(function(c){functiona(b,d){if({}.hasOwnProperty.call(a.cache,b))returna.cache[b];vare=a.resolve(b);if(!e)thrownewError('Failed to resolve module '+b);varc={id:b,require:a,filename:b,exports:{},loaded:!1,parent:d,children:[]};d&&d.children.push(c);varf=b.slice(0,b.lastIndexOf('/')+1);returna.cache[b]=c.exports,e.call(c.exports,c,c.exports,f,b),c.loaded=!0,a.cache[b]=c.exports}a.modules={},a.cache={},a.resolve=function(b){return{}.hasOwnProperty.call(a.modules,b)?a.modules[b]:void0},a.define=function(b,c){a.modules[b]=c};varb=function(a){returna='/',{title:'browser',version:'v0.10.5',browser:!0,env:{},argv:[],nextTick:c.setImmediate||function(a){setTimeout(a,0)},cwd:function(){returna},chdir:function(b){a=b}}}();a.define('/gif.coffee',function(b,k,j,i){functionc(a,b){return{}.hasOwnProperty.call(a,b)}functiong(d,b){for(vara=0,c=b.length;a<c;++a)if(ainb&&b[a]===d)return!0;return!1}functionh(a,b){functione(){this.constructor=a}for(vardinb)c(b,d)&&(a[d]=b[d]);returne.prototype=b.prototype,a.prototype=newe,a.__super__=b.prototype,a}vare,d,f;d=a('events',b).EventEmitter,e=a('/browser.coffee',b),f=function(f,b,d){functiona(d){vara,c;this.running=!1,this.options={},this.frames=[],this.freeWorkers=[],this.activeWorkers=[],this.setOptions(d);for(ainb)c=b[a],null!=this.options[a]?this.options[a]:this.options[a]=c}returnh(a,f),b={workerScript:window.GifWorkerURL,workers:2,repeat:0,background:'#fff',quality:10,width:null,height:null},d={delay:500,copy:!1},a.prototype.setOption=function(a,b){returnthis.options[a]=b,null!=this._canvas&&(a==='width'||a==='height')?this._canvas[a]=b:void0},a.prototype.setOptions=function(a){returnfunction(d){varb,e;for(bina){if(!c(a,b))continue;e=a[b],d.push(this.setOption(b,e))}returnd}.call(this,[])},a.prototype.addFrame=function(a,c){varb,e;null==c&&(c={}),b={};for(eind)b[e]=c[e]||d[e];if(null!=this.options.width||this.setOption('width',a.width),null!=this.options.height||this.setOption('height',a.height),'undefined'!==typeofImageData&&null!=ImageData&&ainstanceofImageData)b.data=a.data;elseif('undefined'!==typeofCanvasRenderingContext2D&&null!=CanvasRenderingContext2D&&ainstanceofCanvasRenderingContext2D||'undefined'!==typeofWebGLRenderingContext&&null!=WebGLRenderingContext&&ainstanceofWebGLRenderingContext)c.copy?b.data=this.getContextData(a):b.context=a;elseif(null!=a.childNodes)c.copy?b.data=this.getImageData(a):b.image=a;elsethrownewError('Invalid image');returnthis.frames.push(b)},a.prototype.render=function(){vard,a;if(this.running)thrownewError('Already running');if(!(null!=this.options.width&&null!=this.options.height))thrownewError('Width and height must be set prior to rendering');this.running=!0,this.nextFrame=0,this.finishedFrames=0,this.imageParts=function(b){vard;for(vara=0,c=function(){varb,b;b=[];for(vara=0;0<=this.frames.length?a<this.frames.length:a>this.frames.length;0<=this.frames.length?++a:--a)b.push(a);returnb}.apply(this,arguments).length;a<c;++a)d=function(){varb,b;b=[];for(vara=0;0<=this.frames.length?a<this.frames.length:a>this.frames.length;0<=this.frames.length?++a:--a)b.push(a);returnb}.apply(this,arguments)[a],b.push(null);returnb}.call(this,[]),a=this.spawnWorkers();for(varb=0,c=function(){varc,c;c=[];for(varb=0;0<=a?b<a:b>a;0<=a?++b:--b)c.push(b);returnc}.apply(this,arguments).length;b<c;++b)d=function(){varc,c;c=[];for(varb=0;0<=a?b<a:b>a;0<=a?++b:--b)c.push(b);returnc}.apply(this,arguments)[b],this.renderNextFrame();returnthis.emit('start'),this.emit('progress',0)},a.prototype.abort=function(){vara;while(!0){if(a=this.activeWorkers.shift(),!(null!=a))break;console.log('killing active worker'),a.terminate()}returnthis.running=!1,this.emit('abort')},a.prototype.spawnWorkers=function(){vara,b;returna=Math.min(this.options.workers,this.frames.length),function(){varc;c=[];for(varb=this.freeWorkers.length;this.freeWorkers.length<=a?b<a:b>a;this.freeWorkers.length<=a?++b:--b)c.push(b);returnc}.apply(this,arguments).forEach((b=this,function(d){vara,c;returnconsole.log('spawning worker '+