Function.prototype.debounce=function(d,c){var b=this,a;return function(){function e(){c||b.apply(f,g);a=null}var f=this,g=arguments;if(a)clearTimeout(a);else c&&b.apply(f,g);a=setTimeout(e,d||100)}};Function.prototype.curry=function(){var d=this,c=Array.prototype.slice.call(arguments);return function(){return d.apply(this,c.concat(Array.prototype.slice.call(arguments)))}};
Function.prototype.partial=function(){var d=this,c=Array.prototype.slice.call(arguments);return function(){for(var b=0,a=0;a<c.length&&b<arguments.length;a++)if(c[a]===undefined)c[a]=arguments[b++];return d.apply(this,c)}};Function.prototype.throttle=function(d){var c=this,b=0,a=false;return function(){var e=this,f=arguments,g=(new Date).getTime()-b;if(g>d){c.apply(e,f);a=false;b=(new Date).getTime()}else a||(a=setTimeout(function(){c.apply(e,f);a=false;b=(new Date).getTime()},d-g))}};
Function.prototype.cycle=function(d){for(var c=this,b,a=-1,e=[],f=1,g=arguments.length,j;f<g;f++)e.push((j=arguments[f])instanceof Array?c.curry.apply(c,j):c.curry(j));var i=function h(){var k=this;a=a==e.length-1?0:++a;e[a].call(k);b&&clearTimeout(b);b=setTimeout(h,d);return h};i.stop=function(h){clearTimeout(b);var k=this;e[a=h||0].call(k)};i.start=function(h){a=h||-1;return i()};return i()};
if(!Array.prototype.indexOf)Array.prototype.indexOf=function(d,c){var b=this.length>>>0;c=Number(c)||0;c=c<0?Math.ceil(c):Math.floor(c);if(c<0)c+=b;for(;c<b;c++)if(c in this&&this[c]===d)return c;return-1};
var FailFast=function(d){function c(b){var a=new Error(b);a.name="FailFast.AssertError";a.message=a.message||b;throw a;}return{VERSION:"1.0",assert:function(b,a){return a===true||c(b)},assertNotNull:function(b,a){return a!==null||c(b)},assertBoolean:function(b,a){return a!==d&&Object.prototype.toString.call(a)==="[object Boolean]"||c(b)},assertString:function(b,a){return a!==d&&Object.prototype.toString.call(a)==="[object String]"||c(b)},assertArray:function(b,a){return a!==d&&Object.prototype.toString.call(a)===
"[object Array]"||c(b)},assertFunction:function(b,a){return a!==d&&Object.prototype.toString.call(a)==="[object Function]"||c(b)},assertDate:function(b,a){return a!==d&&Object.prototype.toString.call(a)==="[object Date]"||c(b)},assertNumber:function(b,a){return Object.prototype.toString.call(a)==="[object Number]"||c(b)},assertNormalNumber:function(b,a){return+a===a&&isFinite(a)||c(b)},assertObject:function(b,a){return a!==d&&Object.prototype.toString.call(a)==="[object Object]"||c(b)},assertHasProperty:function(b,
a,e){return e in a||c(b)},assertMatch:function(b,a,e){return a.test(e)||c(b)}}}();

