From 9b352c1935d5bc70553cd2fcb52445f194ef2e8d Mon Sep 17 00:00:00 2001 From: Leon Chen Date: Tue, 25 Oct 2016 10:52:17 -0400 Subject: [PATCH] update build --- dist/keras.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/keras.js b/dist/keras.js index a12efb3..76e4f47 100644 --- a/dist/keras.js +++ b/dist/keras.js @@ -1,11 +1,11 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KerasJS=e():t.KerasJS=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,e,r){Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=595)}([function(t,e,r){var n=r(5),o=r(30),i=r(15),a=r(16),s=r(31),u="prototype",c=function(t,e,r){var l,f,p,h,d=t&c.F,v=t&c.G,y=t&c.S,g=t&c.P,_=t&c.B,b=v?n:y?n[e]||(n[e]={}):(n[e]||{})[u],m=v?o:o[e]||(o[e]={}),w=m[u]||(m[u]={});v&&(r=e);for(l in r)f=!d&&b&&void 0!==b[l],p=(f?b:r)[l],h=_&&f?s(p,n):g&&"function"==typeof p?s(Function.call,p):p,b&&a(b,l,p,t&c.U),m[l]!=p&&i(m,l,h),g&&w[l]!=p&&(w[l]=p)};n.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.layerClass="Layer",this.name=e.name,this.params=[],this.weights={},e.gpu&&weblas?this._useWeblas=!0:this._useWeblas=!1}return i(t,[{key:"setWeights",value:function(t){var e=this;this.params.forEach(function(r,n){e.weights[r]=t[n]})}},{key:"toggleGpu",value:function(t){var e="undefined"==typeof t?!this._useWeblas:t;e&&weblas?this._useWeblas=!0:this._useWeblas=!1}},{key:"call",value:function(t){return t}},{key:"createWeblasWeights",value:function(){var t=this;this.weblasWeights={},this.params.forEach(function(e,r){if(1===t.weights[e].tensor.shape.length){var n=[1,t.weights[e].tensor.shape[0]];t.weblasWeights[e]=new weblas.pipeline.Tensor(n,t.weights[e].tensor.data)}if(2===t.weights[e].tensor.shape.length){var o=t.weights[e].tensor.shape;t.weblasWeights[e]=new weblas.pipeline.Tensor(o,t.weights[e].tensor.data)}})}},{key:"transferWeblasWeights",value:function(){var t=this;this.params.forEach(function(e,r){if(t.weblasWeights[e]){var n=t.weblasWeights[e].shape,o=t.weblasWeights[e].transfer(!0);t.weights[e].tensor=(0,c.default)((0,s.default)(o,n))}})}},{key:"deleteWeblasWeights",value:function(){var t=this;this.params.forEach(function(e,r){t.weblasWeights[e]&&(t.weblasWeights[e].delete(),delete t.weblasWeights[e])}),delete this.weblasWeights}}]),t}();e.default=l},function(t,e,r){var n=r(7);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};o(this,t),this._type=n.type||Float32Array,e&&e.length&&(e instanceof this._type||e instanceof Array)?(f(e,r),this.tensor=(0,s.default)(e,r),this.tensor=(0,s.default)(new this._type(e),r)):!e.length&&r.length?this.tensor=(0,s.default)(new this._type(r.reduce(function(t,e){return t*e},1)),r):this.tensor=(0,s.default)(new this._type([]),[]),this._gpuMaxSizeExceeded=!1}return i(t,[{key:"createWeblasTensor",value:function(){if(this.weblasTensor&&this.weblasTensor.delete(),1===this.tensor.shape.length){var t=this.tensor.shape[0];if(t>l.MAX_TEXTURE_SIZE)this._gpuMaxSizeExceeded=!0;else{var e=[1,t];this.weblasTensor=new weblas.pipeline.Tensor(e,this.tensor.data)}}else{if(2!==this.tensor.shape.length)throw new Error("[Tensor] can only create weblas Tensor for 1-D or 2-D only");if(this.tensor.shape.some(function(t){return t>l.MAX_TEXTURE_SIZE}))this._gpuMaxSizeExceeded=!0;else{var r=this.tensor.shape;this.weblasTensor=new weblas.pipeline.Tensor(r,this.tensor.data)}}}},{key:"transferWeblasTensor",value:function(){if(this.weblasTensor){var t=this.weblasTensor.shape,e=this.weblasTensor.transfer(!0);this.tensor=(0,c.default)((0,s.default)(e,t))}}},{key:"deleteWeblasTensor",value:function(){this.weblasTensor&&(this.weblasTensor.delete(),delete this.weblasTensor)}},{key:"replaceTensorData",value:function(t){if(t&&t.length&&t instanceof this._type)this.tensor.data=t;else{if(!(t&&t.length&&t instanceof Array))throw new Error("[Tensor] invalid input for replaceTensorData method.");this.tensor.data=new this._type(t)}}}]),t}();e.default=p},function(t,e,r){"use strict";function n(t){if(!t)return s;for(var e=0;e>",rrshift:">>>"};!function(){for(var t in u){var r=u[t];e[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+r+"c"},funcName:t}),e[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+r+"=b"},rvalue:!0,funcName:t+"eq"}),e[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+r+"s"},funcName:t+"s"}),e[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+r+"=s"},rvalue:!0,funcName:t+"seq"})}}();var c={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in c){var r=c[t];e[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+r+"b"},funcName:t}),e[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+r+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in l){var r=l[t];e[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+r+"c"},funcName:t}),e[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+r+"s"},funcName:t+"s"}),e[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+r+"b"},rvalue:!0,count:2,funcName:t+"eq"}),e[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+r+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),e.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),e.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),e.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),e.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),e.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),e.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),e.equals=a({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){var n=r(75)("wks"),o=r(46),i=r(5).Symbol,a="function"==typeof i,s=t.exports=function(t){return n[t]||(n[t]=a&&i[t]||(a?i:o)("Symbol."+t))};s.store=n},function(t,e,r){t.exports=!r(6)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,r){var n=r(2),o=r(142),i=r(28),a=Object.defineProperty;e.f=r(9)?Object.defineProperty:function(t,e,r){if(n(t),e=i(e,!0),n(r),o)try{return a(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){var n=r(37),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e,r){var n=r(23);t.exports=function(t){return Object(n(t))}},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){var n=r(10),o=r(36);t.exports=r(9)?function(t,e,r){return n.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){var n=r(5),o=r(15),i=r(13),a=r(46)("src"),s="toString",u=Function[s],c=(""+u).split(s);r(30).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,r,s){var u="function"==typeof r;u&&(i(r,"name")||o(r,"name",e)),t[e]!==r&&(u&&(i(r,a)||o(r,a,t[e]?""+t[e]:c.join(String(e)))),t===n?t[e]=r:s?t[e]?t[e]=r:o(t,e,r):(delete t[e],o(t,e,r)))})(Function.prototype,s,function(){return"function"==typeof this&&this[a]||u.call(this)})},function(t,e,r){var n=r(0),o=r(6),i=r(23),a=/"/g,s=function(t,e,r,n){var o=String(i(t)),s="<"+e;return""!==r&&(s+=" "+r+'="'+String(n).replace(a,""")+'"'),s+">"+o+""};t.exports=function(t,e){var r={};r[t]=e(s),n(n.P+n.F*o(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",r)}},function(t,e,r){var n=r(58),o=r(23);t.exports=function(t){return n(o(t))}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(1===t.tensor.shape.length){var e=h.default.sup(t.tensor);h.default.subseq(t.tensor,e),h.default.expeq(t.tensor);var r=h.default.sum(t.tensor);h.default.divseq(t.tensor,r)}else{if(2!==t.tensor.shape.length)throw new Error("[activations.softmax] tensor shape "+t.tensor.shape+" not supported.");for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=e.alpha,n=void 0===r?0:r,o=e.maxValue,i=void 0===o?null:o,a=void 0;return 0!==n&&(a=new g.default([],t.tensor.shape),h.default.mins(a.tensor,t.tensor,0),h.default.mulseq(a.tensor,n)),h.default.maxseq(t.tensor,0),i&&h.default.minseq(t.tensor,i),a&&h.default.addeq(t.tensor,a.tensor),this}function u(t){return m(t.tensor),this}function c(t){return w(t.tensor),this}function l(t){return x(t.tensor),this}function f(t){return this}Object.defineProperty(e,"__esModule",{value:!0}),e.softmax=o,e.softplus=i,e.softsign=a,e.relu=s,e.tanh=u,e.sigmoid=c,e.hardSigmoid=l,e.linear=f;var p=r(4),h=n(p),d=r(25),v=n(d),y=r(3),g=n(y),_=(0,v.default)({args:["array"],body:function(t){t=Math.log(Math.exp(t)+1)}}),b=(0,v.default)({args:["array"],body:function(t){t/=1+Math.abs(t)}}),m=(0,v.default)({args:["array"],body:function(t){t=Math.tanh(t)}}),w=(0,v.default)({args:["array"],body:function(t){t=1/(1+Math.exp(-t))}}),x=(0,v.default)({args:["array"],body:function(t){t=.2*t+.5,t<=0?t=0:t>=1&&(t=1)}})},function(t,e,r){var n=r(59),o=r(36),i=r(18),a=r(28),s=r(13),u=r(142),c=Object.getOwnPropertyDescriptor;e.f=r(9)?c:function(t,e){if(t=i(t),e=a(e,!0),u)try{return c(t,e)}catch(t){}if(s(t,e))return o(!n.f.call(t,e),t[e])}},function(t,e,r){var n=r(13),o=r(12),i=r(103)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),n(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(6);t.exports=function(t,e){return!!t&&n(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e,r){"use strict";function n(t){for(var e in t)a.indexOf(e)<0&&s.indexOf(e)<0&&console.warn("cwise: Unknown argument '"+e+"' passed to expression compiler");for(var r=0;rw;w++)if((p||w in _)&&(v=_[w],y=b(v,w,g),t))if(r)x[w]=y;else if(y)switch(t){case 3:return!0;case 5:return v;case 6:return w;case 2:x.push(v)}else if(l)return!1;return f?-1:c||l?l:x}}},function(t,e,r){var n=r(0),o=r(30),i=r(6);t.exports=function(t,e){var r=(o.Object||{})[t]||Object[t],a={};a[t]=e(r),n(n.S+n.F*i(function(){r(1)}),"Object",a)}},function(t,e,r){var n=r(7);t.exports=function(t,e){if(!n(t))return t;var r,o;if(e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!n(o=r.call(t)))return o;if(!e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var n=r(172),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,e,r){var n=r(14);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,r){var n=r(158),o=r(0),i=r(75)("metadata"),a=i.store||(i.store=new(r(161))),s=function(t,e,r){var o=a.get(t);if(!o){if(!r)return;a.set(t,o=new n)}var i=o.get(e);if(!i){if(!r)return;o.set(e,i=new n)}return i},u=function(t,e,r){var n=s(e,r,!1);return void 0!==n&&n.has(t)},c=function(t,e,r){var n=s(e,r,!1);return void 0===n?void 0:n.get(t)},l=function(t,e,r,n){s(r,n,!0).set(t,e)},f=function(t,e){var r=s(t,e,!1),n=[];return r&&r.forEach(function(t,e){n.push(e)}),n},p=function(t){return void 0===t||"symbol"==typeof t?t:String(t)},h=function(t){o(o.S,"Reflect",t)};t.exports={store:a,map:s,has:u,get:c,set:l,keys:f,key:p,exp:h}},function(t,e,r){"use strict";if(r(9)){var n=r(39),o=r(5),i=r(6),a=r(0),s=r(76),u=r(110),c=r(31),l=r(38),f=r(36),p=r(15),h=r(43),d=r(37),v=r(11),y=r(45),g=r(28),_=r(13),b=r(155),m=r(57),w=r(7),x=r(12),O=r(95),j=r(40),E=r(21),S=r(41).f,k=r(112),P=r(46),A=r(8),C=r(26),M=r(66),T=r(104),R=r(113),F=r(52),I=r(72),D=r(44),L=r(88),N=r(135),U=r(10),B=r(20),V=U.f,W=B.f,z=o.RangeError,q=o.TypeError,G=o.Uint8Array,H="ArrayBuffer",Y="Shared"+H,$="BYTES_PER_ELEMENT",K="prototype",X=Array[K],Z=u.ArrayBuffer,Q=u.DataView,J=C(0),tt=C(2),et=C(3),rt=C(4),nt=C(5),ot=C(6),it=M(!0),at=M(!1),st=R.values,ut=R.keys,ct=R.entries,lt=X.lastIndexOf,ft=X.reduce,pt=X.reduceRight,ht=X.join,dt=X.sort,vt=X.slice,yt=X.toString,gt=X.toLocaleString,_t=A("iterator"),bt=A("toStringTag"),mt=P("typed_constructor"),wt=P("def_constructor"),xt=s.CONSTR,Ot=s.TYPED,jt=s.VIEW,Et="Wrong length!",St=C(1,function(t,e){return Tt(T(t,t[wt]),e)}),kt=i(function(){return 1===new G(new Uint16Array([1]).buffer)[0]}),Pt=!!G&&!!G[K].set&&i(function(){new G(1).set({})}),At=function(t,e){if(void 0===t)throw q(Et);var r=+t,n=v(t);if(e&&!b(r,n))throw z(Et);return n},Ct=function(t,e){var r=d(t);if(r<0||r%e)throw z("Wrong offset!");return r},Mt=function(t){if(w(t)&&Ot in t)return t;throw q(t+" is not a typed array!")},Tt=function(t,e){if(!(w(t)&&mt in t))throw q("It is not a typed array constructor!");return new t(e)},Rt=function(t,e){return Ft(T(t,t[wt]),e)},Ft=function(t,e){for(var r=0,n=e.length,o=Tt(t,n);n>r;)o[r]=e[r++];return o},It=function(t,e,r){V(t,e,{get:function(){return this._d[r]}})},Dt=function(t){var e,r,n,o,i,a,s=x(t),u=arguments.length,l=u>1?arguments[1]:void 0,f=void 0!==l,p=k(s);if(void 0!=p&&!O(p)){for(a=p.call(s),n=[],e=0;!(i=a.next()).done;e++)n.push(i.value);s=n}for(f&&u>2&&(l=c(l,arguments[2],2)),e=0,r=v(s.length),o=Tt(this,r);r>e;e++)o[e]=f?l(s[e],e):s[e];return o},Lt=function(){for(var t=0,e=arguments.length,r=Tt(this,e);e>t;)r[t]=arguments[t++];return r},Nt=!!G&&i(function(){gt.call(new G(1))}),Ut=function(){return gt.apply(Nt?vt.call(Mt(this)):Mt(this),arguments)},Bt={copyWithin:function(t,e){return N.call(Mt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return rt(Mt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return L.apply(Mt(this),arguments)},filter:function(t){return Rt(this,tt(Mt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return nt(Mt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return ot(Mt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(Mt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return at(Mt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return it(Mt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(Mt(this),arguments)},lastIndexOf:function(t){return lt.apply(Mt(this),arguments)},map:function(t){return St(Mt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return ft.apply(Mt(this),arguments)},reduceRight:function(t){return pt.apply(Mt(this),arguments)},reverse:function(){for(var t,e=this,r=Mt(e).length,n=Math.floor(r/2),o=0;o1?arguments[1]:void 0)},sort:function(t){return dt.call(Mt(this),t)},subarray:function(t,e){var r=Mt(this),n=r.length,o=y(t,n);return new(T(r,r[wt]))(r.buffer,r.byteOffset+o*r.BYTES_PER_ELEMENT,v((void 0===e?n:y(e,n))-o))}},Vt=function(t,e){return Rt(this,vt.call(Mt(this),t,e))},Wt=function(t){Mt(this);var e=Ct(arguments[1],1),r=this.length,n=x(t),o=v(n.length),i=0;if(o+e>r)throw z(Et);for(;i255?255:255&n),o.v[d](r*e+o.o,n,kt)},A=function(t,e){V(t,e,{get:function(){return k(this,e)},set:function(t){return P(this,e,t)},enumerable:!0})};b?(y=r(function(t,r,n,o){l(t,y,c,"_d");var i,a,s,u,f=0,h=0;if(w(r)){if(!(r instanceof Z||(u=m(r))==H||u==Y))return Ot in r?Ft(y,r):Dt.call(y,r);i=r,h=Ct(n,e);var d=r.byteLength;if(void 0===o){if(d%e)throw z(Et);if(a=d-h,a<0)throw z(Et)}else if(a=v(o)*e,a+h>d)throw z(Et);s=a/e}else s=At(r,!0),a=s*e,i=new Z(a);for(p(t,"_d",{b:i,o:h,l:a,e:s,v:new Q(i)});f0?n:r)(t)}},function(t,e){t.exports=function(t,e,r,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,e){t.exports=!1},function(t,e,r){var n=r(2),o=r(148),i=r(91),a=r(103)("IE_PROTO"),s=function(){},u="prototype",c=function(){var t,e=r(90)("iframe"),n=i.length,o="<",a=">";for(e.style.display="none",r(93).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+a+"document.F=Object"+o+"/script"+a),t.close(),c=t.F;n--;)delete c[u][i[n]];return c()};t.exports=Object.create||function(t,e){var r;return null!==t?(s[u]=n(t),r=new s,s[u]=null,r[a]=t):r=c(),void 0===e?r:o(r,e)}},function(t,e,r){var n=r(150),o=r(91).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},function(t,e,r){var n=r(150),o=r(91);t.exports=Object.keys||function(t){return n(t,o)}},function(t,e,r){var n=r(16);t.exports=function(t,e,r){for(var o in e)n(t,o,e[o],r);return t}},function(t,e,r){"use strict";var n=r(5),o=r(10),i=r(9),a=r(8)("species");t.exports=function(t){var e=n[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e,r){var n=r(37),o=Math.max,i=Math.min;t.exports=function(t,e){return t=n(t),t<0?o(t+e,0):i(t,e)}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e,r){function n(t,e){var r=i(t,e);return o(r)?r:void 0}var o=r(464),i=r(498);t.exports=n},function(t,e,r){function n(t){return a(t)?o(t):i(t)}var o=r(449),i=r(466),a=r(84);t.exports=n},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(8)("unscopables"),o=Array.prototype;void 0==o[n]&&r(15)(o,n,{}),t.exports=function(t){o[n][t]=!0}},function(t,e,r){var n=r(31),o=r(144),i=r(95),a=r(2),s=r(11),u=r(112),c={},l={},e=t.exports=function(t,e,r,f,p){var h,d,v,y,g=p?function(){return t}:u(t),_=n(r,f,e?2:1),b=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(i(g)){for(h=s(t.length);h>b;b++)if(y=e?_(a(d=t[b])[0],d[1]):_(t[b]),y===c||y===l)return y}else for(v=g.call(t);!(d=v.next()).done;)if(y=o(v,_,d.value,e),y===c||y===l)return y};e.BREAK=c,e.RETURN=l},function(t,e){t.exports={}},function(t,e,r){var n=r(10).f,o=r(13),i=r(8)("toStringTag");t.exports=function(t,e,r){t&&!o(t=r?t:t.prototype,i)&&n(t,i,{configurable:!0,value:e})}},function(t,e,r){var n=r(0),o=r(23),i=r(6),a=r(108),s="["+a+"]",u="​…",c=RegExp("^"+s+s+"*"),l=RegExp(s+s+"*$"),f=function(t,e,r){var o={},s=i(function(){return!!a[t]()||u[t]()!=u}),c=o[t]=s?e(p):a[t];r&&(o[r]=c),n(n.P+n.F*s,"String",o)},p=f.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(c,"")), -2&e&&(t=t.replace(l,"")),t};t.exports=f},function(t,e){function r(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=r},function(t,e,r){"use strict";t.exports.gemv=r(575),t.exports.gbmv=r(574),t.exports.symv=r(581),t.exports.sbmv=r(577),t.exports.spmv=r(578),t.exports.trmv=r(587),t.exports.tbmv=r(584),t.exports.trsv=r(588),t.exports.tbsv=r(585),t.exports.tpsv=r(586),t.exports.ger=r(576),t.exports.syr=r(582),t.exports.spr=r(579),t.exports.syr2=r(583),t.exports.spr2=r(580),t.exports.trmv_lower=function(e,r){return console.warn("trmv_lower is deprecated. Please use the 'isLower' flag with trmv."),t.exports.trmv(e,r,!0)},t.exports.trsv_lower=function(e,r){return console.warn("trsv_lower is deprecated. Please use the 'isLower' flag with trsv."),t.exports.trsv(e,r,!0)}},function(t,e,r){var n=r(22),o=r(8)("toStringTag"),i="Arguments"==n(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,r,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=a(e=Object(t),o))?r:i?n(e):"Object"==(s=n(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,r){var n=r(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){function n(t){if("string"==typeof t||o(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}var o=r(85),i=1/0;t.exports=n},function(t,e){function r(t){return null!=t&&"object"==typeof t}t.exports=r},function(t,e,r){function n(t){return null==t?"":o(t)}var o=r(480);t.exports=n},function(t,e,r){"use strict";function n(t){return Array.isArray(t)?[t.length,t[0].length]:t.shape}function o(t,e,r){var o=n(t),i=n(e),a=n(r);if(o[0]!==i[0]||o[1]!==a[1]||i[1]!==a[0])throw new Error("Mismatched array shapes for matrix product")}function i(t){if(Array.isArray(t)){if(Array.isArray(t))return["r","native"]}else if(t.shape&&2===t.shape.length)return t.order[0]?["r",t.dtype]:["c",t.dtype];throw new Error("Unrecognized data type")}function a(t,e,r,n,a){void 0===n&&(n=1),void 0===a&&(a=0);var c=1!==n,l=0!==a,f=i(t),p=i(e),h=i(r);o(t,e,r);var d=[f,p,h,c,l].join(":"),v=u[d];return v||(v=u[d]=s(f,p,h,c,l)),v(t,e,r,n,a)}t.exports=a;var s=r(590),u={}},function(t,e,r){function n(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+r+"_set("+c.join(",")+",v){"),n?i.push("return this.data.set("+l+",v)}"):i.push("return this.data["+l+"]=v}"),i.push("proto.get=function "+r+"_get("+c.join(",")+"){"),n?i.push("return this.data.get("+l+")}"):i.push("return this.data["+l+"]}"),i.push("proto.index=function "+r+"_index(",c.join(),"){return "+l+"}"),i.push("proto.hi=function "+r+"_hi("+c.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),v=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});i.push("proto.lo=function "+r+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+v.join(","));for(var y=0;y=0){d=i"+y+"|0;b+=c"+y+"*d;a"+y+"-=d}");i.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),i.push("proto.step=function "+r+"_step("+c.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var y=0;y=0){c=(c+this.stride["+y+"]*i"+y+")|0}else{a.push(this.shape["+y+"]);b.push(this.stride["+y+"])}");i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var a=new Function("CTOR_LIST","ORDER",i.join("\n"));return a(f[t],o)}function a(t){if(c(t))return"buffer";if(l)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var o=f.array[0];return o([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var u=s-1,c=1;u>=0;--u)r[u]=c,c*=e[u]}if(void 0===n){n=0;for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Convolution2D";var n=t.nbFilter,o=void 0===n?1:n,s=t.nbRow,u=void 0===s?3:s,c=t.nbCol,l=void 0===c?3:c,f=t.activation,h=void 0===f?"linear":f,d=t.borderMode,v=void 0===d?"valid":d,y=t.subsample,g=void 0===y?[1,1]:y,_=t.dimOrdering,b=void 0===_?"tf":_,m=t.bias,w=void 0===m||m;if(r.kernelShape=[o,u,l],r.activation=p[h],"valid"!==v&&"same"!==v)throw new Error(r.name+" [Convolution2D layer] Invalid borderMode.");if(r.borderMode=v,r.subsample=g,"tf"!==b&&"th"!==b)throw new Error(r.name+" [Convolution2D layer] Only tf and th dim ordering are allowed.");return r.dimOrdering=b,r.bias=w,r.params=r.bias?["W","b"]:["W"],r}return s(e,t),c(e,[{key:"setWeights",value:function(t){"th"===this.dimOrdering&&(t[0].tensor=t[0].tensor.transpose(2,3,1,0)),l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,t),this._w2row(),this._useWeblas&&(this._wRowsMat.createWeblasTensor(),this._wRowsMat.weblasTensor=this._wRowsMat.weblasTensor.transpose(),this.bias?this.weights.b.createWeblasTensor():(this._zerosVec=new d.default([],[this.weights.W.tensor.shape[3]]),this._zerosVec.createWeblasTensor()))}},{key:"_calcOutputShape",value:function(t){var e=t.tensor.shape[0],r=t.tensor.shape[1],n=u(this.kernelShape,3),o=n[0],i=n[1],a=n[2],s="same"===this.borderMode?Math.floor((e+this.subsample[0]-1)/this.subsample[0]):Math.floor((e-i+this.subsample[0])/this.subsample[0]),c="same"===this.borderMode?Math.floor((r+this.subsample[1]-1)/this.subsample[1]):Math.floor((r-a+this.subsample[1])/this.subsample[1]),l=o,f="same"===this.borderMode?Math.max(0,Math.floor((s-1)*this.subsample[0]+i-e)):0,p="same"===this.borderMode?Math.max(0,Math.floor((c-1)*this.subsample[1]+a-r)):0,h=Math.floor(f/2),d=f-h,v=Math.floor(p/2),y=p-v;this.outputShape=[s,c,l],this.inputPadding=[h,d,v,y]}},{key:"_padInput",value:function(t){if("same"===this.borderMode){var e=u(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=u(this.inputPadding,4),a=i[0],s=i[1],c=i[2],l=i[3],f=r+a+s,p=n+c+l,h=new d.default([],[f,p,o]);_.default.assign(h.tensor.hi(r+a,n+c,o).lo(a,c,0),t.tensor),t.tensor=h.tensor}return t}},{key:"_im2col",value:function(t){var e=u(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=this.kernelShape[1],a=this.kernelShape[2],s=this.outputShape[0],c=this.outputShape[1],l=s*c,f=i*a*o;if(this._imColsMat||(this._imColsMat=new d.default([],[l,f])),1===i&&1===a&&1===this.subsample[0]&&1===this.subsample[1])return this._imColsMat.replaceTensorData(t.tensor.data),this._useWeblas&&this._imColsMat.createWeblasTensor(),this._imColsMat;for(var p=new d.default([],[i,a,o]),h=0,v=0,y=r-i;v<=y;v+=this.subsample[0])for(var g=0,b=n-a;g<=b;g+=this.subsample[1])_.default.assign(p.tensor,t.tensor.hi(v+i,g+a,o).lo(v,g,0)),this._imColsMat.tensor.data.set(p.tensor.data,h),h+=f;return this._useWeblas&&this._imColsMat.createWeblasTensor(),this._imColsMat}},{key:"_w2row",value:function(){var t=this.weights.W.tensor.shape[2],e=u(this.kernelShape,3),r=e[0],n=e[1],o=e[2],i=n*o*t;this._wRowsMat=new d.default([],[i,r]);for(var a=new d.default([],[n,o,t]),s=new d.default([],[i]),c=0;cl;)if(s=u[l++],s!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===r)return t||l||0;return!t&&-1}}},function(t,e,r){"use strict";var n=r(5),o=r(0),i=r(16),a=r(43),s=r(35),u=r(51),c=r(38),l=r(7),f=r(6),p=r(72),h=r(53),d=r(94);t.exports=function(t,e,r,v,y,g){var _=n[t],b=_,m=y?"set":"add",w=b&&b.prototype,x={},O=function(t){var e=w[t];i(w,t,"delete"==t?function(t){return!(g&&!l(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(g&&!l(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return g&&!l(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,r){return e.call(this,0===t?0:t,r),this})};if("function"==typeof b&&(g||w.forEach&&!f(function(){(new b).entries().next()}))){var j=new b,E=j[m](g?{}:-0,1)!=j,S=f(function(){j.has(1)}),k=p(function(t){new b(t)}),P=!g&&f(function(){for(var t=new b,e=5;e--;)t[m](e,e);return!t.has(-0)});k||(b=e(function(e,r){c(e,b,t);var n=d(new _,e,b);return void 0!=r&&u(r,y,n[m],n),n}),b.prototype=w,w.constructor=b),(S||P)&&(O("delete"),O("has"),y&&O("get")),(P||E)&&O(m),g&&w.clear&&delete w.clear}else b=v.getConstructor(e,t,y,m),a(b.prototype,r),s.NEED=!0;return h(b,t),x[t]=b,o(o.G+o.W+o.F*(b!=_),x),g||v.setStrong(b,t,y),b}},function(t,e,r){"use strict";var n=r(15),o=r(16),i=r(6),a=r(23),s=r(8);t.exports=function(t,e,r){var u=s(t),c=r(a,u,""[t]),l=c[0],f=c[1];i(function(){var e={};return e[u]=function(){return 7},7!=""[t](e)})&&(o(String.prototype,t,l),n(RegExp.prototype,u,2==e?function(t,e){return f.call(t,this,e)}:function(t){return f.call(t,this)}))}},function(t,e,r){"use strict";var n=r(2);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e){t.exports=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)}},function(t,e,r){var n=r(7),o=r(22),i=r(8)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},function(t,e,r){var n=r(8)("iterator"),o=!1;try{var i=[7][n]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var r=!1;try{var i=[7],a=i[n]();a.next=function(){return{done:r=!0}},i[n]=function(){return a},t(i)}catch(t){}return r}},function(t,e,r){t.exports=r(39)||!r(6)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete r(5)[t]})},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){var n=r(5),o="__core-js_shared__",i=n[o]||(n[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,r){for(var n,o=r(5),i=r(15),a=r(46),s=a("typed_array"),u=a("view"),c=!(!o.ArrayBuffer||!o.DataView),l=c,f=0,p=9,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f1?arguments[1]:void 0,r),u=a>2?arguments[2]:void 0,c=void 0===u?r:o(u,r);c>s;)e[s++]=t;return e}},function(t,e,r){"use strict";var n=r(10),o=r(36);t.exports=function(t,e,r){e in t?n.f(t,e,o(0,r)):t[e]=r}},function(t,e,r){var n=r(7),o=r(5).document,i=n(o)&&n(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,r){var n=r(8)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[n]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,r){t.exports=r(5).document&&document.documentElement},function(t,e,r){var n=r(7),o=r(102).set;t.exports=function(t,e,r){var i,a=e.constructor;return a!==r&&"function"==typeof a&&(i=a.prototype)!==r.prototype&&n(i)&&o&&o(t,i),t}},function(t,e,r){var n=r(52),o=r(8)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||i[o]===t)}},function(t,e,r){var n=r(22);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,r){"use strict";var n=r(40),o=r(36),i=r(53),a={};r(15)(a,r(8)("iterator"),function(){return this}),t.exports=function(t,e,r){t.prototype=n(a,{next:o(1,r)}),i(t,e+" Iterator")}},function(t,e,r){"use strict";var n=r(39),o=r(0),i=r(16),a=r(15),s=r(13),u=r(52),c=r(97),l=r(53),f=r(21),p=r(8)("iterator"),h=!([].keys&&"next"in[].keys()),d="@@iterator",v="keys",y="values",g=function(){return this};t.exports=function(t,e,r,_,b,m,w){c(r,e,_);var x,O,j,E=function(t){if(!h&&t in A)return A[t];switch(t){case v:return function(){return new r(this,t)};case y:return function(){return new r(this,t)}}return function(){return new r(this,t)}},S=e+" Iterator",k=b==y,P=!1,A=t.prototype,C=A[p]||A[d]||b&&A[b],M=C||E(b),T=b?k?E("entries"):M:void 0,R="Array"==e?A.entries||C:C;if(R&&(j=f(R.call(new t)),j!==Object.prototype&&(l(j,S,!0),n||s(j,p)||a(j,p,g))),k&&C&&C.name!==y&&(P=!0,M=function(){return C.call(this)}),n&&!w||!h&&!P&&A[p]||a(A,p,M),u[e]=M,u[S]=g,b)if(x={values:k?M:E(y),keys:m?M:E(v),entries:T},w)for(O in x)O in A||i(A,O,x[O]);else o(o.P+o.F*(h||P),e,x);return x}},function(t,e){var r=Math.expm1;t.exports=!r||r(10)>22025.465794806718||r(10)<22025.465794806718||r(-2e-17)!=-2e-17?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:r},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e,r){var n=r(5),o=r(109).set,i=n.MutationObserver||n.WebKitMutationObserver,a=n.process,s=n.Promise,u="process"==r(22)(a);t.exports=function(){var t,e,r,c=function(){var n,o;for(u&&(n=a.domain)&&n.exit();t;){o=t.fn,t=t.next;try{o()}catch(n){throw t?r():e=void 0,n}}e=void 0,n&&n.enter()};if(u)r=function(){a.nextTick(c)};else if(i){var l=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),r=function(){f.data=l=!l}}else if(s&&s.resolve){var p=s.resolve();r=function(){p.then(c)}}else r=function(){o.call(n,c)};return function(n){var o={fn:n,next:void 0};e&&(e.next=o),t||(t=o,r()),e=o}}},function(t,e,r){var n=r(7),o=r(2),i=function(t,e){if(o(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=r(31)(Function.call,r(20).f(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,r){return i(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:i}},function(t,e,r){var n=r(75)("keys"),o=r(46);t.exports=function(t){return n[t]||(n[t]=o(t))}},function(t,e,r){var n=r(2),o=r(14),i=r(8)("species");t.exports=function(t,e){var r,a=n(t).constructor;return void 0===a||void 0==(r=n(a)[i])?e:o(r)}},function(t,e,r){var n=r(37),o=r(23);t.exports=function(t){return function(e,r){var i,a,s=String(o(e)),u=n(r),c=s.length;return u<0||u>=c?t?"":void 0:(i=s.charCodeAt(u),i<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):i:t?s.slice(u,u+2):(i-55296<<10)+(a-56320)+65536)}}},function(t,e,r){var n=r(71),o=r(23);t.exports=function(t,e,r){if(n(e))throw TypeError("String#"+r+" doesn't accept regex!");return String(o(t))}},function(t,e,r){"use strict";var n=r(37),o=r(23);t.exports=function(t){var e=String(o(this)),r="",i=n(t);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(r+=e);return r}},function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,r){var n,o,i,a=r(31),s=r(70),u=r(93),c=r(90),l=r(5),f=l.process,p=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,v=0,y={},g="onreadystatechange",_=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){_.call(t.data)};p&&h||(p=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return y[++v]=function(){s("function"==typeof t?t:Function(t),e)},n(v),v},h=function(t){delete y[t]},"process"==r(22)(f)?n=function(t){f.nextTick(a(_,t,1))}:d?(o=new d,i=o.port2,o.port1.onmessage=b,n=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(n=function(t){l.postMessage(t+"","*")},l.addEventListener("message",b,!1)):n=g in c("script")?function(t){u.appendChild(c("script"))[g]=function(){u.removeChild(this),_.call(t)}}:function(t){setTimeout(a(_,t,1),0)}),t.exports={set:p,clear:h}},function(t,e,r){"use strict";var n=r(5),o=r(9),i=r(39),a=r(76),s=r(15),u=r(43),c=r(6),l=r(38),f=r(37),p=r(11),h=r(41).f,d=r(10).f,v=r(88),y=r(53),g="ArrayBuffer",_="DataView",b="prototype",m="Wrong length!",w="Wrong index!",x=n[g],O=n[_],j=n.Math,E=n.RangeError,S=n.Infinity,k=x,P=j.abs,A=j.pow,C=j.floor,M=j.log,T=j.LN2,R="buffer",F="byteLength",I="byteOffset",D=o?"_b":R,L=o?"_l":F,N=o?"_o":I,U=function(t,e,r){var n,o,i,a=Array(r),s=8*r-e-1,u=(1<>1,l=23===e?A(2,-24)-A(2,-77):0,f=0,p=t<0||0===t&&1/t<0?1:0;for(t=P(t),t!=t||t===S?(o=t!=t?1:0,n=u):(n=C(M(t)/T),t*(i=A(2,-n))<1&&(n--,i*=2),t+=n+c>=1?l/i:l*A(2,1-c),t*i>=2&&(n++,i/=2),n+c>=u?(o=0,n=u):n+c>=1?(o=(t*i-1)*A(2,e),n+=c):(o=t*A(2,c-1)*A(2,e),n=0));e>=8;a[f++]=255&o,o/=256,e-=8);for(n=n<0;a[f++]=255&n,n/=256,s-=8);return a[--f]|=128*p,a},B=function(t,e,r){var n,o=8*r-e-1,i=(1<>1,s=o-7,u=r-1,c=t[u--],l=127&c;for(c>>=7;s>0;l=256*l+t[u],u--,s-=8);for(n=l&(1<<-s)-1,l>>=-s,s+=e;s>0;n=256*n+t[u],u--,s-=8);if(0===l)l=1-a;else{if(l===i)return n?NaN:c?-S:S;n+=A(2,e),l-=a}return(c?-1:1)*n*A(2,l-e)},V=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},W=function(t){return[255&t]},z=function(t){return[255&t,t>>8&255]},q=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},G=function(t){return U(t,52,8)},H=function(t){return U(t,23,4)},Y=function(t,e,r){d(t[b],e,{get:function(){return this[r]}})},$=function(t,e,r,n){var o=+r,i=f(o);if(o!=i||i<0||i+e>t[L])throw E(w);var a=t[D]._b,s=i+t[N],u=a.slice(s,s+e);return n?u:u.reverse()},K=function(t,e,r,n,o,i){var a=+r,s=f(a);if(a!=s||s<0||s+e>t[L])throw E(w);for(var u=t[D]._b,c=s+t[N],l=n(+o),p=0;ptt;)(Z=J[tt++])in x||s(x,Z,k[Z]);i||(Q.constructor=x)}var et=new O(new x(2)),rt=O[b].setInt8;et.setInt8(0,2147483648),et.setInt8(1,2147483649),!et.getInt8(0)&&et.getInt8(1)||u(O[b],{setInt8:function(t,e){rt.call(this,t,e<<24>>24)},setUint8:function(t,e){rt.call(this,t,e<<24>>24)}},!0)}else x=function(t){var e=X(this,t);this._b=v.call(Array(e),0),this[L]=e},O=function(t,e,r){l(this,O,_),l(t,x,_);var n=t[L],o=f(e);if(o<0||o>n)throw E("Wrong offset!");if(r=void 0===r?n-o:p(r),o+r>n)throw E(m);this[D]=t,this[N]=o,this[L]=r},o&&(Y(x,F,"_l"),Y(O,R,"_b"),Y(O,F,"_l"),Y(O,I,"_o")),u(O[b],{getInt8:function(t){return $(this,1,t)[0]<<24>>24},getUint8:function(t){return $(this,1,t)[0]},getInt16:function(t){var e=$(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=$(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return V($(this,4,t,arguments[1]))},getUint32:function(t){return V($(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return B($(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return B($(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){K(this,1,t,W,e)},setUint8:function(t,e){K(this,1,t,W,e)},setInt16:function(t,e){K(this,2,t,z,e,arguments[2])},setUint16:function(t,e){K(this,2,t,z,e,arguments[2])},setInt32:function(t,e){K(this,4,t,q,e,arguments[2])},setUint32:function(t,e){K(this,4,t,q,e,arguments[2])},setFloat32:function(t,e){K(this,4,t,H,e,arguments[2])},setFloat64:function(t,e){K(this,8,t,G,e,arguments[2])}});y(x,g),y(O,_),s(O[b],a.VIEW,!0),e[g]=x,e[_]=O},function(t,e,r){var n=r(5),o=r(30),i=r(39),a=r(157),s=r(10).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:n.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e,r){var n=r(57),o=r(8)("iterator"),i=r(52);t.exports=r(30).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[n(t)]}},function(t,e,r){"use strict";var n=r(50),o=r(145),i=r(52),a=r(18);t.exports=r(98)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,r):"values"==e?o(0,t[r]):o(0,[r,t[r]])},"values"),i.Arguments=i.Array,n("keys"),n("values"),n("entries")},function(t,e,r){var n=r(47),o=r(29),i=n(o,"Map");t.exports=i},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=n}var n=9007199254740991;t.exports=r},function(t,e,r){"use strict";function n(t,e){var r,n=[],i=[];if(void 0!==e&&!Array.isArray(e))throw new Error("axes must be an Array list of dimensions to squeeze");for(r=0;r1)for(var r=1;r=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},e.setImmediate="function"==typeof t?t:function(t){var r=c++,n=!(arguments.length<2)&&s.call(arguments,1);return u[r]=!0,i(function(){u[r]&&(n?t.apply(null,n):t.call(null),e.clearImmediate(r))}),r},e.clearImmediate="function"==typeof n?n:function(t){delete u[t]}}).call(e,r(127).setImmediate,r(127).clearImmediate)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.InputLayer=void 0;var o=r(200);Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})});var i=r(225);Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}})});var a=r(212);Object.keys(a).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}})});var s=r(240);Object.keys(s).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}})});var u=r(229);Object.keys(u).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return u[t]}})});var c=r(227);Object.keys(c).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return c[t]}})});var l=r(132);Object.keys(l).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return l[t]}})});var f=r(246);Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return f[t]}})});var p=r(193),h=n(p);e.InputLayer=h.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="_Pooling1D";var n=t.poolLength,a=void 0===n?2:n,s=t.stride,u=void 0===s?null:s,c=t.borderMode,l=void 0===c?"valid":c;return r.poolLength=a,r.stride=null===u?a:u,r.borderMode=l,r.poolingFunc="max",r}return a(e,t),s(e,[{key:"call",value:function(t){if("max"!==this.poolingFunc&&"average"!==this.poolingFunc)throw new Error("[pooling._Pooling1D] pooling function must be max or average.");for(var e="valid"===this.borderMode?Math.floor((t.tensor.shape[0]-this.poolLength+this.stride)/this.stride):Math.floor((t.tensor.shape[0]+this.stride-1)/this.stride),r=new f.default([],[e,t.tensor.shape[1]]),n=new f.default([],[t.tensor.shape[1]]),o="valid"===this.borderMode?0:Math.min(0,Math.ceil((t.tensor.shape[0]-(e-1)*this.stride-this.poolLength)/2)),i=0;it.tensor.shape[0]-1);c++)"max"===this.poolingFunc?h.default.maxeq(n.tensor,t.tensor.pick(a+c,null)):"average"===this.poolingFunc&&h.default.addeq(n.tensor,t.tensor.pick(a+c,null)),u+=1;"average"===this.poolingFunc&&h.default.divseq(n.tensor,u),h.default.assign(r.tensor.pick(i,null),n.tensor),o+=this.stride}return t.tensor=r.tensor,t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="_Pooling2D";var n=t.poolSize,a=void 0===n?[2,2]:n,s=t.strides,u=void 0===s?null:s,c=t.borderMode,l=void 0===c?"valid":c,f=t.dimOrdering,p=void 0===f?"tf":f;return r.poolSize=a,r.strides=null===u?a:u,r.borderMode=l,r.dimOrdering=p,r.poolingFunc="max",r}return a(e,t),u(e,[{key:"_calcOutputShape",value:function(t){var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=s(this.poolSize,2),a=i[0],u=i[1],c="same"===this.borderMode?Math.floor((r+this.strides[0]-1)/this.strides[0]):Math.floor((r-a+this.strides[0])/this.strides[0]),l="same"===this.borderMode?Math.floor((n+this.strides[1]-1)/this.strides[1]):Math.floor((n-u+this.strides[1])/this.strides[1]),f="same"===this.borderMode?Math.max(0,Math.floor((c-1)*this.strides[0]+a-r)):0,p="same"===this.borderMode?Math.max(0,Math.floor((l-1)*this.strides[1]+u-n)):0,h=Math.floor(f/2),d=f-h,v=Math.floor(p/2),y=p-v;this.outputShape=[c,l,o],this.inputPadding=[h,d,v,y]}},{key:"_padInput",value:function(t){if("same"===this.borderMode){var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=s(this.inputPadding,4),a=i[0],u=i[1],c=i[2],l=i[3],f=r+a+u,h=n+c+l,v=new p.default([],[f,h,o]);"max"===this.poolingFunc&&d.default.assigns(v.tensor,Number.NEGATIVE_INFINITY),d.default.assign(v.tensor.hi(r+a,n+c,o).lo(a,c,0),t.tensor),t.tensor=v.tensor}return t}},{key:"call",value:function(t){if("max"!==this.poolingFunc&&"average"!==this.poolingFunc)throw new Error("[pooling._Pooling2D] pooling function must be max or average.");"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0)),this._calcOutputShape(t),this._padInput(t);for(var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=s(this.poolSize,2),a=i[0],u=i[1],c=new p.default([],this.outputShape),l=new p.default([],[a,u,o]),f=s(this.inputPadding,4),h=f[0],v=f[1],y=f[2],g=f[3],_=0,b=0;_<=r-a;_+=this.strides[0],b++){var m=0;_r-v&&(m=_+a-(r-v));for(var w=0,x=0;w<=n-u;w+=this.strides[1],x++){var O=0;wn-g&&(O=w+u-(n-g)),d.default.assign(l.tensor,t.tensor.hi(_+a,w+u,o).lo(_,w,0));for(var j=0;j0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="_Pooling3D";var n=t.poolSize,a=void 0===n?[2,2,2]:n,s=t.strides,u=void 0===s?null:s,c=t.borderMode,l=void 0===c?"valid":c,f=t.dimOrdering,p=void 0===f?"tf":f;return r.poolSize=a,r.strides=null===u?a:u,r.borderMode=l,r.dimOrdering=p,r.poolingFunc="max",r}return a(e,t),u(e,[{key:"_calcOutputShape",value:function(t){var e=s(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=s(this.poolSize,3),u=a[0],c=a[1],l=a[2],f="same"===this.borderMode?Math.floor((r+this.strides[0]-1)/this.strides[0]):Math.floor((r-u+this.strides[0])/this.strides[0]),p="same"===this.borderMode?Math.floor((n+this.strides[1]-1)/this.strides[1]):Math.floor((n-c+this.strides[1])/this.strides[1]),h="same"===this.borderMode?Math.floor((o+this.strides[2]-1)/this.strides[2]):Math.floor((o-l+this.strides[2])/this.strides[2]),d="same"===this.borderMode?Math.max(0,Math.floor((f-1)*this.strides[0]+u-r)):0,v="same"===this.borderMode?Math.max(0,Math.floor((p-1)*this.strides[1]+c-n)):0,y="same"===this.borderMode?Math.max(0,Math.floor((h-1)*this.strides[2]+l-o)):0,g=Math.floor(d/2),_=d-g,b=Math.floor(v/2),m=v-b,w=Math.floor(y/2),x=y-w;this.outputShape=[f,p,h,i],this.inputPadding=[g,_,b,m,w,x]}},{key:"_padInput",value:function(t){if("same"===this.borderMode){var e=s(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=s(this.inputPadding,6),u=a[0],c=a[1],l=a[2],f=a[3],h=a[4],v=a[5],y=r+u+c,g=n+l+f,_=o+h+v,b=new p.default([],[y,g,_,i]);"max"===this.poolingFunc&&d.default.assigns(b.tensor,Number.NEGATIVE_INFINITY),d.default.assign(b.tensor.hi(r+u,n+l,o+h,i).lo(u,l,h,0),t.tensor),t.tensor=b.tensor}return t}},{key:"call",value:function(t){if("max"!==this.poolingFunc&&"average"!==this.poolingFunc)throw new Error("[pooling._Pooling3D] pooling function must be max or average.");"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,3,0)),this._calcOutputShape(t),this._padInput(t);for(var e=s(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=s(this.poolSize,3),u=a[0],c=a[1],l=a[2],f=new p.default([],this.outputShape),h=new p.default([],[u,c,l,i]),v=s(this.inputPadding,6),y=v[0],g=v[1],_=v[2],b=v[3],m=v[4],w=v[5],x=0,O=0;x<=r-u;x+=this.strides[0],O++){var j=0;xr-g&&(j=x+u-(r-g));for(var E=0,S=0;E<=n-c;E+=this.strides[1],S++){var k=0;E<_?k=_-E:E+c>n-b&&(k=E+c-(n-b));for(var P=0,A=0;P<=o-l;P+=this.strides[2],A++){var C=0;Po-w&&(C=P+l-(o-w)),d.default.assign(h.tensor,t.tensor.hi(x+u,E+c,P+l,i).lo(x,E,P,0));for(var M=0;M=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function y(e){return+e!=e&&(e=0),t.alloc(+e)}function g(e,r){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(o)return G(e).length;r=(""+r).toLowerCase(),o=!0}}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,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(e,r,n,o,i){if(0===e.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof r&&(r=t.from(r,o)),t.isBuffer(r))return 0===r.length?-1:w(e,r,n,o,i);if("number"==typeof r)return r=255&r,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):w(e,[r],n,o,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,o){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}var c;if(o){var l=-1;for(c=r;cs&&(r=s-u),c=r;c>=0;c--){for(var f=!0,p=0;po&&(n=o)):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a239?4:i>223?3:i>191?2:1;if(o+s<=r){var u,c,l,f;switch(s){case 1:i<128&&(a=i);break;case 2:u=t[o+1],128===(192&u)&&(f=(31&i)<<6|63&u,f>127&&(a=f));break;case 3:u=t[o+1],c=t[o+2],128===(192&u)&&128===(192&c)&&(f=(15&i)<<12|(63&u)<<6|63&c,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:u=t[o+1],c=t[o+2],l=t[o+3],128===(192&u)&&128===(192&c)&&128===(192&l)&&(f=(15&i)<<18|(63&u)<<12|(63&c)<<6|63&l,f>65535&&f<1114112&&(a=f))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=s}return C(n)}function C(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function D(e,r,n,o,i,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||re.length)throw new RangeError("Index out of range")}function L(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,o){return o||U(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function V(t,e,r,n,o){return o||U(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function W(t){if(t=z(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){for(var e=[],r=0;r>8,o=r%256,i.push(o),i.push(n);return i}function $(t){return Z.toByteArray(W(t))}function K(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function X(t){return t!==t}var Z=r(248),Q=r(436),J=r(439);e.Buffer=t,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:o(),e.kMaxLength=i(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,r){return s(null,t,e,r)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,r){return c(null,t,e,r)},t.allocUnsafe=function(t){return l(null,t)},t.allocUnsafeSlow=function(t){return l(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,o=r.length,i=0,a=Math.min(n,o);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e,r,n,o,i){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,s=n-r,u=Math.min(a,s),c=this.slice(o,i),l=e.slice(r,n),f=0;fo)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return O(this,t,e,r);case"ascii":return j(this,t,e,r);case"latin1":case"binary":return E(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r0&&(o*=256);)n+=this[t+--e]*o;return n},t.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i=o&&(n-=Math.pow(2,8*e)),n},t.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},t.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var o=Math.pow(2,8*r)-1;D(this,t,e,r,o,0)}var i=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+i]=t/a&255;return e+r},t.prototype.writeUInt8=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):L(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):L(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):N(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):N(this,e,r,!1),r+4},t.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},t.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1), -this[e+i]=(t/a>>0)-s&255;return e+r},t.prototype.writeInt8=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):L(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):L(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):N(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):N(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return V(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return V(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,o){if(n||(n=0),o||0===o||(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r=0;--i)e[i+r]=this[i+n];else if(a<1e3||!t.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=r;a2?arguments[2]:void 0,l=Math.min((void 0===c?a:o(c,a))-u,a-s),f=1;for(u0;)u in r?r[s]=r[u]:delete r[s],s+=f,u+=f;return r}},function(t,e,r){var n=r(51);t.exports=function(t,e){var r=[];return n(t,!1,r.push,r,e),r}},function(t,e,r){var n=r(14),o=r(12),i=r(58),a=r(11);t.exports=function(t,e,r,s,u){n(e);var c=o(t),l=i(c),f=a(c.length),p=u?f-1:0,h=u?-1:1;if(r<2)for(;;){if(p in l){s=l[p],p+=h;break}if(p+=h,u?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;u?p>=0:f>p;p+=h)p in l&&(s=e(s,l[p],p,c));return s}},function(t,e,r){"use strict";var n=r(14),o=r(7),i=r(70),a=[].slice,s={},u=function(t,e,r){if(!(e in s)){for(var n=[],o=0;o1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(r(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!y(this,t)}}),h&&n(f.prototype,"size",{get:function(){return u(this[v])}}),f},def:function(t,e,r){var n,o,i=y(t,e);return i?i.v=r:(t._l=i={i:o=d(e,!0),k:e,v:r,p:n=t._l,n:void 0,r:!1},t._f||(t._f=i),n&&(n.n=i),t[v]++,"F"!==o&&(t._i[o]=i)),t},getEntry:y,setStrong:function(t,e,r){l(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==e?f(0,r.k):"values"==e?f(0,r.v):f(0,[r.k,r.v]):(t._t=void 0,f(1))},r?"entries":"values",!r,!0),p(e)}}},function(t,e,r){var n=r(57),o=r(136);t.exports=function(t){return function(){if(n(this)!=t)throw TypeError(t+"#toJSON isn't generic");return o(this)}}},function(t,e,r){"use strict";var n=r(43),o=r(35).getWeak,i=r(2),a=r(7),s=r(38),u=r(51),c=r(26),l=r(13),f=c(5),p=c(6),h=0,d=function(t){return t._l||(t._l=new v)},v=function(){this.a=[]},y=function(t,e){return f(t.a,function(t){return t[0]===e})};v.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var r=y(this,t);r?r[1]=e:this.a.push([t,e])},delete:function(t){var e=p(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,r,i){var c=t(function(t,n){s(t,c,e,"_i"),t._i=h++,t._l=void 0,void 0!=n&&u(n,r,t[i],t)});return n(c.prototype,{delete:function(t){if(!a(t))return!1;var e=o(t);return e===!0?d(this).delete(t):e&&l(e,this._i)&&delete e[this._i]},has:function(t){if(!a(t))return!1;var e=o(t);return e===!0?d(this).has(t):e&&l(e,this._i)}}),c},def:function(t,e,r){var n=o(i(e),!0);return n===!0?d(t).set(e,r):n[t._i]=r,t},ufstore:d}},function(t,e,r){t.exports=!r(9)&&!r(6)(function(){return 7!=Object.defineProperty(r(90)("div"),"a",{get:function(){return 7}}).a})},function(t,e,r){var n=r(7),o=Math.floor;t.exports=function(t){return!n(t)&&isFinite(t)&&o(t)===t}},function(t,e,r){var n=r(2);t.exports=function(t,e,r,o){try{return o?e(n(r)[0],r[1]):e(r)}catch(e){var i=t.return;throw void 0!==i&&n(i.call(t)),e}}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,r){"use strict";var n=r(42),o=r(74),i=r(59),a=r(12),s=r(58),u=Object.assign;t.exports=!u||r(6)(function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(t){e[t]=t}),7!=u({},t)[r]||Object.keys(u({},e)).join("")!=n})?function(t,e){for(var r=a(t),u=arguments.length,c=1,l=o.f,f=i.f;u>c;)for(var p,h=s(arguments[c++]),d=l?n(h).concat(l(h)):n(h),v=d.length,y=0;v>y;)f.call(h,p=d[y++])&&(r[p]=h[p]);return r}:u},function(t,e,r){var n=r(10),o=r(2),i=r(42);t.exports=r(9)?Object.defineProperties:function(t,e){o(t);for(var r,a=i(e),s=a.length,u=0;s>u;)n.f(t,r=a[u++],e[r]);return t}},function(t,e,r){var n=r(18),o=r(41).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return o(t)}catch(t){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?s(t):o(n(t))}},function(t,e,r){var n=r(13),o=r(18),i=r(66)(!1),a=r(103)("IE_PROTO");t.exports=function(t,e){var r,s=o(t),u=0,c=[];for(r in s)r!=a&&n(s,r)&&c.push(r);for(;e.length>u;)n(s,r=e[u++])&&(~i(c,r)||c.push(r));return c}},function(t,e,r){var n=r(42),o=r(18),i=r(59).f;t.exports=function(t){return function(e){for(var r,a=o(e),s=n(a),u=s.length,c=0,l=[];u>c;)i.call(a,r=s[c++])&&l.push(t?[r,a[r]]:a[r]);return l}}},function(t,e,r){var n=r(41),o=r(74),i=r(2),a=r(5).Reflect;t.exports=a&&a.ownKeys||function(t){var e=n.f(i(t)),r=o.f;return r?e.concat(r(t)):e}},function(t,e,r){var n=r(5).parseFloat,o=r(54).trim;t.exports=1/n(r(108)+"-0")!==-(1/0)?function(t){var e=o(String(t),3),r=n(e);return 0===r&&"-"==e.charAt(0)?-0:r}:n},function(t,e,r){var n=r(5).parseInt,o=r(54).trim,i=r(108),a=/^[\-+]?0[xX]/;t.exports=8!==n(i+"08")||22!==n(i+"0x16")?function(t,e){var r=o(String(t),3);return n(r,e>>>0||(a.test(r)?16:10))}:n},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},function(t,e,r){var n=r(11),o=r(107),i=r(23);t.exports=function(t,e,r,a){var s=String(i(t)),u=s.length,c=void 0===r?" ":String(r),l=n(e);if(l<=u||""==c)return s;var f=l-u,p=o.call(c,Math.ceil(f/c.length));return p.length>f&&(p=p.slice(0,f)),a?p+s:s+p}},function(t,e,r){e.f=r(8)},function(t,e,r){"use strict";var n=r(139);t.exports=r(67)("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=n.getEntry(this,t);return e&&e.v},set:function(t,e){return n.def(this,0===t?0:t,e)}},n,!0)},function(t,e,r){r(9)&&"g"!=/./g.flags&&r(10).f(RegExp.prototype,"flags",{configurable:!0,get:r(69)})},function(t,e,r){"use strict";var n=r(139);t.exports=r(67)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return n.def(this,t=0===t?0:t,t)}},n)},function(t,e,r){"use strict";var n,o=r(26)(0),i=r(16),a=r(35),s=r(147),u=r(141),c=r(7),l=a.getWeak,f=Object.isExtensible,p=u.ufstore,h={},d=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(t){if(c(t)){var e=l(t);return e===!0?p(this).get(t):e?e[this._i]:void 0}},set:function(t,e){return u.def(this,t,e)}},y=t.exports=r(67)("WeakMap",d,v,u,!0,!0);7!=(new y).set((Object.freeze||Object)(h),7).get(h)&&(n=u.getConstructor(d),s(n.prototype,v),a.NEED=!0,o(["delete","has","get","set"],function(t){var e=y.prototype,r=e[t];i(e,t,function(e,o){if(c(e)&&!f(e)){this._f||(this._f=new n);var i=this._f[t](e,o);return"set"==t?this:i}return r.call(this,e,o)})}))},function(t,e,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function o(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var o=0;o0)throw new Error("cwise: pre() block may not reference array args");if(o0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(o),e.shimArgs.push("scalar"+o);else if("index"===a){if(e.indexArgs.push(o),o0)throw new Error("cwise: pre() block may not reference array index");if(o0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(o),or.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,i(e)}var i=r(433);t.exports=o},function(t,e){"use strict";function r(t,e,n){var o=0|t[n];if(o<=0)return[];var i,a=new Array(o);if(n===t.length-1)for(i=0;i0)return n(0|t,e);break;case"object":if("number"==typeof t.length)return r(t,e,0)}return[]}t.exports=o},function(t,e,r){function n(t){var e=this.__data__=new o(t);this.size=e.size}var o=r(77),i=r(531),a=r(532),s=r(533),u=r(534),c=r(535);n.prototype.clear=i,n.prototype.delete=a,n.prototype.get=s,n.prototype.has=u,n.prototype.set=c,t.exports=n},function(t,e,r){function n(t,e,r){"__proto__"==e&&o?o(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var o=r(170);t.exports=n},function(t,e,r){function n(t,e,r,a,s){var u=-1,c=t.length;for(r||(r=i),s||(s=[]);++u0&&r(l)?e>1?n(l,e-1,r,a,s):o(s,l):a||(s[s.length]=l)}return s}var o=r(450),i=r(506);t.exports=n},function(t,e,r){function n(t,e){return t&&o(t,e,i)}var o=r(458),i=r(48);t.exports=n},function(t,e,r){function n(t,e){e=i(e,t)?[e]:o(e);for(var r=0,n=e.length;null!=t&&rp))return!1;var d=l.get(t);if(d&&l.get(e))return d==e;var v=-1,y=!0,g=c&s?new o:void 0;for(l.set(t,e),l.set(e,t);++v=0;--o)n[o]=r,r*=t[o];return c(f.malloc(r,e),t,n,0)}function i(t){"generic"!==t.dtype&&"array"!==t.dtype&&f.free(t.data)}function a(t,e){e||(e="double");for(var r=1,n=new Array(t.length),o=t.length-1;o>=0;--o)n[o]=r,r*=t[o];for(var i=f.malloc(r,e),o=0;o=0;--o)n[o]=r,r*=t[o];for(var i=f.malloc(r,e),o=0;o=0;--r)i[r]=o,o*=t[r];var a=f.malloc(o,e);for(r=0;r=0;r--)u+=i[r],s=Math.min(s,t[r]);for(r=0,n=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var r=e.filepaths,n=void 0===r?{}:r,o=e.headers,a=void 0===o?{}:o,s=e.gpu,u=void 0!==s&&s,c=e.layerCallPauses,l=void 0!==c&&c;if(!n.model||!n.weights||!n.metadata)throw new Error("File paths must be declared for model, weights, and metadata.");this.filepaths=n,this.filetypes={model:"json",weights:"arraybuffer",metadata:"json"},this.headers=a,this.gpu=u,this.layerCallPauses=l,this.data={model:{},weights:null,metadata:[]},this.xhrs={model:null,weights:null,metadata:null},this.xhrProgress={model:0,weights:0,metadata:0},this.modelLayersMap=new Map,this.layersWithResults=[],this.modelDAG={},this.inputTensors={},this._ready=this.initialize(),this.isRunning=!1}return l(t,[{key:"ready",value:function(){return this._ready}},{key:"interrupt",value:function(){var t=this,e=["model","weights","metdata"];e.forEach(function(e){t.xhrs[e]&&(t.xhrs[e].abort(),t.xhrs[e]=null)})}},{key:"initialize",value:function(){var t=this,e=["model","weights","metadata"];return s.default.all(e.map(function(e){return t.dataRequest(e,t.headers)})).then(function(){return t.createLayers(),s.default.resolve()}).catch(function(e){console.log(e),t.interrupt()})}},{key:"dataRequest",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new s.default(function(n,o){var i=new XMLHttpRequest;i.open("GET",e.filepaths[t],!0),i.responseType=e.filetypes[t];var a=!0,s=!1,u=void 0;try{for(var l,f=(0,p.default)(r)[Symbol.iterator]();!(a=(l=f.next()).done);a=!0){var h=c(l.value,2),d=h[0],v=h[1];i.setRequestHeader(d,v)}}catch(t){s=!0,u=t}finally{try{!a&&f.return&&f.return()}finally{if(s)throw u}}i.onload=function(r){e.data[t]=i.response,e.xhrs[t]=null,e.xhrProgress[t]=100,n()},i.onprogress=function(r){if(r.lengthComputable){var n=Math.round(100*r.loaded/r.total);e.xhrProgress[t]=n}},i.onerror=function(t){return o(t)},i.send(null),e.xhrs[t]=i})}},{key:"getLoadingProgress",value:function(){var t=(0,x.default)(this.xhrProgress);return Math.round((0,j.default)(t)/t.length)}},{key:"createLayers",value:function(){var t=this,e=this.data.model.class_name,r=[];"Sequential"===e?r=this.data.model.config:"Model"===e&&(r=this.data.model.config.layers),r.forEach(function(n,o){var i=n.class_name,a=n.config;if(!(i in C))throw new Error("Layer "+i+" specified in model configuration is not implemented!");if("Sequential"===e&&0===o){var s="input",u=a.batch_input_shape.slice(1),c=new C.InputLayer({name:s,shape:u});t.modelLayersMap.set(s,c),t.modelDAG[s]={layerClass:"InputLayer",name:s,inbound:[],outbound:[]},t.inputTensors[s]=new T.default([],u)}else if("Model"===e&&"InputLayer"===i){var l=a.batch_input_shape.slice(1);t.inputTensors[a.name]=new T.default([],l)}var f=void 0;if("Bidirectional"===i||"TimeDistributed"===i){var p=(0,d.default)(a,function(t,e){return(0,y.default)(e)}),h=a.layer.config,v=a.layer.class_name,g=(0,d.default)(h,function(t,e){return(0,y.default)(e)});"activation"in g&&(g.activation=(0,y.default)(g.activation)),"innerActivation"in g&&(g.innerActivation=(0,y.default)(g.innerActivation)),g.gpu=t.gpu,f=new C[i](Object.assign(p,{layer:new C[v](g)}))}else{var b=(0,d.default)(a,function(t,e){return(0,y.default)(e)});"activation"in b&&(b.activation=(0,y.default)(b.activation)),"innerActivation"in b&&(b.innerActivation=(0,y.default)(b.innerActivation)),b.gpu=t.gpu,f=new C[i](b)}var m=[];if("Bidirectional"===i?!function(){var t=a.layer.config.name,e=t.replace(/forward/,"backward"),r=f.forwardLayer.params.map(function(e){return t+"_"+e}),n=f.backwardLayer.params.map(function(t){return e+"_"+t});m=r.concat(n)}():m="TimeDistributed"===i?f.layer.params.map(function(t){return a.layer.config.name+"_"+t}):f.params.map(function(t){return a.name+"_"+t}),m&&m.length){var w=m.map(function(e){var r=(0,_.default)(t.data.metadata,function(t){var r=new RegExp("^"+e);return t.layer_name===a.name&&r.test(t.weight_name)});if(!r)throw new Error("[Model] error loading weights.");var n=r.offset,o=r.length,i=r.shape;return new T.default(new Float32Array(t.data.weights,n,o),i)});f.setWeights(w)}if(t.modelLayersMap.set(a.name,f),t.modelDAG[a.name]={layerClass:i,name:a.name,inbound:[],outbound:[]},"Sequential"===e)if(0===o){var x="input";t.modelDAG[x].outbound.push(a.name),t.modelDAG[a.name].inbound.push(x)}else{var O=r[o-1].config;t.modelDAG[a.name].inbound.push(O.name),t.modelDAG[O.name].outbound.push(a.name)}else"Model"===e&&n.inbound_nodes&&n.inbound_nodes.length&&n.inbound_nodes[0].forEach(function(e){var r=e[0];t.modelDAG[a.name].inbound.push(r),t.modelDAG[r].outbound.push(a.name)})})}},{key:"toggleGpu",value:function(t){"undefined"==typeof t?this.gpu=!this.gpu:this.gpu=t;var e=!0,r=!1,n=void 0;try{for(var o,i=this.modelLayersMap.values()[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var a=o.value;a.toggleGpu(this.gpu)}}catch(t){r=!0,n=t}finally{try{!e&&i.return&&i.return()}finally{if(r)throw n}}}},{key:"traverseDAG",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,a.coroutine)(regeneratorRuntime.mark(function t(e){var r,n,o,i,a,u,c,l,f=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e.length){t.next=4;break}return t.abrupt("return",!0);case 4:if(1!==e.length){t.next=35;break}if(r=e[0],n=this.modelDAG[r],o=n.layerClass,i=n.inbound,a=n.outbound,"InputLayer"===o){t.next=31;break}if(u=this.modelLayersMap.get(r),!u.visited){t.next=14;break}return t.abrupt("return",!1);case 14:if(c=i.map(function(t){return f.modelLayersMap.get(t)}),(0,P.default)(c.map(function(t){return t.hasResult}))){t.next=17;break}return t.abrupt("return",!1);case 17:if("Merge"!==o){t.next=21;break}u.result=u.call(c.map(function(t){return new T.default(t.result.tensor.data,t.result.tensor.shape)})),t.next=25;break;case 21:if(1===c.length){t.next=23;break}throw new Error("Layer name "+u.name+" has "+c.length+" inbound nodes, but is not a Merge layer.");case 23:l=c[0].result,u.result=u.call(new T.default(l.tensor.data,l.tensor.shape));case 25:if(u.hasResult=!0,u.visited=!0,this.layersWithResults.push(u.name),!this.layerCallPauses){t.next=31;break}return t.next=31,s.default.delay(0);case 31:return t.next=33,this.traverseDAG(a);case 33:t.next=37;break;case 35:return t.next=37,s.default.all(e.map(function(t){return f.traverseDAG([t])}));case 37:case"end":return t.stop()}},t,this)}));return t}()},{key:"predict",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,a.coroutine)(regeneratorRuntime.mark(function t(e){var r,n,o,i,a,s,c,l,f,p,h,d,v,y=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isRunning=!0,r=(0,m.default)(this.inputTensors),(0,S.default)((0,m.default)(e),r)){t.next=5;break}throw this.isRunning=!1,new Error("predict() must take an object where the keys are the named inputs of the model: "+r+".");case 5:if((0,P.default)(r,function(t){return e[t]instanceof Float32Array})){t.next=8;break}throw this.isRunning=!1,new Error("predict() must take an object where the values are the flattened data as Float32Array.");case 8:for(this.layersWithResults=[],n=!0,o=!1,i=void 0,t.prev=12,a=this.modelLayersMap.values()[Symbol.iterator]();!(n=(s=a.next()).done);n=!0)c=s.value,c.hasResult=!1,c.visited=!1;t.next=20;break;case 16:t.prev=16,t.t0=t.catch(12),o=!0,i=t.t0;case 20:t.prev=20,t.prev=21,!n&&a.return&&a.return();case 23:if(t.prev=23,!o){t.next=26;break}throw i;case 26:return t.finish(23);case 27:return t.finish(20);case 28:return r.forEach(function(t){var r=y.modelLayersMap.get(t);y.inputTensors[t].replaceTensorData(e[t]),r.result=r.call(y.inputTensors[t]),r.hasResult=!0,r.visited=!0}),t.next=31,this.traverseDAG(r);case 31:if(l=this.data.model.class_name,"Sequential"!==l){t.next=41;break}return f=(0,_.default)((0,x.default)(this.modelDAG),function(t){return!t.outbound.length}),p=this.modelLayersMap.get(f.name),h=p.result,d={output:h.tensor.data},this.isRunning=!1,t.abrupt("return",d);case 41:if("Model"!==l){t.next=45;break}if(v=function(){var t=(0,x.default)(y.modelDAG).filter(function(t){return!t.outbound.length}),e={};return t.forEach(function(t){var r=y.modelLayersMap.get(t.name),n=r.result;e[t.name]=n.tensor.data}),y.isRunning=!1,{v:e}}(),"object"!==("undefined"==typeof v?"undefined":u(v))){t.next=45;break}return t.abrupt("return",v.v);case 45:case"end":return t.stop()}},t,this,[[12,16,20,28],[21,,23,27]])}));return t}()}]),t}();e.default=R},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=document.createElement("canvas"),n=r.getContext("webgl")||r.getContext("experimental-webgl");if(!n)throw new Error("Unable to initialize WebGL. Your browser may not support it.");e.MAX_TEXTURE_SIZE=n.getParameter(n.MAX_TEXTURE_SIZE)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="InputLayer";var n=t.shape,a=void 0===n?[]:n;return r.shape=t.batchInputShape&&t.batchInputShape.length?t.batchInputShape.slice(1):a,r}return a(e,t),s(e,[{key:"call",value:function(t){if(!(0,f.default)(t.tensor.shape,this.shape))throw new Error("[InputLayer] input tensor shape "+t.tensor.shape+" does not match specified shape "+this.shape+".");return t}}]),e}(c.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function"); -}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));h.call(r),r.layerClass="ELU";var n=t.alpha,a=void 0===n?1:n;return r.alpha=a,r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.alpha),t}}]),e}(c.default),h=function(){this._compute=(0,f.default)({args:["array","scalar"],body:function(t,e){t=Math.max(t,0)+e*(Math.exp(Math.min(t,0))-1)}})};e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="LeakyReLU";var n=t.alpha,a=void 0===n?.3:n;return r.alpha=a,r}return a(e,t),s(e,[{key:"call",value:function(t){return(0,l.relu)(t,{alpha:this.alpha}),t}}]),e}(c.default);e.default=f},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r._compute=(0,f.default)({args:["array","array"],body:function(t,e){t=Math.max(t,0)+e*Math.min(t,0)}}),r.layerClass="PReLU",r.params=["alphas"],r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.weights.alphas.tensor),t}}]),e}(c.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r._compute=(0,f.default)({args:["array","array","array"],body:function(t,e,r){t=e*Math.log(1+Math.exp(r*t))}}),r.layerClass="ParametricSoftplus",r.params=["alphas","betas"],r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.weights.alphas.tensor,this.weights.betas.tensor),t}}]),e}(c.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r._compute=(0,f.default)({args:["array","array","array","array","array"],body:function(t,e,r,n,o){t=e+Math.min(Math.max(t-e,0),Math.abs(n))+r*Math.min(t-e,0)+Math.max(t-(e+Math.abs(n)),0)*o}}),r.layerClass="SReLU",r.params=["t_left","a_left","t_right","a_right"],r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.weights.t_left.tensor,this.weights.a_left.tensor,this.weights.t_right.tensor,this.weights.a_right.tensor),t}}]),e}(c.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));h.call(r),r.layerClass="ThresholdedReLU";var n=t.theta,a=void 0===n?1:n;return r.theta=a,r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.theta),t}}]),e}(c.default),h=function(){this._compute=(0,f.default)({args:["array","scalar"],body:function(t,e){t*=Number(t>e)}})};e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.SReLU=e.ThresholdedReLU=e.ParametricSoftplus=e.ELU=e.PReLU=e.LeakyReLU=void 0;var o=r(195),i=n(o),a=r(196),s=n(a),u=r(194),c=n(u),l=r(197),f=n(l),p=r(199),h=n(p),d=r(198),v=n(d);e.LeakyReLU=i.default,e.PReLU=s.default,e.ELU=c.default,e.ParametricSoftplus=f.default,e.ThresholdedReLU=h.default,e.SReLU=v.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="AtrousConvolution2D";var n=t.atrousRate,a=void 0===n?[1,1]:n;return r.atrousRate=a,r}return a(e,t),u(e,[{key:"_calcOutputShape",value:function(t){var e=t.tensor.shape[0],r=t.tensor.shape[1],n=s(this.kernelShape,3),o=n[0],i=n[1],a=n[2],u=i+(i-1)*(this.atrousRate[0]-1),c=a+(a-1)*(this.atrousRate[1]-1),l="same"===this.borderMode?Math.floor((e+this.subsample[0]-1)/this.subsample[0]):Math.floor((e-u+this.subsample[0])/this.subsample[0]),f="same"===this.borderMode?Math.floor((r+this.subsample[1]-1)/this.subsample[1]):Math.floor((r-c+this.subsample[1])/this.subsample[1]),p=o,h="same"===this.borderMode?Math.max(0,Math.floor((l-1)*this.subsample[0]+u-e)):0,d="same"===this.borderMode?Math.max(0,Math.floor((f-1)*this.subsample[1]+c-r)):0,v=Math.floor(h/2),y=h-v,g=Math.floor(d/2),_=d-g;this.outputShape=[l,f,p],this.inputPadding=[v,y,g,_]}},{key:"_im2col",value:function(t){var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=this.kernelShape[1],a=this.kernelShape[2],u=this.outputShape[0],c=this.outputShape[1],f=u*c,p=i*a*o,h=i+(i-1)*(this.atrousRate[0]-1),v=a+(a-1)*(this.atrousRate[1]-1);this._imColsMat||(this._imColsMat=new l.default([],[f,p]));for(var y=new l.default([],[i,a,o]),g=0,_=0,b=r-h;_<=b;_+=this.subsample[0])for(var m=0,w=n-v;m<=w;m+=this.subsample[1])d.default.assign(y.tensor,t.tensor.hi(_+h,m+v,o).lo(_,m,0).step(this.atrousRate[0],this.atrousRate[1],1)),this._imColsMat.tensor.data.set(y.tensor.data,g),g+=p;return this._useWeblas&&this._imColsMat.createWeblasTensor(),this._imColsMat}}]),e}(p.default);e.default=v},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Convolution1D";var n=t.nbFilter,a=void 0===n?1:n,s=t.filterLength,u=void 0===s?1:s,c=t.activation,l=void 0===c?"linear":c,p=t.borderMode,h=void 0===p?"valid":p,d=t.subsampleLength,v=void 0===d?1:d,y=t.bias,g=void 0===y||y;if("valid"!==h&&"same"!==h)throw new Error(r.name+" [Convolution1D layer] Invalid borderMode.");r.params=r.bias?["W","b"]:["W"];var _={nbFilter:a,nbRow:u,nbCol:1,activation:l,borderMode:h,subsample:[v,1],dimOrdering:"th",bias:g};return r._conv2d=new f.default(Object.assign(_,{gpu:t.gpu})),r}return a(e,t),s(e,[{key:"setWeights",value:function(t){this._conv2d.setWeights(t)}},{key:"call",value:function(t){t.tensor=(0,v.default)(t.tensor).transpose(1,0,2);var e=this._conv2d.call(t);return t.tensor=(0,h.default)(e.tensor).transpose(1,0,2),t}}]),e}(c.default);e.default=y},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Convolution3D";var n=t.nbFilter,o=void 0===n?1:n,s=t.kernelDim1,u=void 0===s?1:s,c=t.kernelDim2,l=void 0===c?1:c,f=t.kernelDim3,h=void 0===f?1:f,d=t.activation,v=void 0===d?"linear":d,y=t.borderMode,g=void 0===y?"valid":y,_=t.subsample,b=void 0===_?[1,1,1]:_,m=t.dimOrdering,w=void 0===m?"tf":m,x=t.bias,O=void 0===x||x;if(r.kernelShape=[o,u,l,h],r.activation=p[v],"valid"!==g&&"same"!==g)throw new Error(r.name+" [Convolution3D layer] Invalid borderMode.");if(r.borderMode=g,r.subsample=b,"tf"!==w&&"th"!==w)throw new Error(r.name+" [Convolution3D layer] Only tf and th dim ordering are allowed.");return r.dimOrdering=w,r.bias=O,r.params=r.bias?["W","b"]:["W"],r}return s(e,t),c(e,[{key:"setWeights",value:function(t){"th"===this.dimOrdering&&(t[0].tensor=t[0].tensor.transpose(2,3,4,1,0)),l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,t),this._wRowsMat=this._w2row(),this._useWeblas&&(this._wRowsMat.createWeblasTensor(),this._wRowsMat.weblasTensor=this._wRowsMat.weblasTensor.transpose(),this.bias?this.weights.b.createWeblasTensor():(this._zerosVec=new d.default([],[this.weights.W.tensor.shape[4]]),this._zerosVec.createWeblasTensor()))}},{key:"_calcOutputShape",value:function(t){var e=t.tensor.shape[0],r=t.tensor.shape[1],n=t.tensor.shape[2],o=u(this.kernelShape,4),i=o[0],a=o[1],s=o[2],c=o[3],l="same"===this.borderMode?Math.floor((e+this.subsample[0]-1)/this.subsample[0]):Math.floor((e-a+this.subsample[0])/this.subsample[0]),f="same"===this.borderMode?Math.floor((r+this.subsample[1]-1)/this.subsample[1]):Math.floor((r-s+this.subsample[1])/this.subsample[1]),p="same"===this.borderMode?Math.floor((n+this.subsample[2]-1)/this.subsample[2]):Math.floor((n-c+this.subsample[2])/this.subsample[2]),h=i,d="same"===this.borderMode?Math.max(0,Math.floor((l-1)*this.subsample[0]+a-e)):0,v="same"===this.borderMode?Math.max(0,Math.floor((f-1)*this.subsample[1]+s-r)):0,y="same"===this.borderMode?Math.max(0,Math.floor((p-1)*this.subsample[2]+c-n)):0,g=Math.floor(d/2),_=d-g,b=Math.floor(v/2),m=v-b,w=Math.floor(y/2),x=y-w;this.outputShape=[l,f,p,h],this.inputPadding=[g,_,b,m,w,x]}},{key:"_padInput",value:function(t){if("same"===this.borderMode){var e=u(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=u(this.inputPadding,6),s=a[0],c=a[1],l=a[2],f=a[3],p=a[4],h=a[5],v=r+s+c,y=n+l+f,g=o+p+h,b=new d.default([],[v,y,g,i]);_.default.assign(b.tensor.hi(r+s,n+l,o+p,i).lo(s,l,p,0),t.tensor),t.tensor=b.tensor}return t}},{key:"_vol2col",value:function(t){var e=u(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=this.kernelShape[1],s=this.kernelShape[2],c=this.kernelShape[3],l=this.outputShape[0],f=this.outputShape[1],p=this.outputShape[2],h=l*f*p,v=a*s*c*i;if(this._volColsMat||(this._volColsMat=new d.default([],[h,v])),1===a&&1===s&&1===c&&1===this.subsample[0]&&1===this.subsample[1]&&1===this.subsample[2])return this._volColsMat.replaceTensorData(t.tensor.data),this._useWeblas&&this._volColsMat.createWeblasTensor(),this._volColsMat;for(var y=new d.default([],[a,s,c,i]),g=0,b=0,m=r-a;b<=m;b+=this.subsample[0])for(var w=0,x=n-s;w<=x;w+=this.subsample[1])for(var O=0,j=o-c;O<=j;O+=this.subsample[2])_.default.assign(y.tensor,t.tensor.hi(b+a,w+s,O+c,i).lo(b,w,O,0)),this._volColsMat.tensor.data.set(y.tensor.data,g),g+=v;return this._useWeblas&&this._volColsMat.createWeblasTensor(),this._volColsMat}},{key:"_w2row",value:function(){for(var t=this.weights.W.tensor.shape[3],e=u(this.kernelShape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=n*o*i*t,s=new d.default([],[a,r]),c=new d.default([],[n,o,i,t]),l=new d.default([],[a]),f=0;f0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Deconvolution2D";var n=t.nbFilter,o=void 0===n?1:n,s=t.nbRow,u=void 0===s?1:s,c=t.nbCol,l=void 0===c?1:c,f=t.outputShape,h=void 0===f?[]:f,d=t.activation,v=void 0===d?"linear":d,y=t.borderMode,g=void 0===y?"valid":y,_=t.subsample,b=void 0===_?[1,1]:_,m=t.dimOrdering,w=void 0===m?"tf":m,x=t.bias,O=void 0===x||x;if(r.kernelShape=[o,u,l],null==h[0]?r.outputShape=h.slice(1):r.outputShape=h,r.activation=p[v],"valid"!==g&&"same"!==g)throw new Error(r.name+" [Deconvolution2D layer] Invalid borderMode.");if(r.borderMode=g,r.subsample=b,"tf"!==w&&"th"!==w)throw new Error(r.name+" [Deconvolution2D layer] Only tf and th dim ordering are allowed.");return r.dimOrdering=w,r.bias=O,r.params=r.bias?["W","b"]:["W"],r}return s(e,t),c(e,[{key:"setWeights",value:function(t){"th"===this.dimOrdering&&(t[0].tensor=t[0].tensor.transpose(2,3,1,0)),l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,t),this._wRowsMat=this._w2row(),this._useWeblas&&(this._wRowsMat.createWeblasTensor(),this._wRowsMat.weblasTensor=this._wRowsMat.weblasTensor.transpose())}},{key:"_calcOutputPadding",value:function(t){var e=t.tensor.shape[0],r=t.tensor.shape[1],n=this.kernelShape[1],o=this.kernelShape[2],i=this.outputShape[0],a=this.outputShape[1],s="same"===this.borderMode?Math.max(0,Math.floor((e-1)*this.subsample[0]+n-i)):0,u="same"===this.borderMode?Math.max(0,Math.floor((r-1)*this.subsample[1]+o-a)):0,c=Math.floor(s/2),l=s-c,f=Math.floor(u/2),p=u-f;this.outputPadding=[c,l,f,p]}},{key:"_im2col",value:function(t){for(var e=u(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=new d.default([],[r*n,o]),a=new d.default([],[r*n]),s=new d.default([],[r,n]),c=0;c0&&void 0!==arguments[0]?arguments[0]:{};return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t))}return s(e,t),c(e,[{key:"_im2col",value:function(t){var e=u(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=this.kernelShape[1],a=this.kernelShape[2],s=this.outputShape[0],c=this.outputShape[1],l=s*c,f=i*a;this._imColsMat||(this._imColsMat=new h.default([],[l*o,f]));for(var p=new h.default([],[i,a,1]),d=0,v=0;v0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="SeparableConvolution2D";var n=t.nbFilter,o=void 0===n?1:n,s=t.nbRow,u=void 0===s?1:s,c=t.nbCol,l=void 0===c?1:c,p=t.activation,h=void 0===p?"linear":p,d=t.borderMode,v=void 0===d?"valid":d,y=t.subsample,g=void 0===y?[1,1]:y,_=t.depthMultiplier,b=void 0===_?1:_,m=t.dimOrdering,w=void 0===m?"tf":m,x=t.bias,O=void 0===x||x;if(r.activation=f[h],"valid"!==v&&"same"!==v)throw new Error(r.name+" [SeparableConvolution2D layer] Invalid borderMode.");if(r.borderMode=v,r.subsample=g,r.depthMultiplier=b,"tf"!==w&&"th"!==w)throw new Error(r.name+" [SeparableConvolution2D layer] Only tf and th dim ordering are allowed.");return r.dimOrdering=w,r.bias=O,r.params=r.bias?["depthwise_kernel","pointwise_kernel","b"]:["depthwise_kernel","pointwise_kernel"],r.depthwiseConvAttrs={nbFilter:r.depthMultiplier,nbRow:u,nbCol:l,activation:"linear", -borderMode:v,subsample:g,dimOrdering:w,bias:!1,gpu:t.gpu},r.pointwiseConvAttrs={nbFilter:o,nbRow:1,nbCol:1,activation:"linear",borderMode:v,subsample:[1,1],dimOrdering:w,bias:r.bias,gpu:t.gpu},r}return s(e,t),c(e,[{key:"setWeights",value:function(t){this._depthwiseConv=new x(this.depthwiseConvAttrs),this._depthwiseConv.setWeights(t.slice(0,1)),this._pointwiseConv=new g.default(this.pointwiseConvAttrs),this._pointwiseConv.setWeights(t.slice(1,3))}},{key:"call",value:function(t){var e=this._depthwiseConv.call(t),r=performance.now(),n=this._pointwiseConv.call(e),o=performance.now();return console.log(6,o-r),t.tensor=n.tensor,this.activation(t),t}}]),e}(v.default);e.default=O},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="UpSampling1D";var n=t.length,a=void 0===n?2:n;return r.length=a,r}return a(e,t),s(e,[{key:"call",value:function(t){for(var e=t.tensor.shape,r=[e[0]*this.length,e[1]],n=new f.default([],r),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="UpSampling2D";var n=t.size,a=void 0===n?[2,2]:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.size=a,r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0));for(var e=t.tensor.shape,r=[e[0]*this.size[0],e[1]*this.size[1],e[2]],n=new f.default([],r),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="UpSampling3D";var n=t.size,a=void 0===n?[2,2,2]:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.size=a,r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,3,0));for(var e=t.tensor.shape,r=[e[0]*this.size[0],e[1]*this.size[1],e[2]*this.size[2],e[3]],n=new f.default([],r),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="ZeroPadding1D";var n=t.padding,a=void 0===n?1:n;return r.padding=a,r}return a(e,t),s(e,[{key:"call",value:function(t){var e=t.tensor.shape,r=[e[0]+2*this.padding,e[1]],n=new f.default([],r);return h.default.assign(n.tensor.hi(e[0]+this.padding,e[1]).lo(this.padding,0),t.tensor),t.tensor=n.tensor,t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="ZeroPadding2D";var n=t.padding,a=void 0===n?[1,1]:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.padding=a,r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0));var e=t.tensor.shape,r=[e[0]+2*this.padding[0],e[1]+2*this.padding[1],e[2]],n=new f.default([],r);return h.default.assign(n.tensor.hi(e[0]+this.padding[0],e[1]+this.padding[1],e[2]).lo(this.padding[0],this.padding[1],0),t.tensor),t.tensor=n.tensor,"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(2,0,1)),t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="ZeroPadding3D";var n=t.padding,a=void 0===n?[1,1,1]:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.padding=a,r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,3,0));var e=t.tensor.shape,r=[e[0]+2*this.padding[0],e[1]+2*this.padding[1],e[2]+2*this.padding[2],e[3]],n=new f.default([],r);return h.default.assign(n.tensor.hi(e[0]+this.padding[0],e[1]+this.padding[1],e[2]+this.padding[2],e[3]).lo(this.padding[0],this.padding[1],this.padding[2],0),t.tensor),t.tensor=n.tensor,"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(3,0,1,2)),t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.ZeroPadding3D=e.ZeroPadding2D=e.ZeroPadding1D=e.UpSampling3D=e.UpSampling2D=e.UpSampling1D=e.Convolution3D=e.Deconvolution2D=e.SeparableConvolution2D=e.AtrousConvolution2D=e.Convolution2D=e.Convolution1D=void 0;var o=r(202),i=n(o),a=r(65),s=n(a),u=r(201),c=n(u),l=r(205),f=n(l),p=r(204),h=n(p),d=r(203),v=n(d),y=r(206),g=n(y),_=r(207),b=n(_),m=r(208),w=n(m),x=r(209),O=n(x),j=r(210),E=n(j),S=r(211),k=n(S);e.Convolution1D=i.default,e.Convolution2D=s.default,e.AtrousConvolution2D=c.default,e.SeparableConvolution2D=f.default,e.Deconvolution2D=h.default,e.Convolution3D=v.default,e.UpSampling1D=g.default,e.UpSampling2D=b.default,e.UpSampling3D=w.default,e.ZeroPadding1D=O.default,e.ZeroPadding2D=E.default,e.ZeroPadding3D=k.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Activation";var n=t.activation,o=void 0===n?"linear":n;return r.activation=l[o],r}return s(e,t),u(e,[{key:"call",value:function(t){return this.activation(t),t}}]),e}(p.default);e.default=h},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Dense";var n=t.outputDim,o=void 0===n?1:n,s=t.activation,u=void 0===s?"linear":s,c=t.inputDim,l=void 0===c?null:c,p=t.bias,h=void 0===p||p;return r.activation=f[u],r.outputDim=o,r.inputDim=l,r.bias=h,r.params=r.bias?["W","b"]:["W"],r.inputDim&&(r.inputShape=[r.inputDim]),r}return s(e,t),u(e,[{key:"setWeights",value:function(t){c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,t),this._useWeblas&&(this.weights.W.createWeblasTensor(),this.weights.W.weblasTensor=this.weights.W.weblasTensor.transpose(),this.bias?this.weights.b.createWeblasTensor():(this._zerosVec=new h.default([],[this.weights.W.tensor.shape[1]]),this._zerosVec.createWeblasTensor()))}},{key:"call",value:function(t){var e=new h.default([],[this.outputDim]);if(this._useWeblas){t.createWeblasTensor();var r=this.bias?this.weights.b.weblasTensor:this._zerosVec.weblasTensor;e.tensor.data=weblas.pipeline.sgemm(1,t.weblasTensor,this.weights.W.weblasTensor,1,r).transfer(),t.weblasTensor.delete(),delete t.weblasTensor}else this.bias&&_.default.assign(e.tensor,this.weights.b.tensor),(0,y.gemv)(1,this.weights.W.tensor.transpose(1,0),t.tensor,1,e.tensor);return t.tensor=e.tensor,this.activation(t),t}}]),e}(v.default);e.default=b},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Dropout";var n=t.p,a=void 0===n?.5:n;return r.p=Math.min(Math.max(0,a),1),r}return a(e,t),s(e,[{key:"call",value:function(t){return t}}]),e}(c.default);e.default=l},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="Flatten",r}return a(e,t),s(e,[{key:"call",value:function(t){if(t.tensor.shape.length>1){var e=new c.default([],[t.tensor.shape.reduce(function(t,e){return t*e},1)]);e.replaceTensorData(t.tensor.data),t.tensor=e.tensor}return t}}]),e}(f.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r._computeOutput=(0,b.default)({args:["array","array","array"],body:function(t,e,r){t=e*r+(1-r)*t}}),r.layerClass="Highway";var n=t.transformBias,o=void 0===n?-2:n,s=t.activation,u=void 0===s?"linear":s,c=t.bias,f=void 0===c||c;return r.transformBias=o,r.activation=l[u],r.bias=f,r.params=r.bias?["W","b","W_carry","b_carry"]:["W","W_carry"],r}return s(e,t),u(e,[{key:"call",value:function(t){var e=new p.default([],[this.weights.W.tensor.shape[1]]);this.bias&&g.default.assign(e.tensor,this.weights.b.tensor),(0,v.gemv)(1,this.weights.W.tensor.transpose(1,0),t.tensor,1,e.tensor),this.activation(e);var r=new p.default([],[this.weights.W_carry.tensor.shape[1]]);return this.bias&&g.default.assign(r.tensor,this.weights.b_carry.tensor),(0,v.gemv)(1,this.weights.W_carry.tensor.transpose(1,0),t.tensor,1,r.tensor),l.sigmoid(r),this._computeOutput(t.tensor,e.tensor,r.tensor),t}}]),e}(d.default);e.default=m},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="MaxoutDense";var n=t.outputDim,a=void 0===n?1:n,s=t.inputDim,u=void 0===s?null:s,c=t.bias,l=void 0===c||c;return r.outputDim=a,r.inputDim=u,r.bias=l,r.params=r.bias?["W","b"]:["W"],r}return a(e,t),s(e,[{key:"call",value:function(t){for(var e=this.weights.W.tensor.shape[0],r=new c.default([],[this.outputDim]),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Merge";var n=t.mode,a=void 0===n?"sum":n,s=t.concatAxis,u=void 0===s?-1:s,c=t.dotAxes,l=void 0===c?-1:c,f=t.outputShape,p=void 0===f?null:f,h=t.outputMask,d=void 0===h?null:h,v=["sum","mul","concat","ave","cos","dot","max"];if(!(v.indexOf(a)>-1))throw new Error(r.name+" [Merge layer] "+a+" not available.");return r.mode=a,r.concatAxis=u<=0?u:u-1,r.dotAxes=l<=0?l:l-1,r.outputShape=p,r.outputMask=d,r}return a(e,t),s(e,[{key:"_validateInputs",value:function(t){var e=this,r=t.map(function(t){return t.tensor.shape.slice()});if(["sum","mul","ave","cos","max"].indexOf(this.mode)>-1&&!r.every(function(t){return(0,w.default)(t,r[0])}))throw new Error(this.name+" [Merge layer] All input shapes must be the same for mode "+this.mode+".");if(["cos","dot"].indexOf(this.mode)>-1){if(2!==t.length)throw new Error(this.name+" [Merge layer] Exactly 2 inputs required for mode "+this.mode+".");if((0,O.default)(this.dotAxes)&&(this.dotAxes<0?this.dotAxes=[r[0].length+this.dotAxes,r[1].length+this.dotAxes]:this.dotAxes=[this.dotAxes,this.dotAxes]),r[0][this.dotAxes[0]]!==r[1][this.dotAxes[1]])throw new Error(this.name+" [Merge layer] Dimensions incompatibility using dot mode.")}else"concat"===this.mode&&!function(){var t=r.slice(),n=e.concatAxis<0?t[0].length+e.concatAxis:e.concatAxis;if(0===e.concatAxis&&(n=0),(0,E.default)(t.length).forEach(function(e){t[e].splice(n,1)}),!t.every(function(e){return(0,w.default)(e,t[0])}))throw new Error(e.name+" [Merge layer] In concat mode, all shapes must be the same except along the concat axis.")}();return!0}},{key:"call",value:function(t){var e=this,r=this._validateInputs(t);if(!r)throw new Error(this.name+" [Merge layer] Invalid inputs to call method.");var n=void 0,o=void 0;if(["sum","mul","ave","max"].indexOf(this.mode)>-1)o=t[0].tensor.shape.slice(),n=new c.default([],o);else if("concat"===this.mode)!function(){o=t[0].tensor.shape.slice();var r=e.concatAxis<0?o.length+e.concatAxis:e.concatAxis;0===e.concatAxis&&(r=0),t.slice(1,t.length).forEach(function(t){var e=t.tensor.shape.slice()[r];o[r]+=e}),n=new c.default([],o)}();else if(["cos","dot"].indexOf(this.mode)>-1){var i=t[0].tensor.shape.slice(),a=t[1].tensor.shape.slice();i.splice(this.dotAxes[0],1),a.splice(this.dotAxes[1],1),o=i.concat(a),1===o.length&&o.push(1),n=new c.default([],o)}if("sum"===this.mode)for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Permute";var n=t.dims,o=void 0===n?[]:n;return r.dims=o.map(function(t){return t-1}),r}return s(e,t),u(e,[{key:"call",value:function(t){var e;if(this.dims.length!==t.tensor.shape.length)throw new Error(this.name+" [Permute layer] The specified dims permutation must match the number of dimensions.");return t.tensor=(e=t.tensor).transpose.apply(e,o(this.dims)),t}}]),e}(l.default);e.default=f},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="RepeatVector";var n=t.n,a=void 0===n?1:n;return r.n=a,r}return a(e,t),s(e,[{key:"call",value:function(t){if(1!==t.tensor.shape.length)throw new Error(this.name+" [RepeatVector layer] Only 1D tensor inputs allowed.");return t.tensor=(0,h.default)((0,f.default)(t.tensor,0),[this.n,1]),t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e; -}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Reshape";var n=t.targetShape,a=void 0===n?[]:n;return r.targetShape=a,r}return a(e,t),s(e,[{key:"call",value:function(t){if(this.targetShape.reduce(function(t,e){return t*e},1)!==t.tensor.size)throw new Error(this.name+" [Reshape layer] The total size of new array must be unchanged in reshape layer.");var e=new c.default([],this.targetShape);return e.replaceTensorData(t.tensor.data),t.tensor=e.tensor,t}}]),e}(f.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="SpatialDropout2D";var n=t.p,a=void 0===n?.5:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.p=Math.min(Math.max(0,a),1),r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){return t}}]),e}(c.default);e.default=l},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="SpatialDropout3D";var n=t.p,a=void 0===n?.5:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.p=Math.min(Math.max(0,a),1),r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){return t}}]),e}(c.default);e.default=l},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.MaxoutDense=e.Highway=e.Merge=e.RepeatVector=e.Permute=e.Reshape=e.Flatten=e.SpatialDropout3D=e.SpatialDropout2D=e.Dropout=e.Activation=e.Dense=void 0;var o=r(214),i=n(o),a=r(213),s=n(a),u=r(215),c=n(u),l=r(223),f=n(l),p=r(224),h=n(p),d=r(216),v=n(d),y=r(222),g=n(y),_=r(220),b=n(_),m=r(221),w=n(m),x=r(219),O=n(x),j=r(217),E=n(j),S=r(218),k=n(S);e.Dense=i.default,e.Activation=s.default,e.Dropout=c.default,e.SpatialDropout2D=f.default,e.SpatialDropout3D=h.default,e.Flatten=v.default,e.Reshape=g.default,e.Permute=b.default,e.RepeatVector=w.default,e.Merge=O.default,e.Highway=E.default,e.MaxoutDense=k.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Embedding";var n=t.inputDim,a=void 0===n?1:n,s=t.outputDim,u=void 0===s?1:s,c=t.inputLength,l=void 0===c?0:c,f=t.maskZero,p=void 0!==f&&f,h=t.dropout,d=void 0===h?0:h;return r.inputDim=a,r.outputDim=u,r.inputLength=l,r.maskZero=p,r.dropout=d,r.params=["W"],r}return a(e,t),s(e,[{key:"call",value:function(t){for(var e=new f.default([],[t.tensor.shape[0],this.weights.W.tensor.shape[1]]),r=0,n=t.tensor.shape[0];r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="BatchNormalization";var n=t.epsilon,a=void 0===n?1e-5:n,s=t.mode,u=void 0===s?0:s,c=t.axis,l=void 0===c?-1:c;return r.epsilon=a,r.mode=u,r.axis=l,r.axisNormalized=!1,r.params=0===r.mode?["gamma","beta","running_mean","running_std"]:["gamma","beta"],r}return a(e,t),s(e,[{key:"call",value:function(t){var e=this;this.axisNormalized||(this.axis=this.axis<0?t.tensor.shape.length+this.axis:this.axis-1,this.axisNormalized=!0);for(var r=[],n=0;n0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="AveragePooling1D",r.poolingFunc="average",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(130),u=n(s),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="AveragePooling2D",r.poolingFunc="average",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(131),u=n(s),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="AveragePooling3D",r.poolingFunc="average",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="GlobalAveragePooling1D",r}return a(e,t),u(e,[{key:"call",value:function(t){for(var e=s(t.tensor.shape,2),r=e[0],n=e[1],o=new p.default([],[n]),i=0,a=n;i0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="GlobalAveragePooling2D";var n=t.dimOrdering,a=void 0===n?"tf":n;return r.dimOrdering=a,r}return a(e,t),u(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0));for(var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=new p.default([],[o]),a=0,u=o;a0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="GlobalMaxPooling1D",r}return a(e,t),s(e,[{key:"call",value:function(t){for(var e=t.tensor.shape[1],r=new f.default([],[e]),n=0,o=e;n0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="GlobalMaxPooling2D";var n=t.dimOrdering,a=void 0===n?"tf":n;return r.dimOrdering=a,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0));for(var e=t.tensor.shape[2],r=new f.default([],[e]),n=0,o=e;n0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="MaxPooling1D",r.poolingFunc="max",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(130),u=n(s),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="MaxPooling2D",r.poolingFunc="max",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(131),u=n(s),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="MaxPooling3D",r.poolingFunc="max",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalAveragePooling2D=e.GlobalMaxPooling2D=e.GlobalAveragePooling1D=e.GlobalMaxPooling1D=e.AveragePooling3D=e.AveragePooling2D=e.AveragePooling1D=e.MaxPooling3D=e.MaxPooling2D=e.MaxPooling1D=void 0;var o=r(237),i=n(o),a=r(238),s=n(a),u=r(239),c=n(u),l=r(230),f=n(l),p=r(231),h=n(p),d=r(232),v=n(d),y=r(235),g=n(y),_=r(233),b=n(_),m=r(236),w=n(m),x=r(234),O=n(x);e.MaxPooling1D=i.default,e.MaxPooling2D=s.default,e.MaxPooling3D=c.default,e.AveragePooling1D=f.default,e.AveragePooling2D=h.default,e.AveragePooling3D=v.default,e.GlobalMaxPooling1D=g.default,e.GlobalAveragePooling1D=b.default,e.GlobalMaxPooling2D=w.default,e.GlobalAveragePooling2D=O.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r._combine=(0,b.default)({args:["array","array","array","array"],body:function(t,e,r,n){t=e+r+n}}),r._update=(0,b.default)({args:["array","array","array"],body:function(t,e,r){t=t*(1-r)+e*r}}),r.layerClass="GRU";var n=t.outputDim,o=void 0===n?1:n,s=t.activation,u=void 0===s?"tanh":s,c=t.innerActivation,f=void 0===c?"hardSigmoid":c,p=t.returnSequences,h=void 0!==p&&p,d=t.goBackwards,v=void 0!==d&&d,y=t.stateful,g=void 0!==y&&y;return r.outputDim=o,r.activation=u,r.innerActivation=f,r.activationFunc=l[u],r.innerActivationFunc=l[f],r.returnSequences=h,r.goBackwards=v,r.stateful=g,r.params=["W_z","U_z","b_z","W_r","U_r","b_r","W_h","U_h","b_h"],r}return s(e,t),u(e,[{key:"call",value:function(t){var e=this,r=new p.default([],[t.tensor.shape[1]]),n=this.weights.b_z.tensor.shape[0],o=this.weights.b_r.tensor.shape[0],i=this.weights.b_h.tensor.shape[0],a=new p.default([],[n]),s=new p.default([],[n]),u=new p.default([],[n]),c=new p.default([],[o]),l=new p.default([],[o]),f=new p.default([],[o]),h=this.stateful&&this.currentHiddenState?this.currentHiddenState:new p.default([],[i]),d=new p.default([],[i]),y=new p.default([],[i]),_=new p.default([],[i]);this.hiddenStateSequence=new p.default([],[t.tensor.shape[0],i]);for(var b=function(){var t=[s,u,l,f,d,y];t.forEach(function(t){return g.default.assigns(t.tensor,0)})},m=function(){g.default.assign(_.tensor,h.tensor),(0,v.gemv)(1,e.weights.W_z.tensor.transpose(1,0),r.tensor,1,s.tensor),(0,v.gemv)(1,e.weights.U_z.tensor.transpose(1,0),_.tensor,1,u.tensor),e._combine(a.tensor,s.tensor,u.tensor,e.weights.b_z.tensor),e.innerActivationFunc(a),(0,v.gemv)(1,e.weights.W_r.tensor.transpose(1,0),r.tensor,1,l.tensor),(0,v.gemv)(1,e.weights.U_r.tensor.transpose(1,0),_.tensor,1,f.tensor),e._combine(c.tensor,l.tensor,f.tensor,e.weights.b_r.tensor),e.innerActivationFunc(c),g.default.muleq(c.tensor,_.tensor),(0,v.gemv)(1,e.weights.W_h.tensor.transpose(1,0),r.tensor,1,d.tensor),(0,v.gemv)(1,e.weights.U_h.tensor.transpose(1,0),c.tensor,1,y.tensor),e._combine(h.tensor,d.tensor,y.tensor,e.weights.b_h.tensor),e.activationFunc(h),e._update(h.tensor,_.tensor,a.tensor)},w=0,x=t.tensor.shape[0];w0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r._combine=(0,b.default)({args:["array","array","array","array"],body:function(t,e,r,n){t=e+r+n}}),r._update=(0,b.default)({args:["array","array","array","array"],body:function(t,e,r,n){t=t*r+e*n}}),r.layerClass="LSTM";var n=t.outputDim,o=void 0===n?1:n,s=t.activation,u=void 0===s?"tanh":s,c=t.innerActivation,f=void 0===c?"hardSigmoid":c,p=t.returnSequences,h=void 0!==p&&p,d=t.goBackwards,v=void 0!==d&&d,y=t.stateful,g=void 0!==y&&y;return r.outputDim=o,r.activation=u,r.innerActivation=f,r.activationFunc=l[u],r.innerActivationFunc=l[f],r.returnSequences=h,r.goBackwards=v,r.stateful=g,r.params=["W_i","U_i","b_i","W_c","U_c","b_c","W_f","U_f","b_f","W_o","U_o","b_o"],r}return s(e,t),u(e,[{key:"call",value:function(t){var e=this,r=new p.default([],[t.tensor.shape[1]]),n=this.weights.b_i.tensor.shape[0],o=this.weights.b_c.tensor.shape[0],i=this.weights.b_f.tensor.shape[0],a=this.weights.b_o.tensor.shape[0],s=new p.default([],[n]),u=new p.default([],[n]),c=new p.default([],[n]),l=new p.default([],[i]),f=new p.default([],[i]),h=new p.default([],[i]),d=new p.default([],[a]),y=new p.default([],[a]),_=new p.default([],[a]),b=new p.default([],[o]),m=new p.default([],[o]),w=new p.default([],[o]),x=this.stateful&&this.previousCandidate?this.previousCandidate:new p.default([],[o]),O=this.stateful&&this.currentHiddenState?this.currentHiddenState:new p.default([],[o]),j=new p.default([],[o]);this.hiddenStateSequence=new p.default([],[t.tensor.shape[0],o]);for(var E=function(){var t=[u,c,f,h,y,_,m,w];t.forEach(function(t){return g.default.assigns(t.tensor,0)})},S=function(){g.default.assign(j.tensor,O.tensor),(0,v.gemv)(1,e.weights.W_i.tensor.transpose(1,0),r.tensor,1,u.tensor),(0,v.gemv)(1,e.weights.U_i.tensor.transpose(1,0),j.tensor,1,c.tensor),e._combine(s.tensor,u.tensor,c.tensor,e.weights.b_i.tensor),e.innerActivationFunc(s),(0,v.gemv)(1,e.weights.W_f.tensor.transpose(1,0),r.tensor,1,f.tensor),(0,v.gemv)(1,e.weights.U_f.tensor.transpose(1,0),j.tensor,1,h.tensor),e._combine(l.tensor,f.tensor,h.tensor,e.weights.b_f.tensor),e.innerActivationFunc(l),(0,v.gemv)(1,e.weights.W_o.tensor.transpose(1,0),r.tensor,1,y.tensor),(0,v.gemv)(1,e.weights.U_o.tensor.transpose(1,0),j.tensor,1,_.tensor),e._combine(d.tensor,y.tensor,_.tensor,e.weights.b_o.tensor),e.innerActivationFunc(d),(0,v.gemv)(1,e.weights.W_c.tensor.transpose(1,0),r.tensor,1,m.tensor),(0, -v.gemv)(1,e.weights.U_c.tensor.transpose(1,0),j.tensor,1,w.tensor),e._combine(b.tensor,m.tensor,w.tensor,e.weights.b_c.tensor),e.activationFunc(b),e._update(b.tensor,x.tensor,s.tensor,l.tensor),g.default.assign(x.tensor,b.tensor),e.activationFunc(b),g.default.mul(O.tensor,d.tensor,b.tensor)},k=0,P=t.tensor.shape[0];k0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r._combine=(0,b.default)({args:["array","array","array","array"],body:function(t,e,r,n){t=e+r+n}}),r.layerClass="SimpleRNN";var n=t.outputDim,o=void 0===n?1:n,s=t.activation,u=void 0===s?"tanh":s,c=t.returnSequences,f=void 0!==c&&c,p=t.goBackwards,h=void 0!==p&&p,d=t.stateful,v=void 0!==d&&d;return r.outputDim=o,r.activation=u,r.activationFunc=l[u],r.returnSequences=f,r.goBackwards=h,r.stateful=v,r.params=["W","U","b"],r}return s(e,t),u(e,[{key:"call",value:function(t){var e=this,r=new p.default([],[t.tensor.shape[1]]),n=this.weights.b.tensor.shape[0],o=this.stateful&&this.currentHiddenState?this.currentHiddenState:new p.default([],[n]),i=new p.default([],[n]),a=new p.default([],[n]),s=new p.default([],[n]);this.hiddenStateSequence=new p.default([],[t.tensor.shape[0],n]);for(var u=function(){var t=[i,a];t.forEach(function(t){return g.default.assigns(t.tensor,0)})},c=function(){g.default.assign(s.tensor,o.tensor),(0,v.gemv)(1,e.weights.W.tensor.transpose(1,0),r.tensor,1,i.tensor),(0,v.gemv)(1,e.weights.U.tensor.transpose(1,0),s.tensor,1,a.tensor),e._combine(o.tensor,i.tensor,a.tensor,e.weights.b.tensor),e.activationFunc(o)},l=0,f=t.tensor.shape[0];l0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Bidirectional";var n=t.layer,o=t.mergeMode,s=void 0===o?"concat":o;if(!n)throw new Error("[Bidirectional] wrapped layer is undefined.");r.forwardLayer=n;var u=(0,y.default)(n,["outputDim","activation","innerActivation","returnSequences","goBackwards","stateful"]);return u.goBackwards=!u.goBackwards,r.backwardLayer=new _[n.layerClass](u),r.mergeMode=s,r}return s(e,t),u(e,[{key:"setWeights",value:function(t){this.forwardLayer.setWeights(t.slice(0,t.length/2)),this.backwardLayer.setWeights(t.slice(t.length/2))}},{key:"call",value:function(t){var e=new p.default(t.tensor.data,t.tensor.shape),r=new p.default(t.tensor.data,t.tensor.shape),n=this.forwardLayer.call(e),o=this.backwardLayer.call(r);if("concat"===this.mergeMode){var i=n.tensor.shape.slice();i[i.length-1]+=o.tensor.shape[i.length-1];var a=new p.default([],i);this.forwardLayer.returnSequences?(d.default.assign(a.tensor.hi(i[0],n.tensor.shape[1]).lo(0,0),n.tensor),d.default.assign(a.tensor.hi(i[0],i[1]).lo(0,n.tensor.shape[1]),o.tensor.step(-1))):(d.default.assign(a.tensor.hi(n.tensor.shape[0]).lo(0),n.tensor),d.default.assign(a.tensor.hi(i[0]).lo(n.tensor.shape[0]),o.tensor)),t.tensor=a.tensor}else if("sum"===this.mergeMode){var s=n.tensor.shape.slice(),u=new p.default([],s);d.default.addeq(u.tensor,n.tensor),d.default.addeq(u.tensor,o.tensor),t.tensor=u.tensor}else if("mul"===this.mergeMode){var c=n.tensor.shape.slice(),l=new p.default([],c);d.default.assigns(l.tensor,1),d.default.muleq(l.tensor,n.tensor),d.default.muleq(l.tensor,o.tensor),t.tensor=l.tensor}else if("ave"===this.mergeMode){var f=n.tensor.shape.slice(),h=new p.default([],f);d.default.addeq(h.tensor,n.tensor),d.default.addeq(h.tensor,o.tensor),d.default.divseq(h.tensor,2),t.tensor=h.tensor}return t}}]),e}(l.default);e.default=b},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="TimeDistributed";var n=t.layer;if(!n)throw new Error("[TimeDistributed] wrapped layer is undefined.");return r.layer=n,r}return s(e,t),u(e,[{key:"setWeights",value:function(t){this.layer.setWeights(t)}},{key:"call",value:function(t){var e,r,n=[].concat(o(t.tensor.shape.slice(1))),i=new p.default([],n);d.default.assign(i.tensor,(e=t.tensor).pick.apply(e,[0].concat(o(n.map(function(t){return null})))));var a=this.layer.call(i),s=a.tensor.shape.slice(),u=new p.default([],[t.tensor.shape[0]].concat(o(s)));d.default.assign((r=u.tensor).pick.apply(r,[0].concat(o(s.map(function(t){return null})))),a.tensor);for(var c=1,l=t.tensor.shape[0];c2&&void 0!==arguments[2]?arguments[2]:1e-5,n=(0,u.default)((0,a.default)(t)),o=e;if(n.length!==o.length)return!1;for(var i=0;io[i]+r)return!1}return!0}Object.defineProperty(e,"__esModule",{value:!0}),e.approxEquals=o;var i=r(187),a=n(i),s=r(180),u=n(s),c=r(550),l=n(c)},function(t,e){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-r(t)}function o(t){var e,n,o,i,a,s,u=t.length;a=r(t),s=new l(3*u/4-a),o=a>0?u-4:u;var f=0;for(e=0,n=0;e>16&255,s[f++]=i>>8&255,s[f++]=255&i;return 2===a?(i=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[f++]=255&i):1===a&&(i=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[f++]=i>>8&255,s[f++]=255&i),s}function i(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,r){for(var n,o=[],a=e;al?l:c+s));return 1===n?(e=t[r-1],o+=u[e>>2],o+=u[e<<4&63],o+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],o+=u[e>>10],o+=u[e>>4&63],o+=u[e<<2&63],o+="="),i.push(o),i.join("")}e.byteLength=n,e.toByteArray=o,e.fromByteArray=s;for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,h=f.length;p0)-(t<0)},e.abs=function(t){var e=t>>n-1;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,e|=r,e|t>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var o=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,o=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--o;t[e]=n<>>8&255]<<16|o[t>>>16&255]<<8|o[t>>>24&255]},e.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},e.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},e.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},e.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},function(t,e,r){(function(e,r,n){/* @preserve +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KerasJS=e():t.KerasJS=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,e,r){Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=595)}([function(t,e,r){var n=r(5),o=r(30),i=r(15),a=r(16),s=r(31),u="prototype",c=function(t,e,r){var l,f,p,h,d=t&c.F,v=t&c.G,y=t&c.S,g=t&c.P,_=t&c.B,b=v?n:y?n[e]||(n[e]={}):(n[e]||{})[u],m=v?o:o[e]||(o[e]={}),w=m[u]||(m[u]={});v&&(r=e);for(l in r)f=!d&&b&&void 0!==b[l],p=(f?b:r)[l],h=_&&f?s(p,n):g&&"function"==typeof p?s(Function.call,p):p,b&&a(b,l,p,t&c.U),m[l]!=p&&i(m,l,h),g&&w[l]!=p&&(w[l]=p)};n.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.layerClass="Layer",this.name=e.name,this.params=[],this.weights={},e.gpu&&weblas?this._useWeblas=!0:this._useWeblas=!1}return i(t,[{key:"setWeights",value:function(t){var e=this;this.params.forEach(function(r,n){e.weights[r]=t[n]})}},{key:"toggleGpu",value:function(t){var e="undefined"==typeof t?!this._useWeblas:t;e&&weblas?this._useWeblas=!0:this._useWeblas=!1}},{key:"call",value:function(t){return t}},{key:"createWeblasWeights",value:function(){var t=this;this.weblasWeights={},this.params.forEach(function(e,r){if(1===t.weights[e].tensor.shape.length){var n=[1,t.weights[e].tensor.shape[0]];t.weblasWeights[e]=new weblas.pipeline.Tensor(n,t.weights[e].tensor.data)}if(2===t.weights[e].tensor.shape.length){var o=t.weights[e].tensor.shape;t.weblasWeights[e]=new weblas.pipeline.Tensor(o,t.weights[e].tensor.data)}})}},{key:"transferWeblasWeights",value:function(){var t=this;this.params.forEach(function(e,r){if(t.weblasWeights[e]){var n=t.weblasWeights[e].shape,o=t.weblasWeights[e].transfer(!0);t.weights[e].tensor=(0,c.default)((0,s.default)(o,n))}})}},{key:"deleteWeblasWeights",value:function(){var t=this;this.params.forEach(function(e,r){t.weblasWeights[e]&&(t.weblasWeights[e].delete(),delete t.weblasWeights[e])}),delete this.weblasWeights}}]),t}();e.default=l},function(t,e,r){var n=r(7);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};o(this,t),this._type=n.type||Float32Array,e&&e.length&&(e instanceof this._type||e instanceof Array)?(f(e,r),this.tensor=(0,s.default)(e,r),this.tensor=(0,s.default)(new this._type(e),r)):!e.length&&r.length?this.tensor=(0,s.default)(new this._type(r.reduce(function(t,e){return t*e},1)),r):this.tensor=(0,s.default)(new this._type([]),[]),this._gpuMaxSizeExceeded=!1}return i(t,[{key:"createWeblasTensor",value:function(){if(this.weblasTensor&&this.weblasTensor.delete(),1===this.tensor.shape.length){var t=this.tensor.shape[0];if(t>l.MAX_TEXTURE_SIZE)this._gpuMaxSizeExceeded=!0;else{var e=[1,t];this.weblasTensor=new weblas.pipeline.Tensor(e,this.tensor.data)}}else{if(2!==this.tensor.shape.length)throw new Error("[Tensor] can only create weblas Tensor for 1-D or 2-D only");if(this.tensor.shape.some(function(t){return t>l.MAX_TEXTURE_SIZE}))this._gpuMaxSizeExceeded=!0;else{var r=this.tensor.shape;this.weblasTensor=new weblas.pipeline.Tensor(r,this.tensor.data)}}}},{key:"transferWeblasTensor",value:function(){if(this.weblasTensor){var t=this.weblasTensor.shape,e=this.weblasTensor.transfer(!0);this.tensor=(0,c.default)((0,s.default)(e,t))}}},{key:"deleteWeblasTensor",value:function(){this.weblasTensor&&(this.weblasTensor.delete(),delete this.weblasTensor)}},{key:"replaceTensorData",value:function(t){if(t&&t.length&&t instanceof this._type)this.tensor.data=t;else{if(!(t&&t.length&&t instanceof Array))throw new Error("[Tensor] invalid input for replaceTensorData method.");this.tensor.data=new this._type(t)}}}]),t}();e.default=p},function(t,e,r){"use strict";function n(t){if(!t)return s;for(var e=0;e>",rrshift:">>>"};!function(){for(var t in u){var r=u[t];e[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+r+"c"},funcName:t}),e[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+r+"=b"},rvalue:!0,funcName:t+"eq"}),e[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+r+"s"},funcName:t+"s"}),e[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+r+"=s"},rvalue:!0,funcName:t+"seq"})}}();var c={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in c){var r=c[t];e[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+r+"b"},funcName:t}),e[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+r+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in l){var r=l[t];e[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+r+"c"},funcName:t}),e[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+r+"s"},funcName:t+"s"}),e[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+r+"b"},rvalue:!0,count:2,funcName:t+"eq"}),e[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+r+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),e.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),e.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),e.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),e.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),e.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),e.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),e.equals=a({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){var n=r(75)("wks"),o=r(46),i=r(5).Symbol,a="function"==typeof i,s=t.exports=function(t){return n[t]||(n[t]=a&&i[t]||(a?i:o)("Symbol."+t))};s.store=n},function(t,e,r){t.exports=!r(6)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,r){var n=r(2),o=r(142),i=r(28),a=Object.defineProperty;e.f=r(9)?Object.defineProperty:function(t,e,r){if(n(t),e=i(e,!0),n(r),o)try{return a(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){var n=r(37),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e,r){var n=r(23);t.exports=function(t){return Object(n(t))}},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){var n=r(10),o=r(36);t.exports=r(9)?function(t,e,r){return n.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){var n=r(5),o=r(15),i=r(13),a=r(46)("src"),s="toString",u=Function[s],c=(""+u).split(s);r(30).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,r,s){var u="function"==typeof r;u&&(i(r,"name")||o(r,"name",e)),t[e]!==r&&(u&&(i(r,a)||o(r,a,t[e]?""+t[e]:c.join(String(e)))),t===n?t[e]=r:s?t[e]?t[e]=r:o(t,e,r):(delete t[e],o(t,e,r)))})(Function.prototype,s,function(){return"function"==typeof this&&this[a]||u.call(this)})},function(t,e,r){var n=r(0),o=r(6),i=r(23),a=/"/g,s=function(t,e,r,n){var o=String(i(t)),s="<"+e;return""!==r&&(s+=" "+r+'="'+String(n).replace(a,""")+'"'),s+">"+o+""};t.exports=function(t,e){var r={};r[t]=e(s),n(n.P+n.F*o(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",r)}},function(t,e,r){var n=r(58),o=r(23);t.exports=function(t){return n(o(t))}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(1===t.tensor.shape.length){var e=h.default.sup(t.tensor);h.default.subseq(t.tensor,e),h.default.expeq(t.tensor);var r=h.default.sum(t.tensor);h.default.divseq(t.tensor,r)}else{if(2!==t.tensor.shape.length)throw new Error("[activations.softmax] tensor shape "+t.tensor.shape+" not supported.");for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=e.alpha,n=void 0===r?0:r,o=e.maxValue,i=void 0===o?null:o,a=void 0;return 0!==n&&(a=new g.default([],t.tensor.shape),h.default.mins(a.tensor,t.tensor,0),h.default.mulseq(a.tensor,n)),h.default.maxseq(t.tensor,0),i&&h.default.minseq(t.tensor,i),a&&h.default.addeq(t.tensor,a.tensor),this}function u(t){return m(t.tensor),this}function c(t){return w(t.tensor),this}function l(t){return x(t.tensor),this}function f(t){return this}Object.defineProperty(e,"__esModule",{value:!0}),e.softmax=o,e.softplus=i,e.softsign=a,e.relu=s,e.tanh=u,e.sigmoid=c,e.hardSigmoid=l,e.linear=f;var p=r(4),h=n(p),d=r(25),v=n(d),y=r(3),g=n(y),_=(0,v.default)({args:["array"],body:function(t){t=Math.log(Math.exp(t)+1)}}),b=(0,v.default)({args:["array"],body:function(t){t/=1+Math.abs(t)}}),m=(0,v.default)({args:["array"],body:function(t){t=Math.tanh(t)}}),w=(0,v.default)({args:["array"],body:function(t){t=1/(1+Math.exp(-t))}}),x=(0,v.default)({args:["array"],body:function(t){t=.2*t+.5,t<=0?t=0:t>=1&&(t=1)}})},function(t,e,r){var n=r(59),o=r(36),i=r(18),a=r(28),s=r(13),u=r(142),c=Object.getOwnPropertyDescriptor;e.f=r(9)?c:function(t,e){if(t=i(t),e=a(e,!0),u)try{return c(t,e)}catch(t){}if(s(t,e))return o(!n.f.call(t,e),t[e])}},function(t,e,r){var n=r(13),o=r(12),i=r(103)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),n(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(6);t.exports=function(t,e){return!!t&&n(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e,r){"use strict";function n(t){for(var e in t)a.indexOf(e)<0&&s.indexOf(e)<0&&console.warn("cwise: Unknown argument '"+e+"' passed to expression compiler");for(var r=0;rw;w++)if((p||w in _)&&(v=_[w],y=b(v,w,g),t))if(r)x[w]=y;else if(y)switch(t){case 3:return!0;case 5:return v;case 6:return w;case 2:x.push(v)}else if(l)return!1;return f?-1:c||l?l:x}}},function(t,e,r){var n=r(0),o=r(30),i=r(6);t.exports=function(t,e){var r=(o.Object||{})[t]||Object[t],a={};a[t]=e(r),n(n.S+n.F*i(function(){r(1)}),"Object",a)}},function(t,e,r){var n=r(7);t.exports=function(t,e){if(!n(t))return t;var r,o;if(e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!n(o=r.call(t)))return o;if(!e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var n=r(172),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,e,r){var n=r(14);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,r){var n=r(158),o=r(0),i=r(75)("metadata"),a=i.store||(i.store=new(r(161))),s=function(t,e,r){var o=a.get(t);if(!o){if(!r)return;a.set(t,o=new n)}var i=o.get(e);if(!i){if(!r)return;o.set(e,i=new n)}return i},u=function(t,e,r){var n=s(e,r,!1);return void 0!==n&&n.has(t)},c=function(t,e,r){var n=s(e,r,!1);return void 0===n?void 0:n.get(t)},l=function(t,e,r,n){s(r,n,!0).set(t,e)},f=function(t,e){var r=s(t,e,!1),n=[];return r&&r.forEach(function(t,e){n.push(e)}),n},p=function(t){return void 0===t||"symbol"==typeof t?t:String(t)},h=function(t){o(o.S,"Reflect",t)};t.exports={store:a,map:s,has:u,get:c,set:l,keys:f,key:p,exp:h}},function(t,e,r){"use strict";if(r(9)){var n=r(39),o=r(5),i=r(6),a=r(0),s=r(76),u=r(110),c=r(31),l=r(38),f=r(36),p=r(15),h=r(43),d=r(37),v=r(11),y=r(45),g=r(28),_=r(13),b=r(155),m=r(57),w=r(7),x=r(12),O=r(95),j=r(40),E=r(21),S=r(41).f,k=r(112),P=r(46),A=r(8),M=r(26),C=r(66),T=r(104),R=r(113),F=r(52),I=r(72),D=r(44),L=r(88),N=r(135),U=r(10),B=r(20),V=U.f,W=B.f,z=o.RangeError,q=o.TypeError,G=o.Uint8Array,H="ArrayBuffer",Y="Shared"+H,$="BYTES_PER_ELEMENT",K="prototype",X=Array[K],Z=u.ArrayBuffer,Q=u.DataView,J=M(0),tt=M(2),et=M(3),rt=M(4),nt=M(5),ot=M(6),it=C(!0),at=C(!1),st=R.values,ut=R.keys,ct=R.entries,lt=X.lastIndexOf,ft=X.reduce,pt=X.reduceRight,ht=X.join,dt=X.sort,vt=X.slice,yt=X.toString,gt=X.toLocaleString,_t=A("iterator"),bt=A("toStringTag"),mt=P("typed_constructor"),wt=P("def_constructor"),xt=s.CONSTR,Ot=s.TYPED,jt=s.VIEW,Et="Wrong length!",St=M(1,function(t,e){return Tt(T(t,t[wt]),e)}),kt=i(function(){return 1===new G(new Uint16Array([1]).buffer)[0]}),Pt=!!G&&!!G[K].set&&i(function(){new G(1).set({})}),At=function(t,e){if(void 0===t)throw q(Et);var r=+t,n=v(t);if(e&&!b(r,n))throw z(Et);return n},Mt=function(t,e){var r=d(t);if(r<0||r%e)throw z("Wrong offset!");return r},Ct=function(t){if(w(t)&&Ot in t)return t;throw q(t+" is not a typed array!")},Tt=function(t,e){if(!(w(t)&&mt in t))throw q("It is not a typed array constructor!");return new t(e)},Rt=function(t,e){return Ft(T(t,t[wt]),e)},Ft=function(t,e){for(var r=0,n=e.length,o=Tt(t,n);n>r;)o[r]=e[r++];return o},It=function(t,e,r){V(t,e,{get:function(){return this._d[r]}})},Dt=function(t){var e,r,n,o,i,a,s=x(t),u=arguments.length,l=u>1?arguments[1]:void 0,f=void 0!==l,p=k(s);if(void 0!=p&&!O(p)){for(a=p.call(s),n=[],e=0;!(i=a.next()).done;e++)n.push(i.value);s=n}for(f&&u>2&&(l=c(l,arguments[2],2)),e=0,r=v(s.length),o=Tt(this,r);r>e;e++)o[e]=f?l(s[e],e):s[e];return o},Lt=function(){for(var t=0,e=arguments.length,r=Tt(this,e);e>t;)r[t]=arguments[t++];return r},Nt=!!G&&i(function(){gt.call(new G(1))}),Ut=function(){return gt.apply(Nt?vt.call(Ct(this)):Ct(this),arguments)},Bt={copyWithin:function(t,e){return N.call(Ct(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return rt(Ct(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return L.apply(Ct(this),arguments)},filter:function(t){return Rt(this,tt(Ct(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return nt(Ct(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return ot(Ct(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(Ct(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return at(Ct(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return it(Ct(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(Ct(this),arguments)},lastIndexOf:function(t){return lt.apply(Ct(this),arguments)},map:function(t){return St(Ct(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return ft.apply(Ct(this),arguments)},reduceRight:function(t){return pt.apply(Ct(this),arguments)},reverse:function(){for(var t,e=this,r=Ct(e).length,n=Math.floor(r/2),o=0;o1?arguments[1]:void 0)},sort:function(t){return dt.call(Ct(this),t)},subarray:function(t,e){var r=Ct(this),n=r.length,o=y(t,n);return new(T(r,r[wt]))(r.buffer,r.byteOffset+o*r.BYTES_PER_ELEMENT,v((void 0===e?n:y(e,n))-o))}},Vt=function(t,e){return Rt(this,vt.call(Ct(this),t,e))},Wt=function(t){Ct(this);var e=Mt(arguments[1],1),r=this.length,n=x(t),o=v(n.length),i=0;if(o+e>r)throw z(Et);for(;i255?255:255&n),o.v[d](r*e+o.o,n,kt)},A=function(t,e){V(t,e,{get:function(){return k(this,e)},set:function(t){return P(this,e,t)},enumerable:!0})};b?(y=r(function(t,r,n,o){l(t,y,c,"_d");var i,a,s,u,f=0,h=0;if(w(r)){if(!(r instanceof Z||(u=m(r))==H||u==Y))return Ot in r?Ft(y,r):Dt.call(y,r);i=r,h=Mt(n,e);var d=r.byteLength;if(void 0===o){if(d%e)throw z(Et);if(a=d-h,a<0)throw z(Et)}else if(a=v(o)*e,a+h>d)throw z(Et);s=a/e}else s=At(r,!0),a=s*e,i=new Z(a);for(p(t,"_d",{b:i,o:h,l:a,e:s,v:new Q(i)});f0?n:r)(t)}},function(t,e){t.exports=function(t,e,r,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,e){t.exports=!1},function(t,e,r){var n=r(2),o=r(148),i=r(91),a=r(103)("IE_PROTO"),s=function(){},u="prototype",c=function(){var t,e=r(90)("iframe"),n=i.length,o="<",a=">";for(e.style.display="none",r(93).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+a+"document.F=Object"+o+"/script"+a),t.close(),c=t.F;n--;)delete c[u][i[n]];return c()};t.exports=Object.create||function(t,e){var r;return null!==t?(s[u]=n(t),r=new s,s[u]=null,r[a]=t):r=c(),void 0===e?r:o(r,e)}},function(t,e,r){var n=r(150),o=r(91).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},function(t,e,r){var n=r(150),o=r(91);t.exports=Object.keys||function(t){return n(t,o)}},function(t,e,r){var n=r(16);t.exports=function(t,e,r){for(var o in e)n(t,o,e[o],r);return t}},function(t,e,r){"use strict";var n=r(5),o=r(10),i=r(9),a=r(8)("species");t.exports=function(t){var e=n[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e,r){var n=r(37),o=Math.max,i=Math.min;t.exports=function(t,e){return t=n(t),t<0?o(t+e,0):i(t,e)}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e,r){function n(t,e){var r=i(t,e);return o(r)?r:void 0}var o=r(464),i=r(498);t.exports=n},function(t,e,r){function n(t){return a(t)?o(t):i(t)}var o=r(449),i=r(466),a=r(84);t.exports=n},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(8)("unscopables"),o=Array.prototype;void 0==o[n]&&r(15)(o,n,{}),t.exports=function(t){o[n][t]=!0}},function(t,e,r){var n=r(31),o=r(144),i=r(95),a=r(2),s=r(11),u=r(112),c={},l={},e=t.exports=function(t,e,r,f,p){var h,d,v,y,g=p?function(){return t}:u(t),_=n(r,f,e?2:1),b=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(i(g)){for(h=s(t.length);h>b;b++)if(y=e?_(a(d=t[b])[0],d[1]):_(t[b]),y===c||y===l)return y}else for(v=g.call(t);!(d=v.next()).done;)if(y=o(v,_,d.value,e),y===c||y===l)return y};e.BREAK=c,e.RETURN=l},function(t,e){t.exports={}},function(t,e,r){var n=r(10).f,o=r(13),i=r(8)("toStringTag");t.exports=function(t,e,r){t&&!o(t=r?t:t.prototype,i)&&n(t,i,{configurable:!0,value:e})}},function(t,e,r){var n=r(0),o=r(23),i=r(6),a=r(108),s="["+a+"]",u="​…",c=RegExp("^"+s+s+"*"),l=RegExp(s+s+"*$"),f=function(t,e,r){var o={},s=i(function(){return!!a[t]()||u[t]()!=u}),c=o[t]=s?e(p):a[t];r&&(o[r]=c),n(n.P+n.F*s,"String",o)},p=f.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(c,"")), +2&e&&(t=t.replace(l,"")),t};t.exports=f},function(t,e){function r(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=r},function(t,e,r){"use strict";t.exports.gemv=r(575),t.exports.gbmv=r(574),t.exports.symv=r(581),t.exports.sbmv=r(577),t.exports.spmv=r(578),t.exports.trmv=r(587),t.exports.tbmv=r(584),t.exports.trsv=r(588),t.exports.tbsv=r(585),t.exports.tpsv=r(586),t.exports.ger=r(576),t.exports.syr=r(582),t.exports.spr=r(579),t.exports.syr2=r(583),t.exports.spr2=r(580),t.exports.trmv_lower=function(e,r){return console.warn("trmv_lower is deprecated. Please use the 'isLower' flag with trmv."),t.exports.trmv(e,r,!0)},t.exports.trsv_lower=function(e,r){return console.warn("trsv_lower is deprecated. Please use the 'isLower' flag with trsv."),t.exports.trsv(e,r,!0)}},function(t,e,r){var n=r(22),o=r(8)("toStringTag"),i="Arguments"==n(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,r,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=a(e=Object(t),o))?r:i?n(e):"Object"==(s=n(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,r){var n=r(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){function n(t){if("string"==typeof t||o(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}var o=r(85),i=1/0;t.exports=n},function(t,e){function r(t){return null!=t&&"object"==typeof t}t.exports=r},function(t,e,r){function n(t){return null==t?"":o(t)}var o=r(480);t.exports=n},function(t,e,r){"use strict";function n(t){return Array.isArray(t)?[t.length,t[0].length]:t.shape}function o(t,e,r){var o=n(t),i=n(e),a=n(r);if(o[0]!==i[0]||o[1]!==a[1]||i[1]!==a[0])throw new Error("Mismatched array shapes for matrix product")}function i(t){if(Array.isArray(t)){if(Array.isArray(t))return["r","native"]}else if(t.shape&&2===t.shape.length)return t.order[0]?["r",t.dtype]:["c",t.dtype];throw new Error("Unrecognized data type")}function a(t,e,r,n,a){void 0===n&&(n=1),void 0===a&&(a=0);var c=1!==n,l=0!==a,f=i(t),p=i(e),h=i(r);o(t,e,r);var d=[f,p,h,c,l].join(":"),v=u[d];return v||(v=u[d]=s(f,p,h,c,l)),v(t,e,r,n,a)}t.exports=a;var s=r(590),u={}},function(t,e,r){function n(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+r+"_set("+c.join(",")+",v){"),n?i.push("return this.data.set("+l+",v)}"):i.push("return this.data["+l+"]=v}"),i.push("proto.get=function "+r+"_get("+c.join(",")+"){"),n?i.push("return this.data.get("+l+")}"):i.push("return this.data["+l+"]}"),i.push("proto.index=function "+r+"_index(",c.join(),"){return "+l+"}"),i.push("proto.hi=function "+r+"_hi("+c.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),v=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});i.push("proto.lo=function "+r+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+v.join(","));for(var y=0;y=0){d=i"+y+"|0;b+=c"+y+"*d;a"+y+"-=d}");i.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),i.push("proto.step=function "+r+"_step("+c.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var y=0;y=0){c=(c+this.stride["+y+"]*i"+y+")|0}else{a.push(this.shape["+y+"]);b.push(this.stride["+y+"])}");i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var a=new Function("CTOR_LIST","ORDER",i.join("\n"));return a(f[t],o)}function a(t){if(c(t))return"buffer";if(l)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var o=f.array[0];return o([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var u=s-1,c=1;u>=0;--u)r[u]=c,c*=e[u]}if(void 0===n){n=0;for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Convolution2D";var n=t.nbFilter,o=void 0===n?1:n,s=t.nbRow,u=void 0===s?3:s,c=t.nbCol,l=void 0===c?3:c,f=t.activation,h=void 0===f?"linear":f,d=t.borderMode,v=void 0===d?"valid":d,y=t.subsample,g=void 0===y?[1,1]:y,_=t.dimOrdering,b=void 0===_?"tf":_,m=t.bias,w=void 0===m||m;if(r.kernelShape=[o,u,l],r.activation=p[h],"valid"!==v&&"same"!==v)throw new Error(r.name+" [Convolution2D layer] Invalid borderMode.");if(r.borderMode=v,r.subsample=g,"tf"!==b&&"th"!==b)throw new Error(r.name+" [Convolution2D layer] Only tf and th dim ordering are allowed.");return r.dimOrdering=b,r.bias=w,r.params=r.bias?["W","b"]:["W"],r}return s(e,t),c(e,[{key:"setWeights",value:function(t){"th"===this.dimOrdering&&(t[0].tensor=t[0].tensor.transpose(2,3,1,0)),l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,t),this._w2row(),this._useWeblas&&(this._wRowsMat.createWeblasTensor(),this._wRowsMat.weblasTensor=this._wRowsMat.weblasTensor.transpose(),this.bias?this.weights.b.createWeblasTensor():(this._zerosVec=new d.default([],[this.weights.W.tensor.shape[3]]),this._zerosVec.createWeblasTensor()))}},{key:"_calcOutputShape",value:function(t){var e=t.tensor.shape[0],r=t.tensor.shape[1],n=u(this.kernelShape,3),o=n[0],i=n[1],a=n[2],s="same"===this.borderMode?Math.floor((e+this.subsample[0]-1)/this.subsample[0]):Math.floor((e-i+this.subsample[0])/this.subsample[0]),c="same"===this.borderMode?Math.floor((r+this.subsample[1]-1)/this.subsample[1]):Math.floor((r-a+this.subsample[1])/this.subsample[1]),l=o,f="same"===this.borderMode?Math.max(0,Math.floor((s-1)*this.subsample[0]+i-e)):0,p="same"===this.borderMode?Math.max(0,Math.floor((c-1)*this.subsample[1]+a-r)):0,h=Math.floor(f/2),d=f-h,v=Math.floor(p/2),y=p-v;this.outputShape=[s,c,l],this.inputPadding=[h,d,v,y]}},{key:"_padInput",value:function(t){if("same"===this.borderMode){var e=u(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=u(this.inputPadding,4),a=i[0],s=i[1],c=i[2],l=i[3],f=r+a+s,p=n+c+l,h=new d.default([],[f,p,o]);_.default.assign(h.tensor.hi(r+a,n+c,o).lo(a,c,0),t.tensor),t.tensor=h.tensor}return t}},{key:"_im2col",value:function(t){var e=u(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=this.kernelShape[1],a=this.kernelShape[2],s=this.outputShape[0],c=this.outputShape[1],l=s*c,f=i*a*o;if(this._imColsMat||(this._imColsMat=new d.default([],[l,f])),1===i&&1===a&&1===this.subsample[0]&&1===this.subsample[1])return this._imColsMat.replaceTensorData(t.tensor.data),this._useWeblas&&this._imColsMat.createWeblasTensor(),this._imColsMat;for(var p=new d.default([],[i,a,o]),h=0,v=0,y=r-i;v<=y;v+=this.subsample[0])for(var g=0,b=n-a;g<=b;g+=this.subsample[1])_.default.assign(p.tensor,t.tensor.hi(v+i,g+a,o).lo(v,g,0)),this._imColsMat.tensor.data.set(p.tensor.data,h),h+=f;return this._useWeblas&&this._imColsMat.createWeblasTensor(),this._imColsMat}},{key:"_w2row",value:function(){var t=this.weights.W.tensor.shape[2],e=u(this.kernelShape,3),r=e[0],n=e[1],o=e[2],i=n*o*t;this._wRowsMat=new d.default([],[i,r]);for(var a=new d.default([],[n,o,t]),s=new d.default([],[i]),c=0;cl;)if(s=u[l++],s!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===r)return t||l||0;return!t&&-1}}},function(t,e,r){"use strict";var n=r(5),o=r(0),i=r(16),a=r(43),s=r(35),u=r(51),c=r(38),l=r(7),f=r(6),p=r(72),h=r(53),d=r(94);t.exports=function(t,e,r,v,y,g){var _=n[t],b=_,m=y?"set":"add",w=b&&b.prototype,x={},O=function(t){var e=w[t];i(w,t,"delete"==t?function(t){return!(g&&!l(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(g&&!l(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return g&&!l(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,r){return e.call(this,0===t?0:t,r),this})};if("function"==typeof b&&(g||w.forEach&&!f(function(){(new b).entries().next()}))){var j=new b,E=j[m](g?{}:-0,1)!=j,S=f(function(){j.has(1)}),k=p(function(t){new b(t)}),P=!g&&f(function(){for(var t=new b,e=5;e--;)t[m](e,e);return!t.has(-0)});k||(b=e(function(e,r){c(e,b,t);var n=d(new _,e,b);return void 0!=r&&u(r,y,n[m],n),n}),b.prototype=w,w.constructor=b),(S||P)&&(O("delete"),O("has"),y&&O("get")),(P||E)&&O(m),g&&w.clear&&delete w.clear}else b=v.getConstructor(e,t,y,m),a(b.prototype,r),s.NEED=!0;return h(b,t),x[t]=b,o(o.G+o.W+o.F*(b!=_),x),g||v.setStrong(b,t,y),b}},function(t,e,r){"use strict";var n=r(15),o=r(16),i=r(6),a=r(23),s=r(8);t.exports=function(t,e,r){var u=s(t),c=r(a,u,""[t]),l=c[0],f=c[1];i(function(){var e={};return e[u]=function(){return 7},7!=""[t](e)})&&(o(String.prototype,t,l),n(RegExp.prototype,u,2==e?function(t,e){return f.call(t,this,e)}:function(t){return f.call(t,this)}))}},function(t,e,r){"use strict";var n=r(2);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e){t.exports=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)}},function(t,e,r){var n=r(7),o=r(22),i=r(8)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},function(t,e,r){var n=r(8)("iterator"),o=!1;try{var i=[7][n]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var r=!1;try{var i=[7],a=i[n]();a.next=function(){return{done:r=!0}},i[n]=function(){return a},t(i)}catch(t){}return r}},function(t,e,r){t.exports=r(39)||!r(6)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete r(5)[t]})},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){var n=r(5),o="__core-js_shared__",i=n[o]||(n[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,r){for(var n,o=r(5),i=r(15),a=r(46),s=a("typed_array"),u=a("view"),c=!(!o.ArrayBuffer||!o.DataView),l=c,f=0,p=9,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f1?arguments[1]:void 0,r),u=a>2?arguments[2]:void 0,c=void 0===u?r:o(u,r);c>s;)e[s++]=t;return e}},function(t,e,r){"use strict";var n=r(10),o=r(36);t.exports=function(t,e,r){e in t?n.f(t,e,o(0,r)):t[e]=r}},function(t,e,r){var n=r(7),o=r(5).document,i=n(o)&&n(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,r){var n=r(8)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[n]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,r){t.exports=r(5).document&&document.documentElement},function(t,e,r){var n=r(7),o=r(102).set;t.exports=function(t,e,r){var i,a=e.constructor;return a!==r&&"function"==typeof a&&(i=a.prototype)!==r.prototype&&n(i)&&o&&o(t,i),t}},function(t,e,r){var n=r(52),o=r(8)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||i[o]===t)}},function(t,e,r){var n=r(22);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,r){"use strict";var n=r(40),o=r(36),i=r(53),a={};r(15)(a,r(8)("iterator"),function(){return this}),t.exports=function(t,e,r){t.prototype=n(a,{next:o(1,r)}),i(t,e+" Iterator")}},function(t,e,r){"use strict";var n=r(39),o=r(0),i=r(16),a=r(15),s=r(13),u=r(52),c=r(97),l=r(53),f=r(21),p=r(8)("iterator"),h=!([].keys&&"next"in[].keys()),d="@@iterator",v="keys",y="values",g=function(){return this};t.exports=function(t,e,r,_,b,m,w){c(r,e,_);var x,O,j,E=function(t){if(!h&&t in A)return A[t];switch(t){case v:return function(){return new r(this,t)};case y:return function(){return new r(this,t)}}return function(){return new r(this,t)}},S=e+" Iterator",k=b==y,P=!1,A=t.prototype,M=A[p]||A[d]||b&&A[b],C=M||E(b),T=b?k?E("entries"):C:void 0,R="Array"==e?A.entries||M:M;if(R&&(j=f(R.call(new t)),j!==Object.prototype&&(l(j,S,!0),n||s(j,p)||a(j,p,g))),k&&M&&M.name!==y&&(P=!0,C=function(){return M.call(this)}),n&&!w||!h&&!P&&A[p]||a(A,p,C),u[e]=C,u[S]=g,b)if(x={values:k?C:E(y),keys:m?C:E(v),entries:T},w)for(O in x)O in A||i(A,O,x[O]);else o(o.P+o.F*(h||P),e,x);return x}},function(t,e){var r=Math.expm1;t.exports=!r||r(10)>22025.465794806718||r(10)<22025.465794806718||r(-2e-17)!=-2e-17?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:r},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e,r){var n=r(5),o=r(109).set,i=n.MutationObserver||n.WebKitMutationObserver,a=n.process,s=n.Promise,u="process"==r(22)(a);t.exports=function(){var t,e,r,c=function(){var n,o;for(u&&(n=a.domain)&&n.exit();t;){o=t.fn,t=t.next;try{o()}catch(n){throw t?r():e=void 0,n}}e=void 0,n&&n.enter()};if(u)r=function(){a.nextTick(c)};else if(i){var l=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),r=function(){f.data=l=!l}}else if(s&&s.resolve){var p=s.resolve();r=function(){p.then(c)}}else r=function(){o.call(n,c)};return function(n){var o={fn:n,next:void 0};e&&(e.next=o),t||(t=o,r()),e=o}}},function(t,e,r){var n=r(7),o=r(2),i=function(t,e){if(o(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=r(31)(Function.call,r(20).f(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,r){return i(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:i}},function(t,e,r){var n=r(75)("keys"),o=r(46);t.exports=function(t){return n[t]||(n[t]=o(t))}},function(t,e,r){var n=r(2),o=r(14),i=r(8)("species");t.exports=function(t,e){var r,a=n(t).constructor;return void 0===a||void 0==(r=n(a)[i])?e:o(r)}},function(t,e,r){var n=r(37),o=r(23);t.exports=function(t){return function(e,r){var i,a,s=String(o(e)),u=n(r),c=s.length;return u<0||u>=c?t?"":void 0:(i=s.charCodeAt(u),i<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):i:t?s.slice(u,u+2):(i-55296<<10)+(a-56320)+65536)}}},function(t,e,r){var n=r(71),o=r(23);t.exports=function(t,e,r){if(n(e))throw TypeError("String#"+r+" doesn't accept regex!");return String(o(t))}},function(t,e,r){"use strict";var n=r(37),o=r(23);t.exports=function(t){var e=String(o(this)),r="",i=n(t);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(r+=e);return r}},function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,r){var n,o,i,a=r(31),s=r(70),u=r(93),c=r(90),l=r(5),f=l.process,p=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,v=0,y={},g="onreadystatechange",_=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){_.call(t.data)};p&&h||(p=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return y[++v]=function(){s("function"==typeof t?t:Function(t),e)},n(v),v},h=function(t){delete y[t]},"process"==r(22)(f)?n=function(t){f.nextTick(a(_,t,1))}:d?(o=new d,i=o.port2,o.port1.onmessage=b,n=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(n=function(t){l.postMessage(t+"","*")},l.addEventListener("message",b,!1)):n=g in c("script")?function(t){u.appendChild(c("script"))[g]=function(){u.removeChild(this),_.call(t)}}:function(t){setTimeout(a(_,t,1),0)}),t.exports={set:p,clear:h}},function(t,e,r){"use strict";var n=r(5),o=r(9),i=r(39),a=r(76),s=r(15),u=r(43),c=r(6),l=r(38),f=r(37),p=r(11),h=r(41).f,d=r(10).f,v=r(88),y=r(53),g="ArrayBuffer",_="DataView",b="prototype",m="Wrong length!",w="Wrong index!",x=n[g],O=n[_],j=n.Math,E=n.RangeError,S=n.Infinity,k=x,P=j.abs,A=j.pow,M=j.floor,C=j.log,T=j.LN2,R="buffer",F="byteLength",I="byteOffset",D=o?"_b":R,L=o?"_l":F,N=o?"_o":I,U=function(t,e,r){var n,o,i,a=Array(r),s=8*r-e-1,u=(1<>1,l=23===e?A(2,-24)-A(2,-77):0,f=0,p=t<0||0===t&&1/t<0?1:0;for(t=P(t),t!=t||t===S?(o=t!=t?1:0,n=u):(n=M(C(t)/T),t*(i=A(2,-n))<1&&(n--,i*=2),t+=n+c>=1?l/i:l*A(2,1-c),t*i>=2&&(n++,i/=2),n+c>=u?(o=0,n=u):n+c>=1?(o=(t*i-1)*A(2,e),n+=c):(o=t*A(2,c-1)*A(2,e),n=0));e>=8;a[f++]=255&o,o/=256,e-=8);for(n=n<0;a[f++]=255&n,n/=256,s-=8);return a[--f]|=128*p,a},B=function(t,e,r){var n,o=8*r-e-1,i=(1<>1,s=o-7,u=r-1,c=t[u--],l=127&c;for(c>>=7;s>0;l=256*l+t[u],u--,s-=8);for(n=l&(1<<-s)-1,l>>=-s,s+=e;s>0;n=256*n+t[u],u--,s-=8);if(0===l)l=1-a;else{if(l===i)return n?NaN:c?-S:S;n+=A(2,e),l-=a}return(c?-1:1)*n*A(2,l-e)},V=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},W=function(t){return[255&t]},z=function(t){return[255&t,t>>8&255]},q=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},G=function(t){return U(t,52,8)},H=function(t){return U(t,23,4)},Y=function(t,e,r){d(t[b],e,{get:function(){return this[r]}})},$=function(t,e,r,n){var o=+r,i=f(o);if(o!=i||i<0||i+e>t[L])throw E(w);var a=t[D]._b,s=i+t[N],u=a.slice(s,s+e);return n?u:u.reverse()},K=function(t,e,r,n,o,i){var a=+r,s=f(a);if(a!=s||s<0||s+e>t[L])throw E(w);for(var u=t[D]._b,c=s+t[N],l=n(+o),p=0;ptt;)(Z=J[tt++])in x||s(x,Z,k[Z]);i||(Q.constructor=x)}var et=new O(new x(2)),rt=O[b].setInt8;et.setInt8(0,2147483648),et.setInt8(1,2147483649),!et.getInt8(0)&&et.getInt8(1)||u(O[b],{setInt8:function(t,e){rt.call(this,t,e<<24>>24)},setUint8:function(t,e){rt.call(this,t,e<<24>>24)}},!0)}else x=function(t){var e=X(this,t);this._b=v.call(Array(e),0),this[L]=e},O=function(t,e,r){l(this,O,_),l(t,x,_);var n=t[L],o=f(e);if(o<0||o>n)throw E("Wrong offset!");if(r=void 0===r?n-o:p(r),o+r>n)throw E(m);this[D]=t,this[N]=o,this[L]=r},o&&(Y(x,F,"_l"),Y(O,R,"_b"),Y(O,F,"_l"),Y(O,I,"_o")),u(O[b],{getInt8:function(t){return $(this,1,t)[0]<<24>>24},getUint8:function(t){return $(this,1,t)[0]},getInt16:function(t){var e=$(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=$(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return V($(this,4,t,arguments[1]))},getUint32:function(t){return V($(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return B($(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return B($(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){K(this,1,t,W,e)},setUint8:function(t,e){K(this,1,t,W,e)},setInt16:function(t,e){K(this,2,t,z,e,arguments[2])},setUint16:function(t,e){K(this,2,t,z,e,arguments[2])},setInt32:function(t,e){K(this,4,t,q,e,arguments[2])},setUint32:function(t,e){K(this,4,t,q,e,arguments[2])},setFloat32:function(t,e){K(this,4,t,H,e,arguments[2])},setFloat64:function(t,e){K(this,8,t,G,e,arguments[2])}});y(x,g),y(O,_),s(O[b],a.VIEW,!0),e[g]=x,e[_]=O},function(t,e,r){var n=r(5),o=r(30),i=r(39),a=r(157),s=r(10).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:n.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e,r){var n=r(57),o=r(8)("iterator"),i=r(52);t.exports=r(30).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[n(t)]}},function(t,e,r){"use strict";var n=r(50),o=r(145),i=r(52),a=r(18);t.exports=r(98)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,r):"values"==e?o(0,t[r]):o(0,[r,t[r]])},"values"),i.Arguments=i.Array,n("keys"),n("values"),n("entries")},function(t,e,r){var n=r(47),o=r(29),i=n(o,"Map");t.exports=i},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=n}var n=9007199254740991;t.exports=r},function(t,e,r){"use strict";function n(t,e){var r,n=[],i=[];if(void 0!==e&&!Array.isArray(e))throw new Error("axes must be an Array list of dimensions to squeeze");for(r=0;r1)for(var r=1;r=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},e.setImmediate="function"==typeof t?t:function(t){var r=c++,n=!(arguments.length<2)&&s.call(arguments,1);return u[r]=!0,i(function(){u[r]&&(n?t.apply(null,n):t.call(null),e.clearImmediate(r))}),r},e.clearImmediate="function"==typeof n?n:function(t){delete u[t]}}).call(e,r(127).setImmediate,r(127).clearImmediate)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.InputLayer=void 0;var o=r(200);Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})});var i=r(225);Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}})});var a=r(212);Object.keys(a).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}})});var s=r(240);Object.keys(s).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}})});var u=r(229);Object.keys(u).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return u[t]}})});var c=r(227);Object.keys(c).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return c[t]}})});var l=r(132);Object.keys(l).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return l[t]}})});var f=r(246);Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return f[t]}})});var p=r(193),h=n(p);e.InputLayer=h.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="_Pooling1D";var n=t.poolLength,a=void 0===n?2:n,s=t.stride,u=void 0===s?null:s,c=t.borderMode,l=void 0===c?"valid":c;return r.poolLength=a,r.stride=null===u?a:u,r.borderMode=l,r.poolingFunc="max",r}return a(e,t),s(e,[{key:"call",value:function(t){if("max"!==this.poolingFunc&&"average"!==this.poolingFunc)throw new Error("[pooling._Pooling1D] pooling function must be max or average.");for(var e="valid"===this.borderMode?Math.floor((t.tensor.shape[0]-this.poolLength+this.stride)/this.stride):Math.floor((t.tensor.shape[0]+this.stride-1)/this.stride),r=new f.default([],[e,t.tensor.shape[1]]),n=new f.default([],[t.tensor.shape[1]]),o="valid"===this.borderMode?0:Math.min(0,Math.ceil((t.tensor.shape[0]-(e-1)*this.stride-this.poolLength)/2)),i=0;it.tensor.shape[0]-1);c++)"max"===this.poolingFunc?h.default.maxeq(n.tensor,t.tensor.pick(a+c,null)):"average"===this.poolingFunc&&h.default.addeq(n.tensor,t.tensor.pick(a+c,null)),u+=1;"average"===this.poolingFunc&&h.default.divseq(n.tensor,u),h.default.assign(r.tensor.pick(i,null),n.tensor),o+=this.stride}return t.tensor=r.tensor,t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="_Pooling2D";var n=t.poolSize,a=void 0===n?[2,2]:n,s=t.strides,u=void 0===s?null:s,c=t.borderMode,l=void 0===c?"valid":c,f=t.dimOrdering,p=void 0===f?"tf":f;return r.poolSize=a,r.strides=null===u?a:u,r.borderMode=l,r.dimOrdering=p,r.poolingFunc="max",r}return a(e,t),u(e,[{key:"_calcOutputShape",value:function(t){var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=s(this.poolSize,2),a=i[0],u=i[1],c="same"===this.borderMode?Math.floor((r+this.strides[0]-1)/this.strides[0]):Math.floor((r-a+this.strides[0])/this.strides[0]),l="same"===this.borderMode?Math.floor((n+this.strides[1]-1)/this.strides[1]):Math.floor((n-u+this.strides[1])/this.strides[1]),f="same"===this.borderMode?Math.max(0,Math.floor((c-1)*this.strides[0]+a-r)):0,p="same"===this.borderMode?Math.max(0,Math.floor((l-1)*this.strides[1]+u-n)):0,h=Math.floor(f/2),d=f-h,v=Math.floor(p/2),y=p-v;this.outputShape=[c,l,o],this.inputPadding=[h,d,v,y]}},{key:"_padInput",value:function(t){if("same"===this.borderMode){var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=s(this.inputPadding,4),a=i[0],u=i[1],c=i[2],l=i[3],f=r+a+u,h=n+c+l,v=new p.default([],[f,h,o]);"max"===this.poolingFunc&&d.default.assigns(v.tensor,Number.NEGATIVE_INFINITY),d.default.assign(v.tensor.hi(r+a,n+c,o).lo(a,c,0),t.tensor),t.tensor=v.tensor}return t}},{key:"call",value:function(t){if("max"!==this.poolingFunc&&"average"!==this.poolingFunc)throw new Error("[pooling._Pooling2D] pooling function must be max or average.");"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0)),this._calcOutputShape(t),this._padInput(t);for(var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=s(this.poolSize,2),a=i[0],u=i[1],c=new p.default([],this.outputShape),l=new p.default([],[a,u,o]),f=s(this.inputPadding,4),h=f[0],v=f[1],y=f[2],g=f[3],_=0,b=0;_<=r-a;_+=this.strides[0],b++){var m=0;_r-v&&(m=_+a-(r-v));for(var w=0,x=0;w<=n-u;w+=this.strides[1],x++){var O=0;wn-g&&(O=w+u-(n-g)),d.default.assign(l.tensor,t.tensor.hi(_+a,w+u,o).lo(_,w,0));for(var j=0;j0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="_Pooling3D";var n=t.poolSize,a=void 0===n?[2,2,2]:n,s=t.strides,u=void 0===s?null:s,c=t.borderMode,l=void 0===c?"valid":c,f=t.dimOrdering,p=void 0===f?"tf":f;return r.poolSize=a,r.strides=null===u?a:u,r.borderMode=l,r.dimOrdering=p,r.poolingFunc="max",r}return a(e,t),u(e,[{key:"_calcOutputShape",value:function(t){var e=s(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=s(this.poolSize,3),u=a[0],c=a[1],l=a[2],f="same"===this.borderMode?Math.floor((r+this.strides[0]-1)/this.strides[0]):Math.floor((r-u+this.strides[0])/this.strides[0]),p="same"===this.borderMode?Math.floor((n+this.strides[1]-1)/this.strides[1]):Math.floor((n-c+this.strides[1])/this.strides[1]),h="same"===this.borderMode?Math.floor((o+this.strides[2]-1)/this.strides[2]):Math.floor((o-l+this.strides[2])/this.strides[2]),d="same"===this.borderMode?Math.max(0,Math.floor((f-1)*this.strides[0]+u-r)):0,v="same"===this.borderMode?Math.max(0,Math.floor((p-1)*this.strides[1]+c-n)):0,y="same"===this.borderMode?Math.max(0,Math.floor((h-1)*this.strides[2]+l-o)):0,g=Math.floor(d/2),_=d-g,b=Math.floor(v/2),m=v-b,w=Math.floor(y/2),x=y-w;this.outputShape=[f,p,h,i],this.inputPadding=[g,_,b,m,w,x]}},{key:"_padInput",value:function(t){if("same"===this.borderMode){var e=s(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=s(this.inputPadding,6),u=a[0],c=a[1],l=a[2],f=a[3],h=a[4],v=a[5],y=r+u+c,g=n+l+f,_=o+h+v,b=new p.default([],[y,g,_,i]);"max"===this.poolingFunc&&d.default.assigns(b.tensor,Number.NEGATIVE_INFINITY),d.default.assign(b.tensor.hi(r+u,n+l,o+h,i).lo(u,l,h,0),t.tensor),t.tensor=b.tensor}return t}},{key:"call",value:function(t){if("max"!==this.poolingFunc&&"average"!==this.poolingFunc)throw new Error("[pooling._Pooling3D] pooling function must be max or average.");"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,3,0)),this._calcOutputShape(t),this._padInput(t);for(var e=s(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=s(this.poolSize,3),u=a[0],c=a[1],l=a[2],f=new p.default([],this.outputShape),h=new p.default([],[u,c,l,i]),v=s(this.inputPadding,6),y=v[0],g=v[1],_=v[2],b=v[3],m=v[4],w=v[5],x=0,O=0;x<=r-u;x+=this.strides[0],O++){var j=0;xr-g&&(j=x+u-(r-g));for(var E=0,S=0;E<=n-c;E+=this.strides[1],S++){var k=0;E<_?k=_-E:E+c>n-b&&(k=E+c-(n-b));for(var P=0,A=0;P<=o-l;P+=this.strides[2],A++){var M=0;Po-w&&(M=P+l-(o-w)),d.default.assign(h.tensor,t.tensor.hi(x+u,E+c,P+l,i).lo(x,E,P,0));for(var C=0;C=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function y(e){return+e!=e&&(e=0),t.alloc(+e)}function g(e,r){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(o)return G(e).length;r=(""+r).toLowerCase(),o=!0}}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,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(e,r,n,o,i){if(0===e.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof r&&(r=t.from(r,o)),t.isBuffer(r))return 0===r.length?-1:w(e,r,n,o,i);if("number"==typeof r)return r=255&r,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):w(e,[r],n,o,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,o){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}var c;if(o){var l=-1;for(c=r;cs&&(r=s-u),c=r;c>=0;c--){for(var f=!0,p=0;po&&(n=o)):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a239?4:i>223?3:i>191?2:1;if(o+s<=r){var u,c,l,f;switch(s){case 1:i<128&&(a=i);break;case 2:u=t[o+1],128===(192&u)&&(f=(31&i)<<6|63&u,f>127&&(a=f));break;case 3:u=t[o+1],c=t[o+2],128===(192&u)&&128===(192&c)&&(f=(15&i)<<12|(63&u)<<6|63&c,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:u=t[o+1],c=t[o+2],l=t[o+3],128===(192&u)&&128===(192&c)&&128===(192&l)&&(f=(15&i)<<18|(63&u)<<12|(63&c)<<6|63&l,f>65535&&f<1114112&&(a=f))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=s}return M(n)}function M(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function D(e,r,n,o,i,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||re.length)throw new RangeError("Index out of range")}function L(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,o){return o||U(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function V(t,e,r,n,o){return o||U(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function W(t){if(t=z(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){for(var e=[],r=0;r>8,o=r%256,i.push(o),i.push(n);return i}function $(t){return Z.toByteArray(W(t))}function K(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function X(t){return t!==t}var Z=r(248),Q=r(436),J=r(439);e.Buffer=t,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:o(),e.kMaxLength=i(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,r){return s(null,t,e,r)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,r){return c(null,t,e,r)},t.allocUnsafe=function(t){return l(null,t)},t.allocUnsafeSlow=function(t){return l(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,o=r.length,i=0,a=Math.min(n,o);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e,r,n,o,i){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,s=n-r,u=Math.min(a,s),c=this.slice(o,i),l=e.slice(r,n),f=0;fo)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return O(this,t,e,r);case"ascii":return j(this,t,e,r);case"latin1":case"binary":return E(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r0&&(o*=256);)n+=this[t+--e]*o;return n},t.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i=o&&(n-=Math.pow(2,8*e)),n},t.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||I(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},t.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),Q.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),Q.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var o=Math.pow(2,8*r)-1;D(this,t,e,r,o,0)}var i=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+i]=t/a&255;return e+r},t.prototype.writeUInt8=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):L(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):L(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):N(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):N(this,e,r,!1),r+4},t.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},t.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1), +this[e+i]=(t/a>>0)-s&255;return e+r},t.prototype.writeInt8=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):L(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):L(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):N(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r=0|r,n||D(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):N(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return V(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return V(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,o){if(n||(n=0),o||0===o||(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r=0;--i)e[i+r]=this[i+n];else if(a<1e3||!t.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=r;a2?arguments[2]:void 0,l=Math.min((void 0===c?a:o(c,a))-u,a-s),f=1;for(u0;)u in r?r[s]=r[u]:delete r[s],s+=f,u+=f;return r}},function(t,e,r){var n=r(51);t.exports=function(t,e){var r=[];return n(t,!1,r.push,r,e),r}},function(t,e,r){var n=r(14),o=r(12),i=r(58),a=r(11);t.exports=function(t,e,r,s,u){n(e);var c=o(t),l=i(c),f=a(c.length),p=u?f-1:0,h=u?-1:1;if(r<2)for(;;){if(p in l){s=l[p],p+=h;break}if(p+=h,u?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;u?p>=0:f>p;p+=h)p in l&&(s=e(s,l[p],p,c));return s}},function(t,e,r){"use strict";var n=r(14),o=r(7),i=r(70),a=[].slice,s={},u=function(t,e,r){if(!(e in s)){for(var n=[],o=0;o1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(r(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!y(this,t)}}),h&&n(f.prototype,"size",{get:function(){return u(this[v])}}),f},def:function(t,e,r){var n,o,i=y(t,e);return i?i.v=r:(t._l=i={i:o=d(e,!0),k:e,v:r,p:n=t._l,n:void 0,r:!1},t._f||(t._f=i),n&&(n.n=i),t[v]++,"F"!==o&&(t._i[o]=i)),t},getEntry:y,setStrong:function(t,e,r){l(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==e?f(0,r.k):"values"==e?f(0,r.v):f(0,[r.k,r.v]):(t._t=void 0,f(1))},r?"entries":"values",!r,!0),p(e)}}},function(t,e,r){var n=r(57),o=r(136);t.exports=function(t){return function(){if(n(this)!=t)throw TypeError(t+"#toJSON isn't generic");return o(this)}}},function(t,e,r){"use strict";var n=r(43),o=r(35).getWeak,i=r(2),a=r(7),s=r(38),u=r(51),c=r(26),l=r(13),f=c(5),p=c(6),h=0,d=function(t){return t._l||(t._l=new v)},v=function(){this.a=[]},y=function(t,e){return f(t.a,function(t){return t[0]===e})};v.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var r=y(this,t);r?r[1]=e:this.a.push([t,e])},delete:function(t){var e=p(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,r,i){var c=t(function(t,n){s(t,c,e,"_i"),t._i=h++,t._l=void 0,void 0!=n&&u(n,r,t[i],t)});return n(c.prototype,{delete:function(t){if(!a(t))return!1;var e=o(t);return e===!0?d(this).delete(t):e&&l(e,this._i)&&delete e[this._i]},has:function(t){if(!a(t))return!1;var e=o(t);return e===!0?d(this).has(t):e&&l(e,this._i)}}),c},def:function(t,e,r){var n=o(i(e),!0);return n===!0?d(t).set(e,r):n[t._i]=r,t},ufstore:d}},function(t,e,r){t.exports=!r(9)&&!r(6)(function(){return 7!=Object.defineProperty(r(90)("div"),"a",{get:function(){return 7}}).a})},function(t,e,r){var n=r(7),o=Math.floor;t.exports=function(t){return!n(t)&&isFinite(t)&&o(t)===t}},function(t,e,r){var n=r(2);t.exports=function(t,e,r,o){try{return o?e(n(r)[0],r[1]):e(r)}catch(e){var i=t.return;throw void 0!==i&&n(i.call(t)),e}}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,r){"use strict";var n=r(42),o=r(74),i=r(59),a=r(12),s=r(58),u=Object.assign;t.exports=!u||r(6)(function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(t){e[t]=t}),7!=u({},t)[r]||Object.keys(u({},e)).join("")!=n})?function(t,e){for(var r=a(t),u=arguments.length,c=1,l=o.f,f=i.f;u>c;)for(var p,h=s(arguments[c++]),d=l?n(h).concat(l(h)):n(h),v=d.length,y=0;v>y;)f.call(h,p=d[y++])&&(r[p]=h[p]);return r}:u},function(t,e,r){var n=r(10),o=r(2),i=r(42);t.exports=r(9)?Object.defineProperties:function(t,e){o(t);for(var r,a=i(e),s=a.length,u=0;s>u;)n.f(t,r=a[u++],e[r]);return t}},function(t,e,r){var n=r(18),o=r(41).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return o(t)}catch(t){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?s(t):o(n(t))}},function(t,e,r){var n=r(13),o=r(18),i=r(66)(!1),a=r(103)("IE_PROTO");t.exports=function(t,e){var r,s=o(t),u=0,c=[];for(r in s)r!=a&&n(s,r)&&c.push(r);for(;e.length>u;)n(s,r=e[u++])&&(~i(c,r)||c.push(r));return c}},function(t,e,r){var n=r(42),o=r(18),i=r(59).f;t.exports=function(t){return function(e){for(var r,a=o(e),s=n(a),u=s.length,c=0,l=[];u>c;)i.call(a,r=s[c++])&&l.push(t?[r,a[r]]:a[r]);return l}}},function(t,e,r){var n=r(41),o=r(74),i=r(2),a=r(5).Reflect;t.exports=a&&a.ownKeys||function(t){var e=n.f(i(t)),r=o.f;return r?e.concat(r(t)):e}},function(t,e,r){var n=r(5).parseFloat,o=r(54).trim;t.exports=1/n(r(108)+"-0")!==-(1/0)?function(t){var e=o(String(t),3),r=n(e);return 0===r&&"-"==e.charAt(0)?-0:r}:n},function(t,e,r){var n=r(5).parseInt,o=r(54).trim,i=r(108),a=/^[\-+]?0[xX]/;t.exports=8!==n(i+"08")||22!==n(i+"0x16")?function(t,e){var r=o(String(t),3);return n(r,e>>>0||(a.test(r)?16:10))}:n},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},function(t,e,r){var n=r(11),o=r(107),i=r(23);t.exports=function(t,e,r,a){var s=String(i(t)),u=s.length,c=void 0===r?" ":String(r),l=n(e);if(l<=u||""==c)return s;var f=l-u,p=o.call(c,Math.ceil(f/c.length));return p.length>f&&(p=p.slice(0,f)),a?p+s:s+p}},function(t,e,r){e.f=r(8)},function(t,e,r){"use strict";var n=r(139);t.exports=r(67)("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=n.getEntry(this,t);return e&&e.v},set:function(t,e){return n.def(this,0===t?0:t,e)}},n,!0)},function(t,e,r){r(9)&&"g"!=/./g.flags&&r(10).f(RegExp.prototype,"flags",{configurable:!0,get:r(69)})},function(t,e,r){"use strict";var n=r(139);t.exports=r(67)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return n.def(this,t=0===t?0:t,t)}},n)},function(t,e,r){"use strict";var n,o=r(26)(0),i=r(16),a=r(35),s=r(147),u=r(141),c=r(7),l=a.getWeak,f=Object.isExtensible,p=u.ufstore,h={},d=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(t){if(c(t)){var e=l(t);return e===!0?p(this).get(t):e?e[this._i]:void 0}},set:function(t,e){return u.def(this,t,e)}},y=t.exports=r(67)("WeakMap",d,v,u,!0,!0);7!=(new y).set((Object.freeze||Object)(h),7).get(h)&&(n=u.getConstructor(d),s(n.prototype,v),a.NEED=!0,o(["delete","has","get","set"],function(t){var e=y.prototype,r=e[t];i(e,t,function(e,o){if(c(e)&&!f(e)){this._f||(this._f=new n);var i=this._f[t](e,o);return"set"==t?this:i}return r.call(this,e,o)})}))},function(t,e,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function o(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var o=0;o0)throw new Error("cwise: pre() block may not reference array args");if(o0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(o),e.shimArgs.push("scalar"+o);else if("index"===a){if(e.indexArgs.push(o),o0)throw new Error("cwise: pre() block may not reference array index");if(o0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(o),or.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,i(e)}var i=r(433);t.exports=o},function(t,e){"use strict";function r(t,e,n){var o=0|t[n];if(o<=0)return[];var i,a=new Array(o);if(n===t.length-1)for(i=0;i0)return n(0|t,e);break;case"object":if("number"==typeof t.length)return r(t,e,0)}return[]}t.exports=o},function(t,e,r){function n(t){var e=this.__data__=new o(t);this.size=e.size}var o=r(77),i=r(531),a=r(532),s=r(533),u=r(534),c=r(535);n.prototype.clear=i,n.prototype.delete=a,n.prototype.get=s,n.prototype.has=u,n.prototype.set=c,t.exports=n},function(t,e,r){function n(t,e,r){"__proto__"==e&&o?o(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var o=r(170);t.exports=n},function(t,e,r){function n(t,e,r,a,s){var u=-1,c=t.length;for(r||(r=i),s||(s=[]);++u0&&r(l)?e>1?n(l,e-1,r,a,s):o(s,l):a||(s[s.length]=l)}return s}var o=r(450),i=r(506);t.exports=n},function(t,e,r){function n(t,e){return t&&o(t,e,i)}var o=r(458),i=r(48);t.exports=n},function(t,e,r){function n(t,e){e=i(e,t)?[e]:o(e);for(var r=0,n=e.length;null!=t&&rp))return!1;var d=l.get(t);if(d&&l.get(e))return d==e;var v=-1,y=!0,g=c&s?new o:void 0;for(l.set(t,e),l.set(e,t);++v=0;--o)n[o]=r,r*=t[o];return c(f.malloc(r,e),t,n,0)}function i(t){"generic"!==t.dtype&&"array"!==t.dtype&&f.free(t.data)}function a(t,e){e||(e="double");for(var r=1,n=new Array(t.length),o=t.length-1;o>=0;--o)n[o]=r,r*=t[o];for(var i=f.malloc(r,e),o=0;o=0;--o)n[o]=r,r*=t[o];for(var i=f.malloc(r,e),o=0;o=0;--r)i[r]=o,o*=t[r];var a=f.malloc(o,e);for(r=0;r=0;r--)u+=i[r],s=Math.min(s,t[r]);for(r=0,n=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var r=e.filepaths,n=void 0===r?{}:r,o=e.headers,a=void 0===o?{}:o,s=e.gpu,u=void 0!==s&&s,c=e.layerCallPauses,l=void 0!==c&&c;if(!n.model||!n.weights||!n.metadata)throw new Error("File paths must be declared for model, weights, and metadata.");this.filepaths=n,this.filetypes={model:"json",weights:"arraybuffer",metadata:"json"},this.headers=a,this.gpu=u,this.layerCallPauses=l,this.data={model:{},weights:null,metadata:[]},this.xhrs={model:null,weights:null,metadata:null},this.xhrProgress={model:0,weights:0,metadata:0},this.modelLayersMap=new Map,this.layersWithResults=[],this.modelDAG={},this.inputTensors={},this._ready=this.initialize(),this.isRunning=!1}return l(t,[{key:"ready",value:function(){return this._ready}},{key:"interrupt",value:function(){var t=this,e=["model","weights","metdata"];e.forEach(function(e){t.xhrs[e]&&(t.xhrs[e].abort(),t.xhrs[e]=null)})}},{key:"initialize",value:function(){var t=this,e=["model","weights","metadata"];return s.default.all(e.map(function(e){return t.dataRequest(e,t.headers)})).then(function(){return t.createLayers(),s.default.resolve()}).catch(function(e){console.log(e),t.interrupt()})}},{key:"dataRequest",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new s.default(function(n,o){var i=new XMLHttpRequest;i.open("GET",e.filepaths[t],!0),i.responseType=e.filetypes[t];var a=!0,s=!1,u=void 0;try{for(var l,f=(0,p.default)(r)[Symbol.iterator]();!(a=(l=f.next()).done);a=!0){var h=c(l.value,2),d=h[0],v=h[1];i.setRequestHeader(d,v)}}catch(t){s=!0,u=t}finally{try{!a&&f.return&&f.return()}finally{if(s)throw u}}i.onload=function(r){e.data[t]=i.response,e.xhrs[t]=null,e.xhrProgress[t]=100,n()},i.onprogress=function(r){if(r.lengthComputable){var n=Math.round(100*r.loaded/r.total);e.xhrProgress[t]=n}},i.onerror=function(t){return o(t)},i.send(null),e.xhrs[t]=i})}},{key:"getLoadingProgress",value:function(){var t=(0,x.default)(this.xhrProgress);return Math.round((0,j.default)(t)/t.length)}},{key:"createLayers",value:function(){var t=this,e=this.data.model.class_name,r=[];"Sequential"===e?r=this.data.model.config:"Model"===e&&(r=this.data.model.config.layers),r.forEach(function(n,o){var i=n.class_name,a=n.config;if(!(i in M))throw new Error("Layer "+i+" specified in model configuration is not implemented!");if("Sequential"===e&&0===o){var s="input",u=a.batch_input_shape.slice(1),c=new M.InputLayer({name:s,shape:u});t.modelLayersMap.set(s,c),t.modelDAG[s]={layerClass:"InputLayer",name:s,inbound:[],outbound:[]},t.inputTensors[s]=new T.default([],u)}else if("Model"===e&&"InputLayer"===i){var l=a.batch_input_shape.slice(1);t.inputTensors[a.name]=new T.default([],l)}var f=void 0;if("Bidirectional"===i||"TimeDistributed"===i){var p=(0,d.default)(a,function(t,e){return(0,y.default)(e)}),h=a.layer.config,v=a.layer.class_name,g=(0,d.default)(h,function(t,e){return(0,y.default)(e)});"activation"in g&&(g.activation=(0,y.default)(g.activation)),"innerActivation"in g&&(g.innerActivation=(0,y.default)(g.innerActivation)),g.gpu=t.gpu,f=new M[i](Object.assign(p,{layer:new M[v](g)}))}else{var b=(0,d.default)(a,function(t,e){return(0,y.default)(e)});"activation"in b&&(b.activation=(0,y.default)(b.activation)),"innerActivation"in b&&(b.innerActivation=(0,y.default)(b.innerActivation)),b.gpu=t.gpu,f=new M[i](b)}var m=[];if("Bidirectional"===i?!function(){var t=a.layer.config.name,e=t.replace(/forward/,"backward"),r=f.forwardLayer.params.map(function(e){return t+"_"+e}),n=f.backwardLayer.params.map(function(t){return e+"_"+t});m=r.concat(n)}():m="TimeDistributed"===i?f.layer.params.map(function(t){return a.layer.config.name+"_"+t}):f.params.map(function(t){return a.name+"_"+t}),m&&m.length){var w=m.map(function(e){var r=(0,_.default)(t.data.metadata,function(t){var r=new RegExp("^"+e);return t.layer_name===a.name&&r.test(t.weight_name)});if(!r)throw new Error("[Model] error loading weights.");var n=r.offset,o=r.length,i=r.shape;return new T.default(new Float32Array(t.data.weights,n,o),i)});f.setWeights(w)}if(t.modelLayersMap.set(a.name,f),t.modelDAG[a.name]={layerClass:i,name:a.name,inbound:[],outbound:[]},"Sequential"===e)if(0===o){var x="input";t.modelDAG[x].outbound.push(a.name),t.modelDAG[a.name].inbound.push(x)}else{var O=r[o-1].config;t.modelDAG[a.name].inbound.push(O.name),t.modelDAG[O.name].outbound.push(a.name)}else"Model"===e&&n.inbound_nodes&&n.inbound_nodes.length&&n.inbound_nodes[0].forEach(function(e){var r=e[0];t.modelDAG[a.name].inbound.push(r),t.modelDAG[r].outbound.push(a.name)})})}},{key:"toggleGpu",value:function(t){"undefined"==typeof t?this.gpu=!this.gpu:this.gpu=t;var e=!0,r=!1,n=void 0;try{for(var o,i=this.modelLayersMap.values()[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var a=o.value;a.toggleGpu(this.gpu)}}catch(t){r=!0,n=t}finally{try{!e&&i.return&&i.return()}finally{if(r)throw n}}}},{key:"traverseDAG",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,a.coroutine)(regeneratorRuntime.mark(function t(e){var r,n,o,i,a,u,c,l,f=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e.length){t.next=4;break}return t.abrupt("return",!0);case 4:if(1!==e.length){t.next=35;break}if(r=e[0],n=this.modelDAG[r],o=n.layerClass,i=n.inbound,a=n.outbound,"InputLayer"===o){t.next=31;break}if(u=this.modelLayersMap.get(r),!u.visited){t.next=14;break}return t.abrupt("return",!1);case 14:if(c=i.map(function(t){return f.modelLayersMap.get(t)}),(0,P.default)(c.map(function(t){return t.hasResult}))){t.next=17;break}return t.abrupt("return",!1);case 17:if("Merge"!==o){t.next=21;break}u.result=u.call(c.map(function(t){return new T.default(t.result.tensor.data,t.result.tensor.shape)})),t.next=25;break;case 21:if(1===c.length){t.next=23;break}throw new Error("Layer name "+u.name+" has "+c.length+" inbound nodes, but is not a Merge layer.");case 23:l=c[0].result,u.result=u.call(new T.default(l.tensor.data,l.tensor.shape));case 25:if(u.hasResult=!0,u.visited=!0,this.layersWithResults.push(u.name),!this.layerCallPauses){t.next=31;break}return t.next=31,s.default.delay(0);case 31:return t.next=33,this.traverseDAG(a);case 33:t.next=37;break;case 35:return t.next=37,s.default.all(e.map(function(t){return f.traverseDAG([t])}));case 37:case"end":return t.stop()}},t,this)}));return t}()},{key:"predict",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,a.coroutine)(regeneratorRuntime.mark(function t(e){var r,n,o,i,a,s,c,l,f,p,h,d,v,y=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isRunning=!0,r=(0,m.default)(this.inputTensors),(0,S.default)((0,m.default)(e),r)){t.next=5;break}throw this.isRunning=!1,new Error("predict() must take an object where the keys are the named inputs of the model: "+r+".");case 5:if((0,P.default)(r,function(t){return e[t]instanceof Float32Array})){t.next=8;break}throw this.isRunning=!1,new Error("predict() must take an object where the values are the flattened data as Float32Array.");case 8:for(this.layersWithResults=[],n=!0,o=!1,i=void 0,t.prev=12,a=this.modelLayersMap.values()[Symbol.iterator]();!(n=(s=a.next()).done);n=!0)c=s.value,c.hasResult=!1,c.visited=!1;t.next=20;break;case 16:t.prev=16,t.t0=t.catch(12),o=!0,i=t.t0;case 20:t.prev=20,t.prev=21,!n&&a.return&&a.return();case 23:if(t.prev=23,!o){t.next=26;break}throw i;case 26:return t.finish(23);case 27:return t.finish(20);case 28:return r.forEach(function(t){var r=y.modelLayersMap.get(t);y.inputTensors[t].replaceTensorData(e[t]),r.result=r.call(y.inputTensors[t]),r.hasResult=!0,r.visited=!0}),t.next=31,this.traverseDAG(r);case 31:if(l=this.data.model.class_name,"Sequential"!==l){t.next=41;break}return f=(0,_.default)((0,x.default)(this.modelDAG),function(t){return!t.outbound.length}),p=this.modelLayersMap.get(f.name),h=p.result,d={output:h.tensor.data},this.isRunning=!1,t.abrupt("return",d);case 41:if("Model"!==l){t.next=45;break}if(v=function(){var t=(0,x.default)(y.modelDAG).filter(function(t){return!t.outbound.length}),e={};return t.forEach(function(t){var r=y.modelLayersMap.get(t.name),n=r.result;e[t.name]=n.tensor.data}),y.isRunning=!1,{v:e}}(),"object"!==("undefined"==typeof v?"undefined":u(v))){t.next=45;break}return t.abrupt("return",v.v);case 45:case"end":return t.stop()}},t,this,[[12,16,20,28],[21,,23,27]])}));return t}()}]),t}();e.default=R},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=document.createElement("canvas"),n=r.getContext("webgl")||r.getContext("experimental-webgl");if(!n)throw new Error("Unable to initialize WebGL. Your browser may not support it.");e.MAX_TEXTURE_SIZE=n.getParameter(n.MAX_TEXTURE_SIZE)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="InputLayer";var n=t.shape,a=void 0===n?[]:n;return r.shape=t.batchInputShape&&t.batchInputShape.length?t.batchInputShape.slice(1):a,r}return a(e,t),s(e,[{key:"call",value:function(t){if(!(0,f.default)(t.tensor.shape,this.shape))throw new Error("[InputLayer] input tensor shape "+t.tensor.shape+" does not match specified shape "+this.shape+".");return t}}]),e}(c.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function"); +}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));h.call(r),r.layerClass="ELU";var n=t.alpha,a=void 0===n?1:n;return r.alpha=a,r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.alpha),t}}]),e}(c.default),h=function(){this._compute=(0,f.default)({args:["array","scalar"],body:function(t,e){t=Math.max(t,0)+e*(Math.exp(Math.min(t,0))-1)}})};e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="LeakyReLU";var n=t.alpha,a=void 0===n?.3:n;return r.alpha=a,r}return a(e,t),s(e,[{key:"call",value:function(t){return(0,l.relu)(t,{alpha:this.alpha}),t}}]),e}(c.default);e.default=f},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r._compute=(0,f.default)({args:["array","array"],body:function(t,e){t=Math.max(t,0)+e*Math.min(t,0)}}),r.layerClass="PReLU",r.params=["alphas"],r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.weights.alphas.tensor),t}}]),e}(c.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r._compute=(0,f.default)({args:["array","array","array"],body:function(t,e,r){t=e*Math.log(1+Math.exp(r*t))}}),r.layerClass="ParametricSoftplus",r.params=["alphas","betas"],r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.weights.alphas.tensor,this.weights.betas.tensor),t}}]),e}(c.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r._compute=(0,f.default)({args:["array","array","array","array","array"],body:function(t,e,r,n,o){t=e+Math.min(Math.max(t-e,0),Math.abs(n))+r*Math.min(t-e,0)+Math.max(t-(e+Math.abs(n)),0)*o}}),r.layerClass="SReLU",r.params=["t_left","a_left","t_right","a_right"],r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.weights.t_left.tensor,this.weights.a_left.tensor,this.weights.t_right.tensor,this.weights.a_right.tensor),t}}]),e}(c.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));h.call(r),r.layerClass="ThresholdedReLU";var n=t.theta,a=void 0===n?1:n;return r.theta=a,r}return a(e,t),s(e,[{key:"call",value:function(t){return this._compute(t.tensor,this.theta),t}}]),e}(c.default),h=function(){this._compute=(0,f.default)({args:["array","scalar"],body:function(t,e){t*=Number(t>e)}})};e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.SReLU=e.ThresholdedReLU=e.ParametricSoftplus=e.ELU=e.PReLU=e.LeakyReLU=void 0;var o=r(195),i=n(o),a=r(196),s=n(a),u=r(194),c=n(u),l=r(197),f=n(l),p=r(199),h=n(p),d=r(198),v=n(d);e.LeakyReLU=i.default,e.PReLU=s.default,e.ELU=c.default,e.ParametricSoftplus=f.default,e.ThresholdedReLU=h.default,e.SReLU=v.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="AtrousConvolution2D";var n=t.atrousRate,a=void 0===n?[1,1]:n;return r.atrousRate=a,r}return a(e,t),u(e,[{key:"_calcOutputShape",value:function(t){var e=t.tensor.shape[0],r=t.tensor.shape[1],n=s(this.kernelShape,3),o=n[0],i=n[1],a=n[2],u=i+(i-1)*(this.atrousRate[0]-1),c=a+(a-1)*(this.atrousRate[1]-1),l="same"===this.borderMode?Math.floor((e+this.subsample[0]-1)/this.subsample[0]):Math.floor((e-u+this.subsample[0])/this.subsample[0]),f="same"===this.borderMode?Math.floor((r+this.subsample[1]-1)/this.subsample[1]):Math.floor((r-c+this.subsample[1])/this.subsample[1]),p=o,h="same"===this.borderMode?Math.max(0,Math.floor((l-1)*this.subsample[0]+u-e)):0,d="same"===this.borderMode?Math.max(0,Math.floor((f-1)*this.subsample[1]+c-r)):0,v=Math.floor(h/2),y=h-v,g=Math.floor(d/2),_=d-g;this.outputShape=[l,f,p],this.inputPadding=[v,y,g,_]}},{key:"_im2col",value:function(t){var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=this.kernelShape[1],a=this.kernelShape[2],u=this.outputShape[0],c=this.outputShape[1],f=u*c,p=i*a*o,h=i+(i-1)*(this.atrousRate[0]-1),v=a+(a-1)*(this.atrousRate[1]-1);this._imColsMat||(this._imColsMat=new l.default([],[f,p]));for(var y=new l.default([],[i,a,o]),g=0,_=0,b=r-h;_<=b;_+=this.subsample[0])for(var m=0,w=n-v;m<=w;m+=this.subsample[1])d.default.assign(y.tensor,t.tensor.hi(_+h,m+v,o).lo(_,m,0).step(this.atrousRate[0],this.atrousRate[1],1)),this._imColsMat.tensor.data.set(y.tensor.data,g),g+=p;return this._useWeblas&&this._imColsMat.createWeblasTensor(),this._imColsMat}}]),e}(p.default);e.default=v},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Convolution1D";var n=t.nbFilter,a=void 0===n?1:n,s=t.filterLength,u=void 0===s?1:s,c=t.activation,l=void 0===c?"linear":c,p=t.borderMode,h=void 0===p?"valid":p,d=t.subsampleLength,v=void 0===d?1:d,y=t.bias,g=void 0===y||y;if("valid"!==h&&"same"!==h)throw new Error(r.name+" [Convolution1D layer] Invalid borderMode.");r.params=r.bias?["W","b"]:["W"];var _={nbFilter:a,nbRow:u,nbCol:1,activation:l,borderMode:h,subsample:[v,1],dimOrdering:"th",bias:g};return r._conv2d=new f.default(Object.assign(_,{gpu:t.gpu})),r}return a(e,t),s(e,[{key:"setWeights",value:function(t){this._conv2d.setWeights(t)}},{key:"call",value:function(t){t.tensor=(0,v.default)(t.tensor).transpose(1,0,2);var e=this._conv2d.call(t);return t.tensor=(0,h.default)(e.tensor).transpose(1,0,2),t}}]),e}(c.default);e.default=y},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Convolution3D";var n=t.nbFilter,o=void 0===n?1:n,s=t.kernelDim1,u=void 0===s?1:s,c=t.kernelDim2,l=void 0===c?1:c,f=t.kernelDim3,h=void 0===f?1:f,d=t.activation,v=void 0===d?"linear":d,y=t.borderMode,g=void 0===y?"valid":y,_=t.subsample,b=void 0===_?[1,1,1]:_,m=t.dimOrdering,w=void 0===m?"tf":m,x=t.bias,O=void 0===x||x;if(r.kernelShape=[o,u,l,h],r.activation=p[v],"valid"!==g&&"same"!==g)throw new Error(r.name+" [Convolution3D layer] Invalid borderMode.");if(r.borderMode=g,r.subsample=b,"tf"!==w&&"th"!==w)throw new Error(r.name+" [Convolution3D layer] Only tf and th dim ordering are allowed.");return r.dimOrdering=w,r.bias=O,r.params=r.bias?["W","b"]:["W"],r}return s(e,t),c(e,[{key:"setWeights",value:function(t){"th"===this.dimOrdering&&(t[0].tensor=t[0].tensor.transpose(2,3,4,1,0)),l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,t),this._wRowsMat=this._w2row(),this._useWeblas&&(this._wRowsMat.createWeblasTensor(),this._wRowsMat.weblasTensor=this._wRowsMat.weblasTensor.transpose(),this.bias?this.weights.b.createWeblasTensor():(this._zerosVec=new d.default([],[this.weights.W.tensor.shape[4]]),this._zerosVec.createWeblasTensor()))}},{key:"_calcOutputShape",value:function(t){var e=t.tensor.shape[0],r=t.tensor.shape[1],n=t.tensor.shape[2],o=u(this.kernelShape,4),i=o[0],a=o[1],s=o[2],c=o[3],l="same"===this.borderMode?Math.floor((e+this.subsample[0]-1)/this.subsample[0]):Math.floor((e-a+this.subsample[0])/this.subsample[0]),f="same"===this.borderMode?Math.floor((r+this.subsample[1]-1)/this.subsample[1]):Math.floor((r-s+this.subsample[1])/this.subsample[1]),p="same"===this.borderMode?Math.floor((n+this.subsample[2]-1)/this.subsample[2]):Math.floor((n-c+this.subsample[2])/this.subsample[2]),h=i,d="same"===this.borderMode?Math.max(0,Math.floor((l-1)*this.subsample[0]+a-e)):0,v="same"===this.borderMode?Math.max(0,Math.floor((f-1)*this.subsample[1]+s-r)):0,y="same"===this.borderMode?Math.max(0,Math.floor((p-1)*this.subsample[2]+c-n)):0,g=Math.floor(d/2),_=d-g,b=Math.floor(v/2),m=v-b,w=Math.floor(y/2),x=y-w;this.outputShape=[l,f,p,h],this.inputPadding=[g,_,b,m,w,x]}},{key:"_padInput",value:function(t){if("same"===this.borderMode){var e=u(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=u(this.inputPadding,6),s=a[0],c=a[1],l=a[2],f=a[3],p=a[4],h=a[5],v=r+s+c,y=n+l+f,g=o+p+h,b=new d.default([],[v,y,g,i]);_.default.assign(b.tensor.hi(r+s,n+l,o+p,i).lo(s,l,p,0),t.tensor),t.tensor=b.tensor}return t}},{key:"_vol2col",value:function(t){var e=u(t.tensor.shape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=this.kernelShape[1],s=this.kernelShape[2],c=this.kernelShape[3],l=this.outputShape[0],f=this.outputShape[1],p=this.outputShape[2],h=l*f*p,v=a*s*c*i;if(this._volColsMat||(this._volColsMat=new d.default([],[h,v])),1===a&&1===s&&1===c&&1===this.subsample[0]&&1===this.subsample[1]&&1===this.subsample[2])return this._volColsMat.replaceTensorData(t.tensor.data),this._useWeblas&&this._volColsMat.createWeblasTensor(),this._volColsMat;for(var y=new d.default([],[a,s,c,i]),g=0,b=0,m=r-a;b<=m;b+=this.subsample[0])for(var w=0,x=n-s;w<=x;w+=this.subsample[1])for(var O=0,j=o-c;O<=j;O+=this.subsample[2])_.default.assign(y.tensor,t.tensor.hi(b+a,w+s,O+c,i).lo(b,w,O,0)),this._volColsMat.tensor.data.set(y.tensor.data,g),g+=v;return this._useWeblas&&this._volColsMat.createWeblasTensor(),this._volColsMat}},{key:"_w2row",value:function(){for(var t=this.weights.W.tensor.shape[3],e=u(this.kernelShape,4),r=e[0],n=e[1],o=e[2],i=e[3],a=n*o*i*t,s=new d.default([],[a,r]),c=new d.default([],[n,o,i,t]),l=new d.default([],[a]),f=0;f0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Deconvolution2D";var n=t.nbFilter,o=void 0===n?1:n,s=t.nbRow,u=void 0===s?1:s,c=t.nbCol,l=void 0===c?1:c,f=t.outputShape,h=void 0===f?[]:f,d=t.activation,v=void 0===d?"linear":d,y=t.borderMode,g=void 0===y?"valid":y,_=t.subsample,b=void 0===_?[1,1]:_,m=t.dimOrdering,w=void 0===m?"tf":m,x=t.bias,O=void 0===x||x;if(r.kernelShape=[o,u,l],null==h[0]?r.outputShape=h.slice(1):r.outputShape=h,r.activation=p[v],"valid"!==g&&"same"!==g)throw new Error(r.name+" [Deconvolution2D layer] Invalid borderMode.");if(r.borderMode=g,r.subsample=b,"tf"!==w&&"th"!==w)throw new Error(r.name+" [Deconvolution2D layer] Only tf and th dim ordering are allowed.");return r.dimOrdering=w,r.bias=O,r.params=r.bias?["W","b"]:["W"],r}return s(e,t),c(e,[{key:"setWeights",value:function(t){"th"===this.dimOrdering&&(t[0].tensor=t[0].tensor.transpose(2,3,1,0)),l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,t),this._wRowsMat=this._w2row(),this._useWeblas&&(this._wRowsMat.createWeblasTensor(),this._wRowsMat.weblasTensor=this._wRowsMat.weblasTensor.transpose())}},{key:"_calcOutputPadding",value:function(t){var e=t.tensor.shape[0],r=t.tensor.shape[1],n=this.kernelShape[1],o=this.kernelShape[2],i=this.outputShape[0],a=this.outputShape[1],s="same"===this.borderMode?Math.max(0,Math.floor((e-1)*this.subsample[0]+n-i)):0,u="same"===this.borderMode?Math.max(0,Math.floor((r-1)*this.subsample[1]+o-a)):0,c=Math.floor(s/2),l=s-c,f=Math.floor(u/2),p=u-f;this.outputPadding=[c,l,f,p]}},{key:"_im2col",value:function(t){for(var e=u(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=new d.default([],[r*n,o]),a=new d.default([],[r*n]),s=new d.default([],[r,n]),c=0;c0&&void 0!==arguments[0]?arguments[0]:{};return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t))}return s(e,t),c(e,[{key:"_im2col",value:function(t){var e=u(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=this.kernelShape[1],a=this.kernelShape[2],s=this.outputShape[0],c=this.outputShape[1],l=s*c,f=i*a;this._imColsMat||(this._imColsMat=new h.default([],[l*o,f]));for(var p=new h.default([],[i,a,1]),d=0,v=0;v0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="SeparableConvolution2D";var n=t.nbFilter,o=void 0===n?1:n,s=t.nbRow,u=void 0===s?1:s,c=t.nbCol,l=void 0===c?1:c,p=t.activation,h=void 0===p?"linear":p,d=t.borderMode,v=void 0===d?"valid":d,y=t.subsample,g=void 0===y?[1,1]:y,_=t.depthMultiplier,b=void 0===_?1:_,m=t.dimOrdering,w=void 0===m?"tf":m,x=t.bias,O=void 0===x||x;if(r.activation=f[h],"valid"!==v&&"same"!==v)throw new Error(r.name+" [SeparableConvolution2D layer] Invalid borderMode.");if(r.borderMode=v,r.subsample=g,r.depthMultiplier=b,"tf"!==w&&"th"!==w)throw new Error(r.name+" [SeparableConvolution2D layer] Only tf and th dim ordering are allowed.");return r.dimOrdering=w,r.bias=O,r.params=r.bias?["depthwise_kernel","pointwise_kernel","b"]:["depthwise_kernel","pointwise_kernel"],r.depthwiseConvAttrs={nbFilter:r.depthMultiplier,nbRow:u,nbCol:l,activation:"linear",borderMode:v,subsample:g,dimOrdering:w,bias:!1,gpu:t.gpu},r.pointwiseConvAttrs={nbFilter:o,nbRow:1,nbCol:1,activation:"linear",borderMode:v,subsample:[1,1],dimOrdering:w,bias:r.bias,gpu:t.gpu},r}return s(e,t),c(e,[{key:"setWeights",value:function(t){this._depthwiseConv=new x(this.depthwiseConvAttrs),this._depthwiseConv.setWeights(t.slice(0,1)),this._pointwiseConv=new g.default(this.pointwiseConvAttrs), +this._pointwiseConv.setWeights(t.slice(1,3))}},{key:"call",value:function(t){var e=this._depthwiseConv.call(t),r=this._pointwiseConv.call(e);return t.tensor=r.tensor,this.activation(t),t}}]),e}(v.default);e.default=O},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="UpSampling1D";var n=t.length,a=void 0===n?2:n;return r.length=a,r}return a(e,t),s(e,[{key:"call",value:function(t){for(var e=t.tensor.shape,r=[e[0]*this.length,e[1]],n=new f.default([],r),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="UpSampling2D";var n=t.size,a=void 0===n?[2,2]:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.size=a,r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0));for(var e=t.tensor.shape,r=[e[0]*this.size[0],e[1]*this.size[1],e[2]],n=new f.default([],r),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="UpSampling3D";var n=t.size,a=void 0===n?[2,2,2]:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.size=a,r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,3,0));for(var e=t.tensor.shape,r=[e[0]*this.size[0],e[1]*this.size[1],e[2]*this.size[2],e[3]],n=new f.default([],r),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="ZeroPadding1D";var n=t.padding,a=void 0===n?1:n;return r.padding=a,r}return a(e,t),s(e,[{key:"call",value:function(t){var e=t.tensor.shape,r=[e[0]+2*this.padding,e[1]],n=new f.default([],r);return h.default.assign(n.tensor.hi(e[0]+this.padding,e[1]).lo(this.padding,0),t.tensor),t.tensor=n.tensor,t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="ZeroPadding2D";var n=t.padding,a=void 0===n?[1,1]:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.padding=a,r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0));var e=t.tensor.shape,r=[e[0]+2*this.padding[0],e[1]+2*this.padding[1],e[2]],n=new f.default([],r);return h.default.assign(n.tensor.hi(e[0]+this.padding[0],e[1]+this.padding[1],e[2]).lo(this.padding[0],this.padding[1],0),t.tensor),t.tensor=n.tensor,"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(2,0,1)),t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="ZeroPadding3D";var n=t.padding,a=void 0===n?[1,1,1]:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.padding=a,r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,3,0));var e=t.tensor.shape,r=[e[0]+2*this.padding[0],e[1]+2*this.padding[1],e[2]+2*this.padding[2],e[3]],n=new f.default([],r);return h.default.assign(n.tensor.hi(e[0]+this.padding[0],e[1]+this.padding[1],e[2]+this.padding[2],e[3]).lo(this.padding[0],this.padding[1],this.padding[2],0),t.tensor),t.tensor=n.tensor,"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(3,0,1,2)),t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.ZeroPadding3D=e.ZeroPadding2D=e.ZeroPadding1D=e.UpSampling3D=e.UpSampling2D=e.UpSampling1D=e.Convolution3D=e.Deconvolution2D=e.SeparableConvolution2D=e.AtrousConvolution2D=e.Convolution2D=e.Convolution1D=void 0;var o=r(202),i=n(o),a=r(65),s=n(a),u=r(201),c=n(u),l=r(205),f=n(l),p=r(204),h=n(p),d=r(203),v=n(d),y=r(206),g=n(y),_=r(207),b=n(_),m=r(208),w=n(m),x=r(209),O=n(x),j=r(210),E=n(j),S=r(211),k=n(S);e.Convolution1D=i.default,e.Convolution2D=s.default,e.AtrousConvolution2D=c.default,e.SeparableConvolution2D=f.default,e.Deconvolution2D=h.default,e.Convolution3D=v.default,e.UpSampling1D=g.default,e.UpSampling2D=b.default,e.UpSampling3D=w.default,e.ZeroPadding1D=O.default,e.ZeroPadding2D=E.default,e.ZeroPadding3D=k.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Activation";var n=t.activation,o=void 0===n?"linear":n;return r.activation=l[o],r}return s(e,t),u(e,[{key:"call",value:function(t){return this.activation(t),t}}]),e}(p.default);e.default=h},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Dense";var n=t.outputDim,o=void 0===n?1:n,s=t.activation,u=void 0===s?"linear":s,c=t.inputDim,l=void 0===c?null:c,p=t.bias,h=void 0===p||p;return r.activation=f[u],r.outputDim=o,r.inputDim=l,r.bias=h,r.params=r.bias?["W","b"]:["W"],r.inputDim&&(r.inputShape=[r.inputDim]),r}return s(e,t),u(e,[{key:"setWeights",value:function(t){c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,t),this._useWeblas&&(this.weights.W.createWeblasTensor(),this.weights.W.weblasTensor=this.weights.W.weblasTensor.transpose(),this.bias?this.weights.b.createWeblasTensor():(this._zerosVec=new h.default([],[this.weights.W.tensor.shape[1]]),this._zerosVec.createWeblasTensor()))}},{key:"call",value:function(t){var e=new h.default([],[this.outputDim]);if(this._useWeblas&&t.createWeblasTensor(),!this._useWeblas||t._gpuMaxSizeExceeded||this.weights.W._gpuMaxSizeExceeded)this.bias&&_.default.assign(e.tensor,this.weights.b.tensor),(0,y.gemv)(1,this.weights.W.tensor.transpose(1,0),t.tensor,1,e.tensor);else{var r=this.bias?this.weights.b.weblasTensor:this._zerosVec.weblasTensor;e.tensor.data=weblas.pipeline.sgemm(1,t.weblasTensor,this.weights.W.weblasTensor,1,r).transfer(),t.weblasTensor.delete(),delete t.weblasTensor}return t.tensor=e.tensor,this.activation(t),t}}]),e}(v.default);e.default=b},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Dropout";var n=t.p,a=void 0===n?.5:n;return r.p=Math.min(Math.max(0,a),1),r}return a(e,t),s(e,[{key:"call",value:function(t){return t}}]),e}(c.default);e.default=l},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="Flatten",r}return a(e,t),s(e,[{key:"call",value:function(t){if(t.tensor.shape.length>1){var e=new c.default([],[t.tensor.shape.reduce(function(t,e){return t*e},1)]);e.replaceTensorData(t.tensor.data),t.tensor=e.tensor}return t}}]),e}(f.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r._computeOutput=(0,b.default)({args:["array","array","array"],body:function(t,e,r){t=e*r+(1-r)*t}}),r.layerClass="Highway";var n=t.transformBias,o=void 0===n?-2:n,s=t.activation,u=void 0===s?"linear":s,c=t.bias,f=void 0===c||c;return r.transformBias=o,r.activation=l[u],r.bias=f,r.params=r.bias?["W","b","W_carry","b_carry"]:["W","W_carry"],r}return s(e,t),u(e,[{key:"call",value:function(t){var e=new p.default([],[this.weights.W.tensor.shape[1]]);this.bias&&g.default.assign(e.tensor,this.weights.b.tensor),(0,v.gemv)(1,this.weights.W.tensor.transpose(1,0),t.tensor,1,e.tensor),this.activation(e);var r=new p.default([],[this.weights.W_carry.tensor.shape[1]]);return this.bias&&g.default.assign(r.tensor,this.weights.b_carry.tensor),(0,v.gemv)(1,this.weights.W_carry.tensor.transpose(1,0),t.tensor,1,r.tensor),l.sigmoid(r),this._computeOutput(t.tensor,e.tensor,r.tensor),t}}]),e}(d.default);e.default=m},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="MaxoutDense";var n=t.outputDim,a=void 0===n?1:n,s=t.inputDim,u=void 0===s?null:s,c=t.bias,l=void 0===c||c;return r.outputDim=a,r.inputDim=u,r.bias=l,r.params=r.bias?["W","b"]:["W"],r}return a(e,t),s(e,[{key:"call",value:function(t){for(var e=this.weights.W.tensor.shape[0],r=new c.default([],[this.outputDim]),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Merge";var n=t.mode,a=void 0===n?"sum":n,s=t.concatAxis,u=void 0===s?-1:s,c=t.dotAxes,l=void 0===c?-1:c,f=t.outputShape,p=void 0===f?null:f,h=t.outputMask,d=void 0===h?null:h,v=["sum","mul","concat","ave","cos","dot","max"];if(!(v.indexOf(a)>-1))throw new Error(r.name+" [Merge layer] "+a+" not available.");return r.mode=a,r.concatAxis=u<=0?u:u-1,r.dotAxes=l<=0?l:l-1,r.outputShape=p,r.outputMask=d,r}return a(e,t),s(e,[{key:"_validateInputs",value:function(t){var e=this,r=t.map(function(t){return t.tensor.shape.slice()});if(["sum","mul","ave","cos","max"].indexOf(this.mode)>-1&&!r.every(function(t){return(0,w.default)(t,r[0])}))throw new Error(this.name+" [Merge layer] All input shapes must be the same for mode "+this.mode+".");if(["cos","dot"].indexOf(this.mode)>-1){if(2!==t.length)throw new Error(this.name+" [Merge layer] Exactly 2 inputs required for mode "+this.mode+".");if((0,O.default)(this.dotAxes)&&(this.dotAxes<0?this.dotAxes=[r[0].length+this.dotAxes,r[1].length+this.dotAxes]:this.dotAxes=[this.dotAxes,this.dotAxes]),r[0][this.dotAxes[0]]!==r[1][this.dotAxes[1]])throw new Error(this.name+" [Merge layer] Dimensions incompatibility using dot mode.")}else"concat"===this.mode&&!function(){var t=r.slice(),n=e.concatAxis<0?t[0].length+e.concatAxis:e.concatAxis;if(0===e.concatAxis&&(n=0),(0,E.default)(t.length).forEach(function(e){t[e].splice(n,1)}),!t.every(function(e){return(0,w.default)(e,t[0])}))throw new Error(e.name+" [Merge layer] In concat mode, all shapes must be the same except along the concat axis.")}();return!0}},{key:"call",value:function(t){var e=this,r=this._validateInputs(t);if(!r)throw new Error(this.name+" [Merge layer] Invalid inputs to call method.");var n=void 0,o=void 0;if(["sum","mul","ave","max"].indexOf(this.mode)>-1)o=t[0].tensor.shape.slice(),n=new c.default([],o);else if("concat"===this.mode)!function(){o=t[0].tensor.shape.slice();var r=e.concatAxis<0?o.length+e.concatAxis:e.concatAxis;0===e.concatAxis&&(r=0),t.slice(1,t.length).forEach(function(t){var e=t.tensor.shape.slice()[r];o[r]+=e}),n=new c.default([],o)}();else if(["cos","dot"].indexOf(this.mode)>-1){var i=t[0].tensor.shape.slice(),a=t[1].tensor.shape.slice();i.splice(this.dotAxes[0],1),a.splice(this.dotAxes[1],1),o=i.concat(a),1===o.length&&o.push(1),n=new c.default([],o)}if("sum"===this.mode)for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Permute";var n=t.dims,o=void 0===n?[]:n;return r.dims=o.map(function(t){return t-1}),r}return s(e,t),u(e,[{key:"call",value:function(t){var e;if(this.dims.length!==t.tensor.shape.length)throw new Error(this.name+" [Permute layer] The specified dims permutation must match the number of dimensions.");return t.tensor=(e=t.tensor).transpose.apply(e,o(this.dims)),t}}]),e}(l.default);e.default=f},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="RepeatVector";var n=t.n,a=void 0===n?1:n;return r.n=a,r}return a(e,t),s(e,[{key:"call",value:function(t){if(1!==t.tensor.shape.length)throw new Error(this.name+" [RepeatVector layer] Only 1D tensor inputs allowed.");return t.tensor=(0,h.default)((0,f.default)(t.tensor,0),[this.n,1]),t}}]),e}(c.default);e.default=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{ +value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Reshape";var n=t.targetShape,a=void 0===n?[]:n;return r.targetShape=a,r}return a(e,t),s(e,[{key:"call",value:function(t){if(this.targetShape.reduce(function(t,e){return t*e},1)!==t.tensor.size)throw new Error(this.name+" [Reshape layer] The total size of new array must be unchanged in reshape layer.");var e=new c.default([],this.targetShape);return e.replaceTensorData(t.tensor.data),t.tensor=e.tensor,t}}]),e}(f.default);e.default=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="SpatialDropout2D";var n=t.p,a=void 0===n?.5:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.p=Math.min(Math.max(0,a),1),r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){return t}}]),e}(c.default);e.default=l},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="SpatialDropout3D";var n=t.p,a=void 0===n?.5:n,s=t.dimOrdering,u=void 0===s?"tf":s;return r.p=Math.min(Math.max(0,a),1),r.dimOrdering=u,r}return a(e,t),s(e,[{key:"call",value:function(t){return t}}]),e}(c.default);e.default=l},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.MaxoutDense=e.Highway=e.Merge=e.RepeatVector=e.Permute=e.Reshape=e.Flatten=e.SpatialDropout3D=e.SpatialDropout2D=e.Dropout=e.Activation=e.Dense=void 0;var o=r(214),i=n(o),a=r(213),s=n(a),u=r(215),c=n(u),l=r(223),f=n(l),p=r(224),h=n(p),d=r(216),v=n(d),y=r(222),g=n(y),_=r(220),b=n(_),m=r(221),w=n(m),x=r(219),O=n(x),j=r(217),E=n(j),S=r(218),k=n(S);e.Dense=i.default,e.Activation=s.default,e.Dropout=c.default,e.SpatialDropout2D=f.default,e.SpatialDropout3D=h.default,e.Flatten=v.default,e.Reshape=g.default,e.Permute=b.default,e.RepeatVector=w.default,e.Merge=O.default,e.Highway=E.default,e.MaxoutDense=k.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Embedding";var n=t.inputDim,a=void 0===n?1:n,s=t.outputDim,u=void 0===s?1:s,c=t.inputLength,l=void 0===c?0:c,f=t.maskZero,p=void 0!==f&&f,h=t.dropout,d=void 0===h?0:h;return r.inputDim=a,r.outputDim=u,r.inputLength=l,r.maskZero=p,r.dropout=d,r.params=["W"],r}return a(e,t),s(e,[{key:"call",value:function(t){for(var e=new f.default([],[t.tensor.shape[0],this.weights.W.tensor.shape[1]]),r=0,n=t.tensor.shape[0];r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="BatchNormalization";var n=t.epsilon,a=void 0===n?1e-5:n,s=t.mode,u=void 0===s?0:s,c=t.axis,l=void 0===c?-1:c;return r.epsilon=a,r.mode=u,r.axis=l,r.axisNormalized=!1,r.params=0===r.mode?["gamma","beta","running_mean","running_std"]:["gamma","beta"],r}return a(e,t),s(e,[{key:"call",value:function(t){var e=this;this.axisNormalized||(this.axis=this.axis<0?t.tensor.shape.length+this.axis:this.axis-1,this.axisNormalized=!0);for(var r=[],n=0;n0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="AveragePooling1D",r.poolingFunc="average",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(130),u=n(s),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="AveragePooling2D",r.poolingFunc="average",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(131),u=n(s),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="AveragePooling3D",r.poolingFunc="average",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="GlobalAveragePooling1D",r}return a(e,t),u(e,[{key:"call",value:function(t){for(var e=s(t.tensor.shape,2),r=e[0],n=e[1],o=new p.default([],[n]),i=0,a=n;i0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="GlobalAveragePooling2D";var n=t.dimOrdering,a=void 0===n?"tf":n;return r.dimOrdering=a,r}return a(e,t),u(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0));for(var e=s(t.tensor.shape,3),r=e[0],n=e[1],o=e[2],i=new p.default([],[o]),a=0,u=o;a0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="GlobalMaxPooling1D",r}return a(e,t),s(e,[{key:"call",value:function(t){for(var e=t.tensor.shape[1],r=new f.default([],[e]),n=0,o=e;n0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="GlobalMaxPooling2D";var n=t.dimOrdering,a=void 0===n?"tf":n;return r.dimOrdering=a,r}return a(e,t),s(e,[{key:"call",value:function(t){"th"===this.dimOrdering&&(t.tensor=t.tensor.transpose(1,2,0));for(var e=t.tensor.shape[2],r=new f.default([],[e]),n=0,o=e;n0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="MaxPooling1D",r.poolingFunc="max",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(130),u=n(s),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="MaxPooling2D",r.poolingFunc="max",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(131),u=n(s),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.layerClass="MaxPooling3D",r.poolingFunc="max",r}return a(e,t),e}(u.default);e.default=c},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalAveragePooling2D=e.GlobalMaxPooling2D=e.GlobalAveragePooling1D=e.GlobalMaxPooling1D=e.AveragePooling3D=e.AveragePooling2D=e.AveragePooling1D=e.MaxPooling3D=e.MaxPooling2D=e.MaxPooling1D=void 0;var o=r(237),i=n(o),a=r(238),s=n(a),u=r(239),c=n(u),l=r(230),f=n(l),p=r(231),h=n(p),d=r(232),v=n(d),y=r(235),g=n(y),_=r(233),b=n(_),m=r(236),w=n(m),x=r(234),O=n(x);e.MaxPooling1D=i.default,e.MaxPooling2D=s.default,e.MaxPooling3D=c.default,e.AveragePooling1D=f.default,e.AveragePooling2D=h.default,e.AveragePooling3D=v.default,e.GlobalMaxPooling1D=g.default,e.GlobalAveragePooling1D=b.default,e.GlobalMaxPooling2D=w.default,e.GlobalAveragePooling2D=O.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r._combine=(0,b.default)({args:["array","array","array","array"],body:function(t,e,r,n){t=e+r+n}}),r._update=(0,b.default)({args:["array","array","array"],body:function(t,e,r){t=t*(1-r)+e*r}}),r.layerClass="GRU";var n=t.outputDim,o=void 0===n?1:n,s=t.activation,u=void 0===s?"tanh":s,c=t.innerActivation,f=void 0===c?"hardSigmoid":c,p=t.returnSequences,h=void 0!==p&&p,d=t.goBackwards,v=void 0!==d&&d,y=t.stateful,g=void 0!==y&&y;return r.outputDim=o,r.activation=u,r.innerActivation=f,r.activationFunc=l[u],r.innerActivationFunc=l[f],r.returnSequences=h,r.goBackwards=v,r.stateful=g,r.params=["W_z","U_z","b_z","W_r","U_r","b_r","W_h","U_h","b_h"],r}return s(e,t),u(e,[{key:"call",value:function(t){var e=this,r=new p.default([],[t.tensor.shape[1]]),n=this.weights.b_z.tensor.shape[0],o=this.weights.b_r.tensor.shape[0],i=this.weights.b_h.tensor.shape[0],a=new p.default([],[n]),s=new p.default([],[n]),u=new p.default([],[n]),c=new p.default([],[o]),l=new p.default([],[o]),f=new p.default([],[o]),h=this.stateful&&this.currentHiddenState?this.currentHiddenState:new p.default([],[i]),d=new p.default([],[i]),y=new p.default([],[i]),_=new p.default([],[i]);this.hiddenStateSequence=new p.default([],[t.tensor.shape[0],i]);for(var b=function(){var t=[s,u,l,f,d,y];t.forEach(function(t){return g.default.assigns(t.tensor,0)})},m=function(){g.default.assign(_.tensor,h.tensor),(0,v.gemv)(1,e.weights.W_z.tensor.transpose(1,0),r.tensor,1,s.tensor),(0,v.gemv)(1,e.weights.U_z.tensor.transpose(1,0),_.tensor,1,u.tensor),e._combine(a.tensor,s.tensor,u.tensor,e.weights.b_z.tensor),e.innerActivationFunc(a),(0,v.gemv)(1,e.weights.W_r.tensor.transpose(1,0),r.tensor,1,l.tensor),(0,v.gemv)(1,e.weights.U_r.tensor.transpose(1,0),_.tensor,1,f.tensor),e._combine(c.tensor,l.tensor,f.tensor,e.weights.b_r.tensor),e.innerActivationFunc(c),g.default.muleq(c.tensor,_.tensor),(0,v.gemv)(1,e.weights.W_h.tensor.transpose(1,0),r.tensor,1,d.tensor),(0,v.gemv)(1,e.weights.U_h.tensor.transpose(1,0),c.tensor,1,y.tensor),e._combine(h.tensor,d.tensor,y.tensor,e.weights.b_h.tensor),e.activationFunc(h),e._update(h.tensor,_.tensor,a.tensor)},w=0,x=t.tensor.shape[0];w0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r._combine=(0,b.default)({args:["array","array","array","array"],body:function(t,e,r,n){t=e+r+n}}),r._update=(0,b.default)({args:["array","array","array","array"],body:function(t,e,r,n){t=t*r+e*n}}),r.layerClass="LSTM";var n=t.outputDim,o=void 0===n?1:n,s=t.activation,u=void 0===s?"tanh":s,c=t.innerActivation,f=void 0===c?"hardSigmoid":c,p=t.returnSequences,h=void 0!==p&&p,d=t.goBackwards,v=void 0!==d&&d,y=t.stateful,g=void 0!==y&&y;return r.outputDim=o,r.activation=u,r.innerActivation=f,r.activationFunc=l[u],r.innerActivationFunc=l[f],r.returnSequences=h,r.goBackwards=v,r.stateful=g,r.params=["W_i","U_i","b_i","W_c","U_c","b_c","W_f","U_f","b_f","W_o","U_o","b_o"],r}return s(e,t),u(e,[{key:"call",value:function(t){var e=this,r=new p.default([],[t.tensor.shape[1]]),n=this.weights.b_i.tensor.shape[0],o=this.weights.b_c.tensor.shape[0],i=this.weights.b_f.tensor.shape[0],a=this.weights.b_o.tensor.shape[0],s=new p.default([],[n]),u=new p.default([],[n]),c=new p.default([],[n]),l=new p.default([],[i]),f=new p.default([],[i]),h=new p.default([],[i]),d=new p.default([],[a]),y=new p.default([],[a]),_=new p.default([],[a]),b=new p.default([],[o]),m=new p.default([],[o]),w=new p.default([],[o]),x=this.stateful&&this.previousCandidate?this.previousCandidate:new p.default([],[o]),O=this.stateful&&this.currentHiddenState?this.currentHiddenState:new p.default([],[o]),j=new p.default([],[o]);this.hiddenStateSequence=new p.default([],[t.tensor.shape[0],o]);for(var E=function(){var t=[u,c,f,h,y,_,m,w];t.forEach(function(t){return g.default.assigns(t.tensor,0)})},S=function(){g.default.assign(j.tensor,O.tensor),(0,v.gemv)(1,e.weights.W_i.tensor.transpose(1,0),r.tensor,1,u.tensor),(0,v.gemv)(1,e.weights.U_i.tensor.transpose(1,0),j.tensor,1,c.tensor),e._combine(s.tensor,u.tensor,c.tensor,e.weights.b_i.tensor),e.innerActivationFunc(s),(0,v.gemv)(1,e.weights.W_f.tensor.transpose(1,0),r.tensor,1,f.tensor),(0,v.gemv)(1,e.weights.U_f.tensor.transpose(1,0),j.tensor,1,h.tensor),e._combine(l.tensor,f.tensor,h.tensor,e.weights.b_f.tensor),e.innerActivationFunc(l),(0,v.gemv)(1,e.weights.W_o.tensor.transpose(1,0),r.tensor,1,y.tensor),(0,v.gemv)(1,e.weights.U_o.tensor.transpose(1,0),j.tensor,1,_.tensor),e._combine(d.tensor,y.tensor,_.tensor,e.weights.b_o.tensor),e.innerActivationFunc(d),(0,v.gemv)(1,e.weights.W_c.tensor.transpose(1,0),r.tensor,1,m.tensor),(0,v.gemv)(1,e.weights.U_c.tensor.transpose(1,0),j.tensor,1,w.tensor),e._combine(b.tensor,m.tensor,w.tensor,e.weights.b_c.tensor),e.activationFunc(b),e._update(b.tensor,x.tensor,s.tensor,l.tensor),g.default.assign(x.tensor,b.tensor),e.activationFunc(b),g.default.mul(O.tensor,d.tensor,b.tensor)},k=0,P=t.tensor.shape[0];k0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r._combine=(0,b.default)({args:["array","array","array","array"],body:function(t,e,r,n){t=e+r+n}}),r.layerClass="SimpleRNN";var n=t.outputDim,o=void 0===n?1:n,s=t.activation,u=void 0===s?"tanh":s,c=t.returnSequences,f=void 0!==c&&c,p=t.goBackwards,h=void 0!==p&&p,d=t.stateful,v=void 0!==d&&d;return r.outputDim=o,r.activation=u,r.activationFunc=l[u],r.returnSequences=f,r.goBackwards=h,r.stateful=v,r.params=["W","U","b"],r}return s(e,t),u(e,[{key:"call",value:function(t){var e=this,r=new p.default([],[t.tensor.shape[1]]),n=this.weights.b.tensor.shape[0],o=this.stateful&&this.currentHiddenState?this.currentHiddenState:new p.default([],[n]),i=new p.default([],[n]),a=new p.default([],[n]),s=new p.default([],[n]);this.hiddenStateSequence=new p.default([],[t.tensor.shape[0],n]);for(var u=function(){var t=[i,a];t.forEach(function(t){return g.default.assigns(t.tensor,0)})},c=function(){g.default.assign(s.tensor,o.tensor),(0,v.gemv)(1,e.weights.W.tensor.transpose(1,0),r.tensor,1,i.tensor),(0,v.gemv)(1,e.weights.U.tensor.transpose(1,0),s.tensor,1,a.tensor),e._combine(o.tensor,i.tensor,a.tensor,e.weights.b.tensor),e.activationFunc(o)},l=0,f=t.tensor.shape[0];l0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="Bidirectional";var n=t.layer,o=t.mergeMode,s=void 0===o?"concat":o;if(!n)throw new Error("[Bidirectional] wrapped layer is undefined.");r.forwardLayer=n;var u=(0,y.default)(n,["outputDim","activation","innerActivation","returnSequences","goBackwards","stateful"]);return u.goBackwards=!u.goBackwards,r.backwardLayer=new _[n.layerClass](u),r.mergeMode=s,r}return s(e,t),u(e,[{key:"setWeights",value:function(t){this.forwardLayer.setWeights(t.slice(0,t.length/2)),this.backwardLayer.setWeights(t.slice(t.length/2))}},{key:"call",value:function(t){var e=new p.default(t.tensor.data,t.tensor.shape),r=new p.default(t.tensor.data,t.tensor.shape),n=this.forwardLayer.call(e),o=this.backwardLayer.call(r);if("concat"===this.mergeMode){var i=n.tensor.shape.slice();i[i.length-1]+=o.tensor.shape[i.length-1];var a=new p.default([],i);this.forwardLayer.returnSequences?(d.default.assign(a.tensor.hi(i[0],n.tensor.shape[1]).lo(0,0),n.tensor),d.default.assign(a.tensor.hi(i[0],i[1]).lo(0,n.tensor.shape[1]),o.tensor.step(-1))):(d.default.assign(a.tensor.hi(n.tensor.shape[0]).lo(0),n.tensor),d.default.assign(a.tensor.hi(i[0]).lo(n.tensor.shape[0]),o.tensor)),t.tensor=a.tensor}else if("sum"===this.mergeMode){var s=n.tensor.shape.slice(),u=new p.default([],s);d.default.addeq(u.tensor,n.tensor),d.default.addeq(u.tensor,o.tensor),t.tensor=u.tensor}else if("mul"===this.mergeMode){var c=n.tensor.shape.slice(),l=new p.default([],c);d.default.assigns(l.tensor,1),d.default.muleq(l.tensor,n.tensor),d.default.muleq(l.tensor,o.tensor),t.tensor=l.tensor}else if("ave"===this.mergeMode){var f=n.tensor.shape.slice(),h=new p.default([],f);d.default.addeq(h.tensor,n.tensor),d.default.addeq(h.tensor,o.tensor),d.default.divseq(h.tensor,2),t.tensor=h.tensor}return t}}]),e}(l.default);e.default=b},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.layerClass="TimeDistributed";var n=t.layer;if(!n)throw new Error("[TimeDistributed] wrapped layer is undefined.");return r.layer=n,r}return s(e,t),u(e,[{key:"setWeights",value:function(t){this.layer.setWeights(t)}},{key:"call",value:function(t){var e,r,n=[].concat(o(t.tensor.shape.slice(1))),i=new p.default([],n);d.default.assign(i.tensor,(e=t.tensor).pick.apply(e,[0].concat(o(n.map(function(t){return null})))));var a=this.layer.call(i),s=a.tensor.shape.slice(),u=new p.default([],[t.tensor.shape[0]].concat(o(s)));d.default.assign((r=u.tensor).pick.apply(r,[0].concat(o(s.map(function(t){return null})))),a.tensor);for(var c=1,l=t.tensor.shape[0];c2&&void 0!==arguments[2]?arguments[2]:1e-5,n=(0,u.default)((0,a.default)(t)),o=e;if(n.length!==o.length)return!1;for(var i=0;io[i]+r)return!1}return!0}Object.defineProperty(e,"__esModule",{value:!0}),e.approxEquals=o;var i=r(187),a=n(i),s=r(180),u=n(s),c=r(550),l=n(c)},function(t,e){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-r(t)}function o(t){var e,n,o,i,a,s,u=t.length;a=r(t),s=new l(3*u/4-a),o=a>0?u-4:u;var f=0;for(e=0,n=0;e>16&255,s[f++]=i>>8&255,s[f++]=255&i;return 2===a?(i=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[f++]=255&i):1===a&&(i=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[f++]=i>>8&255,s[f++]=255&i),s}function i(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,r){for(var n,o=[],a=e;al?l:c+s));return 1===n?(e=t[r-1],o+=u[e>>2],o+=u[e<<4&63],o+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],o+=u[e>>10],o+=u[e>>4&63],o+=u[e<<2&63],o+="="),i.push(o),i.join("")}e.byteLength=n,e.toByteArray=o,e.fromByteArray=s;for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,h=f.length;p0)-(t<0)},e.abs=function(t){var e=t>>n-1;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,e|=r,e|t>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var o=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,o=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--o;t[e]=n<>>8&255]<<16|o[t>>>16&255]<<8|o[t>>>24&255]},e.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},e.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},e.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},e.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},function(t,e,r){(function(e,r,n){/* @preserve * The MIT License (MIT) * * Copyright (c) 2013-2015 Petka Antonov @@ -29,16 +29,16 @@ v.gemv)(1,e.weights.U_c.tensor.transpose(1,0),j.tensor,1,w.tensor),e._combine(b. * THE SOFTWARE. * */ -!function(e){t.exports=e()}(function(){var t,o,i;return function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof _dereq_&&_dereq_;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof _dereq_&&_dereq_,a=0;a0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},o.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},o.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},o.prototype._reset=function(){this._isTickUsed=!1},r.exports=o,r.exports.firstLineError=u},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var o=!1,i=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(i,i,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(i){o||(o=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var c=r(i),l=new t(e);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(c),c instanceof t){var p={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:c};f._then(e,a,void 0,l,p),c._then(s,u,void 0,l,p),l._setOnCancel(c)}else l._resolveCallback(f);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=this._bitField&-2097153},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";function n(){try{Promise===i&&(Promise=o)}catch(t){}return i}var o;"undefined"!=typeof Promise&&(o=Promise);var i=t("./promise")();i.noConflict=n,e.exports=i},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var o=n(null),i=n(null);o[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var o="Object "+s.classString(t)+" has no method '"+s.toString(r)+"'";throw new e.TypeError(o)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function o(t){return t[this]}function i(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}var a,s=t("./util"),u=s.canEvaluate;s.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(n,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=i;else if(u){var n=a(t);e=null!==n?n:o}else e=o;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,o){var i=t("./util"),a=i.tryCatch,s=i.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(i.isArray(t))for(var r=0;r=0)return i[t]}var o=!1,i=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,i.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=i.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=r,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var r=t.prototype._pushContext,i=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=i,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,o=!1},o=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=n,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,r,n){"use strict";r.exports=function(r,n){function o(t,e){return{promise:e}}function i(){return!1}function a(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+U.toString(t));n._attachCancellationCallback(t)})}catch(t){return t}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?U.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function u(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(t,e){if(0!==(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function d(){this._trace=new T(this._peekContext())}function v(t,e){if(B(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=j(t);U.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),U.notEnumerableProp(t,"__stackCleaned__",!0)}}}function y(t,e,r,n,o){if(void 0===t&&null!==e&&X){if(void 0!==o&&o._returnedNonUndefined())return;if(0===(65535&n._bitField))return;r&&(r+=" ");var i="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=x(s),c=u.length-1;c>=0;--c){var l=u[c];if(!W.test(l)){var f=l.match(z);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(u.length>0)for(var p=u[0],c=0;c0&&(a="\n"+s[c-1]);break}}var h="a promise was created in a "+r+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(h,!0,e)}}function g(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),_(r)}function _(t,e,n){if(at.warnings){var o,i=new N(t);if(e)n._attachExtraTrace(i);else if(at.longStackTraces&&(o=r._peekContext()))o.attachExtraTrace(i);else{var a=j(i);i.stack=a.message+"\n"+a.stack.join("\n")}et("warning",i)||E(i,"",!0)}}function b(t,e){for(var r=0;r=0;--s)if(n[s]===i){a=s;break}for(var s=a;s>=0;--s){var u=n[s];if(e[o]!==u)break;e.pop(),o--}e=n}}function x(t){for(var e=[],r=0;r0&&(e=e.slice(r)),e}function j(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?O(t):[" (No stack trace)"],{message:r,stack:x(e)}}function E(t,e,r){if("undefined"!=typeof console){var n;if(U.isObject(t)){var o=t.stack;n=e+G(o,t)}else n=e+String(t);"function"==typeof I?I(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function S(t,e,r,n){var o=!1;try{"function"==typeof e&&(o=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){L.throwLater(t)}"unhandledRejection"===t?et(t,r,n)||o||E(r,"Unhandled rejection "):et(t,n)}function k(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():U.toString(t);var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+P(e)+">, no stack trace)"}function P(t){var e=41;return t.length=s||(nt=function(t){if(V.test(t))return!0;var e=C(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}}function T(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,T),e>32&&this.uncycle()}var R,F,I,D=r._getDomain,L=r._async,N=t("./errors").Warning,U=t("./util"),B=U.canAttachTrace,V=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,W=/\((?:timers\.js):\d+:\d+\)/,z=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,G=null,H=!1,Y=!(0==U.env("BLUEBIRD_DEBUG")),$=!(0==U.env("BLUEBIRD_WARNINGS")||!Y&&!U.env("BLUEBIRD_WARNINGS")),K=!(0==U.env("BLUEBIRD_LONG_STACK_TRACES")||!Y&&!U.env("BLUEBIRD_LONG_STACK_TRACES")),X=0!=U.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&($||!!U.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=t._bitField&-1048577|524288},r.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),L.invokeLater(this._notifyUnhandledRejection,this,void 0))},r.prototype._notifyUnhandledRejectionIsHandled=function(){S("rejectionHandled",R,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),S("unhandledRejection",F,t,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(t,e,r){return _(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=D();F="function"==typeof t?null===e?t:U.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=D();R="function"==typeof t?null===e?t:U.domainBind(e,t):void 0};var Z=function(){};r.longStackTraces=function(){if(L.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!at.longStackTraces&&A()){var t=r.prototype._captureStackTrace,e=r.prototype._attachExtraTrace;at.longStackTraces=!0,Z=function(){if(L.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=t,r.prototype._attachExtraTrace=e,n.deactivateLongStackTraces(),L.enableTrampoline(),at.longStackTraces=!1},r.prototype._captureStackTrace=d,r.prototype._attachExtraTrace=v,n.activateLongStackTraces(),L.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return at.longStackTraces&&A()};var Q=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return U.global.dispatchEvent(t),function(t,e){var r=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!U.global.dispatchEvent(r)}}if("function"==typeof Event){var t=new Event("CustomEvent");return U.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,!U.global.dispatchEvent(r)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),U.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!U.global.dispatchEvent(r)}}catch(t){}return function(){return!1}}(),J=function(){return U.isNode?function(){return e.emit.apply(e,arguments)}:U.global?function(t){var e="on"+t.toLowerCase(),r=U.global[e];return!!r&&(r.apply(U.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),tt={promiseCreated:o,promiseFulfilled:o,promiseRejected:o,promiseResolved:o,promiseCancelled:o,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:o},et=function(t){var e=!1;try{e=J.apply(null,arguments)}catch(t){L.throwLater(t),e=!0}var r=!1;try{r=Q(t,tt[t].apply(null,arguments))}catch(t){L.throwLater(t),r=!0}return r||e};r.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&Z()),"warnings"in t){var e=t.warnings;at.warnings=!!e,X=at.warnings,U.isObject(e)&&"wForgottenReturn"in e&&(X=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!at.cancellation){if(L.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=l,r.prototype._propagateFrom=f,r.prototype._onCancel=u,r.prototype._setOnCancel=c,r.prototype._attachCancellationCallback=s,r.prototype._execute=a,rt=f,at.cancellation=!0}"monitoring"in t&&(t.monitoring&&!at.monitoring?(at.monitoring=!0,r.prototype._fireEvent=et):!t.monitoring&&at.monitoring&&(at.monitoring=!1,r.prototype._fireEvent=i))},r.prototype._fireEvent=i,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var rt=p,nt=function(){return!1},ot=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;U.inherits(T,Error),n.CapturedTrace=T,T.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,o=this;void 0!==o;++n)e.push(o),o=o._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var i=e[n].stack;void 0===r[i]&&(r[i]=n)}for(var n=0;n0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;s=0;--l)e[l]._length=c,c++;return}}}},T.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),r=e.message,n=[e.stack],o=this;void 0!==o;)n.push(x(o.stack.split("\n"))),o=o._parent;w(n),m(n),U.notEnumerableProp(t,"stack",b(r,n)),U.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():k(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,G=e;var r=Error.captureStackTrace;return nt=function(t){return V.test(t)},function(t,e){Error.stackTraceLimit+=6,r(t,e),Error.stackTraceLimit-=6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,G=e,H=!0,function(t){t.stack=(new Error).stack};var o;try{throw new Error}catch(t){o="stack"in t}return"stack"in n||!o||"number"!=typeof Error.stackTraceLimit?(G=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?k(e):e.toString()},null):(q=t,G=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(I=function(t){console.warn(t)},U.isNode&&e.stderr.isTTY?I=function(t,e){var r=e?"":"";console.warn(r+t+"\n")}:U.isNode||"string"!=typeof(new Error).stack||(I=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var at={warnings:$,longStackTraces:!1,cancellation:!1,monitoring:!1};return K&&r.longStackTraces(),{longStackTraces:function(){return at.longStackTraces},warnings:function(){return at.warnings},cancellation:function(){return at.cancellation},monitoring:function(){return at.monitoring},propagateFromFunction:function(){return rt},boundValueFunction:function(){return h},checkForgottenReturns:y,setBounds:M,warn:_,deprecated:g,CapturedTrace:T,fireDomEvent:Q,fireGlobalEvent:J}}},{"./errors":12,"./util":36}],10:[function(t,e,r){"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1],n=function(){throw e};return this.caught(t,n)},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();var o=function(){return n};return this.caught(r,o)}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){function r(){return i(this)}function n(t,r){return o(t,r,e,e)}var o=t.reduce,i=t.all;t.prototype.each=function(t){return o(this,t,e,0)._then(r,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return o(this,t,e,e)},t.each=function(t,n){return o(t,n,e,0)._then(r,void 0,void 0,t,void 0)},t.mapSeries=n}},{}],12:[function(t,e,r){"use strict";function n(t,e){function r(n){return this instanceof r?(f(this,"message","string"==typeof n?n:e),f(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return l(r,Error),r}function o(t){return this instanceof o?(f(this,"name","OperationalError"),f(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(f(this,"message",t.message),f(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new o(t)}var i,a,s=t("./es5"),u=s.freeze,c=t("./util"),l=c.inherits,f=c.notEnumerableProp,p=n("Warning","warning"),h=n("CancellationError","cancellation error"),d=n("TimeoutError","timeout error"),v=n("AggregateError","aggregate error");try{i=TypeError,a=RangeError}catch(t){i=n("TypeError","type error"),a=n("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function a(){return u.call(this,this.promise._target()._settledValue())}function s(t){if(!i(this,t))return f.e=t,f}function u(t){var n=this.promise,u=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?u.call(n._boundValue()):u.call(n._boundValue(),t);if(void 0!==c){n._setReturnedNonUndefined();var p=r(c,n);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var h=new l("late cancellation observer");return n._attachExtraTrace(h),f.e=h,f}p.isPending()&&p._attachCancellationCallback(new o(this))}return p._then(a,s,void 0,this,void 0)}}}return n.isRejected()?(i(this),f.e=t,f):(i(this),t)}var c=t("./util"),l=e.CancellationError,f=c.errorObj;return n.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){i(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,o){return"function"!=typeof t?this.then():this._then(r,o,void 0,new n(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,u,u)},e.prototype.tap=function(t){return this._passThrough(t,1,u)},n}},{"./util":36}],16:[function(t,e,r){"use strict";e.exports=function(e,r,n,o,i,a){function s(t,r,n){for(var i=0;i0&&"function"==typeof arguments[e]){t=arguments[e];var n}var o=[].slice.call(arguments);t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,o,i,a){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var o=c();this._callback=null===o?e:l.domainBind(o,e),this._preservedValues=n===i?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function u(t,r,o,i){if("function"!=typeof r)return n("expecting a function but got "+l.classString(r));var a=0;if(void 0!==o){if("object"!=typeof o||null===o)return e.reject(new TypeError("options argument must be an object but it is "+l.classString(o)));if("number"!=typeof o.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+l.classString(o.concurrency)));a=o.concurrency}return a="number"==typeof a&&isFinite(a)&&a>=1?a:0,new s(t,r,a,i).promise()}var c=e._getDomain,l=t("./util"),f=l.tryCatch,p=l.errorObj,h=e._async;l.inherits(s,r),s.prototype._asyncInit=function(){this._init$(void 0,-2)},s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,i=this.length(),s=this._preservedValues,u=this._limit;if(r<0){if(r=r*-1-1,n[r]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var c=this._promise,l=this._callback,h=c._boundValue();c._pushContext();var d=f(l).call(h,t,r,i),v=c._popContext();if(a.checkForgottenReturns(d,v,null!==s?"Promise.filter":"Promise.map",c),d===p)return this._reject(d.e),!0;var y=o(d,this._promise);if(y instanceof e){y=y._target();var g=y._bitField;if(0===(50397184&g))return u>=1&&this._inFlight++,n[r]=y,y._proxy(this,(r+1)*-1),!1;if(0===(33554432&g))return 0!==(16777216&g)?(this._reject(y._reason()),!0):(this._cancel(),!0);d=y._value()}n[r]=d}var _=++this._totalResolved;return _>=i&&(null!==s?this._filter(n,s):this._resolve(n),!0)},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight1){i.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],l=arguments[2];u=a.isArray(c)?s(t).apply(l,c):s(t).call(l,c)}else u=s(t)();var f=n._popContext();return i.checkForgottenReturns(u,f,"Promise.try",n),n._resolveFromSyncValue(u),n},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";function n(t){return t instanceof Error&&l.getPrototypeOf(t)===Error.prototype}function o(t){var e;if(n(t)){e=new c(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=l.keys(t),o=0;o1){var r,n=new Array(e-1),o=0;for(r=0;r0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+d.classString(t);arguments.length>1&&(r+=", "+d.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var r=this._then(t,e,void 0,void 0,void 0);r._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+d.classString(t)):this.all()._then(t,void 0,void 0,x,void 0)},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},i.prototype.error=function(t){return this.caught(d.originatesFromRejection,t)},i.getNewLibraryCopy=r.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(w);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=R(t)(M(e,r));return n===T&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new E(t).promise()},i.cast=function(t){var e=j(t);return e instanceof i||(e=new i(w),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(w);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new b("expecting a function but got "+d.classString(t));return g.setScheduler(t)},i.prototype._then=function(t,e,r,n,o){var a=void 0!==o,s=a?o:new i(w),u=this._target(),l=u._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===n&&0!==(2097152&this._bitField)&&(n=0!==(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var f=c();if(0!==(50397184&l)){var p,h,v=u._settlePromiseCtx;0!==(33554432&l)?(h=u._rejectionHandler0,p=t):0!==(16777216&l)?(h=u._fulfillmentHandler0,p=e,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,h=new m("late cancellation observer"),u._attachExtraTrace(h),p=e),g.invoke(v,u,{handler:null===f?p:"function"==typeof p&&d.domainBind(f,p),promise:s,receiver:n,value:h})}else u._addCallbacks(t,e,s,n,f);return s},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=this._bitField&-65536|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){g.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==h)return void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),r=t._rejectionHandler0,n=t._promise0,o=t._receiverAt(0);void 0===o&&(o=h),this._addCallbacks(e,r,n,o,null)},i.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),o=t._promiseAt(e),i=t._receiverAt(e);void 0===i&&(i=h),this._addCallbacks(r,n,o,i,null)},i.prototype._addCallbacks=function(t,e,r,n,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===o?t:d.domainBind(o,t)),"function"==typeof e&&(this._rejectionHandler0=null===o?e:d.domainBind(o,e));else{var a=4*i-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=null===o?t:d.domainBind(o,t)),"function"==typeof e&&(this[a+1]=null===o?e:d.domainBind(o,e))}return this._setLength(i+1),i},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var r=j(t,this);if(!(r instanceof i))return this._fulfill(t);e&&this._propagateFrom(r,2);var n=r._target();if(n===this)return void this._reject(l());var o=n._bitField;if(0===(50397184&o)){var a=this._length();a>0&&n._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var r=l();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():g.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?g.fatalError(t,d.isNode):void((65535&e)>0?g.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var r=1;r0){if(0!==(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){P.deprecated("Promise.defer","new Promise");var t=new i(w);return{promise:t,resolve:a,reject:s}},d.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,w,j,p,P),t("./bind")(i,w,j,P),t("./cancel")(i,E,p,P),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,E,j,w,g,c),i.Promise=i,i.version="3.4.6",t("./map.js")(i,E,p,j,w,P),t("./call_get.js")(i),t("./using.js")(i,p,j,k,w,P),t("./timers.js")(i,w,P),t("./generators.js")(i,p,w,j,n,P),t("./nodeify.js")(i),t("./promisify.js")(i,w),t("./props.js")(i,E,j,p),t("./race.js")(i,w,j,p),t("./reduce.js")(i,E,p,j,w,P),t("./settle.js")(i,E,P),t("./some.js")(i,E,p),t("./filter.js")(i,w),t("./each.js")(i,w),t("./any.js")(i),d.toFastProperties(i),d.toFastProperties(i.prototype),u({a:1}),u({b:2}),u({c:3}),u(1),u(function(){}),u(void 0),u(!1),u(new i(w)),P.setBounds(y.firstLineError,d.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,r){"use strict";e.exports=function(e,r,n,o,i){function a(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var u=t("./util");u.isArray;return u.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,i){var s=n(this._values,this._promise);if(s instanceof e){s=s._target();var c=s._bitField;if(this._values=s,0===(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,i);if(0===(33554432&c))return 0!==(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(s=u.asArray(s),null===s){var l=o("expecting an array or an iterable object but got "+u.classString(s)).reason();return void this._promise._rejectCallback(l,!1)}return 0===s.length?void(i===-5?this._resolveEmptyArray():this._resolve(a(i))):void this._iterate(s)},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var o=this._promise,i=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r=this._length){var n;if(this._isMap)n=p(this._values);else{n={};for(var o=this.length(),i=0,a=this.length();i>1},e.prototype.props=function(){return a(this)},e.props=function(t){return a(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t,e,r,n,o){for(var i=0;i=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(t,e){var r=new i;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},o.prototype._promiseRejected=function(t,e){var r=new i;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new o(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){function o(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function i(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new o(t),i=r.promise();return r.setHowMany(e),r.init(),i}var a=t("./util"),s=t("./errors").RangeError,u=t("./errors").AggregateError,c=a.isArray,l={};a.inherits(o,r),o.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length())); -}},o.prototype.init=function(){this._initialized=!0,this._init()},o.prototype.setUnwrap=function(){this._unwrap=!0},o.prototype.howMany=function(){return this._howMany},o.prototype.setHowMany=function(t){this._howMany=t},o.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},o.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},o.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},o.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new u,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},o.prototype._fulfilled=function(){return this._totalResolved},o.prototype._rejected=function(){return this._values.length-this.length()},o.prototype._addRejected=function(t){this._values.push(t)},o.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},o.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},o.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new s(e)},o.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return i(t,e)},e.prototype.some=function(t){return i(this,t)},e._SomePromiseArray=o}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},o=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},i=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return i.call(this._target())},t.prototype.isFulfilled=function(){return o.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t,n){if(l(t)){if(t instanceof e)return t;var o=i(t);if(o===c){n&&n._pushContext();var u=e.reject(o.e);return n&&n._popContext(),u}if("function"==typeof o){if(a(t)){var u=new e(r);return t._then(u._fulfill,u._reject,void 0,u,null),u}return s(t,o,n)}}return t}function o(t){return t.then}function i(t){try{return o(t)}catch(t){return c.e=t,c}}function a(t){try{return f.call(t,"_promise0")}catch(t){return!1}}function s(t,n,o){function i(t){s&&(s._resolveCallback(t),s=null)}function a(t){s&&(s._rejectCallback(t,f,!0),s=null)}var s=new e(r),l=s;o&&o._pushContext(),s._captureStackTrace(),o&&o._popContext();var f=!0,p=u.tryCatch(n).call(t,i,a);return f=!1,s&&p===c&&(s._rejectCallback(p.e,!0,!0),s=null),l}var u=t("./util"),c=u.errorObj,l=u.isObject,f={}.hasOwnProperty;return n}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){function o(t){this.handle=t}function i(t){return clearTimeout(this.handle),t}function a(t){throw clearTimeout(this.handle),t}var s=t("./util"),u=e.TimeoutError;o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(t){return l(+this).thenReturn(t)},l=e.delay=function(t,i){var a,s;return void 0!==i?(a=e.resolve(i)._then(c,null,null,t,void 0),n.cancellation()&&i instanceof e&&a._setOnCancel(i)):(a=new e(r),s=setTimeout(function(){a._fulfill()},+t),n.cancellation()&&a._setOnCancel(new o(s)),a._captureStackTrace()),a._setAsyncGuaranteed(),a};e.prototype.delay=function(t){return l(t,this)};var f=function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new u("operation timed out"):new u(e),s.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()};e.prototype.timeout=function(t,e){t=+t;var r,s,u=new o(setTimeout(function(){r.isPending()&&f(r,e,s)},t));return n.cancellation()?(s=this.then(),r=s._then(i,a,void 0,u,void 0),r._setOnCancel(u)):r=this._then(i,a,void 0,u,void 0),r}}},{"./util":36}],35:[function(t,e,r){"use strict";e.exports=function(e,r,n,o,i,a){function s(t){setTimeout(function(){throw t},0)}function u(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function c(t,r){function o(){if(a>=c)return l._fulfill();var i=u(t[a++]);if(i instanceof e&&i._isDisposable()){try{i=n(i._getDisposer().tryDispose(r),t.promise)}catch(t){return s(t)}if(i instanceof e)return i._then(o,s,null,null,null)}o()}var a=0,c=t.length,l=new e(i);return o(),l}function l(t,e,r){this._data=t,this._promise=e,this._context=r}function f(t,e,r){this.constructor$(t,e,r)}function p(t){return l.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function h(t){this.length=t,this.promise=null,this[t-1]=null}var d=t("./util"),v=t("./errors").TypeError,y=t("./util").inherits,g=d.errorObj,_=d.tryCatch,b={};l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():b},l.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==b?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},l.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},y(f,l),f.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},h.prototype._resultCancelled=function(){for(var t=this.length,r=0;r0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new f(t,this,o());throw new v}}},{"./errors":12,"./util":36}],36:[function(t,n,o){"use strict";function i(){try{var t=M;return M=null,t.apply(this,arguments)}catch(t){return C.e=t,C}}function a(t){return M=t,i}function s(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function u(t){return"function"==typeof t||"object"==typeof t&&null!==t}function c(t){return s(t)?new Error(_(t)):t}function l(t,e){var r,n=t.length,o=new Array(n+1);for(r=0;r1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),o=I.test(t+"")&&P.names(t).length>0;if(r||n||o)return!0}return!1}catch(t){return!1}}function v(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function y(t){return D.test(t)}function g(t,e,r){for(var n=new Array(t),o=0;o10||t[0]>0}(),V.isNode&&V.toFastProperties(e);try{throw new Error}catch(t){V.lastLineError=t}n.exports=V},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(e,r(126),r(49),r(127).setImmediate)},function(t,e,r){r(260),t.exports=r(30).RegExp.escape},function(t,e,r){var n=r(7),o=r(96),i=r(8)("species");t.exports=function(t){var e;return o(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!o(e.prototype)||(e=void 0),n(e)&&(e=e[i],null===e&&(e=void 0))),void 0===e?Array:e}},function(t,e,r){var n=r(252);t.exports=function(t,e){return new(n(t))(e)}},function(t,e,r){"use strict";var n=r(2),o=r(28),i="number";t.exports=function(t){if("string"!==t&&t!==i&&"default"!==t)throw TypeError("Incorrect hint");return o(n(this),t!=i)}},function(t,e,r){var n=r(42),o=r(74),i=r(59);t.exports=function(t){var e=n(t),r=o.f;if(r)for(var a,s=r(t),u=i.f,c=0;s.length>c;)u.call(t,a=s[c++])&&e.push(a);return e}},function(t,e,r){var n=r(42),o=r(18);t.exports=function(t,e){for(var r,i=o(t),a=n(i),s=a.length,u=0;s>u;)if(i[r=a[u++]]===e)return r}},function(t,e,r){"use strict";var n=r(258),o=r(70),i=r(14);t.exports=function(){for(var t=i(this),e=arguments.length,r=Array(e),a=0,s=n._,u=!1;e>a;)(r[a]=arguments[a++])===s&&(u=!0);return function(){var n,i=this,a=arguments.length,c=0,l=0;if(!u&&!a)return o(t,r,i);if(n=r.slice(),u)for(;e>c;c++)n[c]===s&&(n[c]=arguments[l++]);for(;a>l;)n.push(arguments[l++]);return o(t,n,i)}}},function(t,e,r){t.exports=r(5)},function(t,e){t.exports=function(t,e){var r=e===Object(e)?function(t){return e[t]}:e;return function(e){return String(e).replace(t,r)}}},function(t,e,r){var n=r(0),o=r(259)(/[\\^$*+?.()|[\]{}]/g,"\\$&");n(n.S,"RegExp",{escape:function(t){return o(t)}})},function(t,e,r){var n=r(0);n(n.P,"Array",{copyWithin:r(135)}),r(50)("copyWithin")},function(t,e,r){"use strict";var n=r(0),o=r(26)(4);n(n.P+n.F*!r(24)([].every,!0),"Array",{every:function(t){return o(this,t,arguments[1])}})},function(t,e,r){var n=r(0);n(n.P,"Array",{fill:r(88)}),r(50)("fill")},function(t,e,r){"use strict";var n=r(0),o=r(26)(2);n(n.P+n.F*!r(24)([].filter,!0),"Array",{filter:function(t){return o(this,t,arguments[1])}})},function(t,e,r){"use strict";var n=r(0),o=r(26)(6),i="findIndex",a=!0;i in[]&&Array(1)[i](function(){a=!1}),n(n.P+n.F*a,"Array",{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),r(50)(i)},function(t,e,r){"use strict";var n=r(0),o=r(26)(5),i="find",a=!0;i in[]&&Array(1)[i](function(){a=!1}),n(n.P+n.F*a,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),r(50)(i)},function(t,e,r){"use strict";var n=r(0),o=r(26)(0),i=r(24)([].forEach,!0);n(n.P+n.F*!i,"Array",{forEach:function(t){return o(this,t,arguments[1])}})},function(t,e,r){"use strict";var n=r(31),o=r(0),i=r(12),a=r(144),s=r(95),u=r(11),c=r(89),l=r(112);o(o.S+o.F*!r(72)(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,o,f,p=i(t),h="function"==typeof this?this:Array,d=arguments.length,v=d>1?arguments[1]:void 0,y=void 0!==v,g=0,_=l(p);if(y&&(v=n(v,d>2?arguments[2]:void 0,2)),void 0==_||h==Array&&s(_))for(e=u(p.length),r=new h(e);e>g;g++)c(r,g,y?v(p[g],g):p[g]);else for(f=_.call(p),r=new h;!(o=f.next()).done;g++)c(r,g,y?a(f,v,[o.value,g],!0):o.value);return r.length=g,r}})},function(t,e,r){"use strict";var n=r(0),o=r(66)(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;n(n.P+n.F*(a||!r(24)(i)),"Array",{indexOf:function(t){return a?i.apply(this,arguments)||0:o(this,t,arguments[1])}})},function(t,e,r){var n=r(0);n(n.S,"Array",{isArray:r(96)})},function(t,e,r){"use strict";var n=r(0),o=r(18),i=[].join;n(n.P+n.F*(r(58)!=Object||!r(24)(i)),"Array",{join:function(t){return i.call(o(this),void 0===t?",":t)}})},function(t,e,r){"use strict";var n=r(0),o=r(18),i=r(37),a=r(11),s=[].lastIndexOf,u=!!s&&1/[1].lastIndexOf(1,-0)<0;n(n.P+n.F*(u||!r(24)(s)),"Array",{lastIndexOf:function(t){if(u)return s.apply(this,arguments)||0;var e=o(this),r=a(e.length),n=r-1;for(arguments.length>1&&(n=Math.min(n,i(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}})},function(t,e,r){"use strict";var n=r(0),o=r(26)(1);n(n.P+n.F*!r(24)([].map,!0),"Array",{map:function(t){return o(this,t,arguments[1])}})},function(t,e,r){"use strict";var n=r(0),o=r(89);n(n.S+n.F*r(6)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,r=new("function"==typeof this?this:Array)(e);e>t;)o(r,t,arguments[t++]);return r.length=e,r}})},function(t,e,r){"use strict";var n=r(0),o=r(137);n(n.P+n.F*!r(24)([].reduceRight,!0),"Array",{reduceRight:function(t){return o(this,t,arguments.length,arguments[1],!0)}})},function(t,e,r){"use strict";var n=r(0),o=r(137);n(n.P+n.F*!r(24)([].reduce,!0),"Array",{reduce:function(t){return o(this,t,arguments.length,arguments[1],!1)}})},function(t,e,r){"use strict";var n=r(0),o=r(93),i=r(22),a=r(45),s=r(11),u=[].slice;n(n.P+n.F*r(6)(function(){o&&u.call(o)}),"Array",{slice:function(t,e){var r=s(this.length),n=i(this);if(e=void 0===e?r:e,"Array"==n)return u.call(this,t,e);for(var o=a(t,r),c=a(e,r),l=s(c-o),f=Array(l),p=0;p9?t:"0"+t};n(n.P+n.F*(o(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!o(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),r=t.getUTCMilliseconds(),n=e<0?"-":e>9999?"+":"";return n+("00000"+Math.abs(e)).slice(n?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(r>99?r:"0"+a(r))+"Z"}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(28);n(n.P+n.F*r(6)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(t){var e=o(this),r=i(e);return"number"!=typeof r||isFinite(r)?e.toISOString():null}})},function(t,e,r){var n=r(8)("toPrimitive"),o=Date.prototype;n in o||r(15)(o,n,r(254))},function(t,e,r){var n=Date.prototype,o="Invalid Date",i="toString",a=n[i],s=n.getTime;new Date(NaN)+""!=o&&r(16)(n,i,function(){var t=s.call(this);return t===t?a.call(this):o})},function(t,e,r){var n=r(0);n(n.P,"Function",{bind:r(138)})},function(t,e,r){"use strict";var n=r(7),o=r(21),i=r(8)("hasInstance"),a=Function.prototype;i in a||r(10).f(a,i,{value:function(t){if("function"!=typeof this||!n(t))return!1;if(!n(this.prototype))return t instanceof this;for(;t=o(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,r){var n=r(10).f,o=r(36),i=r(13),a=Function.prototype,s=/^\s*function ([^ (]*)/,u="name",c=Object.isExtensible||function(){return!0};u in a||r(9)&&n(a,u,{configurable:!0,get:function(){try{var t=this,e=(""+t).match(s)[1];return i(t,u)||!c(t)||n(t,u,o(5,e)),e}catch(t){return""}}})},function(t,e,r){var n=r(0),o=r(146),i=Math.sqrt,a=Math.acosh;n(n.S+n.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:o(t-1+i(t-1)*i(t+1))}})},function(t,e,r){function n(t){return isFinite(t=+t)&&0!=t?t<0?-n(-t):Math.log(t+Math.sqrt(t*t+1)):t}var o=r(0),i=Math.asinh;o(o.S+o.F*!(i&&1/i(0)>0),"Math",{asinh:n})},function(t,e,r){var n=r(0),o=Math.atanh;n(n.S+n.F*!(o&&1/o(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,r){var n=r(0),o=r(100);n(n.S,"Math",{cbrt:function(t){return o(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,r){var n=r(0);n(n.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,r){var n=r(0),o=Math.exp;n(n.S,"Math",{cosh:function(t){return(o(t=+t)+o(-t))/2}})},function(t,e,r){var n=r(0),o=r(99);n(n.S+n.F*(o!=Math.expm1),"Math",{expm1:o})},function(t,e,r){var n=r(0),o=r(100),i=Math.pow,a=i(2,-52),s=i(2,-23),u=i(2,127)*(2-s),c=i(2,-126),l=function(t){return t+1/a-1/a};n(n.S,"Math",{fround:function(t){var e,r,n=Math.abs(t),i=o(t);return nu||r!=r?i*(1/0):i*r)}})},function(t,e,r){var n=r(0),o=Math.abs;n(n.S,"Math",{hypot:function(t,e){for(var r,n,i=0,a=0,s=arguments.length,u=0;a0?(n=r/u,i+=n*n):i+=r;return u===1/0?1/0:u*Math.sqrt(i)}})},function(t,e,r){var n=r(0),o=Math.imul;n(n.S+n.F*r(6)(function(){return o(4294967295,5)!=-5||2!=o.length}),"Math",{imul:function(t,e){var r=65535,n=+t,o=+e,i=r&n,a=r&o;return 0|i*a+((r&n>>>16)*a+i*(r&o>>>16)<<16>>>0)}})},function(t,e,r){var n=r(0);n(n.S,"Math",{log10:function(t){return Math.log(t)/Math.LN10}})},function(t,e,r){var n=r(0);n(n.S,"Math",{log1p:r(146)})},function(t,e,r){var n=r(0);n(n.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,r){var n=r(0);n(n.S,"Math",{sign:r(100)})},function(t,e,r){var n=r(0),o=r(99),i=Math.exp;n(n.S+n.F*r(6)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(o(t)-o(-t))/2:(i(t-1)-i(-t-1))*(Math.E/2)}})},function(t,e,r){var n=r(0),o=r(99),i=Math.exp;n(n.S,"Math",{tanh:function(t){var e=o(t=+t),r=o(-t);return e==1/0?1:r==1/0?-1:(e-r)/(i(t)+i(-t))}})},function(t,e,r){var n=r(0);n(n.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,r){"use strict";var n=r(5),o=r(13),i=r(22),a=r(94),s=r(28),u=r(6),c=r(41).f,l=r(20).f,f=r(10).f,p=r(54).trim,h="Number",d=n[h],v=d,y=d.prototype,g=i(r(40)(y))==h,_="trim"in String.prototype,b=function(t){var e=s(t,!1);if("string"==typeof e&&e.length>2){e=_?e.trim():p(e,3);var r,n,o,i=e.charCodeAt(0);if(43===i||45===i){if(r=e.charCodeAt(2),88===r||120===r)return NaN}else if(48===i){switch(e.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+e}for(var a,u=e.slice(2),c=0,l=u.length;co)return NaN;return parseInt(u,n)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,r=this;return r instanceof d&&(g?u(function(){y.valueOf.call(r)}):i(r)!=h)?a(new v(b(e)),r,d):b(e)};for(var m,w=r(9)?c(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),x=0;w.length>x;x++)o(v,m=w[x])&&!o(d,m)&&f(d,m,l(v,m));d.prototype=y,y.constructor=d,r(16)(n,h,d)}},function(t,e,r){var n=r(0);n(n.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,r){var n=r(0),o=r(5).isFinite;n(n.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},function(t,e,r){var n=r(0);n(n.S,"Number",{isInteger:r(143)})},function(t,e,r){var n=r(0);n(n.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,r){var n=r(0),o=r(143),i=Math.abs;n(n.S,"Number",{isSafeInteger:function(t){return o(t)&&i(t)<=9007199254740991}})},function(t,e,r){var n=r(0);n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,r){var n=r(0);n(n.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,r){var n=r(0),o=r(153);n(n.S+n.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},function(t,e,r){var n=r(0),o=r(154);n(n.S+n.F*(Number.parseInt!=o),"Number",{parseInt:o})},function(t,e,r){"use strict";var n=r(0),o=r(37),i=r(134),a=r(107),s=1..toFixed,u=Math.floor,c=[0,0,0,0,0,0],l="Number.toFixed: incorrect invocation!",f="0",p=function(t,e){for(var r=-1,n=e;++r<6;)n+=t*c[r],c[r]=n%1e7,n=u(n/1e7)},h=function(t){for(var e=6,r=0;--e>=0;)r+=c[e],c[e]=u(r/t),r=r%t*1e7},d=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var r=String(c[t]);e=""===e?r:e+a.call(f,7-r.length)+r}return e},v=function(t,e,r){return 0===e?r:e%2===1?v(t,e-1,r*t):v(t*t,e/2,r)},y=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e};n(n.P+n.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!r(6)(function(){s.call({})})),"Number",{toFixed:function(t){var e,r,n,s,u=i(this,l),c=o(t),g="",_=f;if(c<0||c>20)throw RangeError(l);if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(g="-",u=-u),u>1e-21)if(e=y(u*v(2,69,1))-69,r=e<0?u*v(2,-e,1):u/v(2,e,1),r*=4503599627370496,e=52-e,e>0){for(p(0,r),n=c;n>=7;)p(1e7,0),n-=7;for(p(v(10,n,1),0),n=e-1;n>=23;)h(1<<23),n-=23;h(1<0?(s=_.length,_=g+(s<=c?"0."+a.call(f,c-s)+_:_.slice(0,s-c)+"."+_.slice(s-c))):_=g+_,_}})},function(t,e,r){"use strict";var n=r(0),o=r(6),i=r(134),a=1..toPrecision;n(n.P+n.F*(o(function(){return"1"!==a.call(1,void 0)})||!o(function(){a.call({})})),"Number",{toPrecision:function(t){var e=i(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},function(t,e,r){var n=r(0);n(n.S+n.F,"Object",{assign:r(147)})},function(t,e,r){var n=r(0);n(n.S,"Object",{create:r(40)})},function(t,e,r){var n=r(0);n(n.S+n.F*!r(9),"Object",{defineProperties:r(148)})},function(t,e,r){var n=r(0);n(n.S+n.F*!r(9),"Object",{defineProperty:r(10).f})},function(t,e,r){var n=r(7),o=r(35).onFreeze;r(27)("freeze",function(t){return function(e){return t&&n(e)?t(o(e)):e}})},function(t,e,r){var n=r(18),o=r(20).f;r(27)("getOwnPropertyDescriptor",function(){return function(t,e){return o(n(t),e)}})},function(t,e,r){r(27)("getOwnPropertyNames",function(){return r(149).f})},function(t,e,r){var n=r(12),o=r(21);r(27)("getPrototypeOf",function(){return function(t){return o(n(t))}})},function(t,e,r){var n=r(7);r(27)("isExtensible",function(t){return function(e){return!!n(e)&&(!t||t(e))}})},function(t,e,r){var n=r(7);r(27)("isFrozen",function(t){return function(e){return!n(e)||!!t&&t(e)}})},function(t,e,r){var n=r(7);r(27)("isSealed",function(t){return function(e){return!n(e)||!!t&&t(e)}})},function(t,e,r){var n=r(0);n(n.S,"Object",{is:r(155)})},function(t,e,r){var n=r(12),o=r(42);r(27)("keys",function(){return function(t){return o(n(t))}})},function(t,e,r){var n=r(7),o=r(35).onFreeze;r(27)("preventExtensions",function(t){return function(e){return t&&n(e)?t(o(e)):e}})},function(t,e,r){var n=r(7),o=r(35).onFreeze;r(27)("seal",function(t){return function(e){return t&&n(e)?t(o(e)):e}})},function(t,e,r){var n=r(0);n(n.S,"Object",{setPrototypeOf:r(102).set})},function(t,e,r){"use strict";var n=r(57),o={};o[r(8)("toStringTag")]="z",o+""!="[object z]"&&r(16)(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},function(t,e,r){var n=r(0),o=r(153);n(n.G+n.F*(parseFloat!=o),{parseFloat:o})},function(t,e,r){var n=r(0),o=r(154);n(n.G+n.F*(parseInt!=o),{parseInt:o})},function(t,e,r){"use strict";var n,o,i,a=r(39),s=r(5),u=r(31),c=r(57),l=r(0),f=r(7),p=r(14),h=r(38),d=r(51),v=r(104),y=r(109).set,g=r(101)(),_="Promise",b=s.TypeError,m=s.process,w=s[_],m=s.process,x="process"==c(m),O=function(){},j=!!function(){try{var t=w.resolve(1),e=(t.constructor={})[r(8)("species")]=function(t){t(O,O)};return(x||"function"==typeof PromiseRejectionEvent)&&t.then(O)instanceof e}catch(t){}}(),E=function(t,e){return t===e||t===w&&e===i},S=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},k=function(t){return E(w,t)?new P(t):new o(t)},P=o=function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw b("Bad Promise constructor");e=t,r=n}),this.resolve=p(e),this.reject=p(r)},A=function(t){try{t()}catch(t){return{error:t}}},C=function(t,e){if(!t._n){t._n=!0;var r=t._c;g(function(){for(var n=t._v,o=1==t._s,i=0,a=function(e){var r,i,a=o?e.ok:e.fail,s=e.resolve,u=e.reject,c=e.domain;try{a?(o||(2==t._h&&R(t),t._h=1),a===!0?r=n:(c&&c.enter(),r=a(n),c&&c.exit()),r===e.promise?u(b("Promise-chain cycle")):(i=S(r))?i.call(r,s,u):s(r)):u(n)}catch(t){u(t)}};r.length>i;)a(r[i++]);t._c=[],t._n=!1,e&&!t._h&&M(t)})}},M=function(t){y.call(s,function(){var e,r,n,o=t._v;if(T(t)&&(e=A(function(){x?m.emit("unhandledRejection",o,t):(r=s.onunhandledrejection)?r({promise:t,reason:o}):(n=s.console)&&n.error&&n.error("Unhandled promise rejection",o)}),t._h=x||T(t)?2:1),t._a=void 0,e)throw e.error})},T=function(t){if(1==t._h)return!1;for(var e,r=t._a||t._c,n=0;r.length>n;)if(e=r[n++],e.fail||!T(e.promise))return!1;return!0},R=function(t){y.call(s,function(){var e;x?m.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})})},F=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),C(e,!0))},I=function(t){var e,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw b("Promise can't be resolved itself");(e=S(t))?g(function(){var n={_w:r,_d:!1};try{e.call(t,u(I,n,1),u(F,n,1))}catch(t){F.call(n,t)}}):(r._v=t,r._s=1,C(r,!1))}catch(t){F.call({_w:r,_d:!1},t)}}};j||(w=function(t){h(this,w,_,"_h"),p(t),n.call(this);try{t(u(I,this,1),u(F,this,1))}catch(t){F.call(this,t)}},n=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},n.prototype=r(43)(w.prototype,{then:function(t,e){var r=k(v(this,w));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=x?m.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&C(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),P=function(){var t=new n;this.promise=t,this.resolve=u(I,t,1),this.reject=u(F,t,1)}),l(l.G+l.W+l.F*!j,{Promise:w}),r(53)(w,_),r(44)(_),i=r(30)[_],l(l.S+l.F*!j,_,{reject:function(t){var e=k(this),r=e.reject;return r(t),e.promise}}),l(l.S+l.F*(a||!j),_,{resolve:function(t){if(t instanceof w&&E(t.constructor,this))return t;var e=k(this),r=e.resolve;return r(t),e.promise}}),l(l.S+l.F*!(j&&r(72)(function(t){w.all(t).catch(O)})),_,{all:function(t){var e=this,r=k(e),n=r.resolve,o=r.reject,i=A(function(){var r=[],i=0,a=1;d(t,!1,function(t){var s=i++,u=!1;r.push(void 0),a++,e.resolve(t).then(function(t){u||(u=!0,r[s]=t,--a||n(r))},o)}),--a||n(r)});return i&&o(i.error),r.promise},race:function(t){var e=this,r=k(e),n=r.reject,o=A(function(){d(t,!1,function(t){e.resolve(t).then(r.resolve,n)})});return o&&n(o.error),r.promise}})},function(t,e,r){var n=r(0),o=r(14),i=r(2),a=(r(5).Reflect||{}).apply,s=Function.apply;n(n.S+n.F*!r(6)(function(){a(function(){})}),"Reflect",{apply:function(t,e,r){var n=o(t),u=i(r);return a?a(n,e,u):s.call(n,e,u); -}})},function(t,e,r){var n=r(0),o=r(40),i=r(14),a=r(2),s=r(7),u=r(6),c=r(138),l=(r(5).Reflect||{}).construct,f=u(function(){function t(){}return!(l(function(){},[],t)instanceof t)}),p=!u(function(){l(function(){})});n(n.S+n.F*(f||p),"Reflect",{construct:function(t,e){i(t),a(e);var r=arguments.length<3?t:i(arguments[2]);if(p&&!f)return l(t,e,r);if(t==r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(c.apply(t,n))}var u=r.prototype,h=o(s(u)?u:Object.prototype),d=Function.apply.call(t,h,e);return s(d)?d:h}})},function(t,e,r){var n=r(10),o=r(0),i=r(2),a=r(28);o(o.S+o.F*r(6)(function(){Reflect.defineProperty(n.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,r){i(t),e=a(e,!0),i(r);try{return n.f(t,e,r),!0}catch(t){return!1}}})},function(t,e,r){var n=r(0),o=r(20).f,i=r(2);n(n.S,"Reflect",{deleteProperty:function(t,e){var r=o(i(t),e);return!(r&&!r.configurable)&&delete t[e]}})},function(t,e,r){"use strict";var n=r(0),o=r(2),i=function(t){this._t=o(t),this._i=0;var e,r=this._k=[];for(e in t)r.push(e)};r(97)(i,"Object",function(){var t,e=this,r=e._k;do if(e._i>=r.length)return{value:void 0,done:!0};while(!((t=r[e._i++])in e._t));return{value:t,done:!1}}),n(n.S,"Reflect",{enumerate:function(t){return new i(t)}})},function(t,e,r){var n=r(20),o=r(0),i=r(2);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return n.f(i(t),e)}})},function(t,e,r){var n=r(0),o=r(21),i=r(2);n(n.S,"Reflect",{getPrototypeOf:function(t){return o(i(t))}})},function(t,e,r){function n(t,e){var r,s,l=arguments.length<3?t:arguments[2];return c(t)===l?t[e]:(r=o.f(t,e))?a(r,"value")?r.value:void 0!==r.get?r.get.call(l):void 0:u(s=i(t))?n(s,e,l):void 0}var o=r(20),i=r(21),a=r(13),s=r(0),u=r(7),c=r(2);s(s.S,"Reflect",{get:n})},function(t,e,r){var n=r(0);n(n.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,r){var n=r(0),o=r(2),i=Object.isExtensible;n(n.S,"Reflect",{isExtensible:function(t){return o(t),!i||i(t)}})},function(t,e,r){var n=r(0);n(n.S,"Reflect",{ownKeys:r(152)})},function(t,e,r){var n=r(0),o=r(2),i=Object.preventExtensions;n(n.S,"Reflect",{preventExtensions:function(t){o(t);try{return i&&i(t),!0}catch(t){return!1}}})},function(t,e,r){var n=r(0),o=r(102);o&&n(n.S,"Reflect",{setPrototypeOf:function(t,e){o.check(t,e);try{return o.set(t,e),!0}catch(t){return!1}}})},function(t,e,r){function n(t,e,r){var u,p,h=arguments.length<4?t:arguments[3],d=i.f(l(t),e);if(!d){if(f(p=a(t)))return n(p,e,r,h);d=c(0)}return s(d,"value")?!(d.writable===!1||!f(h))&&(u=i.f(h,e)||c(0),u.value=r,o.f(h,e,u),!0):void 0!==d.set&&(d.set.call(h,r),!0)}var o=r(10),i=r(20),a=r(21),s=r(13),u=r(0),c=r(36),l=r(2),f=r(7);u(u.S,"Reflect",{set:n})},function(t,e,r){var n=r(5),o=r(94),i=r(10).f,a=r(41).f,s=r(71),u=r(69),c=n.RegExp,l=c,f=c.prototype,p=/a/g,h=/a/g,d=new c(p)!==p;if(r(9)&&(!d||r(6)(function(){return h[r(8)("match")]=!1,c(p)!=p||c(h)==h||"/a/i"!=c(p,"i")}))){c=function(t,e){var r=this instanceof c,n=s(t),i=void 0===e;return!r&&n&&t.constructor===c&&i?t:o(d?new l(n&&!i?t.source:t,e):l((n=t instanceof c)?t.source:t,n&&i?u.call(t):e),r?this:f,c)};for(var v=(function(t){t in c||i(c,t,{configurable:!0,get:function(){return l[t]},set:function(e){l[t]=e}})}),y=a(l),g=0;y.length>g;)v(y[g++]);f.constructor=c,c.prototype=f,r(16)(n,"RegExp",c)}r(44)("RegExp")},function(t,e,r){r(68)("match",1,function(t,e,r){return[function(r){"use strict";var n=t(this),o=void 0==r?void 0:r[e];return void 0!==o?o.call(r,n):new RegExp(r)[e](String(n))},r]})},function(t,e,r){r(68)("replace",2,function(t,e,r){return[function(n,o){"use strict";var i=t(this),a=void 0==n?void 0:n[e];return void 0!==a?a.call(n,i,o):r.call(String(i),n,o)},r]})},function(t,e,r){r(68)("search",1,function(t,e,r){return[function(r){"use strict";var n=t(this),o=void 0==r?void 0:r[e];return void 0!==o?o.call(r,n):new RegExp(r)[e](String(n))},r]})},function(t,e,r){r(68)("split",2,function(t,e,n){"use strict";var o=r(71),i=n,a=[].push,s="split",u="length",c="lastIndex";if("c"=="abbc"[s](/(b)*/)[1]||4!="test"[s](/(?:)/,-1)[u]||2!="ab"[s](/(?:ab)*/)[u]||4!="."[s](/(.?)(.?)/)[u]||"."[s](/()()/)[u]>1||""[s](/.?/)[u]){var l=void 0===/()??/.exec("")[1];n=function(t,e){var r=String(this);if(void 0===t&&0===e)return[];if(!o(t))return i.call(r,t,e);var n,s,f,p,h,d=[],v=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),y=0,g=void 0===e?4294967295:e>>>0,_=new RegExp(t.source,v+"g");for(l||(n=new RegExp("^"+_.source+"$(?!\\s)",v));(s=_.exec(r))&&(f=s.index+s[0][u],!(f>y&&(d.push(r.slice(y,s.index)),!l&&s[u]>1&&s[0].replace(n,function(){for(h=1;h1&&s.index=g)));)_[c]===s.index&&_[c]++;return y===r[u]?!p&&_.test("")||d.push(""):d.push(r.slice(y)),d[u]>g?d.slice(0,g):d}}else"0"[s](void 0,0)[u]&&(n=function(t,e){return void 0===t&&0===e?[]:i.call(this,t,e)});return[function(r,o){var i=t(this),a=void 0==r?void 0:r[e];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},n]})},function(t,e,r){"use strict";r(159);var n=r(2),o=r(69),i=r(9),a="toString",s=/./[a],u=function(t){r(16)(RegExp.prototype,a,t,!0)};r(6)(function(){return"/a/b"!=s.call({source:"a",flags:"b"})})?u(function(){var t=n(this);return"/".concat(t.source,"/","flags"in t?t.flags:!i&&t instanceof RegExp?o.call(t):void 0)}):s.name!=a&&u(function(){return s.call(this)})},function(t,e,r){"use strict";r(17)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(t,e,r){"use strict";r(17)("big",function(t){return function(){return t(this,"big","","")}})},function(t,e,r){"use strict";r(17)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,e,r){"use strict";r(17)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,e,r){"use strict";var n=r(0),o=r(105)(!1);n(n.P,"String",{codePointAt:function(t){return o(this,t)}})},function(t,e,r){"use strict";var n=r(0),o=r(11),i=r(106),a="endsWith",s=""[a];n(n.P+n.F*r(92)(a),"String",{endsWith:function(t){var e=i(this,t,a),r=arguments.length>1?arguments[1]:void 0,n=o(e.length),u=void 0===r?n:Math.min(o(r),n),c=String(t);return s?s.call(e,c,u):e.slice(u-c.length,u)===c}})},function(t,e,r){"use strict";r(17)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,e,r){"use strict";r(17)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(t,e,r){"use strict";r(17)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(t,e,r){var n=r(0),o=r(45),i=String.fromCharCode,a=String.fromCodePoint;n(n.S+n.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,r=[],n=arguments.length,a=0;n>a;){if(e=+arguments[a++],o(e,1114111)!==e)throw RangeError(e+" is not a valid code point");r.push(e<65536?i(e):i(((e-=65536)>>10)+55296,e%1024+56320))}return r.join("")}})},function(t,e,r){"use strict";var n=r(0),o=r(106),i="includes";n(n.P+n.F*r(92)(i),"String",{includes:function(t){return!!~o(this,t,i).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){"use strict";r(17)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,e,r){"use strict";var n=r(105)(!0);r(98)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){"use strict";r(17)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(t,e,r){var n=r(0),o=r(18),i=r(11);n(n.S,"String",{raw:function(t){for(var e=o(t.raw),r=i(e.length),n=arguments.length,a=[],s=0;r>s;)a.push(String(e[s++])),s1?arguments[1]:void 0,e.length)),n=String(t);return s?s.call(e,n,r):e.slice(r,r+n.length)===n}})},function(t,e,r){"use strict";r(17)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,e,r){"use strict";r(17)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,e,r){"use strict";r(17)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,e,r){"use strict";r(54)("trim",function(t){return function(){return t(this,3)}})},function(t,e,r){"use strict";var n=r(5),o=r(13),i=r(9),a=r(0),s=r(16),u=r(35).KEY,c=r(6),l=r(75),f=r(53),p=r(46),h=r(8),d=r(157),v=r(111),y=r(256),g=r(255),_=r(96),b=r(2),m=r(18),w=r(28),x=r(36),O=r(40),j=r(149),E=r(20),S=r(10),k=r(42),P=E.f,A=S.f,C=j.f,M=n.Symbol,T=n.JSON,R=T&&T.stringify,F="prototype",I=h("_hidden"),D=h("toPrimitive"),L={}.propertyIsEnumerable,N=l("symbol-registry"),U=l("symbols"),B=l("op-symbols"),V=Object[F],W="function"==typeof M,z=n.QObject,q=!z||!z[F]||!z[F].findChild,G=i&&c(function(){return 7!=O(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,e,r){var n=P(V,e);n&&delete V[e],A(t,e,r),n&&t!==V&&A(V,e,n)}:A,H=function(t){var e=U[t]=O(M[F]);return e._k=t,e},Y=W&&"symbol"==typeof M.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof M},$=function(t,e,r){return t===V&&$(B,e,r),b(t),e=w(e,!0),b(r),o(U,e)?(r.enumerable?(o(t,I)&&t[I][e]&&(t[I][e]=!1),r=O(r,{enumerable:x(0,!1)})):(o(t,I)||A(t,I,x(1,{})),t[I][e]=!0),G(t,e,r)):A(t,e,r)},K=function(t,e){b(t);for(var r,n=g(e=m(e)),o=0,i=n.length;i>o;)$(t,r=n[o++],e[r]);return t},X=function(t,e){return void 0===e?O(t):K(O(t),e)},Z=function(t){var e=L.call(this,t=w(t,!0));return!(this===V&&o(U,t)&&!o(B,t))&&(!(e||!o(this,t)||!o(U,t)||o(this,I)&&this[I][t])||e)},Q=function(t,e){if(t=m(t),e=w(e,!0),t!==V||!o(U,e)||o(B,e)){var r=P(t,e);return!r||!o(U,e)||o(t,I)&&t[I][e]||(r.enumerable=!0),r}},J=function(t){for(var e,r=C(m(t)),n=[],i=0;r.length>i;)o(U,e=r[i++])||e==I||e==u||n.push(e);return n},tt=function(t){for(var e,r=t===V,n=C(r?B:m(t)),i=[],a=0;n.length>a;)!o(U,e=n[a++])||r&&!o(V,e)||i.push(U[e]);return i};W||(M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(r){this===V&&e.call(B,r),o(this,I)&&o(this[I],t)&&(this[I][t]=!1),G(this,t,x(1,r))};return i&&q&&G(V,t,{configurable:!0,set:e}),H(t)},s(M[F],"toString",function(){return this._k}),E.f=Q,S.f=$,r(41).f=j.f=J,r(59).f=Z,r(74).f=tt,i&&!r(39)&&s(V,"propertyIsEnumerable",Z,!0),d.f=function(t){return H(h(t))}),a(a.G+a.W+a.F*!W,{Symbol:M});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;et.length>rt;)h(et[rt++]);for(var et=k(h.store),rt=0;et.length>rt;)v(et[rt++]);a(a.S+a.F*!W,"Symbol",{for:function(t){return o(N,t+="")?N[t]:N[t]=M(t)},keyFor:function(t){if(Y(t))return y(N,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){q=!0},useSimple:function(){q=!1}}),a(a.S+a.F*!W,"Object",{create:X,defineProperty:$,defineProperties:K,getOwnPropertyDescriptor:Q,getOwnPropertyNames:J,getOwnPropertySymbols:tt}),T&&a(a.S+a.F*(!W||c(function(){var t=M();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!Y(t)){for(var e,r,n=[t],o=1;arguments.length>o;)n.push(arguments[o++]);return e=n[1],"function"==typeof e&&(r=e),!r&&_(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!Y(e))return e}),n[1]=e,R.apply(T,n)}}}),M[F][D]||r(15)(M[F],D,M[F].valueOf),f(M,"Symbol"),f(Math,"Math",!0),f(n.JSON,"JSON",!0)},function(t,e,r){"use strict";var n=r(0),o=r(76),i=r(110),a=r(2),s=r(45),u=r(11),c=r(7),l=r(5).ArrayBuffer,f=r(104),p=i.ArrayBuffer,h=i.DataView,d=o.ABV&&l.isView,v=p.prototype.slice,y=o.VIEW,g="ArrayBuffer";n(n.G+n.W+n.F*(l!==p),{ArrayBuffer:p}),n(n.S+n.F*!o.CONSTR,g,{isView:function(t){return d&&d(t)||c(t)&&y in t}}),n(n.P+n.U+n.F*r(6)(function(){return!new p(2).slice(1,void 0).byteLength}),g,{slice:function(t,e){if(void 0!==v&&void 0===e)return v.call(a(this),t);for(var r=a(this).byteLength,n=s(t,r),o=s(void 0===e?r:e,r),i=new(f(this,p))(u(o-n)),c=new h(this),l=new h(i),d=0;n0?arguments[0]:void 0)}},{add:function(t){return n.def(this,t,!0)}},n,!1,!0)},function(t,e,r){"use strict";var n=r(0),o=r(66)(!0);n(n.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),r(50)("includes")},function(t,e,r){var n=r(0),o=r(101)(),i=r(5).process,a="process"==r(22)(i);n(n.G,{asap:function(t){var e=a&&i.domain;o(e?e.bind(t):t)}})},function(t,e,r){var n=r(0),o=r(22);n(n.S,"Error",{isError:function(t){return"Error"===o(t)}})},function(t,e,r){var n=r(0);n(n.P+n.R,"Map",{toJSON:r(140)("Map")})},function(t,e,r){var n=r(0);n(n.S,"Math",{iaddh:function(t,e,r,n){var o=t>>>0,i=e>>>0,a=r>>>0;return i+(n>>>0)+((o&a|(o|a)&~(o+a>>>0))>>>31)|0}})},function(t,e,r){var n=r(0);n(n.S,"Math",{imulh:function(t,e){var r=65535,n=+t,o=+e,i=n&r,a=o&r,s=n>>16,u=o>>16,c=(s*a>>>0)+(i*a>>>16);return s*u+(c>>16)+((i*u>>>0)+(c&r)>>16)}})},function(t,e,r){var n=r(0);n(n.S,"Math",{isubh:function(t,e,r,n){var o=t>>>0,i=e>>>0,a=r>>>0;return i-(n>>>0)-((~o&a|~(o^a)&o-a>>>0)>>>31)|0}})},function(t,e,r){var n=r(0);n(n.S,"Math",{umulh:function(t,e){var r=65535,n=+t,o=+e,i=n&r,a=o&r,s=n>>>16,u=o>>>16,c=(s*a>>>0)+(i*a>>>16);return s*u+(c>>>16)+((i*u>>>0)+(c&r)>>>16)}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(14),a=r(10);r(9)&&n(n.P+r(73),"Object",{__defineGetter__:function(t,e){a.f(o(this),t,{get:i(e),enumerable:!0,configurable:!0})}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(14),a=r(10);r(9)&&n(n.P+r(73),"Object",{__defineSetter__:function(t,e){a.f(o(this),t,{set:i(e),enumerable:!0,configurable:!0})}})},function(t,e,r){var n=r(0),o=r(151)(!0);n(n.S,"Object",{entries:function(t){return o(t)}})},function(t,e,r){var n=r(0),o=r(152),i=r(18),a=r(20),s=r(89);n(n.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,r=i(t),n=a.f,u=o(r),c={},l=0;u.length>l;)s(c,e=u[l++],n(r,e));return c}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(28),a=r(21),s=r(20).f;r(9)&&n(n.P+r(73),"Object",{__lookupGetter__:function(t){var e,r=o(this),n=i(t,!0);do if(e=s(r,n))return e.get;while(r=a(r))}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(28),a=r(21),s=r(20).f;r(9)&&n(n.P+r(73),"Object",{__lookupSetter__:function(t){var e,r=o(this),n=i(t,!0);do if(e=s(r,n))return e.set;while(r=a(r))}})},function(t,e,r){var n=r(0),o=r(151)(!1);n(n.S,"Object",{values:function(t){return o(t)}})},function(t,e,r){"use strict";var n=r(0),o=r(5),i=r(30),a=r(101)(),s=r(8)("observable"),u=r(14),c=r(2),l=r(38),f=r(43),p=r(15),h=r(51),d=h.RETURN,v=function(t){return null==t?void 0:u(t)},y=function(t){var e=t._c;e&&(t._c=void 0,e())},g=function(t){return void 0===t._o},_=function(t){g(t)||(t._o=void 0,y(t))},b=function(t,e){c(t),this._c=void 0,this._o=t,t=new m(this);try{var r=e(t),n=r;null!=r&&("function"==typeof r.unsubscribe?r=function(){n.unsubscribe()}:u(r),this._c=r)}catch(e){return void t.error(e)}g(this)&&y(this)};b.prototype=f({},{unsubscribe:function(){_(this)}});var m=function(t){this._s=t};m.prototype=f({},{next:function(t){var e=this._s;if(!g(e)){var r=e._o;try{var n=v(r.next);if(n)return n.call(r,t)}catch(t){try{_(e)}finally{throw t}}}},error:function(t){var e=this._s;if(g(e))throw t;var r=e._o;e._o=void 0;try{var n=v(r.error);if(!n)throw t;t=n.call(r,t)}catch(t){try{y(e)}finally{throw t}}return y(e),t},complete:function(t){var e=this._s;if(!g(e)){var r=e._o;e._o=void 0;try{var n=v(r.complete);t=n?n.call(r,t):void 0}catch(t){try{y(e)}finally{throw t}}return y(e),t}}});var w=function(t){l(this,w,"Observable","_f")._f=u(t)};f(w.prototype,{subscribe:function(t){return new b(t,this._f)},forEach:function(t){var e=this;return new(i.Promise||o.Promise)(function(r,n){u(t);var o=e.subscribe({next:function(e){try{return t(e)}catch(t){n(t),o.unsubscribe()}},error:n,complete:r})})}}),f(w,{from:function(t){var e="function"==typeof this?this:w,r=v(c(t)[s]);if(r){var n=c(r.call(t));return n.constructor===e?n:new e(function(t){return n.subscribe(t)})}return new e(function(e){var r=!1;return a(function(){if(!r){try{if(h(t,!1,function(t){if(e.next(t),r)return d})===d)return}catch(t){if(r)throw t;return void e.error(t)}e.complete()}}),function(){r=!0}})},of:function(){for(var t=0,e=arguments.length,r=Array(e);t1?arguments[1]:void 0,!1)}})},function(t,e,r){"use strict";var n=r(0),o=r(156);n(n.P,"String",{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,e,r){"use strict";r(54)("trimLeft",function(t){return function(){return t(this,1)}},"trimStart")},function(t,e,r){"use strict";r(54)("trimRight",function(t){return function(){return t(this,2)}},"trimEnd")},function(t,e,r){r(111)("asyncIterator")},function(t,e,r){r(111)("observable")},function(t,e,r){var n=r(0);n(n.S,"System",{global:r(5)})},function(t,e,r){for(var n=r(113),o=r(16),i=r(5),a=r(15),s=r(52),u=r(8),c=u("iterator"),l=u("toStringTag"),f=s.Array,p=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],h=0;h<5;h++){var d,v=p[h],y=i[v],g=y&&y.prototype;if(g){g[c]||a(g,c,f),g[l]||a(g,l,v),s[v]=f;for(d in n)g[d]||o(g,d,n[d],!0)}}},function(t,e,r){var n=r(0),o=r(109);n(n.G+n.B,{setImmediate:o.set,clearImmediate:o.clear})},function(t,e,r){var n=r(5),o=r(0),i=r(70),a=r(257),s=n.navigator,u=!!s&&/MSIE .\./.test(s.userAgent),c=function(t){return u?function(e,r){return t(i(a,[].slice.call(arguments,2),"function"==typeof e?e:Function(e)),r)}:t};o(o.G+o.B+o.F*u,{setTimeout:c(n.setTimeout),setInterval:c(n.setInterval)})},function(t,e,r){r(380),r(319),r(321),r(320),r(323),r(325),r(330),r(324),r(322),r(332),r(331),r(327),r(328),r(326),r(318),r(329),r(333),r(334),r(286),r(288),r(287),r(336),r(335),r(306),r(316),r(317),r(307),r(308),r(309),r(310),r(311),r(312),r(313),r(314),r(315),r(289),r(290),r(291),r(292),r(293),r(294),r(295),r(296),r(297),r(298),r(299),r(300),r(301),r(302),r(303),r(304),r(305),r(367),r(372),r(379),r(370),r(362),r(363),r(368),r(373),r(375),r(358),r(359),r(360),r(361),r(364),r(365),r(366),r(369),r(371),r(374),r(376),r(377),r(378),r(281),r(283),r(282),r(285),r(284),r(270),r(268),r(274),r(271),r(277),r(279),r(267),r(273),r(264),r(278),r(262),r(276),r(275),r(269),r(272),r(261),r(263),r(266),r(265),r(280),r(113),r(352),r(357),r(159),r(353),r(354),r(355),r(356),r(337),r(158),r(160),r(161),r(392),r(381),r(382),r(387),r(390),r(391),r(385),r(388),r(386),r(389),r(383),r(384),r(338),r(339),r(340),r(341),r(342),r(345),r(343),r(344),r(346),r(347),r(348),r(349),r(351),r(350),r(393),r(419),r(422),r(421),r(423),r(424),r(420),r(425),r(426),r(404),r(407),r(403),r(401),r(402),r(405),r(406),r(396),r(418),r(427),r(395),r(397),r(399),r(398),r(400),r(409),r(410),r(412),r(411),r(414),r(413),r(415),r(416),r(417),r(394),r(408),r(430),r(429),r(428),t.exports=r(30)},function(t,e,r){"use strict";function n(t,e,r){var n,o,i=t.length,a=e.arrayArgs.length,s=e.indexArgs.length>0,u=[],c=[],l=0,f=0;for(n=0;n=0;--n)l=t[n],u.push(["for(i",n,"=0;i",n,"0&&u.push(["index[",f,"]-=s",f].join("")),u.push(["++index[",l,"]"].join(""))),u.push("}")}return u.join("\n")}function o(t,e,r,o){for(var i=e.length,a=r.arrayArgs.length,s=r.blockSize,u=r.indexArgs.length>0,c=[],l=0;l0;){"].join("")),c.push(["if(j",l,"<",s,"){"].join("")),c.push(["s",e[l],"=j",l].join("")),c.push(["j",l,"=0"].join("")),c.push(["}else{s",e[l],"=",s].join("")),c.push(["j",l,"-=",s,"}"].join("")),u&&c.push(["index[",e[l],"]=j",l].join(""));for(var l=0;l0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}function u(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,u=new Array(t.arrayArgs.length),l=new Array(t.arrayArgs.length),f=0;f0&&w.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var x=new Array(r),f=0;f3&&m.push(a(t.pre,t,l));var S=a(t.body,t,l),k=i(y);k3&&m.push(a(t.post,t,l)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+m.join("\n")+"\n----------");var P=[t.funcName||"unnamed","_cwise_loop_",u[0].join("s"),"m",k,s(l)].join(""),A=new Function(["function ",P,"(",b.join(","),"){",m.join("\n"),"} return ",P].join(""));return A()}var c=r(188);t.exports=u},function(t,e,r){"use strict";function n(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],a=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],u=[],c=[],l=0;l0&&(u.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[l]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[l])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var l=0;l=0){var c=_[u],l=h(n);l&j&&(c.lvalue=!0),l&E&&(c.rvalue=!0),++c.count,s(n,c.name)}else i(a)||s(n,e(a))}else if("Literal"===n.type)"string"==typeof n.value&&s(n,f(n.value));else{if("WithStatement"===n.type)throw new Error("cwise-parser: with() statements not allowed");for(var p=Object.keys(n),d=0,v=p.length;d=48&&t<=57}function n(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function o(t){return"01234567".indexOf(t)>=0}function i(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function a(t){return 10===t||13===t||8232===t||8233===t}function s(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&ie.NonAsciiIdentifierStart.test(String.fromCharCode(t))}function u(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&ie.NonAsciiIdentifierPart.test(String.fromCharCode(t))}function c(t){switch(t){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function l(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function f(t){return"eval"===t||"arguments"===t}function p(t){if(ue&&l(t))return!0;switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}}function h(t,r,n,o,i){var a;e("number"==typeof n,"Comment must have valid position"),ve.lastCommentStart>=n||(ve.lastCommentStart=n,a={type:t,value:r},ye.range&&(a.range=[n,o]),ye.loc&&(a.loc=i),ye.comments.push(a),ye.attachComment&&(ye.leadingComments.push(a),ye.trailingComments.push(a)))}function d(t){var e,r,n,o;for(e=ce-t,r={start:{line:le,column:ce-fe-t}};ce=pe&&V({},oe.UnexpectedToken,"ILLEGAL");else if(42===r){if(47===se.charCodeAt(ce+1))return++ce,++ce,void(ye.comments&&(n=se.slice(t+2,ce-2),e.end={line:le,column:ce-fe},h("Block",n,t,ce,e)));++ce}else++ce;V({},oe.UnexpectedToken,"ILLEGAL")}function y(){var t,e;for(e=0===ce;ce>>="===n?(ce+=4,{type:Jt.Punctuator,value:n,lineNumber:le,lineStart:fe,start:o,end:ce}):(r=n.substr(0,3),">>>"===r||"<<="===r||">>="===r?(ce+=3,{type:Jt.Punctuator,value:r,lineNumber:le,lineStart:fe,start:o,end:ce}):(e=r.substr(0,2),a===e[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?(ce+=2,{type:Jt.Punctuator,value:e,lineNumber:le,lineStart:fe,start:o,end:ce}):"<>=!+-*%&|^/".indexOf(a)>=0?(++ce,{type:Jt.Punctuator,value:a,lineNumber:le,lineStart:fe,start:o,end:ce}):void V({},oe.UnexpectedToken,"ILLEGAL")))}function x(t){for(var e="";ce=0&&ce0&&(n=ye.tokens[ye.tokens.length-1],n.range[0]===t&&"Punctuator"===n.type&&("/"!==n.value&&"/="!==n.value||ye.tokens.pop())),ye.tokens.push({type:"RegularExpression",value:r.literal,range:[t,ce],loc:e})),r}function T(t){return t.type===Jt.Identifier||t.type===Jt.Keyword||t.type===Jt.BooleanLiteral||t.type===Jt.NullLiteral}function R(){var t,e;if(t=ye.tokens[ye.tokens.length-1],!t)return M();if("Punctuator"===t.type){if("]"===t.value)return w();if(")"===t.value)return e=ye.tokens[ye.openParenToken-1],!e||"Keyword"!==e.type||"if"!==e.value&&"while"!==e.value&&"for"!==e.value&&"with"!==e.value?w():M();if("}"===t.value){if(ye.tokens[ye.openCurlyToken-3]&&"Keyword"===ye.tokens[ye.openCurlyToken-3].type){if(e=ye.tokens[ye.openCurlyToken-4],!e)return w()}else{if(!ye.tokens[ye.openCurlyToken-4]||"Keyword"!==ye.tokens[ye.openCurlyToken-4].type)return w();if(e=ye.tokens[ye.openCurlyToken-5],!e)return M()}return ee.indexOf(e.value)>=0?w():M()}return M()}return"Keyword"===t.type&&"this"!==t.value?M():w()}function F(){var t;return y(),ce>=pe?{type:Jt.EOF,lineNumber:le,lineStart:fe,start:ce,end:ce}:(t=se.charCodeAt(ce),s(t)?m():40===t||41===t||59===t?w():39===t||34===t?S():46===t?r(se.charCodeAt(ce+1))?E():w():r(t)?E():ye.tokenize&&47===t?R():w())}function I(){var t,e,r;return y(),t={start:{line:le,column:ce-fe}},e=F(),t.end={line:le,column:ce-fe},e.type!==Jt.EOF&&(r=se.slice(e.start,e.end),ye.tokens.push({type:te[e.type],value:r,range:[e.start,e.end],loc:t})),e}function D(){var t;return t=de,ce=t.end,le=t.lineNumber,fe=t.lineStart,de="undefined"!=typeof ye.tokens?I():F(),ce=t.end,le=t.lineNumber,fe=t.lineStart,t}function L(){var t,e,r;t=ce,e=le,r=fe,de="undefined"!=typeof ye.tokens?I():F(),ce=t,le=e,fe=r}function N(t,e){this.line=t,this.column=e}function U(t,e,r,n){this.start=new N(t,e),this.end=new N(r,n)}function B(){var t,e,r,n;return t=ce,e=le,r=fe,y(),n=le!==e,ce=t,le=e,fe=r,n}function V(t,r){var n,o=Array.prototype.slice.call(arguments,2),i=r.replace(/%(\d)/g,function(t,r){return e(r>="===t||">>>="===t||"&="===t||"^="===t||"|="===t)}function K(){var t,e=ce,r=le,n=fe,o=de;return 59===se.charCodeAt(ce)||H(";")?void D():(t=le,y(),le!==t?(ce=e,le=r,fe=n,void(de=o)):void(de.type===Jt.EOF||H("}")||z(de)))}function X(t){return t.type===re.Identifier||t.type===re.MemberExpression}function Z(){var t,e=[];for(t=de,q("[");!H("]");)H(",")?(D(),e.push(null)):(e.push(yt()),H("]")||q(","));return D(),he.markEnd(he.createArrayExpression(e),t)}function Q(t,e){var r,n,o;return r=ue,o=de,n=zt(),e&&ue&&f(t[0].name)&&W(e,oe.StrictParamName),ue=r,he.markEnd(he.createFunctionExpression(null,t,[],n),o)}function J(){var t,e;return e=de,t=D(),t.type===Jt.StringLiteral||t.type===Jt.NumericLiteral?(ue&&t.octal&&W(t,oe.StrictOctalLiteral),he.markEnd(he.createLiteral(t),e)):he.markEnd(he.createIdentifier(t.value),e)}function tt(){var t,e,r,n,o,i;return t=de,i=de,t.type===Jt.Identifier?(r=J(),"get"!==t.value||H(":")?"set"!==t.value||H(":")?(q(":"),n=yt(),he.markEnd(he.createProperty("init",r,n),i)):(e=J(),q("("),t=de,t.type!==Jt.Identifier?(q(")"),W(t,oe.UnexpectedToken,t.value),n=Q([])):(o=[mt()],q(")"),n=Q(o,t)),he.markEnd(he.createProperty("set",e,n),i)):(e=J(),q("("),q(")"),n=Q([]),he.markEnd(he.createProperty("get",e,n),i))):t.type!==Jt.EOF&&t.type!==Jt.Punctuator?(e=J(),q(":"),n=yt(),he.markEnd(he.createProperty("init",e,n),i)):void z(t)}function et(){var t,e,r,n,o,i=[],a={},s=String;for(o=de,q("{");!H("}");)t=tt(),e=t.key.type===re.Identifier?t.key.name:s(t.key.value),n="init"===t.kind?ne.Data:"get"===t.kind?ne.Get:ne.Set,r="$"+e,Object.prototype.hasOwnProperty.call(a,r)?(a[r]===ne.Data?ue&&n===ne.Data?W({},oe.StrictDuplicateProperty):n!==ne.Data&&W({},oe.AccessorDataProperty):n===ne.Data?W({},oe.AccessorDataProperty):a[r]&n&&W({},oe.AccessorGetSet),a[r]|=n):a[r]=n,i.push(t),H("}")||q(",");return q("}"),he.markEnd(he.createObjectExpression(i),o)}function rt(){var t;return q("("),t=gt(),q(")"),t}function nt(){var t,e,r,n;if(H("("))return rt();if(H("["))return Z();if(H("{"))return et();if(t=de.type,n=de,t===Jt.Identifier)r=he.createIdentifier(D().value);else if(t===Jt.StringLiteral||t===Jt.NumericLiteral)ue&&de.octal&&W(de,oe.StrictOctalLiteral),r=he.createLiteral(D());else if(t===Jt.Keyword){if(Y("function"))return Ht();Y("this")?(D(),r=he.createThisExpression()):z(D())}else t===Jt.BooleanLiteral?(e=D(),e.value="true"===e.value,r=he.createLiteral(e)):t===Jt.NullLiteral?(e=D(),e.value=null,r=he.createLiteral(e)):H("/")||H("/=")?(r="undefined"!=typeof ye.tokens?he.createLiteral(M()):he.createLiteral(C()),L()):z(D());return he.markEnd(r,n)}function ot(){var t=[];if(q("("),!H(")"))for(;ce":case"<=":case">=":case"instanceof":r=7;break;case"in":r=e?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11}return r}function dt(){var t,e,r,n,o,i,a,s,u,c;if(t=de,u=pt(),n=de,o=ht(n,ve.allowIn),0===o)return u;for(n.prec=o,D(),e=[t,de],a=pt(),i=[u,n,a];(o=ht(de,ve.allowIn))>0;){for(;i.length>2&&o<=i[i.length-2].prec;)a=i.pop(),s=i.pop().value,u=i.pop(),r=he.createBinaryExpression(s,u,a),e.pop(),t=e[e.length-1],he.markEnd(r,t),i.push(r);n=D(),n.prec=o,i.push(n),e.push(de),r=pt(),i.push(r)}for(c=i.length-1,r=i[c],e.pop();c>1;)r=he.createBinaryExpression(i[c-1].value,i[c-2],r),c-=2,t=e.pop(),he.markEnd(r,t);return r}function vt(){var t,e,r,n,o;return o=de,t=dt(),H("?")&&(D(),e=ve.allowIn,ve.allowIn=!0,r=yt(),ve.allowIn=e,q(":"),n=yt(),t=he.createConditionalExpression(t,r,n),he.markEnd(t,o)),t}function yt(){var t,e,r,n,o;return t=de,o=de,n=e=vt(),$()&&(X(e)||W({},oe.InvalidLHSInAssignment),ue&&e.type===re.Identifier&&f(e.name)&&W(t,oe.StrictLHSAssignment),t=D(),r=yt(),n=he.markEnd(he.createAssignmentExpression(t.value,e,r),o)),n}function gt(){var t,e=de;if(t=yt(),H(",")){for(t=he.createSequenceExpression([t]);ce0?1:0,fe=0,pe=se.length,de=null,ve={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},ye={},e=e||{},e.tokens=!0,ye.tokens=[],ye.tokenize=!0,ye.openParenToken=-1,ye.openCurlyToken=-1,ye.range="boolean"==typeof e.range&&e.range,ye.loc="boolean"==typeof e.loc&&e.loc,"boolean"==typeof e.comment&&e.comment&&(ye.comments=[]),"boolean"==typeof e.tolerant&&e.tolerant&&(ye.errors=[]);try{if(L(),de.type===Jt.EOF)return ye.tokens;for(n=D();de.type!==Jt.EOF;)try{n=D()}catch(t){if(n=de,ye.errors){ye.errors.push(t);break}throw t}Xt(),o=ye.tokens,"undefined"!=typeof ye.comments&&(o.comments=ye.comments),"undefined"!=typeof ye.errors&&(o.errors=ye.errors)}catch(t){throw t}finally{ye={}}return o}function Qt(t,e){var r,n;n=String,"string"==typeof t||t instanceof String||(t=n(t)),he=ae,se=t,ce=0,le=se.length>0?1:0,fe=0,pe=se.length,de=null,ve={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},ye={},"undefined"!=typeof e&&(ye.range="boolean"==typeof e.range&&e.range,ye.loc="boolean"==typeof e.loc&&e.loc,ye.attachComment="boolean"==typeof e.attachComment&&e.attachComment,ye.loc&&null!==e.source&&void 0!==e.source&&(ye.source=n(e.source)),"boolean"==typeof e.tokens&&e.tokens&&(ye.tokens=[]),"boolean"==typeof e.comment&&e.comment&&(ye.comments=[]),"boolean"==typeof e.tolerant&&e.tolerant&&(ye.errors=[]),ye.attachComment&&(ye.range=!0,ye.comments=[],ye.bottomRightStack=[],ye.trailingComments=[],ye.leadingComments=[]));try{r=Kt(),"undefined"!=typeof ye.comments&&(r.comments=ye.comments),"undefined"!=typeof ye.tokens&&(Xt(),r.tokens=ye.tokens),"undefined"!=typeof ye.errors&&(r.errors=ye.errors)}catch(t){throw t}finally{ye={}}return r}var Jt,te,ee,re,ne,oe,ie,ae,se,ue,ce,le,fe,pe,he,de,ve,ye;Jt={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9},te={},te[Jt.BooleanLiteral]="Boolean",te[Jt.EOF]="",te[Jt.Identifier]="Identifier",te[Jt.Keyword]="Keyword",te[Jt.NullLiteral]="Null",te[Jt.NumericLiteral]="Numeric",te[Jt.Punctuator]="Punctuator",te[Jt.StringLiteral]="String",te[Jt.RegularExpression]="RegularExpression",ee=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],re={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},ne={Data:1,Get:2,Set:4},oe={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode", +!function(e){t.exports=e()}(function(){var t,o,i;return function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof _dereq_&&_dereq_;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof _dereq_&&_dereq_,a=0;a0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},o.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},o.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},o.prototype._reset=function(){this._isTickUsed=!1},r.exports=o,r.exports.firstLineError=u},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var o=!1,i=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(i,i,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(i){o||(o=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var c=r(i),l=new t(e);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(c),c instanceof t){var p={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:c};f._then(e,a,void 0,l,p),c._then(s,u,void 0,l,p),l._setOnCancel(c)}else l._resolveCallback(f);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=this._bitField&-2097153},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";function n(){try{Promise===i&&(Promise=o)}catch(t){}return i}var o;"undefined"!=typeof Promise&&(o=Promise);var i=t("./promise")();i.noConflict=n,e.exports=i},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var o=n(null),i=n(null);o[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var o="Object "+s.classString(t)+" has no method '"+s.toString(r)+"'";throw new e.TypeError(o)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function o(t){return t[this]}function i(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}var a,s=t("./util"),u=s.canEvaluate;s.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(n,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=i;else if(u){var n=a(t);e=null!==n?n:o}else e=o;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,o){var i=t("./util"),a=i.tryCatch,s=i.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(i.isArray(t))for(var r=0;r=0)return i[t]}var o=!1,i=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,i.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=i.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=r,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var r=t.prototype._pushContext,i=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=i,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,o=!1},o=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=n,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,r,n){"use strict";r.exports=function(r,n){function o(t,e){return{promise:e}}function i(){return!1}function a(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+U.toString(t));n._attachCancellationCallback(t)})}catch(t){return t}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?U.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function u(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(t,e){if(0!==(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function d(){this._trace=new T(this._peekContext())}function v(t,e){if(B(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=j(t);U.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),U.notEnumerableProp(t,"__stackCleaned__",!0)}}}function y(t,e,r,n,o){if(void 0===t&&null!==e&&X){if(void 0!==o&&o._returnedNonUndefined())return;if(0===(65535&n._bitField))return;r&&(r+=" ");var i="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=x(s),c=u.length-1;c>=0;--c){var l=u[c];if(!W.test(l)){var f=l.match(z);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(u.length>0)for(var p=u[0],c=0;c0&&(a="\n"+s[c-1]);break}}var h="a promise was created in a "+r+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(h,!0,e)}}function g(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),_(r)}function _(t,e,n){if(at.warnings){var o,i=new N(t);if(e)n._attachExtraTrace(i);else if(at.longStackTraces&&(o=r._peekContext()))o.attachExtraTrace(i);else{var a=j(i);i.stack=a.message+"\n"+a.stack.join("\n")}et("warning",i)||E(i,"",!0)}}function b(t,e){for(var r=0;r=0;--s)if(n[s]===i){a=s;break}for(var s=a;s>=0;--s){var u=n[s];if(e[o]!==u)break;e.pop(),o--}e=n}}function x(t){for(var e=[],r=0;r0&&(e=e.slice(r)),e}function j(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?O(t):[" (No stack trace)"],{message:r,stack:x(e)}}function E(t,e,r){if("undefined"!=typeof console){var n;if(U.isObject(t)){var o=t.stack;n=e+G(o,t)}else n=e+String(t);"function"==typeof I?I(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function S(t,e,r,n){var o=!1;try{"function"==typeof e&&(o=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){L.throwLater(t)}"unhandledRejection"===t?et(t,r,n)||o||E(r,"Unhandled rejection "):et(t,n)}function k(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():U.toString(t);var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+P(e)+">, no stack trace)"}function P(t){var e=41;return t.length=s||(nt=function(t){if(V.test(t))return!0;var e=M(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}}function T(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,T),e>32&&this.uncycle()}var R,F,I,D=r._getDomain,L=r._async,N=t("./errors").Warning,U=t("./util"),B=U.canAttachTrace,V=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,W=/\((?:timers\.js):\d+:\d+\)/,z=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,G=null,H=!1,Y=!(0==U.env("BLUEBIRD_DEBUG")),$=!(0==U.env("BLUEBIRD_WARNINGS")||!Y&&!U.env("BLUEBIRD_WARNINGS")),K=!(0==U.env("BLUEBIRD_LONG_STACK_TRACES")||!Y&&!U.env("BLUEBIRD_LONG_STACK_TRACES")),X=0!=U.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&($||!!U.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=t._bitField&-1048577|524288},r.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),L.invokeLater(this._notifyUnhandledRejection,this,void 0))},r.prototype._notifyUnhandledRejectionIsHandled=function(){S("rejectionHandled",R,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),S("unhandledRejection",F,t,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(t,e,r){return _(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=D();F="function"==typeof t?null===e?t:U.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=D();R="function"==typeof t?null===e?t:U.domainBind(e,t):void 0};var Z=function(){};r.longStackTraces=function(){if(L.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!at.longStackTraces&&A()){var t=r.prototype._captureStackTrace,e=r.prototype._attachExtraTrace;at.longStackTraces=!0,Z=function(){if(L.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=t,r.prototype._attachExtraTrace=e,n.deactivateLongStackTraces(),L.enableTrampoline(),at.longStackTraces=!1},r.prototype._captureStackTrace=d,r.prototype._attachExtraTrace=v,n.activateLongStackTraces(),L.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return at.longStackTraces&&A()};var Q=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return U.global.dispatchEvent(t),function(t,e){var r=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!U.global.dispatchEvent(r)}}if("function"==typeof Event){var t=new Event("CustomEvent");return U.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,!U.global.dispatchEvent(r)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),U.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!U.global.dispatchEvent(r)}}catch(t){}return function(){return!1}}(),J=function(){return U.isNode?function(){return e.emit.apply(e,arguments)}:U.global?function(t){var e="on"+t.toLowerCase(),r=U.global[e];return!!r&&(r.apply(U.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),tt={promiseCreated:o,promiseFulfilled:o,promiseRejected:o,promiseResolved:o,promiseCancelled:o,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:o},et=function(t){var e=!1;try{e=J.apply(null,arguments)}catch(t){L.throwLater(t),e=!0}var r=!1;try{r=Q(t,tt[t].apply(null,arguments))}catch(t){L.throwLater(t),r=!0}return r||e};r.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&Z()),"warnings"in t){var e=t.warnings;at.warnings=!!e,X=at.warnings,U.isObject(e)&&"wForgottenReturn"in e&&(X=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!at.cancellation){if(L.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=l,r.prototype._propagateFrom=f,r.prototype._onCancel=u,r.prototype._setOnCancel=c,r.prototype._attachCancellationCallback=s,r.prototype._execute=a,rt=f,at.cancellation=!0}"monitoring"in t&&(t.monitoring&&!at.monitoring?(at.monitoring=!0,r.prototype._fireEvent=et):!t.monitoring&&at.monitoring&&(at.monitoring=!1,r.prototype._fireEvent=i))},r.prototype._fireEvent=i,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var rt=p,nt=function(){return!1},ot=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;U.inherits(T,Error),n.CapturedTrace=T,T.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,o=this;void 0!==o;++n)e.push(o),o=o._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var i=e[n].stack;void 0===r[i]&&(r[i]=n)}for(var n=0;n0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;s=0;--l)e[l]._length=c,c++;return}}}},T.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),r=e.message,n=[e.stack],o=this;void 0!==o;)n.push(x(o.stack.split("\n"))),o=o._parent;w(n),m(n),U.notEnumerableProp(t,"stack",b(r,n)),U.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():k(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,G=e;var r=Error.captureStackTrace;return nt=function(t){return V.test(t)},function(t,e){Error.stackTraceLimit+=6,r(t,e),Error.stackTraceLimit-=6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,G=e,H=!0,function(t){t.stack=(new Error).stack};var o;try{throw new Error}catch(t){o="stack"in t}return"stack"in n||!o||"number"!=typeof Error.stackTraceLimit?(G=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?k(e):e.toString()},null):(q=t,G=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(I=function(t){console.warn(t)},U.isNode&&e.stderr.isTTY?I=function(t,e){var r=e?"":"";console.warn(r+t+"\n")}:U.isNode||"string"!=typeof(new Error).stack||(I=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var at={warnings:$,longStackTraces:!1,cancellation:!1,monitoring:!1};return K&&r.longStackTraces(),{longStackTraces:function(){return at.longStackTraces},warnings:function(){return at.warnings},cancellation:function(){return at.cancellation},monitoring:function(){return at.monitoring},propagateFromFunction:function(){return rt},boundValueFunction:function(){return h},checkForgottenReturns:y,setBounds:C,warn:_,deprecated:g,CapturedTrace:T,fireDomEvent:Q,fireGlobalEvent:J}}},{"./errors":12,"./util":36}],10:[function(t,e,r){"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1],n=function(){throw e};return this.caught(t,n)},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();var o=function(){return n};return this.caught(r,o)}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){function r(){return i(this)}function n(t,r){return o(t,r,e,e)}var o=t.reduce,i=t.all;t.prototype.each=function(t){return o(this,t,e,0)._then(r,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return o(this,t,e,e)},t.each=function(t,n){return o(t,n,e,0)._then(r,void 0,void 0,t,void 0)},t.mapSeries=n}},{}],12:[function(t,e,r){"use strict";function n(t,e){function r(n){return this instanceof r?(f(this,"message","string"==typeof n?n:e),f(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return l(r,Error),r}function o(t){return this instanceof o?(f(this,"name","OperationalError"),f(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(f(this,"message",t.message),f(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new o(t)}var i,a,s=t("./es5"),u=s.freeze,c=t("./util"),l=c.inherits,f=c.notEnumerableProp,p=n("Warning","warning"),h=n("CancellationError","cancellation error"),d=n("TimeoutError","timeout error"),v=n("AggregateError","aggregate error");try{i=TypeError,a=RangeError}catch(t){i=n("TypeError","type error"),a=n("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function a(){return u.call(this,this.promise._target()._settledValue())}function s(t){if(!i(this,t))return f.e=t,f}function u(t){var n=this.promise,u=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?u.call(n._boundValue()):u.call(n._boundValue(),t);if(void 0!==c){n._setReturnedNonUndefined();var p=r(c,n);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var h=new l("late cancellation observer");return n._attachExtraTrace(h),f.e=h,f}p.isPending()&&p._attachCancellationCallback(new o(this))}return p._then(a,s,void 0,this,void 0)}}}return n.isRejected()?(i(this),f.e=t,f):(i(this),t)}var c=t("./util"),l=e.CancellationError,f=c.errorObj;return n.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){i(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,o){return"function"!=typeof t?this.then():this._then(r,o,void 0,new n(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,u,u)},e.prototype.tap=function(t){return this._passThrough(t,1,u)},n}},{"./util":36}],16:[function(t,e,r){"use strict";e.exports=function(e,r,n,o,i,a){function s(t,r,n){for(var i=0;i0&&"function"==typeof arguments[e]){t=arguments[e];var n}var o=[].slice.call(arguments);t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,o,i,a){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var o=c();this._callback=null===o?e:l.domainBind(o,e),this._preservedValues=n===i?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function u(t,r,o,i){if("function"!=typeof r)return n("expecting a function but got "+l.classString(r));var a=0;if(void 0!==o){if("object"!=typeof o||null===o)return e.reject(new TypeError("options argument must be an object but it is "+l.classString(o)));if("number"!=typeof o.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+l.classString(o.concurrency)));a=o.concurrency}return a="number"==typeof a&&isFinite(a)&&a>=1?a:0,new s(t,r,a,i).promise()}var c=e._getDomain,l=t("./util"),f=l.tryCatch,p=l.errorObj,h=e._async;l.inherits(s,r),s.prototype._asyncInit=function(){this._init$(void 0,-2)},s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,i=this.length(),s=this._preservedValues,u=this._limit;if(r<0){if(r=r*-1-1,n[r]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var c=this._promise,l=this._callback,h=c._boundValue();c._pushContext();var d=f(l).call(h,t,r,i),v=c._popContext();if(a.checkForgottenReturns(d,v,null!==s?"Promise.filter":"Promise.map",c),d===p)return this._reject(d.e),!0;var y=o(d,this._promise);if(y instanceof e){y=y._target();var g=y._bitField;if(0===(50397184&g))return u>=1&&this._inFlight++,n[r]=y,y._proxy(this,(r+1)*-1),!1;if(0===(33554432&g))return 0!==(16777216&g)?(this._reject(y._reason()),!0):(this._cancel(),!0);d=y._value()}n[r]=d}var _=++this._totalResolved;return _>=i&&(null!==s?this._filter(n,s):this._resolve(n),!0)},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight1){i.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],l=arguments[2];u=a.isArray(c)?s(t).apply(l,c):s(t).call(l,c)}else u=s(t)();var f=n._popContext();return i.checkForgottenReturns(u,f,"Promise.try",n),n._resolveFromSyncValue(u),n},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";function n(t){return t instanceof Error&&l.getPrototypeOf(t)===Error.prototype}function o(t){var e;if(n(t)){e=new c(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=l.keys(t),o=0;o1){var r,n=new Array(e-1),o=0;for(r=0;r0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+d.classString(t);arguments.length>1&&(r+=", "+d.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var r=this._then(t,e,void 0,void 0,void 0);r._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+d.classString(t)):this.all()._then(t,void 0,void 0,x,void 0)},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},i.prototype.error=function(t){return this.caught(d.originatesFromRejection,t)},i.getNewLibraryCopy=r.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(w);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=R(t)(C(e,r));return n===T&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new E(t).promise()},i.cast=function(t){var e=j(t);return e instanceof i||(e=new i(w),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(w);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new b("expecting a function but got "+d.classString(t));return g.setScheduler(t)},i.prototype._then=function(t,e,r,n,o){var a=void 0!==o,s=a?o:new i(w),u=this._target(),l=u._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===n&&0!==(2097152&this._bitField)&&(n=0!==(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var f=c();if(0!==(50397184&l)){var p,h,v=u._settlePromiseCtx;0!==(33554432&l)?(h=u._rejectionHandler0,p=t):0!==(16777216&l)?(h=u._fulfillmentHandler0,p=e,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,h=new m("late cancellation observer"),u._attachExtraTrace(h),p=e),g.invoke(v,u,{handler:null===f?p:"function"==typeof p&&d.domainBind(f,p),promise:s,receiver:n,value:h})}else u._addCallbacks(t,e,s,n,f);return s},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=this._bitField&-65536|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){g.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==h)return void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),r=t._rejectionHandler0,n=t._promise0,o=t._receiverAt(0);void 0===o&&(o=h),this._addCallbacks(e,r,n,o,null)},i.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),o=t._promiseAt(e),i=t._receiverAt(e);void 0===i&&(i=h),this._addCallbacks(r,n,o,i,null)},i.prototype._addCallbacks=function(t,e,r,n,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===o?t:d.domainBind(o,t)),"function"==typeof e&&(this._rejectionHandler0=null===o?e:d.domainBind(o,e));else{var a=4*i-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=null===o?t:d.domainBind(o,t)),"function"==typeof e&&(this[a+1]=null===o?e:d.domainBind(o,e))}return this._setLength(i+1),i},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var r=j(t,this);if(!(r instanceof i))return this._fulfill(t);e&&this._propagateFrom(r,2);var n=r._target();if(n===this)return void this._reject(l());var o=n._bitField;if(0===(50397184&o)){var a=this._length();a>0&&n._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var r=l();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():g.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?g.fatalError(t,d.isNode):void((65535&e)>0?g.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var r=1;r0){if(0!==(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){P.deprecated("Promise.defer","new Promise");var t=new i(w);return{promise:t,resolve:a,reject:s}},d.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,w,j,p,P),t("./bind")(i,w,j,P),t("./cancel")(i,E,p,P),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,E,j,w,g,c),i.Promise=i,i.version="3.4.6",t("./map.js")(i,E,p,j,w,P),t("./call_get.js")(i),t("./using.js")(i,p,j,k,w,P),t("./timers.js")(i,w,P),t("./generators.js")(i,p,w,j,n,P),t("./nodeify.js")(i),t("./promisify.js")(i,w),t("./props.js")(i,E,j,p),t("./race.js")(i,w,j,p),t("./reduce.js")(i,E,p,j,w,P),t("./settle.js")(i,E,P),t("./some.js")(i,E,p),t("./filter.js")(i,w),t("./each.js")(i,w),t("./any.js")(i),d.toFastProperties(i),d.toFastProperties(i.prototype),u({a:1}),u({b:2}),u({c:3}),u(1),u(function(){}),u(void 0),u(!1),u(new i(w)),P.setBounds(y.firstLineError,d.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,r){"use strict";e.exports=function(e,r,n,o,i){function a(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var u=t("./util");u.isArray;return u.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,i){var s=n(this._values,this._promise);if(s instanceof e){s=s._target();var c=s._bitField;if(this._values=s,0===(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,i);if(0===(33554432&c))return 0!==(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(s=u.asArray(s),null===s){var l=o("expecting an array or an iterable object but got "+u.classString(s)).reason();return void this._promise._rejectCallback(l,!1)}return 0===s.length?void(i===-5?this._resolveEmptyArray():this._resolve(a(i))):void this._iterate(s)},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var o=this._promise,i=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r=this._length){var n;if(this._isMap)n=p(this._values);else{n={};for(var o=this.length(),i=0,a=this.length();i>1},e.prototype.props=function(){return a(this)},e.props=function(t){return a(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t,e,r,n,o){for(var i=0;i=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(t,e){var r=new i;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},o.prototype._promiseRejected=function(t,e){var r=new i;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new o(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){function o(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function i(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new o(t),i=r.promise();return r.setHowMany(e),r.init(),i}var a=t("./util"),s=t("./errors").RangeError,u=t("./errors").AggregateError,c=a.isArray,l={};a.inherits(o,r),o.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length())); +}},o.prototype.init=function(){this._initialized=!0,this._init()},o.prototype.setUnwrap=function(){this._unwrap=!0},o.prototype.howMany=function(){return this._howMany},o.prototype.setHowMany=function(t){this._howMany=t},o.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},o.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},o.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},o.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new u,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},o.prototype._fulfilled=function(){return this._totalResolved},o.prototype._rejected=function(){return this._values.length-this.length()},o.prototype._addRejected=function(t){this._values.push(t)},o.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},o.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},o.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new s(e)},o.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return i(t,e)},e.prototype.some=function(t){return i(this,t)},e._SomePromiseArray=o}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},o=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},i=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return i.call(this._target())},t.prototype.isFulfilled=function(){return o.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t,n){if(l(t)){if(t instanceof e)return t;var o=i(t);if(o===c){n&&n._pushContext();var u=e.reject(o.e);return n&&n._popContext(),u}if("function"==typeof o){if(a(t)){var u=new e(r);return t._then(u._fulfill,u._reject,void 0,u,null),u}return s(t,o,n)}}return t}function o(t){return t.then}function i(t){try{return o(t)}catch(t){return c.e=t,c}}function a(t){try{return f.call(t,"_promise0")}catch(t){return!1}}function s(t,n,o){function i(t){s&&(s._resolveCallback(t),s=null)}function a(t){s&&(s._rejectCallback(t,f,!0),s=null)}var s=new e(r),l=s;o&&o._pushContext(),s._captureStackTrace(),o&&o._popContext();var f=!0,p=u.tryCatch(n).call(t,i,a);return f=!1,s&&p===c&&(s._rejectCallback(p.e,!0,!0),s=null),l}var u=t("./util"),c=u.errorObj,l=u.isObject,f={}.hasOwnProperty;return n}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){function o(t){this.handle=t}function i(t){return clearTimeout(this.handle),t}function a(t){throw clearTimeout(this.handle),t}var s=t("./util"),u=e.TimeoutError;o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(t){return l(+this).thenReturn(t)},l=e.delay=function(t,i){var a,s;return void 0!==i?(a=e.resolve(i)._then(c,null,null,t,void 0),n.cancellation()&&i instanceof e&&a._setOnCancel(i)):(a=new e(r),s=setTimeout(function(){a._fulfill()},+t),n.cancellation()&&a._setOnCancel(new o(s)),a._captureStackTrace()),a._setAsyncGuaranteed(),a};e.prototype.delay=function(t){return l(t,this)};var f=function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new u("operation timed out"):new u(e),s.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()};e.prototype.timeout=function(t,e){t=+t;var r,s,u=new o(setTimeout(function(){r.isPending()&&f(r,e,s)},t));return n.cancellation()?(s=this.then(),r=s._then(i,a,void 0,u,void 0),r._setOnCancel(u)):r=this._then(i,a,void 0,u,void 0),r}}},{"./util":36}],35:[function(t,e,r){"use strict";e.exports=function(e,r,n,o,i,a){function s(t){setTimeout(function(){throw t},0)}function u(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function c(t,r){function o(){if(a>=c)return l._fulfill();var i=u(t[a++]);if(i instanceof e&&i._isDisposable()){try{i=n(i._getDisposer().tryDispose(r),t.promise)}catch(t){return s(t)}if(i instanceof e)return i._then(o,s,null,null,null)}o()}var a=0,c=t.length,l=new e(i);return o(),l}function l(t,e,r){this._data=t,this._promise=e,this._context=r}function f(t,e,r){this.constructor$(t,e,r)}function p(t){return l.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function h(t){this.length=t,this.promise=null,this[t-1]=null}var d=t("./util"),v=t("./errors").TypeError,y=t("./util").inherits,g=d.errorObj,_=d.tryCatch,b={};l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():b},l.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==b?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},l.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},y(f,l),f.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},h.prototype._resultCancelled=function(){for(var t=this.length,r=0;r0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new f(t,this,o());throw new v}}},{"./errors":12,"./util":36}],36:[function(t,n,o){"use strict";function i(){try{var t=C;return C=null,t.apply(this,arguments)}catch(t){return M.e=t,M}}function a(t){return C=t,i}function s(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function u(t){return"function"==typeof t||"object"==typeof t&&null!==t}function c(t){return s(t)?new Error(_(t)):t}function l(t,e){var r,n=t.length,o=new Array(n+1);for(r=0;r1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),o=I.test(t+"")&&P.names(t).length>0;if(r||n||o)return!0}return!1}catch(t){return!1}}function v(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function y(t){return D.test(t)}function g(t,e,r){for(var n=new Array(t),o=0;o10||t[0]>0}(),V.isNode&&V.toFastProperties(e);try{throw new Error}catch(t){V.lastLineError=t}n.exports=V},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(e,r(126),r(49),r(127).setImmediate)},function(t,e,r){r(260),t.exports=r(30).RegExp.escape},function(t,e,r){var n=r(7),o=r(96),i=r(8)("species");t.exports=function(t){var e;return o(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!o(e.prototype)||(e=void 0),n(e)&&(e=e[i],null===e&&(e=void 0))),void 0===e?Array:e}},function(t,e,r){var n=r(252);t.exports=function(t,e){return new(n(t))(e)}},function(t,e,r){"use strict";var n=r(2),o=r(28),i="number";t.exports=function(t){if("string"!==t&&t!==i&&"default"!==t)throw TypeError("Incorrect hint");return o(n(this),t!=i)}},function(t,e,r){var n=r(42),o=r(74),i=r(59);t.exports=function(t){var e=n(t),r=o.f;if(r)for(var a,s=r(t),u=i.f,c=0;s.length>c;)u.call(t,a=s[c++])&&e.push(a);return e}},function(t,e,r){var n=r(42),o=r(18);t.exports=function(t,e){for(var r,i=o(t),a=n(i),s=a.length,u=0;s>u;)if(i[r=a[u++]]===e)return r}},function(t,e,r){"use strict";var n=r(258),o=r(70),i=r(14);t.exports=function(){for(var t=i(this),e=arguments.length,r=Array(e),a=0,s=n._,u=!1;e>a;)(r[a]=arguments[a++])===s&&(u=!0);return function(){var n,i=this,a=arguments.length,c=0,l=0;if(!u&&!a)return o(t,r,i);if(n=r.slice(),u)for(;e>c;c++)n[c]===s&&(n[c]=arguments[l++]);for(;a>l;)n.push(arguments[l++]);return o(t,n,i)}}},function(t,e,r){t.exports=r(5)},function(t,e){t.exports=function(t,e){var r=e===Object(e)?function(t){return e[t]}:e;return function(e){return String(e).replace(t,r)}}},function(t,e,r){var n=r(0),o=r(259)(/[\\^$*+?.()|[\]{}]/g,"\\$&");n(n.S,"RegExp",{escape:function(t){return o(t)}})},function(t,e,r){var n=r(0);n(n.P,"Array",{copyWithin:r(135)}),r(50)("copyWithin")},function(t,e,r){"use strict";var n=r(0),o=r(26)(4);n(n.P+n.F*!r(24)([].every,!0),"Array",{every:function(t){return o(this,t,arguments[1])}})},function(t,e,r){var n=r(0);n(n.P,"Array",{fill:r(88)}),r(50)("fill")},function(t,e,r){"use strict";var n=r(0),o=r(26)(2);n(n.P+n.F*!r(24)([].filter,!0),"Array",{filter:function(t){return o(this,t,arguments[1])}})},function(t,e,r){"use strict";var n=r(0),o=r(26)(6),i="findIndex",a=!0;i in[]&&Array(1)[i](function(){a=!1}),n(n.P+n.F*a,"Array",{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),r(50)(i)},function(t,e,r){"use strict";var n=r(0),o=r(26)(5),i="find",a=!0;i in[]&&Array(1)[i](function(){a=!1}),n(n.P+n.F*a,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),r(50)(i)},function(t,e,r){"use strict";var n=r(0),o=r(26)(0),i=r(24)([].forEach,!0);n(n.P+n.F*!i,"Array",{forEach:function(t){return o(this,t,arguments[1])}})},function(t,e,r){"use strict";var n=r(31),o=r(0),i=r(12),a=r(144),s=r(95),u=r(11),c=r(89),l=r(112);o(o.S+o.F*!r(72)(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,o,f,p=i(t),h="function"==typeof this?this:Array,d=arguments.length,v=d>1?arguments[1]:void 0,y=void 0!==v,g=0,_=l(p);if(y&&(v=n(v,d>2?arguments[2]:void 0,2)),void 0==_||h==Array&&s(_))for(e=u(p.length),r=new h(e);e>g;g++)c(r,g,y?v(p[g],g):p[g]);else for(f=_.call(p),r=new h;!(o=f.next()).done;g++)c(r,g,y?a(f,v,[o.value,g],!0):o.value);return r.length=g,r}})},function(t,e,r){"use strict";var n=r(0),o=r(66)(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;n(n.P+n.F*(a||!r(24)(i)),"Array",{indexOf:function(t){return a?i.apply(this,arguments)||0:o(this,t,arguments[1])}})},function(t,e,r){var n=r(0);n(n.S,"Array",{isArray:r(96)})},function(t,e,r){"use strict";var n=r(0),o=r(18),i=[].join;n(n.P+n.F*(r(58)!=Object||!r(24)(i)),"Array",{join:function(t){return i.call(o(this),void 0===t?",":t)}})},function(t,e,r){"use strict";var n=r(0),o=r(18),i=r(37),a=r(11),s=[].lastIndexOf,u=!!s&&1/[1].lastIndexOf(1,-0)<0;n(n.P+n.F*(u||!r(24)(s)),"Array",{lastIndexOf:function(t){if(u)return s.apply(this,arguments)||0;var e=o(this),r=a(e.length),n=r-1;for(arguments.length>1&&(n=Math.min(n,i(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}})},function(t,e,r){"use strict";var n=r(0),o=r(26)(1);n(n.P+n.F*!r(24)([].map,!0),"Array",{map:function(t){return o(this,t,arguments[1])}})},function(t,e,r){"use strict";var n=r(0),o=r(89);n(n.S+n.F*r(6)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,r=new("function"==typeof this?this:Array)(e);e>t;)o(r,t,arguments[t++]);return r.length=e,r}})},function(t,e,r){"use strict";var n=r(0),o=r(137);n(n.P+n.F*!r(24)([].reduceRight,!0),"Array",{reduceRight:function(t){return o(this,t,arguments.length,arguments[1],!0)}})},function(t,e,r){"use strict";var n=r(0),o=r(137);n(n.P+n.F*!r(24)([].reduce,!0),"Array",{reduce:function(t){return o(this,t,arguments.length,arguments[1],!1)}})},function(t,e,r){"use strict";var n=r(0),o=r(93),i=r(22),a=r(45),s=r(11),u=[].slice;n(n.P+n.F*r(6)(function(){o&&u.call(o)}),"Array",{slice:function(t,e){var r=s(this.length),n=i(this);if(e=void 0===e?r:e,"Array"==n)return u.call(this,t,e);for(var o=a(t,r),c=a(e,r),l=s(c-o),f=Array(l),p=0;p9?t:"0"+t};n(n.P+n.F*(o(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!o(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),r=t.getUTCMilliseconds(),n=e<0?"-":e>9999?"+":"";return n+("00000"+Math.abs(e)).slice(n?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(r>99?r:"0"+a(r))+"Z"}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(28);n(n.P+n.F*r(6)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(t){var e=o(this),r=i(e);return"number"!=typeof r||isFinite(r)?e.toISOString():null}})},function(t,e,r){var n=r(8)("toPrimitive"),o=Date.prototype;n in o||r(15)(o,n,r(254))},function(t,e,r){var n=Date.prototype,o="Invalid Date",i="toString",a=n[i],s=n.getTime;new Date(NaN)+""!=o&&r(16)(n,i,function(){var t=s.call(this);return t===t?a.call(this):o})},function(t,e,r){var n=r(0);n(n.P,"Function",{bind:r(138)})},function(t,e,r){"use strict";var n=r(7),o=r(21),i=r(8)("hasInstance"),a=Function.prototype;i in a||r(10).f(a,i,{value:function(t){if("function"!=typeof this||!n(t))return!1;if(!n(this.prototype))return t instanceof this;for(;t=o(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,r){var n=r(10).f,o=r(36),i=r(13),a=Function.prototype,s=/^\s*function ([^ (]*)/,u="name",c=Object.isExtensible||function(){return!0};u in a||r(9)&&n(a,u,{configurable:!0,get:function(){try{var t=this,e=(""+t).match(s)[1];return i(t,u)||!c(t)||n(t,u,o(5,e)),e}catch(t){return""}}})},function(t,e,r){var n=r(0),o=r(146),i=Math.sqrt,a=Math.acosh;n(n.S+n.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:o(t-1+i(t-1)*i(t+1))}})},function(t,e,r){function n(t){return isFinite(t=+t)&&0!=t?t<0?-n(-t):Math.log(t+Math.sqrt(t*t+1)):t}var o=r(0),i=Math.asinh;o(o.S+o.F*!(i&&1/i(0)>0),"Math",{asinh:n})},function(t,e,r){var n=r(0),o=Math.atanh;n(n.S+n.F*!(o&&1/o(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,r){var n=r(0),o=r(100);n(n.S,"Math",{cbrt:function(t){return o(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,r){var n=r(0);n(n.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,r){var n=r(0),o=Math.exp;n(n.S,"Math",{cosh:function(t){return(o(t=+t)+o(-t))/2}})},function(t,e,r){var n=r(0),o=r(99);n(n.S+n.F*(o!=Math.expm1),"Math",{expm1:o})},function(t,e,r){var n=r(0),o=r(100),i=Math.pow,a=i(2,-52),s=i(2,-23),u=i(2,127)*(2-s),c=i(2,-126),l=function(t){return t+1/a-1/a};n(n.S,"Math",{fround:function(t){var e,r,n=Math.abs(t),i=o(t);return nu||r!=r?i*(1/0):i*r)}})},function(t,e,r){var n=r(0),o=Math.abs;n(n.S,"Math",{hypot:function(t,e){for(var r,n,i=0,a=0,s=arguments.length,u=0;a0?(n=r/u,i+=n*n):i+=r;return u===1/0?1/0:u*Math.sqrt(i)}})},function(t,e,r){var n=r(0),o=Math.imul;n(n.S+n.F*r(6)(function(){return o(4294967295,5)!=-5||2!=o.length}),"Math",{imul:function(t,e){var r=65535,n=+t,o=+e,i=r&n,a=r&o;return 0|i*a+((r&n>>>16)*a+i*(r&o>>>16)<<16>>>0)}})},function(t,e,r){var n=r(0);n(n.S,"Math",{log10:function(t){return Math.log(t)/Math.LN10}})},function(t,e,r){var n=r(0);n(n.S,"Math",{log1p:r(146)})},function(t,e,r){var n=r(0);n(n.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,r){var n=r(0);n(n.S,"Math",{sign:r(100)})},function(t,e,r){var n=r(0),o=r(99),i=Math.exp;n(n.S+n.F*r(6)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(o(t)-o(-t))/2:(i(t-1)-i(-t-1))*(Math.E/2)}})},function(t,e,r){var n=r(0),o=r(99),i=Math.exp;n(n.S,"Math",{tanh:function(t){var e=o(t=+t),r=o(-t);return e==1/0?1:r==1/0?-1:(e-r)/(i(t)+i(-t))}})},function(t,e,r){var n=r(0);n(n.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,r){"use strict";var n=r(5),o=r(13),i=r(22),a=r(94),s=r(28),u=r(6),c=r(41).f,l=r(20).f,f=r(10).f,p=r(54).trim,h="Number",d=n[h],v=d,y=d.prototype,g=i(r(40)(y))==h,_="trim"in String.prototype,b=function(t){var e=s(t,!1);if("string"==typeof e&&e.length>2){e=_?e.trim():p(e,3);var r,n,o,i=e.charCodeAt(0);if(43===i||45===i){if(r=e.charCodeAt(2),88===r||120===r)return NaN}else if(48===i){switch(e.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+e}for(var a,u=e.slice(2),c=0,l=u.length;co)return NaN;return parseInt(u,n)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,r=this;return r instanceof d&&(g?u(function(){y.valueOf.call(r)}):i(r)!=h)?a(new v(b(e)),r,d):b(e)};for(var m,w=r(9)?c(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),x=0;w.length>x;x++)o(v,m=w[x])&&!o(d,m)&&f(d,m,l(v,m));d.prototype=y,y.constructor=d,r(16)(n,h,d)}},function(t,e,r){var n=r(0);n(n.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,r){var n=r(0),o=r(5).isFinite;n(n.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},function(t,e,r){var n=r(0);n(n.S,"Number",{isInteger:r(143)})},function(t,e,r){var n=r(0);n(n.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,r){var n=r(0),o=r(143),i=Math.abs;n(n.S,"Number",{isSafeInteger:function(t){return o(t)&&i(t)<=9007199254740991}})},function(t,e,r){var n=r(0);n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,r){var n=r(0);n(n.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,r){var n=r(0),o=r(153);n(n.S+n.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},function(t,e,r){var n=r(0),o=r(154);n(n.S+n.F*(Number.parseInt!=o),"Number",{parseInt:o})},function(t,e,r){"use strict";var n=r(0),o=r(37),i=r(134),a=r(107),s=1..toFixed,u=Math.floor,c=[0,0,0,0,0,0],l="Number.toFixed: incorrect invocation!",f="0",p=function(t,e){for(var r=-1,n=e;++r<6;)n+=t*c[r],c[r]=n%1e7,n=u(n/1e7)},h=function(t){for(var e=6,r=0;--e>=0;)r+=c[e],c[e]=u(r/t),r=r%t*1e7},d=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var r=String(c[t]);e=""===e?r:e+a.call(f,7-r.length)+r}return e},v=function(t,e,r){return 0===e?r:e%2===1?v(t,e-1,r*t):v(t*t,e/2,r)},y=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e};n(n.P+n.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!r(6)(function(){s.call({})})),"Number",{toFixed:function(t){var e,r,n,s,u=i(this,l),c=o(t),g="",_=f;if(c<0||c>20)throw RangeError(l);if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(g="-",u=-u),u>1e-21)if(e=y(u*v(2,69,1))-69,r=e<0?u*v(2,-e,1):u/v(2,e,1),r*=4503599627370496,e=52-e,e>0){for(p(0,r),n=c;n>=7;)p(1e7,0),n-=7;for(p(v(10,n,1),0),n=e-1;n>=23;)h(1<<23),n-=23;h(1<0?(s=_.length,_=g+(s<=c?"0."+a.call(f,c-s)+_:_.slice(0,s-c)+"."+_.slice(s-c))):_=g+_,_}})},function(t,e,r){"use strict";var n=r(0),o=r(6),i=r(134),a=1..toPrecision;n(n.P+n.F*(o(function(){return"1"!==a.call(1,void 0)})||!o(function(){a.call({})})),"Number",{toPrecision:function(t){var e=i(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},function(t,e,r){var n=r(0);n(n.S+n.F,"Object",{assign:r(147)})},function(t,e,r){var n=r(0);n(n.S,"Object",{create:r(40)})},function(t,e,r){var n=r(0);n(n.S+n.F*!r(9),"Object",{defineProperties:r(148)})},function(t,e,r){var n=r(0);n(n.S+n.F*!r(9),"Object",{defineProperty:r(10).f})},function(t,e,r){var n=r(7),o=r(35).onFreeze;r(27)("freeze",function(t){return function(e){return t&&n(e)?t(o(e)):e}})},function(t,e,r){var n=r(18),o=r(20).f;r(27)("getOwnPropertyDescriptor",function(){return function(t,e){return o(n(t),e)}})},function(t,e,r){r(27)("getOwnPropertyNames",function(){return r(149).f})},function(t,e,r){var n=r(12),o=r(21);r(27)("getPrototypeOf",function(){return function(t){return o(n(t))}})},function(t,e,r){var n=r(7);r(27)("isExtensible",function(t){return function(e){return!!n(e)&&(!t||t(e))}})},function(t,e,r){var n=r(7);r(27)("isFrozen",function(t){return function(e){return!n(e)||!!t&&t(e)}})},function(t,e,r){var n=r(7);r(27)("isSealed",function(t){return function(e){return!n(e)||!!t&&t(e)}})},function(t,e,r){var n=r(0);n(n.S,"Object",{is:r(155)})},function(t,e,r){var n=r(12),o=r(42);r(27)("keys",function(){return function(t){return o(n(t))}})},function(t,e,r){var n=r(7),o=r(35).onFreeze;r(27)("preventExtensions",function(t){return function(e){return t&&n(e)?t(o(e)):e}})},function(t,e,r){var n=r(7),o=r(35).onFreeze;r(27)("seal",function(t){return function(e){return t&&n(e)?t(o(e)):e}})},function(t,e,r){var n=r(0);n(n.S,"Object",{setPrototypeOf:r(102).set})},function(t,e,r){"use strict";var n=r(57),o={};o[r(8)("toStringTag")]="z",o+""!="[object z]"&&r(16)(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},function(t,e,r){var n=r(0),o=r(153);n(n.G+n.F*(parseFloat!=o),{parseFloat:o})},function(t,e,r){var n=r(0),o=r(154);n(n.G+n.F*(parseInt!=o),{parseInt:o})},function(t,e,r){"use strict";var n,o,i,a=r(39),s=r(5),u=r(31),c=r(57),l=r(0),f=r(7),p=r(14),h=r(38),d=r(51),v=r(104),y=r(109).set,g=r(101)(),_="Promise",b=s.TypeError,m=s.process,w=s[_],m=s.process,x="process"==c(m),O=function(){},j=!!function(){try{var t=w.resolve(1),e=(t.constructor={})[r(8)("species")]=function(t){t(O,O)};return(x||"function"==typeof PromiseRejectionEvent)&&t.then(O)instanceof e}catch(t){}}(),E=function(t,e){return t===e||t===w&&e===i},S=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},k=function(t){return E(w,t)?new P(t):new o(t)},P=o=function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw b("Bad Promise constructor");e=t,r=n}),this.resolve=p(e),this.reject=p(r)},A=function(t){try{t()}catch(t){return{error:t}}},M=function(t,e){if(!t._n){t._n=!0;var r=t._c;g(function(){for(var n=t._v,o=1==t._s,i=0,a=function(e){var r,i,a=o?e.ok:e.fail,s=e.resolve,u=e.reject,c=e.domain;try{a?(o||(2==t._h&&R(t),t._h=1),a===!0?r=n:(c&&c.enter(),r=a(n),c&&c.exit()),r===e.promise?u(b("Promise-chain cycle")):(i=S(r))?i.call(r,s,u):s(r)):u(n)}catch(t){u(t)}};r.length>i;)a(r[i++]);t._c=[],t._n=!1,e&&!t._h&&C(t)})}},C=function(t){y.call(s,function(){var e,r,n,o=t._v;if(T(t)&&(e=A(function(){x?m.emit("unhandledRejection",o,t):(r=s.onunhandledrejection)?r({promise:t,reason:o}):(n=s.console)&&n.error&&n.error("Unhandled promise rejection",o)}),t._h=x||T(t)?2:1),t._a=void 0,e)throw e.error})},T=function(t){if(1==t._h)return!1;for(var e,r=t._a||t._c,n=0;r.length>n;)if(e=r[n++],e.fail||!T(e.promise))return!1;return!0},R=function(t){y.call(s,function(){var e;x?m.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})})},F=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0))},I=function(t){var e,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw b("Promise can't be resolved itself");(e=S(t))?g(function(){var n={_w:r,_d:!1};try{e.call(t,u(I,n,1),u(F,n,1))}catch(t){F.call(n,t)}}):(r._v=t,r._s=1,M(r,!1))}catch(t){F.call({_w:r,_d:!1},t)}}};j||(w=function(t){h(this,w,_,"_h"),p(t),n.call(this);try{t(u(I,this,1),u(F,this,1))}catch(t){F.call(this,t)}},n=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},n.prototype=r(43)(w.prototype,{then:function(t,e){var r=k(v(this,w));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=x?m.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&M(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),P=function(){var t=new n;this.promise=t,this.resolve=u(I,t,1),this.reject=u(F,t,1)}),l(l.G+l.W+l.F*!j,{Promise:w}),r(53)(w,_),r(44)(_),i=r(30)[_],l(l.S+l.F*!j,_,{reject:function(t){var e=k(this),r=e.reject;return r(t),e.promise}}),l(l.S+l.F*(a||!j),_,{resolve:function(t){if(t instanceof w&&E(t.constructor,this))return t;var e=k(this),r=e.resolve;return r(t),e.promise}}),l(l.S+l.F*!(j&&r(72)(function(t){w.all(t).catch(O)})),_,{all:function(t){var e=this,r=k(e),n=r.resolve,o=r.reject,i=A(function(){var r=[],i=0,a=1;d(t,!1,function(t){var s=i++,u=!1;r.push(void 0),a++,e.resolve(t).then(function(t){u||(u=!0,r[s]=t,--a||n(r))},o)}),--a||n(r)});return i&&o(i.error),r.promise},race:function(t){var e=this,r=k(e),n=r.reject,o=A(function(){d(t,!1,function(t){e.resolve(t).then(r.resolve,n)})});return o&&n(o.error),r.promise}})},function(t,e,r){var n=r(0),o=r(14),i=r(2),a=(r(5).Reflect||{}).apply,s=Function.apply;n(n.S+n.F*!r(6)(function(){a(function(){})}),"Reflect",{apply:function(t,e,r){var n=o(t),u=i(r);return a?a(n,e,u):s.call(n,e,u); +}})},function(t,e,r){var n=r(0),o=r(40),i=r(14),a=r(2),s=r(7),u=r(6),c=r(138),l=(r(5).Reflect||{}).construct,f=u(function(){function t(){}return!(l(function(){},[],t)instanceof t)}),p=!u(function(){l(function(){})});n(n.S+n.F*(f||p),"Reflect",{construct:function(t,e){i(t),a(e);var r=arguments.length<3?t:i(arguments[2]);if(p&&!f)return l(t,e,r);if(t==r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(c.apply(t,n))}var u=r.prototype,h=o(s(u)?u:Object.prototype),d=Function.apply.call(t,h,e);return s(d)?d:h}})},function(t,e,r){var n=r(10),o=r(0),i=r(2),a=r(28);o(o.S+o.F*r(6)(function(){Reflect.defineProperty(n.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,r){i(t),e=a(e,!0),i(r);try{return n.f(t,e,r),!0}catch(t){return!1}}})},function(t,e,r){var n=r(0),o=r(20).f,i=r(2);n(n.S,"Reflect",{deleteProperty:function(t,e){var r=o(i(t),e);return!(r&&!r.configurable)&&delete t[e]}})},function(t,e,r){"use strict";var n=r(0),o=r(2),i=function(t){this._t=o(t),this._i=0;var e,r=this._k=[];for(e in t)r.push(e)};r(97)(i,"Object",function(){var t,e=this,r=e._k;do if(e._i>=r.length)return{value:void 0,done:!0};while(!((t=r[e._i++])in e._t));return{value:t,done:!1}}),n(n.S,"Reflect",{enumerate:function(t){return new i(t)}})},function(t,e,r){var n=r(20),o=r(0),i=r(2);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return n.f(i(t),e)}})},function(t,e,r){var n=r(0),o=r(21),i=r(2);n(n.S,"Reflect",{getPrototypeOf:function(t){return o(i(t))}})},function(t,e,r){function n(t,e){var r,s,l=arguments.length<3?t:arguments[2];return c(t)===l?t[e]:(r=o.f(t,e))?a(r,"value")?r.value:void 0!==r.get?r.get.call(l):void 0:u(s=i(t))?n(s,e,l):void 0}var o=r(20),i=r(21),a=r(13),s=r(0),u=r(7),c=r(2);s(s.S,"Reflect",{get:n})},function(t,e,r){var n=r(0);n(n.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,r){var n=r(0),o=r(2),i=Object.isExtensible;n(n.S,"Reflect",{isExtensible:function(t){return o(t),!i||i(t)}})},function(t,e,r){var n=r(0);n(n.S,"Reflect",{ownKeys:r(152)})},function(t,e,r){var n=r(0),o=r(2),i=Object.preventExtensions;n(n.S,"Reflect",{preventExtensions:function(t){o(t);try{return i&&i(t),!0}catch(t){return!1}}})},function(t,e,r){var n=r(0),o=r(102);o&&n(n.S,"Reflect",{setPrototypeOf:function(t,e){o.check(t,e);try{return o.set(t,e),!0}catch(t){return!1}}})},function(t,e,r){function n(t,e,r){var u,p,h=arguments.length<4?t:arguments[3],d=i.f(l(t),e);if(!d){if(f(p=a(t)))return n(p,e,r,h);d=c(0)}return s(d,"value")?!(d.writable===!1||!f(h))&&(u=i.f(h,e)||c(0),u.value=r,o.f(h,e,u),!0):void 0!==d.set&&(d.set.call(h,r),!0)}var o=r(10),i=r(20),a=r(21),s=r(13),u=r(0),c=r(36),l=r(2),f=r(7);u(u.S,"Reflect",{set:n})},function(t,e,r){var n=r(5),o=r(94),i=r(10).f,a=r(41).f,s=r(71),u=r(69),c=n.RegExp,l=c,f=c.prototype,p=/a/g,h=/a/g,d=new c(p)!==p;if(r(9)&&(!d||r(6)(function(){return h[r(8)("match")]=!1,c(p)!=p||c(h)==h||"/a/i"!=c(p,"i")}))){c=function(t,e){var r=this instanceof c,n=s(t),i=void 0===e;return!r&&n&&t.constructor===c&&i?t:o(d?new l(n&&!i?t.source:t,e):l((n=t instanceof c)?t.source:t,n&&i?u.call(t):e),r?this:f,c)};for(var v=(function(t){t in c||i(c,t,{configurable:!0,get:function(){return l[t]},set:function(e){l[t]=e}})}),y=a(l),g=0;y.length>g;)v(y[g++]);f.constructor=c,c.prototype=f,r(16)(n,"RegExp",c)}r(44)("RegExp")},function(t,e,r){r(68)("match",1,function(t,e,r){return[function(r){"use strict";var n=t(this),o=void 0==r?void 0:r[e];return void 0!==o?o.call(r,n):new RegExp(r)[e](String(n))},r]})},function(t,e,r){r(68)("replace",2,function(t,e,r){return[function(n,o){"use strict";var i=t(this),a=void 0==n?void 0:n[e];return void 0!==a?a.call(n,i,o):r.call(String(i),n,o)},r]})},function(t,e,r){r(68)("search",1,function(t,e,r){return[function(r){"use strict";var n=t(this),o=void 0==r?void 0:r[e];return void 0!==o?o.call(r,n):new RegExp(r)[e](String(n))},r]})},function(t,e,r){r(68)("split",2,function(t,e,n){"use strict";var o=r(71),i=n,a=[].push,s="split",u="length",c="lastIndex";if("c"=="abbc"[s](/(b)*/)[1]||4!="test"[s](/(?:)/,-1)[u]||2!="ab"[s](/(?:ab)*/)[u]||4!="."[s](/(.?)(.?)/)[u]||"."[s](/()()/)[u]>1||""[s](/.?/)[u]){var l=void 0===/()??/.exec("")[1];n=function(t,e){var r=String(this);if(void 0===t&&0===e)return[];if(!o(t))return i.call(r,t,e);var n,s,f,p,h,d=[],v=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),y=0,g=void 0===e?4294967295:e>>>0,_=new RegExp(t.source,v+"g");for(l||(n=new RegExp("^"+_.source+"$(?!\\s)",v));(s=_.exec(r))&&(f=s.index+s[0][u],!(f>y&&(d.push(r.slice(y,s.index)),!l&&s[u]>1&&s[0].replace(n,function(){for(h=1;h1&&s.index=g)));)_[c]===s.index&&_[c]++;return y===r[u]?!p&&_.test("")||d.push(""):d.push(r.slice(y)),d[u]>g?d.slice(0,g):d}}else"0"[s](void 0,0)[u]&&(n=function(t,e){return void 0===t&&0===e?[]:i.call(this,t,e)});return[function(r,o){var i=t(this),a=void 0==r?void 0:r[e];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},n]})},function(t,e,r){"use strict";r(159);var n=r(2),o=r(69),i=r(9),a="toString",s=/./[a],u=function(t){r(16)(RegExp.prototype,a,t,!0)};r(6)(function(){return"/a/b"!=s.call({source:"a",flags:"b"})})?u(function(){var t=n(this);return"/".concat(t.source,"/","flags"in t?t.flags:!i&&t instanceof RegExp?o.call(t):void 0)}):s.name!=a&&u(function(){return s.call(this)})},function(t,e,r){"use strict";r(17)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(t,e,r){"use strict";r(17)("big",function(t){return function(){return t(this,"big","","")}})},function(t,e,r){"use strict";r(17)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,e,r){"use strict";r(17)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,e,r){"use strict";var n=r(0),o=r(105)(!1);n(n.P,"String",{codePointAt:function(t){return o(this,t)}})},function(t,e,r){"use strict";var n=r(0),o=r(11),i=r(106),a="endsWith",s=""[a];n(n.P+n.F*r(92)(a),"String",{endsWith:function(t){var e=i(this,t,a),r=arguments.length>1?arguments[1]:void 0,n=o(e.length),u=void 0===r?n:Math.min(o(r),n),c=String(t);return s?s.call(e,c,u):e.slice(u-c.length,u)===c}})},function(t,e,r){"use strict";r(17)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,e,r){"use strict";r(17)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(t,e,r){"use strict";r(17)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(t,e,r){var n=r(0),o=r(45),i=String.fromCharCode,a=String.fromCodePoint;n(n.S+n.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,r=[],n=arguments.length,a=0;n>a;){if(e=+arguments[a++],o(e,1114111)!==e)throw RangeError(e+" is not a valid code point");r.push(e<65536?i(e):i(((e-=65536)>>10)+55296,e%1024+56320))}return r.join("")}})},function(t,e,r){"use strict";var n=r(0),o=r(106),i="includes";n(n.P+n.F*r(92)(i),"String",{includes:function(t){return!!~o(this,t,i).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){"use strict";r(17)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,e,r){"use strict";var n=r(105)(!0);r(98)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){"use strict";r(17)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(t,e,r){var n=r(0),o=r(18),i=r(11);n(n.S,"String",{raw:function(t){for(var e=o(t.raw),r=i(e.length),n=arguments.length,a=[],s=0;r>s;)a.push(String(e[s++])),s1?arguments[1]:void 0,e.length)),n=String(t);return s?s.call(e,n,r):e.slice(r,r+n.length)===n}})},function(t,e,r){"use strict";r(17)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,e,r){"use strict";r(17)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,e,r){"use strict";r(17)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,e,r){"use strict";r(54)("trim",function(t){return function(){return t(this,3)}})},function(t,e,r){"use strict";var n=r(5),o=r(13),i=r(9),a=r(0),s=r(16),u=r(35).KEY,c=r(6),l=r(75),f=r(53),p=r(46),h=r(8),d=r(157),v=r(111),y=r(256),g=r(255),_=r(96),b=r(2),m=r(18),w=r(28),x=r(36),O=r(40),j=r(149),E=r(20),S=r(10),k=r(42),P=E.f,A=S.f,M=j.f,C=n.Symbol,T=n.JSON,R=T&&T.stringify,F="prototype",I=h("_hidden"),D=h("toPrimitive"),L={}.propertyIsEnumerable,N=l("symbol-registry"),U=l("symbols"),B=l("op-symbols"),V=Object[F],W="function"==typeof C,z=n.QObject,q=!z||!z[F]||!z[F].findChild,G=i&&c(function(){return 7!=O(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,e,r){var n=P(V,e);n&&delete V[e],A(t,e,r),n&&t!==V&&A(V,e,n)}:A,H=function(t){var e=U[t]=O(C[F]);return e._k=t,e},Y=W&&"symbol"==typeof C.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof C},$=function(t,e,r){return t===V&&$(B,e,r),b(t),e=w(e,!0),b(r),o(U,e)?(r.enumerable?(o(t,I)&&t[I][e]&&(t[I][e]=!1),r=O(r,{enumerable:x(0,!1)})):(o(t,I)||A(t,I,x(1,{})),t[I][e]=!0),G(t,e,r)):A(t,e,r)},K=function(t,e){b(t);for(var r,n=g(e=m(e)),o=0,i=n.length;i>o;)$(t,r=n[o++],e[r]);return t},X=function(t,e){return void 0===e?O(t):K(O(t),e)},Z=function(t){var e=L.call(this,t=w(t,!0));return!(this===V&&o(U,t)&&!o(B,t))&&(!(e||!o(this,t)||!o(U,t)||o(this,I)&&this[I][t])||e)},Q=function(t,e){if(t=m(t),e=w(e,!0),t!==V||!o(U,e)||o(B,e)){var r=P(t,e);return!r||!o(U,e)||o(t,I)&&t[I][e]||(r.enumerable=!0),r}},J=function(t){for(var e,r=M(m(t)),n=[],i=0;r.length>i;)o(U,e=r[i++])||e==I||e==u||n.push(e);return n},tt=function(t){for(var e,r=t===V,n=M(r?B:m(t)),i=[],a=0;n.length>a;)!o(U,e=n[a++])||r&&!o(V,e)||i.push(U[e]);return i};W||(C=function(){if(this instanceof C)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(r){this===V&&e.call(B,r),o(this,I)&&o(this[I],t)&&(this[I][t]=!1),G(this,t,x(1,r))};return i&&q&&G(V,t,{configurable:!0,set:e}),H(t)},s(C[F],"toString",function(){return this._k}),E.f=Q,S.f=$,r(41).f=j.f=J,r(59).f=Z,r(74).f=tt,i&&!r(39)&&s(V,"propertyIsEnumerable",Z,!0),d.f=function(t){return H(h(t))}),a(a.G+a.W+a.F*!W,{Symbol:C});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;et.length>rt;)h(et[rt++]);for(var et=k(h.store),rt=0;et.length>rt;)v(et[rt++]);a(a.S+a.F*!W,"Symbol",{for:function(t){return o(N,t+="")?N[t]:N[t]=C(t)},keyFor:function(t){if(Y(t))return y(N,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){q=!0},useSimple:function(){q=!1}}),a(a.S+a.F*!W,"Object",{create:X,defineProperty:$,defineProperties:K,getOwnPropertyDescriptor:Q,getOwnPropertyNames:J,getOwnPropertySymbols:tt}),T&&a(a.S+a.F*(!W||c(function(){var t=C();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!Y(t)){for(var e,r,n=[t],o=1;arguments.length>o;)n.push(arguments[o++]);return e=n[1],"function"==typeof e&&(r=e),!r&&_(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!Y(e))return e}),n[1]=e,R.apply(T,n)}}}),C[F][D]||r(15)(C[F],D,C[F].valueOf),f(C,"Symbol"),f(Math,"Math",!0),f(n.JSON,"JSON",!0)},function(t,e,r){"use strict";var n=r(0),o=r(76),i=r(110),a=r(2),s=r(45),u=r(11),c=r(7),l=r(5).ArrayBuffer,f=r(104),p=i.ArrayBuffer,h=i.DataView,d=o.ABV&&l.isView,v=p.prototype.slice,y=o.VIEW,g="ArrayBuffer";n(n.G+n.W+n.F*(l!==p),{ArrayBuffer:p}),n(n.S+n.F*!o.CONSTR,g,{isView:function(t){return d&&d(t)||c(t)&&y in t}}),n(n.P+n.U+n.F*r(6)(function(){return!new p(2).slice(1,void 0).byteLength}),g,{slice:function(t,e){if(void 0!==v&&void 0===e)return v.call(a(this),t);for(var r=a(this).byteLength,n=s(t,r),o=s(void 0===e?r:e,r),i=new(f(this,p))(u(o-n)),c=new h(this),l=new h(i),d=0;n0?arguments[0]:void 0)}},{add:function(t){return n.def(this,t,!0)}},n,!1,!0)},function(t,e,r){"use strict";var n=r(0),o=r(66)(!0);n(n.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),r(50)("includes")},function(t,e,r){var n=r(0),o=r(101)(),i=r(5).process,a="process"==r(22)(i);n(n.G,{asap:function(t){var e=a&&i.domain;o(e?e.bind(t):t)}})},function(t,e,r){var n=r(0),o=r(22);n(n.S,"Error",{isError:function(t){return"Error"===o(t)}})},function(t,e,r){var n=r(0);n(n.P+n.R,"Map",{toJSON:r(140)("Map")})},function(t,e,r){var n=r(0);n(n.S,"Math",{iaddh:function(t,e,r,n){var o=t>>>0,i=e>>>0,a=r>>>0;return i+(n>>>0)+((o&a|(o|a)&~(o+a>>>0))>>>31)|0}})},function(t,e,r){var n=r(0);n(n.S,"Math",{imulh:function(t,e){var r=65535,n=+t,o=+e,i=n&r,a=o&r,s=n>>16,u=o>>16,c=(s*a>>>0)+(i*a>>>16);return s*u+(c>>16)+((i*u>>>0)+(c&r)>>16)}})},function(t,e,r){var n=r(0);n(n.S,"Math",{isubh:function(t,e,r,n){var o=t>>>0,i=e>>>0,a=r>>>0;return i-(n>>>0)-((~o&a|~(o^a)&o-a>>>0)>>>31)|0}})},function(t,e,r){var n=r(0);n(n.S,"Math",{umulh:function(t,e){var r=65535,n=+t,o=+e,i=n&r,a=o&r,s=n>>>16,u=o>>>16,c=(s*a>>>0)+(i*a>>>16);return s*u+(c>>>16)+((i*u>>>0)+(c&r)>>>16)}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(14),a=r(10);r(9)&&n(n.P+r(73),"Object",{__defineGetter__:function(t,e){a.f(o(this),t,{get:i(e),enumerable:!0,configurable:!0})}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(14),a=r(10);r(9)&&n(n.P+r(73),"Object",{__defineSetter__:function(t,e){a.f(o(this),t,{set:i(e),enumerable:!0,configurable:!0})}})},function(t,e,r){var n=r(0),o=r(151)(!0);n(n.S,"Object",{entries:function(t){return o(t)}})},function(t,e,r){var n=r(0),o=r(152),i=r(18),a=r(20),s=r(89);n(n.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,r=i(t),n=a.f,u=o(r),c={},l=0;u.length>l;)s(c,e=u[l++],n(r,e));return c}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(28),a=r(21),s=r(20).f;r(9)&&n(n.P+r(73),"Object",{__lookupGetter__:function(t){var e,r=o(this),n=i(t,!0);do if(e=s(r,n))return e.get;while(r=a(r))}})},function(t,e,r){"use strict";var n=r(0),o=r(12),i=r(28),a=r(21),s=r(20).f;r(9)&&n(n.P+r(73),"Object",{__lookupSetter__:function(t){var e,r=o(this),n=i(t,!0);do if(e=s(r,n))return e.set;while(r=a(r))}})},function(t,e,r){var n=r(0),o=r(151)(!1);n(n.S,"Object",{values:function(t){return o(t)}})},function(t,e,r){"use strict";var n=r(0),o=r(5),i=r(30),a=r(101)(),s=r(8)("observable"),u=r(14),c=r(2),l=r(38),f=r(43),p=r(15),h=r(51),d=h.RETURN,v=function(t){return null==t?void 0:u(t)},y=function(t){var e=t._c;e&&(t._c=void 0,e())},g=function(t){return void 0===t._o},_=function(t){g(t)||(t._o=void 0,y(t))},b=function(t,e){c(t),this._c=void 0,this._o=t,t=new m(this);try{var r=e(t),n=r;null!=r&&("function"==typeof r.unsubscribe?r=function(){n.unsubscribe()}:u(r),this._c=r)}catch(e){return void t.error(e)}g(this)&&y(this)};b.prototype=f({},{unsubscribe:function(){_(this)}});var m=function(t){this._s=t};m.prototype=f({},{next:function(t){var e=this._s;if(!g(e)){var r=e._o;try{var n=v(r.next);if(n)return n.call(r,t)}catch(t){try{_(e)}finally{throw t}}}},error:function(t){var e=this._s;if(g(e))throw t;var r=e._o;e._o=void 0;try{var n=v(r.error);if(!n)throw t;t=n.call(r,t)}catch(t){try{y(e)}finally{throw t}}return y(e),t},complete:function(t){var e=this._s;if(!g(e)){var r=e._o;e._o=void 0;try{var n=v(r.complete);t=n?n.call(r,t):void 0}catch(t){try{y(e)}finally{throw t}}return y(e),t}}});var w=function(t){l(this,w,"Observable","_f")._f=u(t)};f(w.prototype,{subscribe:function(t){return new b(t,this._f)},forEach:function(t){var e=this;return new(i.Promise||o.Promise)(function(r,n){u(t);var o=e.subscribe({next:function(e){try{return t(e)}catch(t){n(t),o.unsubscribe()}},error:n,complete:r})})}}),f(w,{from:function(t){var e="function"==typeof this?this:w,r=v(c(t)[s]);if(r){var n=c(r.call(t));return n.constructor===e?n:new e(function(t){return n.subscribe(t)})}return new e(function(e){var r=!1;return a(function(){if(!r){try{if(h(t,!1,function(t){if(e.next(t),r)return d})===d)return}catch(t){if(r)throw t;return void e.error(t)}e.complete()}}),function(){r=!0}})},of:function(){for(var t=0,e=arguments.length,r=Array(e);t1?arguments[1]:void 0,!1)}})},function(t,e,r){"use strict";var n=r(0),o=r(156);n(n.P,"String",{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,e,r){"use strict";r(54)("trimLeft",function(t){return function(){return t(this,1)}},"trimStart")},function(t,e,r){"use strict";r(54)("trimRight",function(t){return function(){return t(this,2)}},"trimEnd")},function(t,e,r){r(111)("asyncIterator")},function(t,e,r){r(111)("observable")},function(t,e,r){var n=r(0);n(n.S,"System",{global:r(5)})},function(t,e,r){for(var n=r(113),o=r(16),i=r(5),a=r(15),s=r(52),u=r(8),c=u("iterator"),l=u("toStringTag"),f=s.Array,p=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],h=0;h<5;h++){var d,v=p[h],y=i[v],g=y&&y.prototype;if(g){g[c]||a(g,c,f),g[l]||a(g,l,v),s[v]=f;for(d in n)g[d]||o(g,d,n[d],!0)}}},function(t,e,r){var n=r(0),o=r(109);n(n.G+n.B,{setImmediate:o.set,clearImmediate:o.clear})},function(t,e,r){var n=r(5),o=r(0),i=r(70),a=r(257),s=n.navigator,u=!!s&&/MSIE .\./.test(s.userAgent),c=function(t){return u?function(e,r){return t(i(a,[].slice.call(arguments,2),"function"==typeof e?e:Function(e)),r)}:t};o(o.G+o.B+o.F*u,{setTimeout:c(n.setTimeout),setInterval:c(n.setInterval)})},function(t,e,r){r(380),r(319),r(321),r(320),r(323),r(325),r(330),r(324),r(322),r(332),r(331),r(327),r(328),r(326),r(318),r(329),r(333),r(334),r(286),r(288),r(287),r(336),r(335),r(306),r(316),r(317),r(307),r(308),r(309),r(310),r(311),r(312),r(313),r(314),r(315),r(289),r(290),r(291),r(292),r(293),r(294),r(295),r(296),r(297),r(298),r(299),r(300),r(301),r(302),r(303),r(304),r(305),r(367),r(372),r(379),r(370),r(362),r(363),r(368),r(373),r(375),r(358),r(359),r(360),r(361),r(364),r(365),r(366),r(369),r(371),r(374),r(376),r(377),r(378),r(281),r(283),r(282),r(285),r(284),r(270),r(268),r(274),r(271),r(277),r(279),r(267),r(273),r(264),r(278),r(262),r(276),r(275),r(269),r(272),r(261),r(263),r(266),r(265),r(280),r(113),r(352),r(357),r(159),r(353),r(354),r(355),r(356),r(337),r(158),r(160),r(161),r(392),r(381),r(382),r(387),r(390),r(391),r(385),r(388),r(386),r(389),r(383),r(384),r(338),r(339),r(340),r(341),r(342),r(345),r(343),r(344),r(346),r(347),r(348),r(349),r(351),r(350),r(393),r(419),r(422),r(421),r(423),r(424),r(420),r(425),r(426),r(404),r(407),r(403),r(401),r(402),r(405),r(406),r(396),r(418),r(427),r(395),r(397),r(399),r(398),r(400),r(409),r(410),r(412),r(411),r(414),r(413),r(415),r(416),r(417),r(394),r(408),r(430),r(429),r(428),t.exports=r(30)},function(t,e,r){"use strict";function n(t,e,r){var n,o,i=t.length,a=e.arrayArgs.length,s=e.indexArgs.length>0,u=[],c=[],l=0,f=0;for(n=0;n=0;--n)l=t[n],u.push(["for(i",n,"=0;i",n,"0&&u.push(["index[",f,"]-=s",f].join("")),u.push(["++index[",l,"]"].join(""))),u.push("}")}return u.join("\n")}function o(t,e,r,o){for(var i=e.length,a=r.arrayArgs.length,s=r.blockSize,u=r.indexArgs.length>0,c=[],l=0;l0;){"].join("")),c.push(["if(j",l,"<",s,"){"].join("")),c.push(["s",e[l],"=j",l].join("")),c.push(["j",l,"=0"].join("")),c.push(["}else{s",e[l],"=",s].join("")),c.push(["j",l,"-=",s,"}"].join("")),u&&c.push(["index[",e[l],"]=j",l].join(""));for(var l=0;l0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}function u(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,u=new Array(t.arrayArgs.length),l=new Array(t.arrayArgs.length),f=0;f0&&w.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var x=new Array(r),f=0;f3&&m.push(a(t.pre,t,l));var S=a(t.body,t,l),k=i(y);k3&&m.push(a(t.post,t,l)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+m.join("\n")+"\n----------");var P=[t.funcName||"unnamed","_cwise_loop_",u[0].join("s"),"m",k,s(l)].join(""),A=new Function(["function ",P,"(",b.join(","),"){",m.join("\n"),"} return ",P].join(""));return A()}var c=r(188);t.exports=u},function(t,e,r){"use strict";function n(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],a=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],u=[],c=[],l=0;l0&&(u.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[l]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[l])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var l=0;l=0){var c=_[u],l=h(n);l&j&&(c.lvalue=!0),l&E&&(c.rvalue=!0),++c.count,s(n,c.name)}else i(a)||s(n,e(a))}else if("Literal"===n.type)"string"==typeof n.value&&s(n,f(n.value));else{if("WithStatement"===n.type)throw new Error("cwise-parser: with() statements not allowed");for(var p=Object.keys(n),d=0,v=p.length;d=48&&t<=57}function n(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function o(t){return"01234567".indexOf(t)>=0}function i(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function a(t){return 10===t||13===t||8232===t||8233===t}function s(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&ie.NonAsciiIdentifierStart.test(String.fromCharCode(t))}function u(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&ie.NonAsciiIdentifierPart.test(String.fromCharCode(t))}function c(t){switch(t){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function l(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function f(t){return"eval"===t||"arguments"===t}function p(t){if(ue&&l(t))return!0;switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}}function h(t,r,n,o,i){var a;e("number"==typeof n,"Comment must have valid position"),ve.lastCommentStart>=n||(ve.lastCommentStart=n,a={type:t,value:r},ye.range&&(a.range=[n,o]),ye.loc&&(a.loc=i),ye.comments.push(a),ye.attachComment&&(ye.leadingComments.push(a),ye.trailingComments.push(a)))}function d(t){var e,r,n,o;for(e=ce-t,r={start:{line:le,column:ce-fe-t}};ce=pe&&V({},oe.UnexpectedToken,"ILLEGAL");else if(42===r){if(47===se.charCodeAt(ce+1))return++ce,++ce,void(ye.comments&&(n=se.slice(t+2,ce-2),e.end={line:le,column:ce-fe},h("Block",n,t,ce,e)));++ce}else++ce;V({},oe.UnexpectedToken,"ILLEGAL")}function y(){var t,e;for(e=0===ce;ce>>="===n?(ce+=4,{type:Jt.Punctuator,value:n,lineNumber:le,lineStart:fe,start:o,end:ce}):(r=n.substr(0,3),">>>"===r||"<<="===r||">>="===r?(ce+=3,{type:Jt.Punctuator,value:r,lineNumber:le,lineStart:fe,start:o,end:ce}):(e=r.substr(0,2),a===e[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?(ce+=2,{type:Jt.Punctuator,value:e,lineNumber:le,lineStart:fe,start:o,end:ce}):"<>=!+-*%&|^/".indexOf(a)>=0?(++ce,{type:Jt.Punctuator,value:a,lineNumber:le,lineStart:fe,start:o,end:ce}):void V({},oe.UnexpectedToken,"ILLEGAL")))}function x(t){for(var e="";ce=0&&ce0&&(n=ye.tokens[ye.tokens.length-1],n.range[0]===t&&"Punctuator"===n.type&&("/"!==n.value&&"/="!==n.value||ye.tokens.pop())),ye.tokens.push({type:"RegularExpression",value:r.literal,range:[t,ce],loc:e})),r}function T(t){return t.type===Jt.Identifier||t.type===Jt.Keyword||t.type===Jt.BooleanLiteral||t.type===Jt.NullLiteral}function R(){var t,e;if(t=ye.tokens[ye.tokens.length-1],!t)return C();if("Punctuator"===t.type){if("]"===t.value)return w();if(")"===t.value)return e=ye.tokens[ye.openParenToken-1],!e||"Keyword"!==e.type||"if"!==e.value&&"while"!==e.value&&"for"!==e.value&&"with"!==e.value?w():C();if("}"===t.value){if(ye.tokens[ye.openCurlyToken-3]&&"Keyword"===ye.tokens[ye.openCurlyToken-3].type){if(e=ye.tokens[ye.openCurlyToken-4],!e)return w()}else{if(!ye.tokens[ye.openCurlyToken-4]||"Keyword"!==ye.tokens[ye.openCurlyToken-4].type)return w();if(e=ye.tokens[ye.openCurlyToken-5],!e)return C()}return ee.indexOf(e.value)>=0?w():C()}return C()}return"Keyword"===t.type&&"this"!==t.value?C():w()}function F(){var t;return y(),ce>=pe?{type:Jt.EOF,lineNumber:le,lineStart:fe,start:ce,end:ce}:(t=se.charCodeAt(ce),s(t)?m():40===t||41===t||59===t?w():39===t||34===t?S():46===t?r(se.charCodeAt(ce+1))?E():w():r(t)?E():ye.tokenize&&47===t?R():w())}function I(){var t,e,r;return y(),t={start:{line:le,column:ce-fe}},e=F(),t.end={line:le,column:ce-fe},e.type!==Jt.EOF&&(r=se.slice(e.start,e.end),ye.tokens.push({type:te[e.type],value:r,range:[e.start,e.end],loc:t})),e}function D(){var t;return t=de,ce=t.end,le=t.lineNumber,fe=t.lineStart,de="undefined"!=typeof ye.tokens?I():F(),ce=t.end,le=t.lineNumber,fe=t.lineStart,t}function L(){var t,e,r;t=ce,e=le,r=fe,de="undefined"!=typeof ye.tokens?I():F(),ce=t,le=e,fe=r}function N(t,e){this.line=t,this.column=e}function U(t,e,r,n){this.start=new N(t,e),this.end=new N(r,n)}function B(){var t,e,r,n;return t=ce,e=le,r=fe,y(),n=le!==e,ce=t,le=e,fe=r,n}function V(t,r){var n,o=Array.prototype.slice.call(arguments,2),i=r.replace(/%(\d)/g,function(t,r){return e(r>="===t||">>>="===t||"&="===t||"^="===t||"|="===t)}function K(){var t,e=ce,r=le,n=fe,o=de;return 59===se.charCodeAt(ce)||H(";")?void D():(t=le,y(),le!==t?(ce=e,le=r,fe=n,void(de=o)):void(de.type===Jt.EOF||H("}")||z(de)))}function X(t){return t.type===re.Identifier||t.type===re.MemberExpression}function Z(){var t,e=[];for(t=de,q("[");!H("]");)H(",")?(D(),e.push(null)):(e.push(yt()),H("]")||q(","));return D(),he.markEnd(he.createArrayExpression(e),t)}function Q(t,e){var r,n,o;return r=ue,o=de,n=zt(),e&&ue&&f(t[0].name)&&W(e,oe.StrictParamName),ue=r,he.markEnd(he.createFunctionExpression(null,t,[],n),o)}function J(){var t,e;return e=de,t=D(),t.type===Jt.StringLiteral||t.type===Jt.NumericLiteral?(ue&&t.octal&&W(t,oe.StrictOctalLiteral),he.markEnd(he.createLiteral(t),e)):he.markEnd(he.createIdentifier(t.value),e)}function tt(){var t,e,r,n,o,i;return t=de,i=de,t.type===Jt.Identifier?(r=J(),"get"!==t.value||H(":")?"set"!==t.value||H(":")?(q(":"),n=yt(),he.markEnd(he.createProperty("init",r,n),i)):(e=J(),q("("),t=de,t.type!==Jt.Identifier?(q(")"),W(t,oe.UnexpectedToken,t.value),n=Q([])):(o=[mt()],q(")"),n=Q(o,t)),he.markEnd(he.createProperty("set",e,n),i)):(e=J(),q("("),q(")"),n=Q([]),he.markEnd(he.createProperty("get",e,n),i))):t.type!==Jt.EOF&&t.type!==Jt.Punctuator?(e=J(),q(":"),n=yt(),he.markEnd(he.createProperty("init",e,n),i)):void z(t)}function et(){var t,e,r,n,o,i=[],a={},s=String;for(o=de,q("{");!H("}");)t=tt(),e=t.key.type===re.Identifier?t.key.name:s(t.key.value),n="init"===t.kind?ne.Data:"get"===t.kind?ne.Get:ne.Set,r="$"+e,Object.prototype.hasOwnProperty.call(a,r)?(a[r]===ne.Data?ue&&n===ne.Data?W({},oe.StrictDuplicateProperty):n!==ne.Data&&W({},oe.AccessorDataProperty):n===ne.Data?W({},oe.AccessorDataProperty):a[r]&n&&W({},oe.AccessorGetSet),a[r]|=n):a[r]=n,i.push(t),H("}")||q(",");return q("}"),he.markEnd(he.createObjectExpression(i),o)}function rt(){var t;return q("("),t=gt(),q(")"),t}function nt(){var t,e,r,n;if(H("("))return rt();if(H("["))return Z();if(H("{"))return et();if(t=de.type,n=de,t===Jt.Identifier)r=he.createIdentifier(D().value);else if(t===Jt.StringLiteral||t===Jt.NumericLiteral)ue&&de.octal&&W(de,oe.StrictOctalLiteral),r=he.createLiteral(D());else if(t===Jt.Keyword){if(Y("function"))return Ht();Y("this")?(D(),r=he.createThisExpression()):z(D())}else t===Jt.BooleanLiteral?(e=D(),e.value="true"===e.value,r=he.createLiteral(e)):t===Jt.NullLiteral?(e=D(),e.value=null,r=he.createLiteral(e)):H("/")||H("/=")?(r="undefined"!=typeof ye.tokens?he.createLiteral(C()):he.createLiteral(M()),L()):z(D());return he.markEnd(r,n)}function ot(){var t=[];if(q("("),!H(")"))for(;ce":case"<=":case">=":case"instanceof":r=7;break;case"in":r=e?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11}return r}function dt(){var t,e,r,n,o,i,a,s,u,c;if(t=de,u=pt(),n=de,o=ht(n,ve.allowIn),0===o)return u;for(n.prec=o,D(),e=[t,de],a=pt(),i=[u,n,a];(o=ht(de,ve.allowIn))>0;){for(;i.length>2&&o<=i[i.length-2].prec;)a=i.pop(),s=i.pop().value,u=i.pop(),r=he.createBinaryExpression(s,u,a),e.pop(),t=e[e.length-1],he.markEnd(r,t),i.push(r);n=D(),n.prec=o,i.push(n),e.push(de),r=pt(),i.push(r)}for(c=i.length-1,r=i[c],e.pop();c>1;)r=he.createBinaryExpression(i[c-1].value,i[c-2],r),c-=2,t=e.pop(),he.markEnd(r,t);return r}function vt(){var t,e,r,n,o;return o=de,t=dt(),H("?")&&(D(),e=ve.allowIn,ve.allowIn=!0,r=yt(),ve.allowIn=e,q(":"),n=yt(),t=he.createConditionalExpression(t,r,n),he.markEnd(t,o)),t}function yt(){var t,e,r,n,o;return t=de,o=de,n=e=vt(),$()&&(X(e)||W({},oe.InvalidLHSInAssignment),ue&&e.type===re.Identifier&&f(e.name)&&W(t,oe.StrictLHSAssignment),t=D(),r=yt(),n=he.markEnd(he.createAssignmentExpression(t.value,e,r),o)),n}function gt(){var t,e=de;if(t=yt(),H(",")){for(t=he.createSequenceExpression([t]);ce0?1:0,fe=0,pe=se.length,de=null,ve={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},ye={},e=e||{},e.tokens=!0,ye.tokens=[],ye.tokenize=!0,ye.openParenToken=-1,ye.openCurlyToken=-1,ye.range="boolean"==typeof e.range&&e.range,ye.loc="boolean"==typeof e.loc&&e.loc,"boolean"==typeof e.comment&&e.comment&&(ye.comments=[]),"boolean"==typeof e.tolerant&&e.tolerant&&(ye.errors=[]);try{if(L(),de.type===Jt.EOF)return ye.tokens;for(n=D();de.type!==Jt.EOF;)try{n=D()}catch(t){if(n=de,ye.errors){ye.errors.push(t);break}throw t}Xt(),o=ye.tokens,"undefined"!=typeof ye.comments&&(o.comments=ye.comments),"undefined"!=typeof ye.errors&&(o.errors=ye.errors)}catch(t){throw t}finally{ye={}}return o}function Qt(t,e){var r,n;n=String,"string"==typeof t||t instanceof String||(t=n(t)),he=ae,se=t,ce=0,le=se.length>0?1:0,fe=0,pe=se.length,de=null,ve={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},ye={},"undefined"!=typeof e&&(ye.range="boolean"==typeof e.range&&e.range,ye.loc="boolean"==typeof e.loc&&e.loc,ye.attachComment="boolean"==typeof e.attachComment&&e.attachComment,ye.loc&&null!==e.source&&void 0!==e.source&&(ye.source=n(e.source)),"boolean"==typeof e.tokens&&e.tokens&&(ye.tokens=[]),"boolean"==typeof e.comment&&e.comment&&(ye.comments=[]),"boolean"==typeof e.tolerant&&e.tolerant&&(ye.errors=[]),ye.attachComment&&(ye.range=!0,ye.comments=[],ye.bottomRightStack=[],ye.trailingComments=[],ye.leadingComments=[]));try{r=Kt(),"undefined"!=typeof ye.comments&&(r.comments=ye.comments),"undefined"!=typeof ye.tokens&&(Xt(),r.tokens=ye.tokens),"undefined"!=typeof ye.errors&&(r.errors=ye.errors)}catch(t){throw t}finally{ye={}}return r}var Jt,te,ee,re,ne,oe,ie,ae,se,ue,ce,le,fe,pe,he,de,ve,ye;Jt={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9},te={},te[Jt.BooleanLiteral]="Boolean",te[Jt.EOF]="",te[Jt.Identifier]="Identifier",te[Jt.Keyword]="Keyword",te[Jt.NullLiteral]="Null",te[Jt.NumericLiteral]="Numeric",te[Jt.Punctuator]="Punctuator",te[Jt.StringLiteral]="String",te[Jt.RegularExpression]="RegularExpression",ee=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],re={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},ne={Data:1,Get:2,Set:4},oe={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode", StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},ie={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},ae={name:"SyntaxTree",processComment:function(t){var e,r;if(!(t.type===re.Program&&t.body.length>0)){for(ye.trailingComments.length>0?ye.trailingComments[0].range[0]>=t.range[1]?(r=ye.trailingComments,ye.trailingComments=[]):ye.trailingComments.length=0:ye.bottomRightStack.length>0&&ye.bottomRightStack[ye.bottomRightStack.length-1].trailingComments&&ye.bottomRightStack[ye.bottomRightStack.length-1].trailingComments[0].range[0]>=t.range[1]&&(r=ye.bottomRightStack[ye.bottomRightStack.length-1].trailingComments,delete ye.bottomRightStack[ye.bottomRightStack.length-1].trailingComments);ye.bottomRightStack.length>0&&ye.bottomRightStack[ye.bottomRightStack.length-1].range[0]>=t.range[0];)e=ye.bottomRightStack.pop();e?e.leadingComments&&e.leadingComments[e.leadingComments.length-1].range[1]<=t.range[0]&&(t.leadingComments=e.leadingComments,delete e.leadingComments):ye.leadingComments.length>0&&ye.leadingComments[ye.leadingComments.length-1].range[1]<=t.range[0]&&(t.leadingComments=ye.leadingComments,ye.leadingComments=[]),r&&(t.trailingComments=r),ye.bottomRightStack.push(t)}},markEnd:function(t,e){return ye.range&&(t.range=[e.start,ce]),ye.loc&&(t.loc=new U(void 0===e.startLineNumber?e.lineNumber:e.startLineNumber,e.start-(void 0===e.startLineStart?e.lineStart:e.startLineStart),le,ce-fe),this.postProcess(t)),ye.attachComment&&this.processComment(t),t},postProcess:function(t){return ye.source&&(t.loc.source=ye.source),t},createArrayExpression:function(t){return{type:re.ArrayExpression,elements:t}},createAssignmentExpression:function(t,e,r){return{type:re.AssignmentExpression,operator:t,left:e,right:r}},createBinaryExpression:function(t,e,r){var n="||"===t||"&&"===t?re.LogicalExpression:re.BinaryExpression;return{type:n,operator:t,left:e,right:r}},createBlockStatement:function(t){return{type:re.BlockStatement,body:t}},createBreakStatement:function(t){return{type:re.BreakStatement,label:t}},createCallExpression:function(t,e){return{type:re.CallExpression,callee:t,arguments:e}},createCatchClause:function(t,e){return{type:re.CatchClause,param:t,body:e}},createConditionalExpression:function(t,e,r){return{type:re.ConditionalExpression,test:t,consequent:e,alternate:r}},createContinueStatement:function(t){return{type:re.ContinueStatement,label:t}},createDebuggerStatement:function(){return{type:re.DebuggerStatement}},createDoWhileStatement:function(t,e){return{type:re.DoWhileStatement,body:t,test:e}},createEmptyStatement:function(){return{type:re.EmptyStatement}},createExpressionStatement:function(t){return{type:re.ExpressionStatement,expression:t}},createForStatement:function(t,e,r,n){return{type:re.ForStatement,init:t,test:e,update:r,body:n}},createForInStatement:function(t,e,r){return{type:re.ForInStatement,left:t,right:e,body:r,each:!1}},createFunctionDeclaration:function(t,e,r,n){return{type:re.FunctionDeclaration,id:t,params:e,defaults:r,body:n,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(t,e,r,n){return{type:re.FunctionExpression,id:t,params:e,defaults:r,body:n,rest:null,generator:!1,expression:!1}},createIdentifier:function(t){return{type:re.Identifier,name:t}},createIfStatement:function(t,e,r){return{type:re.IfStatement,test:t,consequent:e,alternate:r}},createLabeledStatement:function(t,e){return{type:re.LabeledStatement,label:t,body:e}},createLiteral:function(t){return{type:re.Literal,value:t.value,raw:se.slice(t.start,t.end)}},createMemberExpression:function(t,e,r){return{type:re.MemberExpression,computed:"["===t,object:e,property:r}},createNewExpression:function(t,e){return{type:re.NewExpression,callee:t,arguments:e}},createObjectExpression:function(t){return{type:re.ObjectExpression,properties:t}},createPostfixExpression:function(t,e){return{type:re.UpdateExpression,operator:t,argument:e,prefix:!1}},createProgram:function(t){return{type:re.Program,body:t}},createProperty:function(t,e,r){return{type:re.Property,key:e,value:r,kind:t}},createReturnStatement:function(t){return{type:re.ReturnStatement,argument:t}},createSequenceExpression:function(t){return{type:re.SequenceExpression,expressions:t}},createSwitchCase:function(t,e){return{type:re.SwitchCase,test:t,consequent:e}},createSwitchStatement:function(t,e){return{type:re.SwitchStatement,discriminant:t,cases:e}},createThisExpression:function(){return{type:re.ThisExpression}},createThrowStatement:function(t){return{type:re.ThrowStatement,argument:t}},createTryStatement:function(t,e,r,n){return{type:re.TryStatement,block:t,guardedHandlers:e,handlers:r,finalizer:n}},createUnaryExpression:function(t,e){return"++"===t||"--"===t?{type:re.UpdateExpression,operator:t,argument:e,prefix:!0}:{type:re.UnaryExpression,operator:t,argument:e,prefix:!0}},createVariableDeclaration:function(t,e){return{type:re.VariableDeclaration,declarations:t,kind:e}},createVariableDeclarator:function(t,e){return{type:re.VariableDeclarator,id:t,init:e}},createWhileStatement:function(t,e){return{type:re.WhileStatement,test:t,body:e}},createWithStatement:function(t,e){return{type:re.WithStatement,object:t,body:e}}},t.version="1.2.5",t.tokenize=Zt,t.parse=Qt,t.Syntax=function(){var t,e={};"function"==typeof Object.create&&(e=Object.create(null));for(t in re)re.hasOwnProperty(t)&&(e[t]=re[t]);return"function"==typeof Object.freeze&&Object.freeze(e),e}()})},function(t,e){e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,l=-7,f=r?o-1:0,p=r?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+t[e+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:(h?-1:1)*(1/0);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+f>=1?p/u:p*Math.pow(2,1-f),e*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*u-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&s,h+=d,s/=256,o-=8);for(a=a<0;t[r+h]=255&a,h+=d,a/=256,c-=8);t[r+h-d]|=128*v}},function(t,e){"use strict";function r(t){for(var e=new Array(t),r=0;r * @license MIT */ -t.exports=function(t){return null!=t&&(r(t)||n(t)||!!t._isBuffer)}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n=r(47),o=r(29),i=n(o,"DataView");t.exports=i},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++eo?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n=n?t:o(t,e,r)}var o=r(476);t.exports=n},function(t,e,r){var n=r(29),o=n["__core-js_shared__"];t.exports=o},function(t,e,r){function n(t,e){return function(r,n){if(null==r)return r;if(!o(r))return t(r,n);for(var i=r.length,a=e?i:-1,s=Object(r);(e?a--:++a-1?s[u?e[c]:c]:void 0}}var o=r(80),i=r(84),a=r(48);t.exports=n},function(t,e,r){function n(t){return function(e,r,n){return n&&"number"!=typeof n&&i(e,r,n)&&(r=n=void 0),e=a(e),void 0===r?(r=e,e=0):r=a(r),n=void 0===n?e-1}var o=r(79);t.exports=n},function(t,e,r){function n(t,e){var r=this.__data__,n=o(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var o=r(79);t.exports=n},function(t,e,r){function n(){this.size=0,this.__data__={hash:new o,map:new(a||i),string:new o}}var o=r(441),i=r(77),a=r(114);t.exports=n},function(t,e,r){function n(t){var e=o(this,t).delete(t);return this.size-=e?1:0,e}var o=r(81);t.exports=n},function(t,e,r){function n(t){return o(this,t).get(t)}var o=r(81);t.exports=n},function(t,e,r){function n(t){return o(this,t).has(t)}var o=r(81);t.exports=n},function(t,e,r){function n(t,e){var r=o(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var o=r(81);t.exports=n},function(t,e,r){function n(t){var e=o(t,function(t){return r.size===i&&r.clear(),t}),r=e.cache;return e}var o=r(553),i=500;t.exports=n},function(t,e,r){var n=r(523),o=n(Object.keys,Object);t.exports=o},function(t,e,r){(function(t){var n=r(172),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o,s=a&&n.process,u=function(){try{return s&&s.binding("util")}catch(t){}}();t.exports=u}).call(e,r(87)(t))},function(t,e){function r(t,e){return function(r){return t(e(r))}}t.exports=r},function(t,e,r){function n(t,e,r){return e=i(void 0===e?t.length-1:e,0),function(){for(var n=arguments,a=-1,s=i(n.length-e,0),u=Array(s);++a0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var n=500,o=16,i=Date.now;t.exports=r},function(t,e,r){function n(){this.__data__=new o,this.size=0}var o=r(77);t.exports=n},function(t,e){function r(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}t.exports=r},function(t,e){function r(t){return this.__data__.get(t)}t.exports=r},function(t,e){function r(t){return this.__data__.has(t)}t.exports=r},function(t,e,r){function n(t,e){var r=this.__data__;if(r instanceof o){var n=r.__data__;if(!i||n.length=0;e--,o+=n)i+=Math.abs(r[o]);return i}},function(t,e){"use strict";t.exports=function(t,e,r){var n,o=e.data,i=r.data,a=e.stride[0],s=r.stride[0],u=e.offset,c=r.offset;for(n=e.shape[0]-1;n>=0;n--,u+=a,c+=s)i[c]+=t*o[u]}},function(t,e){"use strict";t.exports=function(t,e){var r,n=t.data,o=e.data,i=t.stride[0],a=e.stride[0],s=t.offset,u=e.offset;for(r=t.shape[0]-1;r>=0;r--,s+=i,u+=a)o[u]=n[s]}},function(t,e){"use strict";t.exports=function(t,e,r){var n,o=e.data,i=r.data,a=e.stride[0],s=r.stride[0],u=e.offset,c=r.offset;for(n=e.shape[0]-1;n>=0;n--,u+=a,c+=s)i[c]=t*o[u]}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o=t.data,i=t.stride[0],a=t.offset,s=0;if(t===e)for(r=t.shape[0]-1;r>=0;r--,a+=i)n=o[a],s+=n*n;else{var u=e.data,c=e.stride[0],l=e.offset;for(r=t.shape[0]-1;r>=0;r--,a+=i,l+=c)s+=u[l]*o[a]}return s}},function(t,e){"use strict";t.exports=function(t){var e,r,n,o=-(1/0),i=t.data,a=t.stride[0],s=t.offset,u=t.shape[0];for(e=0;eo&&(o=r,n=e);return n}},function(t,e){"use strict";var r=function(t,e){if(0===t&&0===e)return 0;var r=Math.abs(t),n=Math.abs(e),o=Math.min(r,n),i=Math.max(r,n);return o/=i,i*Math.sqrt(1+o*o)};t.exports=function(t){var e,n,o=t.data,i=t.stride[0],a=t.offset,s=0;for(e=t.shape[0]-1;e>=0;e--,a+=i)n=o[a],s=r(s,n);return s}},function(t,e){"use strict";Math.sign=Math.sign||function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1},t.exports=function(t,e,r){var n=0,o=0,i=0,a=0,s=0;return 0===e?(n=Math.sign(t),o=0,i=Math.abs(t)):0===t?(n=0,o=Math.sign(e),i=Math.abs(e)):Math.abs(t)>Math.abs(e)?(a=e/t,s=Math.sign(t)*Math.sqrt(1+a*a),n=1/s,o=a*n,i=t*s):(a=t/e,s=Math.sign(t)*Math.sqrt(1+a*a),o=1/s,n=a*o,i=e*s),void 0!==r&&r.length>2?(r[0]=n,r[1]=o,r[2]=i,void 0):[n,o,i]}},function(t,e){"use strict";t.exports=function(t,e){var r,n=e.data,o=e.stride[0],i=e.offset;for(r=e.shape[0]-1;r>=0;r--,i+=o)n[i]*=t}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o=t.data,i=e.data,a=t.stride[0],s=e.stride[0],u=t.offset,c=e.offset;for(r=t.shape[0]-1;r>=0;r--,u+=a,c+=s)n=o[u],o[u]=i[c],i[c]=n}},function(t,e){"use strict";function r(t,e,r,n,o,i,a){for(var s=0,u=0,c=0,l=0,f=0,p=t.shape[0],h=t.shape[1],d=Math.min(e,p-1),v=Math.min(r,h-1),y=void 0===i?1:i,g=void 0===a?0:a;s<=d;){l=0;var _=Math.min(s+v,h-1);for(c=0;c<=_;c++)l+=t.get(s,c)*n.get(c);o.set(s,l*y+g*o.get(s)),s++}if(s=0;s--)i.set(s,i.get(s)*n+t*a(e.pick(s,null),r));return!0}var o=r(86);t.exports=n},function(t,e){"use strict";function r(){console.error("GER (rank 1 operation A := alpha*x*y' + A) not yet implemented")}t.exports=r},function(t,e){"use strict";function r(){console.error("SBMV (symmetric banded matrix vector multiply) not yet implemented")}t.exports=r},function(t,e,r){"use strict";(function(t){function e(){console.error("SPMV (symmetric packed matrix vector multiply) not yet implemented")}t.exporst=e}).call(e,r(87)(t))},function(t,e){"use strict";function r(){console.error("SPR (symmetric packed rank 1 operation A := alpha*x*y' + A) not yet implemented")}t.exports=r},function(t,e){"use strict";function r(){console.error("SPR (symmetric packed rank 2 operation A := alpha*x*y' + alpha*y*x' + A) not yet implemented")}t.exports=r},function(t,e,r){"use strict";function n(t,e,r,n,i,a){var s=t.shape[0],u=n||!0,c=void 0===i?1:i,l=void 0===a?0:a,f=0,p=0,h=0,d=0;if(0===l)for(f=0;f=0;a--)e.set(a,n(t.pick(a,null).hi(a+1),e.hi(a+1)));else for(a=0;a=0;a--)e.set(a,(e.get(a)-n(t.pick(a,null).lo(a+1),e.lo(a+1)))/t.get(a,a));return!0}var o=r(86);t.exports=n},function(t,e,r){"use strict";function n(){var t,e,r,n,u,c,l,f,p,h;if(n=o({},s),0===arguments.length)throw new Error("Array of ndarrays to concatenate must not be empty");if(Array.isArray(arguments[0])?(r=arguments[0],o(n,arguments[1]||{})):2===arguments.length&&(r=arguments[1],t=arguments[0],o(n,arguments[2]||{})),0===r.length)throw new Error("Array of ndarrays to concatenate must not be empty");for(u=0;u0;){","var w",y,"=",f,";","if(i",y,"<",f,"){","w",y,"=i",y,";","i",y,"=0;","}else{","i",y,"-=",f,";","}"); +t.exports=function(t){return null!=t&&(r(t)||n(t)||!!t._isBuffer)}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n=r(47),o=r(29),i=n(o,"DataView");t.exports=i},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++eo?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n=n?t:o(t,e,r)}var o=r(476);t.exports=n},function(t,e,r){var n=r(29),o=n["__core-js_shared__"];t.exports=o},function(t,e,r){function n(t,e){return function(r,n){if(null==r)return r;if(!o(r))return t(r,n);for(var i=r.length,a=e?i:-1,s=Object(r);(e?a--:++a-1?s[u?e[c]:c]:void 0}}var o=r(80),i=r(84),a=r(48);t.exports=n},function(t,e,r){function n(t){return function(e,r,n){return n&&"number"!=typeof n&&i(e,r,n)&&(r=n=void 0),e=a(e),void 0===r?(r=e,e=0):r=a(r),n=void 0===n?e-1}var o=r(79);t.exports=n},function(t,e,r){function n(t,e){var r=this.__data__,n=o(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var o=r(79);t.exports=n},function(t,e,r){function n(){this.size=0,this.__data__={hash:new o,map:new(a||i),string:new o}}var o=r(441),i=r(77),a=r(114);t.exports=n},function(t,e,r){function n(t){var e=o(this,t).delete(t);return this.size-=e?1:0,e}var o=r(81);t.exports=n},function(t,e,r){function n(t){return o(this,t).get(t)}var o=r(81);t.exports=n},function(t,e,r){function n(t){return o(this,t).has(t)}var o=r(81);t.exports=n},function(t,e,r){function n(t,e){var r=o(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var o=r(81);t.exports=n},function(t,e,r){function n(t){var e=o(t,function(t){return r.size===i&&r.clear(),t}),r=e.cache;return e}var o=r(553),i=500;t.exports=n},function(t,e,r){var n=r(523),o=n(Object.keys,Object);t.exports=o},function(t,e,r){(function(t){var n=r(172),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o,s=a&&n.process,u=function(){try{return s&&s.binding("util")}catch(t){}}();t.exports=u}).call(e,r(87)(t))},function(t,e){function r(t,e){return function(r){return t(e(r))}}t.exports=r},function(t,e,r){function n(t,e,r){return e=i(void 0===e?t.length-1:e,0),function(){for(var n=arguments,a=-1,s=i(n.length-e,0),u=Array(s);++a0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var n=500,o=16,i=Date.now;t.exports=r},function(t,e,r){function n(){this.__data__=new o,this.size=0}var o=r(77);t.exports=n},function(t,e){function r(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}t.exports=r},function(t,e){function r(t){return this.__data__.get(t)}t.exports=r},function(t,e){function r(t){return this.__data__.has(t)}t.exports=r},function(t,e,r){function n(t,e){var r=this.__data__;if(r instanceof o){var n=r.__data__;if(!i||n.length=0;e--,o+=n)i+=Math.abs(r[o]);return i}},function(t,e){"use strict";t.exports=function(t,e,r){var n,o=e.data,i=r.data,a=e.stride[0],s=r.stride[0],u=e.offset,c=r.offset;for(n=e.shape[0]-1;n>=0;n--,u+=a,c+=s)i[c]+=t*o[u]}},function(t,e){"use strict";t.exports=function(t,e){var r,n=t.data,o=e.data,i=t.stride[0],a=e.stride[0],s=t.offset,u=e.offset;for(r=t.shape[0]-1;r>=0;r--,s+=i,u+=a)o[u]=n[s]}},function(t,e){"use strict";t.exports=function(t,e,r){var n,o=e.data,i=r.data,a=e.stride[0],s=r.stride[0],u=e.offset,c=r.offset;for(n=e.shape[0]-1;n>=0;n--,u+=a,c+=s)i[c]=t*o[u]}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o=t.data,i=t.stride[0],a=t.offset,s=0;if(t===e)for(r=t.shape[0]-1;r>=0;r--,a+=i)n=o[a],s+=n*n;else{var u=e.data,c=e.stride[0],l=e.offset;for(r=t.shape[0]-1;r>=0;r--,a+=i,l+=c)s+=u[l]*o[a]}return s}},function(t,e){"use strict";t.exports=function(t){var e,r,n,o=-(1/0),i=t.data,a=t.stride[0],s=t.offset,u=t.shape[0];for(e=0;eo&&(o=r,n=e);return n}},function(t,e){"use strict";var r=function(t,e){if(0===t&&0===e)return 0;var r=Math.abs(t),n=Math.abs(e),o=Math.min(r,n),i=Math.max(r,n);return o/=i,i*Math.sqrt(1+o*o)};t.exports=function(t){var e,n,o=t.data,i=t.stride[0],a=t.offset,s=0;for(e=t.shape[0]-1;e>=0;e--,a+=i)n=o[a],s=r(s,n);return s}},function(t,e){"use strict";Math.sign=Math.sign||function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1},t.exports=function(t,e,r){var n=0,o=0,i=0,a=0,s=0;return 0===e?(n=Math.sign(t),o=0,i=Math.abs(t)):0===t?(n=0,o=Math.sign(e),i=Math.abs(e)):Math.abs(t)>Math.abs(e)?(a=e/t,s=Math.sign(t)*Math.sqrt(1+a*a),n=1/s,o=a*n,i=t*s):(a=t/e,s=Math.sign(t)*Math.sqrt(1+a*a),o=1/s,n=a*o,i=e*s),void 0!==r&&r.length>2?(r[0]=n,r[1]=o,r[2]=i,void 0):[n,o,i]}},function(t,e){"use strict";t.exports=function(t,e){var r,n=e.data,o=e.stride[0],i=e.offset;for(r=e.shape[0]-1;r>=0;r--,i+=o)n[i]*=t}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o=t.data,i=e.data,a=t.stride[0],s=e.stride[0],u=t.offset,c=e.offset;for(r=t.shape[0]-1;r>=0;r--,u+=a,c+=s)n=o[u],o[u]=i[c],i[c]=n}},function(t,e){"use strict";function r(t,e,r,n,o,i,a){for(var s=0,u=0,c=0,l=0,f=0,p=t.shape[0],h=t.shape[1],d=Math.min(e,p-1),v=Math.min(r,h-1),y=void 0===i?1:i,g=void 0===a?0:a;s<=d;){l=0;var _=Math.min(s+v,h-1);for(c=0;c<=_;c++)l+=t.get(s,c)*n.get(c);o.set(s,l*y+g*o.get(s)),s++}if(s=0;s--)i.set(s,i.get(s)*n+t*a(e.pick(s,null),r));return!0}var o=r(86);t.exports=n},function(t,e){"use strict";function r(){console.error("GER (rank 1 operation A := alpha*x*y' + A) not yet implemented")}t.exports=r},function(t,e){"use strict";function r(){console.error("SBMV (symmetric banded matrix vector multiply) not yet implemented")}t.exports=r},function(t,e,r){"use strict";(function(t){function e(){console.error("SPMV (symmetric packed matrix vector multiply) not yet implemented")}t.exporst=e}).call(e,r(87)(t))},function(t,e){"use strict";function r(){console.error("SPR (symmetric packed rank 1 operation A := alpha*x*y' + A) not yet implemented")}t.exports=r},function(t,e){"use strict";function r(){console.error("SPR (symmetric packed rank 2 operation A := alpha*x*y' + alpha*y*x' + A) not yet implemented")}t.exports=r},function(t,e,r){"use strict";function n(t,e,r,n,i,a){var s=t.shape[0],u=n||!0,c=void 0===i?1:i,l=void 0===a?0:a,f=0,p=0,h=0,d=0;if(0===l)for(f=0;f=0;a--)e.set(a,n(t.pick(a,null).hi(a+1),e.hi(a+1)));else for(a=0;a=0;a--)e.set(a,(e.get(a)-n(t.pick(a,null).lo(a+1),e.lo(a+1)))/t.get(a,a));return!0}var o=r(86);t.exports=n},function(t,e,r){"use strict";function n(){var t,e,r,n,u,c,l,f,p,h;if(n=o({},s),0===arguments.length)throw new Error("Array of ndarrays to concatenate must not be empty");if(Array.isArray(arguments[0])?(r=arguments[0],o(n,arguments[1]||{})):2===arguments.length&&(r=arguments[1],t=arguments[0],o(n,arguments[2]||{})),0===r.length)throw new Error("Array of ndarrays to concatenate must not be empty");for(u=0;u0;){","var w",y,"=",f,";","if(i",y,"<",f,"){","w",y,"=i",y,";","i",y,"=0;","}else{","i",y,"-=",f,";","}"); l.push.apply(l,n(h,"o",t,"i0","i1","w1")),l.push("for(i=0;i=0&&(l[h]+=a[h],l[h]===s[h]);)l[h]=0,h--}return r}var o=r(186),i=r(4);t.exports=n},function(t,e,r){(function(e,r){!function(e){"use strict";function n(t,e,r,n){var o=Object.create((e||i).prototype),a=new d(n||[]);return o._invoke=f(t,r,a),o}function o(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function i(){}function a(){}function s(){}function u(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){this.arg=t}function l(t){function e(r,n,i,a){var s=o(t[r],t,n);if("throw"!==s.type){var u=s.arg,l=u.value;return l instanceof c?Promise.resolve(l.arg).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(l).then(function(t){u.value=t,i(u)},a)}a(s.arg)}function n(t,r){function n(){return new Promise(function(n,o){e(t,r,n,o)})}return i=i?i.then(n,n):n()}"object"==typeof r&&r.domain&&(e=r.domain.bind(e));var i;this._invoke=n}function f(t,e,r){var n=j;return function(i,a){if(n===S)throw new Error("Generator is already running");if(n===k){if("throw"===i)throw a;return y()}for(;;){var s=r.delegate;if(s){if("return"===i||"throw"===i&&s.iterator[i]===g){r.delegate=null;var u=s.iterator.return;if(u){var c=o(u,s.iterator,a);if("throw"===c.type){i="throw",a=c.arg;continue}}if("return"===i)continue}var c=o(s.iterator[i],s.iterator,a);if("throw"===c.type){r.delegate=null,i="throw",a=c.arg;continue}i="next",a=g;var l=c.arg;if(!l.done)return n=E,l;r[s.resultName]=l.value,r.next=s.nextLoc,r.delegate=null}if("next"===i)r.sent=r._sent=a;else if("throw"===i){if(n===j)throw n=k,a;r.dispatchException(a)&&(i="next",a=g)}else"return"===i&&r.abrupt("return",a);n=S;var c=o(t,e,r);if("normal"===c.type){n=r.done?k:E;var l={value:c.arg,done:r.done};if(c.arg!==P)return l;r.delegate&&"next"===i&&(a=g)}else"throw"===c.type&&(n=k,i="throw",a=c.arg)}}}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t){var e=t[m];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=_.call(o,"catchLoc"),s=_.call(o,"finallyLoc");if(a&&s){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&_.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),h(r),P}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;h(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:v(t),resultName:e,nextLoc:r},P}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this)}).call(e,r(49),r(126))},function(t,e,r){"use strict";(function(t,n){function o(t){if(t){var e=t.length||t.byteLength,r=_.log2(e);x[r].push(t)}}function i(t){o(t.buffer)}function a(t){var t=_.nextPow2(t),e=_.log2(t),r=x[e];return r.length>0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(a(t),0,t)}function u(t){return new Uint16Array(a(2*t),0,t)}function c(t){return new Uint32Array(a(4*t),0,t)}function l(t){return new Int8Array(a(t),0,t)}function f(t){return new Int16Array(a(2*t),0,t)}function p(t){return new Int32Array(a(4*t),0,t)}function h(t){return new Float32Array(a(4*t),0,t)}function d(t){return new Float64Array(a(8*t),0,t)}function v(t){return m?new Uint8ClampedArray(a(t),0,t):s(t)}function y(t){return new DataView(a(t),0,t)}function g(t){t=_.nextPow2(t);var e=_.log2(t),r=O[e];return r.length>0?r.pop():new n(t)}var _=r(249),b=r(163);t.__TYPEDARRAY_POOL||(t.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var m="undefined"!=typeof Uint8ClampedArray,w=t.__TYPEDARRAY_POOL;w.UINT8C||(w.UINT8C=b([32,0])),w.BUFFER||(w.BUFFER=b([32,0]));var x=w.DATA,O=w.BUFFER;e.free=function(t){if(n.isBuffer(t))O[_.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|_.log2(e);x[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeInt8=e.freeInt16=e.freeInt32=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=i,e.freeArrayBuffer=o,e.freeBuffer=function(t){O[_.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return a(t);switch(e){case"uint8":return s(t);case"uint16":return u(t);case"uint32":return c(t);case"int8":return l(t);case"int16":return f(t);case"int32":return p(t);case"float":case"float32":return h(t);case"double":case"float64":return d(t);case"uint8_clamped":return v(t);case"buffer":return g(t);case"data":case"dataview":return y(t);default:return null}return null},e.mallocArrayBuffer=a,e.mallocUint8=s,e.mallocUint16=u,e.mallocUint32=c,e.mallocInt8=l,e.mallocInt16=f,e.mallocInt32=p,e.mallocFloat32=e.mallocFloat=h,e.mallocFloat64=e.mallocDouble=d,e.mallocUint8Clamped=v,e.mallocDataView=y,e.mallocBuffer=g,e.clearCache=function(){for(var t=0;t<32;++t)w.UINT8[t].length=0,w.UINT16[t].length=0,w.UINT32[t].length=0,w.INT8[t].length=0,w.INT16[t].length=0,w.INT32[t].length=0,w.FLOAT[t].length=0,w.DOUBLE[t].length=0,w.UINT8C[t].length=0,x[t].length=0,O[t].length=0}}).call(e,r(49),r(133).Buffer)},function(t,e){function r(t,e){if(!e||"object"!=typeof e)return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}t.exports=r},function(t,e,r){r(190),t.exports=r(189)}])}); \ No newline at end of file