/** * almond 0.2.7 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */ /** * Array.nocomplex version: "0.0.22" Copyright (c) 2011-2012, Cyril Agosta ( cyril.agosta@gmail.com) All Rights Reserved. * Available via the MIT license. * see: http://github.com/cagosta/Array.nocomplex for details */ var requirejs,require,define;!function(e){function n(e,n){return g.call(e,n)}function r(e,n){var r,t,o,i,s,u,f,a,c,h,p=n&&n.split("/"),l=y.map,m=l&&l["*"]||{};if(e&&"."===e.charAt(0))if(n){for(p=p.slice(0,p.length-1),e=p.concat(e.split("/")),a=0;a0&&(e.splice(a-1,2),a-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((p||m)&&l){for(r=e.split("/"),a=r.length;a>0;a-=1){if(t=r.slice(0,a).join("/"),p)for(c=p.length;c>0;c-=1)if(o=l[p.slice(0,c).join("/")],o&&(o=o[t])){i=o,s=a;break}if(i)break;!u&&m&&m[t]&&(u=m[t],f=a)}!i&&u&&(i=u,s=f),i&&(r.splice(0,s,i),e=r.join("/"))}return e}function t(n,r){return function(){return c.apply(e,v.call(arguments,0).concat([n,r]))}}function o(e){return function(n){return r(n,e)}}function i(e){return function(n){l[e]=n}}function s(r){if(n(m,r)){var t=m[r];delete m[r],d[r]=!0,a.apply(e,t)}if(!n(l,r)&&!n(d,r))throw new Error("No "+r);return l[r]}function u(e){var n,r=e?e.indexOf("!"):-1;return r>-1&&(n=e.substring(0,r),e=e.substring(r+1,e.length)),[n,e]}function f(e){return function(){return y&&y.config&&y.config[e]||{}}}var a,c,h,p,l={},m={},y={},d={},g=Object.prototype.hasOwnProperty,v=[].slice;h=function(e,n){var t,i=u(e),f=i[0];return e=i[1],f&&(f=r(f,n),t=s(f)),f?e=t&&t.normalize?t.normalize(e,o(n)):r(e,n):(e=r(e,n),i=u(e),f=i[0],e=i[1],f&&(t=s(f))),{f:f?f+"!"+e:e,n:e,pr:f,p:t}},p={require:function(e){return t(e)},exports:function(e){var n=l[e];return"undefined"!=typeof n?n:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:f(e)}}},a=function(r,o,u,f){var a,c,y,g,v,x,A=[],b=typeof u;if(f=f||r,"undefined"===b||"function"===b){for(o=!o.length&&u.length?["require","exports","module"]:o,v=0;vn;n++)e(this[n],n);return this}}),define("Array.nocomplex/first",[],function(){Array.prototype.first=function(e){for(var n=0,r=this.length;r>n;n++)if(e(this[n]))return this[n];return null}}),define("Array.nocomplex/has",[],function(){Array.prototype.has=function(e){for(var n=this.length;n--;)if(this[n]===e)return!0;return!1}}),define("Array.nocomplex/last",[],function(){Array.prototype.last=function(){return this[this.length-1]}}),define("Array.nocomplex/map",[],function(){Array.prototype.map=Array.prototype.map||function(e,n){n&&(e=e.bind(n));var r=this.slice();if("function"==typeof e)for(var t=0,o=r.length;o>t;t++)r[t]=e(r[t],t);else{e=e.substr(2,e.length);for(var t=0,o=r.length;o>t;t++)r[t]=r[t][e]()}return r}}),define("Array.nocomplex/onEls",[],function(){Array.prototype.onEls=function(e){for(var n=this.length;n--;)this[n]=e(this[n],n);return this}}),define("Array.nocomplex/remove",[],function(){Array.prototype.remove=function(e){for(var n=this.length;n--;)this[n]===e&&this.splice(n,1);return this}}),define("Array.nocomplex/removeOneValue",[],function(){Array.prototype.removeOneValue=function(e){for(var n=this.length;n--;)if(this[n]===e)return this.splice(n,1)}}),define("Array.nocomplex/except",[],function(){Array.prototype.except=function(e){for(var n=[],r=0,t=this.length;t>r;r++)this[r]!==e&&n.push(this[r]);return n}}),define("Array.nocomplex/exceptFn",[],function(){Array.prototype.exceptFn=function(e){for(var n=this.slice(),r=n.length;r--;)e(n[r])&&n.splice(r,1);return n}}),define("Array.nocomplex/indexOf",[],function(){Array.prototype.indexOf=Array.prototype.indexOf||function(e){var n,r;for(n=0,r=this.length;r>n;n++)if(this[n]===e)return n;return-1}}),define("Array.nocomplex/isIn",["./has"],function(){Array.prototype.isIn=function(e){for(var n=this.length;n--;)if(!e.has(this[n]))return!1;return!0}}),define("Array.nocomplex/send",[],function(){Array.prototype.send=function(e){var n=Array.prototype.slice.call(arguments);if(n.splice(0,1),"string"==typeof e)for(var r=-1,t=this.length;++rt;t++){var i=e(this[t]);r.has(i)||(n.push(this[t]),r.push(i))}return n}for(var n=[],t=this.length;t--;)!n.has(this[t])&&n.push(this[t]);return n}}),define("Array.nocomplex/equals",["./isIn"],function(){Array.prototype.equals=function(e){return this.isIn(e)&&e.isIn(this)?!0:!1}}),define("Array.nocomplex/find",[],function(){Array.prototype.find=function(e){for(var n=0,r=this.length;r>n;n++)if(e(this[n],n))return this[n];return!1},Array.prototype.findReverse=function(e){for(var n=this.length;n--;)if(e(this[n],n))return this[n];return!1}}),define("Array.nocomplex/where",[],function(){Array.prototype.where=function(e){for(var n=[],r=0,t=this.length;t>r;r++)e(this[r])&&n.push(this[r]);return n}}),define("Array.nocomplex/findIndexOf",[],function(){Array.prototype.findIndexOf=function(e){for(var n=0,r=this.length;r>n;n++)if(e(this[n],n))return n;return!1}}),define("Array.nocomplex/findByKey",[],function(){Array.prototype.findByKey=function(e,n){for(var r=0,t=this.length;t>r;r++)if(this[r][e]===n)return this[r];return!1}}),define("Array.nocomplex/basics",["./collect","./each","./first","./has","./last","./map","./onEls","./remove","./removeOneValue","./remove","./except","./exceptFn","./indexOf","./isIn","./send","./uniq","./equals","./find","./where","./findIndexOf","./findByKey"],function(){return Array.prototype}),define("Array.nocomplex/math/all",[],function(){var e={equals:function(e){for(var n=this.length;n--;)if(e[n]!==this[n])return!1;return!0},multiply:function(e){var n=[];if("number"==typeof e)for(var r=this.length;r--;)n[r]=this[r]*e;else for(var r=this.length;r--;)n[r]=this[r]*e[r];return n},divide:function(e){var n=[];if("number"==typeof e)for(var r=this.length;r--;)n[r]=this[r]/e;else for(var r=this.length;r--;)n[r]=this[r]/e[r];return n},min:function(e){var n=e?this.map(e):this;return Math.min.apply(null,n)},minMax:function(e){return[this.min(e),this.max(e)]},max:function(e){var n=e?this.map(e):this;return Math.max.apply(null,n)},average:function(){for(var e=0,n=this.length;n--;)e+=this[n];return e/this.length},minus:function(e){var n=[];if("number"==typeof e)for(var r=this.length;r--;)n[r]=this[r]-e;else for(var r=this.length;r--;)n[r]=this[r]-e[r];return n},domain:function(e,n){var r,t,o=n&&"number"==typeof n[0]?n[0]:this.min(),i=n&&"number"==typeof n[1]?n[1]:this.max();return o===i?this.map(function(){return e[0]}):(r=(e[1]-e[0])/(i-o),t=(e[0]*i-e[1]*o)/(i-o),this.multiply(r).add(t))},add:function(e){var n=[];if("number"==typeof e)for(var r=this.length;r--;)n[r]=this[r]+e;else for(var r=this.length;r--;)n[r]=this[r]+e[r];return n},round:function(){for(var e=this.length;e--;)this[e]=Math.round(this[e]);return this},sum:function(e){for(var n=0,r=this.length;r--;)n+=e(r);return n},orth:function(){if(2!=this.length)throw Error;return[-this[1],this[0]]},norm:function(){return Math.sqrt(this.sum(function(e){return e*e}))}};for(var n in e)e.hasOwnProperty(n)&&(Array.prototype[n]=e[n]);return Array.prototype}),define("Array.nocomplex/Array.nocomplex",["./basics","./math/all"],function(){return Array.prototype});var EngineDetector=function(){this.isNode=!1,this.isBrowser=!1,this.isUnknown=!1,this._exports,this.detect()};EngineDetector.prototype={detect:function(){"undefined"!=typeof module&&module.exports?this._setAsNode():"undefined"!=typeof window?this._setAsBrowser():this._setAsUnknown()},_setAsNode:function(){this.isNode=!0,this.name="node"},_setAsBrowser:function(){this.isBrowser=!0,this._global=window,this.name="browser"},_setAsUnknown:function(){this.isUnknown=!0,this.name="unknown"},setGlobal:function(e){this._global=e},ifNode:function(e){this.isNode&&e()},ifBrowser:function(e){this.isBrowser&&e()},exports:function(e,n){this.isNode?this._global.exports=n:this.isBrowser&&(this._global[e]=n)}};var engine=new EngineDetector,baseUrl,requirejs;engine.ifNode(function(){baseUrl=__dirname,requirejs=require("requirejs"),engine.setGlobal(module)}),engine.ifBrowser(function(){baseUrl="."}),requirejs.config({baseUrl:function(){return"undefined"==typeof define?__dirname:"."}(),shim:{mocha:{exports:"mocha"}},paths:{"Array.nocomplex":".",almond:"bower_components/almond/almond",chai:"bower_components/chai/chai","chai-as-promised":"bower_components/chai-as-promised/lib/chai-as-promised",mocha:"bower_components/mocha/mocha","normalize-css":"bower_components/normalize-css/normalize.css",requirejs:"bower_components/requirejs/require",async:"bower_components/requirejs-plugins/src/async",depend:"bower_components/requirejs-plugins/src/depend",font:"bower_components/requirejs-plugins/src/font",goog:"bower_components/requirejs-plugins/src/goog",image:"bower_components/requirejs-plugins/src/image",json:"bower_components/requirejs-plugins/src/json",mdown:"bower_components/requirejs-plugins/src/mdown",noext:"bower_components/requirejs-plugins/src/noext",propertyParser:"bower_components/requirejs-plugins/src/propertyParser","Markdown.Converter":"bower_components/requirejs-plugins/lib/Markdown.Converter",text:"bower_components/requirejs-plugins/lib/text","sinon-chai":"bower_components/sinon-chai/lib/sinon-chai",sinonjs:"bower_components/sinonjs/sinon"}});var isStandalone=!!requirejs._defined,synchronous=isStandalone;if(engine.ifNode(function(){synchronous=!0}),synchronous){var ArrayNocomplex=requirejs("Array.nocomplex/Array.nocomplex");engine.exports("ArrayNocomplex",ArrayNocomplex)}else requirejs(["Array.nocomplex/Array.nocomplex"],function(e){engine.exports("ArrayNocomplex",e)});define("Array.nocomplex/main",function(){});