text: function FourierTransform(a,b){this.bufferSize=a,this.sampleRate=b,this.bandwidth=2/a*b/2,this.spectrum=new Float32Array(a/2),this.real=new Float32Array(a),this.imag=new Float32Array(a),this.peakBand=0,this.peak=0,this.getBandFrequency=function(a){return this.bandwidth*a+this.bandwidth/2},this.calculateSpectrum=function(){for(var b,c,d,e=this.spectrum,f=this.real,g=this.imag,h=2/this.bufferSize,i=Math.sqrt,j=0,k=a/2;k>j;j++)b=f[j],c=g[j],d=h*i(b*b+c*c),d>this.peak&&(this.peakBand=j,this.peak=d),e[j]=d}}function FFT(a,b){FourierTransform.call(this,a,b),this.reverseTable=new Uint32Array(a);for(var c,d=1,e=a>>1;a>d;){for(c=0;d>c;c++)this.reverseTable[c+d]=this.reverseTable[c]+e;d<<=1,e>>=1}for(this.sinTable=new Float32Array(a),this.cosTable=new Float32Array(a),c=0;a>c;c++)this.sinTable[c]=Math.sin(-Math.PI/c),this.cosTable[c]=Math.cos(-Math.PI/c)}function FourierTransform(a,b){this.bufferSize=a,this.sampleRate=b,this.bandwidth=2/a*b/2,this.spectrum=new Float32Array(a/2),this.real=new Float32Array(a),this.imag=new Float32Array(a),this.peakBand=0,this.peak=0,this.getBandFrequency=function(a){return this.bandwidth*a+this.bandwidth/2},this.calculateSpectrum=function(){for(var b,c,d,e=this.spectrum,f=this.real,g=this.imag,h=2/this.bufferSize,i=Math.sqrt,j=0,k=a/2;k>j;j++)b=f[j],c=g[j],d=h*i(b*b+c*c),d>this.peak&&(this.peakBand=j,this.peak=d),e[j]=d}}function FFT(a,b){FourierTransform.call(this,a,b),this.reverseTable=new Uint32Array(a);for(var c,d=1,e=a>>1;a>d;){for(c=0;d>c;c++)this.reverseTable[c+d]=this.reverseTable[c]+e;d<<=1,e>>=1}for(this.sinTable=new Float32Array(a),this.cosTable=new Float32Array(a),c=0;a>c;c++)this.sinTable[c]=Math.sin(-Math.PI/c),this.cosTable[c]=Math.cos(-Math.PI/c)}(function(){var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.push,h=d.slice,i=d.concat,j=e.toString,k=e.hasOwnProperty,l=d.forEach,m=d.map,n=d.reduce,o=d.reduceRight,p=d.filter,q=d.every,r=d.some,s=d.indexOf,t=d.lastIndexOf,u=Array.isArray,v=Object.keys,w=f.bind,x=function(a){return a instanceof x?a:this instanceof x?(this._wrapped=a,void 0):new x(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=x),exports._=x):a._=x,x.VERSION="1.5.1";var y=x.each=x.forEach=function(a,b,d){if(null!=a)if(l&&a.forEach===l)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;f>e;e++)if(b.call(d,a[e],e,a)===c)return}else for(var g in a)if(x.has(a,g)&&b.call(d,a[g],g,a)===c)return};x.map=x.collect=function(a,b,c){var d=[];return null==a?d:m&&a.map===m?a.map(b,c):(y(a,function(a,e,f){d.push(b.call(c,a,e,f))}),d)};var z="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),n&&a.reduce===n)return d&&(b=x.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(y(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(z);return c},x.reduceRight=x.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),o&&a.reduceRight===o)return d&&(b=x.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=x.keys(a);f=g.length}if(y(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(z);return c},x.find=x.detect=function(a,b,c){var d;return A(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},x.filter=x.select=function(a,b,c){var d=[];return null==a?d:p&&a.filter===p?a.filter(b,c):(y(a,function(a,e,f){b.call(c,a,e,f)&&d.push(a)}),d)},x.reject=function(a,b,c){return x.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},x.every=x.all=function(a,b,d){b||(b=x.identity);var e=!0;return null==a?e:q&&a.every===q?a.every(b,d):(y(a,function(a,f,g){return(e=e&&b.call(d,a,f,g))?void 0:c}),!!e)};var A=x.some=x.any=function(a,b,d){b||(b=x.identity);var e=!1;return null==a?e:r&&a.some===r?a.some(b,d):(y(a,function(a,f,g){return e||(e=b.call(d,a,f,g))?c:void 0}),!!e)};x.contains=x.include=function(a,b){return null==a?!1:s&&a.indexOf===s?-1!=a.indexOf(b):A(a,function(a){return a===b})},x.invoke=function(a,b){var c=h.call(arguments,2),d=x.isFunction(b);return x.map(a,function(a){return(d?b:a[b]).apply(a,c)})},x.pluck=function(a,b){return x.map(a,function(a){return a[b]})},x.where=function(a,b,c){return x.isEmpty(b)?c?void 0:[]:x[c?"find":"filter"](a,function(a){for(var c in b)if(b[c]!==a[c])return!1;return!0})},x.findWhere=function(a,b){return x.where(a,b,!0)},x.max=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.max.apply(Math,a);if(!b&&x.isEmpty(a))return-1/0;var d={computed:-1/0,value:-1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>d.computed&&(d={value:a,computed:g})}),d.value},x.min=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);if(!b&&x.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})}),d.value},x.shuffle=function(a){var b,c=0,d=[];return y(a,function(a){b=x.random(c++),d[c-1]=d[b],d[b]=a}),d};var B=function(a){return x.isFunction(a)?a:function(b){return b[a]}};x.sortBy=function(a,b,c){var d=B(b);return x.pluck(x.map(a,function(a,b,e){return{value:a,index:b,criteria:d.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index<b.index?-1:1}),"value")};var C=function(a,b,c,d){var e={},f=B(null==b?x.identity:b);return y(a,function(b,g){var h=f.call(c,b,g,a);d(e,h,b)}),e};x.groupBy=function(a,b,c){return C(a,b,c,function(a,b,c){(x.has(a,b)?a[b]:a[b]=[]).push(c)})},x.countBy=function(a,b,c){return C(a,b,c,function(a,b){x.has(a,b)||(a[b]=0),a[b]++})},x.sortedIndex=function(a,b,c,d){c=null==c?x.identity:B(c);for(var e=c.call(d,b),f=0,g=a.length;g>f;){var h=f+g>>>1;c.call(d,a[h])<e?f=h+1:g=h}return f},x.toArray=function(a){return a?x.isArray(a)?h.call(a):a.length===+a.length?x.map(a,x.identity):x.values(a):[]},x.size=function(a){return null==a?0:a.length===+a.length?a.length:x.keys(a).length},x.first=x.head=x.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:h.call(a,0,b)},x.initial=function(a,b,c){return h.call(a,0,a.length-(null==b||c?1:b))},x.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:h.call(a,Math.max(a.length-b,0))},x.rest=x.tail=x.drop=function(a,b,c){return h.call(a,null==b||c?1:b)},x.compact=function(a){return x.filter(a,x.identity)};var D=function(a,b,c){return b&&x.every(a,x.isArray)?i.apply(c,a):(y(a,function(a){x.isArray(a)||x.isArguments(a)?b?g.apply(c,a):D(a,b,c):c.push(a)}),c)};x.flatten=function(a,b){return D(a,b,[])},x.without=function(a){return x.difference(a,h.call(arguments,1))},x.uniq=x.unique=function(a,b,c,d){x.isFunction(b)&&(d=c,c=b,b=!1);var e=c?x.map(a,c,d):a,f=[],g=[];return y(e,function(c,d){(b?d&&g[g.length-1]===c:x.contains(g,c))||(g.push(c),f.push(a[d]))}),f},x.union=function(){return x.uniq(x.flatten(arguments,!0))},x.intersection=function(a){var b=h.call(arguments,1);return x.filter(x.uniq(a),function(a){return x.every(b,function(b){return x.indexOf(b,a)>=0})})},x.difference=function(a){var b=i.apply(d,h.call(arguments,1));return x.filter(a,function(a){return!x.contains(b,a)})},x.zip=function(){for(var a=x.max(x.pluck(arguments,"length").concat(0)),b=new Array(a),c=0;a>c;c++)b[c]=x.pluck(arguments,""+c);return b},x.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},x.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=x.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(s&&a.indexOf===s)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},x.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(t&&a.lastIndexOf===t)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},x.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);d>e;)f[e++]=a,a+=c;return f};var E=function(){};x.bind=function(a,b){var c,d;if(w&&a.bind===w)return w.apply(a,h.call(arguments,1));if(!x.isFunction(a))throw new TypeError;return c=h.call(arguments,2),d=function(){if(!(this instanceof d))return a.apply(b,c.concat(h.call(arguments)));E.prototype=a.prototype;var e=new E;E.prototype=null;var f=a.apply(e,c.concat(h.call(arguments)));return Object(f)===f?f:e}},x.partial=function(a){var b=h.call(arguments,1);return function(){return a.apply(this,b.concat(h.call(arguments)))}},x.bindAll=function(a){var b=h.call(arguments,1);if(0===b.length)throw new Error("bindAll must be passed function names");return y(b,function(b){a[b]=x.bind(a[b],a)}),a},x.memoize=function(a,b){var c={};return b||(b=x.identity),function(){var d=b.apply(this,arguments);return x.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},x.delay=function(a,b){var c=h.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},x.defer=function(a){return x.delay.apply(x,[a,1].concat(h.call(arguments,1)))},x.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:new Date,g=null,f=a.apply(d,e)};return function(){var j=new Date;h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k?(clearTimeout(g),g=null,h=j,f=a.apply(d,e)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},x.debounce=function(a,b,c){var d,e=null;return function(){var f=this,g=arguments,h=function(){e=null,c||(d=a.apply(f,g))},i=c&&!e;return clearTimeout(e),e=setTimeout(h,b),i&&(d=a.apply(f,g)),d}},x.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},x.wrap=function(a,b){return function(){var c=[a];return g.apply(c,arguments),b.apply(this,c)}},x.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},x.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},x.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)x.has(a,c)&&b.push(c);return b},x.values=function(a){var b=[];for(var c in a)x.has(a,c)&&b.push(a[c]);return b},x.pairs=function(a){var b=[];for(var c in a)x.has(a,c)&&b.push([c,a[c]]);return b},x.invert=function(a){var b={};for(var c in a)x.has(a,c)&&(b[a[c]]=c);return b},x.functions=x.methods=function(a){var b=[];for(var c in a)x.isFunction(a[c])&&b.push(c);return b.sort()},x.extend=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},x.pick=function(a){var b={},c=i.apply(d,h.call(arguments,1));return y(c,function(c){c in a&&(b[c]=a[c])}),b},x.omit=function(a){var b={},c=i.apply(d,h.call(arguments,1));for(var e in a)x.contains(c,e)||(b[e]=a[e]);return b},x.defaults=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)void 0===a[c]&&(a[c]=b[c])}),a},x.clone=function(a){return x.isObject(a)?x.isArray(a)?a.slice():x.extend({},a):a},x.tap=function(a,b){return b(a),a};var F=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof x&&(a=a._wrapped),b instanceof x&&(b=b._wrapped);var e=j.call(a);if(e!=j.call(b))return!1;switch(e){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;var g=a.constructor,h=b.constructor;if(g!==h&&!(x.isFunction(g)&&g instanceof g&&x.isFunction(h)&&h instanceof h))return!1;c.push(a),d.push(b);var i=0,k=!0;if("[object Array]"==e){if(i=a.length,k=i==b.length)for(;i--&&(k=F(a[i],b[i],c,d)););}else{for(var l in a)if(x.has(a,l)&&(i++,!(k=x.has(b,l)&&F(a[l],b[l],c,d))))break;if(k){for(l in b)if(x.has(b,l)&&!i--)break;k=!i}}return c.pop(),d.pop(),k};x.isEqual=function(a,b){return F(a,b,[],[])},x.isEmpty=function(a){if(null==a)return!0;if(x.isArray(a)||x.isString(a))return 0===a.length;for(var b in a)if(x.has(a,b))return!1;return!0},x.isElement=function(a){return!(!a||1!==a.nodeType)},x.isArray=u||function(a){return"[object Array]"==j.call(a)},x.isObject=function(a){return a===Object(a)},y(["Arguments","Function","String","Number","Date","RegExp"],function(a){x["is"+a]=function(b){return j.call(b)=="[object "+a+"]"}}),x.isArguments(arguments)||(x.isArguments=function(a){return!(!a||!x.has(a,"callee"))}),"function"!=typeof/./&&(x.isFunction=function(a){return"function"==typeof a}),x.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},x.isNaN=function(a){return x.isNumber(a)&&a!=+a},x.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==j.call(a)},x.isNull=function(a){return null===a},x.isUndefined=function(a){return void 0===a},x.has=function(a,b){return k.call(a,b)},x.noConflict=function(){return a._=b,this},x.identity=function(a){return a},x.times=function(a,b,c){for(var d=Array(Math.max(0,a)),e=0;a>e;e++)d[e]=b.call(c,e);return d},x.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))};var G={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};G.unescape=x.invert(G.escape);var H={escape:new RegExp("["+x.keys(G.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(G.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(a){x[a]=function(b){return null==b?"":(""+b).replace(H[a],function(b){return G[a][b]})}}),x.result=function(a,b){if(null==a)return void 0;var c=a[b];return x.isFunction(c)?c.call(a):c},x.mixin=function(a){y(x.functions(a),function(b){var c=x[b]=a[b];x.prototype[b]=function(){var a=[this._wrapped];return g.apply(a,arguments),M.call(this,c.apply(x,a))}})};var I=0;x.uniqueId=function(a){var b=++I+"";return a?a+b:b},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var J=/(.)^/,K={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(a,b,c){var d;c=x.defaults({},c,x.templateSettings);var e=new RegExp([(c.escape||J).source,(c.interpolate||J).source,(c.evaluate||J).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(L,function(a){return"\\"+K[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=new Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,x);var i=function(a){return d.call(this,a,x)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},x.chain=function(a){return x(a).chain()};var M=function(a){return this._chain?x(a).chain():a};x.mixin(x),y(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];x.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],M.call(this,c)}}),y(["concat","join","slice"],function(a){var b=d[a];x.prototype[a]=function(){return M.call(this,b.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this),FFT.prototype.forward=function(a){var b=this.bufferSize,c=this.cosTable,d=this.sinTable,e=this.reverseTable,f=this.real,g=this.imag;this.spectrum;var h=Math.floor(Math.log(b)/Math.LN2);if(Math.pow(2,h)!==b)throw"Invalid buffer size, must be a power of 2.";if(b!==a.length)throw"Supplied buffer is not the same size as defined FFT. FFT Size: "+b+" Buffer Size: "+a.length;var i,j,k,l,m,n,o,p,q,r=1;for(q=0;b>q;q++)f[q]=a[e[q]],g[q]=0;for(;b>r;){i=c[r],j=d[r],k=1,l=0;for(var s=0;r>s;s++){for(q=s;b>q;)m=q+r,n=k*f[m]-l*g[m],o=k*g[m]+l*f[m],f[m]=f[q]-n,g[m]=g[q]-o,f[q]+=n,g[q]+=o,q+=r<<1;p=k,k=p*i-l*j,l=p*j+l*i}r<<=1}return this.calculateSpectrum()},function(){function a(){for(var a in this.sections)this.sections[a].condition()&&this.sections[a].callback.call(this)}var b=function(){this.audioAdapter=b._getAdapter(this),this.events={},this.sections=[],this.bind("update",a)};b.adapters={},b.prototype={load:function(a){return a instanceof HTMLElement?(this.source=a,"flash"===b.isSupported()&&(this.source={src:b._getMP3SrcFromAudio(a)})):(this.source=window.Audio?new Audio:{},this.source.src=b._makeSupportedPath(a.src,a.codecs)),this.audio=this.audioAdapter.load(this.source),this},play:function(){return this.audioAdapter.play(),this},pause:function(){return this.audioAdapter.pause(),this},setVolume:function(a){return this.audioAdapter.setVolume(a),this},createKick:function(a){return new b.Kick(this,a)},bind:function(a,b){return this.events[a]||(this.events[a]=[]),this.events[a].push(b),this},unbind:function(a){return this.events[a]&&delete this.events[a],this},trigger:function(a){var b=this;return this.events[a]&&this.events[a].forEach(function(a){a.call(b)}),this},getVolume:function(){return this.audioAdapter.getVolume()},getProgress:function(){return this.audioAdapter.getProgress()},getTime:function(){return this.audioAdapter.getTime()},getFrequency:function(a,b){var c=0;if(void 0!==b){for(var d=a;b>=d;d++)c+=this.getSpectrum()[d];return c/(b-a+1)}return this.getSpectrum()[a]},getWaveform:function(){return this.audioAdapter.getWaveform()},getSpectrum:function(){return this.audioAdapter.getSpectrum()},isLoaded:function(){return this.audioAdapter.isLoaded},isPlaying:function(){return this.audioAdapter.isPlaying},after:function(a,b){var c=this;return this.sections.push({condition:function(){return c.getTime()>a},callback:b}),this},before:function(a,b){var c=this;return this.sections.push({condition:function(){return c.getTime()<a},callback:b}),this},between:function(a,b,c){var d=this;return this.sections.push({condition:function(){return d.getTime()>a&&d.getTime()<b},callback:c}),this},onceAt:function(a,b){var c=this,d=null;return this.sections.push({condition:function(){return c.getTime()>a&&!this.called},callback:function(){b.call(this),d.called=!0},called:!1}),d=this.sections[this.sections.length-1],this}},window.Dancer=b}(),function(a){function b(){var a=!!(navigator.vendor||"").match(/Apple/),b=navigator.userAgent.match(/Version\/([^ ]*)/);return b=b?parseFloat(b[1]):0,a&&6>=b}var c={mp3:"audio/mpeg;",ogg:'audio/ogg; codecs="vorbis"',wav:'audio/wav; codecs="1"',aac:'audio/mp4; codecs="mp4a.40.2"'},d=document.createElement("audio");a.options={},a.setOptions=function(b){for(var c in b)b.hasOwnProperty(c)&&(a.options[c]=b[c])},a.isSupported=function(){return window.Float32Array&&window.Uint32Array?b()||!window.AudioContext&&!window.webkitAudioContext?d&&d.mozSetup?"audiodata":FlashDetect.versionAtLeast(9)?"flash":"":"webaudio":null},a.canPlay=function(b){return d.canPlayType,!!("flash"===a.isSupported()?"mp3"===b.toLowerCase():d.canPlayType&&d.canPlayType(c[b.toLowerCase()]).replace(/no/,""))},a.addPlugin=function(b,c){void 0===a.prototype[b]&&(a.prototype[b]=c)},a._makeSupportedPath=function(b,c){if(!c)return b;for(var d=0;d<c.length;d++)if(a.canPlay(c[d]))return b+"."+c[d];return b},a._getAdapter=function(b){switch(a.isSupported()){case"webaudio":return new a.adapters.webkit(b);case"audiodata":return new a.adapters.moz(b);case"flash":return new a.adapters.flash(b);default:return null}},a._getMP3SrcFromAudio=function(a){var b=a.children;if(a.src)return a.src;for(var c=b.length;c--;)if((b[c].type||"").match(/audio\/mpeg/))return b[c].src;return null}}(window.Dancer),function(a){var b=function(b,c){c=c||{},this.dancer=b,this.frequency=c.frequency!==a?c.frequency:[0,10],this.threshold=c.threshold!==a?c.threshold:.3,this.decay=c.decay!==a?c.decay:.02,this.onKick=c.onKick,this.offKick=c.offKick,this.isOn=!1,this.currentThreshold=this.threshold;var d=this;this.dancer.bind("update",function(){d.onUpdate()})};b.prototype={on:function(){return this.isOn=!0,this},off:function(){return this.isOn=!1,this},set:function(b){b=b||{},this.frequency=b.frequency!==a?b.frequency:this.frequency,this.threshold=b.threshold!==a?b.threshold:this.threshold,this.decay=b.decay!==a?b.decay:this.decay,this.onKick=b.onKick||this.onKick,this.offKick=b.offKick||this.offKick},onUpdate:function(){if(this.isOn){var a=this.maxAmplitude(this.frequency);a>=this.currentThreshold&&a>=this.threshold?(this.currentThreshold=a,this.onKick&&this.onKick.call(this.dancer,a)):(this.offKick&&this.offKick.call(this.dancer,a),this.currentThreshold-=this.decay)}},maxAmplitude:function(a){var b=0,c=this.dancer.getSpectrum();if(!a.length)return a<c.length?c[~~a]:null;for(var d=a[0],e=a[1];e>=d;d++)c[d]>b&&(b=c[d]);return b}},window.Dancer.Kick=b}(),function(){function a(){this.source=this.context.createMediaElementSource(this.audio),this.source.connect(this.proc),this.source.connect(this.gain),this.gain.connect(this.context.destination),this.proc.connect(this.context.destination),this.isLoaded=!0,this.progress=1,this.dancer.trigger("loaded")}var b=2048,c=44100,d=function(a){this.dancer=a,this.audio=new Audio,this.context=window.AudioContext?new window.AudioContext:new window.webkitAudioContext};d.prototype={load:function(d){var e=this;return this.audio=d,this.isLoaded=!1,this.progress=0,this.proc=this.context.createJavaScriptNode(b/2,1,1),this.proc.onaudioprocess=function(a){e.update.call(e,a)},this.gain=this.context.createGainNode(),this.fft=new FFT(b/2,c),this.signal=new Float32Array(b/2),this.audio.readyState<3?this.audio.addEventListener("canplay",function(){a.call(e)}):a.call(e),this.audio.addEventListener("progress",function(a){a.currentTarget.duration&&(e.progress=a.currentTarget.seekable.end(0)/a.currentTarget.duration)}),this.audio},play:function(){this.audio.play(),this.isPlaying=!0},pause:function(){this.audio.pause(),this.isPlaying=!1},setVolume:function(a){this.gain.gain.value=a},getVolume:function(){return this.gain.gain.value},getProgress:function(){return this.progress},getWaveform:function(){return this.signal},getSpectrum:function(){return this.fft.spectrum},getTime:function(){return this.audio.currentTime},update:function(a){if(this.isPlaying&&this.isLoaded){var c,d=[],e=a.inputBuffer.numberOfChannels,f=b/e,g=function(a,b){return a[c]+b[c]};for(c=e;c--;)d.push(a.inputBuffer.getChannelData(c));for(c=0;f>c;c++)this.signal[c]=e>1?d.reduce(g(prev,curr))/e:d[0][c];this.fft.forward(this.signal),this.dancer.trigger("update")}}},Dancer.adapters.webkit=d}(),function(){function a(){this.fbLength=this.audio.mozFrameBufferLength,this.channels=this.audio.mozChannels,this.rate=this.audio.mozSampleRate,this.fft=new FFT(this.fbLength/this.channels,this.rate),this.signal=new Float32Array(this.fbLength/this.channels),this.isLoaded=!0,this.progress=1,this.dancer.trigger("loaded")}var b=function(a){this.dancer=a,this.audio=new Audio};b.prototype={load:function(b){var c=this;return this.audio=b,this.isLoaded=!1,this.progress=0,this.audio.readyState<3?this.audio.addEventListener("loadedmetadata",function(){a.call(c)},!1):a.call(c),this.audio.addEventListener("MozAudioAvailable",function(a){c.update(a)},!1),this.audio.addEventListener("progress",function(a){a.currentTarget.duration&&(c.progress=a.currentTarget.seekable.end(0)/a.currentTarget.duration)},!1),this.audio},play:function(){this.audio.play(),this.isPlaying=!0},pause:function(){this.audio.pause(),this.isPlaying=!1},setVolume:function(a){this.audio.volume=a},getVolume:function(){return this.audio.volume},getProgress:function(){return this.progress},getWaveform:function(){return this.signal},getSpectrum:function(){return this.fft.spectrum},getTime:function(){return this.audio.currentTime},update:function(a){if(this.isPlaying&&this.isLoaded){for(var b=0,c=this.fbLength/2;c>b;b++)this.signal[b]=(a.frameBuffer[2*b]+a.frameBuffer[2*b+1])/2;this.fft.forward(this.signal),this.dancer.trigger("update")}}},Dancer.adapters.moz=b}(),function(){function a(){var a=this;f=!0,b(Dancer.options.flashJS,function(){soundManager=new SoundManager,soundManager.flashVersion=9,soundManager.flash9Options.useWaveformData=!0,soundManager.useWaveformData=!0,soundManager.useHighPerformance=!0,soundManager.useFastPolling=!0,soundManager.multiShot=!1,soundManager.debugMode=!1,soundManager.debugFlash=!1,soundManager.url=Dancer.options.flashSWF,soundManager.onready(function(){e=!0,a.load()}),soundManager.ontimeout(function(){console.error("Error loading SoundManager2.swf")}),soundManager.beginDelayedInit()})}function b(a,b){var c=document.createElement("script"),d=document.getElementsByTagName("script")[0];c.type="text/javascript",c.src=a,c.onload=b,d.parentNode.insertBefore(c,d)}var c=1024,d=44100,e=!1,f=!1,g=.93,h=function(a){this.dancer=a,this.wave_L=[],this.wave_R=[],this.spectrum=[],window.SM2_DEFER=!0};h.prototype={load:function(b){var e=this;return this.path=b?b.src:this.path,this.isLoaded=!1,this.progress=0,!window.soundManager&&!f&&a.call(this),window.soundManager&&(this.audio=soundManager.createSound({id:"dancer"+Math.random(),url:this.path,stream:!0,autoPlay:!1,autoLoad:!0,whileplaying:function(){e.update()},whileloading:function(){e.progress=this.bytesLoaded/this.bytesTotal},onload:function(){e.fft=new FFT(c,d),e.signal=new Float32Array(c),e.waveform=new Float32Array(c),e.isLoaded=!0,e.progress=1,e.dancer.trigger("loaded")}}),this.dancer.audio=this.audio),this.audio},play:function(){this.audio.play(),this.isPlaying=!0},pause:function(){this.audio.pause(),this.isPlaying=!1},setVolume:function(a){this.audio.setVolume(100*a)},getVolume:function(){return this.audio.volume/100},getProgress:function(){return this.progress},getWaveform:function(){return this.waveform},getSpectrum:function(){return this.fft.spectrum},getTime:function(){return this.audio.position/1e3},update:function(){if(this.isPlaying||this.isLoaded){this.wave_L=this.audio.waveformData.left,this.wave_R=this.audio.waveformData.right;for(var a,b=0,c=this.wave_L.length;c>b;b++)a=parseFloat(this.wave_L[b])+parseFloat(this.wave_R[b]),this.waveform[2*b]=a/2,this.waveform[2*b+1]=a/2,this.signal[2*b]=a*g,this.signal[2*b+1]=a*g;this.fft.forward(this.signal),this.dancer.trigger("update")}}},Dancer.adapters.flash=h}(),FFT.prototype.forward=function(a){var b=this.bufferSize,c=this.cosTable,d=this.sinTable,e=this.reverseTable,f=this.real,g=this.imag;this.spectrum;var h=Math.floor(Math.log(b)/Math.LN2);if(Math.pow(2,h)!==b)throw"Invalid buffer size, must be a power of 2.";if(b!==a.length)throw"Supplied buffer is not the same size as defined FFT. FFT Size: "+b+" Buffer Size: "+a.length;var i,j,k,l,m,n,o,p,q,r=1;for(q=0;b>q;q++)f[q]=a[e[q]],g[q]=0;for(;b>r;){i=c[r],j=d[r],k=1,l=0;for(var s=0;r>s;s++){for(q=s;b>q;)m=q+r,n=k*f[m]-l*g[m],o=k*g[m]+l*f[m],f[m]=f[q]-n,g[m]=g[q]-o,f[q]+=n,g[q]+=o,q+=r<<1;p=k,k=p*i-l*j,l=p*j+l*i}r<<=1}return this.calculateSpectrum()};var FlashDetect=new function(){var a=this;a.installed=!1,a.raw="",a.major=-1,a.minor=-1,a.revision=-1,a.revisionStr="";var b=[{name:"ShockwaveFlash.ShockwaveFlash.7",version:function(a){return c(a)}},{name:"ShockwaveFlash.ShockwaveFlash.6",version:function(a){var b="6,0,21";try{a.AllowScriptAccess="always",b=c(a)}catch(d){}return b}},{name:"ShockwaveFlash.ShockwaveFlash",version:function(a){return c(a)}}],c=function(a){var b=-1;try{b=a.GetVariable("$version")}catch(c){}return b},d=function(a){var b=-1;try{b=new ActiveXObject(a)}catch(c){b={activeXError:!0}}return b},e=function(a){var b=a.split(",");return{raw:a,major:parseInt(b[0].split(" ")[1],10),minor:parseInt(b[1],10),revision:parseInt(b[2],10),revisionStr:b[2]}},f=function(a){var b=a.split(/ +/),c=b[2].split(/\./),d=b[3];return{raw:a,major:parseInt(c[0],10),minor:parseInt(c[1],10),revisionStr:d,revision:g(d)}},g=function(b){return parseInt(b.replace(/[a-zA-Z]/g,""),10)||a.revision};a.majorAtLeast=function(b){return a.major>=b},a.minorAtLeast=function(b){return a.minor>=b},a.revisionAtLeast=function(b){return a.revision>=b},a.versionAtLeast=function(){var b=[a.major,a.minor,a.revision],c=Math.min(b.length,arguments.length);for(i=0;c>i;i++){if(b[i]>=arguments[i]){if(c>i+1&&b[i]==arguments[i])continue;return!0}return!1}},a.FlashDetect=function(){if(navigator.plugins&&navigator.plugins.length>0){var c="application/x-shockwave-flash",g=navigator.mimeTypes;if(g&&g[c]&&g[c].enabledPlugin&&g[c].enabledPlugin.description){var h=g[c].enabledPlugin.description,i=f(h);a.raw=i.raw,a.major=i.major,a.minor=i.minor,a.revisionStr=i.revisionStr,a.revision=i.revision,a.installed=!0}}else if(-1==navigator.appVersion.indexOf("Mac")&&window.execScript)for(var h=-1,j=0;j<b.length&&-1==h;j++){var k=d(b[j].name);if(!k.activeXError&&(a.installed=!0,h=b[j].version(k),-1!=h)){var i=e(h);a.raw=i.raw,a.major=i.major,a.minor=i.minor,a.revision=i.revision,a.revisionStr=i.revisionStr}}}()};FlashDetect.JS_RELEASE="1.0.4";var Stats=function(){var a=Date.now(),b=a,c=0,d=1/0,e=0,f=0,g=1/0,h=0,i=0,j=0,k=document.createElement("div");k.id="stats",k.addEventListener("mousedown",function(a){a.preventDefault(),s(++j%2)},!1),k.style.cssText="width:80px;opacity:0.9;cursor:pointer";var l=document.createElement("div");l.id="fps",l.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002",k.appendChild(l);var m=document.createElement("div");m.id="fpsText",m.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px",m.innerHTML="FPS",l.appendChild(m);var n=document.createElement("div");for(n.id="fpsGraph",n.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff",l.appendChild(n);n.children.length<74;){var o=document.createElement("span");o.style.cssText="width:1px;height:30px;float:left;background-color:#113",n.appendChild(o)}var p=document.createElement("div");p.id="ms",p.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none",k.appendChild(p);var q=document.createElement("div");q.id="msText",q.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px",q.innerHTML="MS",p.appendChild(q);var r=document.createElement("div");for(r.id="msGraph",r.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0",p.appendChild(r);r.children.length<74;){var o=document.createElement("span");o.style.cssText="width:1px;height:30px;float:left;background-color:#131",r.appendChild(o)}var s=function(a){switch(j=a){case 0:l.style.display="block",p.style.display="none";break;case 1:l.style.display="none",p.style.display="block"}},t=function(a,b){var c=a.appendChild(a.firstChild);c.style.height=b+"px"};return{REVISION:11,domElement:k,setMode:s,begin:function(){a=Date.now()},end:function(){var j=Date.now();return c=j-a,d=Math.min(d,c),e=Math.max(e,c),q.textContent=c+" MS ("+d+"-"+e+")",t(r,Math.min(30,30-30*(c/200))),i++,j>b+1e3&&(f=Math.round(1e3*i/(j-b)),g=Math.min(g,f),h=Math.max(h,f),m.textContent=f+" FPS ("+g+"-"+h+")",t(n,Math.min(30,30-30*(f/100))),b=j,i=0),j},update:function(){a=this.end()}}};!function(a){var b={};a.Webvs=b,b.defineClass=function(a,b){return a.prototype=Object.create(b.prototype),a.prototype.constructor=a,a.super=b.prototype,_.chain(arguments).drop(2).each(function(b){_.extend(a.prototype,b)}),a},b.noop=function(){},b.checkRequiredOptions=function(a,b){for(var c in b){var d=b[c];if(!(d in a))throw new Error("Required option "+d+" not found")}},b.glslFloatRepr=function(a){return a+(0===a%1?".0":"")},b.parseColor=function(a){if(_.isArray(a)&&3==a.length)return a;if(_.isString(a)){var b;if(a=a.toLowerCase(),b=a.match(/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/))return _.chain(b).last(3).map(function(a){return parseInt(a,16)}).value();if(b=a.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/))return _.chain(b).last(3).map(function(a){return Math.min(parseInt(a,10),255)
  }).value()}throw new Error("Invalid Color Format")},b.parseColorNorm=function(a){return _.map(b.parseColor(a),function(a){return a/255})},b.logShaderError=function(a,b){var c=a.split("\n"),d=c.length.toString().length,e=b.match(/(\d+):(\d+)/);e&&(e=[parseInt(e[1],10),parseInt(e[2],10)]);var f=_.map(c,function(a,c){var f,g=c+1+"";for(f=0;f<d-g.length;f++)g="0"+g;var h="";if(e&&e[1]==c+1){var i="";for(f=0;f<e[0]+d+2;f++)i+=" ";h="\n"+i+"^\n"+i+b}return g+": "+a+h}).join("\n");console.log("Shader Error : \n"+f)};var c=function(){this.resolved=!1,this.listeners=[]};b.Promise=b.defineClass(c,Object,{resolve:function(){this.resolved||(this.resolved=!0,_.each(this.listeners,function(a){a()}))},onResolve:function(a){this.resolved?a():this.listeners.push(a)}}),b.joinPromises=function(a){var b=new c;if(a=_.filter(a,function(a){return!_.isUndefined(a)}),0===a.length)b.resolve();else{var d=a.length,e=function(){d--,0===d&&b.resolve()};_.each(a,function(a){a.resolved?e():a.onResolve(e)})}return b},_.flatMap=_.compose(_.flatten,_.map),b.blendModes={REPLACE:1,MAXIMUM:2,AVERAGE:3,ADDITIVE:4,SUBTRACTIVE1:5,SUBTRACTIVE2:6,MULTIPLY:7},_.extend(b,b.blendModes),b.getBlendMode=function(a){var c=b.blendModes[a];if(!c)throw new Error("Unknown blendMode "+a);return c},b.randString=function(a,b){var c=[];b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var d=0;a>d;d++)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")},b.clamp=function(a,b,c){return Math.min(Math.max(a,b),c)},b.getComponentClass=function(a){var c=b[a];if(!c)throw new Error("Unknown Component class "+a);return c}}(window),function(a){a.Resources={"avsres_texer_circle_edgeonly_19x19.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAMAAABFjsb+AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhFBMVEUAAAADAwMvLy9dXV1tbW0CAgJaWlrR0dH8/Pz+/v79/f1bW1sKCgqlpaXT09Nubm4xMTEeHh7S0tKCgoIGBgaBgYEuLi5sbGxeXl4cHBwbGxtvb29fX19ra2swMDDU1NQFBQV/f3+np6eoqKgLCwvQ0NBqamoEBAQyMjJhYWFxcXH///8GRExTAAAAAWJLR0QrJLnkCAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAK1JREFUGNN1kMkSgyAQRBViGMc1SpCYBYl7/v8Do2gocpBDF/Wqa3qmPe/w+YSeKPEdEpwZhBgCi4IfihNMs/ySZwUm8e5KoOTmx0tINmeEpZ1yxciMTwtuGS/SNUhA5cRVQBaVSBwmUC6a4c1hNd6NT/z5HosSeDrsCa81V7HGooYpcyBFbZlGut3xBr1t2Gho9x66FvtB1GLose1sU1KZXpR02xqn+TNP43HBX4kJCUk5wyykAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwOS0wNC0yOVQwMTo0OTozMCswNTowMPYYqoAAAAAASUVORK5CYII=","avsres_texer_circle_edgeonly_29x29.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAMAAABhTZc9AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAA3lBMVEUAAAANDQ0/Pz9xcXGRkZGbm5tycnIfHx+IiIjg4OD7+/v+/v7///8EBARoaGjn5+f8/Pzl5eXHx8e7u7sICAiXl5f6+vrx8fGVlZU4ODgKCgoBAQEJCQm+vr4oKCi9vb39/f2YmJikpKQLCwujo6NpaWmJiYknJyeKiorh4eE3Nzc2NjZAQEDk5ORzc3OSkpLGxsacnJy6urq5ubmdnZ3FxcWTk5M1NTWUlJTw8PDo6Oi8vLwgICCioqJqamqZmZmamprj4+PExMS4uLiLi4sODg5BQUF0dHSenp4PDw8GiJKZAAAAAWJLR0QMgbNRYwAAAAlwSFlzAAALEgAACxIB0t1+/AAAATRJREFUKM+tkltXgkAUhUczL+xBQGNAwEuRKVlpNxC8oGZa//8PRRoIjqsnz9M561tnZu+zNiFnqVz+onBZKOZzJ1ipXBEACgiVcumIiVUJVFZq9ZoiU0hVMQ2vVAZNbxgmMY2GroGpVmpTldFsJWOrjc71YbvKcGOnnrJvwbqJIAlNOyPDbkOKpd1Ba5Fs9TT0/3xWqM4Z1Kmz950X5HuODmThYdcUoRgctR7xtGuGGJkcNUcY7ppn+nLisq/07Z/dd7jxvxZHk38jzQOOerHmnEPHHB3HfkkfWu/4Vn58K1IKMMk6NuoIpvHQZZilsTEDmyeTGHYwOTzem6ATptJhhQy+61m/2fBcH2yR8SjOgyhXy9XHahnlKphnchXVdO3I+0w66ynh63Ozdb/c7eabnKV+AJulHNGcTEkjAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwOS0wNC0yOVQwMTo0OTozMCswNTowMPYYqoAAAAAASUVORK5CYII=","avsres_texer_circle_fade_13x13.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAMAAABFNRROAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAA9lBMVEUAAAADAwMGBgYICAgCAgIKCgoVFRUeHh4hISEdHR0JCQkODg4jIyM4ODhISEhNTU1HR0c3NzcNDQ0LCwskJCRGRkZoaGh/f3+Hh4d+fn5lZWVEREQXFxc6OjppaWmSkpKtra22trarq6uPj49mZmYHBwcgICBLS0uCgoKurq7Kysrd3d3JycmsrKxRUVGMjIy4uLjf39/+/v63t7eIiIhMTEyDg4Ovr6/MzMzLy8uAgIBJSUkEBAQYGBg8PDxsbGyVlZWwsLC5ubmTk5M5OTkWFhYMDAwmJiZKSkqEhIRqamoQEBA9PT1SUlI7OzsPDw8BAQH///+Cg4ycAAAAAWJLR0RRlGl8KgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAKRJREFUCNcljukWgVAAhO9tvRKVEhGyhISEspWsZef9n0bL/Jo5c+bMB0AsiOEYBJkIkqJRjmKINOTZQpHjBVRKoiiV5UpVqdURGW/URrOltTvdnkBBoPcHQ2NkjidKkcYAI02tmT03F0sO4UBHjrta2xttu4s7z98Hh+PJOMuXa/wZRrfgbrkPnhUTkGf04t7OR/qm9zD0kYRUkcjQfh7O6F7i/uybEULrc6ImAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwMy0xMC0wN1QwMzoxNzoxMiswNjowMNF3hcgAAAAASUVORK5CYII=","avsres_texer_circle_heavyblur_19x19.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAMAAABFjsb+AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABVlBMVEUAAAACAgIHBwcNDQ0RERETExMBAQEICAgVFRUiIiItLS01NTU3NzcgICA0NDRGRkZVVVVeXl5hYWEjIyM9PT1XV1dubm6BgYGMjIyQkJAfHx9dXV19fX2YmJirq6u2tra6uroDAwMUFBQzMzNWVlafn5+7u7vPz8/b29vf398hISFFRUVtbW2Xl5fY2Njr6+v09PT39/cMDAwsLCxTU1OAgICpqanOzs7q6ur4+Pj8/Pz+/v6qqqoQEBBcXFyKioq0tLTa2tr9/f3///+1tbWLi4sSEhJfX1+NjY24uLje3t729vYyMjKJiYnZ2dnz8/MLCwsrKytSUlJ+fn6oqKjNzc3p6ekGBgZDQ0Nra2uVlZXV1dXy8vL19fUxMTFUVFR5eXmcnJzMzMzc3NwdHR06OjpaWlqUlJSnp6eysrJqamp8fHyIiIgwMDBCQkJRUVEqKioPDw8hvXKsAAAAAWJLR0RDZ9ANYgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAU5JREFUGNM9kFVbwmAARr9tMEpKUhghoyRHCQyHhMTI0SnlSMn/f6OI+l6+z7k5B4DrIBjhcDkIDIG/oTy+QCi6EwkFfB56uyBELJHK5PdymVQiRn5QFFEoVWqN9kGrUauUCuRK8nRKPWYwmswmowHTK3U8AB4tuBWz2R3OJ6fDbsOsuAUCsMvt8Zp9fiJA+H12r8ftgkEwFI48R2NxMkHGY9GXSDgUBBSefE2liUwimyCJ9FsuiVMgLyoU6VI5k81mE+USXSyI8oCqJKupWp28cvVaqpqsUIBpNFvtTjdAZshAt9NuNRsM6In7gyE96o7fx90RPRz0xT0AcSfT2Zxe+D58C3o+m0643yIwu1zN1putabtZz1ZLFr76Bl3L8O5zn9tju/DSxdxSMezheFrpV6fjgWV+Y6FwXnee4JOzLg+j/1WhHnOhLkzv1vkLuBJAlyODjrgAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTMtMTAtMjNUMTg6MDk6NDErMDY6MDDn3a6/AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDA5LTA0LTI5VDAxOjQ5OjMwKzA1OjAw9hiqgAAAAABJRU5ErkJggg==","avsres_texer_circle_heavyblur_21x21.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABfVBMVEUAAAADAwMICAgNDQ0QEBASEhIBAQELCwsWFhYhISEqKiovLy8yMjIFBQUiIiJBQUFNTU1UVFRXV1cUFBQoKCg+Pj5TU1NlZWV0dHR9fX2AgIBmZmYRERFCQkJdXV13d3eNjY2cnJylpaWoqKgKCgqampqvr6/AwMDKysrNzc0VFRUxMTF2dnaZmZm2trbOzs7e3t7o6Ojr6+sHBwcfHx9AQECMjIzl5eXy8vL4+Pj6+voMDAxMTExzc3Obm5u/v7/d3d39/f3+/v4PDw8uLi58fHykpKTIyMjn5+f///8wMDBVVVV+fn6mpqbLy8vp6en5+fktLS1SUlJ7e3ujo6PHx8fm5ub39/dKSkpxcXG9vb3c3Nzx8fEGBgY/Pz9jY2OKioqtra3j4+NQUFCWlpazs7Pb29sCAgIJCQkgICA8PDxaWlp6enqsrKy8vLzGxsbJyckmJiaJiYmhoaEEBAQ7OztiYmJwcHB5eXlJSUkTExMeHh4sLCwdHR0ODg7+hS0uAAAAAWJLR0RJhwXkfAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAZhJREFUGNNFkfs3wnAYxr9jkynXXSqyXLZpGMXShWhbRWFCmUvlslgql1Xk/rdbEc+Pn/Oezznv8wDQDtTVDSNwdxfUA/4CWXrRPqvN2of2WqAO7EcGbINDwyPDQ4O2AaT/F2I4QdodzlGnY4wkcKyNIRc+TrknJqempyYn3NQ47mpJaJSgnAw74+E8MyzjpAiUNk9n58h5fmHR61vyebkFfp6cm4XAsuC3r7BcIBgKh4IBjl2x+4VlsIqvRdY3osGwKInhYHRjPbKGW4AcI+OJza2QmEwmxdDWZiJOxmQAp7Z3dpW9tGRSKb2n7O5sp2Ag7x8cZrJHqiglJVE9ymYOD/ZlYMGPT5jTs1zbmzs7ZU6OTW9eKJxfXCpXOTWt5q6Uy4vzgpAHEJbSHMVrz03AF7hRrosOLYXpAJRuy5Vq8e7+4fHh/q5YrZRvS+bHOmwUKpEaX0/U+Vqk4jdgvVVPAzGetOfmS/yl+aw9GUjjp8qGLFiJV43UXgmrIDc6teult3fjI/ZhfL6V9P+JgJ6nv+QvOv+7zzdrwFa1yCl9GAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMy0xMC0yM1QxODowOTo0MSswNjowMOfdrr8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDktMDQtMjlUMDE6NDk6MzArMDU6MDD2GKqAAAAAAElFTkSuQmCC","avsres_texer_circle_heavyblur_29x29.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAMAAABhTZc9AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACSVBMVEUAAAABAQEDAwMGBgYJCQkLCwsNDQ0ODg4EBAQPDw8WFhYcHBwgICAjIyMkJCQCAgIHBwcQEBAaGhosLCwzMzM4ODg8PDw9PT0ICAgiIiIuLi46OjpERERNTU1TU1NXV1dZWVkMDAwYGBgnJyc2NjZFRUVSUlJeXl5oaGhwcHB1dXV2dnZfX18KCgooKChMTExdXV1sbGx7e3uHh4ePj4+Tk5OVlZWUlJQVFRUmJiZOTk5iYmKIiIiXl5eioqKqqqqvr6+xsbEhISE1NTVLS0t5eXmhoaG8vLzExMTJycnLy8u7u7stLS1cXFykpKS2trbGxsbT09Pb29vh4eHj4+MZGRk5OTlRUVGgoKDKysra2trm5ubu7u7y8vLz8/Nra2sFBQUUFBQqKipDQ0N6enqWlpbZ2dno6Oj4+Pj6+vr7+/vp6ekxMTFnZ2eGhoa6urrR0dHl5eX5+fn8/Pz9/f3+/v7S0tIeHh5ubm6NjY2oqKjCwsLt7e339/f///9VVVVycnKRkZGtra3Hx8ff39/x8fGSkpI7Ozt0dHSurq6srKze3t4dHR1tbW2MjIynp6fBwcHs7OwwMDBKSkplZWWEhISfn5+5ubnQ0NDk5OQpKSlBQUFbW1t3d3fDw8PX19fn5+c3NzdPT09paWmFhYWdnZ2zs7Pr6+vw8PAXFxcrKyuLi4vPz8/Y2Njd3d0fHx9ISEirq6u3t7fAwMDFxcW4uLgTExNxcXGenp6mpqaCgoKKiopaWlpkZGRAQEBJSUkvLy80NDQSEhJl1IWqAAAAAWJLR0R+P7hBcwAAAAlwSFlzAAALEgAACxIB0t1+/AAAAvpJREFUKM9dk/k/2gEcxr/VN+UrlcRKoRJRvs4awrTE2NxHzuZu1RzTMWdEGpqbXLly39mY+9xfNpnZ7Pn1/Xqe1+f1ep4PADwKgUSBaCeMExpEIRHAcyGwoDPkgnPFu+JcIGcQ+4wTiG4kV3eyh+cLTw+yuyvJjUL4C5FoiOpFo3v7+DJ8fbzpNC8qhEY+QSbLj+0fwAkM4vK4QYHBAf5sPxbzERNgVggtNCw8IpIveBnFj4wIDwulhbDgh3AEJTqGJozlxcW/ShC9FiW8io/jxQppMdFEx2lYZ3GiJDaJnyx6k5L6NjXlnSiZnxQrSRQ7Yx1WVho9ncvPyMzKzsnNy83JzsrM4HPT6Wn5FASAxFClBeFxhZlFxSWlsvey0pLioszCuLICKRWDBMorKqs41TWiLPkHmUKpUipkH+VZoppqTlVldDlAIdVK6uqTGz41ytQarU6rUcsaPzck19dJaklEAG5iBzS3tLYVt+s1uo6ODp1G317c1trSHMBuggEmjtZp6Oo29piU2g6HtEpTj7H7i6GThmMCTHGvb5+gPzVXptI9UJ1KlpvaL+jz7aUyATROeu81G7+a1NqHZK363mvuMnRKcWgAHmAXDA4Nj8hH9RoH1mr0o/KR4aHBAvYADBDzx8YnLJNT0zMmher+ZpXCNDM9NWmZGB/LJwLYilnr3HyUeWFxyaRXK9V609Ligjlqfs46W4EFCE5i2/LK6tq6cTFvY9O0uZG3aFxfW11Ztomd7luibG1bGYadwvWF3b39nv293YX1wh0Dw7q9RXR0j7GTDzjcnbVv3w+PjEeHP8xrO9zgA7Id89A/6hhvG+ecWASnZwnmhLNTgeWEI7HhK1C/9whCMbYDRiDv/ILfxb845wUyDmwxEIj4Mx0IT7YKL6/Kgk6Cyq4uhVYyHoKfVkkAj+2V7OubZZ9On+Wba3al/Rj8Z7IIFGbLHnJ75yG13d2G2CEM6vk7IInMY5aLHWd3Yf1kEpHA/yJgUSCMhkEUlvBk/AXCBOhMJK+/nwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMy0xMC0yM1QxODowOTo0MSswNjowMOfdrr8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDMtMTAtMDZUMjI6MDc6NDYrMDY6MDA+xvzGAAAAAElFTkSuQmCC","avsres_texer_circle_sharp_09x09.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAMAAACecocUAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAOVBMVEUAAAACAgJhYWG+vr7b29tiYmKoqKj+/v7///9jY2PBwcHf39/CwsJlZWUDAwOsrKxmZmbDw8Pg4ODJk53hAAAAAWJLR0QIht6VegAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAElJREFUCNdVzUsSwCAIA1CtVakfUO9/WINlY1YvM0xw7op/whuiP0yZiHLSEpUoH1zoT4GrucLN3OBu9x1mOTvCOspjrjn4froBkegClm06guAAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTMtMTAtMjNUMTg6MDk6NDErMDY6MDDn3a6/AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDAzLTA2LTI5VDE5OjA5OjMyKzA2OjAw50C8rwAAAABJRU5ErkJggg==","avsres_texer_circle_sharp_19x19.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAe1BMVEUAAAAFBQVBQUGGhoaurq68vLyvr68GBgYBAQFNTU3Ozs78/Pz+/v7///+Kior6+vr9/f2Li4vR0dFCQkJDQ0OIiIiJiYmzs7PBwcG0tLRERETT09NRUVH7+/uQkJCRkZFTU1PU1NRUVFQHBwdHR0eMjIy1tbXDw8NISEjxdmZoAAAAAWJLR0QN9rRh9QAAAAlwSFlzAAALEgAACxIB0t1+/AAAAJ5JREFUGNN9ke0SgiAUBUUrQbhA9qGpWGZa7/+EgZoCNu7PnTPALEGwAQqj3f4QhbHlMEkoAwBGE4LnIRfwQ3A0LbmEBXkc10SAjSBGxim4pObKE/UsPWt7YZ5lV20z8Mm0zVc2/7u9actX53JtC+lZWZj3lp4th0SVcqSqxg6106GeqqF6Wav7nBg/Gjn0lc0TW93bV9e/++7Tbn3YF1ESEZb9e6HrAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwOS0wNC0yOVQwMTo0OTozMCswNTowMPYYqoAAAAAASUVORK5CYII=","avsres_texer_circle_slightblur_13x13.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAMAAABFNRROAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAASFBMVEUAAAABAQEODg4jIyMtLS0EBARsbGyZmZmoqKiKiorT09Py8vL4+Pj7+/v+/v7///8kJCRtbW3U1NSLi4uampqpqakPDw8uLi7NF0qwAAAAAWJLR0QPGLoA2QAAAAlwSFlzAAALEgAACxIB0t1+/AAAAGhJREFUCNdljkcOwCAMBCmmF9NC/v/TGJBySHwbjXbXjH2PCwlS8AMKtLFGg9oGnA8xeAfLCu1Txpy8FkTShIyIORhJBDbiumiBqLyurFxtO9d2jkNv1Nn67qS9Oq5Rzx7ZWe4y+e/HB1hhBEsscYLrAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwMy0xMC0wNlQyMTozODowMCswNTowMB7KOaoAAAAASUVORK5CYII=","avsres_texer_circle_slightblur_21x21.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAvVBMVEUAAAACAgIDAwMEBAQQEBAgICAsLCwwMDABAQEODg5MTExnZ2d5eXl+fn4TExM9PT1tbW2Xl5e0tLTFxcXKysqvr6/W1tbs7Oz19fX4+Pjg4OD39/f9/f3+/v6YmJj///8RERFoaGi1tbV6enrGxsb29vYxMTGAgIDLy8t/f38tLS0hISG2trbt7e1NTU2ZmZnX19dubm6xsbHh4eGwsLAPDw8+Pj57e3sUFBRvb2/MzMxpaWmBgYEiIiIyMjK3SG45AAAAAWJLR0QfBQ0QvQAAAAlwSFlzAAALEgAACxIB0t1+/AAAAPNJREFUGNN9ketygjAQhZVLCpgKagEjRAKC2nAVC2itvv9jOcRI0Rk9P7/ZOXv27GDwXkNh+IxESQYfQJbEHlNUoI3gJxxpQFU6ONaNyXT2NZtODH18p6oOTcueo7ltmVBXuScwzIXjYoxdZ2Ea4OYtaUvLwV4r7FhLjTAq+4Hteje5duDLLCdYhRHmFEchBG1uYb3Zoo6i7fdaaGfp4+yKshtjP0k73zTwY7aNZHnBLTAq8ozwvLtyj1hetP/ZUd5FVTdlkUYoSouyqat7D4f6mCfhb5jkx/rwX09Fs1Pz15wyWim9LkVyphcak36/r37xpCumwx2LqyXT8gAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMy0xMC0yM1QxODowOTo0MSswNjowMOfdrr8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDMtMTAtMDZUMjA6NDA6MjIrMDU6MDAsCqMMAAAAAElFTkSuQmCC","avsres_texer_hexagon-h_blur_123x123.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHsAAAB7AgMAAAApqRfsAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEUAAACIiIjMzMz///+lqQOCAAAAAWJLR0QDEQxM8gAAAAlwSFlzAAALEgAACxIB0t1+/AAAAXJJREFUSMft17FVwzAURuHgwhSMQKERvEI2ygh4BK1BltAKjECREVxAIQSH4MTvSfpvKhpQe8/J8efY0vNu979+Y90dzXr2/b6Y9eH7g+1l73pwfXb94PqL68n1k7t8l8ub7YPv75JXAT3PA0PVLfBQdQtMVTfAiueAQ92z5DngY90NMDR6lDwLTI2+ATZ4Bji0epY8A2zxtsCp2aPkbYGp2U+StwEO7Z4lbwNs867AqdNX4FOnv0peKYvkXYBjr2fJuwB7vBU4dXuUvBWYun2RvB/g2O9Z8r6Ae8k7AyfRo+SdgUn0RfK+gaPqubUzWmBQvXCn36frIx/dH7y/k+jxhv+Xng96vuj5pOcb348+MN70ftL7TfsD7S+0P+H+1gOu+yPtr7Q/0/5O5wOdL3g+tYHX843ORzpf6Xym853mA5wvguTxfEPzEc1XNJ/RfIfzYQ2cTaf5lOZbmo9pvqb5HOd7D5xdp+8L+j6h75u/uj4BxUT7mSYYfpEAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTMtMTAtMjNUMTg6MDk6NDErMDY6MDDn3a6/AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDExLTA0LTExVDAwOjM0OjU4KzA1OjAwAHKiyQAAAABJRU5ErkJggg==","avsres_texer_square_edgeonly_24x24.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAQMAAADaua+7AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEX///8AAABVwtN+AAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABJJREFUCNdjYEAC8v9/UAUjAQD7uCWNIgeQwQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMy0xMC0yM1QxODowOTo0MSswNjowMOfdrr8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDMtMTAtMDZUMjE6NTc6NDYrMDU6MDDg7pOkAAAAAElFTkSuQmCC","avsres_texer_square_edgeonly_28x28.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcAQMAAABIw03XAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEX///8AAABVwtN+AAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABNJREFUCNdjYEAF8v//N9CPQAUArWA5f2D2DX0AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTMtMTAtMjNUMTg6MDk6NDErMDY6MDDn3a6/AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDAzLTEwLTA2VDIxOjU4OjQ0KzA1OjAwhnrZAAAAAABJRU5ErkJggg==","avsres_texer_square_edgeonly_30x30.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeAQMAAAAB/jzhAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEX///8AAABVwtN+AAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABRJREFUCNdjYEAF8v//PxgIAhUAAOmGR7lQ6SOhAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwMy0xMC0wNlQyMTo1OToxOCswNTowMOb41i4AAAAASUVORK5CYII=","avsres_texer_square_sharp_20x20.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAQMAAADaua+7AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAAAD///+l2Z/dAAAAAWJLR0QB/wIt3gAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABJJREFUCNdjYIAC+/9/qIqhAABLlCyJ9A7ihwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMy0xMC0yM1QxODowOTo0MSswNjowMOfdrr8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDMtMDYtMjlUMTk6Mzg6MDQrMDU6MDBuiiynAAAAAElFTkSuQmCC","avsres_texer_square_sharp_32x32.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoAQMAAAC2MCouAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAAAD///+l2Z/dAAAAAWJLR0QB/wIt3gAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABVJREFUCNdjYMAB+P////9hCJM4AACQJX+BjmWyDAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMy0xMC0yM1QxODowOTo0MSswNjowMOfdrr8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDktMTAtMDhUMDE6NTM6NTYrMDU6MDBzUO7GAAAAAElFTkSuQmCC","avsres_texer_square_sharp_48x48.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4AQMAAACSSKldAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAAAD///+l2Z/dAAAAAWJLR0QB/wIt3gAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABZJREFUGNNjYCAA+P+DwIdReoBoAgAAldYe8LB8aUoAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTMtMTAtMjNUMTg6MDk6NDErMDY6MDDn3a6/AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDA5LTEwLTA4VDAxOjUzOjI4KzA1OjAwKaqcggAAAABJRU5ErkJggg==","avsres_texer_square_sharp_60x60.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABEAQMAAAAC3QHxAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAAAD///+l2Z/dAAAAAWJLR0QB/wIt3gAAAAlwSFlzAAALEgAACxIB0t1+/AAAABdJREFUKM9jYCAS8P+HgFHWKIuaLCIBAH8IpfBELmrmAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwOS0xMC0wOFQwMTo1NDozMiswNTowMKOs2CsAAAAASUVORK5CYII=","avsres_texer_square_sharp_64x64.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQAQMAAAC032DuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAAAD///+l2Z/dAAAAAWJLR0QB/wIt3gAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABdJREFUKM9jYKAV+A8Fo8xR5lBk0gYAAMbE/hBbX3sVAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwOS0xMC0wOFQwMjoxODowMCswNjowML8mns0AAAAASUVORK5CYII=","avsres_texer_square_sharp_72x72.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABUAQMAAAAmpYKCAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAAAD///+l2Z/dAAAAAWJLR0QB/wIt3gAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABpJREFUKM9jYKASYP4PBX9G2aPsUTa12VQCABpBhZc9Qe3KAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwOS0xMC0wOFQwMjowMjoxNiswNjowMMbw5GAAAAAASUVORK5CYII=","avsres_texer_square_sharp_96x96.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAABwAQMAAAD8LmYIAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAAAD///+l2Z/dAAAAAWJLR0QB/wIt3gAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAB1JREFUOMtjYBgo8B8JjHJHuaPcUe4od/BwBwYAAB86e71LirdOAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTIzVDE4OjA5OjQxKzA2OjAw592uvwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAwOS0xMC0wOFQwMjoxODo0NiswNjowMFi8pQ0AAAAASUVORK5CYII=","avsres_texer_square_sharp_250x250.bmp":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQoAAAEKAQMAAADQBYmKAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAAAD///+l2Z/dAAAAAWJLR0QB/wIt3gAAAAlwSFlzAAALEgAACxIB0t1+/AAAADlJREFUaN7tykENAAAIBCD7p7KZFrgZwMGbKrK5taIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoivKpkCyUd+T92W3T7QAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMy0xMC0yM1QxODowOTo0MSswNjowMOfdrr8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTEtMDEtMDVUMTg6NTk6NTQrMDU6MDBwiLErAAAAAElFTkSuQmCC"}}(Webvs),function(a){function b(){}a.AnalyserAdapter=a.defineClass(b,Object,{beat:!1,isPlaying:function(){return!1},getWaveform:function(){return new Float32Array(0)},getSpectrum:function(){return new Float32Array(0)}})}(Webvs),function(a){function b(a){this.dancer=a,this.beat=!1;var b=this;this.kick=a.createKick({onKick:function(){b.beat=!0},offKick:function(){b.beat=!1}}),this.kick.on()}a.DancerAdapter=a.defineClass(b,a.AnalyserAdapter,{isPlaying:function(){return this.dancer.isPlaying()},getWaveform:function(){return this.dancer.getWaveform()},getSpectrum:function(){return this.dancer.getSpectrum()}})}(Webvs),function(a){function b(b){if(a.checkRequiredOptions(b,["canvas","analyser"]),b=_.defaults(b,{showStat:!1}),this.canvas=b.canvas,this.analyser=b.analyser,this.isStarted=!1,b.showStat){var c=new Stats;c.setMode(0),c.domElement.style.position="absolute",c.domElement.style.right="5px",c.domElement.style.bottom="5px",document.body.appendChild(c.domElement),this.stats=c}this.resources={},this.rootComponent=new a.EffectList({id:"root"}),this._registerContextEvents(),this._initGl()}a.Main=a.defineClass(b,Object,{_registerContextEvents:function(){var a=this;this.canvas.addEventListener("webglcontextlost",function(b){b.preventDefault(),a.stop()}),this.canvas.addEventListener("webglcontextrestored",function(){a.resetCanvas()})},_initGl:function(){try{this.gl=this.canvas.getContext("experimental-webgl",{alpha:!1}),this.copier=new a.CopyProgram({dynamicBlend:!0}),this.copier.init(this.gl),this.resolution={width:this.canvas.width,height:this.canvas.height}}catch(b){throw new Error("Couldnt get webgl context"+b)}},loadPreset:function(b){b=_.clone(b),b.id="root";var c=new a.EffectList(b);this.stop(),this.rootComponent.destroy(),this.rootComponent=c,this.resources=b.resources||{}},resetCanvas:function(){this.stop();var b=this.rootComponent.getOptions();this.rootComponent.destroy(),this.copier.cleanup(),this._initGl(),this.rootComponent=new a.EffectList(b)},start:function(){if(!this.isStarted){var a=this,b=function(){a.analyser.isPlaying()&&a.rootComponent.update(),a.animReqId=requestAnimationFrame(b)};if(this.stats){var c=b;b=function(){a.stats.begin(),c.call(this,arguments),a.stats.end()}}this.rootComponent.componentInited||(this.registerBank={},this.bootTime=(new Date).getTime(),this.rootComponent.init(this.gl,this)),this.animReqId=requestAnimationFrame(b),this.isStarted=!0}},stop:function(){_.isUndefined(this.animReqId)||(cancelAnimationFrame(this.animReqId),this.isStarted=!1)},getPreset:function(){var a=this.rootComponent.getOptions();return a.resources=this.resources,a},addComponent:function(a,b,c){return b=_.clone(b),this.rootComponent.addComponent(a,b,c),res},updateComponent:function(b,c){if(c=_.clone(c),c.id=b,"root"==b){var d=this.rootComponent.detachAllComponents();return c=_.defaults(c,this.rootComponent.options),this.rootComponent.destroy(),this.rootComponent=new a.EffectList(c,d),this.rootComponent.init(this.gl,this),!0}return this.rootComponent.updateComponent(b,c)},removeComponent:function(a){var b=this.rootComponent.detachComponent(a);return b?(b.destroy(),!0):!1},moveComponent:function(a,b,c){var d=this.rootComponent.detachComponent(a);return d?this.rootComponent.addComponent(b,d,c):!1},getResource:function(b){var c;return c=this.resources[b],c||(c=a.Resources[b]),c||(c=b),c},setResource:function(a,b){this.resources[a]=b},traverse:function(a){this.rootComponent.traverse(a)}}),b.ui={leaf:!1,disp:"Main",schema:{name:{type:"string",title:"Name"},author:{type:"string",title:"Author"},description:{type:"string",title:"Description"},clearFrame:{type:"boolean",title:"Clear every frame","default":!1,required:!0}}}}(Webvs),function(a){function b(a){this.id=a.id,this.enabled=_.isUndefined(a.enabled)?!0:a.enabled,this.componentInited=!1,this.options=a}a.Component=a.defineClass(b,Object,{componentName:"Component",init:function(a,b,c){this.gl=a,this.main=b,this.parent=c,this.componentInited=!0},adoptOrInit:function(a,b,c){return this.componentInited?this.adopt(c):this.init(a,b,c)},adopt:function(a){this.parent=a},update:function(){},destroy:function(){},getOptions:function(){return this.options},getPath:function(){return _.isUndefined(this.parent)||_.isUndefined(this.id)?this.componentName+"#Main":this.parent.getIdString()+"/"+this.componentName+"#"+this.id}})}(Webvs),function(a){function b(a,c){b.super.constructor.call(this,a),this.components=[],_.each(c||a.components||[],function(a){this.addComponent(this.id,a)},this)}a.Container=a.defineClass(b,a.Component,{init:function(a,c,d){b.super.init.call(this,a,c,d);for(var e=0;e<this.components.length;e++)this.components[e].adoptOrInit(a,c,this)},destroy:function(){b.super.destroy.call(this);for(var a=0;a<this.components.length;a++)this.components[a].destroy()},addComponent:function(c,d,e){d instanceof a.Component||(d.id=d.id||a.randString(5));var f;if(c==this.id)return f=d instanceof a.Component?d:new(a.getComponentClass(d.type))(d),this.componentInited&&f.adoptOrInit(this.gl,this.main,this),_.isNumber(e)?this.components.splice(e,0,f):this.components.push(f),f.id;for(var g=0;g<this.components.length;g++)if(f=this.components[g],f instanceof b){var h=f.addComponent(c,d,e);if(h)return h}},updateComponent:function(c,d){var e,f;for(f=0;f<this.components.length;f++)if(e=this.components[f],e.id==c){d=_.defaults(d,e.options),d.id=c;var g=e instanceof b?e.detachAllComponents():void 0,h=new(a.getComponentClass(d.type))(d,g);return this.componentInited&&h.adoptOrInit(this.gl,this.main,this),this.components[f]=h,e.destroy(),!0}for(f=0;f<this.components.length;f++)if(e=this.components[f],e instanceof b&&e.updateComponent(c,d))return!0},detachAllComponents:function(){var a=this.components;return this.components=[],a},detachComponent:function(a){var c,d;for(d=0;d<this.components.length;d++)if(c=this.components[d],c.id==a)return this.components.splice(d,1),c;for(d=0;d<this.components.length;d++)if(c=this.components[d],c instanceof b){var e=c.detachComponent(a);if(e)return e}},getOptions:function(){var a=this.options;a.components=[];for(var b=0;b<this.components.length;b++)a.components.push(this.components[b].getOptions());return a},traverse:function(a){a.call(this,this.id,this.parent?this.parent.id:void 0,this.options);for(var c=0;c<this.components.length;c++){var d=this.components[c];if(d instanceof b)d.traverse(a);else{var e=d.parent?d.parent.id:void 0,f=d.id,g=d.options;a.call(d,f,e,g)}}}})}(Webvs),function(a){function b(c){c=_.defaults(c,{output:"REPLACE",input:"IGNORE",clearFrame:!1,enableOnBeat:!1,enableOnBeatFor:1}),this.output="IGNORE"==c.output?-1:a.blendModes[c.output],this.input="IGNORE"==c.input?-1:a.blendModes[c.input],this.clearFrame=c.clearFrame,this.enableOnBeat=c.enableOnBeat,this.enableOnBeatFor=c.enableOnBeatFor,this.first=!0,this._frameCounter=0,this._inited=!1;var d=new a.ExprCodeGenerator(c.code,["beat","enabled","clear","w","h","cid"]);this.code=d.generateJs(["init","perFrame"]),b.super.constructor.apply(this,arguments)}a.EffectList=a.defineClass(b,a.Container,{componentName:"EffectList",init:function(c,d,e){b.super.init.call(this,c,d,e),this.code.setup(d,this),this.fm=new a.FrameBufferManager(d.canvas.width,d.canvas.height,c,d.copier,e?!0:!1)},update:function(){b.super.update.call(this);var a=this.gl;if((!this.enableOnBeat||(this.main.analyser.beat?this._frameCounter=this.enableOnBeatFor:this._frameCounter>0&&this._frameCounter--,0!==this._frameCounter))&&(this.code.beat=this.main.analyser.beat?1:0,this.code.enabled=1,this.code.clear=this.clearFrame,this._inited||(this._inited=!0,this.code.init()),this.code.perFrame(),0!==this.code.enabled)){if(this.fm.setRenderTarget(),(this.clearFrame||this.first||this.code.clear)&&(a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT),this.first=!1),-1!==this.input){var c=this.parent.fm.getCurrentTexture();this.main.copier.run(this.fm,this.input,c)}for(var d=0;d<this.components.length;d++)this.components[d].enabled&&this.components[d].update();this.fm.restoreRenderTarget(),-1!=this.output&&(this.parent?this.main.copier.run(this.parent.fm,this.output,this.fm.getCurrentTexture()):this.main.copier.run(null,null,this.fm.getCurrentTexture()))}},destroy:function(){b.super.destroy.call(this),this.fm&&this.fm.destroy()}}),b.ui={disp:"Effect List",type:"EffectList",leaf:!1,schema:{clearFrame:{type:"boolean",title:"Clear Frame","default":!1,required:!0},enableOnBeat:{type:"boolean",title:"Enable on beat","default":!1},enableOnBeatFor:{type:"number",title:"Enable on beat for frames","default":1},output:{type:"string",title:"Output","default":"REPLACE","enum":_.keys(a.blendModes)},input:{type:"string",title:"Input","default":"IGNORE","enum":_.union(_.keys(a.blendModes),["IGNORE"])}}}}(Webvs),function(a){function b(b){b=_.defaults(b,{forceShaderBlend:!1,outputBlendMode:a.REPLACE,varyingPos:!1,dynamicBlend:!1,swapFrame:!1,copyOnSwap:!1});var c=["precision mediump float;","uniform vec2 u_resolution;","#define PI "+Math.PI],d=_.clone(c);if(_.isFunction(b.draw)&&(this.draw=b.draw),this.copyOnSwap=b.copyOnSwap,this.varyingPos=b.varyingPos,this.dynamicBlend=b.dynamicBlend,this.outputBlendMode=b.outputBlendMode,b.swapFrame||this.dynamicBlend||b.forceShaderBlend||!_.contains(this.glBlendModes,this.outputBlendMode)?(this.swapFrame=!0,this.glBlendMode=!1,this.varyingPos=!0):(this.swapFrame=!1,this.glBlendMode=!0),this.varyingPos?(c.push("varying vec2 v_position;"),d.push("varying vec2 v_position;","#define setPosition(pos) (v_position = (((pos)+1.0)/2.0),gl_Position = vec4((pos), 0, 1))")):d.push("#define setPosition(pos) (gl_Position = vec4((pos), 0, 1))"),this.swapFrame&&(d.push("uniform sampler2D u_srcTexture;","#define getSrcColorAtPos(pos) (texture2D(u_srcTexture, pos))"),c.push("uniform sampler2D u_srcTexture;","#define getSrcColor() (texture2D(u_srcTexture, v_position))","#define getSrcColorAtPos(pos) (texture2D(u_srcTexture, pos))")),this.dynamicBlend)c.push("uniform int u_blendMode;","void setFragColor(vec4 color) {"),_.each(this.blendEqs,function(a,b){c.push("   if(u_blendMode == "+b+") {","       gl_FragColor = ("+a+");","   }")}),c.push("}");else{var e=this.blendEqs[this.glBlendMode?a.REPLACE:this.outputBlendMode];if(_.isUndefined(e))throw new Error("Blend Mode "+this.outputBlendMode+" not supported");c.push("#define setFragColor(color) (gl_FragColor = ("+e+"))")}this.fragmentSrc=c.join("\n")+"\n"+b.fragmentShader.join("\n"),this.vertexSrc=d.join("\n")+"\n"+b.vertexShader.join("\n"),this._locations={},this._textureVars=[],this._arrBuffers={}}a.ShaderProgram=a.defineClass(b,Object,{glBlendModes:[a.REPLACE,a.AVERAGE,a.ADDITIVE,a.SUBTRACTIVE1,a.SUBTRACTIVE2,a.MULTIPLY],blendEqs:_.object([[a.REPLACE,"color"],[a.MAXIMUM,"max(color, texture2D(u_srcTexture, v_position))"],[a.AVERAGE,"(color+texture2D(u_srcTexture, v_position))/2.0"],[a.ADDITIVE,"color+texture2D(u_srcTexture, v_position)"],[a.SUBTRACTIVE1,"texture2D(u_srcTexture, v_position)-color"],[a.SUBTRACTIVE2,"color-texture2D(u_srcTexture, v_position)"],[a.MULTIPLY,"color*texture2D(u_srcTexture, v_position)"]]),init:function(a){this.gl=a;try{this._compileProgram(this.vertexSrc,this.fragmentSrc)}catch(b){throw b}},setOutputBlendMode:function(a){this.outputBlendMode=a},run:function(b,c){var d=this.gl,e=d.getParameter(d.CURRENT_PROGRAM);if(d.useProgram(this.program),b&&(this.setUniform("u_resolution","2f",b.width,b.height),this.swapFrame&&(this.setUniform("u_srcTexture","texture2D",b.getCurrentTexture()),b.swapAttachment(),this.copyOnSwap&&b.copyOver())),c&&!this.dynamicBlend)throw new Error("Cannot set blendmode at runtime. Use dynamicBlend");c=c||this.outputBlendMode,this.dynamicBlend&&this.setUniform("u_blendMode","1i",c),this.glBlendMode&&c!=a.REPLACE?(d.enable(d.BLEND),this._setGlBlendMode(d,c)):d.disable(d.BLEND),this.draw.apply(this,_.drop(arguments,2)),d.disable(d.BLEND),d.useProgram(e)},draw:function(){},_compileProgram:function(a,b){var c=this.gl,d=this._compileShader(a,c.VERTEX_SHADER),e=this._compileShader(b,c.FRAGMENT_SHADER),f=c.createProgram();if(c.attachShader(f,d),c.attachShader(f,e),c.linkProgram(f),!c.getProgramParameter(f,c.LINK_STATUS))throw new Error("Program link Error: "+c.getProgramInfoLog(f));this.vertex=d,this.fragment=e,this.program=f},_compileShader:function(b,c){var d=this.gl,e=d.createShader(c);if(d.shaderSource(e,b),d.compileShader(e),!d.getShaderParameter(e,d.COMPILE_STATUS))throw a.logShaderError(b,d.getShaderInfoLog(e)),new Error("Shader compilation Error: "+d.getShaderInfoLog(e));return e},_setGlBlendMode:function(b,c){switch(c){case a.ADDITIVE:b.blendFunc(b.ONE,b.ONE),b.blendEquation(b.FUNC_ADD);break;case a.SUBTRACTIVE1:b.blendFunc(b.ONE,b.ONE),b.blendEquation(b.FUNC_REVERSE_SUBTRACT);break;case a.SUBTRACTIVE2:b.blendFunc(b.ONE,b.ONE),b.blendEquation(b.FUNC_SUBTRACT);break;case a.MULTIPLY:b.blendFunc(b.DST_COLOR,b.ZERO),b.blendEquation(b.FUNC_ADD);break;case a.AVERAGE:b.blendColor(.5,.5,.5,1),b.blendFunc(b.CONSTANT_COLOR,b.CONSTANT_COLOR),b.blendEquation(b.FUNC_ADD);break;default:throw new Error("Invalid blend mode")}},getLocation:function(a,b){var c=this._locations[a];return _.isUndefined(c)&&(c=b?this.gl.getAttribLocation(this.program,a):this.gl.getUniformLocation(this.program,a),this._locations[a]=c),c},getTextureId:function(a){var b=_.indexOf(this._textureVars,a);return-1===b&&(this._textureVars.push(a),b=this._textureVars.length-1),b},setUniform:function(a,b,c){var d=this.getLocation(a),e=this.gl;switch(b){case"texture2D":var f=this.getTextureId(a);e.activeTexture(e["TEXTURE"+f]),e.bindTexture(e.TEXTURE_2D,c),e.uniform1i(d,f);
  break;case"1f":case"2f":case"3f":case"4f":case"1i":case"2i":case"3i":case"4i":var g=[d].concat(_.drop(arguments,2));e["uniform"+b].apply(e,g);break;case"1fv":case"2fv":case"3fv":case"4fv":case"1iv":case"2iv":case"3iv":case"4iv":e["uniform"+b].apply(e,d,c)}},setVertexAttribArray:function(a,b,c,d,e,f,g){var h=this.gl;c=c||2,d=d||h.FLOAT,e=e||!1,f=f||0,g=g||0;var i=this._arrBuffers[a];_.isUndefined(i)&&(i=h.createBuffer(),this._arrBuffers[a]=i);var j=this.getLocation(a,!0);h.bindBuffer(h.ARRAY_BUFFER,i),h.bufferData(h.ARRAY_BUFFER,b,h.STATIC_DRAW),h.enableVertexAttribArray(j),h.vertexAttribPointer(j,c,d,e,f,g)},setElementArray:function(a){var b=this.gl,c=this._arrBuffers.__indexBuffer;_.isUndefined(c)&&(c=b.createBuffer(),this._arrBuffers.__indexBuffer=c),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c),b.bufferData(b.ELEMENT_ARRAY_BUFFER,a,b.STATIC_DRAW)},cleanup:function(){var a=this.gl;_.each(this._buffers,function(b){a.deleteBuffer(b)},this),a.deleteProgram(this.program),a.deleteShader(this.vertexShader),a.deleteShader(this.fragmentShader)}})}(Webvs),function(a){function b(a){a=_.defaults(a,{vertexShader:["attribute vec2 a_position;","void main() {","   setPosition(a_position);","}"],varyingPos:!0}),b.super.constructor.call(this,a)}a.QuadBoxProgram=a.defineClass(b,a.ShaderProgram,{draw:function(){this.setVertexAttribArray("a_position",new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1])),this.gl.drawArrays(this.gl.TRIANGLES,0,6)}})}(Webvs),function(a){function b(a){a=_.defaults(a||{},{fragmentShader:["uniform sampler2D u_copySource;","void main() {","   setFragColor(texture2D(u_copySource, v_position));","}"]}),b.super.constructor.call(this,a)}a.CopyProgram=a.defineClass(b,a.QuadBoxProgram,{draw:function(a){this.setUniform("u_copySource","texture2D",a),b.super.draw.call(this)}})}(Webvs),function(a){function b(a,b,c,d,e,f){this.gl=c,this.width=a,this.height=b,this.copier=d,this.texCount=f||2,this.textureOnly=e,this._initFrameBuffers()}a.FrameBufferManager=a.defineClass(b,Object,{_initFrameBuffers:function(){var a=this.gl;this.textureOnly||(this.framebuffer=a.createFramebuffer());for(var b=[],c=0;c<this.texCount;c++){var d=a.createTexture();a.bindTexture(a.TEXTURE_2D,d),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.width,this.height,0,a.RGBA,a.UNSIGNED_BYTE,null);var e=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,e),a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,this.width,this.height),b[c]={texture:d,renderbuffer:e}}this.frameAttachments=b,this.currAttachment=0},setRenderTarget:function(){var a=this.gl;this.textureOnly?this.oldAttachment=this._getFBAttachment():(this.oldFrameBuffer=a.getParameter(a.FRAMEBUFFER_BINDING),a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer),a.viewport(0,0,this.width,this.height)),this._setFBAttachment()},restoreRenderTarget:function(){var a=this.gl;this.textureOnly?this._setFBAttachment(this.oldAttachment):a.bindFramebuffer(a.FRAMEBUFFER,this.oldFrameBuffer)},getCurrentTexture:function(){return this.frameAttachments[this.currAttachment].texture},copyOver:function(){var a=this.frameAttachments[Math.abs(this.currAttachment-1)%this.texCount].texture;this.copier.run(null,null,a)},swapAttachment:function(){this.currAttachment=(this.currAttachment+1)%this.texCount,this._setFBAttachment()},destroy:function(){for(var a=this.gl,b=0;b<this.texCount;b++)a.deleteRenderbuffer(this.frameAttachments[b].renderbuffer),a.deleteTexture(this.frameAttachments[b].texture)},_getFBAttachment:function(){var a=this.gl;return{texture:a.getFramebufferAttachmentParameter(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME),renderbuffer:a.getFramebufferAttachmentParameter(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)}},_setFBAttachment:function(a){a=a||this.frameAttachments[this.currAttachment];var b=this.gl;b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,a.texture,0),b.framebufferRenderbuffer(b.FRAMEBUFFER,b.DEPTH_ATTACHMENT,b.RENDERBUFFER,a.renderbuffer)}})}(Webvs),function(a){function b(a){b.super.constructor.call(this,{fragmentShader:["uniform vec3 u_color;","void main() {","   setFragColor(vec4(u_color, 1));","}"],outputBlendMode:a})}a.ClearScreenProgram=a.defineClass(b,a.QuadBoxProgram,{draw:function(a){this.setUniform.apply(this,["u_color","3f"].concat(a)),b.super.draw.call(this)}})}(Webvs),function(a){function b(){}function c(a,b,c){this.operator=a,this.leftOperand=b,this.rightOperand=c}function d(a,b){this.operator=a,this.operand=b}function e(a,b){this.funcName=a,this.args=b}function f(a,b){this.lhs=a,this.expr=b}function g(a){this.statements=a}function h(a,b){this.value=a,this.type=b}a.AstBase=a.defineClass(b,Object),a.AstBinaryExpr=a.defineClass(c,b),a.AstUnaryExpr=a.defineClass(d,b),a.AstFuncCall=a.defineClass(e,b),a.AstAssignment=a.defineClass(f,b),a.AstProgram=a.defineClass(g,b),a.AstPrimaryExpr=a.defineClass(h,b)}(Webvs),Webvs.PegExprParser=function(){function a(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var b={parse:function(b,c){function d(a){var b={};for(var c in a)b[c]=a[c];return b}function e(a,c){for(var d=a.offset+c,e=a.offset;d>e;e++){var f=b.charAt(e);"\n"===f?(a.seenCR||a.line++,a.column=1,a.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(a.line++,a.column=1,a.seenCR=!0):(a.column++,a.seenCR=!1)}a.offset+=c}function f(a){F.offset<H.offset||(F.offset>H.offset&&(H=d(F),I=[]),I.push(a))}function g(){var a="program@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g,i,j,k,l,m,n,o,p,q,r;if(p=d(F),q=d(F),g=x(),null!==g)if(i=h(),null!==i)if(j=x(),null!==j){for(k=[],r=d(F),59===b.charCodeAt(F.offset)?(l=";",e(F,1)):(l=null,0===G&&f('";"')),null!==l?(m=x(),null!==m?(n=h(),null!==n?(o=x(),null!==o?l=[l,m,n,o]:(l=null,F=d(r))):(l=null,F=d(r))):(l=null,F=d(r))):(l=null,F=d(r));null!==l;)k.push(l),r=d(F),59===b.charCodeAt(F.offset)?(l=";",e(F,1)):(l=null,0===G&&f('";"')),null!==l?(m=x(),null!==m?(n=h(),null!==n?(o=x(),null!==o?l=[l,m,n,o]:(l=null,F=d(r))):(l=null,F=d(r))):(l=null,F=d(r))):(l=null,F=d(r));null!==k?(59===b.charCodeAt(F.offset)?(l=";",e(F,1)):(l=null,0===G&&f('";"')),l=null!==l?l:"",null!==l?(m=x(),null!==m?g=[g,i,j,k,l,m]:(g=null,F=d(q))):(g=null,F=d(q))):(g=null,F=d(q))}else g=null,F=d(q);else g=null,F=d(q);else g=null,F=d(q);return null!==g&&(g=function(a,b,c,d){var e=[d[1]];return e=e.concat(_.map(d[3],function(a){return a[2]})),new Webvs.AstProgram(e)}(p.offset,p.line,p.column,g)),null===g&&(F=d(p)),J[a]={nextPos:d(F),result:g},g}function h(){var a="statement@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g,h,i,j,k,l,n;return l=d(F),n=d(F),g=s(),null!==g?(h=x(),null!==h?(61===b.charCodeAt(F.offset)?(i="=",e(F,1)):(i=null,0===G&&f('"="')),null!==i?(j=x(),null!==j?(k=m(),null!==k?g=[g,h,i,j,k]:(g=null,F=d(n))):(g=null,F=d(n))):(g=null,F=d(n))):(g=null,F=d(n))):(g=null,F=d(n)),null!==g&&(g=function(a,b,c,d,e){return new Webvs.AstAssignment(d,e)}(l.offset,l.line,l.column,g[0],g[4])),null===g&&(F=d(l)),null===g&&(g=m()),J[a]={nextPos:d(F),result:g},g}function i(){var a="unary_ops@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g;return 43===b.charCodeAt(F.offset)?(g="+",e(F,1)):(g=null,0===G&&f('"+"')),null===g&&(45===b.charCodeAt(F.offset)?(g="-",e(F,1)):(g=null,0===G&&f('"-"'))),J[a]={nextPos:d(F),result:g},g}function j(){var a="additive_ops@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g;return 43===b.charCodeAt(F.offset)?(g="+",e(F,1)):(g=null,0===G&&f('"+"')),null===g&&(45===b.charCodeAt(F.offset)?(g="-",e(F,1)):(g=null,0===G&&f('"-"'))),J[a]={nextPos:d(F),result:g},g}function k(){var a="multiplicative_ops@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g;return 42===b.charCodeAt(F.offset)?(g="*",e(F,1)):(g=null,0===G&&f('"*"')),null===g&&(47===b.charCodeAt(F.offset)?(g="/",e(F,1)):(g=null,0===G&&f('"/"')),null===g&&(37===b.charCodeAt(F.offset)?(g="%",e(F,1)):(g=null,0===G&&f('"%"')))),J[a]={nextPos:d(F),result:g},g}function l(){var a="boolean_ops@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g;return 38===b.charCodeAt(F.offset)?(g="&",e(F,1)):(g=null,0===G&&f('"&"')),null===g&&(124===b.charCodeAt(F.offset)?(g="|",e(F,1)):(g=null,0===G&&f('"|"'))),J[a]={nextPos:d(F),result:g},g}function m(){var a="boolean_expr@"+F.offset,b=J[a];if(b)return F=d(b.nextPos),b.result;var c,e,f,g,h,i,j,k,m;if(j=d(F),k=d(F),c=n(),null!==c){for(e=[],m=d(F),f=x(),null!==f?(g=l(),null!==g?(h=x(),null!==h?(i=n(),null!==i?f=[f,g,h,i]:(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m));null!==f;)e.push(f),m=d(F),f=x(),null!==f?(g=l(),null!==g?(h=x(),null!==h?(i=n(),null!==i?f=[f,g,h,i]:(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m));null!==e?c=[c,e]:(c=null,F=d(k))}else c=null,F=d(k);return null!==c&&(c=function(a,b,c,d,e){return C(d,e)}(j.offset,j.line,j.column,c[0],c[1])),null===c&&(F=d(j)),J[a]={nextPos:d(F),result:c},c}function n(){var a="additive_expr@"+F.offset,b=J[a];if(b)return F=d(b.nextPos),b.result;var c,e,f,g,h,i,k,l,m;if(k=d(F),l=d(F),c=o(),null!==c){for(e=[],m=d(F),f=x(),null!==f?(g=j(),null!==g?(h=x(),null!==h?(i=o(),null!==i?f=[f,g,h,i]:(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m));null!==f;)e.push(f),m=d(F),f=x(),null!==f?(g=j(),null!==g?(h=x(),null!==h?(i=o(),null!==i?f=[f,g,h,i]:(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m));null!==e?c=[c,e]:(c=null,F=d(l))}else c=null,F=d(l);return null!==c&&(c=function(a,b,c,d,e){return C(d,e)}(k.offset,k.line,k.column,c[0],c[1])),null===c&&(F=d(k)),J[a]={nextPos:d(F),result:c},c}function o(){var a="multiplicative_expr@"+F.offset,b=J[a];if(b)return F=d(b.nextPos),b.result;var c,e,f,g,h,i,j,l,m;if(j=d(F),l=d(F),c=p(),null!==c){for(e=[],m=d(F),f=x(),null!==f?(g=k(),null!==g?(h=x(),null!==h?(i=p(),null!==i?f=[f,g,h,i]:(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m));null!==f;)e.push(f),m=d(F),f=x(),null!==f?(g=k(),null!==g?(h=x(),null!==h?(i=p(),null!==i?f=[f,g,h,i]:(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m))):(f=null,F=d(m));null!==e?c=[c,e]:(c=null,F=d(l))}else c=null,F=d(l);return null!==c&&(c=function(a,b,c,d,e){return C(d,e)}(j.offset,j.line,j.column,c[0],c[1])),null===c&&(F=d(j)),J[a]={nextPos:d(F),result:c},c}function p(){var a="unary@"+F.offset,b=J[a];if(b)return F=d(b.nextPos),b.result;var c,e,f,g,h;return g=d(F),h=d(F),c=i(),null!==c?(e=x(),null!==e?(f=q(),null!==f?c=[c,e,f]:(c=null,F=d(h))):(c=null,F=d(h))):(c=null,F=d(h)),null!==c&&(c=function(a,b,c,d,e){return new Webvs.AstUnaryExpr(d,e)}(g.offset,g.line,g.column,c[0],c[2])),null===c&&(F=d(g)),null===c&&(c=q()),J[a]={nextPos:d(F),result:c},c}function q(){var a="func_call@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g,h,i,j,k,l,n,o,p,q,s,t;if(p=d(F),q=d(F),s=d(F),/^[a-zA-Z_]/.test(b.charAt(F.offset))?(g=b.charAt(F.offset),e(F,1)):(g=null,0===G&&f("[a-zA-Z_]")),null!==g){for(h=[],/^[a-zA-Z_0-9]/.test(b.charAt(F.offset))?(i=b.charAt(F.offset),e(F,1)):(i=null,0===G&&f("[a-zA-Z_0-9]"));null!==i;)h.push(i),/^[a-zA-Z_0-9]/.test(b.charAt(F.offset))?(i=b.charAt(F.offset),e(F,1)):(i=null,0===G&&f("[a-zA-Z_0-9]"));null!==h?g=[g,h]:(g=null,F=d(s))}else g=null,F=d(s);if(null!==g)if(h=x(),null!==h)if(40===b.charCodeAt(F.offset)?(i="(",e(F,1)):(i=null,0===G&&f('"("')),null!==i){for(s=d(F),j=[],t=d(F),k=x(),null!==k?(l=m(),null!==l?(n=x(),null!==n?(44===b.charCodeAt(F.offset)?(o=",",e(F,1)):(o=null,0===G&&f('","')),null!==o?k=[k,l,n,o]:(k=null,F=d(t))):(k=null,F=d(t))):(k=null,F=d(t))):(k=null,F=d(t));null!==k;)j.push(k),t=d(F),k=x(),null!==k?(l=m(),null!==l?(n=x(),null!==n?(44===b.charCodeAt(F.offset)?(o=",",e(F,1)):(o=null,0===G&&f('","')),null!==o?k=[k,l,n,o]:(k=null,F=d(t))):(k=null,F=d(t))):(k=null,F=d(t))):(k=null,F=d(t));null!==j?(k=x(),null!==k?(l=m(),null!==l?j=[j,k,l]:(j=null,F=d(s))):(j=null,F=d(s))):(j=null,F=d(s)),j=null!==j?j:"",null!==j?(k=x(),null!==k?(41===b.charCodeAt(F.offset)?(l=")",e(F,1)):(l=null,0===G&&f('")"')),null!==l?g=[g,h,i,j,k,l]:(g=null,F=d(q))):(g=null,F=d(q))):(g=null,F=d(q))}else g=null,F=d(q);else g=null,F=d(q);else g=null,F=d(q);return null!==g&&(g=function(a,b,c,d,e){var f=[];return _.each(e[0],function(a){f.push(a[1])}),f.push(e[2]),new Webvs.AstFuncCall(D(d),f)}(p.offset,p.line,p.column,g[0],g[3])),null===g&&(F=d(p)),null===g&&(g=r()),J[a]={nextPos:d(F),result:g},g}function r(){var a="primary_expr@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g,h,i,j,k;return g=w(),null===g&&(g=u(),null===g&&(g=v(),null===g&&(g=t(),null===g&&(j=d(F),k=d(F),40===b.charCodeAt(F.offset)?(g="(",e(F,1)):(g=null,0===G&&f('"("')),null!==g?(h=m(),null!==h?(41===b.charCodeAt(F.offset)?(i=")",e(F,1)):(i=null,0===G&&f('")"')),null!==i?g=[g,h,i]:(g=null,F=d(k))):(g=null,F=d(k))):(g=null,F=d(k)),null!==g&&(g=function(a,b,c,d){return d}(j.offset,j.line,j.column,g[1])),null===g&&(F=d(j)))))),J[a]={nextPos:d(F),result:g},g}function s(){var a="assignable@"+F.offset,b=J[a];if(b)return F=d(b.nextPos),b.result;var c;return c=v(),null===c&&(c=t()),J[a]={nextPos:d(F),result:c},c}function t(){var a="identifier@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g,h,i,j,k;if(j=d(F),k=d(F),/^[a-zA-Z_]/.test(b.charAt(F.offset))?(g=b.charAt(F.offset),e(F,1)):(g=null,0===G&&f("[a-zA-Z_]")),null!==g){for(h=[],/^[a-zA-Z_0-9]/.test(b.charAt(F.offset))?(i=b.charAt(F.offset),e(F,1)):(i=null,0===G&&f("[a-zA-Z_0-9]"));null!==i;)h.push(i),/^[a-zA-Z_0-9]/.test(b.charAt(F.offset))?(i=b.charAt(F.offset),e(F,1)):(i=null,0===G&&f("[a-zA-Z_0-9]"));null!==h?g=[g,h]:(g=null,F=d(k))}else g=null,F=d(k);return null!==g&&(g=function(a,b,c,d){return new Webvs.AstPrimaryExpr(D(d).toLowerCase(),"ID")}(j.offset,j.line,j.column,g)),null===g&&(F=d(j)),J[a]={nextPos:d(F),result:g},g}function u(){var a="constant@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g,h,i,j,k;if(j=d(F),k=d(F),36===b.charCodeAt(F.offset)?(g="$",e(F,1)):(g=null,0===G&&f('"$"')),null!==g){for(h=[],/^[a-zA-Z_0-9]/.test(b.charAt(F.offset))?(i=b.charAt(F.offset),e(F,1)):(i=null,0===G&&f("[a-zA-Z_0-9]"));null!==i;)h.push(i),/^[a-zA-Z_0-9]/.test(b.charAt(F.offset))?(i=b.charAt(F.offset),e(F,1)):(i=null,0===G&&f("[a-zA-Z_0-9]"));null!==h?g=[g,h]:(g=null,F=d(k))}else g=null,F=d(k);return null!==g&&(g=function(a,b,c,d){return new Webvs.AstPrimaryExpr(D(d).toLowerCase(),"CONST")}(j.offset,j.line,j.column,g[1])),null===g&&(F=d(j)),J[a]={nextPos:d(F),result:g},g}function v(){var a="register@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g,h,i,j,k,l,m;if(l=d(F),m=d(F),64===b.charCodeAt(F.offset)?(g="@",e(F,1)):(g=null,0===G&&f('"@"')),null!==g){for(h=[],/^[a-zA-Z_0-9]/.test(b.charAt(F.offset))?(i=b.charAt(F.offset),e(F,1)):(i=null,0===G&&f("[a-zA-Z_0-9]"));null!==i;)h.push(i),/^[a-zA-Z_0-9]/.test(b.charAt(F.offset))?(i=b.charAt(F.offset),e(F,1)):(i=null,0===G&&f("[a-zA-Z_0-9]"));null!==h?g=[g,h]:(g=null,F=d(m))}else g=null,F=d(m);return null!==g&&(g=function(a,b,c,d){return new Webvs.AstPrimaryExpr("__REG_AT_"+D(d).toLowerCase(),"REG")}(l.offset,l.line,l.column,g[1])),null===g&&(F=d(l)),null===g&&(l=d(F),m=d(F),/^[rR]/.test(b.charAt(F.offset))?(g=b.charAt(F.offset),e(F,1)):(g=null,0===G&&f("[rR]")),null!==g?(/^[eE]/.test(b.charAt(F.offset))?(h=b.charAt(F.offset),e(F,1)):(h=null,0===G&&f("[eE]")),null!==h?(/^[gG]/.test(b.charAt(F.offset))?(i=b.charAt(F.offset),e(F,1)):(i=null,0===G&&f("[gG]")),null!==i?(/^[0-9]/.test(b.charAt(F.offset))?(j=b.charAt(F.offset),e(F,1)):(j=null,0===G&&f("[0-9]")),null!==j?(/^[0-9]/.test(b.charAt(F.offset))?(k=b.charAt(F.offset),e(F,1)):(k=null,0===G&&f("[0-9]")),null!==k?g=[g,h,i,j,k]:(g=null,F=d(m))):(g=null,F=d(m))):(g=null,F=d(m))):(g=null,F=d(m))):(g=null,F=d(m)),null!==g&&(g=function(a,b,c,d){return new Webvs.AstPrimaryExpr("__REG_"+D(d).toLowerCase(),"REG")}(l.offset,l.line,l.column,g)),null===g&&(F=d(l))),J[a]={nextPos:d(F),result:g},g}function w(){var a="value@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g,h,i,j,k,l,m,n,o;for(m=d(F),n=d(F),g=[],/^[0-9]/.test(b.charAt(F.offset))?(h=b.charAt(F.offset),e(F,1)):(h=null,0===G&&f("[0-9]"));null!==h;)g.push(h),/^[0-9]/.test(b.charAt(F.offset))?(h=b.charAt(F.offset),e(F,1)):(h=null,0===G&&f("[0-9]"));if(null!==g)if(46===b.charCodeAt(F.offset)?(h=".",e(F,1)):(h=null,0===G&&f('"."')),null!==h){if(/^[0-9]/.test(b.charAt(F.offset))?(j=b.charAt(F.offset),e(F,1)):(j=null,0===G&&f("[0-9]")),null!==j)for(i=[];null!==j;)i.push(j),/^[0-9]/.test(b.charAt(F.offset))?(j=b.charAt(F.offset),e(F,1)):(j=null,0===G&&f("[0-9]"));else i=null;if(null!==i){if(o=d(F),/^[Ee]/.test(b.charAt(F.offset))?(j=b.charAt(F.offset),e(F,1)):(j=null,0===G&&f("[Ee]")),null!==j){if(/^[0-9]/.test(b.charAt(F.offset))?(l=b.charAt(F.offset),e(F,1)):(l=null,0===G&&f("[0-9]")),null!==l)for(k=[];null!==l;)k.push(l),/^[0-9]/.test(b.charAt(F.offset))?(l=b.charAt(F.offset),e(F,1)):(l=null,0===G&&f("[0-9]"));else k=null;null!==k?j=[j,k]:(j=null,F=d(o))}else j=null,F=d(o);j=null!==j?j:"",null!==j?g=[g,h,i,j]:(g=null,F=d(n))}else g=null,F=d(n)}else g=null,F=d(n);else g=null,F=d(n);if(null!==g&&(g=function(a,b,c,d){return new Webvs.AstPrimaryExpr(parseFloat(D(d)),"VALUE")}(m.offset,m.line,m.column,g)),null===g&&(F=d(m)),null===g){if(m=d(F),n=d(F),/^[a-fA-F0-9]/.test(b.charAt(F.offset))?(h=b.charAt(F.offset),e(F,1)):(h=null,0===G&&f("[a-fA-F0-9]")),null!==h)for(g=[];null!==h;)g.push(h),/^[a-fA-F0-9]/.test(b.charAt(F.offset))?(h=b.charAt(F.offset),e(F,1)):(h=null,0===G&&f("[a-fA-F0-9]"));else g=null;if(null!==g?(/^[hH]/.test(b.charAt(F.offset))?(h=b.charAt(F.offset),e(F,1)):(h=null,0===G&&f("[hH]")),null!==h?g=[g,h]:(g=null,F=d(n))):(g=null,F=d(n)),null!==g&&(g=function(a,b,c,d){return new Webvs.AstPrimaryExpr(parseInt(D(d),16),"VALUE")}(m.offset,m.line,m.column,g[0])),null===g&&(F=d(m)),null===g){if(m=d(F),n=d(F),/^[0-9]/.test(b.charAt(F.offset))?(h=b.charAt(F.offset),e(F,1)):(h=null,0===G&&f("[0-9]")),null!==h)for(g=[];null!==h;)g.push(h),/^[0-9]/.test(b.charAt(F.offset))?(h=b.charAt(F.offset),e(F,1)):(h=null,0===G&&f("[0-9]"));else g=null;null!==g?(/^[dD]/.test(b.charAt(F.offset))?(h=b.charAt(F.offset),e(F,1)):(h=null,0===G&&f("[dD]")),h=null!==h?h:"",null!==h?g=[g,h]:(g=null,F=d(n))):(g=null,F=d(n)),null!==g&&(g=function(a,b,c,d){return new Webvs.AstPrimaryExpr(parseInt(D(d),10),"VALUE")}(m.offset,m.line,m.column,g[0])),null===g&&(F=d(m))}}return J[a]={nextPos:d(F),result:g},g}function x(){var a="__@"+F.offset,b=J[a];if(b)return F=d(b.nextPos),b.result;var c,e;for(c=[],e=y(),null===e&&(e=z(),null===e&&(e=A()));null!==e;)c.push(e),e=y(),null===e&&(e=z(),null===e&&(e=A()));return J[a]={nextPos:d(F),result:c},c}function y(){var a="whiteSpace@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g;return/^[\t\x0B\f \xA0\uFEFF]/.test(b.charAt(F.offset))?(g=b.charAt(F.offset),e(F,1)):(g=null,0===G&&f("[\\t\\x0B\\f \\xA0\\uFEFF]")),J[a]={nextPos:d(F),result:g},g}function z(){var a="lineEnd@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g;return/^[\n\r\u2028\u2029]/.test(b.charAt(F.offset))?(g=b.charAt(F.offset),e(F,1)):(g=null,0===G&&f("[\\n\\r\\u2028\\u2029]")),J[a]={nextPos:d(F),result:g},g}function A(){var a="comment@"+F.offset,c=J[a];if(c)return F=d(c.nextPos),c.result;var g,h,i,j,k,l,m;if(k=d(F),"/*"===b.substr(F.offset,2)?(g="/*",e(F,2)):(g=null,0===G&&f('"/*"')),null!==g){for(h=[],l=d(F),m=d(F),G++,"*/"===b.substr(F.offset,2)?(i="*/",e(F,2)):(i=null,0===G&&f('"*/"')),G--,null===i?i="":(i=null,F=d(m)),null!==i?(b.length>F.offset?(j=b.charAt(F.offset),e(F,1)):(j=null,0===G&&f("any character")),null!==j?i=[i,j]:(i=null,F=d(l))):(i=null,F=d(l));null!==i;)h.push(i),l=d(F),m=d(F),G++,"*/"===b.substr(F.offset,2)?(i="*/",e(F,2)):(i=null,0===G&&f('"*/"')),G--,null===i?i="":(i=null,F=d(m)),null!==i?(b.length>F.offset?(j=b.charAt(F.offset),e(F,1)):(j=null,0===G&&f("any character")),null!==j?i=[i,j]:(i=null,F=d(l))):(i=null,F=d(l));null!==h?("*/"===b.substr(F.offset,2)?(i="*/",e(F,2)):(i=null,0===G&&f('"*/"')),null!==i?g=[g,h,i]:(g=null,F=d(k))):(g=null,F=d(k))}else g=null,F=d(k);if(null===g)if(k=d(F),"//"===b.substr(F.offset,2)?(g="//",e(F,2)):(g=null,0===G&&f('"//"')),null!==g){for(h=[],l=d(F),m=d(F),G++,i=z(),G--,null===i?i="":(i=null,F=d(m)),null!==i?(b.length>F.offset?(j=b.charAt(F.offset),e(F,1)):(j=null,0===G&&f("any character")),null!==j?i=[i,j]:(i=null,F=d(l))):(i=null,F=d(l));null!==i;)h.push(i),l=d(F),m=d(F),G++,i=z(),G--,null===i?i="":(i=null,F=d(m)),null!==i?(b.length>F.offset?(j=b.charAt(F.offset),e(F,1)):(j=null,0===G&&f("any character")),null!==j?i=[i,j]:(i=null,F=d(l))):(i=null,F=d(l));null!==h?g=[g,h]:(g=null,F=d(k))}else g=null,F=d(k);return J[a]={nextPos:d(F),result:g},g}function B(a){a.sort();for(var b=null,c=[],d=0;d<a.length;d++)a[d]!==b&&(c.push(a[d]),b=a[d]);return c}function C(a,b){var c=a;return _.each(b,function(a){c=new Webvs.AstBinaryExpr(a[1],c,a[3])}),c}function D(a){return _.flatten(a).join("")}var E={program:g,statement:h,unary_ops:i,additive_ops:j,multiplicative_ops:k,boolean_ops:l,boolean_expr:m,additive_expr:n,multiplicative_expr:o,unary:p,func_call:q,primary_expr:r,assignable:s,identifier:t,constant:u,register:v,value:w,__:x,whiteSpace:y,lineEnd:z,comment:A};if(void 0!==c){if(void 0===E[c])throw new Error("Invalid rule name: "+a(c)+".")}else c="program";var F={offset:0,line:1,column:1,seenCR:!1},G=0,H={offset:0,line:1,column:1,seenCR:!1},I=[],J={},K=E[c]();if(null===K||F.offset!==b.length){var L=Math.max(F.offset,H.offset),M=L<b.length?b.charAt(L):null,N=F.offset>H.offset?F:H;throw new this.SyntaxError(B(I),M,L,N.line,N.column)}return K},toSource:function(){return this._source}};return b.SyntaxError=function(b,c,d,e,f){function g(b,c){var d,e;switch(b.length){case 0:d="end of input";break;case 1:d=b[0];break;default:d=b.slice(0,b.length-1).join(", ")+" or "+b[b.length-1]}return e=c?a(c):"end of input","Expected "+d+" but "+e+" found."}this.name="SyntaxError",this.expected=b,this.found=c,this.message=g(b,c),this.offset=d,this.line=e,this.column=f},b.SyntaxError.prototype=Error.prototype,b}(),function(a){function b(){}a.CodeInstance=a.defineClass(b,Object,{rand:function(a){return Math.floor(Math.random()*a)+1},gettime:function(a){switch(a){case 0:var b=(new Date).getTime();return(b-this._bootTime)/1e3;default:throw new Error("Invalid startTime mode for gettime call")}},getosc:function(a,b){for(var c=this._analyser.getWaveform(),d=Math.floor((a-b/2)*(c.length-1)),e=Math.floor((a+b/2)*(c.length-1)),f=0,g=d;e>=g;g++)f+=c[g];return f/(e-d+1)},bindUniforms:function(a){var b=this,c=_.difference(_.keys(this),this._treatAsNonUniform);if(_.each(c,function(c){var d=b[c];"number"==typeof d&&a.setUniform(c,"1f",d)}),_.each(this._registerUsages,function(b){a.setUniform(b,"1f",this._registerBank[b])}),this.hasRandom){var d=[Math.random()/100,Math.random()/100];a.setUniform("__randStep","2fv",d)}if(this.hasGettime){var e=((new Date).getTime()-this._bootTime)/1e3;a.setUniform("__gettime0","1f",e)}_.each(this._preCompute,function(b){var c=_.map(_.last(b,b.length-2),function(a){return _.isString(a)?"__REG"==a.substring(0,5)?this._registerBank[a]:this[a]:a}),d=this[b[0]].apply(this,c);a.setUniform(b[1],"1f",d)})},setup:function(a){this._registerBank=a.registerBank,this._bootTime=a.bootTime,this._analyser=a.analyser,this.w=a.canvas.width,this.h=a.canvas.height,_.each(this._registerUsages,function(b){_.has(a.registerBank,b)||(a.registerBank[b]=0)})}}),b.clone=function(a,b){a.cid=0;var c=[a];return b>1&&_.times(b-1,function(b){var d=_.clone(a);d.cid=b+1,c.push(d)}),c}}(Webvs),function(a){function b(a,b){this.codeSrc={};for(var c in a){var d=a[c];_.isArray(d)&&(d=d.join("\n")),d=d.trim(),""!==d&&(this.codeSrc[c]=d)}this.externalVars=_.union(b||[],["w","h","cid"]),this._parseSrc()}a.ExprCodeGenerator=a.defineClass(b,Object,{_parseSrc:function(){var b={},c=[],d={},e=[];for(var f in this.codeSrc)try{var g=this.codeSrc[f];b[f]=a.PegExprParser.parse(g);var h=[];this._getVars(b[f],c,h,e),d[f]=h}catch(i){throw new Error("Error parsing "+f+"("+i.line+":"+i.column+")"+" : "+i)}this.codeAst=b,this.funcUsages=d,this.instanceVars=_.uniq(this.externalVars.concat(c)),this.registerUsages=_.uniq(e)},generateJs:function(b){var c=new a.CodeInstance;_.each(this.instanceVars,function(a){c[a]=0});var d=_.intersection(_.keys(this.codeAst),b),e=_.difference(b,d);return _.each(d,function(a){var b=this.codeAst[a],d=this._generateJs(b);c[a]=new Function(d)},this),_.each(e,function(b){c[b]=a.noop}),c._registerUsages=this.registerUsages,c},generateGlsl:function(a,b,c){var d=[];b=b||[],_.each(this.instanceVars,function(a){var c="";_.contains(b,a)||(c="uniform "),d.push(c+"float "+a+";")});var e=_.intersection(_.keys(this.codeAst),a),f=_.difference(a,e),g=_.uniq(_.flatMap(e,function(a){return this.funcUsages[a]},this));_.each(g,function(a){var b=this.glslFuncCode[a];b&&d.push(b)},this);var h=[],i=[];return _.each(e,function(a){var b=this.codeAst[a],c=this._generateGlsl(b,h);i.push("void "+a+"() {"),i.push(c),i.push("}")},this),d=d.concat(_.map(h,function(a){return"uniform float "+a[1]+";"})),d=d.concat(i),_.each(f,function(a){d.push("void "+a+"() {}")}),c._preCompute=h,_.contains(e,"rand")&&(c.hasRandom=!0),_.contains(e,"gettime")&&(c.hasGettime=!0),c._treatAsNonUniform=b,d.join("\n")},funcArgLengths:{above:2,below:2,equal:2,pow:2,sqr:1,sqrt:1,invsqrt:1,floor:1,ceil:1,abs:1,"if":3,min:2,max:2,sin:1,cos:1,tan:1,asin:1,acos:1,atan:1,atan2:2,log:1,band:2,bor:2,bnot:1,rand:1,gettime:1,getosc:3,select:{min:2}},jsMathFuncs:["min","max","sin","cos","abs","tan","asin","acos","atan","log","pow","sqrt","floor","ceil"],glslFuncCode:{rand:["uniform vec2 __randStep;","vec2 __randSeed;","float rand(float max) {","   __randCur += __randStep;","   float val = fract(sin(dot(__randSeed.xy ,vec2(12.9898,78.233))) * 43758.5453);","   return (floor(val*max)+1);","}"].join("\n"),gettime:["uniform float __gettime0;","int gettime(int startTime) {","   int time = 0;","   if(startTime == 0) {","       time = __gettime0;","   }","   return time;","}"].join("\n")},_checkFunc:function(a){var b=this.funcArgLengths[a.funcName];if(void 0===b)throw Error("Unknown function "+a.funcName);if(_.isNumber(b)){if(a.args.length!=b)throw Error(a.funcName+" accepts "+b+" arguments")}else if(b.min&&a.args.length<b.min)throw Error(a.funcName+" accepts atleast "+b.min+" arguments")},_generateGlsl:function(b,c){if(b instanceof a.AstBinaryExpr)return"("+this._generateGlsl(b.leftOperand,c)+b.operator+this._generateGlsl(b.rightOperand,c)+")";if(b instanceof a.AstUnaryExpr)return"("+b.operator+this._generateGlsl(b.operand,c)+")";if(b instanceof a.AstFuncCall)switch(this._checkFunc(b),b.funcName){case"above":return["(",this._generateGlsl(b.args[0],c),">",this._generateGlsl(b.args[1],c),"?1.0:0.0)"].join("");case"below":return["(",this._generateGlsl(b.args[0],c),"<",this._generateGlsl(b.args[1],c),"?1.0:0.0)"].join("");case"equal":return["(",this._generateGlsl(b.args[0],c),"==",this._generateGlsl(b.args[1],c),"?1.0:0.0)"].join("");case"if":return["(",this._generateGlsl(b.args[0],c),"!=0.0?",this._generateGlsl(b.args[1],c),":",this._generateGlsl(b.args[2],c),")"].join("");case"select":var d=this._generateGlsl(b.args[0],c),e=this,f=function(a,b){return 1==a.length?e._generateGlsl(a[0],c):["(("+d+" === "+b+")?","("+e._generateGlsl(a[0],c)+"):","("+f(_.last(a,a.length-1),b+1)+"))"].join("")};return f(_.last(b.args,b.args.length-1),0);case"sqr":return"(pow(("+this._generateGlsl(b.args[0],c)+"), 2))";case"band":return"(float(("+this._generateGlsl(b.args[0],c)+")&&("+this._generateGlsl(b.args[1],c)+")))";case"bor":return"(float(("+this._generateGlsl(b.args[0],c)+")||("+this._generateGlsl(b.args[1],c)+")))";case"bnot":return"(float(!("+this._generateGlsl(b.args[0],c)+")))";case"invsqrt":return"(1/sqrt("+this._generateGlsl(b.args[0],c)+"))";case"atan2":return"(atan(("+this._generateGlsl(b.args[0],c)+"),("+this._generateGlsl(b.args[1],c)+"))";case"getosc":var g=_.every(b.args,function(b){return b instanceof a.AstPrimaryExpr});if(!g)throw new Error("Non Pre-Computable arguments for getosc in shader code, use variables or constants");var h="__PC_"+b.funcName+"_"+j,i=[b.funcName,h].concat(_.map(b.args,function(a){return a.value})),j=_.indexOf(c,i);return-1==j&&(c.push(i),j=c.length-1),h;default:var k=_.map(b.args,function(a){return this._generateGlsl(a,c)},this).join(","),l=b.funcName;return _.contains(this.varArgFuncs,b.funcName)&&(l+=b.args.length),"("+l+"("+k+"))"}if(b instanceof a.AstAssignment)return this._generateGlsl(b.lhs,c)+"="+this._generateGlsl(b.expr,c);if(b instanceof a.AstProgram){var m=_.map(b.statements,function(a){return this._generateGlsl(a,c)},this);return m.join(";\n")+";"}return b instanceof a.AstPrimaryExpr&&"VALUE"===b.type?a.glslFloatRepr(b.value):b instanceof a.AstPrimaryExpr&&"CONST"===b.type?this._translateConstants(b.value).toString():b instanceof a.AstPrimaryExpr&&("ID"===b.type||"REG"===b.type)?b.value:void 0},_generateJs:function(b){var c;if(b instanceof a.AstBinaryExpr)return"("+this._generateJs(b.leftOperand)+b.operator+this._generateJs(b.rightOperand)+")";if(b instanceof a.AstUnaryExpr)return"("+b.operator+this._generateJs(b.operand)+")";if(b instanceof a.AstFuncCall)switch(this._checkFunc(b),b.funcName){case"above":return["(",this._generateJs(b.args[0]),">",this._generateJs(b.args[1]),"?1:0)"].join("");case"below":return["(",this._generateJs(b.args[0]),"<",this._generateJs(b.args[1]),"?1:0)"].join("");case"equal":return["(",this._generateJs(b.args[0]),"==",this._generateJs(b.args[1]),"?1:0)"].join("");case"if":return["(",this._generateJs(b.args[0]),"!==0?",this._generateJs(b.args[1]),":",this._generateJs(b.args[2]),")"].join("");case"select":var d=["((function() {"];return d.push("switch("+this._generateJs(b.args[0])+") {"),_.each(_.last(b.args,b.args.length-1),function(a,b){d.push("case "+b+": return "+this._generateJs(a)+";")},this),d.push("default : throw new Error('Unknown selector value in select');"),d.push("}}).call(this))"),d.join("");case"sqr":return"(Math.pow(("+this._generateJs(b.args[0])+"),2))";case"band":return"((("+this._generateJs(b.args[0])+")&&("+this._generateJs(b.args[1])+"))?1:0)";case"bor":return"((("+this._generateJs(b.args[0])+")||("+this._generateJs(b.args[1])+"))?1:0)";case"bnot":return"((!("+this._generateJs(b.args[0])+"))?1:0)";case"invsqrt":return"(1/Math.sqrt("+this._generateJs(b.args[0])+"))";case"atan2":return"(Math.atan(("+this._generateJs(b.args[0])+")/("+this._generateJs(b.args[1])+")))";default:var e=_.map(b.args,function(a){return this._generateJs(a)},this).join(",");return c=_.contains(this.jsMathFuncs,b.funcName)?"Math.":"this.","("+c+b.funcName+"("+e+"))"}if(b instanceof a.AstAssignment)return this._generateJs(b.lhs)+"="+this._generateJs(b.expr);if(b instanceof a.AstProgram){var f=_.map(b.statements,function(a){return this._generateJs(a)},this);return f.join(";\n")}return b instanceof a.AstPrimaryExpr&&"VALUE"===b.type?b.value.toString():b instanceof a.AstPrimaryExpr&&"CONST"===b.type?this._translateConstants(b.value).toString():b instanceof a.AstPrimaryExpr&&"ID"===b.type?"this."+b.value:b instanceof a.AstPrimaryExpr&&"REG"===b.type?'this._registerBank["'+b.value+'"]':void 0},_getVars:function(b,c,d,e){b instanceof a.AstBinaryExpr?(this._getVars(b.leftOperand,c,d,e),this._getVars(b.rightOperand,c,d,e)):b instanceof a.AstUnaryExpr?this._getVars(b.operand,c,d,e):b instanceof a.AstFuncCall?(d.push(b.funcName),_.each(b.args,function(a){this._getVars(a,c,d,e)},this)):b instanceof a.AstAssignment?(this._getVars(b.lhs,c,d,e),this._getVars(b.expr,c,d,e)):b instanceof a.AstProgram?_.each(b.statements,function(a){this._getVars(a,c,d,e)},this):b instanceof a.AstPrimaryExpr&&"ID"===b.type?c.push(b.value):b instanceof a.AstPrimaryExpr&&"REG"===b.type&&e.push(b.value)
  },_translateConstants:function(a){switch(a){case"pi":return Math.PI;case"e":return Math.E;case"phi":return 1.6180339887;default:throw new Error("Unknown constant "+a)}}})}(Webvs),function(a){function b(c){a.checkRequiredOptions(c,["code"]);var d=new a.ExprCodeGenerator(c.code,["b"]);this.code=d.generateJs(["init","onBeat","perFrame"]),this.inited=!1,b.super.constructor.apply(this,arguments)}a.GlobalVar=a.defineClass(b,a.Component,{init:function(a,c,d){b.super.init.call(this,a,c,d),this.code.setup(c,this)},update:function(){var a=this.code;a.b=this.main.analyser.beat?1:0,this.inited||(a.init(),this.inited=!0),this.main.analyser.beat&&a.onBeat(),a.perFrame()}}),b.ui={disp:"Global Var",type:"GlobalVar",schema:{code:{type:"object",title:"Code","default":{},properties:{init:{type:"string",title:"Init"},onBeat:{type:"string",title:"On Beat"},perFrame:{type:"string",title:"Per Frame"}}}}}}(Webvs),function(a){function b(c){if(c=_.defaults(c,{action:"SAVE",bufferId:1,blendMode:"REPLACE"}),this.blendMode=a.blendModes[c.blendMode],this.action=this.actions[c.action],!this.action)throw new Error("Unknown BufferSave action "+c.action);this.action==this.actions.SAVERESTORE?this._nextAction=this.actions.SAVE:this.action==this.actions.RESTORESAVE&&(this._nextAction=this.actions.RESTORE),this._bufferId="__BUFFERSAVE_"+c.bufferId,b.super.constructor.apply(this,arguments)}a.BufferSave=a.defineClass(b,a.Component,{actions:{SAVE:1,RESTORE:2,SAVERESTORE:3,RESTORESAVE:4},init:function(c,d,e){if(b.super.init.call(this,c,d,e),!d.registerBank[this._bufferId]){var f=new a.FrameBufferManager(d.canvas.width,d.canvas.height,c,d.copier,!0,1);d.registerBank[this._bufferId]=f}},update:function(){this.gl;var a,b=this.main.registerBank[this._bufferId];switch(this.action==this.actions.SAVERESTORE||this.action==this.RESTORESAVE?(a=this._nextAction,this._nextAction=this._nextAction==this.actions.SAVE?this.actions.RESTORE:this.actions.SAVE):a=this.action,a){case this.actions.SAVE:b.setRenderTarget(),this.main.copier.run(null,null,this.parent.fm.getCurrentTexture()),b.restoreRenderTarget();break;case this.actions.RESTORE:this.main.copier.run(this.parent.fm,this.blendMode,b.getCurrentTexture())}},destroy:function(){b.super.destroy.call(this),this.main.registerBank[this._bufferId].destroy()}}),b.ui={disp:"Buffer Save",type:"BufferSave",schema:{action:{type:"string",title:"Buffer save action","enum":["SAVE","RESTORE","SAVERESTORE","RESTORESAVE"]},bufferId:{type:"number",title:"Buffer Id","enum":[1,2,3,4,5,6,7,8]},blendMode:{type:"string",title:"Blend mode","enum":_.keys(a.blendModes)}}}}(Webvs),function(a){function b(c){c=_.defaults(c,{speed:1,color:"#000000"}),this.color=a.parseColorNorm(c.color),this.frameCount=0,this.maxFrameCount=Math.floor(1/c.speed),this.program=new a.ClearScreenProgram(a.AVERAGE),b.super.constructor.apply(this,arguments)}a.FadeOut=a.defineClass(b,a.Component,{componentName:"FadeOut",init:function(a,c,d){b.super.init.call(this,a,c,d),this.program.init(a)},update:function(){this.gl,this.frameCount++,this.frameCount==this.maxFrameCount&&(this.frameCount=0,this.program.run(this.parent.fm,null,this.color))},destroy:function(){b.super.destroy.call(this),this.program.cleanup()}}),b.ui={type:"FadeOut",disp:"Fade Out",schema:{speed:{type:"number",title:"Speed",maximum:0,minimum:1,"default":1},color:{type:"string",title:"Fadeout color",format:"color","default":"#FFFFFF"}},form:[{key:"speed",type:"range",step:"0.05"},"color"]}}(Webvs),function(a){function b(c){a.checkRequiredOptions(c,["kernel"]),c=_.defaults(c,{edgeMode:"EXTEND",bias:0});var d;if(c.kernel in b.kernels)d=b.kernels[c.kernel];else{if(!_.isArray(c.kernel)||1!==c.kernel.length%2)throw new Error("Invalid convolution kernel");d=c.kernel}var e=Math.floor(Math.sqrt(d.length));if(e*e!=d.length)throw new Error("Invalid convolution kernel");this.program=new a.ConvolutionProgram(d,e,c.edgeMode,c.scale,c.bias),b.super.constructor.apply(this,arguments)}function c(b,d,e,f,g){var h="";switch(e){case"WRAP":h="pos = vec2(pos.x<0?pos.x+1.0:pos.x%1, pos.y<0?pos.y+1.0:pos.y%1);";break;case"EXTEND":h="pos = clamp(pos, vec2(0,0), vec2(1,1));";break;default:throw new Error("Invalid edge mode")}var i,j,k=[],l=Math.floor(d/2);for(i=0;d>i;i++)for(j=0;d>j;j++){var m=b[i*d+j];0!==m&&(k.push("pos = v_position + texel * vec2("+(i-l)+","+(j-l)+");"),k.push(h),k.push("colorSum += texture2D(u_srcTexture, pos) * "+a.glslFloatRepr(m)+";"))}_.isUndefined(f)&&(f=_.reduce(b,function(a,b){return a+b},0)),c.super.constructor.call(this,{swapFrame:!0,fragmentShader:["void main() {","   vec2 texel = 1.0/(u_resolution-vec2(1,1));","   vec2 pos;","   vec4 colorSum = vec4(0,0,0,0);",k.join("\n"),"   setFragColor(vec4(((colorSum+"+a.glslFloatRepr(g)+") / "+a.glslFloatRepr(f)+").rgb, 1.0));","}"]})}a.Convolution=a.defineClass(b,a.Component,{componentName:"Convolution",init:function(a,c,d){b.super.init.call(this,a,c,d),this.program.init(a)},update:function(){this.program.run(this.parent.fm,null)},destroy:function(){b.super.destroy.call(this),this.program.cleanup()}}),b.kernels={normal:[0,0,0,0,1,0,0,0,0],gaussianBlur:[.045,.122,.045,.122,.332,.122,.045,.122,.045],unsharpen:[-1,-1,-1,-1,9,-1,-1,-1,-1],emboss:[-2,-1,0,-1,1,1,0,1,2],blur:[1,1,1,1,1,1,1,1,1]},a.ConvolutionProgram=a.defineClass(c,a.QuadBoxProgram)}(Webvs),function(a){function b(c){if(a.checkRequiredOptions(c,["maps"]),c=_.defaults(c,{key:"RED",output:"REPLACE",mapCycleMode:"SINGLE"}),this.maps=c.maps,this.currentMap=0,this.mapCycleMode=this.mapCycleModes[c.mapCycleMode],!this.mapCycleMode)throw new Error("Unknown mapCycleMode "+c.mapCycleMode);this.program=new a.ColorMapProgram(c.key,a.getBlendMode(c.output)),b.super.constructor.apply(this,arguments)}function c(a,b){var d="";switch(a){case"RED":d="srcColor.r";break;case"GREEN":d="srcColor.g";break;case"BLUE":d="srcColor.b";break;case"(R+G+B)/2":d="mod((srcColor.r+srcColor.g+srcColor.b)/2.0, 1.0)";break;case"(R+G+B)/3":d="(srcColor.r+srcColor.g+srcColor.b)/3.0";break;case"MAX":d="max(srcColor.r, max(srcColor.g, srcColor.b))";break;default:throw new Error("Unknown colormap key function "+options.key)}c.super.constructor.call(this,{outputBlendMode:b,swapFrame:!0,fragmentShader:["uniform sampler2D u_colorMap;","void main() {","   vec4 srcColor = getSrcColor();","   setFragColor(texture2D(u_colorMap, vec2(("+d+"), 0)));","}"]})}a.ColorMap=a.defineClass(b,a.Component,{mapCycleModes:{SINGLE:1,ONBEATRANDOM:2,ONBEATSEQUENTIAL:3},init:function(a,c,d){b.super.init.call(this,a,c,d),this.colorMaps=_.map(this.maps,function(a){return this._buildColorMap(a)},this),this.currentMap=0,this.program.init(a)},update:function(){if(this.main.analyser.beat)switch(this.mapCycleMode){case this.mapCycleModes.ONBEATRANDOM:this.currentMap=Math.floor(Math.random()*this.colorMaps.length);break;case this.mapCycleModes.ONBEATSEQUENTIAL:this.currentMap=(this.currentMap+1)%this.colorMaps.length}this.program.run(this.parent.fm,null,this.colorMaps[this.currentMap])},destroy:function(){b.super.destroy.call(this),this.program.cleanup()},_buildColorMap:function(b){var c=this.gl;b=_.sortBy(b,function(a){return a.index});var d=_.map(b,function(a){return a.index});if(_.uniq(d).length!=d.length)throw new Error("map cannot have repeated indices");b=_.map(b,function(b){var c=a.parseColor(b.color);return{color:c,index:b.index}});var e=_.first(b);0!==e.index&&b.splice(0,0,{color:e.color,index:0});var f=_.last(b);255!==f.index&&b.push({color:f.color,index:255});var g=new Uint8Array(768),h=0,i=_.zip(_.first(b,b.length-1),_.last(b,b.length-1));_.each(i,function(a){var b=a[0],c=a[1],d=c.index-b.index;_.times(d,function(a){g[h++]=Math.floor((b.color[0]*(255-a)+c.color[0]*a)/255),g[h++]=Math.floor((b.color[1]*(255-a)+c.color[1]*a)/255),g[h++]=Math.floor((b.color[2]*(255-a)+c.color[2]*a)/255)})}),g[h++]=f.color[0],g[h++]=f.color[1],g[h++]=f.color[2];var j=c.createTexture();return c.bindTexture(c.TEXTURE_2D,j),c.texImage2D(c.TEXTURE_2D,0,c.RGB,256,1,0,c.RGB,c.UNSIGNED_BYTE,g),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),j}}),a.ColorMapProgram=a.defineClass(c,a.QuadBoxProgram,{draw:function(a){this.setUniform("u_colorMap","texture2D",a),c.super.draw.call(this)}}),b.ui={disp:"Color Map",type:"ColorMap",schema:{maps:{type:"array",items:{type:"array",title:"Map",items:{type:"object",properties:{color:{type:"string",title:"Color",format:"color","default":"#FFFFFF"},index:{type:"number",title:"Index",minimum:0,maximum:255}}}}},key:{type:"string",title:"Map key","enum":["RED","GREEN","BLUE","(R+G+B)/2","(R+G+B)/3","MAX"],"default":"RED"},mapCycleMode:{type:"string",title:"Map Cycle Mode","enum":["SINGLE","ONBEATRANDOM","ONBEATSEQUENTIAL"],"default":"SINGLE"},output:{type:"string",title:"Output blend mode","enum":_.keys(a.blendModes),"default":"REPLACE"}}}}(Webvs),function(a){function b(c){if(a.checkRequiredOptions(c,["mode","color","outColor"]),c=_.defaults(c,{mode:"BELOW",color:"#202020",outColor:"#202020",level:0}),this.mode=_.indexOf(this.modes,c.mode),-1==this.mode)throw new Error("ColorClip: invalid mode");this.color=a.parseColorNorm(c.color),this.outColor=a.parseColorNorm(c.outColor),this.level=c.level,this.program=new a.ColorClipProgram,b.super.constructor.apply(this,arguments)}function c(){c.super.constructor({swapFrame:!0,fragmentShader:["uniform int u_mode;","uniform vec3 u_color;","uniform vec3 u_outColor;","uniform float u_level;","void main() {","   vec4 inColor4 = getSrcColor();","   vec3 inColor = inColor4.rgb;","   bool clip = false;","   if(u_mode == 0) {","           clip = all(lessThanEqual(inColor, u_color));","   }","   if(u_mode == 1) {","           clip = all(greaterThanEqual(inColor, u_color));","   }","   if(u_mode == 2) {","           clip = (distance(inColor, u_color) <= u_level*0.5);","   }","   if(clip) {","       setFragColor(vec4(u_outColor, inColor4.a));","   } else {","       setFragColor(inColor4);","   }","}"]})}a.ColorClip=a.defineClass(b,a.Component,{modes:["BELOW","ABOVE","NEAR"],componentName:"ChannelShift",init:function(a,c,d){b.super.init.call(this,a,c,d),this.program.init(a)},update:function(){this.program.run(this.parent.fm,null,this.mode,this.color,this.outColor,this.level)},destroy:function(){b.super.destroy.call(this),this.program.cleanup()}}),a.ColorClipProgram=a.defineClass(c,a.QuadBoxProgram,{draw:function(a,b,d,e){this.setUniform("u_mode","1i",a),this.setUniform.apply(this,["u_color","3f"].concat(b)),this.setUniform.apply(this,["u_outColor","3f"].concat(d)),this.setUniform("u_level","1f",e),c.super.draw.call(this)}})}(Webvs),function(a){function b(c){a.checkRequiredOptions(c,["code"]),c=_.defaults(c,{gridW:16,gridH:16,noGrid:!1,bFilter:!0,compat:!1,coord:"POLAR"});var d;if(!_.isObject(c.code))throw new Error("Invalid Dynamic movement code");d=c.code;var e=new a.ExprCodeGenerator(d,["x","y","r","d","b"]);this.code=e.generateJs(["init","onBeat","perFrame"]);var f=e.generateGlsl(["perPixel"],["x","y","d","r"],this.code);this.inited=!1,this.noGrid=c.noGrid,this.gridW=c.gridW,this.gridH=c.gridH,this.coordMode=c.coord,this.bFilter=c.bFilter,this.compat=c.compat,this.program=this.noGrid?new a.DMovProgramNG(this.coordMode,this.bFilter,this.compat,this.code.hasRandom,f):new a.DMovProgram(this.coordMode,this.bFilter,this.compat,this.code.hasRandom,f),b.super.constructor.apply(this,arguments)}function c(a,b,d,e,f){var g=[f,this.glslFilter(b,d),"void main() {",e?"__randSeed = v_position;":"","   x = v_position.x*2.0-1.0;","   y = -(v_position.y*2.0-1.0);",this.glslRectToPolar(a),"   perPixel();",this.glslPolarToRect(a),"   setFragColor(vec4(filter(vec2(x, -y)), 1));","}"];c.super.constructor.call(this,{fragmentShader:g,swapFrame:!0})}function d(a,b,c,e,f){var g=["attribute vec2 a_position;","varying vec2 v_newPoint;","uniform int u_coordMode;",f,"void main() {",e?"__randSeed = a_position;":"","   x = a_position.x;","   y = -a_position.y;",this.glslRectToPolar(a),"   perPixel();",this.glslPolarToRect(a),"   v_newPoint = vec2(x,-y);","   setPosition(a_position);","}"],h=["varying vec2 v_newPoint;",this.glslFilter(b,c),"void main() {","   setFragColor(vec4(filter(v_newPoint), 1));","}"];d.super.constructor.call(this,{fragmentShader:h,vertexShader:g,swapFrame:!0})}a.DynamicMovement=a.defineClass(b,a.Component,{componentName:"DynamicMovement",init:function(c,d,e){if(b.super.init.call(this,c,d,e),this.program.init(c),this.code.setup(d,e),!this.noGrid){for(var f=a.clamp(this.gridW,1,this.main.canvas.width),g=a.clamp(this.gridH,1,this.main.canvas.height),h=2*(f/this.main.canvas.width),i=2*(g/this.main.canvas.height),j=Math.ceil(this.main.canvas.width/f),k=Math.ceil(this.main.canvas.height/g),l=new Float32Array(2*6*j*k),m=0,n=-1,o=-1,p=0;k>p;p++){for(var q=0;j>q;q++){var r=Math.min(n+h,1),s=Math.min(o+i,1);l[m++]=n,l[m++]=o,l[m++]=r,l[m++]=o,l[m++]=n,l[m++]=s,l[m++]=r,l[m++]=o,l[m++]=r,l[m++]=s,l[m++]=n,l[m++]=s,n+=h}n=-1,o+=i}this.gridVertices=l,this.gridVerticesSize=m/2}},update:function(){var a=this.code;this.inited||(a.init(),this.inited=!0);var b=this.main.analyser.beat;a.b=b?1:0,a.perFrame(),b&&a.onBeat(),this.noGrid?this.program.run(this.parent.fm,null,this.code):this.program.run(this.parent.fm,null,this.code,this.gridVertices,this.gridVerticesSize)},destroy:function(){b.super.destroy.call(this),this.program.cleanup()}});var e={glslRectToPolar:function(a){return"POLAR"===a?["float ar = u_resolution.x/u_resolution.y;","x=x*ar;","d = distance(vec2(x, y), vec2(0,0))/sqrt(2.0);","r = mod(atan(y, x)+PI*0.5, 2.0*PI);"].join("\n"):""},glslPolarToRect:function(a){return"POLAR"===a?["d = d*sqrt(2.0);","x = d*sin(r)/ar;","y = -d*cos(r);"].join("\n"):""},glslFilter:function(a,b){return a&&!b?["vec3 filter(vec2 point) {","   vec2 texel = 1.0/(u_resolution-vec2(1,1));","   vec2 coord = (point+1.0)/2.0;","   vec2 cornoff = fract(coord/texel);","   vec2 corn = floor(coord/texel)*texel;","   vec3 tl = getSrcColorAtPos(corn).rgb;","   vec3 tr = getSrcColorAtPos(corn + vec2(texel.x, 0)).rgb;","   vec3 bl = getSrcColorAtPos(corn + vec2(0, texel.y)).rgb;","   vec3 br = getSrcColorAtPos(corn + texel).rgb;","   vec3 pt = mix(tl, tr, cornoff.x);","   vec3 pb = mix(bl, br, cornoff.x);","   return mix(pt, pb, cornoff.y);","}"].join("\n"):a&&b?["vec3 filter(vec2 point) {","   vec2 texel = 1.0/(u_resolution-vec2(1,1));","   vec2 coord = (point+1.0)/2.0;","   vec2 corn = floor(coord/texel)*texel;","   ivec2 cornoff = (ivec2(fract(coord/texel)*255.0));","   ivec3 tl = ivec3(255.0 * getSrcColorAtPos(corn).rgb);","   ivec3 tr = ivec3(255.0 * getSrcColorAtPos(corn + vec2(texel.x, 0)).rgb);","   ivec3 bl = ivec3(255.0 * getSrcColorAtPos(corn + vec2(0, texel.y)).rgb);","   ivec3 br = ivec3(255.0 * getSrcColorAtPos(corn + texel).rgb);","   #define bt(i, j) int((float(i)/255.0)*float(j))","   int a1 = bt(255-cornoff.x,255-cornoff.y);","   int a2 = bt(cornoff.x    ,255-cornoff.y);","   int a3 = bt(255-cornoff.x,cornoff.y);","   int a4 = bt(cornoff.x    ,cornoff.y);","   float r = float(bt(a1,tl.r) + bt(a2,tr.r) + bt(a3,bl.r) + bt(a4,br.r))/255.0;","   float g = float(bt(a1,tl.g) + bt(a2,tr.g) + bt(a3,bl.g) + bt(a4,br.g))/255.0;","   float b = float(bt(a1,tl.b) + bt(a2,tr.b) + bt(a3,bl.b) + bt(a4,br.b))/255.0;","   return vec3(r,g,b);","}"].join("\n"):["vec3 filter(vec2 point) {","   return getSrcColorAtPos((point+1.0)/2.0).rgb;","}"].join("\n")}};a.DMovProgramNG=a.defineClass(c,a.QuadBoxProgram,e,{draw:function(a){a.bindUniforms(this),c.super.draw.call(this)}}),a.DMovProgram=a.defineClass(d,a.ShaderProgram,e,{draw:function(a,b,c){a.bindUniforms(this),this.setVertexAttribArray("a_position",b,2,this.gl.FLOAT,!1,0,0),this.gl.drawArrays(this.gl.TRIANGLES,0,c)}}),b.ui={type:"DynamicMovement",disp:"Dynamic Movement",schema:{code:{type:"object",title:"Code","default":{},properties:{init:{type:"string",title:"Init"},onBeat:{type:"string",title:"On Beat"},perFrame:{type:"string",title:"Per Frame"},perPixel:{type:"string",title:"Per Point"}}},gridW:{type:"number",title:"Grid Width","default":16},gridH:{type:"number",title:"Grid Height","default":16},coord:{type:"string",title:"Coordinate System","enum":["POLAR","RECT"],"default":"POLAR"}},form:[{key:"code.init",type:"textarea"},{key:"code.onBeat",type:"textarea"},{key:"code.perFrame",type:"textarea"},{key:"code.perPixel",type:"textarea"},"gridW","gridH","coord"]}}(Webvs),function(a){function b(a){a=_.defaults(a,{bFilter:!0,coord:"POLAR",compat:!1}),b.super.constructor.call(this,{noGrid:!0,bFilter:a.bFilter,compat:a.compat,coord:a.coord,code:a.code}),this.options=a}a.Movement=a.defineClass(b,a.DynamicMovement)}(Webvs),function(a){function b(a){if(a=_.defaults(a,{channel:"RGB",onBeatRandom:!1}),this.channel=d.indexOf(a.channel),-1==this.channel)throw new Error("Invalid Channel");this.onBeatRandom=a.onBeatRandom,this.program=new c,b.super.constructor.apply(this,arguments)}function c(){c.super.constructor.call(this,{swapFrame:!0,fragmentShader:["uniform int u_channel;","void main() {","   vec3 color = getSrcColor().rgb;",_.flatMap(d,function(a,b){return["if(u_channel == "+b+") {","   setFragColor(vec4(color."+a.toLowerCase()+",1));","}"]}).join("\n"),"}"]})}var d=["RGB","RBG","BRG","BGR","GBR","GRB"];a.ChannelShift=a.defineClass(b,a.Component,{componentName:"ChannelShift",init:function(a,c,d){b.super.init.call(this,a,c,d),this.program.init(a)},update:function(){this.onBeatRandom&&this.main.analyser.beat&&(this.channel=Math.floor(Math.random()*d.length)),this.program.run(this.parent.fm,null,this.channel)},destroy:function(){b.super.destroy.call(this),this.program.cleanup()}}),a.ChannelShiftProgram=a.defineClass(c,a.QuadBoxProgram,{draw:function(a){this.setUniform("u_channel","1i",a),c.super.draw.call(this)}}),b.ui={disp:"Channel Shift",type:"ChannelShift",schema:{channel:{type:"string",title:"Channel","enum":d},onBeatRandom:{type:"boolean",title:"On beat random"}}}}(Webvs),function(a){function b(b){b=_.defaults(b,{color:"#ffffff",invert:!1,blendMode:"REPLACE"}),this.tone=a.parseColorNorm(b.color),this.invert=b.invert,this.program=new c(a.getBlendMode(b.blendMode))}function c(a){c.super.constructor.call(this,{outputBlendMode:a,swapFrame:!0,fragmentShader:["uniform vec3 u_tone;","uniform bool u_invert;","void main() {","   vec4 srcColor = getSrcColor();","   float depth = max(srcColor.r, max(srcColor.g, srcColor.b));","   if(u_invert) {","       depth = 1.0-depth;","   }","   setFragColor(vec4(depth*u_tone, 1));","}"]})}a.UniqueTone=a.defineClass(b,a.Component,{init:function(a,c,d){b.super.init.call(this,a,c,d),this.program.init(a)},update:function(){this.program.run(this.parent.fm,null,this.tone,this.invert)},destroy:function(){b.super.destroy.call(this),this.program.cleanup()}}),a.UniqueToneProgram=a.defineClass(c,a.QuadBoxProgram,{draw:function(a,b){this.setUniform.apply(this,["u_tone","3f"].concat(a)),this.setUniform("u_invert","1f",b?1:0),c.super.draw.call(this)}})}(Webvs),function(a){function b(d){a.checkRequiredOptions(d,["code"]),d=_.defaults(d,{source:"SPECTRUM",drawMode:"LINES",colors:["#ffffff"]});var e;if(!_.isObject(d.code))throw new Error("Invalid superscope");e=d.code;var f=new a.ExprCodeGenerator(e,["n","v","i","x","y","b","red","green","blue"]);this.code=f.generateJs(["init","onBeat","perFrame","perPoint"]),this.code.n=100,this.clone=d.clone||1,this.spectrum="SPECTRUM"==d.source,this.dots="DOTS"==d.drawMode,this.colors=_.map(d.colors,a.parseColorNorm),this.currentColor=[],this.maxStep=100,this.step=this.maxStep,this.colorId=0,this.colorStep=[0,0,0],this.thickness=d.thickness?d.thickness:1,this.inited=!1,this.program=new c,b.super.constructor.apply(this,arguments)}function c(){c.super.constructor.call(this,{copyOnSwap:!0,vertexShader:["attribute vec2 a_position;","attribute vec3 a_color;","varying vec3 v_color;","uniform float u_pointSize;","void main() {","   gl_PointSize = u_pointSize;","   setPosition(clamp(a_position, vec2(-1,-1), vec2(1,1)));","   v_color = a_color;","}"],fragmentShader:["varying vec3 v_color;","void main() {","   setFragColor(vec4(v_color, 1));","}"]})}a.SuperScope=a.defineClass(b,a.Component,{componentName:"SuperScope",init:function(c,d,e){b.super.init.call(this,c,d,e),this.program.init(c),this.code.setup(d,this),this.code=a.CodeInstance.clone(this.code,this.clone)},update:function(){this._stepColor(),_.each(this.code,function(a){this.drawScope(a,!this.inited)},this),this.inited=!0},drawScope:function(a,b){this.gl,a.red=this.currentColor[0],a.green=this.currentColor[1],a.blue=this.currentColor[2],b&&a.init();var c=this.main.analyser.beat;a.b=c?1:0,a.perFrame(),c&&a.onBeat();for(var d=Math.floor(a.n),e=this.spectrum?this.main.analyser.getSpectrum():this.main.analyser.getWaveform(),f=e.length/d,g=0,h=0,i=new Float32Array(2*(this.dots?d:2*d-2)),j=new Float32Array(3*(this.dots?d:2*d-2)),k=0;d>k;k++){for(var l=0,m=0,n=Math.floor(k*f);(k+1)*f>n;n++,m++)l+=e[n];l/=m;var o=k/(d>1?d-1:1);a.i=o,a.v=l,a.perPoint(),i[g++]=a.x,i[g++]=-1*a.y,0===k||k==d-1||this.dots||(i[g++]=a.x,i[g++]=-1*a.y),this.dots?(j[h++]=a.red,j[h++]=a.green,j[h++]=a.blue):0!==k&&(j[h++]=a.red,j[h++]=a.green,j[h++]=a.blue,j[h++]=a.red,j[h++]=a.green,j[h++]=a.blue)}this.program.run(this.parent.fm,null,i,j,this.dots,this.thickness)},destroy:function(){b.super.destroy.call(this),this.program.cleanup()},_stepColor:function(){var a;if(this.colors.length>1)if(this.step==this.maxStep){var b=this.colors[this.colorId];this.colorId=(this.colorId+1)%this.colors.length;var c=this.colors[this.colorId];for(a=0;3>a;a++)this.colorStep[a]=(c[a]-b[a])/this.maxStep;for(this.step=0,a=0;3>a;a++)this.currentColor[a]=b[a]}else{for(a=0;3>a;a++)this.currentColor[a]+=this.colorStep[a];this.step++}else this.currentColor=this.colors[0]}}),a.SuperScopeShader=a.defineClass(c,a.ShaderProgram,{draw:function(a,b,c,d){var e=this.gl;this.setUniform("u_pointSize","1f",d),this.setVertexAttribArray("a_position",a,2,e.FLOAT,!1,0,0),this.setVertexAttribArray("a_color",b,3,e.FLOAT,!1,0,0);var f;c||(f=e.getParameter(e.LINE_WIDTH),e.lineWidth(d)),e.drawArrays(c?e.POINTS:e.LINES,0,a.length/2),c||e.lineWidth(f)}}),b.ui={disp:"SuperScope",type:"SuperScope",schema:{code:{type:"object",title:"Code","default":{},properties:{init:{type:"string",title:"Init"},onBeat:{type:"string",title:"On Beat"},perFrame:{type:"string",title:"Per Frame"},perPoint:{type:"string",title:"Per Point"}}},source:{type:"string",title:"Source","default":"WAVEFORM","enum":["WAVEFORM","SPECTRUM"]},drawMode:{type:"string",title:"Draw Mode","default":"LINES","enum":["DOTS","LINES"]},colors:{type:"array",title:"Cycle Colors",items:{type:"string",format:"color","default":"#FFFFFF"}}}}}(Webvs),function(a){function b(a){a=_.defaults(a,{drawMode:"SOLID",source:"WAVEFORM",align:"CENTER",colors:["#ffffff"]});var c={};"SOLID"!=a.drawMode?(c.init="n=w;",c.perPoint={TOP:"x=i*2-1; y=-v/2-0.5;",CENTER:"x=i*2-1; y=-v/2;",BOTTOM:"x=i*2-1; y=v/2+0.5;"}[a.align]):(c.init="n=w*2;",c.perFrame="c=0;",c.perPoint="SPECTRUM"==a.source?{TOP:"x=i*2-1; y=if(c%2,0,-v/2-0.5); c=c+1;",CENTER:"x=i*2-1; y=if(c%2,0.5,-v/2);   c=c+1;",BOTTOM:"x=i*2-1; y=if(c%2,0,v/2+0.5);  c=c+1;"}[a.align]:{TOP:"x=i*2-1; y=if(c%2,-0.5,-v/2-0.5); c=c+1;",CENTER:"x=i*2-1; y=if(c%2,0,-v/2);        c=c+1;",BOTTOM:"x=i*2-1; y=if(c%2,0.5,v/2+0.5);   c=c+1;"}[a.align]),b.super.constructor.call(this,{source:a.source,drawMode:"SOLID"==a.drawMode?"LINES":a.drawMode,colors:a.colors,code:c}),this.options=a}a.Simple=a.defineClass(b,a.SuperScope)}(Webvs),function(a){function b(d){a.checkRequiredOptions(d,["code","imageSrc"]),d=_.defaults(d,{source:"SPECTRUM",resizing:!1,wrapAround:!1,colorFiltering:!0}),this.resizing=d.resizing,this.colorFiltering=d.colorFiltering,this.wrapAround=d.wrapAround,this.imageSrc=d.imageSrc;var e=new a.ExprCodeGenerator(d.code,["n","v","i","x","y","b","sizex","sizey","red","green","blue"]);this.code=e.generateJs(["init","onBeat","perFrame","perPoint"]),this.code.n=100,this.spectrum="SPECTRUM"==d.source,this._inited=!1,this.program=new c,b.super.constructor.apply(this,arguments)}function c(){c.super.constructor.call(this,{vertexShader:["uniform bool u_colorFilter;","attribute vec2 a_texVertex;","attribute vec2 a_vertex;","attribute vec3 a_color;","varying vec2 v_texVertex;","varying vec3 v_color;","void main() {","   if(u_colorFilter) {","       v_color = a_color;","   }","   v_texVertex = a_texVertex;","   setPosition(a_vertex);","}"],fragmentShader:["uniform bool u_colorFilter;","uniform sampler2D u_image;","varying vec2 v_texVertex;","varying vec3 v_color;","void main() {","   vec3 outColor = texture2D(u_image, v_texVertex).rgb;","   if(u_colorFilter) {","       outColor = outColor*v_color;","   }","   setFragColor(vec4(outColor, 1));","}"]})}a.Texer=a.defineClass(b,a.Component,{componentName:"Texer",init:function(a,c,d){b.super.init.call(this,a,c,d),this.program.init(a),this.code.setup(c,this);var e=new Image;e.src=c.getResource(this.imageSrc),this.imagewidth=e.width,this.imageHeight=e.height,this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE)},update:function(){function a(a,b,c,d,e,f,l){-1-c>a||a>1||-1-d>b||b>1||(g.push(a,b,a+c,b,a+c,b+d,a,b+d),h.push(0,0,1,0,1,1,0,1),j&&j.push(e,f,l,e,f,l,e,f,l,e,f,l),i.push(k+0,k+1,k+2,k+0,k+2,k+3),k+=4)}var b=this.code;this._inited||b.init();var c=this.main.analyser.beat;b.b=c?1:0,b.perFrame(),c&&b.onBeat();for(var d=Math.floor(b.n),e=this.spectrum?this.main.analyser.getSpectrum():this.main.analyser.getWaveform(),f=e.length/d,g=[],h=[],i=[],j=this.colorFiltering?[]:null,k=0,l=2*(this.imagewidth/this.parent.fm.width),m=2*(this.imageHeight/this.parent.fm.height),n=0;d>n;n++){for(var o=0,p=0,q=Math.floor(n*f);(n+1)*f>q;q++,p++)o+=e[q];o/=p;var r=n/(d-1);b.i=r,b.v=o,b.sizex=1,b.sizey=1,b.red=1,b.green=1,b.blue=1,b.perPoint();var s=l,t=m;this.resizing&&(s*=b.sizex,t*=b.sizey);var u=b.x-s/2,v=-b.y-t/2;if(a(u,v,s,t,b.red,b.green,b.blue),this.wrapAround){var w=-1>u?2:u>1-s?-2:0,x=-1>v?2:v>1-t?-2:0;w&&a(w+u,v,s,t,b.red,b.green,b.blue),x&&a(u,x+v,s,t,b.red,b.green,b.blue),w&&x&&a(w+u,x+v,s,t,b.red,b.green,b.blue)}}this.program.run(this.parent.fm,null,new Float32Array(g),new Float32Array(h),new Uint16Array(i),j?new Float32Array(j):null,this.texture)},destroy:function(){b.super.destroy.call(this),this.gl.deleteTexture(this.texture),this.program.cleanup()}}),a.TexerProgram=a.defineClass(c,a.ShaderProgram,{draw:function(a,b,c,d,e){this.setUniform("u_image","texture2D",e),this.setVertexAttribArray("a_vertex",a),this.setVertexAttribArray("a_texVertex",b),d?(this.setUniform("u_colorFilter","1f",1),this.setVertexAttribArray("a_color",d,3)):this.setUniform("u_colorFilter","1f",0),this.setElementArray(c),this.gl.drawElements(this.gl.TRIANGLES,c.length,this.gl.UNSIGNED_SHORT,0)}})}(Webvs),function(a){function b(c){c=_.defaults(c,{n:0,color:"#000000",blendMode:"REPLACE"}),this.n=c.n,this.color=a.parseColorNorm(c.color),this.outputBlendMode=a.blendModes[c.blendMode],this.prevBeat=!1,this.beatCount=0,this.program=new a.ClearScreenProgram(this.outputBlendMode),b.super.constructor.apply(this,arguments)}a.ClearScreen=a.defineClass(b,a.Component,{componentName:"ClearScreen",init:function(a,c,d){b.super.init.call(this,a,c,d),this.program.init(a)},update:function(){var a=!1;0===this.n?a=!0:(this.main.analyser.beat&&!this.prevBeat&&(this.beatCount++,this.beatCount==this.n&&(a=!0,this.beatCount=0)),this.prevBeat=this.main.analyser.beat),a&&this.program.run(this.parent.fm,null,this.color)},destroy:function(){this.program.cleanup()}}),b.ui={type:"ClearScreen",disp:"Clear Screen",schema:{n:{type:"number",title:"Clear on beat (0 = always clear)","default":0},color:{type:"string",title:"Clear color",format:"color","default":"#000000"},blendMode:{type:"string",title:"Blend Mode","enum":_.keys(a.blendModes)}}}}(Webvs),function(a){function b(c){a.checkRequiredOptions(c,["src","x","y"]),this.x=c.x,this.y=c.y,this.src=c.src,this.program=new a.PictureProgram,b.super.constructor.apply(this,arguments)}function c(){c.super.constructor.call(this,{copyOnSwap:!0,vertexShader:["attribute vec2 a_texVertex;","uniform vec2 u_pos;","uniform vec2 u_texRes;","varying vec2 v_texCoord;","void main() {","   v_texCoord = a_texVertex;","   setPosition(a_texVertex*(u_texRes/u_resolution)*vec2(2,-2)+u_pos);","}"],fragmentShader:["uniform sampler2D u_image;","varying vec2 v_texCoord;","void main() {","   setFragColor(texture2D(u_image, v_texCoord));","}"]})}a.Picture=a.defineClass(b,a.Component,{init:function(a,c,d){b.super.init.call(this,a,c,d),this.program.init(a);var e=new Image;e.src=c.getResource(this.src),this.width=e.width,this.height=e.height,this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE)},update:function(){this.program.run(this.parent.fm,null,this.x,this.y,this.texture,this.width,this.height)},destroy:function(){this.program.cleanup(),this.gl.deleteTexture(this.texture)}}),a.PictureProgram=a.defineClass(c,a.ShaderProgram,{draw:function(a,b,c,d,e){this.setUniform("u_pos","2f",a,-b),this.setUniform("u_texRes","2f",d,e),this.setUniform("u_image","texture2D",c),this.setVertexAttribArray("a_texVertex",new Float32Array([0,0,0,1,1,1,0,0,1,1,1,0])),this.gl.drawArrays(this.gl.TRIANGLES,0,6)}})}(Webvs);