/*! odometer 0.4.7 */ (function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g=[].slice;q='',n=''+q+"",d='8'+n+"",g='',c="(,ddd).dd",h=/^\(?([^)]*)\)?(?:(.)(d+))?$/,i=30,f=2e3,a=20,j=2,e=.5,k=1e3/i,b=1e3/a,o="transitionend webkittransitionend otransitionend otransitionend mstransitionend",y=document.createelement("div").style,p=null!=y.transition||null!=y.webkittransition||null!=y.moztransition||null!=y.otransition,w=window.requestanimationframe||window.mozrequestanimationframe||window.webkitrequestanimationframe||window.msrequestanimationframe,l=window.mutationobserver||window.webkitmutationobserver||window.mozmutationobserver,s=function(a){var b;return b=document.createelement("div"),b.innerhtml=a,b.children[0]},v=function(a,b){return a.classname=a.classname.replace(new regexp("(^| )"+b.split(" ").join("|")+"( |$)","gi")," ")},r=function(a,b){return v(a,b),a.classname+=" "+b},z=function(a,b){var c;return null!=document.createevent?(c=document.createevent("htmlevents"),c.initevent(b,!0,!0),a.dispatchevent(c)):void 0},u=function(){var a,b;return null!=(a=null!=(b=window.performance)&&"function"==typeof b.now?b.now():void 0)?a:+new date},x=function(a,b){return null==b&&(b=0),b?(a*=math.pow(10,b),a+=.5,a=math.floor(a),a/=math.pow(10,b)):math.round(a)},a=function(a){return 0>a?math.ceil(a):math.floor(a)},t=function(a){return a-x(a)},c=!1,(b=function(){var a,b,c,d,e;if(!c&&null!=window.jquery){for(c=!0,d=["html","text"],e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(function(a){var b;return b=window.jquery.fn[a],window.jquery.fn[a]=function(a){var c;return null==a||null==(null!=(c=this[0])?c.odometer:void 0)?b.apply(this,arguments):this[0].odometer.update(a)}}(a));return e}})(),settimeout(b,0),m=function(){function a(b){var c,d,e,g,h,i,l,m,n,o,p=this;if(this.options=b,this.el=this.options.el,null!=this.el.odometer)return this.el.odometer;this.el.odometer=this,m=a.options;for(d in m)g=m[d],null==this.options[d]&&(this.options[d]=g);null==(h=this.options).duration&&(h.duration=f),this.max_values=this.options.duration/k/j|0,this.resetformat(),this.value=this.cleanvalue(null!=(n=this.options.value)?n:""),this.renderinside(),this.render();try{for(o=["innerhtml","innertext","textcontent"],i=0,l=o.length;l>i;i++)e=o[i],null!=this.el[e]&&!function(a){return object.defineproperty(p.el,a,{get:function(){var b;return"innerhtml"===a?p.inside.outerhtml:null!=(b=p.inside.innertext)?b:p.inside.textcontent},set:function(a){return p.update(a)}})}(e)}catch(q){c=q,this.watchformutations()}}return a.prototype.renderinside=function(){return this.inside=document.createelement("div"),this.inside.classname="odometer-inside",this.el.innerhtml="",this.el.appendchild(this.inside)},a.prototype.watchformutations=function(){var a,b=this;if(null!=l)try{return null==this.observer&&(this.observer=new l(function(){var a;return a=b.el.innertext,b.renderinside(),b.render(b.value),b.update(a)})),this.watchmutations=!0,this.startwatchingmutations()}catch(c){a=c}},a.prototype.startwatchingmutations=function(){return this.watchmutations?this.observer.observe(this.el,{childlist:!0}):void 0},a.prototype.stopwatchingmutations=function(){var a;return null!=(a=this.observer)?a.disconnect():void 0},a.prototype.cleanvalue=function(a){var b;return"string"==typeof a&&(a=a.replace(null!=(b=this.format.radix)?b:".",""),a=a.replace(/[.,]/g,""),a=a.replace("","."),a=parsefloat(a,10)||0),x(a,this.format.precision)},a.prototype.bindtransitionend=function(){var a,b,c,d,e,f,g=this;if(!this.transitionendbound){for(this.transitionendbound=!0,b=!1,e=o.split(" "),f=[],c=0,d=e.length;d>c;c++)a=e[c],f.push(this.el.addeventlistener(a,function(){return b?!0:(b=!0,settimeout(function(){return g.render(),b=!1,z(g.el,"odometerdone")},0),!0)},!1));return f}},a.prototype.resetformat=function(){var a,b,d,e,f,g,i,j;if(a=null!=(i=this.options.format)?i:c,a||(a="d"),d=h.exec(a),!d)throw new error("odometer: unparsable digit format");return j=d.slice(1,4),g=j[0],f=j[1],b=j[2],e=(null!=b?b.length:void 0)||0,this.format={repeating:g,radix:f,precision:e}},a.prototype.render=function(a){var b,c,d,e,f,g,h;for(null==a&&(a=this.value),this.stopwatchingmutations(),this.resetformat(),this.inside.innerhtml="",f=this.options.theme,b=this.el.classname.split(" "),e=[],g=0,h=b.length;h>g;g++)c=b[g],c.length&&((d=/^odometer-theme-(.+)$/.exec(c))?f=d[1]:/^odometer(-|$)/.test(c)||e.push(c));return e.push("odometer"),p||e.push("odometer-no-transitions"),e.push(f?"odometer-theme-"+f:"odometer-auto-theme"),this.el.classname=e.join(" "),this.ribbons={},this.formatdigits(a),this.startwatchingmutations()},a.prototype.formatdigits=function(a){var b,c,d,e,f,g,h,i,j,k;if(this.digits=[],this.options.formatfunction)for(d=this.options.formatfunction(a),j=d.split("").reverse(),f=0,h=j.length;h>f;f++)c=j[f],c.match(/0-9/)?(b=this.renderdigit(),b.queryselector(".odometer-value").innerhtml=c,this.digits.push(b),this.insertdigit(b)):this.addspacer(c);else for(e=!this.format.precision||!t(a)||!1,k=a.tostring().split("").reverse(),g=0,i=k.length;i>g;g++)b=k[g],"."===b&&(e=!0),this.adddigit(b,e)},a.prototype.update=function(a){var b,c=this;return a=this.cleanvalue(a),(b=a-this.value)?(v(this.el,"odometer-animating-up odometer-animating-down odometer-animating"),b>0?r(this.el,"odometer-animating-up"):r(this.el,"odometer-animating-down"),this.stopwatchingmutations(),this.animate(a),this.startwatchingmutations(),settimeout(function(){return c.el.offsetheight,r(c.el,"odometer-animating")},0),this.value=a):void 0},a.prototype.renderdigit=function(){return s(d)},a.prototype.insertdigit=function(a,b){return null!=b?this.inside.insertbefore(a,b):this.inside.children.length?this.inside.insertbefore(a,this.inside.children[0]):this.inside.appendchild(a)},a.prototype.addspacer=function(a,b,c){var d;return d=s(g),d.innerhtml=a,c&&r(d,c),this.insertdigit(d,b)},a.prototype.adddigit=function(a,b){var c,d,e,f;if(null==b&&(b=!0),"-"===a)return this.addspacer(a,null,"odometer-negation-mark");if("."===a)return this.addspacer(null!=(f=this.format.radix)?f:".",null,"odometer-radix-mark");if(b)for(e=!1;;){if(!this.format.repeating.length){if(e)throw new error("bad odometer format without digits");this.resetformat(),e=!0}if(c=this.format.repeating[this.format.repeating.length-1],this.format.repeating=this.format.repeating.substring(0,this.format.repeating.length-1),"d"===c)break;this.addspacer(c)}return d=this.renderdigit(),d.queryselector(".odometer-value").innerhtml=a,this.digits.push(d),this.insertdigit(d)},a.prototype.animate=function(a){return p&&"count"!==this.options.animation?this.animateslide(a):this.animatecount(a)},a.prototype.animatecount=function(a){var c,d,e,f,g,h=this;if(d=+a-this.value)return f=e=u(),c=this.value,(g=function(){var i,j,k;return u()-f>h.options.duration?(h.value=a,h.render(),void z(h.el,"odometerdone")):(i=u()-e,i>b&&(e=u(),k=i/h.options.duration,j=d*k,c+=j,h.render(math.round(c))),null!=w?w(g):settimeout(g,b))})()},a.prototype.getdigitcount=function(){var a,b,c,d,e,f;for(d=1<=arguments.length?g.call(arguments,0):[],a=e=0,f=d.length;f>e;a=++e)c=d[a],d[a]=math.abs(c);return b=math.max.apply(math,d),math.ceil(math.log(b+1)/math.log(10))},a.prototype.getfractionaldigitcount=function(){var a,b,c,d,e,f,g;for(e=1<=arguments.length?g.call(arguments,0):[],b=/^\-?\d*\.(\d*?)0*$/,a=f=0,g=e.length;g>f;a=++f)d=e[a],e[a]=d.tostring(),c=b.exec(e[a]),e[a]=null==c?0:c[1].length;return math.max.apply(math,e)},a.prototype.resetdigits=function(){return this.digits=[],this.ribbons=[],this.inside.innerhtml="",this.resetformat()},a.prototype.animateslide=function(a){var b,c,d,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y,z,b,c,d,e;if(s=this.value,j=this.getfractionaldigitcount(s,a),j&&(a*=math.pow(10,j),s*=math.pow(10,j)),d=a-s){for(this.bindtransitionend(),f=this.getdigitcount(s,a),g=[],b=0,m=v=0;f>=0?f>v:v>f;m=f>=0?++v:--v){if(t=a(s/math.pow(10,f-m-1)),i=a(a/math.pow(10,f-m-1)),h=i-t,math.abs(h)>this.max_values){for(l=[],n=h/(this.max_values+this.max_values*b*e),c=t;h>0&&i>c||0>h&&c>i;)l.push(math.round(c)),c+=n;l[l.length-1]!==i&&l.push(i),b++}else l=function(){e=[];for(var a=t;i>=t?i>=a:a>=i;i>=t?a++:a--)e.push(a);return e}.apply(this);for(m=w=0,y=l.length;y>w;m=++w)k=l[m],l[m]=math.abs(k%10);g.push(l)}for(this.resetdigits(),d=g.reverse(),m=x=0,z=d.length;z>x;m=++x)for(l=d[m],this.digits[m]||this.adddigit(" ",m>=j),null==(u=this.ribbons)[m]&&(u[m]=this.digits[m].queryselector(".odometer-ribbon-inner")),this.ribbons[m].innerhtml="",0>d&&(l=l.reverse()),o=c=0,b=l.length;b>c;o=++c)k=l[o],q=document.createelement("div"),q.classname="odometer-value",q.innerhtml=k,this.ribbons[m].appendchild(q),o===l.length-1&&r(q,"odometer-last-value"),0===o&&r(q,"odometer-first-value");return 0>t&&this.adddigit("-"),p=this.inside.queryselector(".odometer-radix-mark"),null!=p&&p.parent.removechild(p),j?this.addspacer(this.format.radix,this.digits[j-1],"odometer-radix-mark"):void 0}},a}(),m.options=null!=(e=window.odometeroptions)?e:{},settimeout(function(){var a,b,c,d,e;if(window.odometeroptions){d=window.odometeroptions,e=[];for(a in d)b=d[a],e.push(null!=(c=m.options)[a]?(c=m.options)[a]:c[a]=b);return e}},0),m.init=function(){var a,b,c,d,e,f;if(null!=document.queryselectorall){for(b=document.queryselectorall(m.options.selector||".odometer"),f=[],c=0,d=b.length;d>c;c++)a=b[c],f.push(a.odometer=new m({el:a,value:null!=(e=a.innertext)?e:a.textcontent}));return f}},null!=(null!=(f=document.documentelement)?f.doscroll:void 0)&&null!=document.createeventobject?(d=document.onreadystatechange,document.onreadystatechange=function(){return"complete"===document.readystate&&m.options.auto!==!1&&m.init(),null!=d?d.apply(this,arguments):void 0}):document.addeventlistener("domcontentloaded",function(){return m.options.auto!==!1?m.init():void 0},!1),"function"==typeof define&&define.amd?define(["jquery"],function(){return m}):"undefined"!=typeof exports&&null!==exports?module.exports=m:window.odometer=m}).call(this);