(function(f){if(typeofexports==="object"&&typeofmodule!=="undefined"){module.exports=f()}elseif(typeofdefine==="function"&&define.amd){define([],f)}else{varg;if(typeofwindow!=="undefined"){g=window}elseif(typeofglobal!=="undefined"){g=global}elseif(typeofself!=="undefined"){g=self}else{g=this}g.torque=f()}})(function(){vardefine,module,exports;returnfunction(){functionr(e,n,t){functiono(i,f){if(!n[i]){if(!e[i]){varc="function"==typeofrequire&&require;if(!f&&c)returnc(i,!0);if(u)returnu(i,!0);vara=newError("Cannot find module '"+i+"'");throwa.code="MODULE_NOT_FOUND",a}varp=n[i]={exports:{}};e[i][0].call(p.exports,function(r){varn=e[i][1][r];returno(n||r)},p,p.exports,r,e,n,t)}returnn[i].exports}for(varu="function"==typeofrequire&&require,i=0;i<t.length;i++)o(t[i]);returno}returnr}()({1:[function(require,module,exports){varAnimatorStepsRange=function(start,end){if(start<0)thrownewError("start must be a positive number");if(start>=end)thrownewError("start must be smaller than end");this.start=start;this.end=end};AnimatorStepsRange.prototype={diff:function(){returnthis.end-this.start},isLast:function(step){return(step|0)===this.end}};module.exports=AnimatorStepsRange},{}],2:[function(require,module,exports){(function(global){vartorque=require("./");varAnimatorStepsRange=require("./animator-steps-range");varrequestAnimationFrame=global.requestAnimationFrame||global.mozRequestAnimationFrame||global.webkitRequestAnimationFrame||global.msRequestAnimationFrame||function(callback){returnglobal.setTimeout(callback,1e3/60)};varcancelAnimationFrame=global.cancelAnimationFrame||global.mozCancelAnimationFrame||global.webkitCancelAnimationFrame||global.msCancelAnimationFrame||function(id){clearTimeout(id)};functionAnimator(callback,options){if(!options.steps){thrownewError("steps option missing")}this.options=options;this.running=false;this._tick=this._tick.bind(this);this._t0=+newDate;this.callback=callback;this._time=0;this.itemsReady=false;this.options=torque.extend({animationDelay:0,maxDelta:.2,loop:options.loop===undefined?true:options.loop},this.options);this.steps(options.steps)}Animator.prototype={start:function(){this.running=true;requestAnimationFrame(this._tick);this.options.onStart&&this.options.onStart();if(this.stepsRange().diff()===1){this.running=false}},isRunning:function(){returnthis.running},stop:function(){this.pause();this.time(this.stepsRange().start);this.options.onStop&&this.options.onStop()},time:function(_){if(!arguments.length)returnthis._time;this._time=_;vart=this.range(this.domain(this._time));this.callback(t)},toggle:function(){if(this.running){this.pause()}else{this.start()}},rescale:function(){this.domainInv=torque.math.linear(this.options.animationDelay,this.options.animationDelay+this.options.animationDuration);this.domain=this.domainInv.invert();this.range=torque.math.linear(0,this._defaultStepsRange.end);this.rangeInv=this.range.invert();this.time(this._time);this.running?this.start():this.pause();returnthis},duration:function(_){if(!arguments.length)returnthis.options.animationDuration;this.options.animationDuration=_;if(this.time()>_){this.time(0)}this.rescale();returnthis},steps:function(_){this.options.steps=_;this._defaultStepsRange=newAnimatorStepsRange(0,_);returnthis.rescale()},stepsRange:function(start,end){if(arguments.length===2){if(start<this._defaultStepsRange.start)thrownewError("start must be within default steps range");if(end>this._defaultStepsRange.end)thrownewError("end must be within default steps range");this._customStepsRange=newAnimatorStepsRange(start,end);this.options.onStepsRange&&this.options.onStepsRange();varstep=this.step()|0;if(step<start||step>end){this.step(start)}}returnthis._customStepsRange||this._defaultStepsRange},removeCustomStepsRange:function(){this._customStepsRange=undefined;this.options.onStepsRange&&this.options.onStepsRange()},step:function(s){if(arguments.length===0)returnthis.range(this.domain(this._time));this._time=this.domainInv(this.rangeInv(s))},pause:function(){this.running=false;cancelA