generated from statsim/port-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprocess.js
1 lines (1 loc) · 696 KB
/
process.js
1
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Process=t()}}(function(){var define,module,exports;return function(){return function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var f="function"==typeof require&&require;if(!a&&f)return f(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){return i(e[s][1][t]||t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}}()({1:[function(t,e,r){"use strict";var n=function(){};function i(t){return void 0===t?{scalar:n,tensor:n}:{scalar:new Function("_x",["var x = _x.x;","var out = this.x;","_x.dx += ("+t+") * this.dx;"].join("\n")),tensor:new Function("_x",["var n = _x.x.length;","while (n--) {","\tvar x = _x.x.data[n];","\tvar out = this.x.data[n];"," _x.dx.data[n] += ("+t+") * this.dx.data[n];","}"].join("\n"))}}function o(t,e){return void 0===t&&void 0===e?{scalar:[n,n],tensor:[n,n]}:{scalar:[new Function("_x","_y",["var x = _x.x;",'var y = (typeof _y === "number") ? _y : _y.x;',"var out = this.x;","_x.dx += ("+t+") * this.dx;"].join("\n")),new Function("_x","_y",['var x = (typeof _x === "number") ? _x : _x.x;',"var y = _y.x;","var out = this.x;","_y.dx += ("+e+") * this.dx;"].join("\n"))],tensor:[new Function("_x","_y",["var _xx = _x.x;","var _yx = _y.x || _y;","var n = _xx.length;",'if (typeof _yx === "number") {',"\twhile (n--) {","\t\tvar x = _xx.data[n];","\t\tvar y = _yx;","\t\tvar out = this.x.data[n];","\t _x.dx.data[n] += ("+t+") * this.dx.data[n];","\t}","} else {","\twhile (n--) {","\t\tvar x = _xx.data[n];","\t\tvar y = _yx.data[n];","\t\tvar out = this.x.data[n];","\t _x.dx.data[n] += ("+t+") * this.dx.data[n];","\t}","}"].join("\n")),new Function("_x","_y",["var _xx = _x.x || _x;","var _yx = _y.x;","var n = _xx.length;",'if (typeof _yx === "number") {',"\twhile (n--) {","\t\tvar x = _xx.data[n];","\t\tvar y = _yx;","\t\tvar out = this.x.data[n];","\t _y.dx += ("+e+") * this.dx.data[n];","\t}","} else {","\twhile (n--) {","\t\tvar x = _xx.data[n];","\t\tvar y = _yx.data[n];","\t\tvar out = this.x.data[n];","\t _y.dx.data[n] += ("+e+") * this.dx.data[n];","\t}","}"].join("\n"))]}}var s={};s.neg=i("-1"),s.add=o("1","1"),s.sub=o("1","-1"),s.mul=o("y","x"),s.div=o("1/y","-x/(y*y)"),s.sqrt=i("1/(2*out)"),s.exp=i("out"),s.log=i("1/x"),s.pow=o("y*Math.pow(x,y-1)","Math.log(x)*out"),s.sin=i("Math.cos(x)"),s.cos=i("-Math.sin(x)"),s.tan=i("1 + out*out"),s.asin=i("1 / Math.sqrt(1 - x*x)"),s.acos=i("-1 / Math.sqrt(1 - x*x)"),s.atan=i("1 / (1 + x*x)"),s.atan2=o("y/(x*x + y*y)","-x/(x*x + y*y)"),s.sinh=i("Math.cosh(x)"),s.cosh=i("Math.sinh(x)"),s.tanh=i("1 - out*out"),s.asinh=i("1 / Math.sqrt(x*x + 1)"),s.acosh=i("1 / Math.sqrt(x*x - 1)"),s.atanh=i("1 / (1 - x*x)"),s.sigmoid=i("out * (1 - out)"),s.abs=i("x >= 0 ? 1 : -1"),s.floor=i(),s.ceil=i(),s.round=i(),s.min=o(),s.max=o(),e.exports=s},{}],2:[function(t,e,r){"use strict";var n=t("assert"),i=t("./graph.js"),o=i.Node,s=t("../tensor.js");function a(t){n(t===s||t===Number,"Attempting to create AD function with invalid output type '"+t+"'; valid options are 'Number' and 'Tensor'")}e.exports={newUnaryFunction:function(t){var e=t.OutputType,r=t.name,n=t.forward,f=t.backward;a(e);var u=e===s?i.TensorNode:i.ScalarNode;function h(){f.call(this,this.inputs[0])}return function(t){if(t instanceof o){var e=[t];return new u(n(t.x),e,e,h,r)}return n(t)}},newBinaryFunction:function(t){var e=t.OutputType,r=t.name,n=t.forward,f=t.backward1,u=t.backward2;a(e);var h=e===s?i.TensorNode:i.ScalarNode;function c(){f.call(this,this.inputs[0],this.inputs[1].x),u.call(this,this.inputs[0].x,this.inputs[1])}function l(){f.call(this,this.inputs[0],this.inputs[1])}function d(){u.call(this,this.inputs[0],this.inputs[1])}return function(t,e){var i=t instanceof o,s=e instanceof o;if(i&&s){var a=[t,e];return new h(n(t.x,e.x),a,a,c,r)}return i?new h(n(t.x,e),[t],[t,e],l,r):s?new h(n(t,e.x),[e],[t,e],d,r):n(t,e)}},newFunction:function(t){var e=t.OutputType,r=t.name,n=t.forward,o=t.backward,f=t.getParents;a(e);var u=e===s?i.TensorNode:i.ScalarNode;function h(){o.apply(this,this.inputs)}return function(){for(var t=n.apply(null,arguments),e=f.apply(null,arguments),i=new Array(arguments.length),o=0;o<i.length;++o)i[o]=arguments[o];return 0===e.length?t:new u(t,e,i,h,r)}},naryGetParents:function(){for(var t=1===arguments.length&&arguments[0]instanceof Array?arguments[0]:arguments,e=[],r=t.length;r--;){var n=t[r];n instanceof o&&e.push(n)}return e},liftUnaryFunction:function(t){return function(e){return t(e instanceof o?e.x:e)}},liftBinaryFunction:function(t){return function(e,r){var n=e instanceof o?e.x:e,i=r instanceof o?r.x:r;return t(n,i)}}}},{"../tensor.js":22,"./graph.js":4,assert:38}],3:[function(t,e,r){"use strict";var n=t("../tensor.js"),i=t("./graph.js").Node,o=t("./func.js"),s=t("./derivatives.js"),a=Number;function f(t){var e={};function r(e){return t===n?e.tensor:e.scalar}var i=t===a?"scalar.":"tensor.",f={neg:t===n?function(t){return t.neg()}:function(t){return-t}};for(var u in f)e[u]=o.newUnaryFunction({OutputType:t,name:i+u,forward:f[u],backward:r(s[u])});var h={add:t===n?function(t,e){return t.add(e)}:function(t,e){return t+e},sub:t===n?function(t,e){return t.sub(e)}:function(t,e){return t-e},mul:t===n?function(t,e){return t.mul(e)}:function(t,e){return t*e},div:t===n?function(t,e){return t.div(e)}:function(t,e){return t/e}};for(var u in h)e[u]=o.newBinaryFunction({OutputType:t,name:i+u,forward:h[u],backward1:r(s[u])[0],backward2:r(s[u])[1]});for(var c=["floor","ceil","round","sqrt","exp","log","abs","sin","cos","tan","asin","acos","atan","sinh","cosh","tanh","asinh","acosh","atanh","sigmoid"],l=["pow","min","max","atan2"],d=0;d<c.length;d++){var p=c[d],m=t===n?new Function("x","return x."+p+"();"):new Function("x","return Math."+p+"(x);");e[p]=o.newUnaryFunction({OutputType:t,name:i+p,forward:m,backward:r(s[p])})}for(d=0;d<l.length;d++){p=l[d],m=t===n?new Function("x","y","return x."+p+"(y);"):new Function("x","y","return Math."+p+"(x, y);");e[p]=o.newBinaryFunction({OutputType:t,name:i+p,forward:m,backward1:r(s[p])[0],backward2:r(s[p])[1]})}return e.isNaN=t===a?o.liftUnaryFunction(isNaN):o.liftUnaryFunction(function(t){return t.isNaN()}),e.isFinite=t===a?o.liftUnaryFunction(isFinite):o.liftUnaryFunction(function(t){return t.isFinite()}),e}Math.sigmoid=function(t){return 1/(1+Math.exp(-t))};var u={scalar:f(a),tensor:f(n)};Object.getOwnPropertyNames(Math).forEach(function(t){u.scalar.hasOwnProperty(t)||(u.scalar[t]=Math[t])}),u.scalar.eq=o.liftBinaryFunction(function(t,e){return t==e}),u.scalar.neq=o.liftBinaryFunction(function(t,e){return t!=e}),u.scalar.peq=o.liftBinaryFunction(function(t,e){return t===e}),u.scalar.pneq=o.liftBinaryFunction(function(t,e){return t!==e}),u.scalar.gt=o.liftBinaryFunction(function(t,e){return t>e}),u.scalar.lt=o.liftBinaryFunction(function(t,e){return t<e}),u.scalar.geq=o.liftBinaryFunction(function(t,e){return t>=e}),u.scalar.leq=o.liftBinaryFunction(function(t,e){return t<=e}),u.tensor.transpose=o.newUnaryFunction({OutputType:n,name:"transpose",forward:function(t){return t.transpose()},backward:function(t){for(var e=this.x.dims[0],r=this.x.dims[1],n=0;n<e;n++)for(var i=0;i<r;i++)t.dx.data[i*e+n]+=this.dx.data[n*r+i]}}),u.tensor.diagonal=o.newUnaryFunction({OutputType:n,name:"diagonal",forward:function(t){return t.diagonal()},backward:function(t){for(var e=t.dx.dims[0],r=0;r<e;r++)t.dx.data[r]+=this.dx.data[r*(e+1)]}}),u.tensor.inverse=o.newUnaryFunction({OutputType:n,name:"inverse",forward:function(t){return t.inverse()},backward:function(t){var e=this.x.transpose();t.dx=t.dx.add(e.dot(this.dx).dot(e).neg())}}),u.tensor.determinant=o.newUnaryFunction({OutputType:Number,name:"determinant",forward:function(t){return t.determinant()},backward:function(t){for(var e=t.x.dims[0],r=t.x.inverse(),n=0;n<e;n++)for(var i=0;i<e;i++)t.dx.data[n*e+i]+=this.x*this.dx*r.data[i*e+n]}}),u.tensor.dot=o.newBinaryFunction({OutputType:n,name:"dot",forward:function(t,e){return t.dot(e)},backward1:function(t,e){for(var r=ad.value(t),n=ad.value(e),i=r.dims[0],o=r.dims[1],s=n.dims[1],a=s,f=0;f<i;f++)for(var u=0;u<o;u++){for(var h=0,c=0;c<a;c++)h+=this.dx.data[f*a+c]*n.data[u*s+c];t.dx.data[f*o+u]+=h}},backward2:function(t,e){for(var r=ad.value(t),n=ad.value(e),i=r.dims[0],o=r.dims[1],s=n.dims[0],a=n.dims[1],f=a,u=0;u<s;u++)for(var h=0;h<a;h++){for(var c=0,l=0;l<i;l++)c+=this.dx.data[l*f+h]*r.data[l*o+u];e.dx.data[u*a+h]+=c}}}),u.tensor.cholesky=o.newUnaryFunction({OutputType:n,name:"cholesky",forward:function(t){return t.cholesky()},backward:function(t){var e,r,n,i=this,o=this.dx.tril(),s=i.x.dims[0];for(n=s-1;n>=0;n--){for(r=n+1;r<s;r++)for(e=r;e<s;e++)o.data[e*s+n]-=o.data[e*s+r]*i.x.data[r*s+n],o.data[r*s+n]-=o.data[e*s+r]*i.x.data[e*s+n];for(r=n+1;r<s;r++)o.data[r*s+n]/=i.x.data[n*s+n],o.data[n*s+n]-=o.data[r*s+n]*i.x.data[r*s+n];o.data[n*s+n]/=2*i.x.data[n*s+n]}t.dx.addeq(o)}}),u.tensor.sumreduce=o.newUnaryFunction({OutputType:a,name:"sumreduce",forward:function(t){return t.sumreduce()},backward:function(t){for(var e=t.dx.data.length;e--;)t.dx.data[e]+=this.dx}}),u.tensor.allreduce=o.liftUnaryFunction(function(t){return t.allreduce()}),u.tensor.anyreduce=o.liftUnaryFunction(function(t){return t.anyreduce()}),u.tensor.get=o.newFunction({OutputType:a,name:"tensor.get",forward:function(t,e){return t instanceof i?t.x.data[e]:t.data[e]},backward:function(t,e){t instanceof i&&(t.dx.data[e]+=this.dx)},getParents:function(t,e){return t instanceof i?[t]:[]}}),u.tensor.toScalars=function(t){for(var e=t instanceof i?t.x.length:t.length,r=new Array(e);e--;)r[e]=u.tensor.get(t,e);return r},u.tensor.range=o.newFunction({OutputType:n,name:"tensor.range",forward:function(t,e,r){t=t instanceof i?t.x:t;for(var o=r-e,s=new n([o]);o--;){var a=e+o;s.data[o]=t.data[a]}return s},backward:function(t,e,r){if(t instanceof i)for(var n=r-e;n--;){var o=e+n;t.dx.data[o]+=this.dx.data[n]}},getParents:function(t,e,r){return t instanceof i?[t]:[]}}),u.tensor.split=function(t,e){for(var r=new Array(e.length),n=0,i=0;i<e.length;i++){var o=e[i];r[i]=u.tensor.range(t,n,n+o),n+=o}return r},u.tensor.fromScalars=o.newFunction({OutputType:n,name:"tensor.fromScalars",forward:function(){for(var t=1===arguments.length&&arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,r=new n([e]);e--;){var o=t[e];r.data[e]=o instanceof i?o.x:o}return r},backward:function(){for(var t=1===arguments.length&&arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;e--;){var r=t[e];r instanceof i&&(r.dx+=this.dx.data[e])}},getParents:o.naryGetParents}),u.tensor.concat=o.newFunction({OutputType:n,name:"tensor.concat",forward:function(){for(var t=1===arguments.length&&arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,r=0;e--;){r+=(u=(f=t[e])instanceof i?f.x:f).length}var o=new n([r]);e=t.length;for(var s=0,a=0;a<e;a++){var f,u=(f=t[a])instanceof i?f.x:f;o.copy(u,s),s+=u.length}return o},backward:function(){for(var t=1===arguments.length&&arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,r=0,n=0;n<e;n++){var o=t[n];if(o instanceof i){for(var s=o,a=s.dx.length;a--;)s.dx.data[a]+=this.dx.data[r+a];r+=s.dx.length}else r+=o.length}},getParents:o.naryGetParents}),u.tensor.reshape=function(t,e){if(t instanceof i){var r=t.refClone();return r.x.reshape(e),r.dx.reshape(e),r}var n=t.refClone();return n.reshape(e),n},u.scalar.sum=o.newFunction({OutputType:a,name:"scalar.sum",forward:function(){for(var t=1===arguments.length&&arguments[0]instanceof Array?arguments[0]:arguments,e=0,r=t.length;r--;){var n=t[r];e+=n instanceof i?n.x:n}return e},backward:function(){for(var t=1===arguments.length&&arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;e--;){var r=t[e];r instanceof i&&(r.dx+=this.dx)}},getParents:o.naryGetParents}),u.tensor.softmax=o.newUnaryFunction({OutputType:n,name:"tensor.softmax",forward:function(t){return t.softmax()},backward:function(t){for(var e=t.dx.data.length,r=0,n=0;n<e;n++)r+=this.x.data[n]*this.dx.data[n];for(var i=0;i<e;i++)t.dx.data[i]+=this.x.data[i]*(this.dx.data[i]-r)}}),e.exports=u},{"../tensor.js":22,"./derivatives.js":1,"./func.js":2,"./graph.js":4}],4:[function(t,e,r){"use strict";var n=t("../tensor.js");function i(t,e,r,n,i){this.x=t,this.parents=e,this.inputs=r,void 0!==n&&(this.backward=n),this.outDegree=0,this.name=i||"node"}function o(t,e,r,n,o){i.call(this,t,e,r,n,o||"scalarNode"),this.dx=0}function s(t,e,r,o,s){i.call(this,t,e,r,o,s||"tensorNode"),this.dx=new n(t.dims)}i.prototype.copy=function(t){this.x=t.x,this.parents=t.parents,this.inputs=t.inputs,void 0!==t.backward&&(this.backward=t.backward),this.outDegree=t.outDegree,this.name=t.name},i.prototype.clone=function(){var t=Object.create(i.prototype);return t.copy(this),t},i.prototype.computeOutDegree=function(){for(var t=[this];t.length>0;){var e=t.pop();if(e.outDegree++,1===e.outDegree)for(var r=e.parents.length;r--;)t.push(e.parents[r])}},i.prototype.backpropRec=function(){for(var t=[this];t.length>0;){var e=t.pop();if(e.outDegree--,0===e.outDegree){e.backward();for(var r=e.parents.length;r--;)t.push(e.parents[r])}}},i.prototype.zeroDerivativesRec=function(){for(var t=[this];t.length>0;){var e=t.pop();if(e.outDegree--,0===e.outDegree){e.zeroDerivativesImpl();for(var r=e.parents.length;r--;)t.push(e.parents[r])}}},i.prototype.zeroDerivatives=function(){this.computeOutDegree(),this.zeroDerivativesRec()},i.prototype.backward=function(){},o.prototype=Object.create(i.prototype),o.prototype.copy=function(t){i.prototype.copy.call(this,t),this.dx=t.dx},o.prototype.clone=function(){var t=Object.create(o.prototype);return t.copy(this),t},o.prototype.backprop=function(){this.dx=1,this.computeOutDegree(),this.backpropRec()},o.prototype.zeroDerivativesImpl=function(){this.dx=0},s.prototype=Object.create(i.prototype),s.prototype.copy=function(t){i.prototype.copy.call(this,t),this.x=t.x.clone(),this.dx=t.dx.clone()},s.prototype.clone=function(){var t=Object.create(n.prototype);return t.copy(this),t},s.prototype.refCopy=function(t){i.prototype.copy.call(this,t),this.x=t.x.refClone(),this.dx=t.dx.refClone()},s.prototype.refClone=function(){var t=Object.create(s.prototype);return t.refCopy(this),t},s.prototype.backprop=function(){this.dx.fill(1),this.computeOutDegree(),this.backpropRec()},s.prototype.zeroDerivativesImpl=function(){this.dx.zero()},e.exports={Node:i,ScalarNode:o,TensorNode:s}},{"../tensor.js":22}],5:[function(t,e,r){"use strict";var n=t("../utils.js"),i=t("./graph.js"),o=t("../tensor.js"),s=i.Node,a=i.ScalarNode,f=i.TensorNode,u=[];function h(t,e){return t instanceof o?function(t,e){return new f(t,u,u,void 0,e)}(t,e):function(t,e){return new a(t,u,u,void 0,e)}(t,e)}var c={lift:function(t,e){return t instanceof s?t:h(t,e)},isLifted:function(t){return t instanceof s},value:function(t){return t instanceof s?t.x:t},derivative:function(t){return t.dx},params:function(t,e){return c.lift(new o(t).fillRandom(),e)}},l=t("./func.js"),d=t("./functions.js");c=n.mergeObjects(c,l,d),e.exports=c},{"../tensor.js":22,"../utils.js":23,"./func.js":2,"./functions.js":3,"./graph.js":4}],6:[function(t,e,r){"use strict";var n=t("assert"),i=t("../utils.js"),o=t("./network.js");function s(t,e,r){function s(t){o.call(this),this.name=r||"compoundNetwork",this.networks=t.slice();for(var e=0;e<t.length;e++)this.paramGetters=this.paramGetters.concat(t[e].paramGetters),this.paramSetters=this.paramSetters.concat(t[e].paramSetters);this.paramGetters=i.deduplicate(this.paramGetters),this.paramSetters=i.deduplicate(this.paramSetters)}return s.prototype=Object.create(o.prototype),s.prototype.eval=t,s.prototype.setTraining=function(t){o.prototype.setTraining.call(this,t);for(var e=0;e<this.networks.length;e++)this.networks[e].setTraining(t)},r?(s.prototype.serializeJSON=function(){return{type:r,networks:this.networks.map(function(t){return t.serializeJSON()})}},o.deserializers[r]=function(t){return new s(t.networks.map(function(t){return o.deserializeJSON(t)}))}):s.prototype.serializeJSON=function(){n(!1,"Cannot serialize unnamed compound network.")},new s(e)}function a(t,e){this.type=t,this.parents=e||[]}function f(t){o.call(this),this.name="select",this.i=t}function u(){return new a("input")}function h(t,e,r,i){for(var o=0;o<t.length;o++)n("input"===t[o].type,"Inputs to composite neural network must be nn.ast.input()");var a=[];for(o=0;o<e.length;o++)for(var f=[e[o]];f.length>0;){if("input"!==(c=f.pop()).type&&-1===a.indexOf(c)){a.push(c);for(o=0;o<c.parents.length;o++)f.push(c.parents[o])}}a.reverse();var u="var args = arguments;\n",h=[];for(o=0;o<a.length;o++){var c,l=(c=a[o]).parents.map(function(e){var r=t.indexOf(e);return-1!==r?"args["+r+"]":-1!==(r=a.indexOf(e))?"r"+r:void n(!1,"impossible")});if(u+="var r"+o+" = this.networks["+o+"].eval("+l+");\n",i){var d="r"+o,p=d+"_val";u+=["var "+p+" = "+d+".x || "+d+";","if (!"+p+".isFinite().allreduce()) {",'\tvar err = "Non-finite value in output of network '+o+' ("+'+("this.networks["+o+"]")+'.name+")\\n";',' err += "Output:\\n";','\terr += "["+'+p+'.toString()+"]\\n";',' err += "Inputs:\\n";',l.map(function(t){return'\terr += "["+'+("("+t+".x || "+t+")")+'.toString()+"]\\n";'}).join("\n")," throw new Error(err);","}"].join("\n")}-1!==e.indexOf(c)&&h.push("r"+o)}u+="return "+(h.length>1?"["+h+"]":h[0])+";";var m=s(new Function(u),a.map(function(t){return t.network}));return m.name=r||"compiledNetwork",m.nodes=t.concat(a),m.inputs=t.map(function(t){return m.nodes.indexOf(t)}),m.outputs=e.map(function(t){return m.nodes.indexOf(t)}),m.serializeJSON=function(){var t=this.nodes.map(function(t){var e={type:t.type,parents:t.parents.map(function(t){return this.nodes.indexOf(t)}.bind(this))};return"compose"===e.type&&(e.network=t.network.serializeJSON()),e}.bind(this));return{type:"compiled",name:this.name,nodes:t,inputs:this.inputs,outputs:this.outputs}},m}function c(t,e,r){for(var n=u(),i=n,o=0;o<t.length;o++)i=t[o].compose(i);var s=h([n],[i],void 0,r);return s.name=e||"sequenceNetwork",s.serializeJSON=function(){return{type:"sequence",name:this.name,networks:this.networks.map(function(t){return t.serializeJSON()})}},s}f.prototype=Object.create(o.prototype),f.prototype.eval=function(t){return t[this.i]},f.prototype.serializeJSON=function(){return{type:"select",i:this.i}},o.deserializers.select=function(t){return new f(t.i)},a.prototype.split=function(t){for(var e=new Array(t),r=0;r<t;r++){var n=new f(r);e[r]=n.compose(this)}return e},o.prototype.compose=function(){var t=new a("compose",Array.prototype.slice.call(arguments));return t.network=this,t},o.deserializers.compiled=function(t){for(var e=[],r=0;r<t.nodes.length;r++){var n=t.nodes[r],i=new a(n.type,n.parents.map(function(t){return e[t]}));"compose"===n.type&&(i.network=o.deserializeJSON(n.network)),e.push(i)}return h(t.inputs.map(function(t){return e[t]}),t.outputs.map(function(t){return e[t]}),t.name)},o.deserializers.sequence=function(t){return c(t.networks.map(function(t){return o.deserializeJSON(t)}),t.name)},e.exports={compound:s,ast:{input:u,compile:h},sequence:c}},{"../utils.js":23,"./network.js":9,assert:38}],7:[function(t,e,r){"use strict";var n=t("../utils.js"),i=t("./network.js");e.exports={Network:i,deserializeJSON:i.deserializeJSON};var o=t("./lifting.js"),s=t("./composition.js"),a=t("./networks/lifted.js"),f=t("./networks/linear.js"),u=t("./networks/convolution.js"),h=t("./networks/pooling.js"),c=t("./networks/activation.js"),l=t("./networks/perceptron.js"),d=t("./networks/misc.js");e.exports=n.mergeObjects(e.exports,o,s,a,f,u,h,c,l,d)},{"../utils.js":23,"./composition.js":6,"./lifting.js":8,"./network.js":9,"./networks/activation.js":10,"./networks/convolution.js":11,"./networks/lifted.js":12,"./networks/linear.js":13,"./networks/misc.js":14,"./networks/perceptron.js":15,"./networks/pooling.js":16}],8:[function(t,e,r){"use strict";var n=t("./network.js");function i(t,e){var r=new n;return r.eval=t,r.name=e||"liftedNetwork",e?(r.serializeJSON=function(){return{type:e}},n.deserializers[e]=function(t){return r}):r.serializeJSON=function(){assert(!1,"Cannot serialize unnamed lifted network.")},r}e.exports={lift:i,partialeval:function(t,e){var r=function(){var r=Array.prototype.slice.call(arguments),n=i(function(e){var n=Array.prototype.slice.call(arguments);return t.apply(null,n.concat(r))});return n.name=e,e&&(n.serializeJSON=function(){for(var t={type:e},n=0;n<r.length;n++)t["arg"+n]=r[n];return t}),n};return e&&(n.deserializers[e]=function(t){var e=[];for(var n in t)n.startsWith("arg")&&(e[parseInt(n.slice(3))]=t[n]);return r.apply(null,e)}),r}}},{"./network.js":9}],9:[function(t,e,r){"use strict";var n=t("assert");function i(){this.name="",this.isTraining=!1,this.paramGetters=[],this.paramSetters=[]}i.prototype.eval=function(){n(!1,"Neural networks must implement the 'eval' method.")},i.prototype.getParameters=function(){return void 0===this.__parameters&&(this.__parameters=this.paramGetters.map(function(t){return t()})),this.__parameters},i.prototype.setParameters=function(t){t.length!==this.paramSetters.length&&n(!1,"Network.setParameters: size mismatch (network has "+this.paramSetters.length+" parameters, not "+t.length);for(var e=0;e<t.length;e++)this.paramSetters[e](t[e]);this.__parameters=t.slice()},i.prototype.setTraining=function(t){this.isTraining=t},i.prototype.serializeJSON=function(){n(!1,"Neural networks must implement the 'serializeJSON' method.")},i.deserializers={},i.deserializeJSON=function(t){return n(void 0!==t.type,"Network JSON blob has no 'type' field."),n(i.deserializers.hasOwnProperty(t.type),"Network JSON blob has unrecognized type '"+t.type+"'"),i.deserializers[t.type](t)},e.exports=i},{assert:38}],10:[function(t,e,r){"use strict";var n=t("../../tensor.js"),i=t("../../ad"),o=t("../lifting.js").lift,s=o(i.newUnaryFunction({OutputType:n,name:"relu",forward:function(t){for(var e=(t=i.value(t)).clone(),r=t.length;r--;)e.data[r]=e.data[r]<0?0:e.data[r];return e},backward:function(t){for(var e=t.x.length;e--;)t.dx.data[e]+=t.x.data[e]<=0?0:this.dx.data[e]}}),"relu"),a=o(function(t){return i.tensor.sub(i.tensor.mul(i.tensor.sigmoid(t),2),1)});e.exports={relu:s,sigmoidCentered:a}},{"../../ad":5,"../../tensor.js":22,"../lifting.js":8}],11:[function(t,e,r){"use strict";var n=t("../../tensor.js"),i=t("../../ad"),o=t("../network.js"),s=t("assert");function a(t,e,r,n,s,a,f,u,h){o.call(this),this.name=h||"convolution",this.inDepth=t,this.outDepth=e,this.filterWidth=r,this.filterHeight=n,this.strideX=s,this.strideY=a,this.padX=f,this.padY=u,this.filters=i.params([e,t,n,r],this.name+"_filters"),this.biases=i.params([e],this.name+"_biases"),this.paramGetters=[function(){return this.filters}.bind(this),function(){return this.biases}.bind(this)],this.paramSetters=[function(t){this.filters=t}.bind(this),function(t){this.biases=t}.bind(this)]}a.prototype=Object.create(o.prototype),a.prototype.serializeJSON=function(){return{type:"convolution",name:this.name,inDepth:this.inDepth,outDepth:this.outDepth,filterWidth:this.filterWidth,filterHeight:this.filterHeight,strideX:this.strideX,strideY:this.strideY,padX:this.padX,padY:this.padY,filters:i.value(this.filters).toFlatArray(),biases:i.value(this.biases).toFlatArray()}},o.deserializers.convolution=function(t){var e=new a(t.inDepth,t.outDepth,t.filterWidth,t.filterHeight,t.strideX,t.strideY,t.padX,t.padY,t.name);return i.value(e.filters).fromFlatArray(t.filters),i.value(e.biases).fromFlatArray(t.biases),e};var f=i.newFunction({OutputType:n,name:"convolution",forward:function(t,e,r,o,a,f,u){t=i.value(t),e=i.value(e),r=i.value(r);var h=e.dims[2],c=e.dims[3],l=t.dims[0],d=t.dims[1],p=t.dims[2],m=e.dims[0],b=Math.floor((d+2*u-h)/a+1),g=Math.floor((p+2*f-c)/o+1);l!==e.dims[1]&&s(!1,"Convolutional network: input depth is "+l+" but should be "+e.dims[1]);for(var v=new n([m,b,g]),y=0;y<m;y++)for(var w=-f,_=-u,x=0;x<b;_+=a,x++){w=-f;for(var M=0;M<g;w+=o,M++){for(var S=r.data[y],E=0;E<l;E++)for(var k=0;k<h;k++)for(var A=_+k,j=0;j<c;j++){var I=w+j;if(A>=0&&A<d&&I>=0&&I<p){var R=I+p*(A+d*E),O=j+c*(k+h*(E+l*y));S+=e.data[O]*t.data[R]}}v.data[M+g*(x+b*y)]=S}}return v},backward:function(t,e,r,n,o,s,a){for(var f=i.value(t),u=i.value(e),h=t!==f,c=e!==u,l=r!==i.value(r),d=u.dims[2],p=u.dims[3],m=f.dims[0],b=f.dims[1],g=f.dims[2],v=u.dims[0],y=this.x.dims[1],w=this.x.dims[2],_=0;_<v;_++)for(var x=-s,M=-a,S=0;S<y;M+=o,S++){x=-s;for(var E=0;E<w;x+=n,E++){var k=this.dx.data[E+w*(S+y*_)];l&&(r.dx.data[_]+=k);for(var A=0;A<m;A++)for(var j=0;j<d;j++)for(var I=M+j,R=0;R<p;R++){var O=x+R;if(I>=0&&I<b&&O>=0&&O<g){var D=O+g*(I+b*A),N=R+p*(j+d*(A+m*_));h&&(t.dx.data[D]+=u.data[N]*k),c&&(e.dx.data[N]+=f.data[D]*k)}}}}},getParents:function(t,e,r,n,o,s,a){var f=[];return i.isLifted(t)&&f.push(t),i.isLifted(e)&&f.push(e),i.isLifted(r)&&f.push(r),f}});a.prototype.eval=function(t){var e=this.isTraining?this.filters:i.value(this.filters),r=this.isTraining?this.biases:i.value(this.biases);return f(t,e,r,this.strideX,this.strideY,this.padX,this.padY)},e.exports={convolution:function(t,e){var r=t.inDepth||1,n=t.outDepth||1,i=t.filterWidth||t.filterSize,o=t.filterHeight||t.filterSize,s=t.strideX||t.stride||1,f=t.strideY||t.stride||1,u=t.padX||t.pad||"same",h=t.padY||t.pad||"same";return"same"===u&&(u=Math.floor((i-1)/2)),"same"===h&&(h=Math.floor((o-1)/2)),new a(r,n,i,o,s,f,u,h,e)},convolve:f}},{"../../ad":5,"../../tensor.js":22,"../network.js":9,assert:38}],12:[function(t,e,r){"use strict";var n=t("../../ad/functions.js"),i=t("../lifting.js");for(var o in e.exports={},n.tensor)e.exports[o]=i.lift(n.tensor[o],o);e.exports.range=i.partialeval(n.tensor.range,"range"),e.exports.split=i.partialeval(n.tensor.split,"split"),e.exports.reshape=i.partialeval(n.tensor.reshape,"reshape")},{"../../ad/functions.js":3,"../lifting.js":8}],13:[function(t,e,r){"use strict";var n=t("../../tensor.js"),i=t("../../ad"),o=t("../network.js"),s=t("assert");function a(t,e,r){o.call(this),this.name=r||"linear",this.inSize=t,this.outSize=e,this.weights=i.params([e,t],this.name+"_weights"),this.biases=i.params([e],this.name+"_biases"),this.paramGetters=[function(){return this.weights}.bind(this),function(){return this.biases}.bind(this)],this.paramSetters=[function(t){this.weights=t}.bind(this),function(t){this.biases=t}.bind(this)]}a.prototype=Object.create(o.prototype),a.prototype.serializeJSON=function(){return{type:"linear",name:this.name,inSize:this.inSize,outSize:this.outSize,weights:i.value(this.weights).toFlatArray(),biases:i.value(this.biases).toFlatArray()}},o.deserializers.linear=function(t){var e=new a(t.inSize,t.outSize,t.name);return i.value(e.weights).fromFlatArray(t.weights),i.value(e.biases).fromFlatArray(t.biases),e};var f=i.newFunction({OutputType:n,name:"mvmuladd",forward:function(t,e,r){t=i.value(t),e=i.value(e),r=i.value(r);var n=e.length,o=r.length;n!==t.dims[1]&&s(!1,"Linear network: input size is "+n+" but should be "+t.dims[1]);for(var a=r.clone(),f=0;f<o;f++)for(var u=f*n,h=0;h<n;h++)a.data[f]+=t.data[u+h]*e.data[h];return a},backward:function(t,e,r){for(var n=i.value(t),o=i.value(e),s=i.value(r),a=t!==n,f=e!==o,u=r!==s,h=o.length,c=s.length,l=0;l<c;l++){var d=l*h,p=this.dx.data[l];u&&(r.dx.data[l]+=p);for(var m=0;m<h;m++)f&&(e.dx.data[m]+=n.data[d+m]*p),a&&(t.dx.data[d+m]+=o.data[m]*p)}},getParents:i.naryGetParents});function u(t,e,r){o.call(this),this.name=r||"layerwiseLinear",this.inSize=t,this.outSize=e,this.weights=i.params([e,t],this.name+"_weights"),this.biases=i.params([e],this.name+"_biases"),this.paramGetters=[function(){return this.weights}.bind(this),function(){return this.biases}.bind(this)],this.paramSetters=[function(t){this.weights=t}.bind(this),function(t){this.biases=t}.bind(this)]}a.prototype.eval=function(t){var e=this.isTraining?this.weights:i.value(this.weights),r=this.isTraining?this.biases:i.value(this.biases);return f(e,t,r)},u.prototype=Object.create(o.prototype),u.prototype.serializeJSON=function(){return{type:"layerwiseLinear",name:this.name,inSize:this.inSize,outSize:this.outSize,weights:i.value(this.weights).toFlatArray(),biases:i.value(this.biases).toFlatArray()}},o.deserializers.layerwiseLinear=function(t){var e=new u(t.inSize,t.outSize,t.name);return i.value(e.weights).fromFlatArray(t.weights),i.value(e.biases).fromFlatArray(t.biases),e};var h=i.newFunction({OutputType:n,name:"layerwiseMVMulAdd",forward:function(t,e,r){t=i.value(t),e=i.value(e),r=i.value(r);var o=t.dims[0];o!==e.dims[1]&&s(!1,"LayerwiseLinear Network: input depth is "+o+" but should be "+e.dims[1]);for(var a=t.dims[1],f=t.dims[2],u=e.dims[0],h=new n([u,a,f]),c=0;c<a;c++)for(var l=0;l<f;l++)for(var d=0;d<u;d++){var p=l+f*(c+a*d);h.data[p]=r.data[d];for(var m=0;m<o;m++){var b=m+d*o,g=e.data[b],v=l+f*(c+a*m),y=t.data[v];h.data[p]+=g*y}}return h},backward:function(t,e,r){for(var n=i.value(t),o=i.value(e),s=t!==n,a=e!==o,f=r!==i.value(r),u=n.dims[1],h=n.dims[2],c=o.dims[0],l=o.dims[1],d=0;d<u;d++)for(var p=0;p<h;p++)for(var m=0;m<c;m++){var b=p+h*(d+u*m),g=this.dx.data[b];f&&(r.dx.data[m]+=g);for(var v=0;v<l;v++){var y=v+m*l,w=p+h*(d+u*v);if(a){var _=n.data[w];e.dx.data[y]+=_*g}if(s){var x=o.data[y];t.dx.data[w]+=x*g}}}},getParents:i.naryGetParents});u.prototype.eval=function(t){var e=this.isTraining?this.weights:i.value(this.weights),r=this.isTraining?this.biases:i.value(this.biases);return h(t,e,r)},e.exports={linear:function(t,e,r){return new a(t,e,r)},layerwiseLinear:function(t,e,r){return new u(t,e,r)}}},{"../../ad":5,"../../tensor.js":22,"../network.js":9,assert:38}],14:[function(t,e,r){"use strict";var n=t("../../ad"),i=t("../network.js");function o(t,e){i.call(this),this.name=e||"constantparams",this.dims=t,this.params=n.params(t,this.name),this.paramGetters=[function(){return this.params}.bind(this)],this.paramSetters=[function(t){this.params=t}.bind(this)]}o.prototype=Object.create(i.prototype),o.prototype.eval=function(){return this.isTraining?this.params:n.value(this.params)},o.prototype.serializeJSON=function(){return{type:"constantparams",name:this.name,dims:this.dims,params:n.value(this.params).toFlatArray()}},i.deserializers.constantparams=function(t){var e=new o(t.dims,t.name);return n.value(e.params).fromFlatArray(t.params),e},e.exports={constantparams:function(t,e){return new o(t,e)}}},{"../../ad":5,"../network.js":9}],15:[function(t,e,r){"use strict";var n=t("../composition.js").sequence,i=t("./linear.js").linear;e.exports={mlp:function(t,e,r,o){r=r||"mlp";for(var s=[],a=0;a<e.length;a++){var f=e[a];s.push(i(t,f.nOut,r+"_layer"+a)),f.activation&&s.push(f.activation),t=f.nOut}return n(s,r||"multiLayerPerceptron",o)}}},{"../composition.js":6,"./linear.js":13}],16:[function(t,e,r){"use strict";var n,i=t("../../tensor.js"),o=t("../../ad"),s=t("../network.js");function a(t,e,r,n,i,o){s.call(this),this.filterWidth=t,this.filterHeight=e,this.strideX=r,this.strideY=n,this.padX=i,this.padY=o,this.name="maxpool"}a.prototype=Object.create(s.prototype),a.prototype.serializeJSON=function(){return{type:"maxpool",filterWidth:this.filterWidth,filterHeight:this.filterHeight,strideX:this.strideX,strideY:this.strideY,padX:this.padX,padY:this.padY}},s.deserializers.maxpool=function(t){return new a(t.filterWidth,t.filterHeight,t.strideX,t.strideY,t.padX,t.padY)};var f,u=o.newFunction({OutputType:i,name:"maxpooling",forward:function(t,e,r,s,a,f,u){var h=(t=o.value(t)).dims[0],c=t.dims[1],l=t.dims[2],d=Math.floor((c+2*u-r)/a+1),p=Math.floor((l+2*f-e)/s+1),m=new i([h,d,p]);n=new Int32Array(h*d*p);for(var b=0;b<h;b++)for(var g=-f,v=-u,y=0;y<d;v+=a,y++){g=-f;for(var w=0;w<p;g+=s,w++){for(var _=-1/0,x=-1,M=0;M<r;M++)for(var S=v+M,E=0;E<e;E++){var k=g+E;if(S>=0&&S<c&&k>=0&&k<l){var A=k+l*(S+c*b),j=t.data[A];j>_&&(_=j,x=A)}}var I=w+p*(y+d*b);m.data[I]=_,n[I]=x}}return m},backward:function(t,e,r,n,i,o,s){for(var a=t.x.dims[0],f=(t.x.dims[1],t.x.dims[2],this.x.dims[1]),u=this.x.dims[2],h=0;h<a;h++)for(var c=0;c<f;i,c++){-o;for(var l=0;l<u;n,l++){var d=l+u*(c+f*h),p=this.maxIndices[d];t.dx.data[p]+=this.dx.data[d]}}},getParents:function(t,e,r,n,i,s,a){return o.isLifted(t)?[t]:[]}});function h(t,e,r,n,i,o){s.call(this),this.filterWidth=t,this.filterHeight=e,this.strideX=r,this.strideY=n,this.padX=i,this.padY=o,this.name="minpool"}a.prototype.eval=function(t){return e=t,r=this.filterWidth,i=this.filterHeight,s=this.strideX,a=this.strideY,f=this.padX,h=this.padY,c=u(e,r,i,s,a,f,h),o.isLifted(c)&&(c.maxIndices=n),c;var e,r,i,s,a,f,h,c},h.prototype=Object.create(s.prototype),h.prototype.serializeJSON=function(){return{type:"minpool",filterWidth:this.filterWidth,filterHeight:this.filterHeight,strideX:this.strideX,strideY:this.strideY,padX:this.padX,padY:this.padY}},s.deserializers.minpool=function(t){return new h(t.filterWidth,t.filterHeight,t.strideX,t.strideY,t.padX,t.padY)};var c=o.newFunction({OutputType:i,name:"maxpooling",forward:function(t,e,r,n,s,a,u){var h=(t=o.value(t)).dims[0],c=t.dims[1],l=t.dims[2],d=Math.floor((c+2*u-r)/s+1),p=Math.floor((l+2*a-e)/n+1),m=new i([h,d,p]);f=new Int32Array(h*d*p);for(var b=0;b<h;b++)for(var g=-a,v=-u,y=0;y<d;v+=s,y++){g=-a;for(var w=0;w<p;g+=n,w++){for(var _=1/0,x=-1,M=0;M<r;M++)for(var S=v+M,E=0;E<e;E++){var k=g+E;if(S>=0&&S<c&&k>=0&&k<l){var A=k+l*(S+c*b),j=t.data[A];j<_&&(_=j,x=A)}}var I=w+p*(y+d*b);m.data[I]=_,f[I]=x}}return m},backward:function(t,e,r,n,i,o,s){for(var a=t.x.dims[0],f=(t.x.dims[1],t.x.dims[2],this.x.dims[1]),u=this.x.dims[2],h=0;h<a;h++)for(var c=0;c<f;i,c++){-o;for(var l=0;l<u;n,l++){var d=l+u*(c+f*h),p=this.minIndices[d];t.dx.data[p]+=this.dx.data[d]}}},getParents:function(t,e,r,n,i,s,a){return o.isLifted(t)?[t]:[]}});function l(t,e,r,n,i,o){s.call(this),this.filterWidth=t,this.filterHeight=e,this.strideX=r,this.strideY=n,this.padX=i,this.padY=o,this.name="meanpool"}h.prototype.eval=function(t){return e=t,r=this.filterWidth,n=this.filterHeight,i=this.strideX,s=this.strideY,a=this.padX,u=this.padY,h=c(e,r,n,i,s,a,u),o.isLifted(h)&&(h.minIndices=f),h;var e,r,n,i,s,a,u,h},l.prototype=Object.create(s.prototype),l.prototype.serializeJSON=function(){return{type:"meanpool",filterWidth:this.filterWidth,filterHeight:this.filterHeight,strideX:this.strideX,strideY:this.strideY,padX:this.padX,padY:this.padY}},s.deserializers.meanpool=function(t){return new l(t.filterWidth,t.filterHeight,t.strideX,t.strideY,t.padX,t.padY)};var d=o.newFunction({OutputType:i,name:"meanpooling",forward:function(t,e,r,n,s,a,f){for(var u=(t=o.value(t)).dims[0],h=t.dims[1],c=t.dims[2],l=Math.floor((h+2*f-r)/s+1),d=Math.floor((c+2*a-e)/n+1),p=e*r,m=new i([u,l,d]),b=0;b<u;b++)for(var g=-a,v=-f,y=0;y<l;v+=s,y++){g=-a;for(var w=0;w<d;g+=n,w++){for(var _=0,x=0;x<r;x++)for(var M=v+x,S=0;S<e;S++){var E=g+S;if(M>=0&&M<h&&E>=0&&E<c){var k=E+c*(M+h*b);_+=t.data[k]}}var A=w+d*(y+l*b);m.data[A]=_/p}}return m},backward:function(t,e,r,n,i,o,s){for(var a=t.x.dims[0],f=t.x.dims[1],u=t.x.dims[2],h=this.x.dims[1],c=this.x.dims[2],l=e*r,d=0;d<a;d++)for(var p=-o,m=-s,b=0;b<h;m+=i,b++){p=-o;for(var g=0;g<c;p+=n,g++)for(var v=g+c*(b+h*d),y=this.dx.data[v]/l,w=0;w<r;w++)for(var _=m+w,x=0;x<e;x++){var M=p+x;if(_>=0&&_<f&&M>=0&&M<u){var S=M+u*(_+f*d);t.dx.data[S]+=y}}}},getParents:function(t,e,r,n,i,s,a){return o.isLifted(t)?[t]:[]}});l.prototype.eval=function(t){return d(t,this.filterWidth,this.filterHeight,this.strideX,this.strideY,this.padX,this.padY)},e.exports={maxpool:function(t){var e=t.filterWidth||t.filterSize,r=t.filterHeight||t.filterSize;return new a(e,r,t.strideX||t.stride||e,t.strideY||t.stride||r,t.padX||t.pad||0,t.padY||t.pad||0)},minpool:function(t){var e=t.filterWidth||t.filterSize,r=t.filterHeight||t.filterSize;return new h(e,r,t.strideX||t.stride||e,t.strideY||t.stride||r,t.padX||t.pad||0,t.padY||t.pad||0)},meanpool:function(t){var e=t.filterWidth||t.filterSize,r=t.filterHeight||t.filterSize;return new l(e,r,t.strideX||t.stride||e,t.strideY||t.stride||r,t.padX||t.pad||0,t.padY||t.pad||0)}}},{"../../ad":5,"../../tensor.js":22,"../network.js":9}],17:[function(t,e,r){"use strict";var n=t("../utils.js"),i=t("./methods.js"),o=t("./optimize.js"),s=t("./loss.js");e.exports=n.mergeObjects({},i,o,s)},{"../utils.js":23,"./loss.js":18,"./methods.js":19,"./optimize.js":20}],18:[function(t,e,r){"use strict";var n=t("assert"),i=t("../ad");e.exports={classificationLoss:function(t,e){var r=i.value(t).length;return n(e<r,"Training datum has true class label "+e+", but network only outputs "+r+" class probabilities."),i.scalar.neg(i.scalar.log(i.tensor.get(t,e)))},regressionLoss:function(t,e){var r=i.value(t).length,o=e.length;n(r===o,"Network output has different dimensionality than training data ("+r+" vs. "+o+")");var s=i.tensor.sub(t,e);return i.tensor.sumreduce(i.tensor.mul(s,s))}}},{"../ad":5,assert:38}],19:[function(t,e,r){"use strict";var n=t("../utils.js"),i=t("./tensorStruct.js"),o=1e-8;e.exports={sgd:function(t){var e,r=(t=n.mergeDefaults(t,{stepSize:.1,stepSizeDecay:1,mu:0})).stepSize,o="function"==typeof r,s=t.stepSizeDecay,a=t.mu;return function(t,n,f){var u=o?r(f):r;e||(e=i.emptyLike(t)),i.foreach(t,[{struct:n,ifMissing:i.ifMissing.impossible},{struct:e,ifMissing:i.ifMissing.zeros}],function(t,e,r){r.muleq(a).subeq(t.mul(u)),e.addeq(r)}),o||(r*=s)}},adagrad:function(t){var e,r=(t=n.mergeDefaults(t,{stepSize:.1})).stepSize,s="function"==typeof r;return function(t,n,a){var f=s?r(a):r;e||(e=i.emptyLike(t)),i.foreach(t,[{struct:n,ifMissing:i.ifMissing.impossible},{struct:e,ifMissing:i.ifMissing.zeros}],function(t,e,r){r.addeq(t.mul(t)),e.subeq(t.div(r.sqrt().addeq(o)).muleq(f))})}},rmsprop:function(t){var e,r=(t=n.mergeDefaults(t,{stepSize:.1,decayRate:.9})).stepSize,s="function"==typeof r,a=t.decayRate;return function(t,n,f){var u=s?r(f):r;e||(e=i.emptyLike(t)),i.foreach(t,[{struct:n,ifMissing:i.ifMissing.impossible},{struct:e,ifMissing:i.ifMissing.zeros}],function(t,e,r){r.muleq(a).addeq(t.mul(t).muleq(1-a)),e.subeq(t.div(r.sqrt().addeq(o)).muleq(u))})}},adam:function(t){var e,r,s=(t=n.mergeDefaults(t,{stepSize:.001,decayRate1:.9,decayRate2:.999})).stepSize,a="function"==typeof s,f=t.decayRate1,u=t.decayRate2;return function(t,n,h){var c=a?s(h):s,l=h+1;e||(e=i.emptyLike(t)),r||(r=i.emptyLike(t)),i.foreach(t,[{struct:n,ifMissing:i.ifMissing.impossible},{struct:e,ifMissing:i.ifMissing.zeros},{struct:r,ifMissing:i.ifMissing.zeros}],function(t,e,r,n){r.muleq(f).addeq(t.mul(1-f)),n.muleq(u).addeq(t.mul(t).muleq(1-u));var i=c*Math.sqrt(1-Math.pow(u,l))/(1-Math.pow(f,l));e.subeq(r.div(n.sqrt().addeq(o)).muleq(i))})}}}},{"../utils.js":23,"./tensorStruct.js":21}],20:[function(t,e,r){"use strict";var n=t("assert"),i=t("../ad"),o=t("../utils.js"),s=t("./methods.js"),a=t("./tensorStruct.js");function f(t,e){for(var r=(e=o.mergeDefaults(e,{iterations:100,method:s.sgd(),verbose:!1})).iterations,i=e.method,a=e.verbose,f=0;f<r;f++){var u=t();n(void 0!==u.gradients),n(void 0!==u.parameters),i(u.gradients,u.parameters,f),a&&console.log("[optimize] done iteration "+(f+1)+"/"+r)}}function u(t){return function(){var e=t();return n(void 0!==e.parameters),n(void 0!==e.loss),a.foreach(e.parameters,[],function(t){t.zeroDerivatives()}),e.loss.backprop(),{gradients:a.map(e.parameters,i.derivative),parameters:a.map(e.parameters,i.value)}}}function h(t,e,r,n){var i=(n=o.mergeDefaults(n,{batchSize:1})).batchSize,s=n.shuffle,h=-1,c=u(function(){var n=e[h],i=t(n.input),o=r(i.output,n.output);return{parameters:i.parameters,loss:o}});f(function(){for(var t,r,n=0;n<i;n++){h=!1===s?(h+1)%e.length:Math.floor(Math.random()*e.length);var o=c();void 0===t?(t=o.gradients,r=o.parameters):a.foreach(o.gradients,[{struct:t,ifMissing:a.ifMissing.zeros},{struct:o.parameters,ifMissing:a.ifMissing.impossible},{struct:r,ifMissing:a.ifMissing.copyFromCoStruct(1)}],function(t,e){e.addeq(t)})}return i>1&&a.foreach(t,[],function(t){t.diveq(i)}),{parameters:r,gradients:t}},n)}e.exports={optimize:f,adOptimize:function(t,e){f(u(t),e)},adTrain:h,nnTrain:function(t,e,r,n){t.setTraining(!0),h(function(e){return{output:t.eval(e),parameters:t.getParameters()}},e,r,n),t.setTraining(!1)}}},{"../ad":5,"../utils.js":23,"./methods.js":19,"./tensorStruct.js":21,assert:38}],21:[function(t,e,r){"use strict";t("assert"),t("../utils.js");var n=t("../tensor.js"),i=t("../ad");function o(t){if(t instanceof n||i.isLifted(t)&&i.value(t)instanceof n)return"tensor";if(Array.isArray(t))return"array";if("object"==typeof t)return"object";throw new Error("Malformed Tensor structure; expected Tensor, Array, or object, got "+typeof x)}function s(t,e){var r=o(t);if("tensor"===r)return e(t);if("array"===r){for(var n=[],i=0;i<t.length;i++)n[i]=s(t[i],e);return n}if("object"===r){n={};for(var a in t)n[a]=s(t[a],e);return n}}var a={impossible:function(t,e){throw new Error("impossible for this struct to have missing elements")},zeros:function(t,e){return s(t,function(t){return new n(t.dims)})},copyFromStruct:function(t,e){return s(t,function(t){return t})},copyFromCoStruct:function(t){return function(e,r){return s(r[t],function(t){return t})}}};e.exports={emptyLike:function(t){var e=o(t);return"tensor"===e?new n(t.dims):"array"===e?[]:"object"===e?{}:void 0},map:s,foreach:function(t,e,r){var n;if(0===e.length)(n=function(t){var e=o(t);if("tensor"===e)r(t);else if("array"===e)for(var i=0;i<t.length;i++)n(t[i]);else if("object"===e)for(var s in t)n(t[s])})(t);else{var i=e.map(function(t){return t.ifMissing});n=function(t,e){var s=o(t);if("tensor"===s)r.apply(null,[t].concat(e));else if("array"===s){for(var a=[],f=0;f<t.length;f++){for(var u=[],h=0;h<e.length;h++)u.push(e[h][f]);a.push(u)}for(h=0;h<e.length;h++){var c=e[h],l=i[h],d=t.length;for(f=c.length;f<d;f++){var p=l(t[f],a[f]);c.push(p),a[f][h]=p}}for(f=0;f<t.length;f++)n(t[f],a[f])}else if("object"===s){for(var m in a={},t){for(u=[],h=0;h<e.length;h++)u.push(e[h][m]);a[m]=u}for(h=0;h<e.length;h++)for(var m in c=e[h],l=i[h],t)c.hasOwnProperty(m)||(p=l(t[m],a[m]),c[m]=p,a[m][h]=p);for(var m in t)n(t[m],a[m])}};var s=e.map(function(t){return t.struct});n(t,s,r)}},ifMissing:a}},{"../ad":5,"../tensor.js":22,"../utils.js":23,assert:38}],22:[function(t,e,r){"use strict";var n=t("assert"),i=t("./utils.js");Array;var o,s=(o=Float64Array,{new:function(t){return new o(t)},set:function(t,e,r){t.set(e,r)}});function a(t){this.dims=t;for(var e=1,r=t.length;r--;)e*=t[r];this.length=e,this.data=s.new(e)}function f(t,e){var r=new Function(["var n = this.data.length;","while (n--) {","\tvar x = this.data[n];","\tthis.data[n] = "+e+";","}","return this;"].join("\n"));a.prototype[t+"eq"]=r,a.prototype[t]=function(){var t=this.clone();return r.call(t)}}function u(t,e){var r=new Function("s",["var n = this.data.length;","var b = s;","while (n--) {","\tvar a = this.data[n];","\tthis.data[n] = "+e+";","}","return this;"].join("\n")),n=new Function("t",["var n = this.data.length;","while (n--) {","\tvar a = this.data[n];","\tvar b = t.data[n];","\tthis.data[n] = "+e+";","}","return this;"].join("\n")),i=function(t){return t.constructor===a?n.call(this,t):r.call(this,t)};a.prototype[t+"eq"]=i,a.prototype[t]=function(t){var e=this.clone();return i.call(e,t)}}function h(t,e,r){a.prototype[t+"reduce"]=new Function(["var accum = "+e+";","var n = this.data.length;","while (n--) {","\tvar x = this.data[n];","\taccum = "+r+";","}","return accum;"].join("\n"))}Object.defineProperties(a.prototype,{rank:{get:function(){return this.dims.length}}}),a.prototype.reshape=function(t){for(var e=1,r=t.length;r--;)e*=t[r];return n(e===this.length,"Tensor reshape invalid size"),this.dims=t,this},a.prototype.fill=function(t){for(var e=this.length;e--;)this.data[e]=t;return this},a.prototype.zero=function(){return this.fill(0)},a.prototype.fillRandom=function(){for(var t=1/this.length,e=this.length;e--;)this.data[e]=i.gaussianSample(0,t);return this},a.prototype.copy=function(t,e){return e=e||0,s.set(this.data,t.data,e),this},a.prototype.clone=function(){return new a(this.dims).copy(this)},a.prototype.refCopy=function(t){return this.dims=t.dims,this.length=t.length,this.data=t.data,this},a.prototype.refClone=function(){return Object.create(a.prototype).refCopy(this)},a.prototype.get=function(t){for(var e=0,r=this.dims.length,n=0;n<r;n++)e=e*this.dims[n]+t[n];return this.data[e]},a.prototype.set=function(t,e){for(var r=0,n=this.dims.length,i=0;i<n;i++)r=r*this.dims[i]+t[i];this.data[r]=e},a.prototype.toArray=function(){return function t(e,r){if(r.length===e.rank)return e.get(r);for(var n=r.length,i=[],o=0;o<e.dims[n];o++)i.push(t(e,r.concat([o])));return i}(this,[])},a.prototype.fromArray=function(t){return function t(e,r,n){if(n instanceof Array)for(var i=r.length,o=0;o<e.dims[i];o++)t(e,r.concat([o]),n[o]);else e.set(r,n)}(this,[],t),this},a.prototype.toString=function(){return this.toArray().toString()},a.prototype.toFlatArray=function(){return Array.prototype.slice.call(this.data)},a.prototype.fromFlatArray=function(t){return s.set(this.data,t,0),this},f("neg","-x"),f("round","Math.round(x)"),f("log","Math.log(x)"),f("exp","Math.exp(x)"),f("sqrt","Math.sqrt(x)"),f("abs","Math.abs(x)"),f("ceil","Math.ceil(x)"),f("floor","Math.floor(x)"),f("cos","Math.cos(x)"),f("sin","Math.sin(x)"),f("tan","Math.tan(x)"),f("acos","Math.acos(x)"),f("asin","Math.asin(x)"),f("atan","Math.atan(x)"),f("cosh","Math.cosh(x)"),f("sinh","Math.sinh(x)"),f("tanh","Math.tanh(x)"),f("acosh","Math.acosh(x)"),f("asinh","Math.asinh(x)"),f("atanh","Math.atanh(x)"),f("sigmoid","1 / (1 + Math.exp(-x))"),f("isFinite","isFinite(x)"),f("isNaN","isNaN(x)"),f("invert","1/x"),f("pseudoinvert","x === 0 ? 0 : 1/x"),u("add","a + b"),u("sub","a - b"),u("mul","a * b"),u("div","a / b"),u("mod","a % b"),u("min","Math.min(a, b)"),u("max","Math.max(a, b)"),u("pow","Math.pow(a, b)"),u("atan2","Math.atan2(a, b)"),u("eq","a === b"),u("neq","a !== b"),u("gt","a > b"),u("ge","a >= b"),u("lt","a < b"),u("le","a <= b"),h("sum","0","accum + x"),h("min","Infinity","Math.min(accum, x)"),h("max","-Infinity","Math.max(accum, x)"),h("all","true","accum && (x !== 0)"),h("any","false","accum || (x !== 0)"),a.prototype.softmax=function(){for(var t=-1/0,e=this.data.length;e--;)t=Math.max(t,this.data[e]);var r=new a(this.dims);e=this.data.length;for(var n=0;e--;)r.data[e]=Math.exp(this.data[e]-t),n+=r.data[e];for(e=this.data.length;e--;)r.data[e]/=n;return r},a.prototype.transpose=function(){n.ok(2===this.rank);for(var t=this.dims[0],e=this.dims[1],r=new a([e,t]),i=0;i<t;i++)for(var o=0;o<e;o++)r.data[o*t+i]=this.data[i*e+o];return r},a.prototype.diagonal=function(){n.ok(2===this.rank),n.ok(1===this.dims[1]);for(var t=this.dims[0],e=new a([t,t]),r=0;r<t;r++)e.data[r*(t+1)]=this.data[r];return e},a.prototype.inverse=function(){n.ok(2===this.rank),n.ok(this.dims[0]===this.dims[1]);var t,e,r,i,o,s,f,u,h=this.dims[0],c=[];for(o=0;o<h;o++)for(t=new Float64Array(h),c.push(t),s=0;s<h;s++)t[s]=this.data[o*h+s];var l=[];for(o=0;o<h;o++)for(r=new Array(h),l.push(r),s=0;s<h;s++)r[s]=o===s?1:0;for(s=0;s<h;++s){var d=-1,p=-1;for(o=s;o!==h;++o)(f=Math.abs(c[o][s]))>p&&(d=o,p=f);for(e=c[d],c[d]=c[s],c[s]=e,i=l[d],l[d]=l[s],l[s]=i,u=e[s],f=s;f!==h;++f)e[f]/=u;for(f=h-1;-1!==f;--f)i[f]/=u;for(o=h-1;-1!==o;--o)if(o!==s){for(t=c[o],r=l[o],u=t[s],f=s+1;f!==h;++f)t[f]-=e[f]*u;for(f=h-1;f>0;--f)r[f]-=i[f]*u,r[--f]-=i[f]*u;0===f&&(r[0]-=i[0]*u)}}return new a([h,h]).fromArray(l)},a.prototype.determinant=function(){n.ok(2===this.rank),n.ok(this.dims[0]===this.dims[1]);var t,e,r,i,o,s,a,f,u=this.dims[0],h=1,c=[];for(t=0;t<u;t++)for(o=new Float64Array(u),c.push(o),e=0;e<u;e++)o[e]=this.data[t*u+e];for(e=0;e<u-1;e++){for(r=e,t=e+1;t<u;t++)Math.abs(c[t][e])>Math.abs(c[r][e])&&(r=t);for(r!==e&&(a=c[r],c[r]=c[e],c[e]=a,h*=-1),i=c[e],t=e+1;t<u;t++){for(s=(o=c[t])[e]/i[e],r=e+1;r<u-1;r+=2)f=r+1,o[r]-=i[r]*s,o[f]-=i[f]*s;r!==u&&(o[r]-=i[r]*s)}if(0===i[e])return 0;h*=i[e]}return h*c[e][e]},a.prototype.dot=function(t){var e=this,r=t;if(2!==e.rank||2!==r.rank)throw new Error("Inputs to dot should have rank = 2.");if(e.dims[1]!==r.dims[0])throw new Error("Dimension mismatch in dot. Inputs have dimension "+e.dims+" and "+r.dims+".");for(var n=e.dims[1],i=e.dims[0],o=r.dims[1],s=new a([i,o]),f=0;f<i;f++)for(var u=0;u<o;u++){for(var h=0,c=0;c<n;c++)h+=e.data[f*n+c]*r.data[o*c+u];s.data[f*o+u]=h}return s},a.prototype.cholesky=function(){var t,e=this;n.ok(2===e.rank&&e.dims[0]===e.dims[1],"cholesky is only defined for square matrices.");for(var r=e.dims[0],i=new a([r,r]),o=0;o<r;o++)for(var s=0;s<=o;s++){t=0;for(var f=0;f<s;f++)t+=i.data[o*r+f]*i.data[s*r+f];i.data[o*r+s]=o===s?Math.sqrt(e.data[o*r+o]-t):1/i.data[s*r+s]*(e.data[o*r+s]-t)}return i},a.prototype.tril=function(){var t=this;n.ok(2===t.rank&&t.dims[0]===t.dims[1],"tril is only defined for square matrices.");for(var e=t.dims[0],r=new a([e,e]),i=0;i<e;i++)for(var o=0;o<=i;o++)r.data[i*e+o]=t.data[i*e+o];return r},e.exports=a},{"./utils.js":23,assert:38}],23:[function(t,e,r){"use strict";function n(t){t=t||{};for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}e.exports={gaussianSample:function(t,e){var r,n,i,o,s;do{r=1-Math.random(),n=1.7156*(Math.random()-.5),s=(i=r-.449871)*i+(o=Math.abs(n)+.386595)*(.196*o-.25472*i)}while(s>=.27597&&(s>.27846||n*n>-4*r*r*Math.log(r)));return t+e*n/r},deduplicate:function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];-1===e.indexOf(n)&&e.push(n)}return e},mergeObjects:n,cloneObject:function(t){return n({},t)},mergeDefaults:function(t,e){return n({},e,t)}}},{}],24:[function(t,e,r){var n=r;n.bignum=t("bn.js"),n.define=t("./asn1/api").define,n.base=t("./asn1/base"),n.constants=t("./asn1/constants"),n.decoders=t("./asn1/decoders"),n.encoders=t("./asn1/encoders")},{"./asn1/api":25,"./asn1/base":27,"./asn1/constants":31,"./asn1/decoders":33,"./asn1/encoders":36,"bn.js":44}],25:[function(t,e,r){var n=t("../asn1"),i=t("inherits");function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}r.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(e){var r;try{r=t("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(t){r=function(t){this._initNamed(t)}}return i(r,e),r.prototype._initNamed=function(t){e.call(this,t)},new r(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n.decoders[t])),this.decoders[t]},o.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n.encoders[t])),this.encoders[t]},o.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},{"../asn1":24,inherits:133,vm:215}],26:[function(t,e,r){var n=t("inherits"),i=t("../base").Reporter,o=t("buffer").Buffer;function s(t,e){i.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(t){return t instanceof a||(t=new a(t,e)),this.length+=t.length,t},this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(s,i),r.DecoderBuffer=s,s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(t){var e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},r.EncoderBuffer=a,a.prototype.join=function(t,e){return t||(t=new o(this.length)),e||(e=0),0===this.length?t:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(t,e),e+=r.length}):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length),t)}},{"../base":27,buffer:76,inherits:133}],27:[function(t,e,r){var n=r;n.Reporter=t("./reporter").Reporter,n.DecoderBuffer=t("./buffer").DecoderBuffer,n.EncoderBuffer=t("./buffer").EncoderBuffer,n.Node=t("./node")},{"./buffer":26,"./node":28,"./reporter":29}],28:[function(t,e,r){var n=t("../base").Reporter,i=t("../base").EncoderBuffer,o=t("../base").DecoderBuffer,s=t("minimalistic-assert"),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],f=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function u(t,e){var r={};this._baseState=r,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}e.exports=u;var h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){var t=this._baseState,e={};h.forEach(function(r){e[r]=t[r]});var r=new this.constructor(e.parent);return r._baseState=e,r},u.prototype._wrap=function(){var t=this._baseState;f.forEach(function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}},this)},u.prototype._init=function(t){var e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter(function(t){return t._baseState.parent===this},this),s.equal(e.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(t){var e=this._baseState,r=t.filter(function(t){return t instanceof this.constructor},this);t=t.filter(function(t){return!(t instanceof this.constructor)},this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach(function(t){t._baseState.parent=this},this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map(function(t){if("object"!=typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach(function(r){r==(0|r)&&(r|=0);var n=t[r];e[n]=r}),e}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(t){u.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}}),a.forEach(function(t){u.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}}),u.prototype.use=function(t){s(t);var e=this._baseState;return s(null===e.use),e.use=t,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(t){var e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},u.prototype.explicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},u.prototype.implicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},u.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},u.prototype.key=function(t){var e=this._baseState;return s(null===e.key),e.key=t,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(t){var e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},u.prototype.contains=function(t){var e=this._baseState;return s(null===e.use),e.contains=t,this},u.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var n,i=r.default,s=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){var f=null;if(null!==r.explicit?f=r.explicit:null!==r.implicit?f=r.implicit:null!==r.tag&&(f=r.tag),null!==f||r.any){if(s=this._peekTag(t,f,r.any),t.isError(s))return s}else{var u=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),s=!0}catch(t){s=!1}t.restore(u)}}if(r.obj&&s&&(n=t.enterObject()),s){if(null!==r.explicit){var h=this._decodeTag(t,r.explicit);if(t.isError(h))return h;t=h}var c=t.offset;if(null===r.use&&null===r.choice){if(r.any)u=t.save();var l=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(l))return l;r.any?i=t.raw(u):t=l}if(e&&e.track&&null!==r.tag&&e.track(t.path(),c,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),i=r.any?i:null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(t,e)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var d=new o(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(d,e)}}return r.obj&&s&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,i),i},u.prototype._decodeGeneric=function(t,e,r){var n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},u.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},u.prototype._decodeChoice=function(t,e){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some(function(o){var s=t.save(),a=r.choice[o];try{var f=a._decode(t,e);if(t.isError(f))return!1;n={type:o,value:f},i=!0}catch(e){return t.restore(s),!1}return!0},this),i?n:t.error("Choice not matched")},u.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},u.prototype._encode=function(t,e,r){var n=this._baseState;if(null===n.default||n.default!==t){var i=this._encodeValue(t,e,r);if(void 0!==i&&!this._skipDefault(i,e,r))return i}},u.prototype._encodeValue=function(t,e,r){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);var o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}var s=null,a=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)s=this._getUse(i.contains,r)._encode(t,e),a=!0;else if(i.children)s=i.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var n=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");var i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i},this).filter(function(t){return t}),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var f=this.clone();f._baseState.implicit=null,s=this._createEncoderBuffer(t.map(function(r){var n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)},f))}else null!==i.use?o=this._getUse(i.use,r)._encode(t,e):(s=this._encodePrimitive(i.tag,t),a=!0);if(!i.any&&null===i.choice){var u=null!==i.implicit?i.implicit:i.tag,h=null===i.implicit?"universal":"context";null===u?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(u,a,h,s))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},u.prototype._encodeChoice=function(t,e){var r=this._baseState,n=r.choice[t.type];return n||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},u.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},u.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},u.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},{"../base":27,"minimalistic-assert":139}],29:[function(t,e,r){var n=t("inherits");function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}r.Reporter=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){var n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){var e,r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map(function(t){return"["+JSON.stringify(t)+"]"}).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:133}],30:[function(t,e,r){var n=t("../constants");r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=n._reverse(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=n._reverse(r.tag)},{"../constants":31}],31:[function(t,e,r){var n=r;n._reverse=function(t){var e={};return Object.keys(t).forEach(function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r}),e},n.der=t("./der")},{"./der":30}],32:[function(t,e,r){var n=t("inherits"),i=t("../../asn1"),o=i.base,s=i.bignum,a=i.constants.der;function f(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.Node.call(this,"der",t)}function h(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function c(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o<i;o++){n<<=8;var s=t.readUInt8(r);if(t.isError(s))return s;n|=s}return n}e.exports=f,f.prototype.decode=function(t,e){return t instanceof o.DecoderBuffer||(t=new o.DecoderBuffer(t,e)),this.tree._decode(t,e)},n(u,o.Node),u.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;var n=t.save(),i=h(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},u.prototype._decodeTag=function(t,e,r){var n=h(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;var i=c(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');var o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: "'+e+'"'))},u.prototype._skipUntilEnd=function(t,e){for(;;){var r=h(t,e);if(t.isError(r))return r;var n,i=c(t,r.primitive,e);if(t.isError(i))return i;if(n=r.primitive||null!==i?t.skip(i):this._skipUntilEnd(t,e),t.isError(n))return n;if("end"===r.tagStr)break}},u.prototype._decodeList=function(t,e,r,n){for(var i=[];!t.isEmpty();){var o=this._peekTag(t,"end");if(t.isError(o))return o;var s=r.decode(t,"der",n);if(t.isError(s)&&o)break;i.push(s)}return i},u.prototype._decodeStr=function(t,e){if("bitstr"===e){var r=t.readUInt8();return t.isError(r)?r:{unused:r,data:t.raw()}}if("bmpstr"===e){var n=t.raw();if(n.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<n.length/2;o++)i+=String.fromCharCode(n.readUInt16BE(2*o));return i}if("numstr"===e){var s=t.raw().toString("ascii");return this._isNumstr(s)?s:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){var a=t.raw().toString("ascii");return this._isPrintstr(a)?a:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},u.prototype._decodeObjid=function(t,e,r){for(var n,i=[],o=0;!t.isEmpty();){var s=t.readUInt8();o<<=7,o|=127&s,0==(128&s)&&(i.push(o),o=0)}128&s&&i.push(o);var a=i[0]/40|0,f=i[0]%40;if(n=r?i:[a,f].concat(i.slice(1)),e){var u=e[n.join(" ")];void 0===u&&(u=e[n.join(".")]),void 0!==u&&(n=u)}return n},u.prototype._decodeTime=function(t,e){var r=t.raw().toString();if("gentime"===e)var n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),f=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),f=0|r.slice(10,12);n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,s,a,f,0)},u.prototype._decodeNull=function(t){return null},u.prototype._decodeBool=function(t){var e=t.readUInt8();return t.isError(e)?e:0!==e},u.prototype._decodeInt=function(t,e){var r=t.raw(),n=new s(r);return e&&(n=e[n.toString(10)]||n),n},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},{"../../asn1":24,inherits:133}],33:[function(t,e,r){var n=r;n.der=t("./der"),n.pem=t("./pem")},{"./der":32,"./pem":34}],34:[function(t,e,r){var n=t("inherits"),i=t("buffer").Buffer,o=t("./der");function s(t){o.call(this,t),this.enc="pem"}n(s,o),e.exports=s,s.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,f=-1,u=0;u<r.length;u++){var h=r[u].match(s);if(null!==h&&h[2]===n){if(-1!==a){if("END"!==h[1])break;f=u;break}if("BEGIN"!==h[1])break;a=u}}if(-1===a||-1===f)throw new Error("PEM section not found for: "+n);var c=r.slice(a+1,f).join("");c.replace(/[^a-z0-9\+\/=]+/gi,"");var l=new i(c,"base64");return o.prototype.decode.call(this,l,e)}},{"./der":32,buffer:76,inherits:133}],35:[function(t,e,r){var n=t("inherits"),i=t("buffer").Buffer,o=t("../../asn1"),s=o.base,a=o.constants.der;function f(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){s.Node.call(this,"der",t)}function h(t){return t<10?"0"+t:t}e.exports=f,f.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(u,s.Node),u.prototype._encodeComposite=function(t,e,r,n){var o,s=function(t,e,r,n){var i;"seqof"===t?t="seq":"setof"===t&&(t="set");if(a.tagByName.hasOwnProperty(t))i=a.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}if(i>=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=a.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=s,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var f=1,u=n.length;u>=256;u>>=8)f++;(o=new i(2+f))[0]=s,o[1]=128|f;u=1+f;for(var h=n.length;h>0;u--,h>>=8)o[u]=255&h;return this._createEncoderBuffer([o,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new i(2*t.length),n=0;n<t.length;n++)r.writeUInt16BE(t.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)?this._createEncoderBuffer(t):"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},u.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s\.]+/g);for(var n=0;n<t.length;n++)t[n]|=0}else if(Array.isArray(t)){t=t.slice();for(n=0;n<t.length;n++)t[n]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(n=0;n<t.length;n++){var s=t[n];for(o++;s>=128;s>>=7)o++}var a=new i(o),f=a.length-1;for(n=t.length-1;n>=0;n--){s=t[n];for(a[f--]=127&s;(s>>=7)>0;)a[f--]=128|127&s}return this._createEncoderBuffer(a)},u.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[h(n.getFullYear()),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[h(n.getFullYear()%100),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new i(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=new i(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);n=1;for(var s=t;s>=256;s>>=8)n++;for(s=(o=new Array(n)).length-1;s>=0;s--)o[s]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},{"../../asn1":24,buffer:76,inherits:133}],36:[function(t,e,r){var n=r;n.der=t("./der"),n.pem=t("./pem")},{"./der":35,"./pem":37}],37:[function(t,e,r){var n=t("inherits"),i=t("./der");function o(t){i.call(this,t),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(t,e){for(var r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},{"./der":35,inherits:133}],38:[function(t,e,r){(function(r){"use strict";var n=t("object-assign");function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function o(t){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var s=t("util/"),a=Object.prototype.hasOwnProperty,f=Array.prototype.slice,u="foo"===function(){}.name;function h(t){return Object.prototype.toString.call(t)}function c(t){return!o(t)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var l=e.exports=v,d=/\s*function\s+([^\(\s]*)\s*/;function p(t){if(s.isFunction(t)){if(u)return t.name;var e=t.toString().match(d);return e&&e[1]}}function m(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function b(t){if(u||!s.isFunction(t))return s.inspect(t);var e=p(t);return"[Function"+(e?": "+e:"")+"]"}function g(t,e,r,n,i){throw new l.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function v(t,e){t||g(t,!0,e,"==",l.ok)}function y(t,e,r,n){if(t===e)return!0;if(o(t)&&o(e))return 0===i(t,e);if(s.isDate(t)&&s.isDate(e))return t.getTime()===e.getTime();if(s.isRegExp(t)&&s.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(c(t)&&c(e)&&h(t)===h(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===i(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(o(t)!==o(e))return!1;var a=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==a&&a===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null===t||void 0===t||null===e||void 0===e)return!1;if(s.isPrimitive(t)||s.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=w(t),o=w(e);if(i&&!o||!i&&o)return!1;if(i)return t=f.call(t),e=f.call(e),y(t,e,r);var a,u,h=M(t),c=M(e);if(h.length!==c.length)return!1;for(h.sort(),c.sort(),u=h.length-1;u>=0;u--)if(h[u]!==c[u])return!1;for(u=h.length-1;u>=0;u--)if(a=h[u],!y(t[a],e[a],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function w(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function x(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&g(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!t&&s.isError(i),f=!t&&i&&!r;if((a&&o&&_(i,r)||f)&&g(i,r,"Got unwanted exception"+n),t&&i&&r&&!_(i,r)||!t&&i)throw i}l.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=m(b((e=this).actual),128)+" "+e.operator+" "+m(b(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=p(r),s=i.indexOf("\n"+o);if(s>=0){var a=i.indexOf("\n",s+1);i=i.substring(a+1)}this.stack=i}}},s.inherits(l.AssertionError,Error),l.fail=g,l.ok=v,l.equal=function(t,e,r){t!=e&&g(t,e,r,"==",l.equal)},l.notEqual=function(t,e,r){t==e&&g(t,e,r,"!=",l.notEqual)},l.deepEqual=function(t,e,r){y(t,e,!1)||g(t,e,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(t,e,r){y(t,e,!0)||g(t,e,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(t,e,r){y(t,e,!1)&&g(t,e,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function t(e,r,n){y(e,r,!0)&&g(e,r,n,"notDeepStrictEqual",t)},l.strictEqual=function(t,e,r){t!==e&&g(t,e,r,"===",l.strictEqual)},l.notStrictEqual=function(t,e,r){t===e&&g(t,e,r,"!==",l.notStrictEqual)},l.throws=function(t,e,r){x(!0,t,e,r)},l.doesNotThrow=function(t,e,r){x(!1,t,e,r)},l.ifError=function(t){if(t)throw t},l.strict=n(function t(e,r){e||g(e,!0,r,"==",t)},l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual}),l.strict.strict=l.strict;var M=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":151,"util/":41}],39:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],40:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],41:[function(t,e,r){(function(e,n){var i=/%[sdj%]/g;r.format=function(t){if(!g(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(t).replace(i,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),f=n[r];r<o;f=n[++r])m(f)||!w(f)?s+=" "+f:s+=" "+a(f);return s},r.deprecate=function(t,i){if(v(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(!0===e.noDeprecation)return t;var o=!1;return function(){if(!o){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),o=!0}return t.apply(this,arguments)}};var o,s={};function a(t,e){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(e)?n.showHidden=e:e&&r._extend(n,e),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,t,n.depth)}function f(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function u(t,e){return t}function h(t,e,n){if(t.customInspect&&e&&M(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return g(i)||(i=h(t,i,n)),i}var o=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(b(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,e);if(o)return o;var s=Object.keys(e),a=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),x(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(e);if(0===s.length){if(M(e)){var f=e.name?": "+e.name:"";return t.stylize("[Function"+f+"]","special")}if(y(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return c(e)}var u,w="",S=!1,E=["{","}"];(d(e)&&(S=!0,E=["[","]"]),M(e))&&(w=" [Function"+(e.name?": "+e.name:"")+"]");return y(e)&&(w=" "+RegExp.prototype.toString.call(e)),_(e)&&(w=" "+Date.prototype.toUTCString.call(e)),x(e)&&(w=" "+c(e)),0!==s.length||S&&0!=e.length?n<0?y(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=S?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)A(e,String(s))?o.push(l(t,e,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(l(t,e,r,n,i,!0))}),o}(t,e,n,a,s):s.map(function(r){return l(t,e,n,a,r,S)}),t.seen.pop(),function(t,e,r){if(t.reduce(function(t,e){return 0,e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(u,w,E)):E[0]+w+E[1]}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,r,n,i,o){var s,a,f;if((f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=f.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):f.set&&(a=t.stylize("[Setter]","special")),A(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(f.value)<0?(a=m(r)?h(t,f.value,null):h(t,f.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n")):a=t.stylize("[Circular]","special")),v(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function d(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function g(t){return"string"==typeof t}function v(t){return void 0===t}function y(t){return w(t)&&"[object RegExp]"===S(t)}function w(t){return"object"==typeof t&&null!==t}function _(t){return w(t)&&"[object Date]"===S(t)}function x(t){return w(t)&&("[object Error]"===S(t)||t instanceof Error)}function M(t){return"function"==typeof t}function S(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(v(o)&&(o=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!s[t])if(new RegExp("\\b"+t+"\\b","i").test(o)){var n=e.pid;s[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else s[t]=function(){};return s[t]},r.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=d,r.isBoolean=p,r.isNull=m,r.isNullOrUndefined=function(t){return null==t},r.isNumber=b,r.isString=g,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=v,r.isRegExp=y,r.isObject=w,r.isDate=_,r.isError=x,r.isFunction=M,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":"),[t.getDate(),k[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":40,_process:164,inherits:39}],42:[function(t,e,r){const n=t("adnn/tensor"),i=t("adnn/nn"),o=t("adnn/opt");e.exports=class{constructor(t){this.scale=t.scale||!0;let e=[],r=[];if(t.encoder&&t.encoder.length&&t.decoder&&t.decoder.length)this.nInputs=t.decoder[t.decoder.length-1].nOut,this.nHidden=t.encoder[t.encoder.length-1].nOut,e=t.encoder.map(t=>({nOut:t.nOut,activation:i[t.activation]})),r=t.decoder.map(t=>({nOut:t.nOut,activation:i[t.activation]}));else{if(!t.nInputs||!t.nHidden)throw new Error("Not enough parameters to build an autoencoder");{this.nInputs=t.nInputs,this.nHidden=t.nHidden;const o=t.nLayers||2,s=t.activation||"relu";for(var n=0;n<o;n++)e.push({nOut:this.nInputs-Math.round((n+1)*(this.nInputs-this.nHidden)/o),activation:i[s]}),r.push({nOut:this.nHidden+Math.round((n+1)*(this.nInputs-this.nHidden)/o),activation:n<o-1?i[s]:void 0})}}this.encoder=i.mlp(this.nInputs,e),this.decoder=i.mlp(this.nHidden,r),this.net=i.sequence([this.encoder,this.decoder])}_scalerFit(t){this.max=t[0].slice(0),this.min=t[0].slice(0),t.forEach(t=>{t.forEach((t,e)=>{t>this.max[e]?this.max[e]=t:t<this.min[e]&&(this.min[e]=t)})})}_scalerTransform(t){const e=this.max.map((t,e)=>t-this.min[e]);return t.map(t=>t.map((t,r)=>e[r]>0?(t-this.min[r])/(this.max[r]-this.min[r]):0))}_scalerFitTransform(t){return this._scalerFit(t),this._scalerTransform(t)}_scalerInverseTransform(t){return t.map(t=>t.map((t,e)=>this.min[e]+t*(this.max[e]-this.min[e])))}fit(t,e){const r=e||{},i=r.stepSize||.05,s=(this.scale?this._scalerFitTransform(t):t).map(t=>{const e=new n([this.nInputs]).fromArray(t);return{input:e,output:e}});o.nnTrain(this.net,s,o.regressionLoss,{iterations:r.iterations||100,batchSize:r.batchSize||Math.round(s.length/50),method:r.method?o[r.method]({stepSize:i}):o.adagrad({stepSize:i})})}_eval(t,e){const r=t[0].length;return t.map(t=>e.eval(new n([r]).fromArray(t)).toArray())}encode(t){const e=this.scale?this._scalerTransform(t):t;return this._eval(e,this.encoder)}decode(t){const e=this._eval(t,this.decoder);return this.scale?this._scalerInverseTransform(e):e}predict(t){const e=this.scale?this._scalerTransform(t):t,r=this._eval(e,this.net);return this.scale?this._scalerInverseTransform(r):r}}},{"adnn/nn":7,"adnn/opt":17,"adnn/tensor":22}],43:[function(t,e,r){"use strict";r.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=u(t),s=n[0],a=n[1],f=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],f[h++]=e>>16&255,f[h++]=e>>8&255,f[h++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,f[h++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,f[h++]=e>>8&255,f[h++]=255&e);return f},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(h(t,s,s+16383>a?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,f=s.length;a<f;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],44:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof e?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{s=t("buffer").Buffer}catch(t){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,f=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var h=f>>>26,c=67108863&f,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[u]=0|c,f=0|h}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],f=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?u[6-f.length]+f+r:f+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=h[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,f="le"===e,u=new t(o),h=this.clone();if(f){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),u[o-a-1]=s}return u},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,o,s=t.words,a=e.words,f=r.words,u=0,h=0|s[0],c=8191&h,l=h>>>13,d=0|s[1],p=8191&d,m=d>>>13,b=0|s[2],g=8191&b,v=b>>>13,y=0|s[3],w=8191&y,_=y>>>13,x=0|s[4],M=8191&x,S=x>>>13,E=0|s[5],k=8191&E,A=E>>>13,j=0|s[6],I=8191&j,R=j>>>13,O=0|s[7],D=8191&O,N=O>>>13,C=0|s[8],B=8191&C,T=C>>>13,P=0|s[9],z=8191&P,F=P>>>13,q=0|a[0],L=8191&q,U=q>>>13,V=0|a[1],H=8191&V,X=V>>>13,W=0|a[2],K=8191&W,$=W>>>13,J=0|a[3],Y=8191&J,G=J>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ft=8191&at,ut=at>>>13,ht=0|a[8],ct=8191&ht,lt=ht>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(u+(n=Math.imul(c,L))|0)+((8191&(i=(i=Math.imul(c,U))+Math.imul(l,L)|0))<<13)|0;u=((o=Math.imul(l,U))+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(p,L),i=(i=Math.imul(p,U))+Math.imul(m,L)|0,o=Math.imul(m,U);var gt=(u+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,L),i=(i=Math.imul(g,U))+Math.imul(v,L)|0,o=Math.imul(v,U),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,X)|0;var vt=(u+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,$)|0)+Math.imul(l,K)|0))<<13)|0;u=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,L),i=(i=Math.imul(w,U))+Math.imul(_,L)|0,o=Math.imul(_,U),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,X)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,$)|0;var yt=(u+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(M,L),i=(i=Math.imul(M,U))+Math.imul(S,L)|0,o=Math.imul(S,U),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,G)|0;var wt=(u+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,L),i=(i=Math.imul(k,U))+Math.imul(A,L)|0,o=Math.imul(A,U),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(u+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;u=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,L),i=(i=Math.imul(I,U))+Math.imul(R,L)|0,o=Math.imul(R,U),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var xt=(u+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;u=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,L),i=(i=Math.imul(D,U))+Math.imul(N,L)|0,o=Math.imul(N,U),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Mt=(u+(n=n+Math.imul(c,ft)|0)|0)+((8191&(i=(i=i+Math.imul(c,ut)|0)+Math.imul(l,ft)|0))<<13)|0;u=((o=o+Math.imul(l,ut)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,L),i=(i=Math.imul(B,U))+Math.imul(T,L)|0,o=Math.imul(T,U),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,ut)|0;var St=(u+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;u=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(z,L),i=(i=Math.imul(z,U))+Math.imul(F,L)|0,o=Math.imul(F,U),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(D,K)|0,i=(i=i+Math.imul(D,$)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,ut)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var Et=(u+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;u=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,H),i=(i=Math.imul(z,X))+Math.imul(F,H)|0,o=Math.imul(F,X),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ut)|0,n=n+Math.imul(g,ct)|0,i=(i=i+Math.imul(g,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var kt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,K),i=(i=Math.imul(z,$))+Math.imul(F,K)|0,o=Math.imul(F,$),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,ut)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var At=(u+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,G))+Math.imul(F,Y)|0,o=Math.imul(F,G),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(A,ft)|0,o=o+Math.imul(A,ut)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,lt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,lt)|0;var jt=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ut)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ut)|0,n=n+Math.imul(k,ct)|0,i=(i=i+Math.imul(k,lt)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,lt)|0;var It=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(S,pt)|0))<<13)|0;u=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ut)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,ut)|0,n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Rt=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(z,ot),i=(i=Math.imul(z,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,ut)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,ut)|0,n=n+Math.imul(D,ct)|0,i=(i=i+Math.imul(D,lt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,lt)|0;var Ot=(u+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,ft),i=(i=Math.imul(z,ut))+Math.imul(F,ft)|0,o=Math.imul(F,ut),n=n+Math.imul(B,ct)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,lt)|0;var Dt=(u+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(z,ct),i=(i=Math.imul(z,lt))+Math.imul(F,ct)|0,o=Math.imul(F,lt);var Nt=(u+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ct=(u+(n=Math.imul(z,pt))|0)+((8191&(i=(i=Math.imul(z,mt))+Math.imul(F,pt)|0))<<13)|0;return u=((o=Math.imul(F,mt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,f[0]=bt,f[1]=gt,f[2]=vt,f[3]=yt,f[4]=wt,f[5]=_t,f[6]=xt,f[7]=Mt,f[8]=St,f[9]=Et,f[10]=kt,f[11]=At,f[12]=jt,f[13]=It,f[14]=Rt,f[15]=Ot,f[16]=Dt,f[17]=Nt,f[18]=Ct,0!==u&&(f[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,f=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=f;u++){var h=o-u,c=(0|t.words[h])*(0|e.words[u]),l=67108863&c;a=67108863&(l=l+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},m.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,f=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=f,l=u,d=0;d<s;d++){var p=r[h+d],m=n[h+d],b=r[h+d+s],g=n[h+d+s],v=c*b-l*g;g=c*g+l*b,b=v,r[h+d]=p+b,n[h+d]=m+g,r[h+d+s]=p-b,n[h+d+s]=m-g,d!==a&&(v=f*c-u*l,l=f*l+u*c,c=v)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),f=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,u,n),this.transform(s,o,a,f,n,i),this.transform(u,o,h,c,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-f[d]*c[d];f[d]=a[d]*c[d]+f[d]*h[d],a[d]=p}return this.conjugate(a,f,n),this.transform(a,f,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,f=(0|this.words[e])-a<<r;this.words[e]=f|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,f=r;if(i-=s,i=Math.max(0,i),f){for(var u=0;u<s;u++)f.words[u]=this.words[u];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var h=0;for(u=this.length-1;u>=0&&(0!==h||u>=i);u--){var c=0|this.words[u];this.words[u]=h<<26-o|c>>>o,h=c&a}return f&&0!==h&&(f.words[f.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var f=(0|t.words[i])*e;a=((o-=67108863&f)>>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,f=n.length-i.length;if("mod"!==e){(a=new o(null)).length=f+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var h=n.clone()._ishlnsubmul(i,1,f);0===h.negative&&(n=h,a&&(a.words[f]=1));for(var c=f-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),f=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(h),f.isub(c)),a.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(f)):(r.isub(e),a.isub(i),f.isub(s))}return{a:a,b:f,gcd:r.iushln(u)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),f=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,h=1;0==(e.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(v,g),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(y,g),i(w,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new y;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return b[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),f=a.redNeg(),u=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,u).cmp(f);)h.redIAdd(f);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,b=0;0!==m.cmp(a);b++)m=m.redSqr();n(b<p);var g=this.pow(c,new o(1).iushln(p-b-1));l=l.redMul(g),c=g.redSqr(),d=d.redMul(c),p=b}return l},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,f=e.bitLength()%26;for(0===f&&(f=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],h=f-1;h>=0;h--){var c=u>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}f=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},i(M,x),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:46}],45:[function(t,e,r){var n;function i(t){this.rand=t}if(e.exports=function(t){return n||(n=new i(null)),n.generate(t)},e.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=t("crypto");if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},{crypto:46}],46:[function(t,e,r){},{}],47:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,n,i){for(var o,s,a,f,u=r[0],h=r[1],c=r[2],l=r[3],d=t[0]^e[0],p=t[1]^e[1],m=t[2]^e[2],b=t[3]^e[3],g=4,v=1;v<i;v++)o=u[d>>>24]^h[p>>>16&255]^c[m>>>8&255]^l[255&b]^e[g++],s=u[p>>>24]^h[m>>>16&255]^c[b>>>8&255]^l[255&d]^e[g++],a=u[m>>>24]^h[b>>>16&255]^c[d>>>8&255]^l[255&p]^e[g++],f=u[b>>>24]^h[d>>>16&255]^c[p>>>8&255]^l[255&m]^e[g++],d=o,p=s,m=a,b=f;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&b])^e[g++],s=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[b>>>8&255]<<8|n[255&d])^e[g++],a=(n[m>>>24]<<24|n[b>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[g++],f=(n[b>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[g++],[o>>>=0,s>>>=0,a>>>=0,f>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],f=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,f=0;f<256;++f){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,r[s]=u,n[u]=s;var h=t[s],c=t[h],l=t[c],d=257*t[u]^16843008*u;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*l^65537*c^257*h^16843008*s,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===s?s=a=1:(s=h^t[t[t[l^h]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function u(t){this._key=i(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o<e;o++)i[o]=t[o];for(o=e;o<n;o++){var s=i[o-1];o%e==0?(s=s<<8|s>>>24,s=f.SBOX[s>>>24]<<24|f.SBOX[s>>>16&255]<<16|f.SBOX[s>>>8&255]<<8|f.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=f.SBOX[s>>>24]<<24|f.SBOX[s>>>16&255]<<16|f.SBOX[s>>>8&255]<<8|f.SBOX[255&s]),i[o]=i[o-e]^s}for(var u=[],h=0;h<n;h++){var c=n-h,l=i[c-(h%4?0:4)];u[h]=h<4||c<=4?l:f.INV_SUB_MIX[0][f.SBOX[l>>>24]]^f.INV_SUB_MIX[1][f.SBOX[l>>>16&255]]^f.INV_SUB_MIX[2][f.SBOX[l>>>8&255]]^f.INV_SUB_MIX[3][f.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,f.SUB_MIX,f.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,f.INV_SUB_MIX,f.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=u},{"safe-buffer":194}],48:[function(t,e,r){var n=t("./aes"),i=t("safe-buffer").Buffer,o=t("cipher-base"),s=t("inherits"),a=t("./ghash"),f=t("buffer-xor"),u=t("./incr32");function h(t,e,r,s){o.call(this);var f=i.alloc(4,0);this._cipher=new n.AES(e);var h=this._cipher.encryptBlock(f);this._ghash=new a(h),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var f=8*o,h=i.alloc(8);h.writeUIntBE(f,0,8),n.update(h),t._finID=n.state;var c=i.from(t._finID);return u(c),c}(this,r,h),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(h,o),h.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=f(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},h.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},h.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},h.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},e.exports=h},{"./aes":47,"./ghash":52,"./incr32":53,"buffer-xor":75,"cipher-base":77,inherits:133,"safe-buffer":194}],49:[function(t,e,r){var n=t("./encrypter"),i=t("./decrypter"),o=t("./modes/list.json");r.createCipher=r.Cipher=n.createCipher,r.createCipheriv=r.Cipheriv=n.createCipheriv,r.createDecipher=r.Decipher=i.createDecipher,r.createDecipheriv=r.Decipheriv=i.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(o)}},{"./decrypter":50,"./encrypter":51,"./modes/list.json":61}],50:[function(t,e,r){var n=t("./authCipher"),i=t("safe-buffer").Buffer,o=t("./modes"),s=t("./streamCipher"),a=t("cipher-base"),f=t("./aes"),u=t("evp_bytestokey");function h(t,e,r){a.call(this),this._cache=new c,this._last=void 0,this._cipher=new f.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function c(){this.cache=i.allocUnsafe(0)}function l(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new h(a.module,e,r)}t("inherits")(h,a),h.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},h.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16===e)return;return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},c.prototype.add=function(t){this.cache=i.concat([this.cache,t])},c.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(e,!1,r.key,r.iv);return l(t,n.key,n.iv)},r.createDecipheriv=l},{"./aes":47,"./authCipher":48,"./modes":60,"./streamCipher":63,"cipher-base":77,evp_bytestokey:115,inherits:133,"safe-buffer":194}],51:[function(t,e,r){var n=t("./modes"),i=t("./authCipher"),o=t("safe-buffer").Buffer,s=t("./streamCipher"),a=t("cipher-base"),f=t("./aes"),u=t("evp_bytestokey");function h(t,e,r){a.call(this),this._cache=new l,this._cipher=new f.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}t("inherits")(h,a),h.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var c=o.alloc(16,16);function l(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new h(a.module,e,r)}h.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=o.concat([this.cache,t])},l.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},l.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},r.createCipheriv=d,r.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(e,!1,r.key,r.iv);return d(t,i.key,i.iv)}},{"./aes":47,"./authCipher":48,"./modes":60,"./streamCipher":63,"cipher-base":77,evp_bytestokey:115,inherits:133,"safe-buffer":194}],52:[function(t,e,r){var n=t("safe-buffer").Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},e.exports=s},{"safe-buffer":194}],53:[function(t,e,r){e.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},{}],54:[function(t,e,r){var n=t("buffer-xor");r.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},r.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},{"buffer-xor":75}],55:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("buffer-xor");function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}r.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},{"buffer-xor":75,"safe-buffer":194}],56:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e,r){for(var n,i,s,a=-1,f=0;++a<8;)n=t._cipher.encryptBlock(t._prev),i=e&1<<7-a?128:0,f+=(128&(s=n[0]^i))>>a%8,t._prev=o(t._prev,r?i:s);return f}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}r.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},{"safe-buffer":194}],57:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}r.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},{"safe-buffer":194}],58:[function(t,e,r){var n=t("buffer-xor"),i=t("safe-buffer").Buffer,o=t("../incr32");function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}r.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var f=s(t),u=o+16*a;t._cache.writeUInt32BE(f[0],u+0),t._cache.writeUInt32BE(f[1],u+4),t._cache.writeUInt32BE(f[2],u+8),t._cache.writeUInt32BE(f[3],u+12)}var h=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,h)}},{"../incr32":53,"buffer-xor":75,"safe-buffer":194}],59:[function(t,e,r){r.encrypt=function(t,e){return t._cipher.encryptBlock(e)},r.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},{}],60:[function(t,e,r){var n={ECB:t("./ecb"),CBC:t("./cbc"),CFB:t("./cfb"),CFB8:t("./cfb8"),CFB1:t("./cfb1"),OFB:t("./ofb"),CTR:t("./ctr"),GCM:t("./ctr")},i=t("./list.json");for(var o in i)i[o].module=n[i[o].mode];e.exports=i},{"./cbc":54,"./cfb":55,"./cfb1":56,"./cfb8":57,"./ctr":58,"./ecb":59,"./list.json":61,"./ofb":62}],61:[function(t,e,r){e.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],62:[function(t,e,r){(function(e){var n=t("buffer-xor");function i(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}r.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var o=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,o)}}).call(this,t("buffer").Buffer)},{buffer:76,"buffer-xor":75}],63:[function(t,e,r){var n=t("./aes"),i=t("safe-buffer").Buffer,o=t("cipher-base");function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}t("inherits")(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},e.exports=s},{"./aes":47,"cipher-base":77,inherits:133,"safe-buffer":194}],64:[function(t,e,r){var n=t("browserify-des"),i=t("browserify-aes/browser"),o=t("browserify-aes/modes"),s=t("browserify-des/modes"),a=t("evp_bytestokey");function f(t,e,r){if(t=t.toLowerCase(),o[t])return i.createCipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function u(t,e,r){if(t=t.toLowerCase(),o[t])return i.createDecipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}r.createCipher=r.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return f(t,i.key,i.iv)},r.createCipheriv=r.Cipheriv=f,r.createDecipher=r.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return u(t,i.key,i.iv)},r.createDecipheriv=r.Decipheriv=u,r.listCiphers=r.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},{"browserify-aes/browser":49,"browserify-aes/modes":60,"browserify-des":65,"browserify-des/modes":66,evp_bytestokey:115}],65:[function(t,e,r){var n=t("cipher-base"),i=t("des.js"),o=t("inherits"),s=t("safe-buffer").Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function f(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var f=t.iv;s.isBuffer(f)||(f=s.from(f)),this._des=i.create({key:o,iv:f,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],e.exports=f,o(f,n),f.prototype._update=function(t){return s.from(this._des.update(t))},f.prototype._final=function(){return s.from(this._des.final())}},{"cipher-base":77,"des.js":88,inherits:133,"safe-buffer":194}],66:[function(t,e,r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}},{}],67:[function(t,e,r){(function(r){var n=t("bn.js"),i=t("randombytes");function o(t,e){var i=function(t){var e=s(t);return{blinder:e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),a=(n.mont(e.modulus),new n(t).mul(i.blinder).umod(e.modulus)),f=a.toRed(n.mont(e.prime1)),u=a.toRed(n.mont(e.prime2)),h=e.coefficient,c=e.prime1,l=e.prime2,d=f.redPow(e.exponent1),p=u.redPow(e.exponent2);d=d.fromRed(),p=p.fromRed();var m=d.isub(p).imul(h).umod(c);return m.imul(l),p.iadd(m),new r(p.imul(i.unblinder).umod(e.modulus).toArray(!1,o))}function s(t){for(var e=t.modulus.byteLength(),r=new n(i(e));r.cmp(t.modulus)>=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new n(i(e));return r}e.exports=o,o.getr=s}).call(this,t("buffer").Buffer)},{"bn.js":44,buffer:76,randombytes:176}],68:[function(t,e,r){e.exports=t("./browser/algorithms.json")},{"./browser/algorithms.json":69}],69:[function(t,e,r){e.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],70:[function(t,e,r){e.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],71:[function(t,e,r){(function(r){var n=t("create-hash"),i=t("stream"),o=t("inherits"),s=t("./sign"),a=t("./verify"),f=t("./algorithms.json");function u(t){i.Writable.call(this);var e=f[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){i.Writable.call(this);var e=f[t];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function c(t){return new u(t)}function l(t){return new h(t)}Object.keys(f).forEach(function(t){f[t].id=new r(f[t].id,"hex"),f[t.toLowerCase()]=f[t]}),o(u,i.Writable),u.prototype._write=function(t,e,r){this._hash.update(t),r()},u.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},u.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=s(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},o(h,i.Writable),h.prototype._write=function(t,e,r){this._hash.update(t),r()},h.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},h.prototype.verify=function(t,e,n){"string"==typeof e&&(e=new r(e,n)),this.end();var i=this._hash.digest();return a(e,i,t,this._signType,this._tag)},e.exports={Sign:c,Verify:l,createSign:c,createVerify:l}}).call(this,t("buffer").Buffer)},{"./algorithms.json":69,"./sign":72,"./verify":73,buffer:76,"create-hash":80,inherits:133,stream:203}],72:[function(t,e,r){(function(r){var n=t("create-hmac"),i=t("browserify-rsa"),o=t("elliptic").ec,s=t("bn.js"),a=t("parse-asn1"),f=t("./curves.json");function u(t,e,i,o){if((t=new r(t.toArray())).length<e.byteLength()){var s=new r(e.byteLength()-t.length);s.fill(0),t=r.concat([s,t])}var a=i.length,f=function(t,e){t=(t=h(t,e)).mod(e);var n=new r(t.toArray());if(n.length<e.byteLength()){var i=new r(e.byteLength()-n.length);i.fill(0),n=r.concat([i,n])}return n}(i,e),u=new r(a);u.fill(1);var c=new r(a);return c.fill(0),c=n(o,c).update(u).update(new r([0])).update(t).update(f).digest(),u=n(o,c).update(u).digest(),{k:c=n(o,c).update(u).update(new r([1])).update(t).update(f).digest(),v:u=n(o,c).update(u).digest()}}function h(t,e){var r=new s(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function c(t,e,i){var o,s;do{for(o=new r(0);8*o.length<t.bitLength();)e.v=n(i,e.k).update(e.v).digest(),o=r.concat([o,e.v]);s=h(o,t),e.k=n(i,e.k).update(e.v).update(new r([0])).digest(),e.v=n(i,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function l(t,e,r,n){return t.toRed(s.mont(r)).redPow(e).fromRed().mod(n)}e.exports=function(t,e,n,d,p){var m=a(e);if(m.curve){if("ecdsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");return function(t,e){var n=f[e.curve.join(".")];if(!n)throw new Error("unknown curve "+e.curve.join("."));var i=new o(n).keyFromPrivate(e.privateKey).sign(t);return new r(i.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==d)throw new Error("wrong private key type");return function(t,e,n){for(var i,o=e.params.priv_key,a=e.params.p,f=e.params.q,d=e.params.g,p=new s(0),m=h(t,f).mod(f),b=!1,g=u(o,f,t,n);!1===b;)i=c(f,g,n),p=l(d,i,a,f),0===(b=i.invm(f).imul(m.add(o.mul(p))).mod(f)).cmpn(0)&&(b=!1,p=new s(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var n=[48,t.length+e.length+4,2,t.length];return n=n.concat(t,[2,e.length],e),new r(n)}(p,b)}(t,m,n)}if("rsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");t=r.concat([p,t]);for(var b=m.modulus.byteLength(),g=[0,1];t.length+g.length+1<b;)g.push(255);g.push(0);for(var v=-1;++v<t.length;)g.push(t[v]);return i(g,m)},e.exports.getKey=u,e.exports.makeKey=c}).call(this,t("buffer").Buffer)},{"./curves.json":70,"bn.js":44,"browserify-rsa":67,buffer:76,"create-hmac":82,elliptic:98,"parse-asn1":156}],73:[function(t,e,r){(function(r){var n=t("bn.js"),i=t("elliptic").ec,o=t("parse-asn1"),s=t("./curves.json");function a(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}e.exports=function(t,e,f,u,h){var c=o(f);if("ec"===c.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),a=r.data.subjectPrivateKey.data;return o.verify(e,t,a)}(t,e,c)}if("dsa"===c.type){if("dsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var i=r.data.p,s=r.data.q,f=r.data.g,u=r.data.pub_key,h=o.signature.decode(t,"der"),c=h.s,l=h.r;a(c,s),a(l,s);var d=n.mont(i),p=c.invm(s);return 0===f.toRed(d).redPow(new n(e).mul(p).mod(s)).fromRed().mul(u.toRed(d).redPow(l.mul(p).mod(s)).fromRed()).mod(i).mod(s).cmp(l)}(t,e,c)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");e=r.concat([h,e]);for(var l=c.modulus.byteLength(),d=[1],p=0;e.length+d.length+2<l;)d.push(255),p++;d.push(0);for(var m=-1;++m<e.length;)d.push(e[m]);d=new r(d);var b=n.mont(c.modulus);t=(t=new n(t).toRed(b)).redPow(new n(c.publicExponent)),t=new r(t.fromRed().toArray());var g=p<8?1:0;for(l=Math.min(t.length,d.length),t.length!==d.length&&(g=1),m=-1;++m<l;)g|=t[m]^d[m];return 0===g}}).call(this,t("buffer").Buffer)},{"./curves.json":70,"bn.js":44,buffer:76,elliptic:98,"parse-asn1":156}],74:[function(t,e,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],75:[function(t,e,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),o=0;o<n;++o)i[o]=e[o]^r[o];return i}}).call(this,t("buffer").Buffer)},{buffer:76}],76:[function(t,e,r){(function(e){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=e,r.SlowBuffer=function(t){+t!=t&&(t=0);return e.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function s(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return r.__proto__=e.prototype,r}function e(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return a(t,e,r)}function a(t,r,n){if("string"==typeof t)return function(t,r){"string"==typeof r&&""!==r||(r="utf8");if(!e.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|l(t,r),i=s(n),o=i.write(t,r);o!==n&&(i=i.slice(0,o));return i}(t,r);if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return function(t,r,n){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(n||0))throw new RangeError('"length" is outside of buffer bounds');var i;i=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);return i.__proto__=e.prototype,i}(t,r,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return e.from(i,r,n);var o=function(t){if(e.isBuffer(t)){var r=0|c(t.length),n=s(r);return 0===n.length?n:(t.copy(n,0,0,r),n)}if(void 0!==t.length)return"number"!=typeof t.length||q(t.length)?s(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return e.from(t[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return f(t),s(t<0?0:0|c(t))}function h(t){for(var e=t.length<0?0:0|c(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function l(t,r){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return T(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return P(t).length;default:if(o)return i?-1:T(t).length;r=(""+r).toLowerCase(),o=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,r,n,i,o){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=e.from(r,i)),e.isBuffer(r))return 0===r.length?-1:m(t,r,n,i,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,n):Uint8Array.prototype.lastIndexOf.call(t,r,n):m(t,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,s=1,a=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,f/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===f)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+f>a&&(r=a-f),o=r;o>=0;o--){for(var c=!0,l=0;l<f;l++)if(u(t,o+l)!==u(e,l)){c=!1;break}if(c)return o}return-1}function b(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(q(a))return s;t[r+s]=a}return s}function g(t,e,r,n){return z(T(e,t.length-r),t,r,n)}function v(t,e,r,n){return z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function y(t,e,r,n){return v(t,e,r,n)}function w(t,e,r,n){return z(P(e),t,r,n)}function _(t,e,r,n){return z(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,f,u=t[i],h=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c<=r)switch(c){case 1:u<128&&(h=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(h=f);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(f=(15&u)<<12|(63&o)<<6|63&s)>2047&&(f<55296||f>57343)&&(h=f);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(f=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&f<1114112&&(h=f)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=S));return r}(n)}r.kMaxLength=o,e.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),e.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&e[Symbol.species]===e&&Object.defineProperty(e,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),e.poolSize=8192,e.from=function(t,e,r){return a(t,e,r)},e.prototype.__proto__=Uint8Array.prototype,e.__proto__=Uint8Array,e.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},e.allocUnsafe=function(t){return u(t)},e.allocUnsafeSlow=function(t){return u(t)},e.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==e.prototype},e.compare=function(t,r){if(F(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),F(r,Uint8Array)&&(r=e.from(r,r.offset,r.byteLength)),!e.isBuffer(t)||!e.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var n=t.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(t[o]!==r[o]){n=t[o],i=r[o];break}return n<i?-1:i<n?1:0},e.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},e.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return e.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=e.allocUnsafe(r),o=0;for(n=0;n<t.length;++n){var s=t[n];if(F(s,Uint8Array)&&(s=e.from(s)),!e.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i},e.byteLength=l,e.prototype._isBuffer=!0,e.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},e.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},e.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},e.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(t){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===e.compare(this,t)},e.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},e.prototype.compare=function(t,r,n,i,o){if(F(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),!e.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var s=o-i,a=n-r,f=Math.min(s,a),u=this.slice(i,o),h=t.slice(r,n),c=0;c<f;++c)if(u[c]!==h[c]){s=u[c],a=h[c];break}return s<a?-1:a<s?1:0},e.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},e.prototype.indexOf=function(t,e,r){return p(this,t,e,r,!0)},e.prototype.lastIndexOf=function(t,e,r){return p(this,t,e,r,!1)},e.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function A(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=B(t[o]);return i}function j(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function I(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,r,n,i,o,s){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<s)throw new RangeError('"value" argument is out of bounds');if(n+i>t.length)throw new RangeError("Index out of range")}function O(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return e=+e,r>>>=0,o||O(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return e=+e,r>>>=0,o||O(t,0,r,8),i.write(t,e,r,n,52,8),r+8}e.prototype.slice=function(t,r){var n=this.length;t=~~t,r=void 0===r?n:~~r,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),r<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t);var i=this.subarray(t,r);return i.__proto__=e.prototype,i},e.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},e.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},e.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},e.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},e.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},e.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},e.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},e.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},e.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},e.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},e.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},e.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},e.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),i.read(this,t,!0,23,4)},e.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),i.read(this,t,!1,23,4)},e.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!0,52,8)},e.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!1,52,8)},e.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},e.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},e.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},e.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},e.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},e.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},e.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},e.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},e.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},e.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},e.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},e.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},e.prototype.copy=function(t,r,n,i){if(!e.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var o=i-n;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,n,i);else if(this===t&&n<r&&r<i)for(var s=o-1;s>=0;--s)t[s+r]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,i),r);return o},e.prototype.fill=function(t,r,n,i){if("string"==typeof t){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!e.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var o=t.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(t=o)}}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var s;if(r>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=r;s<n;++s)this[s]=t;else{var a=e.isBuffer(t)?t:e.from(t,i),f=a.length;if(0===f)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<n-r;++s)this[s+r]=a[s%f]}return this};var C=/[^+/0-9A-Za-z-_]/g;function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function T(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function P(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function F(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}}).call(this,t("buffer").Buffer)},{"base64-js":43,buffer:76,ieee754:130}],77:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("stream").Transform,o=t("string_decoder").StringDecoder;function s(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t("inherits")(s,i),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},e.exports=s},{inherits:133,"safe-buffer":194,stream:203,string_decoder:204}],78:[function(t,e,r){(function(t){function e(t){return Object.prototype.toString.call(t)}r.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},r.isBoolean=function(t){return"boolean"==typeof t},r.isNull=function(t){return null===t},r.isNullOrUndefined=function(t){return null==t},r.isNumber=function(t){return"number"==typeof t},r.isString=function(t){return"string"==typeof t},r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=function(t){return void 0===t},r.isRegExp=function(t){return"[object RegExp]"===e(t)},r.isObject=function(t){return"object"==typeof t&&null!==t},r.isDate=function(t){return"[object Date]"===e(t)},r.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},r.isFunction=function(t){return"function"==typeof t},r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t.isBuffer}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":135}],79:[function(t,e,r){(function(r){var n=t("elliptic"),i=t("bn.js");e.exports=function(t){return new s(t)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(t){this.curveType=o[t],this.curveType||(this.curveType={name:t}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function a(t,e,n){Array.isArray(t)||(t=t.toArray());var i=new r(t);if(n&&i.length<n){var o=new r(n-i.length);o.fill(0),i=r.concat([o,i])}return e?i.toString(e):i}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,s.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},s.prototype.computeSecret=function(t,e,n){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),a(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},s.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),a(r,t)},s.prototype.getPrivateKey=function(t){return a(this.keys.getPrivate(),t)},s.prototype.setPublicKey=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.keys._importPublic(t),this},s.prototype.setPrivateKey=function(t,e){e=e||"utf8",r.isBuffer(t)||(t=new r(t,e));var n=new i(t);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this,t("buffer").Buffer)},{"bn.js":44,buffer:76,elliptic:98}],80:[function(t,e,r){"use strict";var n=t("inherits"),i=t("md5.js"),o=t("ripemd160"),s=t("sha.js"),a=t("cipher-base");function f(t){a.call(this,"digest"),this._hash=t}n(f,a),f.prototype._update=function(t){this._hash.update(t)},f.prototype._final=function(){return this._hash.digest()},e.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new f(s(t))}},{"cipher-base":77,inherits:133,"md5.js":137,ripemd160:193,"sha.js":196}],81:[function(t,e,r){var n=t("md5.js");e.exports=function(t){return(new n).update(t).digest()}},{"md5.js":137}],82:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./legacy"),o=t("cipher-base"),s=t("safe-buffer").Buffer,a=t("create-hash/md5"),f=t("ripemd160"),u=t("sha.js"),h=s.alloc(128);function c(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new f:u(t)).update(e).digest():e.length<r&&(e=s.concat([e,h],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),a=0;a<r;a++)n[a]=54^e[a],i[a]=92^e[a];this._hash="rmd160"===t?new f:u(t),this._hash.update(n)}n(c,o),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new f:u(this._alg)).update(this._opad).update(t).digest()},e.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new c("rmd160",e):"md5"===t?new i(a,e):new c(t,e)}},{"./legacy":83,"cipher-base":77,"create-hash/md5":81,inherits:133,ripemd160:193,"safe-buffer":194,"sha.js":196}],83:[function(t,e,r){"use strict";var n=t("inherits"),i=t("safe-buffer").Buffer,o=t("cipher-base"),s=i.alloc(128),a=64;function f(t,e){o.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>a?e=t(e):e.length<a&&(e=i.concat([e,s],a));for(var r=this._ipad=i.allocUnsafe(a),n=this._opad=i.allocUnsafe(a),f=0;f<a;f++)r[f]=54^e[f],n[f]=92^e[f];this._hash=[r]}n(f,o),f.prototype._update=function(t){this._hash.push(t)},f.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},e.exports=f},{"cipher-base":77,inherits:133,"safe-buffer":194}],84:[function(t,e,r){"use strict";r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=t("randombytes"),r.createHash=r.Hash=t("create-hash"),r.createHmac=r.Hmac=t("create-hmac");var n=t("browserify-sign/algos"),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);r.getHashes=function(){return o};var s=t("pbkdf2");r.pbkdf2=s.pbkdf2,r.pbkdf2Sync=s.pbkdf2Sync;var a=t("browserify-cipher");r.Cipher=a.Cipher,r.createCipher=a.createCipher,r.Cipheriv=a.Cipheriv,r.createCipheriv=a.createCipheriv,r.Decipher=a.Decipher,r.createDecipher=a.createDecipher,r.Decipheriv=a.Decipheriv,r.createDecipheriv=a.createDecipheriv,r.getCiphers=a.getCiphers,r.listCiphers=a.listCiphers;var f=t("diffie-hellman");r.DiffieHellmanGroup=f.DiffieHellmanGroup,r.createDiffieHellmanGroup=f.createDiffieHellmanGroup,r.getDiffieHellman=f.getDiffieHellman,r.createDiffieHellman=f.createDiffieHellman,r.DiffieHellman=f.DiffieHellman;var u=t("browserify-sign");r.createSign=u.createSign,r.Sign=u.Sign,r.createVerify=u.createVerify,r.Verify=u.Verify,r.createECDH=t("create-ecdh");var h=t("public-encrypt");r.publicEncrypt=h.publicEncrypt,r.privateEncrypt=h.privateEncrypt,r.publicDecrypt=h.publicDecrypt,r.privateDecrypt=h.privateDecrypt;var c=t("randomfill");r.randomFill=c.randomFill,r.randomFillSync=c.randomFillSync,r.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},r.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":64,"browserify-sign":71,"browserify-sign/algos":68,"create-ecdh":79,"create-hash":80,"create-hmac":82,"diffie-hellman":94,pbkdf2:158,"public-encrypt":165,randombytes:176,randomfill:177}],85:[function(t,e,r){(function(t){e.exports=class{constructor(e=100){this.size=e,this.length=0,this.buf=t.alloc(e)}prepend(t){const e=this.length++;e===this.size&&this.resize();const r=this.clone();this.buf[0]=t,r.copy(this.buf,1,0,e)}append(t){const e=this.length++;e===this.size&&this.resize(),this.buf[e]=t}clone(){return t.from(this.buf.slice(0,this.length))}resize(){const e=this.length;this.size=2*this.size;const r=t.alloc(this.size);this.buf.copy(r,0,0,e),this.buf=r}toString(){return this.buf.slice(0,this.length).toString()}toJSON(){return this.toString()}reset(){this.length=0}}}).call(this,t("buffer").Buffer)},{buffer:76}],86:[function(t,e,r){(function(r,n){const{Transform:i}=t("stream"),o=t("./ResizeableBuffer"),s=13,a=10,f=32,u=9,h=r.from([239,187,191]);class c extends i{constructor(t={}){super({...{readableObjectMode:!0},...t});const e={};for(let r in t)e[p(r)]=t[r];if(void 0===e.bom||null===e.bom||!1===e.bom)e.bom=!1;else if(!0!==e.bom)throw new d("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`]);let n=null;if(void 0===e.cast||null===e.cast||!1===e.cast||""===e.cast)e.cast=void 0;else if("function"==typeof e.cast)n=e.cast,e.cast=!0;else if(!0!==e.cast)throw new d("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`]);if(void 0===e.cast_date||null===e.cast_date||!1===e.cast_date||""===e.cast_date)e.cast_date=!1;else if(!0===e.cast_date)e.cast_date=function(t){const e=Date.parse(t);return isNaN(e)?t:new Date(e)};else if("function"!=typeof e.cast_date)throw new d("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`]);let i=null;if(!0===e.columns)i=void 0;else if("function"==typeof e.columns)i=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=g(e.columns);else{if(void 0!==e.columns&&null!==e.columns&&!1!==e.columns)throw new d("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an object, a function or true,",`got ${JSON.stringify(e.columns)}`]);e.columns=!1}if(void 0===e.comment||null===e.comment||!1===e.comment||""===e.comment)e.comment=null;else if("string"==typeof e.comment&&(e.comment=r.from(e.comment)),!r.isBuffer(e.comment))throw new d("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`]);if(void 0===e.delimiter||null===e.delimiter||!1===e.delimiter)e.delimiter=r.from(",");else if("string"==typeof e.delimiter&&0!==e.delimiter.length)e.delimiter=r.from(e.delimiter);else if(r.isBuffer(e.delimiter)&&0===e.delimiter.length||"string"==typeof e.delimiter&&0===e.delimiter.length||!r.isBuffer(e.delimiter)&&"string"!=typeof e.delimiter)throw new d("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer,",`got ${JSON.stringify(e.delimiter)}`]);if(void 0===e.escape||null===e.escape?e.escape=r.from('"'):"string"==typeof e.escape&&(e.escape=r.from(e.escape)),!r.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(e.escape)}`);if(1!==e.escape.length)throw new Error(`Invalid Option Length: escape must be one character, got ${e.escape.length}`);if(e.escape=e.escape[0],void 0===e.from||null===e.from)e.from=1;else{if("string"==typeof e.from&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),!Number.isInteger(e.from))throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(t.from)}`)}if(void 0===e.from_line||null===e.from_line)e.from_line=1;else{if("string"==typeof e.from_line&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),!Number.isInteger(e.from_line))throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(t.from_line)}`);if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(t.from_line)}`)}if(void 0===e.info||null===e.info||!1===e.info)e.info=!1;else if(!0!==e.info)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(void 0===e.max_record_size||null===e.max_record_size||!1===e.max_record_size)e.max_record_size=0;else if(Number.isInteger(e.max_record_size)&&e.max_record_size>=0);else{if("string"!=typeof e.max_record_size||!/\d+/.test(e.max_record_size))throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);e.max_record_size=parseInt(e.max_record_size)}if(void 0===e.objname||null===e.objname||!1===e.objname)e.objname=void 0;else if(r.isBuffer(e.objname)){if(0===e.objname.length)throw new Error("Invalid Option: objname must be a non empty buffer");e.objname=e.objname.toString()}else{if("string"!=typeof e.objname)throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(0===e.objname.length)throw new Error("Invalid Option: objname must be a non empty string")}if(void 0===e.on_record||null===e.on_record)e.on_record=void 0;else if("function"!=typeof e.on_record)throw new d("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`]);if(null===e.quote||!1===e.quote||""===e.quote)e.quote=null;else{if(void 0===e.quote||!0===e.quote?e.quote=r.from('"'):"string"==typeof e.quote&&(e.quote=r.from(e.quote)),!r.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(1!==e.quote.length)throw new Error(`Invalid Option Length: quote must be one character, got ${e.quote.length}`);e.quote=e.quote[0]}if(void 0===e.raw||null===e.raw||!1===e.raw)e.raw=!1;else if(!0!==e.raw)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter?Array.isArray(e.record_delimiter)||(e.record_delimiter=[e.record_delimiter]):e.record_delimiter=[],e.record_delimiter=e.record_delimiter.map(function(t){return"string"==typeof t&&(t=r.from(t)),t}),"boolean"==typeof e.relax);else{if(void 0!==e.relax&&null!==e.relax)throw new Error(`Invalid Option: relax must be a boolean, got ${JSON.stringify(e.relax)}`);e.relax=!1}if("boolean"==typeof e.relax_column_count);else{if(void 0!==e.relax_column_count&&null!==e.relax_column_count)throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);e.relax_column_count=!1}if("boolean"==typeof e.relax_column_count_less);else{if(void 0!==e.relax_column_count_less&&null!==e.relax_column_count_less)throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);e.relax_column_count_less=!1}if("boolean"==typeof e.relax_column_count_more);else{if(void 0!==e.relax_column_count_more&&null!==e.relax_column_count_more)throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);e.relax_column_count_more=!1}if("boolean"==typeof e.skip_empty_lines);else{if(void 0!==e.skip_empty_lines&&null!==e.skip_empty_lines)throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);e.skip_empty_lines=!1}if("boolean"==typeof e.skip_lines_with_empty_values);else{if(void 0!==e.skip_lines_with_empty_values&&null!==e.skip_lines_with_empty_values)throw new Error(`Invalid Option: skip_lines_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_lines_with_empty_values)}`);e.skip_lines_with_empty_values=!1}if("boolean"==typeof e.skip_lines_with_error);else{if(void 0!==e.skip_lines_with_error&&null!==e.skip_lines_with_error)throw new Error(`Invalid Option: skip_lines_with_error must be a boolean, got ${JSON.stringify(e.skip_lines_with_error)}`);e.skip_lines_with_error=!1}if(void 0===e.rtrim||null===e.rtrim||!1===e.rtrim)e.rtrim=!1;else if(!0!==e.rtrim)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(void 0===e.ltrim||null===e.ltrim||!1===e.ltrim)e.ltrim=!1;else if(!0!==e.ltrim)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(void 0===e.trim||null===e.trim||!1===e.trim)e.trim=!1;else if(!0!==e.trim)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(!0===e.trim&&!1!==t.ltrim?e.ltrim=!0:!0!==e.ltrim&&(e.ltrim=!1),!0===e.trim&&!1!==t.rtrim?e.rtrim=!0:!0!==e.rtrim&&(e.rtrim=!1),void 0===e.to||null===e.to)e.to=-1;else{if("string"==typeof e.to&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),!Number.isInteger(e.to))throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(t.to)}`);if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(t.to)}`)}if(void 0===e.to_line||null===e.to_line)e.to_line=-1;else{if("string"==typeof e.to_line&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),!Number.isInteger(e.to_line))throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(t.to_line)}`);if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(t.to_line)}`)}this.info={comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},this.options=e,this.state={bomSkipped:!1,castField:n,commenting:!1,enabled:1===e.from_line,escaping:!1,escapeIsQuote:e.escape===e.quote,expectedRecordLength:null===e.columns?0:e.columns.length,field:new o(20),firstLineToHeaders:i,info:Object.assign({},this.info),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new o(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:0===e.record_delimiter.length?2:Math.max(...e.record_delimiter.map(t=>t.length)),trimChars:[r.from(" ")[0],r.from("\t")[0]],wasQuoting:!1,wasRowDelimiter:!1}}_transform(t,e,r){if(!0===this.state.stop)return;const n=this.__parse(t,!1);void 0!==n&&(this.state.stop=!0),r(n)}_flush(t){if(!0===this.state.stop)return;t(this.__parse(void 0,!0))}__parse(t,e){const{bom:n,comment:i,escape:o,from_line:f,info:u,ltrim:c,max_record_size:l,quote:p,raw:m,relax:b,rtrim:g,skip_empty_lines:v,to:y,to_line:w}=this.options;let{record_delimiter:_}=this.options;const{bomSkipped:x,previousBuf:M,rawBuffer:S,escapeIsQuote:E}=this.state;let k;if(void 0===M){if(void 0===t)return void this.push(null);k=t}else k=void 0!==M&&void 0===t?M:r.concat([M,t]);if(!1===x)if(!1===n)this.state.bomSkipped=!0;else if(k.length<3){if(!1===e)return void(this.state.previousBuf=k)}else 0===h.compare(k,0,3)&&(k=k.slice(3)),this.state.bomSkipped=!0;const A=k.length;let j;for(j=0;j<A&&!this.__needMoreData(j,A,e);j++){if(!0===this.state.wasRowDelimiter&&(this.info.lines++,!0===u&&0===this.state.record.length&&0===this.state.field.length&&!1===this.state.wasQuoting&&(this.state.info=Object.assign({},this.info)),this.state.wasRowDelimiter=!1),-1!==w&&this.info.lines>w)return this.state.stop=!0,void this.push(null);if(!1===this.state.quoting&&0===_.length){this.__autoDiscoverRowDelimiter(k,j)&&(_=this.options.record_delimiter)}const t=k[j];if(!0===m&&S.append(t),t!==s&&t!==a||!1!==this.state.wasRowDelimiter||(this.state.wasRowDelimiter=!0),!0===this.state.escaping)this.state.escaping=!1;else{if(!0===this.state.quoting&&t===o&&j+1<A){if(!E){this.state.escaping=!0;continue}if(k[j+1]===p){this.state.escaping=!0;continue}}if(!1===this.state.commenting&&t===p)if(!0===this.state.quoting){const e=k[j+1],r=g&&this.__isCharTrimable(e),n=null!==i&&this.__compareBytes(i,k,j+1,e),s=this.__isDelimiter(e,k,j+1),a=0===_.length?this.__autoDiscoverRowDelimiter(k,j+1):this.__isRecordDelimiter(e,k,j+1);if(t===o&&e===p)j++;else{if(!e||s||a||n||r){this.state.quoting=!1,this.state.wasQuoting=!0;continue}if(!1===b){const t=this.__error(new d("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(e)}"`,`at line ${this.info.lines}`,"instead of delimiter, row delimiter, trimable character","(if activated) or comment"],this.__context()));if(void 0!==t)return t}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(p)}}else{if(0===this.state.field.length){this.state.quoting=!0;continue}if(!1===b){const t=this.__error(new d("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found inside a field at line ${this.info.lines}`],this.__context(),{field:this.state.field}));if(void 0!==t)return t}}if(!1===this.state.quoting){let e=this.__isRecordDelimiter(t,k,j);if(0!==e){if(this.state.commenting&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length)this.info.comment_lines++;else{if(!0===v&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length){this.info.empty_lines++,j+=e-1;continue}if(!1===this.state.enabled&&this.info.lines+(!0===this.state.wasRowDelimiter?1:0)>=f){this.state.enabled=!0,this.__resetField(),this.__resetRow(),j+=e-1;continue}{const t=this.__onField();if(void 0!==t)return t;const e=this.__onRow();if(void 0!==e)return e}if(-1!==y&&this.info.records>=y)return this.state.stop=!0,void this.push(null)}this.state.commenting=!1,j+=e-1;continue}if(this.state.commenting)continue;if(0!==(null===i?0:this.__compareBytes(i,k,j,t))){this.state.commenting=!0;continue}let r=this.__isDelimiter(t,k,j);if(0!==r){const t=this.__onField();if(void 0!==t)return t;j+=r-1;continue}}}if(!1===this.state.commenting&&0!==l&&this.state.record_length+this.state.field.length>l){const t=this.__error(new d("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${l}`,`at line ${this.info.lines}`],this.__context()));if(void 0!==t)return t}const e=!1===c||!0===this.state.quoting||0!==this.state.field.length||!this.__isCharTrimable(t),r=!1===g||!1===this.state.wasQuoting;if(!0===e&&!0===r)this.state.field.append(t);else if(!0===g&&!this.__isCharTrimable(t)){const t=this.__error(new d("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.__context()));if(void 0!==t)return t}}if(!0===e)if(!0===this.state.quoting){const t=this.__error(new d("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.__context()));if(void 0!==t)return t}else if(!0===this.state.wasQuoting||0!==this.state.record.length||0!==this.state.field.length){const t=this.__onField();if(void 0!==t)return t;const e=this.__onRow();if(void 0!==e)return e}else!0===this.state.wasRowDelimiter?this.info.empty_lines++:!0===this.state.commenting&&this.info.comment_lines++;else this.state.previousBuf=k.slice(j);!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1)}__isCharTrimable(t){return t===f||t===u||t===s||t===a}__onRow(){const{columns:t,info:e,from:r,relax_column_count:n,relax_column_count_less:i,relax_column_count_more:o,raw:s,skip_lines_with_empty_values:a}=this.options,{enabled:f,record:u}=this.state;if(!1===f)return this.__resetRow();const h=u.length;if(!0===t)return b(u)?void this.__resetRow():this.__firstLineToColumns(u);if(!1===t&&0===this.info.records&&(this.state.expectedRecordLength=h),h!==this.state.expectedRecordLength)if(!0===n||!0===i&&h<this.state.expectedRecordLength||!0===o&&h>this.state.expectedRecordLength)this.info.invalid_field_length++;else if(!1===t){const t=this.__error(new d("CSV_INCONSISTENT_RECORD_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${h} on line ${this.info.lines}`],this.__context(),{record:u}));if(void 0!==t)return t}else{const e=this.__error(new d("CSV_RECORD_DONT_MATCH_COLUMNS_LENGTH",["Invalid Record Length:",`columns length is ${t.length},`,`got ${h} on line ${this.info.lines}`],this.__context(),{record:u}));if(void 0!==e)return e}if(!0===a&&b(u))this.__resetRow();else{if(!0===this.state.recordHasError)return this.__resetRow(),void(this.state.recordHasError=!1);if(this.info.records++,1===r||this.info.records>=r)if(!1!==t){const r={};for(let e in u)void 0===t[e]||t[e].disabled||(r[t[e].name]=u[e]);const{objname:n}=this.options;if(void 0===n)if(!0===s||!0===e){const t=this.__push(Object.assign({record:r},!0===s?{raw:this.state.rawBuffer.toString()}:{},!0===e?{info:this.state.info}:{}));if(t)return t}else{const t=this.__push(r);if(t)return t}else if(!0===s||!0===e){const t=this.__push(Object.assign({record:[r[n],r]},!0===s?{raw:this.state.rawBuffer.toString()}:{},!0===e?{info:this.state.info}:{}));if(t)return t}else{const t=this.__push([r[n],r]);if(t)return t}}else if(!0===s||!0===e){const t=this.__push(Object.assign({record:u},!0===s?{raw:this.state.rawBuffer.toString()}:{},!0===e?{info:this.state.info}:{}));if(t)return t}else{const t=this.__push(u);if(t)return t}this.__resetRow()}}__firstLineToColumns(t){const{firstLineToHeaders:e}=this.state;try{const r=void 0===e?t:e.call(null,t);if(!Array.isArray(r))return this.__error(new d("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(r)}`],this.__context(),{headers:r}));const n=g(r);return this.state.expectedRecordLength=n.length,this.options.columns=n,void this.__resetRow()}catch(t){return t}}__resetRow(){!0===this.options.raw&&this.state.rawBuffer.reset(),this.state.record=[],this.state.record_length=0}__onField(){const{cast:t,rtrim:e,max_record_size:r}=this.options,{enabled:n,wasQuoting:i}=this.state;if(!1===n)return this.__resetField();let o=this.state.field.toString();if(!0===e&&!1===i&&(o=o.trimRight()),!0===t){const[t,e]=this.__cast(o);if(void 0!==t)return t;o=e}this.state.record.push(o),0!==r&&"string"==typeof o&&(this.state.record_length+=o.length),this.__resetField()}__resetField(){this.state.field.reset(),this.state.wasQuoting=!1}__push(t){const{on_record:e}=this.options;if(void 0!==e){const r=this.__context();try{t=e.call(null,t,r)}catch(t){return t}if(void 0===t||null===t)return}this.push(t)}__cast(t){const{columns:e,relax_column_count:r}=this.options;if(!0===Array.isArray(e)&&r&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];const n=this.__context();if(null!==this.state.castField)try{return[void 0,this.state.castField.call(null,t,n)]}catch(t){return[t]}return this.__isFloat(t)?[void 0,parseFloat(t)]:!1!==this.options.cast_date?[void 0,this.options.cast_date.call(null,t,n)]:[void 0,t]}__isFloat(t){return t-parseFloat(t)+1>=0}__compareBytes(t,e,r,n){if(t[0]!==n)return 0;const i=t.length;for(let n=1;n<i;n++)if(t[n]!==e[r+n])return 0;return i}__needMoreData(t,e,r){if(r)return!1;const{comment:n,delimiter:i}=this.options,{quoting:o,recordDelimiterMaxLength:s}=this.state;return e-t-1<Math.max(n?n.length:0,s,o?1+s:0,i.length,1)}__isDelimiter(t,e,r){const{delimiter:n}=this.options,i=n.length;if(n[0]!==t)return 0;for(let t=1;t<i;t++)if(n[t]!==e[r+t])return 0;return n.length}__isRecordDelimiter(t,e,r){const{record_delimiter:n}=this.options,i=n.length;t:for(let o=0;o<i;o++){const i=n[o],s=i.length;if(i[0]===t){for(let t=1;t<s;t++)if(i[t]!==e[r+t])continue t;return i.length}}return 0}__autoDiscoverRowDelimiter(t,e){const n=t[e];return n===s?t[e+1]===a?(this.options.record_delimiter.push(r.from("\r\n")),this.state.recordDelimiterMaxLength=2,2):(this.options.record_delimiter.push(r.from("\r")),this.state.recordDelimiterMaxLength=1,1):n===a?(this.options.record_delimiter.push(r.from("\n")),this.state.recordDelimiterMaxLength=1,1):0}__error(t){const{skip_lines_with_error:e}=this.options,r="string"==typeof t?new Error(t):t;return e?(this.state.recordHasError=!0,void this.emit("skip",r)):r}__context(){const{columns:t}=this.options;return{column:!0===Array.isArray(t)?t.length>this.state.record.length?t[this.state.record.length].name:null:this.state.record.length,empty_lines:this.info.empty_lines,header:!0===t,index:this.state.record.length,invalid_field_length:this.info.invalid_field_length,quoting:this.state.wasQuoting,lines:this.info.lines,records:this.info.records}}}const l=function(){let t,e,i;for(let n in arguments){const o=arguments[n],s=typeof o;if(void 0!==t||"string"!=typeof o&&!r.isBuffer(o))if(void 0===e&&m(o))e=o;else{if(void 0!==i||"function"!==s)throw new d("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(o)} at index ${n}`]);i=o}else t=o}const o=new c(e);if(i){const t=void 0===e||void 0===e.objname?[]:{};o.on("readable",function(){let r;for(;null!==(r=this.read());)void 0===e||void 0===e.objname?t.push(r):t[r[0]]=r[1]}),o.on("error",function(t){i(t,void 0,o.info)}),o.on("end",function(){i(void 0,t,o.info)})}return void 0!==t&&("function"==typeof n?n(function(){o.write(t),o.end()}):(o.write(t),o.end())),o};class d extends Error{constructor(t,e,...n){Array.isArray(e)&&(e=e.join(" ")),super(e),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,d),this.code=t;for(const t of n)for(const e in t){const n=t[e];this[e]=r.isBuffer(n)?n.toString():null==n?n:JSON.parse(JSON.stringify(n))}}}l.Parser=c,l.CsvError=d,e.exports=l;const p=function(t){return t.replace(/([A-Z])/g,function(t,e){return"_"+e.toLowerCase()})},m=function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)},b=function(t){return t.every(t=>null==t||t.toString&&""===t.toString().trim())},g=function(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r];if(void 0===n||null===n||!1===n)e[r]={disabled:!0};else if("string"==typeof n)e[r]={name:n};else{if(!m(n))throw new d("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${r}`]);if("string"!=typeof n.name)throw new d("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${r}`,"when column is an object literal"]);e[r]=n}}return e}}).call(this,t("buffer").Buffer,t("timers").setImmediate)},{"./ResizeableBuffer":85,buffer:76,stream:203,timers:205}],87:[function(t,e,r){(function(r){const n=t(".");e.exports=function(t,e={}){"string"==typeof t&&(t=r.from(t));const i=e&&e.objname?{}:[],o=new n.Parser(e);o.push=function(t){void 0===e.objname?i.push(t):i[t[0]]=t[1]};const s=o.__parse(t,!1);if(void 0!==s)throw s;const a=o.__parse(void 0,!0);if(void 0!==a)throw a;return i}}).call(this,t("buffer").Buffer)},{".":86,buffer:76}],88:[function(t,e,r){"use strict";r.utils=t("./des/utils"),r.Cipher=t("./des/cipher"),r.DES=t("./des/des"),r.CBC=t("./des/cbc"),r.EDE=t("./des/ede")},{"./des/cbc":89,"./des/cipher":90,"./des/des":91,"./des/ede":92,"./des/utils":93}],89:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits"),o={};r.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new function(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];o._update.call(this,s,0,r,n);for(a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{o._update.call(this,t,e,r,n);for(a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},{inherits:133,"minimalistic-assert":139}],90:[function(t,e,r){"use strict";var n=t("minimalistic-assert");function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},{"minimalistic-assert":139}],91:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits"),o=t("./utils"),s=t("./cipher");function a(t){s.call(this,t);var e=new function(){this.tmp=new Array(2),this.keys=null};this._desState=e,this.deriveKeys(e,t.key)}i(a,s),e.exports=a,a.create=function(t){return new a(t)};var f=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];a.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=f[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,t.keys,s)}},a.prototype._update=function(t,e,r,n){var i=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},a.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},a.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},a.prototype._encrypt=function(t,e,r,n,i){for(var s=e,a=r,f=0;f<t.keys.length;f+=2){var u=t.keys[f],h=t.keys[f+1];o.expand(a,t.tmp,0),u^=t.tmp[0],h^=t.tmp[1];var c=o.substitute(u,h),l=a;a=(s^o.permute(c))>>>0,s=l}o.rip(a,s,n,i)},a.prototype._decrypt=function(t,e,r,n,i){for(var s=r,a=e,f=t.keys.length-2;f>=0;f-=2){var u=t.keys[f],h=t.keys[f+1];o.expand(s,t.tmp,0),u^=t.tmp[0],h^=t.tmp[1];var c=o.substitute(u,h),l=s;s=(a^o.permute(c))>>>0,a=l}o.rip(s,a,n,i)}},{"./cipher":90,"./utils":93,inherits:133,"minimalistic-assert":139}],92:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits"),o=t("./cipher"),s=t("./des");function a(t){o.call(this,t);var e=new function(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}(this.type,this.options.key);this._edeState=e}i(a,o),e.exports=a,a.create=function(t){return new a(t)},a.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},a.prototype._pad=s.prototype._pad,a.prototype._unpad=s.prototype._unpad},{"./cipher":90,"./des":91,inherits:133,"minimalistic-assert":139}],93:[function(t,e,r){"use strict";r.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},r.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},r.ip=function(t,e,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},r.rip=function(t,e,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+s&1,i<<=1,i|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.pc1=function(t,e,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(t,e,r,i){for(var o=0,s=0,a=n.length>>>1,f=0;f<a;f++)o<<=1,o|=t>>>n[f]&1;for(f=a;f<n.length;f++)s<<=1,s|=e>>>n[f]&1;r[i+0]=o>>>0,r[i+1]=s>>>0},r.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(t,e){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(t>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(t){for(var e=0,r=0;r<o.length;r++)e<<=1,e|=t>>>o[r]&1;return e>>>0},r.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],o=0;o<e;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},{}],94:[function(t,e,r){(function(e){var n=t("./lib/generatePrime"),i=t("./lib/primes.json"),o=t("./lib/dh");var s={binary:!0,hex:!0,base64:!0};r.DiffieHellmanGroup=r.createDiffieHellmanGroup=r.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new o(r,n)},r.createDiffieHellman=r.DiffieHellman=function t(r,i,a,f){return e.isBuffer(i)||void 0===s[i]?t(r,"binary",i,a):(i=i||"binary",f=f||"binary",a=a||new e([2]),e.isBuffer(a)||(a=new e(a,f)),"number"==typeof r?new o(n(r,a),a,!0):(e.isBuffer(r)||(r=new e(r,i)),new o(r,a,!0)))}}).call(this,t("buffer").Buffer)},{"./lib/dh":95,"./lib/generatePrime":96,"./lib/primes.json":97,buffer:76}],95:[function(t,e,r){(function(r){var n=t("bn.js"),i=new(t("miller-rabin")),o=new n(24),s=new n(11),a=new n(10),f=new n(3),u=new n(7),h=t("./generatePrime"),c=t("randombytes");function l(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._pub=new n(t),this}function d(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._priv=new n(t),this}e.exports=m;var p={};function m(t,e,r){this.setGenerator(e),this.__prime=new n(t),this._prime=n.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=l,this.setPrivateKey=d):this._primeCode=8}function b(t,e){var n=new r(t.toArray());return e?n.toString(e):n}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in p)return p[n];var c,l=0;if(t.isEven()||!h.simpleSieve||!h.fermatTest(t)||!i.test(t))return l+=1,l+="02"===r||"05"===r?8:4,p[n]=l,l;switch(i.test(t.shrn(1))||(l+=2),r){case"02":t.mod(o).cmp(s)&&(l+=8);break;case"05":(c=t.mod(a)).cmp(f)&&c.cmp(u)&&(l+=8);break;default:l+=4}return p[n]=l,l}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new n(c(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(t){var e=(t=(t=new n(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new r(e.toArray()),o=this.getPrime();if(i.length<o.length){var s=new r(o.length-i.length);s.fill(0),i=r.concat([s,i])}return i},m.prototype.getPublicKey=function(t){return b(this._pub,t)},m.prototype.getPrivateKey=function(t){return b(this._priv,t)},m.prototype.getPrime=function(t){return b(this.__prime,t)},m.prototype.getGenerator=function(t){return b(this._gen,t)},m.prototype.setGenerator=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.__gen=t,this._gen=new n(t),this}}).call(this,t("buffer").Buffer)},{"./generatePrime":96,"bn.js":44,buffer:76,"miller-rabin":138,randombytes:176}],96:[function(t,e,r){var n=t("randombytes");e.exports=v,v.simpleSieve=b,v.fermatTest=g;var i=t("bn.js"),o=new i(24),s=new(t("miller-rabin")),a=new i(1),f=new i(2),u=new i(5),h=(new i(16),new i(8),new i(10)),c=new i(3),l=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function m(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<e&&t[i]<=n&&r%t[i]!=0;i++);e!==i&&t[i]<=n||(t[e++]=r)}return p=t,t}function b(t){for(var e=m(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function g(t){var e=i.mont(t);return 0===f.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function v(t,e){if(t<16)return new i(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new i(e);;){for(r=new i(n(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(f),e.cmp(f)){if(!e.cmp(u))for(;r.mod(h).cmp(c);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(b(p=r.shrn(1))&&b(r)&&g(p)&&g(r)&&s.test(p)&&s.test(r))return r}}},{"bn.js":44,"miller-rabin":138,randombytes:176}],97:[function(t,e,r){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],98:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":113,"./elliptic/curve":101,"./elliptic/curves":104,"./elliptic/ec":105,"./elliptic/eddsa":108,"./elliptic/utils":112,brorand:45}],99:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.getNAF,s=i.getJSF,a=i.assert;function f(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}e.exports=f,f.prototype.point=function(){throw new Error("Not implemented")},f.prototype.validate=function(){throw new Error("Not implemented")},f.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var s=[],f=0;f<n.length;f+=r.step){var u=0;for(e=f+r.step-1;e>=f;e--)u=(u<<1)+n[e];s.push(u)}for(var h=this.jpoint(null,null,null),c=this.jpoint(null,null,null),l=i;l>0;l--){for(f=0;f<s.length;f++){(u=s[f])===l?c=c.mixedAdd(r.points[f]):u===-l&&(c=c.mixedAdd(r.points[f].neg()))}h=h.add(c)}return h.toP()},f.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),f=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(e=0;u>=0&&0===s[u];u--)e++;if(u>=0&&e++,f=f.dblp(e),u<0)break;var h=s[u];a(0!==h),f="affine"===t.type?h>0?f.mixedAdd(i[h-1>>1]):f.mixedAdd(i[-h-1>>1].neg()):h>0?f.add(i[h-1>>1]):f.add(i[-h-1>>1].neg())}return"affine"===t.type?f.toP():f},f.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,h=0,c=0;c<n;c++){var l=(E=e[c])._getNAFPoints(t);a[c]=l.wnd,f[c]=l.points}for(c=n-1;c>=1;c-=2){var d=c-1,p=c;if(1===a[d]&&1===a[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],g=s(r[d],r[p]);h=Math.max(g[0].length,h),u[d]=new Array(h),u[p]=new Array(h);for(var v=0;v<h;v++){var y=0|g[0][v],w=0|g[1][v];u[d][v]=b[3*(y+1)+(w+1)],u[p][v]=0,f[d]=m}}else u[d]=o(r[d],a[d],this._bitLength),u[p]=o(r[p],a[p],this._bitLength),h=Math.max(u[d].length,h),h=Math.max(u[p].length,h)}var _=this.jpoint(null,null,null),x=this._wnafT4;for(c=h;c>=0;c--){for(var M=0;c>=0;){var S=!0;for(v=0;v<n;v++)x[v]=0|u[v][c],0!==x[v]&&(S=!1);if(!S)break;M++,c--}if(c>=0&&M++,_=_.dblp(M),c<0)break;for(v=0;v<n;v++){var E,k=x[v];0!==k&&(k>0?E=f[v][k-1>>1]:k<0&&(E=f[v][-k-1>>1].neg()),_="affine"===E.type?_.mixedAdd(E):_.add(E))}}for(c=0;c<n;c++)f[c]=null;return i?_:_.toP()},f.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},f.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},u.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},u.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},u.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},u.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},{"../utils":112,"bn.js":44}],100:[function(t,e,r){"use strict";var n=t("../utils"),i=t("bn.js"),o=t("inherits"),s=t("./base"),a=n.assert;function f(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(f,s),e.exports=f,f.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},f.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},f.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},f.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var f=a.fromRed().isOdd();return(e&&!f||!e&&f)&&(a=a.redNeg()),this.point(t,a)},f.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},f.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(u,s.BasePoint),f.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},f.prototype.point=function(t,e,r,n){return new u(this,t,e,r,n)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),f=i.redMul(s),u=o.redMul(a),h=i.redMul(a),c=s.redMul(o);return this.curve.point(f,u,c,h)},u.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(u.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),f=s.redSub(a).redISub(a);t=n.redSub(i).redISub(o).redMul(f),e=s.redMul(u.redSub(o)),r=s.redMul(f)}}else{var u=i.redAdd(o);a=this.curve._mulC(this.z).redSqr(),f=u.redSub(a).redSub(a);t=this.curve._mulC(n.redISub(u)).redMul(f),e=this.curve._mulC(u).redMul(i.redISub(o)),r=u.redMul(f)}return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),f=r.redAdd(e),u=o.redMul(s),h=a.redMul(f),c=o.redMul(f),l=s.redMul(a);return this.curve.point(u,h,l,c)},u.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),f=i.redSub(a),u=i.redAdd(a),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),c=n.redMul(f).redMul(h);return this.curve.twisted?(e=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=f.redMul(u)):(e=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(f).redMul(u)),this.curve.point(c,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},{"../utils":112,"./base":99,"bn.js":44,inherits:133}],101:[function(t,e,r){"use strict";var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":99,"./edwards":100,"./mont":102,"./short":103}],102:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("inherits"),o=t("./base"),s=t("../utils");function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(f,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new f(this,t,e)},a.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(t,e){return new f(t,e[0],e[1]||t.one)},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),f=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,f)},f.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":112,"./base":99,"bn.js":44,inherits:133}],103:[function(t,e,r){"use strict";var n=t("../utils"),i=t("bn.js"),o=t("inherits"),s=t("./base"),a=n.assert;function f(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(f,s),e.exports=f,f.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map(function(t){return{a:new i(t.a,16),b:new i(t.b,16)}}):this._getEndoBasis(r)}}},f.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},f.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,f,u,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new i(1),m=new i(0),b=new i(0),g=new i(1),v=0;0!==l.cmpn(0);){var y=d.div(l);u=d.sub(y.mul(l)),h=b.sub(y.mul(p));var w=g.sub(y.mul(m));if(!n&&u.cmp(c)<0)e=f.neg(),r=p,n=u.neg(),o=h;else if(n&&2==++v)break;f=u,d=l,l=u,b=p,p=h,g=m,m=w}s=u.neg(),a=h;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},f.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),f=i.mul(r.b),u=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:f.add(u).neg()}},f.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},f.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],f=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),n[2*o]=a,n[2*o+1]=f,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),h=0;h<2*o;h++)n[h]=null,i[h]=null;return u},o(u,s.BasePoint),f.prototype.point=function(t,e,r){return new u(this,t,e,r)},f.prototype.pointFromJSON=function(t,e){return u.fromJSON(this,t,e)},u.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,s.BasePoint),f.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),f=o.redSub(s);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),h=u.redMul(a),c=n.redMul(u),l=f.redSqr().redIAdd(h).redISub(c).redISub(c),d=f.redMul(c.redISub(l)).redISub(o.redMul(h)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),u=f.redMul(s),h=r.redMul(f),c=a.redSqr().redIAdd(u).redISub(h).redISub(h),l=a.redMul(h.redISub(c)).redISub(i.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(c,l,d)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,f=a.redSqr().redSqr(),u=s.redAdd(s);for(r=0;r<t;r++){var h=o.redSqr(),c=u.redSqr(),l=c.redSqr(),d=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(f)),p=o.redMul(c),m=d.redSqr().redISub(p.redAdd(p)),b=p.redISub(m),g=d.redMul(b);g=g.redIAdd(g).redISub(l);var v=u.redMul(a);r+1<t&&(f=f.redMul(l)),o=m,a=v,u=g}return this.curve.jpoint(o,u.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),f=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=f,e=a.redMul(s.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),c=this.y.redSqr(),l=c.redSqr(),d=this.x.redAdd(c).redSqr().redISub(h).redISub(l);d=d.redIAdd(d);var p=h.redAdd(h).redIAdd(h),m=p.redSqr(),b=l.redIAdd(l);b=(b=b.redIAdd(b)).redIAdd(b),t=m.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(b),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},h.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=a.redSqr().redISub(s).redISub(s);t=f;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=a.redMul(s.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),c=this.y.redSqr(),l=this.x.redMul(c),d=this.x.redSub(h).redMul(this.x.redAdd(h));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),m=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(h);var b=c.redSqr();b=(b=(b=b.redIAdd(b)).redIAdd(b)).redIAdd(b),e=d.redMul(p.redISub(t)).redISub(b)}return this.curve.jpoint(t,e,r)},h.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),f=e.redAdd(e),u=(f=f.redIAdd(f)).redMul(s),h=a.redSqr().redISub(u.redAdd(u)),c=u.redISub(h),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(c).redISub(l),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,d,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),f=n.redIAdd(n);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(f),h=e.redMul(u);h=(h=h.redIAdd(h)).redIAdd(h);var c=this.x.redMul(a).redISub(h);c=(c=c.redIAdd(c)).redIAdd(c);var l=this.y.redMul(u.redMul(f.redISub(u)).redISub(s.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(c,l,d)},h.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},h.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":112,"./base":99,"bn.js":44,inherits:133}],104:[function(t,e,r){"use strict";var n,i=r,o=t("hash.js"),s=t("./curve"),a=t("./utils").assert;function f(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new f(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=f,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":101,"./precomputed/secp256k1":111,"./utils":112,"hash.js":117}],105:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("hmac-drbg"),o=t("../utils"),s=t("../curves"),a=t("brorand"),f=o.assert,u=t("./key"),h=t("./signature");function c(t){if(!(this instanceof c))return new c(t);"string"==typeof t&&(f(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}e.exports=c,c.prototype.keyPair=function(t){return new u(this,t)},c.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},c.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},c.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},c.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),f=t.toArray("be",s),u=new i({hash:this.hash,entropy:a,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),c=this.n.sub(new n(1)),l=0;;l++){var d=o.k?o.k(l):new n(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(c)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var g=d.invm(this.n).mul(b.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new h({r:b,s:g,recoveryParam:v})}}}}}},c.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new h(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,f=s.invm(this.n),u=f.mul(t).umod(this.n),c=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(t,e,r,i){f((3&r)===r,"The recovery param is more than two bits"),e=new h(e,i);var o=this.n,s=new n(t),a=e.r,u=e.s,c=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=u.mul(d).umod(o);return this.g.mulAdd(p,a,m)},c.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new h(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":104,"../utils":112,"./key":106,"./signature":107,"bn.js":44,brorand:45,"hmac-drbg":129}],106:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils").assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}e.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":112,"bn.js":44}],107:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s];return e.place=s,i}function f(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function u(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}e.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new function(){this.place=0};if(48!==t[r.place++])return!1;if(a(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=a(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var f=a(t,r);if(t.length!==f+r.place)return!1;var u=t.slice(r.place,f+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===u[0]&&128&u[1]&&(u=u.slice(1)),this.r=new n(s),this.s=new n(u),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=f(e),r=f(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];u(n,e.length),(n=n.concat(e)).push(2),u(n,r.length);var o=n.concat(r),s=[48];return u(s,o.length),s=s.concat(o),i.encode(s,t)}},{"../utils":112,"bn.js":44}],108:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("../curves"),o=t("../utils"),s=o.assert,a=o.parseBytes,f=t("./key"),u=t("./signature");function h(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof h))return new h(t);t=i[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}e.exports=h,h.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),f=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:f,Rencoded:o})},h.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(t){return f.fromPublic(this,t)},h.prototype.keyFromSecret=function(t){return f.fromSecret(this,t)},h.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},h.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},h.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},h.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(t){return o.intFromLE(t)},h.prototype.isPoint=function(t){return t instanceof this.pointClass}},{"../curves":104,"../utils":112,"./key":109,"./signature":110,"hash.js":117}],109:[function(t,e,r){"use strict";var n=t("../utils"),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),s(a,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),s(a,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),s(a,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),s(a,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),s(a,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},e.exports=a},{"../utils":112}],110:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function f(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(f,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(f,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(f,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(f,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),f.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},f.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=f},{"../utils":112,"bn.js":44}],111:[function(t,e,r){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],112:[function(t,e,r){"use strict";var n=r,i=t("bn.js"),o=t("minimalistic-assert"),s=t("minimalistic-crypto-utils");n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,f=o.andln(i-1);o.isOdd()?(a=f>(i>>1)-1?(i>>1)-f:f,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o,s,a,f=t.andln(3)+n&3,u=e.andln(3)+i&3;3===f&&(f=-1),3===u&&(u=-1),o=0==(1&f)?0:3!=(a=t.andln(7)+n&7)&&5!==a||2!==u?f:-f,r[0].push(o),s=0==(1&u)?0:3!=(a=e.andln(7)+i&7)&&5!==a||2!==f?u:-u,r[1].push(s),2*n===o+1&&(n=1-n),2*i===s+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":44,"minimalistic-assert":139,"minimalistic-crypto-utils":140}],113:[function(t,e,r){e.exports={_from:"elliptic@^6.0.0",_id:"elliptic@6.5.2",_inBundle:!1,_integrity:"sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.0.0",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.0.0",saveSpec:null,fetchSpec:"^6.0.0"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz",_shasum:"05c5678d7173c049d8ca433552224a495d0e3762",_spec:"elliptic@^6.0.0",_where:"/home/anton/projects/statsim/vis/node_modules/browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.2"}},{}],114:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},i=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},o=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function s(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0;var a,f=10;try{var u={};Object.defineProperty&&Object.defineProperty(u,"x",{value:0}),a=0===u.x}catch(t){a=!1}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function c(t,e,r,i){var o,s,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((s=t._events)?(s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),a=s[e]):(s=t._events=n(null),t._eventsCount=0),a){if("function"==typeof a?a=s[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),!a.warned&&(o=h(t))&&o>0&&a.length>o){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",f.name,f.message)}}else a=s[e]=r,++t._eventsCount;return t}function l(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=o.call(l,n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(!n)return[];var i=n[e];return i?"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):b(i,i.length):[]}function m(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function b(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}a?Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');f=t}}):s.defaultMaxListeners=f,s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return h(this)},s.prototype.emit=function(t){var e,r,n,i,o,s,a="error"===t;if(s=this._events)a=a&&null==s.error;else if(!a)return!1;if(a){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var f=new Error('Unhandled "error" event. ('+e+")");throw f.context=e,f}if(!(r=s[t]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=b(t,n),o=0;o<n;++o)i[o].call(r)}(r,u,this);break;case 2:!function(t,e,r,n){if(e)t.call(r,n);else for(var i=t.length,o=b(t,i),s=0;s<i;++s)o[s].call(r,n)}(r,u,this,arguments[1]);break;case 3:!function(t,e,r,n,i){if(e)t.call(r,n,i);else for(var o=t.length,s=b(t,o),a=0;a<o;++a)s[a].call(r,n,i)}(r,u,this,arguments[1],arguments[2]);break;case 4:!function(t,e,r,n,i,o){if(e)t.call(r,n,i,o);else for(var s=t.length,a=b(t,s),f=0;f<s;++f)a[f].call(r,n,i,o)}(r,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o<n;o++)i[o-1]=arguments[o];!function(t,e,r,n){if(e)t.apply(r,n);else for(var i=t.length,o=b(t,i),s=0;s<i;++s)o[s].apply(r,n)}(r,u,this,i)}return!0},s.prototype.addListener=function(t,e){return c(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return c(this,t,e,!0)},s.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,d(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,d(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,i,o,s,a;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=n(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){a=r[s].listener,o=s;break}if(o<0)return this;0===o?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n<i;r+=1,n+=1)t[r]=t[n];t.pop()}(r,o),1===r.length&&(i[t]=r[0]),i.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.removeAllListeners=function(t){var e,r,o;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=n(null):delete r[t]),this;if(0===arguments.length){var s,a=i(r);for(o=0;o<a.length;++o)"removeListener"!==(s=a[o])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)for(o=e.length-1;o>=0;o--)this.removeListener(t,e[o]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],115:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("md5.js");e.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),f=n.alloc(o||0),u=n.alloc(0);s>0||o>0;){var h=new i;h.update(u),h.update(t),e&&h.update(e),u=h.digest();var c=0;if(s>0){var l=a.length-s;c=Math.min(s,u.length),u.copy(a,l,0,c),s-=c}if(c<u.length&&o>0){var d=f.length-o,p=Math.min(o,u.length-c);u.copy(f,d,c,c+p),o-=p}}return u.fill(0),{key:a,iv:f}}},{"md5.js":137,"safe-buffer":194}],116:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("stream").Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t("inherits")(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},{inherits:133,"safe-buffer":194,stream:203}],117:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":118,"./hash/hmac":119,"./hash/ripemd":120,"./hash/sha":121,"./hash/utils":128}],118:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}r.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},{"./utils":128,"minimalistic-assert":139}],119:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}e.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":128,"minimalistic-assert":139}],120:[function(t,e,r){"use strict";var n=t("./utils"),i=t("./common"),o=n.rotl32,s=n.sum32,a=n.sum32_3,f=n.sum32_4,u=i.BlockHash;function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(h,u),r.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],h=this.h[4],v=r,y=n,w=i,_=u,x=h,M=0;M<80;M++){var S=s(o(f(r,c(M,n,i,u),t[p[M]+e],l(M)),b[M]),h);r=h,h=u,u=o(i,10),i=n,n=S,S=s(o(f(v,c(79-M,y,w,_),t[m[M]+e],d(M)),g[M]),x),v=x,x=_,_=o(w,10),w=y,y=S}S=a(this.h[1],i,_),this.h[1]=a(this.h[2],u,x),this.h[2]=a(this.h[3],h,v),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],n,w),this.h[0]=S},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"./common":118,"./utils":128}],121:[function(t,e,r){"use strict";r.sha1=t("./sha/1"),r.sha224=t("./sha/224"),r.sha256=t("./sha/256"),r.sha384=t("./sha/384"),r.sha512=t("./sha/512")},{"./sha/1":122,"./sha/224":123,"./sha/256":124,"./sha/384":125,"./sha/512":126}],122:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("./common"),s=n.rotl32,a=n.sum32,f=n.sum32_5,u=o.ft_1,h=i.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,h),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],h=this.h[2],l=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),m=f(s(i,5),u(p,o,h,l),d,r[n],c[p]);d=l,l=h,h=s(o,30),o=i,i=m}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":118,"../utils":128,"./common":127}],123:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./256");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},{"../utils":128,"./256":124}],124:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("./common"),s=t("minimalistic-assert"),a=n.sum32,f=n.sum32_4,u=n.sum32_5,h=o.ch32,c=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,b=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,b),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=f(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],b=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var x=u(_,d(v),h(v,y,w),this.k[n],r[n]),M=a(l(i),c(i,o,b));_=w,w=y,y=v,v=a(g,x),g=b,b=o,o=i,i=a(x,M)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],b),this.h[3]=a(this.h[3],g),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":118,"../utils":128,"./common":127,"minimalistic-assert":139}],125:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./512");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},{"../utils":128,"./512":126}],126:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("minimalistic-assert"),s=n.rotr64_hi,a=n.rotr64_lo,f=n.shr64_hi,u=n.shr64_lo,h=n.sum64,c=n.sum64_hi,l=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,b=n.sum64_5_lo,g=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function x(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function M(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function S(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function k(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function j(t,e){var r=s(t,e,1)^s(t,e,8)^f(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function R(t,e){var r=s(t,e,19)^s(e,t,29)^f(t,e,6);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(y,g),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=R(r[n-4],r[n-3]),o=O(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],f=j(r[n-30],r[n-29]),u=I(r[n-30],r[n-29]),h=r[n-32],c=r[n-31];r[n]=d(i,o,s,a,f,u,h,c),r[n+1]=p(i,o,s,a,f,u,h,c)}},y.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],u=this.h[5],d=this.h[6],p=this.h[7],g=this.h[8],v=this.h[9],y=this.h[10],j=this.h[11],I=this.h[12],R=this.h[13],O=this.h[14],D=this.h[15];o(this.k.length===r.length);for(var N=0;N<r.length;N+=2){var C=O,B=D,T=k(g,v),P=A(g,v),z=w(g,v,y,j,I),F=_(g,v,y,j,I,R),q=this.k[N],L=this.k[N+1],U=r[N],V=r[N+1],H=m(C,B,T,P,z,F,q,L,U,V),X=b(C,B,T,P,z,F,q,L,U,V);C=S(n,i),B=E(n,i),T=x(n,i,s,a,f),P=M(n,i,s,a,f,u);var W=c(C,B,T,P),K=l(C,B,T,P);O=I,D=R,I=y,R=j,y=g,j=v,g=c(d,p,H,X),v=l(p,p,H,X),d=f,p=u,f=s,u=a,s=n,a=i,n=c(H,X,W,K),i=l(H,X,W,K)}h(this.h,0,n,i),h(this.h,2,s,a),h(this.h,4,f,u),h(this.h,6,d,p),h(this.h,8,g,v),h(this.h,10,y,j),h(this.h,12,I,R),h(this.h,14,O,D)},y.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":118,"../utils":128,"minimalistic-assert":139}],127:[function(t,e,r){"use strict";var n=t("../utils").rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}r.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},r.ch32=i,r.maj32=o,r.p32=s,r.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},r.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},r.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":128}],128:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits");function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function f(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=i,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},r.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},r.htonl=s,r.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=f(i.toString(16))}return r},r.zero2=a,r.zero8=f,r.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,f=e;a<s.length;a++,f+=4){var u;u="big"===i?t[f]<<24|t[f+1]<<16|t[f+2]<<8|t[f+3]:t[f+3]<<24|t[f+2]<<16|t[f+1]<<8|t[f],s[a]=u>>>0}return s},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<<e|t>>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,s,a){var f=0,u=e;return f+=(u=u+n>>>0)<e?1:0,f+=(u=u+o>>>0)<o?1:0,t+r+i+s+(f+=(u=u+a>>>0)<a?1:0)>>>0},r.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,s,a,f,u){var h=0,c=e;return h+=(c=c+n>>>0)<e?1:0,h+=(c=c+o>>>0)<o?1:0,h+=(c=c+a>>>0)<a?1:0,t+r+i+s+f+(h+=(c=c+u>>>0)<u?1:0)>>>0},r.sum64_5_lo=function(t,e,r,n,i,o,s,a,f,u){return e+n+o+a+u>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:133,"minimalistic-assert":139}],129:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("minimalistic-crypto-utils"),o=t("minimalistic-assert");function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}e.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},{"hash.js":117,"minimalistic-assert":139,"minimalistic-crypto-utils":140}],130:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,f=(1<<a)-1,u=f>>1,h=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-u;else{if(o===f)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,f,u=8*o-i-1,h=(1<<u)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+c>=1?l/f:l*Math.pow(2,1-c))*f>=2&&(s++,f/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*f-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*m}},{}],131:[function(t,e,r){var n=t("./score");function i(t,e,r,i,o,s){const a=[];for(let f=0;f<s;f++){const s=JSON.parse(JSON.stringify(e));for(let t=s.length-1;t>0;t--){const e=Math.floor(Math.random()*(t+1));[s[t][o],s[e][o]]=[s[e][o],s[t][o]]}a.push(n(t,s,r,i))}return a}e.exports=function(t,e,r,o={}){const s=o.verbose?console.log:()=>{},a=o.kind?o.kind:Array.from(new Set(r)).length/r.length>.5?"mae":"ce",f=o.n||1,u=o.means||1===f,h=n(t,e,r,a),c=e[0].length;s("Start feature importance"),s("Score: %s, N repeats: %d, N features: %d",a,f,c),s("Base score:",h);const l=[];for(let n=0;n<c;n++){const o=i(t,e,r,a,n,f).map(t=>h-t);s(" - computing importance of feature: %d -> %f",n,o.reduce((t,e)=>t+e/o.length,0)),l.push(o)}const d=l.map(t=>t.reduce((t,e)=>t+e/f)),p=l.map((t,e)=>{return Math.sqrt(t.reduce((t,r)=>t+Math.pow(r-d[e],2)/f,0))});return u?d:{importances:l,importancesMeans:d,importancesStds:p}}},{"./score":132}],132:[function(t,e,r){function n(t,e){return t.reduce((r,n,i)=>r+Math.pow(n-e[i],2)/t.length,0)}const i={mae:function(t,e){return t.reduce((r,n,i)=>r+Math.abs(n-e[i])/t.length,0)},mse:n,rmse:function(t,e){return Math.sqrt(n(t,e))},smape:function(t,e){return t.reduce((t,r,n)=>t+Math.abs(r-e[n])/(Math.abs(r)+Math.abs(e[n])),0)/t.length*100},acc:function(t,e){return t.reduce((r,n,i)=>r+(n===e[i])/t.length,0)},ce:function(t,e){const r=[];for(let n=0;n<t.length;n++){const i=e[n].map(t=>t<1e-10?1e-10:t>1-1e-10?1-1e-10:t),o=i.reduce((t,e)=>t+e,0);r.push(i.map(t=>t/o).map((e,r)=>Math.log(e)*(t[n]===r)).reduce((t,e)=>t+e,0))}return r.reduce((e,r)=>e+r/t.length,0)}};e.exports=function(t,e,r,n){if(r.length!==e.length)throw new Error("Arrays have different length");if(r.length)return"ce"===n?i[n](r,t.predictProba(e)):"acc"===n?i[n](r,t.predict(e)):-i[n](r,t.predict(e));throw new Error("Zero length array")}},{}],133:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],134:[function(t,e,r){"use strict";const n=Object.prototype.toString;e.exports=function(t){return n.call(t).endsWith("Array]")}},{}],135:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],136:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],137:[function(t,e,r){"use strict";var n=t("inherits"),i=t("hash-base"),o=t("safe-buffer").Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function f(t,e){return t<<e|t>>>32-e}function u(t,e,r,n,i,o,s){return f(t+(e&r|~e&n)+i+o|0,s)+e|0}function h(t,e,r,n,i,o,s){return f(t+(e&n|r&~n)+i+o|0,s)+e|0}function c(t,e,r,n,i,o,s){return f(t+(e^r^n)+i+o|0,s)+e|0}function l(t,e,r,n,i,o,s){return f(t+(r^(e|~n))+i+o|0,s)+e|0}n(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;n=l(n=l(n=l(n=l(n=c(n=c(n=c(n=c(n=h(n=h(n=h(n=h(n=u(n=u(n=u(n=u(n,i=u(i,o=u(o,r=u(r,n,i,o,t[0],3614090360,7),n,i,t[1],3905402710,12),r,n,t[2],606105819,17),o,r,t[3],3250441966,22),i=u(i,o=u(o,r=u(r,n,i,o,t[4],4118548399,7),n,i,t[5],1200080426,12),r,n,t[6],2821735955,17),o,r,t[7],4249261313,22),i=u(i,o=u(o,r=u(r,n,i,o,t[8],1770035416,7),n,i,t[9],2336552879,12),r,n,t[10],4294925233,17),o,r,t[11],2304563134,22),i=u(i,o=u(o,r=u(r,n,i,o,t[12],1804603682,7),n,i,t[13],4254626195,12),r,n,t[14],2792965006,17),o,r,t[15],1236535329,22),i=h(i,o=h(o,r=h(r,n,i,o,t[1],4129170786,5),n,i,t[6],3225465664,9),r,n,t[11],643717713,14),o,r,t[0],3921069994,20),i=h(i,o=h(o,r=h(r,n,i,o,t[5],3593408605,5),n,i,t[10],38016083,9),r,n,t[15],3634488961,14),o,r,t[4],3889429448,20),i=h(i,o=h(o,r=h(r,n,i,o,t[9],568446438,5),n,i,t[14],3275163606,9),r,n,t[3],4107603335,14),o,r,t[8],1163531501,20),i=h(i,o=h(o,r=h(r,n,i,o,t[13],2850285829,5),n,i,t[2],4243563512,9),r,n,t[7],1735328473,14),o,r,t[12],2368359562,20),i=c(i,o=c(o,r=c(r,n,i,o,t[5],4294588738,4),n,i,t[8],2272392833,11),r,n,t[11],1839030562,16),o,r,t[14],4259657740,23),i=c(i,o=c(o,r=c(r,n,i,o,t[1],2763975236,4),n,i,t[4],1272893353,11),r,n,t[7],4139469664,16),o,r,t[10],3200236656,23),i=c(i,o=c(o,r=c(r,n,i,o,t[13],681279174,4),n,i,t[0],3936430074,11),r,n,t[3],3572445317,16),o,r,t[6],76029189,23),i=c(i,o=c(o,r=c(r,n,i,o,t[9],3654602809,4),n,i,t[12],3873151461,11),r,n,t[15],530742520,16),o,r,t[2],3299628645,23),i=l(i,o=l(o,r=l(r,n,i,o,t[0],4096336452,6),n,i,t[7],1126891415,10),r,n,t[14],2878612391,15),o,r,t[5],4237533241,21),i=l(i,o=l(o,r=l(r,n,i,o,t[12],1700485571,6),n,i,t[3],2399980690,10),r,n,t[10],4293915773,15),o,r,t[1],2240044497,21),i=l(i,o=l(o,r=l(r,n,i,o,t[8],1873313359,6),n,i,t[15],4264355552,10),r,n,t[6],2734768916,15),o,r,t[13],1309151649,21),i=l(i,o=l(o,r=l(r,n,i,o,t[4],4149444226,6),n,i,t[11],3174756917,10),r,n,t[2],718787259,15),o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},e.exports=a},{"hash-base":116,inherits:133,"safe-buffer":194}],138:[function(t,e,r){var n=t("bn.js"),i=t("brorand");function o(t){this.rand=t||new i.Rand}e.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),s=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var a=t.subn(1),f=0;!a.testn(f);f++);for(var u=t.shrn(f),h=a.toRed(o);e>0;e--){var c=this._randrange(new n(2),a);r&&r(c);var l=c.toRed(o).redPow(u);if(0!==l.cmp(s)&&0!==l.cmp(h)){for(var d=1;d<f;d++){if(0===(l=l.redSqr()).cmp(s))return!1;if(0===l.cmp(h))break}if(d===f)return!1}}return!0},o.prototype.getDivisor=function(t,e){var r=t.bitLength(),i=n.mont(t),o=new n(1).toRed(i);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var f=t.shrn(a),u=s.toRed(i);e>0;e--){var h=this._randrange(new n(2),s),c=t.gcd(h);if(0!==c.cmpn(1))return c;var l=h.toRed(i).redPow(f);if(0!==l.cmp(o)&&0!==l.cmp(u)){for(var d=1;d<a;d++){if(0===(l=l.redSqr()).cmp(o))return l.fromRed().subn(1).gcd(t);if(0===l.cmp(u))break}if(d===a)return(l=l.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},{"bn.js":44,brorand:45}],139:[function(t,e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}e.exports=n,n.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],140:[function(t,e,r){"use strict";var n=r;function i(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},{}],141:[function(t,e,r){"use strict";var n,i=(n=t("is-any-array"))&&"object"==typeof n&&"default"in n?n.default:n;e.exports=function(t){if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");let e=t[0];for(let r=1;r<t.length;r++)t[r]>e&&(e=t[r]);return e}},{"is-any-array":134}],142:[function(t,e,r){"use strict";var n,i=(n=t("is-any-array"))&&"object"==typeof n&&"default"in n?n.default:n;e.exports=function(t){if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");let e=t[0];for(let r=1;r<t.length;r++)t[r]<e&&(e=t[r]);return e}},{"is-any-array":134}],143:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var i=n(t("is-any-array")),o=n(t("ml-array-max")),s=n(t("ml-array-min"));e.exports=function(t,e={}){if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");let r;if(void 0!==e.output){if(!i(e.output))throw new TypeError("output option must be an array if specified");r=e.output}else r=new Array(t.length);const n=s(t),a=o(t);if(n===a)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");const{min:f=(e.autoMinMax?n:0),max:u=(e.autoMinMax?a:1)}=e;if(f>=u)throw new RangeError("min option must be smaller than max option");const h=(u-f)/(a-n);for(let e=0;e<t.length;e++)r[e]=(t[e]-n)*h+f;return r}},{"is-any-array":134,"ml-array-max":141,"ml-array-min":142}],144:[function(t,e,r){"use strict";var n=t("ml-matrix");function i(t,e,r){var n=0;const i=r(e);for(var o=0;o<t.x.length;o++)n+=Math.abs(t.y[o]-i(t.x[o]));return n}function o(t,e,r,i,o){var s=r*i*i,a=n.Matrix.eye(e.length,e.length,s);const f=o(e);var u=t.x.map(t=>f(t)),h=function(t,e,r,i,o){const s=r.length,a=t.x.length;for(var f=new Array(s),u=0;u<s;u++){f[u]=new Array(a);var h=r.concat();h[u]+=i;for(var c=o(h),l=0;l<a;l++)f[u][l]=e[l]-c(t.x[l])}return new n.Matrix(f)}(t,u,e,i,o),c=function(t,e){const r=t.x.length;for(var i=new Array(r),o=0;o<r;o++)i[o]=[t.y[o]-e[o]];return new n.Matrix(i)}(t,u),l=n.inverse(a.add(h.mmul(h.transpose())));return(e=(e=new n.Matrix([e])).sub(l.mmul(h).mmul(c).mul(i).transpose())).to1DArray()}e.exports=function(t,e,r={}){let{maxIterations:n=100,gradientDifference:s=.1,damping:a=0,errorTolerance:f=.01,minValues:u,maxValues:h,initialValues:c}=r;if(a<=0)throw new Error("The damping option must be a positive number");if(!t.x||!t.y)throw new Error("The data parameter must have x and y elements");if(!Array.isArray(t.x)||t.x.length<2||!Array.isArray(t.y)||t.y.length<2)throw new Error("The data parameter elements must be an array with more than 2 points");if(t.x.length!==t.y.length)throw new Error("The data parameter elements must have the same size");var l=c||new Array(e.length).fill(1);let d=l.length;if(h=h||new Array(d).fill(Number.MAX_SAFE_INTEGER),u=u||new Array(d).fill(Number.MIN_SAFE_INTEGER),h.length!==u.length)throw new Error("minValues and maxValues must be the same size");if(!Array.isArray(l))throw new Error("initialValues must be an array");for(var p=i(t,l,e),m=p<=f,b=0;b<n&&!m;b++){l=o(t,l,a,s,e);for(let t=0;t<d;t++)l[t]=Math.min(Math.max(u[t],l[t]),h[t]);if(p=i(t,l,e),isNaN(p))break;m=p<=f}return{parameterValues:l,parameterError:p,iterations:b}}},{"ml-matrix":145}],145:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("ml-array-rescale")),o=n(t("ml-array-max"));class s{constructor(t){var e,r,n,i,o,s,a,f,u,h=(t=C.checkMatrix(t)).clone(),c=h.rows,l=h.columns,d=new Array(c),p=1;for(e=0;e<c;e++)d[e]=e;for(f=new Array(c),r=0;r<l;r++){for(e=0;e<c;e++)f[e]=h.get(e,r);for(e=0;e<c;e++){for(u=Math.min(e,r),o=0,n=0;n<u;n++)o+=h.get(e,n)*f[n];f[e]-=o,h.set(e,r,f[e])}for(i=r,e=r+1;e<c;e++)Math.abs(f[e])>Math.abs(f[i])&&(i=e);if(i!==r){for(n=0;n<l;n++)s=h.get(i,n),h.set(i,n,h.get(r,n)),h.set(r,n,s);a=d[i],d[i]=d[r],d[r]=a,p=-p}if(r<c&&0!==h.get(r,r))for(e=r+1;e<c;e++)h.set(e,r,h.get(e,r)/h.get(r,r))}this.LU=h,this.pivotVector=d,this.pivotSign=p}isSingular(){for(var t=this.LU,e=t.columns,r=0;r<e;r++)if(0===t[r][r])return!0;return!1}solve(t){t=D.checkMatrix(t);var e=this.LU;if(e.rows!==t.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");var r,n,i,o=t.columns,s=t.subMatrixRow(this.pivotVector,0,o-1),a=e.columns;for(i=0;i<a;i++)for(r=i+1;r<a;r++)for(n=0;n<o;n++)s[r][n]-=s[i][n]*e[r][i];for(i=a-1;i>=0;i--){for(n=0;n<o;n++)s[i][n]/=e[i][i];for(r=0;r<i;r++)for(n=0;n<o;n++)s[r][n]-=s[i][n]*e[r][i]}return s}get determinant(){var t=this.LU;if(!t.isSquare())throw new Error("Matrix must be square");for(var e=this.pivotSign,r=t.columns,n=0;n<r;n++)e*=t[n][n];return e}get lowerTriangularMatrix(){for(var t=this.LU,e=t.rows,r=t.columns,n=new D(e,r),i=0;i<e;i++)for(var o=0;o<r;o++)n[i][o]=i>o?t[i][o]:i===o?1:0;return n}get upperTriangularMatrix(){for(var t=this.LU,e=t.rows,r=t.columns,n=new D(e,r),i=0;i<e;i++)for(var o=0;o<r;o++)n[i][o]=i<=o?t[i][o]:0;return n}get pivotPermutationVector(){return this.pivotVector.slice()}}function a(t,e){var r=0;return Math.abs(t)>Math.abs(e)?(r=e/t,Math.abs(t)*Math.sqrt(1+r*r)):0!==e?(r=t/e,Math.abs(e)*Math.sqrt(1+r*r)):0}function f(t,e,r){for(var n=new Array(t),i=0;i<t;i++){n[i]=new Array(e);for(var o=0;o<e;o++)n[i][o]=r}return n}class u{constructor(t,e={}){var r=(t=C.checkMatrix(t)).rows,n=t.columns;const{computeLeftSingularVectors:i=!0,computeRightSingularVectors:o=!0,autoTranspose:s=!1}=e;var u,h=Boolean(i),c=Boolean(o),l=!1;if(r<n)if(s){r=(u=t.transpose()).rows,n=u.columns,l=!0;var d=h;h=c,c=d}else u=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else u=t.clone();var p=Math.min(r,n),m=Math.min(r+1,n),b=new Array(m),g=f(r,p,0),v=f(n,n,0),y=new Array(n),w=new Array(r),_=new Array(m);for(let t=0;t<m;t++)_[t]=t;var x=Math.min(r-1,n),M=Math.max(0,Math.min(n-2,r)),S=Math.max(x,M);for(let t=0;t<S;t++){if(t<x){b[t]=0;for(let e=t;e<r;e++)b[t]=a(b[t],u[e][t]);if(0!==b[t]){u[t][t]<0&&(b[t]=-b[t]);for(let e=t;e<r;e++)u[e][t]/=b[t];u[t][t]+=1}b[t]=-b[t]}for(let e=t+1;e<n;e++){if(t<x&&0!==b[t]){let n=0;for(let i=t;i<r;i++)n+=u[i][t]*u[i][e];n=-n/u[t][t];for(let i=t;i<r;i++)u[i][e]+=n*u[i][t]}y[e]=u[t][e]}if(h&&t<x)for(let e=t;e<r;e++)g[e][t]=u[e][t];if(t<M){y[t]=0;for(let e=t+1;e<n;e++)y[t]=a(y[t],y[e]);if(0!==y[t]){y[t+1]<0&&(y[t]=0-y[t]);for(let e=t+1;e<n;e++)y[e]/=y[t];y[t+1]+=1}if(y[t]=-y[t],t+1<r&&0!==y[t]){for(let e=t+1;e<r;e++)w[e]=0;for(let e=t+1;e<r;e++)for(let r=t+1;r<n;r++)w[e]+=y[r]*u[e][r];for(let e=t+1;e<n;e++){let n=-y[e]/y[t+1];for(let i=t+1;i<r;i++)u[i][e]+=n*w[i]}}if(c)for(let e=t+1;e<n;e++)v[e][t]=y[e]}}let E=Math.min(n,r+1);if(x<n&&(b[x]=u[x][x]),r<E&&(b[E-1]=0),M+1<E&&(y[M]=u[M][E-1]),y[E-1]=0,h){for(let t=x;t<p;t++){for(let e=0;e<r;e++)g[e][t]=0;g[t][t]=1}for(let t=x-1;t>=0;t--)if(0!==b[t]){for(let e=t+1;e<p;e++){let n=0;for(let i=t;i<r;i++)n+=g[i][t]*g[i][e];n=-n/g[t][t];for(let i=t;i<r;i++)g[i][e]+=n*g[i][t]}for(let e=t;e<r;e++)g[e][t]=-g[e][t];g[t][t]=1+g[t][t];for(let e=0;e<t-1;e++)g[e][t]=0}else{for(let e=0;e<r;e++)g[e][t]=0;g[t][t]=1}}if(c)for(let t=n-1;t>=0;t--){if(t<M&&0!==y[t])for(let e=t+1;e<n;e++){let r=0;for(let i=t+1;i<n;i++)r+=v[i][t]*v[i][e];r=-r/v[t+1][t];for(let i=t+1;i<n;i++)v[i][e]+=r*v[i][t]}for(let e=0;e<n;e++)v[e][t]=0;v[t][t]=1}for(var k=E-1,A=Number.EPSILON;E>0;){let t,e;for(t=E-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+A*Math.abs(b[t]+Math.abs(b[t+1]));if(Math.abs(y[t])<=e||Number.isNaN(y[t])){y[t]=0;break}}if(t===E-2)e=4;else{let r;for(r=E-1;r>=t&&r!==t;r--){let e=(r!==E?Math.abs(y[r]):0)+(r!==t+1?Math.abs(y[r-1]):0);if(Math.abs(b[r])<=A*e){b[r]=0;break}}r===t?e=3:r===E-1?e=1:(e=2,t=r)}switch(t++,e){case 1:{let e=y[E-2];y[E-2]=0;for(let r=E-2;r>=t;r--){let i=a(b[r],e),o=b[r]/i,s=e/i;if(b[r]=i,r!==t&&(e=-s*y[r-1],y[r-1]=o*y[r-1]),c)for(let t=0;t<n;t++)i=o*v[t][r]+s*v[t][E-1],v[t][E-1]=-s*v[t][r]+o*v[t][E-1],v[t][r]=i}break}case 2:{let e=y[t-1];y[t-1]=0;for(let n=t;n<E;n++){let i=a(b[n],e),o=b[n]/i,s=e/i;if(b[n]=i,e=-s*y[n],y[n]=o*y[n],h)for(let e=0;e<r;e++)i=o*g[e][n]+s*g[e][t-1],g[e][t-1]=-s*g[e][n]+o*g[e][t-1],g[e][n]=i}break}case 3:{const e=Math.max(Math.abs(b[E-1]),Math.abs(b[E-2]),Math.abs(y[E-2]),Math.abs(b[t]),Math.abs(y[t])),i=b[E-1]/e,o=b[E-2]/e,s=y[E-2]/e,f=b[t]/e,u=y[t]/e,l=((o+i)*(o-i)+s*s)/2,d=i*s*(i*s);let p=0;0===l&&0===d||(p=d/(l+(p=l<0?0-Math.sqrt(l*l+d):Math.sqrt(l*l+d))));let m=(f+i)*(f-i)+p,w=f*u;for(let e=t;e<E-1;e++){let i=a(m,w);0===i&&(i=Number.MIN_VALUE);let o=m/i,s=w/i;if(e!==t&&(y[e-1]=i),m=o*b[e]+s*y[e],y[e]=o*y[e]-s*b[e],w=s*b[e+1],b[e+1]=o*b[e+1],c)for(let t=0;t<n;t++)i=o*v[t][e]+s*v[t][e+1],v[t][e+1]=-s*v[t][e]+o*v[t][e+1],v[t][e]=i;if(0===(i=a(m,w))&&(i=Number.MIN_VALUE),o=m/i,s=w/i,b[e]=i,m=o*y[e]+s*b[e+1],b[e+1]=-s*y[e]+o*b[e+1],w=s*y[e+1],y[e+1]=o*y[e+1],h&&e<r-1)for(let t=0;t<r;t++)i=o*g[t][e]+s*g[t][e+1],g[t][e+1]=-s*g[t][e]+o*g[t][e+1],g[t][e]=i}y[E-2]=m;break}case 4:if(b[t]<=0&&(b[t]=b[t]<0?-b[t]:0,c))for(let e=0;e<=k;e++)v[e][t]=-v[e][t];for(;t<k&&!(b[t]>=b[t+1]);){let e=b[t];if(b[t]=b[t+1],b[t+1]=e,c&&t<n-1)for(let r=0;r<n;r++)e=v[r][t+1],v[r][t+1]=v[r][t],v[r][t]=e;if(h&&t<r-1)for(let n=0;n<r;n++)e=g[n][t+1],g[n][t+1]=g[n][t],g[n][t]=e;t++}E--}}if(l){var j=v;v=g,g=j}this.m=r,this.n=n,this.s=b,this.U=g,this.V=v}solve(t){var e=t,r=this.threshold,n=this.s.length,i=D.zeros(n,n);for(let t=0;t<n;t++)Math.abs(this.s[t])<=r?i[t][t]=0:i[t][t]=1/this.s[t];var o=this.U,s=this.rightSingularVectors,a=s.mmul(i),f=s.rows,u=o.length,h=D.zeros(f,u);for(let t=0;t<f;t++)for(let e=0;e<u;e++){let r=0;for(let i=0;i<n;i++)r+=a[t][i]*o[e][i];h[t][e]=r}return h.mmul(e)}solveForDiagonal(t){return this.solve(D.diag(t))}inverse(){var t=this.V,e=this.threshold,r=t.length,n=t[0].length,i=new D(r,this.s.length);for(let o=0;o<r;o++)for(let r=0;r<n;r++)Math.abs(this.s[r])>e?i[o][r]=t[o][r]/this.s[r]:i[o][r]=0;var o=this.U,s=o.length,a=o[0].length,f=new D(r,s);for(let t=0;t<r;t++)for(let e=0;e<s;e++){let r=0;for(let n=0;n<a;n++)r+=i[t][n]*o[e][n];f[t][e]=r}return f}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){for(var t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,r=this.s,n=0,i=r.length;n<i;n++)r[n]>t&&e++;return e}get diagonal(){return this.s}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return D.isMatrix(this.U)||(this.U=new D(this.U)),this.U}get rightSingularVectors(){return D.isMatrix(this.V)||(this.V=new D(this.V)),this.V}get diagonalMatrix(){return D.diag(this.s)}}function h(t,e,r){var n=r?t.rows:t.rows-1;if(e<0||e>n)throw new RangeError("Row index out of range")}function c(t,e,r){var n=r?t.columns:t.columns-1;if(e<0||e>n)throw new RangeError("Column index out of range")}function l(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function d(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function p(t,e,r){return{row:m(t,e),column:b(t,r)}}function m(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for row indices");if(e.some(e=>e<0||e>=t.rows))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function b(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for column indices");if(e.some(e=>e<0||e>=t.columns))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function g(t,e,r,n,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(w("startRow",e),w("endRow",r),w("startColumn",n),w("endColumn",i),e>r||n>i||e<0||e>=t.rows||r<0||r>=t.rows||n<0||n>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function v(t){for(var e=D.zeros(t.rows,1),r=0;r<t.rows;++r)for(var n=0;n<t.columns;++n)e.set(r,0,e.get(r,0)+t.get(r,n));return e}function y(t){for(var e=D.zeros(1,t.columns),r=0;r<t.rows;++r)for(var n=0;n<t.columns;++n)e.set(0,n,e.get(0,n)+t.get(r,n));return e}function w(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}class _ extends(O()){constructor(t,e,r){super(),this.matrix=t,this.rows=e,this.columns=r}static get[Symbol.species](){return D}}class x extends _{constructor(t){super(t,t.columns,t.rows)}set(t,e,r){return this.matrix.set(e,t,r),this}get(t,e){return this.matrix.get(e,t)}}class M extends _{constructor(t,e){super(t,1,t.columns),this.row=e}set(t,e,r){return this.matrix.set(this.row,e,r),this}get(t,e){return this.matrix.get(this.row,e)}}class S extends _{constructor(t,e,r,n,i){g(t,e,r,n,i),super(t,r-e+1,i-n+1),this.startRow=e,this.startColumn=n}set(t,e,r){return this.matrix.set(this.startRow+t,this.startColumn+e,r),this}get(t,e){return this.matrix.get(this.startRow+t,this.startColumn+e)}}class E extends _{constructor(t,e,r){var n=p(t,e,r);super(t,n.row.length,n.column.length),this.rowIndices=n.row,this.columnIndices=n.column}set(t,e,r){return this.matrix.set(this.rowIndices[t],this.columnIndices[e],r),this}get(t,e){return this.matrix.get(this.rowIndices[t],this.columnIndices[e])}}class k extends _{constructor(t,e){super(t,(e=m(t,e)).length,t.columns),this.rowIndices=e}set(t,e,r){return this.matrix.set(this.rowIndices[t],e,r),this}get(t,e){return this.matrix.get(this.rowIndices[t],e)}}class A extends _{constructor(t,e){e=b(t,e),super(t,t.rows,e.length),this.columnIndices=e}set(t,e,r){return this.matrix.set(t,this.columnIndices[e],r),this}get(t,e){return this.matrix.get(t,this.columnIndices[e])}}class j extends _{constructor(t,e){super(t,t.rows,1),this.column=e}set(t,e,r){return this.matrix.set(t,this.column,r),this}get(t){return this.matrix.get(t,this.column)}}class I extends _{constructor(t){super(t,t.rows,t.columns)}set(t,e,r){return this.matrix.set(this.rows-t-1,e,r),this}get(t,e){return this.matrix.get(this.rows-t-1,e)}}class R extends _{constructor(t){super(t,t.rows,t.columns)}set(t,e,r){return this.matrix.set(t,this.columns-e-1,r),this}get(t,e){return this.matrix.get(t,this.columns-e-1)}}function O(t){void 0===t&&(t=Object);class e extends t{static get[Symbol.species](){return this}static from1DArray(t,e,r){if(t*e!==r.length)throw new RangeError("Data length does not match given dimensions");for(var n=new this(t,e),i=0;i<t;i++)for(var o=0;o<e;o++)n.set(i,o,r[i*e+o]);return n}static rowVector(t){for(var e=new this(1,t.length),r=0;r<t.length;r++)e.set(0,r,t[r]);return e}static columnVector(t){for(var e=new this(t.length,1),r=0;r<t.length;r++)e.set(r,0,t[r]);return e}static empty(t,e){return new this(t,e)}static zeros(t,e){return this.empty(t,e).fill(0)}static ones(t,e){return this.empty(t,e).fill(1)}static rand(t,e,r){void 0===r&&(r=Math.random);for(var n=this.empty(t,e),i=0;i<t;i++)for(var o=0;o<e;o++)n.set(i,o,r());return n}static randInt(t,e,r,n){void 0===r&&(r=1e3),void 0===n&&(n=Math.random);for(var i=this.empty(t,e),o=0;o<t;o++)for(var s=0;s<e;s++){var a=Math.floor(n()*r);i.set(o,s,a)}return i}static eye(t,e,r){void 0===e&&(e=t),void 0===r&&(r=1);for(var n=Math.min(t,e),i=this.zeros(t,e),o=0;o<n;o++)i.set(o,o,r);return i}static diag(t,e,r){var n=t.length;void 0===e&&(e=n),void 0===r&&(r=e);for(var i=Math.min(n,e,r),o=this.zeros(e,r),s=0;s<i;s++)o.set(s,s,t[s]);return o}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);for(var r=t.rows,n=t.columns,i=new this(r,n),o=0;o<r;o++)for(var s=0;s<n;s++)i.set(o,s,Math.min(t.get(o,s),e.get(o,s)));return i}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);for(var r=t.rows,n=t.columns,i=new this(r,n),o=0;o<r;o++)for(var s=0;s<n;s++)i.set(o,s,Math.max(t.get(o,s),e.get(o,s)));return i}static checkMatrix(t){return e.isMatrix(t)?t:new this(t)}static isMatrix(t){return null!=t&&"Matrix"===t.klass}get size(){return this.rows*this.columns}apply(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(var e=this.rows,r=this.columns,n=0;n<e;n++)for(var i=0;i<r;i++)t.call(this,n,i);return this}to1DArray(){for(var t=new Array(this.size),e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)t[e*this.columns+r]=this.get(e,r);return t}to2DArray(){for(var t=new Array(this.rows),e=0;e<this.rows;e++){t[e]=new Array(this.columns);for(var r=0;r<this.columns;r++)t[e][r]=this.get(e,r)}return t}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isSymmetric(){if(this.isSquare()){for(var t=0;t<this.rows;t++)for(var e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}isEchelonForm(){let t=0,e=0,r=-1,n=!0,i=!1;for(;t<this.rows&&n;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>r?(i=!0,r=e):(n=!1,i=!0);t++}return n}isReducedEchelonForm(){let t=0,e=0,r=-1,n=!0,i=!1;for(;t<this.rows&&n;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>r?(i=!0,r=e):(n=!1,i=!0);for(let r=e+1;r<this.rows;r++)0!==this.get(t,r)&&(n=!1);t++}return n}set(t,e,r){throw new Error("set method is unimplemented")}get(t,e){throw new Error("get method is unimplemented")}repeat(t,e){t=t||1,e=e||1;for(var r=new this.constructor[Symbol.species](this.rows*t,this.columns*e),n=0;n<t;n++)for(var i=0;i<e;i++)r.setSubMatrix(this,this.rows*n,this.columns*i);return r}fill(t){for(var e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.set(e,r,t);return this}neg(){return this.mulS(-1)}getRow(t){h(this,t);for(var e=new Array(this.columns),r=0;r<this.columns;r++)e[r]=this.get(t,r);return e}getRowVector(t){return this.constructor.rowVector(this.getRow(t))}setRow(t,e){h(this,t),e=l(this,e);for(var r=0;r<this.columns;r++)this.set(t,r,e[r]);return this}swapRows(t,e){h(this,t),h(this,e);for(var r=0;r<this.columns;r++){var n=this.get(t,r);this.set(t,r,this.get(e,r)),this.set(e,r,n)}return this}getColumn(t){c(this,t);for(var e=new Array(this.rows),r=0;r<this.rows;r++)e[r]=this.get(r,t);return e}getColumnVector(t){return this.constructor.columnVector(this.getColumn(t))}setColumn(t,e){c(this,t),e=d(this,e);for(var r=0;r<this.rows;r++)this.set(r,t,e[r]);return this}swapColumns(t,e){c(this,t),c(this,e);for(var r=0;r<this.rows;r++){var n=this.get(r,t);this.set(r,t,this.get(r,e)),this.set(r,e,n)}return this}addRowVector(t){t=l(this,t);for(var e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t[r]);return this}subRowVector(t){t=l(this,t);for(var e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t[r]);return this}mulRowVector(t){t=l(this,t);for(var e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t[r]);return this}divRowVector(t){t=l(this,t);for(var e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t[r]);return this}addColumnVector(t){t=d(this,t);for(var e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t[e]);return this}subColumnVector(t){t=d(this,t);for(var e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t[e]);return this}mulColumnVector(t){t=d(this,t);for(var e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t[e]);return this}divColumnVector(t){t=d(this,t);for(var e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t[e]);return this}mulRow(t,e){h(this,t);for(var r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)*e);return this}mulColumn(t,e){c(this,t);for(var r=0;r<this.rows;r++)this.set(r,t,this.get(r,t)*e);return this}max(){for(var t=this.get(0,0),e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.get(e,r)>t&&(t=this.get(e,r));return t}maxIndex(){for(var t=this.get(0,0),e=[0,0],r=0;r<this.rows;r++)for(var n=0;n<this.columns;n++)this.get(r,n)>t&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}min(){for(var t=this.get(0,0),e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)this.get(e,r)<t&&(t=this.get(e,r));return t}minIndex(){for(var t=this.get(0,0),e=[0,0],r=0;r<this.rows;r++)for(var n=0;n<this.columns;n++)this.get(r,n)<t&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}maxRow(t){h(this,t);for(var e=this.get(t,0),r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r));return e}maxRowIndex(t){h(this,t);for(var e=this.get(t,0),r=[t,0],n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n),r[1]=n);return r}minRow(t){h(this,t);for(var e=this.get(t,0),r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r));return e}minRowIndex(t){h(this,t);for(var e=this.get(t,0),r=[t,0],n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n),r[1]=n);return r}maxColumn(t){c(this,t);for(var e=this.get(0,t),r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t));return e}maxColumnIndex(t){c(this,t);for(var e=this.get(0,t),r=[0,t],n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t),r[0]=n);return r}minColumn(t){c(this,t);for(var e=this.get(0,t),r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t));return e}minColumnIndex(t){c(this,t);for(var e=this.get(0,t),r=[0,t],n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t),r[0]=n);return r}diag(){for(var t=Math.min(this.rows,this.columns),e=new Array(t),r=0;r<t;r++)e[r]=this.get(r,r);return e}sum(t){switch(t){case"row":return v(this);case"column":return y(this);default:return function(t){for(var e=0,r=0;r<t.rows;r++)for(var n=0;n<t.columns;n++)e+=t.get(r,n);return e}(this)}}mean(){return this.sum()/this.size}prod(){for(var t=1,e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)t*=this.get(e,r);return t}norm(t="frobenius"){var e=0;if("max"===t)return this.max();if("frobenius"===t){for(var r=0;r<this.rows;r++)for(var n=0;n<this.columns;n++)e+=this.get(r,n)*this.get(r,n);return Math.sqrt(e)}throw new RangeError(`unknown norm type: ${t}`)}cumulativeSum(){for(var t=0,e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)t+=this.get(e,r),this.set(e,r,t);return this}dot(t){e.isMatrix(t)&&(t=t.to1DArray());var r=this.to1DArray();if(r.length!==t.length)throw new RangeError("vectors do not have the same size");for(var n=0,i=0;i<r.length;i++)n+=r[i]*t[i];return n}mmul(t){t=this.constructor.checkMatrix(t),this.columns!==t.rows&&console.warn("Number of columns of left matrix are not equal to number of rows of right matrix.");for(var e=this.rows,r=this.columns,n=t.columns,i=new this.constructor[Symbol.species](e,n),o=new Array(r),s=0;s<n;s++){for(var a=0;a<r;a++)o[a]=t.get(a,s);for(var f=0;f<e;f++){var u=0;for(a=0;a<r;a++)u+=this.get(f,a)*o[a];i.set(f,s,u)}}return i}strassen2x2(t){var e=new this.constructor[Symbol.species](2,2);const r=this.get(0,0),n=t.get(0,0),i=this.get(0,1),o=t.get(0,1),s=this.get(1,0),a=t.get(1,0),f=this.get(1,1),u=t.get(1,1),h=(r+f)*(n+u),c=(s+f)*n,l=r*(o-u),d=f*(a-n),p=(r+i)*u,m=h+d-p+(i-f)*(a+u),b=l+p,g=c+d,v=h-c+l+(s-r)*(n+o);return e.set(0,0,m),e.set(0,1,b),e.set(1,0,g),e.set(1,1,v),e}strassen3x3(t){var e=new this.constructor[Symbol.species](3,3);const r=this.get(0,0),n=this.get(0,1),i=this.get(0,2),o=this.get(1,0),s=this.get(1,1),a=this.get(1,2),f=this.get(2,0),u=this.get(2,1),h=this.get(2,2),c=t.get(0,0),l=t.get(0,1),d=t.get(0,2),p=t.get(1,0),m=t.get(1,1),b=t.get(1,2),g=t.get(2,0),v=t.get(2,1),y=t.get(2,2),w=(r-o)*(-l+m),_=(-r+o+s)*(c-l+m),x=(o+s)*(-c+l),M=r*c,S=(-r+f+u)*(c-d+b),E=(-r+f)*(d-b),k=(f+u)*(-c+d),A=(-i+u+h)*(m+g-v),j=(i-h)*(m-v),I=i*g,R=(u+h)*(-g+v),O=(-i+s+a)*(b+g-y),D=(i-a)*(b-y),N=(s+a)*(-g+y),C=M+I+n*p,B=(r+n+i-o-s-u-h)*m+_+x+M+A+I+R,T=M+S+k+(r+n+i-s-a-f-u)*b+I+O+N,P=w+s*(-c+l+p-m-b-g+y)+_+M+I+O+D,z=w+_+x+M+a*v,F=I+O+D+N+o*d,q=M+S+E+u*(-c+d+p-m-b-g+v)+A+j+I,L=A+j+I+R+f*l,U=M+S+E+k+h*y;return e.set(0,0,C),e.set(0,1,B),e.set(0,2,T),e.set(1,0,P),e.set(1,1,z),e.set(1,2,F),e.set(2,0,q),e.set(2,1,L),e.set(2,2,U),e}mmulStrassen(t){var r=this.clone(),n=r.rows,i=r.columns,o=t.rows,s=t.columns;function a(t,r,n){var i=t.rows,o=t.columns;if(i===r&&o===n)return t;var s=e.zeros(r,n);return s=s.setSubMatrix(t,0,0)}i!==o&&console.warn(`Multiplying ${n} x ${i} and ${o} x ${s} matrix: dimensions do not match.`);var f=Math.max(n,o),u=Math.max(i,s);return function t(r,n,i,o){if(i<=512||o<=512)return r.mmul(n);i%2==1&&o%2==1?(r=a(r,i+1,o+1),n=a(n,i+1,o+1)):i%2==1?(r=a(r,i+1,o),n=a(n,i+1,o)):o%2==1&&(r=a(r,i,o+1),n=a(n,i,o+1));var s=parseInt(r.rows/2,10),f=parseInt(r.columns/2,10),u=r.subMatrix(0,s-1,0,f-1),h=n.subMatrix(0,s-1,0,f-1),c=r.subMatrix(0,s-1,f,r.columns-1),l=n.subMatrix(0,s-1,f,n.columns-1),d=r.subMatrix(s,r.rows-1,0,f-1),p=n.subMatrix(s,n.rows-1,0,f-1),m=r.subMatrix(s,r.rows-1,f,r.columns-1),b=n.subMatrix(s,n.rows-1,f,n.columns-1),g=t(e.add(u,m),e.add(h,b),s,f),v=t(e.add(d,m),h,s,f),y=t(u,e.sub(l,b),s,f),w=t(m,e.sub(p,h),s,f),_=t(e.add(u,c),b,s,f),x=t(e.sub(d,u),e.add(h,l),s,f),M=t(e.sub(c,m),e.add(p,b),s,f),S=e.add(g,w);S.sub(_),S.add(M);var E=e.add(y,_),k=e.add(v,w),A=e.sub(g,v);A.add(y),A.add(x);var j=e.zeros(2*S.rows,2*S.columns);return(j=(j=(j=(j=j.setSubMatrix(S,0,0)).setSubMatrix(E,S.rows,0)).setSubMatrix(k,0,S.columns)).setSubMatrix(A,S.rows,S.columns)).subMatrix(0,i-1,0,o-1)}(r=a(r,f,u),t=a(t,f,u),f,u)}scaleRows(t,e){if((t=void 0===t?0:t)>=(e=void 0===e?1:e))throw new RangeError("min should be strictly smaller than max");for(var r=this.constructor.empty(this.rows,this.columns),n=0;n<this.rows;n++){var o=i(this.getRow(n),{min:t,max:e});r.setRow(n,o)}return r}scaleColumns(t,e){if((t=void 0===t?0:t)>=(e=void 0===e?1:e))throw new RangeError("min should be strictly smaller than max");for(var r=this.constructor.empty(this.rows,this.columns),n=0;n<this.columns;n++){var o=i(this.getColumn(n),{min:t,max:e});r.setColumn(n,o)}return r}kroneckerProduct(t){t=this.constructor.checkMatrix(t);for(var e=this.rows,r=this.columns,n=t.rows,i=t.columns,o=new this.constructor[Symbol.species](e*n,r*i),s=0;s<e;s++)for(var a=0;a<r;a++)for(var f=0;f<n;f++)for(var u=0;u<i;u++)o[n*s+f][i*a+u]=this.get(s,a)*t.get(f,u);return o}transpose(){for(var t=new this.constructor[Symbol.species](this.columns,this.rows),e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)t.set(r,e,this.get(e,r));return t}sortRows(t){void 0===t&&(t=r);for(var e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t){void 0===t&&(t=r);for(var e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,r,n){g(this,t,e,r,n);for(var i=new this.constructor[Symbol.species](e-t+1,n-r+1),o=t;o<=e;o++)for(var s=r;s<=n;s++)i[o-t][s-r]=this.get(o,s);return i}subMatrixRow(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.columns-1),e>r||e<0||e>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");for(var n=new this.constructor[Symbol.species](t.length,r-e+1),i=0;i<t.length;i++)for(var o=e;o<=r;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError(`Row index out of range: ${t[i]}`);n.set(i,o-e,this.get(t[i],o))}return n}subMatrixColumn(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.rows-1),e>r||e<0||e>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");for(var n=new this.constructor[Symbol.species](r-e+1,t.length),i=0;i<t.length;i++)for(var o=e;o<=r;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError(`Column index out of range: ${t[i]}`);n.set(o-e,i,this.get(o,t[i]))}return n}setSubMatrix(t,e,r){g(this,e,e+(t=this.constructor.checkMatrix(t)).rows-1,r,r+t.columns-1);for(var n=0;n<t.rows;n++)for(var i=0;i<t.columns;i++)this[e+n][r+i]=t.get(n,i);return this}selection(t,e){for(var r=p(this,t,e),n=new this.constructor[Symbol.species](t.length,e.length),i=0;i<r.row.length;i++)for(var o=r.row[i],s=0;s<r.column.length;s++){var a=r.column[s];n[i][s]=this.get(o,a)}return n}trace(){for(var t=Math.min(this.rows,this.columns),e=0,r=0;r<t;r++)e+=this.get(r,r);return e}transposeView(){return new x(this)}rowView(t){return h(this,t),new M(this,t)}columnView(t){return c(this,t),new j(this,t)}flipRowView(){return new I(this)}flipColumnView(){return new R(this)}subMatrixView(t,e,r,n){return new S(this,t,e,r,n)}selectionView(t,e){return new E(this,t,e)}rowSelectionView(t){return new k(this,t)}columnSelectionView(t){return new A(this,t)}det(){var t,e,r,n,i,o;if(this.isSquare())return 2===this.columns?(t=this.get(0,0),e=this.get(0,1),r=this.get(1,0),t*this.get(1,1)-e*r):3===this.columns?(n=this.selectionView([1,2],[1,2]),i=this.selectionView([1,2],[0,2]),o=this.selectionView([1,2],[0,1]),t=this.get(0,0),e=this.get(0,1),r=this.get(0,2),t*n.det()-e*i.det()+r*o.det()):new s(this).determinant;throw Error("Determinant can only be calculated for a square matrix.")}pseudoInverse(t){void 0===t&&(t=Number.EPSILON);for(var e=new u(this,{autoTranspose:!0}),r=e.leftSingularVectors,n=e.rightSingularVectors,i=e.diagonal,o=0;o<i.length;o++)Math.abs(i[o])>t?i[o]=1/i[o]:i[o]=0;return i=this.constructor[Symbol.species].diag(i),n.mmul(i.mmul(r.transposeView()))}clone(){for(var t=new this.constructor[Symbol.species](this.rows,this.columns),e=0;e<this.rows;e++)for(var r=0;r<this.columns;r++)t.set(e,r,this.get(e,r));return t}}function r(t,e){return t-e}e.prototype.klass="Matrix",e.random=e.rand,e.diagonal=e.diag,e.prototype.diagonal=e.prototype.diag,e.identity=e.eye,e.prototype.negate=e.prototype.neg,e.prototype.tensorProduct=e.prototype.kroneckerProduct,e.prototype.determinant=e.prototype.det;var n,o="\n(function %name%(matrix, %args%) {\n var newMatrix = new this[Symbol.species](matrix);\n return newMatrix.%name%(%args%);\n})\n",a=eval;for(var f of[["+","add"],["-","sub","subtract"],["*","mul","multiply"],["/","div","divide"],["%","mod","modulus"],["&","and"],["|","or"],["^","xor"],["<<","leftShift"],[">>","signPropagatingRightShift"],[">>>","rightShift","zeroFillRightShift"]]){var m=a(H("\n(function %name%(value) {\n if (typeof value === 'number') return this.%name%S(value);\n return this.%name%M(value);\n})\n",{name:f[1],op:f[0]})),b=a(H("\n(function %name%S(value) {\n for (var i = 0; i < this.rows; i++) {\n for (var j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) %op% value);\n }\n }\n return this;\n})\n",{name:`${f[1]}S`,op:f[0]})),w=a(H("\n(function %name%M(matrix) {\n matrix = this.constructor.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (var i = 0; i < this.rows; i++) {\n for (var j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) %op% matrix.get(i, j));\n }\n }\n return this;\n})\n",{name:`${f[1]}M`,op:f[0]})),_=a(H("\n(function %name%(matrix, value) {\n var newMatrix = new this[Symbol.species](matrix);\n return newMatrix.%name%(value);\n})\n",{name:f[1]}));for(n=1;n<f.length;n++)e.prototype[f[n]]=m,e.prototype[`${f[n]}S`]=b,e.prototype[`${f[n]}M`]=w,e[f[n]]=_}var O=[["~","not"]];for(var D of(["abs","acos","acosh","asin","asinh","atan","atanh","cbrt","ceil","clz32","cos","cosh","exp","expm1","floor","fround","log","log1p","log10","log2","round","sign","sin","sinh","sqrt","tan","tanh","trunc"].forEach(function(t){O.push([`Math.${t}`,t])}),O)){var N=a(H("\n(function %name%() {\n for (var i = 0; i < this.rows; i++) {\n for (var j = 0; j < this.columns; j++) {\n this.set(i, j, %method%(this.get(i, j)));\n }\n }\n return this;\n})\n",{name:D[1],method:D[0]})),C=a(H("\n(function %name%(matrix) {\n var newMatrix = new this[Symbol.species](matrix);\n return newMatrix.%name%();\n})\n",{name:D[1]}));for(n=1;n<D.length;n++)e.prototype[D[n]]=N,e[D[n]]=C}for(var B of[["Math.pow",1,"pow"]]){var T="arg0";for(n=1;n<B[1];n++)T+=`, arg${n}`;if(1!==B[1]){var P=a(H("\n(function %name%(%args%) {\n for (var i = 0; i < this.rows; i++) {\n for (var j = 0; j < this.columns; j++) {\n this.set(i, j, %method%(this.get(i, j), %args%));\n }\n }\n return this;\n})\n",{name:B[2],method:B[0],args:T})),z=a(H(o,{name:B[2],args:T}));for(n=2;n<B.length;n++)e.prototype[B[n]]=P,e[B[n]]=z}else{var F={name:B[2],args:T,method:B[0]},q=a(H("\n(function %name%(value) {\n if (typeof value === 'number') return this.%name%S(value);\n return this.%name%M(value);\n})\n",F)),L=a(H("\n(function %name%S(value) {\n for (var i = 0; i < this.rows; i++) {\n for (var j = 0; j < this.columns; j++) {\n this.set(i, j, %method%(this.get(i, j), value));\n }\n }\n return this;\n})\n",F)),U=a(H("\n(function %name%M(matrix) {\n matrix = this.constructor.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (var i = 0; i < this.rows; i++) {\n for (var j = 0; j < this.columns; j++) {\n this.set(i, j, %method%(this.get(i, j), matrix.get(i, j)));\n }\n }\n return this;\n})\n",F)),V=a(H("\n(function %name%(matrix, %args%) {\n var newMatrix = new this[Symbol.species](matrix);\n return newMatrix.%name%(%args%);\n})\n",F));for(n=2;n<B.length;n++)e.prototype[B[n]]=q,e.prototype[`${B[n]}M`]=U,e.prototype[`${B[n]}S`]=L,e[B[n]]=V}}function H(t,e){for(var r in e)t=t.replace(new RegExp(`%${r}%`,"g"),e[r]);return t}return e}class D extends(O(Array)){constructor(t,e){var r;if(1===arguments.length&&"number"==typeof t)return new Array(t);if(D.isMatrix(t))return t.clone();if(Number.isInteger(t)&&t>0){if(super(t),!(Number.isInteger(e)&&e>0))throw new TypeError("nColumns must be a positive integer");for(r=0;r<t;r++)this[r]=new Array(e)}else{if(!Array.isArray(t))throw new TypeError("First argument must be a positive number or an array");{const n=t;if(t=n.length,"number"!=typeof(e=n[0].length)||0===e)throw new TypeError("Data must be a 2D array with at least one element");for(super(t),r=0;r<t;r++){if(n[r].length!==e)throw new RangeError("Inconsistent array dimensions");this[r]=[].concat(n[r])}}}return this.rows=t,this.columns=e,this}set(t,e,r){return this[t][e]=r,this}get(t,e){return this[t][e]}removeRow(t){if(h(this,t),1===this.rows)throw new RangeError("A matrix cannot have less than one row");return this.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),h(this,t,!0),e=l(this,e),this.splice(t,0,e),this.rows+=1,this}removeColumn(t){if(c(this,t),1===this.columns)throw new RangeError("A matrix cannot have less than one column");for(var e=0;e<this.rows;e++)this[e].splice(t,1);return this.columns-=1,this}addColumn(t,e){void 0===e&&(e=t,t=this.columns),c(this,t,!0),e=d(this,e);for(var r=0;r<this.rows;r++)this[r].splice(t,0,e[r]);return this.columns+=1,this}}class N extends(O()){constructor(t,e={}){const{rows:r=1}=e;if(t.length%r!=0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=r,this.columns=t.length/r,this.data=t}set(t,e,r){var n=this._calculateIndex(t,e);return this.data[n]=r,this}get(t,e){var r=this._calculateIndex(t,e);return this.data[r]}_calculateIndex(t,e){return t*this.columns+e}static get[Symbol.species](){return D}}class C extends(O()){constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,r){return this.data[t][e]=r,this}get(t,e){return this.data[t][e]}static get[Symbol.species](){return D}}class B{constructor(t){var e,r,n,i,o=(t=C.checkMatrix(t)).clone(),s=t.rows,f=t.columns,u=new Array(f);for(n=0;n<f;n++){var h=0;for(e=n;e<s;e++)h=a(h,o.get(e,n));if(0!==h){for(o.get(n,n)<0&&(h=-h),e=n;e<s;e++)o.set(e,n,o.get(e,n)/h);for(o.set(n,n,o.get(n,n)+1),r=n+1;r<f;r++){for(i=0,e=n;e<s;e++)i+=o.get(e,n)*o.get(e,r);for(i=-i/o.get(n,n),e=n;e<s;e++)o.set(e,r,o.get(e,r)+i*o.get(e,n))}}u[n]=-h}this.QR=o,this.Rdiag=u}solve(t){t=D.checkMatrix(t);var e=this.QR,r=e.rows;if(t.rows!==r)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");var n,i,o,s,a=t.columns,f=t.clone(),u=e.columns;for(o=0;o<u;o++)for(i=0;i<a;i++){for(s=0,n=o;n<r;n++)s+=e[n][o]*f[n][i];for(s=-s/e[o][o],n=o;n<r;n++)f[n][i]+=s*e[n][o]}for(o=u-1;o>=0;o--){for(i=0;i<a;i++)f[o][i]/=this.Rdiag[o];for(n=0;n<o;n++)for(i=0;i<a;i++)f[n][i]-=f[o][i]*e[n][o]}return f.subMatrix(0,u-1,0,a-1)}isFullRank(){for(var t=this.QR.columns,e=0;e<t;e++)if(0===this.Rdiag[e])return!1;return!0}get upperTriangularMatrix(){var t,e,r=this.QR,n=r.columns,i=new D(n,n);for(t=0;t<n;t++)for(e=0;e<n;e++)i[t][e]=t<e?r[t][e]:t===e?this.Rdiag[t]:0;return i}get orthogonalMatrix(){var t,e,r,n,i=this.QR,o=i.rows,s=i.columns,a=new D(o,s);for(r=s-1;r>=0;r--){for(t=0;t<o;t++)a[t][r]=0;for(a[r][r]=1,e=r;e<s;e++)if(0!==i[r][r]){for(n=0,t=r;t<o;t++)n+=i[t][r]*a[t][e];for(n=-n/i[r][r],t=r;t<o;t++)a[t][e]+=n*i[t][r]}}return a}}function T(t,e,r=!1){return t=C.checkMatrix(t),e=C.checkMatrix(e),r?new u(t).solve(e):t.isSquare()?new s(t).solve(e):new B(t).solve(e)}function P(t,e){for(var r=[],n=0;n<t;n++)n!==e&&r.push(n);return r}function z(t,e,r,n=1e-9,i=1e-9){if(t>i)return new Array(e.rows+1).fill(0);for(var o=e.addRow(r,[0]),s=0;s<o.rows;s++)Math.abs(o.get(s,0))<n&&o.set(s,0,0);return o.to1DArray()}class F{constructor(t,e={}){const{assumeSymmetric:r=!1}=e;if(!(t=C.checkMatrix(t)).isSquare())throw new Error("Matrix is not a square matrix");var n,i,o=t.columns,s=f(o,o,0),u=new Array(o),h=new Array(o),c=t;if(!!r||t.isSymmetric()){for(n=0;n<o;n++)for(i=0;i<o;i++)s[n][i]=c.get(n,i);!function(t,e,r,n){var i,o,s,a,f,u,h,c;for(f=0;f<t;f++)r[f]=n[t-1][f];for(a=t-1;a>0;a--){for(c=0,s=0,u=0;u<a;u++)c+=Math.abs(r[u]);if(0===c)for(e[a]=r[a-1],f=0;f<a;f++)r[f]=n[a-1][f],n[a][f]=0,n[f][a]=0;else{for(u=0;u<a;u++)r[u]/=c,s+=r[u]*r[u];for(i=r[a-1],o=Math.sqrt(s),i>0&&(o=-o),e[a]=c*o,s-=i*o,r[a-1]=i-o,f=0;f<a;f++)e[f]=0;for(f=0;f<a;f++){for(i=r[f],n[f][a]=i,o=e[f]+n[f][f]*i,u=f+1;u<=a-1;u++)o+=n[u][f]*r[u],e[u]+=n[u][f]*i;e[f]=o}for(i=0,f=0;f<a;f++)e[f]/=s,i+=e[f]*r[f];for(h=i/(s+s),f=0;f<a;f++)e[f]-=h*r[f];for(f=0;f<a;f++){for(i=r[f],o=e[f],u=f;u<=a-1;u++)n[u][f]-=i*e[u]+o*r[u];r[f]=n[a-1][f],n[a][f]=0}}r[a]=s}for(a=0;a<t-1;a++){if(n[t-1][a]=n[a][a],n[a][a]=1,0!==(s=r[a+1])){for(u=0;u<=a;u++)r[u]=n[u][a+1]/s;for(f=0;f<=a;f++){for(o=0,u=0;u<=a;u++)o+=n[u][a+1]*n[u][f];for(u=0;u<=a;u++)n[u][f]-=o*r[u]}}for(u=0;u<=a;u++)n[u][a+1]=0}for(f=0;f<t;f++)r[f]=n[t-1][f],n[t-1][f]=0;n[t-1][t-1]=1,e[0]=0}(o,h,u,s),function(t,e,r,n){var i,o,s,f,u,h,c,l,d,p,m,b,g,v,y,w;for(s=1;s<t;s++)e[s-1]=e[s];e[t-1]=0;var _=0,x=0,M=Number.EPSILON;for(h=0;h<t;h++){for(x=Math.max(x,Math.abs(r[h])+Math.abs(e[h])),c=h;c<t&&!(Math.abs(e[c])<=M*x);)c++;if(c>h)do{for(i=r[h],l=(r[h+1]-i)/(2*e[h]),d=a(l,1),l<0&&(d=-d),r[h]=e[h]/(l+d),r[h+1]=e[h]*(l+d),p=r[h+1],o=i-r[h],s=h+2;s<t;s++)r[s]-=o;for(_+=o,l=r[c],b=m=1,g=m,v=e[h+1],y=0,w=0,s=c-1;s>=h;s--)for(g=b,b=m,w=y,i=m*e[s],o=m*l,d=a(l,e[s]),e[s+1]=y*d,y=e[s]/d,l=(m=l/d)*r[s]-y*i,r[s+1]=o+y*(m*i+y*r[s]),u=0;u<t;u++)o=n[u][s+1],n[u][s+1]=y*n[u][s]+m*o,n[u][s]=m*n[u][s]-y*o;l=-y*w*g*v*e[h]/p,e[h]=y*l,r[h]=m*l}while(Math.abs(e[h])>M*x);r[h]=r[h]+_,e[h]=0}for(s=0;s<t-1;s++){for(u=s,l=r[s],f=s+1;f<t;f++)r[f]<l&&(u=f,l=r[f]);if(u!==s)for(r[u]=r[s],r[s]=l,f=0;f<t;f++)l=n[f][s],n[f][s]=n[f][u],n[f][u]=l}}(o,h,u,s)}else{var l=f(o,o,0),d=new Array(o);for(i=0;i<o;i++)for(n=0;n<o;n++)l[n][i]=c.get(n,i);!function(t,e,r,n){var i,o,s,a,f,u,h,c=t-1;for(u=1;u<=c-1;u++){for(h=0,a=u;a<=c;a++)h+=Math.abs(e[a][u-1]);if(0!==h){for(s=0,a=c;a>=u;a--)r[a]=e[a][u-1]/h,s+=r[a]*r[a];for(o=Math.sqrt(s),r[u]>0&&(o=-o),s-=r[u]*o,r[u]=r[u]-o,f=u;f<t;f++){for(i=0,a=c;a>=u;a--)i+=r[a]*e[a][f];for(i/=s,a=u;a<=c;a++)e[a][f]-=i*r[a]}for(a=0;a<=c;a++){for(i=0,f=c;f>=u;f--)i+=r[f]*e[a][f];for(i/=s,f=u;f<=c;f++)e[a][f]-=i*r[f]}r[u]=h*r[u],e[u][u-1]=h*o}}for(a=0;a<t;a++)for(f=0;f<t;f++)n[a][f]=a===f?1:0;for(u=c-1;u>=1;u--)if(0!==e[u][u-1]){for(a=u+1;a<=c;a++)r[a]=e[a][u-1];for(f=u;f<=c;f++){for(o=0,a=u;a<=c;a++)o+=r[a]*n[a][f];for(o=o/r[u]/e[u][u-1],a=u;a<=c;a++)n[a][f]+=o*r[a]}}}(o,l,d,s),function(t,e,r,n,i){var o,s,a,f,u,h,c,l,d,p,m,b,g,v,y,w=t-1,_=t-1,x=Number.EPSILON,M=0,S=0,E=0,k=0,A=0,j=0,I=0,R=0;for(o=0;o<t;o++)for((o<0||o>_)&&(r[o]=i[o][o],e[o]=0),s=Math.max(o-1,0);s<t;s++)S+=Math.abs(i[o][s]);for(;w>=0;){for(f=w;f>0&&(0===(j=Math.abs(i[f-1][f-1])+Math.abs(i[f][f]))&&(j=S),!(Math.abs(i[f][f-1])<x*j));)f--;if(f===w)i[w][w]=i[w][w]+M,r[w]=i[w][w],e[w]=0,w--,R=0;else if(f===w-1){if(c=i[w][w-1]*i[w-1][w],E=(i[w-1][w-1]-i[w][w])/2,k=E*E+c,I=Math.sqrt(Math.abs(k)),i[w][w]=i[w][w]+M,i[w-1][w-1]=i[w-1][w-1]+M,l=i[w][w],k>=0){for(I=E>=0?E+I:E-I,r[w-1]=l+I,r[w]=r[w-1],0!==I&&(r[w]=l-c/I),e[w-1]=0,e[w]=0,l=i[w][w-1],j=Math.abs(l)+Math.abs(I),E=l/j,k=I/j,A=Math.sqrt(E*E+k*k),E/=A,k/=A,s=w-1;s<t;s++)I=i[w-1][s],i[w-1][s]=k*I+E*i[w][s],i[w][s]=k*i[w][s]-E*I;for(o=0;o<=w;o++)I=i[o][w-1],i[o][w-1]=k*I+E*i[o][w],i[o][w]=k*i[o][w]-E*I;for(o=0;o<=_;o++)I=n[o][w-1],n[o][w-1]=k*I+E*n[o][w],n[o][w]=k*n[o][w]-E*I}else r[w-1]=l+E,r[w]=l+E,e[w-1]=I,e[w]=-I;w-=2,R=0}else{if(l=i[w][w],d=0,c=0,f<w&&(d=i[w-1][w-1],c=i[w][w-1]*i[w-1][w]),10===R){for(M+=l,o=0;o<=w;o++)i[o][o]-=l;j=Math.abs(i[w][w-1])+Math.abs(i[w-1][w-2]),l=d=.75*j,c=-.4375*j*j}if(30===R&&(j=(j=(d-l)/2)*j+c)>0){for(j=Math.sqrt(j),d<l&&(j=-j),j=l-c/((d-l)/2+j),o=0;o<=w;o++)i[o][o]-=j;M+=j,l=d=c=.964}for(R+=1,u=w-2;u>=f&&(I=i[u][u],E=((A=l-I)*(j=d-I)-c)/i[u+1][u]+i[u][u+1],k=i[u+1][u+1]-I-A-j,A=i[u+2][u+1],j=Math.abs(E)+Math.abs(k)+Math.abs(A),E/=j,k/=j,A/=j,u!==f)&&!(Math.abs(i[u][u-1])*(Math.abs(k)+Math.abs(A))<x*(Math.abs(E)*(Math.abs(i[u-1][u-1])+Math.abs(I)+Math.abs(i[u+1][u+1]))));)u--;for(o=u+2;o<=w;o++)i[o][o-2]=0,o>u+2&&(i[o][o-3]=0);for(a=u;a<=w-1&&(v=a!==w-1,a!==u&&(E=i[a][a-1],k=i[a+1][a-1],A=v?i[a+2][a-1]:0,0!==(l=Math.abs(E)+Math.abs(k)+Math.abs(A))&&(E/=l,k/=l,A/=l)),0!==l);a++)if(j=Math.sqrt(E*E+k*k+A*A),E<0&&(j=-j),0!==j){for(a!==u?i[a][a-1]=-j*l:f!==u&&(i[a][a-1]=-i[a][a-1]),l=(E+=j)/j,d=k/j,I=A/j,k/=E,A/=E,s=a;s<t;s++)E=i[a][s]+k*i[a+1][s],v&&(E+=A*i[a+2][s],i[a+2][s]=i[a+2][s]-E*I),i[a][s]=i[a][s]-E*l,i[a+1][s]=i[a+1][s]-E*d;for(o=0;o<=Math.min(w,a+3);o++)E=l*i[o][a]+d*i[o][a+1],v&&(E+=I*i[o][a+2],i[o][a+2]=i[o][a+2]-E*A),i[o][a]=i[o][a]-E,i[o][a+1]=i[o][a+1]-E*k;for(o=0;o<=_;o++)E=l*n[o][a]+d*n[o][a+1],v&&(E+=I*n[o][a+2],n[o][a+2]=n[o][a+2]-E*A),n[o][a]=n[o][a]-E,n[o][a+1]=n[o][a+1]-E*k}}}if(0===S)return;for(w=t-1;w>=0;w--)if(E=r[w],0===(k=e[w]))for(f=w,i[w][w]=1,o=w-1;o>=0;o--){for(c=i[o][o]-E,A=0,s=f;s<=w;s++)A+=i[o][s]*i[s][w];if(e[o]<0)I=c,j=A;else if(f=o,0===e[o]?i[o][w]=0!==c?-A/c:-A/(x*S):(l=i[o][o+1],d=i[o+1][o],k=(r[o]-E)*(r[o]-E)+e[o]*e[o],h=(l*j-I*A)/k,i[o][w]=h,i[o+1][w]=Math.abs(l)>Math.abs(I)?(-A-c*h)/l:(-j-d*h)/I),h=Math.abs(i[o][w]),x*h*h>1)for(s=o;s<=w;s++)i[s][w]=i[s][w]/h}else if(k<0)for(f=w-1,Math.abs(i[w][w-1])>Math.abs(i[w-1][w])?(i[w-1][w-1]=k/i[w][w-1],i[w-1][w]=-(i[w][w]-E)/i[w][w-1]):(y=q(0,-i[w-1][w],i[w-1][w-1]-E,k),i[w-1][w-1]=y[0],i[w-1][w]=y[1]),i[w][w-1]=0,i[w][w]=1,o=w-2;o>=0;o--){for(p=0,m=0,s=f;s<=w;s++)p+=i[o][s]*i[s][w-1],m+=i[o][s]*i[s][w];if(c=i[o][o]-E,e[o]<0)I=c,A=p,j=m;else if(f=o,0===e[o]?(y=q(-p,-m,c,k),i[o][w-1]=y[0],i[o][w]=y[1]):(l=i[o][o+1],d=i[o+1][o],b=(r[o]-E)*(r[o]-E)+e[o]*e[o]-k*k,g=2*(r[o]-E)*k,0===b&&0===g&&(b=x*S*(Math.abs(c)+Math.abs(k)+Math.abs(l)+Math.abs(d)+Math.abs(I))),y=q(l*A-I*p+k*m,l*j-I*m-k*p,b,g),i[o][w-1]=y[0],i[o][w]=y[1],Math.abs(l)>Math.abs(I)+Math.abs(k)?(i[o+1][w-1]=(-p-c*i[o][w-1]+k*i[o][w])/l,i[o+1][w]=(-m-c*i[o][w]-k*i[o][w-1])/l):(y=q(-A-d*i[o][w-1],-j-d*i[o][w],I,k),i[o+1][w-1]=y[0],i[o+1][w]=y[1])),h=Math.max(Math.abs(i[o][w-1]),Math.abs(i[o][w])),x*h*h>1)for(s=o;s<=w;s++)i[s][w-1]=i[s][w-1]/h,i[s][w]=i[s][w]/h}for(o=0;o<t;o++)if(o<0||o>_)for(s=o;s<t;s++)n[o][s]=i[o][s];for(s=t-1;s>=0;s--)for(o=0;o<=_;o++){for(I=0,a=0;a<=Math.min(s,_);a++)I+=n[o][a]*i[a][s];n[o][s]=I}}(o,h,u,s,l)}this.n=o,this.e=h,this.d=u,this.V=s}get realEigenvalues(){return this.d}get imaginaryEigenvalues(){return this.e}get eigenvectorMatrix(){return D.isMatrix(this.V)||(this.V=new D(this.V)),this.V}get diagonalMatrix(){var t,e,r=this.n,n=this.e,i=this.d,o=new D(r,r);for(t=0;t<r;t++){for(e=0;e<r;e++)o[t][e]=0;o[t][t]=i[t],n[t]>0?o[t][t+1]=n[t]:n[t]<0&&(o[t][t-1]=n[t])}return o}}function q(t,e,r,n){var i,o;return Math.abs(r)>Math.abs(n)?[(t+(i=n/r)*e)/(o=r+i*n),(e-i*t)/o]:[((i=r/n)*t+e)/(o=n+i*r),(i*e-t)/o]}class L{constructor(t){if(!(t=C.checkMatrix(t)).isSymmetric())throw new Error("Matrix is not symmetric");var e,r,n,i=t,o=i.rows,s=new D(o,o),a=!0;for(r=0;r<o;r++){var f=s[r],u=0;for(n=0;n<r;n++){var h=s[n],c=0;for(e=0;e<n;e++)c+=h[e]*f[e];f[n]=c=(i.get(r,n)-c)/s[n][n],u+=c*c}for(a&=(u=i.get(r,r)-u)>0,s[r][r]=Math.sqrt(Math.max(u,0)),n=r+1;n<o;n++)s[r][n]=0}if(!a)throw new Error("Matrix is not positive definite");this.L=s}solve(t){t=C.checkMatrix(t);var e=this.L,r=e.rows;if(t.rows!==r)throw new Error("Matrix dimensions do not match");var n,i,o,s=t.columns,a=t.clone();for(o=0;o<r;o++)for(i=0;i<s;i++){for(n=0;n<o;n++)a[o][i]-=a[n][i]*e[o][n];a[o][i]/=e[o][o]}for(o=r-1;o>=0;o--)for(i=0;i<s;i++){for(n=o+1;n<r;n++)a[o][i]-=a[n][i]*e[n][o];a[o][i]/=e[o][o]}return a}get lowerTriangularMatrix(){return this.L}}r.CHO=L,r.CholeskyDecomposition=L,r.EVD=F,r.EigenvalueDecomposition=F,r.LU=s,r.LuDecomposition=s,r.Matrix=D,r.QR=B,r.QrDecomposition=B,r.SVD=u,r.SingularValueDecomposition=u,r.WrapperMatrix1D=N,r.WrapperMatrix2D=C,r.abstractMatrix=O,r.default=D,r.inverse=function(t,e=!1){return t=C.checkMatrix(t),e?new u(t).inverse():T(t,D.eye(t.rows))},r.linearDependencies=function(t,e={}){const{thresholdValue:r=1e-9,thresholdError:n=1e-9}=e;for(var i=t.rows,s=new D(i,i),a=0;a<i;a++){var f=D.columnVector(t.getRow(a)),h=t.subMatrixRow(P(i,a)).transposeView(),c=new u(h).solve(f),l=o(D.sub(f,h.mmul(c)).abs().to1DArray());s.setRow(a,z(l,c,a,r,n))}return s},r.solve=T,r.wrap=function(t,e){if(Array.isArray(t))return t[0]&&Array.isArray(t[0])?new C(t):new N(t,e);throw new Error("the argument is not an array")}},{"ml-array-max":141,"ml-array-rescale":143}],146:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=(n=t("ml-array-rescale"))&&"object"==typeof n&&"default"in n?n.default:n;function o(t,e,r){let n=r?t.rows:t.rows-1;if(e<0||e>n)throw new RangeError("Row index out of range")}function s(t,e,r){let n=r?t.columns:t.columns-1;if(e<0||e>n)throw new RangeError("Column index out of range")}function a(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function f(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function u(t,e,r){return{row:h(t,e),column:c(t,r)}}function h(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for row indices");if(e.some(e=>e<0||e>=t.rows))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function c(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for column indices");if(e.some(e=>e<0||e>=t.columns))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function l(t,e,r,n,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(p("startRow",e),p("endRow",r),p("startColumn",n),p("endColumn",i),e>r||n>i||e<0||e>=t.rows||r<0||r>=t.rows||n<0||n>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function d(t,e=0){let r=[];for(let n=0;n<t;n++)r.push(e);return r}function p(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}const m=15,b=10,g=8;function v(t){const e=String(t);if(e.length<=g)return e.padEnd(g," ");const r=t.toPrecision(g-2);if(r.length<=g)return r;const n=t.toExponential(g-2),i=n.indexOf("e"),o=n.substring(i);return n.substring(0,g-o.length)+o}class y{static from1DArray(t,e,r){if(t*e!==r.length)throw new RangeError("data length does not match given dimensions");let n=new _(t,e);for(let i=0;i<t;i++)for(let t=0;t<e;t++)n.set(i,t,r[i*e+t]);return n}static rowVector(t){let e=new _(1,t.length);for(let r=0;r<t.length;r++)e.set(0,r,t[r]);return e}static columnVector(t){let e=new _(t.length,1);for(let r=0;r<t.length;r++)e.set(r,0,t[r]);return e}static zeros(t,e){return new _(t,e)}static ones(t,e){return new _(t,e).fill(1)}static rand(t,e,r={}){if("object"!=typeof r)throw new TypeError("options must be an object");const{random:n=Math.random}=r;let i=new _(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++)i.set(r,t,n());return i}static randInt(t,e,r={}){if("object"!=typeof r)throw new TypeError("options must be an object");const{min:n=0,max:i=1e3,random:o=Math.random}=r;if(!Number.isInteger(n))throw new TypeError("min must be an integer");if(!Number.isInteger(i))throw new TypeError("max must be an integer");if(n>=i)throw new RangeError("min must be smaller than max");let s=i-n,a=new _(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++){let e=n+Math.round(o()*s);a.set(r,t,e)}return a}static eye(t,e,r){void 0===e&&(e=t),void 0===r&&(r=1);let n=Math.min(t,e),i=this.zeros(t,e);for(let t=0;t<n;t++)i.set(t,t,r);return i}static diag(t,e,r){let n=t.length;void 0===e&&(e=n),void 0===r&&(r=e);let i=Math.min(n,e,r),o=this.zeros(e,r);for(let e=0;e<i;e++)o.set(e,e,t[e]);return o}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let r=t.rows,n=t.columns,i=new _(r,n);for(let o=0;o<r;o++)for(let r=0;r<n;r++)i.set(o,r,Math.min(t.get(o,r),e.get(o,r)));return i}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let r=t.rows,n=t.columns,i=new this(r,n);for(let o=0;o<r;o++)for(let r=0;r<n;r++)i.set(o,r,Math.max(t.get(o,r),e.get(o,r)));return i}static checkMatrix(t){return y.isMatrix(t)?t:new _(t)}static isMatrix(t){return null!=t&&"Matrix"===t.klass}get size(){return this.rows*this.columns}apply(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t.call(this,e,r);return this}to1DArray(){let t=[];for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t.push(this.get(e,r));return t}to2DArray(){let t=[];for(let e=0;e<this.rows;e++){t.push([]);for(let r=0;r<this.columns;r++)t[e].push(this.get(e,r))}return t}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isSymmetric(){if(this.isSquare()){for(let t=0;t<this.rows;t++)for(let e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}isEchelonForm(){let t=0,e=0,r=-1,n=!0,i=!1;for(;t<this.rows&&n;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>r?(i=!0,r=e):(n=!1,i=!0);t++}return n}isReducedEchelonForm(){let t=0,e=0,r=-1,n=!0,i=!1;for(;t<this.rows&&n;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>r?(i=!0,r=e):(n=!1,i=!0);for(let r=e+1;r<this.rows;r++)0!==this.get(t,r)&&(n=!1);t++}return n}echelonForm(){let t=this.clone(),e=0,r=0;for(;e<t.rows&&r<t.columns;){let n=e;for(let i=e;i<t.rows;i++)t.get(i,r)>t.get(n,r)&&(n=i);if(0===t.get(n,r))r++;else{t.swapRows(e,n);let i=t.get(e,r);for(let n=r;n<t.columns;n++)t.set(e,n,t.get(e,n)/i);for(let n=e+1;n<t.rows;n++){let i=t.get(n,r)/t.get(e,r);t.set(n,r,0);for(let o=r+1;o<t.columns;o++)t.set(n,o,t.get(n,o)-t.get(e,o)*i)}e++,r++}}return t}reducedEchelonForm(){let t=this.echelonForm(),e=t.columns,r=t.rows,n=r-1;for(;n>=0;)if(0===t.maxRow(n))n--;else{let i=0,o=!1;for(;i<r&&!1===o;)1===t.get(n,i)?o=!0:i++;for(let r=0;r<n;r++){let o=t.get(r,i);for(let s=i;s<e;s++){let e=t.get(r,s)-o*t.get(n,s);t.set(r,s,e)}}n--}return t}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{rows:e=1,columns:r=1}=t;if(!Number.isInteger(e)||e<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(r)||r<=0)throw new TypeError("columns must be a positive integer");let n=new _(this.rows*e,this.columns*r);for(let t=0;t<e;t++)for(let e=0;e<r;e++)n.setSubMatrix(this,this.rows*t,this.columns*e);return n}fill(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,t);return this}neg(){return this.mulS(-1)}getRow(t){o(this,t);let e=[];for(let r=0;r<this.columns;r++)e.push(this.get(t,r));return e}getRowVector(t){return _.rowVector(this.getRow(t))}setRow(t,e){o(this,t),e=a(this,e);for(let r=0;r<this.columns;r++)this.set(t,r,e[r]);return this}swapRows(t,e){o(this,t),o(this,e);for(let r=0;r<this.columns;r++){let n=this.get(t,r);this.set(t,r,this.get(e,r)),this.set(e,r,n)}return this}getColumn(t){s(this,t);let e=[];for(let r=0;r<this.rows;r++)e.push(this.get(r,t));return e}getColumnVector(t){return _.columnVector(this.getColumn(t))}setColumn(t,e){s(this,t),e=f(this,e);for(let r=0;r<this.rows;r++)this.set(r,t,e[r]);return this}swapColumns(t,e){s(this,t),s(this,e);for(let r=0;r<this.rows;r++){let n=this.get(r,t);this.set(r,t,this.get(r,e)),this.set(r,e,n)}return this}addRowVector(t){t=a(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t[r]);return this}subRowVector(t){t=a(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t[r]);return this}mulRowVector(t){t=a(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t[r]);return this}divRowVector(t){t=a(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t[r]);return this}addColumnVector(t){t=f(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t[e]);return this}subColumnVector(t){t=f(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t[e]);return this}mulColumnVector(t){t=f(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t[e]);return this}divColumnVector(t){t=f(this,t);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t[e]);return this}mulRow(t,e){o(this,t);for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)*e);return this}mulColumn(t,e){s(this,t);for(let r=0;r<this.rows;r++)this.set(r,t,this.get(r,t)*e);return this}max(){let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.get(e,r)>t&&(t=this.get(e,r));return t}maxIndex(){let t=this.get(0,0),e=[0,0];for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>t&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}min(){let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.get(e,r)<t&&(t=this.get(e,r));return t}minIndex(){let t=this.get(0,0),e=[0,0];for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<t&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}maxRow(t){o(this,t);let e=this.get(t,0);for(let r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r));return e}maxRowIndex(t){o(this,t);let e=this.get(t,0),r=[t,0];for(let n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n),r[1]=n);return r}minRow(t){o(this,t);let e=this.get(t,0);for(let r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r));return e}minRowIndex(t){o(this,t);let e=this.get(t,0),r=[t,0];for(let n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n),r[1]=n);return r}maxColumn(t){s(this,t);let e=this.get(0,t);for(let r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t));return e}maxColumnIndex(t){s(this,t);let e=this.get(0,t),r=[0,t];for(let n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t),r[0]=n);return r}minColumn(t){s(this,t);let e=this.get(0,t);for(let r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t));return e}minColumnIndex(t){s(this,t);let e=this.get(0,t),r=[0,t];for(let n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t),r[0]=n);return r}diag(){let t=Math.min(this.rows,this.columns),e=[];for(let r=0;r<t;r++)e.push(this.get(r,r));return e}norm(t="frobenius"){let e=0;if("max"===t)return this.max();if("frobenius"===t){for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e+=this.get(t,r)*this.get(t,r);return Math.sqrt(e)}throw new RangeError(`unknown norm type: ${t}`)}cumulativeSum(){let t=0;for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t+=this.get(e,r),this.set(e,r,t);return this}dot(t){y.isMatrix(t)&&(t=t.to1DArray());let e=this.to1DArray();if(e.length!==t.length)throw new RangeError("vectors do not have the same size");let r=0;for(let n=0;n<e.length;n++)r+=e[n]*t[n];return r}mmul(t){t=_.checkMatrix(t);let e=this.rows,r=this.columns,n=t.columns,i=new _(e,n),o=new Float64Array(r);for(let s=0;s<n;s++){for(let e=0;e<r;e++)o[e]=t.get(e,s);for(let t=0;t<e;t++){let e=0;for(let n=0;n<r;n++)e+=this.get(t,n)*o[n];i.set(t,s,e)}}return i}strassen2x2(t){t=_.checkMatrix(t);let e=new _(2,2);const r=this.get(0,0),n=t.get(0,0),i=this.get(0,1),o=t.get(0,1),s=this.get(1,0),a=t.get(1,0),f=this.get(1,1),u=t.get(1,1),h=(r+f)*(n+u),c=(s+f)*n,l=r*(o-u),d=f*(a-n),p=(r+i)*u,m=h+d-p+(i-f)*(a+u),b=l+p,g=c+d,v=h-c+l+(s-r)*(n+o);return e.set(0,0,m),e.set(0,1,b),e.set(1,0,g),e.set(1,1,v),e}strassen3x3(t){t=_.checkMatrix(t);let e=new _(3,3);const r=this.get(0,0),n=this.get(0,1),i=this.get(0,2),o=this.get(1,0),s=this.get(1,1),a=this.get(1,2),f=this.get(2,0),u=this.get(2,1),h=this.get(2,2),c=t.get(0,0),l=t.get(0,1),d=t.get(0,2),p=t.get(1,0),m=t.get(1,1),b=t.get(1,2),g=t.get(2,0),v=t.get(2,1),y=t.get(2,2),w=(r-o)*(-l+m),x=(-r+o+s)*(c-l+m),M=(o+s)*(-c+l),S=r*c,E=(-r+f+u)*(c-d+b),k=(-r+f)*(d-b),A=(f+u)*(-c+d),j=(-i+u+h)*(m+g-v),I=(i-h)*(m-v),R=i*g,O=(u+h)*(-g+v),D=(-i+s+a)*(b+g-y),N=(i-a)*(b-y),C=(s+a)*(-g+y),B=S+R+n*p,T=(r+n+i-o-s-u-h)*m+x+M+S+j+R+O,P=S+E+A+(r+n+i-s-a-f-u)*b+R+D+C,z=w+s*(-c+l+p-m-b-g+y)+x+S+R+D+N,F=w+x+M+S+a*v,q=R+D+N+C+o*d,L=S+E+k+u*(-c+d+p-m-b-g+v)+j+I+R,U=j+I+R+O+f*l,V=S+E+k+A+h*y;return e.set(0,0,B),e.set(0,1,T),e.set(0,2,P),e.set(1,0,z),e.set(1,1,F),e.set(1,2,q),e.set(2,0,L),e.set(2,1,U),e.set(2,2,V),e}mmulStrassen(t){t=_.checkMatrix(t);let e=this.clone(),r=e.rows,n=e.columns,i=t.rows,o=t.columns;function s(t,e,r){let n=t.rows,i=t.columns;if(n===e&&i===r)return t;{let n=y.zeros(e,r);return n=n.setSubMatrix(t,0,0)}}n!==i&&console.warn(`Multiplying ${r} x ${n} and ${i} x ${o} matrix: dimensions do not match.`);let a=Math.max(r,i),f=Math.max(n,o);return function t(e,r,n,i){if(n<=512||i<=512)return e.mmul(r);n%2==1&&i%2==1?(e=s(e,n+1,i+1),r=s(r,n+1,i+1)):n%2==1?(e=s(e,n+1,i),r=s(r,n+1,i)):i%2==1&&(e=s(e,n,i+1),r=s(r,n,i+1));let o=parseInt(e.rows/2,10),a=parseInt(e.columns/2,10),f=e.subMatrix(0,o-1,0,a-1),u=r.subMatrix(0,o-1,0,a-1),h=e.subMatrix(0,o-1,a,e.columns-1),c=r.subMatrix(0,o-1,a,r.columns-1),l=e.subMatrix(o,e.rows-1,0,a-1),d=r.subMatrix(o,r.rows-1,0,a-1),p=e.subMatrix(o,e.rows-1,a,e.columns-1),m=r.subMatrix(o,r.rows-1,a,r.columns-1),b=t(y.add(f,p),y.add(u,m),o,a),g=t(y.add(l,p),u,o,a),v=t(f,y.sub(c,m),o,a),w=t(p,y.sub(d,u),o,a),_=t(y.add(f,h),m,o,a),x=t(y.sub(l,f),y.add(u,c),o,a),M=t(y.sub(h,p),y.add(d,m),o,a),S=y.add(b,w);S.sub(_),S.add(M);let E=y.add(v,_),k=y.add(g,w),A=y.sub(b,g);A.add(v),A.add(x);let j=y.zeros(2*S.rows,2*S.columns);return(j=(j=(j=(j=j.setSubMatrix(S,0,0)).setSubMatrix(E,S.rows,0)).setSubMatrix(k,0,S.columns)).setSubMatrix(A,S.rows,S.columns)).subMatrix(0,n-1,0,i-1)}(e=s(e,a,f),t=s(t,a,f),a,f)}scaleRows(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:r=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(e>=r)throw new RangeError("min must be smaller than max");let n=new _(this.rows,this.columns);for(let t=0;t<this.rows;t++){const o=this.getRow(t);i(o,{min:e,max:r,output:o}),n.setRow(t,o)}return n}scaleColumns(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:r=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(e>=r)throw new RangeError("min must be smaller than max");let n=new _(this.rows,this.columns);for(let t=0;t<this.columns;t++){const o=this.getColumn(t);i(o,{min:e,max:r,output:o}),n.setColumn(t,o)}return n}flipRows(){const t=Math.ceil(this.columns/2);for(let e=0;e<this.rows;e++)for(let r=0;r<t;r++){let t=this.get(e,r),n=this.get(e,this.columns-1-r);this.set(e,r,n),this.set(e,this.columns-1-r,t)}return this}flipColumns(){const t=Math.ceil(this.rows/2);for(let e=0;e<this.columns;e++)for(let r=0;r<t;r++){let t=this.get(r,e),n=this.get(this.rows-1-r,e);this.set(r,e,n),this.set(this.rows-1-r,e,t)}return this}kroneckerProduct(t){t=_.checkMatrix(t);let e=this.rows,r=this.columns,n=t.rows,i=t.columns,o=new _(e*n,r*i);for(let s=0;s<e;s++)for(let e=0;e<r;e++)for(let r=0;r<n;r++)for(let a=0;a<i;a++)o.set(n*s+r,i*e+a,this.get(s,e)*t.get(r,a));return o}transpose(){let t=new _(this.columns,this.rows);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t.set(r,e,this.get(e,r));return t}sortRows(t=w){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=w){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,r,n){l(this,t,e,r,n);let i=new _(e-t+1,n-r+1);for(let o=t;o<=e;o++)for(let e=r;e<=n;e++)i.set(o-t,e-r,this.get(o,e));return i}subMatrixRow(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.columns-1),e>r||e<0||e>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");let n=new _(t.length,r-e+1);for(let i=0;i<t.length;i++)for(let o=e;o<=r;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError(`Row index out of range: ${t[i]}`);n.set(i,o-e,this.get(t[i],o))}return n}subMatrixColumn(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.rows-1),e>r||e<0||e>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");let n=new _(r-e+1,t.length);for(let i=0;i<t.length;i++)for(let o=e;o<=r;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError(`Column index out of range: ${t[i]}`);n.set(o-e,i,this.get(o,t[i]))}return n}setSubMatrix(t,e,r){l(this,e,e+(t=_.checkMatrix(t)).rows-1,r,r+t.columns-1);for(let n=0;n<t.rows;n++)for(let i=0;i<t.columns;i++)this.set(e+n,r+i,t.get(n,i));return this}selection(t,e){let r=u(this,t,e),n=new _(t.length,e.length);for(let t=0;t<r.row.length;t++){let e=r.row[t];for(let i=0;i<r.column.length;i++){let o=r.column[i];n.set(t,i,this.get(e,o))}}return n}trace(){let t=Math.min(this.rows,this.columns),e=0;for(let r=0;r<t;r++)e+=this.get(r,r);return e}clone(){let t=new _(this.rows,this.columns);for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)t.set(e,r,this.get(e,r));return t}sum(t){switch(t){case"row":return function(t){let e=d(t.rows);for(let r=0;r<t.rows;++r)for(let n=0;n<t.columns;++n)e[r]+=t.get(r,n);return e}(this);case"column":return function(t){let e=d(t.columns);for(let r=0;r<t.rows;++r)for(let n=0;n<t.columns;++n)e[n]+=t.get(r,n);return e}(this);case void 0:return function(t){let e=0;for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)e+=t.get(r,n);return e}(this);default:throw new Error(`invalid option: ${t}`)}}product(t){switch(t){case"row":return function(t){let e=d(t.rows,1);for(let r=0;r<t.rows;++r)for(let n=0;n<t.columns;++n)e[r]*=t.get(r,n);return e}(this);case"column":return function(t){let e=d(t.columns,1);for(let r=0;r<t.rows;++r)for(let n=0;n<t.columns;++n)e[n]*=t.get(r,n);return e}(this);case void 0:return function(t){let e=1;for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)e*=t.get(r,n);return e}(this);default:throw new Error(`invalid option: ${t}`)}}mean(t){const e=this.sum(t);switch(t){case"row":for(let t=0;t<this.rows;t++)e[t]/=this.columns;return e;case"column":for(let t=0;t<this.columns;t++)e[t]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error(`invalid option: ${t}`)}}variance(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{unbiased:r=!0,mean:n=this.mean(t)}=e;if("boolean"!=typeof r)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(n))throw new TypeError("mean must be an array");return function(t,e,r){const n=t.rows,i=t.columns,o=[];for(let s=0;s<n;s++){let n=0,a=0,f=0;for(let e=0;e<i;e++)n+=f=t.get(s,e)-r[s],a+=f*f;e?o.push((a-n*n/i)/(i-1)):o.push((a-n*n/i)/i)}return o}(this,r,n);case"column":if(!Array.isArray(n))throw new TypeError("mean must be an array");return function(t,e,r){const n=t.rows,i=t.columns,o=[];for(let s=0;s<i;s++){let i=0,a=0,f=0;for(let e=0;e<n;e++)i+=f=t.get(e,s)-r[s],a+=f*f;e?o.push((a-i*i/n)/(n-1)):o.push((a-i*i/n)/n)}return o}(this,r,n);case void 0:if("number"!=typeof n)throw new TypeError("mean must be a number");return function(t,e,r){const n=t.rows,i=t.columns,o=n*i;let s=0,a=0,f=0;for(let e=0;e<n;e++)for(let n=0;n<i;n++)s+=f=t.get(e,n)-r,a+=f*f;return e?(a-s*s/o)/(o-1):(a-s*s/o)/o}(this,r,n);default:throw new Error(`invalid option: ${t}`)}}standardDeviation(t,e){"object"==typeof t&&(e=t,t=void 0);const r=this.variance(t,e);if(void 0===t)return Math.sqrt(r);for(let t=0;t<r.length;t++)r[t]=Math.sqrt(r[t]);return r}center(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{center:r=this.mean(t)}=e;switch(t){case"row":if(!Array.isArray(r))throw new TypeError("center must be an array");return function(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)-e[r])}(this,r),this;case"column":if(!Array.isArray(r))throw new TypeError("center must be an array");return function(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)-e[n])}(this,r),this;case void 0:if("number"!=typeof r)throw new TypeError("center must be a number");return function(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)-e)}(this,r),this;default:throw new Error(`invalid option: ${t}`)}}scale(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");let r=e.scale;switch(t){case"row":if(void 0===r)r=function(t){const e=[];for(let r=0;r<t.rows;r++){let n=0;for(let e=0;e<t.columns;e++)n+=Math.pow(t.get(r,e),2)/(t.columns-1);e.push(Math.sqrt(n))}return e}(this);else if(!Array.isArray(r))throw new TypeError("scale must be an array");return function(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)/e[r])}(this,r),this;case"column":if(void 0===r)r=function(t){const e=[];for(let r=0;r<t.columns;r++){let n=0;for(let e=0;e<t.rows;e++)n+=Math.pow(t.get(e,r),2)/(t.rows-1);e.push(Math.sqrt(n))}return e}(this);else if(!Array.isArray(r))throw new TypeError("scale must be an array");return function(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)/e[n])}(this,r),this;case void 0:if(void 0===r)r=function(t){const e=t.size-1;let r=0;for(let n=0;n<t.columns;n++)for(let i=0;i<t.rows;i++)r+=Math.pow(t.get(i,n),2)/e;return Math.sqrt(r)}(this);else if("number"!=typeof r)throw new TypeError("scale must be a number");return function(t,e){for(let r=0;r<t.rows;r++)for(let n=0;n<t.columns;n++)t.set(r,n,t.get(r,n)/e)}(this,r),this;default:throw new Error(`invalid option: ${t}`)}}}function w(t,e){return t-e}y.prototype.klass="Matrix","undefined"!=typeof Symbol&&(y.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){const t=" ".repeat(2),e=" ".repeat(4);return`${this.constructor.name} {\n${t}[\n${e}${function(t,e){const{rows:r,columns:n}=t,i=Math.min(r,m),o=Math.min(n,b),s=[];for(let e=0;e<i;e++){let r=[];for(let n=0;n<o;n++)r.push(v(t.get(e,n)));s.push(`${r.join(" ")}`)}return o!==n&&(s[s.length-1]+=` ... ${n-b} more columns`),i!==r&&s.push(`... ${r-m} more rows`),s.join(`\n${e}`)}(this,e)}\n${t}]\n${t}rows: ${this.rows}\n${t}columns: ${this.columns}\n}`}),y.random=y.rand,y.randomInt=y.randInt,y.diagonal=y.diag,y.prototype.diagonal=y.prototype.diag,y.identity=y.eye,y.prototype.negate=y.prototype.neg,y.prototype.tensorProduct=y.prototype.kroneckerProduct;class _ extends y{constructor(t,e){if(super(),_.isMatrix(t))return t.clone();if(Number.isInteger(t)&&t>0){if(this.data=[],!(Number.isInteger(e)&&e>0))throw new TypeError("nColumns must be a positive integer");for(let r=0;r<t;r++)this.data.push(new Float64Array(e))}else{if(!Array.isArray(t))throw new TypeError("First argument must be a positive number or an array");{const r=t;if(t=r.length,"number"!=typeof(e=r[0].length)||0===e)throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let n=0;n<t;n++){if(r[n].length!==e)throw new RangeError("Inconsistent array dimensions");this.data.push(Float64Array.from(r[n]))}}}return this.rows=t,this.columns=e,this}set(t,e,r){return this.data[t][e]=r,this}get(t,e){return this.data[t][e]}removeRow(t){if(o(this,t),1===this.rows)throw new RangeError("A matrix cannot have less than one row");return this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),o(this,t,!0),e=Float64Array.from(a(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){if(s(this,t),1===this.columns)throw new RangeError("A matrix cannot have less than one column");for(let e=0;e<this.rows;e++){const r=new Float64Array(this.columns-1);for(let n=0;n<t;n++)r[n]=this.data[e][n];for(let n=t+1;n<this.columns;n++)r[n-1]=this.data[e][n];this.data[e]=r}return this.columns-=1,this}addColumn(t,e){void 0===e&&(e=t,t=this.columns),s(this,t,!0),e=f(this,e);for(let r=0;r<this.rows;r++){const n=new Float64Array(this.columns+1);let i=0;for(;i<t;i++)n[i]=this.data[r][i];for(n[i++]=e[r];i<this.columns+1;i++)n[i]=this.data[r][i-1];this.data[r]=n}return this.columns+=1,this}}!function(t,e){t.prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},t.prototype.addS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t);return this},t.prototype.addM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)+t.get(e,r));return this},t.add=function(t,r){return new e(t).add(r)},t.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},t.prototype.subS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t);return this},t.prototype.subM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)-t.get(e,r));return this},t.sub=function(t,r){return new e(t).sub(r)},t.prototype.subtract=t.prototype.sub,t.prototype.subtractS=t.prototype.subS,t.prototype.subtractM=t.prototype.subM,t.subtract=t.sub,t.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},t.prototype.mulS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t);return this},t.prototype.mulM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t.get(e,r));return this},t.mul=function(t,r){return new e(t).mul(r)},t.prototype.multiply=t.prototype.mul,t.prototype.multiplyS=t.prototype.mulS,t.prototype.multiplyM=t.prototype.mulM,t.multiply=t.mul,t.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},t.prototype.divS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t);return this},t.prototype.divM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)/t.get(e,r));return this},t.div=function(t,r){return new e(t).div(r)},t.prototype.divide=t.prototype.div,t.prototype.divideS=t.prototype.divS,t.prototype.divideM=t.prototype.divM,t.divide=t.div,t.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},t.prototype.modS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)%t);return this},t.prototype.modM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)%t.get(e,r));return this},t.mod=function(t,r){return new e(t).mod(r)},t.prototype.modulus=t.prototype.mod,t.prototype.modulusS=t.prototype.modS,t.prototype.modulusM=t.prototype.modM,t.modulus=t.mod,t.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},t.prototype.andS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)&t);return this},t.prototype.andM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)&t.get(e,r));return this},t.and=function(t,r){return new e(t).and(r)},t.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},t.prototype.orS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)|t);return this},t.prototype.orM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)|t.get(e,r));return this},t.or=function(t,r){return new e(t).or(r)},t.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},t.prototype.xorS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)^t);return this},t.prototype.xorM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)^t.get(e,r));return this},t.xor=function(t,r){return new e(t).xor(r)},t.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},t.prototype.leftShiftS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)<<t);return this},t.prototype.leftShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)<<t.get(e,r));return this},t.leftShift=function(t,r){return new e(t).leftShift(r)},t.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},t.prototype.signPropagatingRightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)>>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)>>t.get(e,r));return this},t.signPropagatingRightShift=function(t,r){return new e(t).signPropagatingRightShift(r)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)>>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)>>>t.get(e,r));return this},t.rightShift=function(t,r){return new e(t).rightShift(r)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},t.not=function(t){return new e(t).not()},t.prototype.abs=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},t.abs=function(t){return new e(t).abs()},t.prototype.acos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},t.acos=function(t){return new e(t).acos()},t.prototype.acosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},t.acosh=function(t){return new e(t).acosh()},t.prototype.asin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},t.asin=function(t){return new e(t).asin()},t.prototype.asinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},t.asinh=function(t){return new e(t).asinh()},t.prototype.atan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},t.atan=function(t){return new e(t).atan()},t.prototype.atanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},t.atanh=function(t){return new e(t).atanh()},t.prototype.cbrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},t.cbrt=function(t){return new e(t).cbrt()},t.prototype.ceil=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},t.ceil=function(t){return new e(t).ceil()},t.prototype.clz32=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},t.clz32=function(t){return new e(t).clz32()},t.prototype.cos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},t.cos=function(t){return new e(t).cos()},t.prototype.cosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},t.cosh=function(t){return new e(t).cosh()},t.prototype.exp=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},t.exp=function(t){return new e(t).exp()},t.prototype.expm1=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},t.expm1=function(t){return new e(t).expm1()},t.prototype.floor=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},t.floor=function(t){return new e(t).floor()},t.prototype.fround=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},t.fround=function(t){return new e(t).fround()},t.prototype.log=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},t.log=function(t){return new e(t).log()},t.prototype.log1p=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},t.log1p=function(t){return new e(t).log1p()},t.prototype.log10=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},t.log10=function(t){return new e(t).log10()},t.prototype.log2=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},t.log2=function(t){return new e(t).log2()},t.prototype.round=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},t.round=function(t){return new e(t).round()},t.prototype.sign=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},t.sign=function(t){return new e(t).sign()},t.prototype.sin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},t.sin=function(t){return new e(t).sin()},t.prototype.sinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},t.sinh=function(t){return new e(t).sinh()},t.prototype.sqrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},t.sqrt=function(t){return new e(t).sqrt()},t.prototype.tan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},t.tan=function(t){return new e(t).tan()},t.prototype.tanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},t.tanh=function(t){return new e(t).tanh()},t.prototype.trunc=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},t.trunc=function(t){return new e(t).trunc()},t.pow=function(t,r){return new e(t).pow(r)},t.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},t.prototype.powS=function(t){for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,Math.pow(this.get(e,r),t));return this},t.prototype.powM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let r=0;r<this.columns;r++)this.set(e,r,Math.pow(this.get(e,r),t.get(e,r)));return this}}(y,_);class x extends y{constructor(t,e,r){super(),this.matrix=t,this.rows=e,this.columns=r}}class M extends x{constructor(t,e,r){let n=u(t,e,r);super(t,n.row.length,n.column.length),this.rowIndices=n.row,this.columnIndices=n.column}set(t,e,r){return this.matrix.set(this.rowIndices[t],this.columnIndices[e],r),this}get(t,e){return this.matrix.get(this.rowIndices[t],this.columnIndices[e])}}class S extends y{constructor(t,e={}){const{rows:r=1}=e;if(t.length%r!=0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=r,this.columns=t.length/r,this.data=t}set(t,e,r){let n=this._calculateIndex(t,e);return this.data[n]=r,this}get(t,e){let r=this._calculateIndex(t,e);return this.data[r]}_calculateIndex(t,e){return t*this.columns+e}}class E extends y{constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,r){return this.data[t][e]=r,this}get(t,e){return this.data[t][e]}}class k{constructor(t){let e,r,n,i,o,s,a,f,u,h=(t=E.checkMatrix(t)).clone(),c=h.rows,l=h.columns,d=new Float64Array(c),p=1;for(e=0;e<c;e++)d[e]=e;for(f=new Float64Array(c),r=0;r<l;r++){for(e=0;e<c;e++)f[e]=h.get(e,r);for(e=0;e<c;e++){for(u=Math.min(e,r),o=0,n=0;n<u;n++)o+=h.get(e,n)*f[n];f[e]-=o,h.set(e,r,f[e])}for(i=r,e=r+1;e<c;e++)Math.abs(f[e])>Math.abs(f[i])&&(i=e);if(i!==r){for(n=0;n<l;n++)s=h.get(i,n),h.set(i,n,h.get(r,n)),h.set(r,n,s);a=d[i],d[i]=d[r],d[r]=a,p=-p}if(r<c&&0!==h.get(r,r))for(e=r+1;e<c;e++)h.set(e,r,h.get(e,r)/h.get(r,r))}this.LU=h,this.pivotVector=d,this.pivotSign=p}isSingular(){let t=this.LU,e=t.columns;for(let r=0;r<e;r++)if(0===t.get(r,r))return!0;return!1}solve(t){t=_.checkMatrix(t);let e=this.LU;if(e.rows!==t.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let r,n,i,o=t.columns,s=t.subMatrixRow(this.pivotVector,0,o-1),a=e.columns;for(i=0;i<a;i++)for(r=i+1;r<a;r++)for(n=0;n<o;n++)s.set(r,n,s.get(r,n)-s.get(i,n)*e.get(r,i));for(i=a-1;i>=0;i--){for(n=0;n<o;n++)s.set(i,n,s.get(i,n)/e.get(i,i));for(r=0;r<i;r++)for(n=0;n<o;n++)s.set(r,n,s.get(r,n)-s.get(i,n)*e.get(r,i))}return s}get determinant(){let t=this.LU;if(!t.isSquare())throw new Error("Matrix must be square");let e=this.pivotSign,r=t.columns;for(let n=0;n<r;n++)e*=t.get(n,n);return e}get lowerTriangularMatrix(){let t=this.LU,e=t.rows,r=t.columns,n=new _(e,r);for(let i=0;i<e;i++)for(let e=0;e<r;e++)i>e?n.set(i,e,t.get(i,e)):i===e?n.set(i,e,1):n.set(i,e,0);return n}get upperTriangularMatrix(){let t=this.LU,e=t.rows,r=t.columns,n=new _(e,r);for(let i=0;i<e;i++)for(let e=0;e<r;e++)i<=e?n.set(i,e,t.get(i,e)):n.set(i,e,0);return n}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function A(t,e){let r=0;return Math.abs(t)>Math.abs(e)?(r=e/t,Math.abs(t)*Math.sqrt(1+r*r)):0!==e?(r=t/e,Math.abs(e)*Math.sqrt(1+r*r)):0}class j{constructor(t){let e,r,n,i,o=(t=E.checkMatrix(t)).clone(),s=t.rows,a=t.columns,f=new Float64Array(a);for(n=0;n<a;n++){let t=0;for(e=n;e<s;e++)t=A(t,o.get(e,n));if(0!==t){for(o.get(n,n)<0&&(t=-t),e=n;e<s;e++)o.set(e,n,o.get(e,n)/t);for(o.set(n,n,o.get(n,n)+1),r=n+1;r<a;r++){for(i=0,e=n;e<s;e++)i+=o.get(e,n)*o.get(e,r);for(i=-i/o.get(n,n),e=n;e<s;e++)o.set(e,r,o.get(e,r)+i*o.get(e,n))}}f[n]=-t}this.QR=o,this.Rdiag=f}solve(t){t=_.checkMatrix(t);let e=this.QR,r=e.rows;if(t.rows!==r)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let n,i,o,s,a=t.columns,f=t.clone(),u=e.columns;for(o=0;o<u;o++)for(i=0;i<a;i++){for(s=0,n=o;n<r;n++)s+=e.get(n,o)*f.get(n,i);for(s=-s/e.get(o,o),n=o;n<r;n++)f.set(n,i,f.get(n,i)+s*e.get(n,o))}for(o=u-1;o>=0;o--){for(i=0;i<a;i++)f.set(o,i,f.get(o,i)/this.Rdiag[o]);for(n=0;n<o;n++)for(i=0;i<a;i++)f.set(n,i,f.get(n,i)-f.get(o,i)*e.get(n,o))}return f.subMatrix(0,u-1,0,a-1)}isFullRank(){let t=this.QR.columns;for(let e=0;e<t;e++)if(0===this.Rdiag[e])return!1;return!0}get upperTriangularMatrix(){let t,e,r=this.QR,n=r.columns,i=new _(n,n);for(t=0;t<n;t++)for(e=0;e<n;e++)t<e?i.set(t,e,r.get(t,e)):t===e?i.set(t,e,this.Rdiag[t]):i.set(t,e,0);return i}get orthogonalMatrix(){let t,e,r,n,i=this.QR,o=i.rows,s=i.columns,a=new _(o,s);for(r=s-1;r>=0;r--){for(t=0;t<o;t++)a.set(t,r,0);for(a.set(r,r,1),e=r;e<s;e++)if(0!==i.get(r,r)){for(n=0,t=r;t<o;t++)n+=i.get(t,r)*a.get(t,e);for(n=-n/i.get(r,r),t=r;t<o;t++)a.set(t,e,a.get(t,e)+n*i.get(t,r))}}return a}}class I{constructor(t,e={}){let r=(t=E.checkMatrix(t)).rows,n=t.columns;const{computeLeftSingularVectors:i=!0,computeRightSingularVectors:o=!0,autoTranspose:s=!1}=e;let a,f=Boolean(i),u=Boolean(o),h=!1;if(r<n)if(s){r=(a=t.transpose()).rows,n=a.columns,h=!0;let e=f;f=u,u=e}else a=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else a=t.clone();let c=Math.min(r,n),l=Math.min(r+1,n),d=new Float64Array(l),p=new _(r,c),m=new _(n,n),b=new Float64Array(n),g=new Float64Array(r),v=new Float64Array(l);for(let t=0;t<l;t++)v[t]=t;let y=Math.min(r-1,n),w=Math.max(0,Math.min(n-2,r)),x=Math.max(y,w);for(let t=0;t<x;t++){if(t<y){d[t]=0;for(let e=t;e<r;e++)d[t]=A(d[t],a.get(e,t));if(0!==d[t]){a.get(t,t)<0&&(d[t]=-d[t]);for(let e=t;e<r;e++)a.set(e,t,a.get(e,t)/d[t]);a.set(t,t,a.get(t,t)+1)}d[t]=-d[t]}for(let e=t+1;e<n;e++){if(t<y&&0!==d[t]){let n=0;for(let i=t;i<r;i++)n+=a.get(i,t)*a.get(i,e);n=-n/a.get(t,t);for(let i=t;i<r;i++)a.set(i,e,a.get(i,e)+n*a.get(i,t))}b[e]=a.get(t,e)}if(f&&t<y)for(let e=t;e<r;e++)p.set(e,t,a.get(e,t));if(t<w){b[t]=0;for(let e=t+1;e<n;e++)b[t]=A(b[t],b[e]);if(0!==b[t]){b[t+1]<0&&(b[t]=0-b[t]);for(let e=t+1;e<n;e++)b[e]/=b[t];b[t+1]+=1}if(b[t]=-b[t],t+1<r&&0!==b[t]){for(let e=t+1;e<r;e++)g[e]=0;for(let e=t+1;e<r;e++)for(let r=t+1;r<n;r++)g[e]+=b[r]*a.get(e,r);for(let e=t+1;e<n;e++){let n=-b[e]/b[t+1];for(let i=t+1;i<r;i++)a.set(i,e,a.get(i,e)+n*g[i])}}if(u)for(let e=t+1;e<n;e++)m.set(e,t,b[e])}}let M=Math.min(n,r+1);if(y<n&&(d[y]=a.get(y,y)),r<M&&(d[M-1]=0),w+1<M&&(b[w]=a.get(w,M-1)),b[M-1]=0,f){for(let t=y;t<c;t++){for(let e=0;e<r;e++)p.set(e,t,0);p.set(t,t,1)}for(let t=y-1;t>=0;t--)if(0!==d[t]){for(let e=t+1;e<c;e++){let n=0;for(let i=t;i<r;i++)n+=p.get(i,t)*p.get(i,e);n=-n/p.get(t,t);for(let i=t;i<r;i++)p.set(i,e,p.get(i,e)+n*p.get(i,t))}for(let e=t;e<r;e++)p.set(e,t,-p.get(e,t));p.set(t,t,1+p.get(t,t));for(let e=0;e<t-1;e++)p.set(e,t,0)}else{for(let e=0;e<r;e++)p.set(e,t,0);p.set(t,t,1)}}if(u)for(let t=n-1;t>=0;t--){if(t<w&&0!==b[t])for(let e=t+1;e<n;e++){let r=0;for(let i=t+1;i<n;i++)r+=m.get(i,t)*m.get(i,e);r=-r/m.get(t+1,t);for(let i=t+1;i<n;i++)m.set(i,e,m.get(i,e)+r*m.get(i,t))}for(let e=0;e<n;e++)m.set(e,t,0);m.set(t,t,1)}let S=M-1,k=Number.EPSILON;for(;M>0;){let t,e;for(t=M-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+k*Math.abs(d[t]+Math.abs(d[t+1]));if(Math.abs(b[t])<=e||Number.isNaN(b[t])){b[t]=0;break}}if(t===M-2)e=4;else{let r;for(r=M-1;r>=t&&r!==t;r--){let e=(r!==M?Math.abs(b[r]):0)+(r!==t+1?Math.abs(b[r-1]):0);if(Math.abs(d[r])<=k*e){d[r]=0;break}}r===t?e=3:r===M-1?e=1:(e=2,t=r)}switch(t++,e){case 1:{let e=b[M-2];b[M-2]=0;for(let r=M-2;r>=t;r--){let i=A(d[r],e),o=d[r]/i,s=e/i;if(d[r]=i,r!==t&&(e=-s*b[r-1],b[r-1]=o*b[r-1]),u)for(let t=0;t<n;t++)i=o*m.get(t,r)+s*m.get(t,M-1),m.set(t,M-1,-s*m.get(t,r)+o*m.get(t,M-1)),m.set(t,r,i)}break}case 2:{let e=b[t-1];b[t-1]=0;for(let n=t;n<M;n++){let i=A(d[n],e),o=d[n]/i,s=e/i;if(d[n]=i,e=-s*b[n],b[n]=o*b[n],f)for(let e=0;e<r;e++)i=o*p.get(e,n)+s*p.get(e,t-1),p.set(e,t-1,-s*p.get(e,n)+o*p.get(e,t-1)),p.set(e,n,i)}break}case 3:{const e=Math.max(Math.abs(d[M-1]),Math.abs(d[M-2]),Math.abs(b[M-2]),Math.abs(d[t]),Math.abs(b[t])),i=d[M-1]/e,o=d[M-2]/e,s=b[M-2]/e,a=d[t]/e,h=b[t]/e,c=((o+i)*(o-i)+s*s)/2,l=i*s*(i*s);let g=0;0===c&&0===l||(g=l/(c+(g=c<0?0-Math.sqrt(c*c+l):Math.sqrt(c*c+l))));let v=(a+i)*(a-i)+g,y=a*h;for(let e=t;e<M-1;e++){let i=A(v,y);0===i&&(i=Number.MIN_VALUE);let o=v/i,s=y/i;if(e!==t&&(b[e-1]=i),v=o*d[e]+s*b[e],b[e]=o*b[e]-s*d[e],y=s*d[e+1],d[e+1]=o*d[e+1],u)for(let t=0;t<n;t++)i=o*m.get(t,e)+s*m.get(t,e+1),m.set(t,e+1,-s*m.get(t,e)+o*m.get(t,e+1)),m.set(t,e,i);if(0===(i=A(v,y))&&(i=Number.MIN_VALUE),o=v/i,s=y/i,d[e]=i,v=o*b[e]+s*d[e+1],d[e+1]=-s*b[e]+o*d[e+1],y=s*b[e+1],b[e+1]=o*b[e+1],f&&e<r-1)for(let t=0;t<r;t++)i=o*p.get(t,e)+s*p.get(t,e+1),p.set(t,e+1,-s*p.get(t,e)+o*p.get(t,e+1)),p.set(t,e,i)}b[M-2]=v;break}case 4:if(d[t]<=0&&(d[t]=d[t]<0?-d[t]:0,u))for(let e=0;e<=S;e++)m.set(e,t,-m.get(e,t));for(;t<S&&!(d[t]>=d[t+1]);){let e=d[t];if(d[t]=d[t+1],d[t+1]=e,u&&t<n-1)for(let r=0;r<n;r++)e=m.get(r,t+1),m.set(r,t+1,m.get(r,t)),m.set(r,t,e);if(f&&t<r-1)for(let n=0;n<r;n++)e=p.get(n,t+1),p.set(n,t+1,p.get(n,t)),p.set(n,t,e);t++}M--}}if(h){let t=m;m=p,p=t}this.m=r,this.n=n,this.s=d,this.U=p,this.V=m}solve(t){let e=t,r=this.threshold,n=this.s.length,i=_.zeros(n,n);for(let t=0;t<n;t++)Math.abs(this.s[t])<=r?i.set(t,t,0):i.set(t,t,1/this.s[t]);let o=this.U,s=this.rightSingularVectors,a=s.mmul(i),f=s.rows,u=o.rows,h=_.zeros(f,u);for(let t=0;t<f;t++)for(let e=0;e<u;e++){let r=0;for(let i=0;i<n;i++)r+=a.get(t,i)*o.get(e,i);h.set(t,e,r)}return h.mmul(e)}solveForDiagonal(t){return this.solve(_.diag(t))}inverse(){let t=this.V,e=this.threshold,r=t.rows,n=t.columns,i=new _(r,this.s.length);for(let o=0;o<r;o++)for(let r=0;r<n;r++)Math.abs(this.s[r])>e&&i.set(o,r,t.get(o,r)/this.s[r]);let o=this.U,s=o.rows,a=o.columns,f=new _(r,s);for(let t=0;t<r;t++)for(let e=0;e<s;e++){let r=0;for(let n=0;n<a;n++)r+=i.get(t,n)*o.get(e,n);f.set(t,e,r)}return f}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,r=this.s;for(let n=0,i=r.length;n<i;n++)r[n]>t&&e++;return e}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return _.diag(this.s)}}function R(t,e,r=!1){return t=E.checkMatrix(t),e=E.checkMatrix(e),r?new I(t).solve(e):t.isSquare()?new k(t).solve(e):new j(t).solve(e)}function O(t,e){let r=[];for(let n=0;n<t;n++)n!==e&&r.push(n);return r}function D(t,e,r,n=1e-9,i=1e-9){if(t>i)return new Array(e.rows+1).fill(0);{let t=e.addRow(r,[0]);for(let e=0;e<t.rows;e++)Math.abs(t.get(e,0))<n&&t.set(e,0,0);return t.to1DArray()}}class N{constructor(t,e={}){const{assumeSymmetric:r=!1}=e;if(!(t=E.checkMatrix(t)).isSquare())throw new Error("Matrix is not a square matrix");let n,i,o=t.columns,s=new _(o,o),a=new Float64Array(o),f=new Float64Array(o),u=t,h=!1;if(h=!!r||t.isSymmetric()){for(n=0;n<o;n++)for(i=0;i<o;i++)s.set(n,i,u.get(n,i));!function(t,e,r,n){let i,o,s,a,f,u,h,c;for(f=0;f<t;f++)r[f]=n.get(t-1,f);for(a=t-1;a>0;a--){for(c=0,s=0,u=0;u<a;u++)c+=Math.abs(r[u]);if(0===c)for(e[a]=r[a-1],f=0;f<a;f++)r[f]=n.get(a-1,f),n.set(a,f,0),n.set(f,a,0);else{for(u=0;u<a;u++)r[u]/=c,s+=r[u]*r[u];for(i=r[a-1],o=Math.sqrt(s),i>0&&(o=-o),e[a]=c*o,s-=i*o,r[a-1]=i-o,f=0;f<a;f++)e[f]=0;for(f=0;f<a;f++){for(i=r[f],n.set(f,a,i),o=e[f]+n.get(f,f)*i,u=f+1;u<=a-1;u++)o+=n.get(u,f)*r[u],e[u]+=n.get(u,f)*i;e[f]=o}for(i=0,f=0;f<a;f++)e[f]/=s,i+=e[f]*r[f];for(h=i/(s+s),f=0;f<a;f++)e[f]-=h*r[f];for(f=0;f<a;f++){for(i=r[f],o=e[f],u=f;u<=a-1;u++)n.set(u,f,n.get(u,f)-(i*e[u]+o*r[u]));r[f]=n.get(a-1,f),n.set(a,f,0)}}r[a]=s}for(a=0;a<t-1;a++){if(n.set(t-1,a,n.get(a,a)),n.set(a,a,1),0!==(s=r[a+1])){for(u=0;u<=a;u++)r[u]=n.get(u,a+1)/s;for(f=0;f<=a;f++){for(o=0,u=0;u<=a;u++)o+=n.get(u,a+1)*n.get(u,f);for(u=0;u<=a;u++)n.set(u,f,n.get(u,f)-o*r[u])}}for(u=0;u<=a;u++)n.set(u,a+1,0)}for(f=0;f<t;f++)r[f]=n.get(t-1,f),n.set(t-1,f,0);n.set(t-1,t-1,1),e[0]=0}(o,f,a,s),function(t,e,r,n){let i,o,s,a,f,u,h,c,l,d,p,m,b,g,v,y;for(s=1;s<t;s++)e[s-1]=e[s];e[t-1]=0;let w=0,_=0,x=Number.EPSILON;for(u=0;u<t;u++){for(_=Math.max(_,Math.abs(r[u])+Math.abs(e[u])),h=u;h<t&&!(Math.abs(e[h])<=x*_);)h++;if(h>u)do{for(i=r[u],c=(r[u+1]-i)/(2*e[u]),l=A(c,1),c<0&&(l=-l),r[u]=e[u]/(c+l),r[u+1]=e[u]*(c+l),d=r[u+1],o=i-r[u],s=u+2;s<t;s++)r[s]-=o;for(w+=o,c=r[h],m=p=1,b=p,g=e[u+1],v=0,y=0,s=h-1;s>=u;s--)for(b=m,m=p,y=v,i=p*e[s],o=p*c,l=A(c,e[s]),e[s+1]=v*l,v=e[s]/l,c=(p=c/l)*r[s]-v*i,r[s+1]=o+v*(p*i+v*r[s]),f=0;f<t;f++)o=n.get(f,s+1),n.set(f,s+1,v*n.get(f,s)+p*o),n.set(f,s,p*n.get(f,s)-v*o);c=-v*y*b*g*e[u]/d,e[u]=v*c,r[u]=p*c}while(Math.abs(e[u])>x*_);r[u]=r[u]+w,e[u]=0}for(s=0;s<t-1;s++){for(f=s,c=r[s],a=s+1;a<t;a++)r[a]<c&&(f=a,c=r[a]);if(f!==s)for(r[f]=r[s],r[s]=c,a=0;a<t;a++)c=n.get(a,s),n.set(a,s,n.get(a,f)),n.set(a,f,c)}}(o,f,a,s)}else{let t=new _(o,o),e=new Float64Array(o);for(i=0;i<o;i++)for(n=0;n<o;n++)t.set(n,i,u.get(n,i));!function(t,e,r,n){let i,o,s,a,f,u,h,c=t-1;for(u=1;u<=c-1;u++){for(h=0,a=u;a<=c;a++)h+=Math.abs(e.get(a,u-1));if(0!==h){for(s=0,a=c;a>=u;a--)r[a]=e.get(a,u-1)/h,s+=r[a]*r[a];for(o=Math.sqrt(s),r[u]>0&&(o=-o),s-=r[u]*o,r[u]=r[u]-o,f=u;f<t;f++){for(i=0,a=c;a>=u;a--)i+=r[a]*e.get(a,f);for(i/=s,a=u;a<=c;a++)e.set(a,f,e.get(a,f)-i*r[a])}for(a=0;a<=c;a++){for(i=0,f=c;f>=u;f--)i+=r[f]*e.get(a,f);for(i/=s,f=u;f<=c;f++)e.set(a,f,e.get(a,f)-i*r[f])}r[u]=h*r[u],e.set(u,u-1,h*o)}}for(a=0;a<t;a++)for(f=0;f<t;f++)n.set(a,f,a===f?1:0);for(u=c-1;u>=1;u--)if(0!==e.get(u,u-1)){for(a=u+1;a<=c;a++)r[a]=e.get(a,u-1);for(f=u;f<=c;f++){for(o=0,a=u;a<=c;a++)o+=r[a]*n.get(a,f);for(o=o/r[u]/e.get(u,u-1),a=u;a<=c;a++)n.set(a,f,n.get(a,f)+o*r[a])}}}(o,t,e,s),function(t,e,r,n,i){let o,s,a,f,u,h,c,l,d,p,m,b,g,v,y,w=t-1,_=t-1,x=Number.EPSILON,M=0,S=0,E=0,k=0,A=0,j=0,I=0,R=0;for(o=0;o<t;o++)for((o<0||o>_)&&(r[o]=i.get(o,o),e[o]=0),s=Math.max(o-1,0);s<t;s++)S+=Math.abs(i.get(o,s));for(;w>=0;){for(f=w;f>0&&(0===(j=Math.abs(i.get(f-1,f-1))+Math.abs(i.get(f,f)))&&(j=S),!(Math.abs(i.get(f,f-1))<x*j));)f--;if(f===w)i.set(w,w,i.get(w,w)+M),r[w]=i.get(w,w),e[w]=0,w--,R=0;else if(f===w-1){if(c=i.get(w,w-1)*i.get(w-1,w),E=(i.get(w-1,w-1)-i.get(w,w))/2,k=E*E+c,I=Math.sqrt(Math.abs(k)),i.set(w,w,i.get(w,w)+M),i.set(w-1,w-1,i.get(w-1,w-1)+M),l=i.get(w,w),k>=0){for(I=E>=0?E+I:E-I,r[w-1]=l+I,r[w]=r[w-1],0!==I&&(r[w]=l-c/I),e[w-1]=0,e[w]=0,l=i.get(w,w-1),j=Math.abs(l)+Math.abs(I),E=l/j,k=I/j,A=Math.sqrt(E*E+k*k),E/=A,k/=A,s=w-1;s<t;s++)I=i.get(w-1,s),i.set(w-1,s,k*I+E*i.get(w,s)),i.set(w,s,k*i.get(w,s)-E*I);for(o=0;o<=w;o++)I=i.get(o,w-1),i.set(o,w-1,k*I+E*i.get(o,w)),i.set(o,w,k*i.get(o,w)-E*I);for(o=0;o<=_;o++)I=n.get(o,w-1),n.set(o,w-1,k*I+E*n.get(o,w)),n.set(o,w,k*n.get(o,w)-E*I)}else r[w-1]=l+E,r[w]=l+E,e[w-1]=I,e[w]=-I;w-=2,R=0}else{if(l=i.get(w,w),d=0,c=0,f<w&&(d=i.get(w-1,w-1),c=i.get(w,w-1)*i.get(w-1,w)),10===R){for(M+=l,o=0;o<=w;o++)i.set(o,o,i.get(o,o)-l);j=Math.abs(i.get(w,w-1))+Math.abs(i.get(w-1,w-2)),l=d=.75*j,c=-.4375*j*j}if(30===R&&(j=(j=(d-l)/2)*j+c)>0){for(j=Math.sqrt(j),d<l&&(j=-j),j=l-c/((d-l)/2+j),o=0;o<=w;o++)i.set(o,o,i.get(o,o)-j);M+=j,l=d=c=.964}for(R+=1,u=w-2;u>=f&&(I=i.get(u,u),E=((A=l-I)*(j=d-I)-c)/i.get(u+1,u)+i.get(u,u+1),k=i.get(u+1,u+1)-I-A-j,A=i.get(u+2,u+1),j=Math.abs(E)+Math.abs(k)+Math.abs(A),E/=j,k/=j,A/=j,u!==f)&&!(Math.abs(i.get(u,u-1))*(Math.abs(k)+Math.abs(A))<x*(Math.abs(E)*(Math.abs(i.get(u-1,u-1))+Math.abs(I)+Math.abs(i.get(u+1,u+1)))));)u--;for(o=u+2;o<=w;o++)i.set(o,o-2,0),o>u+2&&i.set(o,o-3,0);for(a=u;a<=w-1&&(v=a!==w-1,a!==u&&(E=i.get(a,a-1),k=i.get(a+1,a-1),A=v?i.get(a+2,a-1):0,0!==(l=Math.abs(E)+Math.abs(k)+Math.abs(A))&&(E/=l,k/=l,A/=l)),0!==l);a++)if(j=Math.sqrt(E*E+k*k+A*A),E<0&&(j=-j),0!==j){for(a!==u?i.set(a,a-1,-j*l):f!==u&&i.set(a,a-1,-i.get(a,a-1)),l=(E+=j)/j,d=k/j,I=A/j,k/=E,A/=E,s=a;s<t;s++)E=i.get(a,s)+k*i.get(a+1,s),v&&(E+=A*i.get(a+2,s),i.set(a+2,s,i.get(a+2,s)-E*I)),i.set(a,s,i.get(a,s)-E*l),i.set(a+1,s,i.get(a+1,s)-E*d);for(o=0;o<=Math.min(w,a+3);o++)E=l*i.get(o,a)+d*i.get(o,a+1),v&&(E+=I*i.get(o,a+2),i.set(o,a+2,i.get(o,a+2)-E*A)),i.set(o,a,i.get(o,a)-E),i.set(o,a+1,i.get(o,a+1)-E*k);for(o=0;o<=_;o++)E=l*n.get(o,a)+d*n.get(o,a+1),v&&(E+=I*n.get(o,a+2),n.set(o,a+2,n.get(o,a+2)-E*A)),n.set(o,a,n.get(o,a)-E),n.set(o,a+1,n.get(o,a+1)-E*k)}}}if(0===S)return;for(w=t-1;w>=0;w--)if(E=r[w],0===(k=e[w]))for(f=w,i.set(w,w,1),o=w-1;o>=0;o--){for(c=i.get(o,o)-E,A=0,s=f;s<=w;s++)A+=i.get(o,s)*i.get(s,w);if(e[o]<0)I=c,j=A;else if(f=o,0===e[o]?i.set(o,w,0!==c?-A/c:-A/(x*S)):(l=i.get(o,o+1),d=i.get(o+1,o),k=(r[o]-E)*(r[o]-E)+e[o]*e[o],h=(l*j-I*A)/k,i.set(o,w,h),i.set(o+1,w,Math.abs(l)>Math.abs(I)?(-A-c*h)/l:(-j-d*h)/I)),h=Math.abs(i.get(o,w)),x*h*h>1)for(s=o;s<=w;s++)i.set(s,w,i.get(s,w)/h)}else if(k<0)for(f=w-1,Math.abs(i.get(w,w-1))>Math.abs(i.get(w-1,w))?(i.set(w-1,w-1,k/i.get(w,w-1)),i.set(w-1,w,-(i.get(w,w)-E)/i.get(w,w-1))):(y=C(0,-i.get(w-1,w),i.get(w-1,w-1)-E,k),i.set(w-1,w-1,y[0]),i.set(w-1,w,y[1])),i.set(w,w-1,0),i.set(w,w,1),o=w-2;o>=0;o--){for(p=0,m=0,s=f;s<=w;s++)p+=i.get(o,s)*i.get(s,w-1),m+=i.get(o,s)*i.get(s,w);if(c=i.get(o,o)-E,e[o]<0)I=c,A=p,j=m;else if(f=o,0===e[o]?(y=C(-p,-m,c,k),i.set(o,w-1,y[0]),i.set(o,w,y[1])):(l=i.get(o,o+1),d=i.get(o+1,o),b=(r[o]-E)*(r[o]-E)+e[o]*e[o]-k*k,g=2*(r[o]-E)*k,0===b&&0===g&&(b=x*S*(Math.abs(c)+Math.abs(k)+Math.abs(l)+Math.abs(d)+Math.abs(I))),y=C(l*A-I*p+k*m,l*j-I*m-k*p,b,g),i.set(o,w-1,y[0]),i.set(o,w,y[1]),Math.abs(l)>Math.abs(I)+Math.abs(k)?(i.set(o+1,w-1,(-p-c*i.get(o,w-1)+k*i.get(o,w))/l),i.set(o+1,w,(-m-c*i.get(o,w)-k*i.get(o,w-1))/l)):(y=C(-A-d*i.get(o,w-1),-j-d*i.get(o,w),I,k),i.set(o+1,w-1,y[0]),i.set(o+1,w,y[1]))),h=Math.max(Math.abs(i.get(o,w-1)),Math.abs(i.get(o,w))),x*h*h>1)for(s=o;s<=w;s++)i.set(s,w-1,i.get(s,w-1)/h),i.set(s,w,i.get(s,w)/h)}for(o=0;o<t;o++)if(o<0||o>_)for(s=o;s<t;s++)n.set(o,s,i.get(o,s));for(s=t-1;s>=0;s--)for(o=0;o<=_;o++){for(I=0,a=0;a<=Math.min(s,_);a++)I+=n.get(o,a)*i.get(a,s);n.set(o,s,I)}}(o,f,a,s,t)}this.n=o,this.e=f,this.d=a,this.V=s}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let t,e,r=this.n,n=this.e,i=this.d,o=new _(r,r);for(t=0;t<r;t++){for(e=0;e<r;e++)o.set(t,e,0);o.set(t,t,i[t]),n[t]>0?o.set(t,t+1,n[t]):n[t]<0&&o.set(t,t-1,n[t])}return o}}function C(t,e,r,n){let i,o;return Math.abs(r)>Math.abs(n)?[(t+(i=n/r)*e)/(o=r+i*n),(e-i*t)/o]:[((i=r/n)*t+e)/(o=n+i*r),(i*e-t)/o]}class B{constructor(t){if(!(t=E.checkMatrix(t)).isSymmetric())throw new Error("Matrix is not symmetric");let e,r,n,i=t,o=i.rows,s=new _(o,o),a=!0;for(r=0;r<o;r++){let t=0;for(n=0;n<r;n++){let o=0;for(e=0;e<n;e++)o+=s.get(n,e)*s.get(r,e);o=(i.get(r,n)-o)/s.get(n,n),s.set(r,n,o),t+=o*o}for(a&=(t=i.get(r,r)-t)>0,s.set(r,r,Math.sqrt(Math.max(t,0))),n=r+1;n<o;n++)s.set(r,n,0)}this.L=s,this.positiveDefinite=Boolean(a)}isPositiveDefinite(){return this.positiveDefinite}solve(t){t=E.checkMatrix(t);let e=this.L,r=e.rows;if(t.rows!==r)throw new Error("Matrix dimensions do not match");if(!1===this.isPositiveDefinite())throw new Error("Matrix is not positive definite");let n,i,o,s=t.columns,a=t.clone();for(o=0;o<r;o++)for(i=0;i<s;i++){for(n=0;n<o;n++)a.set(o,i,a.get(o,i)-a.get(n,i)*e.get(o,n));a.set(o,i,a.get(o,i)/e.get(o,o))}for(o=r-1;o>=0;o--)for(i=0;i<s;i++){for(n=o+1;n<r;n++)a.set(o,i,a.get(o,i)-a.get(n,i)*e.get(n,o));a.set(o,i,a.get(o,i)/e.get(o,o))}return a}get lowerTriangularMatrix(){return this.L}}class T{constructor(t,e={}){t=E.checkMatrix(t);let{Y:r}=e;const{scaleScores:n=!1,maxIterations:i=1e3,terminationCriteria:o=1e-10}=e;let s;if(r){if(!(r=Array.isArray(r)&&"number"==typeof r[0]?_.columnVector(r):E.checkMatrix(r)).isColumnVector()||r.rows!==t.rows)throw new Error("Y must be a column vector of length X.rows");s=r}else s=t.getColumnVector(0);let a,f,u,h,c=1;for(let e=0;e<i&&c>o;e++)u=(u=t.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0))).div(u.norm()),a=t.mmul(u).div(u.transpose().mmul(u).get(0,0)),e>0&&(c=a.clone().sub(h).pow(2).sum()),h=a.clone(),r?(f=(f=r.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0))).div(f.norm()),s=r.mmul(f).div(f.transpose().mmul(f).get(0,0))):s=a;if(r){let e=t.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0));e=e.div(e.norm());let n=t.clone().sub(a.clone().mmul(e.transpose())),i=s.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),o=r.clone().sub(a.clone().mulS(i.get(0,0)).mmul(f.transpose()));this.t=a,this.p=e.transpose(),this.w=u.transpose(),this.q=f,this.u=s,this.s=a.transpose().mmul(a),this.xResidual=n,this.yResidual=o,this.betas=i}else this.w=u.transpose(),this.s=a.transpose().mmul(a).sqrt(),this.t=n?a.clone().div(this.s.get(0,0)):a,this.xResidual=t.sub(a.mmul(u.transpose()))}}r.AbstractMatrix=y,r.CHO=B,r.CholeskyDecomposition=B,r.EVD=N,r.EigenvalueDecomposition=N,r.LU=k,r.LuDecomposition=k,r.Matrix=_,r.MatrixColumnSelectionView=class extends x{constructor(t,e){e=c(t,e),super(t,t.rows,e.length),this.columnIndices=e}set(t,e,r){return this.matrix.set(t,this.columnIndices[e],r),this}get(t,e){return this.matrix.get(t,this.columnIndices[e])}},r.MatrixColumnView=class extends x{constructor(t,e){s(t,e),super(t,t.rows,1),this.column=e}set(t,e,r){return this.matrix.set(t,this.column,r),this}get(t){return this.matrix.get(t,this.column)}},r.MatrixFlipColumnView=class extends x{constructor(t){super(t,t.rows,t.columns)}set(t,e,r){return this.matrix.set(t,this.columns-e-1,r),this}get(t,e){return this.matrix.get(t,this.columns-e-1)}},r.MatrixFlipRowView=class extends x{constructor(t){super(t,t.rows,t.columns)}set(t,e,r){return this.matrix.set(this.rows-t-1,e,r),this}get(t,e){return this.matrix.get(this.rows-t-1,e)}},r.MatrixRowSelectionView=class extends x{constructor(t,e){super(t,(e=h(t,e)).length,t.columns),this.rowIndices=e}set(t,e,r){return this.matrix.set(this.rowIndices[t],e,r),this}get(t,e){return this.matrix.get(this.rowIndices[t],e)}},r.MatrixRowView=class extends x{constructor(t,e){o(t,e),super(t,1,t.columns),this.row=e}set(t,e,r){return this.matrix.set(this.row,e,r),this}get(t,e){return this.matrix.get(this.row,e)}},r.MatrixSelectionView=M,r.MatrixSubView=class extends x{constructor(t,e,r,n,i){l(t,e,r,n,i),super(t,r-e+1,i-n+1),this.startRow=e,this.startColumn=n}set(t,e,r){return this.matrix.set(this.startRow+t,this.startColumn+e,r),this}get(t,e){return this.matrix.get(this.startRow+t,this.startColumn+e)}},r.MatrixTransposeView=class extends x{constructor(t){super(t,t.columns,t.rows)}set(t,e,r){return this.matrix.set(e,t,r),this}get(t,e){return this.matrix.get(e,t)}},r.NIPALS=T,r.Nipals=T,r.QR=j,r.QrDecomposition=j,r.SVD=I,r.SingularValueDecomposition=I,r.WrapperMatrix1D=S,r.WrapperMatrix2D=E,r.correlation=function(t,e=t,r={}){t=_.checkMatrix(t);let n=!1;if("object"!=typeof e||_.isMatrix(e)||Array.isArray(e)?e=_.checkMatrix(e):(r=e,e=t,n=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:i=!0,scale:o=!0}=r;i&&(t.center("column"),n||e.center("column")),o&&(t.scale("column"),n||e.scale("column"));const s=t.standardDeviation("column",{unbiased:!0}),a=n?s:e.standardDeviation("column",{unbiased:!0}),f=t.transpose().mmul(e);for(let e=0;e<f.rows;e++)for(let r=0;r<f.columns;r++)f.set(e,r,f.get(e,r)*(1/(s[e]*a[r]))*(1/(t.rows-1)));return f},r.covariance=function(t,e=t,r={}){t=_.checkMatrix(t);let n=!1;if("object"!=typeof e||_.isMatrix(e)||Array.isArray(e)?e=_.checkMatrix(e):(r=e,e=t,n=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:i=!0}=r;i&&(t=t.center("column"),n||(e=e.center("column")));const o=t.transpose().mmul(e);for(let e=0;e<o.rows;e++)for(let r=0;r<o.columns;r++)o.set(e,r,o.get(e,r)*(1/(t.rows-1)));return o},r.default=_,r.determinant=function t(e){if((e=_.checkMatrix(e)).isSquare()){let r,n,i,o;if(2===e.columns)return r=e.get(0,0),n=e.get(0,1),i=e.get(1,0),r*(o=e.get(1,1))-n*i;if(3===e.columns){let o,s,a;return o=new M(e,[1,2],[1,2]),s=new M(e,[1,2],[0,2]),a=new M(e,[1,2],[0,1]),r=e.get(0,0),n=e.get(0,1),i=e.get(0,2),r*t(o)-n*t(s)+i*t(a)}return new k(e).determinant}throw Error("determinant can only be calculated for a square matrix")},r.inverse=function(t,e=!1){return t=E.checkMatrix(t),e?new I(t).inverse():R(t,_.eye(t.rows))},r.linearDependencies=function(t,e={}){const{thresholdValue:r=1e-9,thresholdError:n=1e-9}=e;let i=(t=_.checkMatrix(t)).rows,o=new _(i,i);for(let e=0;e<i;e++){let s=_.columnVector(t.getRow(e)),a=t.subMatrixRow(O(i,e)).transpose(),f=new I(a).solve(s),u=_.sub(s,a.mmul(f)).abs().max();o.setRow(e,D(u,f,e,r,n))}return o},r.pseudoInverse=function(t,e=Number.EPSILON){t=_.checkMatrix(t);let r=new I(t,{autoTranspose:!0}),n=r.leftSingularVectors,i=r.rightSingularVectors,o=r.diagonal;for(let t=0;t<o.length;t++)Math.abs(o[t])>e?o[t]=1/o[t]:o[t]=0;return i.mmul(_.diag(o).mmul(n.transpose()))},r.solve=R,r.wrap=function(t,e){if(Array.isArray(t))return t[0]&&Array.isArray(t[0])?new E(t):new S(t,e);throw new Error("the argument is not an array")}},{"ml-array-rescale":143}],147:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("ml-matrix");class i{constructor(t,e={}){if(!0===t){const t=e;return this.center=t.center,this.scale=t.scale,this.means=t.means,this.stdevs=t.stdevs,this.U=n.Matrix.checkMatrix(t.U),this.S=t.S,this.R=t.R,void(this.excludedFeatures=t.excludedFeatures||[])}t=new n.Matrix(t);const{isCovarianceMatrix:r=!1,method:i="SVD",nCompNIPALS:o=2,center:s=!0,scale:a=!1,ignoreZeroVariance:f=!1}=e;if(this.center=s,this.scale=a,this.means=null,this.stdevs=null,this.excludedFeatures=[],r)this._computeFromCovarianceMatrix(t);else switch(this._adjust(t,f),i){case"covarianceMatrix":{const e=new n.MatrixTransposeView(t).mmul(t).div(t.rows-1);this._computeFromCovarianceMatrix(e);break}case"NIPALS":this._computeWithNIPALS(t,o);break;case"SVD":{const e=new n.SVD(t,{computeLeftSingularVectors:!1,computeRightSingularVectors:!0,autoTranspose:!0});this.U=e.rightSingularVectors;const r=e.diagonal,i=[];for(const e of r)i.push(e*e/(t.rows-1));this.S=i;break}default:throw new Error(`unknown method: ${i}`)}}static load(t){if("string"!=typeof t.name)throw new TypeError("model must have a name property");if("PCA"!==t.name)throw new RangeError(`invalid model: ${t.name}`);return new i(!0,t)}predict(t,e={}){const{nComponents:r=this.U.columns}=e;if(t=new n.Matrix(t),this.center&&(t.subRowVector(this.means),this.scale)){for(let e of this.excludedFeatures)t.removeColumn(e);t.divRowVector(this.stdevs)}var i=t.mmul(this.U);return i.subMatrix(0,i.rows-1,0,r-1)}invert(t){var e=(t=n.Matrix.checkMatrix(t)).mmul(this.U.transpose());return this.center&&(this.scale&&e.mulRowVector(this.stdevs),e.addRowVector(this.means)),e}getExplainedVariance(){var t=0;for(const e of this.S)t+=e;return this.S.map(e=>e/t)}getCumulativeVariance(){for(var t=this.getExplainedVariance(),e=1;e<t.length;e++)t[e]+=t[e-1];return t}getEigenvectors(){return this.U}getEigenvalues(){return this.S}getStandardDeviations(){return this.S.map(t=>Math.sqrt(t))}getLoadings(){return this.U.transpose()}toJSON(){return{name:"PCA",center:this.center,scale:this.scale,means:this.means,stdevs:this.stdevs,U:this.U,S:this.S,excludedFeatures:this.excludedFeatures}}_adjust(t,e){if(this.center){const r=t.mean("column"),n=this.scale?t.standardDeviation("column",{mean:r}):null;if(this.means=r,t.subRowVector(r),this.scale){for(let r=0;r<n.length;r++)if(0===n[r]){if(!e)throw new RangeError(`Cannot scale the dataset (standard deviation is zero at index ${r}`);t.removeColumn(r),n.splice(r,1),this.excludedFeatures.push(r),r--}this.stdevs=n,t.divRowVector(n)}}}_computeFromCovarianceMatrix(t){const e=new n.EVD(t,{assumeSymmetric:!0});this.U=e.eigenvectorMatrix,this.U.flipRows(),this.S=e.realEigenvalues,this.S.reverse()}_computeWithNIPALS(t,e){this.U=new n.Matrix(e,t.columns),this.S=[];let r=t;for(let t=0;t<e;t++){let e=new n.NIPALS(r);this.U.setRow(t,e.w.transpose()),this.S.push(Math.pow(e.s.get(0,0),2)),r=e.xResidual}this.U=this.U.transpose()}}r.PCA=i},{"ml-matrix":146}],148:[function(require,module,exports){"use strict";var NodeSquare=require("./node-square"),NodeHexagonal=require("./node-hexagonal"),defaultOptions={fields:3,randomizer:Math.random,distance:squareEuclidean,iterations:10,learningRate:.1,gridType:"rect",torus:!0,method:"random"};function SOM(t,e,r,n){for(var i in this.x=t,this.y=e,r=r||{},this.options={},defaultOptions)r.hasOwnProperty(i)?this.options[i]=r[i]:this.options[i]=defaultOptions[i];if("number"==typeof this.options.fields)this.numWeights=this.options.fields;else{if(!Array.isArray(this.options.fields))throw new Error("Invalid fields definition");this.numWeights=this.options.fields.length;var o=getConverters(this.options.fields);this.extractor=o.extractor,this.creator=o.creator}if("rect"===this.options.gridType)this.nodeType=NodeSquare,this.gridDim={x:t,y:e};else{this.nodeType=NodeHexagonal;var s=this.x-Math.floor(this.y/2);this.gridDim={x:s,y:this.y,z:-(0-s-this.y)}}if(this.torus=this.options.torus,this.distanceMethod=this.torus?"getDistanceTorus":"getDistance",this.distance=this.options.distance,this.maxDistance=getMaxDistance(this.distance,this.numWeights),!0!==n){if(!(t>0&&e>0))throw new Error("x and y must be positive");this.times={findBMU:0,adjust:0},this.randomizer=this.options.randomizer,this.iterationCount=0,this.iterations=this.options.iterations,this.startLearningRate=this.learningRate=this.options.learningRate,this.mapRadius=Math.floor(Math.max(t,e)/2),this.algorithmMethod=this.options.method,this._initNodes(),this.done=!1}else this.done=!0}function getConverters(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=0;i<e;i++)r[i]=getNormalizer(t[i].range),n[i]=getDenormalizer(t[i].range);return{extractor:function(n){for(var i=new Array(e),o=0;o<e;o++)i[o]=r[o](n[t[o].name]);return i},creator:function(r){for(var i={},o=0;o<e;o++)i[t[o].name]=n[o](r[o]);return i}}}function getNormalizer(t){return function(e){return(e-t[0])/(t[1]-t[0])}}function getDenormalizer(t){return function(e){return t[0]+e*(t[1]-t[0])}}function squareEuclidean(t,e){for(var r=0,n=0,i=t.length;n<i;n++)r+=(t[n]-e[n])*(t[n]-e[n]);return r}function getRandomValue(t,e){return t[Math.floor(e()*t.length)]}function getMaxDistance(t,e){for(var r=new Array(e),n=new Array(e),i=0;i<e;i++)r[i]=0,n[i]=1;return t(r,n)}SOM.load=function loadModel(model,distance){if("SOM"===model.name){var x=model.data.length,y=model.data[0].length;distance?model.options.distance=distance:model.options.distance&&(model.options.distance=eval("("+model.options.distance+")"));var som=new SOM(x,y,model.options,!0);som.nodes=new Array(x);for(var i=0;i<x;i++){som.nodes[i]=new Array(y);for(var j=0;j<y;j++)som.nodes[i][j]=new som.nodeType(i,j,model.data[i][j],som)}return som}throw new Error("expecting a SOM model")},SOM.prototype.export=function(t){if(!this.done)throw new Error("model is not ready yet");var e={name:"SOM"};e.options={fields:this.options.fields,gridType:this.options.gridType,torus:this.options.torus},e.data=new Array(this.x);for(var r=0;r<this.x;r++){e.data[r]=new Array(this.y);for(var n=0;n<this.y;n++)e.data[r][n]=this.nodes[r][n].weights}return t&&(e.options.distance=this.distance.toString()),e},SOM.prototype._initNodes=function(){var t,e,r,n=Date.now();for(this.nodes=new Array(this.x),t=0;t<this.x;t++)for(this.nodes[t]=new Array(this.y),e=0;e<this.y;e++){var i=new Array(this.numWeights);for(r=0;r<this.numWeights;r++)i[r]=this.randomizer();this.nodes[t][e]=new this.nodeType(t,e,i,this)}this.times.initNodes=Date.now()-n},SOM.prototype.setTraining=function(t){if(this.trainingSet)throw new Error("training set has already been set");var e,r=Date.now(),n=t,i=t.length;if(this.extractor)for(n=new Array(i),e=0;e<i;e++)n[e]=this.extractor(t[e]);this.numIterations=this.iterations*i,"random"===this.algorithmMethod?this.timeConstant=this.numIterations/Math.log(this.mapRadius):this.timeConstant=i/Math.log(this.mapRadius),this.trainingSet=n,this.times.setTraining=Date.now()-r},SOM.prototype.trainOne=function(){return!this.done&&(this.numIterations-- >0?("random"===this.algorithmMethod?(t=this.mapRadius*Math.exp(-this.iterationCount/this.timeConstant),e=getRandomValue(this.trainingSet,this.randomizer),this._adjust(e,t),this.learningRate=this.startLearningRate*Math.exp(-this.iterationCount/this.numIterations)):(r=-Math.floor(this.iterationCount/this.trainingSet.length),t=this.mapRadius*Math.exp(r/this.timeConstant),e=this.trainingSet[this.iterationCount%this.trainingSet.length],this._adjust(e,t),(this.iterationCount+1)%this.trainingSet.length==0&&(this.learningRate=this.startLearningRate*Math.exp(r/Math.floor(this.numIterations/this.trainingSet.length)))),this.iterationCount++,!0):(this.done=!0,!1));var t,e,r},SOM.prototype._adjust=function(t,e){var r,n,i,o,s=Date.now(),a=this._findBestMatchingUnit(t),f=Date.now();this.times.findBMU+=f-s;var u=Math.floor(e),h=a.x-u,c=a.x+u,l=a.y-u,d=a.y+u;for(r=h;r<=c;r++){var p=r;for(r<0?p+=this.x:r>=this.x&&(p-=this.x),n=l;n<=d;n++){var m=n;n<0?m+=this.y:n>=this.y&&(m-=this.y),(i=a[this.distanceMethod](this.nodes[p][m]))<e&&(o=Math.exp(-i/(2*e)),this.nodes[p][m].adjustWeights(t,this.learningRate,o))}}this.times.adjust+=Date.now()-f},SOM.prototype.train=function(t){if(!this.done)for(this.setTraining(t);this.trainOne(););},SOM.prototype.getConvertedNodes=function(){for(var t=new Array(this.x),e=0;e<this.x;e++){t[e]=new Array(this.y);for(var r=0;r<this.y;r++){var n=this.nodes[e][r];t[e][r]=this.creator?this.creator(n.weights):n.weights}}return t},SOM.prototype._findBestMatchingUnit=function(t){for(var e,r,n=1/0,i=0;i<this.x;i++)for(var o=0;o<this.y;o++)(r=this.distance(this.nodes[i][o].weights,t))<n&&(n=r,e=this.nodes[i][o]);return e},SOM.prototype.predict=function(t,e){if("boolean"==typeof t&&(e=t,t=null),t||(t=this.trainingSet),Array.isArray(t)&&(Array.isArray(t[0])||"object"==typeof t[0])){var r=this;return t.map(function(t){return r._predict(t,e)})}return this._predict(t,e)},SOM.prototype._predict=function(t,e){Array.isArray(t)||(t=this.extractor(t));var r=this._findBestMatchingUnit(t),n=[r.x,r.y];return e&&(n[2]=r.getPosition(t)),n},SOM.prototype.getQuantizationError=function(){for(var t=this.getFit(),e=t.length,r=0,n=0;n<e;n++)r+=t[n];return r/e},SOM.prototype.getFit=function(t){t||(t=this.trainingSet);for(var e,r=t.length,n=new Array(r),i=0;i<r;i++)e=this._findBestMatchingUnit(t[i]),n[i]=Math.sqrt(this.distance(t[i],e.weights));return n},module.exports=SOM},{"./node-hexagonal":149,"./node-square":150}],149:[function(t,e,r){var n=t("./node-square");function i(t,e,r,i){n.call(this,t,e,r,i),this.hX=t-Math.floor(e/2),this.z=0-this.hX-e}i.prototype=new n,i.prototype.constructor=i,i.prototype.getDistance=function(t){return Math.max(Math.abs(this.hX-t.hX),Math.abs(this.y-t.y),Math.abs(this.z-t.z))},i.prototype.getDistanceTorus=function(t){var e=Math.abs(this.hX-t.hX),r=Math.abs(this.y-t.y),n=Math.abs(this.z-t.z);return Math.max(Math.min(e,this.som.gridDim.x-e),Math.min(r,this.som.gridDim.y-r),Math.min(n,this.som.gridDim.z-n))},i.prototype.getPosition=function(){throw new Error("Unimplemented : cannot get position of the points for hexagonal grid")},e.exports=i},{"./node-square":150}],150:[function(t,e,r){function n(t,e,r,n){this.x=t,this.y=e,this.weights=r,this.som=n,this.neighbors={}}n.prototype.adjustWeights=function(t,e,r){for(var n=0,i=this.weights.length;n<i;n++)this.weights[n]+=e*r*(t[n]-this.weights[n])},n.prototype.getDistance=function(t){return Math.max(Math.abs(this.x-t.x),Math.abs(this.y-t.y))},n.prototype.getDistanceTorus=function(t){var e=Math.abs(this.x-t.x),r=Math.abs(this.y-t.y);return Math.max(Math.min(e,this.som.gridDim.x-e),Math.min(r,this.som.gridDim.y-r))},n.prototype.getNeighbors=function(t){if(!this.neighbors[t]){var e,r,n,i;if(this.neighbors[t]=new Array(2),this[t]>0?e=this[t]-1:this.som.torus&&(e=this.som.gridDim[t]-1),void 0!==e)"x"===t?(r=e,n=this.y):(r=this.x,n=e),this.neighbors[t][0]=this.som.nodes[r][n];this[t]<this.som.gridDim[t]-1?i=this[t]+1:this.som.torus&&(i=0),void 0!==i&&("x"===t?(r=i,n=this.y):(r=this.x,n=i),this.neighbors[t][1]=this.som.nodes[r][n])}return this.neighbors[t]},n.prototype.getPos=function(t,e){var r,n,i=this.getNeighbors(t),o=this.som.distance;i[0]?i[1]?o(e,i[0].weights)<o(e,i[1].weights)?(r=i[0],n=-1):(r=i[1],n=1):(r=i[0],n=-1):(r=i[1],n=1);var s=1-o(e,this.weights),a=1-o(e,r.weights);return.5+.5*((s-a)/(2-s-a))*n},n.prototype.getPosition=function(t){return[this.getPos("x",t),this.getPos("y",t)]},e.exports=n},{}],151:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,a=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),f=1;f<arguments.length;f++){for(var u in r=Object(arguments[f]))i.call(r,u)&&(a[u]=r[u]);if(n){s=n(r);for(var h=0;h<s.length;h++)o.call(r,s[h])&&(a[s[h]]=r[s[h]])}}return a}},{}],152:[function(t,e,r){e.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],153:[function(t,e,r){"use strict";var n=t("asn1.js");r.certificate=t("./certificate");var i=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=i;var o=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())});r.PublicKey=s;var a=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),f=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())});r.PrivateKey=f;var u=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var h=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=h,r.DSAparam=n.define("DSAparam",function(){this.int()});var c=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(l),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=c;var l=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":154,"asn1.js":24}],154:[function(t,e,r){"use strict";var n=t("asn1.js"),i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),s=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),a=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}),f=n.define("RelativeDistinguishedName",function(){this.setof(o)}),u=n.define("RDNSequence",function(){this.seqof(f)}),h=n.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),c=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),l=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(h),this.key("validity").use(c),this.key("subject").use(h),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())}),p=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())});e.exports=p},{"asn1.js":24}],155:[function(t,e,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,s=t("evp_bytestokey"),a=t("browserify-aes"),f=t("safe-buffer").Buffer;e.exports=function(t,e){var r,u=t.toString(),h=u.match(n);if(h){var c="aes"+h[1],l=f.from(h[2],"hex"),d=f.from(h[3].replace(/[\r\n]/g,""),"base64"),p=s(e,l.slice(0,8),parseInt(h[1],10)).key,m=[],b=a.createDecipheriv(c,p,l);m.push(b.update(d)),m.push(b.final()),r=f.concat(m)}else{var g=u.match(o);r=new f(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(i)[1],data:r}}},{"browserify-aes":49,evp_bytestokey:115,"safe-buffer":194}],156:[function(t,e,r){var n=t("./asn1"),i=t("./aesid.json"),o=t("./fixProc"),s=t("browserify-aes"),a=t("pbkdf2"),f=t("safe-buffer").Buffer;function u(t){var e;"object"!=typeof t||f.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=f.from(t));var r,u,h=o(t,e),c=h.tag,l=h.data;switch(c){case"CERTIFICATE":u=n.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=n.PublicKey.decode(l,"der")),r=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=n.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+c);case"ENCRYPTED PRIVATE KEY":l=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[t.algorithm.decrypt.cipher.algo.join(".")],u=t.algorithm.decrypt.cipher.iv,h=t.subjectPrivateKey,c=parseInt(o.split("-")[1],10)/8,l=a.pbkdf2Sync(e,r,n,c,"sha1"),d=s.createDecipheriv(o,l,u),p=[];return p.push(d.update(h)),p.push(d.final()),f.concat(p)}(l=n.EncryptedPrivateKey.decode(l,"der"),e);case"PRIVATE KEY":switch(r=(u=n.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:n.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=n.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+c);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=n.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+c)}}e.exports=u,u.signature=n.signature},{"./aesid.json":152,"./asn1":153,"./fixProc":155,"browserify-aes":49,pbkdf2:158,"safe-buffer":194}],157:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}r.resolve=function(){for(var r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var o=r.isAbsolute(t),s="/"===i(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!o).join("/"))||o||(t="."),t&&s&&(t+="/"),(o?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),s=Math.min(i.length,o.length),a=s,f=0;f<s;f++)if(i[f]!==o[f]){a=f;break}var u=[];for(f=a;f<i.length;f++)u.push("..");return(u=u.concat(o.slice(a))).join("/")},r.sep="/",r.delimiter=":",r.dirname=function(t){if("string"!=typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,i=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":t.slice(0,n)},r.basename=function(t,e){var r=function(t){"string"!=typeof t&&(t+="");var e,r=0,n=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){r=e+1;break}}else-1===n&&(i=!1,n=e+1);return-1===n?"":t.slice(r,n)}(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,n=-1,i=!0,o=0,s=t.length-1;s>=0;--s){var a=t.charCodeAt(s);if(47!==a)-1===n&&(i=!1,n=s+1),46===a?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){r=s+1;break}}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)};var i="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:164}],158:[function(t,e,r){r.pbkdf2=t("./lib/async"),r.pbkdf2Sync=t("./lib/sync")},{"./lib/async":159,"./lib/sync":162}],159:[function(t,e,r){(function(r,n){var i,o=t("./precondition"),s=t("./default-encoding"),a=t("./sync"),f=t("safe-buffer").Buffer,u=n.crypto&&n.crypto.subtle,h={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},c=[];function l(t,e,r,n,i){return u.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(function(t){return u.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)}).then(function(t){return f.from(t)})}e.exports=function(t,e,d,p,m,b){"function"==typeof m&&(b=m,m=void 0);var g=h[(m=m||"sha1").toLowerCase()];if(!g||"function"!=typeof n.Promise)return r.nextTick(function(){var r;try{r=a(t,e,d,p,m)}catch(t){return b(t)}b(null,r)});if(o(t,e,d,p),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");f.isBuffer(t)||(t=f.from(t,s)),f.isBuffer(e)||(e=f.from(e,s)),function(t,e){t.then(function(t){r.nextTick(function(){e(null,t)})},function(t){r.nextTick(function(){e(t)})})}(function(t){if(n.process&&!n.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==c[t])return c[t];var e=l(i=i||f.alloc(8),i,10,128,t).then(function(){return!0}).catch(function(){return!1});return c[t]=e,e}(g).then(function(r){return r?l(t,e,d,p,g):a(t,e,d,p,m)}),b)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":160,"./precondition":161,"./sync":162,_process:164,"safe-buffer":194}],160:[function(t,e,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,t("_process"))},{_process:164}],161:[function(t,e,r){(function(t){var r=Math.pow(2,30)-1;function n(e,r){if("string"!=typeof e&&!t.isBuffer(e))throw new TypeError(r+" must be a buffer or string")}e.exports=function(t,e,i,o){if(n(t,"Password"),n(e,"Salt"),"number"!=typeof i)throw new TypeError("Iterations not a number");if(i<0)throw new TypeError("Bad iterations");if("number"!=typeof o)throw new TypeError("Key length not a number");if(o<0||o>r||o!=o)throw new TypeError("Bad key length")}}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":135}],162:[function(t,e,r){var n=t("create-hash/md5"),i=t("ripemd160"),o=t("sha.js"),s=t("./precondition"),a=t("./default-encoding"),f=t("safe-buffer").Buffer,u=f.alloc(128),h={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function c(t,e,r){var s=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new i).update(t).digest()}:"md5"===t?n:function(e){return o(t).update(e).digest()}}(t),a="sha512"===t||"sha384"===t?128:64;e.length>a?e=s(e):e.length<a&&(e=f.concat([e,u],a));for(var c=f.allocUnsafe(a+h[t]),l=f.allocUnsafe(a+h[t]),d=0;d<a;d++)c[d]=54^e[d],l[d]=92^e[d];var p=f.allocUnsafe(a+r+4);c.copy(p,0,0,a),this.ipad1=p,this.ipad2=c,this.opad=l,this.alg=t,this.blocksize=a,this.hash=s,this.size=h[t]}c.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(t,e,r,n,i){s(t,e,r,n),f.isBuffer(t)||(t=f.from(t,a)),f.isBuffer(e)||(e=f.from(e,a));var o=new c(i=i||"sha1",t,e.length),u=f.allocUnsafe(n),l=f.allocUnsafe(e.length+4);e.copy(l,0,0,e.length);for(var d=0,p=h[i],m=Math.ceil(n/p),b=1;b<=m;b++){l.writeUInt32BE(b,e.length);for(var g=o.run(l,o.ipad1),v=g,y=1;y<r;y++){v=o.run(v,o.ipad2);for(var w=0;w<p;w++)g[w]^=v[w]}g.copy(u,d),d+=p}return u}},{"./default-encoding":160,"./precondition":161,"create-hash/md5":81,ripemd160:193,"safe-buffer":194,"sha.js":196}],163:[function(t,e,r){(function(t){"use strict";void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return t.nextTick(function(){e.apply(null,o)})}}}:e.exports=t}).call(this,t("_process"))},{_process:164}],164:[function(t,e,r){var n,i,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function f(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var u,h=[],c=!1,l=-1;function d(){c&&u&&(c=!1,u.length?h=u.concat(h):l=-1,h.length&&p())}function p(){if(!c){var t=f(d);c=!0;for(var e=h.length;e;){for(u=h,h=[];++l<e;)u&&u[l].run();l=-1,e=h.length}u=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function b(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new m(t,e)),1!==h.length||c||f(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=b,o.addListener=b,o.once=b,o.off=b,o.removeListener=b,o.removeAllListeners=b,o.emit=b,o.prependListener=b,o.prependOnceListener=b,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],165:[function(t,e,r){r.publicEncrypt=t("./publicEncrypt"),r.privateDecrypt=t("./privateDecrypt"),r.privateEncrypt=function(t,e){return r.publicEncrypt(t,e,!0)},r.publicDecrypt=function(t,e){return r.privateDecrypt(t,e,!0)}},{"./privateDecrypt":167,"./publicEncrypt":168}],166:[function(t,e,r){var n=t("create-hash"),i=t("safe-buffer").Buffer;function o(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}e.exports=function(t,e){for(var r,s=i.alloc(0),a=0;s.length<e;)r=o(a++),s=i.concat([s,n("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},{"create-hash":80,"safe-buffer":194}],167:[function(t,e,r){var n=t("parse-asn1"),i=t("./mgf"),o=t("./xor"),s=t("bn.js"),a=t("browserify-rsa"),f=t("create-hash"),u=t("./withPublic"),h=t("safe-buffer").Buffer;e.exports=function(t,e,r){var c;c=t.padding?t.padding:r?1:4;var l,d=n(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");l=r?u(new s(e),d):a(e,d);var m=h.alloc(p-l.length);if(l=h.concat([m,l],p),4===c)return function(t,e){var r=t.modulus.byteLength(),n=f("sha1").update(h.alloc(0)).digest(),s=n.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),u=e.slice(s+1),c=o(a,i(u,s)),l=o(u,i(c,r-s-1));if(function(t,e){t=h.from(t),e=h.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));var i=-1;for(;++i<n;)r+=t[i]^e[i];return r}(n,l.slice(0,s)))throw new Error("decryption error");var d=s;for(;0===l[d];)d++;if(1!==l[d++])throw new Error("decryption error");return l.slice(d)}(d,l);if(1===c)return function(t,e,r){var n=e.slice(0,2),i=2,o=0;for(;0!==e[i++];)if(i>=e.length){o++;break}var s=e.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,l,r);if(3===c)return l;throw new Error("unknown padding")}},{"./mgf":166,"./withPublic":169,"./xor":170,"bn.js":44,"browserify-rsa":67,"create-hash":80,"parse-asn1":156,"safe-buffer":194}],168:[function(t,e,r){var n=t("parse-asn1"),i=t("randombytes"),o=t("create-hash"),s=t("./mgf"),a=t("./xor"),f=t("bn.js"),u=t("./withPublic"),h=t("browserify-rsa"),c=t("safe-buffer").Buffer;e.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var d,p=n(t);if(4===l)d=function(t,e){var r=t.modulus.byteLength(),n=e.length,u=o("sha1").update(c.alloc(0)).digest(),h=u.length,l=2*h;if(n>r-l-2)throw new Error("message too long");var d=c.alloc(r-n-l-2),p=r-h-1,m=i(h),b=a(c.concat([u,d,c.alloc(1,1),e],p),s(m,p)),g=a(m,s(b,h));return new f(c.concat([c.alloc(1),g,b],r))}(p,e);else if(1===l)d=function(t,e,r){var n,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");n=r?c.alloc(s-o-3,255):function(t){var e,r=c.allocUnsafe(t),n=0,o=i(2*t),s=0;for(;n<t;)s===o.length&&(o=i(2*t),s=0),(e=o[s++])&&(r[n++]=e);return r}(s-o-3);return new f(c.concat([c.from([0,r?1:2]),n,c.alloc(1),e],s))}(p,e,r);else{if(3!==l)throw new Error("unknown padding");if((d=new f(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?h(d,p):u(d,p)}},{"./mgf":166,"./withPublic":169,"./xor":170,"bn.js":44,"browserify-rsa":67,"create-hash":80,"parse-asn1":156,randombytes:176,"safe-buffer":194}],169:[function(t,e,r){var n=t("bn.js"),i=t("safe-buffer").Buffer;e.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},{"bn.js":44,"safe-buffer":194}],170:[function(t,e,r){e.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},{}],171:[function(t,e,r){const n=t("./src/base.js");e.exports={RandomForest:n,RandomForestClassifier:class extends n{constructor(t){t.type="classification",super(t)}},RandomForestRegressor:class extends n{constructor(t){t.type="regression",super(t)}}}},{"./src/base.js":172}],172:[function(t,e,r){const n=t("importance"),i=t("../wasm/native.js"),{uintify:o,calculateMaxFeatures:s,detectType:a,Encoder:f,normalizeProbs:u}=t("./util.js"),h=i({wasmBinary:t("../wrapper/native.bin.js").data}),c=h.cwrap("create","number",["number","number","number","number"]),l=h.cwrap("train","number",["number","array","array","number","number","number","boolean","number","number"]),d=h.cwrap("predict","number",["number","array"]),p=h.cwrap("predictProba","array",["number","array","number"]),m=h.cwrap("save",null,["number"]),b=h.cwrap("load",null,["number"]),g={nEstimators:100,maxDepth:10,maxFeatures:"auto",minSamplesLeaf:5,minInfoGain:0};e.exports=class{constructor(t={}){const e=Object.assign({},g,t);if(e.maxDepth>20)throw new Error("maxDepth should be <=20");for(const t in e)this[t]=e[t];this.model=c(e.nEstimators,e.maxDepth,e.minSamplesLeaf,e.minInfoGain)}train(t,e){this.type="string"==typeof this.type&&"auto"!==this.type?this.type:a(e),this.Xencoder=new f,this.yencoder=new f,t=this.Xencoder.fitTransform(t,this.categorical),e=this.yencoder.fitTransform(e).flat(),this.nSamples=t.length,this.nFeatures=t[0].length,this.nClasses="regression"===this.type?1:Array.from(new Set(e)).length;const r=o(t.flat()),n=o(e);l(this.model,r,n,this.nSamples,this.nFeatures,this.nClasses,"regression"===this.type,s(this.maxFeatures,this.nFeatures),this.seed||Math.round(1e6*Math.random()))}predict(t){if("number"==typeof t)throw new Error("X should be array, try [value]");return Array.isArray(t)&&!Array.isArray(t[0])?(t=this.Xencoder.transform([t])[0],this.yencoder.inverseTransform([d(this.model,o(t))])[0]):(t=this.Xencoder.transform(t),this.yencoder.inverseTransform(t.map(t=>d(this.model,o(t)))))}predictProba(t){if("number"==typeof t)throw new Error("X should be array, try [value]");if(Array.isArray(t)&&!Array.isArray(t[0])){t=this.Xencoder.transform([t])[0];const e=p(this.model,o(t.flat()),this.nClasses),r=[];for(let t=0;t<this.nClasses;t++)r.push(h.HEAPF32[e/Float32Array.BYTES_PER_ELEMENT+t]);return u(r)}return t.map(t=>this.predictProba(t))}save(){return m(this.model),h.FS_readFile("model.txt")}load(t){h.FS_writeFile("model.txt",t),b(this.model)}getFeatureImportances(t,e,r={}){if(this.nSamples)return"ce"===r.kind||"classification"===this.type&&!r.kind?(e=this.yencoder.transform(e).flat(),r.kind="ce"):"regression"!==this.type||r.kind||(r.kind="mae"),n(this,t,e,r);throw new Error("Train the model first")}}},{"../wasm/native.js":174,"../wrapper/native.bin.js":175,"./util.js":173,importance:131}],173:[function(t,e,r){function n(t){if(t.some(t=>isNaN(t)))return"classification";{const e=Array.from(new Set(t)).length;return e/t.length<.2&&e<20?"classification":"regression"}}e.exports={uintify:function(t){return new Uint8Array(Float32Array.from(t).buffer)},accuracy:function(t,e){const r=t.length;return t.reduce((t,r,n)=>t+(r===e[n]),0)/r},calculateMaxFeatures:function(t,e){return"auto"===t||"sqrt"===t?Math.round(Math.sqrt(e)):"log2"===t?Math.round(Math.log2(e)):Math.round(t)===t?t:t<1?Math.round(t*e):e},detectType:n,Encoder:class{constructor(t="label"){this.type=t,this.uniques=[]}fitTransform(t,e){const r=(t=Array.isArray(t[0])?t:t.map(t=>[t])).map(t=>t.slice(0));for(let t=0;t<r[0].length;t++){const i=r.map(e=>e[t]);if("classification"===(e?e[t]?"classification":"regression":n(i))){const e=Array.from(new Set(i));this.uniques.push(e),i.forEach((n,i)=>{r[i][t]=e.indexOf(n)})}else i.forEach((e,n)=>{r[n][t]=parseFloat(e)}),this.uniques.push(null)}return r}transform(t){const e=(t=Array.isArray(t[0])?t:t.map(t=>[t])).map(t=>t.slice(0));for(let t=0;t<e[0].length;t++){const r=e.map(e=>e[t]),n=this.uniques[t];Array.isArray(n)?r.forEach((r,i)=>{e[i][t]=n.indexOf(r)}):r.forEach((r,n)=>{e[n][t]=parseFloat(r)})}return e}inverseTransform(t){const e=this.uniques[this.uniques.length-1];return Array.isArray(e)?t.map((t,r)=>e[t]):t}},normalizeProbs:function(t){const e=t.reduce((t,e)=>t+e,0);return e>0?t.map(t=>t/e):t.map(e=>1/t.length)}}},{}],174:[function(t,e,r){(function(n,i,o,s,a,f,u,h){var c,l=(c="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,void 0!==o&&(c=c||o),function(e){e=void 0!==(e=e||{})?e:{};var r,o={};for(r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);var s,a,f,u,l=[];s="object"==typeof window,a="function"==typeof importScripts,f="object"==typeof n&&"object"==typeof n.versions&&"string"==typeof n.versions.node,u=!s&&!f&&!a;var d,p,m,b,g="";f?(g=a?t("path").dirname(g)+"/":h+"/",d=function(e,r){return m||(m=t("fs")),b||(b=t("path")),e=b.normalize(e),m.readFileSync(e,r?null:"utf8")},p=function(t){var e=d(t,!0);return e.buffer||(e=new Uint8Array(e)),E(e.buffer),e},n.argv.length>1&&n.argv[1].replace(/\\/g,"/"),l=n.argv.slice(2),n.on("uncaughtException",function(t){if(!(t instanceof function(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}))throw t}),n.on("unhandledRejection",nt),e.inspect=function(){return"[Emscripten Module object]"}):u?("undefined"!=typeof read&&(d=function(t){return read(t)}),p=function(t){var e;return"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(E("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs?l=scriptArgs:void 0!==arguments&&(l=arguments),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(s||a)&&(a?g=self.location.href:document.currentScript&&(g=document.currentScript.src),c&&(g=c),g=0!==g.indexOf("blob:")?g.substr(0,g.lastIndexOf("/")+1):"",d=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},a&&(p=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}));var v,y,w=e.print||console.log.bind(console),_=e.printErr||console.warn.bind(console);for(r in o)o.hasOwnProperty(r)&&(e[r]=o[r]);function x(t){var e=D[q>>2],r=e+t+15&-16;return r>vt()&&nt(),D[q>>2]=r,e}o=null,e.arguments&&(l=e.arguments),e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(v=e.wasmBinary),e.noExitRuntime&&e.noExitRuntime,"object"!=typeof WebAssembly&&_("no native wasm support detected");var M=new WebAssembly.Table({initial:45,maximum:45,element:"anyfunc"}),S=!1;function E(t,e){t||nt("Assertion failed: "+e)}function k(t){var r=e["_"+t];return E(r,"Cannot call unknown function "+t+", make sure it is exported"),r}function A(t,e,r,n,i){var o={string:function(t){var e=0;if(null!==t&&void 0!==t&&0!==t){var r=1+(t.length<<2);P(t,e=jt(r),r)}return e},array:function(t){var e,r,n=jt(t.length);return e=t,r=n,I.set(e,r),n}},s=k(t),a=[],f=0;if(n)for(var u=0;u<n.length;u++){var h=o[r[u]];h?(0===f&&(f=At()),a[u]=h(n[u])):a[u]=n[u]}var c=s.apply(null,a);return c=function(t){return"string"===e?B(t):"boolean"===e?Boolean(t):t}(c),0!==f&&It(f),c}var j,I,R,O,D,N="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function C(t,e,r){for(var n=e+r,i=e;t[i]&&!(i>=n);)++i;if(i-e>16&&t.subarray&&N)return N.decode(t.subarray(e,i));for(var o="";e<i;){var s=t[e++];if(128&s){var a=63&t[e++];if(192!=(224&s)){var f=63&t[e++];if((s=224==(240&s)?(15&s)<<12|a<<6|f:(7&s)<<18|a<<12|f<<6|63&t[e++])<65536)o+=String.fromCharCode(s);else{var u=s-65536;o+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}function B(t,e){return t?C(R,t,e):""}function T(t,e,r,n){if(!(n>0))return 0;for(var i=r,o=r+n-1,s=0;s<t.length;++s){var a=t.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++s)),a<=127){if(r>=o)break;e[r++]=a}else if(a<=2047){if(r+1>=o)break;e[r++]=192|a>>6,e[r++]=128|63&a}else if(a<=65535){if(r+2>=o)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a}else{if(r+3>=o)break;e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}}return e[r]=0,r-i}function P(t,e,r){return T(t,R,e,r)}function z(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++r)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function F(t){j=t,e.HEAP8=I=new Int8Array(t),e.HEAP16=O=new Int16Array(t),e.HEAP32=D=new Int32Array(t),e.HEAPU8=R=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var q=4496,L=e.INITIAL_MEMORY||16777216;function U(t){for(;t.length>0;){var r=t.shift();if("function"!=typeof r){var n=r.func;"number"==typeof n?void 0===r.arg?e.dynCall_v(n):e.dynCall_vi(n,r.arg):n(void 0===r.arg?null:r.arg)}else r()}}(y=e.wasmMemory?e.wasmMemory:new WebAssembly.Memory({initial:L/65536}))&&(j=y.buffer),L=j.byteLength,F(j),D[q>>2]=5247536;var V=[],H=[],X=[],W=[],K=!1,$=Math.abs,J=Math.ceil,Y=Math.floor,G=Math.min,Z=0,Q=null,tt=null;function et(t){Z++,e.monitorRunDependencies&&e.monitorRunDependencies(Z)}function rt(t){if(Z--,e.monitorRunDependencies&&e.monitorRunDependencies(Z),0==Z&&(null!==Q&&(clearInterval(Q),Q=null),tt)){var r=tt;tt=null,r()}}function nt(t){throw e.onAbort&&e.onAbort(t),w(t+=""),_(t),S=!0,t="abort("+t+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(t)}e.preloadedImages={},e.preloadedAudios={};var it,ot,st,at,ft="data:application/octet-stream;base64,",ut="native.wasm";function ht(){var t=function(){var t=new Error;if(!t.stack){try{throw new Error}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}();return e.extraStackTrace&&(t+="\n"+e.extraStackTrace()),t.replace(/\b_Z[\w\d_]+/g,function(t){var e=t;return t===e?t:e+" ["+t+"]"})}function ct(t){return e.___errno_location&&(D[e.___errno_location()>>2]=t),t}ot=ut,(String.prototype.startsWith?ot.startsWith(ft):0===ot.indexOf(ft))||(it=ut,ut=e.locateFile?e.locateFile(it,g):g+it),H.push({func:function(){Et()}});var lt={splitPath:function(t){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1)},normalizeArray:function(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:function(t){var e="/"===t.charAt(0),r="/"===t.substr(-1);return(t=lt.normalizeArray(t.split("/").filter(function(t){return!!t}),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:function(t){var e=lt.splitPath(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(t){if("/"===t)return"/";var e=t.lastIndexOf("/");return-1===e?t:t.substr(e+1)},extname:function(t){return lt.splitPath(t)[3]},join:function(){var t=Array.prototype.slice.call(arguments,0);return lt.normalize(t.join("/"))},join2:function(t,e){return lt.normalize(t+"/"+e)}},dt={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:bt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e="/"===n.charAt(0)}return t=lt.normalizeArray(t.split("/").filter(function(t){return!!t}),!e).join("/"),(e?"/":"")+t||"."},relative:function(t,e){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=dt.resolve(t).substr(1),e=dt.resolve(e).substr(1);for(var n=r(t.split("/")),i=r(e.split("/")),o=Math.min(n.length,i.length),s=o,a=0;a<o;a++)if(n[a]!==i[a]){s=a;break}var f=[];for(a=s;a<n.length;a++)f.push("..");return(f=f.concat(i.slice(s))).join("/")}},pt={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){pt.ttys[t]={input:[],output:[],ops:e},bt.registerDevice(t,pt.stream_ops)},stream_ops:{open:function(t){var e=pt.ttys[t.node.rdev];if(!e)throw new bt.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.flush(t.tty)},flush:function(t){t.tty.ops.flush(t.tty)},read:function(t,e,r,n,i){if(!t.tty||!t.tty.ops.get_char)throw new bt.ErrnoError(60);for(var o=0,s=0;s<n;s++){var a;try{a=t.tty.ops.get_char(t.tty)}catch(t){throw new bt.ErrnoError(29)}if(void 0===a&&0===o)throw new bt.ErrnoError(6);if(null===a||void 0===a)break;o++,e[r+s]=a}return o&&(t.node.timestamp=Date.now()),o},write:function(t,e,r,n,i){if(!t.tty||!t.tty.ops.put_char)throw new bt.ErrnoError(60);try{for(var o=0;o<n;o++)t.tty.ops.put_char(t.tty,e[r+o])}catch(t){throw new bt.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:function(t){if(!t.input.length){var e=null;if(f){var r=i.alloc?i.alloc(256):new i(256),o=0;try{o=m.readSync(n.stdin.fd,r,0,256,null)}catch(t){if(-1==t.toString().indexOf("EOF"))throw t;o=0}e=o>0?r.slice(0,o).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=_t(e,!0)}return t.input.shift()},put_char:function(t,e){null===e||10===e?(w(C(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(w(C(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(_(C(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(_(C(t.output,0)),t.output=[])}}},mt={ops_table:null,mount:function(t){return mt.createNode(null,"/",16895,0)},createNode:function(t,e,r,n){if(bt.isBlkdev(r)||bt.isFIFO(r))throw new bt.ErrnoError(63);mt.ops_table||(mt.ops_table={dir:{node:{getattr:mt.node_ops.getattr,setattr:mt.node_ops.setattr,lookup:mt.node_ops.lookup,mknod:mt.node_ops.mknod,rename:mt.node_ops.rename,unlink:mt.node_ops.unlink,rmdir:mt.node_ops.rmdir,readdir:mt.node_ops.readdir,symlink:mt.node_ops.symlink},stream:{llseek:mt.stream_ops.llseek}},file:{node:{getattr:mt.node_ops.getattr,setattr:mt.node_ops.setattr},stream:{llseek:mt.stream_ops.llseek,read:mt.stream_ops.read,write:mt.stream_ops.write,allocate:mt.stream_ops.allocate,mmap:mt.stream_ops.mmap,msync:mt.stream_ops.msync}},link:{node:{getattr:mt.node_ops.getattr,setattr:mt.node_ops.setattr,readlink:mt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:mt.node_ops.getattr,setattr:mt.node_ops.setattr},stream:bt.chrdev_stream_ops}});var i=bt.createNode(t,e,r,n);return bt.isDir(i.mode)?(i.node_ops=mt.ops_table.dir.node,i.stream_ops=mt.ops_table.dir.stream,i.contents={}):bt.isFile(i.mode)?(i.node_ops=mt.ops_table.file.node,i.stream_ops=mt.ops_table.file.stream,i.usedBytes=0,i.contents=null):bt.isLink(i.mode)?(i.node_ops=mt.ops_table.link.node,i.stream_ops=mt.ops_table.link.stream):bt.isChrdev(i.mode)&&(i.node_ops=mt.ops_table.chrdev.node,i.stream_ops=mt.ops_table.chrdev.stream),i.timestamp=Date.now(),t&&(t.contents[e]=i),i},getFileDataAsRegularArray:function(t){if(t.contents&&t.contents.subarray){for(var e=[],r=0;r<t.usedBytes;++r)e.push(t.contents[r]);return e}return t.contents},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){e=Math.max(e,r*(r<1048576?2:1.125)|0),0!=r&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,e){if(t.usedBytes!=e){if(0==e)return t.contents=null,void(t.usedBytes=0);if(!t.contents||t.contents.subarray){var r=t.contents;return t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),void(t.usedBytes=e)}if(t.contents||(t.contents=[]),t.contents.length>e)t.contents.length=e;else for(;t.contents.length<e;)t.contents.push(0);t.usedBytes=e}},node_ops:{getattr:function(t){var e={};return e.dev=bt.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,bt.isDir(t.mode)?e.size=4096:bt.isFile(t.mode)?e.size=t.usedBytes:bt.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&mt.resizeFileStorage(t,e.size)},lookup:function(t,e){throw bt.genericErrors[44]},mknod:function(t,e,r,n){return mt.createNode(t,e,r,n)},rename:function(t,e,r){if(bt.isDir(t.mode)){var n;try{n=bt.lookupNode(e,r)}catch(t){}if(n)for(var i in n.contents)throw new bt.ErrnoError(55)}delete t.parent.contents[t.name],t.name=r,e.contents[r]=t,t.parent=e},unlink:function(t,e){delete t.contents[e]},rmdir:function(t,e){var r=bt.lookupNode(t,e);for(var n in r.contents)throw new bt.ErrnoError(55);delete t.contents[e]},readdir:function(t){var e=[".",".."];for(var r in t.contents)t.contents.hasOwnProperty(r)&&e.push(r);return e},symlink:function(t,e,r){var n=mt.createNode(t,e,41471,0);return n.link=r,n},readlink:function(t){if(!bt.isLink(t.mode))throw new bt.ErrnoError(28);return t.link}},stream_ops:{read:function(t,e,r,n,i){var o=t.node.contents;if(i>=t.node.usedBytes)return 0;var s=Math.min(t.node.usedBytes-i,n);if(s>8&&o.subarray)e.set(o.subarray(i,i+s),r);else for(var a=0;a<s;a++)e[r+a]=o[i+a];return s},write:function(t,e,r,n,i,o){if(e.buffer===I.buffer&&(o=!1),!n)return 0;var s=t.node;if(s.timestamp=Date.now(),e.subarray&&(!s.contents||s.contents.subarray)){if(o)return s.contents=e.subarray(r,r+n),s.usedBytes=n,n;if(0===s.usedBytes&&0===i)return s.contents=e.slice(r,r+n),s.usedBytes=n,n;if(i+n<=s.usedBytes)return s.contents.set(e.subarray(r,r+n),i),n}if(mt.expandFileStorage(s,i+n),s.contents.subarray&&e.subarray)s.contents.set(e.subarray(r,r+n),i);else for(var a=0;a<n;a++)s.contents[i+a]=e[r+a];return s.usedBytes=Math.max(s.usedBytes,i+n),n},llseek:function(t,e,r){var n=e;if(1===r?n+=t.position:2===r&&bt.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new bt.ErrnoError(28);return n},allocate:function(t,e,r){mt.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap:function(t,e,r,n,i,o,s){if(!bt.isFile(t.node.mode))throw new bt.ErrnoError(43);var a,f,u=t.node.contents;if(2&s||u.buffer!==e.buffer){(i>0||i+n<u.length)&&(u=u.subarray?u.subarray(i,i+n):Array.prototype.slice.call(u,i,i+n)),f=!0;var h=e.buffer==I.buffer;if(!(a=kt(n)))throw new bt.ErrnoError(48);(h?I:e).set(u,a)}else f=!1,a=u.byteOffset;return{ptr:a,allocated:f}},msync:function(t,e,r,n,i){if(!bt.isFile(t.node.mode))throw new bt.ErrnoError(43);return 2&i?0:(mt.stream_ops.write(t,e,0,n,r,!1),0)}}},bt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(t){if(!(t instanceof bt.ErrnoError))throw t+" : "+ht();return ct(t.errno)},lookupPath:function(t,e){if(t=dt.resolve(bt.cwd(),t),e=e||{},!t)return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===e[n]&&(e[n]=r[n]);if(e.recurse_count>8)throw new bt.ErrnoError(32);for(var i=lt.normalizeArray(t.split("/").filter(function(t){return!!t}),!1),o=bt.root,s="/",a=0;a<i.length;a++){var f=a===i.length-1;if(f&&e.parent)break;if(o=bt.lookupNode(o,i[a]),s=lt.join2(s,i[a]),bt.isMountpoint(o)&&(!f||f&&e.follow_mount)&&(o=o.mounted.root),!f||e.follow)for(var u=0;bt.isLink(o.mode);){var h=bt.readlink(s);if(s=dt.resolve(lt.dirname(s),h),o=bt.lookupPath(s,{recurse_count:e.recurse_count}).node,u++>40)throw new bt.ErrnoError(32)}}return{path:s,node:o}},getPath:function(t){for(var e;;){if(bt.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?r+"/"+e:r+e:r}e=e?t.name+"/"+e:t.name,t=t.parent}},hashName:function(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%bt.nameTable.length},hashAddNode:function(t){var e=bt.hashName(t.parent.id,t.name);t.name_next=bt.nameTable[e],bt.nameTable[e]=t},hashRemoveNode:function(t){var e=bt.hashName(t.parent.id,t.name);if(bt.nameTable[e]===t)bt.nameTable[e]=t.name_next;else for(var r=bt.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode:function(t,e){var r=bt.mayLookup(t);if(r)throw new bt.ErrnoError(r,t);for(var n=bt.hashName(t.id,e),i=bt.nameTable[n];i;i=i.name_next){var o=i.name;if(i.parent.id===t.id&&o===e)return i}return bt.lookup(t,e)},createNode:function(t,e,r,n){var i=new bt.FSNode(t,e,r,n);return bt.hashAddNode(i),i},destroyNode:function(t){bt.hashRemoveNode(t)},isRoot:function(t){return t===t.parent},isMountpoint:function(t){return!!t.mounted},isFile:function(t){return 32768==(61440&t)},isDir:function(t){return 16384==(61440&t)},isLink:function(t){return 40960==(61440&t)},isChrdev:function(t){return 8192==(61440&t)},isBlkdev:function(t){return 24576==(61440&t)},isFIFO:function(t){return 4096==(61440&t)},isSocket:function(t){return 49152==(49152&t)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(t){var e=bt.flagModes[t];if(void 0===e)throw new Error("Unknown file open mode: "+t);return e},flagsToPermissionString:function(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:function(t,e){return bt.ignorePermissions?0:(-1===e.indexOf("r")||292&t.mode)&&(-1===e.indexOf("w")||146&t.mode)&&(-1===e.indexOf("x")||73&t.mode)?0:2},mayLookup:function(t){var e=bt.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:function(t,e){try{return bt.lookupNode(t,e),20}catch(t){}return bt.nodePermissions(t,"wx")},mayDelete:function(t,e,r){var n;try{n=bt.lookupNode(t,e)}catch(t){return t.errno}var i=bt.nodePermissions(t,"wx");if(i)return i;if(r){if(!bt.isDir(n.mode))return 54;if(bt.isRoot(n)||bt.getPath(n)===bt.cwd())return 10}else if(bt.isDir(n.mode))return 31;return 0},mayOpen:function(t,e){return t?bt.isLink(t.mode)?32:bt.isDir(t.mode)&&("r"!==bt.flagsToPermissionString(e)||512&e)?31:bt.nodePermissions(t,bt.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(t,e){t=t||0,e=e||bt.MAX_OPEN_FDS;for(var r=t;r<=e;r++)if(!bt.streams[r])return r;throw new bt.ErrnoError(33)},getStream:function(t){return bt.streams[t]},createStream:function(t,e,r){bt.FSStream||(bt.FSStream=function(){},bt.FSStream.prototype={object:{get:function(){return this.node},set:function(t){this.node=t}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new bt.FSStream;for(var i in t)n[i]=t[i];t=n;var o=bt.nextfd(e,r);return t.fd=o,bt.streams[o]=t,t},closeStream:function(t){bt.streams[t]=null},chrdev_stream_ops:{open:function(t){var e=bt.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:function(){throw new bt.ErrnoError(70)}},major:function(t){return t>>8},minor:function(t){return 255&t},makedev:function(t,e){return t<<8|e},registerDevice:function(t,e){bt.devices[t]={stream_ops:e}},getDevice:function(t){return bt.devices[t]},getMounts:function(t){for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs:function(t,e){"function"==typeof t&&(e=t,t=!1),bt.syncFSRequests++,bt.syncFSRequests>1&&_("warning: "+bt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=bt.getMounts(bt.root.mount),n=0;function i(t){return bt.syncFSRequests--,e(t)}function o(t){if(t)return o.errored?void 0:(o.errored=!0,i(t));++n>=r.length&&i(null)}r.forEach(function(e){if(!e.type.syncfs)return o(null);e.type.syncfs(e,t,o)})},mount:function(t,e,r){var n,i="/"===r,o=!r;if(i&&bt.root)throw new bt.ErrnoError(10);if(!i&&!o){var s=bt.lookupPath(r,{follow_mount:!1});if(r=s.path,n=s.node,bt.isMountpoint(n))throw new bt.ErrnoError(10);if(!bt.isDir(n.mode))throw new bt.ErrnoError(54)}var a={type:t,opts:e,mountpoint:r,mounts:[]},f=t.mount(a);return f.mount=a,a.root=f,i?bt.root=f:n&&(n.mounted=a,n.mount&&n.mount.mounts.push(a)),f},unmount:function(t){var e=bt.lookupPath(t,{follow_mount:!1});if(!bt.isMountpoint(e.node))throw new bt.ErrnoError(28);var r=e.node,n=r.mounted,i=bt.getMounts(n);Object.keys(bt.nameTable).forEach(function(t){for(var e=bt.nameTable[t];e;){var r=e.name_next;-1!==i.indexOf(e.mount)&&bt.destroyNode(e),e=r}}),r.mounted=null;var o=r.mount.mounts.indexOf(n);r.mount.mounts.splice(o,1)},lookup:function(t,e){return t.node_ops.lookup(t,e)},mknod:function(t,e,r){var n=bt.lookupPath(t,{parent:!0}).node,i=lt.basename(t);if(!i||"."===i||".."===i)throw new bt.ErrnoError(28);var o=bt.mayCreate(n,i);if(o)throw new bt.ErrnoError(o);if(!n.node_ops.mknod)throw new bt.ErrnoError(63);return n.node_ops.mknod(n,i,e,r)},create:function(t,e){return e=void 0!==e?e:438,e&=4095,e|=32768,bt.mknod(t,e,0)},mkdir:function(t,e){return e=void 0!==e?e:511,e&=1023,e|=16384,bt.mknod(t,e,0)},mkdirTree:function(t,e){for(var r=t.split("/"),n="",i=0;i<r.length;++i)if(r[i]){n+="/"+r[i];try{bt.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:function(t,e,r){return void 0===r&&(r=e,e=438),e|=8192,bt.mknod(t,e,r)},symlink:function(t,e){if(!dt.resolve(t))throw new bt.ErrnoError(44);var r=bt.lookupPath(e,{parent:!0}).node;if(!r)throw new bt.ErrnoError(44);var n=lt.basename(e),i=bt.mayCreate(r,n);if(i)throw new bt.ErrnoError(i);if(!r.node_ops.symlink)throw new bt.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename:function(t,e){var r,n,i=lt.dirname(t),o=lt.dirname(e),s=lt.basename(t),a=lt.basename(e);try{r=bt.lookupPath(t,{parent:!0}).node,n=bt.lookupPath(e,{parent:!0}).node}catch(t){throw new bt.ErrnoError(10)}if(!r||!n)throw new bt.ErrnoError(44);if(r.mount!==n.mount)throw new bt.ErrnoError(75);var f,u=bt.lookupNode(r,s),h=dt.relative(t,o);if("."!==h.charAt(0))throw new bt.ErrnoError(28);if("."!==(h=dt.relative(e,i)).charAt(0))throw new bt.ErrnoError(55);try{f=bt.lookupNode(n,a)}catch(t){}if(u!==f){var c=bt.isDir(u.mode),l=bt.mayDelete(r,s,c);if(l)throw new bt.ErrnoError(l);if(l=f?bt.mayDelete(n,a,c):bt.mayCreate(n,a))throw new bt.ErrnoError(l);if(!r.node_ops.rename)throw new bt.ErrnoError(63);if(bt.isMountpoint(u)||f&&bt.isMountpoint(f))throw new bt.ErrnoError(10);if(n!==r&&(l=bt.nodePermissions(r,"w")))throw new bt.ErrnoError(l);try{bt.trackingDelegate.willMovePath&&bt.trackingDelegate.willMovePath(t,e)}catch(r){_("FS.trackingDelegate['willMovePath']('"+t+"', '"+e+"') threw an exception: "+r.message)}bt.hashRemoveNode(u);try{r.node_ops.rename(u,n,a)}catch(t){throw t}finally{bt.hashAddNode(u)}try{bt.trackingDelegate.onMovePath&&bt.trackingDelegate.onMovePath(t,e)}catch(r){_("FS.trackingDelegate['onMovePath']('"+t+"', '"+e+"') threw an exception: "+r.message)}}},rmdir:function(t){var e=bt.lookupPath(t,{parent:!0}).node,r=lt.basename(t),n=bt.lookupNode(e,r),i=bt.mayDelete(e,r,!0);if(i)throw new bt.ErrnoError(i);if(!e.node_ops.rmdir)throw new bt.ErrnoError(63);if(bt.isMountpoint(n))throw new bt.ErrnoError(10);try{bt.trackingDelegate.willDeletePath&&bt.trackingDelegate.willDeletePath(t)}catch(e){_("FS.trackingDelegate['willDeletePath']('"+t+"') threw an exception: "+e.message)}e.node_ops.rmdir(e,r),bt.destroyNode(n);try{bt.trackingDelegate.onDeletePath&&bt.trackingDelegate.onDeletePath(t)}catch(e){_("FS.trackingDelegate['onDeletePath']('"+t+"') threw an exception: "+e.message)}},readdir:function(t){var e=bt.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new bt.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(t){var e=bt.lookupPath(t,{parent:!0}).node,r=lt.basename(t),n=bt.lookupNode(e,r),i=bt.mayDelete(e,r,!1);if(i)throw new bt.ErrnoError(i);if(!e.node_ops.unlink)throw new bt.ErrnoError(63);if(bt.isMountpoint(n))throw new bt.ErrnoError(10);try{bt.trackingDelegate.willDeletePath&&bt.trackingDelegate.willDeletePath(t)}catch(e){_("FS.trackingDelegate['willDeletePath']('"+t+"') threw an exception: "+e.message)}e.node_ops.unlink(e,r),bt.destroyNode(n);try{bt.trackingDelegate.onDeletePath&&bt.trackingDelegate.onDeletePath(t)}catch(e){_("FS.trackingDelegate['onDeletePath']('"+t+"') threw an exception: "+e.message)}},readlink:function(t){var e=bt.lookupPath(t).node;if(!e)throw new bt.ErrnoError(44);if(!e.node_ops.readlink)throw new bt.ErrnoError(28);return dt.resolve(bt.getPath(e.parent),e.node_ops.readlink(e))},stat:function(t,e){var r=bt.lookupPath(t,{follow:!e}).node;if(!r)throw new bt.ErrnoError(44);if(!r.node_ops.getattr)throw new bt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:function(t){return bt.stat(t,!0)},chmod:function(t,e,r){var n;if(!(n="string"==typeof t?bt.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new bt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:function(t,e){bt.chmod(t,e,!0)},fchmod:function(t,e){var r=bt.getStream(t);if(!r)throw new bt.ErrnoError(8);bt.chmod(r.node,e)},chown:function(t,e,r,n){var i;if(!(i="string"==typeof t?bt.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new bt.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown:function(t,e,r){bt.chown(t,e,r,!0)},fchown:function(t,e,r){var n=bt.getStream(t);if(!n)throw new bt.ErrnoError(8);bt.chown(n.node,e,r)},truncate:function(t,e){if(e<0)throw new bt.ErrnoError(28);var r;if(!(r="string"==typeof t?bt.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new bt.ErrnoError(63);if(bt.isDir(r.mode))throw new bt.ErrnoError(31);if(!bt.isFile(r.mode))throw new bt.ErrnoError(28);var n=bt.nodePermissions(r,"w");if(n)throw new bt.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate:function(t,e){var r=bt.getStream(t);if(!r)throw new bt.ErrnoError(8);if(0==(2097155&r.flags))throw new bt.ErrnoError(28);bt.truncate(r.node,e)},utime:function(t,e,r){var n=bt.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open:function(t,r,n,i,o){if(""===t)throw new bt.ErrnoError(44);var s;if(r="string"==typeof r?bt.modeStringToFlags(r):r,n=void 0===n?438:n,n=64&r?4095&n|32768:0,"object"==typeof t)s=t;else{t=lt.normalize(t);try{s=bt.lookupPath(t,{follow:!(131072&r)}).node}catch(t){}}var a=!1;if(64&r)if(s){if(128&r)throw new bt.ErrnoError(20)}else s=bt.mknod(t,n,0),a=!0;if(!s)throw new bt.ErrnoError(44);if(bt.isChrdev(s.mode)&&(r&=-513),65536&r&&!bt.isDir(s.mode))throw new bt.ErrnoError(54);if(!a){var f=bt.mayOpen(s,r);if(f)throw new bt.ErrnoError(f)}512&r&&bt.truncate(s,0),r&=-641;var u=bt.createStream({node:s,path:bt.getPath(s),flags:r,seekable:!0,position:0,stream_ops:s.stream_ops,ungotten:[],error:!1},i,o);u.stream_ops.open&&u.stream_ops.open(u),!e.logReadFiles||1&r||(bt.readFiles||(bt.readFiles={}),t in bt.readFiles||(bt.readFiles[t]=1,_("FS.trackingDelegate error on read file: "+t)));try{if(bt.trackingDelegate.onOpenFile){var h=0;1!=(2097155&r)&&(h|=bt.tracking.openFlags.READ),0!=(2097155&r)&&(h|=bt.tracking.openFlags.WRITE),bt.trackingDelegate.onOpenFile(t,h)}}catch(e){_("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return u},close:function(t){if(bt.isClosed(t))throw new bt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{bt.closeStream(t.fd)}t.fd=null},isClosed:function(t){return null===t.fd},llseek:function(t,e,r){if(bt.isClosed(t))throw new bt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new bt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new bt.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,r),t.ungotten=[],t.position},read:function(t,e,r,n,i){if(n<0||i<0)throw new bt.ErrnoError(28);if(bt.isClosed(t))throw new bt.ErrnoError(8);if(1==(2097155&t.flags))throw new bt.ErrnoError(8);if(bt.isDir(t.node.mode))throw new bt.ErrnoError(31);if(!t.stream_ops.read)throw new bt.ErrnoError(28);var o=void 0!==i;if(o){if(!t.seekable)throw new bt.ErrnoError(70)}else i=t.position;var s=t.stream_ops.read(t,e,r,n,i);return o||(t.position+=s),s},write:function(t,e,r,n,i,o){if(n<0||i<0)throw new bt.ErrnoError(28);if(bt.isClosed(t))throw new bt.ErrnoError(8);if(0==(2097155&t.flags))throw new bt.ErrnoError(8);if(bt.isDir(t.node.mode))throw new bt.ErrnoError(31);if(!t.stream_ops.write)throw new bt.ErrnoError(28);1024&t.flags&&bt.llseek(t,0,2);var s=void 0!==i;if(s){if(!t.seekable)throw new bt.ErrnoError(70)}else i=t.position;var a=t.stream_ops.write(t,e,r,n,i,o);s||(t.position+=a);try{t.path&&bt.trackingDelegate.onWriteToFile&&bt.trackingDelegate.onWriteToFile(t.path)}catch(e){_("FS.trackingDelegate['onWriteToFile']('"+t.path+"') threw an exception: "+e.message)}return a},allocate:function(t,e,r){if(bt.isClosed(t))throw new bt.ErrnoError(8);if(e<0||r<=0)throw new bt.ErrnoError(28);if(0==(2097155&t.flags))throw new bt.ErrnoError(8);if(!bt.isFile(t.node.mode)&&!bt.isDir(t.node.mode))throw new bt.ErrnoError(43);if(!t.stream_ops.allocate)throw new bt.ErrnoError(138);t.stream_ops.allocate(t,e,r)},mmap:function(t,e,r,n,i,o,s){if(0!=(2&o)&&0==(2&s)&&2!=(2097155&t.flags))throw new bt.ErrnoError(2);if(1==(2097155&t.flags))throw new bt.ErrnoError(2);if(!t.stream_ops.mmap)throw new bt.ErrnoError(43);return t.stream_ops.mmap(t,e,r,n,i,o,s)},msync:function(t,e,r,n,i){return t&&t.stream_ops.msync?t.stream_ops.msync(t,e,r,n,i):0},munmap:function(t){return 0},ioctl:function(t,e,r){if(!t.stream_ops.ioctl)throw new bt.ErrnoError(59);return t.stream_ops.ioctl(t,e,r)},readFile:function(t,e){if((e=e||{}).flags=e.flags||"r",e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var r,n=bt.open(t,e.flags),i=bt.stat(t).size,o=new Uint8Array(i);return bt.read(n,o,0,i,0),"utf8"===e.encoding?r=C(o,0):"binary"===e.encoding&&(r=o),bt.close(n),r},writeFile:function(t,e,r){(r=r||{}).flags=r.flags||"w";var n=bt.open(t,r.flags,r.mode);if("string"==typeof e){var i=new Uint8Array(z(e)+1),o=T(e,i,0,i.length);bt.write(n,i,0,o,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");bt.write(n,e,0,e.byteLength,void 0,r.canOwn)}bt.close(n)},cwd:function(){return bt.currentPath},chdir:function(t){var e=bt.lookupPath(t,{follow:!0});if(null===e.node)throw new bt.ErrnoError(44);if(!bt.isDir(e.node.mode))throw new bt.ErrnoError(54);var r=bt.nodePermissions(e.node,"x");if(r)throw new bt.ErrnoError(r);bt.currentPath=e.path},createDefaultDirectories:function(){bt.mkdir("/tmp"),bt.mkdir("/home"),bt.mkdir("/home/web_user")},createDefaultDevices:function(){var e;if(bt.mkdir("/dev"),bt.registerDevice(bt.makedev(1,3),{read:function(){return 0},write:function(t,e,r,n,i){return n}}),bt.mkdev("/dev/null",bt.makedev(1,3)),pt.register(bt.makedev(5,0),pt.default_tty_ops),pt.register(bt.makedev(6,0),pt.default_tty1_ops),bt.mkdev("/dev/tty",bt.makedev(5,0)),bt.mkdev("/dev/tty1",bt.makedev(6,0)),"object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);e=function(){return crypto.getRandomValues(r),r[0]}}else if(f)try{var n=t("crypto");e=function(){return n.randomBytes(1)[0]}}catch(t){}e||(e=function(){nt("random_device")}),bt.createDevice("/dev","random",e),bt.createDevice("/dev","urandom",e),bt.mkdir("/dev/shm"),bt.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){bt.mkdir("/proc"),bt.mkdir("/proc/self"),bt.mkdir("/proc/self/fd"),bt.mount({mount:function(){var t=bt.createNode("/proc/self","fd",16895,73);return t.node_ops={lookup:function(t,e){var r=+e,n=bt.getStream(r);if(!n)throw new bt.ErrnoError(8);var i={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return i.parent=i,i}},t}},{},"/proc/self/fd")},createStandardStreams:function(){e.stdin?bt.createDevice("/dev","stdin",e.stdin):bt.symlink("/dev/tty","/dev/stdin"),e.stdout?bt.createDevice("/dev","stdout",null,e.stdout):bt.symlink("/dev/tty","/dev/stdout"),e.stderr?bt.createDevice("/dev","stderr",null,e.stderr):bt.symlink("/dev/tty1","/dev/stderr"),bt.open("/dev/stdin","r"),bt.open("/dev/stdout","w"),bt.open("/dev/stderr","w")},ensureErrnoError:function(){bt.ErrnoError||(bt.ErrnoError=function(t,e){this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},bt.ErrnoError.prototype=new Error,bt.ErrnoError.prototype.constructor=bt.ErrnoError,[44].forEach(function(t){bt.genericErrors[t]=new bt.ErrnoError(t),bt.genericErrors[t].stack="<generic error, no stack>"}))},staticInit:function(){bt.ensureErrnoError(),bt.nameTable=new Array(4096),bt.mount(mt,{},"/"),bt.createDefaultDirectories(),bt.createDefaultDevices(),bt.createSpecialDirectories(),bt.filesystems={MEMFS:mt}},init:function(t,r,n){bt.init.initialized=!0,bt.ensureErrnoError(),e.stdin=t||e.stdin,e.stdout=r||e.stdout,e.stderr=n||e.stderr,bt.createStandardStreams()},quit:function(){bt.init.initialized=!1;var t=e._fflush;t&&t(0);for(var r=0;r<bt.streams.length;r++){var n=bt.streams[r];n&&bt.close(n)}},getMode:function(t,e){var r=0;return t&&(r|=365),e&&(r|=146),r},joinPath:function(t,e){var r=lt.join.apply(null,t);return e&&"/"==r[0]&&(r=r.substr(1)),r},absolutePath:function(t,e){return dt.resolve(e,t)},standardizePath:function(t){return lt.normalize(t)},findObject:function(t,e){var r=bt.analyzePath(t,e);return r.exists?r.object:(ct(r.error),null)},analyzePath:function(t,e){try{t=(n=bt.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=bt.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=lt.basename(t),n=bt.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createFolder:function(t,e,r,n){var i=lt.join2("string"==typeof t?t:bt.getPath(t),e),o=bt.getMode(r,n);return bt.mkdir(i,o)},createPath:function(t,e,r,n){t="string"==typeof t?t:bt.getPath(t);for(var i=e.split("/").reverse();i.length;){var o=i.pop();if(o){var s=lt.join2(t,o);try{bt.mkdir(s)}catch(t){}t=s}}return s},createFile:function(t,e,r,n,i){var o=lt.join2("string"==typeof t?t:bt.getPath(t),e),s=bt.getMode(n,i);return bt.create(o,s)},createDataFile:function(t,e,r,n,i,o){var s=e?lt.join2("string"==typeof t?t:bt.getPath(t),e):t,a=bt.getMode(n,i),f=bt.create(s,a);if(r){if("string"==typeof r){for(var u=new Array(r.length),h=0,c=r.length;h<c;++h)u[h]=r.charCodeAt(h);r=u}bt.chmod(f,146|a);var l=bt.open(f,"w");bt.write(l,r,0,r.length,0,o),bt.close(l),bt.chmod(f,a)}return f},createDevice:function(t,e,r,n){var i=lt.join2("string"==typeof t?t:bt.getPath(t),e),o=bt.getMode(!!r,!!n);bt.createDevice.major||(bt.createDevice.major=64);var s=bt.makedev(bt.createDevice.major++,0);return bt.registerDevice(s,{open:function(t){t.seekable=!1},close:function(t){n&&n.buffer&&n.buffer.length&&n(10)},read:function(t,e,n,i,o){for(var s=0,a=0;a<i;a++){var f;try{f=r()}catch(t){throw new bt.ErrnoError(29)}if(void 0===f&&0===s)throw new bt.ErrnoError(6);if(null===f||void 0===f)break;s++,e[n+a]=f}return s&&(t.node.timestamp=Date.now()),s},write:function(t,e,r,i,o){for(var s=0;s<i;s++)try{n(e[r+s])}catch(t){throw new bt.ErrnoError(29)}return i&&(t.node.timestamp=Date.now()),s}}),bt.mkdev(i,o,s)},createLink:function(t,e,r,n,i){var o=lt.join2("string"==typeof t?t:bt.getPath(t),e);return bt.symlink(r,o)},forceLoadFile:function(t){if(t.isDevice||t.isFolder||t.link||t.contents)return!0;var e=!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!d)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=_t(d(t.url),!0),t.usedBytes=t.contents.length}catch(t){e=!1}return e||ct(29),e},createLazyFile:function(t,e,r,n,i){function o(){this.lengthKnown=!1,this.chunks=[]}if(o.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},o.prototype.setDataGetter=function(t){this.getter=t},o.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",r,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),i=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,o=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,s=1048576;i||(s=n);var a=this;a.setDataGetter(function(t){var e=t*s,i=(t+1)*s-1;if(i=Math.min(i,n-1),void 0===a.chunks[t]&&(a.chunks[t]=function(t,e){if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var i=new XMLHttpRequest;if(i.open("GET",r,!1),n!==s&&i.setRequestHeader("Range","bytes="+t+"-"+e),"undefined"!=typeof Uint8Array&&(i.responseType="arraybuffer"),i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw new Error("Couldn't load "+r+". Status: "+i.status);return void 0!==i.response?new Uint8Array(i.response||[]):_t(i.responseText||"",!0)}(e,i)),void 0===a.chunks[t])throw new Error("doXHR failed!");return a.chunks[t]}),!o&&n||(s=n=1,n=this.getter(0).length,s=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!a)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new o;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var f={isDevice:!1,contents:s}}else f={isDevice:!1,url:r};var u=bt.createFile(t,e,f,n,i);f.contents?u.contents=f.contents:f.url&&(u.contents=null,u.url=f.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var h={};return Object.keys(u.stream_ops).forEach(function(t){var e=u.stream_ops[t];h[t]=function(){if(!bt.forceLoadFile(u))throw new bt.ErrnoError(29);return e.apply(null,arguments)}}),h.read=function(t,e,r,n,i){if(!bt.forceLoadFile(u))throw new bt.ErrnoError(29);var o=t.node.contents;if(i>=o.length)return 0;var s=Math.min(o.length-i,n);if(o.slice)for(var a=0;a<s;a++)e[r+a]=o[i+a];else for(a=0;a<s;a++)e[r+a]=o.get(i+a);return s},u.stream_ops=h,u},createPreloadedFile:function(t,r,n,i,o,s,a,f,u,h){Browser.init();var c=r?dt.resolve(lt.join2(t,r)):t;function l(n){function l(e){h&&h(),f||bt.createDataFile(t,r,e,i,o,u),s&&s(),rt()}var d=!1;e.preloadPlugins.forEach(function(t){d||t.canHandle(c)&&(t.handle(n,c,l,function(){a&&a(),rt()}),d=!0)}),d||l(n)}et(),"string"==typeof n?Browser.asyncLoad(n,function(t){l(t)},a):l(n)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(t,e,r){e=e||function(){},r=r||function(){};var n=bt.indexedDB();try{var i=n.open(bt.DB_NAME(),bt.DB_VERSION)}catch(t){return r(t)}i.onupgradeneeded=function(){w("creating db"),i.result.createObjectStore(bt.DB_STORE_NAME)},i.onsuccess=function(){var n=i.result.transaction([bt.DB_STORE_NAME],"readwrite"),o=n.objectStore(bt.DB_STORE_NAME),s=0,a=0,f=t.length;function u(){0==a?e():r()}t.forEach(function(t){var e=o.put(bt.analyzePath(t).object.contents,t);e.onsuccess=function(){++s+a==f&&u()},e.onerror=function(){s+ ++a==f&&u()}}),n.onerror=r},i.onerror=r},loadFilesFromDB:function(t,e,r){e=e||function(){},r=r||function(){};var n=bt.indexedDB();try{var i=n.open(bt.DB_NAME(),bt.DB_VERSION)}catch(t){return r(t)}i.onupgradeneeded=r,i.onsuccess=function(){var n=i.result;try{var o=n.transaction([bt.DB_STORE_NAME],"readonly")}catch(t){return void r(t)}var s=o.objectStore(bt.DB_STORE_NAME),a=0,f=0,u=t.length;function h(){0==f?e():r()}t.forEach(function(t){var e=s.get(t);e.onsuccess=function(){bt.analyzePath(t).exists&&bt.unlink(t),bt.createDataFile(lt.dirname(t),lt.basename(t),e.result,!0,!0,!0),++a+f==u&&h()},e.onerror=function(){a+ ++f==u&&h()}}),o.onerror=r},i.onerror=r}},gt={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(t,e){if("/"!==e[0]){var r;if(-100===t)r=bt.cwd();else{var n=bt.getStream(t);if(!n)throw new bt.ErrnoError(8);r=n.path}e=lt.join2(r,e)}return e},doStat:function(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&<.normalize(e)!==lt.normalize(bt.getPath(t.node)))return-54;throw t}return D[r>>2]=n.dev,D[r+4>>2]=0,D[r+8>>2]=n.ino,D[r+12>>2]=n.mode,D[r+16>>2]=n.nlink,D[r+20>>2]=n.uid,D[r+24>>2]=n.gid,D[r+28>>2]=n.rdev,D[r+32>>2]=0,at=[n.size>>>0,(st=n.size,+$(st)>=1?st>0?(0|G(+Y(st/4294967296),4294967295))>>>0:~~+J((st-+(~~st>>>0))/4294967296)>>>0:0)],D[r+40>>2]=at[0],D[r+44>>2]=at[1],D[r+48>>2]=4096,D[r+52>>2]=n.blocks,D[r+56>>2]=n.atime.getTime()/1e3|0,D[r+60>>2]=0,D[r+64>>2]=n.mtime.getTime()/1e3|0,D[r+68>>2]=0,D[r+72>>2]=n.ctime.getTime()/1e3|0,D[r+76>>2]=0,at=[n.ino>>>0,(st=n.ino,+$(st)>=1?st>0?(0|G(+Y(st/4294967296),4294967295))>>>0:~~+J((st-+(~~st>>>0))/4294967296)>>>0:0)],D[r+80>>2]=at[0],D[r+84>>2]=at[1],0},doMsync:function(t,e,r,n,i){var o=R.slice(t,t+r);bt.msync(e,o,i,r,n)},doMkdir:function(t,e){return"/"===(t=lt.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),bt.mkdir(t,e,0),0},doMknod:function(t,e,r){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return bt.mknod(t,e,r),0},doReadlink:function(t,e,r){if(r<=0)return-28;var n=bt.readlink(t),i=Math.min(r,z(n)),o=I[e+i];return P(n,e,r+1),I[e+i]=o,i},doAccess:function(t,e){if(-8&e)return-28;var r;if(!(r=bt.lookupPath(t,{follow:!0}).node))return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&bt.nodePermissions(r,n)?-2:0},doDup:function(t,e,r){var n=bt.getStream(r);return n&&bt.close(n),bt.open(t,e,0,r,r).fd},doReadv:function(t,e,r,n){for(var i=0,o=0;o<r;o++){var s=D[e+8*o>>2],a=D[e+(8*o+4)>>2],f=bt.read(t,I,s,a,n);if(f<0)return-1;if(i+=f,f<a)break}return i},doWritev:function(t,e,r,n){for(var i=0,o=0;o<r;o++){var s=D[e+8*o>>2],a=D[e+(8*o+4)>>2],f=bt.write(t,I,s,a,n);if(f<0)return-1;i+=f}return i},varargs:void 0,get:function(){return gt.varargs+=4,D[gt.varargs-4>>2]},getStr:function(t){return B(t)},getStreamFromFD:function(t){var e=bt.getStream(t);if(!e)throw new bt.ErrnoError(8);return e},get64:function(t,e){return t}};function vt(){return R.length}function yt(t){try{return y.grow(t-j.byteLength+65535>>16),F(y.buffer),1}catch(t){}}var wt=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=bt.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n};function _t(t,e,r){var n=r>0?r:z(t)+1,i=new Array(n),o=T(t,i,0,i.length);return e&&(i.length=o),i}Object.defineProperties(wt.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(t){t?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(t){t?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return bt.isDir(this.mode)}},isDevice:{get:function(){return bt.isChrdev(this.mode)}}}),bt.FSNode=wt,bt.staticInit(),e.FS_createFolder=bt.createFolder,e.FS_createPath=bt.createPath,e.FS_createDataFile=bt.createDataFile,e.FS_createPreloadedFile=bt.createPreloadedFile,e.FS_createLazyFile=bt.createLazyFile,e.FS_createLink=bt.createLink,e.FS_createDevice=bt.createDevice,e.FS_unlink=bt.unlink,e.FS_readFile=bt.readFile,e.FS_writeFile=bt.writeFile;var xt,Mt={c:function(t,e,r){gt.varargs=r;try{var n=gt.getStreamFromFD(t);switch(e){case 0:return(i=gt.get())<0?-28:bt.open(n.path,n.flags,0,i).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var i=gt.get();return n.flags|=i,0;case 12:return i=gt.get(),O[i+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return ct(28),-1;default:return-28}}catch(t){return void 0!==bt&&t instanceof bt.ErrnoError||nt(t),-t.errno}},j:function(t,e,r){gt.varargs=r;try{var n=gt.getStr(t),i=gt.get();return bt.open(n,e,i).fd}catch(t){return void 0!==bt&&t instanceof bt.ErrnoError||nt(t),-t.errno}},h:function(t,e,r){gt.varargs=r;try{var n=gt.getStreamFromFD(t);switch(e){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var i=gt.get();return D[i>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return i=gt.get(),bt.ioctl(n,e,i);case 21523:case 21524:return n.tty?0:-59;default:nt("bad ioctl syscall "+e)}}catch(t){return void 0!==bt&&t instanceof bt.ErrnoError||nt(t),-t.errno}},f:function(){nt()},d:function(t,e,r){R.copyWithin(t,e,e+r)},e:function(t){var e=vt();if(t>2147418112)return!1;for(var r,n,i=1;i<=4;i*=2){var o=e*(1+.2/i);if(o=Math.min(o,t+100663296),yt(Math.min(2147418112,((r=Math.max(16777216,t,o))%(n=65536)>0&&(r+=n-r%n),r))))return!0}return!1},b:function(t){try{var e=gt.getStreamFromFD(t);return bt.close(e),0}catch(t){return void 0!==bt&&t instanceof bt.ErrnoError||nt(t),t.errno}},g:function(t,e,r,n){try{var i=gt.getStreamFromFD(t),o=gt.doReadv(i,e,r);return D[n>>2]=o,0}catch(t){return void 0!==bt&&t instanceof bt.ErrnoError||nt(t),t.errno}},i:function(t,e,r,n,i){try{var o=gt.getStreamFromFD(t),s=4294967296*r+(e>>>0);return s<=-9007199254740992||s>=9007199254740992?-61:(bt.llseek(o,s,n),at=[o.position>>>0,(st=o.position,+$(st)>=1?st>0?(0|G(+Y(st/4294967296),4294967295))>>>0:~~+J((st-+(~~st>>>0))/4294967296)>>>0:0)],D[i>>2]=at[0],D[i+4>>2]=at[1],o.getdents&&0===s&&0===n&&(o.getdents=null),0)}catch(t){return void 0!==bt&&t instanceof bt.ErrnoError||nt(t),t.errno}},a:function(t,e,r,n){try{var i=gt.getStreamFromFD(t),o=gt.doWritev(i,e,r);return D[n>>2]=o,0}catch(t){return void 0!==bt&&t instanceof bt.ErrnoError||nt(t),t.errno}},memory:y,table:M},St=function(){var t={a:Mt};function r(t,r){var n=t.exports;e.asm=n,rt()}if(et(),e.instantiateWasm)try{return e.instantiateWasm(t,r)}catch(t){return _("Module.instantiateWasm callback failed with error: "+t),!1}return function(){var e,n,i;try{i=function(){try{if(v)return new Uint8Array(v);if(p)return p(ut);throw"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"}catch(t){nt(t)}}(),n=new WebAssembly.Module(i),e=new WebAssembly.Instance(n,t)}catch(t){var o=t.toString();throw _("failed to compile wasm module: "+o),(o.indexOf("imported Memory")>=0||o.indexOf("memory import")>=0)&&_("Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)."),t}r(e)}(),e.asm}(),Et=e.___wasm_call_ctors=St.k,kt=(e._create=St.l,e._train=St.m,e._predict=St.n,e._predictProba=St.o,e._save=St.p,e._load=St.q,e.___errno_location=St.r,e._malloc=St.s),At=e.stackSave=St.t,jt=e.stackAlloc=St.u,It=e.stackRestore=St.v;function Rt(t){function r(){xt||(xt=!0,e.calledRun=!0,S||(K=!0,e.noFSInit||bt.init.initialized||bt.init(),pt.init(),U(H),bt.ignorePermissions=!1,U(X),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),W.unshift(t);var t;U(W)}()))}t=t||l,Z>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),V.unshift(t);var t;U(V)}(),Z>0||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),r()},1)):r()))}if(e.dynCall_vi=St.w,e.dynCall_v=St.x,e.asm=St,e.ccall=A,e.cwrap=function(t,e,r,n){var i=(r=r||[]).every(function(t){return"number"===t});return"string"!==e&&i&&!n?k(t):function(){return A(t,e,r,arguments)}},e.getMemory=function(t){return K?kt(t):x(t)},e.addRunDependency=et,e.removeRunDependency=rt,e.FS_createFolder=bt.createFolder,e.FS_createPath=bt.createPath,e.FS_createDataFile=bt.createDataFile,e.FS_createPreloadedFile=bt.createPreloadedFile,e.FS_createLazyFile=bt.createLazyFile,e.FS_createLink=bt.createLink,e.FS_createDevice=bt.createDevice,e.FS_unlink=bt.unlink,e.then=function(t){if(xt)t(e);else{var r=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){r&&r(),t(e)}}return e},tt=function t(){xt||Rt(),xt||(tt=t)},e.run=Rt,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return Rt(),e});"object"==typeof r&&"object"==typeof e?e.exports=l:"function"==typeof define&&define.amd?define([],function(){return l}):"object"==typeof r&&(r.Module=l)}).call(this,t("_process"),t("buffer").Buffer,"/node_modules/random-forest/wasm/native.js",arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/random-forest/wasm")},{_process:164,buffer:76,crypto:84,fs:74,path:157}],175:[function(t,e,r){e.exports={type:"Buffer",data:[0,97,115,109,1,0,0,0,1,192,1,28,96,1,127,0,96,1,127,1,127,96,3,127,127,127,1,127,96,2,127,127,0,96,2,127,127,1,127,96,4,127,127,127,125,0,96,4,127,127,127,127,0,96,0,0,96,3,127,127,127,0,96,5,127,127,127,127,127,0,96,6,127,127,127,127,127,127,0,96,4,127,127,127,127,1,127,96,3,127,126,127,1,126,96,9,127,127,127,127,127,127,127,127,127,0,96,6,127,127,127,127,125,127,0,96,4,127,126,126,127,0,96,0,1,127,96,6,127,124,127,127,127,127,1,127,96,2,126,127,1,127,96,3,127,127,125,0,96,4,127,127,125,125,0,96,5,127,127,127,127,127,1,127,96,5,127,127,127,127,125,1,127,96,3,126,127,127,1,127,96,2,127,127,1,125,96,1,127,1,124,96,2,126,126,1,124,96,2,124,127,1,124,2,86,12,1,97,1,97,0,11,1,97,1,98,0,1,1,97,1,99,0,2,1,97,1,100,0,2,1,97,1,101,0,1,1,97,1,102,0,7,1,97,1,103,0,11,1,97,1,104,0,2,1,97,1,105,0,21,1,97,1,106,0,2,1,97,6,109,101,109,111,114,121,2,0,128,2,1,97,5,116,97,98,108,101,1,112,0,45,3,120,119,1,0,8,9,2,2,11,2,8,1,18,11,4,3,3,9,3,25,6,11,8,1,0,0,2,3,1,6,8,8,1,27,4,3,1,1,0,0,3,6,2,1,14,0,14,1,1,10,10,9,9,6,6,1,2,6,4,7,7,3,17,23,18,0,26,15,15,4,4,4,3,1,10,2,1,1,12,4,2,16,0,4,0,0,2,24,13,11,3,0,5,0,3,0,13,5,0,0,1,4,19,5,3,0,20,5,3,8,0,3,0,0,1,16,12,1,1,22,7,6,9,1,127,1,65,144,163,192,2,11,7,58,14,1,107,0,128,1,1,108,0,97,1,109,0,96,1,110,0,95,1,111,0,94,1,112,0,93,1,113,0,92,1,114,0,89,1,115,0,36,1,116,0,123,1,117,0,122,1,118,0,121,1,119,0,119,1,120,0,118,9,50,1,0,65,1,11,44,126,120,67,53,116,115,53,112,111,109,108,107,105,106,103,50,102,51,32,100,101,99,50,98,86,83,88,84,70,69,51,32,47,47,64,57,59,62,32,58,60,61,125,124,10,138,243,1,119,47,1,2,127,32,0,65,1,32,0,27,33,0,3,64,2,64,32,0,16,36,34,1,13,0,65,128,23,40,2,0,34,2,69,13,0,32,2,17,7,0,12,1,11,11,32,1,11,129,13,1,7,127,2,64,32,0,69,13,0,32,0,65,120,106,34,3,32,0,65,124,106,40,2,0,34,1,65,120,113,34,0,106,33,5,2,64,32,1,65,1,113,13,0,32,1,65,3,113,69,13,1,32,3,32,3,40,2,0,34,2,107,34,3,65,148,23,40,2,0,34,4,73,13,1,32,0,32,2,106,33,0,32,3,65,152,23,40,2,0,71,4,64,32,2,65,255,1,77,4,64,32,3,40,2,8,34,4,32,2,65,3,118,34,2,65,3,116,65,172,23,106,71,26,32,4,32,3,40,2,12,34,1,70,4,64,65,132,23,65,132,23,40,2,0,65,126,32,2,119,113,54,2,0,12,3,11,32,4,32,1,54,2,12,32,1,32,4,54,2,8,12,2,11,32,3,40,2,24,33,6,2,64,32,3,32,3,40,2,12,34,1,71,4,64,32,4,32,3,40,2,8,34,2,77,4,64,32,2,40,2,12,26,11,32,2,32,1,54,2,12,32,1,32,2,54,2,8,12,1,11,2,64,32,3,65,20,106,34,2,40,2,0,34,4,13,0,32,3,65,16,106,34,2,40,2,0,34,4,13,0,65,0,33,1,12,1,11,3,64,32,2,33,7,32,4,34,1,65,20,106,34,2,40,2,0,34,4,13,0,32,1,65,16,106,33,2,32,1,40,2,16,34,4,13,0,11,32,7,65,0,54,2,0,11,32,6,69,13,1,2,64,32,3,32,3,40,2,28,34,2,65,2,116,65,180,25,106,34,4,40,2,0,70,4,64,32,4,32,1,54,2,0,32,1,13,1,65,136,23,65,136,23,40,2,0,65,126,32,2,119,113,54,2,0,12,3,11,32,6,65,16,65,20,32,6,40,2,16,32,3,70,27,106,32,1,54,2,0,32,1,69,13,2,11,32,1,32,6,54,2,24,32,3,40,2,16,34,2,4,64,32,1,32,2,54,2,16,32,2,32,1,54,2,24,11,32,3,40,2,20,34,2,69,13,1,32,1,32,2,54,2,20,32,2,32,1,54,2,24,12,1,11,32,5,40,2,4,34,1,65,3,113,65,3,71,13,0,65,140,23,32,0,54,2,0,32,5,32,1,65,126,113,54,2,4,32,3,32,0,65,1,114,54,2,4,32,0,32,3,106,32,0,54,2,0,15,11,32,5,32,3,77,13,0,32,5,40,2,4,34,1,65,1,113,69,13,0,2,64,32,1,65,2,113,69,4,64,32,5,65,156,23,40,2,0,70,4,64,65,156,23,32,3,54,2,0,65,144,23,65,144,23,40,2,0,32,0,106,34,0,54,2,0,32,3,32,0,65,1,114,54,2,4,32,3,65,152,23,40,2,0,71,13,3,65,140,23,65,0,54,2,0,65,152,23,65,0,54,2,0,15,11,32,5,65,152,23,40,2,0,70,4,64,65,152,23,32,3,54,2,0,65,140,23,65,140,23,40,2,0,32,0,106,34,0,54,2,0,32,3,32,0,65,1,114,54,2,4,32,0,32,3,106,32,0,54,2,0,15,11,32,1,65,120,113,32,0,106,33,0,2,64,32,1,65,255,1,77,4,64,32,5,40,2,12,33,2,32,5,40,2,8,34,4,32,1,65,3,118,34,1,65,3,116,65,172,23,106,34,7,71,4,64,65,148,23,40,2,0,26,11,32,2,32,4,70,4,64,65,132,23,65,132,23,40,2,0,65,126,32,1,119,113,54,2,0,12,2,11,32,2,32,7,71,4,64,65,148,23,40,2,0,26,11,32,4,32,2,54,2,12,32,2,32,4,54,2,8,12,1,11,32,5,40,2,24,33,6,2,64,32,5,32,5,40,2,12,34,1,71,4,64,65,148,23,40,2,0,32,5,40,2,8,34,2,77,4,64,32,2,40,2,12,26,11,32,2,32,1,54,2,12,32,1,32,2,54,2,8,12,1,11,2,64,32,5,65,20,106,34,2,40,2,0,34,4,13,0,32,5,65,16,106,34,2,40,2,0,34,4,13,0,65,0,33,1,12,1,11,3,64,32,2,33,7,32,4,34,1,65,20,106,34,2,40,2,0,34,4,13,0,32,1,65,16,106,33,2,32,1,40,2,16,34,4,13,0,11,32,7,65,0,54,2,0,11,32,6,69,13,0,2,64,32,5,32,5,40,2,28,34,2,65,2,116,65,180,25,106,34,4,40,2,0,70,4,64,32,4,32,1,54,2,0,32,1,13,1,65,136,23,65,136,23,40,2,0,65,126,32,2,119,113,54,2,0,12,2,11,32,6,65,16,65,20,32,6,40,2,16,32,5,70,27,106,32,1,54,2,0,32,1,69,13,1,11,32,1,32,6,54,2,24,32,5,40,2,16,34,2,4,64,32,1,32,2,54,2,16,32,2,32,1,54,2,24,11,32,5,40,2,20,34,2,69,13,0,32,1,32,2,54,2,20,32,2,32,1,54,2,24,11,32,3,32,0,65,1,114,54,2,4,32,0,32,3,106,32,0,54,2,0,32,3,65,152,23,40,2,0,71,13,1,65,140,23,32,0,54,2,0,15,11,32,5,32,1,65,126,113,54,2,4,32,3,32,0,65,1,114,54,2,4,32,0,32,3,106,32,0,54,2,0,11,32,0,65,255,1,77,4,64,32,0,65,3,118,34,1,65,3,116,65,172,23,106,33,0,2,127,65,132,23,40,2,0,34,2,65,1,32,1,116,34,1,113,69,4,64,65,132,23,32,1,32,2,114,54,2,0,32,0,12,1,11,32,0,40,2,8,11,33,2,32,0,32,3,54,2,8,32,2,32,3,54,2,12,32,3,32,0,54,2,12,32,3,32,2,54,2,8,15,11,32,3,66,0,55,2,16,32,3,2,127,65,0,32,0,65,8,118,34,1,69,13,0,26,65,31,32,0,65,255,255,255,7,75,13,0,26,32,1,32,1,65,128,254,63,106,65,16,118,65,8,113,34,1,116,34,2,32,2,65,128,224,31,106,65,16,118,65,4,113,34,2,116,34,4,32,4,65,128,128,15,106,65,16,118,65,2,113,34,4,116,65,15,118,32,1,32,2,114,32,4,114,107,34,1,65,1,116,32,0,32,1,65,21,106,118,65,1,113,114,65,28,106,11,34,2,54,2,28,32,2,65,2,116,65,180,25,106,33,1,2,64,2,64,2,64,65,136,23,40,2,0,34,4,65,1,32,2,116,34,7,113,69,4,64,65,136,23,32,4,32,7,114,54,2,0,32,1,32,3,54,2,0,32,3,32,1,54,2,24,12,1,11,32,0,65,0,65,25,32,2,65,1,118,107,32,2,65,31,70,27,116,33,2,32,1,40,2,0,33,1,3,64,32,1,34,4,40,2,4,65,120,113,32,0,70,13,2,32,2,65,29,118,33,1,32,2,65,1,116,33,2,32,4,32,1,65,4,113,106,34,7,65,16,106,40,2,0,34,1,13,0,11,32,7,32,3,54,2,16,32,3,32,4,54,2,24,11,32,3,32,3,54,2,12,32,3,32,3,54,2,8,12,1,11,32,4,40,2,8,34,0,32,3,54,2,12,32,4,32,3,54,2,8,32,3,65,0,54,2,24,32,3,32,4,54,2,12,32,3,32,0,54,2,8,11,65,164,23,65,164,23,40,2,0,65,127,106,34,0,54,2,0,32,0,13,0,65,204,26,33,3,3,64,32,3,40,2,0,34,0,65,8,106,33,3,32,0,13,0,11,65,164,23,65,127,54,2,0,11,11,23,0,32,0,45,0,0,65,32,113,69,4,64,32,1,32,2,32,0,16,34,26,11,11,107,1,1,127,35,0,65,128,2,107,34,5,36,0,2,64,32,2,32,3,76,13,0,32,4,65,128,192,4,113,13,0,32,5,32,1,32,2,32,3,107,34,2,65,128,2,32,2,65,128,2,73,34,1,27,16,14,26,32,1,69,4,64,3,64,32,0,32,5,65,128,2,16,12,32,2,65,128,126,106,34,2,65,255,1,75,13,0,11,11,32,0,32,5,32,2,16,12,11,32,5,65,128,2,106,36,0,11,243,2,2,2,127,1,126,2,64,32,2,69,13,0,32,0,32,2,106,34,3,65,127,106,32,1,58,0,0,32,0,32,1,58,0,0,32,2,65,3,73,13,0,32,3,65,126,106,32,1,58,0,0,32,0,32,1,58,0,1,32,3,65,125,106,32,1,58,0,0,32,0,32,1,58,0,2,32,2,65,7,73,13,0,32,3,65,124,106,32,1,58,0,0,32,0,32,1,58,0,3,32,2,65,9,73,13,0,32,0,65,0,32,0,107,65,3,113,34,4,106,34,3,32,1,65,255,1,113,65,129,130,132,8,108,34,1,54,2,0,32,3,32,2,32,4,107,65,124,113,34,4,106,34,2,65,124,106,32,1,54,2,0,32,4,65,9,73,13,0,32,3,32,1,54,2,8,32,3,32,1,54,2,4,32,2,65,120,106,32,1,54,2,0,32,2,65,116,106,32,1,54,2,0,32,4,65,25,73,13,0,32,3,32,1,54,2,24,32,3,32,1,54,2,20,32,3,32,1,54,2,16,32,3,32,1,54,2,12,32,2,65,112,106,32,1,54,2,0,32,2,65,108,106,32,1,54,2,0,32,2,65,104,106,32,1,54,2,0,32,2,65,100,106,32,1,54,2,0,32,4,32,3,65,4,113,65,24,114,34,4,107,34,2,65,32,73,13,0,32,1,173,34,5,66,32,134,32,5,132,33,5,32,3,32,4,106,33,1,3,64,32,1,32,5,55,3,24,32,1,32,5,55,3,16,32,1,32,5,55,3,8,32,1,32,5,55,3,0,32,1,65,32,106,33,1,32,2,65,96,106,34,2,65,31,75,13,0,11,11,32,0,11,130,4,1,3,127,32,2,65,128,4,79,4,64,32,0,32,1,32,2,16,3,26,32,0,15,11,32,0,32,2,106,33,3,2,64,32,0,32,1,115,65,3,113,69,4,64,2,64,32,2,65,1,72,4,64,32,0,33,2,12,1,11,32,0,65,3,113,69,4,64,32,0,33,2,12,1,11,32,0,33,2,3,64,32,2,32,1,45,0,0,58,0,0,32,1,65,1,106,33,1,32,2,65,1,106,34,2,32,3,79,13,1,32,2,65,3,113,13,0,11,11,2,64,32,3,65,124,113,34,4,65,192,0,73,13,0,32,2,32,4,65,64,106,34,5,75,13,0,3,64,32,2,32,1,40,2,0,54,2,0,32,2,32,1,40,2,4,54,2,4,32,2,32,1,40,2,8,54,2,8,32,2,32,1,40,2,12,54,2,12,32,2,32,1,40,2,16,54,2,16,32,2,32,1,40,2,20,54,2,20,32,2,32,1,40,2,24,54,2,24,32,2,32,1,40,2,28,54,2,28,32,2,32,1,40,2,32,54,2,32,32,2,32,1,40,2,36,54,2,36,32,2,32,1,40,2,40,54,2,40,32,2,32,1,40,2,44,54,2,44,32,2,32,1,40,2,48,54,2,48,32,2,32,1,40,2,52,54,2,52,32,2,32,1,40,2,56,54,2,56,32,2,32,1,40,2,60,54,2,60,32,1,65,64,107,33,1,32,2,65,64,107,34,2,32,5,77,13,0,11,11,32,2,32,4,79,13,1,3,64,32,2,32,1,40,2,0,54,2,0,32,1,65,4,106,33,1,32,2,65,4,106,34,2,32,4,73,13,0,11,12,1,11,32,3,65,4,73,4,64,32,0,33,2,12,1,11,32,3,65,124,106,34,4,32,0,73,4,64,32,0,33,2,12,1,11,32,0,33,2,3,64,32,2,32,1,45,0,0,58,0,0,32,2,32,1,45,0,1,58,0,1,32,2,32,1,45,0,2,58,0,2,32,2,32,1,45,0,3,58,0,3,32,1,65,4,106,33,1,32,2,65,4,106,34,2,32,4,77,13,0,11,11,32,2,32,3,73,4,64,3,64,32,2,32,1,45,0,0,58,0,0,32,1,65,1,106,33,1,32,2,65,1,106,34,2,32,3,71,13,0,11,11,32,0,11,64,1,1,127,32,1,32,2,108,33,4,32,4,2,127,32,3,40,2,76,65,127,76,4,64,32,0,32,4,32,3,16,34,12,1,11,32,0,32,4,32,3,16,34,11,34,0,70,4,64,32,2,65,0,32,1,27,15,11,32,0,32,1,110,11,44,0,32,2,69,4,64,32,0,40,2,4,32,1,40,2,4,70,15,11,32,0,32,1,70,4,64,65,1,15,11,32,0,40,2,4,32,1,40,2,4,16,66,69,11,178,1,1,2,127,32,2,40,2,76,65,0,78,4,127,65,1,5,65,0,11,26,32,2,32,2,45,0,74,34,3,65,127,106,32,3,114,58,0,74,2,127,32,1,32,2,40,2,8,32,2,40,2,4,34,4,107,34,3,65,1,72,13,0,26,32,0,32,4,32,3,32,1,32,3,32,1,73,27,34,3,16,15,26,32,2,32,2,40,2,4,32,3,106,54,2,4,32,0,32,3,106,33,0,32,1,32,3,107,11,34,3,4,64,3,64,2,64,32,2,16,85,69,4,64,32,2,32,0,32,3,32,2,40,2,32,17,2,0,34,4,65,1,106,65,1,75,13,1,11,32,1,32,3,107,32,1,110,26,15,11,32,0,32,4,106,33,0,32,3,32,4,107,34,3,13,0,11,11,11,65,1,2,127,63,0,33,1,2,64,65,144,35,40,2,0,34,2,32,0,65,3,106,65,124,113,106,34,0,32,1,65,16,116,77,13,0,32,0,16,4,13,0,65,168,22,65,48,54,2,0,65,127,15,11,65,144,35,32,0,54,2,0,32,2,11,131,1,2,3,127,1,126,2,64,32,0,66,128,128,128,128,16,84,4,64,32,0,33,5,12,1,11,3,64,32,1,65,127,106,34,1,32,0,32,0,66,10,128,34,5,66,10,126,125,167,65,48,114,58,0,0,32,0,66,255,255,255,255,159,1,86,33,2,32,5,33,0,32,2,13,0,11,11,32,5,167,34,2,4,64,3,64,32,1,65,127,106,34,1,32,2,32,2,65,10,110,34,3,65,10,108,107,65,48,114,58,0,0,32,2,65,9,75,33,4,32,3,33,2,32,4,13,0,11,11,32,1,11,134,1,1,1,127,32,0,32,1,40,2,0,54,2,0,32,0,32,1,40,2,4,54,2,4,32,0,32,1,40,2,16,54,2,16,32,1,40,2,24,33,4,32,0,32,3,32,2,107,65,1,106,34,3,54,2,28,32,0,32,4,54,2,24,32,0,32,1,40,2,20,54,2,20,32,0,32,1,40,2,32,54,2,32,32,0,65,127,32,3,65,2,116,34,4,32,3,65,255,255,255,255,3,113,32,3,71,27,16,10,34,3,54,2,8,32,3,32,1,40,2,8,32,2,65,2,116,106,32,4,16,15,26,32,0,11,25,0,32,0,32,1,16,91,34,0,65,0,32,0,45,0,0,32,1,65,255,1,113,70,27,11,212,1,1,7,127,32,0,40,2,4,34,3,40,2,8,33,5,32,3,40,2,0,33,6,65,127,32,3,40,2,28,34,2,65,3,116,32,2,65,255,255,255,255,1,113,32,2,71,27,16,10,33,4,65,0,33,2,32,3,40,2,28,34,3,65,0,74,4,64,32,1,65,2,116,33,1,3,64,32,4,32,2,65,3,116,106,34,7,32,5,32,2,65,2,116,106,34,8,40,2,0,54,2,4,32,7,32,6,32,8,40,2,0,65,2,116,106,40,2,0,32,1,106,40,2,0,54,2,0,32,2,65,1,106,34,2,32,3,71,13,0,11,11,32,4,32,3,16,80,65,0,33,2,32,0,40,2,4,34,0,40,2,28,65,0,74,4,64,3,64,32,5,32,2,65,2,116,106,32,4,32,2,65,3,116,106,40,2,4,54,2,0,32,2,65,1,106,34,2,32,0,40,2,28,72,13,0,11,11,32,4,16,11,11,86,1,2,127,32,0,2,127,32,1,65,31,77,4,64,32,0,40,2,4,33,2,32,0,40,2,0,12,1,11,32,0,32,0,40,2,0,34,2,54,2,4,32,0,65,0,54,2,0,32,1,65,96,106,33,1,65,0,11,34,3,32,1,116,54,2,0,32,0,32,2,32,1,116,32,3,65,32,32,1,107,118,114,54,2,4,11,238,2,1,4,127,35,0,65,240,1,107,34,5,36,0,32,5,32,1,40,2,0,34,6,54,2,232,1,32,1,40,2,4,33,1,32,5,32,0,54,2,0,32,5,32,1,54,2,236,1,65,1,33,7,2,64,2,64,2,64,2,64,65,0,32,6,65,1,70,32,1,27,13,0,32,0,32,4,32,2,65,2,116,106,40,2,0,107,34,6,32,0,65,10,17,4,0,65,1,72,13,0,32,3,69,33,8,3,64,2,64,32,6,33,1,2,64,32,8,69,13,0,32,2,65,2,72,13,0,32,2,65,2,116,32,4,106,65,120,106,40,2,0,33,3,32,0,65,120,106,34,6,32,1,65,10,17,4,0,65,127,74,13,1,32,6,32,3,107,32,1,65,10,17,4,0,65,127,74,13,1,11,32,5,32,7,65,2,116,106,32,1,54,2,0,32,5,65,232,1,106,2,127,32,5,40,2,232,1,65,127,106,104,34,0,69,4,64,32,5,40,2,236,1,104,34,0,65,32,106,65,0,32,0,27,12,1,11,32,0,11,34,0,16,26,32,7,65,1,106,33,7,32,0,32,2,106,33,2,32,5,40,2,232,1,65,1,70,4,64,32,5,40,2,236,1,69,13,5,11,65,0,33,3,65,1,33,8,32,1,33,0,32,1,32,4,32,2,65,2,116,106,40,2,0,107,34,6,32,5,40,2,0,65,10,17,4,0,65,0,74,13,1,12,3,11,11,32,0,33,1,12,2,11,32,0,33,1,11,32,3,13,1,11,32,5,32,7,16,43,32,1,32,2,32,4,16,30,11,32,5,65,240,1,106,36,0,11,88,1,2,127,32,0,2,127,32,1,65,31,77,4,64,32,0,40,2,0,33,2,32,0,40,2,4,12,1,11,32,0,40,2,4,33,2,32,0,65,0,54,2,4,32,0,32,2,54,2,0,32,1,65,96,106,33,1,65,0,11,34,3,32,1,118,54,2,4,32,0,32,3,65,32,32,1,107,116,32,2,32,1,118,114,54,2,0,11,169,1,1,1,124,68,0,0,0,0,0,0,240,63,33,1,2,64,32,0,65,128,8,78,4,64,68,0,0,0,0,0,0,224,127,33,1,32,0,65,255,15,72,4,64,32,0,65,129,120,106,33,0,12,2,11,68,0,0,0,0,0,0,240,127,33,1,32,0,65,253,23,32,0,65,253,23,72,27,65,130,112,106,33,0,12,1,11,32,0,65,129,120,74,13,0,68,0,0,0,0,0,0,16,0,33,1,32,0,65,131,112,74,4,64,32,0,65,254,7,106,33,0,12,1,11,68,0,0,0,0,0,0,0,0,33,1,32,0,65,134,104,32,0,65,134,104,74,27,65,252,15,106,33,0,11,32,1,32,0,65,255,7,106,173,66,52,134,191,162,11,183,1,2,3,127,1,126,32,0,32,3,54,2,32,32,0,32,2,54,2,20,32,0,32,1,54,2,12,32,3,65,1,78,4,64,32,2,32,3,107,33,4,3,64,65,0,33,5,32,4,4,64,65,160,22,65,160,22,41,3,0,66,173,254,213,228,212,133,253,168,216,0,126,66,1,124,34,7,55,3,0,32,7,66,33,136,167,32,4,111,33,5,32,0,40,2,12,33,1,11,65,0,33,3,2,64,32,6,69,13,0,3,64,32,5,32,1,32,3,65,2,116,106,40,2,0,71,4,64,32,6,32,3,65,1,106,34,3,71,13,1,12,2,11,11,32,4,33,5,11,32,1,32,6,65,2,116,106,32,5,54,2,0,32,6,65,1,106,33,6,32,4,65,1,106,34,4,32,2,72,13,0,11,11,11,181,17,2,16,127,1,126,35,0,65,208,0,107,34,5,36,0,32,5,65,165,14,54,2,76,32,5,65,55,106,33,19,32,5,65,56,106,33,16,2,64,2,64,3,64,2,64,32,13,65,0,72,13,0,32,4,65,255,255,255,255,7,32,13,107,74,4,64,65,168,22,65,61,54,2,0,65,127,33,13,12,1,11,32,4,32,13,106,33,13,11,32,5,40,2,76,34,9,33,4,2,64,2,64,2,64,2,127,2,64,2,64,2,64,2,64,2,64,2,64,2,64,2,64,2,64,32,9,45,0,0,34,6,4,64,3,64,2,64,2,64,2,64,32,6,65,255,1,113,34,7,69,4,64,32,4,33,6,12,1,11,32,7,65,37,71,13,1,32,4,33,6,3,64,32,4,45,0,1,65,37,71,13,1,32,5,32,4,65,2,106,34,7,54,2,76,32,6,65,1,106,33,6,32,4,45,0,2,33,10,32,7,33,4,32,10,65,37,70,13,0,11,11,32,6,32,9,107,33,4,32,0,4,64,32,0,32,9,32,4,16,12,11,32,4,13,17,65,127,33,15,65,1,33,6,32,5,40,2,76,33,4,2,64,32,5,40,2,76,44,0,1,65,80,106,65,10,79,13,0,32,4,45,0,2,65,36,71,13,0,32,4,44,0,1,65,80,106,33,15,65,1,33,17,65,3,33,6,11,32,5,32,4,32,6,106,34,4,54,2,76,65,0,33,6,2,64,32,4,44,0,0,34,14,65,96,106,34,10,65,31,75,4,64,32,4,33,7,12,1,11,32,4,33,7,65,1,32,10,116,34,10,65,137,209,4,113,69,13,0,3,64,32,5,32,4,65,1,106,34,7,54,2,76,32,6,32,10,114,33,6,32,4,44,0,1,34,14,65,96,106,34,10,65,31,75,13,1,32,7,33,4,65,1,32,10,116,34,10,65,137,209,4,113,13,0,11,11,2,64,32,14,65,42,70,4,64,32,5,2,127,2,64,32,7,44,0,1,65,80,106,65,10,79,13,0,32,5,40,2,76,34,4,45,0,2,65,36,71,13,0,32,4,44,0,1,65,2,116,32,3,106,65,192,126,106,65,10,54,2,0,32,4,44,0,1,65,3,116,32,2,106,65,128,125,106,40,2,0,33,11,65,1,33,17,32,4,65,3,106,12,1,11,32,17,13,21,65,0,33,17,65,0,33,11,32,0,4,64,32,1,32,1,40,2,0,34,4,65,4,106,54,2,0,32,4,40,2,0,33,11,11,32,5,40,2,76,65,1,106,11,34,4,54,2,76,32,11,65,127,74,13,1,65,0,32,11,107,33,11,32,6,65,128,192,0,114,33,6,12,1,11,32,5,65,204,0,106,16,40,34,11,65,0,72,13,19,32,5,40,2,76,33,4,11,65,127,33,8,2,64,32,4,45,0,0,65,46,71,13,0,32,4,45,0,1,65,42,70,4,64,2,64,32,4,44,0,2,65,80,106,65,10,79,13,0,32,5,40,2,76,34,4,45,0,3,65,36,71,13,0,32,4,44,0,2,65,2,116,32,3,106,65,192,126,106,65,10,54,2,0,32,4,44,0,2,65,3,116,32,2,106,65,128,125,106,40,2,0,33,8,32,5,32,4,65,4,106,34,4,54,2,76,12,2,11,32,17,13,20,32,0,4,127,32,1,32,1,40,2,0,34,4,65,4,106,54,2,0,32,4,40,2,0,5,65,0,11,33,8,32,5,32,5,40,2,76,65,2,106,34,4,54,2,76,12,1,11,32,5,32,4,65,1,106,54,2,76,32,5,65,204,0,106,16,40,33,8,32,5,40,2,76,33,4,11,65,0,33,7,3,64,32,7,33,18,65,127,33,12,32,4,44,0,0,65,191,127,106,65,57,75,13,20,32,5,32,4,65,1,106,34,14,54,2,76,32,4,44,0,0,33,7,32,14,33,4,32,7,32,18,65,58,108,106,65,223,9,106,45,0,0,34,7,65,127,106,65,8,73,13,0,11,32,7,69,13,19,2,64,2,64,2,64,32,7,65,19,70,4,64,32,15,65,127,76,13,1,12,23,11,32,15,65,0,72,13,1,32,3,32,15,65,2,116,106,32,7,54,2,0,32,5,32,2,32,15,65,3,116,106,41,3,0,55,3,64,11,65,0,33,4,32,0,69,13,19,12,1,11,32,0,69,13,17,32,5,65,64,107,32,7,32,1,16,39,32,5,40,2,76,33,14,11,32,6,65,255,255,123,113,34,10,32,6,32,6,65,128,192,0,113,27,33,6,65,0,33,12,65,132,10,33,15,32,16,33,7,32,14,65,127,106,44,0,0,34,4,65,95,113,32,4,32,4,65,15,113,65,3,70,27,32,4,32,18,27,34,4,65,168,127,106,34,14,65,32,77,13,1,2,64,2,127,2,64,2,64,32,4,65,191,127,106,34,10,65,6,75,4,64,32,4,65,211,0,71,13,20,32,8,69,13,1,32,5,40,2,64,12,3,11,32,10,65,1,107,14,3,19,1,19,8,11,65,0,33,4,32,0,65,32,32,11,65,0,32,6,16,13,12,2,11,32,5,65,0,54,2,12,32,5,32,5,41,3,64,62,2,8,32,5,32,5,65,8,106,54,2,64,65,127,33,8,32,5,65,8,106,11,33,7,65,0,33,4,2,64,3,64,32,7,40,2,0,34,9,69,13,1,2,64,32,5,65,4,106,32,9,16,42,34,9,65,0,72,34,10,13,0,32,9,32,8,32,4,107,75,13,0,32,7,65,4,106,33,7,32,8,32,4,32,9,106,34,4,75,13,1,12,2,11,11,65,127,33,12,32,10,13,21,11,32,0,65,32,32,11,32,4,32,6,16,13,32,4,69,4,64,65,0,33,4,12,1,11,65,0,33,10,32,5,40,2,64,33,7,3,64,32,7,40,2,0,34,9,69,13,1,32,5,65,4,106,32,9,16,42,34,9,32,10,106,34,10,32,4,74,13,1,32,0,32,5,65,4,106,32,9,16,12,32,7,65,4,106,33,7,32,10,32,4,73,13,0,11,11,32,0,65,32,32,11,32,4,32,6,65,128,192,0,115,16,13,32,11,32,4,32,11,32,4,74,27,33,4,12,17,11,32,5,32,4,65,1,106,34,7,54,2,76,32,4,45,0,1,33,6,32,7,33,4,12,1,11,11,32,14,65,1,107,14,31,12,12,12,12,12,12,12,12,1,12,3,4,1,1,1,12,4,12,12,12,12,8,5,6,12,12,2,12,9,12,12,7,11,32,13,33,12,32,0,13,15,32,17,69,13,12,65,1,33,4,3,64,32,3,32,4,65,2,116,106,40,2,0,34,0,4,64,32,2,32,4,65,3,116,106,32,0,32,1,16,39,65,1,33,12,32,4,65,1,106,34,4,65,10,71,13,1,12,17,11,11,65,1,33,12,32,4,65,9,75,13,15,3,64,32,4,34,0,65,1,106,34,4,65,10,71,4,64,32,3,32,4,65,2,116,106,40,2,0,69,13,1,11,11,65,127,65,1,32,0,65,9,73,27,33,12,12,15,11,32,0,32,5,43,3,64,32,11,32,8,32,6,32,4,65,29,17,17,0,33,4,12,12,11,32,5,40,2,64,34,4,65,142,10,32,4,27,34,9,32,8,16,77,34,4,32,8,32,9,106,32,4,27,33,7,32,10,33,6,32,4,32,9,107,32,8,32,4,27,33,8,12,9,11,32,5,32,5,41,3,64,60,0,55,65,1,33,8,32,19,33,9,32,10,33,6,12,8,11,32,5,41,3,64,34,20,66,127,87,4,64,32,5,66,0,32,20,125,34,20,55,3,64,65,1,33,12,65,132,10,12,6,11,32,6,65,128,16,113,4,64,65,1,33,12,65,133,10,12,6,11,65,134,10,65,132,10,32,6,65,1,113,34,12,27,12,5,11,32,5,41,3,64,32,16,16,72,33,9,32,6,65,8,113,69,13,5,32,8,32,16,32,9,107,34,4,65,1,106,32,8,32,4,74,27,33,8,12,5,11,32,8,65,8,32,8,65,8,75,27,33,8,32,6,65,8,114,33,6,65,248,0,33,4,11,32,5,41,3,64,32,16,32,4,65,32,113,16,71,33,9,32,6,65,8,113,69,13,3,32,5,41,3,64,80,13,3,32,4,65,4,118,65,132,10,106,33,15,65,2,33,12,12,3,11,65,0,33,4,32,18,65,255,1,113,34,7,65,7,75,13,5,2,64,2,64,2,64,2,64,2,64,2,64,2,64,32,7,65,1,107,14,7,1,2,3,4,12,5,6,0,11,32,5,40,2,64,32,13,54,2,0,12,11,11,32,5,40,2,64,32,13,54,2,0,12,10,11,32,5,40,2,64,32,13,172,55,3,0,12,9,11,32,5,40,2,64,32,13,59,1,0,12,8,11,32,5,40,2,64,32,13,58,0,0,12,7,11,32,5,40,2,64,32,13,54,2,0,12,6,11,32,5,40,2,64,32,13,172,55,3,0,12,5,11,32,5,41,3,64,33,20,65,132,10,11,33,15,32,20,32,16,16,20,33,9,11,32,6,65,255,255,123,113,32,6,32,8,65,127,74,27,33,6,32,5,41,3,64,33,20,2,127,2,64,32,8,13,0,32,20,80,69,13,0,32,16,33,9,65,0,12,1,11,32,8,32,20,80,32,16,32,9,107,106,34,4,32,8,32,4,74,27,11,33,8,11,32,0,65,32,32,12,32,7,32,9,107,34,10,32,8,32,8,32,10,72,27,34,14,106,34,7,32,11,32,11,32,7,72,27,34,4,32,7,32,6,16,13,32,0,32,15,32,12,16,12,32,0,65,48,32,4,32,7,32,6,65,128,128,4,115,16,13,32,0,65,48,32,14,32,10,65,0,16,13,32,0,32,9,32,10,16,12,32,0,65,32,32,4,32,7,32,6,65,128,192,0,115,16,13,12,1,11,11,65,0,33,12,12,1,11,65,127,33,12,11,32,5,65,208,0,106,36,0,32,12,11,193,1,1,5,127,35,0,65,240,1,107,34,3,36,0,32,3,32,0,54,2,0,65,1,33,5,2,64,32,1,65,2,72,13,0,32,0,33,4,3,64,32,0,32,4,65,120,106,34,6,32,2,32,1,65,126,106,34,7,65,2,116,106,40,2,0,107,34,4,65,10,17,4,0,65,0,78,4,64,32,0,32,6,65,10,17,4,0,65,127,74,13,2,11,32,3,32,5,65,2,116,106,33,0,2,64,32,4,32,6,65,10,17,4,0,65,0,78,4,64,32,0,32,4,54,2,0,32,1,65,127,106,33,7,12,1,11,32,0,32,6,54,2,0,32,6,33,4,11,32,5,65,1,106,33,5,32,7,65,2,72,13,1,32,3,40,2,0,33,0,32,7,33,1,12,0,0,11,0,11,32,3,32,5,16,43,32,3,65,240,1,106,36,0,11,105,1,2,127,2,64,32,0,40,2,20,32,0,40,2,28,77,13,0,32,0,65,0,65,0,32,0,40,2,36,17,2,0,26,32,0,40,2,20,13,0,65,127,15,11,32,0,40,2,4,34,1,32,0,40,2,8,34,2,73,4,64,32,0,32,1,32,2,107,172,65,1,32,0,40,2,40,17,12,0,26,11,32,0,65,0,54,2,28,32,0,66,0,55,3,16,32,0,66,0,55,2,4,65,0,11,6,0,32,0,16,11,11,110,1,2,127,65,188,16,40,2,0,34,1,40,2,76,65,0,78,4,127,65,1,5,65,0,11,26,2,64,65,127,65,0,32,0,65,1,32,0,16,55,34,0,32,1,16,16,32,0,71,27,65,0,72,13,0,2,64,32,1,45,0,75,65,10,70,13,0,32,1,40,2,20,34,0,32,1,40,2,16,79,13,0,32,1,32,0,65,1,106,54,2,20,32,0,65,10,58,0,0,12,1,11,32,1,65,10,16,35,11,11,182,1,1,4,127,2,64,32,2,40,2,16,34,3,4,127,32,3,5,32,2,16,56,13,1,32,2,40,2,16,11,32,2,40,2,20,34,5,107,32,1,73,4,64,32,2,32,0,32,1,32,2,40,2,36,17,2,0,15,11,2,64,32,2,44,0,75,65,0,72,13,0,32,1,33,4,3,64,32,4,34,3,69,13,1,32,0,32,3,65,127,106,34,4,106,45,0,0,65,10,71,13,0,11,32,2,32,0,32,3,32,2,40,2,36,17,2,0,34,4,32,3,73,13,1,32,1,32,3,107,33,1,32,0,32,3,106,33,0,32,2,40,2,20,33,5,32,3,33,6,11,32,5,32,0,32,1,16,15,26,32,2,32,2,40,2,20,32,1,106,54,2,20,32,1,32,6,106,33,4,11,32,4,11,130,1,1,3,127,35,0,65,16,107,34,2,36,0,32,2,32,1,58,0,15,2,64,32,0,40,2,16,34,3,69,4,64,32,0,16,56,13,1,32,0,40,2,16,33,3,11,2,64,32,0,40,2,20,34,4,32,3,79,13,0,32,0,44,0,75,32,1,65,255,1,113,70,13,0,32,0,32,4,65,1,106,54,2,20,32,4,32,1,58,0,0,12,1,11,32,0,32,2,65,15,106,65,1,32,0,40,2,36,17,2,0,65,1,71,13,0,32,2,45,0,15,26,11,32,2,65,16,106,36,0,11,198,45,1,11,127,35,0,65,16,107,34,11,36,0,2,64,2,64,2,64,2,64,2,64,2,64,2,64,2,64,2,64,2,64,2,64,32,0,65,244,1,77,4,64,65,132,23,40,2,0,34,6,65,16,32,0,65,11,106,65,120,113,32,0,65,11,73,27,34,5,65,3,118,34,0,118,34,1,65,3,113,4,64,32,1,65,127,115,65,1,113,32,0,106,34,2,65,3,116,34,4,65,180,23,106,40,2,0,34,1,65,8,106,33,0,2,64,32,1,40,2,8,34,3,32,4,65,172,23,106,34,4,70,4,64,65,132,23,32,6,65,126,32,2,119,113,54,2,0,12,1,11,65,148,23,40,2,0,26,32,3,32,4,54,2,12,32,4,32,3,54,2,8,11,32,1,32,2,65,3,116,34,2,65,3,114,54,2,4,32,1,32,2,106,34,1,32,1,40,2,4,65,1,114,54,2,4,12,12,11,32,5,65,140,23,40,2,0,34,8,77,13,1,32,1,4,64,2,64,65,2,32,0,116,34,2,65,0,32,2,107,114,32,1,32,0,116,113,34,0,65,0,32,0,107,113,65,127,106,34,0,32,0,65,12,118,65,16,113,34,0,118,34,1,65,5,118,65,8,113,34,2,32,0,114,32,1,32,2,118,34,0,65,2,118,65,4,113,34,1,114,32,0,32,1,118,34,0,65,1,118,65,2,113,34,1,114,32,0,32,1,118,34,0,65,1,118,65,1,113,34,1,114,32,0,32,1,118,106,34,2,65,3,116,34,3,65,180,23,106,40,2,0,34,1,40,2,8,34,0,32,3,65,172,23,106,34,3,70,4,64,65,132,23,32,6,65,126,32,2,119,113,34,6,54,2,0,12,1,11,65,148,23,40,2,0,26,32,0,32,3,54,2,12,32,3,32,0,54,2,8,11,32,1,65,8,106,33,0,32,1,32,5,65,3,114,54,2,4,32,1,32,5,106,34,7,32,2,65,3,116,34,2,32,5,107,34,3,65,1,114,54,2,4,32,1,32,2,106,32,3,54,2,0,32,8,4,64,32,8,65,3,118,34,4,65,3,116,65,172,23,106,33,1,65,152,23,40,2,0,33,2,2,127,32,6,65,1,32,4,116,34,4,113,69,4,64,65,132,23,32,4,32,6,114,54,2,0,32,1,12,1,11,32,1,40,2,8,11,33,4,32,1,32,2,54,2,8,32,4,32,2,54,2,12,32,2,32,1,54,2,12,32,2,32,4,54,2,8,11,65,152,23,32,7,54,2,0,65,140,23,32,3,54,2,0,12,12,11,65,136,23,40,2,0,34,10,69,13,1,32,10,65,0,32,10,107,113,65,127,106,34,0,32,0,65,12,118,65,16,113,34,0,118,34,1,65,5,118,65,8,113,34,2,32,0,114,32,1,32,2,118,34,0,65,2,118,65,4,113,34,1,114,32,0,32,1,118,34,0,65,1,118,65,2,113,34,1,114,32,0,32,1,118,34,0,65,1,118,65,1,113,34,1,114,32,0,32,1,118,106,65,2,116,65,180,25,106,40,2,0,34,1,40,2,4,65,120,113,32,5,107,33,3,32,1,33,2,3,64,2,64,32,2,40,2,16,34,0,69,4,64,32,2,40,2,20,34,0,69,13,1,11,32,0,40,2,4,65,120,113,32,5,107,34,2,32,3,32,2,32,3,73,34,2,27,33,3,32,0,32,1,32,2,27,33,1,32,0,33,2,12,1,11,11,32,1,40,2,24,33,9,32,1,32,1,40,2,12,34,4,71,4,64,65,148,23,40,2,0,32,1,40,2,8,34,0,77,4,64,32,0,40,2,12,26,11,32,0,32,4,54,2,12,32,4,32,0,54,2,8,12,11,11,32,1,65,20,106,34,2,40,2,0,34,0,69,4,64,32,1,40,2,16,34,0,69,13,3,32,1,65,16,106,33,2,11,3,64,32,2,33,7,32,0,34,4,65,20,106,34,2,40,2,0,34,0,13,0,32,4,65,16,106,33,2,32,4,40,2,16,34,0,13,0,11,32,7,65,0,54,2,0,12,10,11,65,127,33,5,32,0,65,191,127,75,13,0,32,0,65,11,106,34,0,65,120,113,33,5,65,136,23,40,2,0,34,7,69,13,0,65,0,32,5,107,33,2,2,64,2,64,2,64,2,127,65,0,32,0,65,8,118,34,0,69,13,0,26,65,31,32,5,65,255,255,255,7,75,13,0,26,32,0,32,0,65,128,254,63,106,65,16,118,65,8,113,34,0,116,34,1,32,1,65,128,224,31,106,65,16,118,65,4,113,34,1,116,34,3,32,3,65,128,128,15,106,65,16,118,65,2,113,34,3,116,65,15,118,32,0,32,1,114,32,3,114,107,34,0,65,1,116,32,5,32,0,65,21,106,118,65,1,113,114,65,28,106,11,34,8,65,2,116,65,180,25,106,40,2,0,34,3,69,4,64,65,0,33,0,12,1,11,32,5,65,0,65,25,32,8,65,1,118,107,32,8,65,31,70,27,116,33,1,65,0,33,0,3,64,2,64,32,3,40,2,4,65,120,113,32,5,107,34,6,32,2,79,13,0,32,3,33,4,32,6,34,2,13,0,65,0,33,2,32,3,33,0,12,3,11,32,0,32,3,40,2,20,34,6,32,6,32,3,32,1,65,29,118,65,4,113,106,40,2,16,34,3,70,27,32,0,32,6,27,33,0,32,1,32,3,65,0,71,116,33,1,32,3,13,0,11,11,32,0,32,4,114,69,4,64,65,2,32,8,116,34,0,65,0,32,0,107,114,32,7,113,34,0,69,13,3,32,0,65,0,32,0,107,113,65,127,106,34,0,32,0,65,12,118,65,16,113,34,0,118,34,1,65,5,118,65,8,113,34,3,32,0,114,32,1,32,3,118,34,0,65,2,118,65,4,113,34,1,114,32,0,32,1,118,34,0,65,1,118,65,2,113,34,1,114,32,0,32,1,118,34,0,65,1,118,65,1,113,34,1,114,32,0,32,1,118,106,65,2,116,65,180,25,106,40,2,0,33,0,11,32,0,69,13,1,11,3,64,32,0,40,2,4,65,120,113,32,5,107,34,3,32,2,73,33,1,32,3,32,2,32,1,27,33,2,32,0,32,4,32,1,27,33,4,32,0,40,2,16,34,1,4,127,32,1,5,32,0,40,2,20,11,34,0,13,0,11,11,32,4,69,13,0,32,2,65,140,23,40,2,0,32,5,107,79,13,0,32,4,40,2,24,33,8,32,4,32,4,40,2,12,34,1,71,4,64,65,148,23,40,2,0,32,4,40,2,8,34,0,77,4,64,32,0,40,2,12,26,11,32,0,32,1,54,2,12,32,1,32,0,54,2,8,12,9,11,32,4,65,20,106,34,3,40,2,0,34,0,69,4,64,32,4,40,2,16,34,0,69,13,3,32,4,65,16,106,33,3,11,3,64,32,3,33,6,32,0,34,1,65,20,106,34,3,40,2,0,34,0,13,0,32,1,65,16,106,33,3,32,1,40,2,16,34,0,13,0,11,32,6,65,0,54,2,0,12,8,11,65,140,23,40,2,0,34,1,32,5,79,4,64,65,152,23,40,2,0,33,0,2,64,32,1,32,5,107,34,2,65,16,79,4,64,65,140,23,32,2,54,2,0,65,152,23,32,0,32,5,106,34,3,54,2,0,32,3,32,2,65,1,114,54,2,4,32,0,32,1,106,32,2,54,2,0,32,0,32,5,65,3,114,54,2,4,12,1,11,65,152,23,65,0,54,2,0,65,140,23,65,0,54,2,0,32,0,32,1,65,3,114,54,2,4,32,0,32,1,106,34,1,32,1,40,2,4,65,1,114,54,2,4,11,32,0,65,8,106,33,0,12,10,11,65,144,23,40,2,0,34,1,32,5,75,4,64,65,144,23,32,1,32,5,107,34,1,54,2,0,65,156,23,65,156,23,40,2,0,34,0,32,5,106,34,2,54,2,0,32,2,32,1,65,1,114,54,2,4,32,0,32,5,65,3,114,54,2,4,32,0,65,8,106,33,0,12,10,11,65,0,33,0,32,5,65,47,106,34,4,2,127,65,220,26,40,2,0,4,64,65,228,26,40,2,0,12,1,11,65,232,26,66,127,55,2,0,65,224,26,66,128,160,128,128,128,128,4,55,2,0,65,220,26,32,11,65,12,106,65,112,113,65,216,170,213,170,5,115,54,2,0,65,240,26,65,0,54,2,0,65,192,26,65,0,54,2,0,65,128,32,11,34,2,106,34,6,65,0,32,2,107,34,7,113,34,2,32,5,77,13,9,65,188,26,40,2,0,34,3,4,64,65,180,26,40,2,0,34,8,32,2,106,34,9,32,8,77,13,10,32,9,32,3,75,13,10,11,65,192,26,45,0,0,65,4,113,13,4,2,64,2,64,65,156,23,40,2,0,34,3,4,64,65,196,26,33,0,3,64,32,0,40,2,0,34,8,32,3,77,4,64,32,8,32,0,40,2,4,106,32,3,75,13,3,11,32,0,40,2,8,34,0,13,0,11,11,65,0,16,19,34,1,65,127,70,13,5,32,2,33,6,65,224,26,40,2,0,34,0,65,127,106,34,3,32,1,113,4,64,32,2,32,1,107,32,1,32,3,106,65,0,32,0,107,113,106,33,6,11,32,6,32,5,77,13,5,32,6,65,254,255,255,255,7,75,13,5,65,188,26,40,2,0,34,0,4,64,65,180,26,40,2,0,34,3,32,6,106,34,7,32,3,77,13,6,32,7,32,0,75,13,6,11,32,6,16,19,34,0,32,1,71,13,1,12,7,11,32,6,32,1,107,32,7,113,34,6,65,254,255,255,255,7,75,13,4,32,6,16,19,34,1,32,0,40,2,0,32,0,40,2,4,106,70,13,3,32,1,33,0,11,2,64,32,5,65,48,106,32,6,77,13,0,32,0,65,127,70,13,0,65,228,26,40,2,0,34,1,32,4,32,6,107,106,65,0,32,1,107,113,34,1,65,254,255,255,255,7,75,4,64,32,0,33,1,12,7,11,32,1,16,19,65,127,71,4,64,32,1,32,6,106,33,6,32,0,33,1,12,7,11,65,0,32,6,107,16,19,26,12,4,11,32,0,34,1,65,127,71,13,5,12,3,11,65,0,33,4,12,7,11,65,0,33,1,12,5,11,32,1,65,127,71,13,2,11,65,192,26,65,192,26,40,2,0,65,4,114,54,2,0,11,32,2,65,254,255,255,255,7,75,13,1,32,2,16,19,34,1,65,0,16,19,34,0,79,13,1,32,1,65,127,70,13,1,32,0,65,127,70,13,1,32,0,32,1,107,34,6,32,5,65,40,106,77,13,1,11,65,180,26,65,180,26,40,2,0,32,6,106,34,0,54,2,0,32,0,65,184,26,40,2,0,75,4,64,65,184,26,32,0,54,2,0,11,2,64,2,64,2,64,65,156,23,40,2,0,34,3,4,64,65,196,26,33,0,3,64,32,1,32,0,40,2,0,34,2,32,0,40,2,4,34,4,106,70,13,2,32,0,40,2,8,34,0,13,0,11,12,2,11,65,148,23,40,2,0,34,0,65,0,32,1,32,0,79,27,69,4,64,65,148,23,32,1,54,2,0,11,65,0,33,0,65,200,26,32,6,54,2,0,65,196,26,32,1,54,2,0,65,164,23,65,127,54,2,0,65,168,23,65,220,26,40,2,0,54,2,0,65,208,26,65,0,54,2,0,3,64,32,0,65,3,116,34,2,65,180,23,106,32,2,65,172,23,106,34,3,54,2,0,32,2,65,184,23,106,32,3,54,2,0,32,0,65,1,106,34,0,65,32,71,13,0,11,65,144,23,32,6,65,88,106,34,0,65,120,32,1,107,65,7,113,65,0,32,1,65,8,106,65,7,113,27,34,2,107,34,3,54,2,0,65,156,23,32,1,32,2,106,34,2,54,2,0,32,2,32,3,65,1,114,54,2,4,32,0,32,1,106,65,40,54,2,4,65,160,23,65,236,26,40,2,0,54,2,0,12,2,11,32,0,45,0,12,65,8,113,13,0,32,1,32,3,77,13,0,32,2,32,3,75,13,0,32,0,32,4,32,6,106,54,2,4,65,156,23,32,3,65,120,32,3,107,65,7,113,65,0,32,3,65,8,106,65,7,113,27,34,0,106,34,1,54,2,0,65,144,23,65,144,23,40,2,0,32,6,106,34,2,32,0,107,34,0,54,2,0,32,1,32,0,65,1,114,54,2,4,32,2,32,3,106,65,40,54,2,4,65,160,23,65,236,26,40,2,0,54,2,0,12,1,11,32,1,65,148,23,40,2,0,34,4,73,4,64,65,148,23,32,1,54,2,0,32,1,33,4,11,32,1,32,6,106,33,2,65,196,26,33,0,2,64,2,64,2,64,2,64,2,64,2,64,3,64,32,2,32,0,40,2,0,71,4,64,32,0,40,2,8,34,0,13,1,12,2,11,11,32,0,45,0,12,65,8,113,69,13,1,11,65,196,26,33,0,3,64,32,0,40,2,0,34,2,32,3,77,4,64,32,2,32,0,40,2,4,106,34,4,32,3,75,13,3,11,32,0,40,2,8,33,0,12,0,0,11,0,11,32,0,32,1,54,2,0,32,0,32,0,40,2,4,32,6,106,54,2,4,32,1,65,120,32,1,107,65,7,113,65,0,32,1,65,8,106,65,7,113,27,106,34,9,32,5,65,3,114,54,2,4,32,2,65,120,32,2,107,65,7,113,65,0,32,2,65,8,106,65,7,113,27,106,34,1,32,9,107,32,5,107,33,0,32,5,32,9,106,33,7,32,1,32,3,70,4,64,65,156,23,32,7,54,2,0,65,144,23,65,144,23,40,2,0,32,0,106,34,0,54,2,0,32,7,32,0,65,1,114,54,2,4,12,3,11,32,1,65,152,23,40,2,0,70,4,64,65,152,23,32,7,54,2,0,65,140,23,65,140,23,40,2,0,32,0,106,34,0,54,2,0,32,7,32,0,65,1,114,54,2,4,32,0,32,7,106,32,0,54,2,0,12,3,11,32,1,40,2,4,34,2,65,3,113,65,1,70,4,64,32,2,65,120,113,33,10,2,64,32,2,65,255,1,77,4,64,32,1,40,2,8,34,3,32,2,65,3,118,34,4,65,3,116,65,172,23,106,71,26,32,3,32,1,40,2,12,34,2,70,4,64,65,132,23,65,132,23,40,2,0,65,126,32,4,119,113,54,2,0,12,2,11,32,3,32,2,54,2,12,32,2,32,3,54,2,8,12,1,11,32,1,40,2,24,33,8,2,64,32,1,32,1,40,2,12,34,6,71,4,64,32,4,32,1,40,2,8,34,2,77,4,64,32,2,40,2,12,26,11,32,2,32,6,54,2,12,32,6,32,2,54,2,8,12,1,11,2,64,32,1,65,20,106,34,3,40,2,0,34,5,13,0,32,1,65,16,106,34,3,40,2,0,34,5,13,0,65,0,33,6,12,1,11,3,64,32,3,33,2,32,5,34,6,65,20,106,34,3,40,2,0,34,5,13,0,32,6,65,16,106,33,3,32,6,40,2,16,34,5,13,0,11,32,2,65,0,54,2,0,11,32,8,69,13,0,2,64,32,1,32,1,40,2,28,34,2,65,2,116,65,180,25,106,34,3,40,2,0,70,4,64,32,3,32,6,54,2,0,32,6,13,1,65,136,23,65,136,23,40,2,0,65,126,32,2,119,113,54,2,0,12,2,11,32,8,65,16,65,20,32,8,40,2,16,32,1,70,27,106,32,6,54,2,0,32,6,69,13,1,11,32,6,32,8,54,2,24,32,1,40,2,16,34,2,4,64,32,6,32,2,54,2,16,32,2,32,6,54,2,24,11,32,1,40,2,20,34,2,69,13,0,32,6,32,2,54,2,20,32,2,32,6,54,2,24,11,32,1,32,10,106,33,1,32,0,32,10,106,33,0,11,32,1,32,1,40,2,4,65,126,113,54,2,4,32,7,32,0,65,1,114,54,2,4,32,0,32,7,106,32,0,54,2,0,32,0,65,255,1,77,4,64,32,0,65,3,118,34,1,65,3,116,65,172,23,106,33,0,2,127,65,132,23,40,2,0,34,2,65,1,32,1,116,34,1,113,69,4,64,65,132,23,32,1,32,2,114,54,2,0,32,0,12,1,11,32,0,40,2,8,11,33,1,32,0,32,7,54,2,8,32,1,32,7,54,2,12,32,7,32,0,54,2,12,32,7,32,1,54,2,8,12,3,11,32,7,2,127,65,0,32,0,65,8,118,34,1,69,13,0,26,65,31,32,0,65,255,255,255,7,75,13,0,26,32,1,32,1,65,128,254,63,106,65,16,118,65,8,113,34,1,116,34,2,32,2,65,128,224,31,106,65,16,118,65,4,113,34,2,116,34,3,32,3,65,128,128,15,106,65,16,118,65,2,113,34,3,116,65,15,118,32,1,32,2,114,32,3,114,107,34,1,65,1,116,32,0,32,1,65,21,106,118,65,1,113,114,65,28,106,11,34,1,54,2,28,32,7,66,0,55,2,16,32,1,65,2,116,65,180,25,106,33,2,2,64,65,136,23,40,2,0,34,3,65,1,32,1,116,34,4,113,69,4,64,65,136,23,32,3,32,4,114,54,2,0,32,2,32,7,54,2,0,12,1,11,32,0,65,0,65,25,32,1,65,1,118,107,32,1,65,31,70,27,116,33,3,32,2,40,2,0,33,1,3,64,32,1,34,2,40,2,4,65,120,113,32,0,70,13,3,32,3,65,29,118,33,1,32,3,65,1,116,33,3,32,2,32,1,65,4,113,106,34,4,40,2,16,34,1,13,0,11,32,4,32,7,54,2,16,11,32,7,32,2,54,2,24,32,7,32,7,54,2,12,32,7,32,7,54,2,8,12,2,11,65,144,23,32,6,65,88,106,34,0,65,120,32,1,107,65,7,113,65,0,32,1,65,8,106,65,7,113,27,34,2,107,34,7,54,2,0,65,156,23,32,1,32,2,106,34,2,54,2,0,32,2,32,7,65,1,114,54,2,4,32,0,32,1,106,65,40,54,2,4,65,160,23,65,236,26,40,2,0,54,2,0,32,3,32,4,65,39,32,4,107,65,7,113,65,0,32,4,65,89,106,65,7,113,27,106,65,81,106,34,0,32,0,32,3,65,16,106,73,27,34,2,65,27,54,2,4,32,2,65,204,26,41,2,0,55,2,16,32,2,65,196,26,41,2,0,55,2,8,65,204,26,32,2,65,8,106,54,2,0,65,200,26,32,6,54,2,0,65,196,26,32,1,54,2,0,65,208,26,65,0,54,2,0,32,2,65,24,106,33,0,3,64,32,0,65,7,54,2,4,32,0,65,8,106,33,1,32,0,65,4,106,33,0,32,4,32,1,75,13,0,11,32,2,32,3,70,13,3,32,2,32,2,40,2,4,65,126,113,54,2,4,32,3,32,2,32,3,107,34,4,65,1,114,54,2,4,32,2,32,4,54,2,0,32,4,65,255,1,77,4,64,32,4,65,3,118,34,1,65,3,116,65,172,23,106,33,0,2,127,65,132,23,40,2,0,34,2,65,1,32,1,116,34,1,113,69,4,64,65,132,23,32,1,32,2,114,54,2,0,32,0,12,1,11,32,0,40,2,8,11,33,1,32,0,32,3,54,2,8,32,1,32,3,54,2,12,32,3,32,0,54,2,12,32,3,32,1,54,2,8,12,4,11,32,3,66,0,55,2,16,32,3,2,127,65,0,32,4,65,8,118,34,0,69,13,0,26,65,31,32,4,65,255,255,255,7,75,13,0,26,32,0,32,0,65,128,254,63,106,65,16,118,65,8,113,34,0,116,34,1,32,1,65,128,224,31,106,65,16,118,65,4,113,34,1,116,34,2,32,2,65,128,128,15,106,65,16,118,65,2,113,34,2,116,65,15,118,32,0,32,1,114,32,2,114,107,34,0,65,1,116,32,4,32,0,65,21,106,118,65,1,113,114,65,28,106,11,34,0,54,2,28,32,0,65,2,116,65,180,25,106,33,1,2,64,65,136,23,40,2,0,34,2,65,1,32,0,116,34,6,113,69,4,64,65,136,23,32,2,32,6,114,54,2,0,32,1,32,3,54,2,0,32,3,32,1,54,2,24,12,1,11,32,4,65,0,65,25,32,0,65,1,118,107,32,0,65,31,70,27,116,33,0,32,1,40,2,0,33,1,3,64,32,1,34,2,40,2,4,65,120,113,32,4,70,13,4,32,0,65,29,118,33,1,32,0,65,1,116,33,0,32,2,32,1,65,4,113,106,34,6,40,2,16,34,1,13,0,11,32,6,32,3,54,2,16,32,3,32,2,54,2,24,11,32,3,32,3,54,2,12,32,3,32,3,54,2,8,12,3,11,32,2,40,2,8,34,0,32,7,54,2,12,32,2,32,7,54,2,8,32,7,65,0,54,2,24,32,7,32,2,54,2,12,32,7,32,0,54,2,8,11,32,9,65,8,106,33,0,12,5,11,32,2,40,2,8,34,0,32,3,54,2,12,32,2,32,3,54,2,8,32,3,65,0,54,2,24,32,3,32,2,54,2,12,32,3,32,0,54,2,8,11,65,144,23,40,2,0,34,0,32,5,77,13,0,65,144,23,32,0,32,5,107,34,1,54,2,0,65,156,23,65,156,23,40,2,0,34,0,32,5,106,34,2,54,2,0,32,2,32,1,65,1,114,54,2,4,32,0,32,5,65,3,114,54,2,4,32,0,65,8,106,33,0,12,3,11,65,168,22,65,48,54,2,0,65,0,33,0,12,2,11,2,64,32,8,69,13,0,2,64,32,4,40,2,28,34,0,65,2,116,65,180,25,106,34,3,40,2,0,32,4,70,4,64,32,3,32,1,54,2,0,32,1,13,1,65,136,23,32,7,65,126,32,0,119,113,34,7,54,2,0,12,2,11,32,8,65,16,65,20,32,8,40,2,16,32,4,70,27,106,32,1,54,2,0,32,1,69,13,1,11,32,1,32,8,54,2,24,32,4,40,2,16,34,0,4,64,32,1,32,0,54,2,16,32,0,32,1,54,2,24,11,32,4,40,2,20,34,0,69,13,0,32,1,32,0,54,2,20,32,0,32,1,54,2,24,11,2,64,32,2,65,15,77,4,64,32,4,32,2,32,5,106,34,0,65,3,114,54,2,4,32,0,32,4,106,34,0,32,0,40,2,4,65,1,114,54,2,4,12,1,11,32,4,32,5,65,3,114,54,2,4,32,4,32,5,106,34,3,32,2,65,1,114,54,2,4,32,2,32,3,106,32,2,54,2,0,32,2,65,255,1,77,4,64,32,2,65,3,118,34,1,65,3,116,65,172,23,106,33,0,2,127,65,132,23,40,2,0,34,2,65,1,32,1,116,34,1,113,69,4,64,65,132,23,32,1,32,2,114,54,2,0,32,0,12,1,11,32,0,40,2,8,11,33,1,32,0,32,3,54,2,8,32,1,32,3,54,2,12,32,3,32,0,54,2,12,32,3,32,1,54,2,8,12,1,11,32,3,2,127,65,0,32,2,65,8,118,34,0,69,13,0,26,65,31,32,2,65,255,255,255,7,75,13,0,26,32,0,32,0,65,128,254,63,106,65,16,118,65,8,113,34,0,116,34,1,32,1,65,128,224,31,106,65,16,118,65,4,113,34,1,116,34,5,32,5,65,128,128,15,106,65,16,118,65,2,113,34,5,116,65,15,118,32,0,32,1,114,32,5,114,107,34,0,65,1,116,32,2,32,0,65,21,106,118,65,1,113,114,65,28,106,11,34,0,54,2,28,32,3,66,0,55,2,16,32,0,65,2,116,65,180,25,106,33,1,2,64,2,64,32,7,65,1,32,0,116,34,5,113,69,4,64,65,136,23,32,5,32,7,114,54,2,0,32,1,32,3,54,2,0,12,1,11,32,2,65,0,65,25,32,0,65,1,118,107,32,0,65,31,70,27,116,33,0,32,1,40,2,0,33,5,3,64,32,5,34,1,40,2,4,65,120,113,32,2,70,13,2,32,0,65,29,118,33,5,32,0,65,1,116,33,0,32,1,32,5,65,4,113,106,34,6,40,2,16,34,5,13,0,11,32,6,32,3,54,2,16,11,32,3,32,1,54,2,24,32,3,32,3,54,2,12,32,3,32,3,54,2,8,12,1,11,32,1,40,2,8,34,0,32,3,54,2,12,32,1,32,3,54,2,8,32,3,65,0,54,2,24,32,3,32,1,54,2,12,32,3,32,0,54,2,8,11,32,4,65,8,106,33,0,12,1,11,2,64,32,9,69,13,0,2,64,32,1,40,2,28,34,0,65,2,116,65,180,25,106,34,2,40,2,0,32,1,70,4,64,32,2,32,4,54,2,0,32,4,13,1,65,136,23,32,10,65,126,32,0,119,113,54,2,0,12,2,11,32,9,65,16,65,20,32,9,40,2,16,32,1,70,27,106,32,4,54,2,0,32,4,69,13,1,11,32,4,32,9,54,2,24,32,1,40,2,16,34,0,4,64,32,4,32,0,54,2,16,32,0,32,4,54,2,24,11,32,1,40,2,20,34,0,69,13,0,32,4,32,0,54,2,20,32,0,32,4,54,2,24,11,2,64,32,3,65,15,77,4,64,32,1,32,3,32,5,106,34,0,65,3,114,54,2,4,32,0,32,1,106,34,0,32,0,40,2,4,65,1,114,54,2,4,12,1,11,32,1,32,5,65,3,114,54,2,4,32,1,32,5,106,34,4,32,3,65,1,114,54,2,4,32,3,32,4,106,32,3,54,2,0,32,8,4,64,32,8,65,3,118,34,5,65,3,116,65,172,23,106,33,0,65,152,23,40,2,0,33,2,2,127,65,1,32,5,116,34,5,32,6,113,69,4,64,65,132,23,32,5,32,6,114,54,2,0,32,0,12,1,11,32,0,40,2,8,11,33,5,32,0,32,2,54,2,8,32,5,32,2,54,2,12,32,2,32,0,54,2,12,32,2,32,5,54,2,8,11,65,152,23,32,4,54,2,0,65,140,23,32,3,54,2,0,11,32,1,65,8,106,33,0,11,32,11,65,16,106,36,0,32,0,11,163,1,0,32,0,65,1,58,0,53,2,64,32,0,40,2,4,32,2,71,13,0,32,0,65,1,58,0,52,32,0,40,2,16,34,2,69,4,64,32,0,65,1,54,2,36,32,0,32,3,54,2,24,32,0,32,1,54,2,16,32,3,65,1,71,13,1,32,0,40,2,48,65,1,71,13,1,32,0,65,1,58,0,54,15,11,32,1,32,2,70,4,64,32,0,40,2,24,34,2,65,2,70,4,64,32,0,32,3,54,2,24,32,3,33,2,11,32,0,40,2,48,65,1,71,13,1,32,2,65,1,71,13,1,32,0,65,1,58,0,54,15,11,32,0,65,1,58,0,54,32,0,32,0,40,2,36,65,1,106,54,2,36,11,11,93,1,1,127,32,0,40,2,16,34,3,69,4,64,32,0,65,1,54,2,36,32,0,32,2,54,2,24,32,0,32,1,54,2,16,15,11,2,64,32,1,32,3,70,4,64,32,0,40,2,24,65,2,71,13,1,32,0,32,2,54,2,24,15,11,32,0,65,1,58,0,54,32,0,65,2,54,2,24,32,0,32,0,40,2,36,65,1,106,54,2,36,11,11,163,2,0,2,64,2,64,32,1,65,20,75,13,0,32,1,65,119,106,34,1,65,9,75,13,0,2,64,2,64,2,64,2,64,2,64,2,64,2,64,2,64,32,1,65,1,107,14,9,1,2,9,3,4,5,6,9,7,0,11,32,2,32,2,40,2,0,34,1,65,4,106,54,2,0,32,0,32,1,40,2,0,54,2,0,15,11,32,2,32,2,40,2,0,34,1,65,4,106,54,2,0,32,0,32,1,52,2,0,55,3,0,15,11,32,2,32,2,40,2,0,34,1,65,4,106,54,2,0,32,0,32,1,53,2,0,55,3,0,15,11,32,2,32,2,40,2,0,34,1,65,4,106,54,2,0,32,0,32,1,50,1,0,55,3,0,15,11,32,2,32,2,40,2,0,34,1,65,4,106,54,2,0,32,0,32,1,51,1,0,55,3,0,15,11,32,2,32,2,40,2,0,34,1,65,4,106,54,2,0,32,0,32,1,48,0,0,55,3,0,15,11,32,2,32,2,40,2,0,34,1,65,4,106,54,2,0,32,0,32,1,49,0,0,55,3,0,15,11,32,0,32,2,65,30,17,3,0,11,15,11,32,2,32,2,40,2,0,65,7,106,65,120,113,34,1,65,8,106,54,2,0,32,0,32,1,41,3,0,55,3,0,11,74,1,3,127,32,0,40,2,0,44,0,0,65,80,106,65,10,73,4,64,3,64,32,0,40,2,0,34,1,44,0,0,33,3,32,0,32,1,65,1,106,54,2,0,32,3,32,2,65,10,108,106,65,80,106,33,2,32,1,44,0,1,65,80,106,65,10,73,13,0,11,11,32,2,11,126,2,1,127,1,126,32,0,189,34,3,66,52,136,167,65,255,15,113,34,2,65,255,15,71,4,124,32,2,69,4,64,32,1,32,0,68,0,0,0,0,0,0,0,0,97,4,127,65,0,5,32,0,68,0,0,0,0,0,0,240,67,162,32,1,16,41,33,0,32,1,40,2,0,65,64,106,11,54,2,0,32,0,15,11,32,1,32,2,65,130,120,106,54,2,0,32,3,66,255,255,255,255,255,255,255,135,128,127,131,66,128,128,128,128,128,128,128,240,63,132,191,5,32,0,11,11,17,0,32,0,69,4,64,65,0,15,11,32,0,32,1,16,79,11,164,1,1,6,127,65,8,33,3,35,0,65,128,2,107,34,4,36,0,2,64,32,1,65,2,72,13,0,32,0,32,1,65,2,116,106,34,7,32,4,54,2,0,32,4,33,2,3,64,32,2,32,0,40,2,0,32,3,65,128,2,32,3,65,128,2,73,27,34,5,16,15,26,65,0,33,2,3,64,32,0,32,2,65,2,116,106,34,6,40,2,0,32,0,32,2,65,1,106,34,2,65,2,116,106,40,2,0,32,5,16,15,26,32,6,32,6,40,2,0,32,5,106,54,2,0,32,1,32,2,71,13,0,11,32,3,32,5,107,34,3,69,13,1,32,7,40,2,0,33,2,12,0,0,11,0,11,32,4,65,128,2,106,36,0,11,130,1,1,3,127,35,0,65,16,107,34,2,36,0,2,64,2,64,65,251,9,32,0,44,0,0,16,22,69,4,64,65,168,22,65,28,54,2,0,12,1,11,32,0,16,81,33,1,32,2,65,182,3,54,2,0,65,237,9,32,1,65,128,128,2,114,32,2,16,9,34,1,65,129,96,79,4,64,65,168,22,65,0,32,1,107,54,2,0,65,127,33,1,11,32,1,65,0,72,13,1,32,1,32,0,16,87,34,3,13,1,32,1,16,1,26,11,65,0,33,3,11,32,2,65,16,106,36,0,32,3,11,114,1,1,127,32,0,4,64,32,0,40,2,76,65,127,76,4,64,32,0,16,31,15,11,32,0,16,31,15,11,65,152,22,40,2,0,4,64,65,152,22,40,2,0,16,45,33,1,11,65,244,22,40,2,0,34,0,4,64,3,64,32,0,40,2,76,65,0,78,4,127,65,1,5,65,0,11,26,32,0,40,2,20,32,0,40,2,28,75,4,64,32,0,16,31,32,1,114,33,1,11,32,0,40,2,56,34,0,13,0,11,11,32,1,11,132,1,1,3,127,32,0,40,2,76,65,0,78,4,127,65,1,5,65,0,11,26,32,0,40,2,0,65,1,113,34,3,69,4,64,32,0,40,2,52,34,1,4,64,32,1,32,0,40,2,56,54,2,56,11,32,0,40,2,56,34,2,4,64,32,2,32,1,54,2,52,11,32,0,65,244,22,40,2,0,70,4,64,65,244,22,32,2,54,2,0,11,11,32,0,16,45,26,32,0,32,0,40,2,12,17,1,0,26,32,0,40,2,96,34,1,4,64,32,1,16,11,11,32,3,69,4,64,32,0,16,11,11,11,3,0,1,11,132,1,1,1,127,32,1,40,2,76,65,0,72,4,64,2,64,32,1,44,0,75,32,0,65,255,1,113,70,13,0,32,1,40,2,20,34,2,32,1,40,2,16,79,13,0,32,1,32,2,65,1,106,54,2,20,32,2,32,0,58,0,0,15,11,32,1,32,0,16,35,15,11,2,64,2,64,32,1,44,0,75,32,0,65,255,1,113,70,13,0,32,1,40,2,20,34,2,32,1,40,2,16,79,13,0,32,1,32,2,65,1,106,54,2,20,32,2,32,0,58,0,0,12,1,11,32,1,32,0,16,35,11,11,200,2,2,4,127,3,125,35,0,65,16,107,34,7,36,0,65,127,32,0,40,2,24,34,4,65,2,116,34,6,32,4,65,255,255,255,255,3,113,32,4,71,27,16,10,33,5,32,4,65,1,78,4,64,32,5,65,0,32,6,16,14,26,11,32,0,40,2,16,34,6,65,1,78,4,64,65,0,33,4,3,64,32,7,65,8,106,32,0,40,2,40,32,4,65,2,116,106,40,2,0,32,1,16,117,32,5,2,127,32,7,42,2,8,34,8,139,67,0,0,0,79,93,4,64,32,8,168,12,1,11,65,128,128,128,128,120,11,65,2,116,106,34,6,32,7,42,2,12,32,6,42,2,0,146,56,2,0,32,4,65,1,106,34,4,32,0,40,2,16,34,6,72,13,0,11,11,2,64,32,0,45,0,28,4,64,32,2,32,5,42,2,0,32,6,178,149,56,2,0,12,1,11,32,3,65,0,78,4,64,32,2,32,5,32,3,65,2,116,106,40,2,0,54,2,0,12,1,11,67,0,0,0,0,33,8,32,0,40,2,24,34,0,65,2,78,4,64,32,5,42,2,0,33,9,65,1,33,4,3,64,32,5,32,4,65,2,116,106,42,2,0,34,10,32,9,32,10,32,9,94,34,1,27,33,9,32,4,178,32,8,32,1,27,33,8,32,4,65,1,106,34,4,32,0,71,13,0,11,11,32,2,32,8,56,2,0,11,32,5,16,11,32,7,65,16,106,36,0,11,38,0,32,2,65,1,116,34,2,65,1,114,32,2,65,2,106,32,1,32,0,40,2,12,65,2,116,106,42,2,0,32,0,42,2,16,93,27,11,4,0,32,0,11,210,1,1,1,124,32,0,32,2,54,2,20,32,0,32,1,54,2,8,32,0,32,4,56,2,24,32,0,32,3,54,2,16,32,0,65,200,16,54,2,0,32,0,2,127,32,1,16,27,68,0,0,0,0,0,0,240,191,160,34,6,153,68,0,0,0,0,0,0,224,65,99,4,64,32,6,170,12,1,11,65,128,128,128,128,120,11,34,2,54,2,12,65,127,32,2,65,2,116,32,2,65,255,255,255,255,3,113,32,2,71,27,16,10,33,1,32,0,32,5,58,0,4,32,0,32,1,54,2,28,2,64,32,2,65,1,72,13,0,32,1,65,0,54,2,0,32,2,65,1,70,13,0,32,1,65,0,54,2,4,65,2,33,1,32,2,65,2,70,13,0,3,64,32,0,40,2,28,32,1,65,2,116,106,65,0,54,2,0,32,1,65,1,106,34,1,32,2,71,13,0,11,11,32,0,65,248,16,54,2,0,11,124,1,5,127,32,0,65,200,16,54,2,0,2,64,32,0,40,2,28,34,1,69,13,0,32,0,40,2,12,34,2,65,0,74,4,64,3,64,32,1,32,3,65,2,116,34,5,106,40,2,0,34,4,4,64,32,4,32,4,40,2,0,40,2,4,17,0,0,32,0,40,2,28,32,5,106,65,0,54,2,0,32,0,40,2,12,33,2,32,0,40,2,28,33,1,11,32,3,65,1,106,34,3,32,2,72,13,0,11,32,1,69,13,1,11,32,1,16,11,11,32,0,16,11,11,210,1,1,1,124,32,0,32,2,54,2,20,32,0,32,1,54,2,8,32,0,32,4,56,2,24,32,0,32,3,54,2,16,32,0,65,200,16,54,2,0,32,0,2,127,32,1,16,27,68,0,0,0,0,0,0,240,191,160,34,6,153,68,0,0,0,0,0,0,224,65,99,4,64,32,6,170,12,1,11,65,128,128,128,128,120,11,34,2,54,2,12,65,127,32,2,65,2,116,32,2,65,255,255,255,255,3,113,32,2,71,27,16,10,33,1,32,0,32,5,58,0,4,32,0,32,1,54,2,28,2,64,32,2,65,1,72,13,0,32,1,65,0,54,2,0,32,2,65,1,70,13,0,32,1,65,0,54,2,4,65,2,33,1,32,2,65,2,70,13,0,3,64,32,0,40,2,28,32,1,65,2,116,106,65,0,54,2,0,32,1,65,1,106,34,1,32,2,71,13,0,11,11,32,0,65,224,16,54,2,0,11,144,1,1,3,127,32,0,33,1,2,64,2,64,32,0,65,3,113,69,13,0,32,0,45,0,0,69,4,64,65,0,15,11,3,64,32,1,65,1,106,34,1,65,3,113,69,13,1,32,1,45,0,0,13,0,11,12,1,11,3,64,32,1,34,2,65,4,106,33,1,32,2,40,2,0,34,3,65,127,115,32,3,65,255,253,251,119,106,113,65,128,129,130,132,120,113,69,13,0,11,32,3,65,255,1,113,69,4,64,32,2,32,0,107,15,11,3,64,32,2,45,0,1,33,3,32,2,65,1,106,34,1,33,2,32,3,13,0,11,11,32,1,32,0,107,11,89,1,1,127,32,0,32,0,45,0,74,34,1,65,127,106,32,1,114,58,0,74,32,0,40,2,0,34,1,65,8,113,4,64,32,0,32,1,65,32,114,54,2,0,65,127,15,11,32,0,66,0,55,2,4,32,0,32,0,40,2,44,34,1,54,2,28,32,0,32,1,54,2,20,32,0,32,1,32,0,40,2,48,106,54,2,16,65,0,11,26,0,32,0,32,1,40,2,8,32,5,16,17,4,64,32,1,32,2,32,3,32,4,16,37,11,11,55,0,32,0,32,1,40,2,8,32,5,16,17,4,64,32,1,32,2,32,3,32,4,16,37,15,11,32,0,40,2,8,34,0,32,1,32,2,32,3,32,4,32,5,32,0,40,2,0,40,2,20,17,10,0,11,167,1,0,32,0,32,1,40,2,8,32,4,16,17,4,64,2,64,32,1,40,2,4,32,2,71,13,0,32,1,40,2,28,65,1,70,13,0,32,1,32,3,54,2,28,11,15,11,2,64,32,0,32,1,40,2,0,32,4,16,17,69,13,0,2,64,32,2,32,1,40,2,16,71,4,64,32,1,40,2,20,32,2,71,13,1,11,32,3,65,1,71,13,1,32,1,65,1,54,2,32,15,11,32,1,32,2,54,2,20,32,1,32,3,54,2,32,32,1,32,1,40,2,40,65,1,106,54,2,40,2,64,32,1,40,2,36,65,1,71,13,0,32,1,40,2,24,65,2,71,13,0,32,1,65,1,58,0,54,11,32,1,65,4,54,2,44,11,11,136,2,0,32,0,32,1,40,2,8,32,4,16,17,4,64,2,64,32,1,40,2,4,32,2,71,13,0,32,1,40,2,28,65,1,70,13,0,32,1,32,3,54,2,28,11,15,11,2,64,32,0,32,1,40,2,0,32,4,16,17,4,64,2,64,32,2,32,1,40,2,16,71,4,64,32,1,40,2,20,32,2,71,13,1,11,32,3,65,1,71,13,2,32,1,65,1,54,2,32,15,11,32,1,32,3,54,2,32,2,64,32,1,40,2,44,65,4,70,13,0,32,1,65,0,59,1,52,32,0,40,2,8,34,0,32,1,32,2,32,2,65,1,32,4,32,0,40,2,0,40,2,20,17,10,0,32,1,45,0,53,4,64,32,1,65,3,54,2,44,32,1,45,0,52,69,13,1,12,3,11,32,1,65,4,54,2,44,11,32,1,32,2,54,2,20,32,1,32,1,40,2,40,65,1,106,54,2,40,32,1,40,2,36,65,1,71,13,1,32,1,40,2,24,65,2,71,13,1,32,1,65,1,58,0,54,15,11,32,0,40,2,8,34,0,32,1,32,2,32,3,32,4,32,0,40,2,0,40,2,24,17,9,0,11,11,49,0,32,0,32,1,40,2,8,65,0,16,17,4,64,32,1,32,2,32,3,16,38,15,11,32,0,40,2,8,34,0,32,1,32,2,32,3,32,0,40,2,0,40,2,28,17,6,0,11,24,0,32,0,32,1,40,2,8,65,0,16,17,4,64,32,1,32,2,32,3,16,38,11,11,168,2,1,4,127,35,0,65,64,106,34,1,36,0,32,0,40,2,0,34,2,65,124,106,40,2,0,33,3,32,2,65,120,106,40,2,0,33,4,32,1,65,0,54,2,20,32,1,65,252,14,54,2,16,32,1,32,0,54,2,12,32,1,65,172,15,54,2,8,65,0,33,2,32,1,65,24,106,65,0,65,39,16,14,26,32,0,32,4,106,33,0,2,64,32,3,65,172,15,65,0,16,17,4,64,32,1,65,1,54,2,56,32,3,32,1,65,8,106,32,0,32,0,65,1,65,0,32,3,40,2,0,40,2,20,17,10,0,32,0,65,0,32,1,40,2,32,65,1,70,27,33,2,12,1,11,32,3,32,1,65,8,106,32,0,65,1,65,0,32,3,40,2,0,40,2,24,17,9,0,32,1,40,2,44,34,0,65,1,75,13,0,32,0,65,1,107,4,64,32,1,40,2,28,65,0,32,1,40,2,40,65,1,70,27,65,0,32,1,40,2,36,65,1,70,27,65,0,32,1,40,2,48,65,1,70,27,33,2,12,1,11,32,1,40,2,32,65,1,71,4,64,32,1,40,2,48,13,1,32,1,40,2,36,65,1,71,13,1,32,1,40,2,40,65,1,71,13,1,11,32,1,40,2,24,33,2,11,32,1,65,64,107,36,0,32,2,11,157,1,1,1,127,35,0,65,64,106,34,3,36,0,2,127,65,1,32,0,32,1,65,0,16,17,13,0,26,65,0,32,1,69,13,0,26,65,0,32,1,16,63,34,1,69,13,0,26,32,3,65,127,54,2,20,32,3,32,0,54,2,16,32,3,65,0,54,2,12,32,3,32,1,54,2,8,32,3,65,24,106,65,0,65,39,16,14,26,32,3,65,1,54,2,56,32,1,32,3,65,8,106,32,2,40,2,0,65,1,32,1,40,2,0,40,2,28,17,6,0,65,0,32,3,40,2,32,65,1,71,13,0,26,32,2,32,3,40,2,24,54,2,0,65,1,11,33,0,32,3,65,64,107,36,0,32,0,11,120,2,1,127,1,126,32,0,32,3,54,2,28,32,0,32,2,54,2,24,32,0,40,2,8,34,4,4,64,32,4,16,11,11,32,0,32,1,54,2,8,32,3,65,1,78,4,64,65,0,33,1,3,64,65,160,22,65,160,22,41,3,0,66,173,254,213,228,212,133,253,168,216,0,126,66,1,124,34,5,55,3,0,32,0,40,2,8,32,1,65,2,116,106,32,5,66,33,136,167,32,2,111,54,2,0,32,1,65,1,106,34,1,32,3,71,13,0,11,11,11,77,1,2,127,32,1,45,0,0,33,2,2,64,32,0,45,0,0,34,3,69,13,0,32,2,32,3,71,13,0,3,64,32,1,45,0,1,33,2,32,0,45,0,1,34,3,69,13,1,32,1,65,1,106,33,1,32,0,65,1,106,33,0,32,2,32,3,70,13,0,11,11,32,3,32,2,107,11,5,0,16,68,0,11,39,1,1,127,35,0,65,16,107,34,0,36,0,32,0,65,0,54,2,12,65,128,10,40,2,0,34,0,16,73,65,10,32,0,16,48,16,5,0,11,40,0,32,1,32,1,40,2,0,65,15,106,65,112,113,34,1,65,16,106,54,2,0,32,0,32,1,41,3,0,32,1,41,3,8,16,74,57,3,0,11,218,22,3,17,127,2,126,1,124,35,0,65,176,4,107,34,9,36,0,32,9,65,0,54,2,44,2,127,32,1,189,34,23,66,127,87,4,64,65,1,33,18,32,1,154,34,1,189,33,23,65,128,14,12,1,11,32,4,65,128,16,113,4,64,65,1,33,18,65,131,14,12,1,11,65,134,14,65,129,14,32,4,65,1,113,34,18,27,11,33,22,2,64,32,23,66,128,128,128,128,128,128,128,248,255,0,131,66,128,128,128,128,128,128,128,248,255,0,81,4,64,32,0,65,32,32,2,32,18,65,3,106,34,12,32,4,65,255,255,123,113,16,13,32,0,32,22,32,18,16,12,32,0,65,155,14,65,159,14,32,5,65,5,118,65,1,113,34,3,27,65,147,14,65,151,14,32,3,27,32,1,32,1,98,27,65,3,16,12,12,1,11,32,9,65,16,106,33,17,2,64,2,127,2,64,32,1,32,9,65,44,106,16,41,34,1,32,1,160,34,1,68,0,0,0,0,0,0,0,0,98,4,64,32,9,32,9,40,2,44,34,6,65,127,106,54,2,44,32,5,65,32,114,34,16,65,225,0,71,13,1,12,3,11,32,5,65,32,114,34,16,65,225,0,70,13,2,32,9,40,2,44,33,10,65,6,32,3,32,3,65,0,72,27,12,1,11,32,9,32,6,65,99,106,34,10,54,2,44,32,1,68,0,0,0,0,0,0,176,65,162,33,1,65,6,32,3,32,3,65,0,72,27,11,33,11,32,9,65,48,106,32,9,65,208,2,106,32,10,65,0,72,27,34,14,33,8,3,64,32,8,2,127,32,1,68,0,0,0,0,0,0,240,65,99,32,1,68,0,0,0,0,0,0,0,0,102,113,4,64,32,1,171,12,1,11,65,0,11,34,3,54,2,0,32,8,65,4,106,33,8,32,1,32,3,184,161,68,0,0,0,0,101,205,205,65,162,34,1,68,0,0,0,0,0,0,0,0,98,13,0,11,2,64,32,10,65,1,72,4,64,32,8,33,6,32,14,33,7,12,1,11,32,14,33,7,3,64,32,10,65,29,32,10,65,29,72,27,33,13,2,64,32,8,65,124,106,34,6,32,7,73,13,0,32,13,173,33,24,66,0,33,23,3,64,32,6,32,23,66,255,255,255,255,15,131,32,6,53,2,0,32,24,134,124,34,23,32,23,66,128,148,235,220,3,128,34,23,66,128,148,235,220,3,126,125,62,2,0,32,6,65,124,106,34,6,32,7,79,13,0,11,32,23,167,34,3,69,13,0,32,7,65,124,106,34,7,32,3,54,2,0,11,3,64,32,8,34,6,32,7,75,4,64,32,6,65,124,106,34,8,40,2,0,69,13,1,11,11,32,9,32,9,40,2,44,32,13,107,34,10,54,2,44,32,6,33,8,32,10,65,0,74,13,0,11,11,32,10,65,127,76,4,64,32,11,65,25,106,65,9,109,65,1,106,33,19,32,16,65,230,0,70,33,20,3,64,65,9,65,0,32,10,107,32,10,65,119,72,27,33,21,2,64,32,7,32,6,79,4,64,32,7,32,7,65,4,106,32,7,40,2,0,27,33,7,12,1,11,65,128,148,235,220,3,32,21,118,33,15,65,127,32,21,116,65,127,115,33,13,65,0,33,10,32,7,33,8,3,64,32,8,32,8,40,2,0,34,3,32,21,118,32,10,106,54,2,0,32,3,32,13,113,32,15,108,33,10,32,8,65,4,106,34,8,32,6,73,13,0,11,32,7,32,7,65,4,106,32,7,40,2,0,27,33,7,32,10,69,13,0,32,6,32,10,54,2,0,32,6,65,4,106,33,6,11,32,9,32,9,40,2,44,32,21,106,34,10,54,2,44,32,14,32,7,32,20,27,34,3,32,19,65,2,116,106,32,6,32,6,32,3,107,65,2,117,32,19,74,27,33,6,32,10,65,0,72,13,0,11,11,65,0,33,8,2,64,32,7,32,6,79,13,0,32,14,32,7,107,65,2,117,65,9,108,33,8,65,10,33,10,32,7,40,2,0,34,3,65,10,73,13,0,3,64,32,8,65,1,106,33,8,32,3,32,10,65,10,108,34,10,79,13,0,11,11,32,11,65,0,32,8,32,16,65,230,0,70,27,107,32,16,65,231,0,70,32,11,65,0,71,113,107,34,3,32,6,32,14,107,65,2,117,65,9,108,65,119,106,72,4,64,32,3,65,128,200,0,106,34,13,65,9,109,34,3,65,2,116,32,14,106,65,132,96,106,33,12,65,10,33,10,32,13,32,3,65,9,108,107,34,3,65,7,76,4,64,3,64,32,10,65,10,108,33,10,32,3,65,1,106,34,3,65,8,71,13,0,11,11,2,64,65,0,32,6,32,12,65,4,106,34,19,70,32,12,40,2,0,34,15,32,15,32,10,110,34,13,32,10,108,107,34,20,27,13,0,68,0,0,0,0,0,0,224,63,68,0,0,0,0,0,0,240,63,68,0,0,0,0,0,0,248,63,32,20,32,10,65,1,118,34,3,70,27,68,0,0,0,0,0,0,248,63,32,6,32,19,70,27,32,20,32,3,73,27,33,25,68,1,0,0,0,0,0,64,67,68,0,0,0,0,0,0,64,67,32,13,65,1,113,27,33,1,2,64,32,18,69,13,0,32,22,45,0,0,65,45,71,13,0,32,25,154,33,25,32,1,154,33,1,11,32,12,32,15,32,20,107,34,3,54,2,0,32,1,32,25,160,32,1,97,13,0,32,12,32,3,32,10,106,34,3,54,2,0,32,3,65,128,148,235,220,3,79,4,64,3,64,32,12,65,0,54,2,0,32,12,65,124,106,34,12,32,7,73,4,64,32,7,65,124,106,34,7,65,0,54,2,0,11,32,12,32,12,40,2,0,65,1,106,34,3,54,2,0,32,3,65,255,147,235,220,3,75,13,0,11,11,32,14,32,7,107,65,2,117,65,9,108,33,8,65,10,33,10,32,7,40,2,0,34,3,65,10,73,13,0,3,64,32,8,65,1,106,33,8,32,3,32,10,65,10,108,34,10,79,13,0,11,11,32,12,65,4,106,34,3,32,6,32,6,32,3,75,27,33,6,11,2,127,3,64,65,0,32,6,34,13,32,7,77,13,1,26,32,13,65,124,106,34,6,40,2,0,69,13,0,11,65,1,11,33,10,2,64,32,16,65,231,0,71,4,64,32,4,65,8,113,33,16,12,1,11,32,8,65,127,115,65,127,32,11,65,1,32,11,27,34,6,32,8,74,32,8,65,123,74,113,34,3,27,32,6,106,33,11,65,127,65,126,32,3,27,32,5,106,33,5,32,4,65,8,113,34,16,13,0,65,9,33,6,2,64,32,10,69,13,0,32,13,65,124,106,40,2,0,34,15,69,13,0,65,10,33,3,65,0,33,6,32,15,65,10,112,13,0,3,64,32,6,65,1,106,33,6,32,15,32,3,65,10,108,34,3,112,69,13,0,11,11,32,13,32,14,107,65,2,117,65,9,108,65,119,106,33,3,32,5,65,32,114,65,230,0,70,4,64,65,0,33,16,32,11,32,3,32,6,107,34,3,65,0,32,3,65,0,74,27,34,3,32,11,32,3,72,27,33,11,12,1,11,65,0,33,16,32,11,32,3,32,8,106,32,6,107,34,3,65,0,32,3,65,0,74,27,34,3,32,11,32,3,72,27,33,11,11,32,11,32,16,114,34,21,65,0,71,33,20,32,0,65,32,32,2,2,127,32,8,65,0,32,8,65,0,74,27,32,5,65,32,114,34,15,65,230,0,70,13,0,26,32,17,32,8,32,8,65,31,117,34,3,106,32,3,115,173,32,17,16,20,34,6,107,65,1,76,4,64,3,64,32,6,65,127,106,34,6,65,48,58,0,0,32,17,32,6,107,65,2,72,13,0,11,11,32,6,65,126,106,34,19,32,5,58,0,0,32,6,65,127,106,65,45,65,43,32,8,65,0,72,27,58,0,0,32,17,32,19,107,11,32,11,32,18,106,32,20,106,106,65,1,106,34,12,32,4,16,13,32,0,32,22,32,18,16,12,32,0,65,48,32,2,32,12,32,4,65,128,128,4,115,16,13,2,64,2,64,2,64,32,15,65,230,0,70,4,64,32,9,65,16,106,65,8,114,33,3,32,9,65,16,106,65,9,114,33,8,32,14,32,7,32,7,32,14,75,27,34,5,33,7,3,64,32,7,53,2,0,32,8,16,20,33,6,2,64,32,5,32,7,71,4,64,32,6,32,9,65,16,106,77,13,1,3,64,32,6,65,127,106,34,6,65,48,58,0,0,32,6,32,9,65,16,106,75,13,0,11,12,1,11,32,6,32,8,71,13,0,32,9,65,48,58,0,24,32,3,33,6,11,32,0,32,6,32,8,32,6,107,16,12,32,7,65,4,106,34,7,32,14,77,13,0,11,32,21,4,64,32,0,65,163,14,65,1,16,12,11,32,7,32,13,79,13,1,32,11,65,1,72,13,1,3,64,32,7,53,2,0,32,8,16,20,34,6,32,9,65,16,106,75,4,64,3,64,32,6,65,127,106,34,6,65,48,58,0,0,32,6,32,9,65,16,106,75,13,0,11,11,32,0,32,6,32,11,65,9,32,11,65,9,72,27,16,12,32,11,65,119,106,33,6,32,7,65,4,106,34,7,32,13,79,13,3,32,11,65,9,74,33,3,32,6,33,11,32,3,13,0,11,12,2,11,2,64,32,11,65,0,72,13,0,32,13,32,7,65,4,106,32,10,27,33,5,32,9,65,16,106,65,8,114,33,3,32,9,65,16,106,65,9,114,33,14,32,7,33,8,3,64,32,14,32,8,53,2,0,32,14,16,20,34,6,70,4,64,32,9,65,48,58,0,24,32,3,33,6,11,2,64,32,7,32,8,71,4,64,32,6,32,9,65,16,106,77,13,1,3,64,32,6,65,127,106,34,6,65,48,58,0,0,32,6,32,9,65,16,106,75,13,0,11,12,1,11,32,0,32,6,65,1,16,12,32,6,65,1,106,33,6,32,16,69,65,0,32,11,65,1,72,27,13,0,32,0,65,163,14,65,1,16,12,11,32,0,32,6,32,14,32,6,107,34,6,32,11,32,11,32,6,74,27,16,12,32,11,32,6,107,33,11,32,8,65,4,106,34,8,32,5,79,13,1,32,11,65,127,74,13,0,11,11,32,0,65,48,32,11,65,18,106,65,18,65,0,16,13,32,0,32,19,32,17,32,19,107,16,12,12,2,11,32,11,33,6,11,32,0,65,48,32,6,65,9,106,65,9,65,0,16,13,11,12,1,11,32,22,65,9,106,32,22,32,5,65,32,113,34,14,27,33,13,2,64,32,3,65,11,75,13,0,65,12,32,3,107,34,6,69,13,0,68,0,0,0,0,0,0,32,64,33,25,3,64,32,25,68,0,0,0,0,0,0,48,64,162,33,25,32,6,65,127,106,34,6,13,0,11,32,13,45,0,0,65,45,70,4,64,32,25,32,1,154,32,25,161,160,154,33,1,12,1,11,32,1,32,25,160,32,25,161,33,1,11,32,17,32,9,40,2,44,34,6,32,6,65,31,117,34,6,106,32,6,115,173,32,17,16,20,34,6,70,4,64,32,9,65,48,58,0,15,32,9,65,15,106,33,6,11,32,18,65,2,114,33,11,32,9,40,2,44,33,8,32,6,65,126,106,34,15,32,5,65,15,106,58,0,0,32,6,65,127,106,65,45,65,43,32,8,65,0,72,27,58,0,0,32,4,65,8,113,33,8,32,9,65,16,106,33,7,3,64,32,7,34,5,2,127,32,1,153,68,0,0,0,0,0,0,224,65,99,4,64,32,1,170,12,1,11,65,128,128,128,128,120,11,34,6,65,240,13,106,45,0,0,32,14,114,58,0,0,32,1,32,6,183,161,68,0,0,0,0,0,0,48,64,162,33,1,2,64,32,5,65,1,106,34,7,32,9,65,16,106,107,65,1,71,13,0,2,64,32,8,13,0,32,3,65,0,74,13,0,32,1,68,0,0,0,0,0,0,0,0,97,13,1,11,32,5,65,46,58,0,1,32,5,65,2,106,33,7,11,32,1,68,0,0,0,0,0,0,0,0,98,13,0,11,32,0,65,32,32,2,32,11,2,127,2,64,32,3,69,13,0,32,7,32,9,107,65,110,106,32,3,78,13,0,32,3,32,17,106,32,15,107,65,2,106,12,1,11,32,17,32,9,65,16,106,107,32,15,107,32,7,106,11,34,3,106,34,12,32,4,16,13,32,0,32,13,32,11,16,12,32,0,65,48,32,2,32,12,32,4,65,128,128,4,115,16,13,32,0,32,9,65,16,106,32,7,32,9,65,16,106,107,34,5,16,12,32,0,65,48,32,3,32,5,32,17,32,15,107,34,3,106,107,65,0,65,0,16,13,32,0,32,15,32,3,16,12,11,32,0,65,32,32,2,32,12,32,4,65,128,192,0,115,16,13,32,9,65,176,4,106,36,0,32,2,32,12,32,12,32,2,72,27,11,52,0,32,0,80,69,4,64,3,64,32,1,65,127,106,34,1,32,0,167,65,15,113,65,240,13,106,45,0,0,32,2,114,58,0,0,32,0,66,4,136,34,0,66,0,82,13,0,11,11,32,1,11,45,0,32,0,80,69,4,64,3,64,32,1,65,127,106,34,1,32,0,167,65,7,113,65,48,114,58,0,0,32,0,66,3,136,34,0,66,0,82,13,0,11,11,32,1,11,194,2,1,4,127,35,0,65,208,1,107,34,1,36,0,32,1,65,0,54,2,204,1,32,1,65,160,1,106,65,0,65,40,16,14,26,32,1,32,1,40,2,204,1,54,2,200,1,2,64,65,0,32,1,65,200,1,106,32,1,65,208,0,106,32,1,65,160,1,106,16,29,65,0,72,13,0,32,0,40,2,76,65,0,78,4,64,65,1,33,3,11,32,0,40,2,0,33,2,32,0,44,0,74,65,0,76,4,64,32,0,32,2,65,95,113,54,2,0,11,32,2,65,32,113,33,4,2,127,32,0,40,2,48,4,64,32,0,32,1,65,200,1,106,32,1,65,208,0,106,32,1,65,160,1,106,16,29,12,1,11,32,0,65,208,0,54,2,48,32,0,32,1,65,208,0,106,54,2,16,32,0,32,1,54,2,28,32,0,32,1,54,2,20,32,0,40,2,44,33,2,32,0,32,1,54,2,44,32,0,32,1,65,200,1,106,32,1,65,208,0,106,32,1,65,160,1,106,16,29,32,2,69,13,0,26,32,0,65,0,65,0,32,0,40,2,36,17,2,0,26,32,0,65,0,54,2,48,32,0,32,2,54,2,44,32,0,65,0,54,2,28,32,0,65,0,54,2,16,32,0,40,2,20,26,32,0,65,0,54,2,20,65,0,11,26,32,0,32,4,32,0,40,2,0,114,54,2,0,32,3,69,13,0,11,32,1,65,208,1,106,36,0,11,215,3,2,2,127,2,126,35,0,65,32,107,34,2,36,0,2,64,32,1,66,255,255,255,255,255,255,255,255,255,0,131,34,5,66,128,128,128,128,128,128,192,255,67,124,32,5,66,128,128,128,128,128,128,192,128,188,127,124,84,4,64,32,1,66,4,134,32,0,66,60,136,132,33,4,32,0,66,255,255,255,255,255,255,255,255,15,131,34,0,66,129,128,128,128,128,128,128,128,8,90,4,64,32,4,66,129,128,128,128,128,128,128,128,192,0,124,33,4,12,2,11,32,4,66,128,128,128,128,128,128,128,128,64,125,33,4,32,0,66,128,128,128,128,128,128,128,128,8,133,66,0,82,13,1,32,4,66,1,131,32,4,124,33,4,12,1,11,32,0,80,32,5,66,128,128,128,128,128,128,192,255,255,0,84,32,5,66,128,128,128,128,128,128,192,255,255,0,81,27,69,4,64,32,1,66,4,134,32,0,66,60,136,132,66,255,255,255,255,255,255,255,3,131,66,128,128,128,128,128,128,128,252,255,0,132,33,4,12,1,11,66,128,128,128,128,128,128,128,248,255,0,33,4,32,5,66,255,255,255,255,255,255,191,255,195,0,86,13,0,66,0,33,4,32,5,66,48,136,167,34,3,65,145,247,0,73,13,0,32,2,65,16,106,32,0,32,1,66,255,255,255,255,255,255,63,131,66,128,128,128,128,128,128,192,0,132,34,4,32,3,65,255,136,127,106,16,76,32,2,32,0,32,4,65,129,248,0,32,3,107,16,75,32,2,41,3,8,66,4,134,32,2,41,3,0,34,0,66,60,136,132,33,4,32,2,41,3,16,32,2,41,3,24,132,66,0,82,173,32,0,66,255,255,255,255,255,255,255,255,15,131,132,34,0,66,129,128,128,128,128,128,128,128,8,90,4,64,32,4,66,1,124,33,4,12,1,11,32,0,66,128,128,128,128,128,128,128,128,8,133,66,0,82,13,0,32,4,66,1,131,32,4,124,33,4,11,32,2,65,32,106,36,0,32,4,32,1,66,128,128,128,128,128,128,128,128,128,127,131,132,191,11,80,1,1,126,2,64,32,3,65,192,0,113,4,64,32,2,32,3,65,64,106,173,136,33,1,66,0,33,2,12,1,11,32,3,69,13,0,32,2,65,192,0,32,3,107,173,134,32,1,32,3,173,34,4,136,132,33,1,32,2,32,4,136,33,2,11,32,0,32,1,55,3,0,32,0,32,2,55,3,8,11,80,1,1,126,2,64,32,3,65,192,0,113,4,64,32,1,32,3,65,64,106,173,134,33,2,66,0,33,1,12,1,11,32,3,69,13,0,32,2,32,3,173,34,4,134,32,1,65,192,0,32,3,107,173,136,132,33,2,32,1,32,4,134,33,1,11,32,0,32,1,55,3,0,32,0,32,2,55,3,8,11,189,1,1,1,127,32,1,65,0,71,33,2,2,64,2,64,2,64,2,64,32,1,69,13,0,32,0,65,3,113,69,13,0,3,64,32,0,45,0,0,69,13,2,32,0,65,1,106,33,0,32,1,65,127,106,34,1,65,0,71,33,2,32,1,69,13,1,32,0,65,3,113,13,0,11,11,32,2,69,13,1,11,32,0,45,0,0,69,13,1,2,64,32,1,65,4,79,4,64,3,64,32,0,40,2,0,34,2,65,127,115,32,2,65,255,253,251,119,106,113,65,128,129,130,132,120,113,13,2,32,0,65,4,106,33,0,32,1,65,124,106,34,1,65,3,75,13,0,11,11,32,1,69,13,1,11,3,64,32,0,45,0,0,69,13,2,32,0,65,1,106,33,0,32,1,65,127,106,34,1,13,0,11,11,65,0,15,11,32,0,11,94,0,32,0,32,1,40,2,0,54,2,0,32,0,32,1,40,2,4,54,2,4,32,0,32,1,40,2,16,54,2,16,32,0,32,1,40,2,20,54,2,20,32,0,32,1,40,2,24,54,2,24,32,0,32,1,40,2,28,54,2,28,32,0,32,1,40,2,32,54,2,32,32,0,32,1,40,2,8,54,2,8,32,0,32,1,40,2,12,54,2,12,32,0,11,137,2,0,2,64,32,0,4,127,32,1,65,255,0,77,13,1,2,64,65,208,20,40,2,0,40,2,0,69,4,64,32,1,65,128,127,113,65,128,191,3,70,13,3,12,1,11,32,1,65,255,15,77,4,64,32,0,32,1,65,63,113,65,128,1,114,58,0,1,32,0,32,1,65,6,118,65,192,1,114,58,0,0,65,2,15,11,32,1,65,128,176,3,79,65,0,32,1,65,128,64,113,65,128,192,3,71,27,69,4,64,32,0,32,1,65,63,113,65,128,1,114,58,0,2,32,0,32,1,65,12,118,65,224,1,114,58,0,0,32,0,32,1,65,6,118,65,63,113,65,128,1,114,58,0,1,65,3,15,11,32,1,65,128,128,124,106,65,255,255,63,77,4,64,32,0,32,1,65,63,113,65,128,1,114,58,0,3,32,0,32,1,65,18,118,65,240,1,114,58,0,0,32,0,32,1,65,6,118,65,63,113,65,128,1,114,58,0,2,32,0,32,1,65,12,118,65,63,113,65,128,1,114,58,0,1,65,4,15,11,11,65,168,22,65,25,54,2,0,65,127,5,65,1,11,15,11,32,0,32,1,58,0,0,65,1,11,191,4,1,5,127,35,0,65,208,1,107,34,2,36,0,32,2,66,1,55,3,8,2,64,32,1,65,3,116,34,6,69,13,0,32,2,65,8,54,2,16,32,2,65,8,54,2,20,65,8,34,1,33,5,65,2,33,4,3,64,32,2,65,16,106,32,4,65,2,116,106,32,1,34,3,32,5,65,8,106,106,34,1,54,2,0,32,4,65,1,106,33,4,32,3,33,5,32,1,32,6,73,13,0,11,2,64,32,0,32,6,106,65,120,106,34,3,32,0,77,4,64,65,1,33,4,65,1,33,1,12,1,11,65,1,33,4,65,1,33,1,3,64,2,127,32,4,65,3,113,65,3,70,4,64,32,0,32,1,32,2,65,16,106,16,30,32,2,65,8,106,65,2,16,26,32,1,65,2,106,12,1,11,2,64,32,2,65,16,106,32,1,65,127,106,34,5,65,2,116,106,40,2,0,32,3,32,0,107,79,4,64,32,0,32,2,65,8,106,32,1,65,0,32,2,65,16,106,16,25,12,1,11,32,0,32,1,32,2,65,16,106,16,30,11,32,1,65,1,70,4,64,32,2,65,8,106,65,1,16,24,65,0,12,1,11,32,2,65,8,106,32,5,16,24,65,1,11,33,1,32,2,32,2,40,2,8,65,1,114,34,4,54,2,8,32,0,65,8,106,34,0,32,3,73,13,0,11,11,32,0,32,2,65,8,106,32,1,65,0,32,2,65,16,106,16,25,3,64,2,127,2,64,2,64,2,64,32,1,65,1,71,13,0,32,4,65,1,71,13,0,32,2,40,2,12,13,1,12,5,11,32,1,65,1,74,13,1,11,32,2,65,8,106,2,127,32,2,40,2,8,65,127,106,104,34,3,69,4,64,32,2,40,2,12,104,34,3,65,32,106,65,0,32,3,27,12,1,11,32,3,11,34,3,16,26,32,2,40,2,8,33,4,32,1,32,3,106,12,1,11,32,2,65,8,106,65,2,16,24,32,2,32,2,40,2,8,65,7,115,54,2,8,32,2,65,8,106,65,1,16,26,32,0,65,120,106,34,5,32,2,65,16,106,32,1,65,126,106,34,3,65,2,116,106,40,2,0,107,32,2,65,8,106,32,1,65,127,106,65,1,32,2,65,16,106,16,25,32,2,65,8,106,65,1,16,24,32,2,32,2,40,2,8,65,1,114,34,4,54,2,8,32,5,32,2,65,8,106,32,3,65,1,32,2,65,16,106,16,25,32,3,11,33,1,32,0,65,120,106,33,0,12,0,0,11,0,11,32,2,65,208,1,106,36,0,11,115,1,1,127,65,2,33,1,2,127,32,0,65,43,16,22,69,4,64,32,0,45,0,0,65,242,0,71,33,1,11,32,1,65,128,1,114,11,32,1,32,0,65,248,0,16,22,27,34,1,65,128,128,32,114,32,1,32,0,65,229,0,16,22,27,34,1,32,1,65,192,0,114,32,0,45,0,0,34,0,65,242,0,70,27,34,1,65,128,4,114,32,1,32,0,65,247,0,70,27,34,1,65,128,8,114,32,1,32,0,65,225,0,70,27,11,58,0,32,0,32,4,54,2,24,32,0,32,2,54,2,4,32,0,32,1,54,2,0,32,0,32,5,54,2,20,32,0,32,5,54,2,32,32,0,32,4,54,2,28,32,0,32,3,54,2,16,32,0,66,0,55,2,8,11,237,2,1,6,127,35,0,65,32,107,34,3,36,0,32,3,32,0,40,2,28,34,5,54,2,16,32,0,40,2,20,33,4,32,3,32,2,54,2,28,32,3,32,1,54,2,24,32,3,32,4,32,5,107,34,1,54,2,20,32,1,32,2,106,33,5,65,2,33,6,32,3,65,16,106,33,1,2,127,2,64,2,64,2,127,65,0,32,0,40,2,60,32,3,65,16,106,65,2,32,3,65,12,106,16,0,34,4,69,13,0,26,65,168,22,32,4,54,2,0,65,127,11,69,4,64,3,64,32,5,32,3,40,2,12,34,4,70,13,2,32,4,65,127,76,13,3,32,1,65,8,106,32,1,32,4,32,1,40,2,4,34,7,75,34,8,27,34,1,32,4,32,7,65,0,32,8,27,107,34,7,32,1,40,2,0,106,54,2,0,32,1,32,1,40,2,4,32,7,107,54,2,4,32,5,32,4,107,33,5,2,127,65,0,32,0,40,2,60,32,1,32,6,32,8,107,34,6,32,3,65,12,106,16,0,34,4,69,13,0,26,65,168,22,32,4,54,2,0,65,127,11,69,13,0,11,11,32,3,65,127,54,2,12,32,5,65,127,71,13,1,11,32,0,32,0,40,2,44,34,1,54,2,28,32,0,32,1,54,2,20,32,0,32,1,32,0,40,2,48,106,54,2,16,32,2,12,1,11,32,0,65,0,54,2,28,32,0,66,0,55,3,16,32,0,32,0,40,2,0,65,32,114,54,2,0,65,0,32,6,65,2,70,13,0,26,32,2,32,1,40,2,4,107,11,33,0,32,3,65,32,106,36,0,32,0,11,9,0,32,0,40,2,60,16,1,11,124,1,2,127,32,0,32,0,45,0,74,34,1,65,127,106,32,1,114,58,0,74,32,0,40,2,20,32,0,40,2,28,75,4,64,32,0,65,0,65,0,32,0,40,2,36,17,2,0,26,11,32,0,65,0,54,2,28,32,0,66,0,55,3,16,32,0,40,2,0,34,1,65,4,113,4,64,32,0,32,1,65,32,114,54,2,0,65,127,15,11,32,0,32,0,40,2,44,32,0,40,2,48,106,34,2,54,2,8,32,0,32,2,54,2,4,32,1,65,27,116,65,31,117,11,69,1,1,127,35,0,65,16,107,34,3,36,0,32,0,40,2,60,32,1,167,32,1,66,32,136,167,32,2,65,255,1,113,32,3,65,8,106,16,8,34,0,4,64,65,168,22,32,0,54,2,0,11,32,3,41,3,8,33,1,32,3,65,16,106,36,0,32,1,11,219,2,1,2,127,35,0,65,32,107,34,3,36,0,2,127,2,64,2,64,65,247,9,32,1,44,0,0,16,22,69,4,64,65,168,22,65,28,54,2,0,12,1,11,65,152,9,16,36,34,2,13,1,11,65,0,12,1,11,32,2,65,0,65,144,1,16,14,26,32,1,65,43,16,22,69,4,64,32,2,65,8,65,4,32,1,45,0,0,65,242,0,70,27,54,2,0,11,2,64,32,1,45,0,0,65,225,0,71,4,64,32,2,40,2,0,33,1,12,1,11,32,0,65,3,65,0,16,2,34,1,65,128,8,113,69,4,64,32,3,32,1,65,128,8,114,54,2,16,32,0,65,4,32,3,65,16,106,16,2,26,11,32,2,32,2,40,2,0,65,128,1,114,34,1,54,2,0,11,32,2,65,255,1,58,0,75,32,2,65,128,8,54,2,48,32,2,32,0,54,2,60,32,2,32,2,65,152,1,106,54,2,44,2,64,32,1,65,8,113,13,0,32,3,32,3,65,24,106,54,2,0,32,0,65,147,168,1,32,3,16,7,13,0,32,2,65,10,58,0,75,11,32,2,65,25,54,2,40,32,2,65,26,54,2,36,32,2,65,27,54,2,32,32,2,65,28,54,2,12,65,176,22,40,2,0,69,4,64,32,2,65,127,54,2,76,11,32,2,65,244,22,40,2,0,54,2,56,65,244,22,40,2,0,34,0,4,64,32,0,32,2,54,2,52,11,65,244,22,32,2,54,2,0,32,2,11,33,0,32,3,65,32,106,36,0,32,0,11,246,1,1,4,127,35,0,65,32,107,34,3,36,0,32,3,32,1,54,2,16,32,3,32,2,32,0,40,2,48,34,4,65,0,71,107,54,2,20,32,0,40,2,44,33,5,32,3,32,4,54,2,28,32,3,32,5,54,2,24,2,64,2,64,2,127,2,127,65,0,32,0,40,2,60,32,3,65,16,106,65,2,32,3,65,12,106,16,6,34,4,69,13,0,26,65,168,22,32,4,54,2,0,65,127,11,4,64,32,3,65,127,54,2,12,65,127,12,1,11,32,3,40,2,12,34,4,65,0,74,13,1,32,4,11,33,2,32,0,32,0,40,2,0,32,2,65,48,113,65,16,115,114,54,2,0,12,1,11,32,4,32,3,40,2,20,34,6,77,4,64,32,4,33,2,12,1,11,32,0,32,0,40,2,44,34,5,54,2,4,32,0,32,5,32,4,32,6,107,106,54,2,8,32,0,40,2,48,69,13,0,32,0,32,5,65,1,106,54,2,4,32,1,32,2,106,65,127,106,32,5,45,0,0,58,0,0,11,32,3,65,32,106,36,0,32,2,11,5,0,65,168,22,11,222,3,2,8,127,1,124,35,0,65,16,107,34,1,36,0,32,0,65,16,106,65,4,65,1,65,128,8,16,44,34,2,16,16,26,32,0,65,20,106,65,4,65,1,32,2,16,16,26,32,0,65,24,106,65,4,65,1,32,2,16,16,26,32,0,44,0,28,32,2,16,48,32,0,40,2,20,16,27,33,9,32,1,65,0,54,2,12,32,0,40,2,16,34,3,65,1,72,33,4,2,127,32,9,68,0,0,0,0,0,0,240,191,160,34,9,153,68,0,0,0,0,0,0,224,65,99,4,64,32,9,170,12,1,11,65,128,128,128,128,120,11,33,5,2,64,32,4,13,0,32,5,65,0,74,4,64,3,64,32,0,40,2,40,32,6,65,2,116,106,40,2,0,40,2,28,33,7,32,1,65,0,54,2,12,65,0,33,4,3,64,2,64,32,7,32,4,65,2,116,106,34,3,40,2,0,34,8,69,13,0,32,8,45,0,8,4,64,32,1,65,1,54,2,12,32,1,65,12,106,65,4,65,1,32,2,16,16,26,32,0,45,0,28,4,64,32,1,32,3,40,2,0,40,2,28,54,2,8,32,1,65,8,106,65,4,65,1,32,2,16,16,26,12,2,11,32,1,32,3,40,2,0,34,3,40,2,28,54,2,8,32,1,32,3,40,2,32,54,2,4,32,1,65,8,106,65,4,65,1,32,2,16,16,26,32,1,65,4,106,65,4,65,1,32,2,16,16,26,12,1,11,32,1,65,0,54,2,12,32,1,65,12,106,65,4,65,1,32,2,16,16,26,32,1,32,3,40,2,0,34,3,40,2,12,54,2,8,32,1,32,3,40,2,16,54,2,4,32,1,65,8,106,65,4,65,1,32,2,16,16,26,32,1,65,4,106,65,4,65,1,32,2,16,16,26,11,32,4,65,1,106,34,4,32,5,71,13,0,11,32,6,65,1,106,34,6,32,0,40,2,16,72,13,0,12,2,0,11,0,11,65,0,33,4,32,1,65,0,54,2,12,3,64,32,4,65,1,106,34,4,32,3,72,13,0,11,11,32,2,16,46,32,1,65,16,106,36,0,11,218,1,1,2,127,2,64,32,1,65,255,1,113,34,3,4,64,32,0,65,3,113,4,64,3,64,32,0,45,0,0,34,2,69,13,3,32,2,32,1,65,255,1,113,70,13,3,32,0,65,1,106,34,0,65,3,113,13,0,11,11,2,64,32,0,40,2,0,34,2,65,127,115,32,2,65,255,253,251,119,106,113,65,128,129,130,132,120,113,13,0,32,3,65,129,130,132,8,108,33,3,3,64,32,2,32,3,115,34,2,65,127,115,32,2,65,255,253,251,119,106,113,65,128,129,130,132,120,113,13,1,32,0,40,2,4,33,2,32,0,65,4,106,33,0,32,2,65,255,253,251,119,106,32,2,65,127,115,113,65,128,129,130,132,120,113,69,13,0,11,11,3,64,32,0,34,2,45,0,0,34,3,4,64,32,2,65,1,106,33,0,32,3,32,1,65,255,1,113,71,13,1,11,11,32,2,15,11,32,0,16,55,32,0,106,15,11,32,0,11,6,0,32,0,16,113,11,6,0,32,0,16,90,11,98,1,3,127,35,0,65,16,107,34,3,36,0,65,127,32,2,65,2,116,32,2,65,255,255,255,255,3,113,32,2,71,27,16,10,33,5,32,2,65,1,78,4,64,3,64,32,0,32,1,32,3,65,12,106,32,4,16,49,32,5,32,4,65,2,116,106,32,3,40,2,12,54,2,0,32,4,65,1,106,34,4,32,2,71,13,0,11,11,32,3,65,16,106,36,0,32,5,11,44,2,1,127,1,125,35,0,65,16,107,34,2,36,0,32,0,32,1,32,2,65,12,106,65,127,16,49,32,2,42,2,12,33,3,32,2,65,16,106,36,0,32,3,11,172,1,1,4,127,65,127,32,3,65,2,116,32,3,65,255,255,255,255,3,113,32,3,71,27,16,10,33,10,2,64,32,3,65,1,72,13,0,65,127,32,4,65,2,116,32,4,65,255,255,255,255,3,113,32,4,71,27,33,11,32,4,65,1,72,4,64,3,64,32,10,32,9,65,2,116,106,32,11,16,10,54,2,0,32,9,65,1,106,34,9,32,3,71,13,0,11,12,1,11,32,4,65,2,116,33,12,3,64,32,10,32,9,65,2,116,106,32,11,16,10,32,1,32,4,32,9,108,65,2,116,106,32,12,16,15,54,2,0,32,9,65,1,106,34,9,32,3,71,13,0,11,11,32,0,32,10,32,2,32,3,32,4,32,5,32,6,32,7,32,8,16,104,11,17,0,65,48,16,10,32,0,32,1,32,2,32,3,178,16,127,11,19,0,32,1,65,0,54,2,0,32,1,32,0,40,2,28,54,2,4,11,19,0,32,0,65,1,58,0,8,32,0,32,0,40,2,20,54,2,28,11,153,7,3,20,127,19,125,1,124,32,0,40,2,4,34,4,40,2,28,33,5,2,64,32,4,40,2,32,34,18,65,1,72,4,64,12,1,11,32,4,40,2,4,33,11,32,4,40,2,0,33,15,32,4,40,2,12,33,19,32,4,40,2,8,33,12,32,5,65,127,106,33,20,32,5,183,33,43,3,64,32,0,32,19,32,13,65,2,116,106,34,4,40,2,0,34,21,16,23,67,0,0,0,0,33,25,67,0,0,0,0,33,36,67,0,0,0,0,33,37,67,0,0,0,0,33,38,65,0,33,9,67,0,0,0,0,33,39,67,0,0,0,0,33,40,32,5,65,2,78,4,64,32,4,40,2,0,65,2,116,34,22,32,15,32,12,40,2,0,34,16,65,2,116,106,40,2,0,106,42,2,0,33,26,32,0,42,2,20,33,27,67,0,0,0,0,33,29,65,0,33,6,65,1,33,14,3,64,32,26,33,42,32,27,32,5,32,6,34,4,107,34,17,178,148,32,11,32,16,65,2,116,106,42,2,0,34,26,147,32,17,65,127,106,178,34,41,149,33,27,32,29,32,4,178,148,32,26,146,32,4,65,1,106,34,6,178,34,30,149,33,29,65,0,33,7,67,0,0,0,0,33,24,2,64,32,15,32,12,32,6,65,2,116,106,40,2,0,34,16,65,2,116,34,23,106,40,2,0,32,22,106,42,2,0,34,26,32,42,147,187,68,141,237,181,160,247,198,176,62,99,13,0,3,64,32,24,32,11,32,12,32,7,65,2,116,106,40,2,0,65,2,116,106,42,2,0,32,29,147,34,24,32,24,148,146,33,24,32,7,65,1,106,34,7,32,14,71,13,0,11,32,24,32,30,149,33,30,67,0,0,0,0,33,24,2,64,32,6,32,5,78,13,0,32,11,32,23,106,42,2,0,32,27,147,34,24,32,24,148,67,0,0,0,0,146,33,24,32,4,65,2,106,34,7,32,5,70,13,0,3,64,32,24,32,11,32,12,32,7,65,2,116,106,40,2,0,65,2,116,106,42,2,0,32,27,147,34,24,32,24,148,146,33,24,32,7,65,1,106,34,7,32,5,71,13,0,11,11,32,0,42,2,24,32,30,32,4,183,68,0,0,0,0,0,0,240,63,160,32,43,163,182,148,147,32,24,32,41,149,34,24,32,17,183,68,0,0,0,0,0,0,240,191,160,32,43,163,182,148,147,34,41,32,25,94,65,1,115,13,0,32,26,32,42,146,67,0,0,0,63,148,33,36,32,41,33,25,32,30,33,37,32,24,33,38,32,4,33,9,32,29,33,39,32,27,33,40,11,32,14,65,1,106,33,14,32,6,32,20,71,13,0,11,11,32,25,32,28,94,65,1,115,69,4,64,32,37,33,31,32,38,33,32,32,39,33,33,32,40,33,34,32,36,33,35,32,21,33,10,32,25,33,28,32,9,33,8,11,32,13,65,1,106,34,13,32,18,71,13,0,11,11,32,28,32,3,93,65,1,115,69,4,64,32,0,32,0,40,2,0,40,2,16,17,0,0,15,11,32,0,32,10,16,23,32,0,32,35,56,2,16,32,0,32,10,54,2,12,65,32,16,10,34,4,66,255,255,255,255,15,55,2,12,32,4,65,0,58,0,8,32,4,65,0,54,2,4,32,4,65,0,54,2,28,32,4,65,212,17,54,2,0,32,1,32,2,65,3,116,34,9,65,4,114,106,34,6,32,4,54,2,0,65,32,16,10,34,2,66,255,255,255,255,15,55,2,12,32,2,65,0,58,0,8,32,2,65,0,54,2,4,32,2,65,0,54,2,28,32,2,65,212,17,54,2,0,32,1,32,9,106,34,1,65,8,106,32,2,54,2,0,32,4,32,33,56,2,20,32,4,32,31,56,2,24,32,2,32,34,56,2,20,32,2,32,32,56,2,24,65,36,16,10,34,2,32,0,40,2,4,65,0,32,8,16,21,26,65,36,16,10,34,4,32,0,40,2,4,32,8,65,1,106,32,5,65,127,106,16,21,26,32,6,40,2,0,32,2,54,2,4,32,1,40,2,8,32,4,54,2,4,11,205,1,3,5,127,1,125,3,124,2,64,32,0,40,2,4,34,2,40,2,28,34,3,65,0,76,4,64,68,0,0,0,0,0,0,0,0,32,3,183,34,9,163,33,8,12,1,11,32,2,40,2,8,33,4,32,2,40,2,4,33,5,3,64,32,7,32,5,32,4,32,1,65,2,116,106,40,2,0,65,2,116,106,42,2,0,187,160,33,7,32,1,65,1,106,34,1,32,3,71,13,0,11,32,7,32,3,183,34,9,163,33,8,32,2,40,2,4,33,2,68,0,0,0,0,0,0,0,0,33,7,65,0,33,1,3,64,32,7,32,2,32,4,32,1,65,2,116,106,40,2,0,65,2,116,106,42,2,0,187,32,8,161,182,34,6,32,6,148,187,160,33,7,32,1,65,1,106,34,1,32,3,71,13,0,11,11,32,0,32,8,182,56,2,20,32,0,32,7,32,9,163,182,56,2,24,11,22,0,32,1,32,0,40,2,28,54,2,0,32,1,32,0,40,2,32,54,2,4,11,145,1,2,5,127,1,125,32,0,65,0,54,2,28,32,0,32,0,40,2,24,34,4,40,2,0,34,2,54,2,32,65,1,33,1,32,2,190,33,6,32,0,40,2,4,34,2,40,2,16,34,5,65,1,74,4,64,3,64,32,4,32,1,65,2,116,106,34,3,42,2,0,32,6,94,65,1,115,69,4,64,32,0,32,1,178,56,2,28,32,0,32,3,40,2,0,34,3,54,2,32,32,3,190,33,6,11,32,1,65,1,106,34,1,32,5,71,13,0,11,11,32,2,40,2,28,33,1,32,0,65,1,58,0,8,32,0,32,6,32,1,178,149,56,2,32,11,172,3,0,32,0,40,2,16,65,0,76,4,64,65,128,9,16,33,15,11,32,0,40,2,20,65,0,76,4,64,65,203,8,16,33,15,11,32,0,40,2,32,65,1,76,4,64,65,134,8,16,33,15,11,32,0,32,5,54,2,24,32,0,32,4,54,2,8,32,0,32,3,54,2,0,32,0,32,6,58,0,28,32,0,32,7,54,2,12,2,64,32,6,69,4,64,65,0,33,6,3,64,65,32,16,10,34,3,32,0,40,2,20,32,0,40,2,12,32,0,40,2,32,32,0,42,2,36,32,0,45,0,28,16,54,32,0,40,2,40,32,6,65,2,116,106,32,3,54,2,0,32,6,65,1,106,34,6,32,0,40,2,16,72,13,0,11,12,1,11,32,0,65,1,54,2,24,65,0,33,6,3,64,65,32,16,10,34,3,32,0,40,2,20,32,0,40,2,12,32,0,40,2,32,32,0,42,2,36,32,0,45,0,28,16,52,32,0,40,2,40,32,6,65,2,116,106,32,3,54,2,0,32,6,65,1,106,34,6,32,0,40,2,16,72,13,0,11,11,65,36,16,10,34,3,32,1,32,2,32,0,40,2,24,32,0,40,2,0,32,0,40,2,8,16,82,32,0,32,3,54,2,44,65,160,22,32,8,65,127,106,173,55,3,0,65,127,32,0,40,2,0,34,1,65,2,116,32,1,65,255,255,255,255,3,113,32,1,71,27,16,10,33,1,32,0,40,2,16,65,1,78,4,64,65,0,33,6,3,64,65,36,16,10,34,3,32,0,40,2,44,16,78,34,2,32,1,32,0,40,2,0,34,4,32,4,16,65,32,0,40,2,40,32,6,65,2,116,106,40,2,0,34,4,32,2,32,4,40,2,0,40,2,8,17,3,0,32,2,66,0,55,2,8,32,3,16,11,32,6,65,1,106,34,6,32,0,40,2,16,72,13,0,11,11,32,1,16,11,11,224,11,3,30,127,13,125,1,124,32,0,40,2,4,34,6,40,2,28,33,10,32,6,40,2,32,33,25,32,6,40,2,4,33,26,32,6,40,2,0,33,12,32,6,40,2,12,33,31,32,6,40,2,8,33,13,65,127,32,6,40,2,16,34,11,65,2,116,34,6,32,11,65,255,255,255,255,3,113,32,11,71,27,34,5,16,10,33,18,32,5,16,10,33,19,32,11,65,1,78,4,64,32,18,65,0,32,6,16,14,26,32,19,65,0,32,6,16,14,26,11,32,5,16,10,33,14,32,5,16,10,33,15,32,5,16,10,33,16,32,5,16,10,33,20,32,25,65,1,78,4,64,32,10,65,127,106,33,27,32,11,65,2,116,33,8,32,10,183,33,47,32,11,65,1,72,33,32,3,64,32,31,32,28,65,2,116,106,34,29,40,2,0,33,21,2,64,32,32,69,4,64,65,0,33,4,32,14,65,0,32,8,16,14,33,33,32,15,65,0,32,8,16,14,33,17,32,0,32,21,16,23,32,16,65,0,32,8,16,14,33,22,32,20,65,0,32,8,16,14,32,0,40,2,24,32,8,16,15,33,23,67,0,0,0,0,33,35,65,0,33,6,67,0,0,0,0,33,38,67,0,0,0,0,33,39,67,0,0,0,0,33,40,32,10,65,1,76,13,1,3,64,32,22,2,127,32,26,32,13,32,4,34,5,65,2,116,106,40,2,0,65,2,116,34,24,106,34,7,42,2,0,34,34,139,67,0,0,0,79,93,4,64,32,34,168,12,1,11,65,128,128,128,128,120,11,65,2,116,106,34,4,32,4,42,2,0,67,0,0,128,63,146,56,2,0,32,23,2,127,32,7,42,2,0,34,34,139,67,0,0,0,79,93,4,64,32,34,168,12,1,11,65,128,128,128,128,120,11,65,2,116,106,34,4,32,4,42,2,0,67,0,0,128,191,146,56,2,0,2,64,32,29,40,2,0,65,2,116,34,7,32,12,32,13,32,5,65,1,106,34,4,65,2,116,106,40,2,0,65,2,116,106,40,2,0,106,42,2,0,34,43,32,12,32,24,106,40,2,0,32,7,106,42,2,0,34,44,147,187,68,141,237,181,160,247,198,176,62,99,13,0,32,4,178,33,36,67,0,0,0,0,33,37,65,0,33,7,3,64,32,37,32,22,32,7,65,2,116,106,42,2,0,32,36,149,34,34,32,34,148,146,33,37,32,7,65,1,106,34,7,32,11,71,13,0,11,32,10,32,5,65,127,115,106,178,33,36,67,0,0,0,0,33,34,65,0,33,7,3,64,32,34,32,23,32,7,65,2,116,106,42,2,0,32,36,149,34,34,32,34,148,146,33,34,32,7,65,1,106,34,7,32,11,71,13,0,11,32,0,42,2,20,67,0,0,128,63,32,37,147,34,37,32,5,183,68,0,0,0,0,0,0,240,63,160,32,47,163,182,148,147,67,0,0,128,63,32,34,147,34,36,32,10,32,5,107,183,68,0,0,0,0,0,0,240,191,160,32,47,163,182,148,147,34,34,32,35,94,69,13,0,32,33,32,22,32,8,16,15,26,32,17,32,23,32,8,16,15,26,32,43,32,44,146,67,0,0,0,63,148,33,40,32,37,33,39,32,36,33,38,32,5,33,6,32,34,33,35,11,32,4,32,27,71,13,0,11,12,1,11,32,0,32,21,16,23,32,20,32,0,40,2,24,32,8,16,15,33,17,67,0,0,0,0,33,35,65,0,33,4,65,0,33,6,67,0,0,0,0,33,38,67,0,0,0,0,33,39,67,0,0,0,0,33,40,32,10,65,1,76,13,0,3,64,32,16,2,127,32,26,32,13,32,4,34,5,65,2,116,106,40,2,0,65,2,116,34,24,106,34,7,42,2,0,34,34,139,67,0,0,0,79,93,4,64,32,34,168,12,1,11,65,128,128,128,128,120,11,65,2,116,106,34,4,32,4,42,2,0,67,0,0,128,63,146,56,2,0,32,17,2,127,32,7,42,2,0,34,34,139,67,0,0,0,79,93,4,64,32,34,168,12,1,11,65,128,128,128,128,120,11,65,2,116,106,34,4,32,4,42,2,0,67,0,0,128,191,146,56,2,0,2,64,32,29,40,2,0,65,2,116,34,7,32,12,32,13,32,5,65,1,106,34,4,65,2,116,106,40,2,0,65,2,116,106,40,2,0,106,42,2,0,34,37,32,12,32,24,106,40,2,0,32,7,106,42,2,0,34,36,147,187,68,141,237,181,160,247,198,176,62,99,13,0,32,0,42,2,20,32,5,183,68,0,0,0,0,0,0,240,63,160,32,47,163,182,147,32,10,32,5,107,183,68,0,0,0,0,0,0,240,191,160,32,47,163,182,147,34,34,32,35,94,65,1,115,13,0,32,14,32,16,32,8,16,15,26,32,15,32,17,32,8,16,15,26,32,37,32,36,146,67,0,0,0,63,148,33,40,67,0,0,128,63,33,39,67,0,0,128,63,33,38,32,5,33,6,32,34,33,35,11,32,4,32,27,71,13,0,11,11,32,35,32,41,94,65,1,115,69,4,64,32,18,32,14,32,8,16,15,26,32,19,32,15,32,8,16,15,26,32,38,33,45,32,39,33,46,32,21,33,9,32,35,33,41,32,6,33,30,32,40,33,42,11,32,28,65,1,106,34,28,32,25,71,13,0,11,11,32,0,32,9,16,23,2,64,32,41,32,3,93,65,1,115,69,4,64,32,0,32,0,40,2,0,40,2,16,17,0,0,12,1,11,32,0,32,42,56,2,16,32,0,32,9,54,2,12,65,36,16,10,34,9,66,255,255,255,255,15,55,2,12,32,9,65,0,58,0,8,32,9,65,0,54,2,4,32,9,66,128,128,128,252,11,55,2,28,32,9,65,176,17,54,2,0,32,1,32,2,65,3,116,34,2,65,4,114,106,34,5,32,9,54,2,0,65,36,16,10,34,4,66,255,255,255,255,15,55,2,12,32,4,65,0,58,0,8,32,4,65,0,54,2,4,32,4,66,128,128,128,252,11,55,2,28,32,4,65,176,17,54,2,0,32,1,32,2,106,34,6,32,4,54,2,8,32,9,32,18,54,2,24,32,9,32,46,56,2,20,32,4,32,19,54,2,24,32,4,32,45,56,2,20,65,36,16,10,34,2,32,0,40,2,4,65,0,32,30,16,21,26,65,36,16,10,34,1,32,0,40,2,4,32,30,65,1,106,32,10,65,127,106,16,21,26,32,5,40,2,0,32,2,54,2,4,32,6,40,2,8,32,1,54,2,4,11,32,0,40,2,24,34,1,4,64,32,1,16,11,11,32,0,65,0,54,2,24,32,14,16,11,32,15,16,11,32,16,16,11,32,20,16,11,11,140,2,2,7,127,2,125,32,0,40,2,4,34,1,40,2,28,33,3,32,1,40,2,8,33,6,32,0,65,127,32,1,40,2,16,34,2,65,2,116,34,4,32,2,65,255,255,255,255,3,113,32,2,71,27,16,10,34,5,54,2,24,32,2,65,1,78,4,64,32,5,65,0,32,4,16,14,26,11,32,3,65,1,78,4,64,32,1,40,2,4,33,4,65,0,33,1,3,64,32,5,2,127,32,4,32,6,32,1,65,2,116,106,40,2,0,65,2,116,106,42,2,0,34,8,139,67,0,0,0,79,93,4,64,32,8,168,12,1,11,65,128,128,128,128,120,11,65,2,116,106,34,7,32,7,42,2,0,67,0,0,128,63,146,56,2,0,32,1,65,1,106,34,1,32,3,71,13,0,11,11,2,64,32,2,65,1,72,4,64,67,0,0,0,0,33,8,12,1,11,32,3,178,33,9,67,0,0,0,0,33,8,65,0,33,1,3,64,32,8,32,5,32,1,65,2,116,106,42,2,0,32,9,149,34,8,32,8,148,146,33,8,32,1,65,1,106,34,1,32,2,71,13,0,11,11,32,0,67,0,0,128,63,32,8,147,56,2,20,11,30,1,1,127,32,0,65,176,17,54,2,0,32,0,40,2,24,34,1,4,64,32,1,16,11,11,32,0,16,11,11,35,1,1,127,32,0,65,176,17,54,2,0,32,0,40,2,24,34,1,4,64,32,1,16,11,32,0,65,0,54,2,24,11,32,0,11,27,1,2,125,65,127,32,0,42,2,0,34,2,32,1,42,2,0,34,3,92,32,2,32,3,93,27,11,93,1,2,127,65,32,16,10,34,4,34,3,66,255,255,255,255,15,55,2,12,32,3,65,0,58,0,8,32,3,65,0,54,2,4,32,3,65,0,54,2,28,32,3,65,212,17,54,2,0,32,1,65,2,116,34,1,32,0,40,2,28,106,32,4,54,2,0,32,0,40,2,28,32,1,106,40,2,0,34,0,65,1,58,0,8,32,0,32,2,56,2,28,11,100,1,2,127,65,32,16,10,34,5,34,4,66,255,255,255,255,15,55,2,12,32,4,65,0,58,0,8,32,4,65,0,54,2,4,32,4,65,0,54,2,28,32,4,65,212,17,54,2,0,32,1,65,2,116,34,1,32,0,40,2,28,106,32,5,54,2,0,32,0,40,2,28,32,1,106,40,2,0,34,0,32,3,56,2,16,32,0,32,2,54,2,12,32,0,65,0,58,0,8,11,186,4,1,8,127,65,127,32,0,40,2,20,34,2,65,2,116,32,2,65,255,255,255,255,3,113,32,2,71,27,16,10,33,6,65,36,16,10,34,7,32,1,65,0,32,1,40,2,28,65,127,106,16,21,33,8,65,32,16,10,34,3,34,2,66,255,255,255,255,15,55,2,12,32,2,65,0,58,0,8,32,2,65,0,54,2,4,32,2,65,0,54,2,28,32,2,65,212,17,54,2,0,32,0,40,2,28,32,3,54,2,0,32,0,40,2,28,34,2,40,2,0,32,7,54,2,4,32,2,40,2,0,34,2,32,2,40,2,0,40,2,12,17,0,0,2,64,32,0,40,2,12,34,3,65,1,72,13,0,2,64,32,0,40,2,28,34,2,40,2,0,69,13,0,32,2,40,2,0,33,2,32,3,65,1,76,4,64,32,2,32,2,40,2,0,40,2,16,17,0,0,12,1,11,32,2,40,2,4,34,3,40,2,28,32,0,40,2,16,76,4,64,32,2,32,2,40,2,0,40,2,16,17,0,0,12,1,11,32,3,32,6,32,1,40,2,20,32,0,40,2,20,16,28,32,0,40,2,28,34,2,40,2,0,34,3,32,2,65,0,32,0,42,2,24,32,3,40,2,0,40,2,8,17,5,0,32,0,40,2,28,40,2,0,40,2,4,34,2,40,2,8,34,3,69,13,0,32,3,16,11,32,2,65,0,54,2,8,11,32,0,40,2,12,34,4,65,2,72,13,0,65,1,33,2,3,64,2,64,32,0,40,2,28,34,3,32,2,65,1,116,34,9,65,126,106,65,124,113,106,40,2,0,34,5,69,13,0,32,5,45,0,8,13,0,32,3,32,2,65,2,116,34,5,106,40,2,0,33,3,32,9,65,1,114,32,4,78,4,64,32,3,32,3,40,2,0,40,2,16,17,0,0,12,1,11,32,3,40,2,4,34,4,40,2,28,32,0,40,2,16,76,4,64,32,3,32,3,40,2,0,40,2,16,17,0,0,12,1,11,32,4,32,6,32,1,40,2,20,32,0,40,2,20,16,28,32,0,40,2,28,34,3,32,5,106,40,2,0,34,4,32,3,32,2,32,0,42,2,24,32,4,40,2,0,40,2,8,17,5,0,32,0,40,2,28,32,5,106,40,2,0,40,2,4,34,3,40,2,8,34,4,69,13,0,32,4,16,11,32,3,65,0,54,2,8,11,32,2,65,1,106,34,2,32,0,40,2,12,34,4,72,13,0,11,11,32,6,16,11,32,8,66,0,55,2,8,32,7,16,11,11,253,5,2,9,127,1,124,35,0,65,32,107,34,2,36,0,32,0,66,0,55,2,32,32,0,65,0,54,2,12,32,0,65,16,106,65,4,65,131,8,16,44,34,4,16,18,32,0,65,20,106,65,4,32,4,16,18,32,0,65,24,106,65,4,32,4,16,18,32,0,65,28,106,65,1,32,4,16,18,32,0,40,2,20,16,27,33,10,32,0,65,0,54,2,44,32,0,65,127,32,0,40,2,16,34,1,65,2,116,32,1,65,255,255,255,255,3,113,32,1,71,27,16,10,54,2,40,2,127,32,10,68,0,0,0,0,0,0,240,191,160,34,10,153,68,0,0,0,0,0,0,224,65,99,4,64,32,10,170,12,1,11,65,128,128,128,128,120,11,33,6,2,64,32,0,45,0,28,4,64,32,1,65,0,76,13,1,3,64,65,32,16,10,34,1,32,0,40,2,20,32,0,40,2,12,32,0,40,2,32,32,0,42,2,36,32,0,45,0,28,16,52,32,0,40,2,40,32,3,65,2,116,106,32,1,54,2,0,32,3,65,1,106,34,3,32,0,40,2,16,34,1,72,13,0,11,12,1,11,32,1,65,0,76,13,0,3,64,65,32,16,10,34,1,32,0,40,2,20,32,0,40,2,12,32,0,40,2,32,32,0,42,2,36,32,0,45,0,28,16,54,32,0,40,2,40,32,3,65,2,116,106,32,1,54,2,0,32,3,65,1,106,34,3,32,0,40,2,16,34,1,72,13,0,11,11,65,127,32,6,65,2,116,34,9,32,6,65,255,255,255,255,3,113,32,6,71,27,16,10,33,7,32,2,65,127,54,2,28,32,2,65,0,54,2,24,32,2,65,0,54,2,20,32,2,65,0,54,2,16,32,2,65,0,54,2,12,32,2,65,0,54,2,8,2,64,32,1,65,1,72,13,0,32,6,65,1,78,4,64,3,64,65,0,33,3,32,7,65,0,32,9,16,14,34,8,65,1,54,2,0,65,1,33,1,3,64,2,64,32,1,69,13,0,32,2,65,28,106,65,4,32,4,16,18,32,2,40,2,28,34,1,65,1,75,13,0,32,1,65,1,107,69,4,64,32,0,45,0,28,4,64,32,2,65,16,106,65,4,32,4,16,18,32,0,40,2,40,32,5,65,2,116,106,40,2,0,32,3,32,2,42,2,16,16,110,12,2,11,32,2,65,12,106,65,4,32,4,16,18,32,2,65,8,106,65,4,32,4,16,18,32,0,40,2,40,32,5,65,2,116,106,40,2,0,32,3,32,2,42,2,12,32,2,42,2,8,16,114,12,1,11,32,8,32,3,65,3,116,34,1,65,4,114,106,65,1,54,2,0,32,1,32,8,106,65,1,54,2,8,32,2,65,24,106,65,4,32,4,16,18,32,2,65,20,106,65,4,32,4,16,18,32,0,40,2,40,32,5,65,2,116,106,40,2,0,34,1,32,3,32,2,40,2,24,32,2,42,2,20,32,1,40,2,0,40,2,12,17,5,0,11,32,6,32,3,65,1,106,34,3,71,4,64,32,8,32,3,65,2,116,106,40,2,0,33,1,12,1,11,11,32,5,65,1,106,34,5,32,0,40,2,16,72,13,0,12,2,0,11,0,11,3,64,32,7,65,0,32,9,16,14,65,1,54,2,0,32,5,65,1,106,34,5,32,1,72,13,0,11,11,32,4,16,46,32,7,16,11,32,2,65,32,106,36,0,11,104,1,2,127,65,36,16,10,34,5,34,4,66,255,255,255,255,15,55,2,12,32,4,65,0,58,0,8,32,4,65,0,54,2,4,32,4,66,128,128,128,252,11,55,2,28,32,4,65,176,17,54,2,0,32,1,65,2,116,34,1,32,0,40,2,28,106,32,5,54,2,0,32,0,40,2,28,32,1,106,40,2,0,34,0,65,1,58,0,8,32,0,32,3,56,2,32,32,0,32,2,56,2,28,11,104,1,2,127,65,36,16,10,34,5,34,4,66,255,255,255,255,15,55,2,12,32,4,65,0,58,0,8,32,4,65,0,54,2,4,32,4,66,128,128,128,252,11,55,2,28,32,4,65,176,17,54,2,0,32,1,65,2,116,34,1,32,0,40,2,28,106,32,5,54,2,0,32,0,40,2,28,32,1,106,40,2,0,34,0,32,3,56,2,16,32,0,32,2,54,2,12,32,0,65,0,58,0,8,11,190,4,1,8,127,65,127,32,0,40,2,20,34,2,65,2,116,32,2,65,255,255,255,255,3,113,32,2,71,27,16,10,33,6,65,36,16,10,34,7,32,1,65,0,32,1,40,2,28,65,127,106,16,21,33,8,65,36,16,10,34,3,34,2,66,255,255,255,255,15,55,2,12,32,2,65,0,58,0,8,32,2,65,0,54,2,4,32,2,66,128,128,128,252,11,55,2,28,32,2,65,176,17,54,2,0,32,0,40,2,28,32,3,54,2,0,32,0,40,2,28,34,2,40,2,0,32,7,54,2,4,32,2,40,2,0,34,2,32,2,40,2,0,40,2,12,17,0,0,2,64,32,0,40,2,12,34,3,65,1,72,13,0,2,64,32,0,40,2,28,34,2,40,2,0,69,13,0,32,2,40,2,0,33,2,32,3,65,1,76,4,64,32,2,32,2,40,2,0,40,2,16,17,0,0,12,1,11,32,2,40,2,4,34,3,40,2,28,32,0,40,2,16,76,4,64,32,2,32,2,40,2,0,40,2,16,17,0,0,12,1,11,32,3,32,6,32,1,40,2,20,32,0,40,2,20,16,28,32,0,40,2,28,34,2,40,2,0,34,3,32,2,65,0,32,0,42,2,24,32,3,40,2,0,40,2,8,17,5,0,32,0,40,2,28,40,2,0,40,2,4,34,2,40,2,8,34,3,69,13,0,32,3,16,11,32,2,65,0,54,2,8,11,32,0,40,2,12,34,4,65,2,72,13,0,65,1,33,2,3,64,2,64,32,0,40,2,28,34,3,32,2,65,1,116,34,9,65,126,106,65,124,113,106,40,2,0,34,5,69,13,0,32,5,45,0,8,13,0,32,3,32,2,65,2,116,34,5,106,40,2,0,33,3,32,9,65,1,114,32,4,78,4,64,32,3,32,3,40,2,0,40,2,16,17,0,0,12,1,11,32,3,40,2,4,34,4,40,2,28,32,0,40,2,16,76,4,64,32,3,32,3,40,2,0,40,2,16,17,0,0,12,1,11,32,4,32,6,32,1,40,2,20,32,0,40,2,20,16,28,32,0,40,2,28,34,3,32,5,106,40,2,0,34,4,32,3,32,2,32,0,42,2,24,32,4,40,2,0,40,2,8,17,5,0,32,0,40,2,28,32,5,106,40,2,0,40,2,4,34,3,40,2,8,34,4,69,13,0,32,4,16,11,32,3,65,0,54,2,8,11,32,2,65,1,106,34,2,32,0,40,2,12,34,4,72,13,0,11,11,32,6,16,11,32,8,66,0,55,2,8,32,7,16,11,11,80,1,2,127,32,1,40,2,28,40,2,0,34,3,45,0,8,69,4,64,3,64,32,3,32,2,32,4,32,3,40,2,0,40,2,20,17,2,0,33,4,32,1,40,2,28,32,4,65,2,116,106,40,2,0,34,3,45,0,8,69,13,0,11,11,32,3,32,0,32,3,40,2,0,40,2,24,17,3,0,11,7,0,32,0,17,7,0,11,9,0,32,1,32,0,17,0,0,11,3,0,0,11,6,0,32,0,36,0,11,16,0,35,0,32,0,107,65,112,113,34,0,36,0,32,0,11,4,0,35,0,11,4,0,66,0,11,4,0,65,0,11,129,1,1,5,127,32,0,65,200,16,54,2,0,32,0,40,2,28,34,1,4,64,2,64,32,0,40,2,12,34,2,65,0,74,4,64,3,64,32,1,32,3,65,2,116,34,5,106,40,2,0,34,4,4,64,32,4,32,4,40,2,0,40,2,4,17,0,0,32,0,40,2,28,32,5,106,65,0,54,2,0,32,0,40,2,12,33,2,32,0,40,2,28,33,1,11,32,3,65,1,106,34,3,32,2,72,13,0,11,32,1,69,13,1,11,32,1,16,11,11,32,0,65,0,54,2,28,11,32,0,11,127,0,32,0,65,0,54,2,44,32,0,32,4,56,2,36,32,0,32,3,54,2,32,32,0,32,2,54,2,20,32,0,32,1,54,2,16,32,0,65,127,32,1,65,2,116,32,1,65,255,255,255,255,3,113,32,1,71,27,16,10,34,3,54,2,40,65,1,33,2,2,64,32,1,65,1,72,13,0,32,3,65,0,54,2,0,32,1,65,1,70,13,0,3,64,32,0,40,2,40,32,2,65,2,116,106,65,0,54,2,0,32,2,65,1,106,34,2,32,1,71,13,0,11,11,32,0,11,3,0,1,11,11,227,9,26,0,65,128,8,11,148,2,119,98,0,114,98,0,69,114,114,111,114,32,40,110,97,116,105,118,101,41,46,32,84,104,101,32,109,105,110,105,109,117,109,32,115,97,109,112,108,101,115,32,105,110,32,97,32,108,101,97,102,32,109,117,115,116,32,98,101,32,98,105,103,103,101,114,32,116,104,97,110,32,49,33,0,69,114,114,111,114,32,40,110,97,116,105,118,101,41,46,32,84,104,101,32,109,97,120,32,100,101,112,116,104,32,109,117,115,116,32,98,101,32,98,105,103,103,101,114,32,116,104,97,110,32,48,33,0,69,114,114,111,114,32,40,110,97,116,105,118,101,41,46,32,84,111,116,97,108,32,116,114,101,101,32,110,117,109,98,101,114,32,109,117,115,116,32,98,101,32,98,105,103,103,101,114,32,116,104,97,110,32,48,33,0,52,84,114,101,101,0,56,67,108,97,115,84,114,101,101,0,56,82,101,103,114,84,114,101,101,0,52,78,111,100,101,0,56,67,108,97,115,78,111,100,101,0,56,82,101,103,114,78,111,100,101,0,109,111,100,101,108,46,116,120,116,0,114,119,97,0,114,119,97,0,0,16,9,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,65,160,10,11,65,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,65,241,10,11,33,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,65,171,11,11,1,12,0,65,183,11,11,21,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,65,229,11,11,1,14,0,65,241,11,11,21,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,65,159,12,11,1,16,0,65,171,12,11,30,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,65,226,12,11,14,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,65,147,13,11,1,11,0,65,159,13,11,21,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,65,205,13,11,1,12,0,65,217,13,11,229,2,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0,80,117,114,101,32,118,105,114,116,117,97,108,32,102,117,110,99,116,105,111,110,32,99,97,108,108,101,100,33,0,83,116,57,116,121,112,101,95,105,110,102,111,0,192,7,0,0,67,7,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,232,7,0,0,88,7,0,0,80,7,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,232,7,0,0,136,7,0,0,124,7,0,0,0,0,0,0,172,7,0,0,31,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,36,0,0,0,37,0,0,0,38,0,0,0,0,0,0,0,48,8,0,0,31,0,0,0,39,0,0,0,33,0,0,0,34,0,0,0,35,0,0,0,40,0,0,0,41,0,0,0,42,0,0,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,0,0,0,232,7,0,0,8,8,0,0,172,7,0,0,136,10,0,65,196,16,11,205,1,136,8,0,0,1,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,144,8,0,0,1,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,0,0,0,0,156,8,0,0,1,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,192,7,0,0,185,4,0,0,232,7,0,0,191,4,0,0,136,8,0,0,232,7,0,0,201,4,0,0,136,8,0,0,0,0,0,0,248,8,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,0,0,0,0,4,9,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,192,7,0,0,211,4,0,0,232,7,0,0,217,4,0,0,240,8,0,0,232,7,0,0,227,4,0,0,240,8,0,0,5,0,65,156,18,11,1,28,0,65,180,18,11,10,26,0,0,0,25,0,0,0,128,11,0,65,204,18,11,1,2,0,65,219,18,11,5,255,255,255,255,255,0,65,208,20,11,2,84,11,0,65,136,21,11,1,5,0,65,148,21,11,1,43,0,65,172,21,11,14,26,0,0,0,44,0,0,0,136,13,0,0,0,4,0,65,196,21,11,1,1,0,65,211,21,11,5,10,255,255,255,255,0,65,152,22,11,2,136,10]}},{}],176:[function(t,e,r){(function(r,n){"use strict";var i=65536,o=4294967295;var s=t("safe-buffer").Buffer,a=n.crypto||n.msCrypto;a&&a.getRandomValues?e.exports=function(t,e){if(t>o)throw new RangeError("requested too many random bytes");var n=s.allocUnsafe(t);if(t>0)if(t>i)for(var f=0;f<t;f+=i)a.getRandomValues(n.slice(f,f+i));else a.getRandomValues(n);if("function"==typeof e)return r.nextTick(function(){e(null,n)});return n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:164,"safe-buffer":194}],177:[function(t,e,r){(function(e,n){"use strict";function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=t("safe-buffer"),s=t("randombytes"),a=o.Buffer,f=o.kMaxLength,u=n.crypto||n.msCrypto,h=Math.pow(2,32)-1;function c(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>h||t<0)throw new TypeError("offset must be a uint32");if(t>f||t>e)throw new RangeError("offset out of range")}function l(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>h||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>f)throw new RangeError("buffer too small")}function d(t,r,n,i){if(e.browser){var o=t.buffer,a=new Uint8Array(o,r,n);return u.getRandomValues(a),i?void e.nextTick(function(){i(null,t)}):t}if(!i)return s(n).copy(t,r),t;s(n,function(e,n){if(e)return i(e);n.copy(t,r),i(null,t)})}u&&u.getRandomValues||!e.browser?(r.randomFill=function(t,e,r,i){if(!(a.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,r=t.length;else if("function"==typeof r)i=r,r=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return c(e,t.length),l(r,e,t.length),d(t,e,r,i)},r.randomFillSync=function(t,e,r){void 0===e&&(e=0);if(!(a.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');c(e,t.length),void 0===r&&(r=t.length-e);return l(r,e,t.length),d(t,e,r)}):(r.randomFill=i,r.randomFillSync=i)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:164,randombytes:176,"safe-buffer":194}],178:[function(t,e,r){e.exports=t("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":179}],179:[function(t,e,r){"use strict";var n=t("process-nextick-args"),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var o=Object.create(t("core-util-is"));o.inherits=t("inherits");var s=t("./_stream_readable"),a=t("./_stream_writable");o.inherits(c,s);for(var f=i(a.prototype),u=0;u<f.length;u++){var h=f[u];c.prototype[h]||(c.prototype[h]=a.prototype[h])}function c(t){if(!(this instanceof c))return new c(t);s.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",l)}function l(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),c.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},{"./_stream_readable":181,"./_stream_writable":183,"core-util-is":78,inherits:133,"process-nextick-args":163}],180:[function(t,e,r){"use strict";e.exports=o;var n=t("./_stream_transform"),i=Object.create(t("core-util-is"));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=t("inherits"),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":182,"core-util-is":78,inherits:133}],181:[function(t,e,r){(function(r,n){"use strict";var i=t("process-nextick-args");e.exports=y;var o,s=t("isarray");y.ReadableState=v;t("events").EventEmitter;var a=function(t,e){return t.listeners(e).length},f=t("./internal/streams/stream"),u=t("safe-buffer").Buffer,h=n.Uint8Array||function(){};var c=Object.create(t("core-util-is"));c.inherits=t("inherits");var l=t("util"),d=void 0;d=l&&l.debuglog?l.debuglog("stream"):function(){};var p,m=t("./internal/streams/BufferList"),b=t("./internal/streams/destroy");c.inherits(y,f);var g=["error","close","destroy","pause","resume"];function v(e,r){o=o||t("./_stream_duplex"),e=e||{};var n=r instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=t("string_decoder/").StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function y(e){if(o=o||t("./_stream_duplex"),!(this instanceof y))return new y(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),f.call(this)}function w(t,e,r,n,i){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}(t,s)):(i||(o=function(t,e){var r;n=e,u.isBuffer(n)||n instanceof h||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?_(t,s,e,!1):k(t,s)):_(t,s,e,!1))):n||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(s)}function _(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&S(t)),k(t,e)}Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(t,e){this.push(null),e(t)},y.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=u.from(t,e),e=""),r=!0),w(this,t,e,!1,r)},y.prototype.unshift=function(t){return w(this,t,null,!0,!1)},y.prototype.isPaused=function(){return!1===this._readableState.flowing},y.prototype.setEncoding=function(e){return p||(p=t("string_decoder/").StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};var x=8388608;function M(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(E,t):E(t))}function E(t){d("emit readable"),t.emit("readable"),R(t)}function k(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(d("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function j(t){d("readable nexttick read 0"),t.read(0)}function I(t,e){e.reading||(d("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(d("flow",e.flowing);e.flowing&&null!==t.read(););}function O(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;t-=i.length;for(;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=u.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function D(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(N,e,t))}function N(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function C(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}y.prototype.read=function(t){d("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?D(this):S(this),null;if(0===(t=M(t,e))&&e.ended)return 0===e.length&&D(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&d("length less than watermark",i=!0),e.ended||e.reading?d("reading or ended",i=!1):i&&(d("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=M(r,e))),null===(n=t>0?O(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&D(this)),null!==n&&this.emit("data",n),n},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var f=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?h:y;function u(e,r){d("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),t.removeListener("close",g),t.removeListener("finish",v),t.removeListener("drain",c),t.removeListener("error",b),t.removeListener("unpipe",u),n.removeListener("end",h),n.removeListener("end",y),n.removeListener("data",m),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function h(){d("onend"),t.end()}o.endEmitted?i.nextTick(f):n.once("end",f),t.on("unpipe",u);var c=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",c);var l=!1;var p=!1;function m(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==C(o.pipes,t))&&!l&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function b(e){d("onerror",e),y(),t.removeListener("error",b),0===a(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",v),y()}function v(){d("onfinish"),t.removeListener("close",g),y()}function y(){d("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",b),t.once("close",g),t.once("finish",v),t.emit("pipe",n),o.flowing||(d("pipe resume"),n.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var s=C(e.pipes,t);return-1===s?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)},y.prototype.on=function(t,e){var r=f.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&S(this):i.nextTick(j,this))}return r},y.prototype.addListener=y.prototype.on,y.prototype.resume=function(){var t=this._readableState;return t.flowing||(d("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(I,t,e))}(this,t)),this},y.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},y.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(d("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<g.length;o++)t.on(g[o],this.emit.bind(this,g[o]));return this._read=function(e){d("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),y._fromList=O}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":179,"./internal/streams/BufferList":184,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:164,"core-util-is":78,events:114,inherits:133,isarray:136,"process-nextick-args":163,"safe-buffer":187,"string_decoder/":188,util:46}],182:[function(t,e,r){"use strict";e.exports=o;var n=t("./_stream_duplex"),i=Object.create(t("core-util-is"));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t),this._transformState={afterTransform:function(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",s)}function s(){var t=this;"function"==typeof this._flush?this._flush(function(e,r){a(t,e,r)}):a(this,null,null)}function a(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=t("inherits"),i.inherits(o,n),o.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},o.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(t,e){var r=this;n.prototype._destroy.call(this,t,function(t){e(t),r.emit("close")})}},{"./_stream_duplex":179,"core-util-is":78,inherits:133}],183:[function(t,e,r){(function(r,n,i){"use strict";var o=t("process-nextick-args");function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}e.exports=v;var a,f=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:o.nextTick;v.WritableState=g;var u=Object.create(t("core-util-is"));u.inherits=t("inherits");var h={deprecate:t("util-deprecate")},c=t("./internal/streams/stream"),l=t("safe-buffer").Buffer,d=n.Uint8Array||function(){};var p,m=t("./internal/streams/destroy");function b(){}function g(e,r){a=a||t("./_stream_duplex"),e=e||{};var n=r instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,h=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:h,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===e.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(S,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),S(t,e))}(t,r,n,e,i);else{var s=x(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||_(t,r),n?f(w,t,r,s,i):w(t,r,s,i)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function v(e){if(a=a||t("./_stream_duplex"),!(p.call(v,this)||this instanceof a))return new v(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function y(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),S(t,e)}function _(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,f=!0;r;)i[a]=r,r.isBuf||(f=!1),r=r.next,a+=1;i.allBuffers=f,y(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,h=r.encoding,c=r.callback;if(y(t,e,!1,e.objectMode?1:u.length,u,h,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function x(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),S(t,e)})}function S(t,e){var r=x(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(M,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(v,c),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===v&&(t&&t._writableState instanceof g)}})):p=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=t,l.isBuffer(n)||n instanceof d);return a&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=b),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(n,s),i=!1),i}(this,i,t,r))&&(i.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var f=e.length<e.highWaterMark;f||(e.needDrain=!0);if(e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else y(t,e,!1,a,n,i,o);return f}(this,i,a,t,e,r)),s},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||_(this,t))},v.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,S(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{"./_stream_duplex":179,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:164,"core-util-is":78,inherits:133,"process-nextick-args":163,"safe-buffer":187,timers:205,"util-deprecate":214}],184:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,r=o,i=a,e.copy(r,i),a+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":187,util:46}],185:[function(t,e,r){"use strict";var n=t("process-nextick-args");function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":163}],186:[function(t,e,r){e.exports=t("events").EventEmitter},{events:114}],187:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:76}],188:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=f,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=h,this.end=c,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function f(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":187}],189:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":190}],190:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":179,"./lib/_stream_passthrough.js":180,"./lib/_stream_readable.js":181,"./lib/_stream_transform.js":182,"./lib/_stream_writable.js":183}],191:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":190}],192:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],193:[function(t,e,r){"use strict";var n=t("buffer").Buffer,i=t("inherits"),o=t("hash-base"),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],h=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],c=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function m(t,e,r,n,i,o,s,a){return p(t+(e^r^n)+o+s|0,a)+i|0}function b(t,e,r,n,i,o,s,a){return p(t+(e&r|~e&n)+o+s|0,a)+i|0}function g(t,e,r,n,i,o,s,a){return p(t+((e|~r)^n)+o+s|0,a)+i|0}function v(t,e,r,n,i,o,s,a){return p(t+(e&n|r&~n)+o+s|0,a)+i|0}function y(t,e,r,n,i,o,s,a){return p(t+(e^(r|~n))+o+s|0,a)+i|0}i(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,x=0|this._c,M=0|this._d,S=0|this._e,E=0;E<80;E+=1){var k,A;E<16?(k=m(r,n,i,o,d,t[a[E]],c[0],u[E]),A=y(w,_,x,M,S,t[f[E]],l[0],h[E])):E<32?(k=b(r,n,i,o,d,t[a[E]],c[1],u[E]),A=v(w,_,x,M,S,t[f[E]],l[1],h[E])):E<48?(k=g(r,n,i,o,d,t[a[E]],c[2],u[E]),A=g(w,_,x,M,S,t[f[E]],l[2],h[E])):E<64?(k=v(r,n,i,o,d,t[a[E]],c[3],u[E]),A=b(w,_,x,M,S,t[f[E]],l[3],h[E])):(k=y(r,n,i,o,d,t[a[E]],c[4],u[E]),A=m(w,_,x,M,S,t[f[E]],l[4],h[E])),r=d,d=o,o=p(i,10),i=n,n=k,w=S,S=M,M=p(x,10),x=_,_=A}var j=this._b+i+M|0;this._b=this._c+o+S|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+n+x|0,this._a=j},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},e.exports=d},{buffer:76,"hash-base":116,inherits:133}],194:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:76}],195:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,s=this._len,a=0;a<o;){for(var f=s%i,u=Math.min(o-a,i-f),h=0;h<u;h++)r[f+h]=t[a+h];a+=u,(s+=u)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},{"safe-buffer":194}],196:[function(t,e,r){(r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e}).sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":197,"./sha1":198,"./sha224":199,"./sha256":200,"./sha384":201,"./sha512":202}],197:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function f(){this.init(),this._w=a,i.call(this,64,56)}function u(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,f=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=n)<<5|e>>>27)+h(d,i,o,a)+f+r[l]+s[d];f=a,a=o,o=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=f},{"./hash":195,inherits:133,"safe-buffer":194}],198:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function f(){this.init(),this._w=a,i.call(this,64,56)}function u(t){return t<<5|t>>>27}function h(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,f=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=u(n)+c(p,i,o,a)+f+r[d]+s[p]|0;f=a,a=o,o=h(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=f},{"./hash":195,inherits:133,"safe-buffer":194}],199:[function(t,e,r){var n=t("inherits"),i=t("./sha256"),o=t("./hash"),s=t("safe-buffer").Buffer,a=new Array(64);function f(){this.init(),this._w=a,o.call(this,64,56)}n(f,i),f.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},f.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=f},{"./hash":195,"./sha256":200,inherits:133,"safe-buffer":194}],200:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function f(){this.init(),this._w=a,i.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function c(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(f,i),f.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,f=0|this._e,p=0|this._f,m=0|this._g,b=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+d(r[g-15])+r[g-16];for(var v=0;v<64;++v){var y=b+l(f)+u(f,p,m)+s[v]+r[v]|0,w=c(n)+h(n,i,o)|0;b=m,m=p,p=f,f=a+y|0,a=o,o=i,i=n,n=y+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=f+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=b+this._h|0},f.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=f},{"./hash":195,inherits:133,"safe-buffer":194}],201:[function(t,e,r){var n=t("inherits"),i=t("./sha512"),o=t("./hash"),s=t("safe-buffer").Buffer,a=new Array(160);function f(){this.init(),this._w=a,o.call(this,128,112)}n(f,i),f.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},f.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},e.exports=f},{"./hash":195,"./sha512":202,inherits:133,"safe-buffer":194}],202:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function f(){this.init(),this._w=a,i.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function c(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0<e>>>0?1:0}n(f,i),f.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},f.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,f=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,x=0|this._cl,M=0|this._dl,S=0|this._el,E=0|this._fl,k=0|this._gl,A=0|this._hl,j=0;j<32;j+=2)e[j]=t.readInt32BE(4*j),e[j+1]=t.readInt32BE(4*j+4);for(;j<160;j+=2){var I=e[j-30],R=e[j-30+1],O=d(I,R),D=p(R,I),N=m(I=e[j-4],R=e[j-4+1]),C=b(R,I),B=e[j-14],T=e[j-14+1],P=e[j-32],z=e[j-32+1],F=D+T|0,q=O+B+g(F,D)|0;q=(q=q+N+g(F=F+C|0,C)|0)+P+g(F=F+z|0,z)|0,e[j]=q,e[j+1]=F}for(var L=0;L<160;L+=2){q=e[L],F=e[L+1];var U=h(r,n,i),V=h(w,_,x),H=c(r,w),X=c(w,r),W=l(a,S),K=l(S,a),$=s[L],J=s[L+1],Y=u(a,f,v),G=u(S,E,k),Z=A+K|0,Q=y+W+g(Z,A)|0;Q=(Q=(Q=Q+Y+g(Z=Z+G|0,G)|0)+$+g(Z=Z+J|0,J)|0)+q+g(Z=Z+F|0,F)|0;var tt=X+V|0,et=H+U+g(tt,X)|0;y=v,A=k,v=f,k=E,f=a,E=S,a=o+Q+g(S=M+Z|0,M)|0,o=i,M=x,i=n,x=_,n=r,_=w,r=Q+et+g(w=Z+tt|0,Z)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+x|0,this._dl=this._dl+M|0,this._el=this._el+S|0,this._fl=this._fl+E|0,this._gl=this._gl+k|0,this._hl=this._hl+A|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,x)|0,this._dh=this._dh+o+g(this._dl,M)|0,this._eh=this._eh+a+g(this._el,S)|0,this._fh=this._fh+f+g(this._fl,E)|0,this._gh=this._gh+v+g(this._gl,k)|0,this._hh=this._hh+y+g(this._hl,A)|0},f.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},e.exports=f},{"./hash":195,inherits:133,"safe-buffer":194}],203:[function(t,e,r){e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/readable.js"),i.Writable=t("readable-stream/writable.js"),i.Duplex=t("readable-stream/duplex.js"),i.Transform=t("readable-stream/transform.js"),i.PassThrough=t("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",f));var s=!1;function a(){s||(s=!0,t.end())}function f(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(h(),0===n.listenerCount(this,"error"))throw t}function h(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",f),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("error",u),t.on("error",u),r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t}},{events:114,inherits:133,"readable-stream/duplex.js":178,"readable-stream/passthrough.js":189,"readable-stream/readable.js":190,"readable-stream/transform.js":191,"readable-stream/writable.js":192}],204:[function(t,e,r){arguments[4][188][0].apply(r,arguments)},{dup:188,"safe-buffer":194}],205:[function(t,e,r){(function(e,n){var i=t("process/browser.js").nextTick,o=Function.prototype.apply,s=Array.prototype.slice,a={},f=0;function u(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new u(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new u(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r.setImmediate="function"==typeof e?e:function(t){var e=f++,n=!(arguments.length<2)&&s.call(arguments,1);return a[e]=!0,i(function(){a[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))}),e},r.clearImmediate="function"==typeof n?n:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":164,timers:205}],206:[function(t,e,r){var n=n||{REVISION:"ALPHA"};!function(t){"use strict";var e=function(t,e){if(!t)throw e||"Assertion failed"},r=function(t,e,r){return t.hasOwnProperty(e)?t[e]:r},n=!1,i=0,o=function(){if(n)return n=!1,i;var t=2*Math.random()-1,e=2*Math.random()-1,r=t*t+e*e;if(0==r||r>1)return o();var s=Math.sqrt(-2*Math.log(r)/r);return i=e*s,n=!0,t*s},s=function(t){if(void 0===t||isNaN(t))return[];if("undefined"==typeof ArrayBuffer){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e}return new Float64Array(t)},a=function(t,e,r){for(var n,i=void 0!==r,s=[],a=0;a<t;a++){for(var f=[],u=0;u<e;u++)i?f.push(r):f.push((n=1e-4,0+o()*n));s.push(f)}return s},f=function(t,e){for(var r=t.length,n=0,i=0;i<r;i++){var o=t[i],s=e[i];n+=(o-s)*(o-s)}return n},u=function(t,r,n){var i=Math.sqrt(t.length),o=Math.floor(i);e(o===i,"D should have square number of elements.");for(var a=Math.log(r),f=s(o*o),u=s(o),h=0;h<o;h++){for(var c=-1/0,l=1/0,d=1,p=!1,m=0;!p;){for(var b=0,g=0;g<o;g++){var v=Math.exp(-t[h*o+g]*d);h===g&&(v=0),u[g]=v,b+=v}var y=0;for(g=0;g<o;g++){v=u[g]/b;u[g]=v,v>1e-7&&(y-=v*Math.log(v))}y>a?(c=d,l===1/0?d*=2:d=(d+l)/2):(l=d,c===-1/0?d/=2:d=(d+c)/2),m++,Math.abs(y-a)<n&&(p=!0),m>=50&&(p=!0)}for(g=0;g<o;g++)f[h*o+g]=u[g]}var w=s(o*o),_=2*o;for(h=0;h<o;h++)for(g=0;g<o;g++)w[h*o+g]=Math.max((f[h*o+g]+f[g*o+h])/_,1e-100);return w};function h(t){return t>0?1:t<0?-1:0}var c=function(t){t=t||{};this.perplexity=r(t,"perplexity",30),this.dim=r(t,"dim",2),this.epsilon=r(t,"epsilon",10),this.iter=0};c.prototype={initDataRaw:function(t){var r=t.length,n=t[0].length;e(r>0," X is empty? You must have some data!"),e(n>0," X[0] is empty? Where is the data?");var i=function(t){for(var e=t.length,r=s(e*e),n=0;n<e;n++)for(var i=n+1;i<e;i++){var o=f(t[n],t[i]);r[n*e+i]=o,r[i*e+n]=o}return r}(t);this.P=u(i,this.perplexity,1e-4),this.N=r,this.initSolution()},initDataDist:function(t){var r=t.length;e(r>0," X is empty? You must have some data!");for(var n=s(r*r),i=0;i<r;i++)for(var o=i+1;o<r;o++){var a=t[i][o];n[i*r+o]=a,n[o*r+i]=a}this.P=u(n,this.perplexity,1e-4),this.N=r,this.initSolution()},initSolution:function(){this.Y=a(this.N,this.dim),this.gains=a(this.N,this.dim,1),this.ystep=a(this.N,this.dim,0),this.iter=0},getSolution:function(){return this.Y},step:function(){this.iter+=1;for(var t=this.N,e=this.costGrad(this.Y),r=e.cost,n=e.grad,i=s(this.dim),o=0;o<t;o++)for(var a=0;a<this.dim;a++){var f=n[o][a],u=this.ystep[o][a],c=this.gains[o][a],l=h(f)===h(u)?.8*c:c+.2;c<.01&&(c=.01),this.gains[o][a]=l;var d=(this.iter<250?.5:.8)*u-this.epsilon*l*n[o][a];this.ystep[o][a]=d,this.Y[o][a]+=d,i[a]+=this.Y[o][a]}for(o=0;o<t;o++)for(a=0;a<this.dim;a++)this.Y[o][a]-=i[a]/t;return r},debugGrad:function(){for(var t=this.N,e=this.costGrad(this.Y),r=(e.cost,e.grad),n=1e-5,i=0;i<t;i++)for(var o=0;o<this.dim;o++){var s=this.Y[i][o];this.Y[i][o]=s+n;var a=this.costGrad(this.Y);this.Y[i][o]=s-n;var f=this.costGrad(this.Y),u=r[i][o],h=(a.cost-f.cost)/(2*n);console.log(i+","+o+": gradcheck analytic: "+u+" vs. numerical: "+h),this.Y[i][o]=s}},costGrad:function(t){for(var e=this.N,r=this.dim,n=this.P,i=this.iter<100?4:1,o=s(e*e),a=0,f=0;f<e;f++)for(var u=f+1;u<e;u++){for(var h=0,c=0;c<r;c++){var l=t[f][c]-t[u][c];h+=l*l}var d=1/(1+h);o[f*e+u]=d,o[u*e+f]=d,a+=2*d}for(var p=e*e,m=s(p),b=0;b<p;b++)m[b]=Math.max(o[b]/a,1e-100);var g=0,v=[];for(f=0;f<e;f++){var y=new Array(r);for(c=0;c<r;c++)y[c]=0;for(u=0;u<e;u++){g+=-n[f*e+u]*Math.log(m[f*e+u]);var w=4*(i*n[f*e+u]-m[f*e+u])*o[f*e+u];for(c=0;c<r;c++)y[c]+=w*(t[f][c]-t[u][c])}v.push(y)}return{cost:g,grad:v}}},t.tSNE=c}(n),function(t){"use strict";void 0===e||void 0===e.exports?window.tsnejs=t:e.exports=t}(n)},{}],207:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("./utils"));function o(t,e){var r=function(r){return i.empty(t).map(function(){return i.filled(e,r)})},n=[];return n.push(r(-1)),n.push(r(1/0)),n.push(r(0)),n}function s(t,e,r,n,i){e=Math.floor(e);var o=t[0][e],s=t[1][e];t[2][e];if(r>=s[0])return 0;for(var f=0;f<o.length;f++)if(n===o[f])return 0;return a(t,e,r,n,i)}function a(t,e,r,n,i){var o=t[0][e],s=t[1][e],a=t[2][e];if(r>=s[0])return 0;s[0]=r,o[0]=n,a[0]=i;for(var f=0,u=0;;){var h=2*f+1,c=h+1,l=t[0][0].length;if(h>=l)break;if(c>=l){if(!(s[h]>r))break;u=h}else if(s[h]>=s[c]){if(!(r<s[h]))break;u=h}else{if(!(r<s[c]))break;u=c}s[f]=s[u],o[f]=o[u],a[f]=a[u],f=u}return s[f]=r,o[f]=n,a[f]=i,1}function f(t,e,r,n){for(;2*n+1<r;){var i=2*n+1,o=i+1,s=n;if(t[s]<t[i]&&(s=i),o<r&&t[s]<t[o]&&(s=o),s===n)break;var a=t[n];t[n]=t[s],t[s]=a;var f=e[n];e[n]=e[s],e[s]=f,n=s}}r.makeHeap=o,r.rejectionSample=function(t,e,r){for(var n=i.zeros(t),o=0;o<t;o++){for(var s=!0,a=0;s;){a=i.tauRandInt(e,r);for(var f=!1,u=0;u<o;u++)if(a===n[u]){f=!0;break}f||(s=!1)}n[o]=a}return n},r.heapPush=s,r.uncheckedHeapPush=a,r.buildCandidates=function(t,e,r,n,a){for(var f=o(e,n),u=0;u<e;u++)for(var h=0;h<r;h++)if(!(t[0][u][h]<0)){var c=t[0][u][h],l=t[2][u][h],d=i.tauRand(a);s(f,u,d,c,l),s(f,c,d,u,l),t[2][u][h]=0}return f},r.deheapSort=function(t){for(var e=t[0],r=t[1],n=0;n<e.length;n++)for(var i=e[n],o=r[n],s=0;s<i.length-1;s++){var a=i.length-s-1,u=o.length-s-1,h=i[0];i[0]=i[a],i[a]=h;var c=o[0];o[0]=o[u],o[u]=c,f(o,i,u,0)}return{indices:e,weights:r}},r.smallestFlagged=function(t,e){for(var r=t[0][e],n=t[1][e],i=t[2][e],o=1/0,s=-1,a=0;a>r.length;a++)1===i[a]&&n[a]<o&&(o=n[a],s=a);return s>=0?(i[s]=0,Math.floor(r[s])):-1}},{"./utils":213}],208:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./umap");r.UMAP=n.UMAP},{"./umap":212}],209:[function(t,e,r){"use strict";var n,i=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var a=s(t("./utils")),f=function(){function t(t,e,r,n){if(this.entries=new Map,this.nRows=0,this.nCols=0,t.length!==e.length||t.length!==r.length)throw new Error("rows, cols and values arrays must all have the same length");this.nRows=n[0],this.nCols=n[1];for(var i=0;i<r.length;i++){var o=t[i],s=e[i];this.checkDims(o,s);var a=this.makeKey(o,s);this.entries.set(a,{value:r[i],row:o,col:s})}}return t.prototype.makeKey=function(t,e){return t+":"+e},t.prototype.checkDims=function(t,e){if(!(t<this.nRows&&e<this.nCols))throw new Error("row and/or col specified outside of matrix dimensions")},t.prototype.set=function(t,e,r){this.checkDims(t,e);var n=this.makeKey(t,e);this.entries.has(n)?this.entries.get(n).value=r:this.entries.set(n,{value:r,row:t,col:e})},t.prototype.get=function(t,e,r){void 0===r&&(r=0),this.checkDims(t,e);var n=this.makeKey(t,e);return this.entries.has(n)?this.entries.get(n).value:r},t.prototype.getAll=function(t){void 0===t&&(t=!0);var e=[];return this.entries.forEach(function(t){e.push(t)}),t&&e.sort(function(t,e){return t.row===e.row?t.col-e.col:t.row-e.row}),e},t.prototype.getDims=function(){return[this.nRows,this.nCols]},t.prototype.getRows=function(){return Array.from(this.entries,function(t){var e=i(t,2);e[0];return e[1].row})},t.prototype.getCols=function(){return Array.from(this.entries,function(t){var e=i(t,2);e[0];return e[1].col})},t.prototype.getValues=function(){return Array.from(this.entries,function(t){var e=i(t,2);e[0];return e[1].value})},t.prototype.forEach=function(t){this.entries.forEach(function(e){return t(e.value,e.row,e.col)})},t.prototype.map=function(e){var r=[];this.entries.forEach(function(t){r.push(e(t.value,t.row,t.col))});var n=[this.nRows,this.nCols];return new t(this.getRows(),this.getCols(),r,n)},t.prototype.toArray=function(){var t=this,e=a.empty(this.nRows).map(function(){return a.zeros(t.nCols)});return this.entries.forEach(function(t){e[t.row][t.col]=t.value}),e},t}();r.SparseMatrix=f,r.transpose=function(t){var e=[],r=[],n=[];t.forEach(function(t,i,o){e.push(i),r.push(o),n.push(t)});var i=[t.nCols,t.nRows];return new f(r,e,n,i)},r.identity=function(t){for(var e=i(t,1)[0],r=new f([],[],[],t),n=0;n<e;n++)r.set(n,n,1);return r},r.pairwiseMultiply=function(t,e){return h(t,e,function(t,e){return t*e})},r.add=function(t,e){return h(t,e,function(t,e){return t+e})},r.subtract=function(t,e){return h(t,e,function(t,e){return t-e})},r.maximum=function(t,e){return h(t,e,function(t,e){return t>e?t:e})},r.multiplyScalar=function(t,e){return t.map(function(t){return t*e})},r.eliminateZeros=function(t){for(var e=new Set,r=t.getValues(),n=t.getRows(),i=t.getCols(),o=0;o<r.length;o++)0===r[o]&&e.add(o);var s=function(t,r){return!e.has(r)},a=r.filter(s),u=n.filter(s),h=i.filter(s);return new f(u,h,a,t.getDims())},r.normalize=function(t,e){var r,n;void 0===e&&(e="l2");var i=u[e],s=new Map;t.forEach(function(t,e,r){var n=s.get(e)||[];n.push(r),s.set(e,n)});var a=new f([],[],[],t.getDims()),h=function(e){for(var r=s.get(e).sort(),n=r.map(function(r){return t.get(e,r)}),o=i(n),f=0;f<o.length;f++)a.set(e,r[f],o[f])};try{for(var c=o(s.keys()),l=c.next();!l.done;l=c.next())h(l.value)}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return a};var u=((n={}).max=function(t){for(var e=-1/0,r=0;r<t.length;r++)e=t[r]>e?t[r]:e;return t.map(function(t){return t/e})},n.l1=function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r];return t.map(function(t){return t/e})},n.l2=function(t){for(var e=0,r=0;r<t.length;r++)e+=Math.pow(t[r],2);return t.map(function(t){return Math.sqrt(Math.pow(t,2)/e)})},n);function h(t,e,r){for(var n=new Set,i=[],o=[],s=[],a=function(n,a){i.push(n),o.push(a);var f=r(t.get(n,a),e.get(n,a));s.push(f)},u=t.getValues(),h=t.getRows(),c=t.getCols(),l=0;l<u.length;l++){var d=(g=h[l])+":"+(v=c[l]);n.add(d),a(g,v)}var p=e.getValues(),m=e.getRows(),b=e.getCols();for(l=0;l<p.length;l++){var g,v;d=(g=m[l])+":"+(v=b[l]);n.has(d)||a(g,v)}var y=[t.nRows,t.nCols];return new f(i,o,s,y)}r.getCSR=function(t){var e=[];t.forEach(function(t,r,n){e.push({value:t,row:r,col:n})}),e.sort(function(t,e){return t.row===e.row?t.col-e.col:t.row-e.row});for(var r=[],n=[],i=[],o=-1,s=0;s<e.length;s++){var a=e[s],f=a.row,u=a.col,h=a.value;f!==o&&(o=f,i.push(s)),r.push(u),n.push(h)}return{indices:r,values:n,indptr:i}}},{"./utils":213}],210:[function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=i(t("./heap")),s=i(t("./matrix")),a=i(t("./tree")),f=i(t("./utils"));r.makeNNDescent=function(t,e){return function(r,n,i,s,a,u,h,c){void 0===s&&(s=10),void 0===a&&(a=50),void 0===u&&(u=.001),void 0===h&&(h=.5),void 0===c&&(c=!0);for(var l=r.length,d=o.makeHeap(r.length,i),p=0;p<r.length;p++)for(var m=o.rejectionSample(i,r.length,e),b=0;b<m.length;b++){var g=t(r[p],r[m[b]]);o.heapPush(d,p,g,m[b],1),o.heapPush(d,m[b],g,p,1)}if(c)for(var v=0;v<n.length;v++)for(p=0;p<n[v].length&&!(n[v][p]<0);p++)for(b=p+1;b<n[v].length&&!(n[v][b]<0);b++)g=t(r[n[v][p]],r[n[v][b]]),o.heapPush(d,n[v][p],g,n[v][b],1),o.heapPush(d,n[v][b],g,n[v][p],1);for(v=0;v<s;v++){var y=o.buildCandidates(d,l,i,a,e),w=0;for(p=0;p<l;p++)for(b=0;b<a;b++){var _=Math.floor(y[0][p][b]);if(!(_<0||f.tauRand(e)<h))for(var x=0;x<a;x++){var M=Math.floor(y[0][p][x]),S=y[2][p][b],E=y[2][p][x];M<0||!S&&!E||(g=t(r[_],r[M]),w+=o.heapPush(d,_,g,M,1),w+=o.heapPush(d,M,g,_,1))}}if(w<=u*i*r.length)break}return o.deheapSort(d)}},r.makeInitializations=function(t){return{initFromRandom:function(e,r,n,i,s){for(var a=0;a<n.length;a++)for(var u=f.rejectionSample(e,r.length,s),h=0;h<u.length;h++)if(!(u[h]<0)){var c=t(r[u[h]],n[a]);o.heapPush(i,a,c,u[h],1)}},initFromTree:function(e,r,n,i,s){for(var f=0;f<n.length;f++)for(var u=a.searchFlatTree(n[f],e,s),h=0;h<u.length;h++){if(u[h]<0)return;var c=t(r[u[h]],n[f]);o.heapPush(i,f,c,u[h],1)}}}},r.makeInitializedNNSearch=function(t){return function(e,r,i,a){for(var f,u,h=s.getCSR(r),c=h.indices,l=h.indptr,d=0;d<a.length;d++)for(var p=new Set(i[0][d]);;){var m=o.smallestFlagged(i,d);if(-1===m)break;var b=c.slice(l[m],l[m+1]);try{for(var g=n(b),v=g.next();!v.done;v=g.next()){var y=v.value;if(y!==m&&-1!==y&&!p.has(y)){var w=t(e[y],a[d]);o.uncheckedHeapPush(i,d,w,y,1),p.add(y)}}}catch(t){f={error:t}}finally{try{v&&!v.done&&(u=g.return)&&u.call(g)}finally{if(f)throw f.error}}}return i}},r.initializeSearch=function(t,e,r,i,s,a,f){var u,h,c=o.makeHeap(r.length,i);if(s(i,e,r,c,f),t)try{for(var l=n(t),d=l.next();!d.done;d=l.next())a(d.value,e,r,c,f)}catch(t){u={error:t}}finally{try{d&&!d.done&&(h=l.return)&&h.call(l)}finally{if(u)throw u.error}}return c}},{"./heap":207,"./matrix":209,"./tree":211,"./utils":213}],211:[function(t,e,r){"use strict";var n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(n(arguments[e]));return t},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var a=s(t("./utils")),f=function(){return function(t,e,r,n){this.hyperplanes=t,this.offsets=e,this.children=r,this.indices=n}}();function u(t,e,r,n){for(var i=e,o=0;o<r.length;o++)i+=t[o]*r[o];return 0===i?a.tauRandInt(2,n):i>0?0:1}r.FlatTree=f,r.makeForest=function(t,e,r,n){var o=Math.max(10,e);return a.range(r).map(function(e,r){return function(t,e,r,n){void 0===e&&(e=30);var i=a.range(t.length);return function t(e,r,n,i,o){if(void 0===n&&(n=30),r.length>n){var s=function(t,e,r){var n=t[0].length,i=a.tauRandInt(e.length,r),o=a.tauRandInt(e.length,r);o=(o+=i===o?1:0)%e.length;for(var s=e[i],f=e[o],u=0,h=a.zeros(n),c=0;c<h.length;c++)h[c]=t[s][c]-t[f][c],u-=h[c]*(t[s][c]+t[f][c])/2;for(var l=0,d=0,p=a.zeros(e.length),c=0;c<e.length;c++){for(var m=u,b=0;b<n;b++)m+=h[b]*t[e[c]][b];0===m?(p[c]=a.tauRandInt(2,r),0===p[c]?l+=1:d+=1):m>0?(p[c]=0,l+=1):(p[c]=1,d+=1)}var g=a.zeros(l),v=a.zeros(d);for(var c in l=0,d=0,a.range(p.length))0===p[c]?(g[l]=e[c],l+=1):(v[d]=e[c],d+=1);return{indicesLeft:g,indicesRight:v,hyperplane:h,offset:u}}(e,r,o),f=s.indicesLeft,u=s.indicesRight,h=s.hyperplane,c=s.offset,l=t(e,f,n,i+1,o),d=t(e,u,n,i+1,o),p={leftChild:l,rightChild:d,isLeaf:!1,hyperplane:h,offset:c};return p}var p={indices:r,isLeaf:!0};return p}(t,i,e,r,n)}(t,o,r,n)}).map(function(t){return function(t,e){var r=function t(e){return e.isLeaf?1:1+t(e.leftChild)+t(e.rightChild)}(t),n=function t(e){return e.isLeaf?1:t(e.leftChild)+t(e.rightChild)}(t),o=a.range(r).map(function(){return a.zeros(t.hyperplane?t.hyperplane.length:0)}),s=a.zeros(r),u=a.range(r).map(function(){return[-1,-1]}),h=a.range(n).map(function(){return a.range(e).map(function(){return-1})});return function t(e,r,n,o,s,a,f){var u;if(e.isLeaf)return o[a][0]=-f,(u=s[f]).splice.apply(u,i([0,e.indices.length],e.indices)),{nodeNum:a,leafNum:f+=1};r[a]=e.hyperplane,n[a]=e.offset,o[a][0]=a+1;var h=a,c=t(e.leftChild,r,n,o,s,a+1,f);return a=c.nodeNum,f=c.leafNum,o[h][1]=a+1,{nodeNum:(c=t(e.rightChild,r,n,o,s,a+1,f)).nodeNum,leafNum:c.leafNum}}(t,o,s,u,h,0,0),new f(o,s,u,h)}(t,o)})},r.makeLeafArray=function(t){var e,r;if(t.length>0){var n=[];try{for(var s=o(t),a=s.next();!a.done;a=s.next()){var f=a.value;n.push.apply(n,i(f.indices))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return n}return[[-1]]},r.searchFlatTree=function(t,e,r){for(var n=0;e.children[n][0]>0;)n=0===u(e.hyperplanes[n],e.offsets[n],t,r)?e.children[n][0]:e.children[n][1];var i=-1*e.children[n][0];return e.indices[i]}},{"./utils":213}],212:[function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{f(n.next(t))}catch(t){o(t)}}function a(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,a)}f((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},s=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e},f=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var u=a(t("./heap")),h=a(t("./matrix")),c=a(t("./nn_descent")),l=a(t("./tree")),d=a(t("./utils")),p=f(t("ml-levenberg-marquardt")),m=function(){function t(t){void 0===t&&(t={});var e=this;this.learningRate=1,this.localConnectivity=1,this.minDist=.1,this.nComponents=2,this.nEpochs=0,this.nNeighbors=15,this.negativeSampleRate=5,this.random=Math.random,this.repulsionStrength=1,this.setOpMixRatio=1,this.spread=1,this.transformQueueSize=4,this.targetMetric="categorical",this.targetWeight=.5,this.targetNNeighbors=this.nNeighbors,this.distanceFn=b,this.isInitialized=!1,this.rpForest=[],this.embedding=[],this.optimizationState=new g;var r=function(r){void 0!==t[r]&&(e[r]=t[r])};r("distanceFn"),r("learningRate"),r("localConnectivity"),r("minDist"),r("nComponents"),r("nEpochs"),r("nNeighbors"),r("negativeSampleRate"),r("random"),r("repulsionStrength"),r("setOpMixRatio"),r("spread"),r("transformQueueSize")}return t.prototype.fit=function(t){return this.initializeFit(t),this.optimizeLayout(),this.embedding},t.prototype.fitAsync=function(t,e){return void 0===e&&(e=function(){return!0}),n(this,void 0,void 0,function(){return i(this,function(r){switch(r.label){case 0:return this.initializeFit(t),[4,this.optimizeLayoutAsync(e)];case 1:return r.sent(),[2,this.embedding]}})})},t.prototype.setSupervisedProjection=function(t,e){void 0===e&&(e={}),this.Y=t,this.targetMetric=e.targetMetric||this.targetMetric,this.targetWeight=e.targetWeight||this.targetWeight,this.targetNNeighbors=e.targetNNeighbors||this.targetNNeighbors},t.prototype.setPrecomputedKNN=function(t,e){this.knnIndices=t,this.knnDistances=e},t.prototype.initializeFit=function(t){if(t.length<=this.nNeighbors)throw new Error("Not enough data points ("+t.length+") to create nNeighbors: "+this.nNeighbors+". Add more data points or adjust the configuration.");if(this.X===t&&this.isInitialized)return this.getNEpochs();if(this.X=t,!this.knnIndices&&!this.knnDistances){var e=this.nearestNeighbors(t);this.knnIndices=e.knnIndices,this.knnDistances=e.knnDistances}this.graph=this.fuzzySimplicialSet(t,this.nNeighbors,this.setOpMixRatio),this.makeSearchFns(),this.searchGraph=this.makeSearchGraph(t),this.processGraphForSupervisedProjection();var r=this.initializeSimplicialSetEmbedding(),n=r.head,i=r.tail,o=r.epochsPerSample;return this.optimizationState.head=n,this.optimizationState.tail=i,this.optimizationState.epochsPerSample=o,this.initializeOptimization(),this.prepareForOptimizationLoop(),this.isInitialized=!0,this.getNEpochs()},t.prototype.makeSearchFns=function(){var t=c.makeInitializations(this.distanceFn),e=t.initFromTree,r=t.initFromRandom;this.initFromTree=e,this.initFromRandom=r,this.search=c.makeInitializedNNSearch(this.distanceFn)},t.prototype.makeSearchGraph=function(t){for(var e=this.knnIndices,r=this.knnDistances,n=[t.length,t.length],i=new h.SparseMatrix([],[],[],n),o=0;o<e.length;o++)for(var s=e[o],a=r[o],f=0;f<s.length;f++){var u=s[f],c=a[f];c>0&&i.set(o,u,c)}var l=h.transpose(i);return h.maximum(i,l)},t.prototype.transform=function(t){var e=this,r=this.X;if(void 0===r||0===r.length)throw new Error("No data has been fit.");var n=Math.floor(this.nNeighbors*this.transformQueueSize);n=Math.min(r.length,n);var i=c.initializeSearch(this.rpForest,r,t,n,this.initFromRandom,this.initFromTree,this.random),o=this.search(r,this.searchGraph,i,t),s=u.deheapSort(o),a=s.indices,f=s.weights;a=a.map(function(t){return t.slice(0,e.nNeighbors)}),f=f.map(function(t){return t.slice(0,e.nNeighbors)});var l=Math.max(0,this.localConnectivity-1),p=this.smoothKNNDistance(f,this.nNeighbors,l),m=p.sigmas,b=p.rhos,g=this.computeMembershipStrengths(a,f,m,b),v=g.rows,y=g.cols,w=g.vals,_=[t.length,r.length],x=new h.SparseMatrix(v,y,w,_),S=h.normalize(x,"l1"),E=h.getCSR(S),k=t.length,A=M(d.reshape2d(E.indices,k,this.nNeighbors),d.reshape2d(E.values,k,this.nNeighbors),this.embedding),j=this.nEpochs?this.nEpochs/3:x.nRows<=1e4?100:30,I=x.getValues().reduce(function(t,e){return e>t?e:t},0);x=x.map(function(t){return t<I/j?0:t}),x=h.eliminateZeros(x);var R=this.makeEpochsPerSample(x.getValues(),j),O=x.getRows(),D=x.getCols();return this.assignOptimizationStateParameters({headEmbedding:A,tailEmbedding:this.embedding,head:O,tail:D,currentEpoch:0,nEpochs:j,nVertices:x.getDims()[1],epochsPerSample:R}),this.prepareForOptimizationLoop(),this.optimizeLayout()},t.prototype.processGraphForSupervisedProjection=function(){var t=this.Y,e=this.X;if(t){if(t.length!==e.length)throw new Error("Length of X and y must be equal");if("categorical"===this.targetMetric){var r=this.targetWeight<1?1/(1-this.targetWeight)*2.5:1e12;this.graph=this.categoricalSimplicialSetIntersection(this.graph,t,r)}}},t.prototype.step=function(){var t=this.optimizationState.currentEpoch;return t<this.getNEpochs()&&this.optimizeLayoutStep(t),this.optimizationState.currentEpoch},t.prototype.getEmbedding=function(){return this.embedding},t.prototype.nearestNeighbors=function(t){var e,r=this.distanceFn,n=this.nNeighbors,i=c.makeNNDescent(r,this.random),o=5+Math.floor(.5===(e=Math.pow(t.length,.5)/20)?0:Math.round(e)),s=Math.max(5,Math.floor(Math.round(function(t){return Math.log(t)/Math.log(2)}(t.length))));this.rpForest=l.makeForest(t,n,o,this.random);var a=i(t,l.makeLeafArray(this.rpForest),n,s);return{knnIndices:a.indices,knnDistances:a.weights}},t.prototype.fuzzySimplicialSet=function(t,e,r){void 0===r&&(r=1);var n=this.knnIndices,i=void 0===n?[]:n,o=this.knnDistances,s=void 0===o?[]:o,a=this.localConnectivity,f=this.smoothKNNDistance(s,e,a),u=f.sigmas,c=f.rhos,l=this.computeMembershipStrengths(i,s,u,c),d=l.rows,p=l.cols,m=l.vals,b=[t.length,t.length],g=new h.SparseMatrix(d,p,m,b),v=h.transpose(g),y=h.pairwiseMultiply(g,v),w=h.subtract(h.add(g,v),y),_=h.multiplyScalar(w,r),x=h.multiplyScalar(y,1-r);return h.add(_,x)},t.prototype.categoricalSimplicialSetIntersection=function(t,e,r,n){void 0===n&&(n=1);var i=_(t,e,n,r);return x(i=h.eliminateZeros(i))},t.prototype.smoothKNNDistance=function(t,e,r,n,i){void 0===r&&(r=1),void 0===n&&(n=64),void 0===i&&(i=1);for(var o=Math.log(e)/Math.log(2)*i,s=d.zeros(t.length),a=d.zeros(t.length),f=0;f<t.length;f++){var u=0,h=1/0,c=1,l=t[f],p=l.filter(function(t){return t>0});if(p.length>=r){var m=Math.floor(r),b=r-m;m>0?(s[f]=p[m-1],b>1e-5&&(s[f]+=b*(p[m]-p[m-1]))):s[f]=b*p[0]}else p.length>0&&(s[f]=d.max(p));for(var g=0;g<n;g++){for(var v=0,y=1;y<t[f].length;y++){var w=t[f][y]-s[f];v+=w>0?Math.exp(-w/c):1}if(Math.abs(v-o)<1e-5)break;v>o?c=(u+(h=c))/2:(u=c,h===1/0?c*=2:c=(u+h)/2)}if(a[f]=c,s[f]>0){var _=d.mean(l);a[f]<.001*_&&(a[f]=.001*_)}else{var x=d.mean(t.map(d.mean));a[f]<.001*x&&(a[f]=.001*x)}}return{sigmas:a,rhos:s}},t.prototype.computeMembershipStrengths=function(t,e,r,n){for(var i=t.length,o=t[0].length,s=d.zeros(i*o),a=d.zeros(i*o),f=d.zeros(i*o),u=0;u<i;u++)for(var h=0;h<o;h++){var c=0;-1!==t[u][h]&&(c=t[u][h]===u?0:e[u][h]-n[u]<=0?1:Math.exp(-(e[u][h]-n[u])/r[u]),s[u*o+h]=u,a[u*o+h]=t[u][h],f[u*o+h]=c)}return{rows:s,cols:a,vals:f}},t.prototype.initializeSimplicialSetEmbedding=function(){for(var t=this,e=this.getNEpochs(),r=this.nComponents,n=this.graph.getValues(),i=0,o=0;o<n.length;o++){var s=n[o];i<n[o]&&(i=s)}var a=this.graph.map(function(t){return t<i/e?0:t});this.embedding=d.zeros(a.nRows).map(function(){return d.zeros(r).map(function(){return 20*d.tauRand(t.random)-10})});var f=[],u=[],h=[],c=a.getAll();for(o=0;o<c.length;o++){var l=c[o];l.value&&(f.push(l.value),h.push(l.row),u.push(l.col))}return{head:u,tail:h,epochsPerSample:this.makeEpochsPerSample(f,e)}},t.prototype.makeEpochsPerSample=function(t,e){var r=d.filled(t.length,-1),n=d.max(t),i=t.map(function(t){return t/n*e});return i.forEach(function(t,n){t>0&&(r[n]=e/i[n])}),r},t.prototype.assignOptimizationStateParameters=function(t){Object.assign(this.optimizationState,t)},t.prototype.prepareForOptimizationLoop=function(){var t=this.repulsionStrength,e=this.learningRate,r=this.negativeSampleRate,n=this.optimizationState,i=n.epochsPerSample,o=n.headEmbedding,a=n.tailEmbedding,f=o[0].length,u=o.length===a.length,h=i.map(function(t){return t/r}),c=s(h),l=s(i);this.assignOptimizationStateParameters({epochOfNextSample:l,epochOfNextNegativeSample:c,epochsPerNegativeSample:h,moveOther:u,initialAlpha:e,alpha:e,gamma:t,dim:f})},t.prototype.initializeOptimization=function(){var t=this.embedding,e=this.embedding,r=this.optimizationState,n=r.head,i=r.tail,o=r.epochsPerSample,s=this.getNEpochs(),a=this.graph.nCols,f=w(this.spread,this.minDist),u=f.a,h=f.b;this.assignOptimizationStateParameters({headEmbedding:t,tailEmbedding:e,head:n,tail:i,epochsPerSample:o,a:u,b:h,nEpochs:s,nVertices:a})},t.prototype.optimizeLayoutStep=function(t){for(var e=this.optimizationState,r=e.head,n=e.tail,i=e.headEmbedding,o=e.tailEmbedding,s=e.epochsPerSample,a=e.epochOfNextSample,f=e.epochOfNextNegativeSample,u=e.epochsPerNegativeSample,h=e.moveOther,c=e.initialAlpha,l=e.alpha,p=e.gamma,m=e.a,b=e.b,g=e.dim,w=e.nEpochs,_=e.nVertices,x=0;x<s.length;x++)if(!(a[x]>t)){var M=r[x],S=n[x],E=i[M],k=o[S],A=y(E,k),j=0;A>0&&(j=-2*m*b*Math.pow(A,b-1),j/=m*Math.pow(A,b)+1);for(var I=0;I<g;I++){var R=v(j*(E[I]-k[I]),4);E[I]+=R*l,h&&(k[I]+=-R*l)}a[x]+=s[x];for(var O=Math.floor((t-f[x])/u[x]),D=0;D<O;D++){var N=d.tauRandInt(_,this.random),C=o[N],B=y(E,C),T=0;if(B>0)T=2*p*b,T/=(.001+B)*(m*Math.pow(B,b)+1);else if(M===N)continue;for(I=0;I<g;I++){R=4;T>0&&(R=v(T*(E[I]-C[I]),4)),E[I]+=R*l}}f[x]+=O*u[x]}return e.alpha=c*(1-t/w),e.currentEpoch+=1,i},t.prototype.optimizeLayoutAsync=function(t){var e=this;return void 0===t&&(t=function(){return!0}),new Promise(function(r,o){var s=function(){return n(e,void 0,void 0,function(){var e,n,a,f,u,h;return i(this,function(i){try{if(e=this.optimizationState,n=e.nEpochs,a=e.currentEpoch,this.embedding=this.optimizeLayoutStep(a),f=this.optimizationState.currentEpoch,u=!1===t(f),h=f===n,u||h)return[2,r(h)];setTimeout(function(){return s()},0)}catch(t){o(t)}return[2]})})};setTimeout(function(){return s()},0)})},t.prototype.optimizeLayout=function(t){void 0===t&&(t=function(){return!0});for(var e=!1,r=[];!e;){var n=this.optimizationState,i=n.nEpochs,o=n.currentEpoch;r=this.optimizeLayoutStep(o);var s=this.optimizationState.currentEpoch,a=!1===t(s);e=s===i||a}return r},t.prototype.getNEpochs=function(){var t=this.graph;if(this.nEpochs>0)return this.nEpochs;var e=t.nRows;return e<=2500?500:e<=5e3?400:e<=7500?300:200},t}();function b(t,e){for(var r=0,n=0;n<t.length;n++)r+=Math.pow(t[n]-e[n],2);return Math.sqrt(r)}r.UMAP=m,r.euclidean=b,r.cosine=function(t,e){for(var r=0,n=0,i=0,o=0;o<t.length;o++)r+=t[o]*e[o],n+=Math.pow(t[o],2),i+=Math.pow(e[o],2);return 0===n&&0===i?0:0===n||0===i?1:1-r/Math.sqrt(n*i)};var g=function(){return function(){this.currentEpoch=0,this.headEmbedding=[],this.tailEmbedding=[],this.head=[],this.tail=[],this.epochsPerSample=[],this.epochOfNextSample=[],this.epochOfNextNegativeSample=[],this.epochsPerNegativeSample=[],this.moveOther=!0,this.initialAlpha=1,this.alpha=1,this.gamma=1,this.a=1.5769434603113077,this.b=.8950608779109733,this.dim=2,this.nEpochs=500,this.nVertices=0}}();function v(t,e){return t>e?e:t<-e?-e:t}function y(t,e){for(var r=0,n=0;n<t.length;n++)r+=Math.pow(t[n]-e[n],2);return r}function w(t,e){var r=d.linear(0,3*t,300).map(function(t){return t<e?1:t}),n=d.zeros(r.length).map(function(n,i){return r[i]>=e?Math.exp(-(r[i]-e)/t):n}),i={x:r,y:n},s={damping:1.5,initialValues:[.5,.5],gradientDifference:.1,maxIterations:100,errorTolerance:.01},a=p.default(i,function(t){var e=o(t,2),r=e[0],n=e[1];return function(t){return 1/(1+r*Math.pow(t,2*n))}},s).parameterValues,f=o(a,2);return{a:f[0],b:f[1]}}function _(t,e,r,n){return void 0===r&&(r=1),void 0===n&&(n=5),t.map(function(t,i,o){return-1===e[i]||-1===e[o]?t*Math.exp(-r):e[i]!==e[o]?t*Math.exp(-n):t})}function x(t){t=h.normalize(t,"max");var e=h.transpose(t),r=h.pairwiseMultiply(e,t);return t=h.add(t,h.subtract(e,r)),h.eliminateZeros(t)}function M(t,e,r){for(var n=d.zeros(t.length).map(function(t){return d.zeros(r[0].length)}),i=0;i<t.length;i++)for(var o=0;o<t[0].length;o++)for(var s=0;s<r[0].length;s++){var a=t[i][o];n[i][s]+=e[i][o]*r[a][s]}return n}r.findABParams=w,r.fastIntersection=_,r.resetLocalConnectivity=x,r.initTransform=M},{"./heap":207,"./matrix":209,"./nn_descent":210,"./tree":211,"./utils":213,"ml-levenberg-marquardt":144}],213:[function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}};function i(t,e){return Math.floor(e()*t)}function o(t){for(var e=[],r=0;r<t;r++)e.push(void 0);return e}function s(t,e){return o(t).map(function(){return e})}function a(t){return s(t,0)}function f(t){return t.reduce(function(t,e){return t+e})}Object.defineProperty(r,"__esModule",{value:!0}),r.tauRandInt=i,r.tauRand=function(t){return t()},r.norm=function(t){var e,r,i=0;try{for(var o=n(t),s=o.next();!s.done;s=o.next()){var a=s.value;i+=Math.pow(a,2)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return Math.sqrt(i)},r.empty=o,r.range=function(t){return o(t).map(function(t,e){return e})},r.filled=s,r.zeros=a,r.ones=function(t){return s(t,1)},r.linear=function(t,e,r){return o(r).map(function(n,i){return t+i*((e-t)/(r-1))})},r.sum=f,r.mean=function(t){return f(t)/t.length},r.max=function(t){for(var e=0,r=0;r<t.length;r++)e=t[r]>e?t[r]:e;return e},r.max2d=function(t){for(var e=0,r=0;r<t.length;r++)for(var n=0;n<t[r].length;n++)e=t[r][n]>e?t[r][n]:e;return e},r.rejectionSample=function(t,e,r){for(var n=a(t),o=0;o<t;o++)for(var s=!0;s;){for(var f=i(e,r),u=!1,h=0;h<o;h++)if(f===n[h]){u=!0;break}u||(s=!1),n[o]=f}return n},r.reshape2d=function(t,e,r){var n=[],i=0;if(t.length!==e*r)throw new Error("Array dimensions must match input length.");for(var o=0;o<e;o++){for(var s=[],a=0;a<r;a++)s.push(t[i]),i+=1;n.push(s)}return n}},{}],214:[function(t,e,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],215:[function(require,module,exports){var indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0;r<t.length;r++)if(t[r]===e)return r;return-1},Object_keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var r in t)e.push(r);return e},forEach=function(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r++)e(t[r],r,t)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(t,e,r){Object.defineProperty(t,e,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(t){return function(t,e,r){t[e]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(t){if(!(this instanceof Script))return new Script(t);this.code=t};Script.prototype.runInContext=function(t){if(!(t instanceof Context))throw new TypeError("needs a 'context' argument.");var e=document.createElement("iframe");e.style||(e.style={}),e.style.display="none",document.body.appendChild(e);var r=e.contentWindow,n=r.eval,i=r.execScript;!n&&i&&(i.call(r,"null"),n=r.eval),forEach(Object_keys(t),function(e){r[e]=t[e]}),forEach(globals,function(e){t[e]&&(r[e]=t[e])});var o=Object_keys(r),s=n.call(r,this.code);return forEach(Object_keys(r),function(e){(e in t||-1===indexOf(o,e))&&(t[e]=r[e])}),forEach(globals,function(e){e in t||defineProp(t,e,r[e])}),document.body.removeChild(e),s},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(t){var e=Script.createContext(t),r=this.runInContext(e);return t&&forEach(Object_keys(e),function(r){t[r]=e[r]}),r},forEach(Object_keys(Script.prototype),function(t){exports[t]=Script[t]=function(e){var r=Script(e);return r[t].apply(r,[].slice.call(arguments,1))}}),exports.isContext=function(t){return t instanceof Context},exports.createScript=function(t){return exports.Script(t)},exports.createContext=Script.createContext=function(t){var e=new Context;return"object"==typeof t&&forEach(Object_keys(t),function(r){e[r]=t[r]}),e}},{}],216:[function(t,e,r){const n=t("tsne").tSNE,{Matrix:i,correlation:o}=t("ml-matrix"),s=t("ml-pca").PCA,a=t("ml-som"),f=t("umap-js").UMAP,u=t("autoencoder"),h=t("csv-parse/lib/sync"),{RandomForest:c}=t("random-forest");e.exports=class{constructor(){this.file="",this.records=[],this.keys=[]}run(t){const e={file:t.File,dimensions:t.Dimensions,column:t["Target variable"],transform:t.Transform,method:t["Projection method"],steps:t.Steps,importance:t["Feature importance"]};if(e.file||this.file.length){if(e.file!==this.file)return console.log("[Vis] Parsing the file"),this.file=e.file,this.records=h(e.file,{columns:!0,skip_empty_lines:!0}),this.keys=Object.keys(this.records[0]).filter(t=>t.length),{"Target variable":{options:["None"].concat(this.keys)}};{const t=this.records.length||1,r=parseInt(e.dimensions),h=this.keys.filter(t=>t!==e.column&&t.length),l=new i(this.records.map(t=>h.map(e=>t[e]))),d=[];let p,m;console.log("[Vis] Transforming data");const b=[];for(let e=0;e<l.columns;e++){const r=l.getColumn(e).reduce((t,e)=>t+isNaN(e),0);console.log("[Vis] Number of NaNs in the variable:",h[e],r,100*r/t+"%"),r<t/10&&(b.push(e),d.push(h[e]))}let g=l.subMatrixColumn(b);e.transform&&("Scale"===e.transform?(console.log("[Vis] Scale input matrix X"),g=g.scaleColumns()):"Log"===e.transform&&(console.log("[Vis] Log-transform matrix X"),g=g.add(1).log()));const v=[];for(let e=0;e<t;e++){0===g.getRow(e).reduce((t,e)=>t+isNaN(e),0)&&v.push(e)}g=g.subMatrixRow(v);const y=this.records.filter((t,e)=>v.includes(e)),w=o(new i(g)).to2DArray();let _,x,M,S;if(g=g.to2DArray(),console.log("[Vis] Target variable:",e.column?e.column:"None"),console.log("[Vis] Keys:",this.keys),console.log("[Vis] Features:",h),console.log("[Vis] Features (filtered):",d),console.log("[Vis] Embedding method:",e.method),"None"!==e.method)if("PCA"===e.method){console.log("[Vis] Fitting PCA"),_=new s(g).predict(g,{nComponents:r}).to2DArray()}else if("SOM"===e.method){const t=new a(100,100,{iterations:Math.round(e.steps/10),fields:g[0].length});t.train(g),_=t.predict(g),3===r&&(_=_.map(t=>t.concat([0])))}else if("UMAP"===e.method){console.log("[Vis] Fitting UMAP");const t=new f({nComponents:r,nEpochs:e.steps});t.initializeFit(g);for(let r=0;r<e.steps;r++)t.step();_=t.getEmbedding()}else if("Autoencoder"===e.method){console.log("[Vis] Fitting Autoencoder");const t=new u({encoder:[{nOut:20,activation:"tanh"},{nOut:r,activation:"sigmoid"}],decoder:[{nOut:20,activation:"tanh"},{nOut:b.length}]});t.fit(g,{iterations:50*e.steps,stepSize:.005,batchSize:20,method:"adam"}),_=t.encode(g),m=[],console.log("[Vis] Generate importance matrix with Autoencoder"),d.forEach((e,r)=>{const n=[],i=[];g.forEach(t=>i.push(t.slice(0)));for(let t=i.length-1;t>0;t--){const e=Math.floor(Math.random()*(t+1)),n=i[t][r];i[t][r]=i[e][r],i[e][r]=n}const o=t.predict(i);d.forEach((t,e)=>{const r=o.reduce((t,r,n)=>Math.pow(r[e]-g[n][e],2)+t,0)/o.length;n.push(r)}),m.push(n)}),console.log("[Vis] Autoencoder importance matrix:",m),m=new i(m).scaleColumns().to2DArray()}else{console.log("[Vis] Fitting t-SNE");const t=new n({epsilon:10,dim:r});t.initDataRaw(g);const i=e.steps||100;for(let e=0;e<=i;e++)t.step();_=t.getSolution()}if(e.column&&e.column.length&&"None"!==e.column){console.log("[Vis] Target variable is present"),S=this.records.map(t=>t[e.column]).filter((t,e)=>v.includes(e));const t=[...new Set(S)].sort((t,e)=>t>e);if(console.log("[Vis] Number of unique values: %d%",g.length?S.length/g.length:0),x=S.map((e,r)=>t.findIndex(t=>t===e)/(t.length>2?t.length-1:1)),M=[[0,"#d90368"],[.25,"#ffd400"],[.5,"#4ecc35"],[.75,"#119ddd"],[1,"#2f2fb7"]],"Random Forest"===e.importance){console.log("[Vis] Fitting random forest");const t=new c({nEstimators:50,maxDepth:10,maxFeatures:"auto"});t.train(g,S),p=t.getFeatureImportances(g,S,{n:3,means:!0,verbose:!0}),console.log("[Vis] Trained random forest:",t),console.log("[Vis] Importance:",p)}}else console.log("[Vis] No target variable specified"),x=Array(g.length).fill(0),M=[[0,"#8A8DA1"],[1,"#8A8DA1"]],"Random Forest"===e.importance&&(console.log("[Vis] Fitting random forest on all variables"),console.log(g,d,d.length),m=d.map((t,e)=>{console.log(`Calculating ${e} of ${d.length}: ${t}`);const r=g.map(t=>t.filter((t,r)=>r!==e)),n=g.map(t=>t.filter((t,r)=>r===e)),i=new c({nEstimators:50,maxDepth:5,maxFeatures:"auto"});i.train(r,n);const o=i.getFeatureImportances(r,n,{n:3,means:!0,verbose:!1});return o.splice(e,0,0),o}));return{Y:_,X:g,params:e,nDims:r,featuresFiltered:d,recordsFiltered:y,target:x,g:S,colorscale:M,impMatrix:m,corr:w,imp:p}}}throw console.log("[Vis] No file provided"),new Error("No file selected")}}},{autoencoder:42,"csv-parse/lib/sync":87,"ml-matrix":146,"ml-pca":147,"ml-som":148,"random-forest":171,tsne:206,"umap-js":208}]},{},[216])(216)});