forked from protonphoton/LJ
2 lines
1.2 MiB
JavaScript
2 lines
1.2 MiB
JavaScript
|
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):global.clm=factory()}(this,function(){"use strict";var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(fn,module){return fn(module={exports:{}},module.exports),module.exports}for(var numeric1_2_6=createCommonjsModule(function(module,exports){var numeric=exports;void 0!==commonjsGlobal&&(commonjsGlobal.numeric=numeric),numeric.version="1.2.6",numeric.bench=function(f,interval){var t1,n,i;for(void 0===interval&&(interval=15),n=.5,t1=new Date;;){for(i=n*=2;i>3;i-=4)f(),f(),f(),f();for(;i>0;)f(),i--;if(new Date-t1>interval)break}for(i=n;i>3;i-=4)f(),f(),f(),f();for(;i>0;)f(),i--;return 1e3*(3*n-1)/(new Date-t1)},numeric._myIndexOf=function(w){var k,n=this.length;for(k=0;k<n;++k)if(this[k]===w)return k;return-1},numeric.myIndexOf=Array.prototype.indexOf?Array.prototype.indexOf:numeric._myIndexOf,numeric.Function=Function,numeric.precision=4,numeric.largeArray=50,numeric.prettyPrint=function(x){var ret=[];return function foo(x){var k;if(void 0===x)return ret.push(Array(numeric.precision+8).join(" ")),!1;if("string"==typeof x)return ret.push('"'+x+'"'),!1;if("boolean"==typeof x)return ret.push(x.toString()),!1;if("number"==typeof x){var a=function fmtnum(x){if(0===x)return"0";if(isNaN(x))return"NaN";if(x<0)return"-"+fmtnum(-x);if(isFinite(x)){var scale=Math.floor(Math.log(x)/Math.log(10)),normalized=x/Math.pow(10,scale),basic=normalized.toPrecision(numeric.precision);return 10===parseFloat(basic)&&(scale++,basic=(normalized=1).toPrecision(numeric.precision)),parseFloat(basic).toString()+"e"+scale.toString()}return"Infinity"}(x),b=x.toPrecision(numeric.precision),c=parseFloat(x.toString()).toString(),d=[a,b,c,parseFloat(b).toString(),parseFloat(c).toString()];for(k=1;k<d.length;k++)d[k].length<a.length&&(a=d[k]);return ret.push(Array(numeric.precision+8-a.length).join(" ")+a),!1}if(null===x)return ret.push("null"),!1;if("function"==typeof x){ret.push(x.toString());var flag=!1;for(k in x)x.hasOwnProperty(k)&&(flag?ret.push(",\n"):ret.push("\n{"),flag=!0,ret.push(k),ret.push(": \n"),foo(x[k]));return flag&&ret.push("}\n"),!0}if(x instanceof Array){if(x.length>numeric.largeArray)return ret.push("...Large Array..."),!0;for(flag=!1,ret.push("["),k=0;k<x.length;k++)k>0&&(ret.push(","),flag&&ret.push("\n ")),flag=foo(x[k]);return ret.push("]"),!0}ret.push("{");flag=!1;for(k in x)x.hasOwnProperty(k)&&(flag&&ret.push(",\n"),flag=!0,ret.push(k),ret.push(": \n"),foo(x[k]));return ret.push("}"),!0}(x),ret.join("")},numeric.parseDate=function(d){return function foo(d){if("string"==typeof d)return Date.parse(d.replace(/-/g,"/"));if(!(d instanceof Array))throw new Error("parseDate: parameter must be arrays of strings");var k,ret=[];for(k=0;k<d.length;k++)ret[k]=foo(d[k]);return ret}(d)},numeric.parseFloat=function(d){return function foo(d){if("string"==typeof d)return parseFloat(d);if(!(d instanceof Array))throw new Error("parseFloat: parameter must be arrays of strings");var k,ret=[];for(k=0;k<d.length;k++)ret[k]=foo(d[k]);return ret}(d)},numeric.parseCSV=function(t){var j,k,n,foo=t.split("\n"),ret=[],pat=/(([^'",]*)|('[^']*')|("[^"]*")),/g,patnum=/^\s*(([+-]?[0-9]+(\.[0-9]*)?(e[+-]?[0-9]+)?)|([+-]?[0-9]*(\.[0-9]+)?(e[+-]?[0-9]+)?))\s*$/,count=0;for(k=0;k<foo.length;k++){var baz,bar=(foo[k]+",").match(pat);if(bar.length>0){for(ret[count]=[],j=0;j<bar.length;j++)baz=(n=bar[j]).substr(0,n.length-1),patnum.test(baz)?ret[count][j]=parseFloat(baz):ret[count][j]=baz;count++}}return ret},numeric.toCSV=function(A){var i,j,m,row,ret,s=numeric.dim(A);for(m=s[0],s[1],ret=[],i=0;i<m;i++){for(row=[],j=0;j<m;j++)row[j]=A[i][j].toString();ret[i]=row.join(", ")}return ret.join("\n")+"\n"},numeric.getURL=function(url){var client=new XMLHttpRequest;return client.open("GET",url,!1),client.send(),client},numeric.imageURL=function(img){function crc32Array(a,from,to){void 0===from&&(from=0),void 0===to&&(to=a.le
|