/**
 * angular-spinner v1.2.26 - 2014-11-02
 * @link https://github.com/angularifyjs/angular-spinner
 * @license MIT - Copyright (c) 2014 Angularfiy.org & HenryTao.
 */
angular.module("angular-spinner",[]).factory("SpinnerConfig",function(){return{_START_REQUEST_:"_START_REQUEST_",_END_REQUEST_:"_END_REQUEST_",isSpinning:!1,pendingRequests:0}}).factory("SpinnerInterceptor",["SpinnerConfig","$injector","$q","$timeout",function(n,i,t){var e,r,o=function(){n.pendingRequests=r.pendingRequests.length,r.pendingRequests.length<1?e.$broadcast(n._END_REQUEST_):n.isSpinning||e.$broadcast(n._START_REQUEST_)};return{request:function(t){return r=r||i.get("$http"),e=e||i.get("$rootScope"),e.$broadcast(n._START_REQUEST_),t},requestError:function(n){return o(),t.reject(n)},response:function(n){return o(),n},responseError:function(n){return o(),t.reject(n)}}}]).config(["$httpProvider",function(n){n.interceptors.push("SpinnerInterceptor")}]).run(["SpinnerConfig","$rootScope",function(n,i){i.$on(n._START_REQUEST_,function(){n.isSpinning=!0}),i.$on(n._END_REQUEST_,function(){n.isSpinning=!1})}]).directive("spinner",["SpinnerConfig",function(n){var i=function(n){n.css("display",n.data("__display")||"inline")},t=function(n){n.data("__display",n.css("display")),n.css("display","none")};return{restrict:"A",link:function(e,r){n.isSpinning?i(r):t(r),e.$on(n._START_REQUEST_,function(){i(r)}),e.$on(n._END_REQUEST_,function(){t(r)})}}}]);