!function(b){var e=function(a,c){this.element=b(a);this.percent=this.position=0;var d="object"==typeof c;this.dangerMarker=b.fn.progressbar.defaults.dangerMarker;d&&"number"==typeof c.dangerMarker&&this.setDangerMarker(c.dangerMarker);this.warningMarker=b.fn.progressbar.defaults.warningMarker;d&&"number"==typeof c.warningMarker&&this.setWarningMarker(c.warningMarker);this.maximum=b.fn.progressbar.defaults.maximum;d&&"number"==typeof c.maximum&&this.setMaximum(c.maximum);this.step=b.fn.progressbar.defaults.step;
d&&"number"==typeof c.step&&this.setStep(c.step);this.element.html(b(g.template))};e.prototype={constructor:e,stepIt:function(){this.position<this.maximum&&(this.position+=this.step);this.setPosition(this.position)},setWarningMarker:function(a){a=parseInt(a);this.warningMarker=a>this.dangerMarker?this.dangerMarker:a},setDangerMarker:function(a){this.dangerMarker=parseInt(a)},setMaximum:function(a){this.maximum=parseInt(a)},setStep:function(a){a=parseInt(a);0>=a&&(a=1);this.step=parseInt(a)},setPosition:function(a){a=
parseInt(a);0>a&&(a=0);a>this.maximum&&(a=this.maximum);this.position=a;this.percent=Math.ceil(100*(this.position/this.maximum));try{this.percent<=this.warningMarker?(this.element.find(".bar-success").css("width",this.percent+"%"),this.element.find(".bar-warning").css("width","0%"),this.element.find(".bar-danger").css("width","0%")):(this.element.find(".bar-success").css("width",this.warningMarker+"%"),this.percent>this.warningMarker&&this.percent<=this.dangerMarker?(this.element.find(".bar-warning").css("width",
this.percent-this.warningMarker+"%"),this.element.find(".bar-danger").css("width","0%")):(this.element.find(".bar-warning").css("width",this.dangerMarker-this.warningMarker+"%"),this.element.find(".bar-danger").css("width",this.percent-this.dangerMarker+"%")))}finally{this._triggerPositionChanged()}},reset:function(){this.percent=this.position=0;this._triggerPositionChanged();this.element.find(".bar-success").css("width","0%");this.element.find(".bar-warning").css("width","0%");this.element.find(".bar-danger").css("width",
"0%")},_triggerPositionChanged:function(){this.element.trigger({type:"positionChanged",position:this.position,percent:this.percent})}};b.fn.progressbar=function(a){var c=Array.apply(null,arguments);c.shift();return this.each(function(){var d=b(this),f=d.data("progressbar"),g="object"==typeof a&&a;f||d.data("progressbar",new e(this,b.extend({},b.fn.progressbar().defaults,g)));"string"==typeof a&&"function"==typeof f[a]&&f[a].apply(f,c)})};b.fn.progressbar.defaults={warningMarker:50,dangerMarker:90,
maximum:100,step:1};b.fn.progressbar.Constructor=e;var g={template:'\x3cdiv class\x3d"progress"\x3e\x3cdiv class\x3d"bar bar-success progress-bar progress-bar-success" style\x3d"width: 0%;"\x3e\x3c/div\x3e\x3cdiv class\x3d"bar bar-warning progress-bar progress-bar-warning" style\x3d"width: 0%;"\x3e\x3c/div\x3e\x3cdiv class\x3d"bar bar-danger progress-bar progress-bar-danger" style\x3d"width: 0%;"\x3e\x3c/div\x3e\x3c/div\x3e'}}(window.jQuery);