You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/03/19 20:21:11 UTC

[01/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 070f15bfb -> b3b46e4cc
  refs/pull/76/head e88af5a09 -> 4431562ac
  refs/pull/76/merge 5d7c9e055 -> b2c7905ab (forced update)


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/tests/unit/sample.spec.js
----------------------------------------------------------------------
diff --git a/portal/tests/unit/sample.spec.js b/portal/tests/unit/sample.spec.js
index afe95ab..1e2c540 100644
--- a/portal/tests/unit/sample.spec.js
+++ b/portal/tests/unit/sample.spec.js
@@ -33,7 +33,8 @@ describe('PageCtrl', function(){
         '$routeParams':{},
         '$q':{},
         '$route':{},
-        '$log':{}
+        '$log':{},
+        '$analytics':{}
       });
     });
   });


[06/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/libs/usergrid.sdk.js
----------------------------------------------------------------------
diff --git a/portal/js/libs/usergrid.sdk.js b/portal/js/libs/usergrid.sdk.js
index 591ad60..78354b1 100755
--- a/portal/js/libs/usergrid.sdk.js
+++ b/portal/js/libs/usergrid.sdk.js
@@ -98,6 +98,10 @@ Usergrid.Client.prototype.request = function (options, callback) {
   if (self.getToken()) {
     qs.access_token = self.getToken();
   }
+  var developerkey=this.get("developerkey");
+  if (developerkey) {
+    qs.developer_key = developerkey;
+  }
   //append params to the path
   var encoded_params = encodeParams(qs);
   if (encoded_params) {
@@ -1010,6 +1014,7 @@ Usergrid.Client.prototype.logout = function () {
   this.set('orgName', null);
   this.set('appName', null);
   this.set('email', null);
+  this.set("developerkey", null);
 }
 
 /*

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/login/forgot-password-controller.js
----------------------------------------------------------------------
diff --git a/portal/js/login/forgot-password-controller.js b/portal/js/login/forgot-password-controller.js
index ece3082..95c7765 100644
--- a/portal/js/login/forgot-password-controller.js
+++ b/portal/js/login/forgot-password-controller.js
@@ -1,6 +1,5 @@
 'use strict'
 
-
 AppServices.Controllers.controller('ForgotPasswordCtrl',
   ['ug',
     '$scope',

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/login/login-controller.js
----------------------------------------------------------------------
diff --git a/portal/js/login/login-controller.js b/portal/js/login/login-controller.js
index 8cb86a0..b253d77 100755
--- a/portal/js/login/login-controller.js
+++ b/portal/js/login/login-controller.js
@@ -5,6 +5,7 @@ AppServices.Controllers.controller('LoginCtrl', ['ug', '$scope', '$rootScope', '
   $scope.loading = false;
   $scope.login = {};
   $scope.activation = {};
+  $scope.requiresDeveloperKey=$scope.options.client.requiresDeveloperKey||false;
   $rootScope.gotoForgotPasswordPage = function(){
     $location.path("/forgot-password");
   };
@@ -32,8 +33,9 @@ AppServices.Controllers.controller('LoginCtrl', ['ug', '$scope', '$rootScope', '
 
   $scope.logout = function() {
     ug.logout();
+    ug.setClientProperty('developerkey', null);
     if($scope.use_sso){
-      window.location = $rootScope.urls().LOGOUT_URL + '?callback=' +  encodeURIComponent($location.absUrl().split('?')[0]);
+      window.location = $rootScope.urls().LOGOUT_URL + '?redirect=no&callback=' +  encodeURIComponent($location.absUrl().split('?')[0]);
     }else{
       $location.path('/login');
       $scope.applyScope();
@@ -45,13 +47,15 @@ AppServices.Controllers.controller('LoginCtrl', ['ug', '$scope', '$rootScope', '
       $location.path('/login');
       $scope.logout();
     }
-
     $scope.applyScope();
   });
 
 
   $scope.$on('loginSuccesful', function(event, user, organizations, applications) {
     $scope.loading = false;
+    if($scope.requiresDeveloperKey){
+      ug.setClientProperty('developerkey', $scope.login.developerkey);
+    }
     $scope.login = {};
 
     //if on login page, send to org overview page.  if on a different page, let them stay there

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/login/login.html
----------------------------------------------------------------------
diff --git a/portal/js/login/login.html b/portal/js/login/login.html
index 458c742..d0286b1 100755
--- a/portal/js/login/login.html
+++ b/portal/js/login/login.html
@@ -26,6 +26,12 @@
         <input type="password" ng-model="login.password"  required id="login-password" class="" ng-value="login.password" size="20" ug-validate>
       </div>
     </div>
+    <div class="control-group" ng-show="requiresDeveloperKey">
+      <label class="control-label" for="login-developerkey">Developer Key:</label>
+      <div class="controls">
+        <input type="text" ng-model="login.developerkey" id="login-developerkey" class="" ng-value="login.developerkey" size="20" ug-validate>
+      </div>
+    </div>
     <div class="form-actions">
       <div class="submit">
         <input type="submit" name="button-login" id="button-login" ng-disabled="!loginForm.$valid || loading" value="{{loading ? loadingText : 'Log In'}}" class="btn btn-primary pull-right">

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/menus/appMenu.html
----------------------------------------------------------------------
diff --git a/portal/js/menus/appMenu.html b/portal/js/menus/appMenu.html
index 93cb1d4..3132bb5 100644
--- a/portal/js/menus/appMenu.html
+++ b/portal/js/menus/appMenu.html
@@ -27,15 +27,14 @@
     <li class="span5">
       <a ng-if="activeUI"
          class="btn btn-create zero-out pull-right"
-         ng-disabled="!addApplications"
-         ng-click="addApplications ? showModal('newApplication') : ''"
+         ng-click="showModal('newApplication')"
          analytics-on="click"
          analytics-category="App Services"
          analytics-label="Button"
          analytics-event="Add New App"
         >
-        <i class="pictogram">{{addApplications ? '&#8862;' : '&#10060;'}}</i>
-        {{!addApplications ? '10 app limit.' : 'Add New App'}}
+        <i class="pictogram">&#8862;</i>
+        Add New App
       </a>
     </li>
 </ul>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/menus/menu-directives.js
----------------------------------------------------------------------
diff --git a/portal/js/menus/menu-directives.js b/portal/js/menus/menu-directives.js
index 805e7cf..72b1a6e 100644
--- a/portal/js/menus/menu-directives.js
+++ b/portal/js/menus/menu-directives.js
@@ -351,7 +351,6 @@ AppServices.Directives.directive('appMenu', ["$location", "$routeParams", "$root
         for (key in applications) {
           if (applications.hasOwnProperty(key)) size++;
         }
-        scope.addApplications = size<10;
         scope.hasApplications = Object.keys(applications).length > 0;
 
         if(!scope.myApp.currentApp){

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/org-overview/org-overview.html
----------------------------------------------------------------------
diff --git a/portal/js/org-overview/org-overview.html b/portal/js/org-overview/org-overview.html
index b64f1de..5e4891d 100644
--- a/portal/js/org-overview/org-overview.html
+++ b/portal/js/org-overview/org-overview.html
@@ -26,8 +26,8 @@
 
     <h2 class="title" > Applications
       <div class="header-button btn-group pull-right">
-        <a class="btn filter-selector" style="{{applicationsSize === 10 ? 'width:290px':''}}"  ng-disabled="!addApplications" ng-click="(addApplications ? showModal('newApplication') : '')">
-          <span class="filter-label">{{!addApplications ? 'You have met your 10 app limit' : 'Add New App'}}</span>
+        <a class="btn filter-selector" style="{{applicationsSize === 10 ? 'width:290px':''}}"  ng-click="showModal('newApplication')">
+          <span class="filter-label">Add New App</span>
         </a>
       </div>
     </h2>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/templates.js
----------------------------------------------------------------------
diff --git a/portal/js/templates.js b/portal/js/templates.js
index ae28dd5..ba8724d 100644
--- a/portal/js/templates.js
+++ b/portal/js/templates.js
@@ -1145,7 +1145,7 @@ angular.module('appservices').run(['$templateCache', function($templateCache) {
     "<section class=\"row-fluid\">\n" +
     "    <div class=\"span12\">\n" +
     "        <div class=\"page-filters\">\n" +
-    "            <h1 class=\"title pull-left\" id=\"pageTitle\"><i class=\"pictogram title\" style=\"padding-right: 5px;\">{{icon}}</i>{{title}} <a class=\"super-help\" href=\"#\" ng-click=\"showHelp()\"  >(need help?)</a></h1>\n" +
+    "            <h1 class=\"title pull-left\" id=\"pageTitle\"><i class=\"pictogram title\" style=\"padding-right: 5px;\">{{icon}}</i>{{title}} <a class=\"super-help\" href=\"http://community.apigee.com/content/apigee-customer-support\" target=\"_blank\"  >(need help?)</a></h1>\n" +
     "        </div>\n" +
     "    </div>\n" +
     "    <bsmodal id=\"need-help\"\n" +
@@ -1610,6 +1610,18 @@ angular.module('appservices').run(['$templateCache', function($templateCache) {
     "\n" +
     "    </div>\r" +
     "\n" +
+    "    <div class=\"control-group\" ng-show=\"requiresDeveloperKey\">\r" +
+    "\n" +
+    "      <label class=\"control-label\" for=\"login-developerkey\">Developer Key:</label>\r" +
+    "\n" +
+    "      <div class=\"controls\">\r" +
+    "\n" +
+    "        <input type=\"text\" ng-model=\"login.developerkey\" id=\"login-developerkey\" class=\"\" ng-value=\"login.developerkey\" size=\"20\" ug-validate>\r" +
+    "\n" +
+    "      </div>\r" +
+    "\n" +
+    "    </div>\r" +
+    "\n" +
     "    <div class=\"form-actions\">\r" +
     "\n" +
     "      <div class=\"submit\">\r" +
@@ -1772,15 +1784,14 @@ angular.module('appservices').run(['$templateCache', function($templateCache) {
     "    <li class=\"span5\">\n" +
     "      <a ng-if=\"activeUI\"\n" +
     "         class=\"btn btn-create zero-out pull-right\"\n" +
-    "         ng-disabled=\"!addApplications\"\n" +
-    "         ng-click=\"addApplications ? showModal('newApplication') : ''\"\n" +
+    "         ng-click=\"showModal('newApplication')\"\n" +
     "         analytics-on=\"click\"\n" +
     "         analytics-category=\"App Services\"\n" +
     "         analytics-label=\"Button\"\n" +
     "         analytics-event=\"Add New App\"\n" +
     "        >\n" +
-    "        <i class=\"pictogram\">{{addApplications ? '&#8862;' : '&#10060;'}}</i>\n" +
-    "        {{!addApplications ? '10 app limit.' : 'Add New App'}}\n" +
+    "        <i class=\"pictogram\">&#8862;</i>\n" +
+    "        Add New App\n" +
     "      </a>\n" +
     "    </li>\n" +
     "</ul>"
@@ -1833,8 +1844,8 @@ angular.module('appservices').run(['$templateCache', function($templateCache) {
     "\n" +
     "    <h2 class=\"title\" > Applications\n" +
     "      <div class=\"header-button btn-group pull-right\">\n" +
-    "        <a class=\"btn filter-selector\" style=\"{{applicationsSize === 10 ? 'width:290px':''}}\"  ng-disabled=\"!addApplications\" ng-click=\"(addApplications ? showModal('newApplication') : '')\">\n" +
-    "          <span class=\"filter-label\">{{!addApplications ? 'You have met your 10 app limit' : 'Add New App'}}</span>\n" +
+    "        <a class=\"btn filter-selector\" style=\"{{applicationsSize === 10 ? 'width:290px':''}}\"  ng-click=\"showModal('newApplication')\">\n" +
+    "          <span class=\"filter-label\">Add New App</span>\n" +
     "        </a>\n" +
     "      </div>\n" +
     "    </h2>\n" +
@@ -2484,6 +2495,37 @@ angular.module('appservices').run(['$templateCache', function($templateCache) {
   );
 
 
+  $templateCache.put('users/users-feed.html',
+    "<div class=\"content-page\" ng-controller=\"UsersFeedCtrl\" >\n" +
+    "\n" +
+    "    <div ng:include=\"'users/users-tabs.html'\"></div>\n" +
+    "    <br>\n" +
+    "    <div>\n" +
+    "        <table class=\"table table-striped\">\n" +
+    "            <tbody>\n" +
+    "            <tr class=\"table-header\">\n" +
+    "                <td>Date</td>\n" +
+    "                <td>User</td>\n" +
+    "                <td>Content</td>\n" +
+    "                <td>Verb</td>\n" +
+    "                <td>UUID</td>\n" +
+    "            </tr>\n" +
+    "            <tr class=\"zebraRows\" ng-repeat=\"activity in activities\">\n" +
+    "                <td>{{activity.createdDate}}</td>\n" +
+    "                <td>{{activity.actor.displayName}}</td>\n" +
+    "                <td>{{activity.content}}</td>\n" +
+    "                <td>{{activity.verb}}</td>\n" +
+    "                <td>{{activity.uuid}}</td>\n" +
+    "            </tr>\n" +
+    "            </tbody>\n" +
+    "        </table>\n" +
+    "    </div>\n" +
+    "\n" +
+    "\n" +
+    "</div>\n"
+  );
+
+
   $templateCache.put('users/users-graph.html',
     "<div class=\"content-page\" ng-controller=\"UsersGraphCtrl\">\n" +
     "\n" +
@@ -2950,6 +2992,7 @@ angular.module('appservices').run(['$templateCache', function($templateCache) {
     "          <li class=\"tab\" ng-class=\"currentUsersPage.route === '/users/profile' ? 'selected' : ''\"><a class=\"btn btn-primary toolbar\" ng-click=\"selectUserPage('/users/profile')\"><i class=\"pictogram\">&#59170;</i>Profile</a></li>\n" +
     "          <li class=\"tab\" ng-class=\"currentUsersPage.route === '/users/groups' ? 'selected' : ''\"><a class=\"btn btn-primary toolbar\" ng-click=\"selectUserPage('/users/groups')\"><i class=\"pictogram\">&#128101;</i>Groups</a></li>\n" +
     "          <li class=\"tab\" ng-class=\"currentUsersPage.route === '/users/activities' ? 'selected' : ''\"><a class=\"btn btn-primary toolbar\" ng-click=\"selectUserPage('/users/activities')\"><i class=\"pictogram\">&#59194;</i>Activities</a></li>\n" +
+    "          <li class=\"tab\" ng-class=\"currentUsersPage.route === '/users/feed' ? 'selected' : ''\"><a class=\"btn btn-primary toolbar\" ng-click=\"selectUserPage('/users/feed')\"><i class=\"pictogram\">&#128196;</i>Feed</a></li>\n" +
     "          <li class=\"tab\" ng-class=\"currentUsersPage.route === '/users/graph' ? 'selected' : ''\"><a class=\"btn btn-primary toolbar\" ng-click=\"selectUserPage('/users/graph')\"><i class=\"pictogram\">&#9729;</i>Graph</a></li>\n" +
     "          <li class=\"tab\" ng-class=\"currentUsersPage.route === '/users/roles' ? 'selected' : ''\"><a class=\"btn btn-primary toolbar\" ng-click=\"selectUserPage('/users/roles')\"><i class=\"pictogram\">&#127758;</i>Roles &amp; Permissions</a></li>\n" +
     "        </ul>\n" +


[45/55] [abbrv] rebuilding artifacts after merge

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/13ab2bd2/sdks/html5-javascript/usergrid.min.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/usergrid.min.js b/sdks/html5-javascript/usergrid.min.js
index 4edec05..13b9848 100644
--- a/sdks/html5-javascript/usergrid.min.js
+++ b/sdks/html5-javascript/usergrid.min.js
@@ -1,3 +1,3 @@
-/*! usergrid@0.10.8 2014-03-05 */
-function extend(subClass,superClass){var F=function(){};return F.prototype=superClass.prototype,subClass.prototype=new F,subClass.prototype.constructor=subClass,subClass.superclass=superClass.prototype,superClass.prototype.constructor==Object.prototype.constructor&&(superClass.prototype.constructor=superClass),subClass}function NOOP(){}function isValidUrl(url){if(!url)return!1;var doc,base,anchor,isValid=!1;try{doc=document.implementation.createHTMLDocument(""),base=doc.createElement("base"),base.href=base||window.lo,doc.head.appendChild(base),anchor=doc.createElement("a"),anchor.href=url,doc.body.appendChild(anchor),isValid=!(""===anchor.href)}catch(e){console.error(e)}finally{return doc.head.removeChild(base),doc.body.removeChild(anchor),base=null,anchor=null,doc=null,isValid}}function isUUID(uuid){return uuid?uuidValueRegex.test(uuid):!1}function encodeParams(params){var queryString;return params&&Object.keys(params)&&(queryString=[].slice.call(arguments).reduce(function(a,b){ret
 urn a.concat(b instanceof Array?b:[b])},[]).filter(function(c){return"object"==typeof c}).reduce(function(p,c){return c instanceof Array?p.push(c):p=p.concat(Object.keys(c).map(function(key){return[key,c[key]]})),p},[]).reduce(function(p,c){return 2===c.length?p.push(c):p=p.concat(c),p},[]).reduce(function(p,c){return c[1]instanceof Array?c[1].forEach(function(v){p.push([c[0],v])}):p.push(c),p},[]).map(function(c){return c[1]=encodeURIComponent(c[1]),c.join("=")}).join("&")),queryString}function isFunction(f){return f&&null!==f&&"function"==typeof f}function doCallback(callback,params,context){var returnValue;return isFunction(callback)&&(params||(params=[]),context||(context=this),params.push(context),returnValue=callback.apply(context,params)),returnValue}var UsergridEventable=function(){throw Error("'UsergridEventable' is not intended to be invoked directly")};UsergridEventable.prototype={bind:function(event,fn){this._events=this._events||{},this._events[event]=this._events[event
 ]||[],this._events[event].push(fn)},unbind:function(event,fn){this._events=this._events||{},event in this._events!=!1&&this._events[event].splice(this._events[event].indexOf(fn),1)},trigger:function(event){if(this._events=this._events||{},event in this._events!=!1)for(var i=0;i<this._events[event].length;i++)this._events[event][i].apply(this,Array.prototype.slice.call(arguments,1))}},UsergridEventable.mixin=function(destObject){for(var props=["bind","unbind","trigger"],i=0;i<props.length;i++)props[i]in destObject.prototype&&(console.warn("overwriting '"+props[i]+"' on '"+destObject.name+"'."),console.warn("the previous version can be found at '_"+props[i]+"' on '"+destObject.name+"'."),destObject.prototype["_"+props[i]]=destObject.prototype[props[i]]),destObject.prototype[props[i]]=UsergridEventable.prototype[props[i]]},function(){function Logger(name){this.logEnabled=!0,this.init(name,!0)}var name="Logger",global=this,overwrittenName=global[name];return Logger.METHODS=["log","error
 ","warn","info","debug","assert","clear","count","dir","dirxml","exception","group","groupCollapsed","groupEnd","profile","profileEnd","table","time","timeEnd","trace"],Logger.prototype.init=function(name,logEnabled){this.name=name||"UNKNOWN",this.logEnabled=logEnabled||!0;var addMethod=function(method){this[method]=this.createLogMethod(method)}.bind(this);Logger.METHODS.forEach(addMethod)},Logger.prototype.createLogMethod=function(method){return Logger.prototype.log.bind(this,method)},Logger.prototype.prefix=function(method,args){var prepend="["+method.toUpperCase()+"]["+name+"]:	";return-1!==["log","error","warn","info"].indexOf(method)&&("string"==typeof args[0]?args[0]=prepend+args[0]:args.unshift(prepend)),args},Logger.prototype.log=function(){var args=[].slice.call(arguments);method=args.shift(),-1===Logger.METHODS.indexOf(method)&&(method="log"),this.logEnabled&&console&&console[method]&&(args=this.prefix(method,args),console[method].apply(console,args))},Logger.prototype.set
 LogEnabled=function(logEnabled){this.logEnabled=logEnabled||!0},Logger.mixin=function(destObject){destObject.__logger=new Logger(destObject.name||"UNKNOWN");var addMethod=function(method){method in destObject.prototype&&(console.warn("overwriting '"+method+"' on '"+destObject.name+"'."),console.warn("the previous version can be found at '_"+method+"' on '"+destObject.name+"'."),destObject.prototype["_"+method]=destObject.prototype[method]),destObject.prototype[method]=destObject.__logger.createLogMethod(method)};Logger.METHODS.forEach(addMethod)},global[name]=Logger,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),Logger},global[name]}(),function(global){function Promise(){this.complete=!1,this.error=null,this.result=null,this.callbacks=[]}var name="Promise",overwrittenName=global[name];return Promise.prototype.create=function(){return new Promise},Promise.prototype.then=function(callback,context){var f=function(){return callback.apply(contex
 t,arguments)};this.complete?f(this.error,this.result):this.callbacks.push(f)},Promise.prototype.done=function(error,result){if(this.complete=!0,this.error=error,this.result=result,this.callbacks){for(var i=0;i<this.callbacks.length;i++)this.callbacks[i](error,result);this.callbacks.length=0}},Promise.join=function(promises){function notifier(i){return function(error,result){completed+=1,errors[i]=error,results[i]=result,completed===total&&p.done(errors,results)}}for(var p=new Promise,total=promises.length,completed=0,errors=[],results=[],i=0;total>i;i++)promises[i]().then(notifier(i));return p},Promise.chain=function(promises,error,result){var p=new Promise;return null===promises||0===promises.length?p.done(error,result):promises[0](error,result).then(function(res,err){promises.splice(0,1),promises?Promise.chain(promises,res,err).then(function(r,e){p.done(r,e)}):p.done(res,err)}),p},global[name]=Promise,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwri
 ttenName),Promise},global[name]}(this),function(){function partial(){var args=Array.prototype.slice.call(arguments),fn=args.shift();return fn.bind(this,args)}function Ajax(){function encode(data){var result="";if("string"==typeof data)result=data;else{var e=encodeURIComponent;for(var i in data)data.hasOwnProperty(i)&&(result+="&"+e(i)+"="+e(data[i]))}return result}function request(m,u,d){var timeout,p=new Promise;return self.logger.time(m+" "+u),function(xhr){xhr.onreadystatechange=function(){4^this.readyState||(self.logger.timeEnd(m+" "+u),clearTimeout(timeout),p.done(null,this))},xhr.onerror=function(response){clearTimeout(timeout),p.done(response,null)},xhr.oncomplete=function(){clearTimeout(timeout),self.logger.timeEnd(m+" "+u),self.info("%s request to %s returned %s",m,u,this.status)},xhr.open(m,u),d&&("object"==typeof d&&(d=JSON.stringify(d)),xhr.setRequestHeader("Content-Type","application/json"),xhr.setRequestHeader("Accept","application/json")),timeout=setTimeout(function()
 {xhr.abort(),p.done("API Call timed out.",null)},3e4),xhr.send(encode(d))}(new XMLHttpRequest),p}this.logger=new global.Logger(name);var self=this;this.request=request,this.get=partial(request,"GET"),this.post=partial(request,"POST"),this.put=partial(request,"PUT"),this.delete=partial(request,"DELETE")}var exports,name="Ajax",global=this,overwrittenName=global[name];return global[name]=new Ajax,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),exports},global[name]}(),window.console=window.console||{},window.console.log=window.console.log||function(){};var uuidValueRegex=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;!function(global){function Usergrid(){this.logger=new Logger(name)}var name="Usergrid",overwrittenName=global[name];Usergrid.isValidEndpoint=function(){return!0};var VALID_REQUEST_METHODS=["GET","POST","PUT","DELETE"];return Usergrid.Request=function(method,endpoint,query_params,data,callback){var 
 p=new Promise;if(this.logger=new global.Logger("Usergrid.Request"),this.logger.time("process request "+method+" "+endpoint),this.endpoint=endpoint+"?"+encodeParams(query_params),this.method=method.toUpperCase(),this.data="object"==typeof data?JSON.stringify(data):data,-1===VALID_REQUEST_METHODS.indexOf(this.method))throw new UsergridInvalidHTTPMethodError("invalid request method '"+this.method+"'");if(!isValidUrl(this.endpoint))throw this.logger.error(endpoint,this.endpoint,/^https:\/\//.test(endpoint)),new UsergridInvalidURIError("The provided endpoint is not valid: "+this.endpoint);var request=function(){return Ajax.request(this.method,this.endpoint,this.data)}.bind(this),response=function(err,request){return new Usergrid.Response(err,request)}.bind(this),oncomplete=function(err,response){p.done(err,response),this.logger.info("REQUEST",err,response),doCallback(callback,[err,response]),this.logger.timeEnd("process request "+method+" "+endpoint)}.bind(this);return Promise.chain([req
 uest,response]).then(oncomplete),p},Usergrid.Response=function(err,response){var p=new Promise,data=null;try{data=JSON.parse(response.responseText)}catch(e){data={}}switch(Object.keys(data).forEach(function(key){Object.defineProperty(this,key,{value:data[key],enumerable:!0})}.bind(this)),Object.defineProperty(this,"logger",{enumerable:!1,configurable:!1,writable:!1,value:new global.Logger(name)}),Object.defineProperty(this,"success",{enumerable:!1,configurable:!1,writable:!0,value:!0}),Object.defineProperty(this,"err",{enumerable:!1,configurable:!1,writable:!0,value:err}),Object.defineProperty(this,"status",{enumerable:!1,configurable:!1,writable:!0,value:parseInt(response.status)}),Object.defineProperty(this,"statusGroup",{enumerable:!1,configurable:!1,writable:!0,value:this.status-this.status%100}),this.statusGroup){case 200:this.success=!0;break;case 400:case 500:case 300:case 100:default:this.success=!1}return this.success?p.done(null,this):p.done(UsergridError.fromResponse(data
 ),this),p},Usergrid.Response.prototype.getEntities=function(){var entities=[];return this.success&&(entities=this.data?this.data.entities:this.entities),entities},Usergrid.Response.prototype.getEntity=function(){var entities=this.getEntities();return entities[0]},Usergrid.VERSION=Usergrid.USERGRID_SDK_VERSION="0.10.08",global[name]=Usergrid,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),Usergrid},global[name]}(this),function(){var exports,name="Client",global=this,overwrittenName=global[name];return Usergrid.Client=function(options){this.URI=options.URI||"https://api.usergrid.com",options.orgName&&this.set("orgName",options.orgName),options.appName&&this.set("appName",options.appName),this.buildCurl=options.buildCurl||!1,this.logging=options.logging||!1,this._callTimeout=options.callTimeout||3e4,this._callTimeoutCallback=options.callTimeoutCallback||null,this.logoutCallback=options.logoutCallback||null},Usergrid.Client.prototype.request=fun
 ction(options,callback){var uri,method=options.method||"GET",endpoint=options.endpoint,body=options.body||{},qs=options.qs||{},mQuery=options.mQuery||!1,orgName=this.get("orgName"),appName=this.get("appName"),logoutCallback=function(){return"function"==typeof this.logoutCallback?this.logoutCallback(!0,"no_org_or_app_name_specified"):void 0}.bind(this);if(!mQuery&&!orgName&&!appName)return logoutCallback();uri=mQuery?this.URI+"/"+endpoint:this.URI+"/"+orgName+"/"+appName+"/"+endpoint,this.getToken()&&(qs.access_token=this.getToken());new Usergrid.Request(method,uri,qs,body,function(err,response){return-1!==["auth_expired_session_token","auth_missing_credentials","auth_unverified_oath","expired_token","unauthorized","auth_invalid"].indexOf(response.error)?logoutCallback():void doCallback(callback,[err,response])})},Usergrid.Client.prototype.buildAssetURL=function(uuid){var self=this,qs={},assetURL=this.URI+"/"+this.orgName+"/"+this.appName+"/assets/"+uuid+"/data";self.getToken()&&(qs.
 access_token=self.getToken());var encoded_params=encodeParams(qs);return encoded_params&&(assetURL+="?"+encoded_params),assetURL},Usergrid.Client.prototype.createGroup=function(options,callback){var getOnExist=options.getOnExist||!1;options={path:options.path,client:this,data:options};var group=new Usergrid.Group(options);group.fetch(function(err,data){var okToSave=err&&-1!==["service_resource_not_found","no_name_specified","null_pointer"].indexOf(err.name)||!err&&getOnExist;okToSave?group.save(function(err,data){doCallback(callback,[err,group,data])}):doCallback(callback,[null,group,data])})},Usergrid.Client.prototype.createEntity=function(options,callback){var getOnExist=options.getOnExist||!1;delete options.getOnExist;var entity_data={client:this,data:options},entity=new Usergrid.Entity(entity_data);entity.fetch(function(err,data){var common_errors=["service_resource_not_found","no_name_specified","null_pointer"],okToSave=!err&&getOnExist||err&&err.name&&-1!==common_errors.indexO
 f(err.name);okToSave?(entity.set(entity_data.data),entity.save(function(err,data){doCallback(callback,[err,entity,data])})):doCallback(callback,[null,entity,data])})},Usergrid.Client.prototype.getEntity=function(options,callback){var options={client:this,data:options},entity=new Usergrid.Entity(options);entity.fetch(function(err,data){doCallback(callback,[err,entity,data])})},Usergrid.Client.prototype.restoreEntity=function(serializedObject){var data=JSON.parse(serializedObject),options={client:this,data:data},entity=new Usergrid.Entity(options);return entity},Usergrid.Client.prototype.createCollection=function(options,callback){options.client=this;var collection=new Usergrid.Collection(options,function(err,data){doCallback(callback,[err,collection,data])})},Usergrid.Client.prototype.restoreCollection=function(serializedObject){var data=JSON.parse(serializedObject);data.client=this;var collection=new Usergrid.Collection(data);return collection},Usergrid.Client.prototype.getFeedForUs
 er=function(username,callback){var options={method:"GET",endpoint:"users/"+username+"/feed"};this.request(options,function(err,data){err?doCallback(callback,[err]):doCallback(callback,[err,data,data.getEntities()])})},Usergrid.Client.prototype.createUserActivity=function(user,options,callback){options.type="users/"+user+"/activities";var options={client:this,data:options},entity=new Usergrid.Entity(options);entity.save(function(err){doCallback(callback,[err,entity])})},Usergrid.Client.prototype.createUserActivityWithEntity=function(user,content,callback){var username=user.get("username"),options={actor:{displayName:username,uuid:user.get("uuid"),username:username,email:user.get("email"),picture:user.get("picture"),image:{duration:0,height:80,url:user.get("picture"),width:80}},verb:"post",content:content};this.createUserActivity(username,options,callback)},Usergrid.Client.prototype.calcTimeDiff=function(){var seconds=0,time=this._end-this._start;try{seconds=(time/10/60).toFixed(2)}ca
 tch(e){return 0}return seconds},Usergrid.Client.prototype.setToken=function(token){this.set("token",token)},Usergrid.Client.prototype.getToken=function(){return this.get("token")},Usergrid.Client.prototype.setObject=function(key,value){value&&(value=JSON.stringify(value)),this.set(key,value)},Usergrid.Client.prototype.set=function(key,value){var keyStore="apigee_"+key;this[key]=value,"undefined"!=typeof Storage&&(value?localStorage.setItem(keyStore,value):localStorage.removeItem(keyStore))},Usergrid.Client.prototype.getObject=function(key){return JSON.parse(this.get(key))},Usergrid.Client.prototype.get=function(key){var keyStore="apigee_"+key,value=null;return this[key]?value=this[key]:"undefined"!=typeof Storage&&(value=localStorage.getItem(keyStore)),value},Usergrid.Client.prototype.signup=function(username,password,email,name,callback){var options={type:"users",username:username,password:password,email:email,name:name};this.createEntity(options,callback)},Usergrid.Client.prototyp
 e.login=function(username,password,callback){var self=this,options={method:"POST",endpoint:"token",body:{username:username,password:password,grant_type:"password"}};self.request(options,function(err,data){var user={};if(err)self.logging&&console.log("error trying to log user in");else{var options={client:self,data:data.user};user=new Usergrid.Entity(options),self.setToken(data.access_token)}doCallback(callback,[err,data,user])})},Usergrid.Client.prototype.reAuthenticateLite=function(callback){var self=this,options={method:"GET",endpoint:"management/me",mQuery:!0};this.request(options,function(err,response){err&&self.logging?console.log("error trying to re-authenticate user"):self.setToken(response.data.access_token),doCallback(callback,[err])})},Usergrid.Client.prototype.reAuthenticate=function(email,callback){var self=this,options={method:"GET",endpoint:"management/users/"+email,mQuery:!0};this.request(options,function(err,response){var data,organizations={},applications={},user={}
 ;if(err&&self.logging)console.log("error trying to full authenticate user");else{data=response.data,self.setToken(data.token),self.set("email",data.email),localStorage.setItem("accessToken",data.token),localStorage.setItem("userUUID",data.uuid),localStorage.setItem("userEmail",data.email);var userData={username:data.username,email:data.email,name:data.name,uuid:data.uuid},options={client:self,data:userData};user=new Usergrid.Entity(options),organizations=data.organizations;var org="";try{var existingOrg=self.get("orgName");org=organizations[existingOrg]?organizations[existingOrg]:organizations[Object.keys(organizations)[0]],self.set("orgName",org.name)}catch(e){err=!0,self.logging&&console.log("error selecting org")}applications=self.parseApplicationsArray(org),self.selectFirstApp(applications),self.setObject("organizations",organizations),self.setObject("applications",applications)}doCallback(callback,[err,data,user,organizations,applications],self)})},Usergrid.Client.prototype.log
 inFacebook=function(facebookToken,callback){var self=this,options={method:"GET",endpoint:"auth/facebook",qs:{fb_access_token:facebookToken}};this.request(options,function(err,data){var user={};if(err&&self.logging)console.log("error trying to log user in");else{var options={client:self,data:data.user};user=new Usergrid.Entity(options),self.setToken(data.access_token)}doCallback(callback,[err,data,user],self)})},Usergrid.Client.prototype.getLoggedInUser=function(callback){if(this.getToken()){var self=this,options={method:"GET",endpoint:"users/me"};this.request(options,function(err,data){if(err)self.logging&&console.log("error trying to log user in"),doCallback(callback,[err,data,null],self);else{var options={client:self,data:data.entities[0]},user=new Usergrid.Entity(options);doCallback(callback,[null,data,user],self)}})}else callback(!0,null,null)},Usergrid.Client.prototype.isLoggedIn=function(){var token=this.getToken();return"undefined"!=typeof token&&null!==token},Usergrid.Client
 .prototype.logout=function(){this.setToken()},Usergrid.Client.prototype.buildCurlCall=function(options){var curl=["curl"],method=(options.method||"GET").toUpperCase(),body=options.body,uri=options.uri;return curl.push("-X"),curl.push(["POST","PUT","DELETE"].indexOf(method)>=0?method:"GET"),curl.push(uri),"object"==typeof body&&Object.keys(body).length>0&&-1!==["POST","PUT"].indexOf(method)&&(curl.push("-d"),curl.push("'"+JSON.stringify(body)+"'")),curl=curl.join(" "),console.log(curl),curl},Usergrid.Client.prototype.getDisplayImage=function(email,picture,size){size=size||50;var image="https://apigee.com/usergrid/images/user_profile.png";try{picture?image=picture:email.length&&(image="https://secure.gravatar.com/avatar/"+MD5(email)+"?s="+size+encodeURI("&d=https://apigee.com/usergrid/images/user_profile.png"))}catch(e){}finally{return image}},global[name]=Usergrid.Client,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),exports},global[name]}()
 ;var ENTITY_SYSTEM_PROPERTIES=["metadata","created","modified","oldpassword","newpassword","type","activated","uuid"];Usergrid.Entity=function(options){options&&(this._data=options.data||{},this._client=options.client||{})},Usergrid.Entity.isEntity=function(obj){return obj&&obj instanceof Usergrid.Entity},Usergrid.Entity.isPersistedEntity=function(obj){return isEntity(obj)&&isUUID(obj.get("uuid"))},Usergrid.Entity.prototype.serialize=function(){return JSON.stringify(this._data)},Usergrid.Entity.prototype.get=function(key){var value;if(0===arguments.length?value=this._data:arguments.length>1&&(key=[].slice.call(arguments).reduce(function(p,c){return c instanceof Array?p=p.concat(c):p.push(c),p},[])),key instanceof Array){var self=this;value=key.map(function(k){return self.get(k)})}else"undefined"!=typeof key&&(value=this._data[key]);return value},Usergrid.Entity.prototype.set=function(key,value){if("object"==typeof key)for(var field in key)this._data[field]=key[field];else"string"==t
 ypeof key?null===value?delete this._data[key]:this._data[key]=value:this._data={}},Usergrid.Entity.prototype.getEndpoint=function(){var name,type=this.get("type"),nameProperties=["uuid","name"];if(void 0===type)throw new UsergridError("cannot fetch entity, no entity type specified","no_type_specified");("users"===type||"user"===type)&&nameProperties.unshift("username");var names=this.get(nameProperties).filter(function(x){return null!=x&&"undefined"!=typeof x});return 0===names.length?type:(name=names.shift(),[type,name].join("/"))},Usergrid.Entity.prototype.save=function(callback){var self=this,type=this.get("type"),method="POST",entityId=this.get("uuid"),data={},entityData=this.get(),password=this.get("password"),oldpassword=this.get("oldpassword"),newpassword=this.get("newpassword"),options={method:method,endpoint:type};entityId&&(options.method="PUT",options.endpoint+="/"+entityId),Object.keys(entityData).filter(function(key){return-1===ENTITY_SYSTEM_PROPERTIES.indexOf(key)}).fo
 rEach(function(key){data[key]=entityData[key]}),options.body=data,this._client.request(options,function(err,response){var entity=response.getEntity();if(entity&&(self.set(entity),self.set("type",/^\//.test(response.path)?response.path.substring(1):response.path)),self.set("password",null),self.set("oldpassword",null),self.set("newpassword",null),err&&self._client.logging)console.log("could not save entity"),doCallback(callback,[err,response,self]);else if(/^users?/.test(self.get("type"))&&oldpassword&&newpassword){var options={method:"PUT",endpoint:type+"/"+self.get("uuid")+"/password",body:{uuid:self.get("uuid"),username:self.get("username"),password:password,oldpassword:oldpassword,newpassword:newpassword}};self._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not update user"),self.set({password:null,oldpassword:null,newpassword:null}),doCallback(callback,[err,data,self])})}else doCallback(callback,[err,response,self])})},Usergrid.Entity.pr
 ototype.fetch=function(callback){var endpoint,self=this;endpoint=this.getEndpoint();var options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,response){var entity=response.getEntity();entity&&self.set(entity),doCallback(callback,[err,entity,self])})},Usergrid.Entity.prototype.destroy=function(callback){var self=this,endpoint=this.getEndpoint(),options={method:"DELETE",endpoint:endpoint};this._client.request(options,function(err,data){err||self.set(null),doCallback(callback,[err,data])})},Usergrid.Entity.prototype.connect=function(connection,entity,callback){var error,self=this,connecteeType=entity.get("type"),connectee=this.getEntityId(entity);if(!connectee)return void("function"==typeof callback&&(error="Error trying to delete object - no uuid specified.",self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)));var connectorType=this.get("type"),connector=this.getEntityId(this);if(!connector)return void("function"==typeof callback
 &&(error="Error in connect - no uuid specified.",self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)));var endpoint=connectorType+"/"+connector+"/"+connection+"/"+connecteeType+"/"+connectee,options={method:"POST",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be connected"),doCallback(callback,[err,data],self)})},Usergrid.Entity.prototype.getEntityId=function(entity){var id=!1;return isUUID(entity.get("uuid"))?id=entity.get("uuid"):"users"===this.get("type")?id=entity.get("username"):entity.get("name")&&(id=entity.get("name")),id},Usergrid.Entity.prototype.getConnections=function(connection,callback){var self=this,connectorType=this.get("type"),connector=this.getEntityId(this);if(connector){var endpoint=connectorType+"/"+connector+"/"+connection+"/",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("enti
 ty could not be connected"),self[connection]={};for(var length=data&&data.entities?data.entities.length:0,i=0;length>i;i++)"user"===data.entities[i].type?self[connection][data.entities[i].username]=data.entities[i]:self[connection][data.entities[i].name]=data.entities[i];doCallback(callback,[err,data,data.entities],self)})}else if("function"==typeof callback){var error="Error in getConnections - no uuid specified.";self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)}},Usergrid.Entity.prototype.getGroups=function(callback){var self=this,endpoint="users/"+this.get("uuid")+"/groups",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be connected"),self.groups=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getActivities=function(callback){var self=this,endpoint=this.get("type")+"/"+this.get("uuid")+"/activities",options={
 method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be connected");for(var entity in data.entities)data.entities[entity].createdDate=new Date(data.entities[entity].created).toUTCString();self.activities=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getFollowing=function(callback){var self=this,endpoint="users/"+this.get("uuid")+"/following",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user following");for(var entity in data.entities){data.entities[entity].createdDate=new Date(data.entities[entity].created).toUTCString();var image=self._client.getDisplayImage(data.entities[entity].email,data.entities[entity].picture);data.entities[entity]._portal_image_icon=image}self.following=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Ent
 ity.prototype.getFollowers=function(callback){var self=this,endpoint="users/"+this.get("uuid")+"/followers",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user followers");for(var entity in data.entities){data.entities[entity].createdDate=new Date(data.entities[entity].created).toUTCString();var image=self._client.getDisplayImage(data.entities[entity].email,data.entities[entity].picture);data.entities[entity]._portal_image_icon=image}self.followers=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getRoles=function(callback){var self=this,endpoint=this.get("type")+"/"+this.get("uuid")+"/roles",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user roles"),self.roles=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.proto
 type.getPermissions=function(callback){var self=this,endpoint=this.get("type")+"/"+this.get("uuid")+"/permissions",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user permissions");var permissions=[];if(data.data){var perms=data.data,count=0;for(var i in perms){count++;var perm=perms[i],parts=perm.split(":"),ops_part="",path_part=parts[0];parts.length>1&&(ops_part=parts[0],path_part=parts[1]),ops_part.replace("*","get,post,put,delete");var ops=ops_part.split(","),ops_object={};ops_object.get="no",ops_object.post="no",ops_object.put="no",ops_object.delete="no";for(var j in ops)ops_object[ops[j]]="yes";permissions.push({operations:ops_object,path:path_part,perm:perm})}}self.permissions=permissions,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.disconnect=function(connection,entity,callback){var error,self=this,connecteeType=entity.get("type"),connectee=this.
 getEntityId(entity);if(!connectee)return void("function"==typeof callback&&(error="Error trying to delete object - no uuid specified.",self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)));var connectorType=this.get("type"),connector=this.getEntityId(this);if(!connector)return void("function"==typeof callback&&(error="Error in connect - no uuid specified.",self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)));var endpoint=connectorType+"/"+connector+"/"+connection+"/"+connecteeType+"/"+connectee,options={method:"DELETE",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be disconnected"),doCallback(callback,[err,data],self)})},Usergrid.Collection=function(options,callback){if(options&&(this._client=options.client,this._type=options.type,this.qs=options.qs||{},this._list=options.list||[],this._iterator=options.iterator||-1,this._previous=options.previous||[],th
 is._next=options.next||null,this._cursor=options.cursor||null,options.list))for(var count=options.list.length,i=0;count>i;i++){var entity=this._client.restoreEntity(options.list[i]);this._list[i]=entity}callback&&this.fetch(callback)},Usergrid.isCollection=function(obj){return obj&&obj instanceof Usergrid.Collection},Usergrid.Collection.prototype.serialize=function(){var data={};data.type=this._type,data.qs=this.qs,data.iterator=this._iterator,data.previous=this._previous,data.next=this._next,data.cursor=this._cursor,this.resetEntityPointer();var i=0;for(data.list=[];this.hasNextEntity();){var entity=this.getNextEntity();data.list[i]=entity.serialize(),i++}return data=JSON.stringify(data)},Usergrid.Collection.prototype.addCollection=function(collectionName,options,callback){self=this,options.client=this._client;var collection=new Usergrid.Collection(options,function(err){if("function"==typeof callback){for(collection.resetEntityPointer();collection.hasNextEntity();){var user=collect
 ion.getNextEntity(),image=(user.get("email"),self._client.getDisplayImage(user.get("email"),user.get("picture")));user._portal_image_icon=image}self[collectionName]=collection,doCallback(callback,[err,collection],self)}})},Usergrid.Collection.prototype.fetch=function(callback){var self=this,qs=this.qs;this._cursor?qs.cursor=this._cursor:delete qs.cursor;var options={method:"GET",endpoint:this._type,qs:this.qs};this._client.request(options,function(err,data){if(err&&self._client.logging)console.log("error getting collection");else{var cursor=data.cursor||null;if(self.saveCursor(cursor),data.entities){self.resetEntityPointer();var count=data.entities.length;self._list=[];for(var i=0;count>i;i++){var uuid=data.entities[i].uuid;if(uuid){var entityData=data.entities[i]||{};self._baseType=data.entities[i].type,entityData.type=self._type;var entityOptions={type:self._type,client:self._client,uuid:uuid,data:entityData},ent=new Usergrid.Entity(entityOptions);ent._json=JSON.stringify(entityDa
 ta,null,2);var ct=self._list.length;self._list[ct]=ent}}}}doCallback(callback,[err,data],self)})},Usergrid.Collection.prototype.addEntity=function(options,callback){var self=this;
-options.type=this._type,this._client.createEntity(options,function(err,entity){if(!err){var count=self._list.length;self._list[count]=entity}doCallback(callback,[err,entity],self)})},Usergrid.Collection.prototype.addExistingEntity=function(entity){var count=this._list.length;this._list[count]=entity},Usergrid.Collection.prototype.destroyEntity=function(entity,callback){var self=this;entity.destroy(function(err,data){err?(self._client.logging&&console.log("could not destroy entity"),doCallback(callback,[err,data],self)):self.fetch(callback)}),this.removeEntity(entity)},Usergrid.Collection.prototype.removeEntity=function(entity){var uuid=entity.get("uuid");for(var key in this._list){var listItem=this._list[key];if(listItem.get("uuid")===uuid)return this._list.splice(key,1)}return!1},Usergrid.Collection.prototype.getEntityByUUID=function(uuid,callback){for(var key in this._list){var listItem=this._list[key];if(listItem.get("uuid")===uuid)return callback(null,listItem)}var options={data
 :{type:this._type,uuid:uuid},client:this._client},entity=new Usergrid.Entity(options);entity.fetch(callback)},Usergrid.Collection.prototype.getFirstEntity=function(){var count=this._list.length;return count>0?this._list[0]:null},Usergrid.Collection.prototype.getLastEntity=function(){var count=this._list.length;return count>0?this._list[count-1]:null},Usergrid.Collection.prototype.hasNextEntity=function(){var next=this._iterator+1,hasNextElement=next>=0&&next<this._list.length;return hasNextElement?!0:!1},Usergrid.Collection.prototype.getNextEntity=function(){this._iterator++;var hasNextElement=this._iterator>=0&&this._iterator<=this._list.length;return hasNextElement?this._list[this._iterator]:!1},Usergrid.Collection.prototype.hasPrevEntity=function(){var previous=this._iterator-1,hasPreviousElement=previous>=0&&previous<this._list.length;return hasPreviousElement?!0:!1},Usergrid.Collection.prototype.getPrevEntity=function(){this._iterator--;var hasPreviousElement=this._iterator>=0&
 &this._iterator<=this._list.length;return hasPreviousElement?this._list[this._iterator]:!1},Usergrid.Collection.prototype.resetEntityPointer=function(){this._iterator=-1},Usergrid.Collection.prototype.saveCursor=function(cursor){this._next!==cursor&&(this._next=cursor)},Usergrid.Collection.prototype.resetPaging=function(){this._previous=[],this._next=null,this._cursor=null},Usergrid.Collection.prototype.hasNextPage=function(){return this._next},Usergrid.Collection.prototype.getNextPage=function(callback){this.hasNextPage()&&(this._previous.push(this._cursor),this._cursor=this._next,this._list=[],this.fetch(callback))},Usergrid.Collection.prototype.hasPreviousPage=function(){return this._previous.length>0},Usergrid.Collection.prototype.getPreviousPage=function(callback){this.hasPreviousPage()&&(this._next=null,this._cursor=this._previous.pop(),this._list=[],this.fetch(callback))},Usergrid.Group=function(options){this._path=options.path,this._list=[],this._client=options.client,this._
 data=options.data||{},this._data.type="groups"},Usergrid.Group.prototype=new Usergrid.Entity,Usergrid.Group.prototype.fetch=function(callback){var self=this,groupEndpoint="groups/"+this._path,memberEndpoint="groups/"+this._path+"/users",groupOptions={method:"GET",endpoint:groupEndpoint},memberOptions={method:"GET",endpoint:memberEndpoint};this._client.request(groupOptions,function(err,data){if(err)self._client.logging&&console.log("error getting group"),doCallback(callback,[err,data],self);else if(data.entities&&data.entities.length){var groupData=data.entities[0];self._data=groupData||{},self._client.request(memberOptions,function(err,data){if(err&&self._client.logging)console.log("error getting group users");else if(data.entities){var count=data.entities.length;self._list=[];for(var i=0;count>i;i++){var uuid=data.entities[i].uuid;if(uuid){var entityData=data.entities[i]||{},entityOptions={type:entityData.type,client:self._client,uuid:uuid,data:entityData},entity=new Usergrid.Entit
 y(entityOptions);self._list.push(entity)}}}doCallback(callback,[err,data,self._list],self)})}})},Usergrid.Group.prototype.members=function(callback){doCallback(callback,[null,this._list],this)},Usergrid.Group.prototype.add=function(options,callback){var self=this,options={method:"POST",endpoint:"groups/"+this._path+"/users/"+options.user.get("username")};this._client.request(options,function(error,data){error?doCallback(callback,[error,data,data.entities],self):self.fetch(callback)})},Usergrid.Group.prototype.remove=function(options,callback){var self=this,options={method:"DELETE",endpoint:"groups/"+this._path+"/users/"+options.user.get("username")};this._client.request(options,function(error,data){error?doCallback(callback,[error,data],self):self.fetch(callback)})},Usergrid.Group.prototype.feed=function(callback){var self=this,endpoint="groups/"+this._path+"/feed",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self.logging&&console.log
 ("error trying to log user in"),doCallback(callback,[err,data,data.entities],self)})},Usergrid.Group.prototype.createGroupActivity=function(options,callback){var user=options.user;options={client:this._client,data:{actor:{displayName:user.get("username"),uuid:user.get("uuid"),username:user.get("username"),email:user.get("email"),picture:user.get("picture"),image:{duration:0,height:80,url:user.get("picture"),width:80}},verb:"post",content:options.content,type:"groups/"+this._path+"/activities"}};var entity=new Usergrid.Entity(options);entity.save(function(err){doCallback(callback,[err,entity])})},Usergrid.Counter=function(options,callback){var self=this;this._client=options.client,this._data=options.data||{},this._data.category=options.category||"UNKNOWN",this._data.timestamp=options.timestamp||0,this._data.type="events",this._data.counters=options.counters||{},doCallback(callback,[!1,self],self)};var COUNTER_RESOLUTIONS=["all","minute","five_minutes","half_hour","hour","six_day","da
 y","week","month"];Usergrid.Counter.prototype=new Usergrid.Entity,Usergrid.Counter.prototype.fetch=function(callback){this.getData({},callback)},Usergrid.Counter.prototype.increment=function(options,callback){var self=this,name=options.name,value=options.value;return name?isNaN(value)?doCallback(callback,[!0,"'value' for increment, decrement must be a number"],self):(self._data.counters[name]=parseInt(value)||1,self.save(callback)):doCallback(callback,[!0,"'name' for increment, decrement must be a number"],self)},Usergrid.Counter.prototype.decrement=function(options,callback){var self=this,name=options.name,value=options.value;self.increment({name:name,value:-(parseInt(value)||1)},callback)},Usergrid.Counter.prototype.reset=function(options,callback){var self=this,name=options.name;self.increment({name:name,value:0},callback)},Usergrid.Counter.prototype.getData=function(options,callback){var start_time,end_time,start=options.start||0,end=options.end||Date.now(),resolution=(options.r
 esolution||"all").toLowerCase(),counters=options.counters||Object.keys(this._data.counters),res=(resolution||"all").toLowerCase();if(-1===COUNTER_RESOLUTIONS.indexOf(res)&&(res="all"),start)switch(typeof start){case"undefined":start_time=0;break;case"number":start_time=start;break;case"string":start_time=isNaN(start)?Date.parse(start):parseInt(start);break;default:start_time=Date.parse(start.toString())}if(end)switch(typeof end){case"undefined":end_time=Date.now();break;case"number":end_time=end;break;case"string":end_time=isNaN(end)?Date.parse(end):parseInt(end);break;default:end_time=Date.parse(end.toString())}var self=this,params=Object.keys(counters).map(function(counter){return["counter",encodeURIComponent(counters[counter])].join("=")});params.push("resolution="+res),params.push("start_time="+String(start_time)),params.push("end_time="+String(end_time));var endpoint="counters?"+params.join("&");this._client.request({endpoint:endpoint},function(err,data){return data.counters&&d
 ata.counters.length&&data.counters.forEach(function(counter){self._data.counters[counter.name]=counter.value||counter.values}),doCallback(callback,[err,data],self)})},Usergrid.Folder=function(options,callback){var self=this;console.log("FOLDER OPTIONS",options),self._client=options.client,self._data=options.data||{},self._data.type="folders";var missingData=["name","owner","path"].some(function(required){return!(required in self._data)});return missingData?doCallback(callback,[!0,new UsergridError("Invalid asset data: 'name', 'owner', and 'path' are required properties.")],self):void self.save(function(err,data){err?doCallback(callback,[!0,new UsergridError(data)],self):(data&&data.entities&&data.entities.length&&self.set(data.entities[0]),doCallback(callback,[!1,self],self))})},Usergrid.Folder.prototype=new Usergrid.Entity,Usergrid.Folder.prototype.fetch=function(callback){var self=this;Usergrid.Entity.prototype.fetch.call(self,function(err,data){console.log("self",self.get()),cons
 ole.log("data",data),err?doCallback(callback,[!0,new UsergridError(data)],self):self.getAssets(function(err,data){err?doCallback(callback,[!0,new UsergridError(data)],self):doCallback(callback,[null,self],self)})})},Usergrid.Folder.prototype.addAsset=function(options,callback){var self=this;if("asset"in options){var asset=null;switch(typeof options.asset){case"object":asset=options.asset,asset instanceof Usergrid.Entity||(asset=new Usergrid.Asset(asset));break;case"string":isUUID(options.asset)&&(asset=new Usergrid.Asset({client:self._client,data:{uuid:options.asset,type:"assets"}}))}asset&&asset instanceof Usergrid.Entity&&asset.fetch(function(err,data){if(err)doCallback(callback,[err,new UsergridError(data)],self);else{var endpoint=["folders",self.get("uuid"),"assets",asset.get("uuid")].join("/"),options={method:"POST",endpoint:endpoint};self._client.request(options,callback)}})}else doCallback(callback,[!0,{error_description:"No asset specified"}],self)},Usergrid.Folder.prototype
 .removeAsset=function(options,callback){var self=this;if("asset"in options){var asset=null;switch(typeof options.asset){case"object":asset=options.asset;break;case"string":isUUID(options.asset)&&(asset=new Usergrid.Asset({client:self._client,data:{uuid:options.asset,type:"assets"}}))}if(asset&&null!==asset){var endpoint=["folders",self.get("uuid"),"assets",asset.get("uuid")].join("/");self._client.request({method:"DELETE",endpoint:endpoint},callback)}}else doCallback(callback,[!0,{error_description:"No asset specified"}],self)},Usergrid.Folder.prototype.getAssets=function(callback){return this.getConnections("assets",callback)},XMLHttpRequest.prototype.sendAsBinary||(XMLHttpRequest.prototype.sendAsBinary=function(sData){for(var nBytes=sData.length,ui8Data=new Uint8Array(nBytes),nIdx=0;nBytes>nIdx;nIdx++)ui8Data[nIdx]=255&sData.charCodeAt(nIdx);this.send(ui8Data)}),Usergrid.Asset=function(options,callback){var self=this;self._client=options.client,self._data=options.data||{},self._da
 ta.type="assets";var missingData=["name","owner","path"].some(function(required){return!(required in self._data)});return missingData?doCallback(callback,[!0,new UsergridError("Invalid asset data: 'name', 'owner', and 'path' are required properties.")],self):void self.save(function(err,data){err?doCallback(callback,[!0,new UsergridError(data)],self):(data&&data.entities&&data.entities.length&&self.set(data.entities[0]),doCallback(callback,[!1,self],self))})},Usergrid.Asset.prototype=new Usergrid.Entity,Usergrid.Asset.prototype.addToFolder=function(options,callback){var self=this;if("folder"in options&&isUUID(options.folder)){Usergrid.Folder({uuid:options.folder},function(err,folder){if(err)return callback.call(self,err,folder);var endpoint=["folders",folder.get("uuid"),"assets",self.get("uuid")].join("/"),options={method:"POST",endpoint:endpoint};this._client.request(options,callback)})}else doCallback(callback,[!0,new UsergridError("folder not specified")],self)},Usergrid.Asset.pro
 totype.upload=function(data,callback){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return doCallback(callback,[!0,new UsergridError("The File APIs are not fully supported by your browser.")],self);var self=this,endpoint=[this._client.URI,this._client.orgName,this._client.appName,"assets",self.get("uuid"),"data"].join("/"),xhr=new XMLHttpRequest;xhr.open("POST",endpoint,!0),xhr.onerror=function(){doCallback(callback,[!0,new UsergridError("The File APIs are not fully supported by your browser.")],self)},xhr.onload=function(){xhr.status>=300?doCallback(callback,[!0,new UsergridError(JSON.parse(xhr.responseText))],self):doCallback(callback,[null,self],self)};var fr=new FileReader;fr.onload=function(){var binary=fr.result;xhr.overrideMimeType("application/octet-stream"),setTimeout(function(){xhr.sendAsBinary(binary)},1e3)},fr.readAsBinaryString(data)},Usergrid.Asset.prototype.download=function(callback){var self=this,endpoint=[this._client.URI,this._client.orgName,t
 his._client.appName,"assets",self.get("uuid"),"data"].join("/"),xhr=new XMLHttpRequest;xhr.open("GET",endpoint,!0),xhr.responseType="blob",xhr.onload=function(){var blob=xhr.response;doCallback(callback,[!1,blob],self)},xhr.onerror=function(err){callback(!0,err),doCallback(callback,[!0,new UsergridError(err)],self)},xhr.send()},function(global){function UsergridError(message,name,timestamp,duration,exception){this.message=message,this.name=name,this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}function UsergridHTTPResponseError(message,name,timestamp,duration,exception){this.message=message,this.name=name,this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}function UsergridInvalidHTTPMethodError(message,name,timestamp,duration,exception){this.message=message,this.name=name,this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}function UsergridInvalidURIError(message,name,times
 tamp,duration,exception){this.message=message,this.name=name,this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}function UsergridKeystoreDatabaseUpgradeNeededError(message,name,timestamp,duration,exception){this.message=message,this.name=name,this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}var short,name="UsergridError",_name=global[name],_short=short&&void 0!==short?global[short]:void 0;return UsergridError.prototype=new Error,UsergridError.prototype.constructor=UsergridError,UsergridError.fromResponse=function(response){return response&&"undefined"!=typeof response?new UsergridError(response.error_description,response.error,response.timestamp,response.duration,response.exception):new UsergridError},UsergridError.createSubClass=function(name){return name in global&&global[name]?global[name]:(global[name]=function(){},global[name].name=name,global[name].prototype=new UsergridError,global[name])},UsergridHTT
 PResponseError.prototype=new UsergridError,UsergridInvalidHTTPMethodError.prototype=new UsergridError,UsergridInvalidURIError.prototype=new UsergridError,UsergridKeystoreDatabaseUpgradeNeededError.prototype=new UsergridError,global.UsergridHTTPResponseError=UsergridHTTPResponseError,global.UsergridInvalidHTTPMethodError=UsergridInvalidHTTPMethodError,global.UsergridInvalidURIError=UsergridInvalidURIError,global.UsergridKeystoreDatabaseUpgradeNeededError=UsergridKeystoreDatabaseUpgradeNeededError,global[name]=UsergridError,void 0!==short&&(global[short]=UsergridError),global[name].noConflict=function(){return _name&&(global[name]=_name),void 0!==short&&(global[short]=_short),UsergridError},global[name]}(this);
\ No newline at end of file
+/*! usergrid@0.10.8 2014-03-13 */
+function extend(subClass,superClass){var F=function(){};return F.prototype=superClass.prototype,subClass.prototype=new F,subClass.prototype.constructor=subClass,subClass.superclass=superClass.prototype,superClass.prototype.constructor==Object.prototype.constructor&&(superClass.prototype.constructor=superClass),subClass}function propCopy(from,to){for(var prop in from)from.hasOwnProperty(prop)&&(to[prop]="object"==typeof from[prop]&&"object"==typeof to[prop]?propCopy(from[prop],to[prop]):from[prop]);return to}function NOOP(){}function isValidUrl(url){if(!url)return!1;var doc,base,anchor,isValid=!1;try{doc=document.implementation.createHTMLDocument(""),base=doc.createElement("base"),base.href=base||window.lo,doc.head.appendChild(base),anchor=doc.createElement("a"),anchor.href=url,doc.body.appendChild(anchor),isValid=!(""===anchor.href)}catch(e){console.error(e)}finally{return doc.head.removeChild(base),doc.body.removeChild(anchor),base=null,anchor=null,doc=null,isValid}}function isUUID
 (uuid){return uuid?uuidValueRegex.test(uuid):!1}function encodeParams(params){var queryString;return params&&Object.keys(params)&&(queryString=[].slice.call(arguments).reduce(function(a,b){return a.concat(b instanceof Array?b:[b])},[]).filter(function(c){return"object"==typeof c}).reduce(function(p,c){return c instanceof Array?p.push(c):p=p.concat(Object.keys(c).map(function(key){return[key,c[key]]})),p},[]).reduce(function(p,c){return 2===c.length?p.push(c):p=p.concat(c),p},[]).reduce(function(p,c){return c[1]instanceof Array?c[1].forEach(function(v){p.push([c[0],v])}):p.push(c),p},[]).map(function(c){return c[1]=encodeURIComponent(c[1]),c.join("=")}).join("&")),queryString}function isFunction(f){return f&&null!==f&&"function"==typeof f}function doCallback(callback,params,context){var returnValue;return isFunction(callback)&&(params||(params=[]),context||(context=this),params.push(context),returnValue=callback.apply(context,params)),returnValue}var UsergridEventable=function(){thro
 w Error("'UsergridEventable' is not intended to be invoked directly")};UsergridEventable.prototype={bind:function(event,fn){this._events=this._events||{},this._events[event]=this._events[event]||[],this._events[event].push(fn)},unbind:function(event,fn){this._events=this._events||{},event in this._events!=!1&&this._events[event].splice(this._events[event].indexOf(fn),1)},trigger:function(event){if(this._events=this._events||{},event in this._events!=!1)for(var i=0;i<this._events[event].length;i++)this._events[event][i].apply(this,Array.prototype.slice.call(arguments,1))}},UsergridEventable.mixin=function(destObject){for(var props=["bind","unbind","trigger"],i=0;i<props.length;i++)props[i]in destObject.prototype&&(console.warn("overwriting '"+props[i]+"' on '"+destObject.name+"'."),console.warn("the previous version can be found at '_"+props[i]+"' on '"+destObject.name+"'."),destObject.prototype["_"+props[i]]=destObject.prototype[props[i]]),destObject.prototype[props[i]]=UsergridEven
 table.prototype[props[i]]},function(){function Logger(name){this.logEnabled=!0,this.init(name,!0)}var name="Logger",global=this,overwrittenName=global[name];return Logger.METHODS=["log","error","warn","info","debug","assert","clear","count","dir","dirxml","exception","group","groupCollapsed","groupEnd","profile","profileEnd","table","time","timeEnd","trace"],Logger.prototype.init=function(name,logEnabled){this.name=name||"UNKNOWN",this.logEnabled=logEnabled||!0;var addMethod=function(method){this[method]=this.createLogMethod(method)}.bind(this);Logger.METHODS.forEach(addMethod)},Logger.prototype.createLogMethod=function(method){return Logger.prototype.log.bind(this,method)},Logger.prototype.prefix=function(method,args){var prepend="["+method.toUpperCase()+"]["+name+"]:	";return-1!==["log","error","warn","info"].indexOf(method)&&("string"==typeof args[0]?args[0]=prepend+args[0]:args.unshift(prepend)),args},Logger.prototype.log=function(){var args=[].slice.call(arguments);method=args.
 shift(),-1===Logger.METHODS.indexOf(method)&&(method="log"),this.logEnabled&&console&&console[method]&&(args=this.prefix(method,args),console[method].apply(console,args))},Logger.prototype.setLogEnabled=function(logEnabled){this.logEnabled=logEnabled||!0},Logger.mixin=function(destObject){destObject.__logger=new Logger(destObject.name||"UNKNOWN");var addMethod=function(method){method in destObject.prototype&&(console.warn("overwriting '"+method+"' on '"+destObject.name+"'."),console.warn("the previous version can be found at '_"+method+"' on '"+destObject.name+"'."),destObject.prototype["_"+method]=destObject.prototype[method]),destObject.prototype[method]=destObject.__logger.createLogMethod(method)};Logger.METHODS.forEach(addMethod)},global[name]=Logger,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),Logger},global[name]}(),function(global){function Promise(){this.complete=!1,this.error=null,this.result=null,this.callbacks=[]}var name="Prom
 ise",overwrittenName=global[name];return Promise.prototype.create=function(){return new Promise},Promise.prototype.then=function(callback,context){var f=function(){return callback.apply(context,arguments)};this.complete?f(this.error,this.result):this.callbacks.push(f)},Promise.prototype.done=function(error,result){if(this.complete=!0,this.error=error,this.result=result,this.callbacks){for(var i=0;i<this.callbacks.length;i++)this.callbacks[i](error,result);this.callbacks.length=0}},Promise.join=function(promises){function notifier(i){return function(error,result){completed+=1,errors[i]=error,results[i]=result,completed===total&&p.done(errors,results)}}for(var p=new Promise,total=promises.length,completed=0,errors=[],results=[],i=0;total>i;i++)promises[i]().then(notifier(i));return p},Promise.chain=function(promises,error,result){var p=new Promise;return null===promises||0===promises.length?p.done(error,result):promises[0](error,result).then(function(res,err){promises.splice(0,1),prom
 ises?Promise.chain(promises,res,err).then(function(r,e){p.done(r,e)}):p.done(res,err)}),p},global[name]=Promise,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),Promise},global[name]}(this),function(){function partial(){var args=Array.prototype.slice.call(arguments),fn=args.shift();return fn.bind(this,args)}function Ajax(){function encode(data){var result="";if("string"==typeof data)result=data;else{var e=encodeURIComponent;for(var i in data)data.hasOwnProperty(i)&&(result+="&"+e(i)+"="+e(data[i]))}return result}function request(m,u,d){var timeout,p=new Promise;return self.logger.time(m+" "+u),function(xhr){xhr.onreadystatechange=function(){4^this.readyState||(self.logger.timeEnd(m+" "+u),clearTimeout(timeout),p.done(null,this))},xhr.onerror=function(response){clearTimeout(timeout),p.done(response,null)},xhr.oncomplete=function(){clearTimeout(timeout),self.logger.timeEnd(m+" "+u),self.info("%s request to %s returned %s",m,u,this.status)},xhr.
 open(m,u),d&&("object"==typeof d&&(d=JSON.stringify(d)),xhr.setRequestHeader("Content-Type","application/json"),xhr.setRequestHeader("Accept","application/json")),timeout=setTimeout(function(){xhr.abort(),p.done("API Call timed out.",null)},3e4),xhr.send(encode(d))}(new XMLHttpRequest),p}this.logger=new global.Logger(name);var self=this;this.request=request,this.get=partial(request,"GET"),this.post=partial(request,"POST"),this.put=partial(request,"PUT"),this.delete=partial(request,"DELETE")}var exports,name="Ajax",global=this,overwrittenName=global[name];return global[name]=new Ajax,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),exports},global[name]}(),window.console=window.console||{},window.console.log=window.console.log||function(){};var uuidValueRegex=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;!function(global){function Usergrid(){this.logger=new Logger(name)}var name="Usergrid",overwrittenName=glob
 al[name];Usergrid.isValidEndpoint=function(){return!0};var VALID_REQUEST_METHODS=["GET","POST","PUT","DELETE"];return Usergrid.Request=function(method,endpoint,query_params,data,callback){var p=new Promise;if(this.logger=new global.Logger("Usergrid.Request"),this.logger.time("process request "+method+" "+endpoint),this.endpoint=endpoint+"?"+encodeParams(query_params),this.method=method.toUpperCase(),this.data="object"==typeof data?JSON.stringify(data):data,-1===VALID_REQUEST_METHODS.indexOf(this.method))throw new UsergridInvalidHTTPMethodError("invalid request method '"+this.method+"'");if(!isValidUrl(this.endpoint))throw this.logger.error(endpoint,this.endpoint,/^https:\/\//.test(endpoint)),new UsergridInvalidURIError("The provided endpoint is not valid: "+this.endpoint);var request=function(){return Ajax.request(this.method,this.endpoint,this.data)}.bind(this),response=function(err,request){return new Usergrid.Response(err,request)}.bind(this),oncomplete=function(err,response){p.d
 one(err,response),this.logger.info("REQUEST",err,response),doCallback(callback,[err,response]),this.logger.timeEnd("process request "+method+" "+endpoint)}.bind(this);return Promise.chain([request,response]).then(oncomplete),p},Usergrid.Response=function(err,response){var p=new Promise,data=null;try{data=JSON.parse(response.responseText)}catch(e){data={}}switch(Object.keys(data).forEach(function(key){Object.defineProperty(this,key,{value:data[key],enumerable:!0})}.bind(this)),Object.defineProperty(this,"logger",{enumerable:!1,configurable:!1,writable:!1,value:new global.Logger(name)}),Object.defineProperty(this,"success",{enumerable:!1,configurable:!1,writable:!0,value:!0}),Object.defineProperty(this,"err",{enumerable:!1,configurable:!1,writable:!0,value:err}),Object.defineProperty(this,"status",{enumerable:!1,configurable:!1,writable:!0,value:parseInt(response.status)}),Object.defineProperty(this,"statusGroup",{enumerable:!1,configurable:!1,writable:!0,value:this.status-this.status
 %100}),this.statusGroup){case 200:this.success=!0;break;case 400:case 500:case 300:case 100:default:this.success=!1}return this.success?p.done(null,this):p.done(UsergridError.fromResponse(data),this),p},Usergrid.Response.prototype.getEntities=function(){var entities=[];return this.success&&(entities=this.data?this.data.entities:this.entities),entities},Usergrid.Response.prototype.getEntity=function(){var entities=this.getEntities();return entities[0]},Usergrid.VERSION=Usergrid.USERGRID_SDK_VERSION="0.10.08",global[name]=Usergrid,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),Usergrid},global[name]}(this),function(){var exports,name="Client",global=this,overwrittenName=global[name];return Usergrid.Client=function(options){this.URI=options.URI||"https://api.usergrid.com",options.orgName&&this.set("orgName",options.orgName),options.appName&&this.set("appName",options.appName),options.qs&&this.setObject("default_qs",options.qs),this.buildCurl=o
 ptions.buildCurl||!1,this.logging=options.logging||!1,this._callTimeout=options.callTimeout||3e4,this._callTimeoutCallback=options.callTimeoutCallback||null,this.logoutCallback=options.logoutCallback||null},Usergrid.Client.prototype.request=function(options,callback){var uri,method=options.method||"GET",endpoint=options.endpoint,body=options.body||{},qs=options.qs||{},mQuery=options.mQuery||!1,orgName=this.get("orgName"),appName=this.get("appName"),default_qs=this.getObject("default_qs"),logoutCallback=function(){return"function"==typeof this.logoutCallback?this.logoutCallback(!0,"no_org_or_app_name_specified"):void 0}.bind(this);if(!mQuery&&!orgName&&!appName)return logoutCallback();uri=mQuery?this.URI+"/"+endpoint:this.URI+"/"+orgName+"/"+appName+"/"+endpoint,this.getToken()&&(qs.access_token=this.getToken()),default_qs&&(qs=propCopy(qs,default_qs));new Usergrid.Request(method,uri,qs,body,function(err,response){return-1!==["auth_expired_session_token","auth_missing_credentials","a
 uth_unverified_oath","expired_token","unauthorized","auth_invalid"].indexOf(response.error)?logoutCallback():void doCallback(callback,[err,response])})},Usergrid.Client.prototype.buildAssetURL=function(uuid){var self=this,qs={},assetURL=this.URI+"/"+this.orgName+"/"+this.appName+"/assets/"+uuid+"/data";self.getToken()&&(qs.access_token=self.getToken());var encoded_params=encodeParams(qs);return encoded_params&&(assetURL+="?"+encoded_params),assetURL},Usergrid.Client.prototype.createGroup=function(options,callback){var getOnExist=options.getOnExist||!1;options={path:options.path,client:this,data:options};var group=new Usergrid.Group(options);group.fetch(function(err,data){var okToSave=err&&-1!==["service_resource_not_found","no_name_specified","null_pointer"].indexOf(err.name)||!err&&getOnExist;okToSave?group.save(function(err,data){doCallback(callback,[err,group,data])}):doCallback(callback,[null,group,data])})},Usergrid.Client.prototype.createEntity=function(options,callback){var g
 etOnExist=options.getOnExist||!1;delete options.getOnExist;var entity_data={client:this,data:options},entity=new Usergrid.Entity(entity_data);entity.fetch(function(err,data){var common_errors=["service_resource_not_found","no_name_specified","null_pointer"],okToSave=!err&&getOnExist||err&&err.name&&-1!==common_errors.indexOf(err.name);okToSave?(entity.set(entity_data.data),entity.save(function(err,data){doCallback(callback,[err,entity,data])})):doCallback(callback,[null,entity,data])})},Usergrid.Client.prototype.getEntity=function(options,callback){var options={client:this,data:options},entity=new Usergrid.Entity(options);entity.fetch(function(err,data){doCallback(callback,[err,entity,data])})},Usergrid.Client.prototype.restoreEntity=function(serializedObject){var data=JSON.parse(serializedObject),options={client:this,data:data},entity=new Usergrid.Entity(options);return entity},Usergrid.Client.prototype.createCollection=function(options,callback){options.client=this,new Usergrid.Co
 llection(options,function(err,data,collection){doCallback(callback,[err,collection,data])})},Usergrid.Client.prototype.restoreCollection=function(serializedObject){var data=JSON.parse(serializedObject);data.client=this;var collection=new Usergrid.Collection(data);return collection},Usergrid.Client.prototype.getFeedForUser=function(username,callback){var options={method:"GET",endpoint:"users/"+username+"/feed"};this.request(options,function(err,data){err?doCallback(callback,[err]):doCallback(callback,[err,data,data.getEntities()])})},Usergrid.Client.prototype.createUserActivity=function(user,options,callback){options.type="users/"+user+"/activities";var options={client:this,data:options},entity=new Usergrid.Entity(options);entity.save(function(err){doCallback(callback,[err,entity])})},Usergrid.Client.prototype.createUserActivityWithEntity=function(user,content,callback){var username=user.get("username"),options={actor:{displayName:username,uuid:user.get("uuid"),username:username,emai
 l:user.get("email"),picture:user.get("picture"),image:{duration:0,height:80,url:user.get("picture"),width:80}},verb:"post",content:content};this.createUserActivity(username,options,callback)},Usergrid.Client.prototype.calcTimeDiff=function(){var seconds=0,time=this._end-this._start;try{seconds=(time/10/60).toFixed(2)}catch(e){return 0}return seconds},Usergrid.Client.prototype.setToken=function(token){this.set("token",token)},Usergrid.Client.prototype.getToken=function(){return this.get("token")},Usergrid.Client.prototype.setObject=function(key,value){value&&(value=JSON.stringify(value)),this.set(key,value)},Usergrid.Client.prototype.set=function(key,value){var keyStore="apigee_"+key;this[key]=value,"undefined"!=typeof Storage&&(value?localStorage.setItem(keyStore,value):localStorage.removeItem(keyStore))},Usergrid.Client.prototype.getObject=function(key){return JSON.parse(this.get(key))},Usergrid.Client.prototype.get=function(key){var keyStore="apigee_"+key,value=null;return this[ke
 y]?value=this[key]:"undefined"!=typeof Storage&&(value=localStorage.getItem(keyStore)),value},Usergrid.Client.prototype.signup=function(username,password,email,name,callback){var options={type:"users",username:username,password:password,email:email,name:name};this.createEntity(options,callback)},Usergrid.Client.prototype.login=function(username,password,callback){var self=this,options={method:"POST",endpoint:"token",body:{username:username,password:password,grant_type:"password"}};self.request(options,function(err,data){var user={};if(err)self.logging&&console.log("error trying to log user in");else{var options={client:self,data:data.user};user=new Usergrid.Entity(options),self.setToken(data.access_token)}doCallback(callback,[err,data,user])})},Usergrid.Client.prototype.reAuthenticateLite=function(callback){var self=this,options={method:"GET",endpoint:"management/me",mQuery:!0};this.request(options,function(err,response){err&&self.logging?console.log("error trying to re-authenticate
  user"):self.setToken(response.data.access_token),doCallback(callback,[err])})},Usergrid.Client.prototype.reAuthenticate=function(email,callback){var self=this,options={method:"GET",endpoint:"management/users/"+email,mQuery:!0};this.request(options,function(err,response){var data,organizations={},applications={},user={};if(err&&self.logging)console.log("error trying to full authenticate user");else{data=response.data,self.setToken(data.token),self.set("email",data.email),localStorage.setItem("accessToken",data.token),localStorage.setItem("userUUID",data.uuid),localStorage.setItem("userEmail",data.email);var userData={username:data.username,email:data.email,name:data.name,uuid:data.uuid},options={client:self,data:userData};user=new Usergrid.Entity(options),organizations=data.organizations;var org="";try{var existingOrg=self.get("orgName");org=organizations[existingOrg]?organizations[existingOrg]:organizations[Object.keys(organizations)[0]],self.set("orgName",org.name)}catch(e){err=!0
 ,self.logging&&console.log("error selecting org")}applications=self.parseApplicationsArray(org),self.selectFirstApp(applications),self.setObject("organizations",organizations),self.setObject("applications",applications)}doCallback(callback,[err,data,user,organizations,applications],self)})},Usergrid.Client.prototype.loginFacebook=function(facebookToken,callback){var self=this,options={method:"GET",endpoint:"auth/facebook",qs:{fb_access_token:facebookToken}};this.request(options,function(err,data){var user={};if(err&&self.logging)console.log("error trying to log user in");else{var options={client:self,data:data.user};user=new Usergrid.Entity(options),self.setToken(data.access_token)}doCallback(callback,[err,data,user],self)})},Usergrid.Client.prototype.getLoggedInUser=function(callback){if(this.getToken()){var self=this,options={method:"GET",endpoint:"users/me"};this.request(options,function(err,data){if(err)self.logging&&console.log("error trying to log user in"),doCallback(callback
 ,[err,data,null],self);else{var options={client:self,data:data.entities[0]},user=new Usergrid.Entity(options);doCallback(callback,[null,data,user],self)}})}else callback(!0,null,null)},Usergrid.Client.prototype.isLoggedIn=function(){var token=this.getToken();return"undefined"!=typeof token&&null!==token},Usergrid.Client.prototype.logout=function(){this.setToken()},Usergrid.Client.prototype.buildCurlCall=function(options){var curl=["curl"],method=(options.method||"GET").toUpperCase(),body=options.body,uri=options.uri;return curl.push("-X"),curl.push(["POST","PUT","DELETE"].indexOf(method)>=0?method:"GET"),curl.push(uri),"object"==typeof body&&Object.keys(body).length>0&&-1!==["POST","PUT"].indexOf(method)&&(curl.push("-d"),curl.push("'"+JSON.stringify(body)+"'")),curl=curl.join(" "),console.log(curl),curl},Usergrid.Client.prototype.getDisplayImage=function(email,picture,size){size=size||50;var image="https://apigee.com/usergrid/images/user_profile.png";try{picture?image=picture:email
 .length&&(image="https://secure.gravatar.com/avatar/"+MD5(email)+"?s="+size+encodeURI("&d=https://apigee.com/usergrid/images/user_profile.png"))}catch(e){}finally{return image}},global[name]=Usergrid.Client,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),exports},global[name]}();var ENTITY_SYSTEM_PROPERTIES=["metadata","created","modified","oldpassword","newpassword","type","activated","uuid"];Usergrid.Entity=function(options){options&&(this._data=options.data||{},this._client=options.client||{})},Usergrid.Entity.isEntity=function(obj){return obj&&obj instanceof Usergrid.Entity},Usergrid.Entity.isPersistedEntity=function(obj){return isEntity(obj)&&isUUID(obj.get("uuid"))},Usergrid.Entity.prototype.serialize=function(){return JSON.stringify(this._data)},Usergrid.Entity.prototype.get=function(key){var value;if(0===arguments.length?value=this._data:arguments.length>1&&(key=[].slice.call(arguments).reduce(function(p,c){return c instanceof Array?
 p=p.concat(c):p.push(c),p},[])),key instanceof Array){var self=this;value=key.map(function(k){return self.get(k)})}else"undefined"!=typeof key&&(value=this._data[key]);return value},Usergrid.Entity.prototype.set=function(key,value){if("object"==typeof key)for(var field in key)this._data[field]=key[field];else"string"==typeof key?null===value?delete this._data[key]:this._data[key]=value:this._data={}},Usergrid.Entity.prototype.getEndpoint=function(){var name,type=this.get("type"),nameProperties=["uuid","name"];if(void 0===type)throw new UsergridError("cannot fetch entity, no entity type specified","no_type_specified");("users"===type||"user"===type)&&nameProperties.unshift("username");var names=this.get(nameProperties).filter(function(x){return null!=x&&"undefined"!=typeof x});return 0===names.length?type:(name=names.shift(),[type,name].join("/"))},Usergrid.Entity.prototype.save=function(callback){var self=this,type=this.get("type"),method="POST",entityId=this.get("uuid"),data={},ent
 ityData=this.get(),password=this.get("password"),oldpassword=this.get("oldpassword"),newpassword=this.get("newpassword"),options={method:method,endpoint:type};entityId&&(options.method="PUT",options.endpoint+="/"+entityId),Object.keys(entityData).filter(function(key){return-1===ENTITY_SYSTEM_PROPERTIES.indexOf(key)}).forEach(function(key){data[key]=entityData[key]}),options.body=data,this._client.request(options,function(err,response){var entity=response.getEntity();if(entity&&(self.set(entity),self.set("type",/^\//.test(response.path)?response.path.substring(1):response.path)),self.set("password",null),self.set("oldpassword",null),self.set("newpassword",null),err&&self._client.logging)console.log("could not save entity"),doCallback(callback,[err,response,self]);else if(/^users?/.test(self.get("type"))&&oldpassword&&newpassword){var options={method:"PUT",endpoint:type+"/"+self.get("uuid")+"/password",body:{uuid:self.get("uuid"),username:self.get("username"),password:password,oldpass
 word:oldpassword,newpassword:newpassword}};self._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not update user"),self.set({password:null,oldpassword:null,newpassword:null}),doCallback(callback,[err,data,self])})}else doCallback(callback,[err,response,self])})},Usergrid.Entity.prototype.fetch=function(callback){var endpoint,self=this;endpoint=this.getEndpoint();var options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,response){var entity=response.getEntity();entity&&self.set(entity),doCallback(callback,[err,entity,self])})},Usergrid.Entity.prototype.destroy=function(callback){var self=this,endpoint=this.getEndpoint(),options={method:"DELETE",endpoint:endpoint};this._client.request(options,function(err,data){err||self.set(null),doCallback(callback,[err,data])})},Usergrid.Entity.prototype.connect=function(connection,entity,callback){var error,self=this,connecteeType=entity.get("type"),connectee=this.getEntityId(ent
 ity);if(!connectee)return void("function"==typeof callback&&(error="Error trying to delete object - no uuid specified.",self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)));var connectorType=this.get("type"),connector=this.getEntityId(this);if(!connector)return void("function"==typeof callback&&(error="Error in connect - no uuid specified.",self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)));var endpoint=connectorType+"/"+connector+"/"+connection+"/"+connecteeType+"/"+connectee,options={method:"POST",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be connected"),doCallback(callback,[err,data],self)})},Usergrid.Entity.prototype.getEntityId=function(entity){var id=!1;return isUUID(entity.get("uuid"))?id=entity.get("uuid"):"users"===this.get("type")?id=entity.get("username"):entity.get("name")&&(id=entity.get("name")),id},Usergrid.Entity.prototype.getConnec
 tions=function(connection,callback){var self=this,connectorType=this.get("type"),connector=this.getEntityId(this);if(connector){var endpoint=connectorType+"/"+connector+"/"+connection+"/",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be connected"),self[connection]={};for(var length=data&&data.entities?data.entities.length:0,i=0;length>i;i++)"user"===data.entities[i].type?self[connection][data.entities[i].username]=data.entities[i]:self[connection][data.entities[i].name]=data.entities[i];doCallback(callback,[err,data,data.entities],self)})}else if("function"==typeof callback){var error="Error in getConnections - no uuid specified.";self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)}},Usergrid.Entity.prototype.getGroups=function(callback){var self=this,endpoint="users/"+this.get("uuid")+"/groups",options={method:"GET",endpoint:endpoint};this._client.request(o
 ptions,function(err,data){err&&self._client.logging&&console.log("entity could not be connected"),self.groups=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getActivities=function(callback){var self=this,endpoint=this.get("type")+"/"+this.get("uuid")+"/activities",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be connected");for(var entity in data.entities)data.entities[entity].createdDate=new Date(data.entities[entity].created).toUTCString();self.activities=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getFollowing=function(callback){var self=this,endpoint="users/"+this.get("uuid")+"/following",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user following");for(var entity in data.entities){data.en
 tities[entity].createdDate=new Date(data.entities[entity].created).toUTCString();var image=self._client.getDisplayImage(data.entities[entity].email,data.entities[entity].picture);data.entities[entity]._portal_image_icon=image}self.following=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getFollowers=function(callback){var self=this,endpoint="users/"+this.get("uuid")+"/followers",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user followers");for(var entity in data.entities){data.entities[entity].createdDate=new Date(data.entities[entity].created).toUTCString();var image=self._client.getDisplayImage(data.entities[entity].email,data.entities[entity].picture);data.entities[entity]._portal_image_icon=image}self.followers=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getRoles=function(callback){var s
 elf=this,endpoint=this.get("type")+"/"+this.get("uuid")+"/roles",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user roles"),self.roles=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getPermissions=function(callback){var self=this,endpoint=this.get("type")+"/"+this.get("uuid")+"/permissions",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user permissions");var permissions=[];if(data.data){var perms=data.data,count=0;for(var i in perms){count++;var perm=perms[i],parts=perm.split(":"),ops_part="",path_part=parts[0];parts.length>1&&(ops_part=parts[0],path_part=parts[1]),ops_part.replace("*","get,post,put,delete");var ops=ops_part.split(","),ops_object={};ops_object.get="no",ops_object.post="no",ops_object.put="no",ops_object.delete="no";for(var j in o
 ps)ops_object[ops[j]]="yes";permissions.push({operations:ops_object,path:path_part,perm:perm})}}self.permissions=permissions,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.disconnect=function(connection,entity,callback){var error,self=this,connecteeType=entity.get("type"),connectee=this.getEntityId(entity);if(!connectee)return void("function"==typeof callback&&(error="Error trying to delete object - no uuid specified.",self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)));var connectorType=this.get("type"),connector=this.getEntityId(this);if(!connector)return void("function"==typeof callback&&(error="Error in connect - no uuid specified.",self._client.logging&&console.log(error),doCallback(callback,[!0,error],self)));var endpoint=connectorType+"/"+connector+"/"+connection+"/"+connecteeType+"/"+connectee,options={method:"DELETE",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&cons
 ole.log("entity could not be disconnected"),doCallback(callback,[err,data],self)})},Usergrid.Collection=function(options,callback){if(options&&(this._client=options.client,this._type=options.type,this.qs=options.qs||{},this._list=options.list||[],this._iterator=options.iterator||-1,this._previous=options.previous||[],this._next=options.next||null,this._cursor=options.cursor||null,options.list))for(var count=options.list.length,i=0;count>i;i++){var entity=this._client.restoreEntity(options.list[i]);this._list[i]=entity}callback&&this.fetch(callback)},Usergrid.isCollection=function(obj){return obj&&obj instanceof Usergrid.Collection},Usergrid.Collection.prototype.serialize=function(){var data={};data.type=this._type,data.qs=this.qs,data.iterator=this._iterator,data.previous=this._previous,data.next=this._next,data.cursor=this._cursor,this.resetEntityPointer();var i=0;for(data.list=[];this.hasNextEntity();){var entity=this.getNextEntity();data.list[i]=entity.serialize(),i++}return data
 =JSON.stringify(data)},Usergrid.Collection.prototype.addCollection=function(collectionName,options,callback){self=this,options.client=this._client;var collection=new Usergrid.Collection(options,function(err){if("function"==typeof callback){for(collection.resetEntityPointer();collection.hasNextEntity();){var user=collection.getNextEntity(),image=(user.get("email"),self._client.getDisplayImage(user.get("email"),user.get("picture")));user._portal_image_icon=image}self[collectionName]=collection,doCallback(callback,[err,collection],self)}})},Usergrid.Collection.prototype.fetch=function(callback){var self=this,qs=this.qs;this._cursor?qs.cursor=this._cursor:delete qs.cursor;var options={method:"GET",endpoint:this._type,qs:this.qs};this._client.request(options,function(err,data){if(err&&self._client.logging)console.log("error getting collection");else{var cursor=data.cursor||null;if(self.saveCursor(cursor),data.entities){self.resetEntityPointer();var count=data.entities.length;self._list=[
 ];for(var i=0;count>i;i++){var uuid=data.entities[i].uuid;if(uuid){var entityData=data.entities[i]||{};
+self._baseType=data.entities[i].type,entityData.type=self._type;var entityOptions={type:self._type,client:self._client,uuid:uuid,data:entityData},ent=new Usergrid.Entity(entityOptions);ent._json=JSON.stringify(entityData,null,2);var ct=self._list.length;self._list[ct]=ent}}}}doCallback(callback,[err,data],self)})},Usergrid.Collection.prototype.addEntity=function(options,callback){var self=this;options.type=this._type,this._client.createEntity(options,function(err,entity){if(!err){var count=self._list.length;self._list[count]=entity}doCallback(callback,[err,entity],self)})},Usergrid.Collection.prototype.addExistingEntity=function(entity){var count=this._list.length;this._list[count]=entity},Usergrid.Collection.prototype.destroyEntity=function(entity,callback){var self=this;entity.destroy(function(err,data){err?(self._client.logging&&console.log("could not destroy entity"),doCallback(callback,[err,data],self)):self.fetch(callback)}),this.removeEntity(entity)},Usergrid.Collection.proto
 type.removeEntity=function(entity){var uuid=entity.get("uuid");for(var key in this._list){var listItem=this._list[key];if(listItem.get("uuid")===uuid)return this._list.splice(key,1)}return!1},Usergrid.Collection.prototype.getEntityByUUID=function(uuid,callback){for(var key in this._list){var listItem=this._list[key];if(listItem.get("uuid")===uuid)return callback(null,listItem)}var options={data:{type:this._type,uuid:uuid},client:this._client},entity=new Usergrid.Entity(options);entity.fetch(callback)},Usergrid.Collection.prototype.getFirstEntity=function(){var count=this._list.length;return count>0?this._list[0]:null},Usergrid.Collection.prototype.getLastEntity=function(){var count=this._list.length;return count>0?this._list[count-1]:null},Usergrid.Collection.prototype.hasNextEntity=function(){var next=this._iterator+1,hasNextElement=next>=0&&next<this._list.length;return hasNextElement?!0:!1},Usergrid.Collection.prototype.getNextEntity=function(){this._iterator++;var hasNextElement
 =this._iterator>=0&&this._iterator<=this._list.length;return hasNextElement?this._list[this._iterator]:!1},Usergrid.Collection.prototype.hasPrevEntity=function(){var previous=this._iterator-1,hasPreviousElement=previous>=0&&previous<this._list.length;return hasPreviousElement?!0:!1},Usergrid.Collection.prototype.getPrevEntity=function(){this._iterator--;var hasPreviousElement=this._iterator>=0&&this._iterator<=this._list.length;return hasPreviousElement?this._list[this._iterator]:!1},Usergrid.Collection.prototype.resetEntityPointer=function(){this._iterator=-1},Usergrid.Collection.prototype.saveCursor=function(cursor){this._next!==cursor&&(this._next=cursor)},Usergrid.Collection.prototype.resetPaging=function(){this._previous=[],this._next=null,this._cursor=null},Usergrid.Collection.prototype.hasNextPage=function(){return this._next},Usergrid.Collection.prototype.getNextPage=function(callback){this.hasNextPage()&&(this._previous.push(this._cursor),this._cursor=this._next,this._list=
 [],this.fetch(callback))},Usergrid.Collection.prototype.hasPreviousPage=function(){return this._previous.length>0},Usergrid.Collection.prototype.getPreviousPage=function(callback){this.hasPreviousPage()&&(this._next=null,this._cursor=this._previous.pop(),this._list=[],this.fetch(callback))},Usergrid.Group=function(options){this._path=options.path,this._list=[],this._client=options.client,this._data=options.data||{},this._data.type="groups"},Usergrid.Group.prototype=new Usergrid.Entity,Usergrid.Group.prototype.fetch=function(callback){var self=this,groupEndpoint="groups/"+this._path,memberEndpoint="groups/"+this._path+"/users",groupOptions={method:"GET",endpoint:groupEndpoint},memberOptions={method:"GET",endpoint:memberEndpoint};this._client.request(groupOptions,function(err,data){if(err)self._client.logging&&console.log("error getting group"),doCallback(callback,[err,data],self);else if(data.entities&&data.entities.length){var groupData=data.entities[0];self._data=groupData||{},self
 ._client.request(memberOptions,function(err,data){if(err&&self._client.logging)console.log("error getting group users");else if(data.entities){var count=data.entities.length;self._list=[];for(var i=0;count>i;i++){var uuid=data.entities[i].uuid;if(uuid){var entityData=data.entities[i]||{},entityOptions={type:entityData.type,client:self._client,uuid:uuid,data:entityData},entity=new Usergrid.Entity(entityOptions);self._list.push(entity)}}}doCallback(callback,[err,data,self._list],self)})}})},Usergrid.Group.prototype.members=function(callback){doCallback(callback,[null,this._list],this)},Usergrid.Group.prototype.add=function(options,callback){var self=this,options={method:"POST",endpoint:"groups/"+this._path+"/users/"+options.user.get("username")};this._client.request(options,function(error,data){error?doCallback(callback,[error,data,data.entities],self):self.fetch(callback)})},Usergrid.Group.prototype.remove=function(options,callback){var self=this,options={method:"DELETE",endpoint:"gr
 oups/"+this._path+"/users/"+options.user.get("username")};this._client.request(options,function(error,data){error?doCallback(callback,[error,data],self):self.fetch(callback)})},Usergrid.Group.prototype.feed=function(callback){var self=this,endpoint="groups/"+this._path+"/feed",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self.logging&&console.log("error trying to log user in"),doCallback(callback,[err,data,data.entities],self)})},Usergrid.Group.prototype.createGroupActivity=function(options,callback){var user=options.user;options={client:this._client,data:{actor:{displayName:user.get("username"),uuid:user.get("uuid"),username:user.get("username"),email:user.get("email"),picture:user.get("picture"),image:{duration:0,height:80,url:user.get("picture"),width:80}},verb:"post",content:options.content,type:"groups/"+this._path+"/activities"}};var entity=new Usergrid.Entity(options);entity.save(function(err){doCallback(callback,[err,entity])}
 )},Usergrid.Counter=function(options,callback){var self=this;this._client=options.client,this._data=options.data||{},this._data.category=options.category||"UNKNOWN",this._data.timestamp=options.timestamp||0,this._data.type="events",this._data.counters=options.counters||{},doCallback(callback,[!1,self],self)};var COUNTER_RESOLUTIONS=["all","minute","five_minutes","half_hour","hour","six_day","day","week","month"];Usergrid.Counter.prototype=new Usergrid.Entity,Usergrid.Counter.prototype.fetch=function(callback){this.getData({},callback)},Usergrid.Counter.prototype.increment=function(options,callback){var self=this,name=options.name,value=options.value;return name?isNaN(value)?doCallback(callback,[!0,"'value' for increment, decrement must be a number"],self):(self._data.counters[name]=parseInt(value)||1,self.save(callback)):doCallback(callback,[!0,"'name' for increment, decrement must be a number"],self)},Usergrid.Counter.prototype.decrement=function(options,callback){var self=this,nam
 e=options.name,value=options.value;self.increment({name:name,value:-(parseInt(value)||1)},callback)},Usergrid.Counter.prototype.reset=function(options,callback){var self=this,name=options.name;self.increment({name:name,value:0},callback)},Usergrid.Counter.prototype.getData=function(options,callback){var start_time,end_time,start=options.start||0,end=options.end||Date.now(),resolution=(options.resolution||"all").toLowerCase(),counters=options.counters||Object.keys(this._data.counters),res=(resolution||"all").toLowerCase();if(-1===COUNTER_RESOLUTIONS.indexOf(res)&&(res="all"),start)switch(typeof start){case"undefined":start_time=0;break;case"number":start_time=start;break;case"string":start_time=isNaN(start)?Date.parse(start):parseInt(start);break;default:start_time=Date.parse(start.toString())}if(end)switch(typeof end){case"undefined":end_time=Date.now();break;case"number":end_time=end;break;case"string":end_time=isNaN(end)?Date.parse(end):parseInt(end);break;default:end_time=Date.pa
 rse(end.toString())}var self=this,params=Object.keys(counters).map(function(counter){return["counter",encodeURIComponent(counters[counter])].join("=")});params.push("resolution="+res),params.push("start_time="+String(start_time)),params.push("end_time="+String(end_time));var endpoint="counters?"+params.join("&");this._client.request({endpoint:endpoint},function(err,data){return data.counters&&data.counters.length&&data.counters.forEach(function(counter){self._data.counters[counter.name]=counter.value||counter.values}),doCallback(callback,[err,data],self)})},Usergrid.Folder=function(options,callback){var self=this;console.log("FOLDER OPTIONS",options),self._client=options.client,self._data=options.data||{},self._data.type="folders";var missingData=["name","owner","path"].some(function(required){return!(required in self._data)});return missingData?doCallback(callback,[!0,new UsergridError("Invalid asset data: 'name', 'owner', and 'path' are required properties.")],self):void self.save
 (function(err,data){err?doCallback(callback,[!0,new UsergridError(data)],self):(data&&data.entities&&data.entities.length&&self.set(data.entities[0]),doCallback(callback,[!1,self],self))})},Usergrid.Folder.prototype=new Usergrid.Entity,Userg

<TRUNCATED>

[23/55] [abbrv] git commit: missed angularitics reference

Posted by sn...@apache.org.
missed angularitics reference


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2e177b92
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2e177b92
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2e177b92

Branch: refs/pull/76/head
Commit: 2e177b928d213deb98f2dd357f97137ea83c255b
Parents: 4fe9b9f
Author: Shawn Feldman <sh...@gmail.com>
Authored: Mon Mar 10 15:05:14 2014 -0600
Committer: Shawn Feldman <sh...@gmail.com>
Committed: Mon Mar 10 15:05:14 2014 -0600

----------------------------------------------------------------------
 portal/Gruntfile.js | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2e177b92/portal/Gruntfile.js
----------------------------------------------------------------------
diff --git a/portal/Gruntfile.js b/portal/Gruntfile.js
index 37fbd9b..d7cb184 100644
--- a/portal/Gruntfile.js
+++ b/portal/Gruntfile.js
@@ -68,8 +68,6 @@ module.exports = function (grunt) {
             'js/libs/angular-1.2.5/angular-sanitize.min.js',
             'js/libs/usergrid.sdk.js',
             'js/libs/MD5.min.js',
-            'bower_components/angularitics/dist/angulartics.min.js',
-            'bower_components/angularitics/dist/angulartics-google-analytics.min.js',
             'js/libs/ui-bootstrap/ui-bootstrap-custom-tpls-0.3.0.min.js',
             'js/libs/jqueryui/jquery-ui-1.8.18.min.js',
             'js/libs/jqueryui/date.min.js'


[25/55] [abbrv] reset version number add built files, so site doesn't initially have to be built

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c1950d95/portal/package.json
----------------------------------------------------------------------
diff --git a/portal/package.json b/portal/package.json
index 9e7d2ea..41b1ea5 100644
--- a/portal/package.json
+++ b/portal/package.json
@@ -1,6 +1,6 @@
 {
   "name": "apigee-usergrid",
-  "version": "1.0.2",
+  "version": "2.0.0",
   "packageName": "appsvc-ui",
   "description": "full apigee portal",
   "main": "./scripts/web-server.js",


[32/55] [abbrv] fix bug with analytics

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f6c3d4aa/portal/js/libs/usergrid-libs.min.js
----------------------------------------------------------------------
diff --git a/portal/js/libs/usergrid-libs.min.js b/portal/js/libs/usergrid-libs.min.js
index 1ce3c94..3dbb5c7 100644
--- a/portal/js/libs/usergrid-libs.min.js
+++ b/portal/js/libs/usergrid-libs.min.js
@@ -1,4 +1,4 @@
-/*! apigee-usergrid@2.0.36 2014-03-10 */
+/*! apigee-usergrid@2.0.0 2014-03-10 */
 !function(e,t){function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)dele
 te o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function it(){return!0}function ot(){return!1}function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0==
 =n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){for(var n,r=0;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t
 ).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}function tn(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;i--;)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function 
 rn(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(
 e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(
 b.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}var o={},a=e===jn;return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);for(;"*"===l[0];)l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataT
 ype)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){for(var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)
 l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.css
 Hooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",
 {}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],
 :{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementB
 yId(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.cal
 l(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},
 isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.
 replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a)for(;o>i&&(r=t.apply(e[i],n),r!==!1);i++);else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a)for(;o>i&&(r=t.call(e[i],i,e[i]),r!==!1);i++);else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call(" ")?function(e){return 
 null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid
 ||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.to
 LowerCase()}),r=b(o);var _={};b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;!function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})}(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){for(var r;(r=b.inArray(t,u,r))>-1;)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u|
 |i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]
 +"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var s,u,l,t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}};if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t
 ={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t
 "),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;bo
 rder:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.fir
 stChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf(
 "data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}}),b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e
 ,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q
 =b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||
 "").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return this.each(b.isFunction(e)?function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var o,a=0,s=b(this),u=t,l=e.match(w)||[];o=l[a++];)u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o);else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];return arguments.length?(i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType
 &&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))})):o?(r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)):void 0}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inA
 rray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;return e&&3!==u&&8!==u&&2!==u?typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t)):void 0},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)for(;n=o[i++];)r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpad
 ding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;return e&&3!==s&&8!==s&&2!==s?(a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]):void 0},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.
 nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)
 }}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected|
 |(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){for(r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f
 .elem=e),n=(n||"").match(w)||[""],l=n.length;l--;)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){for(t=(t||"").match(w)||[""],l=t.length;l--;)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.l
 ength;o--;)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||
 p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}for(d=0;(l=h[d++])&&!n.isPropagationStopped();)n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=b.event.handlers.call(this,e,l),n=
 0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=tt.test(i)?this.mouse
 Hooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;t--;)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.sc
 rollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof
  e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i
 =e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this.
 _just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}})
 ,b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undeleg
 ate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e
 ),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;u--;)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;
 )n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=i.preFilter;s;){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){for(;t=t[i];)if((1===t.nodeType||o)&&e(t,n,s))return!0}else for(;t=t[i];)if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return
  e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r)for(l=mt(y,d),r(l,[],s,u),c=l.length;c--;)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p));if(o){if(i||e){if(i){for(l=[],c=y.length;c--;)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}for(c=y.length;c--;)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){for(var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeTyp
 e?c(e,n,r):p(e,n,r))}];o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r&&!i.relative[e[r].type];r++);return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){for(g=0;m=e[g++];)if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){for(g=0;m=t[g++];)m(x,y,u,c);if(s){if(v>0)for(;b--;)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}function xt(e,t,n){for(var r=0,i=t.length;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1
 ===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}for(o=U.needsContext.test(e)?0:a.length;o--&&(u=a[o],!i.relative[l=u.type]);)if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}return s(e,p)(r,t,d,n,V.test(e)),n}function Tt(){}var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((
 ?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n
 +65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){for(var t,n=[];t=this[e++];)n.push(t);return n}}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a>
 <div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&
 &e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length|
 |h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t
 ];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);for(r=e;r=r.parentNode;)s.unshift(r);for(r=t;r=r.parentNode;)l.unshift(r);for(;s[i]===l[i];)i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "
 +e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e
 ){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u
 ){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(p=t;p=p[g];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];p=++d&&p&&p[g]||(f=d=0)||h.pop();)if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else for(;(p=++d&&p&&p[g]||(f=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++f||(v&&((p[x]||(p[x]={}))[e]=[N,f]),p!==t)););return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){r
 eturn r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e)
 {return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){for(var r
 =0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){for(t||(t=ft(e)),n=t.length;n--;)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o},i.pseudos.nth=i.pseudos.eq,i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,th
 is[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==type
 of e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack,b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.
 fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)
 }}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,
 "<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return t
 his},wrapInner:function(e){return this.each(b.isFunction(e)?function(t){b(this).wrapInner(e.call(this,t))}:function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function
 (e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&b.cleanData(Ot(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)}
 ,null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"glo
 balEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}}),b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){for(var n,r=0,i=[],o=b(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}}),b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&
 &Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){for(s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];i--;)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody)for(o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;i--;)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(b.merge(d,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));for(s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;o=d[h++];)if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),
 "script"),a&&Mt(s),n))for(i=0;o=s[i++];)kt.test(o.type||"")&&n.push(o);return s=null,f},cleanData:function(e,t){for(var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;
 i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.sup
 port.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=fu
 nction(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),
 ""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:i
 nput|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")},b.each("blur focus focusin focusout load resize scroll unload click dblclick moused
 own mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[],b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o
 =arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t
 ){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{}
 ,y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c)for(c={};t=Tn.exec(a);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&
 "string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(j
 n,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}}),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&
 &(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=
 a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.te
 xt=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}}),b.Tween=rr,rr.prototype={constructor:rr,init
 :function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.el
 em[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n
 )&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};re

<TRUNCATED>

[53/55] [abbrv] git commit: Merge branch 'master' of https://github.com/usergrid/usergrid into Export_Persistance_Integration

Posted by sn...@apache.org.
Merge branch 'master' of https://github.com/usergrid/usergrid into Export_Persistance_Integration

# By Shawn Feldman (8) and others
# Via Dave Johnson (5) and others
* 'master' of https://github.com/usergrid/usergrid: (27 commits)
  rebuilding artifacts after merge
  Test case for default query string options
  [DPS-865] Client will accept a 'default_qs' object with the options that will automatically populate the query string for each subsequent request. any query params passed directly to the request method will override these defaults in the event of a conflict.
  prepare new version
  fix issue with querying specific fields instead of entire object
  fix issue with find_by using exclamation point
  lock down rails version to 3.2.x
  test for names with spaces
  fix bug with analytics
  reset version number add built files, so site doesn't initially have to be built
  removing another reference to angularitics
  missed angularitics reference
  remove s3 and angularticis
  Ignore two-dot-o's ignored files.
  Renamed PR to match org.apache
  USERGRID-86: Remove restriction on 10 apps in the portal, add build files
  USERGRID-86: Remove restriction on 10 apps in the portal
  USERGRID-86: Remove restriction on 10 apps in the portal
  Fixing regression bug in Assets
  Updating build artifacts
  ...


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4431562a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4431562a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4431562a

Branch: refs/pull/76/merge
Commit: 4431562ac799429e8ccbe33b057a48e2181072de
Parents: 5a5644e 24425d5
Author: grey <gr...@apigee.com>
Authored: Wed Mar 19 12:04:48 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Wed Mar 19 12:04:48 2014 -0700

----------------------------------------------------------------------
 .gitignore                                      |    9 +-
 portal/config.js                                |   11 +-
 portal/index-debug.html                         |   18 +-
 portal/index-template.html                      |    2 +-
 portal/index.html                               |   18 +-
 portal/js/app.js                                |    7 +-
 portal/js/global/page-controller.js             |   58 +-
 portal/js/global/page-title.html                |    2 +-
 portal/js/global/ug-service.js                  |   74 +-
 portal/js/libs/usergrid-libs.min.js             |   22 +-
 portal/js/libs/usergrid.sdk.js                  |    5 +
 portal/js/login/forgot-password-controller.js   |    1 -
 portal/js/login/login-controller.js             |    8 +-
 portal/js/login/login.html                      |    6 +
 portal/js/menus/appMenu.html                    |    7 +-
 portal/js/menus/menu-directives.js              |    1 -
 portal/js/org-overview/org-overview.html        |    4 +-
 portal/js/templates.js                          |   57 +-
 portal/js/usergrid-dev.min.js                   |  171 +-
 portal/js/usergrid.min.js                       |   12 +-
 portal/js/users/users-feed-controller.js        |   29 +
 portal/js/users/users-feed.html                 |   27 +
 portal/js/users/users.html                      |    1 +
 portal/package.json                             |    5 +-
 portal/phantomjsdriver.log                      | 3869 ------------------
 portal/seleniumLog.txt                          |    0
 portal/tests/unit/sample.spec.js                |    3 +-
 sdks/html5-javascript/lib/Usergrid.js           |   13 +-
 sdks/html5-javascript/lib/modules/Asset.js      |    4 +-
 sdks/html5-javascript/lib/modules/Client.js     |   74 +-
 sdks/html5-javascript/lib/modules/Folder.js     |    4 +-
 sdks/html5-javascript/package.json              |    2 +-
 sdks/html5-javascript/tests/mocha/test.js       |   25 +
 sdks/html5-javascript/usergrid.js               |   36 +-
 sdks/html5-javascript/usergrid.min.js           |    6 +-
 .../lib/usergrid_ironhorse/query.rb             |   30 +-
 .../lib/usergrid_ironhorse/version.rb           |    2 +-
 .../spec/usergrid_ironhorse/base_spec.rb        |    8 +-
 sdks/ruby-on-rails/usergrid_ironhorse.gemspec   |    4 +-
 .../1.5.4/AppleJavaExtensions-1.5.4.jar         |  Bin 0 -> 23531 bytes
 .../1.5.4/AppleJavaExtensions-1.5.4.pom         |    9 +
 .../maven-metadata-local.xml                    |   12 +
 stack/pom.xml                                   |    7 +-
 .../services/AbstractCollectionService.java     |    3 +
 .../RepairingMismatchedApplicationMetadata.java |   73 +
 45 files changed, 655 insertions(+), 4084 deletions(-)
----------------------------------------------------------------------



[27/55] [abbrv] reset version number add built files, so site doesn't initially have to be built

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c1950d95/portal/js/usergrid-dev.min.js
----------------------------------------------------------------------
diff --git a/portal/js/usergrid-dev.min.js b/portal/js/usergrid-dev.min.js
index 3217715..2880606 100644
--- a/portal/js/usergrid-dev.min.js
+++ b/portal/js/usergrid-dev.min.js
@@ -1,4 +1,4 @@
-/*! apigee-usergrid@1.0.2 2014-03-06 */
+/*! apigee-usergrid@2.0.36 2014-03-10 */
 (function(exports, global) {
     global["true"] = exports;
     "use strict";
@@ -44,7 +44,7 @@
     AppServices.Directives = angular.module("appservices.directives", []);
     AppServices.Performance = angular.module("appservices.performance", []);
     AppServices.Push = angular.module("appservices.push", []);
-    angular.module("appservices", [ "ngRoute", "ngResource", "ngSanitize", "ui.bootstrap", "angulartics", "angulartics.google.analytics", "appservices.filters", "appservices.services", "appservices.directives", "appservices.constants", "appservices.controllers", "appservices.performance", "appservices.push" ]).config([ "$routeProvider", "$locationProvider", "$sceDelegateProvider", "$analyticsProvider", function($routeProvider, $locationProvider, $sceDelegateProvider, $analyticsProvider) {
+    angular.module("appservices", [ "ngRoute", "ngResource", "ngSanitize", "ui.bootstrap", "appservices.filters", "appservices.services", "appservices.directives", "appservices.constants", "appservices.controllers", "appservices.performance", "appservices.push" ]).config([ "$routeProvider", "$locationProvider", "$sceDelegateProvider", function($routeProvider, $locationProvider, $sceDelegateProvider) {
         $routeProvider.when("/org-overview", {
             templateUrl: "org-overview/org-overview.html",
             controller: "OrgOverviewCtrl"
@@ -146,8 +146,6 @@
         });
         $locationProvider.html5Mode(false).hashPrefix("!");
         $sceDelegateProvider.resourceUrlWhitelist([ "self", "http://apigee-internal-prod.jupiter.apigee.net/**", "http://apigee-internal-prod.mars.apigee.net/**", "https://appservices.apigee.com/**", "https://api.usergrid.com/**" ]);
-        $analyticsProvider.virtualPageviews(false);
-        $analyticsProvider.firstPageview(false);
     } ]);
     AppServices.Controllers.controller("ActivitiesCtrl", [ "ug", "$scope", "$rootScope", "$location", "$route", function(ug, $scope, $rootScope, $location, $route) {
         $scope.$on("app-activities-received", function(evt, data) {
@@ -1201,7 +1199,7 @@
         ITEMS_URL: "global/temp.json"
     });
     "use strict";
-    AppServices.Controllers.controller("PageCtrl", [ "ug", "utility", "$scope", "$rootScope", "$location", "$routeParams", "$q", "$route", "$log", "$analytics", function(ug, utility, $scope, $rootScope, $location, $routeParams, $q, $route, $log, $analytics) {
+    AppServices.Controllers.controller("PageCtrl", [ "ug", "utility", "$scope", "$rootScope", "$location", "$routeParams", "$q", "$route", "$log", "$analytics", function(ug, utility, $scope, $rootScope, $location, $routeParams, $q, $route, $log) {
         var initScopeVariables = function() {
             $scope.loadingText = "Loading...";
             $scope.use_sso = false;
@@ -1467,19 +1465,12 @@
         $scope.$on("request-times-slow", function(evt, averageRequestTimes) {
             $rootScope.$broadcast("alert", "info", "We are experiencing performance issues on our server.  Please click Get Help for support if this continues.");
         });
-        var lastPage = "";
         $scope.$on("$routeChangeSuccess", function() {
             verifyUser();
             $scope.showDemoBar = $location.path().slice(0, "/performance".length) === "/performance";
             if (!$scope.showDemoBar) {
                 $rootScope.demoData = false;
             }
-            setTimeout(function() {
-                lastPage = "";
-            }, 50);
-            var path = window.location.pathname.replace("index-debug.html", "");
-            lastPage === "" && $analytics.pageTrack((path + $location.path()).replace("//", "/"));
-            lastPage = $location.path();
         });
         $scope.$on("applications-received", function(event, applications) {
             $scope.applications = applications;


[54/55] [abbrv] git commit: Merge 4431562ac799429e8ccbe33b057a48e2181072de into 24425d5e61fabb08e632fcfbdfbb423b7ff6acaa

Posted by sn...@apache.org.
Merge 4431562ac799429e8ccbe33b057a48e2181072de into 24425d5e61fabb08e632fcfbdfbb423b7ff6acaa


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b2c7905a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b2c7905a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b2c7905a

Branch: refs/pull/76/merge
Commit: b2c7905abbd33894fa230aae6d46353dbaed4bc3
Parents: 24425d5 4431562
Author: GERey <gr...@apigee.com>
Authored: Wed Mar 19 19:05:18 2014 +0000
Committer: GERey <gr...@apigee.com>
Committed: Wed Mar 19 19:05:18 2014 +0000

----------------------------------------------------------------------
 .../management/export/ExportServiceImpl.java    |  57 +------
 .../cassandra/ManagementServiceIT.java          | 148 ++++++++++++++++++-
 2 files changed, 154 insertions(+), 51 deletions(-)
----------------------------------------------------------------------



[11/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal, add build files

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44805da2/portal/js/usergrid-dev.min.js
----------------------------------------------------------------------
diff --git a/portal/js/usergrid-dev.min.js b/portal/js/usergrid-dev.min.js
index 83b8ff6..3217715 100644
--- a/portal/js/usergrid-dev.min.js
+++ b/portal/js/usergrid-dev.min.js
@@ -1,4 +1,4 @@
-/*! apigee-usergrid@2.0.36 2014-03-06 */
+/*! apigee-usergrid@1.0.2 2014-03-06 */
 (function(exports, global) {
     global["true"] = exports;
     "use strict";


[21/55] [abbrv] git commit: remove s3 and angularticis

Posted by sn...@apache.org.
remove s3 and angularticis


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/6b1c0764
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/6b1c0764
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/6b1c0764

Branch: refs/pull/76/head
Commit: 6b1c0764c71cc1114282ba5844856800b0b9c1f7
Parents: 44805da
Author: Shawn Feldman <sh...@gmail.com>
Authored: Mon Mar 10 15:01:51 2014 -0600
Committer: Shawn Feldman <sh...@gmail.com>
Committed: Mon Mar 10 15:01:51 2014 -0600

----------------------------------------------------------------------
 portal/Gruntfile.js                 | 28 ----------------------------
 portal/bower.json                   |  1 -
 portal/config.js                    | 15 ---------------
 portal/js/app.js                    |  7 ++-----
 portal/js/global/page-controller.js | 10 +---------
 5 files changed, 3 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6b1c0764/portal/Gruntfile.js
----------------------------------------------------------------------
diff --git a/portal/Gruntfile.js b/portal/Gruntfile.js
index e35c24d..37fbd9b 100644
--- a/portal/Gruntfile.js
+++ b/portal/Gruntfile.js
@@ -319,33 +319,6 @@ module.exports = function (grunt) {
           copy:false
         }
       }
-    },
-    s3: {
-      options: {
-        key: process.env.AWS_KEY || 'noidea',
-        secret: process.env.AWS_SECRET || 'noidea',
-        bucket: 'appservices-deployments',
-        access: 'public-read',
-        headers: {
-          // Two Year cache policy (1000 * 60 * 60 * 24 * 730)
-          "Cache-Control": "max-age=630720000, public",
-          "Expires": new Date(Date.now() + 63072000000).toUTCString()
-        }
-      },
-      dev: {
-        // These options override the defaults
-        options: {
-          encodePaths: false,
-          maxOperations: 20
-        },
-        // Files to be uploaded.
-        upload: [
-          {
-            src: 'dist/appsvc-ui.'+packageJson.version+'.zip',
-            dest: '/production-releases/dist/appsvc-ui.'+packageJson.version+'.zip'
-          }
-        ]
-      }
     }
   });
 
@@ -362,7 +335,6 @@ module.exports = function (grunt) {
   grunt.loadNpmTasks('grunt-protractor-runner');
   grunt.loadNpmTasks('grunt-karma');
   grunt.loadNpmTasks('grunt-dom-munger');
-  grunt.loadNpmTasks('grunt-s3');
 
   // Default task(s).
   grunt.registerTask('dev', ['connect:server', 'watch']);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6b1c0764/portal/bower.json
----------------------------------------------------------------------
diff --git a/portal/bower.json b/portal/bower.json
index bb34bca..98a9d65 100644
--- a/portal/bower.json
+++ b/portal/bower.json
@@ -3,7 +3,6 @@
   "version": "2.0.12",
   "ignore": [],
   "dependencies": {
-    "angularitics": "~0.8.7",
     "apigee-sdk": "~2.0.8"
   },
   "devDependencies": {},

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6b1c0764/portal/config.js
----------------------------------------------------------------------
diff --git a/portal/config.js b/portal/config.js
index 7b1920f..36804d6 100644
--- a/portal/config.js
+++ b/portal/config.js
@@ -1,20 +1,5 @@
 var Usergrid = Usergrid || {};
 
-//Google Analytics
-var _gaq = _gaq || [];
-_gaq.push(['_setAccount', '{{yourtoken}}']);
-try{
-    (function(document) {
-        if(!document){
-            return;
-        }
-        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-    })(document || null);
-}catch(e){};
-//End Google Analytics
-
 Usergrid.showNotifcations = true;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6b1c0764/portal/js/app.js
----------------------------------------------------------------------
diff --git a/portal/js/app.js b/portal/js/app.js
index 0954859..73d0c6d 100644
--- a/portal/js/app.js
+++ b/portal/js/app.js
@@ -68,8 +68,8 @@ angular.module('appservices',
       'appservices.controllers',
       'appservices.performance',
       'appservices.push'
-    ]).config(['$routeProvider', '$locationProvider','$sceDelegateProvider','$analyticsProvider',
-        function ($routeProvider,$locationProvider,$sceDelegateProvider, $analyticsProvider) {
+    ]).config(['$routeProvider', '$locationProvider','$sceDelegateProvider',
+        function ($routeProvider,$locationProvider,$sceDelegateProvider) {
             $routeProvider
                 .when('/org-overview', {templateUrl: 'org-overview/org-overview.html', controller: 'OrgOverviewCtrl'})
                 .when('/login', {templateUrl: 'login/login.html', controller: 'LoginCtrl'})
@@ -119,7 +119,4 @@ angular.module('appservices',
                 'https://api.usergrid.com/**'
             ]);
 
-            $analyticsProvider.virtualPageviews(false);
-            $analyticsProvider.firstPageview(false);
-
         }]);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6b1c0764/portal/js/global/page-controller.js
----------------------------------------------------------------------
diff --git a/portal/js/global/page-controller.js b/portal/js/global/page-controller.js
index 0e4ad60..f8ed966 100644
--- a/portal/js/global/page-controller.js
+++ b/portal/js/global/page-controller.js
@@ -20,8 +20,7 @@ AppServices.Controllers.controller('PageCtrl',
                      $routeParams,
                      $q,
                      $route,
-                     $log,
-                     $analytics) {
+                     $log) {
 
   var initScopeVariables = function(){
     //$rootScope.urls()... will determine which URL should be used for a given environment
@@ -353,7 +352,6 @@ AppServices.Controllers.controller('PageCtrl',
       $rootScope.$broadcast('alert', 'info', 'We are experiencing performance issues on our server.  Please click Get Help for support if this continues.');
     });
 
-    var lastPage = "";
     //verify on every route change
     $scope.$on('$routeChangeSuccess', function () {
       //todo possibly do a date check here for token expiry
@@ -363,12 +361,6 @@ AppServices.Controllers.controller('PageCtrl',
       if(!$scope.showDemoBar){
         $rootScope.demoData = false;
       }
-      setTimeout(function(){
-         lastPage = ""; //remove the double load event
-        },50);
-      var path = window.location.pathname.replace("index-debug.html","");
-      lastPage === "" && $analytics.pageTrack((path+$location.path()).replace("//","/"));
-      lastPage = $location.path();
     });
     $scope.$on('applications-received', function (event, applications) {
       $scope.applications = applications;


[08/55] [abbrv] git commit: USERGRID-86: Remove restriction on 10 apps in the portal

Posted by sn...@apache.org.
USERGRID-86: Remove restriction on 10 apps in the portal


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/bf075e6c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/bf075e6c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/bf075e6c

Branch: refs/pull/76/head
Commit: bf075e6c33447f890362ba2e56eaacf1c6efd511
Parents: 631f02d
Author: Shawn Feldman <sh...@gmail.com>
Authored: Thu Mar 6 14:22:27 2014 -0700
Committer: Shawn Feldman <sh...@gmail.com>
Committed: Thu Mar 6 14:22:27 2014 -0700

----------------------------------------------------------------------
 portal/Gruntfile.js                           |   30 +
 portal/bower.json                             |    1 +
 portal/config.js                              |   26 +-
 portal/index-debug.html                       |   18 +-
 portal/index-template.html                    |    2 +-
 portal/index.html                             |   18 +-
 portal/js/app.js                              |   16 +-
 portal/js/global/page-controller.js           |   66 +-
 portal/js/global/page-title.html              |    2 +-
 portal/js/global/ug-service.js                |   76 +-
 portal/js/libs/usergrid-libs.min.js           |   22 +-
 portal/js/libs/usergrid.sdk.js                |    5 +
 portal/js/login/forgot-password-controller.js |    1 -
 portal/js/login/login-controller.js           |    8 +-
 portal/js/login/login.html                    |    6 +
 portal/js/menus/appMenu.html                  |    7 +-
 portal/js/menus/menu-directives.js            |    1 -
 portal/js/org-overview/org-overview.html      |    4 +-
 portal/js/templates.js                        |   57 +-
 portal/js/usergrid-dev.min.js                 |  187 +-
 portal/js/usergrid.min.js                     |   12 +-
 portal/js/users/users-feed-controller.js      |   29 +
 portal/js/users/users-feed.html               |   27 +
 portal/js/users/users.html                    |    1 +
 portal/package.json                           |    5 +-
 portal/phantomjsdriver.log                    | 3869 --------------------
 portal/seleniumLog.txt                        |    0
 portal/tests/unit/sample.spec.js              |    3 +-
 28 files changed, 449 insertions(+), 4050 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/Gruntfile.js
----------------------------------------------------------------------
diff --git a/portal/Gruntfile.js b/portal/Gruntfile.js
index d7cb184..e35c24d 100644
--- a/portal/Gruntfile.js
+++ b/portal/Gruntfile.js
@@ -68,6 +68,8 @@ module.exports = function (grunt) {
             'js/libs/angular-1.2.5/angular-sanitize.min.js',
             'js/libs/usergrid.sdk.js',
             'js/libs/MD5.min.js',
+            'bower_components/angularitics/dist/angulartics.min.js',
+            'bower_components/angularitics/dist/angulartics-google-analytics.min.js',
             'js/libs/ui-bootstrap/ui-bootstrap-custom-tpls-0.3.0.min.js',
             'js/libs/jqueryui/jquery-ui-1.8.18.min.js',
             'js/libs/jqueryui/date.min.js'
@@ -317,6 +319,33 @@ module.exports = function (grunt) {
           copy:false
         }
       }
+    },
+    s3: {
+      options: {
+        key: process.env.AWS_KEY || 'noidea',
+        secret: process.env.AWS_SECRET || 'noidea',
+        bucket: 'appservices-deployments',
+        access: 'public-read',
+        headers: {
+          // Two Year cache policy (1000 * 60 * 60 * 24 * 730)
+          "Cache-Control": "max-age=630720000, public",
+          "Expires": new Date(Date.now() + 63072000000).toUTCString()
+        }
+      },
+      dev: {
+        // These options override the defaults
+        options: {
+          encodePaths: false,
+          maxOperations: 20
+        },
+        // Files to be uploaded.
+        upload: [
+          {
+            src: 'dist/appsvc-ui.'+packageJson.version+'.zip',
+            dest: '/production-releases/dist/appsvc-ui.'+packageJson.version+'.zip'
+          }
+        ]
+      }
     }
   });
 
@@ -333,6 +362,7 @@ module.exports = function (grunt) {
   grunt.loadNpmTasks('grunt-protractor-runner');
   grunt.loadNpmTasks('grunt-karma');
   grunt.loadNpmTasks('grunt-dom-munger');
+  grunt.loadNpmTasks('grunt-s3');
 
   // Default task(s).
   grunt.registerTask('dev', ['connect:server', 'watch']);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/bower.json
----------------------------------------------------------------------
diff --git a/portal/bower.json b/portal/bower.json
index 98a9d65..bb34bca 100644
--- a/portal/bower.json
+++ b/portal/bower.json
@@ -3,6 +3,7 @@
   "version": "2.0.12",
   "ignore": [],
   "dependencies": {
+    "angularitics": "~0.8.7",
     "apigee-sdk": "~2.0.8"
   },
   "devDependencies": {},

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/config.js
----------------------------------------------------------------------
diff --git a/portal/config.js b/portal/config.js
index c2f31d1..e08e78f 100644
--- a/portal/config.js
+++ b/portal/config.js
@@ -1,12 +1,29 @@
 var Usergrid = Usergrid || {};
 
+//Google Analytics
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-4084158-4']);
+try{
+    (function(document) {
+        if(!document){
+            return;
+        }
+        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+    })(document || null);
+}catch(e){};
+//End Google Analytics
+
 Usergrid.showNotifcations = true;
 
+
 // used only if hostname does not match a real server name
 Usergrid.overrideUrl = 'https://api.usergrid.com/';
 
 Usergrid.options = {
   client:{
+    requiresDeveloperKey:false
    // apiKey:'123456'
   },
   showAutoRefresh:true,
@@ -74,7 +91,10 @@ Usergrid.regex = {
   collectionNameRegexDescription: "Collection name only allows : a-z A-Z 0-9. Must be between 3-25 characters."
 };
 try{
-  if(module && module.exports){
-    module.exports = Usergrid;
+  if (typeof module !== 'undefined'){
+
+    if(module && module.exports){
+      module.exports = Usergrid;
+  }
   }
-}catch(e){}
\ No newline at end of file
+}catch(e){}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/index-debug.html
----------------------------------------------------------------------
diff --git a/portal/index-debug.html b/portal/index-debug.html
index 8aea400..7b8dcec 100644
--- a/portal/index-debug.html
+++ b/portal/index-debug.html
@@ -8,12 +8,12 @@
   <meta name="description" content="">
   <meta name="author" content="">
 
-  <link id="libScript" href="2.0.34/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
-  <link id="libScript" href="2.0.34/css/dash.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.36/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.36/css/dash.min.css" rel="stylesheet">
 
   <!--styles for jquery ui calendar component-->
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.34/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.34/js/libs/jqueryui/jquery-ui-timepicker.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-timepicker.css">
 </head>
 <body ng-controller="PageCtrl">
 <!-- Google Tag Manager -->
@@ -109,20 +109,20 @@
 
         <footer>
           <hr>
-          <p class="pull-right">&copy; Apigee 2013</p>
+          <p class="pull-right">&copy; Apigee 2014</p>
         </footer>
       </div>
     </div>
   </div>
 </section>
-<script id="libScript" src="2.0.34/js/libs/usergrid-libs.min.js"></script>
-<script id="libScript" src="2.0.34/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
+<script id="libScript" src="2.0.36/js/libs/usergrid-libs.min.js"></script>
+<script id="libScript" src="2.0.36/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
 <!--todo - remove this. temporarily including jquery ui for calendar in push-->
-<script id="libScript" src="2.0.34/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
+<script id="libScript" src="2.0.36/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
 <!-- In dev use: <script src="js/libs/angular-1.1.5.js"></script> -->
 <!--<script type="text/javascript" src="js/libs/angular-ui-ng-grid/ng-grid-2.0.2.debug.js"></script>-->
 <script src="config.js"></script>
-<script id="main-script" src="2.0.34/js/usergrid-dev.min.js"></script>
+<script id="main-script" src="2.0.36/js/usergrid-dev.min.js"></script>
 
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/index-template.html
----------------------------------------------------------------------
diff --git a/portal/index-template.html b/portal/index-template.html
index 2c7ddfd..650ef42 100644
--- a/portal/index-template.html
+++ b/portal/index-template.html
@@ -110,7 +110,7 @@
 
         <footer>
           <hr>
-          <p class="pull-right">&copy; Apigee 2013</p>
+          <p class="pull-right">&copy; Apigee 2014</p>
         </footer>
       </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/index.html
----------------------------------------------------------------------
diff --git a/portal/index.html b/portal/index.html
index 2285ff5..95b6eb8 100644
--- a/portal/index.html
+++ b/portal/index.html
@@ -8,12 +8,12 @@
   <meta name="description" content="">
   <meta name="author" content="">
 
-  <link id="libScript" href="2.0.34/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
-  <link id="libScript" href="2.0.34/css/dash.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.36/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.36/css/dash.min.css" rel="stylesheet">
 
   <!--styles for jquery ui calendar component-->
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.34/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.34/js/libs/jqueryui/jquery-ui-timepicker.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-timepicker.css">
 </head>
 <body ng-controller="PageCtrl">
 <!-- Google Tag Manager -->
@@ -109,20 +109,20 @@
 
         <footer>
           <hr>
-          <p class="pull-right">&copy; Apigee 2013</p>
+          <p class="pull-right">&copy; Apigee 2014</p>
         </footer>
       </div>
     </div>
   </div>
 </section>
-<script id="libScript" src="2.0.34/js/libs/usergrid-libs.min.js"></script>
-<script id="libScript" src="2.0.34/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
+<script id="libScript" src="2.0.36/js/libs/usergrid-libs.min.js"></script>
+<script id="libScript" src="2.0.36/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
 <!--todo - remove this. temporarily including jquery ui for calendar in push-->
-<script id="libScript" src="2.0.34/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
+<script id="libScript" src="2.0.36/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
 <!-- In dev use: <script src="js/libs/angular-1.1.5.js"></script> -->
 <!--<script type="text/javascript" src="js/libs/angular-ui-ng-grid/ng-grid-2.0.2.debug.js"></script>-->
 <script src="config.js"></script>
-<script id="main-script" src="2.0.34/js/usergrid.min.js"></script>
+<script id="main-script" src="2.0.36/js/usergrid.min.js"></script>
 
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/app.js
----------------------------------------------------------------------
diff --git a/portal/js/app.js b/portal/js/app.js
index 9ed6816..0954859 100644
--- a/portal/js/app.js
+++ b/portal/js/app.js
@@ -51,20 +51,25 @@ AppServices.Services = angular.module('appservices.services', []);
 AppServices.Controllers = angular.module('appservices.controllers', []);
 AppServices.Filters = angular.module('appservices.filters', []);
 AppServices.Directives = angular.module('appservices.directives', []);
+AppServices.Performance = angular.module('appservices.performance', []);
+AppServices.Push = angular.module('appservices.push', []);
 
 angular.module('appservices',
     [ 'ngRoute',
       'ngResource',
       'ngSanitize',
       'ui.bootstrap',
+      'angulartics',
+      'angulartics.google.analytics',
       'appservices.filters',
       'appservices.services',
       'appservices.directives',
       'appservices.constants',
       'appservices.controllers',
-
-    ]).config(['$routeProvider', '$locationProvider','$sceDelegateProvider',
-        function ($routeProvider,$locationProvider,$sceDelegateProvider) {
+      'appservices.performance',
+      'appservices.push'
+    ]).config(['$routeProvider', '$locationProvider','$sceDelegateProvider','$analyticsProvider',
+        function ($routeProvider,$locationProvider,$sceDelegateProvider, $analyticsProvider) {
             $routeProvider
                 .when('/org-overview', {templateUrl: 'org-overview/org-overview.html', controller: 'OrgOverviewCtrl'})
                 .when('/login', {templateUrl: 'login/login.html', controller: 'LoginCtrl'})
@@ -77,6 +82,7 @@ angular.module('appservices',
                 .when('/users/profile', {templateUrl: 'users/users-profile.html', controller: 'UsersProfileCtrl'})
                 .when('/users/groups', {templateUrl: 'users/users-groups.html', controller: 'UsersGroupsCtrl'})
                 .when('/users/activities', {templateUrl: 'users/users-activities.html', controller: 'UsersActivitiesCtrl'})
+                .when('/users/feed', {templateUrl: 'users/users-feed.html', controller: 'UsersFeedCtrl'})
                 .when('/users/graph', {templateUrl: 'users/users-graph.html', controller: 'UsersGraphCtrl'})
                 .when('/users/roles', {templateUrl: 'users/users-roles.html', controller: 'UsersRolesCtrl'})
                 .when('/groups', {templateUrl: 'groups/groups.html', controller: 'GroupsCtrl'})
@@ -112,4 +118,8 @@ angular.module('appservices',
                 'https://appservices.apigee.com/**',
                 'https://api.usergrid.com/**'
             ]);
+
+            $analyticsProvider.virtualPageviews(false);
+            $analyticsProvider.firstPageview(false);
+
         }]);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/global/page-controller.js
----------------------------------------------------------------------
diff --git a/portal/js/global/page-controller.js b/portal/js/global/page-controller.js
index 8e789d0..0e4ad60 100644
--- a/portal/js/global/page-controller.js
+++ b/portal/js/global/page-controller.js
@@ -10,7 +10,8 @@ AppServices.Controllers.controller('PageCtrl',
     '$routeParams',
     '$q',
     '$route',
-    '$log', function (
+    '$log',
+    '$analytics', function (
                      ug,
                      utility,
                      $scope,
@@ -19,8 +20,8 @@ AppServices.Controllers.controller('PageCtrl',
                      $routeParams,
                      $q,
                      $route,
-                     $log
-                     ) {
+                     $log,
+                     $analytics) {
 
   var initScopeVariables = function(){
     //$rootScope.urls()... will determine which URL should be used for a given environment
@@ -38,6 +39,7 @@ AppServices.Controllers.controller('PageCtrl',
     $rootScope.demoData = false;
     $scope.queryStringApplied = false;
     $rootScope.autoUpdateTimer = Usergrid.config ? Usergrid.config.autoUpdateTimer : 61;
+    $rootScope.requiresDeveloperKey = Usergrid.config ? Usergrid.config.client.requiresDeveloperKey : false;
     $rootScope.loaded = $rootScope.activeUI = false;
     for (var key in Usergrid.regex) {
       $scope[key] = Usergrid.regex[key];
@@ -59,52 +61,11 @@ AppServices.Controllers.controller('PageCtrl',
   initScopeVariables();
 
   $rootScope.urls = function(){
-    var BASE_URL = '';
-    var DATA_URL = '';
-    var qs = $location.search();
-
-    switch(true){
-      case $location.host() === 'appservices.apigee.com' && location.pathname.indexOf('/dit') >= 0 :
-        //DIT
-        BASE_URL = 'https://accounts.jupiter.apigee.net';
-        DATA_URL = 'http://apigee-internal-prod.jupiter.apigee.net';
-        $scope.use_sso = true;
-        break;
-      case $location.host() === 'appservices.apigee.com' && location.pathname.indexOf('/mars') >= 0  :
-        //staging
-        BASE_URL = 'https://accounts.mars.apigee.net';
-        DATA_URL = 'http://apigee-internal-prod.mars.apigee.net';
-        $scope.use_sso = true;
-        break;
-      case $location.host() === 'appservices.apigee.com' :
-        //enterprise portals
-        DATA_URL = Usergrid.overrideUrl;
-        break;
-      case $location.host() === 'apigee.com' :
-        //prod
-        BASE_URL = 'https://accounts.apigee.com';
-        DATA_URL = 'https://api.usergrid.com';
-        $scope.use_sso = true;
-        break;
-      case $location.host() === 'usergrid.dev':
-        //development
-        DATA_URL = 'https://api.usergrid.com';
-        break;
-      default :
-        DATA_URL = Usergrid.overrideUrl;
-        break;
-    }
-    //override with querystring
-    DATA_URL =  qs.api_url || DATA_URL;
-    $scope.apiUrl = DATA_URL = DATA_URL.lastIndexOf('/') === DATA_URL.length - 1 ? DATA_URL.substring(0,DATA_URL.length-1) : DATA_URL;
-
-    return {
-      DATA_URL: DATA_URL,
-      LOGIN_URL: BASE_URL + '/accounts/sign_in',
-      PROFILE_URL: BASE_URL + '/accounts/my_account',
-      LOGOUT_URL: BASE_URL + '/accounts/sign_out'
-    }
-  }
+    var urls = ug.getUrls()
+    $scope.apiUrl = urls.apiUrl;
+    $scope.use_sso = urls.use_sso;
+    return urls;
+  };
 
   //used in users
   $rootScope.gotoPage = function(path){
@@ -392,6 +353,7 @@ AppServices.Controllers.controller('PageCtrl',
       $rootScope.$broadcast('alert', 'info', 'We are experiencing performance issues on our server.  Please click Get Help for support if this continues.');
     });
 
+    var lastPage = "";
     //verify on every route change
     $scope.$on('$routeChangeSuccess', function () {
       //todo possibly do a date check here for token expiry
@@ -401,6 +363,12 @@ AppServices.Controllers.controller('PageCtrl',
       if(!$scope.showDemoBar){
         $rootScope.demoData = false;
       }
+      setTimeout(function(){
+         lastPage = ""; //remove the double load event
+        },50);
+      var path = window.location.pathname.replace("index-debug.html","");
+      lastPage === "" && $analytics.pageTrack((path+$location.path()).replace("//","/"));
+      lastPage = $location.path();
     });
     $scope.$on('applications-received', function (event, applications) {
       $scope.applications = applications;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/global/page-title.html
----------------------------------------------------------------------
diff --git a/portal/js/global/page-title.html b/portal/js/global/page-title.html
index bc68348..77d4231 100644
--- a/portal/js/global/page-title.html
+++ b/portal/js/global/page-title.html
@@ -1,7 +1,7 @@
 <section class="row-fluid">
     <div class="span12">
         <div class="page-filters">
-            <h1 class="title pull-left" id="pageTitle"><i class="pictogram title" style="padding-right: 5px;">{{icon}}</i>{{title}} <a class="super-help" href="#" ng-click="showHelp()"  >(need help?)</a></h1>
+            <h1 class="title pull-left" id="pageTitle"><i class="pictogram title" style="padding-right: 5px;">{{icon}}</i>{{title}} <a class="super-help" href="http://community.apigee.com/content/apigee-customer-support" target="_blank"  >(need help?)</a></h1>
         </div>
     </div>
     <bsmodal id="need-help"

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/global/ug-service.js
----------------------------------------------------------------------
diff --git a/portal/js/global/ug-service.js b/portal/js/global/ug-service.js
index 6b620f2..95307b0 100644
--- a/portal/js/global/ug-service.js
+++ b/portal/js/global/ug-service.js
@@ -1,12 +1,19 @@
 'use strict';
 
-AppServices.Services.factory('ug', function (configuration, $rootScope,utility, $q, $http, $resource, $log) {
+AppServices.Services.factory('ug', function (configuration, $rootScope,utility, $q, $http, $resource, $log, $analytics,$location) {
 
   var requestTimes = [],
     running = false,
     currentRequests = {};
-  function reportError(data,config){
 
+  function reportError(data,config){
+    try {
+      $analytics.eventTrack('error', {
+        category: 'App Services', label: data + ':' + config.url + ':' + (sessionStorage['apigee_uuid'] || 'na')
+      });
+    } catch (e) {
+      console.log(e)
+    }
   };
   var getAccessToken = function(){
     return sessionStorage.getItem('accessToken');
@@ -20,6 +27,55 @@ AppServices.Services.factory('ug', function (configuration, $rootScope,utility,
       this.client().set(prop,value);
 
     },
+    getUrls: function(){
+      var host = $location.host();
+      var qs = $location.search();
+      var BASE_URL = '';
+      var DATA_URL = '';
+      var use_sso = false;
+      switch (true) {
+        case host === 'appservices.apigee.com' && location.pathname.indexOf('/dit') >= 0 :
+          //DIT
+          BASE_URL = 'https://accounts.jupiter.apigee.net';
+          DATA_URL = 'http://apigee-internal-prod.jupiter.apigee.net';
+          use_sso = true;
+          break;
+        case host === 'appservices.apigee.com' && location.pathname.indexOf('/mars') >= 0  :
+          //staging
+          BASE_URL = 'https://accounts.mars.apigee.net';
+          DATA_URL = 'http://apigee-internal-prod.mars.apigee.net';
+          use_sso = true;
+          break;
+        case host === 'appservices.apigee.com' :
+          //enterprise portals
+          DATA_URL = Usergrid.overrideUrl;
+          break;
+        case host === 'apigee.com' :
+          //prod
+          BASE_URL = 'https://accounts.apigee.com';
+          DATA_URL = 'https://api.usergrid.com';
+          use_sso = true;
+          break;
+        case host === 'usergrid.dev':
+          //development
+          DATA_URL = 'https://api.usergrid.com';
+          break;
+        default :
+          DATA_URL = Usergrid.overrideUrl;
+          break;
+      }
+      //override with querystring
+      DATA_URL = qs.api_url || DATA_URL;
+      DATA_URL = DATA_URL.lastIndexOf('/') === DATA_URL.length - 1 ? DATA_URL.substring(0,DATA_URL.length-1) : DATA_URL;
+      return {
+        DATA_URL: DATA_URL,
+        LOGIN_URL: BASE_URL + '/accounts/sign_in',
+        PROFILE_URL: BASE_URL + '/accounts/my_account',
+        LOGOUT_URL: BASE_URL + '/accounts/sign_out',
+        apiUrl: DATA_URL,
+        use_sso:use_sso
+      };
+    },
     orgLogin:function(username,password){
       var self = this;
       this.client().set('email', username);
@@ -34,7 +90,6 @@ AppServices.Services.factory('ug', function (configuration, $rootScope,utility,
         }
       });
     },
-
     checkAuthentication:function(force){
       var ug = this;
       var client = ug.client();
@@ -50,7 +105,6 @@ AppServices.Services.factory('ug', function (configuration, $rootScope,utility,
               for (key in  $rootScope.applications) {
                 if ($rootScope.applications.hasOwnProperty(key)) size++;
               }
-              $rootScope.addApplications = size < 10;
               $rootScope.$broadcast('checkAuthentication-success', client.getObject('organizations'), client.getObject('applications'), client.get('orgName'), client.get('appName'), client.get('email'));
             });
           },
@@ -126,6 +180,9 @@ AppServices.Services.factory('ug', function (configuration, $rootScope,utility,
       );
       return this._client;
     },
+    setClientProperty:function(key,value){
+      this.client().set(key, value);
+    },
     getTopCollections: function () {
       var options = {
         method:'GET',
@@ -442,7 +499,7 @@ AppServices.Services.factory('ug', function (configuration, $rootScope,utility,
     getIndexes: function (path) {
       var options = {
         method:'GET',
-        endpoint: path + '/indexes'
+        endpoint: path.split('/').concat('indexes').filter(function(bit){return bit && bit.length}).join('/') 
       }
       this.client().request(options, function (err, data) {
         if (err) {
@@ -914,8 +971,9 @@ AppServices.Services.factory('ug', function (configuration, $rootScope,utility,
           $rootScope.$broadcast('app-activities-received',data.entities);
         });
     },
-    getEntityActivities: function(entity){
-        var endpoint = entity.get('type') + '/' + entity.get('uuid') + '/activities' ;
+    getEntityActivities: function(entity, isFeed){
+        var route = isFeed ? 'feed' : 'activities'
+        var endpoint = entity.get('type') + '/' + entity.get('uuid') + '/'+route ;
         var options = {
           method:'GET',
           endpoint:endpoint,
@@ -923,12 +981,12 @@ AppServices.Services.factory('ug', function (configuration, $rootScope,utility,
         };
         this.client().request(options, function (err, data) {
           if(err){
-            $rootScope.$broadcast(entity.get('type')+'-activities-error',data);
+            $rootScope.$broadcast(entity.get('type')+'-'+route+'-error',data);
           }
           data.entities.forEach(function(entityInstance) {
             entityInstance.createdDate = (new Date( entityInstance.created)).toUTCString();
           });
-          $rootScope.$broadcast(entity.get('type')+'-activities-received',data.entities);
+          $rootScope.$broadcast(entity.get('type')+'-'+route+'-received',data.entities);
         });
     },
     addUserActivity:function(user,content){


[50/55] [abbrv] git commit: Added integration test

Posted by sn...@apache.org.
Added integration test


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/5a5644e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/5a5644e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/5a5644e7

Branch: refs/pull/76/merge
Commit: 5a5644e75be38700f214d3fe993d092328dc0369
Parents: e88af5a
Author: grey <gr...@apigee.com>
Authored: Wed Mar 19 11:40:51 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Wed Mar 19 11:40:51 2014 -0700

----------------------------------------------------------------------
 .../cassandra/ManagementServiceIT.java          | 62 +++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5a5644e7/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
index aa89f20..15ece91 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
@@ -1508,6 +1508,66 @@ public class ManagementServiceIT {
         exportService.doExport( jobExecution );
     }
 
+    @Ignore //For this test please input your s3 credentials into payload builder.
+    public void testIntegration100EntitiesOnOneOrg() throws Exception {
+
+        S3Export s3Export = new S3ExportImpl();
+        ExportService exportService = setup.getExportService();
+        HashMap<String, Object> payload = payloadBuilder();
+
+        payload.put("organizationId",organization.getUuid());
+        payload.put("applicationId",applicationId);
+
+        OrganizationInfo orgMade = null;
+        ApplicationInfo appMade = null;
+        for(int i = 0; i < 100; i++) {
+            orgMade =setup.getMgmtSvc().createOrganization( "superboss"+i,adminUser,true );
+            appMade = setup.getMgmtSvc().createApplication( orgMade.getUuid(), "superapp"+i);
+
+            EntityManager customMaker = setup.getEmf().getEntityManager( appMade.getId() );
+            customMaker.createApplicationCollection( "superappCol"+i );
+            //intialize user object to be posted
+            Map<String, Object> entityLevelProperties = null;
+            Entity[] entNotCopied;
+            entNotCopied = new Entity[20];
+            //creates entities
+            for ( int index = 0; index < 20; index++ ) {
+                entityLevelProperties = new LinkedHashMap<String, Object>();
+                entityLevelProperties.put( "username", "bobso" + index );
+                entityLevelProperties.put( "email", "derp" + index + "@anuff.com" );
+                entNotCopied[index] = customMaker.create( "superappCol", entityLevelProperties );
+            }
+        }
+
+        EntityManager em = setup.getEmf().getEntityManager( applicationId );
+        //intialize user object to be posted
+        Map<String, Object> userProperties = null;
+        Entity[] entity;
+        entity = new Entity[100];
+        //creates entities
+        for ( int i = 0; i < 100; i++ ) {
+            userProperties = new LinkedHashMap<String, Object>();
+            userProperties.put( "username", "billybob" + i );
+            userProperties.put( "email", "test" + i + "@anuff.com" );
+
+            entity[i] = em.create( "user", userProperties );
+        }
+
+        UUID exportUUID = exportService.schedule( payload );
+        exportService.setS3Export( s3Export );
+
+        //create and initialize jobData returned in JobExecution.
+        JobData jobData = new JobData();
+        jobData.setProperty( "jobName", "exportJob" );
+        jobData.setProperty( "exportInfo", payload );
+        jobData.setProperty( "exportId", exportUUID );
+
+        JobExecution jobExecution = mock( JobExecution.class );
+        when( jobExecution.getJobData() ).thenReturn( jobData );
+
+        exportService.doExport( jobExecution );
+    }
+
     /*Creates fake payload for testing purposes.*/
     public HashMap<String, Object> payloadBuilder() {
         HashMap<String, Object> payload = new HashMap<String, Object>();
@@ -1515,7 +1575,7 @@ public class ManagementServiceIT {
         Map<String, Object> storage_info = new HashMap<String, Object>();
         //        TODO: always put dummy values here and ignore this test.
         storage_info.put( "s3_key", "insert key here" );
-        storage_info.put( "s3_accessId", "insert access id here" );
+        storage_info.put( "s3_access_id", "insert access id here" );
         storage_info.put( "bucket_location", "insert bucket name here" );
 
         properties.put( "storage_provider", "s3" );


[51/55] [abbrv] git commit: Added integration test

Posted by sn...@apache.org.
Added integration test


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/5a5644e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/5a5644e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/5a5644e7

Branch: refs/pull/76/head
Commit: 5a5644e75be38700f214d3fe993d092328dc0369
Parents: e88af5a
Author: grey <gr...@apigee.com>
Authored: Wed Mar 19 11:40:51 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Wed Mar 19 11:40:51 2014 -0700

----------------------------------------------------------------------
 .../cassandra/ManagementServiceIT.java          | 62 +++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5a5644e7/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
index aa89f20..15ece91 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
@@ -1508,6 +1508,66 @@ public class ManagementServiceIT {
         exportService.doExport( jobExecution );
     }
 
+    @Ignore //For this test please input your s3 credentials into payload builder.
+    public void testIntegration100EntitiesOnOneOrg() throws Exception {
+
+        S3Export s3Export = new S3ExportImpl();
+        ExportService exportService = setup.getExportService();
+        HashMap<String, Object> payload = payloadBuilder();
+
+        payload.put("organizationId",organization.getUuid());
+        payload.put("applicationId",applicationId);
+
+        OrganizationInfo orgMade = null;
+        ApplicationInfo appMade = null;
+        for(int i = 0; i < 100; i++) {
+            orgMade =setup.getMgmtSvc().createOrganization( "superboss"+i,adminUser,true );
+            appMade = setup.getMgmtSvc().createApplication( orgMade.getUuid(), "superapp"+i);
+
+            EntityManager customMaker = setup.getEmf().getEntityManager( appMade.getId() );
+            customMaker.createApplicationCollection( "superappCol"+i );
+            //intialize user object to be posted
+            Map<String, Object> entityLevelProperties = null;
+            Entity[] entNotCopied;
+            entNotCopied = new Entity[20];
+            //creates entities
+            for ( int index = 0; index < 20; index++ ) {
+                entityLevelProperties = new LinkedHashMap<String, Object>();
+                entityLevelProperties.put( "username", "bobso" + index );
+                entityLevelProperties.put( "email", "derp" + index + "@anuff.com" );
+                entNotCopied[index] = customMaker.create( "superappCol", entityLevelProperties );
+            }
+        }
+
+        EntityManager em = setup.getEmf().getEntityManager( applicationId );
+        //intialize user object to be posted
+        Map<String, Object> userProperties = null;
+        Entity[] entity;
+        entity = new Entity[100];
+        //creates entities
+        for ( int i = 0; i < 100; i++ ) {
+            userProperties = new LinkedHashMap<String, Object>();
+            userProperties.put( "username", "billybob" + i );
+            userProperties.put( "email", "test" + i + "@anuff.com" );
+
+            entity[i] = em.create( "user", userProperties );
+        }
+
+        UUID exportUUID = exportService.schedule( payload );
+        exportService.setS3Export( s3Export );
+
+        //create and initialize jobData returned in JobExecution.
+        JobData jobData = new JobData();
+        jobData.setProperty( "jobName", "exportJob" );
+        jobData.setProperty( "exportInfo", payload );
+        jobData.setProperty( "exportId", exportUUID );
+
+        JobExecution jobExecution = mock( JobExecution.class );
+        when( jobExecution.getJobData() ).thenReturn( jobData );
+
+        exportService.doExport( jobExecution );
+    }
+
     /*Creates fake payload for testing purposes.*/
     public HashMap<String, Object> payloadBuilder() {
         HashMap<String, Object> payload = new HashMap<String, Object>();
@@ -1515,7 +1575,7 @@ public class ManagementServiceIT {
         Map<String, Object> storage_info = new HashMap<String, Object>();
         //        TODO: always put dummy values here and ignore this test.
         storage_info.put( "s3_key", "insert key here" );
-        storage_info.put( "s3_accessId", "insert access id here" );
+        storage_info.put( "s3_access_id", "insert access id here" );
         storage_info.put( "bucket_location", "insert bucket name here" );
 
         properties.put( "storage_provider", "s3" );


[22/55] [abbrv] git commit: Merge branch 'master' of github.com:usergrid/usergrid

Posted by sn...@apache.org.
Merge branch 'master' of github.com:usergrid/usergrid


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4fe9b9f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4fe9b9f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4fe9b9f7

Branch: refs/pull/76/head
Commit: 4fe9b9f7160511e06b5b510fad0ee44a0e604b24
Parents: 6b1c076 ab9fdf2
Author: Shawn Feldman <sh...@gmail.com>
Authored: Mon Mar 10 15:01:56 2014 -0600
Committer: Shawn Feldman <sh...@gmail.com>
Committed: Mon Mar 10 15:01:56 2014 -0600

----------------------------------------------------------------------
 .gitignore                                      |   9 +-
 .../org/apache/usergrid/persistence/Query.java  |   5 +-
 .../usergrid/persistence/entities/Export.java   | 158 +++++
 stack/pom.xml                                   |   3 +
 .../rest/management/ManagementResource.java     |  15 +-
 .../applications/ApplicationResource.java       | 181 ++++-
 .../rest/management/ManagementResourceIT.java   | 497 ++++++++++++-
 .../usergrid/management/export/ExportJob.java   |  81 +++
 .../management/export/ExportService.java        |  48 ++
 .../management/export/ExportServiceImpl.java    | 608 ++++++++++++++++
 .../usergrid/management/export/S3Export.java    |  35 +
 .../management/export/S3ExportImpl.java         | 109 +++
 .../services/AbstractCollectionService.java     |   3 +
 .../resources/usergrid-services-context.xml     |  10 +
 .../org/apache/usergrid/ServiceITSetup.java     |   3 +
 .../org/apache/usergrid/ServiceITSetupImpl.java |   6 +
 .../cassandra/ManagementServiceIT.java          | 707 ++++++++++++++++++-
 .../management/cassandra/MockS3ExportImpl.java  |  72 ++
 .../RepairingMismatchedApplicationMetadata.java |  73 ++
 19 files changed, 2602 insertions(+), 21 deletions(-)
----------------------------------------------------------------------



[17/55] [abbrv] git commit: ug-27666-rebase

Posted by sn...@apache.org.
ug-27666-rebase


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b309e5e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b309e5e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b309e5e7

Branch: refs/pull/76/head
Commit: b309e5e74f2b4dd1e58fcd13ae4a4116db779de2
Parents: 46dbb16 0254ee8
Author: Jackson Chung <ja...@apigee.com>
Authored: Fri Mar 7 21:39:54 2014 -0800
Committer: Jackson Chung <ja...@apigee.com>
Committed: Fri Mar 7 21:39:54 2014 -0800

----------------------------------------------------------------------
 .gitignore                                      |    18 +-
 README.md                                       |    29 +
 portal/.gitignore                               |     8 -
 portal/.puppet/.gitignore                       |     2 -
 portal/.puppet/Puppetfile                       |     3 -
 portal/.puppet/Puppetfile.lock                  |    12 -
 portal/.puppet/bootstrap.sh                     |    18 -
 portal/.puppet/manifests/main.pp                |    49 -
 portal/.puppet/modules/.gitignore               |     2 -
 portal/.puppet/templates/vhost-ssl.conf.erb     |    33 -
 portal/Deployment.md                            |    23 +
 portal/Gruntfile.js                             |   356 +
 portal/LICENSE                                  |   202 -
 portal/README.md                                |   273 +-
 portal/UnitTests.md                             |    24 +
 portal/Vagrantfile                              |    23 -
 portal/archive/coming_soon.html                 |    31 +
 .../ui-bg_diagonals-thick_90_eeeeee_40x40.png   |   Bin 0 -> 251 bytes
 .../images/ui-bg_flat_100_deedf7_40x100.png     |   Bin 0 -> 182 bytes
 .../images/ui-bg_flat_100_e4f1fb_40x100.png     |   Bin 0 -> 213 bytes
 .../images/ui-bg_flat_100_f2f5f7_40x100.png     |   Bin 0 -> 212 bytes
 .../images/ui-bg_flat_15_cd0a0a_40x100.png      |   Bin 0 -> 181 bytes
 .../images/ui-bg_flat_50_3baae3_40x100.png      |   Bin 0 -> 182 bytes
 .../images/ui-bg_flat_80_d7ebf9_40x100.png      |   Bin 0 -> 183 bytes
 .../ui-bg_highlight-hard_70_000000_1x100.png    |   Bin 0 -> 118 bytes
 .../ui-bg_highlight-soft_25_ffef8f_1x100.png    |   Bin 0 -> 153 bytes
 .../images/ui-icons_000000_256x240.png          |   Bin 0 -> 4369 bytes
 .../images/ui-icons_2694e8_256x240.png          |   Bin 0 -> 4369 bytes
 .../images/ui-icons_2e83ff_256x240.png          |   Bin 0 -> 4369 bytes
 .../images/ui-icons_3d80b3_256x240.png          |   Bin 0 -> 4369 bytes
 .../images/ui-icons_72a7cf_256x240.png          |   Bin 0 -> 4369 bytes
 .../images/ui-icons_ffffff_256x240.png          |   Bin 0 -> 4369 bytes
 .../css/custom-theme/jquery-ui-1.8.9.custom.css |   573 +
 portal/archive/css/jquery-ui-timepicker.css     |    53 +
 portal/archive/css/jquery.ui.statusbar.css      |    25 +
 portal/archive/css/prettify.css                 |    52 +
 portal/archive/css/usergrid-stripped.css        |  5199 ++
 portal/archive/css/usergrid.css                 |  5203 ++
 portal/archive/dash/README.md                   |     3 +
 .../archive/dash/config/testacular-e2e.conf.js  |    22 +
 portal/archive/dash/config/testacular.conf.js   |    20 +
 portal/archive/dash/test/e2e/runner.html        |    10 +
 portal/archive/dash/test/e2e/scenarios.js       |    45 +
 .../dash/test/lib/angular/angular-mocks.js      |  1764 +
 .../dash/test/lib/angular/angular-scenario.js   | 26195 +++++++
 .../archive/dash/test/lib/angular/version.txt   |     1 +
 .../archive/dash/test/unit/controllersSpec.js   |    31 +
 portal/archive/dash/test/unit/directivesSpec.js |    19 +
 portal/archive/dash/test/unit/filtersSpec.js    |    19 +
 portal/archive/dash/test/unit/servicesSpec.js   |    14 +
 portal/archive/images/APNS_cert_upload.png      |   Bin 0 -> 33956 bytes
 portal/archive/images/APNS_certification.png    |   Bin 0 -> 16855 bytes
 portal/archive/images/android-notification.png  |   Bin 0 -> 41629 bytes
 portal/archive/images/android-sdk-download.png  |   Bin 0 -> 4848 bytes
 portal/archive/images/api-activity.gif          |   Bin 0 -> 10819 bytes
 portal/archive/images/apigee-logo.png           |   Bin 0 -> 3647 bytes
 portal/archive/images/apigeetopbar.png          |   Bin 0 -> 4658 bytes
 portal/archive/images/background_one_col.png    |   Bin 0 -> 3126 bytes
 portal/archive/images/btn-copyCurl-up.png       |   Bin 0 -> 2762 bytes
 portal/archive/images/clippy-bg.png             |   Bin 0 -> 561 bytes
 portal/archive/images/close.gif                 |   Bin 0 -> 718 bytes
 portal/archive/images/dotnet-sdk-download.png   |   Bin 0 -> 7149 bytes
 portal/archive/images/down_arrow.png            |   Bin 0 -> 1285 bytes
 portal/archive/images/error.png                 |   Bin 0 -> 2009 bytes
 portal/archive/images/faviconApigee.ico         |   Bin 0 -> 1150 bytes
 .../images/glyphicons-halflings-white.png       |   Bin 0 -> 4352 bytes
 portal/archive/images/glyphicons-halflings.png  |   Bin 0 -> 4352 bytes
 .../glyphicons_halflings_135_wrench-white2.pdn  |   Bin 0 -> 5400 bytes
 .../glyphicons_halflings_135_wrench-white2.png  |   Bin 0 -> 296 bytes
 .../images/glyphicons_halflings_135_wrench.png  |   Bin 0 -> 228 bytes
 .../glyphicons_halflings_135_wrench_white.png   |   Bin 0 -> 251 bytes
 .../glyphicons_halflings_wrench_white.png       |   Bin 0 -> 1016 bytes
 portal/archive/images/google_api_key.png        |   Bin 0 -> 98118 bytes
 portal/archive/images/green_dot.png             |   Bin 0 -> 3472 bytes
 portal/archive/images/grid.png                  |   Bin 0 -> 166 bytes
 portal/archive/images/icons.png                 |   Bin 0 -> 13132 bytes
 portal/archive/images/ios-sdk-download.png      |   Bin 0 -> 4886 bytes
 portal/archive/images/iphone_message.png        |   Bin 0 -> 90307 bytes
 .../archive/images/javascript-sdk-download.png  |   Bin 0 -> 4618 bytes
 portal/archive/images/left_arrow.png            |   Bin 0 -> 1257 bytes
 portal/archive/images/logo-white.png            |   Bin 0 -> 2014 bytes
 portal/archive/images/menuActiveTriangle.png    |   Bin 0 -> 315 bytes
 portal/archive/images/nodejs-sdk-download.png   |   Bin 0 -> 5273 bytes
 portal/archive/images/notice.png                |   Bin 0 -> 2112 bytes
 portal/archive/images/orange-arrow.png          |   Bin 0 -> 242 bytes
 .../archive/images/push_notifications_icon.png  |   Bin 0 -> 338 bytes
 portal/archive/images/red_dot.png               |   Bin 0 -> 3482 bytes
 portal/archive/images/right_arrow.png           |   Bin 0 -> 1251 bytes
 portal/archive/images/ruby-sdk-download.png     |   Bin 0 -> 6343 bytes
 portal/archive/images/step_1.png                |   Bin 0 -> 1953 bytes
 portal/archive/images/step_2.png                |   Bin 0 -> 2117 bytes
 portal/archive/images/step_3.png                |   Bin 0 -> 2162 bytes
 portal/archive/images/success.png               |   Bin 0 -> 1863 bytes
 portal/archive/images/swish_arrow.png           |   Bin 0 -> 220 bytes
 portal/archive/images/topbackground.png         |   Bin 0 -> 2890 bytes
 portal/archive/images/up_arrow.png              |   Bin 0 -> 1292 bytes
 portal/archive/images/user-photo.png            |   Bin 0 -> 3849 bytes
 portal/archive/images/user_profile.png          |   Bin 0 -> 3775 bytes
 portal/archive/images/usergrid_200.png          |   Bin 0 -> 6397 bytes
 portal/archive/images/usergrid_400.png          |   Bin 0 -> 8746 bytes
 portal/archive/images/warning.png               |   Bin 0 -> 1179 bytes
 portal/archive/images/yellow_dot.png            |   Bin 0 -> 3475 bytes
 portal/archive/index-stripped2.html             |  1795 +
 portal/archive/index.html                       |  1910 +
 portal/archive/js/app/app.js                    |   131 +
 portal/archive/js/app/console.js                |  5393 ++
 portal/archive/js/app/helpers.js                |   241 +
 portal/archive/js/app/navigation.js             |   251 +
 portal/archive/js/app/pages.js                  |   161 +
 portal/archive/js/app/params.js                 |    30 +
 portal/archive/js/app/quickLogin.js             |    30 +
 portal/archive/js/app/session.js                |   176 +
 portal/archive/js/app/sso.js                    |   135 +
 portal/archive/js/app/status.js                 |    37 +
 portal/archive/js/app/ui/collections.entity.js  |   320 +
 portal/archive/js/app/ui/collections.user.js    |   120 +
 portal/archive/js/app/ui/ui.js                  |   415 +
 portal/archive/js/app/usergrid.appSDK.js        |  2097 +
 portal/archive/js/app/usergrid.appSDK.orig.js   |  2070 +
 portal/archive/js/lib/MD5.min.js                |     1 +
 portal/archive/js/lib/backbone.js               |  1431 +
 portal/archive/js/lib/bootstrap.min.js          |     7 +
 portal/archive/js/lib/date.min.js               |     2 +
 portal/archive/js/lib/jquery-1.7.2.min.js       |     4 +
 portal/archive/js/lib/jquery-ui-1.8.18.min.js   |    15 +
 portal/archive/js/lib/jquery.dataset.min.js     |     1 +
 portal/archive/js/lib/jquery.dform-0.1.3.min.js |    16 +
 portal/archive/js/lib/jquery.jsonp-2.3.1.min.js |     3 +
 portal/archive/js/lib/jquery.tmpl.min.js        |    10 +
 .../archive/js/lib/jquery.ui.statusbar.min.js   |     1 +
 .../archive/js/lib/jquery.ui.timepicker.min.js  |     1 +
 portal/archive/js/lib/prettify.js               |  1477 +
 portal/archive/js/lib/underscore-min.js         |     5 +
 portal/archive/js/spec/client-tests.js          |   159 +
 portal/archive/js/spec/index.html               |    20 +
 portal/archive/js/spec/qunit-git.css            |   238 +
 portal/archive/js/spec/qunit-git.js             |  1865 +
 portal/archive/js/unit-tests/appSDK-tests.js    |   255 +
 portal/archive/js/unit-tests/ie-jquery-tests.js |   191 +
 portal/archive/js/unit-tests/qunit.css          |   231 +
 portal/archive/js/unit-tests/qunit.js           |  1934 +
 portal/archive/loading.html                     |     9 +
 portal/archive/max/index.html                   |     0
 portal/archive/planned_outage.html              |    48 +
 portal/archive/push/index.html                  |    34 +
 portal/archive/service_down.html                |    48 +
 .../apigee.ui.activities.table_rows.html        |    14 +
 .../templates/apigee.ui.admins.table_rows.html  |     8 +
 .../apigee.ui.applications.table_rows.html      |     4 +
 .../apigee.ui.collection.table_rows.html        |    67 +
 .../apigee.ui.collections.query.indexes.html    |     5 +
 .../apigee.ui.collections.table_rows.html       |     9 +
 .../apigee.ui.collections.user.header.html      |    21 +
 .../templates/apigee.ui.curl.detail.html        |    11 +
 .../templates/apigee.ui.feed.table_rows.html    |    15 +
 .../templates/apigee.ui.groups.table_rows.html  |    14 +
 .../apigee.ui.panels.group.activities.html      |    28 +
 .../apigee.ui.panels.group.details.html         |    97 +
 .../apigee.ui.panels.group.memberships.html     |    40 +
 .../apigee.ui.panels.group.permissions.html     |    99 +
 ...pigee.ui.panels.notifications.configure.html |    14 +
 .../apigee.ui.panels.role.permissions.html      |    58 +
 .../templates/apigee.ui.panels.role.users.html  |    38 +
 .../apigee.ui.panels.user.activities.html       |    40 +
 .../templates/apigee.ui.panels.user.graph.html  |    80 +
 .../apigee.ui.panels.user.memberships.html      |    40 +
 .../apigee.ui.panels.user.permissions.html      |   105 +
 .../apigee.ui.panels.user.profile.html          |   113 +
 .../apigee.ui.role.groups.table_rows.html       |    44 +
 .../templates/apigee.ui.roles.table_rows.html   |    15 +
 .../templates/apigee.ui.users.table_rows.html   |    18 +
 portal/archive/templates/test/modalForm2.html   |    32 +
 portal/archive/test/autocomplete.html           |    25 +
 portal/archive/test/modalForm.html              |    32 +
 portal/bower.json                               |    13 +
 portal/build.sh                                 |    34 +
 portal/coming_soon.html                         |    31 -
 portal/config.js                                |    80 +-
 portal/css/apigeeGlobalNavigation.css           |   274 +
 .../css/arsmarquette/ARSMaquettePro-Light.otf   |   Bin 0 -> 184600 bytes
 .../css/arsmarquette/ARSMaquettePro-Medium.otf  |   Bin 0 -> 188020 bytes
 .../css/arsmarquette/ARSMaquettePro-Regular.otf |   Bin 0 -> 188096 bytes
 .../ui-bg_diagonals-thick_90_eeeeee_40x40.png   |   Bin 251 -> 0 bytes
 .../images/ui-bg_flat_100_deedf7_40x100.png     |   Bin 182 -> 0 bytes
 .../images/ui-bg_flat_100_e4f1fb_40x100.png     |   Bin 213 -> 0 bytes
 .../images/ui-bg_flat_100_f2f5f7_40x100.png     |   Bin 212 -> 0 bytes
 .../images/ui-bg_flat_15_cd0a0a_40x100.png      |   Bin 181 -> 0 bytes
 .../images/ui-bg_flat_50_3baae3_40x100.png      |   Bin 182 -> 0 bytes
 .../images/ui-bg_flat_80_d7ebf9_40x100.png      |   Bin 183 -> 0 bytes
 .../ui-bg_highlight-hard_70_000000_1x100.png    |   Bin 118 -> 0 bytes
 .../ui-bg_highlight-soft_25_ffef8f_1x100.png    |   Bin 153 -> 0 bytes
 .../images/ui-icons_000000_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_2694e8_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_2e83ff_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_3d80b3_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_72a7cf_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_ffffff_256x240.png          |   Bin 4369 -> 0 bytes
 .../css/custom-theme/jquery-ui-1.8.9.custom.css |   573 -
 portal/css/dash.min.css                         |     1 +
 portal/css/entypo/entypo.eot                    |   Bin 0 -> 35540 bytes
 portal/css/entypo/entypo.svg                    |    13 +
 portal/css/entypo/entypo.ttf                    |   Bin 0 -> 35392 bytes
 portal/css/entypo/entypo.woff                   |   Bin 0 -> 21916 bytes
 portal/css/jquery-ui-timepicker.css             |    53 -
 portal/css/jquery.ui.statusbar.css              |    25 -
 portal/css/main.css                             |  1705 +
 portal/css/prettify.css                         |    52 -
 portal/css/usergrid.css                         |  6358 --
 portal/images/android-sdk-download.png          |   Bin 4848 -> 0 bytes
 portal/images/api-activity.gif                  |   Bin 10819 -> 0 bytes
 portal/images/apigee-logo.png                   |   Bin 3647 -> 0 bytes
 portal/images/apigeetopbar.png                  |   Bin 4658 -> 0 bytes
 portal/images/btn-copyCurl-up.png               |   Bin 2762 -> 0 bytes
 portal/images/clippy-bg.png                     |   Bin 561 -> 0 bytes
 portal/images/close.gif                         |   Bin 718 -> 0 bytes
 portal/images/dotnet-sdk-download.png           |   Bin 7149 -> 0 bytes
 portal/images/down_arrow.png                    |   Bin 1285 -> 0 bytes
 portal/images/error.png                         |   Bin 2009 -> 0 bytes
 portal/images/faviconApigee.ico                 |   Bin 1150 -> 0 bytes
 portal/images/glyphicons-halflings-white.png    |   Bin 4352 -> 0 bytes
 portal/images/glyphicons-halflings.png          |   Bin 4352 -> 0 bytes
 .../glyphicons_halflings_135_wrench-white2.pdn  |   Bin 5400 -> 0 bytes
 .../glyphicons_halflings_135_wrench-white2.png  |   Bin 296 -> 0 bytes
 .../images/glyphicons_halflings_135_wrench.png  |   Bin 228 -> 0 bytes
 .../glyphicons_halflings_135_wrench_white.png   |   Bin 251 -> 0 bytes
 .../glyphicons_halflings_wrench_white.png       |   Bin 1016 -> 0 bytes
 portal/images/grid.png                          |   Bin 166 -> 0 bytes
 portal/images/icons.png                         |   Bin 13132 -> 0 bytes
 portal/images/ios-sdk-download.png              |   Bin 4886 -> 0 bytes
 portal/images/javascript-sdk-download.png       |   Bin 4618 -> 0 bytes
 portal/images/left_arrow.png                    |   Bin 1257 -> 0 bytes
 portal/images/logo-white.png                    |   Bin 2014 -> 0 bytes
 portal/images/menuActiveTriangle.png            |   Bin 315 -> 0 bytes
 portal/images/nodejs-sdk-download.png           |   Bin 5273 -> 0 bytes
 portal/images/notice.png                        |   Bin 2112 -> 0 bytes
 portal/images/orange-arrow.png                  |   Bin 242 -> 0 bytes
 portal/images/right_arrow.png                   |   Bin 1251 -> 0 bytes
 portal/images/ruby-sdk-download.png             |   Bin 6343 -> 0 bytes
 portal/images/success.png                       |   Bin 1863 -> 0 bytes
 portal/images/swish_arrow.png                   |   Bin 220 -> 0 bytes
 portal/images/topbackground.png                 |   Bin 2890 -> 0 bytes
 portal/images/up_arrow.png                      |   Bin 1292 -> 0 bytes
 portal/images/user-photo.png                    |   Bin 3849 -> 0 bytes
 portal/images/user_profile.png                  |   Bin 3775 -> 0 bytes
 portal/images/usergrid_200.png                  |   Bin 6397 -> 0 bytes
 portal/images/usergrid_400.png                  |   Bin 8746 -> 0 bytes
 portal/images/warning.png                       |   Bin 1179 -> 0 bytes
 portal/img/appswitcher/apiPlatform_lg.png       |   Bin 0 -> 2397 bytes
 portal/img/appswitcher/appServices_lg.png       |   Bin 0 -> 2295 bytes
 portal/img/appswitcher/console_lg.png           |   Bin 0 -> 1453 bytes
 portal/img/appswitcher/home_lg.png              |   Bin 0 -> 1522 bytes
 portal/img/appswitcher/logo_color.png           |   Bin 0 -> 3459 bytes
 portal/img/appswitcher/max_lg.png               |   Bin 0 -> 1970 bytes
 .../img/appswitcher/triangleMenuItem_right.png  |   Bin 0 -> 1158 bytes
 .../triangleMenuItem_right_hover.png            |   Bin 0 -> 1169 bytes
 portal/img/blue-bars.png                        |   Bin 0 -> 3635 bytes
 portal/img/blue-bolt.png                        |   Bin 0 -> 3942 bytes
 portal/img/blue-carat.png                       |   Bin 0 -> 1006 bytes
 portal/img/green_dot.png                        |   Bin 0 -> 3472 bytes
 portal/img/logo.gif                             |   Bin 0 -> 2279 bytes
 portal/img/nav-device.gif                       |   Bin 0 -> 2184 bytes
 portal/img/nav-sprites.png                      |   Bin 0 -> 7953 bytes
 portal/img/no-data1.png                         |   Bin 0 -> 45300 bytes
 portal/img/phone-small.gif                      |   Bin 0 -> 1300 bytes
 portal/img/push/APNS_cert_upload.png            |   Bin 0 -> 33956 bytes
 portal/img/push/APNS_certification.png          |   Bin 0 -> 16855 bytes
 portal/img/push/android-notification.png        |   Bin 0 -> 41629 bytes
 portal/img/push/google_api_key.png              |   Bin 0 -> 98118 bytes
 portal/img/push/iphone_message.png              |   Bin 0 -> 90307 bytes
 portal/img/push/step_1.png                      |   Bin 0 -> 1953 bytes
 portal/img/push/step_2.png                      |   Bin 0 -> 2117 bytes
 portal/img/push/step_3.png                      |   Bin 0 -> 2162 bytes
 portal/img/red_dot.png                          |   Bin 0 -> 3482 bytes
 portal/img/sdk-sprites-large.png                |   Bin 0 -> 14642 bytes
 portal/img/sdk-sprites.png                      |   Bin 0 -> 5027 bytes
 portal/img/tablet-small.gif                     |   Bin 0 -> 1390 bytes
 portal/img/user-photo.png                       |   Bin 0 -> 3849 bytes
 portal/img/user_profile.png                     |   Bin 0 -> 3775 bytes
 portal/img/verify.png                           |   Bin 0 -> 22934 bytes
 portal/img/yellow_dot.png                       |   Bin 0 -> 3475 bytes
 portal/index-debug.html                         |   128 +
 portal/index-template.html                      |   129 +
 portal/index.html                               |  1498 +-
 portal/js/activities/activities-controller.js   |    11 +
 portal/js/activities/activities.html            |    33 +
 .../js/app-overview/app-overview-controller.js  |    75 +
 portal/js/app-overview/app-overview.html        |    30 +
 .../js/app-overview/doc-includes/android.html   |   209 +
 portal/js/app-overview/doc-includes/ios.html    |   173 +
 .../app-overview/doc-includes/javascript.html   |    94 +
 portal/js/app-overview/doc-includes/net.html    |     0
 portal/js/app-overview/doc-includes/node.html   |     0
 portal/js/app-overview/doc-includes/ruby.html   |     0
 .../app-overview/getting-started-controller.js  |    89 +
 portal/js/app-overview/getting-started.html     |   119 +
 portal/js/app.js                                |   115 +
 portal/js/app/app.js                            |   118 -
 portal/js/app/console.js                        |  4536 --
 portal/js/app/helpers.js                        |   241 -
 portal/js/app/navigation.js                     |   189 -
 portal/js/app/pages.js                          |   154 -
 portal/js/app/params.js                         |    30 -
 portal/js/app/quickLogin.js                     |    30 -
 portal/js/app/session.js                        |   172 -
 portal/js/app/sso.js                            |    89 -
 portal/js/app/status.js                         |    33 -
 portal/js/app/ui/collections.entity.js          |   320 -
 portal/js/app/ui/collections.user.js            |   120 -
 portal/js/app/ui/ui.js                          |   415 -
 portal/js/app/usergrid.appSDK.js                |  2073 -
 portal/js/app/usergrid.appSDK.orig.js           |  2070 -
 portal/js/charts/chart-controller.js            |     6 +
 portal/js/charts/chart-directives.js            |   141 +
 portal/js/charts/chart-service.js               |   494 +
 portal/js/charts/highcharts.json                |   329 +
 portal/js/charts/sparklines.js                  |     2 +
 portal/js/data/data-controller.js               |   304 +
 portal/js/data/data.html                        |   114 +
 portal/js/data/display-generic.html             |    95 +
 portal/js/data/display-groups.html              |     0
 portal/js/data/display-roles.html               |     1 +
 portal/js/data/display-users.html               |    88 +
 portal/js/data/entity-controller.js             |    69 +
 portal/js/data/entity.html                      |    31 +
 portal/js/data/shell-controller.js              |     9 +
 portal/js/data/shell.html                       |    16 +
 portal/js/dialogs/balloon-directive.js          |    25 +
 portal/js/dialogs/modal-directive.js            |    41 +
 portal/js/dialogs/modal.html                    |    16 +
 portal/js/global/alert-controller.js            |    33 +
 portal/js/global/alert-directive.js             |    40 +
 portal/js/global/app-switcher-directive.js      |    35 +
 portal/js/global/appswitcher-template.html      |    34 +
 portal/js/global/insecure-banner.html           |     7 +
 portal/js/global/insecure-banner.js             |    46 +
 portal/js/global/page-constants.js              |    11 +
 portal/js/global/page-controller.js             |   414 +
 portal/js/global/page-title.html                |    17 +
 portal/js/global/page-title.js                  |    31 +
 portal/js/global/temp.json                      |    18 +
 portal/js/global/ug-service.js                  |  1175 +
 portal/js/global/util-directive.js              |    24 +
 portal/js/global/utility-service.js             |    52 +
 portal/js/global/validate-directive.js          |    40 +
 .../js/groups/groups-activities-controller.js   |    27 +
 portal/js/groups/groups-activities.html         |    24 +
 portal/js/groups/groups-controller.js           |   119 +
 portal/js/groups/groups-details-controller.js   |    38 +
 portal/js/groups/groups-details.html            |    28 +
 portal/js/groups/groups-members-controller.js   |   113 +
 portal/js/groups/groups-members.html            |    60 +
 portal/js/groups/groups-roles-controller.js     |   184 +
 portal/js/groups/groups-roles.html              |   127 +
 portal/js/groups/groups-tabs.html               |    31 +
 portal/js/groups/groups.html                    |    81 +
 portal/js/lib/MD5.min.js                        |     1 -
 portal/js/lib/backbone.js                       |  1431 -
 portal/js/lib/bootstrap.min.js                  |     7 -
 portal/js/lib/date.min.js                       |     2 -
 portal/js/lib/jquery-1.7.2.min.js               |     4 -
 portal/js/lib/jquery-ui-1.8.18.min.js           |    15 -
 portal/js/lib/jquery.dataset.min.js             |     1 -
 portal/js/lib/jquery.dform-0.1.3.min.js         |    16 -
 portal/js/lib/jquery.jsonp-2.3.1.min.js         |     3 -
 portal/js/lib/jquery.tmpl.min.js                |    10 -
 portal/js/lib/jquery.ui.statusbar.min.js        |     1 -
 portal/js/lib/jquery.ui.timepicker.min.js       |     1 -
 portal/js/lib/prettify.js                       |  1477 -
 portal/js/lib/underscore-min.js                 |     5 -
 portal/js/libs/Highcharts-2.3.5/index.htm       |    79 +
 .../js/adapters/mootools-adapter.js             |    13 +
 .../js/adapters/mootools-adapter.src.js         |   328 +
 .../js/adapters/prototype-adapter.js            |    16 +
 .../js/adapters/prototype-adapter.src.js        |   385 +
 .../libs/Highcharts-2.3.5/js/highcharts-more.js |    35 +
 .../Highcharts-2.3.5/js/highcharts-more.src.js  |  1581 +
 .../js/libs/Highcharts-2.3.5/js/highcharts.js   |   250 +
 .../libs/Highcharts-2.3.5/js/highcharts.src.js  | 15281 ++++
 .../Highcharts-2.3.5/js/modules/canvas-tools.js |   133 +
 .../js/modules/canvas-tools.src.js              |  3113 +
 .../js/libs/Highcharts-2.3.5/js/modules/data.js |    14 +
 .../Highcharts-2.3.5/js/modules/data.src.js     |   512 +
 .../Highcharts-2.3.5/js/modules/exporting.js    |    23 +
 .../js/modules/exporting.src.js                 |   752 +
 .../Highcharts-2.3.5/js/themes/dark-blue.js     |   263 +
 .../Highcharts-2.3.5/js/themes/dark-green.js    |   263 +
 .../js/libs/Highcharts-2.3.5/js/themes/gray.js  |   262 +
 .../js/libs/Highcharts-2.3.5/js/themes/grid.js  |    95 +
 .../js/libs/Highcharts-2.3.5/js/themes/skies.js |    89 +
 portal/js/libs/MD5.min.js                       |     1 +
 portal/js/libs/angular-1.0.5/angular-cookies.js |   183 +
 .../libs/angular-1.0.5/angular-cookies.min.js   |     7 +
 portal/js/libs/angular-1.0.5/angular-loader.js  |   276 +
 .../js/libs/angular-1.0.5/angular-loader.min.js |     7 +
 portal/js/libs/angular-1.0.5/angular-mocks.js   |  1886 +
 .../js/libs/angular-1.0.5/angular-resource.js   |   445 +
 .../libs/angular-1.0.5/angular-resource.min.js  |    10 +
 .../js/libs/angular-1.0.5/angular-sanitize.js   |   535 +
 .../libs/angular-1.0.5/angular-sanitize.min.js  |    13 +
 portal/js/libs/angular-1.0.5/angular.js         | 14733 ++++
 portal/js/libs/angular-1.0.5/angular.min.js     |   161 +
 portal/js/libs/angular-1.0.5/version.txt        |     1 +
 portal/js/libs/angular-1.1.5/angular-1.1.5.js   | 16876 +++++
 .../js/libs/angular-1.1.5/angular-merge.min.js  |     8 +
 .../angular-1.1.5/angular-resource-1.1.5.js     |   537 +
 portal/js/libs/angular-1.2.5/angular-animate.js |  1323 +
 .../libs/angular-1.2.5/angular-animate.min.js   |    23 +
 .../angular-1.2.5/angular-animate.min.js.map    |     8 +
 portal/js/libs/angular-1.2.5/angular-cookies.js |   202 +
 .../libs/angular-1.2.5/angular-cookies.min.js   |     8 +
 .../angular-1.2.5/angular-cookies.min.js.map    |     8 +
 portal/js/libs/angular-1.2.5/angular-csp.css    |    24 +
 portal/js/libs/angular-1.2.5/angular-loader.js  |   410 +
 .../js/libs/angular-1.2.5/angular-loader.min.js |     9 +
 .../angular-1.2.5/angular-loader.min.js.map     |     8 +
 portal/js/libs/angular-1.2.5/angular-mocks.js   |  2116 +
 .../js/libs/angular-1.2.5/angular-resource.js   |   565 +
 .../libs/angular-1.2.5/angular-resource.min.js  |    13 +
 .../angular-1.2.5/angular-resource.min.js.map   |     8 +
 portal/js/libs/angular-1.2.5/angular-route.js   |   911 +
 .../js/libs/angular-1.2.5/angular-route.min.js  |    14 +
 .../libs/angular-1.2.5/angular-route.min.js.map |     8 +
 .../js/libs/angular-1.2.5/angular-sanitize.js   |   622 +
 .../libs/angular-1.2.5/angular-sanitize.min.js  |    14 +
 .../angular-1.2.5/angular-sanitize.min.js.map   |     8 +
 .../js/libs/angular-1.2.5/angular-scenario.js   | 32374 +++++++++
 portal/js/libs/angular-1.2.5/angular-touch.js   |   563 +
 .../js/libs/angular-1.2.5/angular-touch.min.js  |    13 +
 .../libs/angular-1.2.5/angular-touch.min.js.map |     8 +
 portal/js/libs/angular-1.2.5/angular.js         | 20369 ++++++
 portal/js/libs/angular-1.2.5/angular.min.js     |   201 +
 portal/js/libs/angular-1.2.5/angular.min.js.map |     8 +
 portal/js/libs/angular-1.2.5/errors.json        |     1 +
 portal/js/libs/angular-1.2.5/version.json       |     1 +
 portal/js/libs/angular-1.2.5/version.txt        |     1 +
 .../angularitics-0.8.5-google-analytics.js      |     7 +
 .../js/libs/angularitics/angularitics-0.8.5.js  |     6 +
 .../libs/bootstrap/css/bootstrap-responsive.css |  1345 +
 .../bootstrap/css/bootstrap-responsive.min.css  |  1245 +
 portal/js/libs/bootstrap/css/bootstrap.css      |  6169 ++
 portal/js/libs/bootstrap/css/bootstrap.min.css  |  5469 ++
 .../js/libs/bootstrap/custom/css/bootstrap.css  |  6315 ++
 .../libs/bootstrap/custom/css/bootstrap.min.css |     9 +
 .../custom/img/glyphicons-halflings-white.png   |   Bin 0 -> 8777 bytes
 .../custom/img/glyphicons-halflings.png         |   Bin 0 -> 12799 bytes
 portal/js/libs/bootstrap/custom/js/bootstrap.js |  2291 +
 .../libs/bootstrap/custom/js/bootstrap.min.js   |     7 +
 .../img/glyphicons-halflings-white.png          |   Bin 0 -> 8777 bytes
 .../libs/bootstrap/img/glyphicons-halflings.png |   Bin 0 -> 12799 bytes
 portal/js/libs/bootstrap/js/bootstrap.js        |  2117 +
 portal/js/libs/bootstrap/js/bootstrap.min.js    |   644 +
 portal/js/libs/google-viz-api.js                |    49 +
 portal/js/libs/jquery/jquery-1.9.1.min.js       |     5 +
 .../js/libs/jquery/jquery-migrate-1.1.1.min.js  |     3 +
 portal/js/libs/jquery/jquery.sparkline.min.js   |     5 +
 portal/js/libs/jqueryui/date.min.js             |     2 +
 .../ui-bg_diagonals-thick_90_eeeeee_40x40.png   |   Bin 0 -> 251 bytes
 .../images/ui-bg_flat_100_deedf7_40x100.png     |   Bin 0 -> 182 bytes
 .../images/ui-bg_flat_100_e4f1fb_40x100.png     |   Bin 0 -> 213 bytes
 .../images/ui-bg_flat_100_f2f5f7_40x100.png     |   Bin 0 -> 212 bytes
 .../images/ui-bg_flat_15_cd0a0a_40x100.png      |   Bin 0 -> 181 bytes
 .../images/ui-bg_flat_50_3baae3_40x100.png      |   Bin 0 -> 182 bytes
 .../images/ui-bg_flat_80_d7ebf9_40x100.png      |   Bin 0 -> 183 bytes
 .../ui-bg_highlight-hard_70_000000_1x100.png    |   Bin 0 -> 118 bytes
 .../ui-bg_highlight-soft_25_ffef8f_1x100.png    |   Bin 0 -> 153 bytes
 .../jqueryui/images/ui-icons_000000_256x240.png |   Bin 0 -> 4369 bytes
 .../jqueryui/images/ui-icons_2694e8_256x240.png |   Bin 0 -> 4369 bytes
 .../jqueryui/images/ui-icons_2e83ff_256x240.png |   Bin 0 -> 4369 bytes
 .../jqueryui/images/ui-icons_3d80b3_256x240.png |   Bin 0 -> 4369 bytes
 .../jqueryui/images/ui-icons_72a7cf_256x240.png |   Bin 0 -> 4369 bytes
 .../jqueryui/images/ui-icons_ffffff_256x240.png |   Bin 0 -> 4369 bytes
 portal/js/libs/jqueryui/jquery-ui-1.8.18.min.js |    15 +
 .../js/libs/jqueryui/jquery-ui-1.8.9.custom.css |     1 +
 .../js/libs/jqueryui/jquery-ui-timepicker.css   |     1 +
 .../libs/jqueryui/jquery.ui.timepicker.min.js   |     1 +
 .../ui-bootstrap-custom-0.3.0.min.js            |     1 +
 .../ui-bootstrap-custom-tpls-0.3.0.min.js       |     1 +
 portal/js/libs/usergrid-libs.min.js             |    22 +
 portal/js/libs/usergrid.sdk.js                  |  2469 +
 portal/js/login/forgot-password-controller.js   |    13 +
 portal/js/login/forgot-password.html            |     5 +
 portal/js/login/loading.html                    |     3 +
 portal/js/login/login-controller.js             |    83 +
 portal/js/login/login.html                      |    48 +
 portal/js/login/logout-controller.js            |    10 +
 portal/js/login/logout.html                     |     1 +
 portal/js/login/register-controller.js          |    36 +
 portal/js/login/register.html                   |    80 +
 portal/js/menus/appMenu.html                    |    41 +
 portal/js/menus/menu-directives.js              |   434 +
 portal/js/menus/orgMenu.html                    |    13 +
 .../js/org-overview/org-overview-controller.js  |    86 +
 portal/js/org-overview/org-overview.html        |   113 +
 portal/js/profile/account-controller.js         |    18 +
 portal/js/profile/account.html                  |    13 +
 portal/js/profile/organizations-controller.js   |    73 +
 portal/js/profile/organizations.html            |    71 +
 portal/js/profile/profile-controller.js         |    40 +
 portal/js/profile/profile.html                  |    68 +
 portal/js/roles/roles-controller.js             |   112 +
 portal/js/roles/roles-groups-controller.js      |   113 +
 portal/js/roles/roles-groups.html               |    60 +
 portal/js/roles/roles-settings-controller.js    |    87 +
 portal/js/roles/roles-settings.html             |    80 +
 portal/js/roles/roles-tabs.html                 |    30 +
 portal/js/roles/roles-users-controller.js       |   112 +
 portal/js/roles/roles-users.html                |    59 +
 portal/js/roles/roles.html                      |    83 +
 portal/js/shell/shell-controller.js             |   216 +
 portal/js/shell/shell.html                      |    20 +
 portal/js/spec/client-tests.js                  |   159 -
 portal/js/spec/index.html                       |    20 -
 portal/js/spec/qunit-git.css                    |   238 -
 portal/js/spec/qunit-git.js                     |  1865 -
 portal/js/templates.js                          |  2963 +
 portal/js/unit-tests/appSDK-tests.js            |   255 -
 portal/js/unit-tests/ie-jquery-tests.js         |   191 -
 portal/js/unit-tests/qunit.css                  |   231 -
 portal/js/unit-tests/qunit.js                   |  1934 -
 portal/js/usergrid-dev.min.js                   |  4770 ++
 portal/js/usergrid.min.js                       |     6 +
 portal/js/users/users-activities-controller.js  |    40 +
 portal/js/users/users-activities.html           |    39 +
 portal/js/users/users-controller.js             |   115 +
 portal/js/users/users-graph-controller.js       |    67 +
 portal/js/users/users-graph.html                |    67 +
 portal/js/users/users-groups-controller.js      |   124 +
 portal/js/users/users-groups.html               |    67 +
 portal/js/users/users-profile-controller.js     |    32 +
 portal/js/users/users-profile.html              |    70 +
 portal/js/users/users-roles-controller.js       |   138 +
 portal/js/users/users-roles.html                |   129 +
 portal/js/users/users-tabs.html                 |     3 +
 portal/js/users/users.html                      |   117 +
 portal/loading.html                             |     9 -
 portal/package.json                             |    44 +
 portal/phantomjsdriver.log                      |  3869 +
 portal/planned_outage.html                      |    48 -
 portal/sass/.gitignore                          |     1 -
 portal/sass/config.rb                           |    25 -
 portal/sass/usergrid.scss                       |  1855 -
 portal/scripts/e2e-test.bat                     |    11 +
 portal/scripts/e2e-test.sh                      |     9 +
 portal/scripts/test.bat                         |    11 +
 portal/scripts/test.sh                          |     9 +
 portal/scripts/watchr.rb                        |    19 +
 portal/scripts/web-server.js                    |   244 +
 portal/sdk/usergrid.0.10.4.js                   |  1402 +
 portal/sdk/usergrid.0.10.5.js                   |  1755 +
 portal/sdk/usergrid.0.10.7.js                   |  2265 +
 portal/seleniumLog.txt                          |     0
 portal/server.js                                |   244 +
 portal/service_down.html                        |    48 -
 .../apigee.ui.activities.table_rows.html        |    14 -
 .../templates/apigee.ui.admins.table_rows.html  |     8 -
 .../apigee.ui.applications.table_rows.html      |     4 -
 .../apigee.ui.collection.table_rows.html        |    65 -
 .../apigee.ui.collections.query.indexes.html    |     5 -
 .../apigee.ui.collections.table_rows.html       |     9 -
 .../apigee.ui.collections.user.header.html      |    21 -
 portal/templates/apigee.ui.curl.detail.html     |    11 -
 portal/templates/apigee.ui.feed.table_rows.html |    15 -
 .../templates/apigee.ui.groups.table_rows.html  |    14 -
 .../apigee.ui.panels.group.activities.html      |    28 -
 .../apigee.ui.panels.group.details.html         |    97 -
 .../apigee.ui.panels.group.memberships.html     |    40 -
 .../apigee.ui.panels.group.permissions.html     |    99 -
 .../apigee.ui.panels.role.permissions.html      |    58 -
 .../templates/apigee.ui.panels.role.users.html  |    38 -
 .../apigee.ui.panels.user.activities.html       |    40 -
 .../templates/apigee.ui.panels.user.graph.html  |    80 -
 .../apigee.ui.panels.user.memberships.html      |    40 -
 .../apigee.ui.panels.user.permissions.html      |   105 -
 .../apigee.ui.panels.user.profile.html          |   113 -
 .../apigee.ui.role.groups.table_rows.html       |    44 -
 .../templates/apigee.ui.roles.table_rows.html   |    15 -
 .../templates/apigee.ui.users.table_rows.html   |    18 -
 portal/templates/test/modalForm2.html           |    32 -
 portal/test/autocomplete.html                   |    25 -
 portal/test/modalForm.html                      |    32 -
 portal/tests/karma.conf.js                      |    68 +
 portal/tests/protractor/applications.spec.js    |    31 +
 portal/tests/protractor/data.spec.js            |    51 +
 portal/tests/protractor/forgotPassword.spec.js  |    33 +
 portal/tests/protractor/organization.spec.js    |    40 +
 portal/tests/protractor/profile.spec.js         |    77 +
 portal/tests/protractor/users.spec.js           |    55 +
 portal/tests/protractor/util.js                 |   110 +
 portal/tests/protractorConf.js                  |    93 +
 portal/tests/selenium/chromedriver              |   Bin 0 -> 22034760 bytes
 .../selenium-server-standalone-2.37.0.jar       |   Bin 0 -> 34730734 bytes
 portal/tests/unit/sample.spec.js                |    46 +
 sdks/android/doc/allclasses-frame.html          |   110 +-
 sdks/android/doc/allclasses-noframe.html        |   110 +-
 sdks/android/doc/constant-values.html           |   859 +-
 sdks/android/doc/deprecated-list.html           |   237 +-
 sdks/android/doc/help-doc.html                  |   419 +-
 sdks/android/doc/index-all.html                 |   371 +
 sdks/android/doc/index-files/index-1.html       |   209 -
 sdks/android/doc/index-files/index-10.html      |   151 -
 sdks/android/doc/index-files/index-11.html      |   154 -
 sdks/android/doc/index-files/index-12.html      |   151 -
 sdks/android/doc/index-files/index-13.html      |   217 -
 sdks/android/doc/index-files/index-14.html      |   268 -
 sdks/android/doc/index-files/index-15.html      |   204 -
 sdks/android/doc/index-files/index-16.html      |   151 -
 sdks/android/doc/index-files/index-17.html      |   466 -
 sdks/android/doc/index-files/index-18.html      |   184 -
 sdks/android/doc/index-files/index-19.html      |   157 -
 sdks/android/doc/index-files/index-2.html       |   193 -
 sdks/android/doc/index-files/index-20.html      |   239 -
 sdks/android/doc/index-files/index-21.html      |   154 -
 sdks/android/doc/index-files/index-3.html       |   161 -
 sdks/android/doc/index-files/index-4.html       |   166 -
 sdks/android/doc/index-files/index-5.html       |   151 -
 sdks/android/doc/index-files/index-6.html       |   547 -
 sdks/android/doc/index-files/index-7.html       |   145 -
 sdks/android/doc/index-files/index-8.html       |   160 -
 sdks/android/doc/index-files/index-9.html       |   145 -
 sdks/android/doc/index.html                     |    89 +-
 .../apache/usergrid/android/client/Client.html  |   989 +
 .../client/callbacks/ApiResponseCallback.html   |   224 +
 .../client/callbacks/ClientAsyncTask.html       |   338 +
 .../client/callbacks/ClientCallback.html        |   227 +
 .../callbacks/DeviceRegistrationCallback.html   |   220 +
 .../callbacks/GroupsRetrievedCallback.html      |   220 +
 .../client/callbacks/QueryResultsCallback.html  |   220 +
 .../class-use/ApiResponseCallback.html          |   282 +
 .../callbacks/class-use/ClientAsyncTask.html    |   117 +
 .../callbacks/class-use/ClientCallback.html     |   180 +
 .../class-use/DeviceRegistrationCallback.html   |   171 +
 .../class-use/GroupsRetrievedCallback.html      |   160 +
 .../class-use/QueryResultsCallback.html         |   219 +
 .../android/client/callbacks/package-frame.html |    28 +
 .../client/callbacks/package-summary.html       |   166 +
 .../android/client/callbacks/package-tree.html  |   145 +
 .../android/client/callbacks/package-use.html   |   178 +
 .../android/client/class-use/Client.html        |   117 +
 .../usergrid/android/client/package-frame.html  |    20 +
 .../android/client/package-summary.html         |   137 +
 .../usergrid/android/client/package-tree.html   |   134 +
 .../usergrid/android/client/package-use.html    |   117 +
 .../android/client/utils/DeviceUuidFactory.html |   352 +
 .../android/client/utils/ObjectUtils.html       |   258 +
 .../utils/class-use/DeviceUuidFactory.html      |   117 +
 .../client/utils/class-use/ObjectUtils.html     |   117 +
 .../android/client/utils/package-frame.html     |    21 +
 .../android/client/utils/package-summary.html   |   142 +
 .../android/client/utils/package-tree.html      |   131 +
 .../android/client/utils/package-use.html       |   117 +
 .../usergrid/android/client/Client.Query.html   |   247 -
 .../android/client/Client.QueuePosition.html    |   398 -
 .../doc/org/usergrid/android/client/Client.html |  2389 -
 .../client/callbacks/ApiResponseCallback.html   |   221 -
 .../client/callbacks/ClientAsyncTask.html       |   281 -
 .../client/callbacks/ClientCallback.html        |   228 -
 .../callbacks/DeviceRegistrationCallback.html   |   221 -
 .../callbacks/GroupsRetrievedCallback.html      |   221 -
 .../client/callbacks/QueryResultsCallback.html  |   221 -
 .../class-use/ApiResponseCallback.html          |   328 -
 .../callbacks/class-use/ClientAsyncTask.html    |   144 -
 .../callbacks/class-use/ClientCallback.html     |   218 -
 .../class-use/DeviceRegistrationCallback.html   |   182 -
 .../class-use/GroupsRetrievedCallback.html      |   181 -
 .../class-use/QueryResultsCallback.html         |   266 -
 .../android/client/callbacks/package-frame.html |    51 -
 .../client/callbacks/package-summary.html       |   187 -
 .../android/client/callbacks/package-tree.html  |   162 -
 .../android/client/callbacks/package-use.html   |   207 -
 .../android/client/class-use/Client.Query.html  |   306 -
 .../client/class-use/Client.QueuePosition.html  |   222 -
 .../android/client/class-use/Client.html        |   204 -
 .../entities/Activity.ActivityCollection.html   |   412 -
 .../entities/Activity.ActivityObject.html       |   868 -
 .../client/entities/Activity.MediaLink.html     |   450 -
 .../android/client/entities/Activity.html       |  1790 -
 .../android/client/entities/Device.html         |   402 -
 .../android/client/entities/Entity.html         |   586 -
 .../usergrid/android/client/entities/Group.html |   458 -
 .../android/client/entities/Message.html        |   756 -
 .../usergrid/android/client/entities/User.html  |   850 -
 .../class-use/Activity.ActivityCollection.html  |   144 -
 .../class-use/Activity.ActivityObject.html      |   276 -
 .../entities/class-use/Activity.MediaLink.html  |   212 -
 .../client/entities/class-use/Activity.html     |   227 -
 .../client/entities/class-use/Device.html       |   210 -
 .../client/entities/class-use/Entity.html       |   635 -
 .../client/entities/class-use/Group.html        |   209 -
 .../client/entities/class-use/Message.html      |   212 -
 .../android/client/entities/class-use/User.html |   344 -
 .../android/client/entities/package-frame.html  |    48 -
 .../client/entities/package-summary.html        |   189 -
 .../android/client/entities/package-tree.html   |   155 -
 .../android/client/entities/package-use.html    |   293 -
 .../usergrid/android/client/package-frame.html  |    54 -
 .../android/client/package-summary.html         |   185 -
 .../usergrid/android/client/package-tree.html   |   168 -
 .../usergrid/android/client/package-use.html    |   201 -
 .../client/response/AggregateCounter.html       |   333 -
 .../client/response/AggregateCounterSet.html    |   511 -
 .../android/client/response/ApiResponse.html    |  1576 -
 .../client/response/ClientCredentialsInfo.html  |   333 -
 .../android/client/response/QueueInfo.html      |   309 -
 .../response/class-use/AggregateCounter.html    |   223 -
 .../response/class-use/AggregateCounterSet.html |   196 -
 .../client/response/class-use/ApiResponse.html  |   434 -
 .../class-use/ClientCredentialsInfo.html        |   196 -
 .../client/response/class-use/QueueInfo.html    |   220 -
 .../android/client/response/package-frame.html  |    40 -
 .../client/response/package-summary.html        |   173 -
 .../android/client/response/package-tree.html   |   153 -
 .../android/client/response/package-use.html    |   226 -
 .../android/client/utils/DeviceUuidFactory.html |   285 -
 .../android/client/utils/JsonUtils.html         |   556 -
 .../usergrid/android/client/utils/MapUtils.html |   261 -
 .../android/client/utils/ObjectUtils.html       |   252 -
 .../usergrid/android/client/utils/UrlUtils.html |   332 -
 .../utils/class-use/DeviceUuidFactory.html      |   144 -
 .../client/utils/class-use/JsonUtils.html       |   144 -
 .../client/utils/class-use/MapUtils.html        |   144 -
 .../client/utils/class-use/ObjectUtils.html     |   144 -
 .../client/utils/class-use/UrlUtils.html        |   144 -
 .../android/client/utils/package-frame.html     |    40 -
 .../android/client/utils/package-summary.html   |   174 -
 .../android/client/utils/package-tree.html      |   153 -
 .../android/client/utils/package-use.html       |   144 -
 sdks/android/doc/overview-frame.html            |    71 +-
 sdks/android/doc/overview-summary.html          |   280 +-
 sdks/android/doc/overview-tree.html             |   301 +-
 sdks/android/doc/package-list                   |     8 +-
 sdks/android/doc/resources/background.gif       |   Bin 0 -> 2313 bytes
 sdks/android/doc/resources/inherit.gif          |   Bin 57 -> 0 bytes
 sdks/android/doc/resources/tab.gif              |   Bin 0 -> 291 bytes
 sdks/android/doc/resources/titlebar.gif         |   Bin 0 -> 10701 bytes
 sdks/android/doc/resources/titlebar_end.gif     |   Bin 0 -> 849 bytes
 sdks/android/doc/stylesheet.css                 |   501 +-
 .../0.0.6/usergrid-java-client-0.0.6.jar        |   Bin 0 -> 46389 bytes
 .../0.0.6/usergrid-java-client-0.0.6.jar.sha1   |     1 +
 .../0.0.6/usergrid-java-client-0.0.6.pom        |    95 +
 .../0.0.6/usergrid-java-client-0.0.6.pom.sha1   |     1 +
 .../maven-metadata-local.xml                    |    12 +
 sdks/android/pom.xml                            |    31 +-
 .../apache/usergrid/android/client/Client.java  |   590 +
 .../client/callbacks/ApiResponseCallback.java   |    10 +
 .../client/callbacks/ClientAsyncTask.java       |    38 +
 .../client/callbacks/ClientCallback.java        |     9 +
 .../callbacks/DeviceRegistrationCallback.java   |     9 +
 .../callbacks/GroupsRetrievedCallback.java      |    13 +
 .../client/callbacks/QueryResultsCallback.java  |     9 +
 .../android/client/utils/DeviceUuidFactory.java |   154 +
 .../android/client/utils/ObjectUtils.java       |    20 +
 .../org/usergrid/android/client/Client.java     |   590 -
 .../client/callbacks/ApiResponseCallback.java   |    10 -
 .../client/callbacks/ClientAsyncTask.java       |    38 -
 .../client/callbacks/ClientCallback.java        |     9 -
 .../callbacks/DeviceRegistrationCallback.java   |     9 -
 .../callbacks/GroupsRetrievedCallback.java      |    13 -
 .../client/callbacks/QueryResultsCallback.java  |     9 -
 .../android/client/utils/DeviceUuidFactory.java |   154 -
 .../android/client/utils/ObjectUtils.java       |    20 -
 sdks/html5-javascript/Gruntfile.js              |    96 +
 sdks/html5-javascript/Release.md                |     6 +
 sdks/html5-javascript/examples/test/test.js     |    94 +-
 sdks/html5-javascript/lib/Module.js             |    34 +
 sdks/html5-javascript/lib/Usergrid.js           |   295 +
 sdks/html5-javascript/lib/modules/Asset.js      |   149 +
 sdks/html5-javascript/lib/modules/Client.js     |   741 +
 sdks/html5-javascript/lib/modules/Collection.js |   453 +
 sdks/html5-javascript/lib/modules/Counter.js    |   178 +
 sdks/html5-javascript/lib/modules/Entity.js     |   640 +
 sdks/html5-javascript/lib/modules/Error.js      |   125 +
 sdks/html5-javascript/lib/modules/Folder.js     |   167 +
 sdks/html5-javascript/lib/modules/Group.js      |   219 +
 sdks/html5-javascript/lib/modules/util/Ajax.js  |    74 +
 sdks/html5-javascript/lib/modules/util/Event.js |    33 +
 .../html5-javascript/lib/modules/util/Logger.js |    68 +
 .../lib/modules/util/Promise.js                 |    83 +
 sdks/html5-javascript/package.json              |    22 +
 sdks/html5-javascript/tests/mocha/index.html    |    49 +
 sdks/html5-javascript/tests/mocha/test.js       |  1039 +
 .../tests/qunit/apigee_test.html                |    14 +
 sdks/html5-javascript/tests/qunit/tests.js      |     3 +
 .../resources/css/bootstrap-combined.min.css    |    18 +
 .../tests/resources/css/mocha.css               |   270 +
 .../tests/resources/css/styles.css              |    91 +
 .../tests/resources/images/apigee.png           |   Bin 0 -> 6010 bytes
 .../tests/resources/js/blanket_mocha.min.js     |     1 +
 .../tests/resources/js/json2.js                 |   486 +
 .../tests/resources/js/mocha.js                 |  5341 ++
 sdks/html5-javascript/tests/test.html           |    37 +
 sdks/html5-javascript/tests/test.js             |   910 +
 sdks/html5-javascript/usergrid.js               |  4859 +-
 sdks/html5-javascript/usergrid.min.js           |     4 +-
 sdks/java/doc/allclasses-frame.html             |   123 +-
 sdks/java/doc/allclasses-noframe.html           |   123 +-
 sdks/java/doc/constant-values.html              |  1437 +-
 sdks/java/doc/deprecated-list.html              |   237 +-
 sdks/java/doc/help-doc.html                     |   419 +-
 sdks/java/doc/index-all.html                    |  1299 +
 sdks/java/doc/index-files/index-1.html          |   209 -
 sdks/java/doc/index-files/index-10.html         |   151 -
 sdks/java/doc/index-files/index-11.html         |   154 -
 sdks/java/doc/index-files/index-12.html         |   151 -
 sdks/java/doc/index-files/index-13.html         |   217 -
 sdks/java/doc/index-files/index-14.html         |   268 -
 sdks/java/doc/index-files/index-15.html         |   204 -
 sdks/java/doc/index-files/index-16.html         |   151 -
 sdks/java/doc/index-files/index-17.html         |   466 -
 sdks/java/doc/index-files/index-18.html         |   184 -
 sdks/java/doc/index-files/index-19.html         |   157 -
 sdks/java/doc/index-files/index-2.html          |   193 -
 sdks/java/doc/index-files/index-20.html         |   239 -
 sdks/java/doc/index-files/index-21.html         |   154 -
 sdks/java/doc/index-files/index-3.html          |   161 -
 sdks/java/doc/index-files/index-4.html          |   166 -
 sdks/java/doc/index-files/index-5.html          |   151 -
 sdks/java/doc/index-files/index-6.html          |   547 -
 sdks/java/doc/index-files/index-7.html          |   145 -
 sdks/java/doc/index-files/index-8.html          |   160 -
 sdks/java/doc/index-files/index-9.html          |   145 -
 sdks/java/doc/index.html                        |    89 +-
 .../usergrid/java/client/Client.Query.html      |   238 +
 .../java/client/Client.QueuePosition.html       |   381 +
 .../org/apache/usergrid/java/client/Client.html |  1652 +
 .../java/client/class-use/Client.Query.html     |   246 +
 .../client/class-use/Client.QueuePosition.html  |   192 +
 .../usergrid/java/client/class-use/Client.html  |   175 +
 .../entities/Activity.ActivityCollection.html   |   408 +
 .../entities/Activity.ActivityObject.html       |   720 +
 .../client/entities/Activity.MediaLink.html     |   434 +
 .../usergrid/java/client/entities/Activity.html |  1449 +
 .../usergrid/java/client/entities/Device.html   |   387 +
 .../usergrid/java/client/entities/Entity.html   |   599 +
 .../usergrid/java/client/entities/Group.html    |   427 +
 .../usergrid/java/client/entities/Message.html  |   641 +
 .../usergrid/java/client/entities/User.html     |   707 +
 .../class-use/Activity.ActivityCollection.html  |   117 +
 .../class-use/Activity.ActivityObject.html      |   231 +
 .../entities/class-use/Activity.MediaLink.html  |   191 +
 .../client/entities/class-use/Activity.html     |   203 +
 .../java/client/entities/class-use/Device.html  |   169 +
 .../java/client/entities/class-use/Entity.html  |   415 +
 .../java/client/entities/class-use/Group.html   |   159 +
 .../java/client/entities/class-use/Message.html |   183 +
 .../java/client/entities/class-use/User.html    |   248 +
 .../java/client/entities/package-frame.html     |    28 +
 .../java/client/entities/package-summary.html   |   169 +
 .../java/client/entities/package-tree.html      |   141 +
 .../java/client/entities/package-use.html       |   219 +
 .../java/client/exception/ClientException.html  |   263 +
 .../exception/class-use/ClientException.html    |   117 +
 .../java/client/exception/package-frame.html    |    20 +
 .../java/client/exception/package-summary.html  |   137 +
 .../java/client/exception/package-tree.html     |   142 +
 .../java/client/exception/package-use.html      |   117 +
 .../usergrid/java/client/package-frame.html     |    28 +
 .../usergrid/java/client/package-summary.html   |   167 +
 .../usergrid/java/client/package-tree.html      |   146 +
 .../usergrid/java/client/package-use.html       |   158 +
 .../java/client/response/AggregateCounter.html  |   316 +
 .../client/response/AggregateCounterSet.html    |   444 +
 .../java/client/response/ApiResponse.html       |  1148 +
 .../client/response/ClientCredentialsInfo.html  |   316 +
 .../java/client/response/QueueInfo.html         |   297 +
 .../response/class-use/AggregateCounter.html    |   191 +
 .../response/class-use/AggregateCounterSet.html |   170 +
 .../client/response/class-use/ApiResponse.html  |   365 +
 .../class-use/ClientCredentialsInfo.html        |   170 +
 .../client/response/class-use/QueueInfo.html    |   187 +
 .../java/client/response/package-frame.html     |    24 +
 .../java/client/response/package-summary.html   |   151 +
 .../java/client/response/package-tree.html      |   134 +
 .../java/client/response/package-use.html       |   178 +
 .../usergrid/java/client/utils/JsonUtils.html   |   480 +
 .../usergrid/java/client/utils/MapUtils.html    |   260 +
 .../usergrid/java/client/utils/ObjectUtils.html |   258 +
 .../usergrid/java/client/utils/UrlUtils.html    |   314 +
 .../java/client/utils/class-use/JsonUtils.html  |   117 +
 .../java/client/utils/class-use/MapUtils.html   |   117 +
 .../client/utils/class-use/ObjectUtils.html     |   117 +
 .../java/client/utils/class-use/UrlUtils.html   |   117 +
 .../java/client/utils/package-frame.html        |    23 +
 .../java/client/utils/package-summary.html      |   147 +
 .../java/client/utils/package-tree.html         |   133 +
 .../usergrid/java/client/utils/package-use.html |   117 +
 .../usergrid/android/client/Client.Query.html   |   247 -
 .../android/client/Client.QueuePosition.html    |   398 -
 .../doc/org/usergrid/android/client/Client.html |  2389 -
 .../client/callbacks/ApiResponseCallback.html   |   221 -
 .../client/callbacks/ClientAsyncTask.html       |   281 -
 .../client/callbacks/ClientCallback.html        |   228 -
 .../callbacks/DeviceRegistrationCallback.html   |   221 -
 .../callbacks/GroupsRetrievedCallback.html      |   221 -
 .../client/callbacks/QueryResultsCallback.html  |   221 -
 .../class-use/ApiResponseCallback.html          |   328 -
 .../callbacks/class-use/ClientAsyncTask.html    |   144 -
 .../callbacks/class-use/ClientCallback.html     |   218 -
 .../class-use/DeviceRegistrationCallback.html   |   182 -
 .../class-use/GroupsRetrievedCallback.html      |   181 -
 .../class-use/QueryResultsCallback.html         |   266 -
 .../android/client/callbacks/package-frame.html |    51 -
 .../client/callbacks/package-summary.html       |   187 -
 .../android/client/callbacks/package-tree.html  |   162 -
 .../android/client/callbacks/package-use.html   |   207 -
 .../android/client/class-use/Client.Query.html  |   306 -
 .../client/class-use/Client.QueuePosition.html  |   222 -
 .../android/client/class-use/Client.html        |   204 -
 .../entities/Activity.ActivityCollection.html   |   412 -
 .../entities/Activity.ActivityObject.html       |   868 -
 .../client/entities/Activity.MediaLink.html     |   450 -
 .../android/client/entities/Activity.html       |  1790 -
 .../android/client/entities/Device.html         |   402 -
 .../android/client/entities/Entity.html         |   586 -
 .../usergrid/android/client/entities/Group.html |   458 -
 .../android/client/entities/Message.html        |   756 -
 .../usergrid/android/client/entities/User.html  |   850 -
 .../class-use/Activity.ActivityCollection.html  |   144 -
 .../class-use/Activity.ActivityObject.html      |   276 -
 .../entities/class-use/Activity.MediaLink.html  |   212 -
 .../client/entities/class-use/Activity.html     |   227 -
 .../client/entities/class-use/Device.html       |   210 -
 .../client/entities/class-use/Entity.html       |   635 -
 .../client/entities/class-use/Group.html        |   209 -
 .../client/entities/class-use/Message.html      |   212 -
 .../android/client/entities/class-use/User.html |   344 -
 .../android/client/entities/package-frame.html  |    48 -
 .../client/entities/package-summary.html        |   189 -
 .../android/client/entities/package-tree.html   |   155 -
 .../android/client/entities/package-use.html    |   293 -
 .../usergrid/android/client/package-frame.html  |    54 -
 .../android/client/package-summary.html         |   185 -
 .../usergrid/android/client/package-tree.html   |   168 -
 .../usergrid/android/client/package-use.html    |   201 -
 .../client/response/AggregateCounter.html       |   333 -
 .../client/response/AggregateCounterSet.html    |   511 -
 .../android/client/response/ApiResponse.html    |  1576 -
 .../client/response/ClientCredentialsInfo.html  |   333 -
 .../android/client/response/QueueInfo.html      |   309 -
 .../response/class-use/AggregateCounter.html    |   223 -
 .../response/class-use/AggregateCounterSet.html |   196 -
 .../client/response/class-use/ApiResponse.html  |   434 -
 .../class-use/ClientCredentialsInfo.html        |   196 -
 .../client/response/class-use/QueueInfo.html    |   220 -
 .../android/client/response/package-frame.html  |    40 -
 .../client/response/package-summary.html        |   173 -
 .../android/client/response/package-tree.html   |   153 -
 .../android/client/response/package-use.html    |   226 -
 .../android/client/utils/DeviceUuidFactory.html |   285 -
 .../android/client/utils/JsonUtils.html         |   556 -
 .../usergrid/android/client/utils/MapUtils.html |   261 -
 .../android/client/utils/ObjectUtils.html       |   252 -
 .../usergrid/android/client/utils/UrlUtils.html |   332 -
 .../utils/class-use/DeviceUuidFactory.html      |   144 -
 .../client/utils/class-use/JsonUtils.html       |   144 -
 .../client/utils/class-use/MapUtils.html        |   144 -
 .../client/utils/class-use/ObjectUtils.html     |   144 -
 .../client/utils/class-use/UrlUtils.html        |   144 -
 .../android/client/utils/package-frame.html     |    40 -
 .../android/client/utils/package-summary.html   |   174 -
 .../android/client/utils/package-tree.html      |   153 -
 .../android/client/utils/package-use.html       |   144 -
 sdks/java/doc/overview-frame.html               |    73 +-
 sdks/java/doc/overview-summary.html             |   288 +-
 sdks/java/doc/overview-tree.html                |   331 +-
 sdks/java/doc/package-list                      |    10 +-
 sdks/java/doc/resources/background.gif          |   Bin 0 -> 2313 bytes
 sdks/java/doc/resources/inherit.gif             |   Bin 57 -> 0 bytes
 sdks/java/doc/resources/tab.gif                 |   Bin 0 -> 291 bytes
 sdks/java/doc/resources/titlebar.gif            |   Bin 0 -> 10701 bytes
 sdks/java/doc/resources/titlebar_end.gif        |   Bin 0 -> 849 bytes
 sdks/java/doc/serialized-form.html              |   134 +
 sdks/java/doc/stylesheet.css                    |   501 +-
 sdks/java/pom.xml                               |   182 +-
 .../org/apache/usergrid/java/client/Client.java |  1276 +
 .../usergrid/java/client/entities/Activity.java |   627 +
 .../usergrid/java/client/entities/Device.java   |    52 +
 .../usergrid/java/client/entities/Entity.java   |   175 +
 .../usergrid/java/client/entities/Group.java    |    63 +
 .../usergrid/java/client/entities/Message.java  |   132 +
 .../usergrid/java/client/entities/User.java     |   142 +
 .../java/client/exception/ClientException.java  |    40 +
 .../java/client/response/AggregateCounter.java  |    36 +
 .../client/response/AggregateCounterSet.java    |    95 +
 .../java/client/response/ApiResponse.java       |   405 +
 .../client/response/ClientCredentialsInfo.java  |    42 +
 .../java/client/response/QueueInfo.java         |    28 +
 .../usergrid/java/client/utils/JsonUtils.java   |   166 +
 .../usergrid/java/client/utils/MapUtils.java    |    23 +
 .../usergrid/java/client/utils/ObjectUtils.java |    20 +
 .../usergrid/java/client/utils/UrlUtils.java    |   108 +
 .../java/org/usergrid/java/client/Client.java   |  1276 -
 .../usergrid/java/client/entities/Activity.java |   627 -
 .../usergrid/java/client/entities/Device.java   |    52 -
 .../usergrid/java/client/entities/Entity.java   |   175 -
 .../usergrid/java/client/entities/Group.java    |    63 -
 .../usergrid/java/client/entities/Message.java  |   132 -
 .../org/usergrid/java/client/entities/User.java |   142 -
 .../java/client/exception/ClientException.java  |    40 -
 .../java/client/response/AggregateCounter.java  |    36 -
 .../client/response/AggregateCounterSet.java    |    95 -
 .../java/client/response/ApiResponse.java       |   405 -
 .../client/response/ClientCredentialsInfo.java  |    42 -
 .../java/client/response/QueueInfo.java         |    28 -
 .../usergrid/java/client/utils/JsonUtils.java   |   166 -
 .../usergrid/java/client/utils/MapUtils.java    |    23 -
 .../usergrid/java/client/utils/ObjectUtils.java |    20 -
 .../usergrid/java/client/utils/UrlUtils.java    |   108 -
 sdks/nodejs/changelog.md                        |     6 +
 sdks/nodejs/lib/usergrid.js                     |   259 +-
 sdks/nodejs/package.json                        |     2 +-
 sdks/nodejs/readme.md                           |     2 +-
 sdks/nodejs/test.js                             |   267 +-
 sdks/php/lib/vendor/Apigee/Usergrid/Client.php  |     7 +-
 .../lib/vendor/Apigee/Usergrid/Collection.php   |    18 +-
 sdks/php/lib/vendor/Apigee/Usergrid/Entity.php  |    90 +-
 stack/README.md                                 |     4 +-
 stack/build-tools/pom.xml                       |    20 +-
 .../src/main/resources/usergrid/checkstyle.xml  |    18 +-
 stack/config/pom.xml                            |    20 +-
 stack/config/src/main/resources/log4j.xml       |    30 +-
 .../main/resources/usergrid-default.properties  |    14 +-
 stack/config/src/test/resources/cassandra.yaml  |    14 +-
 stack/config/src/test/resources/hazelcast.xml   |    16 +
 .../config/src/test/resources/log4j.properties  |    14 +-
 stack/config/src/test/resources/log4j.xml       |    20 +-
 stack/core/pom.xml                              |    36 +-
 .../persistence/query/tree/QueryFilter.g        |   345 +
 .../persistence/query/tree/QueryFilter.g        |   311 -
 .../java/org/apache/usergrid/batch/AppArgs.java |    73 +
 .../java/org/apache/usergrid/batch/Job.java     |    36 +
 .../org/apache/usergrid/batch/JobExecution.java |    92 +
 .../apache/usergrid/batch/JobExecutionImpl.java |   218 +
 .../org/apache/usergrid/batch/JobFactory.java   |    35 +
 .../usergrid/batch/JobNotFoundException.java    |    39 +
 .../org/apache/usergrid/batch/JobRuntime.java   |    41 +
 .../usergrid/batch/JobRuntimeException.java     |    65 +
 .../usergrid/batch/UsergridJobFactory.java      |    53 +
 .../apache/usergrid/batch/job/OnlyOnceJob.java  |    86 +
 .../apache/usergrid/batch/job/package-info.java |    17 +
 .../usergrid/batch/repository/JobAccessor.java  |    35 +
 .../batch/repository/JobDescriptor.java         |    96 +
 .../usergrid/batch/repository/package-info.java |    17 +
 .../org/apache/usergrid/batch/service/App.java  |    86 +
 .../usergrid/batch/service/JobListener.java     |    49 +
 .../batch/service/JobRuntimeService.java        |    49 +
 .../batch/service/JobSchedulerService.java      |   314 +
 .../batch/service/SchedulerService.java         |    54 +
 .../batch/service/SchedulerServiceImpl.java     |   428 +
 .../usergrid/batch/service/package-info.java    |    17 +
 .../hazelcast/HazelcastLifecycleMonitor.java    |    79 +
 .../apache/usergrid/count/AbstractBatcher.java  |   176 +
 .../apache/usergrid/count/BatchSubmitter.java   |    31 +
 .../java/org/apache/usergrid/count/Batcher.java |    36 +
 .../usergrid/count/CassandraCounterStore.java   |   101 +
 .../usergrid/count/CassandraSubmitter.java      |    78 +
 .../apache/usergrid/count/CountProducer.java    |    26 +
 .../CounterProcessingUnavailableException.java  |    39 +
 .../org/apache/usergrid/count/CounterStore.java |    31 +
 .../apache/usergrid/count/SimpleBatcher.java    |    41 +
 .../usergrid/count/Slf4JBatchSubmitter.java     |    78 +
 .../org/apache/usergrid/count/common/Count.java |   140 +
 .../usergrid/count/common/CountSerDeUtils.java  |    52 +
 .../common/CountTransportSerDeException.java    |    39 +
 .../org/apache/usergrid/count/package-info.java |    18 +
 .../usergrid/exception/JsonReadException.java   |    27 +
 .../usergrid/exception/JsonWriteException.java  |    27 +
 .../exception/NotImplementedException.java      |    59 +
 .../java/org/apache/usergrid/locking/Lock.java  |    45 +
 .../org/apache/usergrid/locking/LockHelper.java |    52 +
 .../apache/usergrid/locking/LockManager.java    |    41 +
 .../usergrid/locking/LockPathBuilder.java       |    69 +
 .../locking/cassandra/HectorLockImpl.java       |    86 +
 .../cassandra/HectorLockManagerImpl.java        |   142 +
 .../locking/exception/UGLockException.java      |    50 +
 .../usergrid/locking/noop/NoOpLockImpl.java     |    62 +
 .../locking/noop/NoOpLockManagerImpl.java       |    41 +
 .../locking/singlenode/SingleNodeLockImpl.java  |    71 +
 .../singlenode/SingleNodeLockManagerImpl.java   |    94 +
 .../zookeeper/ZooKeeperLockManagerImpl.java     |   115 +
 .../locking/zookeeper/ZookeeperLockImpl.java    |    88 +
 .../org/apache/usergrid/mq/CounterQuery.java    |   314 +
 .../java/org/apache/usergrid/mq/Message.java    |   513 +
 .../main/java/org/apache/usergrid/mq/Query.java |  1858 +
 .../apache/usergrid/mq/QueryFilterLexer.java    |  1858 +
 .../apache/usergrid/mq/QueryFilterParser.java   |  1118 +
 .../org/apache/usergrid/mq/QueryProcessor.java  |   578 +
 .../main/java/org/apache/usergrid/mq/Queue.java |   292 +
 .../org/apache/usergrid/mq/QueueManager.java    |   131 +
 .../apache/usergrid/mq/QueueManagerFactory.java |    42 +
 .../org/apache/usergrid/mq/QueuePosition.java   |    60 +
 .../java/org/apache/usergrid/mq/QueueQuery.java |   307 +
 .../org/apache/usergrid/mq/QueueResults.java    |   129 +
 .../java/org/apache/usergrid/mq/QueueSet.java   |   193 +
 .../usergrid/mq/cassandra/CassandraMQUtils.java |   279 +
 .../mq/cassandra/MessageIndexUpdate.java        |   121 +
 .../usergrid/mq/cassandra/QueueIndexUpdate.java |   350 +
 .../mq/cassandra/QueueManagerFactoryImpl.java   |    86 +
 .../usergrid/mq/cassandra/QueueManagerImpl.java |  1392 +
 .../apache/usergrid/mq/cassandra/QueuesCF.java  |   157 +
 .../mq/cassandra/io/AbstractSearch.java         |   359 +
 .../mq/cassandra/io/ConsumerTransaction.java    |   472 +
 .../usergrid/mq/cassandra/io/EndSearch.java     |    70 +
 .../usergrid/mq/cassandra/io/FilterSearch.java  |   260 +
 .../mq/cassandra/io/NoTransactionSearch.java    |   133 +
 .../usergrid/mq/cassandra/io/QueueBounds.java   |   107 +
 .../usergrid/mq/cassandra/io/QueueSearch.java   |    30 +
 .../usergrid/mq/cassandra/io/StartSearch.java   |    69 +
 .../usergrid/persistence/AbstractEntity.java    |   342 +
 .../usergrid/persistence/AggregateCounter.java  |    49 +
 .../persistence/AggregateCounterSet.java        |   117 +
 .../persistence/AssociatedEntityRef.java        |    22 +
 .../usergrid/persistence/CollectionRef.java     |    27 +
 .../persistence/ConnectedEntityRef.java         |    23 +
 .../usergrid/persistence/ConnectionRef.java     |    35 +
 .../usergrid/persistence/CounterQuery.java      |   313 +
 .../usergrid/persistence/CounterResolution.java |    85 +
 .../usergrid/persistence/CredentialsInfo.java   |   177 +
 .../usergrid/persistence/DynamicEntity.java     |   112 +
 .../org/apache/usergrid/persistence/Entity.java |   103 +
 .../usergrid/persistence/EntityFactory.java     |   132 +
 .../usergrid/persistence/EntityManager.java     |   621 +
 .../persistence/EntityManagerFactory.java       |   109 +
 .../persistence/EntityPropertyComparator.java   |    56 +
 .../apache/usergrid/persistence/EntityRef.java  |    38 +
 .../usergrid/persistence/EntityUtils.java       |    54 +
 .../apache/usergrid/persistence/Identifier.java |   227 +
 .../persistence/IndexBucketLocator.java         |    76 +
 .../persistence/MultiQueryIterator.java         |   122 +
 .../persistence/PagingResultsIterator.java      |   125 +
 .../apache/usergrid/persistence/PathQuery.java  |   131 +
 .../org/apache/usergrid/persistence/Query.java  |  1311 +
 .../apache/usergrid/persistence/QueryUtils.java |    50 +
 .../usergrid/persistence/RelationManager.java   |   114 +
 .../apache/usergrid/persistence/Results.java    |  1295 +
 .../apache/usergrid/persistence/RoleRef.java    |    32 +
 .../org/apache/usergrid/persistence/Schema.java |  1789 +
 .../persistence/SimpleCollectionRef.java        |    85 +
 .../usergrid/persistence/SimpleEntityRef.java   |   150 +
 .../usergrid/persistence/SimpleRoleRef.java     |   126 +
 .../usergrid/persistence/TypedEntity.java       |    38 +
 .../org/apache/usergrid/persistence/Update.java |    76 +
 .../annotations/EntityCollection.java           |    44 +
 .../annotations/EntityDictionary.java           |    39 +
 .../persistence/annotations/EntityProperty.java |    55 +
 .../persistence/cassandra/ApplicationCF.java    |   161 +
 .../usergrid/persistence/cassandra/CFEnum.java  |    38 +
 .../cassandra/CassandraPersistenceUtils.java    |   487 +
 .../persistence/cassandra/CassandraService.java |  1139 +
 .../cassandra/ConnectedEntityRefImpl.java       |    62 +
 .../cassandra/ConnectionRefImpl.java            |   629 +
 .../persistence/cassandra/CounterUtils.java     |   401 +
 .../persistence/cassandra/CursorCache.java      |   137 +
 .../cassandra/EntityManagerFactoryImpl.java     |   412 +
 .../cassandra/EntityManagerImpl.java            |  2859 +
 .../cassandra/EntityValueSerializer.java        |    53 +
 .../persistence/cassandra/GeoIndexManager.java  |   324 +
 .../persistence/cassandra/IndexUpdate.java      |   451 +
 .../persistence/cassandra/QueryProcessor.java   |   721 +
 .../cassandra/RelationManagerImpl.java          |  2335 +
 .../usergrid/persistence/cassandra/Setup.java   |   207 +
 .../cassandra/SimpleIndexBucketLocatorImpl.java |   122 +
 .../cassandra/index/ConnectedIndexScanner.java  |   282 +
 .../cassandra/index/IndexBucketScanner.java     |   240 +
 .../index/IndexMultiBucketSetLoader.java        |   139 +
 .../cassandra/index/IndexScanner.java           |    40 +
 .../cassandra/index/NoOpIndexScanner.java       |    95 +
 .../cassandra/util/Slf4jTraceTagReporter.java   |    63 +
 .../cassandra/util/TaggedOpTimer.java           |    54 +
 .../persistence/cassandra/util/TimedOpTag.java  |   117 +
 .../cassandra/util/TraceParticipant.java        |    36 +
 .../persistence/cassandra/util/TraceTag.java    |    93 +
 .../cassandra/util/TraceTagAspect.java          |    57 +
 .../cassandra/util/TraceTagManager.java         |   172 +
 .../cassandra/util/TraceTagReporter.java        |    26 +
 .../usergrid/persistence/entities/Activity.java |   686 +
 .../persistence/entities/Application.java       |   610 +
 .../usergrid/persistence/entities/Asset.java    |    94 +
 .../usergrid/persistence/entities/Device.java   |   106 +
 .../usergrid/persistence/entities/Event.java    |   156 +
 .../usergrid/persistence/entities/Folder.java   |    94 +
 .../usergrid/persistence/entities/Group.java    |   169 +
 .../usergrid/persistence/entities/JobData.java  |    55 +
 .../usergrid/persistence/entities/JobStat.java  |   176 +
 .../usergrid/persistence/entities/Message.java  |    78 +
 .../usergrid/persistence/entities/Role.java     |   154 +
 .../usergrid/persistence/entities/User.java     |   349 +
 .../ApplicationAlreadyExistsException.java      |    38 +
 .../DuplicateUniquePropertyExistsException.java |    53 +
 .../exceptions/EntityNotFoundException.java     |    46 +
 .../exceptions/LockingException.java            |    63 +
 .../exceptions/NoFullTextIndexException.java    |    51 +
 .../exceptions/NoIndexException.java            |    51 +
 .../exceptions/PersistenceException.java        |    46 +
 .../PropertyTypeConversionException.java        |    72 +
 .../exceptions/QueryIterationException.java     |    29 +
 .../exceptions/QueryParseException.java         |    64 +
 .../exceptions/QueryTokenException.java         |    53 +
 .../persistence/exceptions/QueueException.java  |    59 +
 .../RequiredPropertyNotFoundException.java      |    42 +
 .../TransactionNotFoundException.java           |    46 +
 .../UnexpectedEntityTypeException.java          |    46 +
 .../persistence/geo/CollectionGeoSearch.java    |    68 +
 .../persistence/geo/ConnectionGeoSearch.java    |    67 +
 .../persistence/geo/EntityLocationRef.java      |   227 +
 .../EntityLocationRefDistanceComparator.java    |    78 +
 .../persistence/geo/GeoIndexSearcher.java       |   384 +
 .../persistence/geo/GeocellManager.java         |   195 +
 .../usergrid/persistence/geo/GeocellUtils.java  |   543 +
 .../geo/comparator/DoubleTupleComparator.java   |    39 +
 .../persistence/geo/model/BoundingBox.java      |    74 +
 .../persistence/geo/model/CostFunction.java     |    36 +
 .../geo/model/DefaultCostFunction.java          |    37 +
 .../usergrid/persistence/geo/model/Point.java   |    61 +
 .../usergrid/persistence/geo/model/Tuple.java   |    40 +
 .../usergrid/persistence/query/ir/AllNode.java  |    70 +
 .../usergrid/persistence/query/ir/AndNode.java  |    44 +
 .../persistence/query/ir/BooleanNode.java       |    49 +
 .../query/ir/EmailIdentifierNode.java           |    47 +
 .../query/ir/NameIdentifierNode.java            |    44 +
 .../persistence/query/ir/NodeVisitor.java       |    79 +
 .../usergrid/persistence/query/ir/NotNode.java  |    63 +
 .../usergrid/persistence/query/ir/OrNode.java   |    53 +
 .../persistence/query/ir/OrderByNode.java       |    93 +
 .../persistence/query/ir/QueryNode.java         |    29 +
 .../persistence/query/ir/QuerySlice.java        |   345 +
 .../persistence/query/ir/SearchVisitor.java     |   270 +
 .../persistence/query/ir/SliceNode.java         |   168 +
 .../query/ir/UuidIdentifierNode.java            |    48 +
 .../persistence/query/ir/WithinNode.java        |    97 +
 .../query/ir/result/AbstractScanColumn.java     |    86 +
 .../result/CollectionResultsLoaderFactory.java  |    39 +
 .../ir/result/ConnectionIndexSliceParser.java   |    87 +
 .../query/ir/result/ConnectionRefLoader.java    |    81 +
 .../result/ConnectionResultsLoaderFactory.java  |    48 +
 .../ir/result/ConnectionTypesIterator.java      |   195 +
 .../query/ir/result/EmptyIterator.java          |    63 +
 .../query/ir/result/EntityRefLoader.java        |    51 +
 .../query/ir/result/EntityResultsLoader.java    |    47 +
 .../query/ir/result/GeoIterator.java            |   356 +
 .../persistence/query/ir/result/IDLoader.java   |    40 +
 .../query/ir/result/IntersectionIterator.java   |   170 +
 .../query/ir/result/MergeIterator.java          |   150 +
 .../query/ir/result/MultiIterator.java          |    55 +
 .../query/ir/result/OrderByIterator.java        |   253 +
 .../query/ir/result/ResultIterator.java         |    44 +
 .../query/ir/result/ResultsLoader.java          |    30 +
 .../query/ir/result/ResultsLoaderFactory.java   |    37 +
 .../persistence/query/ir/result/ScanColumn.java |    32 +
 .../query/ir/result/ScanColumnTransformer.java  |    39 +
 .../ir/result/SecondaryIndexSliceParser.java    |    61 +
 .../query/ir/result/SliceIterator.java          |   242 +
 .../query/ir/result/SliceParser.java            |    32 +
 .../query/ir/result/StaticIdIterator.java       |    82 +
 .../query/ir/result/SubtractionIterator.java    |   109 +
 .../query/ir/result/UUIDIndexSliceParser.java   |    51 +
 .../query/ir/result/UnionIterator.java          |   268 +
 .../usergrid/persistence/query/tree/.gitignore  |     2 +
 .../persistence/query/tree/AndOperand.java      |    49 +
 .../persistence/query/tree/BooleanLiteral.java  |    49 +
 .../persistence/query/tree/BooleanOperand.java  |    49 +
 .../persistence/query/tree/ContainsOperand.java |    70 +
 .../query/tree/ContainsProperty.java            |    58 +
 .../usergrid/persistence/query/tree/Equal.java  |    53 +
 .../persistence/query/tree/EqualityOperand.java |    89 +
 .../persistence/query/tree/FloatLiteral.java    |    58 +
 .../persistence/query/tree/GreaterThan.java     |    53 +
 .../query/tree/GreaterThanEqual.java            |    57 +
 .../persistence/query/tree/LessThan.java        |    53 +
 .../persistence/query/tree/LessThanEqual.java   |    55 +
 .../persistence/query/tree/Literal.java         |    39 +
 .../persistence/query/tree/LiteralFactory.java  |    59 +
 .../persistence/query/tree/LongLiteral.java     |    65 +
 .../persistence/query/tree/NotOperand.java      |    46 +
 .../persistence/query/tree/NumericLiteral.java  |    25 +
 .../persistence/query/tree/Operand.java         |    48 +
 .../persistence/query/tree/OrOperand.java       |    54 +
 .../persistence/query/tree/Property.java        |    63 +
 .../persistence/query/tree/QueryVisitor.java    |    91 +
 .../persistence/query/tree/StringLiteral.java   |    83 +
 .../persistence/query/tree/UUIDLiteral.java     |    50 +
 .../persistence/query/tree/WithinOperand.java   |   112 +
 .../persistence/query/tree/WithinProperty.java  |    55 +
 .../persistence/schema/CollectionInfo.java      |   208 +
 .../persistence/schema/DictionaryInfo.java      |   118 +
 .../usergrid/persistence/schema/EntityInfo.java |   300 +
 .../persistence/schema/PropertyInfo.java        |   219 +
 .../usergrid/system/UsergridSystemMonitor.java  |   111 +
 .../org/apache/usergrid/utils/AESUtils.java     |    83 +
 .../java/org/apache/usergrid/utils/BCrypt.java  |   627 +
 .../org/apache/usergrid/utils/ClassUtils.java   |    58 +
 .../org/apache/usergrid/utils/CodecUtils.java   |    45 +
 .../apache/usergrid/utils/CompositeUtils.java   |    54 +
 .../apache/usergrid/utils/ConversionUtils.java  |   765 +
 .../org/apache/usergrid/utils/DateUtils.java    |    73 +
 .../org/apache/usergrid/utils/HttpUtils.java    |    51 +
 .../org/apache/usergrid/utils/IndexUtils.java   |   218 +
 .../apache/usergrid/utils/InflectionUtils.java  |    51 +
 .../org/apache/usergrid/utils/Inflector.java    |   528 +
 .../org/apache/usergrid/utils/JsonUtils.java    |   329 +
 .../org/apache/usergrid/utils/ListUtils.java    |   230 +
 .../org/apache/usergrid/utils/MailUtils.java    |   154 +
 .../org/apache/usergrid/utils/MapUtils.java     |   377 +
 .../org/apache/usergrid/utils/NumberUtils.java  |    35 +
 .../apache/usergrid/utils/PasswordUtils.java    |    28 +
 .../org/apache/usergrid/utils/StringUtils.java  |   172 +
 .../org/apache/usergrid/utils/TimeUtils.java    |    88 +
 .../org/apache/usergrid/utils/UUIDUtils.java    |   412 +
 .../java/org/apache/usergrid/utils/Version.java |   428 +
 .../org/apache/usergrid/utils/package-info.java |    17 +
 .../main/java/org/usergrid/batch/AppArgs.java   |    57 -
 .../src/main/java/org/usergrid/batch/Job.java   |    20 -
 .../java/org/usergrid/batch/JobExecution.java   |    91 -
 .../org/usergrid/batch/JobExecutionImpl.java    |   202 -
 .../java/org/usergrid/batch/JobFactory.java     |    19 -
 .../usergrid/batch/JobNotFoundException.java    |    23 -
 .../java/org/usergrid/batch/JobRuntime.java     |    40 -
 .../org/usergrid/batch/JobRuntimeException.java |    49 -
 .../org/usergrid/batch/UsergridJobFactory.java  |    37 -
 .../org/usergrid/batch/job/OnlyOnceJob.java     |    85 -
 .../org/usergrid/batch/job/package-info.java    |    18 -
 .../usergrid/batch/repository/JobAccessor.java  |    36 -
 .../batch/repository/JobDescriptor.java         |    80 -
 .../usergrid/batch/repository/package-info.java |    18 -
 .../java/org/usergrid/batch/service/App.java    |    70 -
 .../org/usergrid/batch/service/JobListener.java |    50 -
 .../batch/service/JobRuntimeService.java        |    49 -
 .../batch/service/JobSchedulerService.java      |   315 -
 .../batch/service/SchedulerService.java         |    54 -
 .../batch/service/SchedulerServiceImpl.java     |   428 -
 .../usergrid/batch/service/package-info.java    |    18 -
 .../hazelcast/HazelcastLifecycleMonitor.java    |    78 -
 .../org/usergrid/count/AbstractBatcher.java     |   175 -
 .../java/org/usergrid/count/BatchSubmitter.java |    30 -
 .../main/java/org/usergrid/count/Batcher.java   |    35 -
 .../usergrid/count/CassandraCounterStore.java   |   100 -
 .../org/usergrid/count/CassandraSubmitter.java  |    77 -
 .../java/org/usergrid/count/CountProducer.java  |    25 -
 .../CounterProcessingUnavailableException.java  |    38 -
 .../java/org/usergrid/count/CounterStore.java   |    30 -
 .../java/org/usergrid/count/SimpleBatcher.java  |    40 -
 .../org/usergrid/count/Slf4JBatchSubmitter.java |    77 -
 .../java/org/usergrid/count/common/Count.java   |   139 -
 .../usergrid/count/common/CountSerDeUtils.java  |    51 -
 .../common/CountTransportSerDeException.java    |    38 -
 .../java/org/usergrid/count/package-info.java   |     0
 .../usergrid/exception/JsonReadException.java   |    27 -
 .../usergrid/exception/JsonWriteException.java  |    27 -
 .../exception/NotImplementedException.java      |    58 -
 .../main/java/org/usergrid/locking/Lock.java    |    44 -
 .../java/org/usergrid/locking/LockHelper.java   |    51 -
 .../java/org/usergrid/locking/LockManager.java  |    40 -
 .../org/usergrid/locking/LockPathBuilder.java   |    68 -
 .../locking/cassandra/HectorLockImpl.java       |    85 -
 .../cassandra/HectorLockManagerImpl.java        |   141 -
 .../locking/exception/UGLockException.java      |    49 -
 .../org/usergrid/locking/noop/NoOpLockImpl.java |    61 -
 .../locking/noop/NoOpLockManagerImpl.java       |    40 -
 .../locking/singlenode/SingleNodeLockImpl.java  |    70 -
 .../singlenode/SingleNodeLockManagerImpl.java   |    93 -
 .../zookeeper/ZooKeeperLockManagerImpl.java     |   114 -
 .../locking/zookeeper/ZookeeperLockImpl.java    |    87 -
 .../main/java/org/usergrid/mq/CounterQuery.java |   314 -
 .../src/main/java/org/usergrid/mq/Message.java  |   512 -
 .../src/main/java/org/usergrid/mq/Query.java    |  1857 -
 .../java/org/usergrid/mq/QueryFilterLexer.java  |  1842 -
 .../java/org/usergrid/mq/QueryFilterParser.java |  1102 -
 .../java/org/usergrid/mq/QueryProcessor.java    |   562 -
 .../src/main/java/org/usergrid/mq/Queue.java    |   291 -
 .../main/java/org/usergrid/mq/QueueManager.java |   130 -
 .../org/usergrid/mq/QueueManagerFactory.java    |    41 -
 .../java/org/usergrid/mq/QueuePosition.java     |    59 -
 .../main/java/org/usergrid/mq/QueueQuery.java   |   306 -
 .../main/java/org/usergrid/mq/QueueResults.java |   128 -
 .../src/main/java/org/usergrid/mq/QueueSet.java |   192 -
 .../usergrid/mq/cassandra/CassandraMQUtils.java |   278 -
 .../mq/cassandra/MessageIndexUpdate.java        |   120 -
 .../usergrid/mq/cassandra/QueueIndexUpdate.java |   349 -
 .../mq/cassandra/QueueManagerFactoryImpl.java   |    85 -
 .../usergrid/mq/cassandra/QueueManagerImpl.java |  1391 -
 .../org/usergrid/mq/cassandra/QueuesCF.java     |   156 -
 .../mq/cassandra/io/AbstractSearch.java         |   358 -
 .../mq/cassandra/io/ConsumerTransaction.java    |   471 -
 .../org/usergrid/mq/cassandra/io/EndSearch.java |    69 -
 .../usergrid/mq/cassandra/io/FilterSearch.java  |   259 -
 .../mq/cassandra/io/NoTransactionSearch.java    |   132 -
 .../usergrid/mq/cassandra/io/QueueBounds.java   |    91 -
 .../usergrid/mq/cassandra/io/QueueSearch.java   |    29 -
 .../usergrid/mq/cassandra/io/StartSearch.java   |    68 -
 .../usergrid/persistence/AbstractEntity.java    |   342 -
 .../usergrid/persistence/AggregateCounter.java  |    48 -
 .../persistence/AggregateCounterSet.java        |   116 -
 .../persistence/AssociatedEntityRef.java        |    21 -
 .../org/usergrid/persistence/CollectionRef.java |    26 -
 .../persistence/ConnectedEntityRef.java         |    22 -
 .../org/usergrid/persistence/ConnectionRef.java |    34 -
 .../org/usergrid/persistence/CounterQuery.java  |   313 -
 .../usergrid/persistence/CounterResolution.java |    84 -
 .../usergrid/persistence/CredentialsInfo.java   |   176 -
 .../org/usergrid/persistence/DynamicEntity.java |   111 -
 .../java/org/usergrid/persistence/Entity.java   |   103 -
 .../org/usergrid/persistence/EntityFactory.java |   131 -
 .../org/usergrid/persistence/EntityManager.java |   616 -
 .../persistence/EntityManagerFactory.java       |   108 -
 .../persistence/EntityPropertyComparator.java   |    55 -
 .../org/usergrid/persistence/EntityRef.java     |    37 -
 .../org/usergrid/persistence/EntityUtils.java   |    53 -
 .../org/usergrid/persistence/Identifier.java    |   226 -
 .../persistence/IndexBucketLocator.java         |    75 -
 .../persistence/MultiQueryIterator.java         |   106 -
 .../persistence/PagingResultsIterator.java      |   109 -
 .../org/usergrid/persistence/PathQuery.java     |   115 -
 .../java/org/usergrid/persistence/Query.java    |  1310 -
 .../org/usergrid/persistence/QueryUtils.java    |    34 -
 .../usergrid/persistence/RelationManager.java   |   109 -
 .../java/org/usergrid/persistence/Results.java  |  1294 -
 .../java/org/usergrid/persistence/RoleRef.java  |    31 -
 .../java/org/usergrid/persistence/Schema.java   |  1788 -
 .../persistence/SimpleCollectionRef.java        |    84 -
 .../usergrid/persistence/SimpleEntityRef.java   |   149 -
 .../org/usergrid/persistence/SimpleRoleRef.java |   125 -
 .../org/usergrid/persistence/TypedEntity.java   |    37 -
 .../java/org/usergrid/persistence/Update.java   |    75 -
 .../annotations/EntityCollection.java           |    43 -
 .../annotations/EntityDictionary.java           |    38 -
 .../persistence/annotations/EntityProperty.java |    54 -
 .../persistence/cassandra/ApplicationCF.java    |   160 -
 .../usergrid/persistence/cassandra/CFEnum.java  |    37 -
 .../cassandra/CassandraPersistenceUtils.java    |   486 -
 .../persistence/cassandra/CassandraService.java |  1125 -
 .../cassandra/ConnectedEntityRefImpl.java       |    61 -
 .../cassandra/ConnectionRefImpl.java            |   628 -
 .../persistence/cassandra/CounterUtils.java     |   400 -
 .../persistence/cassandra/CursorCache.java      |   121 -
 .../cassandra/EntityManagerFactoryImpl.java     |   411 -
 .../cassandra/EntityManagerImpl.java            |  2853 -
 .../cassandra/EntityValueSerializer.java        |    52 -
 .../persistence/cassandra/GeoIndexManager.java  |   323 -
 .../persistence/cassandra/IndexUpdate.java      |   450 -
 .../persistence/cassandra/QueryProcessor.java   |   704 -
 .../cassandra/RelationManagerImpl.java          |  2316 -
 .../usergrid/persistence/cassandra/Setup.java   |   206 -
 .../cassandra/SimpleIndexBucketLocatorImpl.java |   121 -
 .../cassandra/index/ConnectedIndexScanner.java  |   232 -
 .../cassandra/index/IndexBucketScanner.java     |   218 -
 .../index/IndexMultiBucketSetLoader.java        |   138 -
 .../cassandra/index/IndexScanner.java           |    38 -
 .../cassandra/index/NoOpIndexScanner.java       |    94 -
 .../cassandra/util/Slf4jTraceTagReporter.java   |    47 -
 .../cassandra/util/TaggedOpTimer.java           |    38 -
 .../persistence/cassandra/util/TimedOpTag.java  |   101 -
 .../cassandra/util/TraceParticipant.java        |    20 -
 .../persistence/cassandra/util/TraceTag.java    |    77 -
 .../cassandra/util/TraceTagAspect.java          |    41 -
 .../cassandra/util/TraceTagManager.java         |   156 -
 .../cassandra/util/TraceTagReporter.java        |    10 -
 .../usergrid/persistence/entities/Activity.java |   685 -
 .../persistence/entities/Application.java       |   609 -
 .../usergrid/persistence/entities/Asset.java    |    93 -
 .../usergrid/persistence/entities/Device.java   |   105 -
 .../usergrid/persistence/entities/Event.java    |   155 -
 .../usergrid/persistence/entities/Folder.java   |    93 -
 .../usergrid/persistence/entities/Group.java    |   168 -
 .../usergrid/persistence/entities/JobData.java  |    54 -
 .../usergrid/persistence/entities/JobStat.java  |   175 -
 .../usergrid/persistence/entities/Message.java  |    77 -
 .../org/usergrid/persistence/entities/Role.java |   153 -
 .../org/usergrid/persistence/entities/User.java |   348 -
 .../ApplicationAlreadyExistsException.java      |    37 -
 .../DuplicateUniquePropertyExistsException.java |    52 -
 .../exceptions/EntityNotFoundException.java     |    45 -
 .../exceptions/LockingException.java            |    65 -
 .../exceptions/NoFullTextIndexException.java    |    50 -
 .../exceptions/NoIndexException.java            |    50 -
 .../exceptions/PersistenceException.java        |    45 -
 .../PropertyTypeConversionException.java        |    71 -
 .../exceptions/QueryIterationException.java     |    13 -
 .../exceptions/QueryParseException.java         |    63 -
 .../exceptions/QueryTokenException.java         |    52 -
 .../persistence/exceptions/QueueException.java  |    61 -
 .../RequiredPropertyNotFoundException.java      |    41 -
 .../TransactionNotFoundException.java           |    45 -
 .../UnexpectedEntityTypeException.java          |    45 -
 .../persistence/geo/CollectionGeoSearch.java    |    52 -
 .../persistence/geo/ConnectionGeoSearch.java    |    51 -
 .../persistence/geo/EntityLocationRef.java      |   211 -
 .../EntityLocationRefDistanceComparator.java    |    77 -
 .../persistence/geo/GeoIndexSearcher.java       |   368 -
 .../persistence/geo/GeocellManager.java         |   179 -
 .../usergrid/persistence/geo/GeocellUtils.java  |   539 -
 .../geo/comparator/DoubleTupleComparator.java   |    23 -
 .../persistence/geo/model/BoundingBox.java      |    71 -
 .../persistence/geo/model/CostFunction.java     |    33 -
 .../geo/model/DefaultCostFunction.java          |    34 -
 .../usergrid/persistence/geo/model/Point.java   |    58 -
 .../usergrid/persistence/geo/model/Tuple.java   |    24 -
 .../usergrid/persistence/query/ir/AllNode.java  |    54 -
 .../usergrid/persistence/query/ir/AndNode.java  |    43 -
 .../persistence/query/ir/BooleanNode.java       |    48 -
 .../query/ir/EmailIdentifierNode.java           |    31 -
 .../query/ir/NameIdentifierNode.java            |    28 -
 .../persistence/query/ir/NodeVisitor.java       |    78 -
 .../usergrid/persistence/query/ir/NotNode.java  |    62 -
 .../usergrid/persistence/query/ir/OrNode.java   |    38 -
 .../persistence/query/ir/OrderByNode.java       |    92 -
 .../persistence/query/ir/QueryNode.java         |    28 -
 .../persistence/query/ir/QuerySlice.java        |   344 -
 .../persistence/query/ir/SearchVisitor.java     |   253 -
 .../persistence/query/ir/SliceNode.java         |   168 -
 .../query/ir/UuidIdentifierNode.java            |    32 -
 .../persistence/query/ir/WithinNode.java        |    96 -
 .../query/ir/result/AbstractScanColumn.java     |    60 -
 .../result/CollectionResultsLoaderFactory.java  |    23 -
 .../ir/result/ConnectionIndexSliceParser.java   |    86 -
 .../query/ir/result/ConnectionRefLoader.java    |    65 -
 .../result/ConnectionResultsLoaderFactory.java  |    32 -
 .../ir/result/ConnectionTypesIterator.java      |   179 -
 .../query/ir/result/EmptyIterator.java          |    47 -
 .../query/ir/result/EntityRefLoader.java        |    50 -
 .../query/ir/result/EntityResultsLoader.java    |    46 -
 .../query/ir/result/GeoIterator.java            |   355 -
 .../persistence/query/ir/result/IDLoader.java   |    24 -
 .../query/ir/result/IntersectionIterator.java   |   164 -
 .../query/ir/result/MergeIterator.java          |   137 -
 .../query/ir/result/MultiIterator.java          |    54 -
 .../query/ir/result/OrderByIterator.java        |   252 -
 .../query/ir/result/ResultIterator.java         |    43 -
 .../query/ir/result/ResultsLoader.java          |    29 -
 .../query/ir/result/ResultsLoaderFactory.java   |    21 -
 .../persistence/query/ir/result/ScanColumn.java |    16 -
 .../query/ir/result/ScanColumnTransformer.java  |    23 -
 .../ir/result/SecondaryIndexSliceParser.java    |    60 -
 .../query/ir/result/SliceIterator.java          |   213 -
 .../query/ir/result/SliceParser.java            |    31 -
 .../query/ir/result/StaticIdIterator.java       |    66 -
 .../query/ir/result/SubtractionIterator.java    |   108 -
 .../query/ir/result/UUIDIndexSliceParser.java   |    50 -
 .../query/ir/result/UnionIterator.java          |   132 -
 .../usergrid/persistence/query/tree/.gitignore  |     2 -
 .../persistence/query/tree/AndOperand.java      |    48 -
 .../persistence/query/tree/BooleanLiteral.java  |    48 -
 .../persistence/query/tree/BooleanOperand.java  |    48 -
 .../persistence/query/tree/ContainsOperand.java |    69 -
 .../query/tree/ContainsProperty.java            |    57 -
 .../usergrid/persistence/query/tree/Equal.java  |    52 -
 .../persistence/query/tree/EqualityOperand.java |    88 -
 .../persistence/query/tree/FloatLiteral.java    |    57 -
 .../persistence/query/tree/GreaterThan.java     |    52 -
 .../query/tree/GreaterThanEqual.java            |    56 -
 .../persistence/query/tree/LessThan.java        |    52 -
 .../persistence/query/tree/LessThanEqual.java   |    54 -
 .../persistence/query/tree/Literal.java         |    38 -
 .../persistence/query/tree/LiteralFactory.java  |    58 -
 .../persistence/query/tree/LongLiteral.java     |    64 -
 .../persistence/query/tree/NotOperand.java      |    45 -
 .../persistence/query/tree/NumericLiteral.java  |    24 -
 .../persistence/query/tree/Operand.java         |    47 -
 .../persistence/query/tree/OrOperand.java       |    53 -
 .../persistence/query/tree/Property.java        |    62 -
 .../persistence/query/tree/QueryVisitor.java    |    90 -
 .../persistence/query/tree/StringLiteral.java   |    82 -
 .../persistence/query/tree/UUIDLiteral.java     |    49 -
 .../persistence/query/tree/WithinOperand.java   |   111 -
 .../persistence/query/tree/WithinProperty.java  |    54 -
 .../persistence/query/util/PeekingIterator.java |    64 -
 .../persistence/schema/CollectionInfo.java      |   207 -
 .../persistence/schema/DictionaryInfo.java      |   117 -
 .../usergrid/persistence/schema/EntityInfo.java |   299 -
 .../persistence/schema/PropertyInfo.java        |   218 -
 .../usergrid/system/UsergridSystemMonitor.java  |    95 -
 .../main/java/org/usergrid/utils/AESUtils.java  |    84 -
 .../main/java/org/usergrid/utils/BCrypt.java    |   627 -
 .../java/org/usergrid/utils/ClassUtils.java     |    58 -
 .../java/org/usergrid/utils/CodecUtils.java     |    45 -
 .../java/org/usergrid/utils/CompositeUtils.java |    54 -
 .../org/usergrid/utils/ConversionUtils.java     |   765 -
 .../main/java/org/usergrid/utils/DateUtils.java |    88 -
 .../main/java/org/usergrid/utils/HttpUtils.java |    51 -
 .../java/org/usergrid/utils/IndexUtils.java     |   218 -
 .../org/usergrid/utils/InflectionUtils.java     |    51 -
 .../main/java/org/usergrid/utils/Inflector.java |   553 -
 .../main/java/org/usergrid/utils/JsonUtils.java |   329 -
 .../main/java/org/usergrid/utils/ListUtils.java |   230 -
 .../main/java/org/usergrid/utils/MailUtils.java |   154 -
 .../main/java/org/usergrid/utils/MapUtils.java  |   377 -
 .../java/org/usergrid/utils/NumberUtils.java    |    35 -
 .../java/org/usergrid/utils/PasswordUtils.java  |    28 -
 .../java/org/usergrid/utils/StringUtils.java    |   172 -
 .../main/java/org/usergrid/utils/TimeUtils.java |    88 -
 .../main/java/org/usergrid/utils/UUIDUtils.java |   412 -
 .../main/java/org/usergrid/utils/Version.java   |   428 -
 .../java/org/usergrid/utils/package-info.java   |    18 -
 .../main/resources/usergrid-core-context.xml    |    68 +-
 .../resources/usergrid-scheduler-context.xml    |    25 +-
 stack/core/src/site/apt/format.apt              |    17 +-
 stack/core/src/site/apt/index.apt               |    16 +
 stack/core/src/site/fml/faq.fml                 |    17 +
 stack/core/src/site/site.xml                    |    16 +
 stack/core/src/site/xdoc/xdoc.xml               |    18 +-
 stack/core/src/test/java/io/baas/Simple.java    |    19 -
 .../org/apache/usergrid/AbstractCoreIT.java     |    46 +
 .../java/org/apache/usergrid/Application.java   |   140 +
 .../apache/usergrid/ConcurrentCoreITSuite.java  |    51 +
 .../usergrid/ConcurrentCoreIteratorITSuite.java |    78 +
 .../usergrid/ConcurrentCoreTestSuite.java       |    49 +
 .../org/apache/usergrid/CoreApplication.java    |   172 +
 .../java/org/apache/usergrid/CoreITSetup.java   |    44 +
 .../org/apache/usergrid/CoreITSetupImpl.java    |   161 +
 .../java/org/apache/usergrid/CoreITSuite.java   |    50 +
 .../java/org/apache/usergrid/CoreTestSuite.java |    48 +
 .../org/apache/usergrid/batch/AppArgsTest.java  |    68 +
 .../batch/BulkJobExecutionUnitTest.java         |   225 +
 .../apache/usergrid/batch/BulkTestUtils.java    |    54 +
 .../batch/ConcurrentSchedulerITSuite.java       |    47 +
 .../batch/ConcurrentSchedulerTestSuite.java     |    35 +
 .../apache/usergrid/batch/SchedulerITSuite.java |    50 +
 .../usergrid/batch/SchedulerTestSuite.java      |    34 +
 .../usergrid/batch/UsergridJobFactoryTest.java  |    47 +
 .../batch/job/AbstractSchedulerRuntimeIT.java   |    78 +
 .../usergrid/batch/job/CountdownLatchJob.java   |    67 +
 .../usergrid/batch/job/DelayExecution.java      |   104 +
 .../usergrid/batch/job/DelayHeartbeat.java      |   106 +
 .../batch/job/FailureJobExceuction.java         |    74 +
 .../usergrid/batch/job/OnlyOnceExceution.java   |   116 +
 .../job/OnlyOnceUnlockOnFailExceution.java      |   126 +
 .../usergrid/batch/job/SchedulerRuntime1IT.java |    70 +
 .../usergrid/batch/job/SchedulerRuntime2IT.java |    98 +
 .../usergrid/batch/job/SchedulerRuntime3IT.java |    71 +
 .../usergrid/batch/job/SchedulerRuntime4IT.java |    68 +
 .../usergrid/batch/job/SchedulerRuntime5IT.java |    69 +
 .../usergrid/batch/job/SchedulerRuntime6IT.java |    97 +
 .../usergrid/batch/job/SchedulerRuntime7IT.java |    74 +
 .../usergrid/batch/job/SchedulerRuntime8IT.java |    95 +
 .../usergrid/batch/job/TestJobListener.java     |   120 +
 .../usergrid/batch/job/TestJobListenerTest.java |   143 +
 .../apache/usergrid/batch/job/package-info.java |    17 +
 .../clustering/hazelcast/HazelcastTest.java     |   112 +
 .../count/BatchCountParallelismTest.java        |   138 +
 .../usergrid/count/SimpleBatcherTest.java       |    51 +
 .../count/common/CountSerDeUtilsTest.java       |    69 +
 .../apache/usergrid/count/common/CountTest.java |    69 +
 .../locking/cassandra/HectorLockManagerIT.java  |   186 +
 .../SingleNodeLockTestSingleNode.java           |   169 +
 .../zookeeper/AbstractZooKeeperTest.java        |   127 +
 .../usergrid/locking/zookeeper/ZooPut.java      |   114 +
 .../zookeeper/ZookeeperLockManagerTest.java     |   183 +
 .../java/org/apache/usergrid/mq/MessagesIT.java |   279 +
 .../org/apache/usergrid/mq/QueuePathsTest.java  |    49 +
 .../usergrid/persistence/CollectionIT.java      |  1638 +
 .../usergrid/persistence/CoreSchemaManager.java |    82 +
 .../apache/usergrid/persistence/CounterIT.java  |   236 +
 .../persistence/EntityConnectionsIT.java        |   293 +
 .../persistence/EntityDictionaryIT.java         |   134 +
 .../usergrid/persistence/EntityManagerIT.java   |   564 +
 .../EntityPropertyComparatorTest.java           |   222 +
 .../apache/usergrid/persistence/EntityTest.java |   101 +
 .../org/apache/usergrid/persistence/GeoIT.java  |   525 +
 .../apache/usergrid/persistence/IndexIT.java    |   463 +
 .../usergrid/persistence/PathQueryIT.java       |   180 +
 .../usergrid/persistence/PermissionsIT.java     |   192 +
 .../apache/usergrid/persistence/QueryTest.java  |   312 +
 .../usergrid/persistence/QueryUtilsTest.java    |    57 +
 .../apache/usergrid/persistence/SchemaTest.java |   128 +
 .../apache/usergrid/persistence/UtilsTest.java  |    39 +
 .../cassandra/EntityManagerFactoryImplIT.java   |   176 +
 .../cassandra/QueryProcessorTest.java           |   727 +
 .../SimpleIndexBucketLocatorImplTest.java       |   177 +
 .../cassandra/util/TraceTagUnitTest.java        |    54 +
 .../persistence/entities/SampleEntity.java      |    59 +
 ...EntityLocationRefDistanceComparatorTest.java |   103 +
 .../query/AbstractIteratingQueryIT.java         |  1300 +
 .../persistence/query/AllInCollectionIT.java    |    29 +
 .../persistence/query/AllInConnectionIT.java    |    29 +
 .../query/AllInConnectionNoTypeIT.java          |    57 +
 .../query/IntersectionUnionPagingIT.java        |   168 +
 .../query/MultiOrderByCollectionIT.java         |    29 +
 .../MultiOrderByComplexUnionCollectionIT.java   |    29 +
 .../MultiOrderByComplexUnionConnectionIT.java   |    29 +
 .../query/MultiOrderByConnectionIT.java         |    32 +
 .../query/NotOrderByCollectionIT.java           |    29 +
 .../query/NotOrderByConnectionIT.java           |    29 +
 ...gleOrderByBoundRangeScanAscCollectionIT.java |    29 +
 ...gleOrderByBoundRangeScanAscConnectionIT.java |    29 +
 ...leOrderByBoundRangeScanDescCollectionIT.java |    29 +
 ...leOrderByBoundRangeScanDescConnectionIT.java |    29 +
 ...eOrderByComplexIntersectionCollectionIT.java |    29 +
 ...eOrderByComplexIntersectionConnectionIT.java |    30 +
 .../SingleOrderByComplexUnionCollectionIT.java  |    29 +
 .../SingleOrderByComplexUnionConnectionIT.java  |    29 +
 .../SingleOrderByIntersectionCollectionIT.java  |    31 +
 .../SingleOrderByIntersectionConnectionIT.java  |    31 +
 .../SingleOrderByLessThanLimitCollectionIT.java |    29 +
 .../SingleOrderByLessThanLimitConnectionIT.java |    29 +
 .../SingleOrderByMaxLimitCollectionIT.java      |    30 +
 .../SingleOrderByMaxLimitConnectionIT.java      |    30 +
 ...SingleOrderByNoIntersectionCollectionIT.java |    29 +
 ...SingleOrderByNoIntersectionConnectionIT.java |    29 +
 .../query/SingleOrderByNotCollectionIT.java     |    29 +
 .../query/SingleOrderByNotConnectionIT.java     |    29 +
 ...OrderBySameRangeScanGreaterCollectionIT.java |    29 +
 ...OrderBySameRangeScanGreaterConnectionIT.java |    29 +
 ...meRangeScanGreaterThanEqualCollectionIT.java |    29 +
 ...gleOrderBySameRangeScanLessCollectionIT.java |    29 +
 ...gleOrderBySameRangeScanLessConnectionIT.java |    29 +
 ...ySameRangeScanLessThanEqualCollectionIT.java |    29 +
 ...ySameRangeScanLessThanEqualConnectionIT.java |    29 +
 .../query/ir/result/AbstractScanColumnTest.java |   100 +
 .../query/ir/result/InOrderIterator.java        |   131 +
 .../ir/result/IntersectionIteratorTest.java     |   307 +
 .../query/ir/result/IteratorHelper.java         |    34 +
 .../ir/result/SubtractionIteratorTest.java      |   181 +
 .../query/ir/result/UnionIteratorTest.java      |   467 +
 .../persistence/query/tree/GrammarTreeTest.java |   593 +
 .../persistence/query/tree/LongLiteralTest.java |    62 +
 .../query/tree/StringLiteralTest.java           |    88 +
 .../system/UsergridSystemMonitorIT.java         |    67 +
 .../usergrid/utils/ConversionUtilsTest.java     |    49 +
 .../apache/usergrid/utils/IndexUtilsTest.java   |    71 +
 .../apache/usergrid/utils/JsonUtilsTest.java    |    85 +
 .../apache/usergrid/utils/ListUtilsTest.java    |    53 +
 .../apache/usergrid/utils/MailUtilsTest.java    |    90 +
 .../org/apache/usergrid/utils/MapUtilsTest.java |    41 +
 .../apache/usergrid/utils/TestInflector.java    |    81 +
 .../apache/usergrid/utils/TimeUtilsTest.java    |    59 +
 .../apache/usergrid/utils/UUIDUtilsTest.java    |   371 +
 .../org/apache/usergrid/utils/package-info.java |    17 +
 .../test/java/org/usergrid/AbstractCoreIT.java  |    45 -
 .../src/test/java/org/usergrid/Application.java |   124 -
 .../org/usergrid/ConcurrentCoreITSuite.java     |    50 -
 .../usergrid/ConcurrentCoreIteratorITSuite.java |    62 -
 .../org/usergrid/ConcurrentCoreTestSuite.java   |    33 -
 .../test/java/org/usergrid/CoreApplication.java |   171 -
 .../src/test/java/org/usergrid/CoreITSetup.java |    43 -
 .../test/java/org/usergrid/CoreITSetupImpl.java |   145 -
 .../src/test/java/org/usergrid/CoreITSuite.java |    34 -
 .../test/java/org/usergrid/CoreTestSuite.java   |    47 -
 .../core/src/test/java/org/usergrid/Simple.java |    36 +
 .../java/org/usergrid/batch/AppArgsTest.java    |    52 -
 .../batch/BulkJobExecutionUnitTest.java         |   209 -
 .../java/org/usergrid/batch/BulkTestUtils.java  |    38 -
 .../batch/ConcurrentSchedulerITSuite.java       |    31 -
 .../batch/ConcurrentSchedulerTestSuite.java     |    19 -
 .../org/usergrid/batch/SchedulerITSuite.java    |    34 -
 .../org/usergrid/batch/SchedulerTestSuite.java  |    18 -
 .../usergrid/batch/UsergridJobFactoryTest.java  |    31 -
 .../batch/job/AbstractSchedulerRuntimeIT.java   |    77 -
 .../usergrid/batch/job/CountdownLatchJob.java   |    67 -
 .../org/usergrid/batch/job/DelayExecution.java  |   104 -
 .../org/usergrid/batch/job/DelayHeartbeat.java  |   106 -
 .../batch/job/FailureJobExceuction.java         |    74 -
 .../usergrid/batch/job/OnlyOnceExceution.java   |   116 -
 .../job/OnlyOnceUnlockOnFailExceution.java      |   126 -
 .../usergrid/batch/job/SchedulerRuntime1IT.java |    48 -
 .../usergrid/batch/job/SchedulerRuntime2IT.java |    65 -
 .../usergrid/batch/job/SchedulerRuntime3IT.java |    71 -
 .../usergrid/batch/job/SchedulerRuntime4IT.java |    68 -
 .../usergrid/batch/job/SchedulerRuntime5IT.java |    69 -
 .../usergrid/batch/job/SchedulerRuntime6IT.java |    97 -
 .../usergrid/batch/job/SchedulerRuntime7IT.java |    74 -
 .../usergrid/batch/job/SchedulerRuntime8IT.java |    95 -
 .../org/usergrid/batch/job/TestJobListener.java |   111 -
 .../usergrid/batch/job/TestJobListenerTest.java |   142 -
 .../org/usergrid/batch/job/package-info.java    |    18 -
 .../clustering/hazelcast/HazelcastTest.java     |   111 -
 .../count/BatchCountParallelismTest.java        |   109 -
 .../count/CassandraCounterStoreTest.java        |    63 -
 .../org/usergrid/count/SimpleBatcherTest.java   |    51 -
 .../count/common/CountSerDeUtilsTest.java       |    68 -
 .../org/usergrid/count/common/CountTest.java    |    68 -
 .../locking/cassandra/HectorLockManagerIT.java  |   185 -
 .../SingleNodeLockTestSingleNode.java           |   168 -
 .../zookeeper/AbstractZooKeeperTest.java        |   126 -
 .../org/usergrid/locking/zookeeper/ZooPut.java  |   113 -
 .../zookeeper/ZookeeperLockManagerTest.java     |   182 -
 .../test/java/org/usergrid/mq/MessagesIT.java   |   278 -
 .../java/org/usergrid/mq/QueuePathsTest.java    |    48 -
 .../org/usergrid/persistence/CollectionIT.java  |  1637 -
 .../usergrid/persistence/CoreSchemaManager.java |    66 -
 .../org/usergrid/persistence/CounterIT.java     |   235 -
 .../persistence/EntityConnectionsIT.java        |   292 -
 .../persistence/EntityDictionaryIT.java         |   133 -
 .../usergrid/persistence/EntityManagerIT.java   |   563 -
 .../EntityPropertyComparatorTest.java           |   206 -
 .../org/usergrid/persistence/EntityTest.java    |   100 -
 .../java/org/usergrid/persistence/GeoIT.java    |   524 -
 .../java/org/usergrid/persistence/IndexIT.java  |   462 -
 .../org/usergrid/persistence/PathQueryIT.java   |   164 -
 .../org/usergrid/persistence/PermissionsIT.java |   191 -
 .../org/usergrid/persistence/QueryTest.java     |   311 -
 .../usergrid/persistence/QueryUtilsTest.java    |    41 -
 .../org/usergrid/persistence/SchemaTest.java    |   127 -
 .../org/usergrid/persistence/UtilsTest.java     |    38 -
 .../cassandra/EntityManagerFactoryImplIT.java   |   175 -
 .../cassandra/QueryProcessorTest.java           |   726 -
 .../SimpleIndexBucketLocatorImplTest.java       |   176 -
 .../cassandra/util/TraceTagUnitTest.java        |    38 -
 .../persistence/entities/SampleEntity.java      |    58 -
 ...EntityLocationRefDistanceComparatorTest.java |   102 -
 .../query/AbstractIteratingQueryIT.java         |  1285 -
 .../persistence/query/AllInCollectionIT.java    |    28 -
 .../persistence/query/AllInConnectionIT.java    |    28 -
 .../query/AllInConnectionNoTypeIT.java          |    49 -
 .../query/MultiOrderByCollectionIT.java         |    28 -
 .../MultiOrderByComplexUnionCollectionIT.java   |    28 -
 .../MultiOrderByComplexUnionConnectionIT.java   |    28 -
 .../query/MultiOrderByConnectionIT.java         |    31 -
 .../query/NotOrderByCollectionIT.java           |    28 -
 .../query/NotOrderByConnectionIT.java           |    28 -
 ...gleOrderByBoundRangeScanAscCollectionIT.java |    28 -
 ...gleOrderByBoundRangeScanAscConnectionIT.java |    28 -
 ...leOrderByBoundRangeScanDescCollectionIT.java |    28 -
 ...leOrderByBoundRangeScanDescConnectionIT.java |    28 -
 ...eOrderByComplexIntersectionCollectionIT.java |    28 -
 ...eOrderByComplexIntersectionConnectionIT.java |    29 -
 .../SingleOrderByComplexUnionCollectionIT.java  |    28 -
 .../SingleOrderByComplexUnionConnectionIT.java  |    28 -
 .../SingleOrderByIntersectionCollectionIT.java  |    30 -
 .../SingleOrderByIntersectionConnectionIT.java  |    30 -
 .../SingleOrderByLessThanLimitCollectionIT.java |    28 -
 .../SingleOrderByLessThanLimitConnectionIT.java |    28 -
 .../SingleOrderByMaxLimitCollectionIT.java      |    29 -
 .../SingleOrderByMaxLimitConnectionIT.java      |    29 -
 ...SingleOrderByNoIntersectionCollectionIT.java |    28 -
 ...SingleOrderByNoIntersectionConnectionIT.java |    28 -
 .../query/SingleOrderByNotCollectionIT.java     |    28 -
 .../query/SingleOrderByNotConnectionIT.java     |    28 -
 ...OrderBySameRangeScanGreaterCollectionIT.java |    28 -
 ...OrderBySameRangeScanGreaterConnectionIT.java |    28 -
 ...meRangeScanGreaterThanEqualCollectionIT.java |    28 -
 ...gleOrderBySameRangeScanLessCollectionIT.java |    28 -
 ...gleOrderBySameRangeScanLessConnectionIT.java |    28 -
 ...ySameRangeScanLessThanEqualCollectionIT.java |    28 -
 ...ySameRangeScanLessThanEqualConnectionIT.java |    28 -
 .../query/ir/result/InOrderIterator.java        |   115 -
 .../ir/result/IntersectionIteratorTest.java     |   304 -
 .../query/ir/result/IteratorHelper.java         |    18 -
 .../ir/result/SubtractionIteratorTest.java      |   180 -
 .../query/ir/result/UnionIteratorTest.java      |   258 -
 .../persistence/query/tree/GrammarTreeTest.java |   557 -
 .../persistence/query/tree/LongLiteralTest.java |    61 -
 .../query/tree/StringLiteralTest.java           |    87 -
 .../system/UsergridSystemMonitorIT.java         |    51 -
 .../org/usergrid/utils/ConversionUtilsTest.java |    49 -
 .../java/org/usergrid/utils/IndexUtilsTest.java |    71 -
 .../java/org/usergrid/utils/JsonUtilsTest.java  |    85 -
 .../java/org/usergrid/utils/ListUtilsTest.java  |    53 -
 .../java/org/usergrid/utils/MailUtilsTest.java  |    90 -
 .../java/org/usergrid/utils/MapUtilsTest.java   |    41 -
 .../java/org/usergrid/utils/TestInflector.java  |    81 -
 .../java/org/usergrid/utils/TimeUtilsTest.java  |    60 -
 .../java/org/usergrid/utils/UUIDUtilsTest.java  |   371 -
 .../java/org/usergrid/utils/package-info.java   |    18 -
 stack/core/src/test/resources/log4j.properties  |    16 +-
 .../test/resources/usergrid-test-context.xml    |     4 +-
 stack/launcher/launch                           |    18 +-
 stack/launcher/pom.xml                          |    28 +-
 .../java/org/apache/usergrid/launcher/App.java  |   289 +
 .../apache/usergrid/launcher/AppleUtils.java    |    39 +
 .../launcher/ClasspathStaticHttpHandler.java    |   320 +
 .../launcher/CustomJSPTemplateProcessor.java    |   137 +
 .../usergrid/launcher/EmbeddedServerHelper.java |   193 +
 .../org/apache/usergrid/launcher/JarMain.java   |    39 +
 .../apache/usergrid/launcher/LauncherFrame.java |   462 +
 .../usergrid/launcher/LogViewerFrame.java       |   105 +
 .../org/apache/usergrid/launcher/Server.java    |   618 +
 .../apache/usergrid/launcher/package-info.java  |    17 +
 .../main/java/org/usergrid/launcher/App.java    |   288 -
 .../java/org/usergrid/launcher/AppleUtils.java  |    38 -
 .../launcher/ClasspathStaticHttpHandler.java    |   320 -
 .../launcher/CustomJSPTemplateProcessor.java    |   137 -
 .../usergrid/launcher/EmbeddedServerHelper.java |   193 -
 .../java/org/usergrid/launcher/JarMain.java     |    40 -
 .../org/usergrid/launcher/LauncherFrame.java    |   461 -
 .../org/usergrid/launcher/LogViewerFrame.java   |   104 -
 .../main/java/org/usergrid/launcher/Server.java |   618 -
 .../org/usergrid/launcher/package-info.java     |    18 -
 .../launcher/src/main/resources/cassandra.yaml  |    14 +-
 .../src/main/resources/log4j.properties         |    14 +-
 .../org/apache/usergrid/launcher/dock_icon.png  |   Bin 0 -> 11592 bytes
 .../org/apache/usergrid/launcher/icon_16.png    |   Bin 0 -> 3273 bytes
 .../org/apache/usergrid/launcher/icon_256.png   |   Bin 0 -> 12578 bytes
 .../org/apache/usergrid/launcher/icon_32.png    |   Bin 0 -> 3862 bytes
 .../org/apache/usergrid/launcher/icon_64.png    |   Bin 0 -> 5079 bytes
 .../org/apache/usergrid/launcher/log_viewer.png |   Bin 0 -> 6610 bytes
 .../org/apache/usergrid/launcher/start.png      |   Bin 0 -> 9253 bytes
 .../apache/usergrid/launcher/start_active.png   |   Bin 0 -> 9334 bytes
 .../apache/usergrid/launcher/status_green.png   |   Bin 0 -> 2048 bytes
 .../org/apache/usergrid/launcher/status_off.png |   Bin 0 -> 1847 bytes
 .../org/apache/usergrid/launcher/status_red.png |   Bin 0 -> 2047 bytes
 .../apache/usergrid/launcher/status_yellow.png  |   Bin 0 -> 2092 bytes
 .../org/apache/usergrid/launcher/stop.png       |   Bin 0 -> 8858 bytes
 .../apache/usergrid/launcher/stop_active.png    |   Bin 0 -> 8844 bytes
 .../apache/usergrid/launcher/web_browser.png    |   Bin 0 -> 4531 bytes
 .../org/usergrid/launcher/dock_icon.png         |   Bin 11592 -> 0 bytes
 .../resources/org/usergrid/launcher/icon_16.png |   Bin 3273 -> 0 bytes
 .../org/usergrid/launcher/icon_256.png          |   Bin 12578 -> 0 bytes
 .../resources/org/usergrid/launcher/icon_32.png |   Bin 3862 -> 0 bytes
 .../resources/org/usergrid/launcher/icon_64.png |   Bin 5079 -> 0 bytes
 .../org/usergrid/launcher/log_viewer.png        |   Bin 6610 -> 0 bytes
 .../resources/org/usergrid/launcher/start.png   |   Bin 9253 -> 0 bytes
 .../org/usergrid/launcher/start_active.png      |   Bin 9334 -> 0 bytes
 .../org/usergrid/launcher/status_green.png      |   Bin 2048 -> 0 bytes
 .../org/usergrid/launcher/status_off.png        |   Bin 1847 -> 0 bytes
 .../org/usergrid/launcher/status_red.png        |   Bin 2047 -> 0 bytes
 .../org/usergrid/launcher/status_yellow.png     |   Bin 2092 -> 0 bytes
 .../resources/org/usergrid/launcher/stop.png    |   Bin 8858 -> 0 bytes
 .../org/usergrid/launcher/stop_active.png       |   Bin 8844 -> 0 bytes
 .../org/usergrid/launcher/web_browser.png       |   Bin 4531 -> 0 bytes
 .../resources/usergrid-standalone-context.xml   |    18 +-
 .../resources/usergrid-standalone.properties    |    23 +
 .../0.0.3/usergrid-java-client-0.0.3.jar        |   Bin 0 -> 45750 bytes
 .../usergrid-java-client-0.0.3.jar.lastUpdated  |     5 +
 .../0.0.3/usergrid-java-client-0.0.3.jar.sha1   |     1 +
 .../0.0.3/usergrid-java-client-0.0.3.pom        |    87 +
 .../usergrid-java-client-0.0.3.pom.lastUpdated  |     5 +
 .../0.0.3/usergrid-java-client-0.0.3.pom.sha1   |     1 +
 .../maven-metadata-local.xml                    |    13 +
 stack/mongo-emulator/README.txt                 |     2 +-
 stack/mongo-emulator/pom.xml                    |    32 +-
 .../usergrid/mongo/MongoChannelHandler.java     |   145 +
 .../usergrid/mongo/MongoMessageDecoder.java     |   116 +
 .../usergrid/mongo/MongoMessageEncoder.java     |    47 +
 .../org/apache/usergrid/mongo/MongoQuery.java   |    31 +
 .../org/apache/usergrid/mongo/MongoServer.java  |   172 +
 .../mongo/MongoServerPipelineFactory.java       |    56 +
 .../usergrid/mongo/commands/Buildinfo.java      |    44 +
 .../usergrid/mongo/commands/Collstats.java      |    59 +
 .../apache/usergrid/mongo/commands/Count.java   |    66 +
 .../apache/usergrid/mongo/commands/Dbstats.java |    41 +
 .../usergrid/mongo/commands/Getlasterror.java   |    49 +
 .../usergrid/mongo/commands/ListDatabases.java  |    52 +
 .../usergrid/mongo/commands/MongoCommand.java   |    82 +
 .../mongo/commands/ReplSetGetStatus.java        |    38 +
 .../usergrid/mongo/commands/ServerStatus.java   |    63 +
 .../usergrid/mongo/commands/Whatsmyuri.java     |    42 +
 .../apache/usergrid/mongo/protocol/Message.java |   192 +
 .../apache/usergrid/mongo/protocol/OpCrud.java  |    47 +
 .../usergrid/mongo/protocol/OpDelete.java       |   197 +
 .../usergrid/mongo/protocol/OpGetMore.java      |   113 +
 .../usergrid/mongo/protocol/OpInsert.java       |   181 +
 .../usergrid/mongo/protocol/OpKillCursors.java  |   116 +
 .../apache/usergrid/mongo/protocol/OpMsg.java   |    78 +
 .../apache/usergrid/mongo/protocol/OpQuery.java |   448 +
 .../apache/usergrid/mongo/protocol/OpReply.java |   190 +
 .../usergrid/mongo/protocol/OpUpdate.java       |   207 +
 .../usergrid/mongo/query/MongoQueryParser.java  |   292 +
 .../mongo/testproxy/MongoMessageFrame.java      |    56 +
 .../testproxy/MongoProxyInboundHandler.java     |   198 +
 .../testproxy/MongoProxyPipelineFactory.java    |    54 +
 .../mongo/testproxy/MongoProxyServer.java       |    56 +
 .../testproxy/MongoProxyServerHandler.java      |    59 +
 .../apache/usergrid/mongo/utils/BSONUtils.java  |    51 +
 .../org/usergrid/mongo/MongoChannelHandler.java |   144 -
 .../org/usergrid/mongo/MongoMessageDecoder.java |   115 -
 .../org/usergrid/mongo/MongoMessageEncoder.java |    46 -
 .../java/org/usergrid/mongo/MongoQuery.java     |    30 -
 .../java/org/usergrid/mongo/MongoServer.java    |   171 -
 .../mongo/MongoServerPipelineFactory.java       |    55 -
 .../org/usergrid/mongo/commands/Buildinfo.java  |    43 -
 .../org/usergrid/mongo/commands/Collstats.java  |    58 -
 .../java/org/usergrid/mongo/commands/Count.java |    65 -
 .../org/usergrid/mongo/commands/Dbstats.java    |    40 -
 .../usergrid/mongo/commands/Getlasterror.java   |    48 -
 .../usergrid/mongo/commands/ListDatabases.java  |    51 -
 .../usergrid/mongo/commands/MongoCommand.java   |    81 -
 .../mongo/commands/ReplSetGetStatus.java        |    37 -
 .../usergrid/mongo/commands/ServerStatus.java   |    63 -
 .../org/usergrid/mongo/commands/Whatsmyuri.java |    41 -
 .../org/usergrid/mongo/protocol/Message.java    |   191 -
 .../org/usergrid/mongo/protocol/OpCrud.java     |    46 -
 .../org/usergrid/mongo/protocol/OpDelete.java   |   196 -
 .../org/usergrid/mongo/protocol/OpGetMore.java  |   112 -
 .../org/usergrid/mongo/protocol/OpInsert.java   |   180 -
 .../usergrid/mongo/protocol/OpKillCursors.java  |   115 -
 .../java/org/usergrid/mongo/protocol/OpMsg.java |    77 -
 .../org/usergrid/mongo/protocol/OpQuery.java    |   447 -
 .../org/usergrid/mongo/protocol/OpReply.java    |   189 -
 .../org/usergrid/mongo/protocol/OpUpdate.java   |   206 -
 .../usergrid/mongo/query/MongoQueryParser.java  |   291 -
 .../mongo/testproxy/MongoMessageFrame.java      |    55 -
 .../testproxy/MongoProxyInboundHandler.java     |   197 -
 .../testproxy/MongoProxyPipelineFactory.java    |    53 -
 .../mongo/testproxy/MongoProxyServer.java       |    55 -
 .../testproxy/MongoProxyServerHandler.java      |    58 -
 .../org/usergrid/mongo/utils/BSONUtils.java     |    50 -
 .../usergrid/mongo/AbstractMongoTest.java       |    63 +
 .../apache/usergrid/mongo/BasicMongoTest.java   |   356 +
 .../usergrid/mongo/DatabaseInitializer.java     |   146 +
 .../apache/usergrid/mongo/MongoQueryTest.java   |   519 +
 .../org/usergrid/mongo/AbstractMongoTest.java   |    61 -
 .../java/org/usergrid/mongo/BasicMongoTest.java |   340 -
 .../org/usergrid/mongo/DatabaseInitializer.java |   145 -
 .../java/org/usergrid/mongo/MongoQueryTest.java |   503 -
 .../test/resources/usergrid-test-context.xml    |     4 +-
 stack/pom.xml                                   |   118 +-
 stack/query-validator/.gitignore                |     1 +
 stack/query-validator/README.md                 |     3 +
 stack/query-validator/pom.xml                   |   246 +-
 stack/query-validator/sql.db                    |   Bin 4096 -> 0 bytes
 .../query/validator/ApiServerRunner.java        |   211 +
 .../validator/DefaultQueryResultsMatcher.java   |    31 +
 .../usergrid/query/validator/QueryEntity.java   |    62 +
 .../usergrid/query/validator/QueryRequest.java  |    66 +
 .../usergrid/query/validator/QueryResponse.java |   104 +
 .../query/validator/QueryResultsMatcher.java    |    28 +
 .../usergrid/query/validator/QueryRunner.java   |    30 +
 .../validator/QueryValidationConfiguration.java |    93 +
 .../query/validator/QueryValidator.java         |    77 +
 .../usergrid/query/validator/SqliteRunner.java  |   191 +
 .../query/validator/ApiServerRunner.java        |   212 -
 .../usergrid/query/validator/QueryEntity.java   |    34 -
 .../usergrid/query/validator/QueryRequest.java  |    74 -
 .../usergrid/query/validator/QueryResponse.java |   103 -
 .../usergrid/query/validator/QueryRunner.java   |    28 -
 .../validator/QueryValidationConfiguration.java |    74 -
 .../query/validator/QueryValidator.java         |    77 -
 .../usergrid/query/validator/SqliteRunner.java  |   160 -
 .../usergrid-query-validator-context.xml        |    30 +-
 .../query/validator/AbstractQueryIT.java        |   132 +
 .../usergrid/query/validator/QueryITSuite.java  |    38 +
 .../query/validator/users/UserQueryIT.java      |   876 +
 .../query/validator/QueryValidationTest.java    |   339 -
 .../query/validator/QueryValidatorRunner.java   |   209 -
 .../src/test/resources/log4j.properties         |    18 +-
 .../src/test/resources/project.properties       |    17 +
 .../src/test/resources/user.json                |    15 +-
 .../resources/usergrid-custom-test.properties   |    29 +-
 .../test/resources/usergrid-test-context.xml    |    42 +-
 stack/rest/pom.xml                              |    61 +-
 .../usergrid/rest/AbstractContextResource.java  |   165 +
 .../org/apache/usergrid/rest/ApiResponse.java   |   637 +
 .../rest/JacksonCustomMapperProvider.java       |    66 +
 .../org/apache/usergrid/rest/RootResource.java  |   398 +
 .../rest/ServerEnvironmentProperties.java       |    63 +
 .../apache/usergrid/rest/SwaggerServlet.java    |   172 +
 .../apache/usergrid/rest/SystemResource.java    |   111 +
 .../usergrid/rest/TextToJsonSwapWriter.java     |   135 +
 .../rest/applications/ApplicationResource.java  |   611 +
 .../rest/applications/AuthResource.java         |   252 +
 .../rest/applications/ServiceResource.java      |   663 +
 .../applications/assets/AssetsResource.java     |   206 +
 .../applications/events/EventsResource.java     |    70 +
 .../rest/applications/queues/QueueResource.java |   205 +
 .../queues/QueueSubscriberResource.java         |   159 +
 .../queues/QueueSubscriptionResource.java       |   161 +
 .../queues/QueueTransactionsResource.java       |   100 +
 .../users/AbstractUserExtensionResource.java    |    48 +
 .../rest/applications/users/UserResource.java   |   581 +
 .../rest/applications/users/UsersResource.java  |   265 +
 .../exceptions/AbstractExceptionMapper.java     |   107 +
 .../usergrid/rest/exceptions/AuthErrorInfo.java |   112 +
 .../AuthorizationExceptionMapper.java           |    37 +
 ...cateUniquePropertyExistsExceptionMapper.java |    36 +
 .../EntityNotFoundExceptionMapper.java          |    35 +
 ...orbiddenServiceOperationExceptionMapper.java |    36 +
 .../IllegalArgumentExceptionMapper.java         |    33 +
 .../exceptions/JsonReadExceptionMapper.java     |    35 +
 .../exceptions/JsonWriteExceptionMapper.java    |    35 +
 .../exceptions/ManagementExceptionMapper.java   |    39 +
 .../usergrid/rest/exceptions/NoOpException.java |    51 +
 .../rest/exceptions/NoOpExceptionMapper.java    |    33 +
 .../NotImplementedExceptionMapper.java          |    33 +
 .../exceptions/OAuthProblemExceptionMapper.java |    52 +
 ...rganizationApplicationNotFoundException.java |    55 +
 ...ationApplicationNotFoundExceptionMapper.java |    32 +
 .../exceptions/PersistenceExceptionMapper.java  |    28 +
 .../exceptions/QueryParseExceptionMapper.java   |    35 +
 .../exceptions/QueryTokenExceptionMapper.java   |    37 +
 .../RecentlyUsedPasswordExceptionMapper.java    |    37 +
 .../rest/exceptions/RedirectionException.java   |    43 +
 .../exceptions/RedirectionExceptionMapper.java  |    31 +
 ...RequiredPropertyNotFoundExceptionMapper.java |    36 +
 .../rest/exceptions/SecurityException.java      |    89 +
 .../exceptions/SecurityExceptionMapper.java     |    46 +
 .../rest/exceptions/ServiceExceptionMapper.java |    29 +
 .../ServiceResourceNotFoundExceptionMapper.java |    42 +
 .../rest/exceptions/ThrowableMapper.java        |    27 +
 .../TransactionNotFoundExceptionMapper.java     |    35 +
 .../rest/filters/ContentTypeFilter.java         |   324 +
 .../rest/filters/JSONPCallbackFilter.java       |    67 +
 .../usergrid/rest/filters/MeteringFilter.java   |   344 +
 .../usergrid/rest/filters/TracingFilter.java    |    90 +
 .../rest/management/ManagementResource.java     |   479 +
 .../management/metrics/MetricsResource.java     |    55 +
 .../organizations/OrganizationResource.java     |   255 +
 .../organizations/OrganizationsResource.java    |   193 +
 .../applications/ApplicationResource.java       |   196 +
 .../applications/ApplicationsResource.java      |   159 +
 .../organizations/users/UsersResource.java      |   342 +
 .../rest/management/users/UserResource.java     |   424 +
 .../rest/management/users/UsersResource.java    |   212 +
 .../organizations/OrganizationsResource.java    |   207 +
 .../organizations/OrganizationResource.java     |   175 +
 .../rest/security/CrossOriginRequestFilter.java |    39 +
 .../security/SecuredResourceFilterFactory.java  |   326 +
 .../annotations/RequireAdminUserAccess.java     |    32 +
 .../annotations/RequireApplicationAccess.java   |    35 +
 .../annotations/RequireOrganizationAccess.java  |    35 +
 .../annotations/RequireSystemAccess.java        |    32 +
 .../security/shiro/RestSecurityManager.java     |    61 +
 .../ShiroAuthenticationExceptionMapper.java     |    60 +
 .../shiro/filters/BasicAuthSecurityFilter.java  |   112 +
 .../ClientCredentialsSecurityFilter.java        |    70 +
 .../OAuth2AccessTokenSecurityFilter.java        |   212 +
 .../security/shiro/filters/SecurityFilter.java  |   137 +
 .../session/HttpRequestSessionManager.java      |    88 +
 .../session/HttpServletRequestSession.java      |   133 +
 .../usergrid/rest/test/PropertiesResource.java  |    88 +
 .../apache/usergrid/rest/utils/CORSUtils.java   |   174 +
 .../apache/usergrid/rest/utils/JSONPUtils.java  |   104 +
 .../usergrid/rest/utils/PathingUtils.java       |    51 +
 .../usergrid/rest/AbstractContextResource.java  |   164 -
 .../java/org/usergrid/rest/ApiResponse.java     |   636 -
 .../rest/JacksonCustomMapperProvider.java       |    65 -
 .../java/org/usergrid/rest/RootResource.java    |   397 -
 .../rest/ServerEnvironmentProperties.java       |    47 -
 .../java/org/usergrid/rest/SwaggerServlet.java  |   171 -
 .../java/org/usergrid/rest/SystemResource.java  |   110 -
 .../org/usergrid/rest/TextToJsonSwapWriter.java |   119 -
 .../rest/applications/ApplicationResource.java  |   610 -
 .../rest/applications/AuthResource.java         |   251 -
 .../rest/applications/ServiceResource.java      |   662 -
 .../applications/assets/AssetsResource.java     |   187 -
 .../applications/events/EventsResource.java     |    69 -
 .../rest/applications/queues/QueueResource.java |   204 -
 .../queues/QueueSubscriberResource.java         |   158 -
 .../queues/QueueSubscriptionResource.java       |   160 -
 .../queues/QueueTransactionsResource.java       |    99 -
 .../users/AbstractUserExtensionResource.java    |    47 -
 .../rest/applications/users/UserResource.java   |   580 -
 .../rest/applications/users/UsersResource.java  |   264 -
 .../exceptions/AbstractExceptionMapper.java     |   106 -
 .../usergrid/rest/exceptions/AuthErrorInfo.java |   111 -
 .../AuthorizationExceptionMapper.java           |    36 -
 ...cateUniquePropertyExistsExceptionMapper.java |    35 -
 .../EntityNotFoundExceptionMapper.java          |    34 -
 ...orbiddenServiceOperationExceptionMapper.java |    35 -
 .../IllegalArgumentExceptionMapper.java         |    32 -
 .../exceptions/JsonReadExceptionMapper.java     |    35 -
 .../exceptions/JsonWriteExceptionMapper.java    |    35 -
 .../exceptions/ManagementExceptionMapper.java   |    38 -
 .../usergrid/rest/exceptions/NoOpException.java |    50 -
 .../rest/exceptions/NoOpExceptionMapper.java    |    32 -
 .../NotImplementedExceptionMapper.java          |    32 -
 .../exceptions/OAuthProblemExceptionMapper.java |    51 -
 ...rganizationApplicationNotFoundException.java |    39 -
 ...ationApplicationNotFoundExceptionMapper.java |    16 -
 .../exceptions/PersistenceExceptionMapper.java  |    27 -
 .../exceptions/QueryParseExceptionMapper.java   |    34 -
 .../exceptions/QueryTokenExceptionMapper.java   |    36 -
 .../RecentlyUsedPasswordExceptionMapper.java    |    21 -
 .../rest/exceptions/RedirectionException.java   |    27 -
 .../exceptions/RedirectionExceptionMapper.java  |    30 -
 ...RequiredPropertyNotFoundExceptionMapper.java |    35 -
 .../rest/exceptions/SecurityException.java      |    88 -
 .../exceptions/SecurityExceptionMapper.java     |    45 -
 .../rest/exceptions/ServiceExceptionMapper.java |    28 -
 .../ServiceResourceNotFoundExceptionMapper.java |    41 -
 .../rest/exceptions/ThrowableMapper.java        |    26 -
 .../TransactionNotFoundExceptionMapper.java     |    34 -
 .../rest/filters/ContentTypeFilter.java         |   323 -
 .../rest/filters/JSONPCallbackFilter.java       |    66 -
 .../usergrid/rest/filters/MeteringFilter.java   |   343 -
 .../usergrid/rest/filters/TracingFilter.java    |    74 -
 .../rest/management/ManagementResource.java     |   478 -
 .../management/metrics/MetricsResource.java     |    39 -
 .../organizations/OrganizationResource.java     |   254 -
 .../organizations/OrganizationsResource.java    |   192 -
 .../applications/ApplicationResource.java       |   195 -
 .../applications/ApplicationsResource.java      |   158 -
 .../organizations/users/UsersResource.java      |   341 -
 .../rest/management/users/UserResource.java     |   423 -
 .../rest/management/users/UsersResource.java    |   211 -
 .../organizations/OrganizationsResource.java    |   206 -
 .../organizations/OrganizationResource.java     |   159 -
 .../rest/security/CrossOriginRequestFilter.java |    38 -
 .../security/SecuredResourceFilterFactory.java  |   325 -
 .../annotations/RequireAdminUserAccess.java     |    31 -
 .../annotations/RequireApplicationAccess.java   |    34 -
 .../annotations/RequireOrganizationAccess.java  |    34 -
 .../annotations/RequireSystemAccess.java        |    31 -
 .../security/shiro/RestSecurityManager.java     |    60 -
 .../ShiroAuthenticationExceptionMapper.java     |    59 -
 .../shiro/filters/BasicAuthSecurityFilter.java  |   111 -
 .../ClientCredentialsSecurityFilter.java        |    69 -
 .../OAuth2AccessTokenSecurityFilter.java        |   211 -
 .../security/shiro/filters/SecurityFilter.java  |   136 -
 .../session/HttpRequestSessionManager.java      |    87 -
 .../session/HttpServletRequestSession.java      |   132 -
 .../usergrid/rest/test/PropertiesResource.java  |    87 -
 .../java/org/usergrid/rest/utils/CORSUtils.java |   173 -
 .../org/usergrid/rest/utils/JSONPUtils.java     |   103 -
 .../org/usergrid/rest/utils/PathingUtils.java   |    35 -
 .../main/resources/swagger/applications.json    |    16 +
 .../src/main/resources/swagger/management.json  |    16 +
 .../src/main/resources/swagger/resources.json   |    16 +
 .../main/resources/usergrid-rest-context.xml    |    28 +-
 .../resources/usergrid-rest-deploy-context.xml  |    16 +
 stack/rest/src/main/webapp/WEB-INF/c.tld        |    17 +-
 .../apache/usergrid/rest/TestResource/error.jsp |    33 +
 .../apache/usergrid/rest/TestResource/test.jsp  |    29 +
 .../ApplicationResource/authorize_form.jsp      |    59 +
 .../applications/ApplicationResource/error.jsp  |    33 +
 .../users/UserResource/activate.jsp             |    32 +
 .../applications/users/UserResource/confirm.jsp |    33 +
 .../applications/users/UserResource/error.jsp   |    33 +
 .../users/UserResource/resetpw_email_form.jsp   |    47 +
 .../UserResource/resetpw_email_success.jsp      |    35 +
 .../users/UserResource/resetpw_set_form.jsp     |    57 +
 .../users/UserResource/resetpw_set_success.jsp  |    35 +
 .../applications/users/UsersResource/error.jsp  |    33 +
 .../users/UsersResource/resetpw_email_form.jsp  |    53 +
 .../UsersResource/resetpw_email_success.jsp     |    35 +
 .../ManagementResource/authorize_form.jsp       |    59 +
 .../management/ManagementResource/error.jsp     |    33 +
 .../OrganizationResource/activate.jsp           |    32 +
 .../OrganizationResource/confirm.jsp            |    33 +
 .../OrganizationResource/error.jsp              |    33 +
 .../management/users/UserResource/activate.jsp  |    32 +
 .../management/users/UserResource/confirm.jsp   |    33 +
 .../management/users/UserResource/error.jsp     |    33 +
 .../users/UserResource/resetpw_email_form.jsp   |    47 +
 .../UserResource/resetpw_email_success.jsp      |    35 +
 .../users/UserResource/resetpw_set_form.jsp     |    57 +
 .../users/UserResource/resetpw_set_success.jsp  |    35 +
 .../management/users/UsersResource/error.jsp    |    33 +
 .../users/UsersResource/resetpw_email_form.jsp  |    50 +
 .../UsersResource/resetpw_email_success.jsp     |    35 +
 .../org/usergrid/rest/TestResource/error.jsp    |    17 -
 .../jsp/org/usergrid/rest/TestResource/test.jsp |    13 -
 .../ApplicationResource/authorize_form.jsp      |    43 -
 .../applications/ApplicationResource/error.jsp  |    17 -
 .../users/UserResource/activate.jsp             |    16 -
 .../applications/users/UserResource/confirm.jsp |    17 -
 .../applications/users/UserResource/error.jsp   |    17 -
 .../users/UserResource/resetpw_email_form.jsp   |    31 -
 .../UserResource/resetpw_email_success.jsp      |    19 -
 .../users/UserResource/resetpw_set_form.jsp     |    41 -
 .../users/UserResource/resetpw_set_success.jsp  |    19 -
 .../applications/users/UsersResource/error.jsp  |    17 -
 .../users/UsersResource/resetpw_email_form.jsp  |    37 -
 .../UsersResource/resetpw_email_success.jsp     |    19 -
 .../ManagementResource/authorize_form.jsp       |    43 -
 .../management/ManagementResource/error.jsp     |    17 -
 .../OrganizationResource/activate.jsp           |    16 -
 .../OrganizationResource/confirm.jsp            |    17 -
 .../OrganizationResource/error.jsp              |    17 -
 .../management/users/UserResource/activate.jsp  |    16 -
 .../management/users/UserResource/confirm.jsp   |    17 -
 .../management/users/UserResource/error.jsp     |    17 -
 .../users/UserResource/resetpw_email_form.jsp   |    31 -
 .../UserResource/resetpw_email_success.jsp      |    19 -
 .../users/UserResource/resetpw_set_form.jsp     |    41 -
 .../users/UserResource/resetpw_set_success.jsp  |    19 -
 .../management/users/UsersResource/error.jsp    |    17 -
 .../users/UsersResource/resetpw_email_form.jsp  |    34 -
 .../UsersResource/resetpw_email_success.jsp     |    19 -
 stack/rest/src/main/webapp/WEB-INF/web.xml      |   185 +-
 stack/rest/src/main/webapp/css/styles.css       |    17 +-
 .../apache/usergrid/rest/AbstractRestIT.java    |   356 +
 .../java/org/apache/usergrid/rest/BasicIT.java  |   311 +
 .../usergrid/rest/ConcurrentRestITSuite.java    |    63 +
 .../usergrid/rest/DatabaseInitializer.java      |   146 +
 .../java/org/apache/usergrid/rest/ITSetup.java  |   172 +
 .../org/apache/usergrid/rest/RestITSuite.java   |    57 +
 .../apache/usergrid/rest/TestContextSetup.java  |    74 +
 .../apache/usergrid/rest/TomcatResource.java    |    85 +
 .../ApplicationRequestCounterIT.java            |    95 +
 .../applications/ApplicationResourceIT.java     |   533 +
 .../rest/applications/DevicesResourceIT.java    |    78 +
 .../applications/assets/AssetResourceIT.java    |   276 +
 .../collection/BadGrammarQueryTest.java         |    76 +
 .../collection/BrowserCompatibilityTest.java    |    87 +
 .../collection/PagingResourceIT.java            |   219 +
 .../collection/activities/AndOrQueryTest.java   |   192 +
 .../collection/activities/OrderByTest.java      |   165 +
 .../activities/PagingEntitiesTest.java          |   135 +
 .../collection/activities/PutTest.java          |    80 +
 .../collection/groups/GeoPagingTest.java        |   126 +
 .../collection/groups/UpdateGroupIT.java        |   110 +
 .../applications/events/EventsResourceIT.java   |   125 +
 .../queues/AbstractQueueResourceIT.java         |   484 +
 .../queues/QueueResourceLong1IT.java            |   146 +
 .../queues/QueueResourceLong2IT.java            |    98 +
 .../queues/QueueResourceLong3IT.java            |   200 +
 .../queues/QueueResourceShortIT.java            |   431 +
 .../applications/users/ActivityResourceIT.java  |   181 +
 .../users/CollectionsResourceIT.java            |   200 +
 .../users/ConnectionResourceTest.java           |   252 +
 .../applications/users/GroupResourceIT.java     |   271 +
 .../applications/users/OwnershipResourceIT.java |   345 +
 .../users/PermissionsResourceIT.java            |   700 +
 .../applications/users/RetrieveUsersTest.java   |    82 +
 .../rest/applications/users/UserResourceIT.java |  1287 +
 .../users/extensions/TestResource.java          |    51 +
 .../rest/applications/utils/TestUtils.java      |    47 +
 .../rest/applications/utils/UserRepo.java       |    81 +
 .../rest/filters/ContentTypeResourceIT.java     |   311 +
 .../rest/management/ManagementResourceIT.java   |   620 +
 .../rest/management/RegistrationIT.java         |   354 +
 .../organizations/AdminEmailEncodingIT.java     |   117 +
 .../organizations/OrganizationResourceIT.java   |    87 +
 .../organizations/OrganizationsResourceIT.java  |   273 +
 .../applications/ApplicationsIT.java            |    84 +
 .../rest/management/users/MUUserResourceIT.java |   605 +
 .../UsersOrganizationsResourceIT.java           |    72 +
 .../rest/test/PropertiesResourceIT.java         |    75 +
 .../rest/test/resource/CollectionResource.java  |    27 +
 .../usergrid/rest/test/resource/Connection.java |    52 +
 .../rest/test/resource/CustomCollection.java    |    32 +
 .../rest/test/resource/EntityResource.java      |   105 +
 .../apache/usergrid/rest/test/resource/Me.java  |    36 +
 .../rest/test/resource/NamedResource.java       |   186 +
 .../rest/test/resource/ResultsParser.java       |    23 +
 .../rest/test/resource/RootResource.java        |    65 +
 .../rest/test/resource/SetResource.java         |    83 +
 .../rest/test/resource/TestContext.java         |   172 +
 .../rest/test/resource/ValueResource.java       |   308 +
 .../rest/test/resource/app/Application.java     |    73 +
 .../usergrid/rest/test/resource/app/Device.java |    49 +
 .../usergrid/rest/test/resource/app/User.java   |    55 +
 .../rest/test/resource/app/UsersCollection.java |    63 +
 .../resource/app/queue/DevicesCollection.java   |    37 +
 .../rest/test/resource/app/queue/Queue.java     |   184 +
 .../resource/app/queue/QueuesCollection.java    |    36 +
 .../app/queue/SubscribersCollection.java        |    60 +
 .../test/resource/app/queue/Transaction.java    |    77 +
 .../app/queue/TransactionsCollection.java       |    36 +
 .../rest/test/resource/mgmt/Application.java    |    49 +
 .../resource/mgmt/ApplicationsCollection.java   |    52 +
 .../rest/test/resource/mgmt/Management.java     |    94 +
 .../rest/test/resource/mgmt/Organization.java   |    60 +
 .../resource/mgmt/OrganizationsCollection.java  |    55 +
 .../rest/test/security/TestAdminUser.java       |    54 +
 .../rest/test/security/TestAppUser.java         |    54 +
 .../usergrid/rest/test/security/TestUser.java   |   127 +
 .../java/org/usergrid/rest/AbstractRestIT.java  |   355 -
 .../test/java/org/usergrid/rest/BasicIT.java    |   310 -
 .../usergrid/rest/ConcurrentRestITSuite.java    |    47 -
 .../org/usergrid/rest/DatabaseInitializer.java  |   145 -
 .../test/java/org/usergrid/rest/ITSetup.java    |   166 -
 .../java/org/usergrid/rest/RestITSuite.java     |    55 -
 .../org/usergrid/rest/TestContextSetup.java     |    58 -
 .../java/org/usergrid/rest/TomcatResource.java  |    74 -
 .../ApplicationRequestCounterIT.java            |    93 -
 .../applications/ApplicationResourceIT.java     |   531 -
 .../rest/applications/DevicesResourceIT.java    |    62 -
 .../applications/assets/AssetResourceIT.java    |   260 -
 .../collection/BadGrammarQueryTest.java         |    60 -
 .../collection/BrowserCompatibilityTest.java    |    86 -
 .../collection/PagingResourceIT.java            |   218 -
 .../collection/activities/AndOrQueryTest.java   |   176 -
 .../collection/activities/OrderByTest.java      |   149 -
 .../activities/PagingEntitiesTest.java          |   119 -
 .../collection/activities/PutTest.java          |    64 -
 .../collection/groups/GeoPagingTest.java        |   124 -
 .../collection/groups/UpdateGroupIT.java        |   108 -
 .../applications/events/EventsResourceIT.java   |   109 -
 .../queues/AbstractQueueResourceIT.java         |   464 -
 .../queues/QueueResourceLong1IT.java            |   130 -
 .../queues/QueueResourceLong2IT.java            |    82 -
 .../queues/QueueResourceLong3IT.java            |   184 -
 .../queues/QueueResourceShortIT.java            |   415 -
 .../applications/users/ActivityResourceIT.java  |   180 -
 .../users/CollectionsResourceIT.java            |   199 -
 .../users/ConnectionResourceTest.java           |   193 -
 .../applications/users/GroupResourceIT.java     |   270 -
 .../applications/users/OwnershipResourceIT.java |   344 -
 .../users/PermissionsResourceIT.java            |   699 -
 .../applications/users/RetrieveUsersTest.java   |    66 -
 .../rest/applications/users/UserResourceIT.java |  1286 -
 .../users/extensions/TestResource.java          |    50 -
 .../rest/applications/utils/TestUtils.java      |    46 -
 .../rest/applications/utils/UserRepo.java       |    65 -
 .../rest/filters/ContentTypeResourceIT.java     |   310 -
 .../rest/management/ManagementResourceIT.java   |   524 -
 .../rest/management/RegistrationIT.java         |   351 -
 .../organizations/AdminEmailEncodingIT.java     |   101 -
 .../organizations/OrganizationResourceIT.java   |    70 -
 .../organizations/OrganizationsResourceIT.java  |   256 -
 .../rest/management/users/MUUserResourceIT.java |   602 -
 .../UsersOrganizationsResourceIT.java           |    56 -
 .../rest/test/PropertiesResourceIT.java         |    75 -
 .../rest/test/resource/CollectionResource.java  |    26 -
 .../usergrid/rest/test/resource/Connection.java |    51 -
 .../rest/test/resource/CustomCollection.java    |    31 -
 .../rest/test/resource/EntityResource.java      |   104 -
 .../org/usergrid/rest/test/resource/Me.java     |    35 -
 .../rest/test/resource/NamedResource.java       |   185 -
 .../rest/test/resource/ResultsParser.java       |    22 -
 .../rest/test/resource/RootResource.java        |    64 -
 .../rest/test/resource/SetResource.java         |    82 -
 .../rest/test/resource/TestContext.java         |   170 -
 .../rest/test/resource/ValueResource.java       |   307 -
 .../rest/test/resource/app/Application.java     |    72 -
 .../usergrid/rest/test/resource/app/Device.java |    48 -
 .../usergrid/rest/test/resource/app/User.java   |    54 -
 .../rest/test/resource/app/UsersCollection.java |    62 -
 .../resource/app/queue/DevicesCollection.java   |    36 -
 .../rest/test/resource/app/queue/Queue.java     |   183 -
 .../resource/app/queue/QueuesCollection.java    |    35 -
 .../app/queue/SubscribersCollection.java        |    59 -
 .../test/resource/app/queue/Transaction.java    |    76 -
 .../app/queue/TransactionsCollection.java       |    35 -
 .../rest/test/resource/mgmt/Application.java    |    48 -
 .../resource/mgmt/ApplicationsCollection.java   |    51 -
 .../rest/test/resource/mgmt/Management.java     |    93 -
 .../rest/test/resource/mgmt/Organization.java   |    59 -
 .../resource/mgmt/OrganizationsCollection.java  |    54 -
 .../rest/test/security/TestAdminUser.java       |    53 -
 .../rest/test/security/TestAppUser.java         |    53 -
 .../usergrid/rest/test/security/TestUser.java   |   126 -
 stack/rest/src/test/resources/log4j.properties  |    14 +-
 .../test/resources/usergrid-test-context.xml    |    12 +-
 stack/services/groupstest.out                   | 64570 -----------------
 stack/services/pom.xml                          |    44 +-
 .../management/AccountCreationProps.java        |   129 +
 .../usergrid/management/ActivationState.java    |    24 +
 .../usergrid/management/ApplicationCreator.java |    30 +
 .../usergrid/management/ApplicationInfo.java    |   135 +
 .../usergrid/management/ManagementService.java  |   320 +
 .../usergrid/management/OrganizationInfo.java   |   186 +
 .../management/OrganizationOwnerInfo.java       |    54 +
 .../management/OrganizationProfile.java         |    88 +
 .../apache/usergrid/management/UserInfo.java    |   150 +
 .../cassandra/AccountCreationPropsImpl.java     |   158 +
 .../cassandra/ApplicationCreatorImpl.java       |    93 +
 .../cassandra/ManagementServiceImpl.java        |  2895 +
 .../ApplicationCreationException.java           |    42 +
 .../exceptions/DisabledAdminUserException.java  |    43 +
 .../exceptions/DisabledAppUserException.java    |    43 +
 .../exceptions/IncorrectPasswordException.java  |    43 +
 .../exceptions/ManagementException.java         |    43 +
 .../RecentlyUsedPasswordException.java          |    43 +
 .../UnableToLeaveOrganizationException.java     |    43 +
 .../UnactivatedAdminUserException.java          |    43 +
 .../exceptions/UnactivatedAppUserException.java |    43 +
 .../UnactivatedOrganizationException.java       |    43 +
 .../UnconfirmedAdminUserException.java          |    43 +
 .../usergrid/management/utils/AccountUtils.java |    42 +
 .../usergrid/security/AuthPrincipalInfo.java    |    72 +
 .../usergrid/security/AuthPrincipalType.java    |   116 +
 .../security/crypto/EncryptionService.java      |    71 +
 .../security/crypto/EncryptionServiceImpl.java  |   209 +
 .../security/crypto/command/BcryptCommand.java  |    93 +
 .../crypto/command/EncryptionCommand.java       |    50 +
 .../security/crypto/command/Md5HashCommand.java |    62 +
 .../crypto/command/PlainTextCommand.java        |    65 +
 .../crypto/command/SaltedHasherCommand.java     |    68 +
 .../crypto/command/Sha1HashCommand.java         |    74 +
 .../usergrid/security/oauth/AccessInfo.java     |   188 +
 .../security/oauth/ClientCredentialsInfo.java   |    94 +
 .../usergrid/security/oauth/OAuthProxy.java     |    44 +
 .../security/oauth/OAuthProxyFactory.java       |    32 +
 .../security/providers/AbstractProvider.java    |    77 +
 .../security/providers/FacebookProvider.java    |   199 +
 .../security/providers/FoursquareProvider.java  |   175 +
 .../providers/PingIdentityProvider.java         |   159 +
 .../security/providers/SignInAsProvider.java    |    35 +
 .../providers/SignInProviderFactory.java        |    67 +
 .../security/salt/NoOpSaltProvider.java         |    37 +
 .../security/salt/PropertiesSaltProvider.java   |    54 +
 .../usergrid/security/salt/SaltProvider.java    |    32 +
 .../security/shiro/CustomPermission.java        |   226 +
 .../shiro/CustomPermissionResolver.java         |    30 +
 .../shiro/PrincipalCredentialsToken.java        |   140 +
 .../apache/usergrid/security/shiro/Realm.java   |   541 +
 .../AbstractAccessTokenCredentials.java         |    34 +
 .../credentials/AbstractClientCredentials.java  |    29 +
 .../AbstractPasswordCredentials.java            |    34 +
 .../credentials/AccessTokenCredentials.java     |    23 +
 .../shiro/credentials/AdminUserAccessToken.java |    25 +
 .../shiro/credentials/AdminUserCredentials.java |    22 +
 .../shiro/credentials/AdminUserPassword.java    |    25 +
 .../credentials/ApplicationAccessToken.java     |    25 +
 .../ApplicationClientCredentials.java           |    25 +
 .../credentials/ApplicationCredentials.java     |    22 +
 .../shiro/credentials/ApplicationGuest.java     |    25 +
 .../credentials/ApplicationUserAccessToken.java |    25 +
 .../credentials/ApplicationUserCredentials.java |    22 +
 .../credentials/ApplicationUserPassword.java    |    25 +
 .../shiro/credentials/ClientCredentials.java    |    25 +
 .../credentials/OrganizationAccessToken.java    |    25 +
 .../OrganizationClientCredentials.java          |    25 +
 .../credentials/OrganizationCredentials.java    |    22 +
 .../shiro/credentials/PasswordCredentials.java  |    23 +
 .../shiro/credentials/PrincipalCredentials.java |    22 +
 .../shiro/principals/AdminUserPrincipal.java    |    30 +
 .../principals/ApplicationGuestPrincipal.java   |    49 +
 .../shiro/principals/ApplicationPrincipal.java  |    49 +
 .../principals/ApplicationUserPrincipal.java    |    36 +
 .../shiro/principals/OrganizationPrincipal.java |    49 +
 .../shiro/principals/PrincipalIdentifier.java   |    52 +
 .../shiro/principals/UserPrincipal.java         |    70 +
 .../security/shiro/utils/SubjectUtils.java      |   450 +
 .../usergrid/security/tokens/TokenCategory.java |    84 +
 .../usergrid/security/tokens/TokenInfo.java     |   141 +
 .../usergrid/security/tokens/TokenService.java  |    55 +
 .../tokens/cassandra/TokenServiceImpl.java      |   643 +
 .../tokens/exceptions/BadTokenException.java    |    33 +
 .../exceptions/ExpiredTokenException.java       |    33 +
 .../exceptions/InvalidTokenException.java       |    33 +
 .../tokens/exceptions/TokenException.java       |    36 +
 .../services/AbstractCollectionService.java     |   575 +
 .../services/AbstractConnectionsService.java    |   521 +
 .../AbstractPathBasedColllectionService.java    |   149 +
 .../usergrid/services/AbstractService.java      |  1307 +
 .../org/apache/usergrid/services/Service.java   |    50 +
 .../apache/usergrid/services/ServiceAction.java |    22 +
 .../ServiceCollectionEventListener.java         |    23 +
 .../usergrid/services/ServiceContext.java       |   449 +
 .../services/ServiceExecutionEvent.java         |    80 +
 .../services/ServiceExecutionEventListener.java |    23 +
 .../apache/usergrid/services/ServiceInfo.java   |   439 +
 .../usergrid/services/ServiceManager.java       |   432 +
 .../services/ServiceManagerFactory.java         |   132 +
 .../usergrid/services/ServiceParameter.java     |   453 +
 .../usergrid/services/ServicePayload.java       |   200 +
 .../usergrid/services/ServiceRequest.java       |   373 +
 .../usergrid/services/ServiceResults.java       |   305 +
 .../apache/usergrid/services/ServiceUtils.java  |    22 +
 .../services/activities/ActivitiesService.java  |    34 +
 .../applications/ApplicationsService.java       |   216 +
 .../usergrid/services/assets/AssetsService.java |    58 +
 .../services/assets/data/AssetMimeHandler.java  |   106 +
 .../services/assets/data/AssetUtils.java        |   123 +
 .../services/assets/data/BinaryStore.java       |    43 +
 .../assets/data/LocalFileBinaryStore.java       |   101 +
 .../services/assets/data/S3BinaryStore.java     |   218 +
 .../services/devices/DevicesService.java        |    52 +
 .../services/devices/users/UsersService.java    |    33 +
 .../ForbiddenServiceOperationException.java     |    42 +
 .../services/exceptions/ServiceException.java   |    46 +
 .../exceptions/ServiceInvocationException.java  |    84 +
 .../ServiceResourceNotFoundException.java       |    40 +
 .../UndefinedServiceEntityTypeException.java    |    46 +
 .../UnsupportedServiceOperationException.java   |    40 +
 .../generic/GenericCollectionService.java       |    28 +
 .../generic/GenericConnectionsService.java      |    28 +
 .../services/generic/RootCollectionService.java |    28 +
 .../usergrid/services/groups/GroupsService.java |   225 +
 .../groups/activities/ActivitiesService.java    |    75 +
 .../services/groups/roles/RolesService.java     |    33 +
 .../services/groups/users/UsersService.java     |    33 +
 .../users/activities/ActivitiesService.java     |    85 +
 .../groups/users/devices/DevicesService.java    |    33 +
 .../services/messages/MessagesService.java      |    34 +
 .../usergrid/services/roles/RolesService.java   |   237 +
 .../services/roles/groups/GroupsService.java    |    33 +
 .../services/roles/users/UsersService.java      |    85 +
 .../usergrid/services/users/UsersService.java   |   288 +
 .../users/activities/ActivitiesService.java     |   157 +
 .../services/users/devices/DevicesService.java  |    33 +
 .../users/following/FollowingService.java       |    63 +
 .../services/users/groups/GroupsService.java    |    33 +
 .../services/users/roles/RolesService.java      |    85 +
 .../org/apache/usergrid/utils/PythonUtils.java  |   103 +
 .../management/AccountCreationProps.java        |   119 -
 .../usergrid/management/ActivationState.java    |     8 -
 .../usergrid/management/ApplicationCreator.java |    14 -
 .../usergrid/management/ApplicationInfo.java    |   134 -
 .../usergrid/management/ManagementService.java  |   319 -
 .../usergrid/management/OrganizationInfo.java   |   185 -
 .../management/OrganizationOwnerInfo.java       |    53 -
 .../management/OrganizationProfile.java         |    87 -
 .../java/org/usergrid/management/UserInfo.java  |   149 -
 .../cassandra/AccountCreationPropsImpl.java     |   112 -
 .../cassandra/ApplicationCreatorImpl.java       |    77 -
 .../cassandra/ManagementServiceImpl.java        |  2909 -
 .../ApplicationCreationException.java           |    26 -
 .../exceptions/DisabledAdminUserException.java  |    42 -
 .../exceptions/DisabledAppUserException.java    |    42 -
 .../exceptions/IncorrectPasswordException.java  |    42 -
 .../exceptions/ManagementException.java         |    42 -
 .../RecentlyUsedPasswordException.java          |    27 -
 .../UnableToLeaveOrganizationException.java     |    42 -
 .../UnactivatedAdminUserException.java          |    42 -
 .../exceptions/UnactivatedAppUserException.java |    42 -
 .../UnactivatedOrganizationException.java       |    42 -
 .../UnconfirmedAdminUserException.java          |    42 -
 .../usergrid/management/utils/AccountUtils.java |    42 -
 .../usergrid/security/AuthPrincipalInfo.java    |    71 -
 .../usergrid/security/AuthPrincipalType.java    |   115 -
 .../security/crypto/EncryptionService.java      |    70 -
 .../security/crypto/EncryptionServiceImpl.java  |   208 -
 .../security/crypto/command/BcryptCommand.java  |    92 -
 .../crypto/command/EncryptionCommand.java       |    49 -
 .../security/crypto/command/Md5HashCommand.java |    61 -
 .../crypto/command/PlainTextCommand.java        |    64 -
 .../crypto/command/SaltedHasherCommand.java     |    67 -
 .../crypto/command/Sha1HashCommand.java         |    73 -
 .../org/usergrid/security/oauth/AccessInfo.java |   187 -
 .../security/oauth/ClientCredentialsInfo.java   |    93 -
 .../org/usergrid/security/oauth/OAuthProxy.java |    43 -
 .../security/oauth/OAuthProxyFactory.java       |    31 -
 .../security/providers/AbstractProvider.java    |    61 -
 .../security/providers/FacebookProvider.java    |   183 -
 .../security/providers/FoursquareProvider.java  |   159 -
 .../providers/PingIdentityProvider.java         |   143 -
 .../security/providers/SignInAsProvider.java    |    19 -
 .../providers/SignInProviderFactory.java        |    51 -
 .../security/salt/NoOpSaltProvider.java         |    36 -
 .../security/salt/PropertiesSaltProvider.java   |    53 -
 .../usergrid/security/salt/SaltProvider.java    |    31 -
 .../security/shiro/CustomPermission.java        |   225 -
 .../shiro/CustomPermissionResolver.java         |    29 -
 .../shiro/PrincipalCredentialsToken.java        |   139 -
 .../java/org/usergrid/security/shiro/Realm.java |   540 -
 .../AbstractAccessTokenCredentials.java         |    33 -
 .../credentials/AbstractClientCredentials.java  |    28 -
 .../AbstractPasswordCredentials.java            |    33 -
 .../credentials/AccessTokenCredentials.java     |    22 -
 .../shiro/credentials/AdminUserAccessToken.java |    24 -
 .../shiro/credentials/AdminUserCredentials.java |    21 -
 .../shiro/credentials/AdminUserPassword.java    |    24 -
 .../credentials/ApplicationAccessToken.java     |    24 -
 .../ApplicationClientCredentials.java           |    24 -
 .../credentials/ApplicationCredentials.java     |    21 -
 .../shiro/credentials/ApplicationGuest.java     |    24 -
 .../credentials/ApplicationUserAccessToken.java |    24 -
 .../credentials/ApplicationUserCredentials.java |    21 -
 .../credentials/ApplicationUserPassword.java    |    24 -
 .../shiro/credentials/ClientCredentials.java    |    24 -
 .../credentials/OrganizationAccessToken.java    |    24 -
 .../OrganizationClientCredentials.java          |    24 -
 .../credentials/OrganizationCredentials.java    |    21 -
 .../shiro/credentials/PasswordCredentials.java  |    22 -
 .../shiro/credentials/PrincipalCredentials.java |    21 -
 .../shiro/principals/AdminUserPrincipal.java    |    29 -
 .../principals/ApplicationGuestPrincipal.java   |    48 -
 .../shiro/principals/ApplicationPrincipal.java  |    48 -
 .../principals/ApplicationUserPrincipal.java    |    35 -
 .../shiro/principals/OrganizationPrincipal.java |    48 -
 .../shiro/principals/PrincipalIdentifier.java   |    51 -
 .../shiro/principals/UserPrincipal.java         |    69 -
 .../security/shiro/utils/SubjectUtils.java      |   449 -
 .../usergrid/security/tokens/TokenCategory.java |    83 -
 .../org/usergrid/security/tokens/TokenInfo.java |   125 -
 .../usergrid/security/tokens/TokenService.java  |    39 -
 .../tokens/cassandra/TokenServiceImpl.java      |   627 -
 .../tokens/exceptions/BadTokenException.java    |    32 -
 .../exceptions/ExpiredTokenException.java       |    32 -
 .../exceptions/InvalidTokenException.java       |    32 -
 .../tokens/exceptions/TokenException.java       |    35 -
 .../services/AbstractCollectionService.java     |   574 -
 .../services/AbstractConnectionsService.java    |   514 -
 .../AbstractPathBasedColllectionService.java    |   149 -
 .../org/usergrid/services/AbstractService.java  |  1306 -
 .../java/org/usergrid/services/Service.java     |    49 -
 .../org/usergrid/services/ServiceAction.java    |    21 -
 .../ServiceCollectionEventListener.java         |    22 -
 .../org/usergrid/services/ServiceContext.java   |   449 -
 .../services/ServiceExecutionEvent.java         |    79 -
 .../services/ServiceExecutionEventListener.java |    22 -
 .../java/org/usergrid/services/ServiceInfo.java |   438 -
 .../org/usergrid/services/ServiceManager.java   |   431 -
 .../services/ServiceManagerFactory.java         |   131 -
 .../org/usergrid/services/ServiceParameter.java |   452 -
 .../org/usergrid/services/ServicePayload.java   |   199 -
 .../org/usergrid/services/ServiceRequest.java   |   372 -
 .../org/usergrid/services/ServiceResults.java   |   304 -
 .../org/usergrid/services/ServiceUtils.java     |    21 -
 .../services/activities/ActivitiesService.java  |    33 -
 .../applications/ApplicationsService.java       |   215 -
 .../usergrid/services/assets/AssetsService.java |    57 -
 .../services/assets/data/AssetMimeHandler.java  |    90 -
 .../services/assets/data/AssetUtils.java        |   107 -
 .../services/assets/data/BinaryStore.java       |    27 -
 .../assets/data/LocalFileBinaryStore.java       |    85 -
 .../services/assets/data/S3BinaryStore.java     |   202 -
 .../services/devices/DevicesService.java        |    51 -
 .../services/devices/users/UsersService.java    |    32 -
 .../ForbiddenServiceOperationException.java     |    41 -
 .../services/exceptions/ServiceException.java   |    45 -
 .../exceptions/ServiceInvocationException.java  |    83 -
 .../ServiceResourceNotFoundException.java       |    39 -
 .../UndefinedServiceEntityTypeException.java    |    45 -
 .../UnsupportedServiceOperationException.java   |    39 -
 .../generic/GenericCollectionService.java       |    27 -
 .../generic/GenericConnectionsService.java      |    27 -
 .../services/generic/RootCollectionService.java |    27 -
 .../usergrid/services/groups/GroupsService.java |   224 -
 .../groups/activities/ActivitiesService.java    |    74 -
 .../services/groups/roles/RolesService.java     |    32 -
 .../services/groups/users/UsersService.java     |    32 -
 .../users/activities/ActivitiesService.java     |    84 -
 .../groups/users/devices/DevicesService.java    |    32 -
 .../services/messages/MessagesService.java      |    33 -
 .../usergrid/services/roles/RolesService.java   |   236 -
 .../services/roles/groups/GroupsService.java    |    32 -
 .../services/roles/users/UsersService.java      |    84 -
 .../usergrid/services/users/UsersService.java   |   287 -
 .../users/activities/ActivitiesService.java     |   142 -
 .../services/users/devices/DevicesService.java  |    32 -
 .../users/following/FollowingService.java       |    47 -
 .../services/users/groups/GroupsService.java    |    32 -
 .../services/users/roles/RolesService.java      |    84 -
 .../java/org/usergrid/utils/PythonUtils.java    |   102 -
 .../src/main/python/pyusergrid/__init__.py      |    15 +
 .../main/python/pyusergrid/services/__init__.py |    15 +
 .../pyusergrid/services/pytest/PytestService.py |    20 +-
 .../pyusergrid/services/pytest/__init__.py      |    15 +
 .../python/pyusergrid/services/pytest/test.py   |    18 +-
 stack/services/src/main/python/test/__init__.py |    15 +
 stack/services/src/main/python/test/test.py     |    18 +-
 .../resources/usergrid-services-context.xml     |    34 +-
 .../test/java/baas/io/simple/SimpleService.java |    18 -
 .../usergrid/ConcurrentServiceITSuite.java      |    59 +
 .../org/apache/usergrid/ServiceApplication.java |   204 +
 .../org/apache/usergrid/ServiceITSetup.java     |    60 +
 .../org/apache/usergrid/ServiceITSetupImpl.java |   145 +
 .../org/apache/usergrid/ServiceITSuite.java     |    57 +
 .../apache/usergrid/management/EmailFlowIT.java |   420 +
 .../management/ManagementTestHelper.java        |    41 +
 .../usergrid/management/MockImapClient.java     |    99 +
 .../usergrid/management/OrganizationIT.java     |   230 +
 .../org/apache/usergrid/management/RoleIT.java  |    98 +
 .../cassandra/ApplicationCreatorIT.java         |    82 +
 .../cassandra/ManagementServiceIT.java          |   745 +
 .../cassandra/ManagementTestHelperImpl.java     |    86 +
 .../org/apache/usergrid/python/JythonTest.java  |    39 +
 .../usergrid/security/CustomResolverTest.java   |   170 +
 .../crypto/EncryptionServiceImplTest.java       |   171 +
 .../crypto/command/BcryptCommandTest.java       |   166 +
 .../crypto/command/Md5HashCommandTest.java      |    72 +
 .../crypto/command/Sha1HashCommandTest.java     |    68 +
 .../security/providers/FacebookProviderIT.java  |    97 +
 .../providers/PingIdentityProviderIT.java       |    79 +
 .../security/tokens/TokenServiceIT.java         |   456 +
 .../usergrid/services/AbstractServiceIT.java    |    39 +
 .../usergrid/services/ActivitiesServiceIT.java  |   112 +
 .../services/ApplicationsServiceIT.java         |    36 +
 .../usergrid/services/CollectionServiceIT.java  |   291 +
 .../usergrid/services/ConnectionsServiceIT.java |    83 +
 .../usergrid/services/GroupServiceIT.java       |    81 +
 .../usergrid/services/RolesServiceIT.java       |   280 +
 .../usergrid/services/ServiceFactoryIT.java     |    58 +
 .../usergrid/services/ServiceInfoTest.java      |   109 +
 .../usergrid/services/ServiceInvocationIT.java  |   146 +
 .../usergrid/services/ServiceRequestIT.java     |    79 +
 .../usergrid/services/UsersServiceIT.java       |    53 +
 .../services/assets/data/AssetUtilsTest.java    |    60 +
 .../usergrid/services/simple/SimpleService.java |    33 +
 .../org/usergrid/ConcurrentServiceITSuite.java  |    43 -
 .../java/org/usergrid/ServiceApplication.java   |   188 -
 .../test/java/org/usergrid/ServiceITSetup.java  |    44 -
 .../java/org/usergrid/ServiceITSetupImpl.java   |   129 -
 .../test/java/org/usergrid/ServiceITSuite.java  |    41 -
 .../org/usergrid/management/EmailFlowIT.java    |   419 -
 .../management/ManagementTestHelper.java        |    40 -
 .../org/usergrid/management/MockImapClient.java |    83 -
 .../org/usergrid/management/OrganizationIT.java |   229 -
 .../java/org/usergrid/management/RoleIT.java    |    97 -
 .../cassandra/ApplicationCreatorIT.java         |    66 -
 .../cassandra/ManagementServiceIT.java          |   729 -
 .../cassandra/ManagementTestHelperImpl.java     |    85 -
 .../java/org/usergrid/python/JythonTest.java    |    38 -
 .../usergrid/security/CustomResolverTest.java   |   169 -
 .../crypto/EncryptionServiceImplTest.java       |   170 -
 .../crypto/command/BcryptCommandTest.java       |   165 -
 .../crypto/command/Md5HashCommandTest.java      |    71 -
 .../crypto/command/Sha1HashCommandTest.java     |    67 -
 .../security/providers/FacebookProviderIT.java  |    81 -
 .../providers/PingIdentityProviderIT.java       |    63 -
 .../security/tokens/TokenServiceIT.java         |   440 -
 .../usergrid/services/AbstractServiceIT.java    |    38 -
 .../usergrid/services/ActivitiesServiceIT.java  |   111 -
 .../services/ApplicationsServiceIT.java         |    35 -
 .../usergrid/services/CollectionServiceIT.java  |   290 -
 .../usergrid/services/ConnectionsServiceIT.java |    82 -
 .../org/usergrid/services/GroupServiceIT.java   |    80 -
 .../org/usergrid/services/RolesServiceIT.java   |   279 -
 .../org/usergrid/services/ServiceFactoryIT.java |    57 -
 .../org/usergrid/services/ServiceInfoTest.java  |   108 -
 .../usergrid/services/ServiceInvocationIT.java  |   145 -
 .../org/usergrid/services/ServiceRequestIT.java |    78 -
 .../org/usergrid/services/UsersServiceIT.java   |    52 -
 .../services/assets/data/AssetUtilsTest.java    |    44 -
 .../src/test/resources/log4j.properties         |    14 +-
 .../src/test/resources/project.properties       |    16 +
 .../test/resources/usergrid-test-context.xml    |    24 +-
 stack/test-utils/pom.xml                        |    26 +-
 .../apache/usergrid/NoExitSecurityManager.java  |    80 +
 .../usergrid/cassandra/AvailablePortFinder.java |   208 +
 .../usergrid/cassandra/CassandraResource.java   |   521 +
 .../usergrid/cassandra/ClearShiroSubject.java   |    47 +
 .../apache/usergrid/cassandra/Concurrent.java   |    31 +
 .../cassandra/ConcurrentJunitRunner.java        |    91 +
 .../usergrid/cassandra/ConcurrentSuite.java     |   117 +
 .../apache/usergrid/cassandra/DataControl.java  |    33 +
 .../apache/usergrid/cassandra/DataLoader.java   |    25 +
 .../usergrid/cassandra/SchemaManager.java       |    34 +
 .../org/usergrid/NoExitSecurityManager.java     |    64 -
 .../usergrid/cassandra/AvailablePortFinder.java |   187 -
 .../usergrid/cassandra/CassandraResource.java   |   487 -
 .../usergrid/cassandra/ClearShiroSubject.java   |    31 -
 .../java/org/usergrid/cassandra/Concurrent.java |    15 -
 .../cassandra/ConcurrentJunitRunner.java        |    75 -
 .../org/usergrid/cassandra/ConcurrentSuite.java |   101 -
 .../org/usergrid/cassandra/DataControl.java     |    17 -
 .../java/org/usergrid/cassandra/DataLoader.java |     9 -
 .../org/usergrid/cassandra/SchemaManager.java   |    18 -
 .../src/main/resources/cassandra.yaml           |    12 +
 .../src/main/resources/log4j.properties         |    12 +
 .../cassandra/AnotherCassandraResourceIT.java   |    84 +
 .../cassandra/CassandraResourceITSuite.java     |    41 +
 .../cassandra/CassandraResourceTest.java        |   120 +
 .../usergrid/cassandra/FakeSchemaManager.java   |    48 +
 .../usergrid/cassandra/OkThisIsTheLastIT.java   |    92 +
 .../YetAnotherCassandraResourceIT.java          |    86 +
 .../cassandra/AnotherCassandraResourceIT.java   |    68 -
 .../cassandra/CassandraResourceITSuite.java     |    25 -
 .../cassandra/CassandraResourceTest.java        |   104 -
 .../usergrid/cassandra/FakeSchemaManager.java   |    32 -
 .../usergrid/cassandra/OkThisIsTheLastIT.java   |    76 -
 .../YetAnotherCassandraResourceIT.java          |    70 -
 .../src/test/resources/project.properties       |    12 +
 .../test/resources/usergrid-test-context.xml    |    22 +-
 stack/tools/README.md                           |     4 +-
 stack/tools/impoexpo.sh                         |    16 +
 stack/tools/pom.xml                             |    38 +-
 stack/tools/src/main/assembly/release.xml       |    16 +
 .../main/dist/usergrid-custom-tools.properties  |    16 +
 stack/tools/src/main/dist/usergrid-export.sh    |    16 +
 .../java/org/apache/usergrid/tools/ApiDoc.java  |   115 +
 .../org/apache/usergrid/tools/AppAudit.java     |   232 +
 .../org/apache/usergrid/tools/AppNameFix.java   |   110 +
 .../java/org/apache/usergrid/tools/Cli.java     |   270 +
 .../java/org/apache/usergrid/tools/Command.java |   100 +
 .../org/apache/usergrid/tools/CredExport.java   |   123 +
 .../apache/usergrid/tools/DupAdminRepair.java   |   311 +
 .../org/apache/usergrid/tools/DupOrgRepair.java |   267 +
 .../apache/usergrid/tools/EntityCleanup.java    |   177 +
 .../usergrid/tools/EntityInsertBenchMark.java   |   274 +
 .../usergrid/tools/EntityReadBenchMark.java     |   361 +
 .../org/apache/usergrid/tools/EntityUpdate.java |   207 +
 .../java/org/apache/usergrid/tools/Export.java  |   432 +
 .../usergrid/tools/ExportDataCreator.java       |   106 +
 .../usergrid/tools/ExportingToolBase.java       |   186 +
 .../java/org/apache/usergrid/tools/Import.java  |   546 +
 .../org/apache/usergrid/tools/ImportFB.java     |   102 +
 .../org/apache/usergrid/tools/IndexRebuild.java |   207 +
 .../java/org/apache/usergrid/tools/Metrics.java |   229 +
 .../usergrid/tools/OrganizationExport.java      |   133 +
 .../apache/usergrid/tools/PopulateSample.java   |   143 +
 .../RepairingMismatchedApplicationMetadata.java |    73 +
 .../apache/usergrid/tools/ResetSuperUser.java   |   106 +
 .../java/org/apache/usergrid/tools/SetupDB.java |    58 +
 .../java/org/apache/usergrid/tools/Test.java    |    54 +
 .../org/apache/usergrid/tools/ToolBase.java     |   246 +
 .../usergrid/tools/UniqueIndexCleanup.java      |   382 +
 .../org/apache/usergrid/tools/UserManager.java  |    61 +
 .../apache/usergrid/tools/WarehouseExport.java  |   516 +
 .../apache/usergrid/tools/WarehouseUpsert.java  |   156 +
 .../usergrid/tools/apidoc/swagger/Api.java      |    93 +
 .../tools/apidoc/swagger/ApiListing.java        |   146 +
 .../tools/apidoc/swagger/ApiOperation.java      |   248 +
 .../tools/apidoc/swagger/ApiOperationError.java |    61 +
 .../usergrid/tools/apidoc/swagger/ApiParam.java |   185 +
 .../apidoc/swagger/ApiParamAllowableValues.java |    63 +
 .../apache/usergrid/tools/bean/AppScore.java    |    98 +
 .../apache/usergrid/tools/bean/ExportOrg.java   |    70 +
 .../apache/usergrid/tools/bean/MetricLine.java  |    98 +
 .../apache/usergrid/tools/bean/MetricQuery.java |   109 +
 .../apache/usergrid/tools/bean/MetricSort.java  |    42 +
 .../apache/usergrid/tools/bean/OrgScore.java    |   109 +
 .../main/java/org/usergrid/tools/ApiDoc.java    |   114 -
 .../main/java/org/usergrid/tools/AppAudit.java  |   231 -
 .../java/org/usergrid/tools/AppNameFix.java     |   109 -
 .../src/main/java/org/usergrid/tools/Cli.java   |   269 -
 .../main/java/org/usergrid/tools/Command.java   |    99 -
 .../java/org/usergrid/tools/CredExport.java     |   122 -
 .../java/org/usergrid/tools/DupAdminRepair.java |   310 -
 .../java/org/usergrid/tools/DupOrgRepair.java   |   266 -
 .../java/org/usergrid/tools/EntityCleanup.java  |   176 -
 .../usergrid/tools/EntityInsertBenchMark.java   |   273 -
 .../org/usergrid/tools/EntityReadBenchMark.java |   360 -
 .../java/org/usergrid/tools/EntityUpdate.java   |   191 -
 .../main/java/org/usergrid/tools/Export.java    |   431 -
 .../org/usergrid/tools/ExportDataCreator.java   |   105 -
 .../org/usergrid/tools/ExportingToolBase.java   |   183 -
 .../main/java/org/usergrid/tools/Import.java    |   545 -
 .../main/java/org/usergrid/tools/ImportFB.java  |   101 -
 .../java/org/usergrid/tools/IndexRebuild.java   |   206 -
 .../main/java/org/usergrid/tools/Metrics.java   |   213 -
 .../org/usergrid/tools/OrganizationExport.java  |   117 -
 .../java/org/usergrid/tools/PopulateSample.java |   142 -
 .../java/org/usergrid/tools/ResetSuperUser.java |   105 -
 .../main/java/org/usergrid/tools/SetupDB.java   |    57 -
 .../src/main/java/org/usergrid/tools/Test.java  |    53 -
 .../main/java/org/usergrid/tools/ToolBase.java  |   246 -
 .../org/usergrid/tools/UniqueIndexCleanup.java  |   381 -
 .../java/org/usergrid/tools/UserManager.java    |    45 -
 .../org/usergrid/tools/WarehouseExport.java     |   516 -
 .../org/usergrid/tools/WarehouseUpsert.java     |   153 -
 .../org/usergrid/tools/apidoc/swagger/Api.java  |    92 -
 .../tools/apidoc/swagger/ApiListing.java        |   145 -
 .../tools/apidoc/swagger/ApiOperation.java      |   247 -
 .../tools/apidoc/swagger/ApiOperationError.java |    60 -
 .../usergrid/tools/apidoc/swagger/ApiParam.java |   184 -
 .../apidoc/swagger/ApiParamAllowableValues.java |    62 -
 .../java/org/usergrid/tools/bean/AppScore.java  |    82 -
 .../java/org/usergrid/tools/bean/ExportOrg.java |    58 -
 .../org/usergrid/tools/bean/MetricLine.java     |    82 -
 .../org/usergrid/tools/bean/MetricQuery.java    |    93 -
 .../org/usergrid/tools/bean/MetricSort.java     |    26 -
 .../java/org/usergrid/tools/bean/OrgScore.java  |    93 -
 .../src/main/resources/apidoc/applications.yaml |    11 +
 .../src/main/resources/apidoc/management.yaml   |    11 +
 stack/tools/src/main/resources/log4j.xml        |    18 +-
 .../main/resources/toolsApplicationContext.xml  |    16 +
 .../src/main/resources/warehouse-schema.sql     |    18 +-
 stack/websocket/pom.xml                         |    30 +-
 .../websocket/WebSocketChannelHandler.java      |   358 +
 .../usergrid/websocket/WebSocketKeyStore.java   |    50 +
 .../usergrid/websocket/WebSocketServer.java     |   181 +
 .../websocket/WebSocketServerIndexPage.java     |    57 +
 .../WebSocketServerPipelineFactory.java         |    76 +
 .../websocket/WebSocketSslContextFactory.java   |    63 +
 .../websocket/WebSocketChannelHandler.java      |   357 -
 .../usergrid/websocket/WebSocketKeyStore.java   |    49 -
 .../org/usergrid/websocket/WebSocketServer.java |   195 -
 .../websocket/WebSocketServerIndexPage.java     |    71 -
 .../WebSocketServerPipelineFactory.java         |    75 -
 .../websocket/WebSocketSslContextFactory.java   |    62 -
 .../usergrid/websocket/ExampleListener.java     |    42 +
 .../websocket/SimpleMessageProducer.java        |    62 +
 .../usergrid/websocket/WebSocketServerTest.java |    44 +
 .../org/usergrid/websocket/ExampleListener.java |    41 -
 .../websocket/SimpleMessageProducer.java        |    61 -
 .../usergrid/websocket/WebSocketServerTest.java |    42 -
 .../src/test/resources/test-activemq.xml        |    27 +-
 .../test/resources/testApplicationContext.xml   |    36 +-
 2932 files changed, 430001 insertions(+), 297200 deletions(-)
----------------------------------------------------------------------



[13/55] [abbrv] git commit: USERGRID-86: Remove restriction on 10 apps in the portal, add build files

Posted by sn...@apache.org.
USERGRID-86: Remove restriction on 10 apps in the portal, add build files


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/44805da2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/44805da2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/44805da2

Branch: refs/pull/76/head
Commit: 44805da27273483d6bf89a7f42e92c87dd214b08
Parents: a339e4f
Author: Shawn Feldman <sh...@gmail.com>
Authored: Thu Mar 6 14:33:44 2014 -0700
Committer: Shawn Feldman <sh...@gmail.com>
Committed: Thu Mar 6 14:33:44 2014 -0700

----------------------------------------------------------------------
 portal/index-debug.html             | 16 ++++++++--------
 portal/index.html                   | 16 ++++++++--------
 portal/js/libs/usergrid-libs.min.js |  2 +-
 portal/js/usergrid-dev.min.js       |  2 +-
 portal/js/usergrid.min.js           |  2 +-
 5 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44805da2/portal/index-debug.html
----------------------------------------------------------------------
diff --git a/portal/index-debug.html b/portal/index-debug.html
index 7b8dcec..4e572c2 100644
--- a/portal/index-debug.html
+++ b/portal/index-debug.html
@@ -8,12 +8,12 @@
   <meta name="description" content="">
   <meta name="author" content="">
 
-  <link id="libScript" href="2.0.36/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
-  <link id="libScript" href="2.0.36/css/dash.min.css" rel="stylesheet">
+  <link id="libScript" href="1.0.2/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
+  <link id="libScript" href="1.0.2/css/dash.min.css" rel="stylesheet">
 
   <!--styles for jquery ui calendar component-->
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-timepicker.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="1.0.2/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="1.0.2/js/libs/jqueryui/jquery-ui-timepicker.css">
 </head>
 <body ng-controller="PageCtrl">
 <!-- Google Tag Manager -->
@@ -115,14 +115,14 @@
     </div>
   </div>
 </section>
-<script id="libScript" src="2.0.36/js/libs/usergrid-libs.min.js"></script>
-<script id="libScript" src="2.0.36/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
+<script id="libScript" src="1.0.2/js/libs/usergrid-libs.min.js"></script>
+<script id="libScript" src="1.0.2/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
 <!--todo - remove this. temporarily including jquery ui for calendar in push-->
-<script id="libScript" src="2.0.36/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
+<script id="libScript" src="1.0.2/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
 <!-- In dev use: <script src="js/libs/angular-1.1.5.js"></script> -->
 <!--<script type="text/javascript" src="js/libs/angular-ui-ng-grid/ng-grid-2.0.2.debug.js"></script>-->
 <script src="config.js"></script>
-<script id="main-script" src="2.0.36/js/usergrid-dev.min.js"></script>
+<script id="main-script" src="1.0.2/js/usergrid-dev.min.js"></script>
 
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44805da2/portal/index.html
----------------------------------------------------------------------
diff --git a/portal/index.html b/portal/index.html
index 95b6eb8..558e6a9 100644
--- a/portal/index.html
+++ b/portal/index.html
@@ -8,12 +8,12 @@
   <meta name="description" content="">
   <meta name="author" content="">
 
-  <link id="libScript" href="2.0.36/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
-  <link id="libScript" href="2.0.36/css/dash.min.css" rel="stylesheet">
+  <link id="libScript" href="1.0.2/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
+  <link id="libScript" href="1.0.2/css/dash.min.css" rel="stylesheet">
 
   <!--styles for jquery ui calendar component-->
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-timepicker.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="1.0.2/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="1.0.2/js/libs/jqueryui/jquery-ui-timepicker.css">
 </head>
 <body ng-controller="PageCtrl">
 <!-- Google Tag Manager -->
@@ -115,14 +115,14 @@
     </div>
   </div>
 </section>
-<script id="libScript" src="2.0.36/js/libs/usergrid-libs.min.js"></script>
-<script id="libScript" src="2.0.36/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
+<script id="libScript" src="1.0.2/js/libs/usergrid-libs.min.js"></script>
+<script id="libScript" src="1.0.2/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
 <!--todo - remove this. temporarily including jquery ui for calendar in push-->
-<script id="libScript" src="2.0.36/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
+<script id="libScript" src="1.0.2/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
 <!-- In dev use: <script src="js/libs/angular-1.1.5.js"></script> -->
 <!--<script type="text/javascript" src="js/libs/angular-ui-ng-grid/ng-grid-2.0.2.debug.js"></script>-->
 <script src="config.js"></script>
-<script id="main-script" src="2.0.36/js/usergrid.min.js"></script>
+<script id="main-script" src="1.0.2/js/usergrid.min.js"></script>
 
 </body>
 </html>


[35/55] [abbrv] git commit: Merge pull request #69 from r3b/error-regression

Posted by sn...@apache.org.
Merge pull request #69 from r3b/error-regression

Error regression

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2ef4e336
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2ef4e336
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2ef4e336

Branch: refs/pull/76/head
Commit: 2ef4e336ebbb572575d22ede8898a5db4bb7a097
Parents: 51ad092 a8ee99a
Author: Dave Johnson <da...@rollerweblogger.org>
Authored: Tue Mar 11 09:34:18 2014 -0400
Committer: Dave Johnson <da...@rollerweblogger.org>
Committed: Tue Mar 11 09:34:18 2014 -0400

----------------------------------------------------------------------
 sdks/html5-javascript/lib/modules/Asset.js  |  4 ++--
 sdks/html5-javascript/lib/modules/Folder.js |  4 ++--
 sdks/html5-javascript/usergrid.js           | 16 ++++++++--------
 sdks/html5-javascript/usergrid.min.js       |  4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[39/55] [abbrv] git commit: fix issue with find_by using exclamation point

Posted by sn...@apache.org.
fix issue with find_by using exclamation point


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/6ab616b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/6ab616b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/6ab616b0

Branch: refs/pull/76/head
Commit: 6ab616b0c2a1d6743f1825b1b65a09bd0892e893
Parents: 746384c
Author: Scott Ganyo <sc...@ganyo.com>
Authored: Wed Mar 12 16:07:05 2014 -0700
Committer: Scott Ganyo <sc...@ganyo.com>
Committed: Wed Mar 12 16:07:05 2014 -0700

----------------------------------------------------------------------
 sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6ab616b0/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb
----------------------------------------------------------------------
diff --git a/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb b/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb
index 5945857..6868257 100644
--- a/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb
+++ b/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb
@@ -333,6 +333,12 @@ module Usergrid
       def method_missing(method_name, *args)
 
         method = method_name.to_s
+
+        if method.end_with? '!'
+          method.chop!
+          error_on_empty = true
+        end
+
         if method.start_with? 'find_all_by_'
           attribs = method.gsub /^find_all_by_/, ''
         elsif method.start_with? 'find_by_'
@@ -350,11 +356,6 @@ module Usergrid
           super
         end
 
-        if method.end_with? '!'
-          method.chop!
-          error_on_empty = true
-        end
-
         attribs = attribs.split '_and_'
         conditions = {}
         attribs.each { |attr| conditions[attr] = args.shift }
@@ -892,7 +893,7 @@ module Usergrid
         return if loaded?
         begin
           @response = run_query
-          @records = @response.entities.collect {|r| @model_class.model_name.constantize.new(r.data)}
+            @records = @response.entities.collect {|r| @model_class.model_name.constantize.new(r.data)}
         rescue RestClient::ResourceNotFound
           @records = []
         end


[31/55] [abbrv] fix bug with analytics

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f6c3d4aa/portal/js/usergrid-dev.min.js
----------------------------------------------------------------------
diff --git a/portal/js/usergrid-dev.min.js b/portal/js/usergrid-dev.min.js
index 2880606..21bfa8c 100644
--- a/portal/js/usergrid-dev.min.js
+++ b/portal/js/usergrid-dev.min.js
@@ -1,4 +1,4 @@
-/*! apigee-usergrid@2.0.36 2014-03-10 */
+/*! apigee-usergrid@2.0.0 2014-03-10 */
 (function(exports, global) {
     global["true"] = exports;
     "use strict";
@@ -1199,7 +1199,7 @@
         ITEMS_URL: "global/temp.json"
     });
     "use strict";
-    AppServices.Controllers.controller("PageCtrl", [ "ug", "utility", "$scope", "$rootScope", "$location", "$routeParams", "$q", "$route", "$log", "$analytics", function(ug, utility, $scope, $rootScope, $location, $routeParams, $q, $route, $log) {
+    AppServices.Controllers.controller("PageCtrl", [ "ug", "utility", "$scope", "$rootScope", "$location", "$routeParams", "$q", "$route", "$log", function(ug, utility, $scope, $rootScope, $location, $routeParams, $q, $route, $log) {
         var initScopeVariables = function() {
             $scope.loadingText = "Loading...";
             $scope.use_sso = false;
@@ -1506,15 +1506,10 @@
         };
     } ]);
     "use strict";
-    AppServices.Services.factory("ug", function(configuration, $rootScope, utility, $q, $http, $resource, $log, $analytics, $location) {
+    AppServices.Services.factory("ug", function(configuration, $rootScope, utility, $q, $http, $resource, $log, $location) {
         var requestTimes = [], running = false, currentRequests = {};
         function reportError(data, config) {
-            try {
-                $analytics.eventTrack("error", {
-                    category: "App Services",
-                    label: data + ":" + config.url + ":" + (sessionStorage["apigee_uuid"] || "na")
-                });
-            } catch (e) {
+            try {} catch (e) {
                 console.log(e);
             }
         }


[46/55] [abbrv] git commit: rebuilding artifacts after merge

Posted by sn...@apache.org.
rebuilding artifacts after merge


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/13ab2bd2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/13ab2bd2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/13ab2bd2

Branch: refs/pull/76/head
Commit: 13ab2bd2e770543c1f35e6243ea5c732fa3d6a4e
Parents: 55462ea
Author: ryan bridges <rb...@apigee.com>
Authored: Thu Mar 13 10:30:32 2014 -0400
Committer: ryan bridges <rb...@apigee.com>
Committed: Thu Mar 13 10:30:32 2014 -0400

----------------------------------------------------------------------
 sdks/html5-javascript/usergrid.js     | 24 ++++++++++++++++++++++--
 sdks/html5-javascript/usergrid.min.js |  6 +++---
 2 files changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/13ab2bd2/sdks/html5-javascript/usergrid.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/usergrid.js b/sdks/html5-javascript/usergrid.js
index 517908f..cb83d0c 100644
--- a/sdks/html5-javascript/usergrid.js
+++ b/sdks/html5-javascript/usergrid.js
@@ -1,4 +1,4 @@
-/*! usergrid@0.10.8 2014-03-05 */
+/*! usergrid@0.10.8 2014-03-13 */
 var UsergridEventable = function() {
     throw Error("'UsergridEventable' is not intended to be invoked directly");
 };
@@ -293,6 +293,19 @@ function extend(subClass, superClass) {
     return subClass;
 }
 
+function propCopy(from, to) {
+    for (var prop in from) {
+        if (from.hasOwnProperty(prop)) {
+            if ("object" === typeof from[prop] && "object" === typeof to[prop]) {
+                to[prop] = propCopy(from[prop], to[prop]);
+            } else {
+                to[prop] = from[prop];
+            }
+        }
+    }
+    return to;
+}
+
 function NOOP() {}
 
 //Usergrid namespace encapsulates this SDK
@@ -563,6 +576,9 @@ function doCallback(callback, params, context) {
         if (options.appName) {
             this.set("appName", options.appName);
         }
+        if (options.qs) {
+            this.setObject("default_qs", options.qs);
+        }
         //other options
         this.buildCurl = options.buildCurl || false;
         this.logging = options.logging || false;
@@ -598,6 +614,7 @@ function doCallback(callback, params, context) {
         //is this a query to the management endpoint?
         var orgName = this.get("orgName");
         var appName = this.get("appName");
+        var default_qs = this.getObject("default_qs");
         var uri;
         var logoutCallback = function() {
             if (typeof this.logoutCallback === "function") {
@@ -615,6 +632,9 @@ function doCallback(callback, params, context) {
         if (this.getToken()) {
             qs.access_token = this.getToken();
         }
+        if (default_qs) {
+            qs = propCopy(qs, default_qs);
+        }
         var req = new Usergrid.Request(method, uri, qs, body, function(err, response) {
             if ([ "auth_expired_session_token", "auth_missing_credentials", "auth_unverified_oath", "expired_token", "unauthorized", "auth_invalid" ].indexOf(response.error) !== -1) {
                 return logoutCallback();
@@ -767,7 +787,7 @@ function doCallback(callback, params, context) {
    */
     Usergrid.Client.prototype.createCollection = function(options, callback) {
         options.client = this;
-        var collection = new Usergrid.Collection(options, function(err, data) {
+        new Usergrid.Collection(options, function(err, data, collection) {
             doCallback(callback, [ err, collection, data ]);
         });
     };


[15/55] [abbrv] git commit: Renamed PR to match org.apache

Posted by sn...@apache.org.
Renamed PR to match org.apache


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/3cd006ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3cd006ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3cd006ac

Branch: refs/pull/76/head
Commit: 3cd006acb15c3b3216255d641c8b47c83e85bba6
Parents: d565e79
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Mar 7 09:25:05 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Mar 7 09:25:30 2014 -0700

----------------------------------------------------------------------
 .../RepairingMismatchedApplicationMetadata.java | 73 ++++++++++++++++++++
 .../RepairingMismatchedApplicationMetadata.java | 57 ---------------
 2 files changed, 73 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3cd006ac/stack/tools/src/main/java/org/apache/usergrid/tools/RepairingMismatchedApplicationMetadata.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/RepairingMismatchedApplicationMetadata.java b/stack/tools/src/main/java/org/apache/usergrid/tools/RepairingMismatchedApplicationMetadata.java
new file mode 100644
index 0000000..c0bd320
--- /dev/null
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/RepairingMismatchedApplicationMetadata.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.tools;
+
+import com.google.common.collect.BiMap;
+import me.prettyprint.cassandra.serializers.ByteBufferSerializer;
+import me.prettyprint.hector.api.Keyspace;
+import me.prettyprint.hector.api.mutation.Mutator;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Options;
+
+import java.nio.ByteBuffer;
+import java.util.Map;
+import java.util.UUID;
+
+import static me.prettyprint.hector.api.factory.HFactory.createMutator;
+import static org.apache.usergrid.persistence.Schema.PROPERTY_NAME;
+import static org.apache.usergrid.persistence.Schema.PROPERTY_UUID;
+import static org.apache.usergrid.persistence.cassandra.CassandraPersistenceUtils.addInsertToMutator;
+import static org.apache.usergrid.persistence.cassandra.CassandraPersistenceUtils.batchExecute;
+import static org.apache.usergrid.persistence.cassandra.CassandraService.APPLICATIONS_CF;
+import static org.apache.usergrid.persistence.cassandra.CassandraService.RETRY_COUNT;
+
+public class RepairingMismatchedApplicationMetadata extends ToolBase {
+
+    public static final ByteBufferSerializer be = new ByteBufferSerializer();
+
+    @Override
+    public Options createOptions() {
+        Options options = super.createOptions();
+        return options;
+    }
+
+    @Override
+    public void runTool(CommandLine line) throws Exception {
+        startSpring();
+
+        BiMap<UUID, String> orgs = managementService.getOrganizations();
+        for(Map.Entry org : orgs.entrySet()) {
+            BiMap<UUID, String> apps = managementService.getApplicationsForOrganization((UUID)org.getKey());
+            for(Map.Entry app : apps.entrySet()) {
+                UUID applicationId = emf.lookupApplication((String)app.getValue());
+                if( applicationId == null ) {
+                    String appName = (String)app.getValue();
+                    Keyspace ko = cass.getSystemKeyspace();
+                    Mutator<ByteBuffer> m = createMutator(ko, be);
+                    long timestamp = cass.createTimestamp();
+                    addInsertToMutator(m, APPLICATIONS_CF, appName, PROPERTY_UUID, (UUID)app.getKey(), timestamp);
+                    addInsertToMutator(m, APPLICATIONS_CF, appName, PROPERTY_NAME, appName, timestamp);
+                    batchExecute(m, RETRY_COUNT);
+                    logger.info("UUID {}, NAME {}", app.getKey(), app.getValue());
+                }
+            }
+        }
+
+        logger.info("Waiting 60 sec...");
+        Thread.sleep(1000 * 60);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3cd006ac/stack/tools/src/main/java/org/usergrid/tools/RepairingMismatchedApplicationMetadata.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/usergrid/tools/RepairingMismatchedApplicationMetadata.java b/stack/tools/src/main/java/org/usergrid/tools/RepairingMismatchedApplicationMetadata.java
deleted file mode 100644
index 24146fc..0000000
--- a/stack/tools/src/main/java/org/usergrid/tools/RepairingMismatchedApplicationMetadata.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.usergrid.tools;
-
-import com.google.common.collect.BiMap;
-import me.prettyprint.cassandra.serializers.ByteBufferSerializer;
-import me.prettyprint.hector.api.Keyspace;
-import me.prettyprint.hector.api.mutation.Mutator;
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Options;
-
-import java.nio.ByteBuffer;
-import java.util.Map;
-import java.util.UUID;
-
-import static me.prettyprint.hector.api.factory.HFactory.createMutator;
-import static org.usergrid.persistence.Schema.PROPERTY_NAME;
-import static org.usergrid.persistence.Schema.PROPERTY_UUID;
-import static org.usergrid.persistence.cassandra.CassandraPersistenceUtils.addInsertToMutator;
-import static org.usergrid.persistence.cassandra.CassandraPersistenceUtils.batchExecute;
-import static org.usergrid.persistence.cassandra.CassandraService.APPLICATIONS_CF;
-import static org.usergrid.persistence.cassandra.CassandraService.RETRY_COUNT;
-
-public class RepairingMismatchedApplicationMetadata extends ToolBase {
-
-    public static final ByteBufferSerializer be = new ByteBufferSerializer();
-
-    @Override
-    public Options createOptions() {
-        Options options = super.createOptions();
-        return options;
-    }
-
-    @Override
-    public void runTool(CommandLine line) throws Exception {
-        startSpring();
-
-        BiMap<UUID, String> orgs = managementService.getOrganizations();
-        for(Map.Entry org : orgs.entrySet()) {
-            BiMap<UUID, String> apps = managementService.getApplicationsForOrganization((UUID)org.getKey());
-            for(Map.Entry app : apps.entrySet()) {
-                UUID applicationId = emf.lookupApplication((String)app.getValue());
-                if( applicationId == null ) {
-                    String appName = (String)app.getValue();
-                    Keyspace ko = cass.getSystemKeyspace();
-                    Mutator<ByteBuffer> m = createMutator(ko, be);
-                    long timestamp = cass.createTimestamp();
-                    addInsertToMutator(m, APPLICATIONS_CF, appName, PROPERTY_UUID, (UUID)app.getKey(), timestamp);
-                    addInsertToMutator(m, APPLICATIONS_CF, appName, PROPERTY_NAME, appName, timestamp);
-                    batchExecute(m, RETRY_COUNT);
-                    logger.info("UUID {}, NAME {}", app.getKey(), app.getValue());
-                }
-            }
-        }
-
-        logger.info("Waiting 60 sec...");
-        Thread.sleep(1000 * 60);
-    }
-}


[18/55] [abbrv] git commit: Ignore two-dot-o's ignored files.

Posted by sn...@apache.org.
Ignore two-dot-o's ignored files.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/0254ee82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/0254ee82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/0254ee82

Branch: refs/pull/76/head
Commit: 0254ee828d61a326e27cbabed4dfb0d5cd65e6ed
Parents: 3cd006a
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Mar 10 09:06:29 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Mar 10 09:06:29 2014 -0400

----------------------------------------------------------------------
 .gitignore    | 9 ++++++++-
 stack/pom.xml | 3 +++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0254ee82/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index eacfd46..2e2bcbe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,4 +20,11 @@ Icon
 /stack/corepersistence/priamcluster/aws.properties
 #Webstorm artifacts
 .idea/
-portal/2.0.**
\ No newline at end of file
+portal/2.0.**
+stack/corepersistence/collection/nbactions.xml
+stack/corepersistence/graph/nbactions.xml
+stack/corepersistence/model/nbactions.xml
+stack/corepersistence/nbactions.xml
+stack/corepersistence/queryindex/nbactions.xml
+stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterLexer.java
+stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterParser.java

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0254ee82/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 1e4214c..93d57a0 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -1789,12 +1789,15 @@
                     <exclude>**/META-INF/**</exclude>
                     <exclude>**/dependency-reduced-pom.xml</exclude>
                     <exclude>**/QueryFilter.tokens</exclude>
+                    <exclude>**/QueryFilterLexer.java</exclude>
+                    <exclude>**/QueryFilterParser.java</exclude>
 
                     <!-- other -->
                     <exclude>**/m2/**</exclude>
                     <exclude>**/*.asc</exclude>
                     <exclude>**/src/test/resources/**</exclude>
                     <exclude>**/cloudbees.xml</exclude>
+                    <exclude>**/aws.properties</exclude>
 
                 </excludes>
             </configuration>


[05/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/usergrid-dev.min.js
----------------------------------------------------------------------
diff --git a/portal/js/usergrid-dev.min.js b/portal/js/usergrid-dev.min.js
index fbbf56d..83b8ff6 100644
--- a/portal/js/usergrid-dev.min.js
+++ b/portal/js/usergrid-dev.min.js
@@ -1,4 +1,4 @@
-/*! apigee-usergrid@2.0.34 2014-03-03 */
+/*! apigee-usergrid@2.0.36 2014-03-06 */
 (function(exports, global) {
     global["true"] = exports;
     "use strict";
@@ -42,7 +42,9 @@
     AppServices.Controllers = angular.module("appservices.controllers", []);
     AppServices.Filters = angular.module("appservices.filters", []);
     AppServices.Directives = angular.module("appservices.directives", []);
-    angular.module("appservices", [ "ngRoute", "ngResource", "ngSanitize", "ui.bootstrap", "appservices.filters", "appservices.services", "appservices.directives", "appservices.constants", "appservices.controllers" ]).config([ "$routeProvider", "$locationProvider", "$sceDelegateProvider", function($routeProvider, $locationProvider, $sceDelegateProvider) {
+    AppServices.Performance = angular.module("appservices.performance", []);
+    AppServices.Push = angular.module("appservices.push", []);
+    angular.module("appservices", [ "ngRoute", "ngResource", "ngSanitize", "ui.bootstrap", "angulartics", "angulartics.google.analytics", "appservices.filters", "appservices.services", "appservices.directives", "appservices.constants", "appservices.controllers", "appservices.performance", "appservices.push" ]).config([ "$routeProvider", "$locationProvider", "$sceDelegateProvider", "$analyticsProvider", function($routeProvider, $locationProvider, $sceDelegateProvider, $analyticsProvider) {
         $routeProvider.when("/org-overview", {
             templateUrl: "org-overview/org-overview.html",
             controller: "OrgOverviewCtrl"
@@ -76,6 +78,9 @@
         }).when("/users/activities", {
             templateUrl: "users/users-activities.html",
             controller: "UsersActivitiesCtrl"
+        }).when("/users/feed", {
+            templateUrl: "users/users-feed.html",
+            controller: "UsersFeedCtrl"
         }).when("/users/graph", {
             templateUrl: "users/users-graph.html",
             controller: "UsersGraphCtrl"
@@ -141,6 +146,8 @@
         });
         $locationProvider.html5Mode(false).hashPrefix("!");
         $sceDelegateProvider.resourceUrlWhitelist([ "self", "http://apigee-internal-prod.jupiter.apigee.net/**", "http://apigee-internal-prod.mars.apigee.net/**", "https://appservices.apigee.com/**", "https://api.usergrid.com/**" ]);
+        $analyticsProvider.virtualPageviews(false);
+        $analyticsProvider.firstPageview(false);
     } ]);
     AppServices.Controllers.controller("ActivitiesCtrl", [ "ug", "$scope", "$rootScope", "$location", "$route", function(ug, $scope, $rootScope, $location, $route) {
         $scope.$on("app-activities-received", function(evt, data) {
@@ -1194,7 +1201,7 @@
         ITEMS_URL: "global/temp.json"
     });
     "use strict";
-    AppServices.Controllers.controller("PageCtrl", [ "ug", "utility", "$scope", "$rootScope", "$location", "$routeParams", "$q", "$route", "$log", function(ug, utility, $scope, $rootScope, $location, $routeParams, $q, $route, $log) {
+    AppServices.Controllers.controller("PageCtrl", [ "ug", "utility", "$scope", "$rootScope", "$location", "$routeParams", "$q", "$route", "$log", "$analytics", function(ug, utility, $scope, $rootScope, $location, $routeParams, $q, $route, $log, $analytics) {
         var initScopeVariables = function() {
             $scope.loadingText = "Loading...";
             $scope.use_sso = false;
@@ -1212,6 +1219,7 @@
             $rootScope.demoData = false;
             $scope.queryStringApplied = false;
             $rootScope.autoUpdateTimer = Usergrid.config ? Usergrid.config.autoUpdateTimer : 61;
+            $rootScope.requiresDeveloperKey = Usergrid.config ? Usergrid.config.client.requiresDeveloperKey : false;
             $rootScope.loaded = $rootScope.activeUI = false;
             for (var key in Usergrid.regex) {
                 $scope[key] = Usergrid.regex[key];
@@ -1228,48 +1236,10 @@
         };
         initScopeVariables();
         $rootScope.urls = function() {
-            var BASE_URL = "";
-            var DATA_URL = "";
-            var qs = $location.search();
-            switch (true) {
-              case $location.host() === "appservices.apigee.com" && location.pathname.indexOf("/dit") >= 0:
-                BASE_URL = "https://accounts.jupiter.apigee.net";
-                DATA_URL = "http://apigee-internal-prod.jupiter.apigee.net";
-                $scope.use_sso = true;
-                break;
-
-              case $location.host() === "appservices.apigee.com" && location.pathname.indexOf("/mars") >= 0:
-                BASE_URL = "https://accounts.mars.apigee.net";
-                DATA_URL = "http://apigee-internal-prod.mars.apigee.net";
-                $scope.use_sso = true;
-                break;
-
-              case $location.host() === "appservices.apigee.com":
-                DATA_URL = Usergrid.overrideUrl;
-                break;
-
-              case $location.host() === "apigee.com":
-                BASE_URL = "https://accounts.apigee.com";
-                DATA_URL = "https://api.usergrid.com";
-                $scope.use_sso = true;
-                break;
-
-              case $location.host() === "usergrid.dev":
-                DATA_URL = "https://api.usergrid.com";
-                break;
-
-              default:
-                DATA_URL = Usergrid.overrideUrl;
-                break;
-            }
-            DATA_URL = qs.api_url || DATA_URL;
-            $scope.apiUrl = DATA_URL = DATA_URL.lastIndexOf("/") === DATA_URL.length - 1 ? DATA_URL.substring(0, DATA_URL.length - 1) : DATA_URL;
-            return {
-                DATA_URL: DATA_URL,
-                LOGIN_URL: BASE_URL + "/accounts/sign_in",
-                PROFILE_URL: BASE_URL + "/accounts/my_account",
-                LOGOUT_URL: BASE_URL + "/accounts/sign_out"
-            };
+            var urls = ug.getUrls();
+            $scope.apiUrl = urls.apiUrl;
+            $scope.use_sso = urls.use_sso;
+            return urls;
         };
         $rootScope.gotoPage = function(path) {
             $location.path(path);
@@ -1497,12 +1467,19 @@
         $scope.$on("request-times-slow", function(evt, averageRequestTimes) {
             $rootScope.$broadcast("alert", "info", "We are experiencing performance issues on our server.  Please click Get Help for support if this continues.");
         });
+        var lastPage = "";
         $scope.$on("$routeChangeSuccess", function() {
             verifyUser();
             $scope.showDemoBar = $location.path().slice(0, "/performance".length) === "/performance";
             if (!$scope.showDemoBar) {
                 $rootScope.demoData = false;
             }
+            setTimeout(function() {
+                lastPage = "";
+            }, 50);
+            var path = window.location.pathname.replace("index-debug.html", "");
+            lastPage === "" && $analytics.pageTrack((path + $location.path()).replace("//", "/"));
+            lastPage = $location.path();
         });
         $scope.$on("applications-received", function(event, applications) {
             $scope.applications = applications;
@@ -1538,9 +1515,18 @@
         };
     } ]);
     "use strict";
-    AppServices.Services.factory("ug", function(configuration, $rootScope, utility, $q, $http, $resource, $log) {
+    AppServices.Services.factory("ug", function(configuration, $rootScope, utility, $q, $http, $resource, $log, $analytics, $location) {
         var requestTimes = [], running = false, currentRequests = {};
-        function reportError(data, config) {}
+        function reportError(data, config) {
+            try {
+                $analytics.eventTrack("error", {
+                    category: "App Services",
+                    label: data + ":" + config.url + ":" + (sessionStorage["apigee_uuid"] || "na")
+                });
+            } catch (e) {
+                console.log(e);
+            }
+        }
         var getAccessToken = function() {
             return sessionStorage.getItem("accessToken");
         };
@@ -1551,6 +1537,54 @@
             set: function(prop, value) {
                 this.client().set(prop, value);
             },
+            getUrls: function() {
+                var host = $location.host();
+                var qs = $location.search();
+                var BASE_URL = "";
+                var DATA_URL = "";
+                var use_sso = false;
+                switch (true) {
+                  case host === "appservices.apigee.com" && location.pathname.indexOf("/dit") >= 0:
+                    BASE_URL = "https://accounts.jupiter.apigee.net";
+                    DATA_URL = "http://apigee-internal-prod.jupiter.apigee.net";
+                    use_sso = true;
+                    break;
+
+                  case host === "appservices.apigee.com" && location.pathname.indexOf("/mars") >= 0:
+                    BASE_URL = "https://accounts.mars.apigee.net";
+                    DATA_URL = "http://apigee-internal-prod.mars.apigee.net";
+                    use_sso = true;
+                    break;
+
+                  case host === "appservices.apigee.com":
+                    DATA_URL = Usergrid.overrideUrl;
+                    break;
+
+                  case host === "apigee.com":
+                    BASE_URL = "https://accounts.apigee.com";
+                    DATA_URL = "https://api.usergrid.com";
+                    use_sso = true;
+                    break;
+
+                  case host === "usergrid.dev":
+                    DATA_URL = "https://api.usergrid.com";
+                    break;
+
+                  default:
+                    DATA_URL = Usergrid.overrideUrl;
+                    break;
+                }
+                DATA_URL = qs.api_url || DATA_URL;
+                DATA_URL = DATA_URL.lastIndexOf("/") === DATA_URL.length - 1 ? DATA_URL.substring(0, DATA_URL.length - 1) : DATA_URL;
+                return {
+                    DATA_URL: DATA_URL,
+                    LOGIN_URL: BASE_URL + "/accounts/sign_in",
+                    PROFILE_URL: BASE_URL + "/accounts/my_account",
+                    LOGOUT_URL: BASE_URL + "/accounts/sign_out",
+                    apiUrl: DATA_URL,
+                    use_sso: use_sso
+                };
+            },
             orgLogin: function(username, password) {
                 var self = this;
                 this.client().set("email", username);
@@ -1579,7 +1613,6 @@
                         for (key in $rootScope.applications) {
                             if ($rootScope.applications.hasOwnProperty(key)) size++;
                         }
-                        $rootScope.addApplications = size < 10;
                         $rootScope.$broadcast("checkAuthentication-success", client.getObject("organizations"), client.getObject("applications"), client.get("orgName"), client.get("appName"), client.get("email"));
                     });
                 }, isAuthenticated = function() {
@@ -1657,6 +1690,9 @@
                 this._client = this._client || new Usergrid.Client(options, $rootScope.urls().DATA_URL);
                 return this._client;
             },
+            setClientProperty: function(key, value) {
+                this.client().set(key, value);
+            },
             getTopCollections: function() {
                 var options = {
                     method: "GET",
@@ -1953,7 +1989,9 @@
             getIndexes: function(path) {
                 var options = {
                     method: "GET",
-                    endpoint: path + "/indexes"
+                    endpoint: path.split("/").concat("indexes").filter(function(bit) {
+                        return bit && bit.length;
+                    }).join("/")
                 };
                 this.client().request(options, function(err, data) {
                     if (err) {
@@ -2419,8 +2457,9 @@
                     $rootScope.$broadcast("app-activities-received", data.entities);
                 });
             },
-            getEntityActivities: function(entity) {
-                var endpoint = entity.get("type") + "/" + entity.get("uuid") + "/activities";
+            getEntityActivities: function(entity, isFeed) {
+                var route = isFeed ? "feed" : "activities";
+                var endpoint = entity.get("type") + "/" + entity.get("uuid") + "/" + route;
                 var options = {
                     method: "GET",
                     endpoint: endpoint,
@@ -2430,12 +2469,12 @@
                 };
                 this.client().request(options, function(err, data) {
                     if (err) {
-                        $rootScope.$broadcast(entity.get("type") + "-activities-error", data);
+                        $rootScope.$broadcast(entity.get("type") + "-" + route + "-error", data);
                     }
                     data.entities.forEach(function(entityInstance) {
                         entityInstance.createdDate = new Date(entityInstance.created).toUTCString();
                     });
-                    $rootScope.$broadcast(entity.get("type") + "-activities-received", data.entities);
+                    $rootScope.$broadcast(entity.get("type") + "-" + route + "-received", data.entities);
                 });
             },
             addUserActivity: function(user, content) {
@@ -3172,6 +3211,7 @@
         $scope.loading = false;
         $scope.login = {};
         $scope.activation = {};
+        $scope.requiresDeveloperKey = $scope.options.client.requiresDeveloperKey || false;
         $rootScope.gotoForgotPasswordPage = function() {
             $location.path("/forgot-password");
         };
@@ -3192,8 +3232,9 @@
         });
         $scope.logout = function() {
             ug.logout();
+            ug.setClientProperty("developerkey", null);
             if ($scope.use_sso) {
-                window.location = $rootScope.urls().LOGOUT_URL + "?callback=" + encodeURIComponent($location.absUrl().split("?")[0]);
+                window.location = $rootScope.urls().LOGOUT_URL + "?redirect=no&callback=" + encodeURIComponent($location.absUrl().split("?")[0]);
             } else {
                 $location.path("/login");
                 $scope.applyScope();
@@ -3208,6 +3249,9 @@
         });
         $scope.$on("loginSuccesful", function(event, user, organizations, applications) {
             $scope.loading = false;
+            if ($scope.requiresDeveloperKey) {
+                ug.setClientProperty("developerkey", $scope.login.developerkey);
+            }
             $scope.login = {};
             if ($rootScope.currentPath === "/login" || $rootScope.currentPath === "/login/loading" || typeof $rootScope.currentPath === "undefined") {
                 $location.path("/org-overview");
@@ -3488,7 +3532,6 @@
                     for (key in applications) {
                         if (applications.hasOwnProperty(key)) size++;
                     }
-                    scope.addApplications = size < 10;
                     scope.hasApplications = Object.keys(applications).length > 0;
                     if (!scope.myApp.currentApp) {
                         $rootScope.currentApp = scope.myApp.currentApp = ug.get("appName");
@@ -4333,7 +4376,7 @@
         $templateCache.put("dialogs/modal.html", '    <div class="modal show fade" tabindex="-1" role="dialog" aria-hidden="true">\n' + '        <form ng-submit="extraDelegate(extrabutton)" name="dialogForm" novalidate>\n' + "\n" + '        <div class="modal-header">\n' + '            <h1 class="title">{{title}}</h1>\n' + "        </div>\n" + "\n" + '        <div class="modal-body" ng-transclude></div>\n' + '        <div class="modal-footer">\n' + "            {{footertext}}\n" + '            <input type="submit" class="btn" id="dialogButton-{{buttonId}}" ng-if="extrabutton" ng-disabled="!dialogForm.$valid" aria-hidden="true" ng-value="extrabuttonlabel"/>\n' + '            <button class="btn cancel pull-left" data-dismiss="modal" aria-hidden="true"\n' + '                    ng-click="closeDelegate(close)">{{closelabel}}\n' + "            </button>\n" + "        </div>\n" + "        </form>    </div>\n");
         $templateCache.put("global/appswitcher-template.html", '<li id="globalNav" class="dropdown dropdownContainingSubmenu active">\n' + '  <a class="dropdown-toggle" data-toggle="dropdown">API Platform<b class="caret"></b></a>\n' + '  <ul class="dropdown-menu pull-right">\n' + '    <li id="globalNavSubmenuContainer">\n' + "      <ul>\n" + '        <li data-globalNavDetail="globalNavDetailApigeeHome"><a target="_blank" href="http://apigee.com">Apigee Home</a></li>\n' + '        <li data-globalNavDetail="globalNavDetailAppServices" class="active"><a target="_blank" href="https://apigee.com/usergrid/">App Services</a></li>\n' + '        <li data-globalNavDetail="globalNavDetailApiPlatform" ><a target="_blank" href="https://enterprise.apigee.com">API Platform</a></li>\n' + '        <li data-globalNavDetail="globalNavDetailApiConsoles"><a target="_blank" href="http://apigee.com/providers">API Consoles</a></li>\n' + "      </ul>\n" + "    </li>\n" + '    <li id="globalNavDetail">\n' + 
 '      <div id="globalNavDetailApigeeHome">\n' + '        <div class="globalNavDetailApigeeLogo"></div>\n' + '        <div class="globalNavDetailDescription">You need apps and apps need APIs. Apigee is the leading API platform for enterprises and developers.</div>\n' + "      </div>\n" + '      <div id="globalNavDetailAppServices">\n' + '        <div class="globalNavDetailSubtitle">For App Developers</div>\n' + '        <div class="globalNavDetailTitle">App Services</div>\n' + '        <div class="globalNavDetailDescription">Build engaging applications, store data, manage application users, and more.</div>\n' + "      </div>\n" + '      <div id="globalNavDetailApiPlatform">\n' + '        <div class="globalNavDetailSubtitle">For API Developers</div>\n' + '        <div class="globalNavDetailTitle">API Platform</div>\n' + '        <div class="globalNavDetailDescription">Create, configure, manage and analyze your APIs and resources.</div>\n' + "      </div>\n" + '      <div id="globalNa
 vDetailApiConsoles">\n' + '        <div class="globalNavDetailSubtitle">For API Developers</div>\n' + '        <div class="globalNavDetailTitle">API Consoles</div>\n' + '        <div class="globalNavDetailDescription">Explore over 100 APIs with the Apigee API Console, or create and embed your own API Console.</div>\n' + "      </div>\n" + "    </li>\n" + "  </ul>\n" + "</li>");
         $templateCache.put("global/insecure-banner.html", '<div ng-if="securityWarning" ng-cloak class="demo-holder">\n' + '    <div class="alert alert-demo alert-animate">\n' + '        <div class="alert-text">\n' + '            <i class="pictogram">&#9888;</i>Warning: This application has "sandbox" permissions and is not production ready. <a target="_blank" href="http://apigee.com/docs/app-services/content/securing-your-app">Please go to our security documentation to find out more.</a></span>\n' + "        </div>\n" + "    </div>\n" + "</div>");
-        $templateCache.put("global/page-title.html", '<section class="row-fluid">\n' + '    <div class="span12">\n' + '        <div class="page-filters">\n' + '            <h1 class="title pull-left" id="pageTitle"><i class="pictogram title" style="padding-right: 5px;">{{icon}}</i>{{title}} <a class="super-help" href="#" ng-click="showHelp()"  >(need help?)</a></h1>\n' + "        </div>\n" + "    </div>\n" + '    <bsmodal id="need-help"\n' + '             title="Need Help?"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="sendHelp"\n' + '             extrabuttonlabel="Get Help"\n' + "             ng-cloak>\n" + "        <p>Do you want to contact support? Support will get in touch with you as soon as possible.</p>\n" + "    </bsmodal>\n" + "</section>\n" + "\n");
+        $templateCache.put("global/page-title.html", '<section class="row-fluid">\n' + '    <div class="span12">\n' + '        <div class="page-filters">\n' + '            <h1 class="title pull-left" id="pageTitle"><i class="pictogram title" style="padding-right: 5px;">{{icon}}</i>{{title}} <a class="super-help" href="http://community.apigee.com/content/apigee-customer-support" target="_blank"  >(need help?)</a></h1>\n' + "        </div>\n" + "    </div>\n" + '    <bsmodal id="need-help"\n' + '             title="Need Help?"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="sendHelp"\n' + '             extrabuttonlabel="Get Help"\n' + "             ng-cloak>\n" + "        <p>Do you want to contact support? Support will get in touch with you as soon as possible.</p>\n" + "    </bsmodal>\n" + "</section>\n" + "\n");
         $templateCache.put("groups/groups-activities.html", '<div class="content-page" ng-controller="GroupsActivitiesCtrl">\n' + "\n" + "  <br>\n" + "  <div>\n" + '    <table class="table table-striped">\n' + "      <tbody>\n" + '      <tr class="table-header">\n' + "        <td>Date</td>\n" + "        <td>Content</td>\n" + "        <td>Verb</td>\n" + "        <td>UUID</td>\n" + "      </tr>\n" + '      <tr class="zebraRows" ng-repeat="activity in selectedGroup.activities">\n' + "        <td>{{activity.createdDate}}</td>\n" + "        <td>{{activity.content}}</td>\n" + "        <td>{{activity.verb}}</td>\n" + "        <td>{{activity.uuid}}</td>\n" + "      </tr>\n" + "      </tbody>\n" + "    </table>\n" + "  </div>\n" + "\n" + "\n" + "</div>");
         $templateCache.put("groups/groups-details.html", '<div class="content-page" ng-controller="GroupsDetailsCtrl">\n' + "\n" + "  <div>\n" + '      <form name="updateGroupDetailForm" ng-submit="saveSelectedGroup()" novalidate>\n' + '          <div style="float: left; padding-right: 30px;">\n' + '              <h4 class="ui-dform-legend">Group Information</h4>\n' + '              <label for="group-title" class="ui-dform-label">Group Title</label>\n' + '              <input type="text" id="group-title" ng-pattern="titleRegex" ng-attr-title="{{titleRegexDescription}}" required class="ui-dform-text" ng-model="group.title" ug-validate>\n' + "              <br/>\n" + '            <label for="group-path" class="ui-dform-label">Group Path</label>\n' + '            <input type="text" id="group-path" required ng-attr-title="{{pathRegexDescription}}" placeholder="ex: /mydata" ng-pattern="pathRegex" class="ui-dform-text" ng-model="group.path" ug-validate>\n' + "            <br/>\n" + "     
      </div>\n" + '          <br style="clear:both"/>\n' + "\n" + '          <div style="width:100%;float:left;padding: 20px 0">\n' + '              <input type="submit" value="Save Group" style="margin-right: 15px;" ng-disabled="!updateGroupDetailForm.$valid" class="btn btn-primary" />\n' + "          </div>\n" + "\n" + '          <div class="content-container">\n' + "              <h4>JSON Group Object</h4>\n" + "              <pre>{{json}}</pre>\n" + "          </div>\n" + "      </form>\n" + "  </div>\n" + "\n" + "\n" + "</div>");
         $templateCache.put("groups/groups-members.html", '<div class="content-page" ng-controller="GroupsMembersCtrl">\n' + "\n" + "\n" + '  <bsmodal id="removeFromGroup"\n' + '           title="Confirmation"\n' + '           close="hideModal"\n' + '           closelabel="Cancel"\n' + '           extrabutton="removeUsersFromGroupDialog"\n' + '           extrabuttonlabel="Delete"\n' + "           ng-cloak>\n" + "    <p>Are you sure you want to remove the users from the seleted group(s)?</p>\n" + "  </bsmodal>\n" + "\n" + '  <bsmodal id="addGroupToUser"\n' + '           title="Add user to group"\n' + '           close="hideModal"\n' + '           closelabel="Cancel"\n' + '           extrabutton="addGroupToUserDialog"\n' + '           extrabuttonlabel="Add"\n' + "           ng-cloak>\n" + '    <div class="btn-group">\n' + '      <a class="btn dropdown-toggle filter-selector" data-toggle="dropdown">\n' + "        <span class=\"filter-label\">{{$parent.user != '' ? $parent.user.username 
 : 'Select a user...'}}</span>\n" + '        <span class="caret"></span>\n' + "      </a>\n" + '      <ul class="dropdown-menu">\n' + '        <li ng-repeat="user in $parent.usersTypeaheadValues" class="filterItem"><a ng-click="$parent.$parent.user = user">{{user.username}}</a></li>\n' + "      </ul>\n" + "    </div>\n" + "  </bsmodal>\n" + "\n" + "\n" + '  <div class="button-strip">\n' + '    <button class="btn btn-primary"  ng-click="showModal(\'addGroupToUser\')">Add User to Group</button>\n' + '    <button class="btn btn-primary" ng-disabled="!hasMembers || !valueSelected(groupsCollection.users._list)" ng-click="showModal(\'removeFromGroup\')">Remove User(s) from Group</button>\n' + "  </div>\n" + '  <table class="table table-striped">\n' + '    <tr class="table-header">\n' + '      <td style="width: 30px;"><input type="checkbox" ng-show="hasMembers" id="selectAllCheckbox" ng-model="groupMembersSelected" ng-click="selectAllEntities(groupsCollection.users._list,this,\'groupMembers
 Selected\')"></td>\n' + '      <td style="width: 50px;"></td>\n' + "      <td>Username</td>\n" + "      <td>Display Name</td>\n" + "    </tr>\n" + '    <tr class="zebraRows" ng-repeat="user in groupsCollection.users._list">\n' + "      <td>\n" + "        <input\n" + '          type="checkbox"\n' + '          ng-model="user.checked"\n' + "          >\n" + "      </td>\n" + '      <td><img style="width:30px;height:30px;" ng-src="{{user._portal_image_icon}}"></td>\n' + "      <td>{{user.get('username')}}</td>\n" + "      <td>{{user.get('name')}}</td>\n" + "    </tr>\n" + "  </table>\n" + '  <div style="padding: 10px 5px 10px 5px">\n' + '    <button class="btn btn-primary" ng-click="getPrevious()" style="display:{{previous_display}}">< Previous</button>\n' + '    <button class="btn btn-primary" ng-click="getNext()" style="display:{{next_display}}; float:right;">Next ></button>\n' + "  </div>\n" + "</div>");
@@ -4342,12 +4385,12 @@
         $templateCache.put("groups/groups.html", '<div class="content-page">\n' + "\n" + '  <page-title title=" Groups" icon="&#128101;"></page-title>\n' + '  <bsmodal id="newGroup"\n' + '           title="New Group"\n' + '           close="hideModal"\n' + '           closelabel="Cancel"\n' + '           extrabutton="newGroupDialog"\n' + '           extrabuttonlabel="Add"\n' + '           ng-model="dialog"\n' + "           ng-cloak>\n" + "    <fieldset>\n" + '      <div class="control-group">\n' + '        <label for="title">Title</label>\n' + '        <div class="controls">\n' + '          <input type="text" id="title" ng-pattern="titleRegex" ng-attr-title="{{titleRegexDescription}}" required ng-model="newGroup.title"class="input-xlarge" ug-validate/>\n' + "        </div>\n" + "      </div>\n" + '      <div class="control-group">\n' + '        <label for="path">Path</label>\n' + '        <div class="controls">\n' + '          <input id="path" type="text" ng-attr-title="{{pathRegexD
 escription}}" placeholder="ex: /mydata" ng-pattern="pathRegex" required ng-model="newGroup.path" class="input-xlarge" ug-validate/>\n' + "        </div>\n" + "      </div>\n" + "    </fieldset>\n" + "  </bsmodal>\n" + "\n" + '  <bsmodal id="deleteGroup"\n' + '           title="Delete Group"\n' + '           close="hideModal"\n' + '           closelabel="Cancel"\n' + '           extrabutton="deleteGroupsDialog"\n' + '           extrabuttonlabel="Delete"\n' + "           ng-cloak>\n" + "    <p>Are you sure you want to delete the group(s)?</p>\n" + "  </bsmodal>\n" + "\n" + "\n" + '  <section class="row-fluid">\n' + '    <div class="span3 user-col">\n' + "\n" + '      <div class="button-toolbar span12">\n' + '        <a title="Select All" class="btn btn-primary select-all toolbar" ng-show="hasGroups" ng-click="selectAllEntities(groupsCollection._list,this,\'groupBoxesSelected\',true)"> <i class="pictogram">&#8863;</i></a>\n' + '        <button title="Delete" class="btn btn-primary tool
 bar" ng-disabled="!hasGroups || !valueSelected(groupsCollection._list)" ng-click="showModal(\'deleteGroup\')"><i class="pictogram">&#9749;</i></button>\n' + '        <button title="Add" class="btn btn-primary toolbar" ng-click="showModal(\'newGroup\')"><i class="pictogram">&#59136;</i></button>\n' + "      </div>\n" + '      <ul class="user-list">\n' + '        <li ng-class="selectedGroup._data.uuid === group._data.uuid ? \'selected\' : \'\'" ng-repeat="group in groupsCollection._list" ng-click="selectGroup(group._data.uuid)">\n' + "          <input\n" + '              type="checkbox"\n' + '              ng-value="group._data.uuid"\n' + '              ng-checked="group.checked"\n' + '              ng-model="group.checked"\n' + "              >\n" + "          <a href=\"javaScript:void(0)\" >{{group.get('title')}}</a>\n" + "          <br/>\n" + "          <span ng-if=\"group.get('path')\" class=\"label\">Path:</span>/{{group.get('path')}}\n" + "        </li>\n" + "      </ul>\n" + "\
 n" + "\n" + '      <div style="padding: 10px 5px 10px 5px">\n' + '        <button class="btn btn-primary" ng-click="getPrevious()" style="display:{{previous_display}}">< Previous</button>\n' + '        <button class="btn btn-primary" ng-click="getNext()" style="display:{{next_display}}; float:right;">Next ></button>\n' + "      </div>\n" + "\n" + "    </div>\n" + "\n" + '    <div class="span9 tab-content" ng-show="selectedGroup.get" >\n' + '      <div class="menu-toolbar">\n' + '        <ul class="inline" >\n' + '          <li class="tab" ng-class="currentGroupsPage.route === \'/groups/details\' ? \'selected\' : \'\'"><a class="btn btn-primary toolbar" ng-click="selectGroupPage(\'/groups/details\')"><i class="pictogram">&#59170;</i>Details</a></li>\n' + '          <li class="tab" ng-class="currentGroupsPage.route === \'/groups/members\' ? \'selected\' : \'\'"><a class="btn btn-primary toolbar" ng-click="selectGroupPage(\'/groups/members\')"><i class="pictogram">&#128101;</i>Users</a
 ></li>\n' + '          <li class="tab" ng-class="currentGroupsPage.route === \'/groups/activities\' ? \'selected\' : \'\'"><a class="btn btn-primary toolbar" ng-click="selectGroupPage(\'/groups/activities\')"><i class="pictogram">&#59194;</i>Activities</a></li>\n' + '          <li class="tab" ng-class="currentGroupsPage.route === \'/groups/roles\' ? \'selected\' : \'\'"><a class="btn btn-primary toolbar" ng-click="selectGroupPage(\'/groups/roles\')"><i class="pictogram">&#127758;</i>Roles &amp; Permissions</a></li>\n' + "        </ul>\n" + "      </div>\n" + '      <span ng-include="currentGroupsPage.template"></span>\n' + "\n" + "  </section>\n" + "</div>\n");
         $templateCache.put("login/forgot-password.html", '<div class="login-content" ng-controller="ForgotPasswordCtrl">\n' + '	<iframe class="container" ng-src="{{forgotPWiframeURL}}" id="forgot-password-frame" border="0" style="border:0;width:600px;height:620px;">\n' + '	<p>Email Address: <input id="resetPasswordEmail" name="resetPasswordEmail" /></p>\n' + '	<button class="btn btn-primary" ng-click="">Reset Password</button>\n' + "</div>\n");
         $templateCache.put("login/loading.html", "\n" + "\n" + "<h1>Loading...</h1>");
-        $templateCache.put("login/login.html", '<div class="login-content">\r' + "\n" + '  <bsmodal id="sendActivationLink"\r' + "\n" + '           title="Resend Activation Link"\r' + "\n" + '           close="hideModal"\r' + "\n" + '           closelabel="Cancel"\r' + "\n" + '           extrabutton="resendActivationLink"\r' + "\n" + '           extrabuttonlabel="Send Activation"\r' + "\n" + "           ng-cloak>\r" + "\n" + "    <fieldset>\r" + "\n" + '      <p>Email to send to: <input type="email" required ng-model="$parent.activation.id" ng-pattern="emailRegex" ng-attr-title="{{emailRegexDescription}}" name="activationId" id="user-activationId" class="input-xlarge"/></p>\r' + "\n" + "    </fieldset>\r" + "\n" + "  </bsmodal>\r" + "\n" + '  <div class="login-holder">\r' + "\n" + '  <form name="loginForm" id="login-form"  ng-submit="login()" class="form-horizontal" novalidate>\r' + "\n" + '    <h1 class="title">Enter your credentials</h1>\r' + "\n" + '    <div class="alert-error" n
 g-if="loginMessage">{{loginMessage}}</div>\r' + "\n" + '    <div class="control-group">\r' + "\n" + '      <label class="control-label" for="login-username">Email or Username:</label>\r' + "\n" + '      <div class="controls">\r' + "\n" + '        <input type="text" ng-model="login.username"  title="Please add a username or email."  class="" id="login-username" required ng-value="login.username" size="20" ug-validate>\r' + "\n" + "      </div>\r" + "\n" + "    </div>\r" + "\n" + '    <div class="control-group">\r' + "\n" + '      <label class="control-label" for="login-password">Password:</label>\r' + "\n" + '      <div class="controls">\r' + "\n" + '        <input type="password" ng-model="login.password"  required id="login-password" class="" ng-value="login.password" size="20" ug-validate>\r' + "\n" + "      </div>\r" + "\n" + "    </div>\r" + "\n" + '    <div class="form-actions">\r' + "\n" + '      <div class="submit">\r' + "\n" + '        <input type="submit" name="button-login
 " id="button-login" ng-disabled="!loginForm.$valid || loading" value="{{loading ? loadingText : \'Log In\'}}" class="btn btn-primary pull-right">\r' + "\n" + "      </div>\r" + "\n" + "    </div>\r" + "\n" + "  </form>\r" + "\n" + "  </div>\r" + "\n" + '  <div class="extra-actions">\r' + "\n" + '    <div class="submit">\r' + "\n" + '      <a ng-click="gotoSignUp()"   name="button-signUp" id="button-signUp" value="Sign Up"\r' + "\n" + '         class="btn btn-primary pull-left">Register</a>\r' + "\n" + "    </div>\r" + "\n" + '    <div class="submit">\r' + "\n" + '      <a ng-click="gotoForgotPasswordPage()" name="button-forgot-password" id="button-forgot-password"\r' + "\n" + '         value="" class="btn btn-primary pull-left">Forgot Password?</a>\r' + "\n" + "    </div>\r" + "\n" + '    <a ng-click="showModal(\'sendActivationLink\')"  name="button-resend-activation" id="button-resend-activation"\r' + "\n" + '       value="" class="btn btn-primary pull-left">Resend Activation Link<
 /a>\r' + "\n" + "  </div>\r" + "\n" + "</div>\r" + "\n");
+        $templateCache.put("login/login.html", '<div class="login-content">\r' + "\n" + '  <bsmodal id="sendActivationLink"\r' + "\n" + '           title="Resend Activation Link"\r' + "\n" + '           close="hideModal"\r' + "\n" + '           closelabel="Cancel"\r' + "\n" + '           extrabutton="resendActivationLink"\r' + "\n" + '           extrabuttonlabel="Send Activation"\r' + "\n" + "           ng-cloak>\r" + "\n" + "    <fieldset>\r" + "\n" + '      <p>Email to send to: <input type="email" required ng-model="$parent.activation.id" ng-pattern="emailRegex" ng-attr-title="{{emailRegexDescription}}" name="activationId" id="user-activationId" class="input-xlarge"/></p>\r' + "\n" + "    </fieldset>\r" + "\n" + "  </bsmodal>\r" + "\n" + '  <div class="login-holder">\r' + "\n" + '  <form name="loginForm" id="login-form"  ng-submit="login()" class="form-horizontal" novalidate>\r' + "\n" + '    <h1 class="title">Enter your credentials</h1>\r' + "\n" + '    <div class="alert-error" n
 g-if="loginMessage">{{loginMessage}}</div>\r' + "\n" + '    <div class="control-group">\r' + "\n" + '      <label class="control-label" for="login-username">Email or Username:</label>\r' + "\n" + '      <div class="controls">\r' + "\n" + '        <input type="text" ng-model="login.username"  title="Please add a username or email."  class="" id="login-username" required ng-value="login.username" size="20" ug-validate>\r' + "\n" + "      </div>\r" + "\n" + "    </div>\r" + "\n" + '    <div class="control-group">\r' + "\n" + '      <label class="control-label" for="login-password">Password:</label>\r' + "\n" + '      <div class="controls">\r' + "\n" + '        <input type="password" ng-model="login.password"  required id="login-password" class="" ng-value="login.password" size="20" ug-validate>\r' + "\n" + "      </div>\r" + "\n" + "    </div>\r" + "\n" + '    <div class="control-group" ng-show="requiresDeveloperKey">\r' + "\n" + '      <label class="control-label" for="login-developer
 key">Developer Key:</label>\r' + "\n" + '      <div class="controls">\r' + "\n" + '        <input type="text" ng-model="login.developerkey" id="login-developerkey" class="" ng-value="login.developerkey" size="20" ug-validate>\r' + "\n" + "      </div>\r" + "\n" + "    </div>\r" + "\n" + '    <div class="form-actions">\r' + "\n" + '      <div class="submit">\r' + "\n" + '        <input type="submit" name="button-login" id="button-login" ng-disabled="!loginForm.$valid || loading" value="{{loading ? loadingText : \'Log In\'}}" class="btn btn-primary pull-right">\r' + "\n" + "      </div>\r" + "\n" + "    </div>\r" + "\n" + "  </form>\r" + "\n" + "  </div>\r" + "\n" + '  <div class="extra-actions">\r' + "\n" + '    <div class="submit">\r' + "\n" + '      <a ng-click="gotoSignUp()"   name="button-signUp" id="button-signUp" value="Sign Up"\r' + "\n" + '         class="btn btn-primary pull-left">Register</a>\r' + "\n" + "    </div>\r" + "\n" + '    <div class="submit">\r' + "\n" + '      <
 a ng-click="gotoForgotPasswordPage()" name="button-forgot-password" id="button-forgot-password"\r' + "\n" + '         value="" class="btn btn-primary pull-left">Forgot Password?</a>\r' + "\n" + "    </div>\r" + "\n" + '    <a ng-click="showModal(\'sendActivationLink\')"  name="button-resend-activation" id="button-resend-activation"\r' + "\n" + '       value="" class="btn btn-primary pull-left">Resend Activation Link</a>\r' + "\n" + "  </div>\r" + "\n" + "</div>\r" + "\n");
         $templateCache.put("login/logout.html", '<div id="logut">Logging out...</div>');
         $templateCache.put("login/register.html", '<div class="signUp-content">\n' + '  <div class="signUp-holder">\n' + '    <form name="signUpform" id="signUp-form" ng-submit="register()" class="form-horizontal" ng-show="!signUpSuccess" novalidate>\n' + '      <h1 class="title">Register</h1>\n' + "\n" + '      <div class="alert" ng-if="loginMessage">{{loginMessage}}</div>\n' + '      <div class="control-group">\n' + '        <label class="control-label" for="register-orgName">Organization:</label>\n' + "\n" + '        <div class="controls">\n' + '          <input type="text" ng-model="registeredUser.orgName" id="register-orgName" ng-pattern="appNameRegex" ng-attr-title="{{appNameRegexDescription}}" ug-validate  required class="" size="20">\n' + "        </div>\n" + "      </div>\n" + "\n" + '      <div class="control-group">\n' + '        <label class="control-label" for="register-name">Name:</label>\n' + "\n" + '        <div class="controls">\n' + '          <input type="text" ng
 -model="registeredUser.name" id="register-name" ng-pattern="nameRegex" ng-attr-title="{{nameRegexDescription}}" ug-validate required class="" size="20">\n' + "        </div>\n" + "      </div>\n" + "\n" + '      <div class="control-group">\n' + '        <label class="control-label" for="register-userName">Username:</label>\n' + "\n" + '        <div class="controls">\n' + '          <input type="text" ng-model="registeredUser.userName" id="register-userName" ng-pattern="usernameRegex" ng-attr-title="{{usernameRegexDescription}}" ug-validate required class="" size="20">\n' + "        </div>\n" + "      </div>\n" + "\n" + '      <div class="control-group">\n' + '        <label class="control-label" for="register-email">Email:</label>\n' + "\n" + '        <div class="controls">\n' + '          <input type="email" ng-model="registeredUser.email" id="register-email"  ng-pattern="emailRegex" ng-attr-title="{{emailRegexDescription}}"  required class="" ug-validate size="20">\n' + "        <
 /div>\n" + "      </div>\n" + "\n" + "\n" + '      <div class="control-group">\n' + '        <label class="control-label" for="register-password">Password:</label>\n' + "\n" + '        <div class="controls">\n' + '          <input type="password" ng-pattern="passwordRegex" ng-attr-title="{{passwordRegexDescription}}" ug-validate ng-model="registeredUser.password" id="register-password" required class=""\n' + '                 size="20">\n' + "        </div>\n" + "      </div>\n" + '      <div class="control-group">\n' + '        <label class="control-label" for="register-confirmPassword">Re-enter Password:</label>\n' + "\n" + '        <div class="controls">\n' + '          <input type="password" ng-model="registeredUser.confirmPassword" required id="register-confirmPassword" ug-validate class="" size="20">\n' + "        </div>\n" + "      </div>\n" + '      <div class="form-actions">\n' + '        <div class="submit">\n' + '          <input type="submit" name="button-login" ng-disab
 led="!signUpform.$valid" id="button-login" value="Register"\n' + '                 class="btn btn-primary pull-right">\n' + "        </div>\n" + '        <div class="submit">\n' + '          <a ng-click="cancel()" type="submit" name="button-cancel" id="button-cancel"\n' + '             class="btn btn-primary pull-right">Cancel</a>\n' + "        </div>\n" + "      </div>\n" + "    </form>\n" + '    <div class="console-section well thingy" ng-show="signUpSuccess">\n' + '      <span class="title">We\'re holding a seat for you!</span>\n' + "      <br><br>\n" + "\n" + "      <p>Thanks for signing up for a spot on our private beta. We will send you an email as soon as we're ready for\n" + "        you!</p>\n" + "\n" + "      <p>In the mean time, you can stay up to date with App Services on our <a\n" + '          href="https://groups.google.com/forum/?fromgroups#!forum/usergrid">GoogleGroup</a>.</p>\n' + "\n" + '      <p> <a href="#!/login">Back to login</a></p>\n' + "    </div>\n" + "  </
 div>\n" + "\n" + "</div>\n");
-        $templateCache.put("menus/appMenu.html", '<ul id="app-menu" class="nav top-nav span12">\n' + '    <li class="span7">\n' + '      <bsmodal id="newApplication"\n' + '               title="Create New Application"\n' + '               close="hideModal"\n' + '               closelabel="Cancel"\n' + '               extrabutton="newApplicationDialog"\n' + '               extrabuttonlabel="Create"\n' + '               buttonid="app"\n' + "               ng-cloak>\n" + '        <div ng-show="!hasApplications" class="modal-instructions" >You have no applications, please create one.</div>\n' + '        <div  ng-show="hasCreateApplicationError" class="alert-error">Application already exists!</div>\n' + '        <p>New application name: <input ng-model="$parent.newApp.name" id="app-name-input" ng-pattern="appNameRegex"  ng-attr-title="{{appNameRegexDescription}}" type="text" required ug-validate /></p>\n' + "      </bsmodal>\n" + '        <div class="btn-group">\n' + '            <a clas
 s="btn dropdown-toggle top-selector app-selector" id="current-app-selector" data-toggle="dropdown">\n' + '                <i class="pictogram">&#9881;</i> {{myApp.currentApp}}\n' + '                <span class="caret"></span>\n' + "            </a>\n" + '            <ul class="dropdown-menu app-nav">\n' + '                <li name="app-selector" ng-repeat="app in applications">\n' + '                    <a id="app-{{app.name}}-link-id" ng-click="appChange(app.name)">{{app.name}}</a>\n' + "                </li>\n" + "            </ul>\n" + "        </div>\n" + "    </li>\n" + '    <li class="span5">\n' + '      <a ng-if="activeUI"\n' + '         class="btn btn-create zero-out pull-right"\n' + '         ng-disabled="!addApplications"\n' + "         ng-click=\"addApplications ? showModal('newApplication') : ''\"\n" + '         analytics-on="click"\n' + '         analytics-category="App Services"\n' + '         analytics-label="Button"\n' + '         analytics-event="Add New App"\n' + "
         >\n" + "        <i class=\"pictogram\">{{addApplications ? '&#8862;' : '&#10060;'}}</i>\n" + "        {{!addApplications ? '10 app limit.' : 'Add New App'}}\n" + "      </a>\n" + "    </li>\n" + "</ul>");
+        $templateCache.put("menus/appMenu.html", '<ul id="app-menu" class="nav top-nav span12">\n' + '    <li class="span7">\n' + '      <bsmodal id="newApplication"\n' + '               title="Create New Application"\n' + '               close="hideModal"\n' + '               closelabel="Cancel"\n' + '               extrabutton="newApplicationDialog"\n' + '               extrabuttonlabel="Create"\n' + '               buttonid="app"\n' + "               ng-cloak>\n" + '        <div ng-show="!hasApplications" class="modal-instructions" >You have no applications, please create one.</div>\n' + '        <div  ng-show="hasCreateApplicationError" class="alert-error">Application already exists!</div>\n' + '        <p>New application name: <input ng-model="$parent.newApp.name" id="app-name-input" ng-pattern="appNameRegex"  ng-attr-title="{{appNameRegexDescription}}" type="text" required ug-validate /></p>\n' + "      </bsmodal>\n" + '        <div class="btn-group">\n' + '            <a clas
 s="btn dropdown-toggle top-selector app-selector" id="current-app-selector" data-toggle="dropdown">\n' + '                <i class="pictogram">&#9881;</i> {{myApp.currentApp}}\n' + '                <span class="caret"></span>\n' + "            </a>\n" + '            <ul class="dropdown-menu app-nav">\n' + '                <li name="app-selector" ng-repeat="app in applications">\n' + '                    <a id="app-{{app.name}}-link-id" ng-click="appChange(app.name)">{{app.name}}</a>\n' + "                </li>\n" + "            </ul>\n" + "        </div>\n" + "    </li>\n" + '    <li class="span5">\n' + '      <a ng-if="activeUI"\n' + '         class="btn btn-create zero-out pull-right"\n' + "         ng-click=\"showModal('newApplication')\"\n" + '         analytics-on="click"\n' + '         analytics-category="App Services"\n' + '         analytics-label="Button"\n' + '         analytics-event="Add New App"\n' + "        >\n" + '        <i class="pictogram">&#8862;</i>\n' + "      
   Add New App\n" + "      </a>\n" + "    </li>\n" + "</ul>");
         $templateCache.put("menus/orgMenu.html", '<ul class="nav top-nav org-nav">\n' + "  <li>\n" + '<div class="btn-group ">\n' + '    <a class="btn dropdown-toggle top-selector org-selector" id="current-org-selector" data-toggle="dropdown">\n' + '        <i class="pictogram">&#128193</i> {{currentOrg}}<span class="caret"></span>\n' + "        </a>\n" + '    <ul class="dropdown-menu org-nav">\n' + '          <li name="org-selector" ng-repeat="(k,v) in organizations">\n' + '              <a id="org-{{v.name}}-selector" class="org-overview" ng-click="orgChange(v.name)"> {{v.name}}</a>\n' + "            </li>\n" + "         </ul>\n" + "    </div>\n" + "  </li></ul>");
-        $templateCache.put("org-overview/org-overview.html", '<div class="org-overview-content" ng-show="activeUI">\n' + "\n" + '  <page-title title=" Org Administration" icon="&#128362;"></page-title>\n' + "\n" + '  <section class="row-fluid">\n' + "\n" + '  <div class="span6">\n' + "\n" + '    <h2 class="title">Current Organization </h2>\n' + '    <table class="table table-striped">\n' + "      <tr>\n" + '        <td id="org-overview-name">{{currentOrganization.name}}</td>\n' + '        <td style="text-align: right">{{currentOrganization.uuid}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + '    <bsmodal id="newApplication"\n' + '             title="Create New Application"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="newApplicationDialog"\n' + '             extrabuttonlabel="Create"\n' + "             ng-cloak>\n" + '      <p>New application name: <input ng-model="$parent.newApp.name"  ug-validate required type=
 "text" ng-pattern="appNameRegex" ng-attr-title="{{appNameRegexDescription}}" /></p>\n' + "    </bsmodal>\n" + "\n" + '    <h2 class="title" > Applications\n' + '      <div class="header-button btn-group pull-right">\n' + "        <a class=\"btn filter-selector\" style=\"{{applicationsSize === 10 ? 'width:290px':''}}\"  ng-disabled=\"!addApplications\" ng-click=\"(addApplications ? showModal('newApplication') : '')\">\n" + "          <span class=\"filter-label\">{{!addApplications ? 'You have met your 10 app limit' : 'Add New App'}}</span>\n" + "        </a>\n" + "      </div>\n" + "    </h2>\n" + "\n" + '    <table class="table table-striped">\n' + '      <tr ng-repeat="application in applications">\n' + "        <td>{{application.name}}</td>\n" + '        <td style="text-align: right">{{application.uuid}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + '    <bsmodal id="regenerateCredentials"\n' + '             title="Confirmation"\n' + '             close="hideModal"\n' + ' 
             closelabel="Cancel"\n' + '             extrabutton="regenerateCredentialsDialog"\n' + '             extrabuttonlabel="Yes"\n' + "             ng-cloak>\n" + "      Are you sure you want to regenerate the credentials?\n" + "    </bsmodal>\n" + "\n" + '    <h2 class="title" >Organization API Credentials\n' + '      <div class="header-button btn-group pull-right">\n' + '        <a class="btn filter-selector" ng-click="showModal(\'regenerateCredentials\')">\n' + '          <span class="filter-label">Regenerate Org Credentials</span>\n' + "        </a>\n" + "      </div>\n" + "    </h2>\n" + "\n" + '    <table class="table table-striped">\n' + "      <tr>\n" + "        <td >Client ID</td>\n" + '        <td style="text-align: right" >{{orgAPICredentials.client_id}}</td>\n' + "      </tr>\n" + "      <tr>\n" + "        <td>Client Secret</td>\n" + '        <td style="text-align: right">{{orgAPICredentials.client_secret}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + '   
  <bsmodal id="newAdministrator"\n' + '             title="Create New Administrator"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="newAdministratorDialog"\n' + '             extrabuttonlabel="Create"\n' + "             ng-cloak>\n" + '      <p>New administrator email: <input id="newAdminInput" ug-validate ng-model="$parent.admin.email" pattern="emailRegex" ng-attr-title="{{emailRegexDescription}}" required type="email" /></p>\n' + "    </bsmodal>\n" + "\n" + '    <h2 class="title" >Organization Administrators\n' + '      <div class="header-button btn-group pull-right">\n' + '        <a class="btn filter-selector" ng-click="showModal(\'newAdministrator\')">\n' + '          <span class="filter-label">Add New Administrator</span>\n' + "        </a>\n" + "      </div>\n" + "    </h2>\n" + "\n" + '    <table class="table table-striped">\n' + '      <tr ng-repeat="administrator in orgAdministrators">\n' + '        <td><img style
 ="width:30px;height:30px;" ng-src="{{administrator.image}}"> {{administrator.name}}</td>\n' + '        <td style="text-align: right">{{administrator.email}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + "\n" + "  </div>\n" + "\n" + '  <div class="span6">\n' + "\n" + '    <h2 class="title">Activities </h2>\n' + '    <table class="table table-striped">\n' + '      <tr ng-repeat="activity in activities">\n' + "        <td>{{activity.title}}</td>\n" + '        <td style="text-align: right">{{activity.date}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + "  </div>\n" + "\n" + "\n" + "  </section>\n" + "</div>");
+        $templateCache.put("org-overview/org-overview.html", '<div class="org-overview-content" ng-show="activeUI">\n' + "\n" + '  <page-title title=" Org Administration" icon="&#128362;"></page-title>\n' + "\n" + '  <section class="row-fluid">\n' + "\n" + '  <div class="span6">\n' + "\n" + '    <h2 class="title">Current Organization </h2>\n' + '    <table class="table table-striped">\n' + "      <tr>\n" + '        <td id="org-overview-name">{{currentOrganization.name}}</td>\n' + '        <td style="text-align: right">{{currentOrganization.uuid}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + '    <bsmodal id="newApplication"\n' + '             title="Create New Application"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="newApplicationDialog"\n' + '             extrabuttonlabel="Create"\n' + "             ng-cloak>\n" + '      <p>New application name: <input ng-model="$parent.newApp.name"  ug-validate required type=
 "text" ng-pattern="appNameRegex" ng-attr-title="{{appNameRegexDescription}}" /></p>\n' + "    </bsmodal>\n" + "\n" + '    <h2 class="title" > Applications\n' + '      <div class="header-button btn-group pull-right">\n' + "        <a class=\"btn filter-selector\" style=\"{{applicationsSize === 10 ? 'width:290px':''}}\"  ng-click=\"showModal('newApplication')\">\n" + '          <span class="filter-label">Add New App</span>\n' + "        </a>\n" + "      </div>\n" + "    </h2>\n" + "\n" + '    <table class="table table-striped">\n' + '      <tr ng-repeat="application in applications">\n' + "        <td>{{application.name}}</td>\n" + '        <td style="text-align: right">{{application.uuid}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + '    <bsmodal id="regenerateCredentials"\n' + '             title="Confirmation"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="regenerateCredentialsDialog"\n' + '             extrabut
 tonlabel="Yes"\n' + "             ng-cloak>\n" + "      Are you sure you want to regenerate the credentials?\n" + "    </bsmodal>\n" + "\n" + '    <h2 class="title" >Organization API Credentials\n' + '      <div class="header-button btn-group pull-right">\n' + '        <a class="btn filter-selector" ng-click="showModal(\'regenerateCredentials\')">\n' + '          <span class="filter-label">Regenerate Org Credentials</span>\n' + "        </a>\n" + "      </div>\n" + "    </h2>\n" + "\n" + '    <table class="table table-striped">\n' + "      <tr>\n" + "        <td >Client ID</td>\n" + '        <td style="text-align: right" >{{orgAPICredentials.client_id}}</td>\n' + "      </tr>\n" + "      <tr>\n" + "        <td>Client Secret</td>\n" + '        <td style="text-align: right">{{orgAPICredentials.client_secret}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + '    <bsmodal id="newAdministrator"\n' + '             title="Create New Administrator"\n' + '             close="hideModal"
 \n' + '             closelabel="Cancel"\n' + '             extrabutton="newAdministratorDialog"\n' + '             extrabuttonlabel="Create"\n' + "             ng-cloak>\n" + '      <p>New administrator email: <input id="newAdminInput" ug-validate ng-model="$parent.admin.email" pattern="emailRegex" ng-attr-title="{{emailRegexDescription}}" required type="email" /></p>\n' + "    </bsmodal>\n" + "\n" + '    <h2 class="title" >Organization Administrators\n' + '      <div class="header-button btn-group pull-right">\n' + '        <a class="btn filter-selector" ng-click="showModal(\'newAdministrator\')">\n' + '          <span class="filter-label">Add New Administrator</span>\n' + "        </a>\n" + "      </div>\n" + "    </h2>\n" + "\n" + '    <table class="table table-striped">\n' + '      <tr ng-repeat="administrator in orgAdministrators">\n' + '        <td><img style="width:30px;height:30px;" ng-src="{{administrator.image}}"> {{administrator.name}}</td>\n' + '        <td style="text-a
 lign: right">{{administrator.email}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + "\n" + "  </div>\n" + "\n" + '  <div class="span6">\n' + "\n" + '    <h2 class="title">Activities </h2>\n' + '    <table class="table table-striped">\n' + '      <tr ng-repeat="activity in activities">\n' + "        <td>{{activity.title}}</td>\n" + '        <td style="text-align: right">{{activity.date}}</td>\n' + "      </tr>\n" + "    </table>\n" + "\n" + "  </div>\n" + "\n" + "\n" + "  </section>\n" + "</div>");
         $templateCache.put("profile/account.html", '<page-title title=" Account Settings" icon="&#59170"></page-title>\n' + "\n" + '<section class="row-fluid">\n' + '  <div class="span12 tab-content">\n' + '    <div class="menu-toolbar">\n' + '      <ul class="inline">\n' + '        <li class="tab" ng-show="!use_sso" ng-class="currentAccountPage.route === \'/profile/profile\' ? \'selected\' : \'\'"><a class="btn btn-primary toolbar" id="profile-link" ng-click="selectAccountPage(\'/profile/profile\')"><i class="pictogram">&#59170;</i>Profile</a></li>\n' + '        <li class="tab" ng-class="currentAccountPage.route === \'/profile/organizations\' ? \'selected\' : \'\'"><a class="btn btn-primary toolbar" id="account-link" ng-click="selectAccountPage(\'/profile/organizations\')"><i class="pictogram">&#128101;</i>Organizations</a></li>\n' + "      </ul>\n" + "    </div>\n" + '    <span ng-include="currentAccountPage.template"></span>\n' + "  </div>\n" + "</section>");
         $templateCache.put("profile/organizations.html", '<div class="content-page"   ng-controller="OrgCtrl">\n' + "\n" + "\n" + "\n" + '  <bsmodal id="newOrganization"\n' + '           title="Create New Organization"\n' + '           close="hideModal"\n' + '           closelabel="Cancel"\n' + '           extrabutton="addOrganization"\n' + '           extrabuttonlabel="Create"\n' + "           ng-cloak>\n" + "    <fieldset>\n" + "\n" + '      <div class="control-group">\n' + '        <label for="new-user-orgname">Organization Name</label>\n' + "\n" + '        <div class="controls">\n' + '          <input type="text" required title="Name" ug-validate ng-pattern="nameRegex" ng-attr-title="{{nameRegexDescription}}" ng-model="$parent.org.name" name="name" id="new-user-orgname" class="input-xlarge"/>\n' + "\n" + '          <p class="help-block hide"></p>\n' + "        </div>\n" + "      </div>\n" + "\n" + "    </fieldset>\n" + "  </bsmodal>\n" + "\n" + "\n" + '      <div class="row-flui
 d" >\n' + '      <div class="span3 user-col ">\n' + "\n" + '        <div class="button-toolbar span12">\n' + "\n" + '          <button class="btn btn-primary toolbar" ng-click="showModal(\'newOrganization\')" ng-show="true"><i class="pictogram">&#59136;</i>\n' + "          </button>\n" + "        </div>\n" + '        <ul class="user-list">\n' + "          <li ng-class=\"selectedOrg.uuid === org.uuid ? 'selected' : ''\"\n" + '              ng-repeat="org in orgs" ng-click=" selectOrganization(org)">\n' + "\n" + '            <a href="javaScript:void(0)">{{org.name}}</a>\n' + "          </li>\n" + "        </ul>\n" + "      </div>\n" + '      <div class="span9">\n' + '        <div class="row-fluid" >\n' + "          <h4>Organization Information</h4>\n" + '          <div class="span11" ng-show="selectedOrg">\n' + '            <label  class="ui-dform-label">Applications</label>\n' + '            <table class="table table-striped">\n' + '              <tr ng-repeat="app in selectedOrg.app
 licationsArray">\n' + "                <td> {{app.name}}</td>\n" + '                <td style="text-align: right">{{app.uuid}}</td>\n' + "              </tr>\n" + "            </table>\n" + "            <br/>\n" + '            <label  class="ui-dform-label">Users</label>\n' + '            <table class="table table-striped">\n' + '              <tr ng-repeat="user in selectedOrg.usersArray">\n' + "                <td> {{user.name}}</td>\n" + '                <td style="text-align: right">{{user.email}}</td>\n' + "              </tr>\n" + "            </table>\n" + '            <form ng-submit="leaveOrganization(selectedOrg)">\n' + '              <input type="submit" name="button-leave-org" id="button-leave-org" title="Can only leave if organization has more than 1 user." ng-disabled="!doesOrgHaveUsers(selectedOrg)" value="Leave Organization" class="btn btn-primary pull-right">\n' + "            </form>\n" + "          </div>\n" + "        </div>\n" + "\n" + "      </div>\n" + "      
   </div>\n" + "</div>");
         $templateCache.put("profile/profile.html", '<div class="content-page" ng-controller="ProfileCtrl">\n' + "\n" + '  <div id="account-panels">\n' + '    <div class="panel-content">\n' + '      <div class="console-section">\n' + '        <div class="console-section-contents">\n' + '          <form name="updateAccountForm" id="update-account-form" ng-submit="saveUserInfo()" class="form-horizontal">\n' + "            <fieldset>\n" + '              <div class="control-group">\n' + '                <label id="update-account-id-label" class="control-label" for="update-account-id">UUID</label>\n' + '                <div class="controls">\n' + '                  <span id="update-account-id" class="monospace">{{user.uuid}}</span>\n' + "                </div>\n" + "              </div>\n" + '              <div class="control-group">\n' + '                <label class="control-label" for="update-account-username">Username </label>\n' + '                <div class="controls">\n' + '       
            <input type="text" ug-validate name="update-account-username" required ng-pattern="usernameRegex" id="update-account-username" ng-attr-title="{{usernameRegexDescription}}"  class="span4" ng-model="user.username" size="20"/>\n' + "                </div>\n" + "              </div>\n" + '              <div class="control-group">\n' + '                <label class="control-label" for="update-account-name">Name </label>\n' + '                <div class="controls">\n' + '                  <input type="text" ug-validate name="update-account-name" id="update-account-name" ng-pattern="nameRegex" ng-attr-title="{{nameRegexDescription}}" class="span4" ng-model="user.name" size="20"/>\n' + "                </div>\n" + "              </div>\n" + '              <div class="control-group">\n' + '                <label class="control-label" for="update-account-email"> Email</label>\n' + '                <div class="controls">\n' + '                  <input type="email" ug-validate requir
 ed name="update-account-email" ng-pattern="emailRegex" ng-attr-title="{{emailRegexDescription}}"  id="update-account-email" class="span4" ng-model="user.email" size="20"/>\n' + "                </div>\n" + "              </div>\n" + '              <div class="control-group">\n' + '                <label class="control-label" for="update-account-picture-img">Picture <br />(from <a href="http://gravatar.com">gravatar.com</a>) </label>\n' + '                <div class="controls">\n' + '                  <img id="update-account-picture-img" ng-src="{{user.profileImg}}" width="50" />\n' + "                </div>\n" + "              </div>\n" + '              <span class="help-block">Leave blank any of the following to keep the current password unchanged</span>\n' + "              <br />\n" + '              <div class="control-group">\n' + '                <label class="control-label" for="old-account-password">Old Password</label>\n' + '                <div class="controls">\n' + '      
             <input type="password" ug-validate name="old-account-password"  id="old-account-password" class="span4" ng-model="user.oldPassword" size="20"/>\n' + "                </div>\n" + "              </div>\n" + '              <div class="control-group">\n' + '                <label class="control-label" for="update-account-password">New Password</label>\n' + '                <div class="controls">\n' + '                  <input type="password"  ug-validate name="update-account-password" ng-pattern="passwordRegex" ng-attr-title="{{passwordRegexDescription}}" id="update-account-password" class="span4" ng-model="user.newPassword" size="20"/>\n' + "                </div>\n" + "              </div>\n" + '              <div class="control-group" style="display:none">\n' + '                <label class="control-label" for="update-account-password-repeat">Confirm New Password</label>\n' + '                <div class="controls">\n' + '                  <input type="password" ug-validat
 e name="update-account-password-repeat" ng-pattern="passwordRegex" ng-attr-title="{{passwordRegexDescription}}" id="update-account-password-repeat" class="span4" ng-model="user.newPasswordConfirm" size="20"/>\n' + "                </div>\n" + "              </div>\n" + "            </fieldset>\n" + '            <div class="form-actions">\n' + '              <input type="submit"  class="btn btn-primary"  name="button-update-account" ng-disabled="!updateAccountForm.$valid || loading" id="button-update-account" value="{{loading ? loadingText : \'Update\'}}"  class="btn btn-usergrid"/>\n' + "            </div>\n" + "          </form>\n" + "        </div>\n" + "      </div>\n" + "    </div>\n" + "  </div>\n" + "</div>");
@@ -4358,12 +4401,13 @@
         $templateCache.put("roles/roles.html", '<div class="content-page">\n' + "\n" + '  <page-title title=" Roles" icon="&#59170;"></page-title>\n' + "\n" + '  <bsmodal id="newRole"\n' + '           title="New Role"\n' + '           close="hideModal"\n' + '           closelabel="Cancel"\n' + '           extrabutton="newRoleDialog"\n' + '           extrabuttonlabel="Create"\n' + "           ng-cloak>\n" + "          <fieldset>\n" + '            <div class="control-group">\n' + '              <label for="new-role-roletitle">Title</label>\n' + '              <div class="controls">\n' + '                <input type="text" ng-pattern="titleRegex" ng-attr-title="{{titleRegexDescription}}" required ng-model="$parent.newRole.title" name="roletitle" id="new-role-roletitle" class="input-xlarge" ug-validate/>\n' + '                <p class="help-block hide"></p>\n' + "              </div>\n" + "            </div>\n" + '            <div class="control-group">\n' + '              <label for="n
 ew-role-rolename">Role Name</label>\n' + '              <div class="controls">\n' + '                <input type="text" required ng-pattern="roleNameRegex" ng-attr-title="{{roleNameRegexDescription}}" ng-model="$parent.newRole.name" name="rolename" id="new-role-rolename" class="input-xlarge" ug-validate/>\n' + '                <p class="help-block hide"></p>\n' + "              </div>\n" + "            </div>\n" + "          </fieldset>\n" + "  </bsmodal>\n" + "\n" + '  <bsmodal id="deleteRole"\n' + '           title="Delete Role"\n' + '           close="hideModal"\n' + '           closelabel="Cancel"\n' + '           extrabutton="deleteRoleDialog"\n' + '           extrabuttonlabel="Delete"\n' + "           ng-cloak>\n" + "    <p>Are you sure you want to delete the role(s)?</p>\n" + "  </bsmodal>\n" + "\n" + '  <section class="row-fluid">\n' + '    <div class="span3 user-col">\n' + "\n" + '      <div class="button-toolbar span12">\n' + '        <a title="Select All" class="btn btn-p
 rimary select-all toolbar" ng-show="hasRoles" ng-click="selectAllEntities(rolesCollection._list,this,\'rolesSelected\',true)"> <i class="pictogram">&#8863;</i></a>\n' + '        <button title="Delete" class="btn btn-primary toolbar"  ng-disabled="!hasRoles || !valueSelected(rolesCollection._list)" ng-click="showModal(\'deleteRole\')"><i class="pictogram">&#9749;</i></button>\n' + '        <button title="Add" class="btn btn-primary toolbar" ng-click="showModal(\'newRole\')"><i class="pictogram">&#59136;</i></button>\n' + "      </div>\n" + "\n" + '      <ul class="user-list">\n' + '        <li ng-class="selectedRole._data.uuid === role._data.uuid ? \'selected\' : \'\'" ng-repeat="role in rolesCollection._list" ng-click="selectRole(role._data.uuid)">\n' + "          <input\n" + '              type="checkbox"\n' + "              ng-value=\"role.get('uuid')\"\n" + '              ng-checked="master"\n' + '              ng-model="role.checked"\n' + "              >\n" + "          <a >{{r
 ole.get('title')}}</a>\n" + "          <br/>\n" + "          <span ng-if=\"role.get('name')\" class=\"label\">Role Name:</span>{{role.get('name')}}\n" + "        </li>\n" + "      </ul>\n" + "\n" + "\n" + "\n" + '  <div style="padding: 10px 5px 10px 5px">\n' + '    <button class="btn btn-primary" ng-click="getPrevious()" style="display:{{previous_display}}">< Previous</button>\n' + '    <button class="btn btn-primary" ng-click="getNext()" style="display:{{next_display}};float:right;">Next ></button>\n' + "  </div>\n" + "\n" + "    </div>\n" + "\n" + '    <div class="span9 tab-content" ng-show="hasRoles">\n' + '      <div class="menu-toolbar">\n' + '        <ul class="inline">\n' + '          <li class="tab" ng-class="currentRolesPage.route === \'/roles/settings\' ? \'selected\' : \'\'"><a class="btn btn-primary toolbar" ng-click="selectRolePage(\'/roles/settings\')"><i class="pictogram">&#59170;</i>Settings</a></li>\n' + '          <li class="tab" ng-class="currentRolesPage.route ==
 = \'/roles/users\' ? \'selected\' : \'\'"><a class="btn btn-primary toolbar" ng-click="selectRolePage(\'/roles/users\')"><i class="pictogram">&#128101;</i>Users</a></li>\n' + '          <li class="tab" ng-class="currentRolesPage.route === \'/roles/groups\' ? \'selected\' : \'\'"><a class="btn btn-primary toolbar" ng-click="selectRolePage(\'/roles/groups\')"><i class="pictogram">&#59194;</i>Groups</a></li>\n' + "        </ul>\n" + "      </div>\n" + '      <span ng-include="currentRolesPage.template"></span>\n' + "    </div>\n" + "  </section>\n" + "</div>");
         $templateCache.put("shell/shell.html", '<page-title title=" Shell" icon="&#128241;"></page-title>\n' + "\n" + '<section class="row-fluid">\n' + '  <div class="console-section-contents" id="shell-panel">\n' + '    <div id="shell-input-div">\n' + '      <p> Type "help" to view a list of the available commands.</p>\n' + "      <hr>\n" + "\n" + '      <form name="shellForm" ng-submit="submitCommand()" >\n' + "        <span>&nbsp;&gt;&gt; </span>\n" + '        <input  type="text" id="shell-input"  ng-model="shell.input" autofocus="autofocus" required\n' + '                  ng-form="shellForm">\n' + '        <input style="display: none" type="submit" ng-form="shellForm" value="submit" ng-disabled="!shell.input"/>\n' + "      </form>\n" + "    </div>\n" + '    <pre id="shell-output" class="prettyprint lang-js" style="overflow-x: auto; height: 400px;" ng-bind-html="shell.output">\n' + "\n" + "    </pre>\n" + "  </div>\n" + "</section>\n");
         $templateCache.put("users/users-activities.html", '<div class="content-page" ng-controller="UsersActivitiesCtrl" >\n' + "\n" + '  <bsmodal id="addActivityToUser"\n' + '           title="Add activity to user"\n' + '           close="hideModal"\n' + '           closelabel="Cancel"\n' + '           extrabutton="addActivityToUserDialog"\n' + '           extrabuttonlabel="Add"\n' + "           ng-cloak>\n" + '      <p>Content: <input id="activityMessage" ng-model="$parent.newActivity.activityToAdd" required name="activityMessage" ug-validate /></p>\n' + "  </bsmodal>\n" + "\n" + "\n" + "  <div ng:include=\"'users/users-tabs.html'\"></div>\n" + "  <br>\n" + '  <div class="button-strip">\n' + '    <button class="btn btn-primary" ng-click="showModal(\'addActivityToUser\')">Add activity to user</button>\n' + "  </div>\n" + "  <div>\n" + '    <table class="table table-striped">\n' + "      <tbody>\n" + '      <tr class="table-header">\n' + "        <td>Date</td>\n" + "        <td>Cont
 ent</td>\n" + "        <td>Verb</td>\n" + "        <td>UUID</td>\n" + "      </tr>\n" + '      <tr class="zebraRows" ng-repeat="activity in activities">\n' + "        <td>{{activity.createdDate}}</td>\n" + "        <td>{{activity.content}}</td>\n" + "        <td>{{activity.verb}}</td>\n" + "        <td>{{activity.uuid}}</td>\n" + "      </tr>\n" + "      </tbody>\n" + "    </table>\n" + "  </div>\n" + "\n" + "\n" + "</div>\n");
+        $templateCache.put("users/users-feed.html", '<div class="content-page" ng-controller="UsersFeedCtrl" >\n' + "\n" + "    <div ng:include=\"'users/users-tabs.html'\"></div>\n" + "    <br>\n" + "    <div>\n" + '        <table class="table table-striped">\n' + "            <tbody>\n" + '            <tr class="table-header">\n' + "                <td>Date</td>\n" + "                <td>User</td>\n" + "                <td>Content</td>\n" + "                <td>Verb</td>\n" + "                <td>UUID</td>\n" + "            </tr>\n" + '            <tr class="zebraRows" ng-repeat="activity in activities">\n' + "                <td>{{activity.createdDate}}</td>\n" + "                <td>{{activity.actor.displayName}}</td>\n" + "                <td>{{activity.content}}</td>\n" + "                <td>{{activity.verb}}</td>\n" + "                <td>{{activity.uuid}}</td>\n" + "            </tr>\n" + "            </tbody>\n" + "        </table>\n" + "    </div>\n" + "\n" + "\n" + "</div
 >\n");
         $templateCache.put("users/users-graph.html", '<div class="content-page" ng-controller="UsersGraphCtrl">\n' + "\n" + "  <div ng:include=\"'users/users-tabs.html'\"></div>\n" + "\n" + "  <div>\n" + "\n" + '    <bsmodal id="followUser"\n' + '             title="Follow User"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="followUserDialog"\n' + '             extrabuttonlabel="Add"\n' + "             ng-cloak>\n" + '      <div class="btn-group">\n' + '        <a class="btn dropdown-toggle filter-selector" data-toggle="dropdown">\n' + "          <span class=\"filter-label\">{{$parent.user != '' ? $parent.user.username : 'Select a user...'}}</span>\n" + '          <span class="caret"></span>\n' + "        </a>\n" + '        <ul class="dropdown-menu">\n' + '          <li ng-repeat="user in $parent.usersTypeaheadValues" class="filterItem"><a ng-click="$parent.$parent.user = user">{{user.username}}</a></li>\n' + "        </ul
 >\n" + "      </div>\n" + "    </bsmodal>\n" + "\n" + "\n" + '    <div class="button-strip">\n' + '      <button class="btn btn-primary" ng-click="showModal(\'followUser\')">Follow User</button>\n' + "    </div>\n" + "    <br>\n" + "    <h4>Following</h4>\n" + '    <table class="table table-striped">\n' + "      <tbody>\n" + '      <tr class="table-header">\n' + "        <td>Image</td>\n" + "        <td>Username</td>\n" + "        <td>Email</td>\n" + "        <td>UUID</td>\n" + "      </tr>\n" + '      <tr class="zebraRows" ng-repeat="user in selectedUser.following">\n' + '        <td><img style="width:30px;height:30px;" ng-src="{{user._portal_image_icon}}"></td>\n' + "        <td>{{user.username}}</td>\n" + "        <td>{{user.email}}</td>\n" + "        <td>{{user.uuid}}</td>\n" + "      </tr>\n" + "      </tbody>\n" + "    </table>\n" + "\n" + "    <h4>Followers</h4>\n" + '    <table class="table table-striped">\n' + "      <tbody>\n" + '      <tr class="table-header">\n' + "     
    <td>Image</td>\n" + "        <td>Username</td>\n" + "        <td>Email</td>\n" + "        <td>UUID</td>\n" + "      </tr>\n" + '      <tr class="zebraRows" ng-repeat="user in selectedUser.followers">\n' + '        <td><img style="width:30px;height:30px;" ng-src="{{user._portal_image_icon}}"></td>\n' + "        <td>{{user.username}}</td>\n" + "        <td>{{user.email}}</td>\n" + "        <td>{{user.uuid}}</td>\n" + "      </tr>\n" + "      </tbody>\n" + "    </table>\n" + "\n" + "  </div>\n" + "</div>");
         $templateCache.put("users/users-groups.html", '<div class="content-page" ng-controller="UsersGroupsCtrl">\n' + "\n" + "  <div ng:include=\"'users/users-tabs.html'\"></div>\n" + "\n" + "  <div>\n" + "\n" + '    <bsmodal id="addUserToGroup"\n' + '             title="Add user to group"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="addUserToGroupDialog"\n' + '             extrabuttonlabel="Add"\n' + "             ng-cloak>\n" + '      <div class="btn-group">\n' + '        <a class="btn dropdown-toggle filter-selector" data-toggle="dropdown">\n' + "          <span class=\"filter-label\">{{$parent.title && $parent.title !== '' ? $parent.title : 'Select a group...'}}</span>\n" + '          <span class="caret"></span>\n' + "        </a>\n" + '        <ul class="dropdown-menu">\n' + '          <li ng-repeat="group in $parent.groupsTypeaheadValues" class="filterItem"><a ng-click="selectGroup(group)">{{group.title}}</a></li>
 \n' + "        </ul>\n" + "      </div>\n" + "    </bsmodal>\n" + "\n" + '    <bsmodal id="leaveGroup"\n' + '             title="Confirmation"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="leaveGroupDialog"\n' + '             extrabuttonlabel="Leave"\n' + "             ng-cloak>\n" + "      <p>Are you sure you want to remove the user from the seleted group(s)?</p>\n" + "    </bsmodal>\n" + "\n" + '    <div class="button-strip">\n' + '      <button class="btn btn-primary" ng-click="showModal(\'addUserToGroup\')">Add to group</button>\n' + '      <button class="btn btn-primary" ng-disabled="!hasGroups || !valueSelected(userGroupsCollection._list)" ng-click="showModal(\'leaveGroup\')">Leave group(s)</button>\n' + "    </div>\n" + '    <table class="table table-striped">\n' + "      <tbody>\n" + '      <tr class="table-header">\n' + "        <td>\n" + '          <input type="checkbox" ng-show="hasGroups" id="selectAllCheckBox
 " ng-model="userGroupsSelected" ng-click="selectAllEntities(userGroupsCollection._list,this,\'userGroupsSelected\')" >\n' + "        </td>\n" + "        <td>Group Name</td>\n" + "        <td>Path</td>\n" + "      </tr>\n" + '      <tr class="zebraRows" ng-repeat="group in userGroupsCollection._list">\n' + "        <td>\n" + "          <input\n" + '            type="checkbox"\n' + "            ng-value=\"group.get('uuid')\"\n" + '            ng-model="group.checked"\n' + "            >\n" + "        </td>\n" + "        <td>{{group.get('title')}}</td>\n" + "        <td>{{group.get('path')}}</td>\n" + "      </tr>\n" + "      </tbody>\n" + "    </table>\n" + "  </div>\n" + '  <div style="padding: 10px 5px 10px 5px">\n' + '    <button class="btn btn-primary" ng-click="getPrevious()" style="display:{{previous_display}}">< Previous</button>\n' + '    <button class="btn btn-primary" ng-click="getNext()" style="display:{{next_display}}; float:right;">Next ></button>\n' + "  </div>\n" + "\n"
  + "</div>\n");
         $templateCache.put("users/users-profile.html", '<div class="content-page" ng-controller="UsersProfileCtrl">\n' + "\n" + "  <div ng:include=\"'users/users-tabs.html'\"></div>\n" + "\n" + '  <div class="row-fluid">\n' + "\n" + '  <form ng-submit="saveSelectedUser()" name="profileForm" novalidate>\n' + '    <div class="span6">\n' + "      <h4>User Information</h4>\n" + '      <label for="ui-form-username" class="ui-dform-label">Username</label>\n' + '      <input type="text" ug-validate required  name="ui-form-username" ng-pattern="usernameRegex" ng-attr-title="{{usernameRegexDescription}}" id="ui-form-username" class="ui-dform-text" ng-model="user.username">\n' + "      <br/>\n" + '      <label for="ui-form-name" class="ui-dform-label">Full Name</label>\n' + '      <input type="text" ug-validate ng-pattern="nameRegex" ng-attr-title="{{nameRegexDescription}}" required name="ui-form-name" id="ui-form-name" class="ui-dform-text" ng-model="user.name">\n' + "      <br/>\n" + '     
  <label for="ui-form-title" class="ui-dform-label">Title</label>\n' + '      <input type="text" ug-validate name="ui-form-title" id="ui-form-title" class="ui-dform-text" ng-model="user.title">\n' + "      <br/>\n" + '      <label for="ui-form-url" class="ui-dform-label">Home Page</label>\n' + '      <input type="url" ug-validate name="ui-form-url" id="ui-form-url" title="Please enter a valid url." class="ui-dform-text" ng-model="user.url">\n' + "      <br/>\n" + '      <label for="ui-form-email" class="ui-dform-label">Email</label>\n' + '      <input type="email" ug-validate required name="ui-form-email" id="ui-form-email"  ng-pattern="emailRegex" ng-attr-title="{{emailRegexDescription}}" class="ui-dform-text" ng-model="user.email">\n' + "      <br/>\n" + '      <label for="ui-form-tel" class="ui-dform-label">Telephone</label>\n' + '      <input type="tel" ug-validate name="ui-form-tel" id="ui-form-tel" class="ui-dform-text" ng-model="user.tel">\n' + "      <br/>\n" + '      <label 
 for="ui-form-picture" class="ui-dform-label">Picture URL</label>\n' + '      <input type="url" ug-validate name="ui-form-picture" id="ui-form-picture" title="Please enter a valid url." ng class="ui-dform-text" ng-model="user.picture">\n' + "      <br/>\n" + '      <label for="ui-form-bday" class="ui-dform-label">Birthday</label>\n' + '      <input type="date" ug-validate name="ui-form-bday" id="ui-form-bday" class="ui-dform-text" ng-model="user.bday">\n' + "      <br/>\n" + "    </div>\n" + '    <div class="span6">\n' + "      <h4>Address</h4>\n" + '      <label for="ui-form-addr1" class="ui-dform-label">Street 1</label>\n' + '      <input type="text" ug-validate name="ui-form-addr1" id="ui-form-addr1" class="ui-dform-text" ng-model="user.adr.addr1">\n' + "      <br/>\n" + '      <label for="ui-form-addr2" class="ui-dform-label">Street 2</label>\n' + '      <input type="text" ug-validate name="ui-form-addr2" id="ui-form-addr2" class="ui-dform-text" ng-model="user.adr.addr2">\n' + " 
      <br/>\n" + '      <label for="ui-form-city" class="ui-dform-label">City</label>\n' + '      <input type="text" ug-validate name="ui-form-city" id="ui-form-city" class="ui-dform-text" ng-model="user.adr.city">\n' + "      <br/>\n" + '      <label for="ui-form-state" class="ui-dform-label">State</label>\n' + '      <input type="text" ug-validate name="ui-form-state" id="ui-form-state"  ng-attr-title="{{stateRegexDescription}}" ng-pattern="stateRegex" class="ui-dform-text" ng-model="user.adr.state">\n' + "      <br/>\n" + '      <label for="ui-form-zip" class="ui-dform-label">Zip</label>\n' + '      <input type="text" ug-validate name="ui-form-zip" ng-pattern="zipRegex" ng-attr-title="{{zipRegexDescription}}" id="ui-form-zip" class="ui-dform-text" ng-model="user.adr.zip">\n' + "      <br/>\n" + '      <label for="ui-form-country" class="ui-dform-label">Country</label>\n' + '      <input type="text" ug-validate name="ui-form-country" ng-attr-title="{{countryRegexDescription}}" ng-p
 attern="countryRegex" id="ui-form-country" class="ui-dform-text" ng-model="user.adr.country">\n' + "      <br/>\n" + "    </div>\n" + "\n" + '      <div class="span6">\n' + '        <input type="submit" class="btn btn-primary margin-35" ng-disabled="!profileForm.$valid"  value="Save User"/>\n' + "      </div>\n" + "\n" + "\n" + '    <div class="content-container">\n' + "      <legend>JSON User Object</legend>\n" + "      <pre>{{user.json}}</pre>\n" + "    </div>\n" + "    </form>\n" + "  </div>\n" + "\n" + "\n" + "</div>\n");
         $templateCache.put("users/users-roles.html", '<div class="content-page" ng-controller="UsersRolesCtrl">\n' + "\n" + "  <div ng:include=\"'users/users-tabs.html'\"></div>\n" + "\n" + "  <div>\n" + "\n" + '    <bsmodal id="addRole"\n' + '             title="Add user to role"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="addUserToRoleDialog"\n' + '             extrabuttonlabel="Add"\n' + "             ng-cloak>\n" + '      <div class="btn-group">\n' + '        <a class="btn dropdown-toggle filter-selector" data-toggle="dropdown">\n' + "          <span class=\"filter-label\">{{$parent.name != '' ? $parent.name : 'Select a Role...'}}</span>\n" + '          <span class="caret"></span>\n' + "        </a>\n" + '        <ul class="dropdown-menu">\n' + '          <li ng-repeat="role in $parent.rolesTypeaheadValues" class="filterItem"><a ng-click="$parent.$parent.name = role.name">{{role.name}}</a></li>\n' + "        </ul>\n
 " + "      </div>\n" + "    </bsmodal>\n" + "\n" + '    <bsmodal id="leaveRole"\n' + '             title="Confirmation"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="leaveRoleDialog"\n' + '             extrabuttonlabel="Leave"\n' + "             ng-cloak>\n" + "      <p>Are you sure you want to remove the user from the role(s)?</p>\n" + "    </bsmodal>\n" + "\n" + '<div ng-controller="UsersRolesCtrl">\n' + "\n" + '    <div class="button-strip">\n' + '      <button class="btn btn-primary" ng-click="showModal(\'addRole\')">Add Role</button>\n' + '      <button class="btn btn-primary" ng-disabled="!hasRoles || !valueSelected(selectedUser.roles)" ng-click="showModal(\'leaveRole\')">Leave role(s)</button>\n' + "    </div>\n" + "    <br>\n" + "    <h4>Roles</h4>\n" + '    <table class="table table-striped">\n' + "      <tbody>\n" + '      <tr class="table-header">\n' + '        <td style="width: 30px;"><input type="checkbox" ng
 -show="hasRoles" id="rolesSelectAllCheckBox" ng-model="usersRolesSelected" ng-click="selectAllEntities(selectedUser.roles,this,\'usersRolesSelected\',true)" ></td>\n' + "        <td>Role Name</td>\n" + "        <td>Role title</td>\n" + "      </tr>\n" + '      <tr class="zebraRows" ng-repeat="role in selectedUser.roles">\n' + "        <td>\n" + "          <input\n" + '            type="checkbox"\n' + '            ng-model="role.checked"\n' + "            >\n" + "        </td>\n" + "        <td>{{role.name}}</td>\n" + "        <td>{{role.title}}</td>\n" + "      </tr>\n" + "      </tbody>\n" + "    </table>\n" + "\n" + '    <bsmodal id="deletePermission"\n' + '             title="Confirmation"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="deletePermissionDialog"\n' + '             extrabuttonlabel="Delete"\n' + "             ng-cloak>\n" + "      <p>Are you sure you want to delete the permission(s)?</p>\n" + "    </bsmodal
 >\n" + "\n" + '    <bsmodal id="addPermission"\n' + '             title="New Permission"\n' + '             close="hideModal"\n' + '             closelabel="Cancel"\n' + '             extrabutton="addUserPermissionDialog"\n' + '             extrabuttonlabel="Add"\n' + "             ng-cloak>\n" + '      <p>Path: <input ng-model="$parent.permissions.path" placeholder="ex: /mydata" id="usersRolePermissions" type="text" ng-pattern="pathRegex" required ug-validate ng-attr-title="{{pathRegexDescription}}" /></p>\n' + '      <div class="control-group">\n' + '        <input type="checkbox" ng-model="$parent.permissions.getPerm"> GET\n' + "      </div>\n" + '      <div class="control-group">\n' + '        <input type="checkbox" ng-model="$parent.permissions.postPerm"> POST\n' + "      </div>\n" + '      <div class="control-group">\n' + '        <input type="checkbox" ng-model="$parent.permissions.putPerm"> PUT\n' + "      </div>\n" + '      <div class="control-group">\n' + '        <input t
 ype="checkbox" ng-model="$parent.permissions.deletePerm"> DELETE\n' + "      </div>\n" + "    </bsmodal>\n" + "\n" + '    <div class="button-strip">\n' + '      <button class="btn btn-primary" ng-click="showModal(\'addPermission\')">Add Permission</button>\n' + '      <button class="btn btn-primary" ng-disabled="!hasPermissions || !valueSelected(selectedUser.permissions)" ng-click="showModal(\'deletePermission\')">Delete Permission(s)</button>\n' + "    </div>\n" + "    <br>\n" + "    <h4>Permissions</h4>\n" + '    <table class="table table-striped">\n' + "      <tbody>\n" + '      <tr class="table-header">\n' + '        <td style="width: 30px;"><input type="checkbox" ng-show="hasPermissions"  id="permissionsSelectAllCheckBox" ng-model="usersPermissionsSelected" ng-click="selectAllEntities(selectedUser.permissions,this,\'usersPermissionsSelected\',true)"  ></td>\n' + "        <td>Path</td>\n" + "        <td>GET</td>\n" + "        <td>POST</td>\n" + "        <td>PUT</td>\n" + "      
   <td>DELETE</td>\n" + "      </tr>\n" + '      <tr class="zebraRows" ng-repeat="permission in selectedUser.permissions">\n' + "        <td>\n" + "          <input\n" + '            type="checkbox"\n' + '            ng-model="permission.checked"\n' + "            >\n" + "        </td>\n" + "        <td>{{permission.path}}</td>\n" + "        <td>{{permission.operations.get}}</td>\n" + "        <td>{{permission.operations.post}}</td>\n" + "        <td>{{permission.operations.put}}</td>\n" + "        <td>{{permission.operations.delete}}</td>\n" + "      </tr>\n" + "      </tbody>\n" + "    </table>\n" + "  </div>\n" + " </div>\n" + "\n" + "</div>\n");
         $templateCache.put("users/users-tabs.html", "\n" + "\n" + "\n");
-        $templateCache.put("users/users.html", '<div class="content-page">\n' + "\n" + '  <page-title title=" Users" icon="&#128100;"></page-title>\n' + '  <bsmodal id="newUser"\n' + '           title="Create New User"\n' + '           close="hideModal"\n' + '           closelabel="Cancel"\n' + '           buttonid="users"\n' + '           extrabutton="newUserDialog"\n' + '           extrabuttonlabel="Create"\n' + "           ng-cloak>\n" + "    <fieldset>\n" + '      <div class="control-group">\n' + '        <label for="new-user-username">Username</label>\n' + "\n" + '        <div class="controls">\n' + '          <input type="text" required ng-model="$parent.newUser.newusername" ng-pattern="usernameRegex" ng-attr-title=

<TRUNCATED>

[48/55] [abbrv] git commit: Merge pull request #59 from amuramoto/master

Posted by sn...@apache.org.
Merge pull request #59 from amuramoto/master

added destroyToken and logoutAndDestroyToken functions

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/5a7915c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/5a7915c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/5a7915c5

Branch: refs/pull/76/head
Commit: 5a7915c58e50c56619b24814c074304dcc445440
Parents: 0b584f7 55b1a64
Author: Rod Simpson <ro...@rodsimpson.com>
Authored: Mon Mar 17 10:32:50 2014 -0600
Committer: Rod Simpson <ro...@rodsimpson.com>
Committed: Mon Mar 17 10:32:50 2014 -0600

----------------------------------------------------------------------
 sdks/html5-javascript/lib/modules/Client.js | 64 ++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5a7915c5/sdks/html5-javascript/lib/modules/Client.js
----------------------------------------------------------------------


[40/55] [abbrv] git commit: fix issue with querying specific fields instead of entire object

Posted by sn...@apache.org.
fix issue with querying specific fields instead of entire object


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/88f37ce6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/88f37ce6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/88f37ce6

Branch: refs/pull/76/head
Commit: 88f37ce60306321b36f3cd4c9c83533c5b41d785
Parents: 6ab616b
Author: Scott Ganyo <sc...@ganyo.com>
Authored: Wed Mar 12 16:07:34 2014 -0700
Committer: Scott Ganyo <sc...@ganyo.com>
Committed: Wed Mar 12 16:07:34 2014 -0700

----------------------------------------------------------------------
 sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/88f37ce6/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb
----------------------------------------------------------------------
diff --git a/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb b/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb
index 6868257..f9db153 100644
--- a/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb
+++ b/sdks/ruby-on-rails/lib/usergrid_ironhorse/query.rb
@@ -542,9 +542,9 @@ module Usergrid
           where(conditions).delete_all
         else
           pluck :uuid
-          response = run_query
-          response.entities.each {|entity| entity.delete} # todo: can this be optimized into one call?
-          response.entities.size
+          response = load
+          response.each {|entity| entity.delete} # todo: can this be optimized into one call?
+          response.size
         end
       end
 
@@ -893,7 +893,18 @@ module Usergrid
         return if loaded?
         begin
           @response = run_query
+          if (!@options[:select] or @options[:select] == '*')
             @records = @response.entities.collect {|r| @model_class.model_name.constantize.new(r.data)}
+          else # handle list
+            selects = @options[:select].split ','
+            @records = @response.entities.collect do |r|
+              data = {}
+              (0..selects.size).each do |i|
+                data[selects[i]] = r[i]
+              end
+              @model_class.model_name.constantize.new(data)
+            end
+          end
         rescue RestClient::ResourceNotFound
           @records = []
         end


[09/55] [abbrv] git commit: USERGRID-86: Remove restriction on 10 apps in the portal

Posted by sn...@apache.org.
USERGRID-86: Remove restriction on 10 apps in the portal


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a339e4f6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a339e4f6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a339e4f6

Branch: refs/pull/76/head
Commit: a339e4f67b104ebeca2f8049a08dd0d24fffa038
Parents: bf075e6
Author: Shawn Feldman <sh...@gmail.com>
Authored: Thu Mar 6 14:25:12 2014 -0700
Committer: Shawn Feldman <sh...@gmail.com>
Committed: Thu Mar 6 14:25:12 2014 -0700

----------------------------------------------------------------------
 portal/config.js    | 2 +-
 portal/package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a339e4f6/portal/config.js
----------------------------------------------------------------------
diff --git a/portal/config.js b/portal/config.js
index e08e78f..7b1920f 100644
--- a/portal/config.js
+++ b/portal/config.js
@@ -2,7 +2,7 @@ var Usergrid = Usergrid || {};
 
 //Google Analytics
 var _gaq = _gaq || [];
-_gaq.push(['_setAccount', 'UA-4084158-4']);
+_gaq.push(['_setAccount', '{{yourtoken}}']);
 try{
     (function(document) {
         if(!document){

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a339e4f6/portal/package.json
----------------------------------------------------------------------
diff --git a/portal/package.json b/portal/package.json
index a54ded3..9e7d2ea 100644
--- a/portal/package.json
+++ b/portal/package.json
@@ -1,6 +1,6 @@
 {
   "name": "apigee-usergrid",
-  "version": "2.0.36",
+  "version": "1.0.2",
   "packageName": "appsvc-ui",
   "description": "full apigee portal",
   "main": "./scripts/web-server.js",


[41/55] [abbrv] git commit: prepare new version

Posted by sn...@apache.org.
prepare new version


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/e820f5b2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/e820f5b2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/e820f5b2

Branch: refs/pull/76/head
Commit: e820f5b2dadb613d4a73ab583c27091bffc96379
Parents: 88f37ce
Author: Scott Ganyo <sc...@ganyo.com>
Authored: Wed Mar 12 16:08:01 2014 -0700
Committer: Scott Ganyo <sc...@ganyo.com>
Committed: Wed Mar 12 16:08:01 2014 -0700

----------------------------------------------------------------------
 sdks/ruby-on-rails/lib/usergrid_ironhorse/version.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e820f5b2/sdks/ruby-on-rails/lib/usergrid_ironhorse/version.rb
----------------------------------------------------------------------
diff --git a/sdks/ruby-on-rails/lib/usergrid_ironhorse/version.rb b/sdks/ruby-on-rails/lib/usergrid_ironhorse/version.rb
index 23d3598..6f80fd3 100644
--- a/sdks/ruby-on-rails/lib/usergrid_ironhorse/version.rb
+++ b/sdks/ruby-on-rails/lib/usergrid_ironhorse/version.rb
@@ -1,5 +1,5 @@
 module Usergrid
   module Ironhorse
-    VERSION = '0.1.1'
+    VERSION = '0.1.2'
   end
 end


[02/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/phantomjsdriver.log
----------------------------------------------------------------------
diff --git a/portal/phantomjsdriver.log b/portal/phantomjsdriver.log
deleted file mode 100644
index c84686e..0000000
--- a/portal/phantomjsdriver.log
+++ /dev/null
@@ -1,3869 +0,0 @@
-[INFO  - 2014-01-23T18:59:59.143Z] GhostDriver - Main - running on port 8767
-[INFO  - 2014-01-23T18:59:59.279Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-23T18:59:59.279Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - page.customHeaders:  - {}
-[INFO  - 2014-01-23T18:59:59.279Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-23T18:59:59.279Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-23T18:59:59.279Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 8e70f0a0-8460-11e3-a6ca-f90cb29742ce
-[ERROR - 2014-01-23T19:00:36.539Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.error_description')
-[ERROR - 2014-01-23T19:00:36.539Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 17,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T19:00:36.550Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T19:00:36.550Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T19:00:36.550Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T19:00:36.550Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T19:00:37.619Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T19:00:37.619Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 17,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T19:00:39.117Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.error_description')
-[ERROR - 2014-01-23T19:00:39.117Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 17,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T19:00:39.134Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T19:00:39.134Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T19:00:40.284Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T19:00:40.284Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T19:00:40.284Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T19:00:40.284Z] Session [8e70f0a0-8460-11e3-a6ca-f90cb29742ce] - Page at 'http://localhost:3000/#!/data' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[INFO  - 2014-01-23T19:09:56.291Z] GhostDriver - Main - running on port 13652
-[INFO  - 2014-01-23T19:09:56.472Z] Session [f265aa50-8461-11e3-b919-9726a1670dc4] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-23T19:09:56.472Z] Session [f265aa50-8461-11e3-b919-9726a1670dc4] - page.customHeaders:  - {}
-[INFO  - 2014-01-23T19:09:56.472Z] Session [f265aa50-8461-11e3-b919-9726a1670dc4] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-23T19:09:56.472Z] Session [f265aa50-8461-11e3-b919-9726a1670dc4] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-23T19:09:56.472Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: f265aa50-8461-11e3-b919-9726a1670dc4
-[INFO  - 2014-01-23T19:10:58.163Z] GhostDriver - Main - running on port 39798
-[INFO  - 2014-01-23T19:10:58.350Z] Session [17477fb0-8462-11e3-8e84-2705d21b7f88] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-23T19:10:58.350Z] Session [17477fb0-8462-11e3-8e84-2705d21b7f88] - page.customHeaders:  - {}
-[INFO  - 2014-01-23T19:10:58.350Z] Session [17477fb0-8462-11e3-8e84-2705d21b7f88] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-23T19:10:58.351Z] Session [17477fb0-8462-11e3-8e84-2705d21b7f88] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-23T19:10:58.351Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 17477fb0-8462-11e3-8e84-2705d21b7f88
-[INFO  - 2014-01-23T20:38:20.996Z] GhostDriver - Main - running on port 12645
-[INFO  - 2014-01-23T20:38:21.183Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-23T20:38:21.184Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - page.customHeaders:  - {}
-[INFO  - 2014-01-23T20:38:21.184Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-23T20:38:21.184Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-23T20:38:21.184Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 4c402cb0-846e-11e3-b6a5-c9d262a817bf
-[ERROR - 2014-01-23T20:39:24.492Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - Page at 'http://localhost:3005/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T20:39:24.493Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - Page at 'http://localhost:3005/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T20:39:24.507Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - Page at 'http://localhost:3005/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T20:39:24.507Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - Page at 'http://localhost:3005/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T20:39:24.507Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - Page at 'http://localhost:3005/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T20:39:24.507Z] Session [4c402cb0-846e-11e3-b6a5-c9d262a817bf] - Page at 'http://localhost:3005/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[INFO  - 2014-01-23T20:39:31.229Z] ShutdownReqHand - _handle - About to shutdown
-[INFO  - 2014-01-23T22:15:59.777Z] GhostDriver - Main - running on port 40710
-[INFO  - 2014-01-23T22:15:59.976Z] Session [f05d3150-847b-11e3-b468-f72bafceee69] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-23T22:15:59.976Z] Session [f05d3150-847b-11e3-b468-f72bafceee69] - page.customHeaders:  - {}
-[INFO  - 2014-01-23T22:15:59.977Z] Session [f05d3150-847b-11e3-b468-f72bafceee69] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-23T22:15:59.977Z] Session [f05d3150-847b-11e3-b468-f72bafceee69] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-23T22:15:59.977Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: f05d3150-847b-11e3-b468-f72bafceee69
-[INFO  - 2014-01-23T22:21:34.513Z] GhostDriver - Main - running on port 3728
-[INFO  - 2014-01-23T22:21:34.714Z] Session [b7e22870-847c-11e3-813a-ad8a8e76bb47] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-23T22:21:34.714Z] Session [b7e22870-847c-11e3-813a-ad8a8e76bb47] - page.customHeaders:  - {}
-[INFO  - 2014-01-23T22:21:34.714Z] Session [b7e22870-847c-11e3-813a-ad8a8e76bb47] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-23T22:21:34.714Z] Session [b7e22870-847c-11e3-813a-ad8a8e76bb47] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-23T22:21:34.714Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: b7e22870-847c-11e3-813a-ad8a8e76bb47
-[INFO  - 2014-01-23T22:28:46.091Z] GhostDriver - Main - running on port 22903
-[INFO  - 2014-01-23T22:28:46.272Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-23T22:28:46.272Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - page.customHeaders:  - {}
-[INFO  - 2014-01-23T22:28:46.272Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-23T22:28:46.272Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-23T22:28:46.272Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: b91c87c0-847d-11e3-86b3-65c19fc17756
-[ERROR - 2014-01-23T22:29:44.367Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.error_description')
-[ERROR - 2014-01-23T22:29:44.367Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 17,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:29:44.377Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T22:29:44.378Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:29:44.378Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T22:29:44.378Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:29:47.988Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T22:29:47.988Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:29:47.988Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T22:29:47.988Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:29:47.993Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T22:29:47.993Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:29:47.994Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T22:29:47.994Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:29:48.006Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T22:29:48.006Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:29:48.006Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T22:29:48.006Z] Session [b91c87c0-847d-11e3-86b3-65c19fc17756] - Page at 'http://localhost:3000/#!/users' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[INFO  - 2014-01-23T22:30:00.494Z] ShutdownReqHand - _handle - About to shutdown
-[INFO  - 2014-01-23T22:47:52.144Z] GhostDriver - Main - running on port 25295
-[INFO  - 2014-01-23T22:47:52.348Z] Session [643879f0-8480-11e3-8351-cfdfbbd14f49] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-23T22:47:52.353Z] Session [643879f0-8480-11e3-8351-cfdfbbd14f49] - page.customHeaders:  - {}
-[INFO  - 2014-01-23T22:47:52.353Z] Session [643879f0-8480-11e3-8351-cfdfbbd14f49] - CONSTRUCTOR - Desired Capabilities: {"baseUrl":"http://localhost:3005","browserName":"phantomjs"}
-[INFO  - 2014-01-23T22:47:52.353Z] Session [643879f0-8480-11e3-8351-cfdfbbd14f49] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-23T22:47:52.353Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 643879f0-8480-11e3-8351-cfdfbbd14f49
-[INFO  - 2014-01-23T22:51:12.327Z] GhostDriver - Main - running on port 9220
-[INFO  - 2014-01-23T22:51:12.539Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-23T22:51:12.539Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - page.customHeaders:  - {}
-[INFO  - 2014-01-23T22:51:12.539Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - CONSTRUCTOR - Desired Capabilities: {"baseUrl":"http://localhost:3005","browserName":"phantomjs"}
-[INFO  - 2014-01-23T22:51:12.539Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-23T22:51:12.539Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: db8cb980-8480-11e3-afd6-9f14614f2b13
-[ERROR - 2014-01-23T22:52:14.777Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T22:52:14.777Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 17,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:52:16.998Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T22:52:16.998Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:52:16.999Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T22:52:16.999Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:52:17.000Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T22:52:17.000Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:52:17.004Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T22:52:17.005Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:52:17.005Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T22:52:17.005Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:52:17.017Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-23T22:52:17.018Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-23T22:52:17.018Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-23T22:52:17.018Z] Session [db8cb980-8480-11e3-afd6-9f14614f2b13] - Page at 'http://localhost:3000/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 16,
-    "function": ""
-  }
-]
-[INFO  - 2014-01-23T22:52:36.174Z] ShutdownReqHand - _handle - About to shutdown
-[INFO  - 2014-01-28T17:26:49.011Z] GhostDriver - Main - running on port 48003
-[INFO  - 2014-01-28T17:26:49.167Z] Session [5e8a98c0-8841-11e3-beda-33b115d17185] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-28T17:26:49.168Z] Session [5e8a98c0-8841-11e3-beda-33b115d17185] - page.customHeaders:  - {}
-[INFO  - 2014-01-28T17:26:49.168Z] Session [5e8a98c0-8841-11e3-beda-33b115d17185] - CONSTRUCTOR - Desired Capabilities: {"baseUrl":"http://localhost:3005","browserName":"phantomjs"}
-[INFO  - 2014-01-28T17:26:49.168Z] Session [5e8a98c0-8841-11e3-beda-33b115d17185] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-28T17:26:49.168Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 5e8a98c0-8841-11e3-beda-33b115d17185
-[ERROR - 2014-01-28T17:26:53.378Z] Session [5e8a98c0-8841-11e3-beda-33b115d17185] - Page at 'http://localhost:3000/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-01-28T17:26:53.378Z] Session [5e8a98c0-8841-11e3-beda-33b115d17185] - Page at 'http://localhost:3000/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T17:27:13.110Z] Session [5e8a98c0-8841-11e3-beda-33b115d17185] - Page at 'http://localhost:3000/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-01-28T17:27:13.110Z] Session [5e8a98c0-8841-11e3-beda-33b115d17185] - Page at 'http://localhost:3000/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T17:27:15.693Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1390930035681
-[INFO  - 2014-01-28T17:27:31.388Z] ShutdownReqHand - _handle - About to shutdown
-[INFO  - 2014-01-28T17:41:21.128Z] GhostDriver - Main - running on port 29014
-[INFO  - 2014-01-28T17:41:21.272Z] Session [665b1b40-8843-11e3-9989-4f0166db0236] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-28T17:41:21.272Z] Session [665b1b40-8843-11e3-9989-4f0166db0236] - page.customHeaders:  - {}
-[INFO  - 2014-01-28T17:41:21.272Z] Session [665b1b40-8843-11e3-9989-4f0166db0236] - CONSTRUCTOR - Desired Capabilities: {"baseUrl":"http://localhost:3005","browserName":"phantomjs"}
-[INFO  - 2014-01-28T17:41:21.272Z] Session [665b1b40-8843-11e3-9989-4f0166db0236] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-28T17:41:21.272Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 665b1b40-8843-11e3-9989-4f0166db0236
-[ERROR - 2014-01-28T17:41:25.397Z] Session [665b1b40-8843-11e3-9989-4f0166db0236] - Page at 'http://localhost:3000/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-01-28T17:41:25.397Z] Session [665b1b40-8843-11e3-9989-4f0166db0236] - Page at 'http://localhost:3000/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T17:41:44.997Z] Session [665b1b40-8843-11e3-9989-4f0166db0236] - Page at 'http://localhost:3000/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-01-28T17:41:44.997Z] Session [665b1b40-8843-11e3-9989-4f0166db0236] - Page at 'http://localhost:3000/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3000/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[INFO  - 2014-01-28T21:50:00.496Z] GhostDriver - Main - running on port 18631
-[INFO  - 2014-01-28T21:50:00.596Z] Session [22f74900-8866-11e3-a9b2-7d36995a81fe] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-28T21:50:00.596Z] Session [22f74900-8866-11e3-a9b2-7d36995a81fe] - page.customHeaders:  - {}
-[INFO  - 2014-01-28T21:50:00.596Z] Session [22f74900-8866-11e3-a9b2-7d36995a81fe] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-28T21:50:00.597Z] Session [22f74900-8866-11e3-a9b2-7d36995a81fe] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-28T21:50:00.597Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 22f74900-8866-11e3-a9b2-7d36995a81fe
-[INFO  - 2014-01-28T22:53:42.097Z] GhostDriver - Main - running on port 3555
-[INFO  - 2014-01-28T22:53:42.286Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-28T22:53:42.287Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - page.customHeaders:  - {}
-[INFO  - 2014-01-28T22:53:42.287Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-28T22:53:42.287Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-28T22:53:42.287Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 08dee6a0-886f-11e3-b173-8760eb936d41
-[ERROR - 2014-01-28T22:53:47.447Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-01-28T22:53:47.447Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:12.694Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-01-28T22:54:12.694Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:42.664Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/push/sendNotification' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.error_description')
-[ERROR - 2014-01-28T22:54:42.664Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/push/sendNotification' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:42.675Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/push/sendNotification' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-28T22:54:42.675Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/push/sendNotification' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:42.676Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/push/sendNotification' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-28T22:54:42.676Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/push/sendNotification' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:46.366Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-28T22:54:46.366Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:46.366Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-28T22:54:46.366Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:46.367Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-28T22:54:46.367Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:46.374Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-28T22:54:46.374Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:46.374Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-28T22:54:46.374Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:46.391Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-01-28T22:54:46.392Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-01-28T22:54:46.392Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-01-28T22:54:46.392Z] Session [08dee6a0-886f-11e3-b173-8760eb936d41] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[INFO  - 2014-01-28T22:55:05.180Z] ShutdownReqHand - _handle - About to shutdown
-[INFO  - 2014-01-31T15:38:31.188Z] GhostDriver - Main - running on port 10460
-[INFO  - 2014-01-31T15:38:31.786Z] Session [bd0a2f70-8a8d-11e3-9116-f5560ce789e8] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-01-31T15:38:31.787Z] Session [bd0a2f70-8a8d-11e3-9116-f5560ce789e8] - page.customHeaders:  - {}
-[INFO  - 2014-01-31T15:38:31.787Z] Session [bd0a2f70-8a8d-11e3-9116-f5560ce789e8] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-01-31T15:38:31.787Z] Session [bd0a2f70-8a8d-11e3-9116-f5560ce789e8] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-01-31T15:38:31.787Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: bd0a2f70-8a8d-11e3-9116-f5560ce789e8
-[ERROR - 2014-01-31T15:38:36.654Z] Session [bd0a2f70-8a8d-11e3-9116-f5560ce789e8] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-01-31T15:38:36.654Z] Session [bd0a2f70-8a8d-11e3-9116-f5560ce789e8] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[INFO  - 2014-02-06T22:50:02.974Z] GhostDriver - Main - running on port 30741
-[INFO  - 2014-02-06T22:50:03.590Z] Session [043c4a20-8f81-11e3-90c6-2daeb88a349a] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-02-06T22:50:03.590Z] Session [043c4a20-8f81-11e3-90c6-2daeb88a349a] - page.customHeaders:  - {}
-[INFO  - 2014-02-06T22:50:03.590Z] Session [043c4a20-8f81-11e3-90c6-2daeb88a349a] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-02-06T22:50:03.590Z] Session [043c4a20-8f81-11e3-90c6-2daeb88a349a] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-02-06T22:50:03.590Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 043c4a20-8f81-11e3-90c6-2daeb88a349a
-[ERROR - 2014-02-06T22:50:08.454Z] Session [043c4a20-8f81-11e3-90c6-2daeb88a349a] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-02-06T22:50:08.454Z] Session [043c4a20-8f81-11e3-90c6-2daeb88a349a] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.27/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.27/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.27/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.27/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[INFO  - 2014-02-07T15:25:32.958Z] GhostDriver - Main - running on port 35931
-[INFO  - 2014-02-07T15:25:33.111Z] Session [15ce0f40-900c-11e3-bc5b-8b51a1c96a6b] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-02-07T15:25:33.111Z] Session [15ce0f40-900c-11e3-bc5b-8b51a1c96a6b] - page.customHeaders:  - {}
-[INFO  - 2014-02-07T15:25:33.111Z] Session [15ce0f40-900c-11e3-bc5b-8b51a1c96a6b] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-02-07T15:25:33.111Z] Session [15ce0f40-900c-11e3-bc5b-8b51a1c96a6b] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-02-07T15:25:33.111Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 15ce0f40-900c-11e3-bc5b-8b51a1c96a6b
-[ERROR - 2014-02-07T15:25:38.151Z] Session [15ce0f40-900c-11e3-bc5b-8b51a1c96a6b] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-02-07T15:25:38.151Z] Session [15ce0f40-900c-11e3-bc5b-8b51a1c96a6b] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.27/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.27/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.27/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.27/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[INFO  - 2014-02-12T15:55:24.968Z] GhostDriver - Main - running on port 47671
-[INFO  - 2014-02-12T15:55:25.131Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-02-12T15:55:25.132Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - page.customHeaders:  - {}
-[INFO  - 2014-02-12T15:55:25.132Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-02-12T15:55:25.132Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-02-12T15:55:25.132Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 15ff5c80-93fe-11e3-a5c9-4f55b752acf6
-[ERROR - 2014-02-12T15:55:34.301Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-02-12T15:55:34.301Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:14.291Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/forgot-password' - Console Error (msg): TypeError: 'null' is not an object (evaluating '$.widget.innerHTML='<div id="recaptcha_area">'+d+"</div>"')
-[ERROR - 2014-02-12T15:56:14.292Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/forgot-password' - Console Error (stack): [
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 168,
-    "function": ""
-  },
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 171,
-    "function": ""
-  },
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 166,
-    "function": ""
-  },
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 183,
-    "function": ""
-  },
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 183,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:27.187Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-02-12T15:56:27.187Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:57.161Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.error_description')
-[ERROR - 2014-02-12T15:56:57.161Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:57.180Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T15:56:57.180Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:57.180Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T15:56:57.180Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:57.389Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T15:56:57.389Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:57.390Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T15:56:57.390Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:59.399Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T15:56:59.399Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:59.403Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T15:56:59.403Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:59.404Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T15:56:59.404Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:59.415Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T15:56:59.415Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:56:59.416Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T15:56:59.416Z] Session [15ff5c80-93fe-11e3-a5c9-4f55b752acf6] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T15:57:04.492Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1392220624479
-[ERROR - 2014-02-12T15:57:06.168Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1392220626155
-[ERROR - 2014-02-12T15:57:12.301Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1392220632287
-[INFO  - 2014-02-12T15:57:13.039Z] ShutdownReqHand - _handle - About to shutdown
-[INFO  - 2014-02-12T15:58:01.455Z] GhostDriver - Main - running on port 35372
-[INFO  - 2014-02-12T15:58:01.501Z] Session [73336090-93fe-11e3-9347-45b71a22888c] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-02-12T15:58:01.501Z] Session [73336090-93fe-11e3-9347-45b71a22888c] - page.customHeaders:  - {}
-[INFO  - 2014-02-12T15:58:01.501Z] Session [73336090-93fe-11e3-9347-45b71a22888c] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-02-12T15:58:01.501Z] Session [73336090-93fe-11e3-9347-45b71a22888c] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-02-12T15:58:01.501Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 73336090-93fe-11e3-9347-45b71a22888c
-[INFO  - 2014-02-12T16:01:16.803Z] GhostDriver - Main - running on port 26024
-[INFO  - 2014-02-12T16:01:17.223Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-02-12T16:01:17.223Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - page.customHeaders:  - {}
-[INFO  - 2014-02-12T16:01:17.223Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-02-12T16:01:17.223Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-02-12T16:01:17.223Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: e7dc2f30-93fe-11e3-bcbb-257db06ecbb8
-[ERROR - 2014-02-12T16:01:25.881Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-02-12T16:01:25.882Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:01:55.842Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.error_description')
-[ERROR - 2014-02-12T16:01:55.842Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:01:55.865Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T16:01:55.866Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:01:55.866Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T16:01:55.866Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:01:58.096Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.error_description')
-[ERROR - 2014-02-12T16:01:58.096Z] Session [e7dc2f30-93fe-11e3-bcbb-257db06ecbb8] - Page at 'http://localhost:3005/#!/org-overview' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[INFO  - 2014-02-12T16:03:01.455Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:06:16.803Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:08:01.455Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:11:05.125Z] GhostDriver - Main - running on port 34505
-[INFO  - 2014-02-12T16:11:05.616Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-02-12T16:11:05.616Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - page.customHeaders:  - {}
-[INFO  - 2014-02-12T16:11:05.616Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs"}
-[INFO  - 2014-02-12T16:11:05.616Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
-[INFO  - 2014-02-12T16:11:05.616Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 4691fbd0-9400-11e3-918d-8f0e56495534
-[INFO  - 2014-02-12T16:11:16.803Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[ERROR - 2014-02-12T16:11:16.922Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-02-12T16:11:16.923Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:11:59.556Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/forgot-password' - Console Error (msg): TypeError: 'null' is not an object (evaluating '$.widget.innerHTML='<div id="recaptcha_area">'+d+"</div>"')
-[ERROR - 2014-02-12T16:11:59.556Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/forgot-password' - Console Error (stack): [
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 168,
-    "function": ""
-  },
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 171,
-    "function": ""
-  },
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 166,
-    "function": ""
-  },
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 183,
-    "function": ""
-  },
-  {
-    "file": "https://www.google.com/recaptcha/api/js/recaptcha.js",
-    "line": 183,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:11.354Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/' - Console Error (msg): TypeError: 'null' is not an object (evaluating 'c.$$nextSibling')
-[ERROR - 2014-02-12T16:12:11.354Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 11,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:41.332Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.error_description')
-[ERROR - 2014-02-12T16:12:41.333Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:41.350Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T16:12:41.350Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:41.351Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T16:12:41.351Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:41.560Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T16:12:41.560Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:41.560Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T16:12:41.561Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:43.826Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T16:12:43.826Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:43.826Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T16:12:43.826Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:43.827Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T16:12:43.827Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:43.831Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T16:12:43.831Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:43.832Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T16:12:43.832Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:43.843Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.data')
-[ERROR - 2014-02-12T16:12:43.844Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 14,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:43.844Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (msg): TypeError: 'undefined' is not an object (evaluating 'data.credentials')
-[ERROR - 2014-02-12T16:12:43.844Z] Session [4691fbd0-9400-11e3-918d-8f0e56495534] - Page at 'http://localhost:3005/#!/profile' - Console Error (stack): [
-  {
-    "file": "http://localhost:3005/2.0.31/js/usergrid.min.js",
-    "line": 3,
-    "function": ""
-  },
-  {
-    "file": "http://localhost:3005/2.0.31/js/libs/usergrid-libs.min.js",
-    "line": 13,
-    "function": ""
-  }
-]
-[ERROR - 2014-02-12T16:12:48.917Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1392221568904
-[ERROR - 2014-02-12T16:12:50.623Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1392221570609
-[ERROR - 2014-02-12T16:12:56.599Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1392221576585
-[INFO  - 2014-02-12T16:12:57.197Z] ShutdownReqHand - _handle - About to shutdown
-[INFO  - 2014-02-12T16:13:01.455Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:16:16.802Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:18:01.455Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:21:16.802Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:23:01.455Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:26:16.803Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:28:01.456Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:31:16.803Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:33:01.456Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:36:16.803Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:38:01.456Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:41:16.803Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:43:01.456Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
-[INFO  - 2014-02-12T16:44:14.447Z] GhostDriver - Main - running on port 47506
-[INFO  - 2014-02-12T16:44:14.612Z] Session [e81ab010-9404-11e3-9661-97930cc9db7a] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34","webSecurityEnabled":true}
-[INFO  - 2014-02-12T16:44:14.612Z] Session [e81ab010-9404-11e3-9661-97930cc9d

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/seleniumLog.txt
----------------------------------------------------------------------
diff --git a/portal/seleniumLog.txt b/portal/seleniumLog.txt
deleted file mode 100644
index e69de29..0000000


[19/55] [abbrv] git commit: Merge pull request #27 from cywjackson/ug-2766

Posted by sn...@apache.org.
Merge pull request #27 from cywjackson/ug-2766

ug-2766 : should check permission when putting a new entity to collection

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/5a43bb5c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/5a43bb5c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/5a43bb5c

Branch: refs/pull/76/head
Commit: 5a43bb5cce00771b8ae4f140d4f75b81cda5c72f
Parents: 0254ee8 b309e5e
Author: Dave Johnson <da...@rollerweblogger.org>
Authored: Mon Mar 10 12:15:57 2014 -0400
Committer: Dave Johnson <da...@rollerweblogger.org>
Committed: Mon Mar 10 12:15:57 2014 -0400

----------------------------------------------------------------------
 .../org/apache/usergrid/services/AbstractCollectionService.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------



[55/55] [abbrv] git commit: JUnit test version of the code I've been using to test Core Persistence load and read performance.

Posted by sn...@apache.org.
JUnit test version of the code I've been using to test Core Persistence load and read performance.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b3b46e4c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b3b46e4c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b3b46e4c

Branch: refs/heads/two-dot-o
Commit: b3b46e4cc6c77a9c92236863dcc2f7b711e3e4b1
Parents: 070f15b
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Mar 19 15:19:45 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Mar 19 15:19:45 2014 -0400

----------------------------------------------------------------------
 .../index/impl/CorePerformanceIT.java           | 304 +++++++++++++++++++
 1 file changed, 304 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b3b46e4c/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CorePerformanceIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CorePerformanceIT.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CorePerformanceIT.java
new file mode 100644
index 0000000..b368b92
--- /dev/null
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CorePerformanceIT.java
@@ -0,0 +1,304 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.usergrid.persistence.index.impl;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.netflix.config.ConfigurationManager;
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.EntityCollectionManager;
+import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
+import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
+import org.apache.usergrid.persistence.index.EntityCollectionIndex;
+import org.apache.usergrid.persistence.index.EntityCollectionIndexFactory;
+import org.apache.usergrid.persistence.index.guice.TestIndexModule;
+import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.model.entity.SimpleId;
+import org.apache.usergrid.persistence.model.field.DoubleField;
+import org.apache.usergrid.persistence.model.field.LongField;
+import org.apache.usergrid.persistence.model.field.StringField;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+import org.apache.usergrid.persistence.query.Query;
+import org.apache.usergrid.persistence.query.Results;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * TODO: make CorePerformanceIT configurable, add CHOP markup.
+ */
+public class CorePerformanceIT {
+    private static final Logger log = LoggerFactory.getLogger(CorePerformanceIT.class);
+
+    // max entities we will write and read
+    static int maxEntities = Integer.MAX_VALUE;
+
+    // each app will get all data
+    static int orgCount = 2;
+    static int appCount = 5  ;
+
+    // number of threads = orgCount x appCount 
+
+    // total number of records = orgCount x appCount x numRecords
+
+    static EntityCollectionManagerFactory ecmf;
+    static EntityCollectionIndexFactory ecif ;
+
+
+    @Ignore
+    @Test
+    public void loadAndReadData( String[] args ) throws IOException, InterruptedException {
+
+        ConfigurationManager.loadCascadedPropertiesFromResources( "usergrid" );
+        Injector injector = Guice.createInjector( new TestIndexModule() );
+
+        // only on first run
+        //MigrationManager m = injector.getInstance( MigrationManager.class )
+        //m.migrate()
+
+        ecmf = injector.getInstance( EntityCollectionManagerFactory.class );
+        ecif = injector.getInstance( EntityCollectionIndexFactory.class );
+
+        log.info("Start Data Load");
+        List<CollectionScope> scopes = loadData();
+        log.info("Finish Data Load");
+
+        log.info("Start Data Read");
+        readData( scopes );
+        log.info("Finish Data Read");
+
+        runSelectedQueries( scopes );
+
+    }
+
+
+    private List<CollectionScope> loadData() throws InterruptedException {
+
+        long time = new Date().getTime();
+
+        List<CollectionScope> scopes = new ArrayList<CollectionScope>();
+        List<Thread> threads = new ArrayList<Thread>();
+
+        for ( int i=0; i<orgCount; i++ ) {
+
+            String orgName = "org-${i}-${time}";
+            final Id orgId = new SimpleId(orgName);
+
+            for ( int j=0; j<appCount; j++ ) {
+
+                String appName = "app-${j}-${time}";
+                final Id appId = new SimpleId(appName);
+
+                CollectionScope scope = new CollectionScopeImpl( orgId, appId, "reviews" );
+                scopes.add( scope );
+
+//                def scopeFile = new File("/home/ubuntu/scopes.txt")
+//                scopeFile.append("Created ${orgId}, ${appId}\n")
+
+                Thread t = new Thread( new DataLoader( scope ));
+                t.start();
+                threads.add(t);
+            }
+        }
+
+        // wait for indexing to end
+        for ( Thread t : threads ) {
+            t.join();
+        }
+
+        return scopes;
+    }
+
+
+    private void readData( List<CollectionScope> scopes ) throws InterruptedException {
+
+        List<Thread> threads = new ArrayList<Thread>();
+        for ( CollectionScope scope : scopes ) {
+
+            Thread t = new Thread( new DataReader( scope ));
+            t.start();
+            threads.add(t);
+        }
+
+        // wait for reading to end
+        for ( Thread t : threads ) {
+            t.join();
+        }
+    }
+
+
+    static class DataReader implements Runnable {
+        CollectionScope scope;
+
+        public DataReader( CollectionScope scope ) {
+            this.scope = scope;
+        }
+
+        public void run() {
+
+            Id orgId = scope.getOrganization();
+            Id appId = scope.getOwner();
+
+            EntityCollectionManager ecm = ecmf.createCollectionManager( scope );
+            EntityCollectionIndex eci = ecif.createCollectionIndex( scope );
+
+            Query query = Query.fromQL( "review_score > 0"); // get all reviews;
+            query.withLimit( maxEntities < 1000 ? maxEntities : 1000 );
+
+            Results results = eci.execute( query );
+            results.getEntities(); // cause retrieval from Cassandra
+            int count = results.size();
+
+            while ( results.hasCursor() && count < maxEntities ) {
+                query.setCursor( results.getCursor() )   ;
+                results = eci.execute( query );
+                results.getEntities(); // cause retrieval from Cassanda;
+                count += results.size();
+
+                log.info("Read ${count} reviews in ${orgId} ${appId}");
+            }
+        }
+    }
+
+
+    static class DataLoader implements Runnable {
+        CollectionScope scope;
+
+        public DataLoader( CollectionScope scope ) {
+            this.scope = scope;
+        }
+
+        public void run() {
+
+            EntityCollectionManager ecm = ecmf.createCollectionManager( scope );
+            EntityCollectionIndex eci = ecif.createCollectionIndex( scope );
+
+            FileReader fr;
+            try {
+                fr = new FileReader("../../resources/finefoods.txt");
+            } catch (FileNotFoundException ex) {
+                throw new RuntimeException("Error opening file", ex);
+            }
+            BufferedReader br = new BufferedReader(fr);
+            String s = null;
+
+            // create the first entry
+            Entity current = new Entity(
+                new SimpleId(UUIDGenerator.newTimeUUID(), "review")); 
+
+            int count = 0;
+            try {
+                while ( (s = br.readLine()) != null && count < maxEntities ) {
+                    
+                    try {
+                        
+                        if ( s.trim().equals("")) { // then we are at end of a record
+                            
+                            // write and index current entity
+                            ecm.write( current ).toBlockingObservable().last();
+                            eci.index( current );
+                            
+                            if ( maxEntities < 20 ) {
+                                log.info("Index written for ${current.getId()}");
+                                log.info("---");
+                            }
+                            
+                            // create the next entity
+                            current = new Entity(
+                                    new SimpleId(UUIDGenerator.newTimeUUID(), "review"));
+                            
+                            count++;
+                            if (count % 100000 == 0) {
+                                log.info("Indexed ${count} reviews in ${orgId} ${appId}");
+                            }
+                            continue;
+                        }
+                        
+                        // process a field
+                        String name = s.substring( 0, s.indexOf(":")).replace("/", "_").toLowerCase() ;
+                        String value = s.substring( s.indexOf(":") + 1 ).trim();
+                        
+                        if ( maxEntities < 20 ) {
+                            log.info("Indexing ${name} = ${value}");
+                        }
+                        
+                        if ( NumberUtils.isNumber(value) && value.contains(".")) {
+                            current.setField( new DoubleField( name, Double.parseDouble(value)));
+                            
+                        } else if ( NumberUtils.isNumber(value) ) {
+                            current.setField( new LongField( name, Long.parseLong(value)));
+                            
+                        } else {
+                            current.setField( new StringField( name, value.toString() ));
+                        }
+
+                    } catch ( Exception e ) {
+                        log.info("Error on line " + count);
+                    }
+                }
+
+            } catch (IOException ex) {
+                throw new RuntimeException("Error reading file", ex);
+            }
+
+            eci.refresh();
+        }
+    }   
+
+
+    public void runSelectedQueries( List<CollectionScope> scopes ) { 
+
+        for ( CollectionScope scope : scopes ) {
+
+            EntityCollectionManager ecm = ecmf.createCollectionManager( scope );
+            EntityCollectionIndex eci = ecif.createCollectionIndex( scope );
+
+            // TODO: come up with more and more complex queries for CorePerformanceIT
+
+            query(eci, "product_productid = 'B006K2ZZ7K'") ;
+            query(eci, "review_profilename = 'Twoapennything'") ;
+            query(eci, "review_profilename contains 'Natalia'") ;
+            query(eci, "review_profilename contains 'Patrick'") ;
+            query(eci, "review_time = 1342051200") ;
+            query(eci, "review_time > 1342051200") ;
+            query(eci, "review_score > 0");
+            query(eci, "review_score > 2");
+            query(eci, "review_score > 3");
+            query(eci, "review_score > 4");
+            query(eci, "review_score > 5");
+        }
+    }
+
+    public static void query( EntityCollectionIndex eci, String query ) {;
+        Query q = Query.fromQL(query) ;
+        Results results = eci.execute( q );
+        log.info("${q.getQl()}: ${results.getIds().size()}");
+    }
+
+}


[16/55] [abbrv] ug-27666-rebase

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b309e5e7/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
----------------------------------------------------------------------
diff --cc stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
index 0000000,d7c7f9a..10c208f
mode 000000,100644..100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
@@@ -1,0 -1,572 +1,575 @@@
+ /*
+  * Licensed to the Apache Software Foundation (ASF) under one or more
+  * contributor license agreements.  See the NOTICE file distributed with
+  * this work for additional information regarding copyright ownership.
+  * The ASF licenses this file to You under the Apache License, Version 2.0
+  * (the "License"); you may not use this file except in compliance with
+  * the License.  You may obtain a copy of the License at
+  *
+  *      http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+ package org.apache.usergrid.services;
+ 
+ 
+ import java.util.ArrayList;
+ import java.util.List;
+ import java.util.Map;
+ import java.util.Set;
+ import java.util.UUID;
+ 
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+ import org.apache.usergrid.persistence.Entity;
+ import org.apache.usergrid.persistence.EntityRef;
+ import org.apache.usergrid.persistence.Query;
+ import org.apache.usergrid.persistence.Results;
+ import org.apache.usergrid.persistence.Results.Level;
+ import org.apache.usergrid.persistence.Schema;
+ import org.apache.usergrid.persistence.exceptions.UnexpectedEntityTypeException;
+ import org.apache.usergrid.services.ServiceResults.Type;
+ import org.apache.usergrid.services.exceptions.ForbiddenServiceOperationException;
+ import org.apache.usergrid.services.exceptions.ServiceResourceNotFoundException;
+ 
+ import static org.apache.usergrid.utils.ClassUtils.cast;
+ 
+ 
+ public class AbstractCollectionService extends AbstractService {
+ 
+     private static final Logger logger = LoggerFactory.getLogger( AbstractCollectionService.class );
+ 
+ 
+     public AbstractCollectionService() {
+         // addSet("indexes");
+         declareMetadataType( "indexes" );
+     }
+ 
+     // cname/id/
+ 
+ 
+     @Override
+     public Entity getEntity( ServiceRequest request, UUID uuid ) throws Exception {
+         if ( !isRootService() ) {
+             return null;
+         }
+         Entity entity = em.get( uuid );
+         if ( entity != null ) {
+             entity = importEntity( request, entity );
+         }
+         return entity;
+     }
+ 
+ 
+     @Override
+     public Entity getEntity( ServiceRequest request, String name ) throws Exception {
+         if ( !isRootService() ) {
+             return null;
+         }
+         String nameProperty = Schema.getDefaultSchema().aliasProperty( getEntityType() );
+         if ( nameProperty == null ) {
+             nameProperty = "name";
+         }
+ 
+         EntityRef entityRef = em.getAlias( getEntityType(), name );
+         if ( entityRef == null ) {
+             return null;
+         }
+         Entity entity = em.get( entityRef );
+         if ( entity != null ) {
+             entity = importEntity( request, entity );
+         }
+         return entity;
+     }
+ 
+ 
+     private EntityRef loadFromId( ServiceContext context, UUID id ) throws Exception {
+         EntityRef entity = null;
+ 
+         if ( !context.moreParameters() ) {
+             entity = em.get( id );
+ 
+             entity = importEntity( context, ( Entity ) entity );
+         }
+         else {
+             entity = em.getRef( id );
+         }
+ 
+         if ( entity == null ) {
+             throw new ServiceResourceNotFoundException( context );
+         }
+ 
+ 
+         return entity;
+     }
+ 
+ 
+     private ServiceResults getItemById( ServiceContext context, UUID id, boolean skipPermissionCheck )
+             throws Exception {
+ 
+         EntityRef entity = loadFromId( context, id );
+ 
+         validateEntityType( entity, id );
+ 
+         if ( !skipPermissionCheck ) {
+             checkPermissionsForEntity( context, entity );
+         }
+ 
+         // the context of the entity they're trying to load isn't owned by the owner
+         // in the path, don't return it
+         if ( !em.isCollectionMember( context.getOwner(), context.getCollectionName(), entity ) ) {
+             logger.info( "Someone tried to GET entity {} they don't own. Entity id {} with owner {}", new Object[] {
+                     getEntityType(), id, context.getOwner()
+             } );
+             throw new ServiceResourceNotFoundException( context );
+         }
+ 
+         // TODO check that entity is in fact in the collection
+ 
+         List<ServiceRequest> nextRequests = context.getNextServiceRequests( entity );
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, Results.fromRef( entity ), null, nextRequests );
+     }
+ 
+ 
+     @Override
+     public ServiceResults getItemById( ServiceContext context, UUID id ) throws Exception {
+ 
+         return getItemById( context, id, false );
+     }
+ 
+ 
+     @Override
+     public ServiceResults getItemByName( ServiceContext context, String name ) throws Exception {
+ 
+         String nameProperty = Schema.getDefaultSchema().aliasProperty( getEntityType() );
+         if ( nameProperty == null ) {
+             nameProperty = "name";
+         }
+ 
+         EntityRef entity = em.getAlias( getEntityType(), name );
+ 
+         if ( entity == null ) {
+             logger.info( "miss on entityType: {} with name: {}", getEntityType(), name );
+             throw new ServiceResourceNotFoundException( context );
+         }
+ 
+         // the context of the entity they're trying to load isn't owned by the owner
+         // in the path, don't return it
+         if ( !em.isCollectionMember( context.getOwner(), context.getCollectionName(), entity ) ) {
+             logger.info( "Someone tried to GET entity {} they don't own. Entity name {} with owner {}", new Object[] {
+                     getEntityType(), name, context.getOwner()
+             } );
+             throw new ServiceResourceNotFoundException( context );
+         }
+ 
+         if ( !context.moreParameters() ) {
+             entity = em.get( entity );
+             entity = importEntity( context, ( Entity ) entity );
+         }
+ 
+         checkPermissionsForEntity( context, entity );
+ 
+     /*
+      * Results.Level level = Results.Level.REFS; if (isEmpty(parameters)) {
+      * level = Results.Level.ALL_PROPERTIES; }
+      * 
+      * Results results = em.searchCollectionForProperty(owner,
+      * getCollectionName(), null, nameProperty, name, null, null, 1, level);
+      * EntityRef entity = results.getRef();
+      */
+ 
+         List<ServiceRequest> nextRequests = context.getNextServiceRequests( entity );
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, Results.fromRef( entity ), null, nextRequests );
+     }
+ 
+ 
+     @Override
+     public ServiceResults getItemsByQuery( ServiceContext context, Query query ) throws Exception {
+ 
+         checkPermissionsForCollection( context );
+ 
+         int count = 1;
+         Results.Level level = Results.Level.REFS;
+ 
+         if ( !context.moreParameters() ) {
+             count = 0;
+             level = Results.Level.ALL_PROPERTIES;
+         }
+ 
+         if ( context.getRequest().isReturnsTree() ) {
+             level = Results.Level.ALL_PROPERTIES;
+         }
+ 
+         query = new Query( query );
+         query.setResultsLevel( level );
+         query.setLimit( query.getLimit( count ) );
+ 
+         if ( !query.isReversedSet() ) {
+             query.setReversed( isCollectionReversed( context ) );
+         }
+ 
+         if ( !query.isSortSet() ) {
+             query.addSort( getCollectionSort( context ) );
+         }
+     /*
+      * if (count > 0) { query.setMaxResults(count); }
+      */
+ 
+         Results r = em.searchCollection( context.getOwner(), context.getCollectionName(), query );
+ 
+         List<ServiceRequest> nextRequests = null;
+         if ( !r.isEmpty() ) {
+ 
+             if ( !context.moreParameters() ) {
+                 importEntities( context, r );
+             }
+ 
+             nextRequests = context.getNextServiceRequests( r.getRefs() );
+         }
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, r, null, nextRequests );
+     }
+ 
+ 
+     @Override
+     public ServiceResults getCollection( ServiceContext context ) throws Exception {
+ 
+         checkPermissionsForCollection( context );
+ 
+         if ( getCollectionSort( context ) != null ) {
+             return getItemsByQuery( context, new Query() );
+         }
+ 
+         int count = 10;
+         Results r =
+                 em.getCollection( context.getOwner(), context.getCollectionName(), null, count, Level.ALL_PROPERTIES,
+                         isCollectionReversed( context ) );
+ 
+         importEntities( context, r );
+ 
+     /*
+      * if (r.isEmpty()) { throw new ServiceResourceNotFoundException(request); }
+      */
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, r, null, null );
+     }
+ 
+ 
+     @Override
+     public ServiceResults putItemById( ServiceContext context, UUID id ) throws Exception {
+ 
+         if ( context.moreParameters() ) {
+             return getItemById( context, id, true );
+         }
+ 
+         checkPermissionsForEntity( context, id );
+ 
+         Entity item = em.get( id );
+         if ( item != null ) {
+             validateEntityType( item, id );
+             updateEntity( context, item, context.getPayload() );
+             item = importEntity( context, item );
+         }
+         else {
+             String entityType = getEntityType();
+             item = em.create( id, entityType, context.getPayload().getProperties() );
+         }
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, Results.fromEntity( item ), null, null );
+     }
+ 
+ 
+     @Override
+     public ServiceResults putItemByName( ServiceContext context, String name ) throws Exception {
+ 
+         if ( context.moreParameters() ) {
+             return getItemByName( context, name );
+         }
+ 
+         EntityRef ref = em.getAlias( getEntityType(), name );
+         Entity entity;
+         if ( ref == null ) {
++            // null entity ref means we tried to put a non-existing entity
++            // before we create a new entity for it, we should check for permission
++            checkPermissionsForCollection(context);
+             Map<String, Object> properties = context.getPayload().getProperties();
+             if ( !properties.containsKey( "name" ) || !( ( String ) properties.get( "name" ) ).trim().equalsIgnoreCase(
+                     name ) ) {
+                 properties.put( "name", name );
+             }
+             entity = em.create( getEntityType(), properties );
+         }
+         else {
+             entity = em.get( ref );
+             entity = importEntity( context, entity );
+             checkPermissionsForEntity( context, entity );
+             updateEntity( context, entity );
+         }
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, Results.fromEntity( entity ), null, null );
+     }
+ 
+ 
+     @Override
+     public ServiceResults putItemsByQuery( ServiceContext context, Query query ) throws Exception {
+ 
+         checkPermissionsForCollection( context );
+ 
+         if ( context.moreParameters() ) {
+             return getItemsByQuery( context, query );
+         }
+ 
+         query = new Query( query );
+         query.setResultsLevel( Level.ALL_PROPERTIES );
+         query.setLimit( 1000 );
+         if ( !query.isReversedSet() ) {
+             query.setReversed( isCollectionReversed( context ) );
+         }
+         if ( !query.isSortSet() ) {
+             query.addSort( getCollectionSort( context ) );
+         }
+ 
+         Results r = em.searchCollection( context.getOwner(), context.getCollectionName(), query );
+         if ( r.isEmpty() ) {
+             throw new ServiceResourceNotFoundException( context );
+         }
+ 
+         updateEntities( context, r );
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, r, null, null );
+     }
+ 
+ 
+     @Override
+     public ServiceResults postCollection( ServiceContext context ) throws Exception {
+ 
+         checkPermissionsForCollection( context );
+ 
+         if ( context.getPayload().isBatch() ) {
+             List<Entity> entities = new ArrayList<Entity>();
+             List<Map<String, Object>> batch = context.getPayload().getBatchProperties();
+             logger.info( "Attempting to batch create " + batch.size() + " entities in collection " + context
+                     .getCollectionName() );
+             int i = 1;
+             for ( Map<String, Object> p : batch ) {
+                 logger.info( "Creating entity " + i + " in collection " + context.getCollectionName() );
+ 
+                 Entity item = null;
+ 
+                 try {
+                     item = em.createItemInCollection( context.getOwner(), context.getCollectionName(), getEntityType(),
+                             p );
+                 }
+                 catch ( Exception e ) {
+                     logger.error( "Entity " + i + " unable to be created in collection " + context.getCollectionName(),
+                             e );
+ 
+                     i++;
+                     continue;
+                 }
+ 
+                 logger.info(
+                         "Entity " + i + " created in collection " + context.getCollectionName() + " with UUID " + item
+                                 .getUuid() );
+ 
+                 item = importEntity( context, item );
+                 entities.add( item );
+                 i++;
+             }
+             return new ServiceResults( this, context, Type.COLLECTION, Results.fromEntities( entities ), null, null );
+         }
+ 
+         Entity item = em.createItemInCollection( context.getOwner(), context.getCollectionName(), getEntityType(),
+                 context.getProperties() );
+ 
+         item = importEntity( context, item );
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, Results.fromEntity( item ), null, null );
+     }
+ 
+ 
+     @Override
+     public ServiceResults putCollection( ServiceContext context ) throws Exception {
+         return postCollection( context );
+     }
+ 
+ 
+     @Override
+     public ServiceResults postItemsByQuery( ServiceContext context, Query query ) throws Exception {
+         if ( context.moreParameters() ) {
+             return super.postItemsByQuery( context, query );
+         }
+         return postCollection( context );
+     }
+ 
+ 
+     @Override
+     public ServiceResults postItemById( ServiceContext context, UUID id ) throws Exception {
+         if ( context.moreParameters() ) {
+             return getItemById( context, id, true );
+         }
+         checkPermissionsForEntity( context, id );
+ 
+         Entity entity = em.get( id );
+         if ( entity == null ) {
+             throw new ServiceResourceNotFoundException( context );
+         }
+ 
+         validateEntityType( entity, id );
+ 
+         entity = importEntity( context, entity );
+ 
+         em.addToCollection( context.getOwner(), context.getCollectionName(), entity );
+ 
+         return new ServiceResults( null, context, Type.COLLECTION, Results.fromEntity( entity ), null, null );
+     }
+ 
+ 
+     @Override
+     public ServiceResults postItemByName( ServiceContext context, String name ) throws Exception {
+ 
+         if ( context.moreParameters() ) {
+             return super.postItemByName( context, name );
+         }
+ 
+         EntityRef ref = em.getAlias( getEntityType(), name );
+         if ( ref == null ) {
+             throw new ServiceResourceNotFoundException( context );
+         }
+ 
+         return postItemById( context, ref.getUuid() );
+     }
+ 
+ 
+     protected boolean isDeleteAllowed( ServiceContext context, Entity entity ) {
+         return true;
+     }
+ 
+ 
+     protected void prepareToDelete( ServiceContext context, Entity entity ) {
+         if ( !isDeleteAllowed( context, entity ) ) {
+             throw new ForbiddenServiceOperationException( context );
+         }
+     }
+ 
+ 
+     @Override
+     public ServiceResults deleteItemById( ServiceContext context, UUID id ) throws Exception {
+ 
+         checkPermissionsForEntity( context, id );
+ 
+         if ( context.moreParameters() ) {
+             return getItemById( context, id );
+         }
+ 
+         Entity item = em.get( id );
+         if ( item == null ) {
+             throw new ServiceResourceNotFoundException( context );
+         }
+ 
+         validateEntityType( item, id );
+ 
+         item = importEntity( context, item );
+ 
+         prepareToDelete( context, item );
+ 
+         em.removeFromCollection( context.getOwner(), context.getCollectionName(), item );
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, Results.fromEntity( item ), null, null );
+     }
+ 
+ 
+     @Override
+     public ServiceResults deleteItemByName( ServiceContext context, String name ) throws Exception {
+ 
+         if ( context.moreParameters() ) {
+             return getItemByName( context, name );
+         }
+ 
+         EntityRef ref = em.getAlias( getEntityType(), name );
+         if ( ref == null ) {
+             throw new ServiceResourceNotFoundException( context );
+         }
+         Entity entity = em.get( ref );
+         if ( entity == null ) {
+             throw new ServiceResourceNotFoundException( context );
+         }
+         entity = importEntity( context, entity );
+ 
+         checkPermissionsForEntity( context, entity );
+ 
+         prepareToDelete( context, entity );
+ 
+         em.removeFromCollection( context.getOwner(), context.getCollectionName(), entity );
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, Results.fromEntity( entity ), null, null );
+     }
+ 
+ 
+     @Override
+     public ServiceResults deleteItemsByQuery( ServiceContext context, Query query ) throws Exception {
+ 
+         checkPermissionsForCollection( context );
+ 
+         if ( context.moreParameters() ) {
+             return getItemsByQuery( context, query );
+         }
+ 
+         query = new Query( query );
+         query.setResultsLevel( Level.ALL_PROPERTIES );
+         query.setLimit( query.getLimit() );
+ 
+         if ( !query.isReversedSet() ) {
+             query.setReversed( isCollectionReversed( context ) );
+         }
+ 
+         if ( !query.isSortSet() ) {
+             query.addSort( getCollectionSort( context ) );
+         }
+ 
+ 
+         Results r = em.searchCollection( context.getOwner(), context.getCollectionName(), query );
+ 
+         importEntities( context, r );
+ 
+         for ( Entity entity : r ) {
+             prepareToDelete( context, entity );
+         }
+ 
+         for ( Entity entity : r ) {
+             em.removeFromCollection( context.getOwner(), context.getCollectionName(), entity );
+         }
+ 
+         return new ServiceResults( this, context, Type.COLLECTION, r, null, null );
+     }
+ 
+ 
+     @Override
+     public ServiceResults getServiceMetadata( ServiceContext context, String metadataType ) throws Exception {
+ 
+         if ( "indexes".equals( metadataType ) ) {
+             Set<String> indexes = cast( em.getCollectionIndexes( context.getOwner(), context.getCollectionName() ) );
+ 
+             return new ServiceResults( this,
+                     context.getRequest().withPath( context.getRequest().getPath() + "/indexes" ),
+                     context.getPreviousResults(), context.getChildPath(), Type.GENERIC, Results.fromData( indexes ),
+                     null, null );
+         }
+         return null;
+     }
+ 
+ 
+     private void validateEntityType( EntityRef item, UUID id ) throws UnexpectedEntityTypeException {
+         if ( !getEntityType().equalsIgnoreCase( item.getType() ) ) {
+             throw new UnexpectedEntityTypeException(
+                     "Entity " + id + " is not the expected type, expected " + getEntityType() + ", found " + item
+                             .getType() );
+         }
+     }
+ }


[49/55] [abbrv] git commit: Merge pull request #73 from usergrid/usergrid-93

Posted by sn...@apache.org.
Merge pull request #73 from usergrid/usergrid-93

Usergrid 93

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/24425d5e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/24425d5e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/24425d5e

Branch: refs/pull/76/head
Commit: 24425d5e61fabb08e632fcfbdfbb423b7ff6acaa
Parents: 5a7915c e820f5b
Author: Todd Nine <tn...@apigee.com>
Authored: Tue Mar 18 09:05:45 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Tue Mar 18 09:05:45 2014 -0700

----------------------------------------------------------------------
 .../lib/usergrid_ironhorse/query.rb             | 30 ++++++++++++++------
 .../lib/usergrid_ironhorse/version.rb           |  2 +-
 .../spec/usergrid_ironhorse/base_spec.rb        |  8 ++++--
 sdks/ruby-on-rails/usergrid_ironhorse.gemspec   |  4 +--
 4 files changed, 29 insertions(+), 15 deletions(-)
----------------------------------------------------------------------



[20/55] [abbrv] git commit: Merge pull request #60 from GERey/Export_Persistance_Integration

Posted by sn...@apache.org.
Merge pull request #60 from GERey/Export_Persistance_Integration

Export persistance integration

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/ab9fdf2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ab9fdf2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ab9fdf2e

Branch: refs/pull/76/head
Commit: ab9fdf2e5251a6b79376d7d7c9a89349c108b66a
Parents: 5a43bb5 63fb1ca
Author: Dave Johnson <da...@rollerweblogger.org>
Authored: Mon Mar 10 12:18:00 2014 -0400
Committer: Dave Johnson <da...@rollerweblogger.org>
Committed: Mon Mar 10 12:18:00 2014 -0400

----------------------------------------------------------------------
 .../org/apache/usergrid/persistence/Query.java  |   5 +-
 .../usergrid/persistence/entities/Export.java   | 158 +++++
 .../rest/management/ManagementResource.java     |  15 +-
 .../applications/ApplicationResource.java       | 181 ++++-
 .../rest/management/ManagementResourceIT.java   | 497 ++++++++++++-
 .../usergrid/management/export/ExportJob.java   |  81 +++
 .../management/export/ExportService.java        |  48 ++
 .../management/export/ExportServiceImpl.java    | 608 ++++++++++++++++
 .../usergrid/management/export/S3Export.java    |  35 +
 .../management/export/S3ExportImpl.java         | 109 +++
 .../resources/usergrid-services-context.xml     |  10 +
 .../org/apache/usergrid/ServiceITSetup.java     |   3 +
 .../org/apache/usergrid/ServiceITSetupImpl.java |   6 +
 .../cassandra/ManagementServiceIT.java          | 707 ++++++++++++++++++-
 .../management/cassandra/MockS3ExportImpl.java  |  72 ++
 15 files changed, 2515 insertions(+), 20 deletions(-)
----------------------------------------------------------------------



[43/55] [abbrv] git commit: [DPS-865] Client will accept a 'default_qs' object with the options that will automatically populate the query string for each subsequent request. any query params passed directly to the request method will override these defa

Posted by sn...@apache.org.
[DPS-865] Client will accept a 'default_qs' object with the options that will automatically populate the query string for each subsequent request. any query params passed directly to the request method will override these defaults in the event of a conflict.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/00afe2c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/00afe2c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/00afe2c1

Branch: refs/pull/76/head
Commit: 00afe2c166956681c1c1145989ca9d83942b63f8
Parents: dee2ca9
Author: ryan bridges <rb...@apigee.com>
Authored: Thu Mar 13 09:08:24 2014 -0400
Committer: ryan bridges <rb...@apigee.com>
Committed: Thu Mar 13 10:28:48 2014 -0400

----------------------------------------------------------------------
 sdks/html5-javascript/lib/Usergrid.js       | 13 ++++++++++++-
 sdks/html5-javascript/lib/modules/Client.js | 10 ++++++++--
 2 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/00afe2c1/sdks/html5-javascript/lib/Usergrid.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/lib/Usergrid.js b/sdks/html5-javascript/lib/Usergrid.js
index a4dbe9b..2595e7c 100644
--- a/sdks/html5-javascript/lib/Usergrid.js
+++ b/sdks/html5-javascript/lib/Usergrid.js
@@ -40,7 +40,18 @@ function extend(subClass, superClass) {
     }
     return subClass;
 }
-
+function propCopy(from, to){
+    for(var prop in from){
+        if(from.hasOwnProperty(prop)){
+            if("object"===typeof from[prop] && "object"===typeof to[prop]){
+                to[prop]=propCopy(from[prop], to[prop]);
+            }else{
+                to[prop]=from[prop];
+            }
+        }
+    }
+    return to;
+}
 function NOOP(){}
 
 //Usergrid namespace encapsulates this SDK

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/00afe2c1/sdks/html5-javascript/lib/modules/Client.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/lib/modules/Client.js b/sdks/html5-javascript/lib/modules/Client.js
index 38db3b1..242b08b 100644
--- a/sdks/html5-javascript/lib/modules/Client.js
+++ b/sdks/html5-javascript/lib/modules/Client.js
@@ -12,7 +12,9 @@
     if (options.appName) {
       this.set('appName', options.appName);
     }
-
+    if(options.qs){
+      this.setObject('default_qs', options.qs);
+    }
     //other options
     this.buildCurl = options.buildCurl || false;
     this.logging = options.logging || false;
@@ -48,6 +50,7 @@
     var mQuery = options.mQuery || false; //is this a query to the management endpoint?
     var orgName = this.get('orgName');
     var appName = this.get('appName');
+    var default_qs=this.get('default_qs');
     var uri;
       var logoutCallback=function(){
           if (typeof(this.logoutCallback) === 'function') {
@@ -69,6 +72,9 @@
        xhr.withCredentials = true;
        */
     }
+    if(default_qs){
+      qs=propCopy(qs, default_qs);
+    }
       var req = new Usergrid.Request(method, uri, qs, body, function (err, response) {
           if ([
               "auth_expired_session_token",
@@ -238,7 +244,7 @@
    */
   Usergrid.Client.prototype.createCollection = function (options, callback) {
     options.client = this;
-    var collection = new Usergrid.Collection(options, function(err, data) {
+    new Usergrid.Collection(options, function(err, data, collection) {
         doCallback(callback, [err, collection, data]);
     });
   };


[04/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/usergrid.min.js
----------------------------------------------------------------------
diff --git a/portal/js/usergrid.min.js b/portal/js/usergrid.min.js
index f94947b..4c7e347 100644
--- a/portal/js/usergrid.min.js
+++ b/portal/js/usergrid.min.js
@@ -1,6 +1,6 @@
-/*! apigee-usergrid@2.0.34 2014-03-03 */
-!function(exports,global){function renderChart(chartsDefaults,chartdata){var newSettings={};$.extend(!0,newSettings,chartsDefaults,chartdata);new Highcharts.Chart(newSettings)}function menuBindClick(scope,lElement,cevent,menuContext){var currentSelection=angular.element(cevent.srcElement).parent(),previousSelection=scope[menuContext];previousSelection!==currentSelection&&(previousSelection&&angular.element(previousSelection).removeClass("active"),scope[menuContext]=currentSelection,scope.$apply(function(){currentSelection.addClass("active")}))}global["true"]=exports;var polyfills=function(window,Object){window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)}}(),Object.defineProperty(Object.prototype,"clone",{enumerable:!1,writable:!0,value:function(){var i,newObj=this instanceof Arra
 y?[]:{};for(i in this)"clone"!==i&&(newObj[i]=this[i]&&"object"==typeof this[i]?this[i].clone():this[i]);return newObj}}),Object.defineProperty(Object.prototype,"stringifyJSON",{enumerable:!1,writable:!0,value:function(){return JSON.stringify(this,null,"	")}})};polyfills(window,Object);var AppServices=AppServices||{};global.AppServices=global.AppServices||AppServices,AppServices.Constants=angular.module("appservices.constants",[]),AppServices.Services=angular.module("appservices.services",[]),AppServices.Controllers=angular.module("appservices.controllers",[]),AppServices.Filters=angular.module("appservices.filters",[]),AppServices.Directives=angular.module("appservices.directives",[]),angular.module("appservices",["ngRoute","ngResource","ngSanitize","ui.bootstrap","appservices.filters","appservices.services","appservices.directives","appservices.constants","appservices.controllers"]).config(["$routeProvider","$locationProvider","$sceDelegateProvider",function($routeProvider,$locati
 onProvider,$sceDelegateProvider){$routeProvider.when("/org-overview",{templateUrl:"org-overview/org-overview.html",controller:"OrgOverviewCtrl"}).when("/login",{templateUrl:"login/login.html",controller:"LoginCtrl"}).when("/login/loading",{templateUrl:"login/loading.html",controller:"LoginCtrl"}).when("/app-overview/summary",{templateUrl:"app-overview/app-overview.html",controller:"AppOverviewCtrl"}).when("/getting-started/setup",{templateUrl:"app-overview/getting-started.html",controller:"GettingStartedCtrl"}).when("/forgot-password",{templateUrl:"login/forgot-password.html",controller:"ForgotPasswordCtrl"}).when("/register",{templateUrl:"login/register.html",controller:"RegisterCtrl"}).when("/users",{templateUrl:"users/users.html",controller:"UsersCtrl"}).when("/users/profile",{templateUrl:"users/users-profile.html",controller:"UsersProfileCtrl"}).when("/users/groups",{templateUrl:"users/users-groups.html",controller:"UsersGroupsCtrl"}).when("/users/activities",{templateUrl:"users
 /users-activities.html",controller:"UsersActivitiesCtrl"}).when("/users/graph",{templateUrl:"users/users-graph.html",controller:"UsersGraphCtrl"}).when("/users/roles",{templateUrl:"users/users-roles.html",controller:"UsersRolesCtrl"}).when("/groups",{templateUrl:"groups/groups.html",controller:"GroupsCtrl"}).when("/groups/details",{templateUrl:"groups/groups-details.html",controller:"GroupsDetailsCtrl"}).when("/groups/members",{templateUrl:"groups/groups-members.html",controller:"GroupsMembersCtrl"}).when("/groups/activities",{templateUrl:"groups/groups-activities.html",controller:"GroupsActivitiesCtrl"}).when("/groups/roles",{templateUrl:"groups/groups-roles.html",controller:"GroupsRolesCtrl"}).when("/roles",{templateUrl:"roles/roles.html",controller:"RolesCtrl"}).when("/roles/settings",{templateUrl:"roles/roles-settings.html",controller:"RolesSettingsCtrl"}).when("/roles/users",{templateUrl:"roles/roles-users.html",controller:"RolesUsersCtrl"}).when("/roles/groups",{templateUrl:"r
 oles/roles-groups.html",controller:"RolesGroupsCtrl"}).when("/data",{templateUrl:"data/data.html",controller:"DataCtrl"}).when("/data/entity",{templateUrl:"data/entity.html",controller:"EntityCtrl"}).when("/data/shell",{templateUrl:"data/shell.html",controller:"ShellCtrl"}).when("/profile/organizations",{templateUrl:"profile/organizations.html",controller:"OrgCtrl"}).when("/profile/profile",{templateUrl:"profile/profile.html",controller:"ProfileCtrl"}).when("/profile",{templateUrl:"profile/account.html",controller:"AccountCtrl"}).when("/activities",{templateUrl:"activities/activities.html",controller:"ActivitiesCtrl"}).when("/shell",{templateUrl:"shell/shell.html",controller:"ShellCtrl"}).when("/logout",{templateUrl:"login/logout.html",controller:"LogoutCtrl"}).otherwise({redirectTo:"/org-overview"}),$locationProvider.html5Mode(!1).hashPrefix("!"),$sceDelegateProvider.resourceUrlWhitelist(["self","http://apigee-internal-prod.jupiter.apigee.net/**","http://apigee-internal-prod.mars.a
 pigee.net/**","https://appservices.apigee.com/**","https://api.usergrid.com/**"])}]),AppServices.Controllers.controller("ActivitiesCtrl",["ug","$scope","$rootScope","$location","$route",function(ug,$scope,$rootScope){$scope.$on("app-activities-received",function(evt,data){$scope.activities=data,$scope.$apply()}),$scope.$on("app-activities-error",function(){$rootScope.$broadcast("alert","error","Application failed to retreive activities data.")}),ug.getActivities()}]),AppServices.Controllers.controller("AppOverviewCtrl",["ug","charts","$scope","$rootScope","$log",function(ug,charts,$scope,$rootScope,$log){var createGradient=function(color1,color2){var perShapeGradient={x1:0,y1:0,x2:0,y2:1};return{linearGradient:perShapeGradient,stops:[[0,color1],[1,color2]]}};$scope.appOverview={},$scope.collections=[],$scope.graph="",$scope.$on("top-collections-received",function(event,collections){var dataDescription={bar1:{labels:["Total"],dataAttr:["title","count"],colors:[createGradient("rgba(36
 ,151,212,0.6)","rgba(119,198,240,0.6)")],borderColor:"#1b97d1"}};$scope.collections=collections;var arr=[];for(var i in collections)collections.hasOwnProperty(i)&&arr.push(collections[i]);$scope.appOverview={},$rootScope.chartTemplate?($scope.appOverview.chart=angular.copy($rootScope.chartTemplate.pareto),$scope.appOverview.chart=charts.convertParetoChart(arr,$scope.appOverview.chart,dataDescription.bar1,"1h","NOW"),$scope.applyScope()):ug.httpGet(null,"js/charts/highcharts.json").then(function(success){$rootScope.chartTemplate=success,$scope.appOverview.chart=angular.copy($rootScope.chartTemplate.pareto),$scope.appOverview.chart=charts.convertParetoChart(arr,$scope.appOverview.chart,dataDescription.bar1,"1h","NOW"),$scope.applyScope()},function(fail){$log.error("Problem getting chart template",fail)})}),$scope.$on("app-initialized",function(){ug.getTopCollections()}),$rootScope.activeUI&&ug.getTopCollections()}]),AppServices.Controllers.controller("GettingStartedCtrl",["ug","$scope
 ","$rootScope","$location","$timeout","$anchorScroll",function(ug,$scope,$rootScope,$location,$timeout,$anchorScroll){$scope.collections=[],$scope.graph="",$scope.clientID="",$scope.clientSecret="";$scope.regenerateCredentialsDialog=function(modalId){$scope.orgAPICredentials={client_id:"regenerating...",client_secret:"regenerating..."},ug.regenerateAppCredentials(),$scope.hideModal(modalId)},$scope.$on("app-creds-updated",function(event,credentials){credentials?($scope.clientID=credentials.client_id,$scope.clientSecret=credentials.client_secret,$scope.$$phase||$scope.$apply()):setTimeout(function(){ug.getAppCredentials()},5e3)}),ug.getAppCredentials(),$scope.contentTitle,$scope.showSDKDetail=function(name){var introContainer=document.getElementById("intro-container");if("nocontent"===name)return introContainer.style.height="0",!0;introContainer.style.opacity=.1,introContainer.style.height="0";var timeout=0;$scope.contentTitle&&(timeout=500),$timeout(function(){introContainer.style.h
 eight="1000px",introContainer.style.opacity=1},timeout),$scope.optionName=name,$scope.contentTitle=name,$scope.sdkLink="http://apigee.com/docs/content/"+name+"-sdk-redirect",$scope.docsLink="http://apigee.com/docs/app-services/content/installing-apigee-sdk-"+name,$scope.getIncludeURL=function(){return"app-overview/doc-includes/"+$scope.optionName+".html"}},$scope.scrollToElement=function(elem){return $location.hash(elem),$anchorScroll(),!1}}]),AppServices.Controllers.controller("ChartCtrl",["$scope","$location",function(){}]),AppServices.Directives.directive("chart",function(){return{restrict:"E",scope:{chartdata:"=chartdata"},template:"<div></div>",replace:!0,controller:function(){},link:function(scope,element,attrs){scope.$watch("chartdata",function(chartdata){if(chartdata){var chartsDefaults={chart:{renderTo:element[0],type:attrs.type||null,height:attrs.height||null,width:attrs.width||null,reflow:!0,animation:!1,zoomType:"x"}};if("pie"===attrs.type&&(chartsDefaults.chart.margin=[
 0,0,0,0],chartsDefaults.chart.spacingLeft=0,chartsDefaults.chart.spacingRight=0,chartsDefaults.chart.spacingTop=0,chartsDefaults.chart.spacingBottom=0,attrs.titleimage&&(chartdata.title.text='<img src="'+attrs.titleimage+'">'),attrs.titleicon&&(chartdata.title.text='<i class="pictogram '+attrs.titleiconclass+'">'+attrs.titleicon+"</i>"),attrs.titlecolor&&(chartdata.title.style.color=attrs.titlecolor),attrs.titleimagetop&&(chartdata.title.style.marginTop=attrs.titleimagetop),attrs.titleimageleft&&(chartdata.title.style.marginLeft=attrs.titleimageleft)),"line"===attrs.type&&(chartsDefaults.chart.marginTop=30,chartsDefaults.chart.spacingTop=50),"column"===attrs.type&&(chartsDefaults.chart.marginBottom=80),"area"===attrs.type&&(chartsDefaults.chart.spacingLeft=0,chartsDefaults.chart.spacingRight=0,chartsDefaults.chart.marginLeft=0,chartsDefaults.chart.marginRight=0),Highcharts.setOptions({global:{useUTC:!1},chart:{style:{fontFamily:"marquette-light, Helvetica, Arial, sans-serif"}}}),"li
 ne"===attrs.type){var xAxis1=chartdata.xAxis[0];xAxis1.labels.formatter||(xAxis1.labels.formatter=new Function(attrs.xaxislabel)),xAxis1.labels.step||(xAxis1.labels.step=attrs.xaxisstep)}chartdata.tooltip&&"string"==typeof chartdata.tooltip.formatter&&(chartdata.tooltip.formatter=new Function(chartdata.tooltip.formatter)),renderChart(chartsDefaults,chartdata)}},!0)}}}),AppServices.Services.factory("charts",function(){function sortJsonArrayByProperty(objArray,prop){if(arguments.length<2)throw new Error("sortJsonArrayByProp requires 2 arguments");var direct=arguments.length>2?arguments[2]:1;if(objArray&&objArray.constructor===Array){var propPath=prop.constructor===Array?prop:prop.split(".");objArray.sort(function(a,b){for(var p in propPath)a[propPath[p]]&&b[propPath[p]]&&(a=a[propPath[p]],b=b[propPath[p]]);return a=a.match(/^\d+$/)?+a:a,b=b.match(/^\d+$/)?+b:b,b>a?-1*direct:a>b?1*direct:0})}}var lineChart,areaChart,paretoChart,pieChart,xaxis,seriesIndex;return{convertLineChart:functio
 n(chartData,chartTemplate,dataDescription,settings,currentCompare){function plotData(counter,dPLength,dataPoints,dataAttrs,detailedView){for(var i=0;dPLength>i;i++)for(var dp=dataPoints[i],localCounter=counter,j=0;j<dataAttrs.length;j++)lineChart.series[localCounter].data.push("undefined"==typeof dp?[i,0]:[i,dp[dataAttrs[j]]]),detailedView||localCounter++}lineChart=chartTemplate,"undefined"==typeof chartData[0]&&(chartData[0]={},chartData[0].datapoints=[]);var label,dataPoints=chartData[0].datapoints,dPLength=dataPoints.length;"YESTERDAY"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Yesterday "):"LAST_WEEK"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Last Week "):(lineChart=chartTemplate,seriesIndex=0,lineChart.series=[],label=""),xaxis=lineChart.xAxis[0],xaxis.categories=[],settings.xaxisformat&&(xaxis.labels.formatter=new Function(settings.xaxisformat)),settings.step&&(xaxis.labels.step=settings.step);for(var i=0;dPLength>i;i++){var
  dp=dataPoints[i];xaxis.categories.push(dp.timestamp)}if(chartData.length>1)for(var l=0;l<chartData.length;l++)chartData[l].chartGroupName&&(dataPoints=chartData[l].datapoints,lineChart.series[l]={},lineChart.series[l].data=[],lineChart.series[l].name=chartData[l].chartGroupName,lineChart.series[l].yAxis=0,lineChart.series[l].type="line",lineChart.series[l].color=dataDescription.colors[i],lineChart.series[l].dashStyle="solid",lineChart.series[l].yAxis.title.text=dataDescription.yAxisLabels,plotData(l,dPLength,dataPoints,dataDescription.detailDataAttr,!0));else{for(var steadyCounter=0,i=seriesIndex;i<dataDescription.dataAttr.length+(seriesIndex>0?seriesIndex:0);i++){var yAxisIndex=dataDescription.multiAxis?steadyCounter:0;lineChart.series[i]={},lineChart.series[i].data=[],lineChart.series[i].name=label+dataDescription.labels[steadyCounter],lineChart.series[i].yAxis=yAxisIndex,lineChart.series[i].type="line",lineChart.series[i].color=dataDescription.colors[i],lineChart.series[i].dashS
 tyle="solid",lineChart.yAxis[yAxisIndex].title.text=dataDescription.yAxisLabels[dataDescription.yAxisLabels>1?steadyCounter:0],steadyCounter++}plotData(seriesIndex,dPLength,dataPoints,dataDescription.dataAttr,!1)}return lineChart},convertAreaChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function plotData(counter,dPLength,dataPoints,dataAttrs,detailedView){for(var i=0;dPLength>i;i++)for(var dp=dataPoints[i],localCounter=counter,j=0;j<dataAttrs.length;j++)areaChart.series[localCounter].data.push("undefined"==typeof dp?0:dp[dataAttrs[j]]),detailedView||localCounter++}areaChart=angular.copy(areaChart),"undefined"==typeof chartData[0]&&(chartData[0]={},chartData[0].datapoints=[]);var label,dataPoints=chartData[0].datapoints,dPLength=dataPoints.length;"YESTERDAY"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Yesterday "):"LAST_WEEK"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Last Week "):(areaChart=chartTem
 plate,seriesIndex=0,areaChart.series=[],label=""),xaxis=areaChart.xAxis[0],xaxis.categories=[],settings.xaxisformat&&(xaxis.labels.formatter=new Function(settings.xaxisformat)),settings.step&&(xaxis.labels.step=settings.step);for(var i=0;dPLength>i;i++){var dp=dataPoints[i];xaxis.categories.push(dp.timestamp)}if(chartData.length>1)for(var l=0;l<chartData.length;l++)chartData[l].chartGroupName&&(dataPoints=chartData[l].datapoints,areaChart.series[l]={},areaChart.series[l].data=[],areaChart.series[l].fillColor=dataDescription.areaColors[l],areaChart.series[l].name=chartData[l].chartGroupName,areaChart.series[l].yAxis=0,areaChart.series[l].type="area",areaChart.series[l].pointInterval=1,areaChart.series[l].color=dataDescription.colors[l],areaChart.series[l].dashStyle="solid",areaChart.series[l].yAxis.title.text=dataDescription.yAxisLabels,plotData(l,dPLength,dataPoints,dataDescription.detailDataAttr,!0));else{for(var steadyCounter=0,i=seriesIndex;i<dataDescription.dataAttr.length+(seri
 esIndex>0?seriesIndex:0);i++){var yAxisIndex=dataDescription.multiAxis?steadyCounter:0;areaChart.series[i]={},areaChart.series[i].data=[],areaChart.series[i].fillColor=dataDescription.areaColors[i],areaChart.series[i].name=label+dataDescription.labels[steadyCounter],areaChart.series[i].yAxis=yAxisIndex,areaChart.series[i].type="area",areaChart.series[i].pointInterval=1,areaChart.series[i].color=dataDescription.colors[i],areaChart.series[i].dashStyle="solid",areaChart.yAxis[yAxisIndex].title.text=dataDescription.yAxisLabels[dataDescription.yAxisLabels>1?steadyCounter:0],steadyCounter++}plotData(seriesIndex,dPLength,dataPoints,dataDescription.dataAttr,!1)}return areaChart},convertParetoChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function getPreviousData(){for(var i=0;i<chartTemplate.series[0].data.length;i++)allParetoOptions.push(chartTemplate.xAxis.categories[i])}function createStackedBar(dataDescription,paretoChart){paretoChart.plotOptions={series
 :{shadow:!1,borderColor:dataDescription.borderColor,borderWidth:1},column:{stacking:"normal",dataLabels:{enabled:!0,color:Highcharts.theme&&Highcharts.theme.dataLabelsColor||"white"}}};var start=dataDescription.dataAttr[1].length,steadyCounter=0;compare&&(paretoChart.legend.enabled=!0);for(var f=seriesIndex;start+seriesIndex>f;f++)paretoChart.series[f]||(paretoChart.series[f]={data:[]}),paretoChart.series[f].data.push(bar[dataDescription.dataAttr[1][steadyCounter]]),paretoChart.series[f].name=""!==label?label+" "+dataDescription.labels[steadyCounter]:dataDescription.labels[steadyCounter],paretoChart.series[f].color=dataDescription.colors[f],paretoChart.series[f].stack=label,steadyCounter++}paretoChart=chartTemplate,"undefined"==typeof chartData&&(chartData=[]);var label,cdLength=chartData.length,compare=!1,allParetoOptions=[],stackedBar=!1;if(seriesIndex=0,"object"==typeof dataDescription.dataAttr[1]&&(stackedBar=!0),"YESTERDAY"===currentCompare?(label="Yesterday ",compare=!0,stacke
 dBar&&(seriesIndex=dataDescription.dataAttr[1].length),getPreviousData()):"LAST_WEEK"===currentCompare?(label="Last Week ",compare=!0,stackedBar&&(seriesIndex=dataDescription.dataAttr[1].length),seriesIndex=getPreviousData()):(compare=!1,label="",paretoChart.xAxis.categories=[],paretoChart.series=[],paretoChart.series[0]={},paretoChart.series[0].data=[],paretoChart.legend.enabled=!1),paretoChart.plotOptions.series.borderColor=dataDescription.borderColor,compare&&!stackedBar){paretoChart.series[1]={},paretoChart.series[1].data=[];for(var i=0;i<allParetoOptions.length;i++)paretoChart.series[1].data.push(0);paretoChart.legend.enabled=!0}for(var i=0;cdLength>i;i++){var bar=chartData[i];if(compare){var newLabel=bar[dataDescription.dataAttr[0]],newValue=bar[dataDescription.dataAttr[1]],previousIndex=allParetoOptions.indexOf(newLabel);previousIndex>-1&&("object"==typeof dataDescription.dataAttr[1]?createStackedBar(dataDescription,paretoChart,paretoChart.series.length):(paretoChart.series[1
 ].data[previousIndex]=newValue,paretoChart.series[1].name=""!==label?label+" "+dataDescription.labels[0]:dataDescription.labels[0],paretoChart.series[1].color=dataDescription.colors[1]))}else paretoChart.xAxis.categories.push(bar[dataDescription.dataAttr[0]]),"object"==typeof dataDescription.dataAttr[1]?createStackedBar(dataDescription,paretoChart,paretoChart.series.length):(paretoChart.series[0].data.push(bar[dataDescription.dataAttr[1]]),paretoChart.series[0].name=dataDescription.labels[0],paretoChart.series[0].color=dataDescription.colors[0])}return paretoChart},convertPieChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){var label,cdLength=chartData.length,compare=!1;pieChart=chartTemplate,"YESTERDAY"===currentCompare?(label="Yesterday ",compare=!1):"LAST_WEEK"===currentCompare?(label="Last Week ",compare=!1):(compare=!1,pieChart.series[0].data=[],pieChart.series[0].dataLabels&&"string"==typeof pieChart.series[0].dataLabels.formatter&&(pieChart.serie
 s[0].dataLabels.formatter=new Function(pieChart.series[0].dataLabels.formatter))),pieChart.plotOptions.pie.borderColor=dataDescription.borderColor,compare&&(pieChart.series[1].data=[],pieChart.series[1].dataLabels&&"string"==typeof pieChart.series[1].dataLabels.formatter&&(pieChart.series[1].dataLabels.formatter=new Function(pieChart.series[1].dataLabels.formatter)));for(var tempArray=[],i=0;cdLength>i;i++){var pie=chartData[i];tempArray.push({name:pie[dataDescription.dataAttr[0]],y:pie[dataDescription.dataAttr[1]],color:""})}sortJsonArrayByProperty(tempArray,"name");for(var i=0;i<tempArray.length;i++)tempArray[i].color=dataDescription.colors[i];return compare?pieChart.series[1].data=tempArray:pieChart.series[0].data=tempArray,pieChart}}}),$(".sessions-bar").sparkline([3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,1],{type:"bar",barColor:"#c5c5c5",width:"800px",height:100,barWidth:12,barSpacing:"1px"}),AppServic
 es.Controllers.controller("DataCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope){var init=function(){$scope.verb="GET",$scope.display="",$scope.queryBodyDetail={},$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.entitySelected={},$scope.newCollection={},$rootScope.queryCollection={},$scope.data={},$scope.data.queryPath="",$scope.data.queryBody='{ "name":"value" }',$scope.data.searchString="",$scope.data.queryLimit=""},runQuery=function(verb){$scope.loading=!0;var queryPath=$scope.removeFirstSlash($scope.data.queryPath||""),searchString=$scope.data.searchString||"",queryLimit=$scope.data.queryLimit||"",body=JSON.parse($scope.data.queryBody||"{}");"POST"==verb&&$scope.validateJson(!0)?ug.runDataPOSTQuery(queryPath,body):"PUT"==verb&&$scope.validateJson(!0)?ug.runDataPutQuery(queryPath,searchString,queryLimit,body):"DELETE"==verb?ug.runDataDeleteQuery(queryPath,searchString,queryLimit):ug.runDataQuery(qu
 eryPath,searchString,queryLimit)};$scope.$on("top-collections-received",function(event,collectionList){$scope.loading=!1;var ignoredCollections=["events"];ignoredCollections.forEach(function(ignoredCollection){collectionList.hasOwnProperty(ignoredCollection)&&delete collectionList[ignoredCollection]}),$scope.collectionList=collectionList,$scope.queryBoxesSelected=!1,$scope.queryPath||$scope.loadCollection("/"+collectionList[Object.keys(collectionList).sort()[0]].name),$scope.applyScope()}),$scope.$on("error-running-query",function(){$scope.loading=!1,runQuery("GET"),$scope.applyScope()}),$scope.$on("entity-deleted",function(){$scope.deleteLoading=!1,$rootScope.$broadcast("alert","success","Entities deleted sucessfully"),$scope.queryBoxesSelected=!1,$scope.checkNextPrev(),$scope.applyScope()}),$scope.$on("entity-deleted-error",function(){$scope.deleteLoading=!1,runQuery("GET"),$scope.applyScope()}),$scope.$on("collection-created",function(){$scope.newCollection.name=""}),$scope.$on("
 query-received",function(event,collection){$scope.loading=!1,$rootScope.queryCollection=collection,ug.getIndexes($scope.data.queryPath),$scope.setDisplayType(),$scope.checkNextPrev(),$scope.applyScope(),$scope.queryBoxesSelected=!1}),$scope.$on("indexes-received",function(event,indexes){}),$scope.$on("app-changed",function(){init()}),$scope.setDisplayType=function(){$scope.display="generic"},$scope.deleteEntitiesDialog=function(modalId){$scope.deleteLoading=!1,$scope.deleteEntities($rootScope.queryCollection,"entity-deleted","error deleting entity"),$scope.hideModal(modalId)},$scope.newCollectionDialog=function(modalId){$scope.newCollection.name?(ug.createCollection($scope.newCollection.name),ug.getTopCollections(),$rootScope.$broadcast("alert","success","Collection created successfully."),$scope.hideModal(modalId)):$rootScope.$broadcast("alert","error","You must specify a collection name.")},$scope.addToPath=function(uuid){$scope.data.queryPath="/"+$rootScope.queryCollection._type+
 "/"+uuid},$scope.isDeep=function(item){return"[object Object]"===Object.prototype.toString.call(item)},$scope.loadCollection=function(type){$scope.data.queryPath="/"+type.substring(1,type.length),$scope.data.searchString="",$scope.data.queryLimit="",$scope.data.body='{ "name":"value" }',$scope.selectGET(),$scope.applyScope(),$scope.run()},$scope.selectGET=function(){$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="GET"},$scope.selectPOST=function(){$scope.queryBodyDisplay="block",$scope.queryLimitDisplay="none",$scope.queryStringDisplay="none",$scope.verb="POST"},$scope.selectPUT=function(){$scope.queryBodyDisplay="block",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="PUT"},$scope.selectDELETE=function(){$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="DELETE"},$scope.validateJson=function(skipMessage){var queryBody=$scope.data.
 queryBody;try{queryBody=JSON.parse(queryBody)}catch(e){return $rootScope.$broadcast("alert","error","JSON is not valid"),!1}return queryBody=JSON.stringify(queryBody,null,2),!skipMessage&&$rootScope.$broadcast("alert","success","JSON is valid"),$scope.data.queryBody=queryBody,!0},$scope.saveEntity=function(entity){if(!$scope.validateJson())return!1;var queryBody=entity._json;queryBody=JSON.parse(queryBody),$rootScope.selectedEntity.set(),$rootScope.selectedEntity.set(queryBody),$rootScope.selectedEntity.set("type",entity._data.type),$rootScope.selectedEntity.set("uuid",entity._data.uuid),$rootScope.selectedEntity.save(function(err,data){err?$rootScope.$broadcast("alert","error","error: "+data.error_description):$rootScope.$broadcast("alert","success","entity saved")})},$scope.run=function(){$rootScope.queryCollection="";var verb=$scope.verb;runQuery(verb)},$scope.hasProperty=function(prop){var retval=!1;return"undefined"!=typeof $rootScope.queryCollection._list&&angular.forEach($roo
 tScope.queryCollection._list,function(value){retval||value._data[prop]&&(retval=!0)}),retval},$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$rootScope.queryCollection.hasPreviousPage()&&($scope.previous_display="default"),$rootScope.queryCollection.hasNextPage()&&($scope.next_display="default")},$scope.selectEntity=function(uuid){$rootScope.selectedEntity=$rootScope.queryCollection.getEntityByUUID(uuid),$scope.addToPath(uuid)},$scope.getJSONView=function(entity){var tempjson=entity.get(),queryBody=JSON.stringify(tempjson,null,2);queryBody=JSON.parse(queryBody),delete queryBody.metadata,delete queryBody.uuid,delete queryBody.created,delete queryBody.modified,delete queryBody.type,$scope.queryBody=JSON.stringify(queryBody,null,2)},$scope.getPrevious=function(){$rootScope.queryCollection.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page
  of data"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.getNext=function(){$rootScope.queryCollection.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of data"),$scope.checkNextPrev(),$scope.applyScope()})},init(),$rootScope.queryCollection=$rootScope.queryCollection||{},$rootScope.selectedEntity={},$rootScope.queryCollection&&$rootScope.queryCollection._type&&($scope.loadCollection($rootScope.queryCollection._type),$scope.setDisplayType()),ug.getTopCollections(),$scope.resetNextPrev()}]),AppServices.Controllers.controller("EntityCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){if(!$rootScope.selectedEntity)return void $location.path("/data");$scope.entityUUID=$rootScope.selectedEntity.get("uuid"),$scope.entityType=$rootScope.selectedEntity.get("type");var tempjson=$rootScope.selectedEntity.get(),queryBody=JSON.stringify(tempjson,null,2);queryBody=JSON.parse(queryBody),delete queryBody.metadat
 a,delete queryBody.uuid,delete queryBody.created,delete queryBody.modified,delete queryBody.type,$scope.queryBody=JSON.stringify(queryBody,null,2),$scope.validateJson=function(){var queryBody=$scope.queryBody;try{queryBody=JSON.parse(queryBody)}catch(e){return $rootScope.$broadcast("alert","error","JSON is not valid"),!1}return queryBody=JSON.stringify(queryBody,null,2),$rootScope.$broadcast("alert","success","JSON is valid"),$scope.queryBody=queryBody,!0},$scope.saveEntity=function(){if(!$scope.validateJson())return!1;var queryBody=$scope.queryBody;queryBody=JSON.parse(queryBody),$rootScope.selectedEntity.set(),$rootScope.selectedEntity.set(queryBody),$rootScope.selectedEntity.set("type",$scope.entityType),$rootScope.selectedEntity.set("uuid",$scope.entityUUID),$rootScope.selectedEntity.save(function(err,data){err?$rootScope.$broadcast("alert","error","error: "+data.error_description):$rootScope.$broadcast("alert","success","entity saved")})}}]),AppServices.Controllers.controller("
 ShellCtrl",["ug","$scope","$rootScope","$location",function(){}]),AppServices.Directives.directive("balloon",["$window","$timeout",function($window,$timeout){return{restrict:"ECA",scope:"=",template:'<div class="baloon {{direction}}" ng-transclude></div>',replace:!0,transclude:!0,link:function(scope,lElement,attrs){scope.direction=attrs.direction;var runScroll=!0,windowEl=angular.element($window);windowEl.on("scroll",function(){runScroll&&(lElement.addClass("fade-out"),$timeout(function(){lElement.addClass("hide")},1e3),runScroll=!1)})}}}]),AppServices.Directives.directive("bsmodal",["$rootScope",function($rootScope){return{restrict:"ECA",scope:{title:"@title",buttonid:"=buttonid",footertext:"=footertext",closelabel:"=closelabel"},transclude:!0,templateUrl:"dialogs/modal.html",replace:!0,link:function(scope,lElement,attrs,parentCtrl){scope.title=attrs.title,scope.footertext=attrs.footertext,scope.closelabel=attrs.closelabel,scope.close=attrs.close,scope.extrabutton=attrs.extrabutton
 ,scope.extrabuttonlabel=attrs.extrabuttonlabel,scope.buttonId=attrs.buttonid,scope.closeDelegate=function(attr){scope.$parent[attr](attrs.id,scope)},scope.extraDelegate=function(attr){scope.dialogForm.$valid?(console.log(parentCtrl),scope.$parent[attr](attrs.id)):$rootScope.$broadcast("alert","error","Please check your form input and resubmit.")}}}}]),AppServices.Controllers.controller("AlertCtrl",["$scope","$rootScope","$timeout",function($scope,$rootScope,$timeout){$scope.alertDisplay="none",$scope.alerts=[],$scope.$on("alert",function(event,type,message,permanent){$scope.addAlert(type,message,permanent)}),$scope.$on("clear-alerts",function(){$scope.alerts=[]}),$scope.addAlert=function(type,message,permanent){$scope.alertDisplay="block",$scope.alerts.push({type:type,msg:message}),$scope.applyScope(),permanent||$timeout(function(){$scope.alerts.shift()},5e3)},$scope.closeAlert=function(index){$scope.alerts.splice(index,1)}}]),AppServices.Directives.directive("alerti",["$rootScope",
 "$timeout",function($rootScope,$timeout){return{restrict:"ECA",scope:{type:"=type",closeable:"@closeable",index:"&index"},template:'<div class="alert" ng-class="type && \'alert-\' + type">    <button ng-show="closeable" type="button" class="close" ng-click="closeAlert(index)">&times;</button>    <i ng-if="type === \'warning\'" class="pictogram pull-left" style="font-size:3em;line-height:0.4">&#128165;</i>    <i ng-if="type === \'info\'" class="pictogram pull-left">&#8505;</i>    <i ng-if="type === \'error\'" class="pictogram pull-left">&#9889;</i>    <i ng-if="type === \'success\'" class="pictogram pull-left">&#128077;</i><div ng-transclude></div></div>',replace:!0,transclude:!0,link:function(scope,lElement,attrs){$timeout(function(){lElement.addClass("fade-out")},4e3),lElement.click(function(){attrs.index&&scope.$parent.closeAlert(attrs.index)}),setTimeout(function(){lElement.addClass("alert-animate")},10)}}}]),AppServices.Directives.directive("appswitcher",["$rootScope",function()
 {return{restrict:"ECA",scope:"=",templateUrl:"global/appswitcher-template.html",replace:!0,transclude:!0,link:function(){function globalNavDetail(){$("#globalNavDetail > div").removeClass(classNameOpen),$("#globalNavDetailApiPlatform").addClass(classNameOpen)}var classNameOpen="open";$("ul.nav li.dropdownContainingSubmenu").hover(function(){$(this).addClass(classNameOpen)},function(){$(this).removeClass(classNameOpen)}),$("#globalNav > a").mouseover(globalNavDetail),$("#globalNavDetail").mouseover(globalNavDetail),$("#globalNavSubmenuContainer ul li").mouseover(function(){$("#globalNavDetail > div").removeClass(classNameOpen),$("#"+this.getAttribute("data-globalNavDetail")).addClass(classNameOpen)})}}}]),AppServices.Directives.directive("insecureBanner",["$rootScope","ug",function($rootScope,ug){return{restrict:"E",transclude:!0,templateUrl:"global/insecure-banner.html",link:function(scope){scope.securityWarning=!1,scope.$on("roles-received",function(evt,roles){scope.securityWarning
 =!1,roles&&roles._list&&roles._list.forEach(function(roleHolder){var role=roleHolder._data;"GUEST"===role.name.toUpperCase()&&roleHolder.getPermissions(function(err){err||roleHolder.permissions&&roleHolder.permissions.forEach(function(permission){permission.path.indexOf("/**")>=0&&(scope.securityWarning=!0,scope.applyScope())
-})})})});var initialized=!1;scope.$on("app-initialized",function(){!initialized&&ug.getRoles(),initialized=!0}),scope.$on("app-changed",function(){scope.securityWarning=!1,ug.getRoles()})}}}]),AppServices.Constants.constant("configuration",{ITEMS_URL:"global/temp.json"}),AppServices.Controllers.controller("PageCtrl",["ug","utility","$scope","$rootScope","$location","$routeParams","$q","$route","$log",function(ug,utility,$scope,$rootScope,$location,$routeParams,$q,$route){var initScopeVariables=function(){$scope.loadingText="Loading...",$scope.use_sso=!1,$scope.newApp={name:""},$scope.getPerm="",$scope.postPerm="",$scope.putPerm="",$scope.deletePerm="",$scope.usersTypeaheadValues=[],$scope.groupsTypeaheadValues=[],$scope.rolesTypeaheadValues=[],$rootScope.sdkActive=!1,$rootScope.demoData=!1,$scope.queryStringApplied=!1,$rootScope.autoUpdateTimer=Usergrid.config?Usergrid.config.autoUpdateTimer:61,$rootScope.loaded=$rootScope.activeUI=!1;for(var key in Usergrid.regex)$scope[key]=Usergr
 id.regex[key];$scope.options=Usergrid.options;var getQuery=function(){for(var m,result={},queryString=location.search.slice(1),re=/([^&=]+)=([^&]*)/g;m=re.exec(queryString);)result[decodeURIComponent(m[1])]=decodeURIComponent(m[2]);return result};$scope.queryString=getQuery()};initScopeVariables(),$rootScope.urls=function(){var BASE_URL="",DATA_URL="",qs=$location.search();switch(!0){case"appservices.apigee.com"===$location.host()&&location.pathname.indexOf("/dit")>=0:BASE_URL="https://accounts.jupiter.apigee.net",DATA_URL="http://apigee-internal-prod.jupiter.apigee.net",$scope.use_sso=!0;break;case"appservices.apigee.com"===$location.host()&&location.pathname.indexOf("/mars")>=0:BASE_URL="https://accounts.mars.apigee.net",DATA_URL="http://apigee-internal-prod.mars.apigee.net",$scope.use_sso=!0;break;case"appservices.apigee.com"===$location.host():DATA_URL=Usergrid.overrideUrl;break;case"apigee.com"===$location.host():BASE_URL="https://accounts.apigee.com",DATA_URL="https://api.user
 grid.com",$scope.use_sso=!0;break;case"usergrid.dev"===$location.host():DATA_URL="https://api.usergrid.com";break;default:DATA_URL=Usergrid.overrideUrl}return DATA_URL=qs.api_url||DATA_URL,$scope.apiUrl=DATA_URL=DATA_URL.lastIndexOf("/")===DATA_URL.length-1?DATA_URL.substring(0,DATA_URL.length-1):DATA_URL,{DATA_URL:DATA_URL,LOGIN_URL:BASE_URL+"/accounts/sign_in",PROFILE_URL:BASE_URL+"/accounts/my_account",LOGOUT_URL:BASE_URL+"/accounts/sign_out"}},$rootScope.gotoPage=function(path){$location.path(path)};var notRegistration=function(){return"/forgot-password"!==$location.path()&&"/register"!==$location.path()},verifyUser=function(){"/login"!==$location.path().slice(0,"/login".length)&&($rootScope.currentPath=$location.path()),$routeParams.access_token&&$routeParams.admin_email&&$routeParams.uuid&&(ug.set("token",$routeParams.access_token),ug.set("email",$routeParams.admin_email),ug.set("uuid",$routeParams.uuid),$location.search("access_token",null),$location.search("admin_email",null
 ),$location.search("uuid",null)),ug.checkAuthentication(!0)};$scope.profile=function(){$scope.use_sso?window.location=$rootScope.urls().PROFILE_URL+"?callback="+encodeURIComponent($location.absUrl()):$location.path("/profile")},$scope.showModal=function(id){$("#"+id).modal("show")},$scope.hideModal=function(id){$("#"+id).modal("hide")},$scope.deleteEntities=function(collection,successBroadcast,errorMessage){collection.resetEntityPointer();for(var entitiesToDelete=[];collection.hasNextEntity();){var entity=collection.getNextEntity(),checked=entity.checked;checked&&entitiesToDelete.push(entity)}for(var count=0,success=!1,i=0;i<entitiesToDelete.length;i++){var entity=entitiesToDelete[i];collection.destroyEntity(entity,function(err){count++,err?($rootScope.$broadcast("alert","error",errorMessage),$rootScope.$broadcast(successBroadcast+"-error",err)):success=!0,count===entitiesToDelete.length&&(success&&$rootScope.$broadcast(successBroadcast),$scope.applyScope())})}},$scope.selectAllEnti
 ties=function(list,that,varName,setValue){varName=varName||"master";var val=that[varName];void 0==setValue&&(setValue=!0),setValue&&(that[varName]=val=!val),list.forEach(function(entitiy){entitiy.checked=val})},$scope.createPermission=function(type,entity,path,permissions){"/"!=path.charAt(0)&&(path="/"+path);var ops="",s="";permissions.getPerm&&(ops="get",s=","),permissions.postPerm&&(ops=ops+s+"post",s=","),permissions.putPerm&&(ops=ops+s+"put",s=","),permissions.deletePerm&&(ops=ops+s+"delete",s=",");var permission=ops+":"+path;return permission},$scope.formatDate=function(date){return new Date(date).toUTCString()},$scope.clearCheckbox=function(id){$("#"+id).attr("checked")&&$("#"+id).click()},$scope.removeFirstSlash=function(path){return 0===path.indexOf("/")?path.substring(1,path.length):path},$scope.applyScope=function(cb){return cb="function"==typeof cb?cb:function(){},this.$$phase?void cb():this.$apply(cb)},$scope.valueSelected=function(list){return list&&list.some(function(
 item){return item.checked})},$scope.sendHelp=function(modalId){ug.jsonpRaw("apigeeuihelpemail","",{useremail:$rootScope.userEmail}).then(function(){$rootScope.$broadcast("alert","success","Email sent. Our team will be in touch with you shortly.")},function(){$rootScope.$broadcast("alert","error","Problem Sending Email. Try sending an email to mobile@apigee.com.")}),$scope.hideModal(modalId)},$scope.$on("users-typeahead-received",function(event,users){$scope.usersTypeaheadValues=users,$scope.$$phase||$scope.$apply()}),$scope.$on("groups-typeahead-received",function(event,groups){$scope.groupsTypeaheadValues=groups,$scope.$$phase||$scope.$apply()}),$scope.$on("roles-typeahead-received",function(event,roles){$scope.rolesTypeaheadValues=roles,$scope.$$phase||$scope.$apply()}),$scope.$on("checkAuthentication-success",function(){sessionStorage.setItem("authenticateAttempts",0),$scope.loaded=!0,$rootScope.activeUI=!0,$scope.applyScope(),$scope.queryStringApplied||($scope.queryStringApplied
 =!0,setTimeout(function(){$scope.queryString.org&&$rootScope.$broadcast("change-org",$scope.queryString.org)},1e3)),$rootScope.$broadcast("app-initialized")}),$scope.$on("checkAuthentication-error",function(args,err,missingData,email){if($scope.loaded=!0,err&&!$scope.use_sso&&notRegistration())ug.logout(),$location.path("/login"),$scope.applyScope();else if(missingData&&notRegistration()){if(!email&&$scope.use_sso)return void(window.location=$rootScope.urls().LOGIN_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0]));ug.reAuthenticate(email)}}),$scope.$on("reAuthenticate-success",function(args,err,data,user,organizations,applications){sessionStorage.setItem("authenticateAttempts",0),$rootScope.$broadcast("loginSuccesful",user,organizations,applications),$rootScope.$emit("loginSuccesful",user,organizations,applications),$rootScope.$broadcast("checkAuthentication-success"),$scope.applyScope(function(){$scope.deferredLogin.resolve(),$location.path("/org-overview")})})
 ;var authenticateAttempts=parseInt(sessionStorage.getItem("authenticateAttempts")||0);$scope.$on("reAuthenticate-error",function(){if($scope.use_sso){if(authenticateAttempts++>5)return void $rootScope.$broadcast("alert","error","There is an issue with authentication. Please contact support.");console.error("Failed to login via sso "+authenticateAttempts),sessionStorage.setItem("authenticateAttempts",authenticateAttempts),window.location=$rootScope.urls().LOGIN_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0])}else notRegistration()&&(ug.logout(),$location.path("/login"),$scope.applyScope())}),$scope.$on("loginSuccessful",function(){$rootScope.activeUI=!0}),$scope.$on("app-changed",function(args,oldVal,newVal,preventReload){newVal===oldVal||preventReload||$route.reload()}),$scope.$on("org-changed",function(){ug.getApplications(),$route.reload()}),$scope.$on("app-settings-received",function(){}),$scope.$on("request-times-slow",function(){$rootScope.$broadcast("aler
 t","info","We are experiencing performance issues on our server.  Please click Get Help for support if this continues.")}),$scope.$on("$routeChangeSuccess",function(){verifyUser(),$scope.showDemoBar="/performance"===$location.path().slice(0,"/performance".length),$scope.showDemoBar||($rootScope.demoData=!1)}),$scope.$on("applications-received",function(event,applications){$scope.applications=applications,$scope.hasApplications=Object.keys(applications).length>0}),ug.getAppSettings()}]),AppServices.Directives.directive("pageTitle",["$rootScope","data",function($rootScope,data){return{restrict:"ECA",scope:{},transclude:!0,templateUrl:"global/page-title.html",replace:!0,link:function(scope,lElement,attrs){scope.title=attrs.title,scope.icon=attrs.icon,scope.showHelp=function(){$("#need-help").modal("show")},scope.sendHelp=function(){data.jsonp_raw("apigeeuihelpemail","",{useremail:$rootScope.userEmail}).then(function(){$rootScope.$broadcast("alert","success","Email sent. Our team will b
 e in touch with you shortly.")},function(){$rootScope.$broadcast("alert","error","Problem Sending Email. Try sending an email to mobile@apigee.com.")}),$("#need-help").modal("hide")}}}}]),AppServices.Services.factory("ug",function(configuration,$rootScope,utility,$q,$http,$resource,$log){function reportError(){}var requestTimes=[],running=!1,currentRequests={},getAccessToken=function(){return sessionStorage.getItem("accessToken")};return{get:function(prop,isObject){return isObject?this.client().getObject(prop):this.client().get(prop)},set:function(prop,value){this.client().set(prop,value)},orgLogin:function(username,password){var self=this;this.client().set("email",username),this.client().set("token",null),this.client().orgLogin(username,password,function(err,data,user,organizations,applications){err?$rootScope.$broadcast("loginFailed",err,data):self.initializeCurrentUser(function(){$rootScope.$broadcast("loginSuccesful",user,organizations,applications)})})},checkAuthentication:func
 tion(force){var ug=this,client=ug.client(),initialize=function(){ug.initializeCurrentUser(function(){$rootScope.userEmail=client.get("email"),$rootScope.organizations=client.getObject("organizations"),$rootScope.applications=client.getObject("applications"),$rootScope.currentOrg=client.get("orgName"),$rootScope.currentApp=client.get("appName");var key,size=0;for(key in $rootScope.applications)$rootScope.applications.hasOwnProperty(key)&&size++;$rootScope.addApplications=10>size,$rootScope.$broadcast("checkAuthentication-success",client.getObject("organizations"),client.getObject("applications"),client.get("orgName"),client.get("appName"),client.get("email"))})},isAuthenticated=function(){var authenticated=null!==client.get("token")&&null!==client.get("organizations");return authenticated&&initialize(),authenticated};if(!isAuthenticated()||force){if(!client.get("token"))return $rootScope.$broadcast("checkAuthentication-error","no token",{},client.get("email"));this.client().reAuthent
 icateLite(function(err){var missingData=err||!client.get("orgName")||!client.get("appName")||!client.getObject("organizations")||!client.getObject("applications"),email=client.get("email");err||missingData?$rootScope.$broadcast("checkAuthentication-error",err,missingData,email):initialize()})}},reAuthenticate:function(email,eventOveride){var ug=this;this.client().reAuthenticate(email,function(err,data,user,organizations,applications){err||($rootScope.currentUser=user),err||($rootScope.userEmail=user.get("email"),$rootScope.organizations=organizations,$rootScope.applications=applications,$rootScope.currentOrg=ug.get("orgName"),$rootScope.currentApp=ug.get("appName"),$rootScope.currentUser=user._data,$rootScope.currentUser.profileImg=utility.get_gravatar($rootScope.currentUser.email)),$rootScope.$broadcast((eventOveride||"reAuthenticate")+"-"+(err?"error":"success"),err,data,user,organizations,applications)})},logoutCallback:function(){$rootScope.$broadcast("userNotAuthenticated")},lo
 gout:function(){$rootScope.activeUI=!1,$rootScope.userEmail="user@apigee.com",$rootScope.organizations={noOrg:{name:"No Orgs Found"}},$rootScope.applications={noApp:{name:"No Apps Found"}},$rootScope.currentOrg="No Org Found",$rootScope.currentApp="No App Found",sessionStorage.setItem("accessToken",null),sessionStorage.setItem("userUUID",null),sessionStorage.setItem("userEmail",null),this.client().logout(),this._client=null},client:function(){var options={buildCurl:!0,logging:!0};return Usergrid.options&&Usergrid.options.client&&(options.keys=Usergrid.options.client),this._client=this._client||new Usergrid.Client(options,$rootScope.urls().DATA_URL),this._client},getTopCollections:function(){var options={method:"GET",endpoint:""};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting collections");else{var collections=data.entities[0].metadata.collections;$rootScope.$broadcast("top-collections-received",collections)}})},createColl
 ection:function(collectionName){var collections={};collections[collectionName]={};var metadata={metadata:{collections:collections}},options={method:"PUT",body:metadata,endpoint:""};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error creating collection"):$rootScope.$broadcast("collection-created",collections)})},getApplications:function(){this.client().getApplications(function(err,applications){err?applications&&console.error(applications):$rootScope.$broadcast("applications-received",applications)})},getAdministrators:function(){this.client().getAdministrators(function(err,administrators){err&&$rootScope.$broadcast("alert","error","error getting administrators"),$rootScope.$broadcast("administrators-received",administrators)})},createApplication:function(appName){this.client().createApplication(appName,function(err,applications){err?$rootScope.$broadcast("alert","error","error creating application"):($rootScope.$broadcast("applications-creat
 ed",applications,appName),$rootScope.$broadcast("applications-received",applications))})},createAdministrator:function(adminName){this.client().createAdministrator(adminName,function(err,administrators){err&&$rootScope.$broadcast("alert","error","error creating administrator"),$rootScope.$broadcast("administrators-received",administrators)})},getFeed:function(){var options={method:"GET",endpoint:"management/organizations/"+this.client().get("orgName")+"/feed",mQuery:!0};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting feed");else{var feedData=data.entities,feed=[],i=0;for(i=0;i<feedData.length;i++){var date=new Date(feedData[i].created).toUTCString(),title=feedData[i].title,n=title.indexOf(">");title=title.substring(n+1,title.length),n=title.indexOf(">"),title=title.substring(n+1,title.length),feedData[i].actor&&(title=feedData[i].actor.displayName+" "+title),feed.push({date:date,title:title})}0===i&&feed.push({date:"",titl
 e:"No Activities found."}),$rootScope.$broadcast("feed-received",feed)}})},createGroup:function(path,title){var options={path:path,title:title},self=this;this.groupsCollection.addEntity(options,function(err){err?$rootScope.$broadcast("groups-create-error",err):($rootScope.$broadcast("groups-create-success",self.groupsCollection),$rootScope.$broadcast("groups-received",self.groupsCollection))})},createRole:function(name,title){var options={name:name,title:title},self=this;this.rolesCollection.addEntity(options,function(err){err?$rootScope.$broadcast("alert","error","error creating role"):$rootScope.$broadcast("roles-received",self.rolesCollection)})},createUser:function(username,name,email,password){var options={username:username,name:name,email:email,password:password},self=this;this.usersCollection.addEntity(options,function(err,data){err?"string"==typeof data?$rootScope.$broadcast("alert","error","error: "+data):$rootScope.$broadcast("alert","error","error creating user. the email
  address might already exist."):($rootScope.$broadcast("users-create-success",self.usersCollection),$rootScope.$broadcast("users-received",self.usersCollection))})},getCollection:function(type,path,orderBy,query,limit){var options={type:path,qs:{}};query&&(options.qs.ql=query),options.qs.ql=options.qs.ql?options.qs.ql+" order by "+(orderBy||"created desc"):" order by "+(orderBy||"created desc"),limit&&(options.qs.limit=limit),this.client().createCollection(options,function(err,collection,data){err?$rootScope.$broadcast("alert","error","error getting "+collection._type+": "+data.error_description):$rootScope.$broadcast(type+"-received",collection),$rootScope.$$phase||$rootScope.$apply()})},runDataQuery:function(queryPath,searchString,queryLimit){this.getCollection("query",queryPath,null,searchString,queryLimit)},runDataPOSTQuery:function(queryPath,body){var self=this,options={method:"POST",endpoint:queryPath,body:body};this.client().request(options,function(err,data){if(err)$rootScop
 e.$broadcast("alert","error","error: "+data.error_description),$rootScope.$broadcast("error-running-query",data);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},runDataPutQuery:function(queryPath,searchString,queryLimit,body){var self=this,options={method:"PUT",endpoint:queryPath,body:body};searchString&&(options.qs.ql=searchString),queryLimit&&(options.qs.queryLimit=queryLimit),this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},runDataDeleteQuery:function(queryPath,searchString,queryLimit){var self=this,options={method:"DELETE",endpoint:queryPath};searchString&&(options.qs.ql=searchString),queryLimit&&(options.qs.queryLimit=queryLimit),this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.er
 ror_description);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},getUsers:function(){this.getCollection("users","users","username");var self=this;$rootScope.$on("users-received",function(evt,users){self.usersCollection=users})},getGroups:function(){this.getCollection("groups","groups","title");var self=this;$rootScope.$on("groups-received",function(event,roles){self.groupsCollection=roles})},getRoles:function(){this.getCollection("roles","roles","name");var self=this;$rootScope.$on("roles-received",function(event,roles){self.rolesCollection=roles})},getNotifiers:function(){var query="",limit="100",self=this;this.getCollection("notifiers","notifiers","created",query,limit),$rootScope.$on("notifiers-received",function(event,notifiers){self.notifiersCollection=notifiers})},getNotificationHistory:function(type){var query=null;type&&(query="select * where state = '"+type+"'"),this.getCollection("notifications","notifications","cre
 ated desc",query);var self=this;$rootScope.$on("notifications-received",function(event,notifications){self.notificationCollection=notifications})},getNotificationReceipts:function(uuid){this.getCollection("receipts","notifications/"+uuid+"/receipts");var self=this;$rootScope.$on("receipts-received",function(event,receipts){self.receiptsCollection=receipts})},getIndexes:function(path){var options={method:"GET",endpoint:path+"/indexes"};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Problem getting indexes: "+data.error):$rootScope.$broadcast("indexes-received",data.data)})},sendNotification:function(path,body){var options={method:"POST",endpoint:path,body:body};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Problem creating notification: "+data.error):$rootScope.$broadcast("send-notification-complete")})},getRolesUsers:function(username){var options={type:"roles/users/"+username,qs:{ql:"order by
  username"}};this.client().createCollection(options,function(err,users){err?$rootScope.$broadcast("alert","error","error getting users"):$rootScope.$broadcast("users-received",users)})},getTypeAheadData:function(type,searchString,searchBy,orderBy){var search="",qs={limit:100};searchString&&(search="select * where "+searchBy+" = '"+searchString+"'"),orderBy&&(search=search+" order by "+orderBy),search&&(qs.ql=search);var options={method:"GET",endpoint:type,qs:qs};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting "+type);else{var entities=data.entities;$rootScope.$broadcast(type+"-typeahead-received",entities)}})},getUsersTypeAhead:function(searchString){this.getTypeAheadData("users",searchString,"username","username")},getGroupsTypeAhead:function(searchString){this.getTypeAheadData("groups",searchString,"path","path")},getRolesTypeAhead:function(searchString){this.getTypeAheadData("roles",searchString,"name","name")},getGroup
 sForUser:function(user){var options={type:"users/"+user+"/groups"};this.client().createCollection(options,function(err,groups){err?$rootScope.$broadcast("alert","error","error getting groups"):$rootScope.$broadcast("user-groups-received",groups)})},addUserToGroup:function(user,group){var options={type:"users/"+user+"/groups/"+group};this.client().createEntity(options,function(err){err?$rootScope.$broadcast("alert","error","error adding user to group"):$rootScope.$broadcast("user-added-to-group-received")})},addUserToRole:function(user,role){var options={method:"POST",endpoint:"roles/"+role+"/users/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding user to role"):$rootScope.$broadcast("role-update-received")})},addGroupToRole:function(group,role){var options={method:"POST",endpoint:"roles/"+role+"/groups/"+group};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding group to role"):
 $rootScope.$broadcast("role-update-received")})},followUser:function(user){var username=$rootScope.selectedUser.get("uuid"),options={method:"POST",endpoint:"users/"+username+"/following/users/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error following user"):$rootScope.$broadcast("follow-user-received")})},newPermission:function(permission,type,entity){var options={method:"POST",endpoint:type+"/"+entity+"/permissions",body:{permission:permission}};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding permission"):$rootScope.$broadcast("permission-update-received")})},newUserPermission:function(permission,username){this.newPermission(permission,"users",username)},newGroupPermission:function(permission,path){this.newPermission(permission,"groups",path)},newRolePermission:function(permission,name){this.newPermission(permission,"roles",name)},deletePermission:function(permission,type,entity)
 {var options={method:"DELETE",endpoint:type+"/"+entity+"/permissions",qs:{permission:permission}};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error deleting permission"):$rootScope.$broadcast("permission-update-received")})},deleteUserPermission:function(permission,user){this.deletePermission(permission,"users",user)},deleteGroupPermission:function(permission,group){this.deletePermission(permission,"groups",group)},deleteRolePermission:function(permission,rolename){this.deletePermission(permission,"roles",rolename)},removeUserFromRole:function(user,role){var options={method:"DELETE",endpoint:"roles/"+role+"/users/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error removing user from role"):$rootScope.$broadcast("role-update-received")})},removeUserFromGroup:function(group,role){var options={method:"DELETE",endpoint:"roles/"+role+"/groups/"+group};this.client().request(options,function(err){er
 r?$rootScope.$broadcast("alert","error","error removing role from the group"):$rootScope.$broadcast("role-update-received")})},createAndroidNotifier:function(name,APIkey){var options={method:"POST",endpoint:"notifiers",body:{apiKey:APIkey,name:name,provider:"google"}};this.client().request(options,function(err,data){err?(console.error(data),$rootScope.$broadcast("alert","error","error creating notifier ")):($rootScope.$broadcast("alert","success","New notifier created successfully."),$rootScope.$broadcast("notifier-update"))})},createAppleNotifier:function(file,name,environment,certificatePassword){var provider="apple",formData=new FormData;formData.append("p12Certificate",file),formData.append("name",name),formData.append("provider",provider),formData.append("environment",environment),formData.append("certificatePassword",certificatePassword||"");var options={method:"POST",endpoint:"notifiers",formData:formData};this.client().request(options,function(err,data){err?(console.error(da
 ta),$rootScope.$broadcast("alert","error","error creating notifier.")):($rootScope.$broadcast("alert","success","New notifier created successfully."),$rootScope.$broadcast("notifier-update"))})},deleteNotifier:function(name){var options={method:"DELETE",endpoint:"notifiers/"+name};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error deleting notifier"):$rootScope.$broadcast("notifier-update")})},initializeCurrentUser:function(callback){if(callback=callback||function(){},$rootScope.currentUser&&!$rootScope.currentUser.reset)return callback($rootScope.currentUser),$rootScope.$broadcast("current-user-initialized","");var options={method:"GET",endpoint:"management/users/"+this.client().get("email"),mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Error getting user info"):($rootScope.currentUser=data.data,$rootScope.currentUser.profileImg=utility.get_gravatar($rootScope.currentUser.email),$root
 Scope.userEmail=$rootScope.currentUser.email,callback($rootScope.currentUser),$rootScope.$broadcast("current-user-initialized",$rootScope.currentUser))})},updateUser:function(user){var body=$rootScope.currentUser;body.username=user.username,body.name=user.name,body.email=user.email;var options={method:"PUT",endpoint:"management/users/"+user.uuid+"/",mQuery:!0,body:body},self=this;this.client().request(options,function(err,data){return self.client().set("email",user.email),self.client().set("username",user.username),err?$rootScope.$broadcast("user-update-error",data):($rootScope.currentUser.reset=!0,void self.initializeCurrentUser(function(){$rootScope.$broadcast("user-update-success",$rootScope.currentUser)}))})},resetUserPassword:function(user){var pwdata={};pwdata.oldpassword=user.oldPassword,pwdata.newpassword=user.newPassword,pwdata.username=user.username;var options={method:"PUT",endpoint:"users/"+pwdata.uuid+"/",body:pwdata};this.client().request(options,function(err){return e
 rr?$rootScope.$broadcast("alert","error","Error resetting password"):($rootScope.currentUser.oldPassword="",$rootScope.currentUser.newPassword="",void $rootScope.$broadcast("user-reset-password-success",$rootScope.currentUser))})},getOrgCredentials:function(){var options={method:"GET",endpoint:"management/organizations/"+this.client().get("orgName")+"/credentials",mQuery:!0};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error getting credentials"):$rootScope.$broadcast("org-creds-updated",data.credentials)})},regenerateOrgCredentials:function(){var options={method:"POST",endpoint:"management/organizations/"+this.client().get("orgName")+"/credentials",mQuery:!0};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error regenerating credentials"):($rootScope.$broadcast("alert","success","Regeneration of credentials complete."),$rootScope.$broadcast("org-creds-updat
 ed",data.credentials))})},getAppCredentials:function(){var options={method:"GET",endpoint:"credentials"};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error getting credentials"):$rootScope.$broadcast("app-creds-updated",data.credentials)})},regenerateAppCredentials:function(){var options={method:"POST",endpoint:"credentials"};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error regenerating credentials"):($rootScope.$broadcast("alert","success","Regeneration of credentials complete."),$rootScope.$broadcast("app-creds-updated",data.credentials))})},signUpUser:function(orgName,userName,name,email,password){var formData={organization:orgName,username:userName,name:name,email:email,password:password},options={method:"POST",endpoint:"management/organizations",body:formData,mQuery:!0},client=this.client();client.request(options,function(err,data){err?$rootScope.$
 broadcast("register-error",data):$rootScope.$broadcast("register-success",data)})},resendActivationLink:function(id){var options={method:"GET",endpoint:"management/users/"+id+"/reactivate",mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("resend-activate-error",data):$rootScope.$broadcast("resend-activate-success",data)})},getAppSettings:function(){$rootScope.$broadcast("app-settings-received",{})},getActivities:function(){this.client().request({method:"GET",endpoint:"activities",qs:{limit:200}},function(err,data){if(err)return $rootScope.$broadcast("app-activities-error",data);var entities=data.entities;entities.forEach(function(entity){entity.actor.picture?(entity.actor.picture=entity.actor.picture.replace(/^http:\/\/www.gravatar/i,"https://secure.gravatar"),entity.actor.picture=~entity.actor.picture.indexOf("http")?entity.actor.picture:"https://apigee.com/usergrid/img/user_profile.png"):entity.actor.picture=window.location.protocol+"//"+window
 .location.host+window.location.pathname+"img/user_profile.png"}),$rootScope.$broadcast("app-activities-received",data.entities)})},getEntityActivities:function(entity){var endpoint=entity.get("type")+"/"+entity.get("uuid")+"/activities",options={method:"GET",endpoint:endpoint,qs:{limit:200}};this.client().request(options,function(err,data){err&&$rootScope.$broadcast(entity.get("type")+"-activities-error",data),data.entities.forEach(function(entityInstance){entityInstance.createdDate=new Date(entityInstance.created).toUTCString()}),$rootScope.$broadcast(entity.get("type")+"-activities-received",data.entities)})},addUserActivity:function(user,content){var options={actor:{displayName:user.get("username"),uuid:user.get("uuid"),username:user.get("username")},verb:"post",content:content};this.client().createUserActivity(user.get("username"),options,function(err,activity){err?$rootScope.$broadcast("user-activity-add-error",err):$rootScope.$broadcast("user-activity-add-success",activity)})}
 ,runShellQuery:function(method,path,payload){var options={verb:method,endpoint:path};payload&&(options.body=payload),this.client().request(options,function(err,data){err?$rootScope.$broadcast("shell-error",data):$rootScope.$broadcast("shell-success",data)})},addOrganization:function(user,orgName){var options={method:"POST",endpoint:"management/users/"+user.uuid+"/organizations",body:{organization:orgName},mQuery:!0},client=this.client();client.request(options,function(err,data){err?$rootScope.$broadcast("user-add-org-error",data):$rootScope.$broadcast("user-add-org-success",$rootScope.organizations)})},leaveOrganization:function(user,org){var options={method:"DELETE",endpoint:"management/users/"+user.uuid+"/organizations/"+org.uuid,mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("user-leave-org-error",data):(delete $rootScope.organizations[org.name],$rootScope.$broadcast("user-leave-org-success",$rootScope.organizations))})},httpGet:function(id,
 url){var deferred;return deferred=$q.defer(),$http.get(url||configuration.ITEMS_URL).success(function(data){var result;
-id?angular.forEach(data,function(obj){obj.id===id&&(result=obj)}):result=data,deferred.resolve(result)}).error(function(data,status,headers,config){$log.error(data,status,headers,config),reportError(data,config),deferred.reject(data)}),deferred.promise},jsonp:function(objectType,criteriaId,params,successCallback){params||(params={}),params.demoApp=$rootScope.demoData,params.access_token=getAccessToken(),params.callback="JSON_CALLBACK";var uri=$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/apm/"+objectType+"/"+criteriaId;return this.jsonpRaw(objectType,criteriaId,params,uri,successCallback)},jsonpSimple:function(objectType,appId,params){var uri=$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/apm/"+objectType+"/"+appId;return this.jsonpRaw(objectType,appId,params,uri)},calculateAverageRequestTimes:function(){if(!running){var self=this;running=!0,setTimeout(function(){running=!1;var length=requestTimes.length<10?request
 Times.length:10,sum=requestTimes.slice(0,length).reduce(function(a,b){return a+b}),avg=sum/length;self.averageRequestTimes=avg/1e3,self.averageRequestTimes>5&&$rootScope.$broadcast("request-times-slow",self.averageRequestTimes)},3e3)}},jsonpRaw:function(objectType,appId,params,uri,successCallback){"function"!=typeof successCallback&&(successCallback=null),uri=uri||$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/"+objectType,params||(params={});var start=(new Date).getTime(),self=this;params.access_token=getAccessToken(),params.callback="JSON_CALLBACK";var deferred=$q.defer(),diff=function(){currentRequests[uri]--,requestTimes.splice(0,0,(new Date).getTime()-start),self.calculateAverageRequestTimes()};successCallback&&$rootScope.$broadcast("ajax_loading",objectType);var reqCount=currentRequests[uri]||0;return self.averageRequestTimes>5&&reqCount>1?(setTimeout(function(){deferred.reject(new Error("query in progress"))},50),deferred):(currentRequests[ur
 i]=(currentRequests[uri]||0)+1,$http.jsonp(uri,{params:params}).success(function(data,status,headers,config){diff(),successCallback&&(successCallback(data,status,headers,config),$rootScope.$broadcast("ajax_finished",objectType)),deferred.resolve(data)}).error(function(data,status,headers,config){diff(),$log.error("ERROR: Could not get jsonp data. "+uri),reportError(data,config),deferred.reject(data)}),deferred.promise)},resource:function(params,isArray){return $resource($rootScope.urls().DATA_URL+"/:orgname/:appname/:username/:endpoint",{},{get:{method:"JSONP",isArray:isArray,params:params},login:{method:"GET",url:$rootScope.urls().DATA_URL+"/management/token",isArray:!1,params:params},save:{url:$rootScope.urls().DATA_URL+"/"+params.orgname+"/"+params.appname,method:"PUT",isArray:!1,params:params}})},httpPost:function(url,callback,payload,headers){var accessToken=getAccessToken();payload?payload.access_token=accessToken:payload={access_token:accessToken},headers||(headers={Bearer:ac
 cessToken}),$http({method:"POST",url:url,data:payload,headers:headers}).success(function(data){callback(data)}).error(function(data,status,headers,config){reportError(data,config),callback(data)})}}}),AppServices.Directives.directive("ngFocus",["$parse",function($parse){return function(scope,element,attr){var fn=$parse(attr.ngFocus);element.bind("focus",function(event){scope.$apply(function(){fn(scope,{$event:event})})})}}]),AppServices.Directives.directive("ngBlur",["$parse",function($parse){return function(scope,element,attr){var fn=$parse(attr.ngBlur);element.bind("blur",function(event){scope.$apply(function(){fn(scope,{$event:event})})})}}]),AppServices.Services.factory("utility",function(){return{keys:function(o){var a=[];for(var propertyName in o)a.push(propertyName);return a},get_gravatar:function(email,size){try{var size=size||50;return email.length?"https://secure.gravatar.com/avatar/"+MD5(email)+"?s="+size:"https://apigee.com/usergrid/img/user_profile.png"}catch(e){return"
 https://apigee.com/usergrid/img/user_profile.png"}},get_qs_params:function(){var queryParams={};if(window.location.search)for(var params=window.location.search.slice(1).split("&"),i=0;i<params.length;i++){var tmp=params[i].split("=");queryParams[tmp[0]]=unescape(tmp[1])}return queryParams},safeApply:function(fn){var phase=this.$root.$$phase;"$apply"==phase||"$digest"==phase?fn&&"function"==typeof fn&&fn():this.$apply(fn)}}}),AppServices.Directives.directive("ugValidate",["$rootScope",function(){return{scope:!0,restrict:"A",require:"ng-model",replace:!0,link:function(scope,element,attrs,ctrl){var validate=function(){var id=element.attr("id"),validator=id+"-validator",title=element.attr("title");if(title=title&&title.length?title:"Please enter data",$("#"+validator).remove(),ctrl.$valid)element.removeClass("has-error"),$("#"+validator).remove();else{var validatorElem='<div id="'+validator+'"><span  class="validator-error-message">'+title+"</span></div>";$("#"+id).after(validatorElem),
 element.addClass("has-error")}},firing=!1;element.bind("blur",function(){validate(scope,element,attrs,ctrl)}).bind("input",function(){firing||(firing=!0,setTimeout(function(){validate(scope,element,attrs,ctrl),firing=!1},500))})}}}]),AppServices.Controllers.controller("GroupsActivitiesCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.activitiesSelected="active",$rootScope.selectedGroup?($rootScope.selectedGroup.activities=[],void $rootScope.selectedGroup.getActivities(function(err){err||$rootScope.$$phase||$rootScope.$apply()})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsCtrl",["ug","$scope","$rootScope","$location","$route",function(ug,$scope,$rootScope,$location,$route){$scope.groupsCollection={},$rootScope.selectedGroup={},$scope.previous_display="none",$scope.next_display="none",$scope.hasGroups=!1,$scope.newGroup={path:"",title:""},ug.getGroups(),$scope.currentGroupsPage={},$scope.selectGroupPag
 e=function(route){$scope.currentGroupsPage.template=$route.routes[route].templateUrl,$scope.currentGroupsPage.route=route},$scope.newGroupDialog=function(modalId){$scope.newGroup.path&&$scope.newGroup.title?(ug.createGroup($scope.removeFirstSlash($scope.newGroup.path),$scope.newGroup.title),$scope.hideModal(modalId),$scope.newGroup={path:"",title:""}):$rootScope.$broadcast("alert","error","Missing required information.")},$scope.deleteGroupsDialog=function(modalId){$scope.deleteEntities($scope.groupsCollection,"group-deleted","error deleting group"),$scope.hideModal(modalId),$scope.newGroup={path:"",title:""}},$scope.$on("group-deleted",function(){$rootScope.$broadcast("alert","success","Group deleted successfully.")}),$scope.$on("group-deleted-error",function(){ug.getGroups()}),$scope.$on("groups-create-success",function(){$rootScope.$broadcast("alert","success","Group created successfully.")}),$scope.$on("groups-create-error",function(){$rootScope.$broadcast("alert","error","Error
  creating group. Make sure you don't have spaces in the path.")}),$scope.$on("groups-received",function(event,groups){$scope.groupBoxesSelected=!1,$scope.groupsCollection=groups,$scope.newGroup.path="",$scope.newGroup.title="",!(groups._list.length>0)||$rootScope.selectedGroup._data&&groups._list.some(function(group){return $rootScope.selectedGroup._data.uuid===group._data.uuid})||$scope.selectGroup(groups._list[0]._data.uuid),$scope.hasGroups=groups._list.length>0,$scope.received=!0,$scope.checkNextPrev(),$scope.applyScope()}),$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$scope.groupsCollection.hasPreviousPage()&&($scope.previous_display="block"),$scope.groupsCollection.hasNextPage()&&($scope.next_display="block")},$scope.selectGroup=function(uuid){$rootScope.selectedGroup=$scope.groupsCollection.getEntityByUUID(uuid),$scope.currentGroupsPage.template="groups/groups-details.html",$s
 cope.currentGroupsPage.route="/groups/details",$rootScope.$broadcast("group-selection-changed",$rootScope.selectedGroup)},$scope.getPrevious=function(){$scope.groupsCollection.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of groups"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.getNext=function(){$scope.groupsCollection.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of groups"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.$on("group-deleted",function(){$route.reload(),$scope.master=""})}]),AppServices.Controllers.controller("GroupsDetailsCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){var selectedGroup=$rootScope.selectedGroup.clone();return $scope.detailsSelected="active",$scope.json=selectedGroup._json||selectedGroup._data.stringifyJSON(),$scope.group=selectedGroup._data,$scope.group.path=0!=$scope.group.path.indexOf("/")?"/"
 +$scope.group.path:$scope.group.path,$scope.group.title=$scope.group.title,$rootScope.selectedGroup?($scope.$on("group-selection-changed",function(evt,selectedGroup){$scope.group.path=0!=selectedGroup._data.path.indexOf("/")?"/"+selectedGroup._data.path:selectedGroup._data.path,$scope.group.title=selectedGroup._data.title,$scope.detailsSelected="active",$scope.json=selectedGroup._json||selectedGroup._data.stringifyJSON()}),void($rootScope.saveSelectedGroup=function(){$rootScope.selectedGroup._data.title=$scope.group.title,$rootScope.selectedGroup._data.path=$scope.removeFirstSlash($scope.group.path),$rootScope.selectedGroup.save(function(err){err?$rootScope.$broadcast("alert","error","error saving group"):$rootScope.$broadcast("alert","success","group saved")})})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsMembersCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.membersSelected="active",$scope.previo
 us_display="none",$scope.next_display="none",$scope.user="",$scope.master="",$scope.hasMembers=!1,ug.getUsersTypeAhead(),$scope.usersTypeaheadValues=[],$scope.$on("users-typeahead-received",function(event,users){$scope.usersTypeaheadValues=users,$scope.applyScope()}),$scope.addGroupToUserDialog=function(modalId){if($scope.user){var path=$rootScope.selectedGroup.get("path");ug.addUserToGroup($scope.user.uuid,path),$scope.user="",$scope.hideModal(modalId)}else $rootScope.$broadcast("alert","error","Please select a user.")},$scope.removeUsersFromGroupDialog=function(modalId){$scope.deleteEntities($scope.groupsCollection.users,"group-update-received","Error removing user from group"),$scope.hideModal(modalId)},$scope.get=function(){if($rootScope.selectedGroup.get){var options={type:"groups/"+$rootScope.selectedGroup.get("path")+"/users"};$scope.groupsCollection.addCollection("users",options,function(err){$scope.groupMembersSelected=!1,err?$rootScope.$broadcast("alert","error","error get
 ting users for group"):($scope.hasMembers=$scope.groupsCollection.users._list.length>0,$scope.checkNextPrev(),$scope.applyScope())})}},$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$scope.groupsCollection.users.hasPreviousPage()&&($scope.previous_display="block"),$scope.groupsCollection.users.hasNextPage()&&($scope.next_display="block")},$rootScope.selectedGroup?($scope.get(),$scope.getPrevious=function(){$scope.groupsCollection.users.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of users"),$scope.checkNextPrev(),$rootScope.$$phase||$rootScope.$apply()})},$scope.getNext=function(){$scope.groupsCollection.users.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of users"),$scope.checkNextPrev(),$rootScope.$$phase||$rootScope.$apply()})},$scope.$on("group-update-received",function(){$scope
 .get()}),void $scope.$on("user-added-to-group-received",function(){$scope.get()})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsRolesCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.rolesSelected="active",$scope.roles_previous_display="none",$scope.roles_next_display="none",$scope.name="",$scope.master="",$scope.hasRoles=!1,$scope.hasPermissions=!1,$scope.permissions={},$scope.addGroupToRoleDialog=function(modalId){if($scope.name){var path=$rootScope.selectedGroup.get("path");ug.addGroupToRole(path,$scope.name),$scope.hideModal(modalId),$scope.name=""}else $rootScope.$broadcast("alert","error","You must specify a role name.")},$scope.leaveRoleDialog=function(modalId){for(var path=$rootScope.selectedGroup.get("path"),roles=$scope.groupsCollection.roles._list,i=0;i<roles.length;i++)roles[i].checked&&ug.removeUserFromGroup(path,roles[i]._data.name);$scope.hideModal(modalId)},$scope.addGroupPermissionDial
 og=function(modalId){if($scope.permissions.path){var permission=$scope.createPermission(null,null,$scope.removeFirstSlash($scope.permissions.path),$scope.permissions),path=$rootScope.selectedGroup.get("path");ug.newGroupPermission(permission,path),$scope.hideModal(modalId),$scope.permissions&&($scope.permissions={})}else $rootScope.$broadcast("alert","error","You must specify a name for the permission.")},$scope.deleteGroupPermissionDialog=function(modalId){for(var path=$rootScope.selectedGroup.get("path"),permissions=$rootScope.selectedGroup.permissions,i=0;i<permissions.length;i++)permissions[i].checked&&ug.deleteGroupPermission(permissions[i].perm,path);$scope.hideModal(modalId)},$scope.resetNextPrev=function(){$scope.roles_previous_display="none",$scope.roles_next_display="none",$scope.permissions_previous_display="none",$scope.permissions_next_display="none"},$scope.resetNextPrev(),$scope.checkNextPrevRoles=function(){$scope.resetNextPrev(),$scope.groupsCollection.roles.hasPrev
 iousPage()&&($scope.roles_previous_display="block"),$scope.groupsCollection.roles.hasNextPage()&&($scope.roles_next_display="block")},$scope.checkNextPrevPermissions=function(){$scope.groupsCollection.permissions.hasPreviousPage()&&($scope.permissions_previous_display="block"),$scope.groupsCollection.permissions.hasNextPage()&&($scope.permissions_next_display="block")},$scope.getRoles=function(){var path=$rootScope.selectedGroup.get("path"),options={type:"groups/"+path+"/roles"};$scope.groupsCollection.addCollection("roles",options,function(err){$scope.groupRoleSelected=!1,err?$rootScope.$broadcast("alert","error","error getting roles for group"):($scope.hasRoles=$scope.groupsCollection.roles._list.length>0,$scope.checkNextPrevRoles(),$scope.applyScope())})},$scope.getPermissions=function(){$rootScope.selectedGroup.permissions=[],$rootScope.selectedGroup.getPermissions(function(err){$scope.groupPermissionsSelected=!1,$scope.hasPermissions=$scope.selectedGroup.permissions.length,err|
 |$scope.applyScope()})},$scope.getPreviousRoles=function(){$scope.groupsCollection.roles.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of roles"),$scope.checkNextPrevRoles(),$scope.applyScope()})},$scope.getNextRoles=function(){$scope.groupsCollection.roles.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of roles"),$scope.checkNextPrevRoles(),$scope.applyScope()})},$scope.getPreviousPermissions=function(){$scope.groupsCollection.permissions.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of permissions"),$scope.checkNextPrevPermissions(),$scope.applyScope()})},$scope.getNextPermissions=function(){$scope.groupsCollection.permissions.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of permissions"),$scope.checkNextPrevPermissions(),$scope.applyScope()})},$scope.$on("role-update-received"
 ,function(){$scope.getRoles()}),$scope.$on("permission-update-received",function(){$scope.getPermissions()}),$scope.$on("groups-received",function(evt,data){$scope.groupsCollection=data,$scope.getRoles(),$scope.getPermissions()}),$rootScope.selectedGroup?(ug.getRolesTypeAhead(),void ug.getGroups()):void $location.path("/groups")}]),AppServices.Controllers.controller("ForgotPasswordCtrl",["ug","$scope","$rootScope","$location","$sce","utility",function(ug,$scope,$rootScope,$location,$sce){$rootScope.activeUI&&$location.path("/"),$scope.forgotPWiframeURL=$sce.trustAsResourceUrl($scope.apiUrl+"/management/users/resetpw")}]),AppServices.Controllers.controller("LoginCtrl",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){$scope.loading=!1,$scope.login={},$scope.activation={},$rootScope.gotoForgotPasswordPage=function(){$location.path("/forgot-password")},$rootScope.gotoSignUp=function(){$location.path("/register")},$sco
 pe.login=function(){var username=$scope.login.username,password=$scope.login.password;$scope.loginMessage="",$scope.loading=!0,ug.orgLogin(username,password)},$scope.$on("loginFailed",function(){$scope.loading=!1,$scope.loginMessage="Error: the username / password combination was not valid",$scope.applyScope()}),$scope.logout=function(){ug.logout(),$scope.use_sso?window.location=$rootScope.urls().LOGOUT_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0]):($location.path("/login"),$scope.applyScope())},$rootScope.$on("userNotAuthenticated",function(){"/forgot-password"!==$location.path()&&($location.path("/login"),$scope.logout()),$scope.applyScope()}),$scope.$on("loginSuccesful",function(){$scope.loading=!1,$scope.login={},$location.path("/login"===$rootScope.currentPath||"/login/loading"===$rootScope.currentPath||"undefined"==typeof $rootScope.currentPath?"/org-overview":$rootScope.currentPath),$scope.applyScope()}),$scope.resendActivationLink=function(modalId){va
 r id=$scope.activation.id;ug.resendActivationLink(id),$scope.activation={},$scope.hideModal(modalId)},$scope.$on("resend-activate-success",function(){$scope.activationId="",$scope.$apply(),$rootScope.$broadcast("alert","success","Activation link sent successfully.")}),$scope.$on("resend-activate-error",function(){$rootScope.$broadcast("alert","error","Activation link failed to send.")})}]),AppServices.Controllers.controller("LogoutCtrl",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){ug.logout(),$scope.use_sso?window.location=$rootScope.urls().LOGOUT_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0]):($location.path("/login"),$scope.applyScope())}]),AppServices.Controllers.controller("RegisterCtrl",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){$rootScope.activeUI&&$location.path("/");var init=function(){$scope.registeredUs
 er={}};init(),$scope.cancel=function(){$location.path("/")},$scope.register=function(){var user=$scope.registeredUser.clone();user.password===user.confirmPassword?ug.signUpUser(user.orgName,user.userName,user.name,user.email,user.password):$rootScope.$broadcast("alert","error","Passwords do not match."+name)},$scope.$on("register-error",function(event,data){$scope.signUpSuccess=!1,$rootScope.$broadcast("alert","error","Error registering: "+(data&&data.error_description?data.error_description:name))}),$scope.$on("register-success",function(){$scope.registeredUser={},$scope.signUpSuccess=!0,init(),$scope.$apply()})}]),AppServices.Directives.directive("menu",["$location","$rootScope","$log",function($location,$rootScope,$log){return{link:function(scope,lElement,attrs){function setActiveElement(ele,locationPath,$rootScope,isParentClick){ele.removeClass("active");var menuItem,parentMenuItem,newActiveElement=ele.parent().find('a[href*="#!'+locationPath+'"]');if(0===newActiveElement.length
 )parentMenuItem=ele;else{menuItem=newActiveElement.parent(),menuItem.hasClass("option")?parentMenuItem=menuItem[0]:1===menuItem.size()?(parentMenuItem=newActiveElement.parent().parent().parent(),parentMenuItem.addClass("active")):(parentMenuItem=menuItem[0],menuItem=menuItem[1]);try{var menuItemCompare=parentMenuItem[0]||parentMenuItem;ele[0]!==menuItemCompare&&isParentClick&&ele.find("ul")[0]&&(ele.find("ul")[0].style.height=0);var subMenuSizer=angular.element(parentMenuItem).find(".nav-list")[0];if(subMenuSizer){var heightChecker,clientHeight=subMenuSizer.getAttribute("data-height"),heightCounter=1;clientHeight||heightChecker?(menuItem.addClass("active"),subMenuSizer.style.height=clientHeight+"px"):heightChecker=setInterval(function(){var tempHeight=subMenuSizer.getAttribute("data-height")||subMenuSizer.clientHeight;heightCounter=subMenuSizer.clientHeight,0===heightCounter&&(heightCounter=1),"string"==typeof tempHeight&&(tempHeight=parseInt(tempHeight,10)),tempHeight>0&&heightCoun
 ter===tempHeight&&(subMenuSizer.setAttribute("data-height",tempHeight),menuItem.addClass("active"),subMenuSizer.style.height=tempHeight+"px",clearInterval(heightChecker)),heightCounter=tempHeight},20),$rootScope.menuExecute=!0}else menuItem.addClass("active")}catch(e){$log.error("Problem calculating size of menu",e)}}return{menuitem:menuItem,parentMenuItem:parentMenuItem}}function setupMenuState(){if(menuContext=attrs.menu,parentMenuItems=lElement.find("li.option"),0!==lElement.find("li.option.active").length&&($rootScope[menuContext+"Parent"]=lElement.find("li.option.active")),activeParentElement=$rootScope[menuContext+"Parent"]||null,activeParentElement&&(activeParentElement=angular.element(activeParentElement)),menuItems=lElement.find("li.option li"),locationPath=$location.path(),activeParentElement&&(activeMenuElement=angular.element(activeParentElement),activeMenuElement=activeMenuElement.find("li.active"),activeMenuElement.removeClass("active"),activeParentElement.find("a")[0]
 )){subMenuContext=activeParentElement.find("a")[0].href.split("#!")[1];var tempMenuContext=subMenuContext.split("/");subMenuContext="/"+tempMenuContext[1],tempMenuContext.length>2&&(subMenuContext+="/"+tempMenuContext[2])}var activeElements;""!==locationPath&&-1===locationPath.indexOf(subMenuContext)?(activeElements=setActiveElement(activeParentElement,locationPath,scope),$rootScope[menuContext+"Parent"]=activeElements.parentMenuItem,$rootScope[menuContext+"Menu"]=activeElements.menuitem):setActiveElement(activeParentElement,subMenuContext,scope)}var menuContext,parentMenuItems,activeParentElement,menuItems,activeMenuElement,locationPath,subMenuContext,bound=!1;scope.$on("$routeChangeSuccess",function(){setupMenuState(),bound||(bound=!0,parentMenuItems.bind("click",function(cevent){var previousParentSelection=angular.element($rootScope[menuContext+"Parent"]),targetPath=angular.element(cevent.currentTarget).find("> a")[0].href.split("#!")[1];previousParentSelection.find(".nav > li").
 removeClass("active");var activeElements=setActiveElement(previousParentSelection,targetPath,scope,!0);$rootScope[menuContext+"Parent"]=activeElements.parentMenuItem,$rootScope[menuContext+"Menu"]=activeElements.menuitem,scope.$broadcast("menu-selection")}),menuItems.bind("click",function(cevent){var previousMenuSelection=$rootScope[menuContext+"Menu"],targetElement=cevent.currentTarget;previousMenuSelection!==targetElement&&(previousMenuSelection?angular.element(previousMenuSelection).removeClass("active"):activeMenuElement.removeClass("active"),scope.$apply(function(){angular.element($rootScope[menuContext]).addClass("active")}),$rootScope[menuContext+"Menu"]=targetElement,angular.element($rootScope[menuContext+"Parent"]).find("a")[0].setAttribute("href",angular.element(cevent.currentTarget).find("a")[0].href))}))})}}}]),AppServices.Directives.directive("timeFilter",["$location","$routeParams","$rootScope",function($location,$routeParams,$rootScope){return{restrict:"A",transclude:
 !0,template:'<li ng-repeat="time in timeFilters" class="filterItem"><a ng-click="changeTimeFilter(time)">{{time.label}}</a></li>',link:function(scope,lElement,attrs){var menuContext=attrs.filter;scope.changeTimeFilter=function(newTime){$rootScope.selectedtimefilter=newTime,$routeParams.timeFilter=newTime.value},lElement.bind("click",function(cevent){menuBindClick(scope,lElement,cevent,menuContext)})}}}]),AppServices.Directives.directive("chartFilter",["$location","$routeParams","$rootScope",function($location,$routeParams,$rootScope){return{restrict:"ACE",scope:"=",template:'<li ng-repeat="chart in chartCriteriaOptions" class="filterItem"><a ng-click="changeChart(chart)">{{chart.chartName}}</a></li>',link:function(scope,lElement,attrs){var menuContext=attrs.filter;scope.changeChart=function(newChart){$rootScope.selectedChartCriteria=newChart,$routeParams.currentCompare="NOW",$routeParams[newChart.typ

<TRUNCATED>

[07/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/libs/usergrid-libs.min.js
----------------------------------------------------------------------
diff --git a/portal/js/libs/usergrid-libs.min.js b/portal/js/libs/usergrid-libs.min.js
index f002c2a..fda0f20 100644
--- a/portal/js/libs/usergrid-libs.min.js
+++ b/portal/js/libs/usergrid-libs.min.js
@@ -1,4 +1,4 @@
-/*! apigee-usergrid@2.0.34 2014-03-03 */
+/*! apigee-usergrid@2.0.36 2014-03-06 */
 !function(e,t){function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)dele
 te o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function it(){return!0}function ot(){return!1}function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0==
 =n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){for(var n,r=0;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t
 ).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}function tn(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;i--;)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function 
 rn(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(
 e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(
 b.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}var o={},a=e===jn;return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);for(;"*"===l[0];)l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataT
 ype)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){for(var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)
 l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.css
 Hooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",
 {}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],
 :{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementB
 yId(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.cal
 l(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},
 isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.
 replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a)for(;o>i&&(r=t.apply(e[i],n),r!==!1);i++);else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a)for(;o>i&&(r=t.call(e[i],i,e[i]),r!==!1);i++);else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call(" ")?function(e){return 
 null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid
 ||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.to
 LowerCase()}),r=b(o);var _={};b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;!function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})}(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){for(var r;(r=b.inArray(t,u,r))>-1;)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u|
 |i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]
 +"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var s,u,l,t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}};if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t
 ={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t
 "),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;bo
 rder:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.fir
 stChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf(
 "data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}}),b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e
 ,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q
 =b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||
 "").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return this.each(b.isFunction(e)?function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var o,a=0,s=b(this),u=t,l=e.match(w)||[];o=l[a++];)u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o);else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];return arguments.length?(i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType
 &&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))})):o?(r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)):void 0}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inA
 rray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;return e&&3!==u&&8!==u&&2!==u?typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t)):void 0},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)for(;n=o[i++];)r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpad
 ding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;return e&&3!==s&&8!==s&&2!==s?(a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]):void 0},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.
 nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)
 }}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected|
 |(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){for(r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f
 .elem=e),n=(n||"").match(w)||[""],l=n.length;l--;)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){for(t=(t||"").match(w)||[""],l=t.length;l--;)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.l
 ength;o--;)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||
 p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}for(d=0;(l=h[d++])&&!n.isPropagationStopped();)n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=b.event.handlers.call(this,e,l),n=
 0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=tt.test(i)?this.mouse
 Hooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;t--;)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.sc
 rollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof
  e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i
 =e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this.
 _just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}})
 ,b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undeleg
 ate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e
 ),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;u--;)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;
 )n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=i.preFilter;s;){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){for(;t=t[i];)if((1===t.nodeType||o)&&e(t,n,s))return!0}else for(;t=t[i];)if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return
  e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r)for(l=mt(y,d),r(l,[],s,u),c=l.length;c--;)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p));if(o){if(i||e){if(i){for(l=[],c=y.length;c--;)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}for(c=y.length;c--;)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){for(var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeTyp
 e?c(e,n,r):p(e,n,r))}];o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r&&!i.relative[e[r].type];r++);return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){for(g=0;m=e[g++];)if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){for(g=0;m=t[g++];)m(x,y,u,c);if(s){if(v>0)for(;b--;)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}function xt(e,t,n){for(var r=0,i=t.length;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1
 ===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}for(o=U.needsContext.test(e)?0:a.length;o--&&(u=a[o],!i.relative[l=u.type]);)if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}return s(e,p)(r,t,d,n,V.test(e)),n}function Tt(){}var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((
 ?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n
 +65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){for(var t,n=[];t=this[e++];)n.push(t);return n}}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a>
 <div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&
 &e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length|
 |h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t
 ];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);for(r=e;r=r.parentNode;)s.unshift(r);for(r=t;r=r.parentNode;)l.unshift(r);for(;s[i]===l[i];)i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "
 +e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e
 ){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u
 ){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(p=t;p=p[g];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];p=++d&&p&&p[g]||(f=d=0)||h.pop();)if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else for(;(p=++d&&p&&p[g]||(f=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++f||(v&&((p[x]||(p[x]={}))[e]=[N,f]),p!==t)););return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){r
 eturn r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e)
 {return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){for(var r
 =0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){for(t||(t=ft(e)),n=t.length;n--;)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o},i.pseudos.nth=i.pseudos.eq,i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,th
 is[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==type
 of e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack,b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.
 fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)
 }}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,
 "<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return t
 his},wrapInner:function(e){return this.each(b.isFunction(e)?function(t){b(this).wrapInner(e.call(this,t))}:function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function
 (e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&b.cleanData(Ot(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)}
 ,null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"glo
 balEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}}),b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){for(var n,r=0,i=[],o=b(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}}),b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&
 &Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){for(s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];i--;)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody)for(o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;i--;)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(b.merge(d,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));for(s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;o=d[h++];)if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),
 "script"),a&&Mt(s),n))for(i=0;o=s[i++];)kt.test(o.type||"")&&n.push(o);return s=null,f},cleanData:function(e,t){for(var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;
 i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.sup
 port.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=fu
 nction(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),
 ""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:i
 nput|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")},b.each("blur focus focusin focusout load resize scroll unload click dblclick moused
 own mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[],b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o
 =arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t
 ){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{}
 ,y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c)for(c={};t=Tn.exec(a);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&
 "string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(j
 n,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}}),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&
 &(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=
 a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.te
 xt=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}}),b.Tween=rr,rr.prototype={constructor:rr,init
 :function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.el
 em[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n
 )&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};r

<TRUNCATED>

[44/55] [abbrv] git commit: Test case for default query string options

Posted by sn...@apache.org.
Test case for default query string options


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/55462ea0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/55462ea0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/55462ea0

Branch: refs/pull/76/head
Commit: 55462ea09173292a8418020bf6514accb3404998
Parents: 00afe2c
Author: ryan bridges <rb...@apigee.com>
Authored: Thu Mar 13 10:24:32 2014 -0400
Committer: ryan bridges <rb...@apigee.com>
Committed: Thu Mar 13 10:28:48 2014 -0400

----------------------------------------------------------------------
 sdks/html5-javascript/lib/modules/Client.js |  2 +-
 sdks/html5-javascript/tests/mocha/test.js   | 25 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/55462ea0/sdks/html5-javascript/lib/modules/Client.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/lib/modules/Client.js b/sdks/html5-javascript/lib/modules/Client.js
index 242b08b..63e5a13 100644
--- a/sdks/html5-javascript/lib/modules/Client.js
+++ b/sdks/html5-javascript/lib/modules/Client.js
@@ -50,7 +50,7 @@
     var mQuery = options.mQuery || false; //is this a query to the management endpoint?
     var orgName = this.get('orgName');
     var appName = this.get('appName');
-    var default_qs=this.get('default_qs');
+    var default_qs=this.getObject('default_qs');
     var uri;
       var logoutCallback=function(){
           if (typeof(this.logoutCallback) === 'function') {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/55462ea0/sdks/html5-javascript/tests/mocha/test.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/tests/mocha/test.js b/sdks/html5-javascript/tests/mocha/test.js
index 7b78e04..a60a61c 100644
--- a/sdks/html5-javascript/tests/mocha/test.js
+++ b/sdks/html5-javascript/tests/mocha/test.js
@@ -186,6 +186,31 @@ describe('Usergrid', function(){
                 method: 'GET',
                 endpoint: 'users'
             };
+            it('should persist default query parameters', function(done) {
+                //create new client with default params
+                var client=new Usergrid.Client({
+                    orgName: 'yourorgname',
+                    appName: 'sandbox',
+                    logging: false, //optional - turn on logging, off by default
+                    buildCurl: true, //optional - turn on curl commands, off by default
+                    qs:{
+                        test1:'test1',
+                        test2:'test2'
+                    }
+                });
+                var default_qs=client.getObject('default_qs');
+                assert(default_qs.test1==='test1', "the default query parameters were not persisted");
+                assert(default_qs.test2==='test2', "the default query parameters were not persisted");
+                client.request({
+                    method: 'GET',
+                    endpoint: 'users'
+                }, function(err, data) {
+                    //console.log(err, data);
+                    assert(data.params.test2[0]==='test2', "the default query parameters were not sent to the backend");
+                    assert(data.params.test1[0]==='test1', "the default query parameters were not sent to the backend");
+                    done();
+                });
+            });
             it('should CREATE a new user', function(done) {
                 client.request({
                     method: 'POST',


[36/55] [abbrv] git commit: Merge pull request #65 from spreiter301/issue-usergrid-81

Posted by sn...@apache.org.
Merge pull request #65 from spreiter301/issue-usergrid-81

Issue usergrid 81 - Unable to build the launcher project

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/7ea7503a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/7ea7503a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/7ea7503a

Branch: refs/pull/76/head
Commit: 7ea7503a75c94e3d9306e405c2bedf79a092fc7b
Parents: 2ef4e33 3ac9ecf
Author: Dave Johnson <da...@rollerweblogger.org>
Authored: Tue Mar 11 10:26:57 2014 -0400
Committer: Dave Johnson <da...@rollerweblogger.org>
Committed: Tue Mar 11 10:26:57 2014 -0400

----------------------------------------------------------------------
 .../1.5.4/AppleJavaExtensions-1.5.4.jar            | Bin 0 -> 23531 bytes
 .../1.5.4/AppleJavaExtensions-1.5.4.pom            |   9 +++++++++
 .../AppleJavaExtensions/maven-metadata-local.xml   |  12 ++++++++++++
 stack/pom.xml                                      |   4 ++--
 4 files changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7ea7503a/stack/pom.xml
----------------------------------------------------------------------


[24/55] [abbrv] git commit: removing another reference to angularitics

Posted by sn...@apache.org.
removing another reference to angularitics


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/54b06312
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/54b06312
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/54b06312

Branch: refs/pull/76/head
Commit: 54b06312e57983bf8a4f6573cc53430cbc7cc73f
Parents: 2e177b9
Author: Shawn Feldman <sh...@gmail.com>
Authored: Mon Mar 10 15:06:40 2014 -0600
Committer: Shawn Feldman <sh...@gmail.com>
Committed: Mon Mar 10 15:06:40 2014 -0600

----------------------------------------------------------------------
 portal/js/app.js | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/54b06312/portal/js/app.js
----------------------------------------------------------------------
diff --git a/portal/js/app.js b/portal/js/app.js
index 73d0c6d..274d50e 100644
--- a/portal/js/app.js
+++ b/portal/js/app.js
@@ -59,8 +59,6 @@ angular.module('appservices',
       'ngResource',
       'ngSanitize',
       'ui.bootstrap',
-      'angulartics',
-      'angulartics.google.analytics',
       'appservices.filters',
       'appservices.services',
       'appservices.directives',


[14/55] [abbrv] git commit: Merge pull request #47 from sungjuly/USERGRID-59

Posted by sn...@apache.org.
Merge pull request #47 from sungjuly/USERGRID-59

Mismatch application metadata ( APPLICATIONS_CF and Management Apps )

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/d565e798
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/d565e798
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/d565e798

Branch: refs/pull/76/head
Commit: d565e79879a7bd74b254ddbfa0d04ad5ec6bc043
Parents: 631f02d 6c14dc2
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Mar 7 09:09:35 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Mar 7 09:09:35 2014 -0700

----------------------------------------------------------------------
 .../RepairingMismatchedApplicationMetadata.java | 57 ++++++++++++++++++++
 1 file changed, 57 insertions(+)
----------------------------------------------------------------------



[42/55] [abbrv] git commit: Merging from usergrid/usergrid

Posted by sn...@apache.org.
Merging from usergrid/usergrid


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/dee2ca98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/dee2ca98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/dee2ca98

Branch: refs/pull/76/head
Commit: dee2ca98330294101c4a5258910cb75fbac7205b
Parents: c0ba7b0 7ea7503
Author: ryan bridges <rb...@apigee.com>
Authored: Thu Mar 13 10:28:40 2014 -0400
Committer: ryan bridges <rb...@apigee.com>
Committed: Thu Mar 13 10:28:40 2014 -0400

----------------------------------------------------------------------
 .gitignore                                      |    9 +-
 portal/config.js                                |   11 +-
 portal/index-debug.html                         |   18 +-
 portal/index-template.html                      |    2 +-
 portal/index.html                               |   18 +-
 portal/js/app.js                                |    7 +-
 portal/js/global/page-controller.js             |   58 +-
 portal/js/global/page-title.html                |    2 +-
 portal/js/global/ug-service.js                  |   74 +-
 portal/js/libs/usergrid-libs.min.js             |   22 +-
 portal/js/libs/usergrid.sdk.js                  |    5 +
 portal/js/login/forgot-password-controller.js   |    1 -
 portal/js/login/login-controller.js             |    8 +-
 portal/js/login/login.html                      |    6 +
 portal/js/menus/appMenu.html                    |    7 +-
 portal/js/menus/menu-directives.js              |    1 -
 portal/js/org-overview/org-overview.html        |    4 +-
 portal/js/templates.js                          |   57 +-
 portal/js/usergrid-dev.min.js                   |  171 +-
 portal/js/usergrid.min.js                       |   12 +-
 portal/js/users/users-feed-controller.js        |   29 +
 portal/js/users/users-feed.html                 |   27 +
 portal/js/users/users.html                      |    1 +
 portal/package.json                             |    5 +-
 portal/phantomjsdriver.log                      | 3869 ------------------
 portal/seleniumLog.txt                          |    0
 portal/tests/unit/sample.spec.js                |    3 +-
 sdks/html5-javascript/lib/modules/Folder.js     |    4 +-
 sdks/html5-javascript/usergrid.js               |    4 +-
 sdks/html5-javascript/usergrid.min.js           |    2 +-
 .../org/apache/usergrid/persistence/Query.java  |    5 +-
 .../usergrid/persistence/entities/Export.java   |  158 +
 .../1.5.4/AppleJavaExtensions-1.5.4.jar         |  Bin 0 -> 23531 bytes
 .../1.5.4/AppleJavaExtensions-1.5.4.pom         |    9 +
 .../maven-metadata-local.xml                    |   12 +
 stack/pom.xml                                   |    7 +-
 .../rest/management/ManagementResource.java     |   15 +-
 .../applications/ApplicationResource.java       |  181 +-
 .../rest/management/ManagementResourceIT.java   |  497 ++-
 .../usergrid/management/export/ExportJob.java   |   81 +
 .../management/export/ExportService.java        |   48 +
 .../management/export/ExportServiceImpl.java    |  608 +++
 .../usergrid/management/export/S3Export.java    |   35 +
 .../management/export/S3ExportImpl.java         |  109 +
 .../services/AbstractCollectionService.java     |    3 +
 .../resources/usergrid-services-context.xml     |   10 +
 .../org/apache/usergrid/ServiceITSetup.java     |    3 +
 .../org/apache/usergrid/ServiceITSetupImpl.java |    6 +
 .../cassandra/ManagementServiceIT.java          |  707 +++-
 .../management/cassandra/MockS3ExportImpl.java  |   72 +
 .../RepairingMismatchedApplicationMetadata.java |   73 +
 51 files changed, 3001 insertions(+), 4075 deletions(-)
----------------------------------------------------------------------



[33/55] [abbrv] git commit: fix bug with analytics

Posted by sn...@apache.org.
fix bug with analytics


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/f6c3d4aa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/f6c3d4aa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/f6c3d4aa

Branch: refs/pull/76/head
Commit: f6c3d4aa2f464f46fe8c36bdce10f6e0852438c5
Parents: c1950d9
Author: Shawn Feldman <sh...@gmail.com>
Authored: Mon Mar 10 15:24:56 2014 -0600
Committer: Shawn Feldman <sh...@gmail.com>
Committed: Mon Mar 10 15:24:56 2014 -0600

----------------------------------------------------------------------
 portal/index-debug.html             | 16 ++++++++--------
 portal/index.html                   | 16 ++++++++--------
 portal/js/global/page-controller.js |  2 +-
 portal/js/global/ug-service.js      |  6 ++----
 portal/js/libs/usergrid-libs.min.js |  2 +-
 portal/js/usergrid-dev.min.js       | 13 ++++---------
 portal/js/usergrid.min.js           |  8 ++++----
 7 files changed, 28 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f6c3d4aa/portal/index-debug.html
----------------------------------------------------------------------
diff --git a/portal/index-debug.html b/portal/index-debug.html
index 7b8dcec..0aaf485 100644
--- a/portal/index-debug.html
+++ b/portal/index-debug.html
@@ -8,12 +8,12 @@
   <meta name="description" content="">
   <meta name="author" content="">
 
-  <link id="libScript" href="2.0.36/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
-  <link id="libScript" href="2.0.36/css/dash.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.0/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.0/css/dash.min.css" rel="stylesheet">
 
   <!--styles for jquery ui calendar component-->
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-timepicker.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.0/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.0/js/libs/jqueryui/jquery-ui-timepicker.css">
 </head>
 <body ng-controller="PageCtrl">
 <!-- Google Tag Manager -->
@@ -115,14 +115,14 @@
     </div>
   </div>
 </section>
-<script id="libScript" src="2.0.36/js/libs/usergrid-libs.min.js"></script>
-<script id="libScript" src="2.0.36/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
+<script id="libScript" src="2.0.0/js/libs/usergrid-libs.min.js"></script>
+<script id="libScript" src="2.0.0/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
 <!--todo - remove this. temporarily including jquery ui for calendar in push-->
-<script id="libScript" src="2.0.36/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
+<script id="libScript" src="2.0.0/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
 <!-- In dev use: <script src="js/libs/angular-1.1.5.js"></script> -->
 <!--<script type="text/javascript" src="js/libs/angular-ui-ng-grid/ng-grid-2.0.2.debug.js"></script>-->
 <script src="config.js"></script>
-<script id="main-script" src="2.0.36/js/usergrid-dev.min.js"></script>
+<script id="main-script" src="2.0.0/js/usergrid-dev.min.js"></script>
 
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f6c3d4aa/portal/index.html
----------------------------------------------------------------------
diff --git a/portal/index.html b/portal/index.html
index 95b6eb8..6a00379 100644
--- a/portal/index.html
+++ b/portal/index.html
@@ -8,12 +8,12 @@
   <meta name="description" content="">
   <meta name="author" content="">
 
-  <link id="libScript" href="2.0.36/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
-  <link id="libScript" href="2.0.36/css/dash.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.0/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.0/css/dash.min.css" rel="stylesheet">
 
   <!--styles for jquery ui calendar component-->
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
-  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-timepicker.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.0/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.0/js/libs/jqueryui/jquery-ui-timepicker.css">
 </head>
 <body ng-controller="PageCtrl">
 <!-- Google Tag Manager -->
@@ -115,14 +115,14 @@
     </div>
   </div>
 </section>
-<script id="libScript" src="2.0.36/js/libs/usergrid-libs.min.js"></script>
-<script id="libScript" src="2.0.36/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
+<script id="libScript" src="2.0.0/js/libs/usergrid-libs.min.js"></script>
+<script id="libScript" src="2.0.0/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
 <!--todo - remove this. temporarily including jquery ui for calendar in push-->
-<script id="libScript" src="2.0.36/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
+<script id="libScript" src="2.0.0/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
 <!-- In dev use: <script src="js/libs/angular-1.1.5.js"></script> -->
 <!--<script type="text/javascript" src="js/libs/angular-ui-ng-grid/ng-grid-2.0.2.debug.js"></script>-->
 <script src="config.js"></script>
-<script id="main-script" src="2.0.36/js/usergrid.min.js"></script>
+<script id="main-script" src="2.0.0/js/usergrid.min.js"></script>
 
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f6c3d4aa/portal/js/global/page-controller.js
----------------------------------------------------------------------
diff --git a/portal/js/global/page-controller.js b/portal/js/global/page-controller.js
index f8ed966..5de913b 100644
--- a/portal/js/global/page-controller.js
+++ b/portal/js/global/page-controller.js
@@ -11,7 +11,7 @@ AppServices.Controllers.controller('PageCtrl',
     '$q',
     '$route',
     '$log',
-    '$analytics', function (
+     function (
                      ug,
                      utility,
                      $scope,

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f6c3d4aa/portal/js/global/ug-service.js
----------------------------------------------------------------------
diff --git a/portal/js/global/ug-service.js b/portal/js/global/ug-service.js
index 95307b0..b9c1d3b 100644
--- a/portal/js/global/ug-service.js
+++ b/portal/js/global/ug-service.js
@@ -1,6 +1,6 @@
 'use strict';
 
-AppServices.Services.factory('ug', function (configuration, $rootScope,utility, $q, $http, $resource, $log, $analytics,$location) {
+AppServices.Services.factory('ug', function (configuration, $rootScope,utility, $q, $http, $resource, $log,$location) {
 
   var requestTimes = [],
     running = false,
@@ -8,9 +8,7 @@ AppServices.Services.factory('ug', function (configuration, $rootScope,utility,
 
   function reportError(data,config){
     try {
-      $analytics.eventTrack('error', {
-        category: 'App Services', label: data + ':' + config.url + ':' + (sessionStorage['apigee_uuid'] || 'na')
-      });
+    
     } catch (e) {
       console.log(e)
     }


[26/55] [abbrv] reset version number add built files, so site doesn't initially have to be built

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c1950d95/portal/js/usergrid.min.js
----------------------------------------------------------------------
diff --git a/portal/js/usergrid.min.js b/portal/js/usergrid.min.js
index 7dabf61..279579c 100644
--- a/portal/js/usergrid.min.js
+++ b/portal/js/usergrid.min.js
@@ -1,6 +1,6 @@
-/*! apigee-usergrid@1.0.2 2014-03-06 */
-!function(exports,global){function renderChart(chartsDefaults,chartdata){var newSettings={};$.extend(!0,newSettings,chartsDefaults,chartdata);new Highcharts.Chart(newSettings)}function menuBindClick(scope,lElement,cevent,menuContext){var currentSelection=angular.element(cevent.srcElement).parent(),previousSelection=scope[menuContext];previousSelection!==currentSelection&&(previousSelection&&angular.element(previousSelection).removeClass("active"),scope[menuContext]=currentSelection,scope.$apply(function(){currentSelection.addClass("active")}))}global["true"]=exports;var polyfills=function(window,Object){window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)}}(),Object.defineProperty(Object.prototype,"clone",{enumerable:!1,writable:!0,value:function(){var i,newObj=this instanceof Arra
 y?[]:{};for(i in this)"clone"!==i&&(newObj[i]=this[i]&&"object"==typeof this[i]?this[i].clone():this[i]);return newObj}}),Object.defineProperty(Object.prototype,"stringifyJSON",{enumerable:!1,writable:!0,value:function(){return JSON.stringify(this,null,"	")}})};polyfills(window,Object);var AppServices=AppServices||{};global.AppServices=global.AppServices||AppServices,AppServices.Constants=angular.module("appservices.constants",[]),AppServices.Services=angular.module("appservices.services",[]),AppServices.Controllers=angular.module("appservices.controllers",[]),AppServices.Filters=angular.module("appservices.filters",[]),AppServices.Directives=angular.module("appservices.directives",[]),AppServices.Performance=angular.module("appservices.performance",[]),AppServices.Push=angular.module("appservices.push",[]),angular.module("appservices",["ngRoute","ngResource","ngSanitize","ui.bootstrap","angulartics","angulartics.google.analytics","appservices.filters","appservices.services","appser
 vices.directives","appservices.constants","appservices.controllers","appservices.performance","appservices.push"]).config(["$routeProvider","$locationProvider","$sceDelegateProvider","$analyticsProvider",function($routeProvider,$locationProvider,$sceDelegateProvider,$analyticsProvider){$routeProvider.when("/org-overview",{templateUrl:"org-overview/org-overview.html",controller:"OrgOverviewCtrl"}).when("/login",{templateUrl:"login/login.html",controller:"LoginCtrl"}).when("/login/loading",{templateUrl:"login/loading.html",controller:"LoginCtrl"}).when("/app-overview/summary",{templateUrl:"app-overview/app-overview.html",controller:"AppOverviewCtrl"}).when("/getting-started/setup",{templateUrl:"app-overview/getting-started.html",controller:"GettingStartedCtrl"}).when("/forgot-password",{templateUrl:"login/forgot-password.html",controller:"ForgotPasswordCtrl"}).when("/register",{templateUrl:"login/register.html",controller:"RegisterCtrl"}).when("/users",{templateUrl:"users/users.html",
 controller:"UsersCtrl"}).when("/users/profile",{templateUrl:"users/users-profile.html",controller:"UsersProfileCtrl"}).when("/users/groups",{templateUrl:"users/users-groups.html",controller:"UsersGroupsCtrl"}).when("/users/activities",{templateUrl:"users/users-activities.html",controller:"UsersActivitiesCtrl"}).when("/users/feed",{templateUrl:"users/users-feed.html",controller:"UsersFeedCtrl"}).when("/users/graph",{templateUrl:"users/users-graph.html",controller:"UsersGraphCtrl"}).when("/users/roles",{templateUrl:"users/users-roles.html",controller:"UsersRolesCtrl"}).when("/groups",{templateUrl:"groups/groups.html",controller:"GroupsCtrl"}).when("/groups/details",{templateUrl:"groups/groups-details.html",controller:"GroupsDetailsCtrl"}).when("/groups/members",{templateUrl:"groups/groups-members.html",controller:"GroupsMembersCtrl"}).when("/groups/activities",{templateUrl:"groups/groups-activities.html",controller:"GroupsActivitiesCtrl"}).when("/groups/roles",{templateUrl:"groups/gro
 ups-roles.html",controller:"GroupsRolesCtrl"}).when("/roles",{templateUrl:"roles/roles.html",controller:"RolesCtrl"}).when("/roles/settings",{templateUrl:"roles/roles-settings.html",controller:"RolesSettingsCtrl"}).when("/roles/users",{templateUrl:"roles/roles-users.html",controller:"RolesUsersCtrl"}).when("/roles/groups",{templateUrl:"roles/roles-groups.html",controller:"RolesGroupsCtrl"}).when("/data",{templateUrl:"data/data.html",controller:"DataCtrl"}).when("/data/entity",{templateUrl:"data/entity.html",controller:"EntityCtrl"}).when("/data/shell",{templateUrl:"data/shell.html",controller:"ShellCtrl"}).when("/profile/organizations",{templateUrl:"profile/organizations.html",controller:"OrgCtrl"}).when("/profile/profile",{templateUrl:"profile/profile.html",controller:"ProfileCtrl"}).when("/profile",{templateUrl:"profile/account.html",controller:"AccountCtrl"}).when("/activities",{templateUrl:"activities/activities.html",controller:"ActivitiesCtrl"}).when("/shell",{templateUrl:"she
 ll/shell.html",controller:"ShellCtrl"}).when("/logout",{templateUrl:"login/logout.html",controller:"LogoutCtrl"}).otherwise({redirectTo:"/org-overview"}),$locationProvider.html5Mode(!1).hashPrefix("!"),$sceDelegateProvider.resourceUrlWhitelist(["self","http://apigee-internal-prod.jupiter.apigee.net/**","http://apigee-internal-prod.mars.apigee.net/**","https://appservices.apigee.com/**","https://api.usergrid.com/**"]),$analyticsProvider.virtualPageviews(!1),$analyticsProvider.firstPageview(!1)}]),AppServices.Controllers.controller("ActivitiesCtrl",["ug","$scope","$rootScope","$location","$route",function(ug,$scope,$rootScope){$scope.$on("app-activities-received",function(evt,data){$scope.activities=data,$scope.$apply()}),$scope.$on("app-activities-error",function(){$rootScope.$broadcast("alert","error","Application failed to retreive activities data.")}),ug.getActivities()}]),AppServices.Controllers.controller("AppOverviewCtrl",["ug","charts","$scope","$rootScope","$log",function(ug,
 charts,$scope,$rootScope,$log){var createGradient=function(color1,color2){var perShapeGradient={x1:0,y1:0,x2:0,y2:1};return{linearGradient:perShapeGradient,stops:[[0,color1],[1,color2]]}};$scope.appOverview={},$scope.collections=[],$scope.graph="",$scope.$on("top-collections-received",function(event,collections){var dataDescription={bar1:{labels:["Total"],dataAttr:["title","count"],colors:[createGradient("rgba(36,151,212,0.6)","rgba(119,198,240,0.6)")],borderColor:"#1b97d1"}};$scope.collections=collections;var arr=[];for(var i in collections)collections.hasOwnProperty(i)&&arr.push(collections[i]);$scope.appOverview={},$rootScope.chartTemplate?($scope.appOverview.chart=angular.copy($rootScope.chartTemplate.pareto),$scope.appOverview.chart=charts.convertParetoChart(arr,$scope.appOverview.chart,dataDescription.bar1,"1h","NOW"),$scope.applyScope()):ug.httpGet(null,"js/charts/highcharts.json").then(function(success){$rootScope.chartTemplate=success,$scope.appOverview.chart=angular.copy($
 rootScope.chartTemplate.pareto),$scope.appOverview.chart=charts.convertParetoChart(arr,$scope.appOverview.chart,dataDescription.bar1,"1h","NOW"),$scope.applyScope()},function(fail){$log.error("Problem getting chart template",fail)})}),$scope.$on("app-initialized",function(){ug.getTopCollections()}),$rootScope.activeUI&&ug.getTopCollections()}]),AppServices.Controllers.controller("GettingStartedCtrl",["ug","$scope","$rootScope","$location","$timeout","$anchorScroll",function(ug,$scope,$rootScope,$location,$timeout,$anchorScroll){$scope.collections=[],$scope.graph="",$scope.clientID="",$scope.clientSecret="";$scope.regenerateCredentialsDialog=function(modalId){$scope.orgAPICredentials={client_id:"regenerating...",client_secret:"regenerating..."},ug.regenerateAppCredentials(),$scope.hideModal(modalId)},$scope.$on("app-creds-updated",function(event,credentials){credentials?($scope.clientID=credentials.client_id,$scope.clientSecret=credentials.client_secret,$scope.$$phase||$scope.$apply(
 )):setTimeout(function(){ug.getAppCredentials()},5e3)}),ug.getAppCredentials(),$scope.contentTitle,$scope.showSDKDetail=function(name){var introContainer=document.getElementById("intro-container");if("nocontent"===name)return introContainer.style.height="0",!0;introContainer.style.opacity=.1,introContainer.style.height="0";var timeout=0;$scope.contentTitle&&(timeout=500),$timeout(function(){introContainer.style.height="1000px",introContainer.style.opacity=1},timeout),$scope.optionName=name,$scope.contentTitle=name,$scope.sdkLink="http://apigee.com/docs/content/"+name+"-sdk-redirect",$scope.docsLink="http://apigee.com/docs/app-services/content/installing-apigee-sdk-"+name,$scope.getIncludeURL=function(){return"app-overview/doc-includes/"+$scope.optionName+".html"}},$scope.scrollToElement=function(elem){return $location.hash(elem),$anchorScroll(),!1}}]),AppServices.Controllers.controller("ChartCtrl",["$scope","$location",function(){}]),AppServices.Directives.directive("chart",function
 (){return{restrict:"E",scope:{chartdata:"=chartdata"},template:"<div></div>",replace:!0,controller:function(){},link:function(scope,element,attrs){scope.$watch("chartdata",function(chartdata){if(chartdata){var chartsDefaults={chart:{renderTo:element[0],type:attrs.type||null,height:attrs.height||null,width:attrs.width||null,reflow:!0,animation:!1,zoomType:"x"}};if("pie"===attrs.type&&(chartsDefaults.chart.margin=[0,0,0,0],chartsDefaults.chart.spacingLeft=0,chartsDefaults.chart.spacingRight=0,chartsDefaults.chart.spacingTop=0,chartsDefaults.chart.spacingBottom=0,attrs.titleimage&&(chartdata.title.text='<img src="'+attrs.titleimage+'">'),attrs.titleicon&&(chartdata.title.text='<i class="pictogram '+attrs.titleiconclass+'">'+attrs.titleicon+"</i>"),attrs.titlecolor&&(chartdata.title.style.color=attrs.titlecolor),attrs.titleimagetop&&(chartdata.title.style.marginTop=attrs.titleimagetop),attrs.titleimageleft&&(chartdata.title.style.marginLeft=attrs.titleimageleft)),"line"===attrs.type&&(c
 hartsDefaults.chart.marginTop=30,chartsDefaults.chart.spacingTop=50),"column"===attrs.type&&(chartsDefaults.chart.marginBottom=80),"area"===attrs.type&&(chartsDefaults.chart.spacingLeft=0,chartsDefaults.chart.spacingRight=0,chartsDefaults.chart.marginLeft=0,chartsDefaults.chart.marginRight=0),Highcharts.setOptions({global:{useUTC:!1},chart:{style:{fontFamily:"marquette-light, Helvetica, Arial, sans-serif"}}}),"line"===attrs.type){var xAxis1=chartdata.xAxis[0];xAxis1.labels.formatter||(xAxis1.labels.formatter=new Function(attrs.xaxislabel)),xAxis1.labels.step||(xAxis1.labels.step=attrs.xaxisstep)}chartdata.tooltip&&"string"==typeof chartdata.tooltip.formatter&&(chartdata.tooltip.formatter=new Function(chartdata.tooltip.formatter)),renderChart(chartsDefaults,chartdata)}},!0)}}}),AppServices.Services.factory("charts",function(){function sortJsonArrayByProperty(objArray,prop){if(arguments.length<2)throw new Error("sortJsonArrayByProp requires 2 arguments");var direct=arguments.length>2?
 arguments[2]:1;if(objArray&&objArray.constructor===Array){var propPath=prop.constructor===Array?prop:prop.split(".");objArray.sort(function(a,b){for(var p in propPath)a[propPath[p]]&&b[propPath[p]]&&(a=a[propPath[p]],b=b[propPath[p]]);return a=a.match(/^\d+$/)?+a:a,b=b.match(/^\d+$/)?+b:b,b>a?-1*direct:a>b?1*direct:0})}}var lineChart,areaChart,paretoChart,pieChart,xaxis,seriesIndex;return{convertLineChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function plotData(counter,dPLength,dataPoints,dataAttrs,detailedView){for(var i=0;dPLength>i;i++)for(var dp=dataPoints[i],localCounter=counter,j=0;j<dataAttrs.length;j++)lineChart.series[localCounter].data.push("undefined"==typeof dp?[i,0]:[i,dp[dataAttrs[j]]]),detailedView||localCounter++}lineChart=chartTemplate,"undefined"==typeof chartData[0]&&(chartData[0]={},chartData[0].datapoints=[]);var label,dataPoints=chartData[0].datapoints,dPLength=dataPoints.length;"YESTERDAY"===currentCompare?(seriesIndex=dataDe
 scription.dataAttr.length,label="Yesterday "):"LAST_WEEK"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Last Week "):(lineChart=chartTemplate,seriesIndex=0,lineChart.series=[],label=""),xaxis=lineChart.xAxis[0],xaxis.categories=[],settings.xaxisformat&&(xaxis.labels.formatter=new Function(settings.xaxisformat)),settings.step&&(xaxis.labels.step=settings.step);for(var i=0;dPLength>i;i++){var dp=dataPoints[i];xaxis.categories.push(dp.timestamp)}if(chartData.length>1)for(var l=0;l<chartData.length;l++)chartData[l].chartGroupName&&(dataPoints=chartData[l].datapoints,lineChart.series[l]={},lineChart.series[l].data=[],lineChart.series[l].name=chartData[l].chartGroupName,lineChart.series[l].yAxis=0,lineChart.series[l].type="line",lineChart.series[l].color=dataDescription.colors[i],lineChart.series[l].dashStyle="solid",lineChart.series[l].yAxis.title.text=dataDescription.yAxisLabels,plotData(l,dPLength,dataPoints,dataDescription.detailDataAttr,!0));else{for(var steady
 Counter=0,i=seriesIndex;i<dataDescription.dataAttr.length+(seriesIndex>0?seriesIndex:0);i++){var yAxisIndex=dataDescription.multiAxis?steadyCounter:0;lineChart.series[i]={},lineChart.series[i].data=[],lineChart.series[i].name=label+dataDescription.labels[steadyCounter],lineChart.series[i].yAxis=yAxisIndex,lineChart.series[i].type="line",lineChart.series[i].color=dataDescription.colors[i],lineChart.series[i].dashStyle="solid",lineChart.yAxis[yAxisIndex].title.text=dataDescription.yAxisLabels[dataDescription.yAxisLabels>1?steadyCounter:0],steadyCounter++}plotData(seriesIndex,dPLength,dataPoints,dataDescription.dataAttr,!1)}return lineChart},convertAreaChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function plotData(counter,dPLength,dataPoints,dataAttrs,detailedView){for(var i=0;dPLength>i;i++)for(var dp=dataPoints[i],localCounter=counter,j=0;j<dataAttrs.length;j++)areaChart.series[localCounter].data.push("undefined"==typeof dp?0:dp[dataAttrs[j]]),detai
 ledView||localCounter++}areaChart=angular.copy(areaChart),"undefined"==typeof chartData[0]&&(chartData[0]={},chartData[0].datapoints=[]);var label,dataPoints=chartData[0].datapoints,dPLength=dataPoints.length;"YESTERDAY"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Yesterday "):"LAST_WEEK"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Last Week "):(areaChart=chartTemplate,seriesIndex=0,areaChart.series=[],label=""),xaxis=areaChart.xAxis[0],xaxis.categories=[],settings.xaxisformat&&(xaxis.labels.formatter=new Function(settings.xaxisformat)),settings.step&&(xaxis.labels.step=settings.step);for(var i=0;dPLength>i;i++){var dp=dataPoints[i];xaxis.categories.push(dp.timestamp)}if(chartData.length>1)for(var l=0;l<chartData.length;l++)chartData[l].chartGroupName&&(dataPoints=chartData[l].datapoints,areaChart.series[l]={},areaChart.series[l].data=[],areaChart.series[l].fillColor=dataDescription.areaColors[l],areaChart.series[l].name=chartData[l]
 .chartGroupName,areaChart.series[l].yAxis=0,areaChart.series[l].type="area",areaChart.series[l].pointInterval=1,areaChart.series[l].color=dataDescription.colors[l],areaChart.series[l].dashStyle="solid",areaChart.series[l].yAxis.title.text=dataDescription.yAxisLabels,plotData(l,dPLength,dataPoints,dataDescription.detailDataAttr,!0));else{for(var steadyCounter=0,i=seriesIndex;i<dataDescription.dataAttr.length+(seriesIndex>0?seriesIndex:0);i++){var yAxisIndex=dataDescription.multiAxis?steadyCounter:0;areaChart.series[i]={},areaChart.series[i].data=[],areaChart.series[i].fillColor=dataDescription.areaColors[i],areaChart.series[i].name=label+dataDescription.labels[steadyCounter],areaChart.series[i].yAxis=yAxisIndex,areaChart.series[i].type="area",areaChart.series[i].pointInterval=1,areaChart.series[i].color=dataDescription.colors[i],areaChart.series[i].dashStyle="solid",areaChart.yAxis[yAxisIndex].title.text=dataDescription.yAxisLabels[dataDescription.yAxisLabels>1?steadyCounter:0],stead
 yCounter++}plotData(seriesIndex,dPLength,dataPoints,dataDescription.dataAttr,!1)}return areaChart},convertParetoChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function getPreviousData(){for(var i=0;i<chartTemplate.series[0].data.length;i++)allParetoOptions.push(chartTemplate.xAxis.categories[i])}function createStackedBar(dataDescription,paretoChart){paretoChart.plotOptions={series:{shadow:!1,borderColor:dataDescription.borderColor,borderWidth:1},column:{stacking:"normal",dataLabels:{enabled:!0,color:Highcharts.theme&&Highcharts.theme.dataLabelsColor||"white"}}};var start=dataDescription.dataAttr[1].length,steadyCounter=0;compare&&(paretoChart.legend.enabled=!0);for(var f=seriesIndex;start+seriesIndex>f;f++)paretoChart.series[f]||(paretoChart.series[f]={data:[]}),paretoChart.series[f].data.push(bar[dataDescription.dataAttr[1][steadyCounter]]),paretoChart.series[f].name=""!==label?label+" "+dataDescription.labels[steadyCounter]:dataDescription.labels[s
 teadyCounter],paretoChart.series[f].color=dataDescription.colors[f],paretoChart.series[f].stack=label,steadyCounter++}paretoChart=chartTemplate,"undefined"==typeof chartData&&(chartData=[]);var label,cdLength=chartData.length,compare=!1,allParetoOptions=[],stackedBar=!1;if(seriesIndex=0,"object"==typeof dataDescription.dataAttr[1]&&(stackedBar=!0),"YESTERDAY"===currentCompare?(label="Yesterday ",compare=!0,stackedBar&&(seriesIndex=dataDescription.dataAttr[1].length),getPreviousData()):"LAST_WEEK"===currentCompare?(label="Last Week ",compare=!0,stackedBar&&(seriesIndex=dataDescription.dataAttr[1].length),seriesIndex=getPreviousData()):(compare=!1,label="",paretoChart.xAxis.categories=[],paretoChart.series=[],paretoChart.series[0]={},paretoChart.series[0].data=[],paretoChart.legend.enabled=!1),paretoChart.plotOptions.series.borderColor=dataDescription.borderColor,compare&&!stackedBar){paretoChart.series[1]={},paretoChart.series[1].data=[];for(var i=0;i<allParetoOptions.length;i++)pare
 toChart.series[1].data.push(0);paretoChart.legend.enabled=!0}for(var i=0;cdLength>i;i++){var bar=chartData[i];if(compare){var newLabel=bar[dataDescription.dataAttr[0]],newValue=bar[dataDescription.dataAttr[1]],previousIndex=allParetoOptions.indexOf(newLabel);previousIndex>-1&&("object"==typeof dataDescription.dataAttr[1]?createStackedBar(dataDescription,paretoChart,paretoChart.series.length):(paretoChart.series[1].data[previousIndex]=newValue,paretoChart.series[1].name=""!==label?label+" "+dataDescription.labels[0]:dataDescription.labels[0],paretoChart.series[1].color=dataDescription.colors[1]))}else paretoChart.xAxis.categories.push(bar[dataDescription.dataAttr[0]]),"object"==typeof dataDescription.dataAttr[1]?createStackedBar(dataDescription,paretoChart,paretoChart.series.length):(paretoChart.series[0].data.push(bar[dataDescription.dataAttr[1]]),paretoChart.series[0].name=dataDescription.labels[0],paretoChart.series[0].color=dataDescription.colors[0])}return paretoChart},convertPi
 eChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){var label,cdLength=chartData.length,compare=!1;pieChart=chartTemplate,"YESTERDAY"===currentCompare?(label="Yesterday ",compare=!1):"LAST_WEEK"===currentCompare?(label="Last Week ",compare=!1):(compare=!1,pieChart.series[0].data=[],pieChart.series[0].dataLabels&&"string"==typeof pieChart.series[0].dataLabels.formatter&&(pieChart.series[0].dataLabels.formatter=new Function(pieChart.series[0].dataLabels.formatter))),pieChart.plotOptions.pie.borderColor=dataDescription.borderColor,compare&&(pieChart.series[1].data=[],pieChart.series[1].dataLabels&&"string"==typeof pieChart.series[1].dataLabels.formatter&&(pieChart.series[1].dataLabels.formatter=new Function(pieChart.series[1].dataLabels.formatter)));for(var tempArray=[],i=0;cdLength>i;i++){var pie=chartData[i];tempArray.push({name:pie[dataDescription.dataAttr[0]],y:pie[dataDescription.dataAttr[1]],color:""})}sortJsonArrayByProperty(tempArray,"name");for(var
  i=0;i<tempArray.length;i++)tempArray[i].color=dataDescription.colors[i];return compare?pieChart.series[1].data=tempArray:pieChart.series[0].data=tempArray,pieChart}}}),$(".sessions-bar").sparkline([3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,1],{type:"bar",barColor:"#c5c5c5",width:"800px",height:100,barWidth:12,barSpacing:"1px"}),AppServices.Controllers.controller("DataCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope){var init=function(){$scope.verb="GET",$scope.display="",$scope.queryBodyDetail={},$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.entitySelected={},$scope.newCollection={},$rootScope.queryCollection={},$scope.data={},$scope.data.queryPath="",$scope.data.queryBody='{ "name":"value" }',$scope.data.searchString="",$scope.data.queryLimit=""},runQuery=function(verb){$scope.loading=!0;var queryPath=$scope.removeFirstSl
 ash($scope.data.queryPath||""),searchString=$scope.data.searchString||"",queryLimit=$scope.data.queryLimit||"",body=JSON.parse($scope.data.queryBody||"{}");"POST"==verb&&$scope.validateJson(!0)?ug.runDataPOSTQuery(queryPath,body):"PUT"==verb&&$scope.validateJson(!0)?ug.runDataPutQuery(queryPath,searchString,queryLimit,body):"DELETE"==verb?ug.runDataDeleteQuery(queryPath,searchString,queryLimit):ug.runDataQuery(queryPath,searchString,queryLimit)};$scope.$on("top-collections-received",function(event,collectionList){$scope.loading=!1;var ignoredCollections=["events"];ignoredCollections.forEach(function(ignoredCollection){collectionList.hasOwnProperty(ignoredCollection)&&delete collectionList[ignoredCollection]}),$scope.collectionList=collectionList,$scope.queryBoxesSelected=!1,$scope.queryPath||$scope.loadCollection("/"+collectionList[Object.keys(collectionList).sort()[0]].name),$scope.applyScope()}),$scope.$on("error-running-query",function(){$scope.loading=!1,runQuery("GET"),$scope.a
 pplyScope()}),$scope.$on("entity-deleted",function(){$scope.deleteLoading=!1,$rootScope.$broadcast("alert","success","Entities deleted sucessfully"),$scope.queryBoxesSelected=!1,$scope.checkNextPrev(),$scope.applyScope()}),$scope.$on("entity-deleted-error",function(){$scope.deleteLoading=!1,runQuery("GET"),$scope.applyScope()}),$scope.$on("collection-created",function(){$scope.newCollection.name=""}),$scope.$on("query-received",function(event,collection){$scope.loading=!1,$rootScope.queryCollection=collection,ug.getIndexes($scope.data.queryPath),$scope.setDisplayType(),$scope.checkNextPrev(),$scope.applyScope(),$scope.queryBoxesSelected=!1}),$scope.$on("indexes-received",function(event,indexes){}),$scope.$on("app-changed",function(){init()}),$scope.setDisplayType=function(){$scope.display="generic"},$scope.deleteEntitiesDialog=function(modalId){$scope.deleteLoading=!1,$scope.deleteEntities($rootScope.queryCollection,"entity-deleted","error deleting entity"),$scope.hideModal(modalId)
 },$scope.newCollectionDialog=function(modalId){$scope.newCollection.name?(ug.createCollection($scope.newCollection.name),ug.getTopCollections(),$rootScope.$broadcast("alert","success","Collection created successfully."),$scope.hideModal(modalId)):$rootScope.$broadcast("alert","error","You must specify a collection name.")},$scope.addToPath=function(uuid){$scope.data.queryPath="/"+$rootScope.queryCollection._type+"/"+uuid},$scope.isDeep=function(item){return"[object Object]"===Object.prototype.toString.call(item)},$scope.loadCollection=function(type){$scope.data.queryPath="/"+type.substring(1,type.length),$scope.data.searchString="",$scope.data.queryLimit="",$scope.data.body='{ "name":"value" }',$scope.selectGET(),$scope.applyScope(),$scope.run()},$scope.selectGET=function(){$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="GET"},$scope.selectPOST=function(){$scope.queryBodyDisplay="block",$scope.queryLimitDisplay="none",$s
 cope.queryStringDisplay="none",$scope.verb="POST"},$scope.selectPUT=function(){$scope.queryBodyDisplay="block",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="PUT"},$scope.selectDELETE=function(){$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="DELETE"},$scope.validateJson=function(skipMessage){var queryBody=$scope.data.queryBody;try{queryBody=JSON.parse(queryBody)}catch(e){return $rootScope.$broadcast("alert","error","JSON is not valid"),!1}return queryBody=JSON.stringify(queryBody,null,2),!skipMessage&&$rootScope.$broadcast("alert","success","JSON is valid"),$scope.data.queryBody=queryBody,!0},$scope.saveEntity=function(entity){if(!$scope.validateJson())return!1;var queryBody=entity._json;queryBody=JSON.parse(queryBody),$rootScope.selectedEntity.set(),$rootScope.selectedEntity.set(queryBody),$rootScope.selectedEntity.set("type",entity._data.type),$rootScope.selectedEntity.set("uuid",entit
 y._data.uuid),$rootScope.selectedEntity.save(function(err,data){err?$rootScope.$broadcast("alert","error","error: "+data.error_description):$rootScope.$broadcast("alert","success","entity saved")})},$scope.run=function(){$rootScope.queryCollection="";var verb=$scope.verb;runQuery(verb)},$scope.hasProperty=function(prop){var retval=!1;return"undefined"!=typeof $rootScope.queryCollection._list&&angular.forEach($rootScope.queryCollection._list,function(value){retval||value._data[prop]&&(retval=!0)}),retval},$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$rootScope.queryCollection.hasPreviousPage()&&($scope.previous_display="default"),$rootScope.queryCollection.hasNextPage()&&($scope.next_display="default")},$scope.selectEntity=function(uuid){$rootScope.selectedEntity=$rootScope.queryCollection.getEntityByUUID(uuid),$scope.addToPath(uuid)},$scope.getJSONView=function(entity){var tempjson=e
 ntity.get(),queryBody=JSON.stringify(tempjson,null,2);queryBody=JSON.parse(queryBody),delete queryBody.metadata,delete queryBody.uuid,delete queryBody.created,delete queryBody.modified,delete queryBody.type,$scope.queryBody=JSON.stringify(queryBody,null,2)},$scope.getPrevious=function(){$rootScope.queryCollection.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of data"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.getNext=function(){$rootScope.queryCollection.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of data"),$scope.checkNextPrev(),$scope.applyScope()})},init(),$rootScope.queryCollection=$rootScope.queryCollection||{},$rootScope.selectedEntity={},$rootScope.queryCollection&&$rootScope.queryCollection._type&&($scope.loadCollection($rootScope.queryCollection._type),$scope.setDisplayType()),ug.getTopCollections(),$scope.resetNextPrev()}]),AppServices.Controllers.controller
 ("EntityCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){if(!$rootScope.selectedEntity)return void $location.path("/data");$scope.entityUUID=$rootScope.selectedEntity.get("uuid"),$scope.entityType=$rootScope.selectedEntity.get("type");var tempjson=$rootScope.selectedEntity.get(),queryBody=JSON.stringify(tempjson,null,2);queryBody=JSON.parse(queryBody),delete queryBody.metadata,delete queryBody.uuid,delete queryBody.created,delete queryBody.modified,delete queryBody.type,$scope.queryBody=JSON.stringify(queryBody,null,2),$scope.validateJson=function(){var queryBody=$scope.queryBody;try{queryBody=JSON.parse(queryBody)}catch(e){return $rootScope.$broadcast("alert","error","JSON is not valid"),!1}return queryBody=JSON.stringify(queryBody,null,2),$rootScope.$broadcast("alert","success","JSON is valid"),$scope.queryBody=queryBody,!0},$scope.saveEntity=function(){if(!$scope.validateJson())return!1;var queryBody=$scope.queryBody;queryBody=JSON.parse(quer
 yBody),$rootScope.selectedEntity.set(),$rootScope.selectedEntity.set(queryBody),$rootScope.selectedEntity.set("type",$scope.entityType),$rootScope.selectedEntity.set("uuid",$scope.entityUUID),$rootScope.selectedEntity.save(function(err,data){err?$rootScope.$broadcast("alert","error","error: "+data.error_description):$rootScope.$broadcast("alert","success","entity saved")})}}]),AppServices.Controllers.controller("ShellCtrl",["ug","$scope","$rootScope","$location",function(){}]),AppServices.Directives.directive("balloon",["$window","$timeout",function($window,$timeout){return{restrict:"ECA",scope:"=",template:'<div class="baloon {{direction}}" ng-transclude></div>',replace:!0,transclude:!0,link:function(scope,lElement,attrs){scope.direction=attrs.direction;var runScroll=!0,windowEl=angular.element($window);windowEl.on("scroll",function(){runScroll&&(lElement.addClass("fade-out"),$timeout(function(){lElement.addClass("hide")},1e3),runScroll=!1)})}}}]),AppServices.Directives.directive("
 bsmodal",["$rootScope",function($rootScope){return{restrict:"ECA",scope:{title:"@title",buttonid:"=buttonid",footertext:"=footertext",closelabel:"=closelabel"},transclude:!0,templateUrl:"dialogs/modal.html",replace:!0,link:function(scope,lElement,attrs,parentCtrl){scope.title=attrs.title,scope.footertext=attrs.footertext,scope.closelabel=attrs.closelabel,scope.close=attrs.close,scope.extrabutton=attrs.extrabutton,scope.extrabuttonlabel=attrs.extrabuttonlabel,scope.buttonId=attrs.buttonid,scope.closeDelegate=function(attr){scope.$parent[attr](attrs.id,scope)},scope.extraDelegate=function(attr){scope.dialogForm.$valid?(console.log(parentCtrl),scope.$parent[attr](attrs.id)):$rootScope.$broadcast("alert","error","Please check your form input and resubmit.")}}}}]),AppServices.Controllers.controller("AlertCtrl",["$scope","$rootScope","$timeout",function($scope,$rootScope,$timeout){$scope.alertDisplay="none",$scope.alerts=[],$scope.$on("alert",function(event,type,message,permanent){$scope.
 addAlert(type,message,permanent)}),$scope.$on("clear-alerts",function(){$scope.alerts=[]}),$scope.addAlert=function(type,message,permanent){$scope.alertDisplay="block",$scope.alerts.push({type:type,msg:message}),$scope.applyScope(),permanent||$timeout(function(){$scope.alerts.shift()},5e3)},$scope.closeAlert=function(index){$scope.alerts.splice(index,1)}}]),AppServices.Directives.directive("alerti",["$rootScope","$timeout",function($rootScope,$timeout){return{restrict:"ECA",scope:{type:"=type",closeable:"@closeable",index:"&index"},template:'<div class="alert" ng-class="type && \'alert-\' + type">    <button ng-show="closeable" type="button" class="close" ng-click="closeAlert(index)">&times;</button>    <i ng-if="type === \'warning\'" class="pictogram pull-left" style="font-size:3em;line-height:0.4">&#128165;</i>    <i ng-if="type === \'info\'" class="pictogram pull-left">&#8505;</i>    <i ng-if="type === \'error\'" class="pictogram pull-left">&#9889;</i>    <i ng-if="type === \'suc
 cess\'" class="pictogram pull-left">&#128077;</i><div ng-transclude></div></div>',replace:!0,transclude:!0,link:function(scope,lElement,attrs){$timeout(function(){lElement.addClass("fade-out")},4e3),lElement.click(function(){attrs.index&&scope.$parent.closeAlert(attrs.index)}),setTimeout(function(){lElement.addClass("alert-animate")},10)}}}]),AppServices.Directives.directive("appswitcher",["$rootScope",function(){return{restrict:"ECA",scope:"=",templateUrl:"global/appswitcher-template.html",replace:!0,transclude:!0,link:function(){function globalNavDetail(){$("#globalNavDetail > div").removeClass(classNameOpen),$("#globalNavDetailApiPlatform").addClass(classNameOpen)}var classNameOpen="open";$("ul.nav li.dropdownContainingSubmenu").hover(function(){$(this).addClass(classNameOpen)},function(){$(this).removeClass(classNameOpen)}),$("#globalNav > a").mouseover(globalNavDetail),$("#globalNavDetail").mouseover(globalNavDetail),$("#globalNavSubmenuContainer ul li").mouseover(function(){$(
 "#globalNavDetail > div").removeClass(classNameOpen),$("#"+this.getAttribute("data-globalNavDetail")).addClass(classNameOpen)
-})}}}]),AppServices.Directives.directive("insecureBanner",["$rootScope","ug",function($rootScope,ug){return{restrict:"E",transclude:!0,templateUrl:"global/insecure-banner.html",link:function(scope){scope.securityWarning=!1,scope.$on("roles-received",function(evt,roles){scope.securityWarning=!1,roles&&roles._list&&roles._list.forEach(function(roleHolder){var role=roleHolder._data;"GUEST"===role.name.toUpperCase()&&roleHolder.getPermissions(function(err){err||roleHolder.permissions&&roleHolder.permissions.forEach(function(permission){permission.path.indexOf("/**")>=0&&(scope.securityWarning=!0,scope.applyScope())})})})});var initialized=!1;scope.$on("app-initialized",function(){!initialized&&ug.getRoles(),initialized=!0}),scope.$on("app-changed",function(){scope.securityWarning=!1,ug.getRoles()})}}}]),AppServices.Constants.constant("configuration",{ITEMS_URL:"global/temp.json"}),AppServices.Controllers.controller("PageCtrl",["ug","utility","$scope","$rootScope","$location","$routePara
 ms","$q","$route","$log","$analytics",function(ug,utility,$scope,$rootScope,$location,$routeParams,$q,$route,$log,$analytics){var initScopeVariables=function(){$scope.loadingText="Loading...",$scope.use_sso=!1,$scope.newApp={name:""},$scope.getPerm="",$scope.postPerm="",$scope.putPerm="",$scope.deletePerm="",$scope.usersTypeaheadValues=[],$scope.groupsTypeaheadValues=[],$scope.rolesTypeaheadValues=[],$rootScope.sdkActive=!1,$rootScope.demoData=!1,$scope.queryStringApplied=!1,$rootScope.autoUpdateTimer=Usergrid.config?Usergrid.config.autoUpdateTimer:61,$rootScope.requiresDeveloperKey=Usergrid.config?Usergrid.config.client.requiresDeveloperKey:!1,$rootScope.loaded=$rootScope.activeUI=!1;for(var key in Usergrid.regex)$scope[key]=Usergrid.regex[key];$scope.options=Usergrid.options;var getQuery=function(){for(var m,result={},queryString=location.search.slice(1),re=/([^&=]+)=([^&]*)/g;m=re.exec(queryString);)result[decodeURIComponent(m[1])]=decodeURIComponent(m[2]);return result};$scope.q
 ueryString=getQuery()};initScopeVariables(),$rootScope.urls=function(){var urls=ug.getUrls();return $scope.apiUrl=urls.apiUrl,$scope.use_sso=urls.use_sso,urls},$rootScope.gotoPage=function(path){$location.path(path)};var notRegistration=function(){return"/forgot-password"!==$location.path()&&"/register"!==$location.path()},verifyUser=function(){"/login"!==$location.path().slice(0,"/login".length)&&($rootScope.currentPath=$location.path()),$routeParams.access_token&&$routeParams.admin_email&&$routeParams.uuid&&(ug.set("token",$routeParams.access_token),ug.set("email",$routeParams.admin_email),ug.set("uuid",$routeParams.uuid),$location.search("access_token",null),$location.search("admin_email",null),$location.search("uuid",null)),ug.checkAuthentication(!0)};$scope.profile=function(){$scope.use_sso?window.location=$rootScope.urls().PROFILE_URL+"?callback="+encodeURIComponent($location.absUrl()):$location.path("/profile")},$scope.showModal=function(id){$("#"+id).modal("show")},$scope.hi
 deModal=function(id){$("#"+id).modal("hide")},$scope.deleteEntities=function(collection,successBroadcast,errorMessage){collection.resetEntityPointer();for(var entitiesToDelete=[];collection.hasNextEntity();){var entity=collection.getNextEntity(),checked=entity.checked;checked&&entitiesToDelete.push(entity)}for(var count=0,success=!1,i=0;i<entitiesToDelete.length;i++){var entity=entitiesToDelete[i];collection.destroyEntity(entity,function(err){count++,err?($rootScope.$broadcast("alert","error",errorMessage),$rootScope.$broadcast(successBroadcast+"-error",err)):success=!0,count===entitiesToDelete.length&&(success&&$rootScope.$broadcast(successBroadcast),$scope.applyScope())})}},$scope.selectAllEntities=function(list,that,varName,setValue){varName=varName||"master";var val=that[varName];void 0==setValue&&(setValue=!0),setValue&&(that[varName]=val=!val),list.forEach(function(entitiy){entitiy.checked=val})},$scope.createPermission=function(type,entity,path,permissions){"/"!=path.charAt(0
 )&&(path="/"+path);var ops="",s="";permissions.getPerm&&(ops="get",s=","),permissions.postPerm&&(ops=ops+s+"post",s=","),permissions.putPerm&&(ops=ops+s+"put",s=","),permissions.deletePerm&&(ops=ops+s+"delete",s=",");var permission=ops+":"+path;return permission},$scope.formatDate=function(date){return new Date(date).toUTCString()},$scope.clearCheckbox=function(id){$("#"+id).attr("checked")&&$("#"+id).click()},$scope.removeFirstSlash=function(path){return 0===path.indexOf("/")?path.substring(1,path.length):path},$scope.applyScope=function(cb){return cb="function"==typeof cb?cb:function(){},this.$$phase?void cb():this.$apply(cb)},$scope.valueSelected=function(list){return list&&list.some(function(item){return item.checked})},$scope.sendHelp=function(modalId){ug.jsonpRaw("apigeeuihelpemail","",{useremail:$rootScope.userEmail}).then(function(){$rootScope.$broadcast("alert","success","Email sent. Our team will be in touch with you shortly.")},function(){$rootScope.$broadcast("alert","er
 ror","Problem Sending Email. Try sending an email to mobile@apigee.com.")}),$scope.hideModal(modalId)},$scope.$on("users-typeahead-received",function(event,users){$scope.usersTypeaheadValues=users,$scope.$$phase||$scope.$apply()}),$scope.$on("groups-typeahead-received",function(event,groups){$scope.groupsTypeaheadValues=groups,$scope.$$phase||$scope.$apply()}),$scope.$on("roles-typeahead-received",function(event,roles){$scope.rolesTypeaheadValues=roles,$scope.$$phase||$scope.$apply()}),$scope.$on("checkAuthentication-success",function(){sessionStorage.setItem("authenticateAttempts",0),$scope.loaded=!0,$rootScope.activeUI=!0,$scope.applyScope(),$scope.queryStringApplied||($scope.queryStringApplied=!0,setTimeout(function(){$scope.queryString.org&&$rootScope.$broadcast("change-org",$scope.queryString.org)},1e3)),$rootScope.$broadcast("app-initialized")}),$scope.$on("checkAuthentication-error",function(args,err,missingData,email){if($scope.loaded=!0,err&&!$scope.use_sso&&notRegistration
 ())ug.logout(),$location.path("/login"),$scope.applyScope();else if(missingData&&notRegistration()){if(!email&&$scope.use_sso)return void(window.location=$rootScope.urls().LOGIN_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0]));ug.reAuthenticate(email)}}),$scope.$on("reAuthenticate-success",function(args,err,data,user,organizations,applications){sessionStorage.setItem("authenticateAttempts",0),$rootScope.$broadcast("loginSuccesful",user,organizations,applications),$rootScope.$emit("loginSuccesful",user,organizations,applications),$rootScope.$broadcast("checkAuthentication-success"),$scope.applyScope(function(){$scope.deferredLogin.resolve(),$location.path("/org-overview")})});var authenticateAttempts=parseInt(sessionStorage.getItem("authenticateAttempts")||0);$scope.$on("reAuthenticate-error",function(){if($scope.use_sso){if(authenticateAttempts++>5)return void $rootScope.$broadcast("alert","error","There is an issue with authentication. Please contact support."
 );console.error("Failed to login via sso "+authenticateAttempts),sessionStorage.setItem("authenticateAttempts",authenticateAttempts),window.location=$rootScope.urls().LOGIN_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0])}else notRegistration()&&(ug.logout(),$location.path("/login"),$scope.applyScope())}),$scope.$on("loginSuccessful",function(){$rootScope.activeUI=!0}),$scope.$on("app-changed",function(args,oldVal,newVal,preventReload){newVal===oldVal||preventReload||$route.reload()}),$scope.$on("org-changed",function(){ug.getApplications(),$route.reload()}),$scope.$on("app-settings-received",function(){}),$scope.$on("request-times-slow",function(){$rootScope.$broadcast("alert","info","We are experiencing performance issues on our server.  Please click Get Help for support if this continues.")});var lastPage="";$scope.$on("$routeChangeSuccess",function(){verifyUser(),$scope.showDemoBar="/performance"===$location.path().slice(0,"/performance".length),$scope.showD
 emoBar||($rootScope.demoData=!1),setTimeout(function(){lastPage=""},50);var path=window.location.pathname.replace("index-debug.html","");""===lastPage&&$analytics.pageTrack((path+$location.path()).replace("//","/")),lastPage=$location.path()}),$scope.$on("applications-received",function(event,applications){$scope.applications=applications,$scope.hasApplications=Object.keys(applications).length>0}),ug.getAppSettings()}]),AppServices.Directives.directive("pageTitle",["$rootScope","data",function($rootScope,data){return{restrict:"ECA",scope:{},transclude:!0,templateUrl:"global/page-title.html",replace:!0,link:function(scope,lElement,attrs){scope.title=attrs.title,scope.icon=attrs.icon,scope.showHelp=function(){$("#need-help").modal("show")},scope.sendHelp=function(){data.jsonp_raw("apigeeuihelpemail","",{useremail:$rootScope.userEmail}).then(function(){$rootScope.$broadcast("alert","success","Email sent. Our team will be in touch with you shortly.")},function(){$rootScope.$broadcast("a
 lert","error","Problem Sending Email. Try sending an email to mobile@apigee.com.")}),$("#need-help").modal("hide")}}}}]),AppServices.Services.factory("ug",function(configuration,$rootScope,utility,$q,$http,$resource,$log,$analytics,$location){function reportError(data,config){try{$analytics.eventTrack("error",{category:"App Services",label:data+":"+config.url+":"+(sessionStorage.apigee_uuid||"na")})}catch(e){console.log(e)}}var requestTimes=[],running=!1,currentRequests={},getAccessToken=function(){return sessionStorage.getItem("accessToken")};return{get:function(prop,isObject){return isObject?this.client().getObject(prop):this.client().get(prop)},set:function(prop,value){this.client().set(prop,value)},getUrls:function(){var host=$location.host(),qs=$location.search(),BASE_URL="",DATA_URL="",use_sso=!1;switch(!0){case"appservices.apigee.com"===host&&location.pathname.indexOf("/dit")>=0:BASE_URL="https://accounts.jupiter.apigee.net",DATA_URL="http://apigee-internal-prod.jupiter.apige
 e.net",use_sso=!0;break;case"appservices.apigee.com"===host&&location.pathname.indexOf("/mars")>=0:BASE_URL="https://accounts.mars.apigee.net",DATA_URL="http://apigee-internal-prod.mars.apigee.net",use_sso=!0;break;case"appservices.apigee.com"===host:DATA_URL=Usergrid.overrideUrl;break;case"apigee.com"===host:BASE_URL="https://accounts.apigee.com",DATA_URL="https://api.usergrid.com",use_sso=!0;break;case"usergrid.dev"===host:DATA_URL="https://api.usergrid.com";break;default:DATA_URL=Usergrid.overrideUrl}return DATA_URL=qs.api_url||DATA_URL,DATA_URL=DATA_URL.lastIndexOf("/")===DATA_URL.length-1?DATA_URL.substring(0,DATA_URL.length-1):DATA_URL,{DATA_URL:DATA_URL,LOGIN_URL:BASE_URL+"/accounts/sign_in",PROFILE_URL:BASE_URL+"/accounts/my_account",LOGOUT_URL:BASE_URL+"/accounts/sign_out",apiUrl:DATA_URL,use_sso:use_sso}},orgLogin:function(username,password){var self=this;this.client().set("email",username),this.client().set("token",null),this.client().orgLogin(username,password,function(e
 rr,data,user,organizations,applications){err?$rootScope.$broadcast("loginFailed",err,data):self.initializeCurrentUser(function(){$rootScope.$broadcast("loginSuccesful",user,organizations,applications)})})},checkAuthentication:function(force){var ug=this,client=ug.client(),initialize=function(){ug.initializeCurrentUser(function(){$rootScope.userEmail=client.get("email"),$rootScope.organizations=client.getObject("organizations"),$rootScope.applications=client.getObject("applications"),$rootScope.currentOrg=client.get("orgName"),$rootScope.currentApp=client.get("appName");var key,size=0;for(key in $rootScope.applications)$rootScope.applications.hasOwnProperty(key)&&size++;$rootScope.$broadcast("checkAuthentication-success",client.getObject("organizations"),client.getObject("applications"),client.get("orgName"),client.get("appName"),client.get("email"))})},isAuthenticated=function(){var authenticated=null!==client.get("token")&&null!==client.get("organizations");return authenticated&&in
 itialize(),authenticated};if(!isAuthenticated()||force){if(!client.get("token"))return $rootScope.$broadcast("checkAuthentication-error","no token",{},client.get("email"));this.client().reAuthenticateLite(function(err){var missingData=err||!client.get("orgName")||!client.get("appName")||!client.getObject("organizations")||!client.getObject("applications"),email=client.get("email");err||missingData?$rootScope.$broadcast("checkAuthentication-error",err,missingData,email):initialize()})}},reAuthenticate:function(email,eventOveride){var ug=this;this.client().reAuthenticate(email,function(err,data,user,organizations,applications){err||($rootScope.currentUser=user),err||($rootScope.userEmail=user.get("email"),$rootScope.organizations=organizations,$rootScope.applications=applications,$rootScope.currentOrg=ug.get("orgName"),$rootScope.currentApp=ug.get("appName"),$rootScope.currentUser=user._data,$rootScope.currentUser.profileImg=utility.get_gravatar($rootScope.currentUser.email)),$rootSco
 pe.$broadcast((eventOveride||"reAuthenticate")+"-"+(err?"error":"success"),err,data,user,organizations,applications)})},logoutCallback:function(){$rootScope.$broadcast("userNotAuthenticated")},logout:function(){$rootScope.activeUI=!1,$rootScope.userEmail="user@apigee.com",$rootScope.organizations={noOrg:{name:"No Orgs Found"}},$rootScope.applications={noApp:{name:"No Apps Found"}},$rootScope.currentOrg="No Org Found",$rootScope.currentApp="No App Found",sessionStorage.setItem("accessToken",null),sessionStorage.setItem("userUUID",null),sessionStorage.setItem("userEmail",null),this.client().logout(),this._client=null},client:function(){var options={buildCurl:!0,logging:!0};return Usergrid.options&&Usergrid.options.client&&(options.keys=Usergrid.options.client),this._client=this._client||new Usergrid.Client(options,$rootScope.urls().DATA_URL),this._client},setClientProperty:function(key,value){this.client().set(key,value)},getTopCollections:function(){var options={method:"GET",endpoint
 :""};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting collections");else{var collections=data.entities[0].metadata.collections;$rootScope.$broadcast("top-collections-received",collections)}})},createCollection:function(collectionName){var collections={};collections[collectionName]={};var metadata={metadata:{collections:collections}},options={method:"PUT",body:metadata,endpoint:""};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error creating collection"):$rootScope.$broadcast("collection-created",collections)})},getApplications:function(){this.client().getApplications(function(err,applications){err?applications&&console.error(applications):$rootScope.$broadcast("applications-received",applications)})},getAdministrators:function(){this.client().getAdministrators(function(err,administrators){err&&$rootScope.$broadcast("alert","error","error getting administrators"),$rootScope.$broadcast
 ("administrators-received",administrators)})},createApplication:function(appName){this.client().createApplication(appName,function(err,applications){err?$rootScope.$broadcast("alert","error","error creating application"):($rootScope.$broadcast("applications-created",applications,appName),$rootScope.$broadcast("applications-received",applications))})},createAdministrator:function(adminName){this.client().createAdministrator(adminName,function(err,administrators){err&&$rootScope.$broadcast("alert","error","error creating administrator"),$rootScope.$broadcast("administrators-received",administrators)})},getFeed:function(){var options={method:"GET",endpoint:"management/organizations/"+this.client().get("orgName")+"/feed",mQuery:!0};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting feed");else{var feedData=data.entities,feed=[],i=0;for(i=0;i<feedData.length;i++){var date=new Date(feedData[i].created).toUTCString(),title=feedData[
 i].title,n=title.indexOf(">");title=title.substring(n+1,title.length),n=title.indexOf(">"),title=title.substring(n+1,title.length),feedData[i].actor&&(title=feedData[i].actor.displayName+" "+title),feed.push({date:date,title:title})}0===i&&feed.push({date:"",title:"No Activities found."}),$rootScope.$broadcast("feed-received",feed)}})},createGroup:function(path,title){var options={path:path,title:title},self=this;this.groupsCollection.addEntity(options,function(err){err?$rootScope.$broadcast("groups-create-error",err):($rootScope.$broadcast("groups-create-success",self.groupsCollection),$rootScope.$broadcast("groups-received",self.groupsCollection))})},createRole:function(name,title){var options={name:name,title:title},self=this;this.rolesCollection.addEntity(options,function(err){err?$rootScope.$broadcast("alert","error","error creating role"):$rootScope.$broadcast("roles-received",self.rolesCollection)})},createUser:function(username,name,email,password){var options={username:user
 name,name:name,email:email,password:password},self=this;this.usersCollection.addEntity(options,function(err,data){err?"string"==typeof data?$rootScope.$broadcast("alert","error","error: "+data):$rootScope.$broadcast("alert","error","error creating user. the email address might already exist."):($rootScope.$broadcast("users-create-success",self.usersCollection),$rootScope.$broadcast("users-received",self.usersCollection))})},getCollection:function(type,path,orderBy,query,limit){var options={type:path,qs:{}};query&&(options.qs.ql=query),options.qs.ql=options.qs.ql?options.qs.ql+" order by "+(orderBy||"created desc"):" order by "+(orderBy||"created desc"),limit&&(options.qs.limit=limit),this.client().createCollection(options,function(err,collection,data){err?$rootScope.$broadcast("alert","error","error getting "+collection._type+": "+data.error_description):$rootScope.$broadcast(type+"-received",collection),$rootScope.$$phase||$rootScope.$apply()})},runDataQuery:function(queryPath,sear
 chString,queryLimit){this.getCollection("query",queryPath,null,searchString,queryLimit)},runDataPOSTQuery:function(queryPath,body){var self=this,options={method:"POST",endpoint:queryPath,body:body};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description),$rootScope.$broadcast("error-running-query",data);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},runDataPutQuery:function(queryPath,searchString,queryLimit,body){var self=this,options={method:"PUT",endpoint:queryPath,body:body};searchString&&(options.qs.ql=searchString),queryLimit&&(options.qs.queryLimit=queryLimit),this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},runDataDeleteQuery:function(queryPath,searchString,queryLimi
 t){var self=this,options={method:"DELETE",endpoint:queryPath};searchString&&(options.qs.ql=searchString),queryLimit&&(options.qs.queryLimit=queryLimit),this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},getUsers:function(){this.getCollection("users","users","username");var self=this;$rootScope.$on("users-received",function(evt,users){self.usersCollection=users})},getGroups:function(){this.getCollection("groups","groups","title");var self=this;$rootScope.$on("groups-received",function(event,roles){self.groupsCollection=roles})},getRoles:function(){this.getCollection("roles","roles","name");var self=this;$rootScope.$on("roles-received",function(event,roles){self.rolesCollection=roles})},getNotifiers:function(){var query="",limit="100",self=this;this.getCollection("notifiers","notifiers","created",query,li
 mit),$rootScope.$on("notifiers-received",function(event,notifiers){self.notifiersCollection=notifiers})},getNotificationHistory:function(type){var query=null;type&&(query="select * where state = '"+type+"'"),this.getCollection("notifications","notifications","created desc",query);var self=this;$rootScope.$on("notifications-received",function(event,notifications){self.notificationCollection=notifications})},getNotificationReceipts:function(uuid){this.getCollection("receipts","notifications/"+uuid+"/receipts");var self=this;$rootScope.$on("receipts-received",function(event,receipts){self.receiptsCollection=receipts})},getIndexes:function(path){var options={method:"GET",endpoint:path.split("/").concat("indexes").filter(function(bit){return bit&&bit.length}).join("/")};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Problem getting indexes: "+data.error):$rootScope.$broadcast("indexes-received",data.data)})},sendNotification:function(path,body
 ){var options={method:"POST",endpoint:path,body:body};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Problem creating notification: "+data.error):$rootScope.$broadcast("send-notification-complete")})},getRolesUsers:function(username){var options={type:"roles/users/"+username,qs:{ql:"order by username"}};this.client().createCollection(options,function(err,users){err?$rootScope.$broadcast("alert","error","error getting users"):$rootScope.$broadcast("users-received",users)})},getTypeAheadData:function(type,searchString,searchBy,orderBy){var search="",qs={limit:100};searchString&&(search="select * where "+searchBy+" = '"+searchString+"'"),orderBy&&(search=search+" order by "+orderBy),search&&(qs.ql=search);var options={method:"GET",endpoint:type,qs:qs};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting "+type);else{var entities=data.entities;$rootScope.$broadcast(type+"-typeahead-recei
 ved",entities)}})},getUsersTypeAhead:function(searchString){this.getTypeAheadData("users",searchString,"username","username")},getGroupsTypeAhead:function(searchString){this.getTypeAheadData("groups",searchString,"path","path")},getRolesTypeAhead:function(searchString){this.getTypeAheadData("roles",searchString,"name","name")},getGroupsForUser:function(user){var options={type:"users/"+user+"/groups"};this.client().createCollection(options,function(err,groups){err?$rootScope.$broadcast("alert","error","error getting groups"):$rootScope.$broadcast("user-groups-received",groups)})},addUserToGroup:function(user,group){var options={type:"users/"+user+"/groups/"+group};this.client().createEntity(options,function(err){err?$rootScope.$broadcast("alert","error","error adding user to group"):$rootScope.$broadcast("user-added-to-group-received")})},addUserToRole:function(user,role){var options={method:"POST",endpoint:"roles/"+role+"/users/"+user};this.client().request(options,function(err){err
 ?$rootScope.$broadcast("alert","error","error adding user to role"):$rootScope.$broadcast("role-update-received")})},addGroupToRole:function(group,role){var options={method:"POST",endpoint:"roles/"+role+"/groups/"+group};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding group to role"):$rootScope.$broadcast("role-update-received")})},followUser:function(user){var username=$rootScope.selectedUser.get("uuid"),options={method:"POST",endpoint:"users/"+username+"/following/users/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error following user"):$rootScope.$broadcast("follow-user-received")})},newPermission:function(permission,type,entity){var options={method:"POST",endpoint:type+"/"+entity+"/permissions",body:{permission:permission}};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding permission"):$rootScope.$broadcast("permission-update-rec
 eived")})},newUserPermission:function(permission,username){this.newPermission(permission,"users",username)},newGroupPermission:function(permission,path){this.newPermission(permission,"groups",path)},newRolePermission:function(permission,name){this.newPermission(permission,"roles",name)},deletePermission:function(permission,type,entity){var options={method:"DELETE",endpoint:type+"/"+entity+"/permissions",qs:{permission:permission}};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error deleting permission"):$rootScope.$broadcast("permission-update-received")})},deleteUserPermission:function(permission,user){this.deletePermission(permission,"users",user)},deleteGroupPermission:function(permission,group){this.deletePermission(permission,"groups",group)},deleteRolePermission:function(permission,rolename){this.deletePermission(permission,"roles",rolename)},removeUserFromRole:function(user,role){var options={method:"DELETE",endpoint:"roles/"+role+"/us
 ers/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error removing user from role"):$rootScope.$broadcast("role-update-received")})},removeUserFromGroup:function(group,role){var options={method:"DELETE",endpoint:"roles/"+role+"/groups/"+group};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error removing role from the group"):$rootScope.$broadcast("role-update-received")})},createAndroidNotifier:function(name,APIkey){var options={method:"POST",endpoint:"notifiers",body:{apiKey:APIkey,name:name,provider:"google"}};this.client().request(options,function(err,data){err?(console.error(data),$rootScope.$broadcast("alert","error","error creating notifier ")):($rootScope.$broadcast("alert","success","New notifier created successfully."),$rootScope.$broadcast("notifier-update"))})},createAppleNotifier:function(file,name,environment,certificatePassword){var provider="apple",formData=new FormData;formData.ap
 pend("p12Certificate",file),formData.append("name",name),formData.append("provider",provider),formData.append("environment",environment),formData.append("certificatePassword",certificatePassword||"");var options={method:"POST",endpoint:"notifiers",formData:formData};this.client().request(options,function(err,data){err?(console.error(data),$rootScope.$broadcast("alert","error","error creating notifier.")):($rootScope.$broadcast("alert","success","New notifier created successfully."),$rootScope.$broadcast("notifier-update"))})},deleteNotifier:function(name){var options={method:"DELETE",endpoint:"notifiers/"+name};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error deleting notifier"):$rootScope.$broadcast("notifier-update")})},initializeCurrentUser:function(callback){if(callback=callback||function(){},$rootScope.currentUser&&!$rootScope.currentUser.reset)return callback($rootScope.currentUser),$rootScope.$broadcast("current-user-initialized",""
 );var options={method:"GET",endpoint:"management/users/"+this.client().get("email"),mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Error getting user info"):($rootScope.currentUser=data.data,$rootScope.currentUser.profileImg=utility.get_gravatar($rootScope.currentUser.email),$rootScope.userEmail=$rootScope.currentUser.email,callback($rootScope.currentUser),$rootScope.$broadcast("current-user-initialized",$rootScope.currentUser))})},updateUser:function(user){var body=$rootScope.currentUser;body.username=user.username,body.name=user.name,body.email=user.email;var options={method:"PUT",endpoint:"management/users/"+user.uuid+"/",mQuery:!0,body:body},self=this;this.client().request(options,function(err,data){return self.client().set("email",user.email),self.client().set("username",user.username),err?$rootScope.$broadcast("user-update-error",data):($rootScope.currentUser.reset=!0,void self.initializeCurrentUser(function(){$rootScope.
 $broadcast("user-update-success",$rootScope.currentUser)}))})},resetUserPassword:function(user){var pwdata={};pwdata.oldpassword=user.oldPassword,pwdata.newpassword=user.newPassword,pwdata.username=user.username;var options={method:"PUT",endpoint:"users/"+pwdata.uuid+"/",body:pwdata};this.client().request(options,function(err){return err?$rootScope.$broadcast("alert","error","Error resetting password"):($rootScope.currentUser.oldPassword="",$rootScope.currentUser.newPassword="",void $rootScope.$broadcast("user-reset-password-success",$rootScope.currentUser))})},getOrgCredentials:function(){var options={method:"GET",endpoint:"management/organizations/"+this.client().get("orgName")+"/credentials",mQuery:!0};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error getting credentials"):$rootScope.$broadcast("org-creds-updated",data.credentials)})},regenerateOrgCredentials:function(){var options={method:"POST",endpoint:"manageme
 nt/organizations/"+this.client().get("orgName")+"/credentials",mQuery:!0};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error regenerating credentials"):($rootScope.$broadcast("alert","success","Regeneration of credentials complete."),$rootScope.$broadcast("org-creds-updated",data.credentials))})},getAppCredentials:function(){var options={method:"GET",endpoint:"credentials"};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error getting credentials"):$rootScope.$broadcast("app-creds-updated",data.credentials)})},regenerateAppCredentials:function(){var options={method:"POST",endpoint:"credentials"};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error regenerating credentials"):($rootScope.$broadcast("alert","success","Regeneration of credentials complete."),$rootScope.$broadcast("app-creds-updated",
 data.credentials))})},signUpUser:function(orgName,userName,name,email,password){var formData={organization:orgName,username:userName,name:name,email:email,password:password},options={method:"POST",endpoint:"management/organizations",body:formData,mQuery:!0},client=this.client();client.request(options,function(err,data){err?$rootScope.$broadcast("register-error",data):$rootScope.$broadcast("register-success",data)})},resendActivationLink:function(id){var options={method:"GET",endpoint:"management/users/"+id+"/reactivate",mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("resend-activate-error",data):$rootScope.$broadcast("resend-activate-success",data)})},getAppSettings:function(){$rootScope.$broadcast("app-settings-received",{})},getActivities:function(){this.client().request({method:"GET",endpoint:"activities",qs:{limit:200}},function(err,data){if(err)return $rootScope.$broadcast("app-activities-error",data);var entities=data.entities;entities.fo
 rEach(function(entity){entity.actor.picture?(entity.actor.picture=entity.actor.picture.replace(/^http:\/\/www.gravatar/i,"https://secure.gravatar"),entity.actor.picture=~entity.actor.picture.indexOf("http")?entity.actor.picture:"https://apigee.com/usergrid/img/user_profile.png"):entity.actor.picture=window.location.protocol+"//"+window.location.host+window.location.pathname+"img/user_profile.png"}),$rootScope.$broadcast("app-activities-received",data.entities)})},getEntityActivities:function(entity,isFeed){var route=isFeed?"feed":"activities",endpoint=entity.get("type")+"/"+entity.get("uuid")+"/"+route,options={method:"GET",endpoint:endpoint,qs:{limit:200}};this.client().request(options,function(err,data){err&&$rootScope.$broadcast(entity.get("type")+"-"+route+"-error",data),data.entities.forEach(function(entityInstance){entityInstance.createdDate=new Date(entityInstance.created).toUTCString()}),$rootScope.$broadcast(entity.get("type")+"-"+route+"-received",data.entities)})},addUser
 Activity:function(user,content){var options={actor:{displayName:user.get("username"),uuid:user.get("uuid"),username:user.get("username")},verb:"post",content:content};
-this.client().createUserActivity(user.get("username"),options,function(err,activity){err?$rootScope.$broadcast("user-activity-add-error",err):$rootScope.$broadcast("user-activity-add-success",activity)})},runShellQuery:function(method,path,payload){var options={verb:method,endpoint:path};payload&&(options.body=payload),this.client().request(options,function(err,data){err?$rootScope.$broadcast("shell-error",data):$rootScope.$broadcast("shell-success",data)})},addOrganization:function(user,orgName){var options={method:"POST",endpoint:"management/users/"+user.uuid+"/organizations",body:{organization:orgName},mQuery:!0},client=this.client();client.request(options,function(err,data){err?$rootScope.$broadcast("user-add-org-error",data):$rootScope.$broadcast("user-add-org-success",$rootScope.organizations)})},leaveOrganization:function(user,org){var options={method:"DELETE",endpoint:"management/users/"+user.uuid+"/organizations/"+org.uuid,mQuery:!0};this.client().request(options,function(e
 rr,data){err?$rootScope.$broadcast("user-leave-org-error",data):(delete $rootScope.organizations[org.name],$rootScope.$broadcast("user-leave-org-success",$rootScope.organizations))})},httpGet:function(id,url){var deferred;return deferred=$q.defer(),$http.get(url||configuration.ITEMS_URL).success(function(data){var result;id?angular.forEach(data,function(obj){obj.id===id&&(result=obj)}):result=data,deferred.resolve(result)}).error(function(data,status,headers,config){$log.error(data,status,headers,config),reportError(data,config),deferred.reject(data)}),deferred.promise},jsonp:function(objectType,criteriaId,params,successCallback){params||(params={}),params.demoApp=$rootScope.demoData,params.access_token=getAccessToken(),params.callback="JSON_CALLBACK";var uri=$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/apm/"+objectType+"/"+criteriaId;return this.jsonpRaw(objectType,criteriaId,params,uri,successCallback)},jsonpSimple:function(objectType,appId,para
 ms){var uri=$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/apm/"+objectType+"/"+appId;return this.jsonpRaw(objectType,appId,params,uri)},calculateAverageRequestTimes:function(){if(!running){var self=this;running=!0,setTimeout(function(){running=!1;var length=requestTimes.length<10?requestTimes.length:10,sum=requestTimes.slice(0,length).reduce(function(a,b){return a+b}),avg=sum/length;self.averageRequestTimes=avg/1e3,self.averageRequestTimes>5&&$rootScope.$broadcast("request-times-slow",self.averageRequestTimes)},3e3)}},jsonpRaw:function(objectType,appId,params,uri,successCallback){"function"!=typeof successCallback&&(successCallback=null),uri=uri||$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/"+objectType,params||(params={});var start=(new Date).getTime(),self=this;params.access_token=getAccessToken(),params.callback="JSON_CALLBACK";var deferred=$q.defer(),diff=function(){currentRequests[uri]--,requestTimes.splice(
 0,0,(new Date).getTime()-start),self.calculateAverageRequestTimes()};successCallback&&$rootScope.$broadcast("ajax_loading",objectType);var reqCount=currentRequests[uri]||0;return self.averageRequestTimes>5&&reqCount>1?(setTimeout(function(){deferred.reject(new Error("query in progress"))},50),deferred):(currentRequests[uri]=(currentRequests[uri]||0)+1,$http.jsonp(uri,{params:params}).success(function(data,status,headers,config){diff(),successCallback&&(successCallback(data,status,headers,config),$rootScope.$broadcast("ajax_finished",objectType)),deferred.resolve(data)}).error(function(data,status,headers,config){diff(),$log.error("ERROR: Could not get jsonp data. "+uri),reportError(data,config),deferred.reject(data)}),deferred.promise)},resource:function(params,isArray){return $resource($rootScope.urls().DATA_URL+"/:orgname/:appname/:username/:endpoint",{},{get:{method:"JSONP",isArray:isArray,params:params},login:{method:"GET",url:$rootScope.urls().DATA_URL+"/management/token",isArr
 ay:!1,params:params},save:{url:$rootScope.urls().DATA_URL+"/"+params.orgname+"/"+params.appname,method:"PUT",isArray:!1,params:params}})},httpPost:function(url,callback,payload,headers){var accessToken=getAccessToken();payload?payload.access_token=accessToken:payload={access_token:accessToken},headers||(headers={Bearer:accessToken}),$http({method:"POST",url:url,data:payload,headers:headers}).success(function(data){callback(data)}).error(function(data,status,headers,config){reportError(data,config),callback(data)})}}}),AppServices.Directives.directive("ngFocus",["$parse",function($parse){return function(scope,element,attr){var fn=$parse(attr.ngFocus);element.bind("focus",function(event){scope.$apply(function(){fn(scope,{$event:event})})})}}]),AppServices.Directives.directive("ngBlur",["$parse",function($parse){return function(scope,element,attr){var fn=$parse(attr.ngBlur);element.bind("blur",function(event){scope.$apply(function(){fn(scope,{$event:event})})})}}]),AppServices.Services
 .factory("utility",function(){return{keys:function(o){var a=[];for(var propertyName in o)a.push(propertyName);return a},get_gravatar:function(email,size){try{var size=size||50;return email.length?"https://secure.gravatar.com/avatar/"+MD5(email)+"?s="+size:"https://apigee.com/usergrid/img/user_profile.png"}catch(e){return"https://apigee.com/usergrid/img/user_profile.png"}},get_qs_params:function(){var queryParams={};if(window.location.search)for(var params=window.location.search.slice(1).split("&"),i=0;i<params.length;i++){var tmp=params[i].split("=");queryParams[tmp[0]]=unescape(tmp[1])}return queryParams},safeApply:function(fn){var phase=this.$root.$$phase;"$apply"==phase||"$digest"==phase?fn&&"function"==typeof fn&&fn():this.$apply(fn)}}}),AppServices.Directives.directive("ugValidate",["$rootScope",function(){return{scope:!0,restrict:"A",require:"ng-model",replace:!0,link:function(scope,element,attrs,ctrl){var validate=function(){var id=element.attr("id"),validator=id+"-validator"
 ,title=element.attr("title");if(title=title&&title.length?title:"Please enter data",$("#"+validator).remove(),ctrl.$valid)element.removeClass("has-error"),$("#"+validator).remove();else{var validatorElem='<div id="'+validator+'"><span  class="validator-error-message">'+title+"</span></div>";$("#"+id).after(validatorElem),element.addClass("has-error")}},firing=!1;element.bind("blur",function(){validate(scope,element,attrs,ctrl)}).bind("input",function(){firing||(firing=!0,setTimeout(function(){validate(scope,element,attrs,ctrl),firing=!1},500))})}}}]),AppServices.Controllers.controller("GroupsActivitiesCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.activitiesSelected="active",$rootScope.selectedGroup?($rootScope.selectedGroup.activities=[],void $rootScope.selectedGroup.getActivities(function(err){err||$rootScope.$$phase||$rootScope.$apply()})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsCtrl",["ug",
 "$scope","$rootScope","$location","$route",function(ug,$scope,$rootScope,$location,$route){$scope.groupsCollection={},$rootScope.selectedGroup={},$scope.previous_display="none",$scope.next_display="none",$scope.hasGroups=!1,$scope.newGroup={path:"",title:""},ug.getGroups(),$scope.currentGroupsPage={},$scope.selectGroupPage=function(route){$scope.currentGroupsPage.template=$route.routes[route].templateUrl,$scope.currentGroupsPage.route=route},$scope.newGroupDialog=function(modalId){$scope.newGroup.path&&$scope.newGroup.title?(ug.createGroup($scope.removeFirstSlash($scope.newGroup.path),$scope.newGroup.title),$scope.hideModal(modalId),$scope.newGroup={path:"",title:""}):$rootScope.$broadcast("alert","error","Missing required information.")},$scope.deleteGroupsDialog=function(modalId){$scope.deleteEntities($scope.groupsCollection,"group-deleted","error deleting group"),$scope.hideModal(modalId),$scope.newGroup={path:"",title:""}},$scope.$on("group-deleted",function(){$rootScope.$broadc
 ast("alert","success","Group deleted successfully.")}),$scope.$on("group-deleted-error",function(){ug.getGroups()}),$scope.$on("groups-create-success",function(){$rootScope.$broadcast("alert","success","Group created successfully.")}),$scope.$on("groups-create-error",function(){$rootScope.$broadcast("alert","error","Error creating group. Make sure you don't have spaces in the path.")}),$scope.$on("groups-received",function(event,groups){$scope.groupBoxesSelected=!1,$scope.groupsCollection=groups,$scope.newGroup.path="",$scope.newGroup.title="",!(groups._list.length>0)||$rootScope.selectedGroup._data&&groups._list.some(function(group){return $rootScope.selectedGroup._data.uuid===group._data.uuid})||$scope.selectGroup(groups._list[0]._data.uuid),$scope.hasGroups=groups._list.length>0,$scope.received=!0,$scope.checkNextPrev(),$scope.applyScope()}),$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextP
 rev(),$scope.groupsCollection.hasPreviousPage()&&($scope.previous_display="block"),$scope.groupsCollection.hasNextPage()&&($scope.next_display="block")},$scope.selectGroup=function(uuid){$rootScope.selectedGroup=$scope.groupsCollection.getEntityByUUID(uuid),$scope.currentGroupsPage.template="groups/groups-details.html",$scope.currentGroupsPage.route="/groups/details",$rootScope.$broadcast("group-selection-changed",$rootScope.selectedGroup)},$scope.getPrevious=function(){$scope.groupsCollection.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of groups"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.getNext=function(){$scope.groupsCollection.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of groups"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.$on("group-deleted",function(){$route.reload(),$scope.master=""})}]),AppServices.Controllers.controller("GroupsDetailsCtrl",["ug"
 ,"$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){var selectedGroup=$rootScope.selectedGroup.clone();return $scope.detailsSelected="active",$scope.json=selectedGroup._json||selectedGroup._data.stringifyJSON(),$scope.group=selectedGroup._data,$scope.group.path=0!=$scope.group.path.indexOf("/")?"/"+$scope.group.path:$scope.group.path,$scope.group.title=$scope.group.title,$rootScope.selectedGroup?($scope.$on("group-selection-changed",function(evt,selectedGroup){$scope.group.path=0!=selectedGroup._data.path.indexOf("/")?"/"+selectedGroup._data.path:selectedGroup._data.path,$scope.group.title=selectedGroup._data.title,$scope.detailsSelected="active",$scope.json=selectedGroup._json||selectedGroup._data.stringifyJSON()}),void($rootScope.saveSelectedGroup=function(){$rootScope.selectedGroup._data.title=$scope.group.title,$rootScope.selectedGroup._data.path=$scope.removeFirstSlash($scope.group.path),$rootScope.selectedGroup.save(function(err){err?$rootScope.$broadca
 st("alert","error","error saving group"):$rootScope.$broadcast("alert","success","group saved")})})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsMembersCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.membersSelected="active",$scope.previous_display="none",$scope.next_display="none",$scope.user="",$scope.master="",$scope.hasMembers=!1,ug.getUsersTypeAhead(),$scope.usersTypeaheadValues=[],$scope.$on("users-typeahead-received",function(event,users){$scope.usersTypeaheadValues=users,$scope.applyScope()}),$scope.addGroupToUserDialog=function(modalId){if($scope.user){var path=$rootScope.selectedGroup.get("path");ug.addUserToGroup($scope.user.uuid,path),$scope.user="",$scope.hideModal(modalId)}else $rootScope.$broadcast("alert","error","Please select a user.")},$scope.removeUsersFromGroupDialog=function(modalId){$scope.deleteEntities($scope.groupsCollection.users,"group-update-received","Error removing use
 r from group"),$scope.hideModal(modalId)},$scope.get=function(){if($rootScope.selectedGroup.get){var options={type:"groups/"+$rootScope.selectedGroup.get("path")+"/users"};$scope.groupsCollection.addCollection("users",options,function(err){$scope.groupMembersSelected=!1,err?$rootScope.$broadcast("alert","error","error getting users for group"):($scope.hasMembers=$scope.groupsCollection.users._list.length>0,$scope.checkNextPrev(),$scope.applyScope())})}},$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$scope.groupsCollection.users.hasPreviousPage()&&($scope.previous_display="block"),$scope.groupsCollection.users.hasNextPage()&&($scope.next_display="block")},$rootScope.selectedGroup?($scope.get(),$scope.getPrevious=function(){$scope.groupsCollection.users.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of users"),$scope.checkNextPrev()
 ,$rootScope.$$phase||$rootScope.$apply()})},$scope.getNext=function(){$scope.groupsCollection.users.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of users"),$scope.checkNextPrev(),$rootScope.$$phase||$rootScope.$apply()})},$scope.$on("group-update-received",function(){$scope.get()}),void $scope.$on("user-added-to-group-received",function(){$scope.get()})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsRolesCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.rolesSelected="active",$scope.roles_previous_display="none",$scope.roles_next_display="none",$scope.name="",$scope.master="",$scope.hasRoles=!1,$scope.hasPermissions=!1,$scope.permissions={},$scope.addGroupToRoleDialog=function(modalId){if($scope.name){var path=$rootScope.selectedGroup.get("path");ug.addGroupToRole(path,$scope.name),$scope.hideModal(modalId),$scope.name=""}else $rootScope.$broadcast("alert
 ","error","You must specify a role name.")},$scope.leaveRoleDialog=function(modalId){for(var path=$rootScope.selectedGroup.get("path"),roles=$scope.groupsCollection.roles._list,i=0;i<roles.length;i++)roles[i].checked&&ug.removeUserFromGroup(path,roles[i]._data.name);$scope.hideModal(modalId)},$scope.addGroupPermissionDialog=function(modalId){if($scope.permissions.path){var permission=$scope.createPermission(null,null,$scope.removeFirstSlash($scope.permissions.path),$scope.permissions),path=$rootScope.selectedGroup.get("path");ug.newGroupPermission(permission,path),$scope.hideModal(modalId),$scope.permissions&&($scope.permissions={})}else $rootScope.$broadcast("alert","error","You must specify a name for the permission.")},$scope.deleteGroupPermissionDialog=function(modalId){for(var path=$rootScope.selectedGroup.get("path"),permissions=$rootScope.selectedGroup.permissions,i=0;i<permissions.length;i++)permissions[i].checked&&ug.deleteGroupPermission(permissions[i].perm,path);$scope.hi
 deModal(modalId)},$scope.resetNextPrev=function(){$scope.roles_previous_display="none",$scope.roles_next_display="none",$scope.permissions_previous_display="none",$scope.permissions_next_display="none"},$scope.resetNextPrev(),$scope.checkNextPrevRoles=function(){$scope.resetNextPrev(),$scope.groupsCollection.roles.hasPreviousPage()&&($scope.roles_previous_display="block"),$scope.groupsCollection.roles.hasNextPage()&&($scope.roles_next_display="block")},$scope.checkNextPrevPermissions=function(){$scope.groupsCollection.permissions.hasPreviousPage()&&($scope.permissions_previous_display="block"),$scope.groupsCollection.permissions.hasNextPage()&&($scope.permissions_next_display="block")},$scope.getRoles=function(){var path=$rootScope.selectedGroup.get("path"),options={type:"groups/"+path+"/roles"};$scope.groupsCollection.addCollection("roles",options,function(err){$scope.groupRoleSelected=!1,err?$rootScope.$broadcast("alert","error","error getting roles for group"):($scope.hasRoles=$s
 cope.groupsCollection.roles._list.length>0,$scope.checkNextPrevRoles(),$scope.applyScope())})},$scope.getPermissions=function(){$rootScope.selectedGroup.permissions=[],$rootScope.selectedGroup.getPermissions(function(err){$scope.groupPermissionsSelected=!1,$scope.hasPermissions=$scope.selectedGroup.permissions.length,err||$scope.applyScope()})},$scope.getPreviousRoles=function(){$scope.groupsCollection.roles.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of roles"),$scope.checkNextPrevRoles(),$scope.applyScope()})},$scope.getNextRoles=function(){$scope.groupsCollection.roles.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of roles"),$scope.checkNextPrevRoles(),$scope.applyScope()})},$scope.getPreviousPermissions=function(){$scope.groupsCollection.permissions.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of permissions"),$scope.c
 heckNextPrevPermissions(),$scope.applyScope()})},$scope.getNextPermissions=function(){$scope.groupsCollection.permissions.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of permissions"),$scope.checkNextPrevPermissions(),$scope.applyScope()})},$scope.$on("role-update-received",function(){$scope.getRoles()}),$scope.$on("permission-update-received",function(){$scope.getPermissions()}),$scope.$on("groups-received",function(evt,data){$scope.groupsCollection=data,$scope.getRoles(),$scope.getPermissions()}),$rootScope.selectedGroup?(ug.getRolesTypeAhead(),void ug.getGroups()):void $location.path("/groups")}]),AppServices.Controllers.controller("ForgotPasswordCtrl",["ug","$scope","$rootScope","$location","$sce","utility",function(ug,$scope,$rootScope,$location,$sce){$rootScope.activeUI&&$location.path("/"),$scope.forgotPWiframeURL=$sce.trustAsResourceUrl($scope.apiUrl+"/management/users/resetpw")}]),AppServices.Controllers.controller("LoginCtrl
 ",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){$scope.loading=!1,$scope.login={},$scope.activation={},$scope.requiresDeveloperKey=$scope.options.client.requiresDeveloperKey||!1,$rootScope.gotoForgotPasswordPage=function(){$location.path("/forgot-password")},$rootScope.gotoSignUp=function(){$location.path("/register")},$scope.login=function(){var username=$scope.login.username,password=$scope.login.password;$scope.loginMessage="",$scope.loading=!0,ug.orgLogin(username,password)},$scope.$on("loginFailed",function(){$scope.loading=!1,$scope.loginMessage="Error: the username / password combination was not valid",$scope.applyScope()}),$scope.logout=function(){ug.logout(),ug.setClientProperty("developerkey",null),$scope.use_sso?window.location=$rootScope.urls().LOGOUT_URL+"?redirect=no&callback="+encodeURIComponent($location.absUrl().split("?")[0]):($location.path("/login"),$scope.applyScope())},$rootScope.$on("user
 NotAuthenticated",function(){"/forgot-password"!==$location.path()&&($location.path("/login"),$scope.logout()),$scope.applyScope()}),$scope.$on("loginSuccesful",function(){$scope.loading=!1,$scope.requiresDeveloperKey&&ug.setClientProperty("developerkey",$scope.login.developerkey),$scope.login={},$location.path("/login"===$rootScope.currentPath||"/login/loading"===$rootScope.currentPath||"undefined"==typeof $rootScope.currentPath?"/org-overview":$rootScope.currentPath),$scope.applyScope()}),$scope.resendActivationLink=function(modalId){var id=$scope.activation.id;ug.resendActivationLink(id),$scope.activation={},$scope.hideModal(modalId)},$scope.$on("resend-activate-success",function(){$scope.activationId="",$scope.$apply(),$rootScope.$broadcast("alert","success","Activation link sent successfully.")}),$scope.$on("resend-activate-error",function(){$rootScope.$broadcast("alert","error","Activation link failed to send.")})}]),AppServices.Controllers.controller("LogoutCtrl",["ug","$scop
 e","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){ug.logout(),$scope.use_sso?window.location=$rootScope.urls().LOGOUT_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0]):($location.path("/login"),$scope.applyScope())}]),AppServices.Controllers.controller("RegisterCtrl",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){$rootScope.activeUI&&$location.path("/");var init=function(){$scope.registeredUser={}};init(),$scope.cancel=function(){$location.path("/")},$scope.register=function(){var user=$scope.registeredUser.clone();user.password===user.confirmPassword?ug.signUpUser(user.orgName,user.userName,user.name,user.email,user.password):$rootScope.$broadcast("alert","error","Passwords do not match."+name)},$scope.$on("register-error",function(event,data){$scope.signUpSuccess=!1,$rootScope.$broadcast("alert","error","Error registering: "+(data&&da
 ta.error_description?data.error_description:name))}),$scope.$on("register-success",function(){$scope.registeredUser={},$scope.signUpSuccess=!0,init(),$scope.$apply()})}]),AppServices.Directives.directive("menu",["$location","$rootScope","$log",function($location,$rootScope,$log){return{link:function(scope,lElement,attrs){function setActiveElement(ele,locationPath,$rootScope,isParentClick){ele.removeClass("active");var menuItem,parentMenuItem,newActiveElement=ele.parent().find('a[href*="#!'+locationPath+'"]');if(0===newActiveElement.length)parentMenuItem=ele;else{menuItem=newActiveElement.parent(),menuItem.hasClass("option")?parentMenuItem=menuItem[0]:1===menuItem.size()?(parentMenuItem=newActiveElement.parent().parent().parent(),parentMenuItem.addClass("active")):(parentMenuItem=menuItem[0],menuItem=menuItem[1]);try{var menuItemCompare=parentMenuItem[0]||parentMenuItem;ele[0]!==menuItemCompare&&isParentClick&&ele.find("ul")[0]&&(ele.find("ul")[0].style.height=0);var subMenuSizer=ang
 ular.element(parentMenuItem).find(".nav-list")[0];if(subMenuSizer){var heightChecker,clientHeight=subMenuSizer.getAttribute("data-height"),heightCounter=1;clientHeight||heightChecker?(menuItem.addClass("active"),subMenuSizer.style.height=clientHeight+"px"):heightChecker=setInterval(function(){var tempHeight=subMenuSizer.getAttribute("data-height")||subMenuSizer.clientHeight;heightCounter=subMenuSizer.clientHeight,0===heightCounter&&(heightCounter=1),"string"==typeof tempHeight&&(tempHeight=parseInt(tempHeight,10)),tempHeight>0&&heightCounter===tempHeight&&(subMenuSizer.setAttribute("data-height",tempHeight),menuItem.addClass("active"),subMenuSizer.style.height=tempHeight+"px",clearInterval(heightChecker)),heightCounter=tempHeight},20),$rootScope.menuExecute=!0}else menuItem.addClass("active")}catch(e){$log.error("Problem calculating size of menu",e)}}return{menuitem:menuItem,parentMenuItem:parentMenuItem}}function setupMenuState(){if(menuContext=attrs.menu,parentMenuItems=lElement.f
 ind("li.option"),0!==lElement.find("li.option.active").length&&($rootScope[menuContext+"Parent"]=lElement.find("li.option.active")),activeParentElement=$rootScope[menuContext+"Parent"]||null,activeParentElement&&(activeParentElement=angular.element(activeParentElement)),menuItems=lElement.find("li.option li"),locationPath=$location.path(),activeParentElement&&(activeMenuElement=angular.element(activeParentElement),activeMenuElement=activeMenuElement.find("li.active"),activeMenuElement.removeClass("active"),activeParentElement.find("a")[0])){subMenuContext=activeParentElement.find("a")[0].href.split("#!")[1];var tempMenuContext=subMenuContext.split("/");subMenuContext="/"+tempMenuContext[1],tempMenuContext.length>2&&(subMenuContext+="/"+tempMenuContext[2])}var activeElements;""!==locationPath&&-1===locationPath.indexOf(subMenuContext)?(activeElements=setActiveElement(activeParentElement,locationPath,scope),$rootScope[menuContext+"Parent"]=activeElements.parentMenuItem,$rootScope[menu
 Context+"Menu"]=activeElements.menuitem):setActiveElement(activeParentElement,subMenuContext,scope)}var menuContext,parentMenuItems,activeParentElement,menuItems,activeMenuElement,locationPath,subMenuContext,bound=!1;scope.$on("$routeChangeSuccess",function(){setupMenuState(),bound||(bound=!0,parentMenuItems.bind("click",function(cevent){var previousParentSelection=angular.element($rootScope[menuContext+"Parent"]),targetPath=angular.element(cevent.currentTarget).find("> a")[0].href.split("#!")[1];previousParentSelection.find(".nav > li").removeClass("active");var activeElements=setActiveElement(previousParentSelection,targetPath,scope,!0);$rootScope[menuContext+"Parent"]=activeElements.parentMenuItem,$rootScope[menuContext+"Menu"]=activeElements.menuitem,scope.$broadcast("menu-selection")}),menuItems.bind("click",function(cevent){var previousMenuSelection=$rootScope[menuContext+"Menu"],targetElement=cevent.currentTarget;previousMenuSelection!==targetElement&&(previousMenuSelection?a
 ngular.element(previousMenuSelection).removeClass("active"):activeMenuE

<TRUNCATED>

[29/55] [abbrv] git commit: reset version number add built files, so site doesn't initially have to be built

Posted by sn...@apache.org.
reset version number
add built files, so site doesn't initially have to be built


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c1950d95
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c1950d95
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c1950d95

Branch: refs/pull/76/head
Commit: c1950d95848e7c5022746fb0e1fbb409caa5b47a
Parents: 54b0631
Author: Shawn Feldman <sh...@gmail.com>
Authored: Mon Mar 10 15:19:58 2014 -0600
Committer: Shawn Feldman <sh...@gmail.com>
Committed: Mon Mar 10 15:19:58 2014 -0600

----------------------------------------------------------------------
 portal/index-debug.html             | 16 ++++++++--------
 portal/index.html                   | 16 ++++++++--------
 portal/js/libs/usergrid-libs.min.js | 20 ++++++++++----------
 portal/js/usergrid-dev.min.js       | 15 +++------------
 portal/js/usergrid.min.js           | 10 +++++-----
 portal/package.json                 |  2 +-
 6 files changed, 35 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c1950d95/portal/index-debug.html
----------------------------------------------------------------------
diff --git a/portal/index-debug.html b/portal/index-debug.html
index 4e572c2..7b8dcec 100644
--- a/portal/index-debug.html
+++ b/portal/index-debug.html
@@ -8,12 +8,12 @@
   <meta name="description" content="">
   <meta name="author" content="">
 
-  <link id="libScript" href="1.0.2/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
-  <link id="libScript" href="1.0.2/css/dash.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.36/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.36/css/dash.min.css" rel="stylesheet">
 
   <!--styles for jquery ui calendar component-->
-  <link id="libScript" rel="stylesheet" type="text/css" href="1.0.2/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
-  <link id="libScript" rel="stylesheet" type="text/css" href="1.0.2/js/libs/jqueryui/jquery-ui-timepicker.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-timepicker.css">
 </head>
 <body ng-controller="PageCtrl">
 <!-- Google Tag Manager -->
@@ -115,14 +115,14 @@
     </div>
   </div>
 </section>
-<script id="libScript" src="1.0.2/js/libs/usergrid-libs.min.js"></script>
-<script id="libScript" src="1.0.2/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
+<script id="libScript" src="2.0.36/js/libs/usergrid-libs.min.js"></script>
+<script id="libScript" src="2.0.36/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
 <!--todo - remove this. temporarily including jquery ui for calendar in push-->
-<script id="libScript" src="1.0.2/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
+<script id="libScript" src="2.0.36/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
 <!-- In dev use: <script src="js/libs/angular-1.1.5.js"></script> -->
 <!--<script type="text/javascript" src="js/libs/angular-ui-ng-grid/ng-grid-2.0.2.debug.js"></script>-->
 <script src="config.js"></script>
-<script id="main-script" src="1.0.2/js/usergrid-dev.min.js"></script>
+<script id="main-script" src="2.0.36/js/usergrid-dev.min.js"></script>
 
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c1950d95/portal/index.html
----------------------------------------------------------------------
diff --git a/portal/index.html b/portal/index.html
index 558e6a9..95b6eb8 100644
--- a/portal/index.html
+++ b/portal/index.html
@@ -8,12 +8,12 @@
   <meta name="description" content="">
   <meta name="author" content="">
 
-  <link id="libScript" href="1.0.2/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
-  <link id="libScript" href="1.0.2/css/dash.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.36/js/libs/bootstrap/custom/css/bootstrap.min.css" rel="stylesheet">
+  <link id="libScript" href="2.0.36/css/dash.min.css" rel="stylesheet">
 
   <!--styles for jquery ui calendar component-->
-  <link id="libScript" rel="stylesheet" type="text/css" href="1.0.2/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
-  <link id="libScript" rel="stylesheet" type="text/css" href="1.0.2/js/libs/jqueryui/jquery-ui-timepicker.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-1.8.9.custom.css">
+  <link id="libScript" rel="stylesheet" type="text/css" href="2.0.36/js/libs/jqueryui/jquery-ui-timepicker.css">
 </head>
 <body ng-controller="PageCtrl">
 <!-- Google Tag Manager -->
@@ -115,14 +115,14 @@
     </div>
   </div>
 </section>
-<script id="libScript" src="1.0.2/js/libs/usergrid-libs.min.js"></script>
-<script id="libScript" src="1.0.2/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
+<script id="libScript" src="2.0.36/js/libs/usergrid-libs.min.js"></script>
+<script id="libScript" src="2.0.36/js/libs/bootstrap/custom/js/bootstrap.min.js"></script>
 <!--todo - remove this. temporarily including jquery ui for calendar in push-->
-<script id="libScript" src="1.0.2/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
+<script id="libScript" src="2.0.36/js/libs/jqueryui/jquery.ui.timepicker.min.js" type="text/javascript"></script>
 <!-- In dev use: <script src="js/libs/angular-1.1.5.js"></script> -->
 <!--<script type="text/javascript" src="js/libs/angular-ui-ng-grid/ng-grid-2.0.2.debug.js"></script>-->
 <script src="config.js"></script>
-<script id="main-script" src="1.0.2/js/usergrid.min.js"></script>
+<script id="main-script" src="2.0.36/js/usergrid.min.js"></script>
 
 </body>
 </html>


[47/55] [abbrv] git commit: Merge pull request #71 from r3b/DPS-865

Posted by sn...@apache.org.
Merge pull request #71 from r3b/DPS-865

Dps 865

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/0b584f73
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/0b584f73
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/0b584f73

Branch: refs/pull/76/head
Commit: 0b584f7351896e2df62c04c8b6a4f24ac1cdd3b9
Parents: 7ea7503 13ab2bd
Author: Rod Simpson <ro...@rodsimpson.com>
Authored: Mon Mar 17 06:57:21 2014 -0600
Committer: Rod Simpson <ro...@rodsimpson.com>
Committed: Mon Mar 17 06:57:21 2014 -0600

----------------------------------------------------------------------
 sdks/html5-javascript/lib/Usergrid.js       | 13 +++++++++++-
 sdks/html5-javascript/lib/modules/Client.js | 10 ++++++++--
 sdks/html5-javascript/package.json          |  2 +-
 sdks/html5-javascript/tests/mocha/test.js   | 25 ++++++++++++++++++++++++
 sdks/html5-javascript/usergrid.js           | 24 +++++++++++++++++++++--
 sdks/html5-javascript/usergrid.min.js       |  6 +++---
 6 files changed, 71 insertions(+), 9 deletions(-)
----------------------------------------------------------------------



[30/55] [abbrv] fix bug with analytics

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f6c3d4aa/portal/js/usergrid.min.js
----------------------------------------------------------------------
diff --git a/portal/js/usergrid.min.js b/portal/js/usergrid.min.js
index 279579c..c0adf9a 100644
--- a/portal/js/usergrid.min.js
+++ b/portal/js/usergrid.min.js
@@ -1,6 +1,6 @@
-/*! apigee-usergrid@2.0.36 2014-03-10 */
+/*! apigee-usergrid@2.0.0 2014-03-10 */
 !function(exports,global){function renderChart(chartsDefaults,chartdata){var newSettings={};$.extend(!0,newSettings,chartsDefaults,chartdata);new Highcharts.Chart(newSettings)}function menuBindClick(scope,lElement,cevent,menuContext){var currentSelection=angular.element(cevent.srcElement).parent(),previousSelection=scope[menuContext];previousSelection!==currentSelection&&(previousSelection&&angular.element(previousSelection).removeClass("active"),scope[menuContext]=currentSelection,scope.$apply(function(){currentSelection.addClass("active")}))}global["true"]=exports;var polyfills=function(window,Object){window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)}}(),Object.defineProperty(Object.prototype,"clone",{enumerable:!1,writable:!0,value:function(){var i,newObj=this instanceof Arra
 y?[]:{};for(i in this)"clone"!==i&&(newObj[i]=this[i]&&"object"==typeof this[i]?this[i].clone():this[i]);return newObj}}),Object.defineProperty(Object.prototype,"stringifyJSON",{enumerable:!1,writable:!0,value:function(){return JSON.stringify(this,null,"	")}})};polyfills(window,Object);var AppServices=AppServices||{};global.AppServices=global.AppServices||AppServices,AppServices.Constants=angular.module("appservices.constants",[]),AppServices.Services=angular.module("appservices.services",[]),AppServices.Controllers=angular.module("appservices.controllers",[]),AppServices.Filters=angular.module("appservices.filters",[]),AppServices.Directives=angular.module("appservices.directives",[]),AppServices.Performance=angular.module("appservices.performance",[]),AppServices.Push=angular.module("appservices.push",[]),angular.module("appservices",["ngRoute","ngResource","ngSanitize","ui.bootstrap","appservices.filters","appservices.services","appservices.directives","appservices.constants","ap
 pservices.controllers","appservices.performance","appservices.push"]).config(["$routeProvider","$locationProvider","$sceDelegateProvider",function($routeProvider,$locationProvider,$sceDelegateProvider){$routeProvider.when("/org-overview",{templateUrl:"org-overview/org-overview.html",controller:"OrgOverviewCtrl"}).when("/login",{templateUrl:"login/login.html",controller:"LoginCtrl"}).when("/login/loading",{templateUrl:"login/loading.html",controller:"LoginCtrl"}).when("/app-overview/summary",{templateUrl:"app-overview/app-overview.html",controller:"AppOverviewCtrl"}).when("/getting-started/setup",{templateUrl:"app-overview/getting-started.html",controller:"GettingStartedCtrl"}).when("/forgot-password",{templateUrl:"login/forgot-password.html",controller:"ForgotPasswordCtrl"}).when("/register",{templateUrl:"login/register.html",controller:"RegisterCtrl"}).when("/users",{templateUrl:"users/users.html",controller:"UsersCtrl"}).when("/users/profile",{templateUrl:"users/users-profile.html
 ",controller:"UsersProfileCtrl"}).when("/users/groups",{templateUrl:"users/users-groups.html",controller:"UsersGroupsCtrl"}).when("/users/activities",{templateUrl:"users/users-activities.html",controller:"UsersActivitiesCtrl"}).when("/users/feed",{templateUrl:"users/users-feed.html",controller:"UsersFeedCtrl"}).when("/users/graph",{templateUrl:"users/users-graph.html",controller:"UsersGraphCtrl"}).when("/users/roles",{templateUrl:"users/users-roles.html",controller:"UsersRolesCtrl"}).when("/groups",{templateUrl:"groups/groups.html",controller:"GroupsCtrl"}).when("/groups/details",{templateUrl:"groups/groups-details.html",controller:"GroupsDetailsCtrl"}).when("/groups/members",{templateUrl:"groups/groups-members.html",controller:"GroupsMembersCtrl"}).when("/groups/activities",{templateUrl:"groups/groups-activities.html",controller:"GroupsActivitiesCtrl"}).when("/groups/roles",{templateUrl:"groups/groups-roles.html",controller:"GroupsRolesCtrl"}).when("/roles",{templateUrl:"roles/role
 s.html",controller:"RolesCtrl"}).when("/roles/settings",{templateUrl:"roles/roles-settings.html",controller:"RolesSettingsCtrl"}).when("/roles/users",{templateUrl:"roles/roles-users.html",controller:"RolesUsersCtrl"}).when("/roles/groups",{templateUrl:"roles/roles-groups.html",controller:"RolesGroupsCtrl"}).when("/data",{templateUrl:"data/data.html",controller:"DataCtrl"}).when("/data/entity",{templateUrl:"data/entity.html",controller:"EntityCtrl"}).when("/data/shell",{templateUrl:"data/shell.html",controller:"ShellCtrl"}).when("/profile/organizations",{templateUrl:"profile/organizations.html",controller:"OrgCtrl"}).when("/profile/profile",{templateUrl:"profile/profile.html",controller:"ProfileCtrl"}).when("/profile",{templateUrl:"profile/account.html",controller:"AccountCtrl"}).when("/activities",{templateUrl:"activities/activities.html",controller:"ActivitiesCtrl"}).when("/shell",{templateUrl:"shell/shell.html",controller:"ShellCtrl"}).when("/logout",{templateUrl:"login/logout.htm
 l",controller:"LogoutCtrl"}).otherwise({redirectTo:"/org-overview"}),$locationProvider.html5Mode(!1).hashPrefix("!"),$sceDelegateProvider.resourceUrlWhitelist(["self","http://apigee-internal-prod.jupiter.apigee.net/**","http://apigee-internal-prod.mars.apigee.net/**","https://appservices.apigee.com/**","https://api.usergrid.com/**"])}]),AppServices.Controllers.controller("ActivitiesCtrl",["ug","$scope","$rootScope","$location","$route",function(ug,$scope,$rootScope){$scope.$on("app-activities-received",function(evt,data){$scope.activities=data,$scope.$apply()}),$scope.$on("app-activities-error",function(){$rootScope.$broadcast("alert","error","Application failed to retreive activities data.")}),ug.getActivities()}]),AppServices.Controllers.controller("AppOverviewCtrl",["ug","charts","$scope","$rootScope","$log",function(ug,charts,$scope,$rootScope,$log){var createGradient=function(color1,color2){var perShapeGradient={x1:0,y1:0,x2:0,y2:1};return{linearGradient:perShapeGradient,stops:
 [[0,color1],[1,color2]]}};$scope.appOverview={},$scope.collections=[],$scope.graph="",$scope.$on("top-collections-received",function(event,collections){var dataDescription={bar1:{labels:["Total"],dataAttr:["title","count"],colors:[createGradient("rgba(36,151,212,0.6)","rgba(119,198,240,0.6)")],borderColor:"#1b97d1"}};$scope.collections=collections;var arr=[];for(var i in collections)collections.hasOwnProperty(i)&&arr.push(collections[i]);$scope.appOverview={},$rootScope.chartTemplate?($scope.appOverview.chart=angular.copy($rootScope.chartTemplate.pareto),$scope.appOverview.chart=charts.convertParetoChart(arr,$scope.appOverview.chart,dataDescription.bar1,"1h","NOW"),$scope.applyScope()):ug.httpGet(null,"js/charts/highcharts.json").then(function(success){$rootScope.chartTemplate=success,$scope.appOverview.chart=angular.copy($rootScope.chartTemplate.pareto),$scope.appOverview.chart=charts.convertParetoChart(arr,$scope.appOverview.chart,dataDescription.bar1,"1h","NOW"),$scope.applyScope
 ()},function(fail){$log.error("Problem getting chart template",fail)})}),$scope.$on("app-initialized",function(){ug.getTopCollections()}),$rootScope.activeUI&&ug.getTopCollections()}]),AppServices.Controllers.controller("GettingStartedCtrl",["ug","$scope","$rootScope","$location","$timeout","$anchorScroll",function(ug,$scope,$rootScope,$location,$timeout,$anchorScroll){$scope.collections=[],$scope.graph="",$scope.clientID="",$scope.clientSecret="";$scope.regenerateCredentialsDialog=function(modalId){$scope.orgAPICredentials={client_id:"regenerating...",client_secret:"regenerating..."},ug.regenerateAppCredentials(),$scope.hideModal(modalId)},$scope.$on("app-creds-updated",function(event,credentials){credentials?($scope.clientID=credentials.client_id,$scope.clientSecret=credentials.client_secret,$scope.$$phase||$scope.$apply()):setTimeout(function(){ug.getAppCredentials()},5e3)}),ug.getAppCredentials(),$scope.contentTitle,$scope.showSDKDetail=function(name){var introContainer=document
 .getElementById("intro-container");if("nocontent"===name)return introContainer.style.height="0",!0;introContainer.style.opacity=.1,introContainer.style.height="0";var timeout=0;$scope.contentTitle&&(timeout=500),$timeout(function(){introContainer.style.height="1000px",introContainer.style.opacity=1},timeout),$scope.optionName=name,$scope.contentTitle=name,$scope.sdkLink="http://apigee.com/docs/content/"+name+"-sdk-redirect",$scope.docsLink="http://apigee.com/docs/app-services/content/installing-apigee-sdk-"+name,$scope.getIncludeURL=function(){return"app-overview/doc-includes/"+$scope.optionName+".html"}},$scope.scrollToElement=function(elem){return $location.hash(elem),$anchorScroll(),!1}}]),AppServices.Controllers.controller("ChartCtrl",["$scope","$location",function(){}]),AppServices.Directives.directive("chart",function(){return{restrict:"E",scope:{chartdata:"=chartdata"},template:"<div></div>",replace:!0,controller:function(){},link:function(scope,element,attrs){scope.$watch("c
 hartdata",function(chartdata){if(chartdata){var chartsDefaults={chart:{renderTo:element[0],type:attrs.type||null,height:attrs.height||null,width:attrs.width||null,reflow:!0,animation:!1,zoomType:"x"}};if("pie"===attrs.type&&(chartsDefaults.chart.margin=[0,0,0,0],chartsDefaults.chart.spacingLeft=0,chartsDefaults.chart.spacingRight=0,chartsDefaults.chart.spacingTop=0,chartsDefaults.chart.spacingBottom=0,attrs.titleimage&&(chartdata.title.text='<img src="'+attrs.titleimage+'">'),attrs.titleicon&&(chartdata.title.text='<i class="pictogram '+attrs.titleiconclass+'">'+attrs.titleicon+"</i>"),attrs.titlecolor&&(chartdata.title.style.color=attrs.titlecolor),attrs.titleimagetop&&(chartdata.title.style.marginTop=attrs.titleimagetop),attrs.titleimageleft&&(chartdata.title.style.marginLeft=attrs.titleimageleft)),"line"===attrs.type&&(chartsDefaults.chart.marginTop=30,chartsDefaults.chart.spacingTop=50),"column"===attrs.type&&(chartsDefaults.chart.marginBottom=80),"area"===attrs.type&&(chartsDef
 aults.chart.spacingLeft=0,chartsDefaults.chart.spacingRight=0,chartsDefaults.chart.marginLeft=0,chartsDefaults.chart.marginRight=0),Highcharts.setOptions({global:{useUTC:!1},chart:{style:{fontFamily:"marquette-light, Helvetica, Arial, sans-serif"}}}),"line"===attrs.type){var xAxis1=chartdata.xAxis[0];xAxis1.labels.formatter||(xAxis1.labels.formatter=new Function(attrs.xaxislabel)),xAxis1.labels.step||(xAxis1.labels.step=attrs.xaxisstep)}chartdata.tooltip&&"string"==typeof chartdata.tooltip.formatter&&(chartdata.tooltip.formatter=new Function(chartdata.tooltip.formatter)),renderChart(chartsDefaults,chartdata)}},!0)}}}),AppServices.Services.factory("charts",function(){function sortJsonArrayByProperty(objArray,prop){if(arguments.length<2)throw new Error("sortJsonArrayByProp requires 2 arguments");var direct=arguments.length>2?arguments[2]:1;if(objArray&&objArray.constructor===Array){var propPath=prop.constructor===Array?prop:prop.split(".");objArray.sort(function(a,b){for(var p in prop
 Path)a[propPath[p]]&&b[propPath[p]]&&(a=a[propPath[p]],b=b[propPath[p]]);return a=a.match(/^\d+$/)?+a:a,b=b.match(/^\d+$/)?+b:b,b>a?-1*direct:a>b?1*direct:0})}}var lineChart,areaChart,paretoChart,pieChart,xaxis,seriesIndex;return{convertLineChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function plotData(counter,dPLength,dataPoints,dataAttrs,detailedView){for(var i=0;dPLength>i;i++)for(var dp=dataPoints[i],localCounter=counter,j=0;j<dataAttrs.length;j++)lineChart.series[localCounter].data.push("undefined"==typeof dp?[i,0]:[i,dp[dataAttrs[j]]]),detailedView||localCounter++}lineChart=chartTemplate,"undefined"==typeof chartData[0]&&(chartData[0]={},chartData[0].datapoints=[]);var label,dataPoints=chartData[0].datapoints,dPLength=dataPoints.length;"YESTERDAY"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Yesterday "):"LAST_WEEK"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Last Week "):(lineChart=chartTempla
 te,seriesIndex=0,lineChart.series=[],label=""),xaxis=lineChart.xAxis[0],xaxis.categories=[],settings.xaxisformat&&(xaxis.labels.formatter=new Function(settings.xaxisformat)),settings.step&&(xaxis.labels.step=settings.step);for(var i=0;dPLength>i;i++){var dp=dataPoints[i];xaxis.categories.push(dp.timestamp)}if(chartData.length>1)for(var l=0;l<chartData.length;l++)chartData[l].chartGroupName&&(dataPoints=chartData[l].datapoints,lineChart.series[l]={},lineChart.series[l].data=[],lineChart.series[l].name=chartData[l].chartGroupName,lineChart.series[l].yAxis=0,lineChart.series[l].type="line",lineChart.series[l].color=dataDescription.colors[i],lineChart.series[l].dashStyle="solid",lineChart.series[l].yAxis.title.text=dataDescription.yAxisLabels,plotData(l,dPLength,dataPoints,dataDescription.detailDataAttr,!0));else{for(var steadyCounter=0,i=seriesIndex;i<dataDescription.dataAttr.length+(seriesIndex>0?seriesIndex:0);i++){var yAxisIndex=dataDescription.multiAxis?steadyCounter:0;lineChart.se
 ries[i]={},lineChart.series[i].data=[],lineChart.series[i].name=label+dataDescription.labels[steadyCounter],lineChart.series[i].yAxis=yAxisIndex,lineChart.series[i].type="line",lineChart.series[i].color=dataDescription.colors[i],lineChart.series[i].dashStyle="solid",lineChart.yAxis[yAxisIndex].title.text=dataDescription.yAxisLabels[dataDescription.yAxisLabels>1?steadyCounter:0],steadyCounter++}plotData(seriesIndex,dPLength,dataPoints,dataDescription.dataAttr,!1)}return lineChart},convertAreaChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function plotData(counter,dPLength,dataPoints,dataAttrs,detailedView){for(var i=0;dPLength>i;i++)for(var dp=dataPoints[i],localCounter=counter,j=0;j<dataAttrs.length;j++)areaChart.series[localCounter].data.push("undefined"==typeof dp?0:dp[dataAttrs[j]]),detailedView||localCounter++}areaChart=angular.copy(areaChart),"undefined"==typeof chartData[0]&&(chartData[0]={},chartData[0].datapoints=[]);var label,dataPoints=char
 tData[0].datapoints,dPLength=dataPoints.length;"YESTERDAY"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Yesterday "):"LAST_WEEK"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Last Week "):(areaChart=chartTemplate,seriesIndex=0,areaChart.series=[],label=""),xaxis=areaChart.xAxis[0],xaxis.categories=[],settings.xaxisformat&&(xaxis.labels.formatter=new Function(settings.xaxisformat)),settings.step&&(xaxis.labels.step=settings.step);for(var i=0;dPLength>i;i++){var dp=dataPoints[i];xaxis.categories.push(dp.timestamp)}if(chartData.length>1)for(var l=0;l<chartData.length;l++)chartData[l].chartGroupName&&(dataPoints=chartData[l].datapoints,areaChart.series[l]={},areaChart.series[l].data=[],areaChart.series[l].fillColor=dataDescription.areaColors[l],areaChart.series[l].name=chartData[l].chartGroupName,areaChart.series[l].yAxis=0,areaChart.series[l].type="area",areaChart.series[l].pointInterval=1,areaChart.series[l].color=dataDescription.colors[l
 ],areaChart.series[l].dashStyle="solid",areaChart.series[l].yAxis.title.text=dataDescription.yAxisLabels,plotData(l,dPLength,dataPoints,dataDescription.detailDataAttr,!0));else{for(var steadyCounter=0,i=seriesIndex;i<dataDescription.dataAttr.length+(seriesIndex>0?seriesIndex:0);i++){var yAxisIndex=dataDescription.multiAxis?steadyCounter:0;areaChart.series[i]={},areaChart.series[i].data=[],areaChart.series[i].fillColor=dataDescription.areaColors[i],areaChart.series[i].name=label+dataDescription.labels[steadyCounter],areaChart.series[i].yAxis=yAxisIndex,areaChart.series[i].type="area",areaChart.series[i].pointInterval=1,areaChart.series[i].color=dataDescription.colors[i],areaChart.series[i].dashStyle="solid",areaChart.yAxis[yAxisIndex].title.text=dataDescription.yAxisLabels[dataDescription.yAxisLabels>1?steadyCounter:0],steadyCounter++}plotData(seriesIndex,dPLength,dataPoints,dataDescription.dataAttr,!1)}return areaChart},convertParetoChart:function(chartData,chartTemplate,dataDescrip
 tion,settings,currentCompare){function getPreviousData(){for(var i=0;i<chartTemplate.series[0].data.length;i++)allParetoOptions.push(chartTemplate.xAxis.categories[i])}function createStackedBar(dataDescription,paretoChart){paretoChart.plotOptions={series:{shadow:!1,borderColor:dataDescription.borderColor,borderWidth:1},column:{stacking:"normal",dataLabels:{enabled:!0,color:Highcharts.theme&&Highcharts.theme.dataLabelsColor||"white"}}};var start=dataDescription.dataAttr[1].length,steadyCounter=0;compare&&(paretoChart.legend.enabled=!0);for(var f=seriesIndex;start+seriesIndex>f;f++)paretoChart.series[f]||(paretoChart.series[f]={data:[]}),paretoChart.series[f].data.push(bar[dataDescription.dataAttr[1][steadyCounter]]),paretoChart.series[f].name=""!==label?label+" "+dataDescription.labels[steadyCounter]:dataDescription.labels[steadyCounter],paretoChart.series[f].color=dataDescription.colors[f],paretoChart.series[f].stack=label,steadyCounter++}paretoChart=chartTemplate,"undefined"==typeo
 f chartData&&(chartData=[]);var label,cdLength=chartData.length,compare=!1,allParetoOptions=[],stackedBar=!1;if(seriesIndex=0,"object"==typeof dataDescription.dataAttr[1]&&(stackedBar=!0),"YESTERDAY"===currentCompare?(label="Yesterday ",compare=!0,stackedBar&&(seriesIndex=dataDescription.dataAttr[1].length),getPreviousData()):"LAST_WEEK"===currentCompare?(label="Last Week ",compare=!0,stackedBar&&(seriesIndex=dataDescription.dataAttr[1].length),seriesIndex=getPreviousData()):(compare=!1,label="",paretoChart.xAxis.categories=[],paretoChart.series=[],paretoChart.series[0]={},paretoChart.series[0].data=[],paretoChart.legend.enabled=!1),paretoChart.plotOptions.series.borderColor=dataDescription.borderColor,compare&&!stackedBar){paretoChart.series[1]={},paretoChart.series[1].data=[];for(var i=0;i<allParetoOptions.length;i++)paretoChart.series[1].data.push(0);paretoChart.legend.enabled=!0}for(var i=0;cdLength>i;i++){var bar=chartData[i];if(compare){var newLabel=bar[dataDescription.dataAtt
 r[0]],newValue=bar[dataDescription.dataAttr[1]],previousIndex=allParetoOptions.indexOf(newLabel);previousIndex>-1&&("object"==typeof dataDescription.dataAttr[1]?createStackedBar(dataDescription,paretoChart,paretoChart.series.length):(paretoChart.series[1].data[previousIndex]=newValue,paretoChart.series[1].name=""!==label?label+" "+dataDescription.labels[0]:dataDescription.labels[0],paretoChart.series[1].color=dataDescription.colors[1]))}else paretoChart.xAxis.categories.push(bar[dataDescription.dataAttr[0]]),"object"==typeof dataDescription.dataAttr[1]?createStackedBar(dataDescription,paretoChart,paretoChart.series.length):(paretoChart.series[0].data.push(bar[dataDescription.dataAttr[1]]),paretoChart.series[0].name=dataDescription.labels[0],paretoChart.series[0].color=dataDescription.colors[0])}return paretoChart},convertPieChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){var label,cdLength=chartData.length,compare=!1;pieChart=chartTemplate,"YESTERDAY"
 ===currentCompare?(label="Yesterday ",compare=!1):"LAST_WEEK"===currentCompare?(label="Last Week ",compare=!1):(compare=!1,pieChart.series[0].data=[],pieChart.series[0].dataLabels&&"string"==typeof pieChart.series[0].dataLabels.formatter&&(pieChart.series[0].dataLabels.formatter=new Function(pieChart.series[0].dataLabels.formatter))),pieChart.plotOptions.pie.borderColor=dataDescription.borderColor,compare&&(pieChart.series[1].data=[],pieChart.series[1].dataLabels&&"string"==typeof pieChart.series[1].dataLabels.formatter&&(pieChart.series[1].dataLabels.formatter=new Function(pieChart.series[1].dataLabels.formatter)));for(var tempArray=[],i=0;cdLength>i;i++){var pie=chartData[i];tempArray.push({name:pie[dataDescription.dataAttr[0]],y:pie[dataDescription.dataAttr[1]],color:""})}sortJsonArrayByProperty(tempArray,"name");for(var i=0;i<tempArray.length;i++)tempArray[i].color=dataDescription.colors[i];return compare?pieChart.series[1].data=tempArray:pieChart.series[0].data=tempArray,pieCha
 rt}}}),$(".sessions-bar").sparkline([3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,1],{type:"bar",barColor:"#c5c5c5",width:"800px",height:100,barWidth:12,barSpacing:"1px"}),AppServices.Controllers.controller("DataCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope){var init=function(){$scope.verb="GET",$scope.display="",$scope.queryBodyDetail={},$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.entitySelected={},$scope.newCollection={},$rootScope.queryCollection={},$scope.data={},$scope.data.queryPath="",$scope.data.queryBody='{ "name":"value" }',$scope.data.searchString="",$scope.data.queryLimit=""},runQuery=function(verb){$scope.loading=!0;var queryPath=$scope.removeFirstSlash($scope.data.queryPath||""),searchString=$scope.data.searchString||"",queryLimit=$scope.data.queryLimit||"",body=JSON.parse($scope.data.queryBody||"{}");"POST"
 ==verb&&$scope.validateJson(!0)?ug.runDataPOSTQuery(queryPath,body):"PUT"==verb&&$scope.validateJson(!0)?ug.runDataPutQuery(queryPath,searchString,queryLimit,body):"DELETE"==verb?ug.runDataDeleteQuery(queryPath,searchString,queryLimit):ug.runDataQuery(queryPath,searchString,queryLimit)};$scope.$on("top-collections-received",function(event,collectionList){$scope.loading=!1;var ignoredCollections=["events"];ignoredCollections.forEach(function(ignoredCollection){collectionList.hasOwnProperty(ignoredCollection)&&delete collectionList[ignoredCollection]}),$scope.collectionList=collectionList,$scope.queryBoxesSelected=!1,$scope.queryPath||$scope.loadCollection("/"+collectionList[Object.keys(collectionList).sort()[0]].name),$scope.applyScope()}),$scope.$on("error-running-query",function(){$scope.loading=!1,runQuery("GET"),$scope.applyScope()}),$scope.$on("entity-deleted",function(){$scope.deleteLoading=!1,$rootScope.$broadcast("alert","success","Entities deleted sucessfully"),$scope.queryB
 oxesSelected=!1,$scope.checkNextPrev(),$scope.applyScope()}),$scope.$on("entity-deleted-error",function(){$scope.deleteLoading=!1,runQuery("GET"),$scope.applyScope()}),$scope.$on("collection-created",function(){$scope.newCollection.name=""}),$scope.$on("query-received",function(event,collection){$scope.loading=!1,$rootScope.queryCollection=collection,ug.getIndexes($scope.data.queryPath),$scope.setDisplayType(),$scope.checkNextPrev(),$scope.applyScope(),$scope.queryBoxesSelected=!1}),$scope.$on("indexes-received",function(event,indexes){}),$scope.$on("app-changed",function(){init()}),$scope.setDisplayType=function(){$scope.display="generic"},$scope.deleteEntitiesDialog=function(modalId){$scope.deleteLoading=!1,$scope.deleteEntities($rootScope.queryCollection,"entity-deleted","error deleting entity"),$scope.hideModal(modalId)},$scope.newCollectionDialog=function(modalId){$scope.newCollection.name?(ug.createCollection($scope.newCollection.name),ug.getTopCollections(),$rootScope.$broadc
 ast("alert","success","Collection created successfully."),$scope.hideModal(modalId)):$rootScope.$broadcast("alert","error","You must specify a collection name.")},$scope.addToPath=function(uuid){$scope.data.queryPath="/"+$rootScope.queryCollection._type+"/"+uuid},$scope.isDeep=function(item){return"[object Object]"===Object.prototype.toString.call(item)},$scope.loadCollection=function(type){$scope.data.queryPath="/"+type.substring(1,type.length),$scope.data.searchString="",$scope.data.queryLimit="",$scope.data.body='{ "name":"value" }',$scope.selectGET(),$scope.applyScope(),$scope.run()},$scope.selectGET=function(){$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="GET"},$scope.selectPOST=function(){$scope.queryBodyDisplay="block",$scope.queryLimitDisplay="none",$scope.queryStringDisplay="none",$scope.verb="POST"},$scope.selectPUT=function(){$scope.queryBodyDisplay="block",$scope.queryLimitDisplay="block",$scope.queryString
 Display="block",$scope.verb="PUT"},$scope.selectDELETE=function(){$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="DELETE"},$scope.validateJson=function(skipMessage){var queryBody=$scope.data.queryBody;try{queryBody=JSON.parse(queryBody)}catch(e){return $rootScope.$broadcast("alert","error","JSON is not valid"),!1}return queryBody=JSON.stringify(queryBody,null,2),!skipMessage&&$rootScope.$broadcast("alert","success","JSON is valid"),$scope.data.queryBody=queryBody,!0},$scope.saveEntity=function(entity){if(!$scope.validateJson())return!1;var queryBody=entity._json;queryBody=JSON.parse(queryBody),$rootScope.selectedEntity.set(),$rootScope.selectedEntity.set(queryBody),$rootScope.selectedEntity.set("type",entity._data.type),$rootScope.selectedEntity.set("uuid",entity._data.uuid),$rootScope.selectedEntity.save(function(err,data){err?$rootScope.$broadcast("alert","error","error: "+data.error_description):$rootScope.$broadcast(
 "alert","success","entity saved")})},$scope.run=function(){$rootScope.queryCollection="";var verb=$scope.verb;runQuery(verb)},$scope.hasProperty=function(prop){var retval=!1;return"undefined"!=typeof $rootScope.queryCollection._list&&angular.forEach($rootScope.queryCollection._list,function(value){retval||value._data[prop]&&(retval=!0)}),retval},$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$rootScope.queryCollection.hasPreviousPage()&&($scope.previous_display="default"),$rootScope.queryCollection.hasNextPage()&&($scope.next_display="default")},$scope.selectEntity=function(uuid){$rootScope.selectedEntity=$rootScope.queryCollection.getEntityByUUID(uuid),$scope.addToPath(uuid)},$scope.getJSONView=function(entity){var tempjson=entity.get(),queryBody=JSON.stringify(tempjson,null,2);queryBody=JSON.parse(queryBody),delete queryBody.metadata,delete queryBody.uuid,delete queryBody.created,del
 ete queryBody.modified,delete queryBody.type,$scope.queryBody=JSON.stringify(queryBody,null,2)},$scope.getPrevious=function(){$rootScope.queryCollection.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of data"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.getNext=function(){$rootScope.queryCollection.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of data"),$scope.checkNextPrev(),$scope.applyScope()})},init(),$rootScope.queryCollection=$rootScope.queryCollection||{},$rootScope.selectedEntity={},$rootScope.queryCollection&&$rootScope.queryCollection._type&&($scope.loadCollection($rootScope.queryCollection._type),$scope.setDisplayType()),ug.getTopCollections(),$scope.resetNextPrev()}]),AppServices.Controllers.controller("EntityCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){if(!$rootScope.selectedEntity)return void $location.path("/data");$
 scope.entityUUID=$rootScope.selectedEntity.get("uuid"),$scope.entityType=$rootScope.selectedEntity.get("type");var tempjson=$rootScope.selectedEntity.get(),queryBody=JSON.stringify(tempjson,null,2);queryBody=JSON.parse(queryBody),delete queryBody.metadata,delete queryBody.uuid,delete queryBody.created,delete queryBody.modified,delete queryBody.type,$scope.queryBody=JSON.stringify(queryBody,null,2),$scope.validateJson=function(){var queryBody=$scope.queryBody;try{queryBody=JSON.parse(queryBody)}catch(e){return $rootScope.$broadcast("alert","error","JSON is not valid"),!1}return queryBody=JSON.stringify(queryBody,null,2),$rootScope.$broadcast("alert","success","JSON is valid"),$scope.queryBody=queryBody,!0},$scope.saveEntity=function(){if(!$scope.validateJson())return!1;var queryBody=$scope.queryBody;queryBody=JSON.parse(queryBody),$rootScope.selectedEntity.set(),$rootScope.selectedEntity.set(queryBody),$rootScope.selectedEntity.set("type",$scope.entityType),$rootScope.selectedEntity.
 set("uuid",$scope.entityUUID),$rootScope.selectedEntity.save(function(err,data){err?$rootScope.$broadcast("alert","error","error: "+data.error_description):$rootScope.$broadcast("alert","success","entity saved")})}}]),AppServices.Controllers.controller("ShellCtrl",["ug","$scope","$rootScope","$location",function(){}]),AppServices.Directives.directive("balloon",["$window","$timeout",function($window,$timeout){return{restrict:"ECA",scope:"=",template:'<div class="baloon {{direction}}" ng-transclude></div>',replace:!0,transclude:!0,link:function(scope,lElement,attrs){scope.direction=attrs.direction;var runScroll=!0,windowEl=angular.element($window);windowEl.on("scroll",function(){runScroll&&(lElement.addClass("fade-out"),$timeout(function(){lElement.addClass("hide")},1e3),runScroll=!1)})}}}]),AppServices.Directives.directive("bsmodal",["$rootScope",function($rootScope){return{restrict:"ECA",scope:{title:"@title",buttonid:"=buttonid",footertext:"=footertext",closelabel:"=closelabel"},tr
 ansclude:!0,templateUrl:"dialogs/modal.html",replace:!0,link:function(scope,lElement,attrs,parentCtrl){scope.title=attrs.title,scope.footertext=attrs.footertext,scope.closelabel=attrs.closelabel,scope.close=attrs.close,scope.extrabutton=attrs.extrabutton,scope.extrabuttonlabel=attrs.extrabuttonlabel,scope.buttonId=attrs.buttonid,scope.closeDelegate=function(attr){scope.$parent[attr](attrs.id,scope)},scope.extraDelegate=function(attr){scope.dialogForm.$valid?(console.log(parentCtrl),scope.$parent[attr](attrs.id)):$rootScope.$broadcast("alert","error","Please check your form input and resubmit.")}}}}]),AppServices.Controllers.controller("AlertCtrl",["$scope","$rootScope","$timeout",function($scope,$rootScope,$timeout){$scope.alertDisplay="none",$scope.alerts=[],$scope.$on("alert",function(event,type,message,permanent){$scope.addAlert(type,message,permanent)}),$scope.$on("clear-alerts",function(){$scope.alerts=[]}),$scope.addAlert=function(type,message,permanent){$scope.alertDisplay="b
 lock",$scope.alerts.push({type:type,msg:message}),$scope.applyScope(),permanent||$timeout(function(){$scope.alerts.shift()},5e3)},$scope.closeAlert=function(index){$scope.alerts.splice(index,1)}}]),AppServices.Directives.directive("alerti",["$rootScope","$timeout",function($rootScope,$timeout){return{restrict:"ECA",scope:{type:"=type",closeable:"@closeable",index:"&index"},template:'<div class="alert" ng-class="type && \'alert-\' + type">    <button ng-show="closeable" type="button" class="close" ng-click="closeAlert(index)">&times;</button>    <i ng-if="type === \'warning\'" class="pictogram pull-left" style="font-size:3em;line-height:0.4">&#128165;</i>    <i ng-if="type === \'info\'" class="pictogram pull-left">&#8505;</i>    <i ng-if="type === \'error\'" class="pictogram pull-left">&#9889;</i>    <i ng-if="type === \'success\'" class="pictogram pull-left">&#128077;</i><div ng-transclude></div></div>',replace:!0,transclude:!0,link:function(scope,lElement,attrs){$timeout(function()
 {lElement.addClass("fade-out")},4e3),lElement.click(function(){attrs.index&&scope.$parent.closeAlert(attrs.index)}),setTimeout(function(){lElement.addClass("alert-animate")},10)}}}]),AppServices.Directives.directive("appswitcher",["$rootScope",function(){return{restrict:"ECA",scope:"=",templateUrl:"global/appswitcher-template.html",replace:!0,transclude:!0,link:function(){function globalNavDetail(){$("#globalNavDetail > div").removeClass(classNameOpen),$("#globalNavDetailApiPlatform").addClass(classNameOpen)}var classNameOpen="open";$("ul.nav li.dropdownContainingSubmenu").hover(function(){$(this).addClass(classNameOpen)},function(){$(this).removeClass(classNameOpen)}),$("#globalNav > a").mouseover(globalNavDetail),$("#globalNavDetail").mouseover(globalNavDetail),$("#globalNavSubmenuContainer ul li").mouseover(function(){$("#globalNavDetail > div").removeClass(classNameOpen),$("#"+this.getAttribute("data-globalNavDetail")).addClass(classNameOpen)})}}}]),AppServices.Directives.direct
 ive("insecureBanner",["$rootScope","ug",function($rootScope,ug){return{restrict:"E",transclude:!0,templateUrl:"global/insecure-banner.html",link:function(scope){scope.securityWarning=!1,scope.$on("roles-received",function(evt,roles){scope.securityWarning=!1,roles&&roles._list&&roles._list.forEach(function(roleHolder){var role=roleHolder._data;
-"GUEST"===role.name.toUpperCase()&&roleHolder.getPermissions(function(err){err||roleHolder.permissions&&roleHolder.permissions.forEach(function(permission){permission.path.indexOf("/**")>=0&&(scope.securityWarning=!0,scope.applyScope())})})})});var initialized=!1;scope.$on("app-initialized",function(){!initialized&&ug.getRoles(),initialized=!0}),scope.$on("app-changed",function(){scope.securityWarning=!1,ug.getRoles()})}}}]),AppServices.Constants.constant("configuration",{ITEMS_URL:"global/temp.json"}),AppServices.Controllers.controller("PageCtrl",["ug","utility","$scope","$rootScope","$location","$routeParams","$q","$route","$log","$analytics",function(ug,utility,$scope,$rootScope,$location,$routeParams,$q,$route){var initScopeVariables=function(){$scope.loadingText="Loading...",$scope.use_sso=!1,$scope.newApp={name:""},$scope.getPerm="",$scope.postPerm="",$scope.putPerm="",$scope.deletePerm="",$scope.usersTypeaheadValues=[],$scope.groupsTypeaheadValues=[],$scope.rolesTypeaheadValu
 es=[],$rootScope.sdkActive=!1,$rootScope.demoData=!1,$scope.queryStringApplied=!1,$rootScope.autoUpdateTimer=Usergrid.config?Usergrid.config.autoUpdateTimer:61,$rootScope.requiresDeveloperKey=Usergrid.config?Usergrid.config.client.requiresDeveloperKey:!1,$rootScope.loaded=$rootScope.activeUI=!1;for(var key in Usergrid.regex)$scope[key]=Usergrid.regex[key];$scope.options=Usergrid.options;var getQuery=function(){for(var m,result={},queryString=location.search.slice(1),re=/([^&=]+)=([^&]*)/g;m=re.exec(queryString);)result[decodeURIComponent(m[1])]=decodeURIComponent(m[2]);return result};$scope.queryString=getQuery()};initScopeVariables(),$rootScope.urls=function(){var urls=ug.getUrls();return $scope.apiUrl=urls.apiUrl,$scope.use_sso=urls.use_sso,urls},$rootScope.gotoPage=function(path){$location.path(path)};var notRegistration=function(){return"/forgot-password"!==$location.path()&&"/register"!==$location.path()},verifyUser=function(){"/login"!==$location.path().slice(0,"/login".length
 )&&($rootScope.currentPath=$location.path()),$routeParams.access_token&&$routeParams.admin_email&&$routeParams.uuid&&(ug.set("token",$routeParams.access_token),ug.set("email",$routeParams.admin_email),ug.set("uuid",$routeParams.uuid),$location.search("access_token",null),$location.search("admin_email",null),$location.search("uuid",null)),ug.checkAuthentication(!0)};$scope.profile=function(){$scope.use_sso?window.location=$rootScope.urls().PROFILE_URL+"?callback="+encodeURIComponent($location.absUrl()):$location.path("/profile")},$scope.showModal=function(id){$("#"+id).modal("show")},$scope.hideModal=function(id){$("#"+id).modal("hide")},$scope.deleteEntities=function(collection,successBroadcast,errorMessage){collection.resetEntityPointer();for(var entitiesToDelete=[];collection.hasNextEntity();){var entity=collection.getNextEntity(),checked=entity.checked;checked&&entitiesToDelete.push(entity)}for(var count=0,success=!1,i=0;i<entitiesToDelete.length;i++){var entity=entitiesToDelete[
 i];collection.destroyEntity(entity,function(err){count++,err?($rootScope.$broadcast("alert","error",errorMessage),$rootScope.$broadcast(successBroadcast+"-error",err)):success=!0,count===entitiesToDelete.length&&(success&&$rootScope.$broadcast(successBroadcast),$scope.applyScope())})}},$scope.selectAllEntities=function(list,that,varName,setValue){varName=varName||"master";var val=that[varName];void 0==setValue&&(setValue=!0),setValue&&(that[varName]=val=!val),list.forEach(function(entitiy){entitiy.checked=val})},$scope.createPermission=function(type,entity,path,permissions){"/"!=path.charAt(0)&&(path="/"+path);var ops="",s="";permissions.getPerm&&(ops="get",s=","),permissions.postPerm&&(ops=ops+s+"post",s=","),permissions.putPerm&&(ops=ops+s+"put",s=","),permissions.deletePerm&&(ops=ops+s+"delete",s=",");var permission=ops+":"+path;return permission},$scope.formatDate=function(date){return new Date(date).toUTCString()},$scope.clearCheckbox=function(id){$("#"+id).attr("checked")&&$("
 #"+id).click()},$scope.removeFirstSlash=function(path){return 0===path.indexOf("/")?path.substring(1,path.length):path},$scope.applyScope=function(cb){return cb="function"==typeof cb?cb:function(){},this.$$phase?void cb():this.$apply(cb)},$scope.valueSelected=function(list){return list&&list.some(function(item){return item.checked})},$scope.sendHelp=function(modalId){ug.jsonpRaw("apigeeuihelpemail","",{useremail:$rootScope.userEmail}).then(function(){$rootScope.$broadcast("alert","success","Email sent. Our team will be in touch with you shortly.")},function(){$rootScope.$broadcast("alert","error","Problem Sending Email. Try sending an email to mobile@apigee.com.")}),$scope.hideModal(modalId)},$scope.$on("users-typeahead-received",function(event,users){$scope.usersTypeaheadValues=users,$scope.$$phase||$scope.$apply()}),$scope.$on("groups-typeahead-received",function(event,groups){$scope.groupsTypeaheadValues=groups,$scope.$$phase||$scope.$apply()}),$scope.$on("roles-typeahead-receive
 d",function(event,roles){$scope.rolesTypeaheadValues=roles,$scope.$$phase||$scope.$apply()}),$scope.$on("checkAuthentication-success",function(){sessionStorage.setItem("authenticateAttempts",0),$scope.loaded=!0,$rootScope.activeUI=!0,$scope.applyScope(),$scope.queryStringApplied||($scope.queryStringApplied=!0,setTimeout(function(){$scope.queryString.org&&$rootScope.$broadcast("change-org",$scope.queryString.org)},1e3)),$rootScope.$broadcast("app-initialized")}),$scope.$on("checkAuthentication-error",function(args,err,missingData,email){if($scope.loaded=!0,err&&!$scope.use_sso&&notRegistration())ug.logout(),$location.path("/login"),$scope.applyScope();else if(missingData&&notRegistration()){if(!email&&$scope.use_sso)return void(window.location=$rootScope.urls().LOGIN_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0]));ug.reAuthenticate(email)}}),$scope.$on("reAuthenticate-success",function(args,err,data,user,organizations,applications){sessionStorage.setItem("authe
 nticateAttempts",0),$rootScope.$broadcast("loginSuccesful",user,organizations,applications),$rootScope.$emit("loginSuccesful",user,organizations,applications),$rootScope.$broadcast("checkAuthentication-success"),$scope.applyScope(function(){$scope.deferredLogin.resolve(),$location.path("/org-overview")})});var authenticateAttempts=parseInt(sessionStorage.getItem("authenticateAttempts")||0);$scope.$on("reAuthenticate-error",function(){if($scope.use_sso){if(authenticateAttempts++>5)return void $rootScope.$broadcast("alert","error","There is an issue with authentication. Please contact support.");console.error("Failed to login via sso "+authenticateAttempts),sessionStorage.setItem("authenticateAttempts",authenticateAttempts),window.location=$rootScope.urls().LOGIN_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0])}else notRegistration()&&(ug.logout(),$location.path("/login"),$scope.applyScope())}),$scope.$on("loginSuccessful",function(){$rootScope.activeUI=!0}),$scop
 e.$on("app-changed",function(args,oldVal,newVal,preventReload){newVal===oldVal||preventReload||$route.reload()}),$scope.$on("org-changed",function(){ug.getApplications(),$route.reload()}),$scope.$on("app-settings-received",function(){}),$scope.$on("request-times-slow",function(){$rootScope.$broadcast("alert","info","We are experiencing performance issues on our server.  Please click Get Help for support if this continues.")}),$scope.$on("$routeChangeSuccess",function(){verifyUser(),$scope.showDemoBar="/performance"===$location.path().slice(0,"/performance".length),$scope.showDemoBar||($rootScope.demoData=!1)}),$scope.$on("applications-received",function(event,applications){$scope.applications=applications,$scope.hasApplications=Object.keys(applications).length>0}),ug.getAppSettings()}]),AppServices.Directives.directive("pageTitle",["$rootScope","data",function($rootScope,data){return{restrict:"ECA",scope:{},transclude:!0,templateUrl:"global/page-title.html",replace:!0,link:function(
 scope,lElement,attrs){scope.title=attrs.title,scope.icon=attrs.icon,scope.showHelp=function(){$("#need-help").modal("show")},scope.sendHelp=function(){data.jsonp_raw("apigeeuihelpemail","",{useremail:$rootScope.userEmail}).then(function(){$rootScope.$broadcast("alert","success","Email sent. Our team will be in touch with you shortly.")},function(){$rootScope.$broadcast("alert","error","Problem Sending Email. Try sending an email to mobile@apigee.com.")}),$("#need-help").modal("hide")}}}}]),AppServices.Services.factory("ug",function(configuration,$rootScope,utility,$q,$http,$resource,$log,$analytics,$location){function reportError(data,config){try{$analytics.eventTrack("error",{category:"App Services",label:data+":"+config.url+":"+(sessionStorage.apigee_uuid||"na")})}catch(e){console.log(e)}}var requestTimes=[],running=!1,currentRequests={},getAccessToken=function(){return sessionStorage.getItem("accessToken")};return{get:function(prop,isObject){return isObject?this.client().getObjec
 t(prop):this.client().get(prop)},set:function(prop,value){this.client().set(prop,value)},getUrls:function(){var host=$location.host(),qs=$location.search(),BASE_URL="",DATA_URL="",use_sso=!1;switch(!0){case"appservices.apigee.com"===host&&location.pathname.indexOf("/dit")>=0:BASE_URL="https://accounts.jupiter.apigee.net",DATA_URL="http://apigee-internal-prod.jupiter.apigee.net",use_sso=!0;break;case"appservices.apigee.com"===host&&location.pathname.indexOf("/mars")>=0:BASE_URL="https://accounts.mars.apigee.net",DATA_URL="http://apigee-internal-prod.mars.apigee.net",use_sso=!0;break;case"appservices.apigee.com"===host:DATA_URL=Usergrid.overrideUrl;break;case"apigee.com"===host:BASE_URL="https://accounts.apigee.com",DATA_URL="https://api.usergrid.com",use_sso=!0;break;case"usergrid.dev"===host:DATA_URL="https://api.usergrid.com";break;default:DATA_URL=Usergrid.overrideUrl}return DATA_URL=qs.api_url||DATA_URL,DATA_URL=DATA_URL.lastIndexOf("/")===DATA_URL.length-1?DATA_URL.substring(0,D
 ATA_URL.length-1):DATA_URL,{DATA_URL:DATA_URL,LOGIN_URL:BASE_URL+"/accounts/sign_in",PROFILE_URL:BASE_URL+"/accounts/my_account",LOGOUT_URL:BASE_URL+"/accounts/sign_out",apiUrl:DATA_URL,use_sso:use_sso}},orgLogin:function(username,password){var self=this;this.client().set("email",username),this.client().set("token",null),this.client().orgLogin(username,password,function(err,data,user,organizations,applications){err?$rootScope.$broadcast("loginFailed",err,data):self.initializeCurrentUser(function(){$rootScope.$broadcast("loginSuccesful",user,organizations,applications)})})},checkAuthentication:function(force){var ug=this,client=ug.client(),initialize=function(){ug.initializeCurrentUser(function(){$rootScope.userEmail=client.get("email"),$rootScope.organizations=client.getObject("organizations"),$rootScope.applications=client.getObject("applications"),$rootScope.currentOrg=client.get("orgName"),$rootScope.currentApp=client.get("appName");var key,size=0;for(key in $rootScope.applicatio
 ns)$rootScope.applications.hasOwnProperty(key)&&size++;$rootScope.$broadcast("checkAuthentication-success",client.getObject("organizations"),client.getObject("applications"),client.get("orgName"),client.get("appName"),client.get("email"))})},isAuthenticated=function(){var authenticated=null!==client.get("token")&&null!==client.get("organizations");return authenticated&&initialize(),authenticated};if(!isAuthenticated()||force){if(!client.get("token"))return $rootScope.$broadcast("checkAuthentication-error","no token",{},client.get("email"));this.client().reAuthenticateLite(function(err){var missingData=err||!client.get("orgName")||!client.get("appName")||!client.getObject("organizations")||!client.getObject("applications"),email=client.get("email");err||missingData?$rootScope.$broadcast("checkAuthentication-error",err,missingData,email):initialize()})}},reAuthenticate:function(email,eventOveride){var ug=this;this.client().reAuthenticate(email,function(err,data,user,organizations,appl
 ications){err||($rootScope.currentUser=user),err||($rootScope.userEmail=user.get("email"),$rootScope.organizations=organizations,$rootScope.applications=applications,$rootScope.currentOrg=ug.get("orgName"),$rootScope.currentApp=ug.get("appName"),$rootScope.currentUser=user._data,$rootScope.currentUser.profileImg=utility.get_gravatar($rootScope.currentUser.email)),$rootScope.$broadcast((eventOveride||"reAuthenticate")+"-"+(err?"error":"success"),err,data,user,organizations,applications)})},logoutCallback:function(){$rootScope.$broadcast("userNotAuthenticated")},logout:function(){$rootScope.activeUI=!1,$rootScope.userEmail="user@apigee.com",$rootScope.organizations={noOrg:{name:"No Orgs Found"}},$rootScope.applications={noApp:{name:"No Apps Found"}},$rootScope.currentOrg="No Org Found",$rootScope.currentApp="No App Found",sessionStorage.setItem("accessToken",null),sessionStorage.setItem("userUUID",null),sessionStorage.setItem("userEmail",null),this.client().logout(),this._client=null}
 ,client:function(){var options={buildCurl:!0,logging:!0};return Usergrid.options&&Usergrid.options.client&&(options.keys=Usergrid.options.client),this._client=this._client||new Usergrid.Client(options,$rootScope.urls().DATA_URL),this._client},setClientProperty:function(key,value){this.client().set(key,value)},getTopCollections:function(){var options={method:"GET",endpoint:""};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting collections");else{var collections=data.entities[0].metadata.collections;$rootScope.$broadcast("top-collections-received",collections)}})},createCollection:function(collectionName){var collections={};collections[collectionName]={};var metadata={metadata:{collections:collections}},options={method:"PUT",body:metadata,endpoint:""};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error creating collection"):$rootScope.$broadcast("collection-created",collections)})},getAp
 plications:function(){this.client().getApplications(function(err,applications){err?applications&&console.error(applications):$rootScope.$broadcast("applications-received",applications)})},getAdministrators:function(){this.client().getAdministrators(function(err,administrators){err&&$rootScope.$broadcast("alert","error","error getting administrators"),$rootScope.$broadcast("administrators-received",administrators)})},createApplication:function(appName){this.client().createApplication(appName,function(err,applications){err?$rootScope.$broadcast("alert","error","error creating application"):($rootScope.$broadcast("applications-created",applications,appName),$rootScope.$broadcast("applications-received",applications))})},createAdministrator:function(adminName){this.client().createAdministrator(adminName,function(err,administrators){err&&$rootScope.$broadcast("alert","error","error creating administrator"),$rootScope.$broadcast("administrators-received",administrators)})},getFeed:functio
 n(){var options={method:"GET",endpoint:"management/organizations/"+this.client().get("orgName")+"/feed",mQuery:!0};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting feed");else{var feedData=data.entities,feed=[],i=0;for(i=0;i<feedData.length;i++){var date=new Date(feedData[i].created).toUTCString(),title=feedData[i].title,n=title.indexOf(">");title=title.substring(n+1,title.length),n=title.indexOf(">"),title=title.substring(n+1,title.length),feedData[i].actor&&(title=feedData[i].actor.displayName+" "+title),feed.push({date:date,title:title})}0===i&&feed.push({date:"",title:"No Activities found."}),$rootScope.$broadcast("feed-received",feed)}})},createGroup:function(path,title){var options={path:path,title:title},self=this;this.groupsCollection.addEntity(options,function(err){err?$rootScope.$broadcast("groups-create-error",err):($rootScope.$broadcast("groups-create-success",self.groupsCollection),$rootScope.$broadcast("groups
 -received",self.groupsCollection))})},createRole:function(name,title){var options={name:name,title:title},self=this;this.rolesCollection.addEntity(options,function(err){err?$rootScope.$broadcast("alert","error","error creating role"):$rootScope.$broadcast("roles-received",self.rolesCollection)})},createUser:function(username,name,email,password){var options={username:username,name:name,email:email,password:password},self=this;this.usersCollection.addEntity(options,function(err,data){err?"string"==typeof data?$rootScope.$broadcast("alert","error","error: "+data):$rootScope.$broadcast("alert","error","error creating user. the email address might already exist."):($rootScope.$broadcast("users-create-success",self.usersCollection),$rootScope.$broadcast("users-received",self.usersCollection))})},getCollection:function(type,path,orderBy,query,limit){var options={type:path,qs:{}};query&&(options.qs.ql=query),options.qs.ql=options.qs.ql?options.qs.ql+" order by "+(orderBy||"created desc"):"
  order by "+(orderBy||"created desc"),limit&&(options.qs.limit=limit),this.client().createCollection(options,function(err,collection,data){err?$rootScope.$broadcast("alert","error","error getting "+collection._type+": "+data.error_description):$rootScope.$broadcast(type+"-received",collection),$rootScope.$$phase||$rootScope.$apply()})},runDataQuery:function(queryPath,searchString,queryLimit){this.getCollection("query",queryPath,null,searchString,queryLimit)},runDataPOSTQuery:function(queryPath,body){var self=this,options={method:"POST",endpoint:queryPath,body:body};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description),$rootScope.$broadcast("error-running-query",data);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},runDataPutQuery:function(queryPath,searchString,queryLimit,body){var self=this,options={method:"PUT",endpoint:queryPath,body:body};searchStri
 ng&&(options.qs.ql=searchString),queryLimit&&(options.qs.queryLimit=queryLimit),this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},runDataDeleteQuery:function(queryPath,searchString,queryLimit){var self=this,options={method:"DELETE",endpoint:queryPath};searchString&&(options.qs.ql=searchString),queryLimit&&(options.qs.queryLimit=queryLimit),this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},getUsers:function(){this.getCollection("users","users","username");var self=this;$rootScope.$on("users-received",function(evt,users){self.usersCollection=users})},getGroups:function(){this.getCollection("groups","groups","title");var sel
 f=this;$rootScope.$on("groups-received",function(event,roles){self.groupsCollection=roles})},getRoles:function(){this.getCollection("roles","roles","name");var self=this;$rootScope.$on("roles-received",function(event,roles){self.rolesCollection=roles})},getNotifiers:function(){var query="",limit="100",self=this;this.getCollection("notifiers","notifiers","created",query,limit),$rootScope.$on("notifiers-received",function(event,notifiers){self.notifiersCollection=notifiers})},getNotificationHistory:function(type){var query=null;type&&(query="select * where state = '"+type+"'"),this.getCollection("notifications","notifications","created desc",query);var self=this;$rootScope.$on("notifications-received",function(event,notifications){self.notificationCollection=notifications})},getNotificationReceipts:function(uuid){this.getCollection("receipts","notifications/"+uuid+"/receipts");var self=this;$rootScope.$on("receipts-received",function(event,receipts){self.receiptsCollection=receipts})}
 ,getIndexes:function(path){var options={method:"GET",endpoint:path.split("/").concat("indexes").filter(function(bit){return bit&&bit.length}).join("/")};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Problem getting indexes: "+data.error):$rootScope.$broadcast("indexes-received",data.data)})},sendNotification:function(path,body){var options={method:"POST",endpoint:path,body:body};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Problem creating notification: "+data.error):$rootScope.$broadcast("send-notification-complete")})},getRolesUsers:function(username){var options={type:"roles/users/"+username,qs:{ql:"order by username"}};this.client().createCollection(options,function(err,users){err?$rootScope.$broadcast("alert","error","error getting users"):$rootScope.$broadcast("users-received",users)})},getTypeAheadData:function(type,searchString,searchBy,orderBy){var search="",qs={limit:100};searchStr
 ing&&(search="select * where "+searchBy+" = '"+searchString+"'"),orderBy&&(search=search+" order by "+orderBy),search&&(qs.ql=search);var options={method:"GET",endpoint:type,qs:qs};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting "+type);else{var entities=data.entities;$rootScope.$broadcast(type+"-typeahead-received",entities)}})},getUsersTypeAhead:function(searchString){this.getTypeAheadData("users",searchString,"username","username")},getGroupsTypeAhead:function(searchString){this.getTypeAheadData("groups",searchString,"path","path")},getRolesTypeAhead:function(searchString){this.getTypeAheadData("roles",searchString,"name","name")},getGroupsForUser:function(user){var options={type:"users/"+user+"/groups"};this.client().createCollection(options,function(err,groups){err?$rootScope.$broadcast("alert","error","error getting groups"):$rootScope.$broadcast("user-groups-received",groups)})},addUserToGroup:function(user,group){v
 ar options={type:"users/"+user+"/groups/"+group};this.client().createEntity(options,function(err){err?$rootScope.$broadcast("alert","error","error adding user to group"):$rootScope.$broadcast("user-added-to-group-received")})},addUserToRole:function(user,role){var options={method:"POST",endpoint:"roles/"+role+"/users/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding user to role"):$rootScope.$broadcast("role-update-received")})},addGroupToRole:function(group,role){var options={method:"POST",endpoint:"roles/"+role+"/groups/"+group};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding group to role"):$rootScope.$broadcast("role-update-received")})},followUser:function(user){var username=$rootScope.selectedUser.get("uuid"),options={method:"POST",endpoint:"users/"+username+"/following/users/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error",
 "error following user"):$rootScope.$broadcast("follow-user-received")})},newPermission:function(permission,type,entity){var options={method:"POST",endpoint:type+"/"+entity+"/permissions",body:{permission:permission}};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding permission"):$rootScope.$broadcast("permission-update-received")})},newUserPermission:function(permission,username){this.newPermission(permission,"users",username)},newGroupPermission:function(permission,path){this.newPermission(permission,"groups",path)},newRolePermission:function(permission,name){this.newPermission(permission,"roles",name)},deletePermission:function(permission,type,entity){var options={method:"DELETE",endpoint:type+"/"+entity+"/permissions",qs:{permission:permission}};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error deleting permission"):$rootScope.$broadcast("permission-update-received")})},deleteUserPermissi
 on:function(permission,user){this.deletePermission(permission,"users",user)},deleteGroupPermission:function(permission,group){this.deletePermission(permission,"groups",group)},deleteRolePermission:function(permission,rolename){this.deletePermission(permission,"roles",rolename)},removeUserFromRole:function(user,role){var options={method:"DELETE",endpoint:"roles/"+role+"/users/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error removing user from role"):$rootScope.$broadcast("role-update-received")})},removeUserFromGroup:function(group,role){var options={method:"DELETE",endpoint:"roles/"+role+"/groups/"+group};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error removing role from the group"):$rootScope.$broadcast("role-update-received")})},createAndroidNotifier:function(name,APIkey){var options={method:"POST",endpoint:"notifiers",body:{apiKey:APIkey,name:name,provider:"google"}};this.client().req
 uest(options,function(err,data){err?(console.error(data),$rootScope.$broadcast("alert","error","error creating notifier ")):($rootScope.$broadcast("alert","success","New notifier created successfully."),$rootScope.$broadcast("notifier-update"))})},createAppleNotifier:function(file,name,environment,certificatePassword){var provider="apple",formData=new FormData;formData.append("p12Certificate",file),formData.append("name",name),formData.append("provider",provider),formData.append("environment",environment),formData.append("certificatePassword",certificatePassword||"");var options={method:"POST",endpoint:"notifiers",formData:formData};this.client().request(options,function(err,data){err?(console.error(data),$rootScope.$broadcast("alert","error","error creating notifier.")):($rootScope.$broadcast("alert","success","New notifier created successfully."),$rootScope.$broadcast("notifier-update"))})},deleteNotifier:function(name){var options={method:"DELETE",endpoint:"notifiers/"+name};this
 .client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error deleting notifier"):$rootScope.$broadcast("notifier-update")})},initializeCurrentUser:function(callback){if(callback=callback||function(){},$rootScope.currentUser&&!$rootScope.currentUser.reset)return callback($rootScope.currentUser),$rootScope.$broadcast("current-user-initialized","");var options={method:"GET",endpoint:"management/users/"+this.client().get("email"),mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Error getting user info"):($rootScope.currentUser=data.data,$rootScope.currentUser.profileImg=utility.get_gravatar($rootScope.currentUser.email),$rootScope.userEmail=$rootScope.currentUser.email,callback($rootScope.currentUser),$rootScope.$broadcast("current-user-initialized",$rootScope.currentUser))})},updateUser:function(user){var body=$rootScope.currentUser;body.username=user.username,body.name=user.name,body.email=user.email;var
  options={method:"PUT",endpoint:"management/users/"+user.uuid+"/",mQuery:!0,body:body},self=this;this.client().request(options,function(err,data){return self.client().set("email",user.email),self.client().set("username",user.username),err?$rootScope.$broadcast("user-update-error",data):($rootScope.currentUser.reset=!0,void self.initializeCurrentUser(function(){$rootScope.$broadcast("user-update-success",$rootScope.currentUser)}))})},resetUserPassword:function(user){var pwdata={};pwdata.oldpassword=user.oldPassword,pwdata.newpassword=user.newPassword,pwdata.username=user.username;var options={method:"PUT",endpoint:"users/"+pwdata.uuid+"/",body:pwdata};this.client().request(options,function(err){return err?$rootScope.$broadcast("alert","error","Error resetting password"):($rootScope.currentUser.oldPassword="",$rootScope.currentUser.newPassword="",void $rootScope.$broadcast("user-reset-password-success",$rootScope.currentUser))})},getOrgCredentials:function(){var options={method:"GET",
 endpoint:"management/organizations/"+this.client().get("orgName")+"/credentials",mQuery:!0};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error getting credentials"):$rootScope.$broadcast("org-creds-updated",data.credentials)})},regenerateOrgCredentials:function(){var options={method:"POST",endpoint:"management/organizations/"+this.client().get("orgName")+"/credentials",mQuery:!0};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error regenerating credentials"):($rootScope.$broadcast("alert","success","Regeneration of credentials complete."),$rootScope.$broadcast("org-creds-updated",data.credentials))})},getAppCredentials:function(){var options={method:"GET",endpoint:"credentials"};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error getting credentials"):$rootScope.$broadcast("app-creds-updated",d
 ata.credentials)})},regenerateAppCredentials:function(){var options={method:"POST",endpoint:"credentials"};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error regenerating credentials"):($rootScope.$broadcast("alert","success","Regeneration of credentials complete."),$rootScope.$broadcast("app-creds-updated",data.credentials))})},signUpUser:function(orgName,userName,name,email,password){var formData={organization:orgName,username:userName,name:name,email:email,password:password},options={method:"POST",endpoint:"management/organizations",body:formData,mQuery:!0},client=this.client();client.request(options,function(err,data){err?$rootScope.$broadcast("register-error",data):$rootScope.$broadcast("register-success",data)})},resendActivationLink:function(id){var options={method:"GET",endpoint:"management/users/"+id+"/reactivate",mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("resend-act
 ivate-error",data):$rootScope.$broadcast("resend-activate-success",data)})},getAppSettings:function(){$rootScope.$broadcast("app-settings-received",{})},getActivities:function(){this.client().request({method:"GET",endpoint:"activities",qs:{limit:200}},function(err,data){if(err)return $rootScope.$broadcast("app-activities-error",data);var entities=data.entities;entities.forEach(function(entity){entity.actor.picture?(entity.actor.picture=entity.actor.picture.replace(/^http:\/\/www.gravatar/i,"https://secure.gravatar"),entity.actor.picture=~entity.actor.picture.indexOf("http")?entity.actor.picture:"https://apigee.com/usergrid/img/user_profile.png"):entity.actor.picture=window.location.protocol+"//"+window.location.host+window.location.pathname+"img/user_profile.png"}),$rootScope.$broadcast("app-activities-received",data.entities)})},getEntityActivities:function(entity,isFeed){var route=isFeed?"feed":"activities",endpoint=entity.get("type")+"/"+entity.get("uuid")+"/"+route,options={meth
 od:"GET",endpoint:endpoint,qs:{limit:200}};this.client().request(options,function(err,data){err&&$rootScope.$broadcast(entity.get("type")+"-"+route+"-error",data),data.entities.forEach(function(entityInstance){entityInstance.createdDate=new Date(entityInstance.created).toUTCString()}),$rootScope.$broadcast(entity.get("type")+"-"+route+"-received",data.entities)})},addUserActivity:function(user,content){var options={actor:{displayName:user.get("username"),uuid:user.get("uuid"),username:user.get("username")},verb:"post",content:content};this.client().createUserActivity(user.get("username"),options,function(err,activity){err?$rootScope.$broadcast("user-activity-add-error",err):$rootScope.$broadcast("user-activity-add-success",activity)})},runShellQuery:function(method,path,payload){var options={verb:method,endpoint:path};payload&&(options.body=payload),this.client().request(options,function(err,data){err?$rootScope.$broadcast("shell-error",data):$rootScope.$broadcast("shell-success",da
 ta)})},addOrganization:function(user,orgName){var options={method:"POST",endpoint:"management/users/"+user.uuid+"/organizations",body:{organization:orgName},mQuery:!0},client=this.client();
-client.request(options,function(err,data){err?$rootScope.$broadcast("user-add-org-error",data):$rootScope.$broadcast("user-add-org-success",$rootScope.organizations)})},leaveOrganization:function(user,org){var options={method:"DELETE",endpoint:"management/users/"+user.uuid+"/organizations/"+org.uuid,mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("user-leave-org-error",data):(delete $rootScope.organizations[org.name],$rootScope.$broadcast("user-leave-org-success",$rootScope.organizations))})},httpGet:function(id,url){var deferred;return deferred=$q.defer(),$http.get(url||configuration.ITEMS_URL).success(function(data){var result;id?angular.forEach(data,function(obj){obj.id===id&&(result=obj)}):result=data,deferred.resolve(result)}).error(function(data,status,headers,config){$log.error(data,status,headers,config),reportError(data,config),deferred.reject(data)}),deferred.promise},jsonp:function(objectType,criteriaId,params,successCallback){params|
 |(params={}),params.demoApp=$rootScope.demoData,params.access_token=getAccessToken(),params.callback="JSON_CALLBACK";var uri=$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/apm/"+objectType+"/"+criteriaId;return this.jsonpRaw(objectType,criteriaId,params,uri,successCallback)},jsonpSimple:function(objectType,appId,params){var uri=$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/apm/"+objectType+"/"+appId;return this.jsonpRaw(objectType,appId,params,uri)},calculateAverageRequestTimes:function(){if(!running){var self=this;running=!0,setTimeout(function(){running=!1;var length=requestTimes.length<10?requestTimes.length:10,sum=requestTimes.slice(0,length).reduce(function(a,b){return a+b}),avg=sum/length;self.averageRequestTimes=avg/1e3,self.averageRequestTimes>5&&$rootScope.$broadcast("request-times-slow",self.averageRequestTimes)},3e3)}},jsonpRaw:function(objectType,appId,params,uri,successCallback){"function"!=typeof succ
 essCallback&&(successCallback=null),uri=uri||$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/"+objectType,params||(params={});var start=(new Date).getTime(),self=this;params.access_token=getAccessToken(),params.callback="JSON_CALLBACK";var deferred=$q.defer(),diff=function(){currentRequests[uri]--,requestTimes.splice(0,0,(new Date).getTime()-start),self.calculateAverageRequestTimes()};successCallback&&$rootScope.$broadcast("ajax_loading",objectType);var reqCount=currentRequests[uri]||0;return self.averageRequestTimes>5&&reqCount>1?(setTimeout(function(){deferred.reject(new Error("query in progress"))},50),deferred):(currentRequests[uri]=(currentRequests[uri]||0)+1,$http.jsonp(uri,{params:params}).success(function(data,status,headers,config){diff(),successCallback&&(successCallback(data,status,headers,config),$rootScope.$broadcast("ajax_finished",objectType)),deferred.resolve(data)}).error(function(data,status,headers,config){diff(),$log.error("ERROR:
  Could not get jsonp data. "+uri),reportError(data,config),deferred.reject(data)}),deferred.promise)},resource:function(params,isArray){return $resource($rootScope.urls().DATA_URL+"/:orgname/:appname/:username/:endpoint",{},{get:{method:"JSONP",isArray:isArray,params:params},login:{method:"GET",url:$rootScope.urls().DATA_URL+"/management/token",isArray:!1,params:params},save:{url:$rootScope.urls().DATA_URL+"/"+params.orgname+"/"+params.appname,method:"PUT",isArray:!1,params:params}})},httpPost:function(url,callback,payload,headers){var accessToken=getAccessToken();payload?payload.access_token=accessToken:payload={access_token:accessToken},headers||(headers={Bearer:accessToken}),$http({method:"POST",url:url,data:payload,headers:headers}).success(function(data){callback(data)}).error(function(data,status,headers,config){reportError(data,config),callback(data)})}}}),AppServices.Directives.directive("ngFocus",["$parse",function($parse){return function(scope,element,attr){var fn=$parse(a
 ttr.ngFocus);element.bind("focus",function(event){scope.$apply(function(){fn(scope,{$event:event})})})}}]),AppServices.Directives.directive("ngBlur",["$parse",function($parse){return function(scope,element,attr){var fn=$parse(attr.ngBlur);element.bind("blur",function(event){scope.$apply(function(){fn(scope,{$event:event})})})}}]),AppServices.Services.factory("utility",function(){return{keys:function(o){var a=[];for(var propertyName in o)a.push(propertyName);return a},get_gravatar:function(email,size){try{var size=size||50;return email.length?"https://secure.gravatar.com/avatar/"+MD5(email)+"?s="+size:"https://apigee.com/usergrid/img/user_profile.png"}catch(e){return"https://apigee.com/usergrid/img/user_profile.png"}},get_qs_params:function(){var queryParams={};if(window.location.search)for(var params=window.location.search.slice(1).split("&"),i=0;i<params.length;i++){var tmp=params[i].split("=");queryParams[tmp[0]]=unescape(tmp[1])}return queryParams},safeApply:function(fn){var phas
 e=this.$root.$$phase;"$apply"==phase||"$digest"==phase?fn&&"function"==typeof fn&&fn():this.$apply(fn)}}}),AppServices.Directives.directive("ugValidate",["$rootScope",function(){return{scope:!0,restrict:"A",require:"ng-model",replace:!0,link:function(scope,element,attrs,ctrl){var validate=function(){var id=element.attr("id"),validator=id+"-validator",title=element.attr("title");if(title=title&&title.length?title:"Please enter data",$("#"+validator).remove(),ctrl.$valid)element.removeClass("has-error"),$("#"+validator).remove();else{var validatorElem='<div id="'+validator+'"><span  class="validator-error-message">'+title+"</span></div>";$("#"+id).after(validatorElem),element.addClass("has-error")}},firing=!1;element.bind("blur",function(){validate(scope,element,attrs,ctrl)}).bind("input",function(){firing||(firing=!0,setTimeout(function(){validate(scope,element,attrs,ctrl),firing=!1},500))})}}}]),AppServices.Controllers.controller("GroupsActivitiesCtrl",["ug","$scope","$rootScope","$
 location",function(ug,$scope,$rootScope,$location){return $scope.activitiesSelected="active",$rootScope.selectedGroup?($rootScope.selectedGroup.activities=[],void $rootScope.selectedGroup.getActivities(function(err){err||$rootScope.$$phase||$rootScope.$apply()})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsCtrl",["ug","$scope","$rootScope","$location","$route",function(ug,$scope,$rootScope,$location,$route){$scope.groupsCollection={},$rootScope.selectedGroup={},$scope.previous_display="none",$scope.next_display="none",$scope.hasGroups=!1,$scope.newGroup={path:"",title:""},ug.getGroups(),$scope.currentGroupsPage={},$scope.selectGroupPage=function(route){$scope.currentGroupsPage.template=$route.routes[route].templateUrl,$scope.currentGroupsPage.route=route},$scope.newGroupDialog=function(modalId){$scope.newGroup.path&&$scope.newGroup.title?(ug.createGroup($scope.removeFirstSlash($scope.newGroup.path),$scope.newGroup.title),$scope.hideModal(modalId),$sco
 pe.newGroup={path:"",title:""}):$rootScope.$broadcast("alert","error","Missing required information.")},$scope.deleteGroupsDialog=function(modalId){$scope.deleteEntities($scope.groupsCollection,"group-deleted","error deleting group"),$scope.hideModal(modalId),$scope.newGroup={path:"",title:""}},$scope.$on("group-deleted",function(){$rootScope.$broadcast("alert","success","Group deleted successfully.")}),$scope.$on("group-deleted-error",function(){ug.getGroups()}),$scope.$on("groups-create-success",function(){$rootScope.$broadcast("alert","success","Group created successfully.")}),$scope.$on("groups-create-error",function(){$rootScope.$broadcast("alert","error","Error creating group. Make sure you don't have spaces in the path.")}),$scope.$on("groups-received",function(event,groups){$scope.groupBoxesSelected=!1,$scope.groupsCollection=groups,$scope.newGroup.path="",$scope.newGroup.title="",!(groups._list.length>0)||$rootScope.selectedGroup._data&&groups._list.some(function(group){ret
 urn $rootScope.selectedGroup._data.uuid===group._data.uuid})||$scope.selectGroup(groups._list[0]._data.uuid),$scope.hasGroups=groups._list.length>0,$scope.received=!0,$scope.checkNextPrev(),$scope.applyScope()}),$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$scope.groupsCollection.hasPreviousPage()&&($scope.previous_display="block"),$scope.groupsCollection.hasNextPage()&&($scope.next_display="block")},$scope.selectGroup=function(uuid){$rootScope.selectedGroup=$scope.groupsCollection.getEntityByUUID(uuid),$scope.currentGroupsPage.template="groups/groups-details.html",$scope.currentGroupsPage.route="/groups/details",$rootScope.$broadcast("group-selection-changed",$rootScope.selectedGroup)},$scope.getPrevious=function(){$scope.groupsCollection.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of groups"),$scope.checkNextPrev(),$scope.ap
 plyScope()})},$scope.getNext=function(){$scope.groupsCollection.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of groups"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.$on("group-deleted",function(){$route.reload(),$scope.master=""})}]),AppServices.Controllers.controller("GroupsDetailsCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){var selectedGroup=$rootScope.selectedGroup.clone();return $scope.detailsSelected="active",$scope.json=selectedGroup._json||selectedGroup._data.stringifyJSON(),$scope.group=selectedGroup._data,$scope.group.path=0!=$scope.group.path.indexOf("/")?"/"+$scope.group.path:$scope.group.path,$scope.group.title=$scope.group.title,$rootScope.selectedGroup?($scope.$on("group-selection-changed",function(evt,selectedGroup){$scope.group.path=0!=selectedGroup._data.path.indexOf("/")?"/"+selectedGroup._data.path:selectedGroup._data.path,$scope.group.title=selectedGroup._data.titl
 e,$scope.detailsSelected="active",$scope.json=selectedGroup._json||selectedGroup._data.stringifyJSON()}),void($rootScope.saveSelectedGroup=function(){$rootScope.selectedGroup._data.title=$scope.group.title,$rootScope.selectedGroup._data.path=$scope.removeFirstSlash($scope.group.path),$rootScope.selectedGroup.save(function(err){err?$rootScope.$broadcast("alert","error","error saving group"):$rootScope.$broadcast("alert","success","group saved")})})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsMembersCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.membersSelected="active",$scope.previous_display="none",$scope.next_display="none",$scope.user="",$scope.master="",$scope.hasMembers=!1,ug.getUsersTypeAhead(),$scope.usersTypeaheadValues=[],$scope.$on("users-typeahead-received",function(event,users){$scope.usersTypeaheadValues=users,$scope.applyScope()}),$scope.addGroupToUserDialog=function(modalId){if($scop
 e.user){var path=$rootScope.selectedGroup.get("path");ug.addUserToGroup($scope.user.uuid,path),$scope.user="",$scope.hideModal(modalId)}else $rootScope.$broadcast("alert","error","Please select a user.")},$scope.removeUsersFromGroupDialog=function(modalId){$scope.deleteEntities($scope.groupsCollection.users,"group-update-received","Error removing user from group"),$scope.hideModal(modalId)},$scope.get=function(){if($rootScope.selectedGroup.get){var options={type:"groups/"+$rootScope.selectedGroup.get("path")+"/users"};$scope.groupsCollection.addCollection("users",options,function(err){$scope.groupMembersSelected=!1,err?$rootScope.$broadcast("alert","error","error getting users for group"):($scope.hasMembers=$scope.groupsCollection.users._list.length>0,$scope.checkNextPrev(),$scope.applyScope())})}},$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$scope.groupsCollection.users.hasPrevious
 Page()&&($scope.previous_display="block"),$scope.groupsCollection.users.hasNextPage()&&($scope.next_display="block")},$rootScope.selectedGroup?($scope.get(),$scope.getPrevious=function(){$scope.groupsCollection.users.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of users"),$scope.checkNextPrev(),$rootScope.$$phase||$rootScope.$apply()})},$scope.getNext=function(){$scope.groupsCollection.users.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of users"),$scope.checkNextPrev(),$rootScope.$$phase||$rootScope.$apply()})},$scope.$on("group-update-received",function(){$scope.get()}),void $scope.$on("user-added-to-group-received",function(){$scope.get()})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsRolesCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.rolesSelected="active",$scope.roles_previous_display="non
 e",$scope.roles_next_display="none",$scope.name="",$scope.master="",$scope.hasRoles=!1,$scope.hasPermissions=!1,$scope.permissions={},$scope.addGroupToRoleDialog=function(modalId){if($scope.name){var path=$rootScope.selectedGroup.get("path");ug.addGroupToRole(path,$scope.name),$scope.hideModal(modalId),$scope.name=""}else $rootScope.$broadcast("alert","error","You must specify a role name.")},$scope.leaveRoleDialog=function(modalId){for(var path=$rootScope.selectedGroup.get("path"),roles=$scope.groupsCollection.roles._list,i=0;i<roles.length;i++)roles[i].checked&&ug.removeUserFromGroup(path,roles[i]._data.name);$scope.hideModal(modalId)},$scope.addGroupPermissionDialog=function(modalId){if($scope.permissions.path){var permission=$scope.createPermission(null,null,$scope.removeFirstSlash($scope.permissions.path),$scope.permissions),path=$rootScope.selectedGroup.get("path");ug.newGroupPermission(permission,path),$scope.hideModal(modalId),$scope.permissions&&($scope.permissions={})}else
  $rootScope.$broadcast("alert","error","You must specify a name for the permission.")},$scope.deleteGroupPermissionDialog=function(modalId){for(var path=$rootScope.selectedGroup.get("path"),permissions=$rootScope.selectedGroup.permissions,i=0;i<permissions.length;i++)permissions[i].checked&&ug.deleteGroupPermission(permissions[i].perm,path);$scope.hideModal(modalId)},$scope.resetNextPrev=function(){$scope.roles_previous_display="none",$scope.roles_next_display="none",$scope.permissions_previous_display="none",$scope.permissions_next_display="none"},$scope.resetNextPrev(),$scope.checkNextPrevRoles=function(){$scope.resetNextPrev(),$scope.groupsCollection.roles.hasPreviousPage()&&($scope.roles_previous_display="block"),$scope.groupsCollection.roles.hasNextPage()&&($scope.roles_next_display="block")},$scope.checkNextPrevPermissions=function(){$scope.groupsCollection.permissions.hasPreviousPage()&&($scope.permissions_previous_display="block"),$scope.groupsCollection.permissions.hasNextP
 age()&&($scope.permissions_next_display="block")},$scope.getRoles=function(){var path=$rootScope.selectedGroup.get("path"),options={type:"groups/"+path+"/roles"};$scope.groupsCollection.addCollection("roles",options,function(err){$scope.groupRoleSelected=!1,err?$rootScope.$broadcast("alert","error","error getting roles for group"):($scope.hasRoles=$scope.groupsCollection.roles._list.length>0,$scope.checkNextPrevRoles(),$scope.applyScope())})},$scope.getPermissions=function(){$rootScope.selectedGroup.permissions=[],$rootScope.selectedGroup.getPermissions(function(err){$scope.groupPermissionsSelected=!1,$scope.hasPermissions=$scope.selectedGroup.permissions.length,err||$scope.applyScope()})},$scope.getPreviousRoles=function(){$scope.groupsCollection.roles.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of roles"),$scope.checkNextPrevRoles(),$scope.applyScope()})},$scope.getNextRoles=function(){$scope.groupsCollection.roles.getNextP
 age(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of roles"),$scope.checkNextPrevRoles(),$scope.applyScope()})},$scope.getPreviousPermissions=function(){$scope.groupsCollection.permissions.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of permissions"),$scope.checkNextPrevPermissions(),$scope.applyScope()})},$scope.getNextPermissions=function(){$scope.groupsCollection.permissions.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of permissions"),$scope.checkNextPrevPermissions(),$scope.applyScope()})},$scope.$on("role-update-received",function(){$scope.getRoles()}),$scope.$on("permission-update-received",function(){$scope.getPermissions()}),$scope.$on("groups-received",function(evt,data){$scope.groupsCollection=data,$scope.getRoles(),$scope.getPermissions()}),$rootScope.selectedGroup?(ug.getRolesTypeAhead(),void ug.getGroups()):void $location.path("/
 groups")}]),AppServices.Controllers.controller("ForgotPasswordCtrl",["ug","$scope","$rootScope","$location","$sce","utility",function(ug,$scope,$rootScope,$location,$sce){$rootScope.activeUI&&$location.path("/"),$scope.forgotPWiframeURL=$sce.trustAsResourceUrl($scope.apiUrl+"/management/users/resetpw")}]),AppServices.Controllers.controller("LoginCtrl",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){$scope.loading=!1,$scope.login={},$scope.activation={},$scope.requiresDeveloperKey=$scope.options.client.requiresDeveloperKey||!1,$rootScope.gotoForgotPasswordPage=function(){$location.path("/forgot-password")},$rootScope.gotoSignUp=function(){$location.path("/register")},$scope.login=function(){var username=$scope.login.username,password=$scope.login.password;$scope.loginMessage="",$scope.loading=!0,ug.orgLogin(username,password)},$scope.$on("loginFailed",function(){$scope.loading=!1,$scope.loginMessage="Error: the us
 ername / password combination was not valid",$scope.applyScope()}),$scope.logout=function(){ug.logout(),ug.setClientProperty("developerkey",null),$scope.use_sso?window.location=$rootScope.urls().LOGOUT_URL+"?redirect=no&callback="+encodeURIComponent($location.absUrl().split("?")[0]):($location.path("/login"),$scope.applyScope())},$rootScope.$on("userNotAuthenticated",function(){"/forgot-password"!==$location.path()&&($location.path("/login"),$scope.logout()),$scope.applyScope()}),$scope.$on("loginSuccesful",function(){$scope.loading=!1,$scope.requiresDeveloperKey&&ug.setClientProperty("developerkey",$scope.login.developerkey),$scope.login={},$location.path("/login"===$rootScope.currentPath||"/login/loading"===$rootScope.currentPath||"undefined"==typeof $rootScope.currentPath?"/org-overview":$rootScope.currentPath),$scope.applyScope()}),$scope.resendActivationLink=function(modalId){var id=$scope.activation.id;ug.resendActivationLink(id),$scope.activation={},$scope.hideModal(modalId)}
 ,$scope.$on("resend-activate-success",function(){$scope.activationId="",$scope.$apply(),$rootScope.$broadcast("alert","success","Activation link sent successfully.")}),$scope.$on("resend-activate-error",function(){$rootScope.$broadcast("alert","error","Activation link failed to send.")})}]),AppServices.Controllers.controller("LogoutCtrl",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){ug.logout(),$scope.use_sso?window.location=$rootScope.urls().LOGOUT_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0]):($location.path("/login"),$scope.applyScope())}]),AppServices.Controllers.controller("RegisterCtrl",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){$rootScope.activeUI&&$location.path("/");var init=function(){$scope.registeredUser={}};init(),$scope.cancel=function(){$location.path("/")},$scope.register=function(){var user=$scop
 e.registeredUser.clone();user.password===user.confirmPassword?ug.signUpUser(user.orgName,user.userName,user.name,user.email,user.password):$rootScope.$broadcast("alert","error","Passwords do not match."+name)},$scope.$on("register-error",function(event,data){$scope.signUpSuccess=!1,$rootScope.$broadcast("alert","error","Error registering: "+(data&&data.error_description?data.error_description:name))}),$scope.$on("register-success",function(){$scope.registeredUser={},$scope.signUpSuccess=!0,init(),$scope.$apply()})}]),AppServices.Directives.directive("menu",["$location","$rootScope","$log",function($location,$rootScope,$log){return{link:function(scope,lElement,attrs){function setActiveElement(ele,locationPath,$rootScope,isParentClick){ele.removeClass("active");var menuItem,parentMenuItem,newActiveElement=ele.parent().find('a[href*="#!'+locationPath+'"]');if(0===newActiveElement.length)parentMenuItem=ele;else{menuItem=newActiveElement.parent(),menuItem.hasClass("option")?parentMenuIte
 m=menuItem[0]:1===menuItem.size()?(parentMenuItem=newActiveElement.parent().parent().parent(),parentMenuItem.addClass("active")):(parentMenuItem=menuItem[0],menuItem=menuItem[1]);try{var menuItemCompare=parentMenuItem[0]||parentMenuItem;ele[0]!==menuItemCompare&&isParentClick&&ele.find("ul")[0]&&(ele.find("ul")[0].style.height=0);var subMenuSizer=angular.element(parentMenuItem).find(".nav-list")[0];if(subMenuSizer){var heightChecker,clientHeight=subMenuSizer.getAttribute("data-height"),heightCounter=1;clientHeight||heightChecker?(menuItem.addClass("active"),subMenuSizer.style.height=clientHeight+"px"):heightChecker=setInterval(function(){var tempHeight=subMenuSizer.getAttribute("data-height")||subMenuSizer.clientHeight;heightCounter=subMenuSizer.clientHeight,0===heightCounter&&(heightCounter=1),"string"==typeof tempHeight&&(tempHeight=parseInt(tempHeight,10)),tempHeight>0&&heightCounter===tempHeight&&(subMenuSizer.setAttribute("data-height",tempHeight),menuItem.addClass("active"),su
 bMenuSizer.style.height=tempHeight+"px",clearInterval(heightChecker)),heightCounter=tempHeight},20),$rootScope.menuExecute=!0}else menuItem.addClass("active")}catch(e){$log.error("Problem calculating size of menu",e)}}return{menuitem:menuItem,parentMenuItem:parentMenuItem}}function setupMenuState(){if(menuContext=attrs.menu,parentMenuItems=lElement.find("li.option"),0!==lElement.find("li.option.active").length&&($rootScope[menuContext+"Parent"]=lElement.find("li.option.active")),activeParentElement=$rootScope[menuContext+"Parent"]||null,activeParentElement&&(activeParentElement=angular.element(activeParentElement)),menuItems=lElement.find("li.option li"),locationPath=$location.path(),activeParentElement&&(activeMenuElement=angular.element(activeParentElement),activeMenuElement=activeMenuElement.find("li.active"),activeMenuElement.removeClass("active"),activeParentElement.find("a")[0])){subMenuContext=activeParentElement.find("a")[0].href.split("#!")[1];var tempMenuContext=subMenuCon
 text.split("/");subMenuContext="/"+tempMenuContext[1],tempMenuContext.length>2&&(subMenuContext+="/"+tempMenuContext[2])}var activeElements;""!==locationPath&&-1===locationPath.indexOf(subMenuContext)?(activeElements=setActiveElement(activeParentElement,locationPath,scope),$rootScope[menuContext+"Parent"]=activeElements.parentMenuItem,$rootScope[menuContext+"Menu"]=activeElements.menuitem):setActiveElement(activeParentElement,subMenuContext,scope)}var menuContext,parentMenuItems,activeParentElement,menuItems,activeMenuElement,locationPath,subMenuContext,bound=!1;scope.$on("$routeChangeSuccess",function(){setupMenuState(),bound||(bound=!0,parentMenuItems.bind("click",function(cevent){var previousParentSelection=angular.element($rootScope[menuContext+"Parent"]),targetPath=angular.element(cevent.currentTarget).find("> a")[0].href.split("#!")[1];previousParentSelection.find(".nav > li").removeClass("active");var activeElements=setActiveElement(previousParentSelection,targetPath,scope,!0
 );$rootScope[menuContext+"Parent"]=activeElements.parentMenuItem,$rootScope[menuContext+"Menu"]=activeElements.menuitem,scope.$broadcast("menu-selection")}),menuItems.bind("click",function(cevent){var previousMenuSelection=$rootScope[menuContext+"Menu"],targetElement=cevent.currentTarget;previousMenuSelection!==targetElement&&(previousMenuSelection?angular.element(previousMenuSelection).removeClass("active"):activeMenuElement.removeClass("active"),scope.$apply(function(){angular.element($rootScope[menuContext]).addClass("active")}),$rootScope[menuContext+"Menu"]=targetElement,angular.element($rootScope[menuContext+"Parent"]).find("a")[0].setAttribute("href",angular.element(cevent.currentTarget).find("a")[0].href))}))})}}}]),AppServices.Directives.directive("timeFilter",["$l

<TRUNCATED>

[52/55] [abbrv] git commit: Merge branch 'master' of https://github.com/usergrid/usergrid into Export_Persistance_Integration

Posted by sn...@apache.org.
Merge branch 'master' of https://github.com/usergrid/usergrid into Export_Persistance_Integration

# By Shawn Feldman (8) and others
# Via Dave Johnson (5) and others
* 'master' of https://github.com/usergrid/usergrid: (27 commits)
  rebuilding artifacts after merge
  Test case for default query string options
  [DPS-865] Client will accept a 'default_qs' object with the options that will automatically populate the query string for each subsequent request. any query params passed directly to the request method will override these defaults in the event of a conflict.
  prepare new version
  fix issue with querying specific fields instead of entire object
  fix issue with find_by using exclamation point
  lock down rails version to 3.2.x
  test for names with spaces
  fix bug with analytics
  reset version number add built files, so site doesn't initially have to be built
  removing another reference to angularitics
  missed angularitics reference
  remove s3 and angularticis
  Ignore two-dot-o's ignored files.
  Renamed PR to match org.apache
  USERGRID-86: Remove restriction on 10 apps in the portal, add build files
  USERGRID-86: Remove restriction on 10 apps in the portal
  USERGRID-86: Remove restriction on 10 apps in the portal
  Fixing regression bug in Assets
  Updating build artifacts
  ...


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4431562a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4431562a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4431562a

Branch: refs/pull/76/head
Commit: 4431562ac799429e8ccbe33b057a48e2181072de
Parents: 5a5644e 24425d5
Author: grey <gr...@apigee.com>
Authored: Wed Mar 19 12:04:48 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Wed Mar 19 12:04:48 2014 -0700

----------------------------------------------------------------------
 .gitignore                                      |    9 +-
 portal/config.js                                |   11 +-
 portal/index-debug.html                         |   18 +-
 portal/index-template.html                      |    2 +-
 portal/index.html                               |   18 +-
 portal/js/app.js                                |    7 +-
 portal/js/global/page-controller.js             |   58 +-
 portal/js/global/page-title.html                |    2 +-
 portal/js/global/ug-service.js                  |   74 +-
 portal/js/libs/usergrid-libs.min.js             |   22 +-
 portal/js/libs/usergrid.sdk.js                  |    5 +
 portal/js/login/forgot-password-controller.js   |    1 -
 portal/js/login/login-controller.js             |    8 +-
 portal/js/login/login.html                      |    6 +
 portal/js/menus/appMenu.html                    |    7 +-
 portal/js/menus/menu-directives.js              |    1 -
 portal/js/org-overview/org-overview.html        |    4 +-
 portal/js/templates.js                          |   57 +-
 portal/js/usergrid-dev.min.js                   |  171 +-
 portal/js/usergrid.min.js                       |   12 +-
 portal/js/users/users-feed-controller.js        |   29 +
 portal/js/users/users-feed.html                 |   27 +
 portal/js/users/users.html                      |    1 +
 portal/package.json                             |    5 +-
 portal/phantomjsdriver.log                      | 3869 ------------------
 portal/seleniumLog.txt                          |    0
 portal/tests/unit/sample.spec.js                |    3 +-
 sdks/html5-javascript/lib/Usergrid.js           |   13 +-
 sdks/html5-javascript/lib/modules/Asset.js      |    4 +-
 sdks/html5-javascript/lib/modules/Client.js     |   74 +-
 sdks/html5-javascript/lib/modules/Folder.js     |    4 +-
 sdks/html5-javascript/package.json              |    2 +-
 sdks/html5-javascript/tests/mocha/test.js       |   25 +
 sdks/html5-javascript/usergrid.js               |   36 +-
 sdks/html5-javascript/usergrid.min.js           |    6 +-
 .../lib/usergrid_ironhorse/query.rb             |   30 +-
 .../lib/usergrid_ironhorse/version.rb           |    2 +-
 .../spec/usergrid_ironhorse/base_spec.rb        |    8 +-
 sdks/ruby-on-rails/usergrid_ironhorse.gemspec   |    4 +-
 .../1.5.4/AppleJavaExtensions-1.5.4.jar         |  Bin 0 -> 23531 bytes
 .../1.5.4/AppleJavaExtensions-1.5.4.pom         |    9 +
 .../maven-metadata-local.xml                    |   12 +
 stack/pom.xml                                   |    7 +-
 .../services/AbstractCollectionService.java     |    3 +
 .../RepairingMismatchedApplicationMetadata.java |   73 +
 45 files changed, 655 insertions(+), 4084 deletions(-)
----------------------------------------------------------------------



[12/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal, add build files

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44805da2/portal/js/libs/usergrid-libs.min.js
----------------------------------------------------------------------
diff --git a/portal/js/libs/usergrid-libs.min.js b/portal/js/libs/usergrid-libs.min.js
index fda0f20..5af6fec 100644
--- a/portal/js/libs/usergrid-libs.min.js
+++ b/portal/js/libs/usergrid-libs.min.js
@@ -1,4 +1,4 @@
-/*! apigee-usergrid@2.0.36 2014-03-06 */
+/*! apigee-usergrid@1.0.2 2014-03-06 */
 !function(e,t){function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)dele
 te o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function it(){return!0}function ot(){return!1}function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0==
 =n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){for(var n,r=0;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t
 ).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}function tn(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;i--;)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function 
 rn(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(
 e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(
 b.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}var o={},a=e===jn;return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);for(;"*"===l[0];)l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataT
 ype)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){for(var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)
 l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.css
 Hooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",
 {}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],
 :{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementB
 yId(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.cal
 l(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},
 isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.
 replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a)for(;o>i&&(r=t.apply(e[i],n),r!==!1);i++);else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a)for(;o>i&&(r=t.call(e[i],i,e[i]),r!==!1);i++);else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call(" ")?function(e){return 
 null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid
 ||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.to
 LowerCase()}),r=b(o);var _={};b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;!function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})}(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){for(var r;(r=b.inArray(t,u,r))>-1;)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u|
 |i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]
 +"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var s,u,l,t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}};if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t
 ={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t
 "),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;bo
 rder:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.fir
 stChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf(
 "data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}}),b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e
 ,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q
 =b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||
 "").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return this.each(b.isFunction(e)?function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var o,a=0,s=b(this),u=t,l=e.match(w)||[];o=l[a++];)u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o);else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];return arguments.length?(i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType
 &&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))})):o?(r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)):void 0}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inA
 rray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;return e&&3!==u&&8!==u&&2!==u?typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t)):void 0},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)for(;n=o[i++];)r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpad
 ding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;return e&&3!==s&&8!==s&&2!==s?(a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]):void 0},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.
 nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)
 }}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected|
 |(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){for(r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f
 .elem=e),n=(n||"").match(w)||[""],l=n.length;l--;)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){for(t=(t||"").match(w)||[""],l=t.length;l--;)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.l
 ength;o--;)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||
 p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}for(d=0;(l=h[d++])&&!n.isPropagationStopped();)n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=b.event.handlers.call(this,e,l),n=
 0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=tt.test(i)?this.mouse
 Hooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;t--;)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.sc
 rollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof
  e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i
 =e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this.
 _just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}})
 ,b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undeleg
 ate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e
 ),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;u--;)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;
 )n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=i.preFilter;s;){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){for(;t=t[i];)if((1===t.nodeType||o)&&e(t,n,s))return!0}else for(;t=t[i];)if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return
  e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r)for(l=mt(y,d),r(l,[],s,u),c=l.length;c--;)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p));if(o){if(i||e){if(i){for(l=[],c=y.length;c--;)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}for(c=y.length;c--;)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){for(var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeTyp
 e?c(e,n,r):p(e,n,r))}];o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r&&!i.relative[e[r].type];r++);return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){for(g=0;m=e[g++];)if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){for(g=0;m=t[g++];)m(x,y,u,c);if(s){if(v>0)for(;b--;)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}function xt(e,t,n){for(var r=0,i=t.length;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1
 ===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}for(o=U.needsContext.test(e)?0:a.length;o--&&(u=a[o],!i.relative[l=u.type]);)if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}return s(e,p)(r,t,d,n,V.test(e)),n}function Tt(){}var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((
 ?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n
 +65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){for(var t,n=[];t=this[e++];)n.push(t);return n}}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a>
 <div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&
 &e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length|
 |h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t
 ];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);for(r=e;r=r.parentNode;)s.unshift(r);for(r=t;r=r.parentNode;)l.unshift(r);for(;s[i]===l[i];)i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "
 +e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e
 ){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u
 ){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(p=t;p=p[g];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];p=++d&&p&&p[g]||(f=d=0)||h.pop();)if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else for(;(p=++d&&p&&p[g]||(f=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++f||(v&&((p[x]||(p[x]={}))[e]=[N,f]),p!==t)););return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){r
 eturn r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e)
 {return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){for(var r
 =0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){for(t||(t=ft(e)),n=t.length;n--;)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o},i.pseudos.nth=i.pseudos.eq,i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,th
 is[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==type
 of e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack,b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.
 fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)
 }}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,
 "<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return t
 his},wrapInner:function(e){return this.each(b.isFunction(e)?function(t){b(this).wrapInner(e.call(this,t))}:function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function
 (e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&b.cleanData(Ot(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)}
 ,null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"glo
 balEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}}),b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){for(var n,r=0,i=[],o=b(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}}),b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&
 &Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){for(s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];i--;)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody)for(o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;i--;)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(b.merge(d,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));for(s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;o=d[h++];)if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),
 "script"),a&&Mt(s),n))for(i=0;o=s[i++];)kt.test(o.type||"")&&n.push(o);return s=null,f},cleanData:function(e,t){for(var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;
 i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.sup
 port.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=fu
 nction(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),
 ""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:i
 nput|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")},b.each("blur focus focusin focusout load resize scroll unload click dblclick moused
 own mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[],b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o
 =arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t
 ){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{}
 ,y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c)for(c={};t=Tn.exec(a);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&
 "string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(j
 n,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}}),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&
 &(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=
 a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.te
 xt=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}}),b.Tween=rr,rr.prototype={constructor:rr,init
 :function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.el
 em[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n
 )&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};re

<TRUNCATED>

[28/55] [abbrv] reset version number add built files, so site doesn't initially have to be built

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c1950d95/portal/js/libs/usergrid-libs.min.js
----------------------------------------------------------------------
diff --git a/portal/js/libs/usergrid-libs.min.js b/portal/js/libs/usergrid-libs.min.js
index 5af6fec..1ce3c94 100644
--- a/portal/js/libs/usergrid-libs.min.js
+++ b/portal/js/libs/usergrid-libs.min.js
@@ -1,4 +1,4 @@
-/*! apigee-usergrid@1.0.2 2014-03-06 */
+/*! apigee-usergrid@2.0.36 2014-03-10 */
 !function(e,t){function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)dele
 te o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function it(){return!0}function ot(){return!1}function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0==
 =n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){for(var n,r=0;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t
 ).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}function tn(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;i--;)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function 
 rn(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(
 e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(
 b.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}var o={},a=e===jn;return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);for(;"*"===l[0];)l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataT
 ype)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){for(var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)
 l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.css
 Hooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",
 {}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],
 :{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementB
 yId(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.cal
 l(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},
 isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.
 replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a)for(;o>i&&(r=t.apply(e[i],n),r!==!1);i++);else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a)for(;o>i&&(r=t.call(e[i],i,e[i]),r!==!1);i++);else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call(" ")?function(e){return 
 null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid
 ||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.to
 LowerCase()}),r=b(o);var _={};b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;!function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})}(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){for(var r;(r=b.inArray(t,u,r))>-1;)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u|
 |i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]
 +"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var s,u,l,t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}};if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t
 ={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t
 "),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;bo
 rder:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.fir
 stChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf(
 "data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}}),b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e
 ,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q
 =b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||
 "").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return this.each(b.isFunction(e)?function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var o,a=0,s=b(this),u=t,l=e.match(w)||[];o=l[a++];)u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o);else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];return arguments.length?(i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType
 &&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))})):o?(r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)):void 0}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inA
 rray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;return e&&3!==u&&8!==u&&2!==u?typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t)):void 0},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)for(;n=o[i++];)r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpad
 ding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;return e&&3!==s&&8!==s&&2!==s?(a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]):void 0},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.
 nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)
 }}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected|
 |(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){for(r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f
 .elem=e),n=(n||"").match(w)||[""],l=n.length;l--;)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){for(t=(t||"").match(w)||[""],l=t.length;l--;)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.l
 ength;o--;)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||
 p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}for(d=0;(l=h[d++])&&!n.isPropagationStopped();)n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=b.event.handlers.call(this,e,l),n=
 0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=tt.test(i)?this.mouse
 Hooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;t--;)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.sc
 rollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof
  e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i
 =e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this.
 _just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}})
 ,b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undeleg
 ate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e
 ),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;u--;)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;
 )n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=i.preFilter;s;){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){for(;t=t[i];)if((1===t.nodeType||o)&&e(t,n,s))return!0}else for(;t=t[i];)if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return
  e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r)for(l=mt(y,d),r(l,[],s,u),c=l.length;c--;)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p));if(o){if(i||e){if(i){for(l=[],c=y.length;c--;)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}for(c=y.length;c--;)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){for(var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeTyp
 e?c(e,n,r):p(e,n,r))}];o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r&&!i.relative[e[r].type];r++);return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){for(g=0;m=e[g++];)if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){for(g=0;m=t[g++];)m(x,y,u,c);if(s){if(v>0)for(;b--;)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}function xt(e,t,n){for(var r=0,i=t.length;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1
 ===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}for(o=U.needsContext.test(e)?0:a.length;o--&&(u=a[o],!i.relative[l=u.type]);)if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}return s(e,p)(r,t,d,n,V.test(e)),n}function Tt(){}var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((
 ?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n
 +65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){for(var t,n=[];t=this[e++];)n.push(t);return n}}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a>
 <div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&
 &e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length|
 |h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t
 ];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);for(r=e;r=r.parentNode;)s.unshift(r);for(r=t;r=r.parentNode;)l.unshift(r);for(;s[i]===l[i];)i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "
 +e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e
 ){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u
 ){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(p=t;p=p[g];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];p=++d&&p&&p[g]||(f=d=0)||h.pop();)if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else for(;(p=++d&&p&&p[g]||(f=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++f||(v&&((p[x]||(p[x]={}))[e]=[N,f]),p!==t)););return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){r
 eturn r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e)
 {return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){for(var r
 =0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){for(t||(t=ft(e)),n=t.length;n--;)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o},i.pseudos.nth=i.pseudos.eq,i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,th
 is[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==type
 of e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack,b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.
 fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)
 }}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,
 "<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return t
 his},wrapInner:function(e){return this.each(b.isFunction(e)?function(t){b(this).wrapInner(e.call(this,t))}:function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function
 (e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&b.cleanData(Ot(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)}
 ,null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"glo
 balEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}}),b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){for(var n,r=0,i=[],o=b(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}}),b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&
 &Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){for(s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];i--;)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody)for(o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;i--;)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(b.merge(d,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));for(s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;o=d[h++];)if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),
 "script"),a&&Mt(s),n))for(i=0;o=s[i++];)kt.test(o.type||"")&&n.push(o);return s=null,f},cleanData:function(e,t){for(var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;
 i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.sup
 port.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=fu
 nction(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),
 ""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:i
 nput|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")},b.each("blur focus focusin focusout load resize scroll unload click dblclick moused
 own mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[],b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o
 =arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t
 ){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{}
 ,y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c)for(c={};t=Tn.exec(a);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&
 "string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(j
 n,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}}),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&
 &(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=
 a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.te
 xt=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}}),b.Tween=rr,rr.prototype={constructor:rr,init
 :function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.el
 em[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n
 )&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};re

<TRUNCATED>

[03/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/users/users-feed-controller.js
----------------------------------------------------------------------
diff --git a/portal/js/users/users-feed-controller.js b/portal/js/users/users-feed-controller.js
new file mode 100644
index 0000000..1f1c4a5
--- /dev/null
+++ b/portal/js/users/users-feed-controller.js
@@ -0,0 +1,29 @@
+'use strict'
+
+AppServices.Controllers.controller('UsersFeedCtrl', ['ug', '$scope', '$rootScope', '$location',
+  function (ug, $scope, $rootScope, $location) {
+
+    $scope.activitiesSelected = 'active';
+    $scope.activityToAdd = '';
+    $scope.activities = [];
+    $scope.newActivity = {};
+    var getFeed = function(){
+      ug.getEntityActivities($rootScope.selectedUser,true);
+    };
+
+    if (!$rootScope.selectedUser) {
+      $location.path('/users');
+      return;
+    } else {
+      getFeed();
+    }
+
+    $scope.$on('users-feed-error',function(){
+      $rootScope.$broadcast('alert', 'error', 'could not create activity');
+    });
+    $scope.$on('users-feed-received',function(evt,entities){
+      $scope.activities = entities;
+      $scope.applyScope();
+    });
+
+  }]);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/users/users-feed.html
----------------------------------------------------------------------
diff --git a/portal/js/users/users-feed.html b/portal/js/users/users-feed.html
new file mode 100644
index 0000000..5968746
--- /dev/null
+++ b/portal/js/users/users-feed.html
@@ -0,0 +1,27 @@
+<div class="content-page" ng-controller="UsersFeedCtrl" >
+
+    <div ng:include="'users/users-tabs.html'"></div>
+    <br>
+    <div>
+        <table class="table table-striped">
+            <tbody>
+            <tr class="table-header">
+                <td>Date</td>
+                <td>User</td>
+                <td>Content</td>
+                <td>Verb</td>
+                <td>UUID</td>
+            </tr>
+            <tr class="zebraRows" ng-repeat="activity in activities">
+                <td>{{activity.createdDate}}</td>
+                <td>{{activity.actor.displayName}}</td>
+                <td>{{activity.content}}</td>
+                <td>{{activity.verb}}</td>
+                <td>{{activity.uuid}}</td>
+            </tr>
+            </tbody>
+        </table>
+    </div>
+
+
+</div>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/js/users/users.html
----------------------------------------------------------------------
diff --git a/portal/js/users/users.html b/portal/js/users/users.html
index ad53edc..6078c82 100644
--- a/portal/js/users/users.html
+++ b/portal/js/users/users.html
@@ -107,6 +107,7 @@
           <li class="tab" ng-class="currentUsersPage.route === '/users/profile' ? 'selected' : ''"><a class="btn btn-primary toolbar" ng-click="selectUserPage('/users/profile')"><i class="pictogram">&#59170;</i>Profile</a></li>
           <li class="tab" ng-class="currentUsersPage.route === '/users/groups' ? 'selected' : ''"><a class="btn btn-primary toolbar" ng-click="selectUserPage('/users/groups')"><i class="pictogram">&#128101;</i>Groups</a></li>
           <li class="tab" ng-class="currentUsersPage.route === '/users/activities' ? 'selected' : ''"><a class="btn btn-primary toolbar" ng-click="selectUserPage('/users/activities')"><i class="pictogram">&#59194;</i>Activities</a></li>
+          <li class="tab" ng-class="currentUsersPage.route === '/users/feed' ? 'selected' : ''"><a class="btn btn-primary toolbar" ng-click="selectUserPage('/users/feed')"><i class="pictogram">&#128196;</i>Feed</a></li>
           <li class="tab" ng-class="currentUsersPage.route === '/users/graph' ? 'selected' : ''"><a class="btn btn-primary toolbar" ng-click="selectUserPage('/users/graph')"><i class="pictogram">&#9729;</i>Graph</a></li>
           <li class="tab" ng-class="currentUsersPage.route === '/users/roles' ? 'selected' : ''"><a class="btn btn-primary toolbar" ng-click="selectUserPage('/users/roles')"><i class="pictogram">&#127758;</i>Roles &amp; Permissions</a></li>
         </ul>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf075e6c/portal/package.json
----------------------------------------------------------------------
diff --git a/portal/package.json b/portal/package.json
index ca5b409..a54ded3 100644
--- a/portal/package.json
+++ b/portal/package.json
@@ -1,6 +1,6 @@
 {
   "name": "apigee-usergrid",
-  "version": "2.0.34",
+  "version": "2.0.36",
   "packageName": "appsvc-ui",
   "description": "full apigee portal",
   "main": "./scripts/web-server.js",
@@ -36,7 +36,8 @@
     "grunt-contrib-clean": "~0.5.0",
     "grunt-dom-munger": "~3.1.0",
     "bower": "~1.2.8",
-    "grunt-bower-task": "~0.3.4"
+    "grunt-bower-task": "~0.3.4",
+    "grunt-s3": "~0.2.0-alpha.3"
   },
   "engines": {
     "node": ">=0.10.21"


[10/55] [abbrv] USERGRID-86: Remove restriction on 10 apps in the portal, add build files

Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44805da2/portal/js/usergrid.min.js
----------------------------------------------------------------------
diff --git a/portal/js/usergrid.min.js b/portal/js/usergrid.min.js
index 4c7e347..7dabf61 100644
--- a/portal/js/usergrid.min.js
+++ b/portal/js/usergrid.min.js
@@ -1,4 +1,4 @@
-/*! apigee-usergrid@2.0.36 2014-03-06 */
+/*! apigee-usergrid@1.0.2 2014-03-06 */
 !function(exports,global){function renderChart(chartsDefaults,chartdata){var newSettings={};$.extend(!0,newSettings,chartsDefaults,chartdata);new Highcharts.Chart(newSettings)}function menuBindClick(scope,lElement,cevent,menuContext){var currentSelection=angular.element(cevent.srcElement).parent(),previousSelection=scope[menuContext];previousSelection!==currentSelection&&(previousSelection&&angular.element(previousSelection).removeClass("active"),scope[menuContext]=currentSelection,scope.$apply(function(){currentSelection.addClass("active")}))}global["true"]=exports;var polyfills=function(window,Object){window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)}}(),Object.defineProperty(Object.prototype,"clone",{enumerable:!1,writable:!0,value:function(){var i,newObj=this instanceof Arra
 y?[]:{};for(i in this)"clone"!==i&&(newObj[i]=this[i]&&"object"==typeof this[i]?this[i].clone():this[i]);return newObj}}),Object.defineProperty(Object.prototype,"stringifyJSON",{enumerable:!1,writable:!0,value:function(){return JSON.stringify(this,null,"	")}})};polyfills(window,Object);var AppServices=AppServices||{};global.AppServices=global.AppServices||AppServices,AppServices.Constants=angular.module("appservices.constants",[]),AppServices.Services=angular.module("appservices.services",[]),AppServices.Controllers=angular.module("appservices.controllers",[]),AppServices.Filters=angular.module("appservices.filters",[]),AppServices.Directives=angular.module("appservices.directives",[]),AppServices.Performance=angular.module("appservices.performance",[]),AppServices.Push=angular.module("appservices.push",[]),angular.module("appservices",["ngRoute","ngResource","ngSanitize","ui.bootstrap","angulartics","angulartics.google.analytics","appservices.filters","appservices.services","appser
 vices.directives","appservices.constants","appservices.controllers","appservices.performance","appservices.push"]).config(["$routeProvider","$locationProvider","$sceDelegateProvider","$analyticsProvider",function($routeProvider,$locationProvider,$sceDelegateProvider,$analyticsProvider){$routeProvider.when("/org-overview",{templateUrl:"org-overview/org-overview.html",controller:"OrgOverviewCtrl"}).when("/login",{templateUrl:"login/login.html",controller:"LoginCtrl"}).when("/login/loading",{templateUrl:"login/loading.html",controller:"LoginCtrl"}).when("/app-overview/summary",{templateUrl:"app-overview/app-overview.html",controller:"AppOverviewCtrl"}).when("/getting-started/setup",{templateUrl:"app-overview/getting-started.html",controller:"GettingStartedCtrl"}).when("/forgot-password",{templateUrl:"login/forgot-password.html",controller:"ForgotPasswordCtrl"}).when("/register",{templateUrl:"login/register.html",controller:"RegisterCtrl"}).when("/users",{templateUrl:"users/users.html",
 controller:"UsersCtrl"}).when("/users/profile",{templateUrl:"users/users-profile.html",controller:"UsersProfileCtrl"}).when("/users/groups",{templateUrl:"users/users-groups.html",controller:"UsersGroupsCtrl"}).when("/users/activities",{templateUrl:"users/users-activities.html",controller:"UsersActivitiesCtrl"}).when("/users/feed",{templateUrl:"users/users-feed.html",controller:"UsersFeedCtrl"}).when("/users/graph",{templateUrl:"users/users-graph.html",controller:"UsersGraphCtrl"}).when("/users/roles",{templateUrl:"users/users-roles.html",controller:"UsersRolesCtrl"}).when("/groups",{templateUrl:"groups/groups.html",controller:"GroupsCtrl"}).when("/groups/details",{templateUrl:"groups/groups-details.html",controller:"GroupsDetailsCtrl"}).when("/groups/members",{templateUrl:"groups/groups-members.html",controller:"GroupsMembersCtrl"}).when("/groups/activities",{templateUrl:"groups/groups-activities.html",controller:"GroupsActivitiesCtrl"}).when("/groups/roles",{templateUrl:"groups/gro
 ups-roles.html",controller:"GroupsRolesCtrl"}).when("/roles",{templateUrl:"roles/roles.html",controller:"RolesCtrl"}).when("/roles/settings",{templateUrl:"roles/roles-settings.html",controller:"RolesSettingsCtrl"}).when("/roles/users",{templateUrl:"roles/roles-users.html",controller:"RolesUsersCtrl"}).when("/roles/groups",{templateUrl:"roles/roles-groups.html",controller:"RolesGroupsCtrl"}).when("/data",{templateUrl:"data/data.html",controller:"DataCtrl"}).when("/data/entity",{templateUrl:"data/entity.html",controller:"EntityCtrl"}).when("/data/shell",{templateUrl:"data/shell.html",controller:"ShellCtrl"}).when("/profile/organizations",{templateUrl:"profile/organizations.html",controller:"OrgCtrl"}).when("/profile/profile",{templateUrl:"profile/profile.html",controller:"ProfileCtrl"}).when("/profile",{templateUrl:"profile/account.html",controller:"AccountCtrl"}).when("/activities",{templateUrl:"activities/activities.html",controller:"ActivitiesCtrl"}).when("/shell",{templateUrl:"she
 ll/shell.html",controller:"ShellCtrl"}).when("/logout",{templateUrl:"login/logout.html",controller:"LogoutCtrl"}).otherwise({redirectTo:"/org-overview"}),$locationProvider.html5Mode(!1).hashPrefix("!"),$sceDelegateProvider.resourceUrlWhitelist(["self","http://apigee-internal-prod.jupiter.apigee.net/**","http://apigee-internal-prod.mars.apigee.net/**","https://appservices.apigee.com/**","https://api.usergrid.com/**"]),$analyticsProvider.virtualPageviews(!1),$analyticsProvider.firstPageview(!1)}]),AppServices.Controllers.controller("ActivitiesCtrl",["ug","$scope","$rootScope","$location","$route",function(ug,$scope,$rootScope){$scope.$on("app-activities-received",function(evt,data){$scope.activities=data,$scope.$apply()}),$scope.$on("app-activities-error",function(){$rootScope.$broadcast("alert","error","Application failed to retreive activities data.")}),ug.getActivities()}]),AppServices.Controllers.controller("AppOverviewCtrl",["ug","charts","$scope","$rootScope","$log",function(ug,
 charts,$scope,$rootScope,$log){var createGradient=function(color1,color2){var perShapeGradient={x1:0,y1:0,x2:0,y2:1};return{linearGradient:perShapeGradient,stops:[[0,color1],[1,color2]]}};$scope.appOverview={},$scope.collections=[],$scope.graph="",$scope.$on("top-collections-received",function(event,collections){var dataDescription={bar1:{labels:["Total"],dataAttr:["title","count"],colors:[createGradient("rgba(36,151,212,0.6)","rgba(119,198,240,0.6)")],borderColor:"#1b97d1"}};$scope.collections=collections;var arr=[];for(var i in collections)collections.hasOwnProperty(i)&&arr.push(collections[i]);$scope.appOverview={},$rootScope.chartTemplate?($scope.appOverview.chart=angular.copy($rootScope.chartTemplate.pareto),$scope.appOverview.chart=charts.convertParetoChart(arr,$scope.appOverview.chart,dataDescription.bar1,"1h","NOW"),$scope.applyScope()):ug.httpGet(null,"js/charts/highcharts.json").then(function(success){$rootScope.chartTemplate=success,$scope.appOverview.chart=angular.copy($
 rootScope.chartTemplate.pareto),$scope.appOverview.chart=charts.convertParetoChart(arr,$scope.appOverview.chart,dataDescription.bar1,"1h","NOW"),$scope.applyScope()},function(fail){$log.error("Problem getting chart template",fail)})}),$scope.$on("app-initialized",function(){ug.getTopCollections()}),$rootScope.activeUI&&ug.getTopCollections()}]),AppServices.Controllers.controller("GettingStartedCtrl",["ug","$scope","$rootScope","$location","$timeout","$anchorScroll",function(ug,$scope,$rootScope,$location,$timeout,$anchorScroll){$scope.collections=[],$scope.graph="",$scope.clientID="",$scope.clientSecret="";$scope.regenerateCredentialsDialog=function(modalId){$scope.orgAPICredentials={client_id:"regenerating...",client_secret:"regenerating..."},ug.regenerateAppCredentials(),$scope.hideModal(modalId)},$scope.$on("app-creds-updated",function(event,credentials){credentials?($scope.clientID=credentials.client_id,$scope.clientSecret=credentials.client_secret,$scope.$$phase||$scope.$apply(
 )):setTimeout(function(){ug.getAppCredentials()},5e3)}),ug.getAppCredentials(),$scope.contentTitle,$scope.showSDKDetail=function(name){var introContainer=document.getElementById("intro-container");if("nocontent"===name)return introContainer.style.height="0",!0;introContainer.style.opacity=.1,introContainer.style.height="0";var timeout=0;$scope.contentTitle&&(timeout=500),$timeout(function(){introContainer.style.height="1000px",introContainer.style.opacity=1},timeout),$scope.optionName=name,$scope.contentTitle=name,$scope.sdkLink="http://apigee.com/docs/content/"+name+"-sdk-redirect",$scope.docsLink="http://apigee.com/docs/app-services/content/installing-apigee-sdk-"+name,$scope.getIncludeURL=function(){return"app-overview/doc-includes/"+$scope.optionName+".html"}},$scope.scrollToElement=function(elem){return $location.hash(elem),$anchorScroll(),!1}}]),AppServices.Controllers.controller("ChartCtrl",["$scope","$location",function(){}]),AppServices.Directives.directive("chart",function
 (){return{restrict:"E",scope:{chartdata:"=chartdata"},template:"<div></div>",replace:!0,controller:function(){},link:function(scope,element,attrs){scope.$watch("chartdata",function(chartdata){if(chartdata){var chartsDefaults={chart:{renderTo:element[0],type:attrs.type||null,height:attrs.height||null,width:attrs.width||null,reflow:!0,animation:!1,zoomType:"x"}};if("pie"===attrs.type&&(chartsDefaults.chart.margin=[0,0,0,0],chartsDefaults.chart.spacingLeft=0,chartsDefaults.chart.spacingRight=0,chartsDefaults.chart.spacingTop=0,chartsDefaults.chart.spacingBottom=0,attrs.titleimage&&(chartdata.title.text='<img src="'+attrs.titleimage+'">'),attrs.titleicon&&(chartdata.title.text='<i class="pictogram '+attrs.titleiconclass+'">'+attrs.titleicon+"</i>"),attrs.titlecolor&&(chartdata.title.style.color=attrs.titlecolor),attrs.titleimagetop&&(chartdata.title.style.marginTop=attrs.titleimagetop),attrs.titleimageleft&&(chartdata.title.style.marginLeft=attrs.titleimageleft)),"line"===attrs.type&&(c
 hartsDefaults.chart.marginTop=30,chartsDefaults.chart.spacingTop=50),"column"===attrs.type&&(chartsDefaults.chart.marginBottom=80),"area"===attrs.type&&(chartsDefaults.chart.spacingLeft=0,chartsDefaults.chart.spacingRight=0,chartsDefaults.chart.marginLeft=0,chartsDefaults.chart.marginRight=0),Highcharts.setOptions({global:{useUTC:!1},chart:{style:{fontFamily:"marquette-light, Helvetica, Arial, sans-serif"}}}),"line"===attrs.type){var xAxis1=chartdata.xAxis[0];xAxis1.labels.formatter||(xAxis1.labels.formatter=new Function(attrs.xaxislabel)),xAxis1.labels.step||(xAxis1.labels.step=attrs.xaxisstep)}chartdata.tooltip&&"string"==typeof chartdata.tooltip.formatter&&(chartdata.tooltip.formatter=new Function(chartdata.tooltip.formatter)),renderChart(chartsDefaults,chartdata)}},!0)}}}),AppServices.Services.factory("charts",function(){function sortJsonArrayByProperty(objArray,prop){if(arguments.length<2)throw new Error("sortJsonArrayByProp requires 2 arguments");var direct=arguments.length>2?
 arguments[2]:1;if(objArray&&objArray.constructor===Array){var propPath=prop.constructor===Array?prop:prop.split(".");objArray.sort(function(a,b){for(var p in propPath)a[propPath[p]]&&b[propPath[p]]&&(a=a[propPath[p]],b=b[propPath[p]]);return a=a.match(/^\d+$/)?+a:a,b=b.match(/^\d+$/)?+b:b,b>a?-1*direct:a>b?1*direct:0})}}var lineChart,areaChart,paretoChart,pieChart,xaxis,seriesIndex;return{convertLineChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function plotData(counter,dPLength,dataPoints,dataAttrs,detailedView){for(var i=0;dPLength>i;i++)for(var dp=dataPoints[i],localCounter=counter,j=0;j<dataAttrs.length;j++)lineChart.series[localCounter].data.push("undefined"==typeof dp?[i,0]:[i,dp[dataAttrs[j]]]),detailedView||localCounter++}lineChart=chartTemplate,"undefined"==typeof chartData[0]&&(chartData[0]={},chartData[0].datapoints=[]);var label,dataPoints=chartData[0].datapoints,dPLength=dataPoints.length;"YESTERDAY"===currentCompare?(seriesIndex=dataDe
 scription.dataAttr.length,label="Yesterday "):"LAST_WEEK"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Last Week "):(lineChart=chartTemplate,seriesIndex=0,lineChart.series=[],label=""),xaxis=lineChart.xAxis[0],xaxis.categories=[],settings.xaxisformat&&(xaxis.labels.formatter=new Function(settings.xaxisformat)),settings.step&&(xaxis.labels.step=settings.step);for(var i=0;dPLength>i;i++){var dp=dataPoints[i];xaxis.categories.push(dp.timestamp)}if(chartData.length>1)for(var l=0;l<chartData.length;l++)chartData[l].chartGroupName&&(dataPoints=chartData[l].datapoints,lineChart.series[l]={},lineChart.series[l].data=[],lineChart.series[l].name=chartData[l].chartGroupName,lineChart.series[l].yAxis=0,lineChart.series[l].type="line",lineChart.series[l].color=dataDescription.colors[i],lineChart.series[l].dashStyle="solid",lineChart.series[l].yAxis.title.text=dataDescription.yAxisLabels,plotData(l,dPLength,dataPoints,dataDescription.detailDataAttr,!0));else{for(var steady
 Counter=0,i=seriesIndex;i<dataDescription.dataAttr.length+(seriesIndex>0?seriesIndex:0);i++){var yAxisIndex=dataDescription.multiAxis?steadyCounter:0;lineChart.series[i]={},lineChart.series[i].data=[],lineChart.series[i].name=label+dataDescription.labels[steadyCounter],lineChart.series[i].yAxis=yAxisIndex,lineChart.series[i].type="line",lineChart.series[i].color=dataDescription.colors[i],lineChart.series[i].dashStyle="solid",lineChart.yAxis[yAxisIndex].title.text=dataDescription.yAxisLabels[dataDescription.yAxisLabels>1?steadyCounter:0],steadyCounter++}plotData(seriesIndex,dPLength,dataPoints,dataDescription.dataAttr,!1)}return lineChart},convertAreaChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function plotData(counter,dPLength,dataPoints,dataAttrs,detailedView){for(var i=0;dPLength>i;i++)for(var dp=dataPoints[i],localCounter=counter,j=0;j<dataAttrs.length;j++)areaChart.series[localCounter].data.push("undefined"==typeof dp?0:dp[dataAttrs[j]]),detai
 ledView||localCounter++}areaChart=angular.copy(areaChart),"undefined"==typeof chartData[0]&&(chartData[0]={},chartData[0].datapoints=[]);var label,dataPoints=chartData[0].datapoints,dPLength=dataPoints.length;"YESTERDAY"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Yesterday "):"LAST_WEEK"===currentCompare?(seriesIndex=dataDescription.dataAttr.length,label="Last Week "):(areaChart=chartTemplate,seriesIndex=0,areaChart.series=[],label=""),xaxis=areaChart.xAxis[0],xaxis.categories=[],settings.xaxisformat&&(xaxis.labels.formatter=new Function(settings.xaxisformat)),settings.step&&(xaxis.labels.step=settings.step);for(var i=0;dPLength>i;i++){var dp=dataPoints[i];xaxis.categories.push(dp.timestamp)}if(chartData.length>1)for(var l=0;l<chartData.length;l++)chartData[l].chartGroupName&&(dataPoints=chartData[l].datapoints,areaChart.series[l]={},areaChart.series[l].data=[],areaChart.series[l].fillColor=dataDescription.areaColors[l],areaChart.series[l].name=chartData[l]
 .chartGroupName,areaChart.series[l].yAxis=0,areaChart.series[l].type="area",areaChart.series[l].pointInterval=1,areaChart.series[l].color=dataDescription.colors[l],areaChart.series[l].dashStyle="solid",areaChart.series[l].yAxis.title.text=dataDescription.yAxisLabels,plotData(l,dPLength,dataPoints,dataDescription.detailDataAttr,!0));else{for(var steadyCounter=0,i=seriesIndex;i<dataDescription.dataAttr.length+(seriesIndex>0?seriesIndex:0);i++){var yAxisIndex=dataDescription.multiAxis?steadyCounter:0;areaChart.series[i]={},areaChart.series[i].data=[],areaChart.series[i].fillColor=dataDescription.areaColors[i],areaChart.series[i].name=label+dataDescription.labels[steadyCounter],areaChart.series[i].yAxis=yAxisIndex,areaChart.series[i].type="area",areaChart.series[i].pointInterval=1,areaChart.series[i].color=dataDescription.colors[i],areaChart.series[i].dashStyle="solid",areaChart.yAxis[yAxisIndex].title.text=dataDescription.yAxisLabels[dataDescription.yAxisLabels>1?steadyCounter:0],stead
 yCounter++}plotData(seriesIndex,dPLength,dataPoints,dataDescription.dataAttr,!1)}return areaChart},convertParetoChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){function getPreviousData(){for(var i=0;i<chartTemplate.series[0].data.length;i++)allParetoOptions.push(chartTemplate.xAxis.categories[i])}function createStackedBar(dataDescription,paretoChart){paretoChart.plotOptions={series:{shadow:!1,borderColor:dataDescription.borderColor,borderWidth:1},column:{stacking:"normal",dataLabels:{enabled:!0,color:Highcharts.theme&&Highcharts.theme.dataLabelsColor||"white"}}};var start=dataDescription.dataAttr[1].length,steadyCounter=0;compare&&(paretoChart.legend.enabled=!0);for(var f=seriesIndex;start+seriesIndex>f;f++)paretoChart.series[f]||(paretoChart.series[f]={data:[]}),paretoChart.series[f].data.push(bar[dataDescription.dataAttr[1][steadyCounter]]),paretoChart.series[f].name=""!==label?label+" "+dataDescription.labels[steadyCounter]:dataDescription.labels[s
 teadyCounter],paretoChart.series[f].color=dataDescription.colors[f],paretoChart.series[f].stack=label,steadyCounter++}paretoChart=chartTemplate,"undefined"==typeof chartData&&(chartData=[]);var label,cdLength=chartData.length,compare=!1,allParetoOptions=[],stackedBar=!1;if(seriesIndex=0,"object"==typeof dataDescription.dataAttr[1]&&(stackedBar=!0),"YESTERDAY"===currentCompare?(label="Yesterday ",compare=!0,stackedBar&&(seriesIndex=dataDescription.dataAttr[1].length),getPreviousData()):"LAST_WEEK"===currentCompare?(label="Last Week ",compare=!0,stackedBar&&(seriesIndex=dataDescription.dataAttr[1].length),seriesIndex=getPreviousData()):(compare=!1,label="",paretoChart.xAxis.categories=[],paretoChart.series=[],paretoChart.series[0]={},paretoChart.series[0].data=[],paretoChart.legend.enabled=!1),paretoChart.plotOptions.series.borderColor=dataDescription.borderColor,compare&&!stackedBar){paretoChart.series[1]={},paretoChart.series[1].data=[];for(var i=0;i<allParetoOptions.length;i++)pare
 toChart.series[1].data.push(0);paretoChart.legend.enabled=!0}for(var i=0;cdLength>i;i++){var bar=chartData[i];if(compare){var newLabel=bar[dataDescription.dataAttr[0]],newValue=bar[dataDescription.dataAttr[1]],previousIndex=allParetoOptions.indexOf(newLabel);previousIndex>-1&&("object"==typeof dataDescription.dataAttr[1]?createStackedBar(dataDescription,paretoChart,paretoChart.series.length):(paretoChart.series[1].data[previousIndex]=newValue,paretoChart.series[1].name=""!==label?label+" "+dataDescription.labels[0]:dataDescription.labels[0],paretoChart.series[1].color=dataDescription.colors[1]))}else paretoChart.xAxis.categories.push(bar[dataDescription.dataAttr[0]]),"object"==typeof dataDescription.dataAttr[1]?createStackedBar(dataDescription,paretoChart,paretoChart.series.length):(paretoChart.series[0].data.push(bar[dataDescription.dataAttr[1]]),paretoChart.series[0].name=dataDescription.labels[0],paretoChart.series[0].color=dataDescription.colors[0])}return paretoChart},convertPi
 eChart:function(chartData,chartTemplate,dataDescription,settings,currentCompare){var label,cdLength=chartData.length,compare=!1;pieChart=chartTemplate,"YESTERDAY"===currentCompare?(label="Yesterday ",compare=!1):"LAST_WEEK"===currentCompare?(label="Last Week ",compare=!1):(compare=!1,pieChart.series[0].data=[],pieChart.series[0].dataLabels&&"string"==typeof pieChart.series[0].dataLabels.formatter&&(pieChart.series[0].dataLabels.formatter=new Function(pieChart.series[0].dataLabels.formatter))),pieChart.plotOptions.pie.borderColor=dataDescription.borderColor,compare&&(pieChart.series[1].data=[],pieChart.series[1].dataLabels&&"string"==typeof pieChart.series[1].dataLabels.formatter&&(pieChart.series[1].dataLabels.formatter=new Function(pieChart.series[1].dataLabels.formatter)));for(var tempArray=[],i=0;cdLength>i;i++){var pie=chartData[i];tempArray.push({name:pie[dataDescription.dataAttr[0]],y:pie[dataDescription.dataAttr[1]],color:""})}sortJsonArrayByProperty(tempArray,"name");for(var
  i=0;i<tempArray.length;i++)tempArray[i].color=dataDescription.colors[i];return compare?pieChart.series[1].data=tempArray:pieChart.series[0].data=tempArray,pieChart}}}),$(".sessions-bar").sparkline([3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,4,3,5,6,3,4,5,6,7,8,1],{type:"bar",barColor:"#c5c5c5",width:"800px",height:100,barWidth:12,barSpacing:"1px"}),AppServices.Controllers.controller("DataCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope){var init=function(){$scope.verb="GET",$scope.display="",$scope.queryBodyDetail={},$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.entitySelected={},$scope.newCollection={},$rootScope.queryCollection={},$scope.data={},$scope.data.queryPath="",$scope.data.queryBody='{ "name":"value" }',$scope.data.searchString="",$scope.data.queryLimit=""},runQuery=function(verb){$scope.loading=!0;var queryPath=$scope.removeFirstSl
 ash($scope.data.queryPath||""),searchString=$scope.data.searchString||"",queryLimit=$scope.data.queryLimit||"",body=JSON.parse($scope.data.queryBody||"{}");"POST"==verb&&$scope.validateJson(!0)?ug.runDataPOSTQuery(queryPath,body):"PUT"==verb&&$scope.validateJson(!0)?ug.runDataPutQuery(queryPath,searchString,queryLimit,body):"DELETE"==verb?ug.runDataDeleteQuery(queryPath,searchString,queryLimit):ug.runDataQuery(queryPath,searchString,queryLimit)};$scope.$on("top-collections-received",function(event,collectionList){$scope.loading=!1;var ignoredCollections=["events"];ignoredCollections.forEach(function(ignoredCollection){collectionList.hasOwnProperty(ignoredCollection)&&delete collectionList[ignoredCollection]}),$scope.collectionList=collectionList,$scope.queryBoxesSelected=!1,$scope.queryPath||$scope.loadCollection("/"+collectionList[Object.keys(collectionList).sort()[0]].name),$scope.applyScope()}),$scope.$on("error-running-query",function(){$scope.loading=!1,runQuery("GET"),$scope.a
 pplyScope()}),$scope.$on("entity-deleted",function(){$scope.deleteLoading=!1,$rootScope.$broadcast("alert","success","Entities deleted sucessfully"),$scope.queryBoxesSelected=!1,$scope.checkNextPrev(),$scope.applyScope()}),$scope.$on("entity-deleted-error",function(){$scope.deleteLoading=!1,runQuery("GET"),$scope.applyScope()}),$scope.$on("collection-created",function(){$scope.newCollection.name=""}),$scope.$on("query-received",function(event,collection){$scope.loading=!1,$rootScope.queryCollection=collection,ug.getIndexes($scope.data.queryPath),$scope.setDisplayType(),$scope.checkNextPrev(),$scope.applyScope(),$scope.queryBoxesSelected=!1}),$scope.$on("indexes-received",function(event,indexes){}),$scope.$on("app-changed",function(){init()}),$scope.setDisplayType=function(){$scope.display="generic"},$scope.deleteEntitiesDialog=function(modalId){$scope.deleteLoading=!1,$scope.deleteEntities($rootScope.queryCollection,"entity-deleted","error deleting entity"),$scope.hideModal(modalId)
 },$scope.newCollectionDialog=function(modalId){$scope.newCollection.name?(ug.createCollection($scope.newCollection.name),ug.getTopCollections(),$rootScope.$broadcast("alert","success","Collection created successfully."),$scope.hideModal(modalId)):$rootScope.$broadcast("alert","error","You must specify a collection name.")},$scope.addToPath=function(uuid){$scope.data.queryPath="/"+$rootScope.queryCollection._type+"/"+uuid},$scope.isDeep=function(item){return"[object Object]"===Object.prototype.toString.call(item)},$scope.loadCollection=function(type){$scope.data.queryPath="/"+type.substring(1,type.length),$scope.data.searchString="",$scope.data.queryLimit="",$scope.data.body='{ "name":"value" }',$scope.selectGET(),$scope.applyScope(),$scope.run()},$scope.selectGET=function(){$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="GET"},$scope.selectPOST=function(){$scope.queryBodyDisplay="block",$scope.queryLimitDisplay="none",$s
 cope.queryStringDisplay="none",$scope.verb="POST"},$scope.selectPUT=function(){$scope.queryBodyDisplay="block",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="PUT"},$scope.selectDELETE=function(){$scope.queryBodyDisplay="none",$scope.queryLimitDisplay="block",$scope.queryStringDisplay="block",$scope.verb="DELETE"},$scope.validateJson=function(skipMessage){var queryBody=$scope.data.queryBody;try{queryBody=JSON.parse(queryBody)}catch(e){return $rootScope.$broadcast("alert","error","JSON is not valid"),!1}return queryBody=JSON.stringify(queryBody,null,2),!skipMessage&&$rootScope.$broadcast("alert","success","JSON is valid"),$scope.data.queryBody=queryBody,!0},$scope.saveEntity=function(entity){if(!$scope.validateJson())return!1;var queryBody=entity._json;queryBody=JSON.parse(queryBody),$rootScope.selectedEntity.set(),$rootScope.selectedEntity.set(queryBody),$rootScope.selectedEntity.set("type",entity._data.type),$rootScope.selectedEntity.set("uuid",entit
 y._data.uuid),$rootScope.selectedEntity.save(function(err,data){err?$rootScope.$broadcast("alert","error","error: "+data.error_description):$rootScope.$broadcast("alert","success","entity saved")})},$scope.run=function(){$rootScope.queryCollection="";var verb=$scope.verb;runQuery(verb)},$scope.hasProperty=function(prop){var retval=!1;return"undefined"!=typeof $rootScope.queryCollection._list&&angular.forEach($rootScope.queryCollection._list,function(value){retval||value._data[prop]&&(retval=!0)}),retval},$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$rootScope.queryCollection.hasPreviousPage()&&($scope.previous_display="default"),$rootScope.queryCollection.hasNextPage()&&($scope.next_display="default")},$scope.selectEntity=function(uuid){$rootScope.selectedEntity=$rootScope.queryCollection.getEntityByUUID(uuid),$scope.addToPath(uuid)},$scope.getJSONView=function(entity){var tempjson=e
 ntity.get(),queryBody=JSON.stringify(tempjson,null,2);queryBody=JSON.parse(queryBody),delete queryBody.metadata,delete queryBody.uuid,delete queryBody.created,delete queryBody.modified,delete queryBody.type,$scope.queryBody=JSON.stringify(queryBody,null,2)},$scope.getPrevious=function(){$rootScope.queryCollection.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of data"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.getNext=function(){$rootScope.queryCollection.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of data"),$scope.checkNextPrev(),$scope.applyScope()})},init(),$rootScope.queryCollection=$rootScope.queryCollection||{},$rootScope.selectedEntity={},$rootScope.queryCollection&&$rootScope.queryCollection._type&&($scope.loadCollection($rootScope.queryCollection._type),$scope.setDisplayType()),ug.getTopCollections(),$scope.resetNextPrev()}]),AppServices.Controllers.controller
 ("EntityCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){if(!$rootScope.selectedEntity)return void $location.path("/data");$scope.entityUUID=$rootScope.selectedEntity.get("uuid"),$scope.entityType=$rootScope.selectedEntity.get("type");var tempjson=$rootScope.selectedEntity.get(),queryBody=JSON.stringify(tempjson,null,2);queryBody=JSON.parse(queryBody),delete queryBody.metadata,delete queryBody.uuid,delete queryBody.created,delete queryBody.modified,delete queryBody.type,$scope.queryBody=JSON.stringify(queryBody,null,2),$scope.validateJson=function(){var queryBody=$scope.queryBody;try{queryBody=JSON.parse(queryBody)}catch(e){return $rootScope.$broadcast("alert","error","JSON is not valid"),!1}return queryBody=JSON.stringify(queryBody,null,2),$rootScope.$broadcast("alert","success","JSON is valid"),$scope.queryBody=queryBody,!0},$scope.saveEntity=function(){if(!$scope.validateJson())return!1;var queryBody=$scope.queryBody;queryBody=JSON.parse(quer
 yBody),$rootScope.selectedEntity.set(),$rootScope.selectedEntity.set(queryBody),$rootScope.selectedEntity.set("type",$scope.entityType),$rootScope.selectedEntity.set("uuid",$scope.entityUUID),$rootScope.selectedEntity.save(function(err,data){err?$rootScope.$broadcast("alert","error","error: "+data.error_description):$rootScope.$broadcast("alert","success","entity saved")})}}]),AppServices.Controllers.controller("ShellCtrl",["ug","$scope","$rootScope","$location",function(){}]),AppServices.Directives.directive("balloon",["$window","$timeout",function($window,$timeout){return{restrict:"ECA",scope:"=",template:'<div class="baloon {{direction}}" ng-transclude></div>',replace:!0,transclude:!0,link:function(scope,lElement,attrs){scope.direction=attrs.direction;var runScroll=!0,windowEl=angular.element($window);windowEl.on("scroll",function(){runScroll&&(lElement.addClass("fade-out"),$timeout(function(){lElement.addClass("hide")},1e3),runScroll=!1)})}}}]),AppServices.Directives.directive("
 bsmodal",["$rootScope",function($rootScope){return{restrict:"ECA",scope:{title:"@title",buttonid:"=buttonid",footertext:"=footertext",closelabel:"=closelabel"},transclude:!0,templateUrl:"dialogs/modal.html",replace:!0,link:function(scope,lElement,attrs,parentCtrl){scope.title=attrs.title,scope.footertext=attrs.footertext,scope.closelabel=attrs.closelabel,scope.close=attrs.close,scope.extrabutton=attrs.extrabutton,scope.extrabuttonlabel=attrs.extrabuttonlabel,scope.buttonId=attrs.buttonid,scope.closeDelegate=function(attr){scope.$parent[attr](attrs.id,scope)},scope.extraDelegate=function(attr){scope.dialogForm.$valid?(console.log(parentCtrl),scope.$parent[attr](attrs.id)):$rootScope.$broadcast("alert","error","Please check your form input and resubmit.")}}}}]),AppServices.Controllers.controller("AlertCtrl",["$scope","$rootScope","$timeout",function($scope,$rootScope,$timeout){$scope.alertDisplay="none",$scope.alerts=[],$scope.$on("alert",function(event,type,message,permanent){$scope.
 addAlert(type,message,permanent)}),$scope.$on("clear-alerts",function(){$scope.alerts=[]}),$scope.addAlert=function(type,message,permanent){$scope.alertDisplay="block",$scope.alerts.push({type:type,msg:message}),$scope.applyScope(),permanent||$timeout(function(){$scope.alerts.shift()},5e3)},$scope.closeAlert=function(index){$scope.alerts.splice(index,1)}}]),AppServices.Directives.directive("alerti",["$rootScope","$timeout",function($rootScope,$timeout){return{restrict:"ECA",scope:{type:"=type",closeable:"@closeable",index:"&index"},template:'<div class="alert" ng-class="type && \'alert-\' + type">    <button ng-show="closeable" type="button" class="close" ng-click="closeAlert(index)">&times;</button>    <i ng-if="type === \'warning\'" class="pictogram pull-left" style="font-size:3em;line-height:0.4">&#128165;</i>    <i ng-if="type === \'info\'" class="pictogram pull-left">&#8505;</i>    <i ng-if="type === \'error\'" class="pictogram pull-left">&#9889;</i>    <i ng-if="type === \'suc
 cess\'" class="pictogram pull-left">&#128077;</i><div ng-transclude></div></div>',replace:!0,transclude:!0,link:function(scope,lElement,attrs){$timeout(function(){lElement.addClass("fade-out")},4e3),lElement.click(function(){attrs.index&&scope.$parent.closeAlert(attrs.index)}),setTimeout(function(){lElement.addClass("alert-animate")},10)}}}]),AppServices.Directives.directive("appswitcher",["$rootScope",function(){return{restrict:"ECA",scope:"=",templateUrl:"global/appswitcher-template.html",replace:!0,transclude:!0,link:function(){function globalNavDetail(){$("#globalNavDetail > div").removeClass(classNameOpen),$("#globalNavDetailApiPlatform").addClass(classNameOpen)}var classNameOpen="open";$("ul.nav li.dropdownContainingSubmenu").hover(function(){$(this).addClass(classNameOpen)},function(){$(this).removeClass(classNameOpen)}),$("#globalNav > a").mouseover(globalNavDetail),$("#globalNavDetail").mouseover(globalNavDetail),$("#globalNavSubmenuContainer ul li").mouseover(function(){$(
 "#globalNavDetail > div").removeClass(classNameOpen),$("#"+this.getAttribute("data-globalNavDetail")).addClass(classNameOpen)
 })}}}]),AppServices.Directives.directive("insecureBanner",["$rootScope","ug",function($rootScope,ug){return{restrict:"E",transclude:!0,templateUrl:"global/insecure-banner.html",link:function(scope){scope.securityWarning=!1,scope.$on("roles-received",function(evt,roles){scope.securityWarning=!1,roles&&roles._list&&roles._list.forEach(function(roleHolder){var role=roleHolder._data;"GUEST"===role.name.toUpperCase()&&roleHolder.getPermissions(function(err){err||roleHolder.permissions&&roleHolder.permissions.forEach(function(permission){permission.path.indexOf("/**")>=0&&(scope.securityWarning=!0,scope.applyScope())})})})});var initialized=!1;scope.$on("app-initialized",function(){!initialized&&ug.getRoles(),initialized=!0}),scope.$on("app-changed",function(){scope.securityWarning=!1,ug.getRoles()})}}}]),AppServices.Constants.constant("configuration",{ITEMS_URL:"global/temp.json"}),AppServices.Controllers.controller("PageCtrl",["ug","utility","$scope","$rootScope","$location","$routePara
 ms","$q","$route","$log","$analytics",function(ug,utility,$scope,$rootScope,$location,$routeParams,$q,$route,$log,$analytics){var initScopeVariables=function(){$scope.loadingText="Loading...",$scope.use_sso=!1,$scope.newApp={name:""},$scope.getPerm="",$scope.postPerm="",$scope.putPerm="",$scope.deletePerm="",$scope.usersTypeaheadValues=[],$scope.groupsTypeaheadValues=[],$scope.rolesTypeaheadValues=[],$rootScope.sdkActive=!1,$rootScope.demoData=!1,$scope.queryStringApplied=!1,$rootScope.autoUpdateTimer=Usergrid.config?Usergrid.config.autoUpdateTimer:61,$rootScope.requiresDeveloperKey=Usergrid.config?Usergrid.config.client.requiresDeveloperKey:!1,$rootScope.loaded=$rootScope.activeUI=!1;for(var key in Usergrid.regex)$scope[key]=Usergrid.regex[key];$scope.options=Usergrid.options;var getQuery=function(){for(var m,result={},queryString=location.search.slice(1),re=/([^&=]+)=([^&]*)/g;m=re.exec(queryString);)result[decodeURIComponent(m[1])]=decodeURIComponent(m[2]);return result};$scope.q
 ueryString=getQuery()};initScopeVariables(),$rootScope.urls=function(){var urls=ug.getUrls();return $scope.apiUrl=urls.apiUrl,$scope.use_sso=urls.use_sso,urls},$rootScope.gotoPage=function(path){$location.path(path)};var notRegistration=function(){return"/forgot-password"!==$location.path()&&"/register"!==$location.path()},verifyUser=function(){"/login"!==$location.path().slice(0,"/login".length)&&($rootScope.currentPath=$location.path()),$routeParams.access_token&&$routeParams.admin_email&&$routeParams.uuid&&(ug.set("token",$routeParams.access_token),ug.set("email",$routeParams.admin_email),ug.set("uuid",$routeParams.uuid),$location.search("access_token",null),$location.search("admin_email",null),$location.search("uuid",null)),ug.checkAuthentication(!0)};$scope.profile=function(){$scope.use_sso?window.location=$rootScope.urls().PROFILE_URL+"?callback="+encodeURIComponent($location.absUrl()):$location.path("/profile")},$scope.showModal=function(id){$("#"+id).modal("show")},$scope.hi
 deModal=function(id){$("#"+id).modal("hide")},$scope.deleteEntities=function(collection,successBroadcast,errorMessage){collection.resetEntityPointer();for(var entitiesToDelete=[];collection.hasNextEntity();){var entity=collection.getNextEntity(),checked=entity.checked;checked&&entitiesToDelete.push(entity)}for(var count=0,success=!1,i=0;i<entitiesToDelete.length;i++){var entity=entitiesToDelete[i];collection.destroyEntity(entity,function(err){count++,err?($rootScope.$broadcast("alert","error",errorMessage),$rootScope.$broadcast(successBroadcast+"-error",err)):success=!0,count===entitiesToDelete.length&&(success&&$rootScope.$broadcast(successBroadcast),$scope.applyScope())})}},$scope.selectAllEntities=function(list,that,varName,setValue){varName=varName||"master";var val=that[varName];void 0==setValue&&(setValue=!0),setValue&&(that[varName]=val=!val),list.forEach(function(entitiy){entitiy.checked=val})},$scope.createPermission=function(type,entity,path,permissions){"/"!=path.charAt(0
 )&&(path="/"+path);var ops="",s="";permissions.getPerm&&(ops="get",s=","),permissions.postPerm&&(ops=ops+s+"post",s=","),permissions.putPerm&&(ops=ops+s+"put",s=","),permissions.deletePerm&&(ops=ops+s+"delete",s=",");var permission=ops+":"+path;return permission},$scope.formatDate=function(date){return new Date(date).toUTCString()},$scope.clearCheckbox=function(id){$("#"+id).attr("checked")&&$("#"+id).click()},$scope.removeFirstSlash=function(path){return 0===path.indexOf("/")?path.substring(1,path.length):path},$scope.applyScope=function(cb){return cb="function"==typeof cb?cb:function(){},this.$$phase?void cb():this.$apply(cb)},$scope.valueSelected=function(list){return list&&list.some(function(item){return item.checked})},$scope.sendHelp=function(modalId){ug.jsonpRaw("apigeeuihelpemail","",{useremail:$rootScope.userEmail}).then(function(){$rootScope.$broadcast("alert","success","Email sent. Our team will be in touch with you shortly.")},function(){$rootScope.$broadcast("alert","er
 ror","Problem Sending Email. Try sending an email to mobile@apigee.com.")}),$scope.hideModal(modalId)},$scope.$on("users-typeahead-received",function(event,users){$scope.usersTypeaheadValues=users,$scope.$$phase||$scope.$apply()}),$scope.$on("groups-typeahead-received",function(event,groups){$scope.groupsTypeaheadValues=groups,$scope.$$phase||$scope.$apply()}),$scope.$on("roles-typeahead-received",function(event,roles){$scope.rolesTypeaheadValues=roles,$scope.$$phase||$scope.$apply()}),$scope.$on("checkAuthentication-success",function(){sessionStorage.setItem("authenticateAttempts",0),$scope.loaded=!0,$rootScope.activeUI=!0,$scope.applyScope(),$scope.queryStringApplied||($scope.queryStringApplied=!0,setTimeout(function(){$scope.queryString.org&&$rootScope.$broadcast("change-org",$scope.queryString.org)},1e3)),$rootScope.$broadcast("app-initialized")}),$scope.$on("checkAuthentication-error",function(args,err,missingData,email){if($scope.loaded=!0,err&&!$scope.use_sso&&notRegistration
 ())ug.logout(),$location.path("/login"),$scope.applyScope();else if(missingData&&notRegistration()){if(!email&&$scope.use_sso)return void(window.location=$rootScope.urls().LOGIN_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0]));ug.reAuthenticate(email)}}),$scope.$on("reAuthenticate-success",function(args,err,data,user,organizations,applications){sessionStorage.setItem("authenticateAttempts",0),$rootScope.$broadcast("loginSuccesful",user,organizations,applications),$rootScope.$emit("loginSuccesful",user,organizations,applications),$rootScope.$broadcast("checkAuthentication-success"),$scope.applyScope(function(){$scope.deferredLogin.resolve(),$location.path("/org-overview")})});var authenticateAttempts=parseInt(sessionStorage.getItem("authenticateAttempts")||0);$scope.$on("reAuthenticate-error",function(){if($scope.use_sso){if(authenticateAttempts++>5)return void $rootScope.$broadcast("alert","error","There is an issue with authentication. Please contact support."
 );console.error("Failed to login via sso "+authenticateAttempts),sessionStorage.setItem("authenticateAttempts",authenticateAttempts),window.location=$rootScope.urls().LOGIN_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0])}else notRegistration()&&(ug.logout(),$location.path("/login"),$scope.applyScope())}),$scope.$on("loginSuccessful",function(){$rootScope.activeUI=!0}),$scope.$on("app-changed",function(args,oldVal,newVal,preventReload){newVal===oldVal||preventReload||$route.reload()}),$scope.$on("org-changed",function(){ug.getApplications(),$route.reload()}),$scope.$on("app-settings-received",function(){}),$scope.$on("request-times-slow",function(){$rootScope.$broadcast("alert","info","We are experiencing performance issues on our server.  Please click Get Help for support if this continues.")});var lastPage="";$scope.$on("$routeChangeSuccess",function(){verifyUser(),$scope.showDemoBar="/performance"===$location.path().slice(0,"/performance".length),$scope.showD
 emoBar||($rootScope.demoData=!1),setTimeout(function(){lastPage=""},50);var path=window.location.pathname.replace("index-debug.html","");""===lastPage&&$analytics.pageTrack((path+$location.path()).replace("//","/")),lastPage=$location.path()}),$scope.$on("applications-received",function(event,applications){$scope.applications=applications,$scope.hasApplications=Object.keys(applications).length>0}),ug.getAppSettings()}]),AppServices.Directives.directive("pageTitle",["$rootScope","data",function($rootScope,data){return{restrict:"ECA",scope:{},transclude:!0,templateUrl:"global/page-title.html",replace:!0,link:function(scope,lElement,attrs){scope.title=attrs.title,scope.icon=attrs.icon,scope.showHelp=function(){$("#need-help").modal("show")},scope.sendHelp=function(){data.jsonp_raw("apigeeuihelpemail","",{useremail:$rootScope.userEmail}).then(function(){$rootScope.$broadcast("alert","success","Email sent. Our team will be in touch with you shortly.")},function(){$rootScope.$broadcast("a
 lert","error","Problem Sending Email. Try sending an email to mobile@apigee.com.")}),$("#need-help").modal("hide")}}}}]),AppServices.Services.factory("ug",function(configuration,$rootScope,utility,$q,$http,$resource,$log,$analytics,$location){function reportError(data,config){try{$analytics.eventTrack("error",{category:"App Services",label:data+":"+config.url+":"+(sessionStorage.apigee_uuid||"na")})}catch(e){console.log(e)}}var requestTimes=[],running=!1,currentRequests={},getAccessToken=function(){return sessionStorage.getItem("accessToken")};return{get:function(prop,isObject){return isObject?this.client().getObject(prop):this.client().get(prop)},set:function(prop,value){this.client().set(prop,value)},getUrls:function(){var host=$location.host(),qs=$location.search(),BASE_URL="",DATA_URL="",use_sso=!1;switch(!0){case"appservices.apigee.com"===host&&location.pathname.indexOf("/dit")>=0:BASE_URL="https://accounts.jupiter.apigee.net",DATA_URL="http://apigee-internal-prod.jupiter.apige
 e.net",use_sso=!0;break;case"appservices.apigee.com"===host&&location.pathname.indexOf("/mars")>=0:BASE_URL="https://accounts.mars.apigee.net",DATA_URL="http://apigee-internal-prod.mars.apigee.net",use_sso=!0;break;case"appservices.apigee.com"===host:DATA_URL=Usergrid.overrideUrl;break;case"apigee.com"===host:BASE_URL="https://accounts.apigee.com",DATA_URL="https://api.usergrid.com",use_sso=!0;break;case"usergrid.dev"===host:DATA_URL="https://api.usergrid.com";break;default:DATA_URL=Usergrid.overrideUrl}return DATA_URL=qs.api_url||DATA_URL,DATA_URL=DATA_URL.lastIndexOf("/")===DATA_URL.length-1?DATA_URL.substring(0,DATA_URL.length-1):DATA_URL,{DATA_URL:DATA_URL,LOGIN_URL:BASE_URL+"/accounts/sign_in",PROFILE_URL:BASE_URL+"/accounts/my_account",LOGOUT_URL:BASE_URL+"/accounts/sign_out",apiUrl:DATA_URL,use_sso:use_sso}},orgLogin:function(username,password){var self=this;this.client().set("email",username),this.client().set("token",null),this.client().orgLogin(username,password,function(e
 rr,data,user,organizations,applications){err?$rootScope.$broadcast("loginFailed",err,data):self.initializeCurrentUser(function(){$rootScope.$broadcast("loginSuccesful",user,organizations,applications)})})},checkAuthentication:function(force){var ug=this,client=ug.client(),initialize=function(){ug.initializeCurrentUser(function(){$rootScope.userEmail=client.get("email"),$rootScope.organizations=client.getObject("organizations"),$rootScope.applications=client.getObject("applications"),$rootScope.currentOrg=client.get("orgName"),$rootScope.currentApp=client.get("appName");var key,size=0;for(key in $rootScope.applications)$rootScope.applications.hasOwnProperty(key)&&size++;$rootScope.$broadcast("checkAuthentication-success",client.getObject("organizations"),client.getObject("applications"),client.get("orgName"),client.get("appName"),client.get("email"))})},isAuthenticated=function(){var authenticated=null!==client.get("token")&&null!==client.get("organizations");return authenticated&&in
 itialize(),authenticated};if(!isAuthenticated()||force){if(!client.get("token"))return $rootScope.$broadcast("checkAuthentication-error","no token",{},client.get("email"));this.client().reAuthenticateLite(function(err){var missingData=err||!client.get("orgName")||!client.get("appName")||!client.getObject("organizations")||!client.getObject("applications"),email=client.get("email");err||missingData?$rootScope.$broadcast("checkAuthentication-error",err,missingData,email):initialize()})}},reAuthenticate:function(email,eventOveride){var ug=this;this.client().reAuthenticate(email,function(err,data,user,organizations,applications){err||($rootScope.currentUser=user),err||($rootScope.userEmail=user.get("email"),$rootScope.organizations=organizations,$rootScope.applications=applications,$rootScope.currentOrg=ug.get("orgName"),$rootScope.currentApp=ug.get("appName"),$rootScope.currentUser=user._data,$rootScope.currentUser.profileImg=utility.get_gravatar($rootScope.currentUser.email)),$rootSco
 pe.$broadcast((eventOveride||"reAuthenticate")+"-"+(err?"error":"success"),err,data,user,organizations,applications)})},logoutCallback:function(){$rootScope.$broadcast("userNotAuthenticated")},logout:function(){$rootScope.activeUI=!1,$rootScope.userEmail="user@apigee.com",$rootScope.organizations={noOrg:{name:"No Orgs Found"}},$rootScope.applications={noApp:{name:"No Apps Found"}},$rootScope.currentOrg="No Org Found",$rootScope.currentApp="No App Found",sessionStorage.setItem("accessToken",null),sessionStorage.setItem("userUUID",null),sessionStorage.setItem("userEmail",null),this.client().logout(),this._client=null},client:function(){var options={buildCurl:!0,logging:!0};return Usergrid.options&&Usergrid.options.client&&(options.keys=Usergrid.options.client),this._client=this._client||new Usergrid.Client(options,$rootScope.urls().DATA_URL),this._client},setClientProperty:function(key,value){this.client().set(key,value)},getTopCollections:function(){var options={method:"GET",endpoint
 :""};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting collections");else{var collections=data.entities[0].metadata.collections;$rootScope.$broadcast("top-collections-received",collections)}})},createCollection:function(collectionName){var collections={};collections[collectionName]={};var metadata={metadata:{collections:collections}},options={method:"PUT",body:metadata,endpoint:""};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error creating collection"):$rootScope.$broadcast("collection-created",collections)})},getApplications:function(){this.client().getApplications(function(err,applications){err?applications&&console.error(applications):$rootScope.$broadcast("applications-received",applications)})},getAdministrators:function(){this.client().getAdministrators(function(err,administrators){err&&$rootScope.$broadcast("alert","error","error getting administrators"),$rootScope.$broadcast
 ("administrators-received",administrators)})},createApplication:function(appName){this.client().createApplication(appName,function(err,applications){err?$rootScope.$broadcast("alert","error","error creating application"):($rootScope.$broadcast("applications-created",applications,appName),$rootScope.$broadcast("applications-received",applications))})},createAdministrator:function(adminName){this.client().createAdministrator(adminName,function(err,administrators){err&&$rootScope.$broadcast("alert","error","error creating administrator"),$rootScope.$broadcast("administrators-received",administrators)})},getFeed:function(){var options={method:"GET",endpoint:"management/organizations/"+this.client().get("orgName")+"/feed",mQuery:!0};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting feed");else{var feedData=data.entities,feed=[],i=0;for(i=0;i<feedData.length;i++){var date=new Date(feedData[i].created).toUTCString(),title=feedData[
 i].title,n=title.indexOf(">");title=title.substring(n+1,title.length),n=title.indexOf(">"),title=title.substring(n+1,title.length),feedData[i].actor&&(title=feedData[i].actor.displayName+" "+title),feed.push({date:date,title:title})}0===i&&feed.push({date:"",title:"No Activities found."}),$rootScope.$broadcast("feed-received",feed)}})},createGroup:function(path,title){var options={path:path,title:title},self=this;this.groupsCollection.addEntity(options,function(err){err?$rootScope.$broadcast("groups-create-error",err):($rootScope.$broadcast("groups-create-success",self.groupsCollection),$rootScope.$broadcast("groups-received",self.groupsCollection))})},createRole:function(name,title){var options={name:name,title:title},self=this;this.rolesCollection.addEntity(options,function(err){err?$rootScope.$broadcast("alert","error","error creating role"):$rootScope.$broadcast("roles-received",self.rolesCollection)})},createUser:function(username,name,email,password){var options={username:user
 name,name:name,email:email,password:password},self=this;this.usersCollection.addEntity(options,function(err,data){err?"string"==typeof data?$rootScope.$broadcast("alert","error","error: "+data):$rootScope.$broadcast("alert","error","error creating user. the email address might already exist."):($rootScope.$broadcast("users-create-success",self.usersCollection),$rootScope.$broadcast("users-received",self.usersCollection))})},getCollection:function(type,path,orderBy,query,limit){var options={type:path,qs:{}};query&&(options.qs.ql=query),options.qs.ql=options.qs.ql?options.qs.ql+" order by "+(orderBy||"created desc"):" order by "+(orderBy||"created desc"),limit&&(options.qs.limit=limit),this.client().createCollection(options,function(err,collection,data){err?$rootScope.$broadcast("alert","error","error getting "+collection._type+": "+data.error_description):$rootScope.$broadcast(type+"-received",collection),$rootScope.$$phase||$rootScope.$apply()})},runDataQuery:function(queryPath,sear
 chString,queryLimit){this.getCollection("query",queryPath,null,searchString,queryLimit)},runDataPOSTQuery:function(queryPath,body){var self=this,options={method:"POST",endpoint:queryPath,body:body};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description),$rootScope.$broadcast("error-running-query",data);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},runDataPutQuery:function(queryPath,searchString,queryLimit,body){var self=this,options={method:"PUT",endpoint:queryPath,body:body};searchString&&(options.qs.ql=searchString),queryLimit&&(options.qs.queryLimit=queryLimit),this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},runDataDeleteQuery:function(queryPath,searchString,queryLimi
 t){var self=this,options={method:"DELETE",endpoint:queryPath};searchString&&(options.qs.ql=searchString),queryLimit&&(options.qs.queryLimit=queryLimit),this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error: "+data.error_description);else{var queryPath=data.path;self.getCollection("query",queryPath,null,"order by modified DESC",null)}})},getUsers:function(){this.getCollection("users","users","username");var self=this;$rootScope.$on("users-received",function(evt,users){self.usersCollection=users})},getGroups:function(){this.getCollection("groups","groups","title");var self=this;$rootScope.$on("groups-received",function(event,roles){self.groupsCollection=roles})},getRoles:function(){this.getCollection("roles","roles","name");var self=this;$rootScope.$on("roles-received",function(event,roles){self.rolesCollection=roles})},getNotifiers:function(){var query="",limit="100",self=this;this.getCollection("notifiers","notifiers","created",query,li
 mit),$rootScope.$on("notifiers-received",function(event,notifiers){self.notifiersCollection=notifiers})},getNotificationHistory:function(type){var query=null;type&&(query="select * where state = '"+type+"'"),this.getCollection("notifications","notifications","created desc",query);var self=this;$rootScope.$on("notifications-received",function(event,notifications){self.notificationCollection=notifications})},getNotificationReceipts:function(uuid){this.getCollection("receipts","notifications/"+uuid+"/receipts");var self=this;$rootScope.$on("receipts-received",function(event,receipts){self.receiptsCollection=receipts})},getIndexes:function(path){var options={method:"GET",endpoint:path.split("/").concat("indexes").filter(function(bit){return bit&&bit.length}).join("/")};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Problem getting indexes: "+data.error):$rootScope.$broadcast("indexes-received",data.data)})},sendNotification:function(path,body
 ){var options={method:"POST",endpoint:path,body:body};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Problem creating notification: "+data.error):$rootScope.$broadcast("send-notification-complete")})},getRolesUsers:function(username){var options={type:"roles/users/"+username,qs:{ql:"order by username"}};this.client().createCollection(options,function(err,users){err?$rootScope.$broadcast("alert","error","error getting users"):$rootScope.$broadcast("users-received",users)})},getTypeAheadData:function(type,searchString,searchBy,orderBy){var search="",qs={limit:100};searchString&&(search="select * where "+searchBy+" = '"+searchString+"'"),orderBy&&(search=search+" order by "+orderBy),search&&(qs.ql=search);var options={method:"GET",endpoint:type,qs:qs};this.client().request(options,function(err,data){if(err)$rootScope.$broadcast("alert","error","error getting "+type);else{var entities=data.entities;$rootScope.$broadcast(type+"-typeahead-recei
 ved",entities)}})},getUsersTypeAhead:function(searchString){this.getTypeAheadData("users",searchString,"username","username")},getGroupsTypeAhead:function(searchString){this.getTypeAheadData("groups",searchString,"path","path")},getRolesTypeAhead:function(searchString){this.getTypeAheadData("roles",searchString,"name","name")},getGroupsForUser:function(user){var options={type:"users/"+user+"/groups"};this.client().createCollection(options,function(err,groups){err?$rootScope.$broadcast("alert","error","error getting groups"):$rootScope.$broadcast("user-groups-received",groups)})},addUserToGroup:function(user,group){var options={type:"users/"+user+"/groups/"+group};this.client().createEntity(options,function(err){err?$rootScope.$broadcast("alert","error","error adding user to group"):$rootScope.$broadcast("user-added-to-group-received")})},addUserToRole:function(user,role){var options={method:"POST",endpoint:"roles/"+role+"/users/"+user};this.client().request(options,function(err){err
 ?$rootScope.$broadcast("alert","error","error adding user to role"):$rootScope.$broadcast("role-update-received")})},addGroupToRole:function(group,role){var options={method:"POST",endpoint:"roles/"+role+"/groups/"+group};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding group to role"):$rootScope.$broadcast("role-update-received")})},followUser:function(user){var username=$rootScope.selectedUser.get("uuid"),options={method:"POST",endpoint:"users/"+username+"/following/users/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error following user"):$rootScope.$broadcast("follow-user-received")})},newPermission:function(permission,type,entity){var options={method:"POST",endpoint:type+"/"+entity+"/permissions",body:{permission:permission}};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error adding permission"):$rootScope.$broadcast("permission-update-rec
 eived")})},newUserPermission:function(permission,username){this.newPermission(permission,"users",username)},newGroupPermission:function(permission,path){this.newPermission(permission,"groups",path)},newRolePermission:function(permission,name){this.newPermission(permission,"roles",name)},deletePermission:function(permission,type,entity){var options={method:"DELETE",endpoint:type+"/"+entity+"/permissions",qs:{permission:permission}};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error deleting permission"):$rootScope.$broadcast("permission-update-received")})},deleteUserPermission:function(permission,user){this.deletePermission(permission,"users",user)},deleteGroupPermission:function(permission,group){this.deletePermission(permission,"groups",group)},deleteRolePermission:function(permission,rolename){this.deletePermission(permission,"roles",rolename)},removeUserFromRole:function(user,role){var options={method:"DELETE",endpoint:"roles/"+role+"/us
 ers/"+user};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error removing user from role"):$rootScope.$broadcast("role-update-received")})},removeUserFromGroup:function(group,role){var options={method:"DELETE",endpoint:"roles/"+role+"/groups/"+group};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error removing role from the group"):$rootScope.$broadcast("role-update-received")})},createAndroidNotifier:function(name,APIkey){var options={method:"POST",endpoint:"notifiers",body:{apiKey:APIkey,name:name,provider:"google"}};this.client().request(options,function(err,data){err?(console.error(data),$rootScope.$broadcast("alert","error","error creating notifier ")):($rootScope.$broadcast("alert","success","New notifier created successfully."),$rootScope.$broadcast("notifier-update"))})},createAppleNotifier:function(file,name,environment,certificatePassword){var provider="apple",formData=new FormData;formData.ap
 pend("p12Certificate",file),formData.append("name",name),formData.append("provider",provider),formData.append("environment",environment),formData.append("certificatePassword",certificatePassword||"");var options={method:"POST",endpoint:"notifiers",formData:formData};this.client().request(options,function(err,data){err?(console.error(data),$rootScope.$broadcast("alert","error","error creating notifier.")):($rootScope.$broadcast("alert","success","New notifier created successfully."),$rootScope.$broadcast("notifier-update"))})},deleteNotifier:function(name){var options={method:"DELETE",endpoint:"notifiers/"+name};this.client().request(options,function(err){err?$rootScope.$broadcast("alert","error","error deleting notifier"):$rootScope.$broadcast("notifier-update")})},initializeCurrentUser:function(callback){if(callback=callback||function(){},$rootScope.currentUser&&!$rootScope.currentUser.reset)return callback($rootScope.currentUser),$rootScope.$broadcast("current-user-initialized",""
 );var options={method:"GET",endpoint:"management/users/"+this.client().get("email"),mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("alert","error","Error getting user info"):($rootScope.currentUser=data.data,$rootScope.currentUser.profileImg=utility.get_gravatar($rootScope.currentUser.email),$rootScope.userEmail=$rootScope.currentUser.email,callback($rootScope.currentUser),$rootScope.$broadcast("current-user-initialized",$rootScope.currentUser))})},updateUser:function(user){var body=$rootScope.currentUser;body.username=user.username,body.name=user.name,body.email=user.email;var options={method:"PUT",endpoint:"management/users/"+user.uuid+"/",mQuery:!0,body:body},self=this;this.client().request(options,function(err,data){return self.client().set("email",user.email),self.client().set("username",user.username),err?$rootScope.$broadcast("user-update-error",data):($rootScope.currentUser.reset=!0,void self.initializeCurrentUser(function(){$rootScope.
 $broadcast("user-update-success",$rootScope.currentUser)}))})},resetUserPassword:function(user){var pwdata={};pwdata.oldpassword=user.oldPassword,pwdata.newpassword=user.newPassword,pwdata.username=user.username;var options={method:"PUT",endpoint:"users/"+pwdata.uuid+"/",body:pwdata};this.client().request(options,function(err){return err?$rootScope.$broadcast("alert","error","Error resetting password"):($rootScope.currentUser.oldPassword="",$rootScope.currentUser.newPassword="",void $rootScope.$broadcast("user-reset-password-success",$rootScope.currentUser))})},getOrgCredentials:function(){var options={method:"GET",endpoint:"management/organizations/"+this.client().get("orgName")+"/credentials",mQuery:!0};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error getting credentials"):$rootScope.$broadcast("org-creds-updated",data.credentials)})},regenerateOrgCredentials:function(){var options={method:"POST",endpoint:"manageme
 nt/organizations/"+this.client().get("orgName")+"/credentials",mQuery:!0};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error regenerating credentials"):($rootScope.$broadcast("alert","success","Regeneration of credentials complete."),$rootScope.$broadcast("org-creds-updated",data.credentials))})},getAppCredentials:function(){var options={method:"GET",endpoint:"credentials"};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error getting credentials"):$rootScope.$broadcast("app-creds-updated",data.credentials)})},regenerateAppCredentials:function(){var options={method:"POST",endpoint:"credentials"};this.client().request(options,function(err,data){err&&data.credentials?$rootScope.$broadcast("alert","error","Error regenerating credentials"):($rootScope.$broadcast("alert","success","Regeneration of credentials complete."),$rootScope.$broadcast("app-creds-updated",
 data.credentials))})},signUpUser:function(orgName,userName,name,email,password){var formData={organization:orgName,username:userName,name:name,email:email,password:password},options={method:"POST",endpoint:"management/organizations",body:formData,mQuery:!0},client=this.client();client.request(options,function(err,data){err?$rootScope.$broadcast("register-error",data):$rootScope.$broadcast("register-success",data)})},resendActivationLink:function(id){var options={method:"GET",endpoint:"management/users/"+id+"/reactivate",mQuery:!0};this.client().request(options,function(err,data){err?$rootScope.$broadcast("resend-activate-error",data):$rootScope.$broadcast("resend-activate-success",data)})},getAppSettings:function(){$rootScope.$broadcast("app-settings-received",{})},getActivities:function(){this.client().request({method:"GET",endpoint:"activities",qs:{limit:200}},function(err,data){if(err)return $rootScope.$broadcast("app-activities-error",data);var entities=data.entities;entities.fo
 rEach(function(entity){entity.actor.picture?(entity.actor.picture=entity.actor.picture.replace(/^http:\/\/www.gravatar/i,"https://secure.gravatar"),entity.actor.picture=~entity.actor.picture.indexOf("http")?entity.actor.picture:"https://apigee.com/usergrid/img/user_profile.png"):entity.actor.picture=window.location.protocol+"//"+window.location.host+window.location.pathname+"img/user_profile.png"}),$rootScope.$broadcast("app-activities-received",data.entities)})},getEntityActivities:function(entity,isFeed){var route=isFeed?"feed":"activities",endpoint=entity.get("type")+"/"+entity.get("uuid")+"/"+route,options={method:"GET",endpoint:endpoint,qs:{limit:200}};this.client().request(options,function(err,data){err&&$rootScope.$broadcast(entity.get("type")+"-"+route+"-error",data),data.entities.forEach(function(entityInstance){entityInstance.createdDate=new Date(entityInstance.created).toUTCString()}),$rootScope.$broadcast(entity.get("type")+"-"+route+"-received",data.entities)})},addUser
 Activity:function(user,content){var options={actor:{displayName:user.get("username"),uuid:user.get("uuid"),username:user.get("username")},verb:"post",content:content};
 this.client().createUserActivity(user.get("username"),options,function(err,activity){err?$rootScope.$broadcast("user-activity-add-error",err):$rootScope.$broadcast("user-activity-add-success",activity)})},runShellQuery:function(method,path,payload){var options={verb:method,endpoint:path};payload&&(options.body=payload),this.client().request(options,function(err,data){err?$rootScope.$broadcast("shell-error",data):$rootScope.$broadcast("shell-success",data)})},addOrganization:function(user,orgName){var options={method:"POST",endpoint:"management/users/"+user.uuid+"/organizations",body:{organization:orgName},mQuery:!0},client=this.client();client.request(options,function(err,data){err?$rootScope.$broadcast("user-add-org-error",data):$rootScope.$broadcast("user-add-org-success",$rootScope.organizations)})},leaveOrganization:function(user,org){var options={method:"DELETE",endpoint:"management/users/"+user.uuid+"/organizations/"+org.uuid,mQuery:!0};this.client().request(options,function(e
 rr,data){err?$rootScope.$broadcast("user-leave-org-error",data):(delete $rootScope.organizations[org.name],$rootScope.$broadcast("user-leave-org-success",$rootScope.organizations))})},httpGet:function(id,url){var deferred;return deferred=$q.defer(),$http.get(url||configuration.ITEMS_URL).success(function(data){var result;id?angular.forEach(data,function(obj){obj.id===id&&(result=obj)}):result=data,deferred.resolve(result)}).error(function(data,status,headers,config){$log.error(data,status,headers,config),reportError(data,config),deferred.reject(data)}),deferred.promise},jsonp:function(objectType,criteriaId,params,successCallback){params||(params={}),params.demoApp=$rootScope.demoData,params.access_token=getAccessToken(),params.callback="JSON_CALLBACK";var uri=$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/apm/"+objectType+"/"+criteriaId;return this.jsonpRaw(objectType,criteriaId,params,uri,successCallback)},jsonpSimple:function(objectType,appId,para
 ms){var uri=$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/apm/"+objectType+"/"+appId;return this.jsonpRaw(objectType,appId,params,uri)},calculateAverageRequestTimes:function(){if(!running){var self=this;running=!0,setTimeout(function(){running=!1;var length=requestTimes.length<10?requestTimes.length:10,sum=requestTimes.slice(0,length).reduce(function(a,b){return a+b}),avg=sum/length;self.averageRequestTimes=avg/1e3,self.averageRequestTimes>5&&$rootScope.$broadcast("request-times-slow",self.averageRequestTimes)},3e3)}},jsonpRaw:function(objectType,appId,params,uri,successCallback){"function"!=typeof successCallback&&(successCallback=null),uri=uri||$rootScope.urls().DATA_URL+"/"+$rootScope.currentOrg+"/"+$rootScope.currentApp+"/"+objectType,params||(params={});var start=(new Date).getTime(),self=this;params.access_token=getAccessToken(),params.callback="JSON_CALLBACK";var deferred=$q.defer(),diff=function(){currentRequests[uri]--,requestTimes.splice(
 0,0,(new Date).getTime()-start),self.calculateAverageRequestTimes()};successCallback&&$rootScope.$broadcast("ajax_loading",objectType);var reqCount=currentRequests[uri]||0;return self.averageRequestTimes>5&&reqCount>1?(setTimeout(function(){deferred.reject(new Error("query in progress"))},50),deferred):(currentRequests[uri]=(currentRequests[uri]||0)+1,$http.jsonp(uri,{params:params}).success(function(data,status,headers,config){diff(),successCallback&&(successCallback(data,status,headers,config),$rootScope.$broadcast("ajax_finished",objectType)),deferred.resolve(data)}).error(function(data,status,headers,config){diff(),$log.error("ERROR: Could not get jsonp data. "+uri),reportError(data,config),deferred.reject(data)}),deferred.promise)},resource:function(params,isArray){return $resource($rootScope.urls().DATA_URL+"/:orgname/:appname/:username/:endpoint",{},{get:{method:"JSONP",isArray:isArray,params:params},login:{method:"GET",url:$rootScope.urls().DATA_URL+"/management/token",isArr
 ay:!1,params:params},save:{url:$rootScope.urls().DATA_URL+"/"+params.orgname+"/"+params.appname,method:"PUT",isArray:!1,params:params}})},httpPost:function(url,callback,payload,headers){var accessToken=getAccessToken();payload?payload.access_token=accessToken:payload={access_token:accessToken},headers||(headers={Bearer:accessToken}),$http({method:"POST",url:url,data:payload,headers:headers}).success(function(data){callback(data)}).error(function(data,status,headers,config){reportError(data,config),callback(data)})}}}),AppServices.Directives.directive("ngFocus",["$parse",function($parse){return function(scope,element,attr){var fn=$parse(attr.ngFocus);element.bind("focus",function(event){scope.$apply(function(){fn(scope,{$event:event})})})}}]),AppServices.Directives.directive("ngBlur",["$parse",function($parse){return function(scope,element,attr){var fn=$parse(attr.ngBlur);element.bind("blur",function(event){scope.$apply(function(){fn(scope,{$event:event})})})}}]),AppServices.Services
 .factory("utility",function(){return{keys:function(o){var a=[];for(var propertyName in o)a.push(propertyName);return a},get_gravatar:function(email,size){try{var size=size||50;return email.length?"https://secure.gravatar.com/avatar/"+MD5(email)+"?s="+size:"https://apigee.com/usergrid/img/user_profile.png"}catch(e){return"https://apigee.com/usergrid/img/user_profile.png"}},get_qs_params:function(){var queryParams={};if(window.location.search)for(var params=window.location.search.slice(1).split("&"),i=0;i<params.length;i++){var tmp=params[i].split("=");queryParams[tmp[0]]=unescape(tmp[1])}return queryParams},safeApply:function(fn){var phase=this.$root.$$phase;"$apply"==phase||"$digest"==phase?fn&&"function"==typeof fn&&fn():this.$apply(fn)}}}),AppServices.Directives.directive("ugValidate",["$rootScope",function(){return{scope:!0,restrict:"A",require:"ng-model",replace:!0,link:function(scope,element,attrs,ctrl){var validate=function(){var id=element.attr("id"),validator=id+"-validator"
 ,title=element.attr("title");if(title=title&&title.length?title:"Please enter data",$("#"+validator).remove(),ctrl.$valid)element.removeClass("has-error"),$("#"+validator).remove();else{var validatorElem='<div id="'+validator+'"><span  class="validator-error-message">'+title+"</span></div>";$("#"+id).after(validatorElem),element.addClass("has-error")}},firing=!1;element.bind("blur",function(){validate(scope,element,attrs,ctrl)}).bind("input",function(){firing||(firing=!0,setTimeout(function(){validate(scope,element,attrs,ctrl),firing=!1},500))})}}}]),AppServices.Controllers.controller("GroupsActivitiesCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.activitiesSelected="active",$rootScope.selectedGroup?($rootScope.selectedGroup.activities=[],void $rootScope.selectedGroup.getActivities(function(err){err||$rootScope.$$phase||$rootScope.$apply()})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsCtrl",["ug",
 "$scope","$rootScope","$location","$route",function(ug,$scope,$rootScope,$location,$route){$scope.groupsCollection={},$rootScope.selectedGroup={},$scope.previous_display="none",$scope.next_display="none",$scope.hasGroups=!1,$scope.newGroup={path:"",title:""},ug.getGroups(),$scope.currentGroupsPage={},$scope.selectGroupPage=function(route){$scope.currentGroupsPage.template=$route.routes[route].templateUrl,$scope.currentGroupsPage.route=route},$scope.newGroupDialog=function(modalId){$scope.newGroup.path&&$scope.newGroup.title?(ug.createGroup($scope.removeFirstSlash($scope.newGroup.path),$scope.newGroup.title),$scope.hideModal(modalId),$scope.newGroup={path:"",title:""}):$rootScope.$broadcast("alert","error","Missing required information.")},$scope.deleteGroupsDialog=function(modalId){$scope.deleteEntities($scope.groupsCollection,"group-deleted","error deleting group"),$scope.hideModal(modalId),$scope.newGroup={path:"",title:""}},$scope.$on("group-deleted",function(){$rootScope.$broadc
 ast("alert","success","Group deleted successfully.")}),$scope.$on("group-deleted-error",function(){ug.getGroups()}),$scope.$on("groups-create-success",function(){$rootScope.$broadcast("alert","success","Group created successfully.")}),$scope.$on("groups-create-error",function(){$rootScope.$broadcast("alert","error","Error creating group. Make sure you don't have spaces in the path.")}),$scope.$on("groups-received",function(event,groups){$scope.groupBoxesSelected=!1,$scope.groupsCollection=groups,$scope.newGroup.path="",$scope.newGroup.title="",!(groups._list.length>0)||$rootScope.selectedGroup._data&&groups._list.some(function(group){return $rootScope.selectedGroup._data.uuid===group._data.uuid})||$scope.selectGroup(groups._list[0]._data.uuid),$scope.hasGroups=groups._list.length>0,$scope.received=!0,$scope.checkNextPrev(),$scope.applyScope()}),$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextP
 rev(),$scope.groupsCollection.hasPreviousPage()&&($scope.previous_display="block"),$scope.groupsCollection.hasNextPage()&&($scope.next_display="block")},$scope.selectGroup=function(uuid){$rootScope.selectedGroup=$scope.groupsCollection.getEntityByUUID(uuid),$scope.currentGroupsPage.template="groups/groups-details.html",$scope.currentGroupsPage.route="/groups/details",$rootScope.$broadcast("group-selection-changed",$rootScope.selectedGroup)},$scope.getPrevious=function(){$scope.groupsCollection.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of groups"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.getNext=function(){$scope.groupsCollection.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of groups"),$scope.checkNextPrev(),$scope.applyScope()})},$scope.$on("group-deleted",function(){$route.reload(),$scope.master=""})}]),AppServices.Controllers.controller("GroupsDetailsCtrl",["ug"
 ,"$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){var selectedGroup=$rootScope.selectedGroup.clone();return $scope.detailsSelected="active",$scope.json=selectedGroup._json||selectedGroup._data.stringifyJSON(),$scope.group=selectedGroup._data,$scope.group.path=0!=$scope.group.path.indexOf("/")?"/"+$scope.group.path:$scope.group.path,$scope.group.title=$scope.group.title,$rootScope.selectedGroup?($scope.$on("group-selection-changed",function(evt,selectedGroup){$scope.group.path=0!=selectedGroup._data.path.indexOf("/")?"/"+selectedGroup._data.path:selectedGroup._data.path,$scope.group.title=selectedGroup._data.title,$scope.detailsSelected="active",$scope.json=selectedGroup._json||selectedGroup._data.stringifyJSON()}),void($rootScope.saveSelectedGroup=function(){$rootScope.selectedGroup._data.title=$scope.group.title,$rootScope.selectedGroup._data.path=$scope.removeFirstSlash($scope.group.path),$rootScope.selectedGroup.save(function(err){err?$rootScope.$broadca
 st("alert","error","error saving group"):$rootScope.$broadcast("alert","success","group saved")})})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsMembersCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.membersSelected="active",$scope.previous_display="none",$scope.next_display="none",$scope.user="",$scope.master="",$scope.hasMembers=!1,ug.getUsersTypeAhead(),$scope.usersTypeaheadValues=[],$scope.$on("users-typeahead-received",function(event,users){$scope.usersTypeaheadValues=users,$scope.applyScope()}),$scope.addGroupToUserDialog=function(modalId){if($scope.user){var path=$rootScope.selectedGroup.get("path");ug.addUserToGroup($scope.user.uuid,path),$scope.user="",$scope.hideModal(modalId)}else $rootScope.$broadcast("alert","error","Please select a user.")},$scope.removeUsersFromGroupDialog=function(modalId){$scope.deleteEntities($scope.groupsCollection.users,"group-update-received","Error removing use
 r from group"),$scope.hideModal(modalId)},$scope.get=function(){if($rootScope.selectedGroup.get){var options={type:"groups/"+$rootScope.selectedGroup.get("path")+"/users"};$scope.groupsCollection.addCollection("users",options,function(err){$scope.groupMembersSelected=!1,err?$rootScope.$broadcast("alert","error","error getting users for group"):($scope.hasMembers=$scope.groupsCollection.users._list.length>0,$scope.checkNextPrev(),$scope.applyScope())})}},$scope.resetNextPrev=function(){$scope.previous_display="none",$scope.next_display="none"},$scope.checkNextPrev=function(){$scope.resetNextPrev(),$scope.groupsCollection.users.hasPreviousPage()&&($scope.previous_display="block"),$scope.groupsCollection.users.hasNextPage()&&($scope.next_display="block")},$rootScope.selectedGroup?($scope.get(),$scope.getPrevious=function(){$scope.groupsCollection.users.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of users"),$scope.checkNextPrev()
 ,$rootScope.$$phase||$rootScope.$apply()})},$scope.getNext=function(){$scope.groupsCollection.users.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of users"),$scope.checkNextPrev(),$rootScope.$$phase||$rootScope.$apply()})},$scope.$on("group-update-received",function(){$scope.get()}),void $scope.$on("user-added-to-group-received",function(){$scope.get()})):void $location.path("/groups")}]),AppServices.Controllers.controller("GroupsRolesCtrl",["ug","$scope","$rootScope","$location",function(ug,$scope,$rootScope,$location){return $scope.rolesSelected="active",$scope.roles_previous_display="none",$scope.roles_next_display="none",$scope.name="",$scope.master="",$scope.hasRoles=!1,$scope.hasPermissions=!1,$scope.permissions={},$scope.addGroupToRoleDialog=function(modalId){if($scope.name){var path=$rootScope.selectedGroup.get("path");ug.addGroupToRole(path,$scope.name),$scope.hideModal(modalId),$scope.name=""}else $rootScope.$broadcast("alert
 ","error","You must specify a role name.")},$scope.leaveRoleDialog=function(modalId){for(var path=$rootScope.selectedGroup.get("path"),roles=$scope.groupsCollection.roles._list,i=0;i<roles.length;i++)roles[i].checked&&ug.removeUserFromGroup(path,roles[i]._data.name);$scope.hideModal(modalId)},$scope.addGroupPermissionDialog=function(modalId){if($scope.permissions.path){var permission=$scope.createPermission(null,null,$scope.removeFirstSlash($scope.permissions.path),$scope.permissions),path=$rootScope.selectedGroup.get("path");ug.newGroupPermission(permission,path),$scope.hideModal(modalId),$scope.permissions&&($scope.permissions={})}else $rootScope.$broadcast("alert","error","You must specify a name for the permission.")},$scope.deleteGroupPermissionDialog=function(modalId){for(var path=$rootScope.selectedGroup.get("path"),permissions=$rootScope.selectedGroup.permissions,i=0;i<permissions.length;i++)permissions[i].checked&&ug.deleteGroupPermission(permissions[i].perm,path);$scope.hi
 deModal(modalId)},$scope.resetNextPrev=function(){$scope.roles_previous_display="none",$scope.roles_next_display="none",$scope.permissions_previous_display="none",$scope.permissions_next_display="none"},$scope.resetNextPrev(),$scope.checkNextPrevRoles=function(){$scope.resetNextPrev(),$scope.groupsCollection.roles.hasPreviousPage()&&($scope.roles_previous_display="block"),$scope.groupsCollection.roles.hasNextPage()&&($scope.roles_next_display="block")},$scope.checkNextPrevPermissions=function(){$scope.groupsCollection.permissions.hasPreviousPage()&&($scope.permissions_previous_display="block"),$scope.groupsCollection.permissions.hasNextPage()&&($scope.permissions_next_display="block")},$scope.getRoles=function(){var path=$rootScope.selectedGroup.get("path"),options={type:"groups/"+path+"/roles"};$scope.groupsCollection.addCollection("roles",options,function(err){$scope.groupRoleSelected=!1,err?$rootScope.$broadcast("alert","error","error getting roles for group"):($scope.hasRoles=$s
 cope.groupsCollection.roles._list.length>0,$scope.checkNextPrevRoles(),$scope.applyScope())})},$scope.getPermissions=function(){$rootScope.selectedGroup.permissions=[],$rootScope.selectedGroup.getPermissions(function(err){$scope.groupPermissionsSelected=!1,$scope.hasPermissions=$scope.selectedGroup.permissions.length,err||$scope.applyScope()})},$scope.getPreviousRoles=function(){$scope.groupsCollection.roles.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of roles"),$scope.checkNextPrevRoles(),$scope.applyScope()})},$scope.getNextRoles=function(){$scope.groupsCollection.roles.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of roles"),$scope.checkNextPrevRoles(),$scope.applyScope()})},$scope.getPreviousPermissions=function(){$scope.groupsCollection.permissions.getPreviousPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting previous page of permissions"),$scope.c
 heckNextPrevPermissions(),$scope.applyScope()})},$scope.getNextPermissions=function(){$scope.groupsCollection.permissions.getNextPage(function(err){err&&$rootScope.$broadcast("alert","error","error getting next page of permissions"),$scope.checkNextPrevPermissions(),$scope.applyScope()})},$scope.$on("role-update-received",function(){$scope.getRoles()}),$scope.$on("permission-update-received",function(){$scope.getPermissions()}),$scope.$on("groups-received",function(evt,data){$scope.groupsCollection=data,$scope.getRoles(),$scope.getPermissions()}),$rootScope.selectedGroup?(ug.getRolesTypeAhead(),void ug.getGroups()):void $location.path("/groups")}]),AppServices.Controllers.controller("ForgotPasswordCtrl",["ug","$scope","$rootScope","$location","$sce","utility",function(ug,$scope,$rootScope,$location,$sce){$rootScope.activeUI&&$location.path("/"),$scope.forgotPWiframeURL=$sce.trustAsResourceUrl($scope.apiUrl+"/management/users/resetpw")}]),AppServices.Controllers.controller("LoginCtrl
 ",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){$scope.loading=!1,$scope.login={},$scope.activation={},$scope.requiresDeveloperKey=$scope.options.client.requiresDeveloperKey||!1,$rootScope.gotoForgotPasswordPage=function(){$location.path("/forgot-password")},$rootScope.gotoSignUp=function(){$location.path("/register")},$scope.login=function(){var username=$scope.login.username,password=$scope.login.password;$scope.loginMessage="",$scope.loading=!0,ug.orgLogin(username,password)},$scope.$on("loginFailed",function(){$scope.loading=!1,$scope.loginMessage="Error: the username / password combination was not valid",$scope.applyScope()}),$scope.logout=function(){ug.logout(),ug.setClientProperty("developerkey",null),$scope.use_sso?window.location=$rootScope.urls().LOGOUT_URL+"?redirect=no&callback="+encodeURIComponent($location.absUrl().split("?")[0]):($location.path("/login"),$scope.applyScope())},$rootScope.$on("user
 NotAuthenticated",function(){"/forgot-password"!==$location.path()&&($location.path("/login"),$scope.logout()),$scope.applyScope()}),$scope.$on("loginSuccesful",function(){$scope.loading=!1,$scope.requiresDeveloperKey&&ug.setClientProperty("developerkey",$scope.login.developerkey),$scope.login={},$location.path("/login"===$rootScope.currentPath||"/login/loading"===$rootScope.currentPath||"undefined"==typeof $rootScope.currentPath?"/org-overview":$rootScope.currentPath),$scope.applyScope()}),$scope.resendActivationLink=function(modalId){var id=$scope.activation.id;ug.resendActivationLink(id),$scope.activation={},$scope.hideModal(modalId)},$scope.$on("resend-activate-success",function(){$scope.activationId="",$scope.$apply(),$rootScope.$broadcast("alert","success","Activation link sent successfully.")}),$scope.$on("resend-activate-error",function(){$rootScope.$broadcast("alert","error","Activation link failed to send.")})}]),AppServices.Controllers.controller("LogoutCtrl",["ug","$scop
 e","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){ug.logout(),$scope.use_sso?window.location=$rootScope.urls().LOGOUT_URL+"?callback="+encodeURIComponent($location.absUrl().split("?")[0]):($location.path("/login"),$scope.applyScope())}]),AppServices.Controllers.controller("RegisterCtrl",["ug","$scope","$rootScope","$routeParams","$location","utility",function(ug,$scope,$rootScope,$routeParams,$location){$rootScope.activeUI&&$location.path("/");var init=function(){$scope.registeredUser={}};init(),$scope.cancel=function(){$location.path("/")},$scope.register=function(){var user=$scope.registeredUser.clone();user.password===user.confirmPassword?ug.signUpUser(user.orgName,user.userName,user.name,user.email,user.password):$rootScope.$broadcast("alert","error","Passwords do not match."+name)},$scope.$on("register-error",function(event,data){$scope.signUpSuccess=!1,$rootScope.$broadcast("alert","error","Error registering: "+(data&&da
 ta.error_description?data.error_description:name))}),$scope.$on("register-success",function(){$scope.registeredUser={},$scope.signUpSuccess=!0,init(),$scope.$apply()})}]),AppServices.Directives.directive("menu",["$location","$rootScope","$log",function($location,$rootScope,$log){return{link:function(scope,lElement,attrs){function setActiveElement(ele,locationPath,$rootScope,isParentClick){ele.removeClass("active");var menuItem,parentMenuItem,newActiveElement=ele.parent().find('a[href*="#!'+locationPath+'"]');if(0===newActiveElement.length)parentMenuItem=ele;else{menuItem=newActiveElement.parent(),menuItem.hasClass("option")?parentMenuItem=menuItem[0]:1===menuItem.size()?(parentMenuItem=newActiveElement.parent().parent().parent(),parentMenuItem.addClass("active")):(parentMenuItem=menuItem[0],menuItem=menuItem[1]);try{var menuItemCompare=parentMenuItem[0]||parentMenuItem;ele[0]!==menuItemCompare&&isParentClick&&ele.find("ul")[0]&&(ele.find("ul")[0].style.height=0);var subMenuSizer=ang
 ular.element(parentMenuItem).find(".nav-list")[0];if(subMenuSizer){var heightChecker,clientHeight=subMenuSizer.getAttribute("data-height"),heightCounter=1;clientHeight||heightChecker?(menuItem.addClass("active"),subMenuSizer.style.height=clientHeight+"px"):heightChecker=setInterval(function(){var tempHeight=subMenuSizer.getAttribute("data-height")||subMenuSizer.clientHeight;heightCounter=subMenuSizer.clientHeight,0===heightCounter&&(heightCounter=1),"string"==typeof tempHeight&&(tempHeight=parseInt(tempHeight,10)),tempHeight>0&&heightCounter===tempHeight&&(subMenuSizer.setAttribute("data-height",tempHeight),menuItem.addClass("active"),subMenuSizer.style.height=tempHeight+"px",clearInterval(heightChecker)),heightCounter=tempHeight},20),$rootScope.menuExecute=!0}else menuItem.addClass("active")}catch(e){$log.error("Problem calculating size of menu",e)}}return{menuitem:menuItem,parentMenuItem:parentMenuItem}}function setupMenuState(){if(menuContext=attrs.menu,parentMenuItems=lElement.f
 ind("li.option"),0!==lElement.find("li.option.active").length&&($rootScope[menuContext+"Parent"]=lElement.find("li.option.active")),activeParentElement=$rootScope[menuContext+"Parent"]||null,activeParentElement&&(activeParentElement=angular.element(activeParentElement)),menuItems=lElement.find("li.option li"),locationPath=$location.path(),activeParentElement&&(activeMenuElement=angular.element(activeParentElement),activeMenuElement=activeMenuElement.find("li.active"),activeMenuElement.removeClass("active"),activeParentElement.find("a")[0])){subMenuContext=activeParentElement.find("a")[0].href.split("#!")[1];var tempMenuContext=subMenuContext.split("/");subMenuContext="/"+tempMenuContext[1],tempMenuContext.length>2&&(subMenuContext+="/"+tempMenuContext[2])}var activeElements;""!==locationPath&&-1===locationPath.indexOf(subMenuContext)?(activeElements=setActiveElement(activeParentElement,locationPath,scope),$rootScope[menuContext+"Parent"]=activeElements.parentMenuItem,$rootScope[menu
 Context+"Menu"]=activeElements.menuitem):setActiveElement(activeParentElement,subMenuContext,scope)}var menuContext,parentMenuItems,activeParentElement,menuItems,activeMenuElement,locationPath,subMenuContext,bound=!1;scope.$on("$routeChangeSuccess",function(){setupMenuState(),bound||(bound=!0,parentMenuItems.bind("click",function(cevent){var previousParentSelection=angular.element($rootScope[menuContext+"Parent"]),targetPath=angular.element(cevent.currentTarget).find("> a")[0].href.split("#!")[1];previousParentSelection.find(".nav > li").removeClass("active");var activeElements=setActiveElement(previousParentSelection,targetPath,scope,!0);$rootScope[menuContext+"Parent"]=activeElements.parentMenuItem,$rootScope[menuContext+"Menu"]=activeElements.menuitem,scope.$broadcast("menu-selection")}),menuItems.bind("click",function(cevent){var previousMenuSelection=$rootScope[menuContext+"Menu"],targetElement=cevent.currentTarget;previousMenuSelection!==targetElement&&(previousMenuSelection?a
 ngular.element(previousMenuSe

<TRUNCATED>

[38/55] [abbrv] git commit: lock down rails version to 3.2.x

Posted by sn...@apache.org.
lock down rails version to 3.2.x


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/746384c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/746384c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/746384c2

Branch: refs/pull/76/head
Commit: 746384c269823132f3715a974f112e5b92df18df
Parents: 6af732b
Author: Scott Ganyo <sc...@ganyo.com>
Authored: Wed Mar 12 16:06:34 2014 -0700
Committer: Scott Ganyo <sc...@ganyo.com>
Committed: Wed Mar 12 16:06:34 2014 -0700

----------------------------------------------------------------------
 sdks/ruby-on-rails/usergrid_ironhorse.gemspec | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/746384c2/sdks/ruby-on-rails/usergrid_ironhorse.gemspec
----------------------------------------------------------------------
diff --git a/sdks/ruby-on-rails/usergrid_ironhorse.gemspec b/sdks/ruby-on-rails/usergrid_ironhorse.gemspec
index 62b8ed7..2f77151 100644
--- a/sdks/ruby-on-rails/usergrid_ironhorse.gemspec
+++ b/sdks/ruby-on-rails/usergrid_ironhorse.gemspec
@@ -19,8 +19,8 @@ Gem::Specification.new do |gem|
   gem.require_paths = ["lib"]
 
   gem.add_dependency 'usergrid_iron', '0.9.1'
-  gem.add_dependency 'activemodel'
-  gem.add_dependency 'activerecord'
+  gem.add_dependency 'activemodel', '~> 3.2'
+  gem.add_dependency 'activerecord', '~> 3.2'
   gem.add_dependency 'i18n'
 
   gem.add_development_dependency 'rake'


[37/55] [abbrv] git commit: test for names with spaces

Posted by sn...@apache.org.
test for names with spaces


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/6af732b9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/6af732b9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/6af732b9

Branch: refs/pull/76/head
Commit: 6af732b93fccbb9970b5b04a0988182eb069dcf0
Parents: 7ea7503
Author: Scott Ganyo <sc...@ganyo.com>
Authored: Wed Mar 12 16:06:09 2014 -0700
Committer: Scott Ganyo <sc...@ganyo.com>
Committed: Wed Mar 12 16:06:09 2014 -0700

----------------------------------------------------------------------
 sdks/ruby-on-rails/spec/usergrid_ironhorse/base_spec.rb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6af732b9/sdks/ruby-on-rails/spec/usergrid_ironhorse/base_spec.rb
----------------------------------------------------------------------
diff --git a/sdks/ruby-on-rails/spec/usergrid_ironhorse/base_spec.rb b/sdks/ruby-on-rails/spec/usergrid_ironhorse/base_spec.rb
index 92d5249..7fc911b 100644
--- a/sdks/ruby-on-rails/spec/usergrid_ironhorse/base_spec.rb
+++ b/sdks/ruby-on-rails/spec/usergrid_ironhorse/base_spec.rb
@@ -57,12 +57,14 @@ describe Usergrid::Ironhorse::Base do
     end
 
     it 'be created and destroyed' do
-      foo = Foo.create name: 'foo2'
+      foo = Foo.create name: 'foo man'
       foo.persisted?.should be_true
-      foo.name.should eq 'foo2'
+      foo.name.should eq 'foo man'
+      foo = Foo.find_by_name 'foo man'
+      foo.should_not be_nil
       foo.destroy.should be_true
       foo.persisted?.should be_false
-      foo = Foo.find_by_name 'foo2'
+      foo = Foo.find_by_name 'foo man'
       foo.should be_nil
     end
 


[34/55] [abbrv] git commit: Merge pull request #70 from shawnfeldman/master

Posted by sn...@apache.org.
Merge pull request #70 from shawnfeldman/master

USERGRID-86: Remove restriction on 10 apps in the portal

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/51ad0923
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/51ad0923
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/51ad0923

Branch: refs/pull/76/head
Commit: 51ad0923126f14d7c90533575b98d1164b05620f
Parents: ab9fdf2 f6c3d4a
Author: Dave Johnson <da...@rollerweblogger.org>
Authored: Tue Mar 11 09:26:55 2014 -0400
Committer: Dave Johnson <da...@rollerweblogger.org>
Committed: Tue Mar 11 09:26:55 2014 -0400

----------------------------------------------------------------------
 portal/config.js                              |   11 +-
 portal/index-debug.html                       |   18 +-
 portal/index-template.html                    |    2 +-
 portal/index.html                             |   18 +-
 portal/js/app.js                              |    7 +-
 portal/js/global/page-controller.js           |   58 +-
 portal/js/global/page-title.html              |    2 +-
 portal/js/global/ug-service.js                |   74 +-
 portal/js/libs/usergrid-libs.min.js           |   22 +-
 portal/js/libs/usergrid.sdk.js                |    5 +
 portal/js/login/forgot-password-controller.js |    1 -
 portal/js/login/login-controller.js           |    8 +-
 portal/js/login/login.html                    |    6 +
 portal/js/menus/appMenu.html                  |    7 +-
 portal/js/menus/menu-directives.js            |    1 -
 portal/js/org-overview/org-overview.html      |    4 +-
 portal/js/templates.js                        |   57 +-
 portal/js/usergrid-dev.min.js                 |  171 +-
 portal/js/usergrid.min.js                     |   12 +-
 portal/js/users/users-feed-controller.js      |   29 +
 portal/js/users/users-feed.html               |   27 +
 portal/js/users/users.html                    |    1 +
 portal/package.json                           |    5 +-
 portal/phantomjsdriver.log                    | 3869 --------------------
 portal/seleniumLog.txt                        |    0
 portal/tests/unit/sample.spec.js              |    3 +-
 26 files changed, 371 insertions(+), 4047 deletions(-)
----------------------------------------------------------------------