;var Goku=(function(b){function a(c){this.options=b.extend({debug:false,indicator:b("<div></div>").attr("id","kamehameha-indicator").appendTo(b("body")),watch:function(d){b(window).scroll(function(){d()})},shouldTrigger:function(d){var f=b(document).scrollTop();var e=b(document).height()-b(window).height();return f>=e},onHold:function(d,e){e()},onEmit:function(d,e){e()},restingSeconds:1},c);this.$indicator=this.options.indicator;this.isActing=false;this.counter=0}a.prototype.think=function(){if(!this.isActing&&this.options.shouldTrigger()){this.isActing=true;this.setStateClass("trigger");setTimeout(this.hold.bind(this),this.options.debug?1000:0)}};a.prototype.hold=function(){console.log("hold...");this.setStateClass("hold");this.counter+=1;this.options.onHold(this.counter,this.emit.bind(this))};a.prototype.emit=function(){console.log("emit!");this.setStateClass("emit");this.options.onEmit(this.counter,this.rest.bind(this))};a.prototype.rest=function(){console.log("take a rest...");this.setStateClass("rest");var c=this;setTimeout(function(){c.isActing=false;console.log("ready!");c.setStateClass("ready")},this.options.restingSeconds*1000)};a.prototype.setStateClass=function(c){this.$indicator.removeClass("rest trigger hold emit").addClass(c)};a.prototype.study=function(){this.options.watch(this.think.bind(this));this.setStateClass("ready")};return a})(jQuery);
;var Goku=(function(b){function a(c){this.options=b.extend({debug:false,indicator:b("<div></div>").attr("id","kamehameha-indicator").appendTo(b("body")),watch:function(d){b(window).scroll(function(){d()})},shouldTrigger:function(d){var f=b(document).scrollTop();var e=b(document).height()-b(window).height();return f>=e},onHold:function(d,e){e()},onEmit:function(d,e){e()},restingSeconds:1},c);this.$indicator=this.options.indicator;this.isActing=false;this.counter=0}a.prototype.think=function(){if(!this.isActing&&this.options.shouldTrigger()){this.isActing=true;this.setStateClass("trigger");setTimeout(this.hold.bind(this),this.options.debug?1000:0)}};a.prototype.hold=function(){console.log("hold...");this.setStateClass("hold");this.counter+=1;this.options.onHold(this.counter,this.emit.bind(this))};a.prototype.emit=function(){console.log("emit!");this.setStateClass("emit");if((arguments.length>0)){this.options.onEmit(this.counter,this.rest.bind(this),arguments[0])}else{this.options.onEmit(this.counter,this.rest.bind(this))}};a.prototype.rest=function(){console.log("take a rest...");this.setStateClass("rest");var c=this;setTimeout(function(){c.isActing=false;console.log("ready!");c.setStateClass("ready")},this.options.restingSeconds*1000)};a.prototype.setStateClass=function(c){this.$indicator.removeClass("ready trigger hold emit rest").addClass(c)};a.prototype.study=function(){this.options.watch(this.think.bind(this));this.setStateClass("ready")};return a})(jQuery);
update minified version