1(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[function(e,t,n){"use strict";n.r(t),function(e,r,i,o){n.d(t,"AdadeltaOptimizer",function(){return Af}),n.d(t,"AdagradOptimizer",function(){return Tf}),n.d(t,"AdamOptimizer",function(){return If}),n.d(t,"AdamaxOptimizer",function(){return Rf}),n.d(t,"DataStorage",function(){return nr}),n.d(t,"ENV",function(){return f}),n.d(t,"Environment",function(){return h}),n.d(t,"KernelBackend",function(){return rr}),n.d(t,"MomentumOptimizer",function(){return Df}),n.d(t,"Optimizer",function(){return Of}),n.d(t,"RMSPropOptimizer",function(){return jf}),n.d(t,"Rank",function(){return ye}),n.d(t,"Reduction",function(){return Bc}),n.d(t,"SGDOptimizer",function(){return Mf}),n.d(t,"Tensor",function(){return ve}),n.d(t,"TensorBuffer",function(){return he}),n.d(t,"Variable",function(){return ge}),n.d(t,"abs",function(){return Ga}),n.d(t,"acos",function(){return Ka}),n.d(t,"acosh",function(){return $a}),n.d(t,"add",function(){return Bu}),n.d(t,"addN",function(){return Fu}),n.d(t,"addStrict",function(){return Uu}),n.d(t,"all",function(){return vu}),n.d(t,"any",function(){return gu}),n.d(t,"argMax",function(){return yu}),n.d(t,"argMin",function(){return bu}),n.d(t,"asin",function(){return Xa}),n.d(t,"asinh",function(){return Ya}),n.d(t,"atan",function(){return Ja}),n.d(t,"atan2",function(){return Wu}),n.d(t,"atanh",function(){return Za}),n.d(t,"avgPool",function(){return uu}),n.d(t,"backend",function(){return Yt}),n.d(t,"backend_util",function(){return wr}),n.d(t,"basicLSTMCell",function(){return Sc}),n.d(t,"batchNorm",function(){return zs}),n.d(t,"batchNorm2d",function(){return Ls}),n.d(t,"batchNorm3d",function(){return Bs}),n.d(t,"batchNorm4d",function(){return Fs}),n.d(t,"batchNormalization",function(){return Ps}),n.d(t,"batchNormalization2d",function(){return Ms}),n.d(t,"batchNormalization3d",function(){return Ds}),n.d(t,"batchNormalization4d",function(){return js}),n.d(t,"batchToSpaceND",function(){return $r}),n.d(t,"browser",function(){return mf}),n.d(t,"buffer",function(){return Gr}),n.d(t,"cast",function(){return Xr}),n.d(t,"ceil",function(){return Qa}),n.d(t,"clipByValue",function(){return es}),n.d(t,"clone",function(){return Yr}),n.d(t,"complex",function(){return Ln}),n.d(t,"concat",function(){return Ar}),n.d(t,"concat1d",function(){return Tr}),n.d(t,"concat2d",function(){return Ir}),n.d(t,"concat3d",function(){return Rr}),n.d(t,"concat4d",function(){return Mr}),n.d(t,"conv1d",function(){return qs}),n.d(t,"conv2d",function(){return Hs}),n.d(t,"conv2dDerFilter",function(){return Ks}),n.d(t,"conv2dTranspose",function(){return Ys}),n.d(t,"conv3d",function(){return Gs}),n.d(t,"cos",function(){return ts}),n.d(t,"cosh",function(){return ns}),n.d(t,"cumsum",function(){return Jr}),n.d(t,"customGrad",function(){return Mn}),n.d(t,"deprecationWarn",function(){return jt}),n.d(t,"depthToSpace",function(){return Zr}),n.d(t,"depthwiseConv2d",function(){return $s}),n.d(t,"disableDeprecationWarnings",function(){return Dt}),n.d(t,"dispose",function(){return Ft}),n.d(t,"disposeVariables",function(){return Pt}),n.d(t,"div",function(){return Vu}),n.d(t,"divStrict",function(){return qu}),n.d(t,"dot",function(){return Zs}),n.d(t,"dropout",function(){return zc}),n.d(t,"elu",function(){return hc}),n.d(t,"enableDebugMode",function(){return Mt}),n.d(t,"enableProdMode",function(){return Rt}),n.d(t,"environment",function(){return m}),n.d(t,"equal",function(){return Nu}),n.d(t,"equalStrict",function(){return Ou}),n.d(t,"erf",function(){return rs}),n.d(t,"exp",function(){return is}),n.d(t,"expandDims",function(){return Qr}),n.d(t,"expm1",function(){return os}),n.d(t,"eye",function(){return ei}),n.d(t,"fft",function(){return Tc}),n.d(t,"fill",function(){return Jn}),n.d(t,"findBackend",function(){return Kt}),n.d(t,"findBackendFactory",function(){return $t}),n.d(t,"floor",function(){return as}),n.d(t,"floorDiv",function(){return Hu}),n.d(t,"frame",function(){return Wc}),n.d(t,"fused",function(){return fl}),n.d(t,"gather",function(){return _c}),n.d(t,"gatherND",function(){return Pc}),n.d(t,"getBackend",function(){return Ht}),n.d(t,"grad",function(){return On}),n.d(t,"grads",function(){return An}),n.d(t,"greater",function(){return Au}),n.d(t,"greaterEqual",function(){return Tu}),n.d(t,"greaterEqualStrict",function(){return Iu}),n.d(t,"greaterStrict",function(){return Ru}),n.d(t,"hammingWindow",function(){return Uc}),n.d(t,"hannWindow",function(){return Fc}),n.d(t,"ifft",function(){return Ic}),n.d(t,"imag",function(){return Fn}),n.d(t,"image",function(){return cl}),n.d(t,"io",function(){return ff}),n.d(t,"irfft",function(){return Mc}
1),n.d(t,"isFinite",function(){return ys}),n.d(t,"isInf",function(){return gs}),n.d(t,"isNaN",function(){return vs}),n.d(t,"keep",function(){return Ut}),n.d(t,"leakyRelu",function(){return dc}),n.d(t,"less",function(){return Mu}),n.d(t,"lessEqual",function(){return Du}),n.d(t,"lessEqualStrict",function(){return ju}),n.d(t,"lessStrict",function(){return Pu}),n.d(t,"linalg",function(){return rl}),n.d(t,"linspace",function(){return Zn}),n.d(t,"localResponseNormalization",function(){return yc}),n.d(t,"log",function(){return ss}),n.d(t,"log1p",function(){return us}),n.d(t,"logSigmoid",function(){return cs}),n.d(t,"logSoftmax",function(){return zn}),n.d(t,"logSumExp",function(){return wu}),n.d(t,"logicalAnd",function(){return ac}),n.d(t,"logicalNot",function(){return sc}),n.d(t,"logicalOr",function(){return uc}),n.d(t,"logicalXor",function(){return cc}),n.d(t,"losses",function(){return Qc}),n.d(t,"matMul",function(){return Js}),n.d(t,"math",function(){return df}),n.d(t,"max",function(){return xu}),n.d(t,"maxPool",function(){return su}),n.d(t,"maximum",function(){return Gu}),n.d(t,"maximumStrict",function(){return Ku}),n.d(t,"mean",function(){return _u}),n.d(t,"memory",function(){return zt}),n.d(t,"min",function(){return ku}),n.d(t,"minimum",function(){return $u}),n.d(t,"minimumStrict",function(){return Xu}),n.d(t,"mod",function(){return Yu}),n.d(t,"modStrict",function(){return Ju}),n.d(t,"moments",function(){return Su}),n.d(t,"movingAverage",function(){return Cc}),n.d(t,"mul",function(){return Zu}),n.d(t,"mulStrict",function(){return Qu}),n.d(t,"multiRNNCell",function(){return Ec}),n.d(t,"multinomial",function(){return ti}),n.d(t,"neg",function(){return ls}),n.d(t,"nextFrame",function(){return Bf}),n.d(t,"norm",function(){return bc}),n.d(t,"notEqual",function(){return zu}),n.d(t,"notEqualStrict",function(){return Lu}),n.d(t,"oneHot",function(){return ni}),n.d(t,"ones",function(){return Xn}),n.d(t,"onesLike",function(){return er}),n.d(t,"op",function(){return jn}),n.d(t,"outerProduct",function(){return Qs}),n.d(t,"pad",function(){return ri}),n.d(t,"pad1d",function(){return ii}),n.d(t,"pad2d",function(){return oi}),n.d(t,"pad3d",function(){return ai}),n.d(t,"pad4d",function(){return si}),n.d(t,"pool",function(){return cu}),n.d(t,"pow",function(){return ec}),n.d(t,"powStrict",function(){return tc}),n.d(t,"prelu",function(){return pc}),n.d(t,"print",function(){return Kr}),n.d(t,"prod",function(){return Cu}),n.d(t,"profile",function(){return Lt}),n.d(t,"rand",function(){return ui}),n.d(t,"randomNormal",function(){return ci}),n.d(t,"randomUniform",function(){return li}),n.d(t,"range",function(){return Qn}),n.d(t,"ready",function(){return qt}),n.d(t,"real",function(){return Bn}),n.d(t,"reciprocal",function(){return fs}),n.d(t,"registerBackend",function(){return Xt}),n.d(t,"relu",function(){return mc}),n.d(t,"removeBackend",function(){return Gt}),n.d(t,"reshape",function(){return fi}),n.d(t,"reverse",function(){return eu}),n.d(t,"reverse1d",function(){return tu}),n.d(t,"reverse2d",function(){return nu}),n.d(t,"reverse3d",function(){return ru}),n.d(t,"reverse4d",function(){return iu}),n.d(t,"rfft",function(){return Rc}),n.d(t,"round",function(){return hs}),n.d(t,"rsqrt",function(){return ds}),n.d(t,"scalar",function(){return Wn}),n.d(t,"scatterND",function(){return Ac}),n.d(t,"selu",function(){return vc}),n.d(t,"separableConv2d",function(){return Xs}),n.d(t,"serialization",function(){return bf}),n.d(t,"setBackend",function(){return Vt}),n.d(t,"setPlatform",function(){return Jt}),n.d(t,"setdiff1dAsync",function(){return yi}),n.d(t,"sigmoid",function(){return ps}),n.d(t,"sign",function(){return ms}),n.d(t,"signal",function(){return Vc}),n.d(t,"sin",function(){return bs}),n.d(t,"sinh",function(){return ws}),n.d(t,"slice",function(){return lu}),n.d(t,"slice1d",function(){return fu}),n.d(t,"slice2d",function(){return hu}),n.d(t,"slice3d",function(){return du}),n.d(t,"slice4d",function(){return pu}),n.d(t,"softmax",function(){return Pn}),n.d(t,"softplus",function(){return xs}),n.d(t,"spaceToBatchND",function(){return hi}),n.d(t,"sparseToDense",function(){return jc}),n.d(t,"spectral",function(){return Dc}),n.d(t,"split",function(){return Dr}),n.d(t,"sqrt",function(){return _s}),n.d(t,"square",function(){return ks}),n.d(t,"squaredDifference",function(){return nc}),n.d(t,"squaredDifferenceStrict",function(){return rc}),n.d(t,"squeeze",function(){return di}),n.d(t,"stack",function(){return pi}),n.d(t,"step",function(){return Ss}
1),n.d(t,"stridedSlice",function(){return Nc}),n.d(t,"sub",function(){return ic}),n.d(t,"subStrict",function(){return oc}),n.d(t,"sum",function(){return Eu}),n.d(t,"tan",function(){return Es}),n.d(t,"tanh",function(){return Cs}),n.d(t,"tensor",function(){return Un}),n.d(t,"tensor1d",function(){return Vn}),n.d(t,"tensor2d",function(){return qn}),n.d(t,"tensor3d",function(){return Hn}),n.d(t,"tensor4d",function(){return Gn}),n.d(t,"tensor5d",function(){return Kn}),n.d(t,"tensor6d",function(){return $n}),n.d(t,"tensor_util",function(){return Re}),n.d(t,"test_util",function(){return Ef}),n.d(t,"tidy",function(){return Bt}),n.d(t,"tile",function(){return mi}),n.d(t,"time",function(){return Wt}),n.d(t,"topk",function(){return Oc}),n.d(t,"train",function(){return zf}),n.d(t,"transpose",function(){return gc}),n.d(t,"truncatedNormal",function(){return vi}),n.d(t,"unsortedSegmentSum",function(){return kc}),n.d(t,"unstack",function(){return gi}),n.d(t,"util",function(){return re}),n.d(t,"valueAndGrad",function(){return Tn}),n.d(t,"valueAndGrads",function(){return In}),n.d(t,"variable",function(){return Se}),n.d(t,"variableGrads",function(){return Rn}),n.d(t,"version_core",function(){return Cf}),n.d(t,"webgl",function(){return Nf}),n.d(t,"where",function(){return lc}),n.d(t,"whereAsync",function(){return fc}),n.d(t,"zeros",function(){return Yn}),n.d(t,"zerosLike",function(){return tr});var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function s(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function l(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var f,h=function(){function e(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.populateURLFlags()}return e.prototype.setPlatform=function(e,t){null!=this.platform&&console.warn("Platform "+this.platformName+" has already been set. Overwriting the platform with "+t+"."),this.platformName=e,this.platform=t},e.prototype.registerFlag=function(e,t,n){if(this.flagRegistry[e]={evaluationFn:t,setHook:n},null!=this.urlFlags[e]){var r=this.urlFlags[e];console.warn("Setting feature override from URL "+e+": "+r+"."),this.set(e,r)}},e.prototype.get=function(e){return e in this.flags?this.flags[e]:(this.flags[e]=this.evaluateFlag(e),this.flags[e])},e.prototype.getNumber=function(e){return this.get(e)},e.prototype.getBool=function(e){return this.get(e)},e.prototype.getFlags=function(){return this.flags},Object.defineProperty(e.prototype,"features",{get:function(){return this.flags},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t){if(null==this.flagRegistry[e])throw new Error("Cannot set flag "+e+" as it has not been registered.");this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)},e.prototype.evaluateFlag=function(e){if(null==this.flagRegistry[e])throw new Error("Cannot evaluate flag '"+e+"': no evaluation function found.");return this.flagRegistry[e].evaluationFn()},e.prototype.setFlags=function(e){this.flags=Object.assign({},e)},e.prototype.reset=function(){this.flags={},this.urlFlags={},this.populateURLFlags()},e.prototype.populateURLFlags=function(){var e=this;if(void 0!==this.global&&void 0!==this.global.location&&void 0!==this.global.location.search){var t=d(this.global.location.search);"tfjsflags"in t&&t.tfjsflags.split(",").forEach(function(t){var n=t.split(":"),r=n[0],i=n[1];e.urlFlags[r]=function(e,t){if("true"===(t=t.toLowerCase())||"false"===t)return"true"===t;if(""+ +t===t)return+t;throw new Error("Could not parse value flag value "+t+" for flag "+e+".")}(r,i)})}},e}();function d(e){var t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("=")}),t}function p(e){f=e}var m=Object.freeze({Environment:h,getQueryParams:d,get ENV(){return f},setEnvironmentGlobal:p});function v(e){for(var t=e.length,n=0,r=0;t>0;)r=Math.random()*t|0,n=e[--t],e[t]=e[r],e[r]=n}function g(e,t,n){return Math.max(e,Math.min(t,n))}function y(e){return e%2==0?e:e+1}function b(e){for(var t=0,n=0;n<e.length;n++)t+=e[n];return t}function w(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function x(e,t,n){void 0===n&&(n=""),w(E(e,t),function(){return n+" Shapes "+e+" and "+t+" must match"})}function _(e){w(null!=e,function(){return"The input to the tensor constructor must be a non-null value."})}function k(e,t){if(void 0===t&&(t=[]),null==t&&(t=[]),Array.isArray(e)||F(e))for(var n=0;n<e.length;++n)k(e[n],t);else t.push(e);return t}function S(e){if(0===e.length)return 1;for(var t=e[0],n=1;n<e.length;n++)t*=e[n];return t}function E(e,t){if(e===t)return!0;
1if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function C(e){return e%1==0}function N(e){if(null!=Math.tanh)return Math.tanh(e);if(e===1/0)return 1;if(e===-1/0)return-1;var t=Math.exp(2*e);return(t-1)/(t+1)}function O(e){var t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}function A(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function T(e,t,n){return void 0===t&&(t=function(e){return 0}),new Promise(function(r,i){var o=0;!function a(){if(e())r();else{var s=t(++o);null!=n&&o>=n?i():setTimeout(a,s)}}()})}function I(e,t){for(var n=1,r=-1,i=0;i<e.length;++i)if(e[i]>=0)n*=e[i];else if(-1===e[i]){if(-1!==r)throw Error("Shapes can only have 1 implicit size. Found -1 at dim "+r+" and dim "+i);r=i}else if(e[i]<0)throw Error("Shapes can not be < 0. Found "+e[i]+" at dim "+i);if(-1===r){if(t>0&&t!==n)throw Error("Size("+t+") must match the product of shape "+e);return e}if(0===n)throw Error("Cannot infer the missing size in ["+e+"] when there are 0 elements");if(t%n!=0)throw Error("The implicit shape can't be a fractional number. Got "+t+" / "+n);var o=e.slice();return o[r]=t/n,o}function R(e,t){var n=t.length;return w((e=null==e?t.map(function(e,t){return t}):[].concat(e)).every(function(e){return e>=-n&&e<n}),function(){return"All values in axis param must be in range [-"+n+", "+n+") but got axis "+e}),w(e.every(function(e){return C(e)}),function(){return"All values in axis param must be integers but got axis "+e}),e.map(function(e){return e<0?n+e:e})}function M(e,t){for(var n=[],r=[],i=null==t?null:R(t,e).sort(),o=0,a=0;a<e.length;++a){if(null!=i){if(i[o]===a&&1!==e[a])throw new Error("Can't squeeze axis "+a+" since its dim '"+e[a]+"' is not 1");(null==i[o]||i[o]>a)&&1===e[a]&&(n.push(e[a]),r.push(a)),i[o]<=a&&o++}1!==e[a]&&(n.push(e[a]),r.push(a))}return{newShape:n,keptDims:r}}function D(e,t){var n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else{if("bool"!==e)throw new Error("Unknown data type "+e);n=new Uint8Array(t)}return n}function j(e,t){var n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error("Unknown data type "+e);n=new Array(t)}return n}function P(e,t,n){if("float32"===t)for(var r=0;r<e.length;r++){var i=e[r];if(isNaN(i)||!isFinite(i))throw Error("The result of the '"+n+"' is "+i+".")}}function z(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(isNaN(r)||!isFinite(r))throw Error("A tensor of type "+t+" being uploaded contains "+r+".")}}function L(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}function B(e,t){return"complex64"!==t&&("float32"!==t||"complex64"===e)&&("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)}function F(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array}function U(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error("Unknown dtype "+e)}function W(e){if(null==e)return 0;var t=0;return e.forEach(function(e){return t+=2*e.length}),t}function V(e){return"string"==typeof e||e instanceof String}function q(e){return"boolean"==typeof e}function H(e){return"number"==typeof e}function G(e){return Array.isArray(e)?G(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":H(e)?"float32":V(e)?"string":q(e)?"bool":"float32"}function K(e){return!!(e&&e.constructor&&e.call&&e.apply)}function $(e,t){for(var n=t;n<e;++n)if(e%n==0)return n;return e}function X(e){var t=e.length;if(t<2)return[];var n=new Array(t-1);n[t-2]=e[t-1];for(var r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}function Y(e,t,n){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=k(e)),n&&z(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);
1if("bool"===t){for(var r=new Uint8Array(e.length),i=0;i<r.length;++i)0!==Math.round(e[i])&&(r[i]=1);return r}throw new Error("Unknown data type "+t)}function J(e,t){if(0===e.length)return t[0];var n=e.reduce(function(e,t){return e*t});if(0===n)return[];if(n!==t.length)throw new Error("["+e+"] does not match the input size.");return function e(t,n,r){var i=new Array;if(1===n.length)for(var o=n[0],a=0;a<o;a++)i[a]=r[t+a];else{o=n[0];var s=n.slice(1),u=s.reduce(function(e,t){return e*t});for(a=0;a<o;a++)i[a]=e(t+a*u,s,r)}return i}(0,e,t)}function Z(e,t){for(var n=Q(e,t),r=0;r<n.length;r++)n[r]=1;return n}function Q(e,t){if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t)return new Uint8Array(e);throw new Error("Unknown data type "+t)}function ee(){if("undefined"!=typeof performance)return performance.now();if("undefined"!=typeof e){var t=e.hrtime();return 1e3*t[0]+t[1]/1e6}throw new Error("Cannot measure time in this environment. You should run tf.js in the browser or in Node.js")}function te(e){e.forEach(function(t){w(Number.isInteger(t)&&t>=0,function(){return"Tensor must have a shape comprised of positive integers but got shape ["+e+"]."})})}function ne(e,t){return f.platform.fetch(e,t)}var re=Object.freeze({shuffle:v,clamp:g,nearestLargerEven:y,sum:b,randUniform:function(e,t){var n=Math.random();return t*n+(1-n)*e},distSquared:function(e,t){for(var n=0,r=0;r<e.length;r++){var i=Number(e[r])-Number(t[r]);n+=i*i}return n},assert:w,assertShapesMatch:x,assertNonNull:_,flatten:k,sizeFromShape:S,isScalarShape:function(e){return 0===e.length},arraysEqual:E,isInt:C,tanh:N,sizeToSquarishShape:O,createShuffledIndices:function(e){for(var t=new Uint32Array(e),n=0;n<e;++n)t[n]=n;return v(t),t},rightPad:A,repeatedTry:T,inferFromImplicitShape:I,parseAxisParam:R,squeezeShape:M,getTypedArrayFromDType:D,getArrayFromDType:j,checkComputationForErrors:P,checkConversionForErrors:z,isValidDtype:L,hasEncodingLoss:B,isTypedArray:F,bytesPerElement:U,bytesFromStringArray:W,isString:V,isBoolean:q,isNumber:H,inferDtype:G,isFunction:K,nearestDivisor:$,computeStrides:X,toTypedArray:Y,toNestedArray:J,makeOnesTypedArray:Z,makeZerosTypedArray:Q,now:ee,assertNonNegativeIntegerDimensions:te,fetch:ne}),ie=function(){function e(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new oe)}return e.prototype.profileKernel=function(e,t){var n,r=this,i=this.backendTimer.time(function(){n=t()});return(Array.isArray(n)?n:[n]).forEach(function(t){var n=t.dataSync();P(n,t.dtype,e),i.then(function(i){var o="";null!=i.getExtraProfileInfo&&(o=i.getExtraProfileInfo()),r.logger.logKernelProfile(e,t,n,i.kernelMs,o)})}),n},e}(),oe=function(){function e(){}return e.prototype.logKernelProfile=function(e,t,n,r,i){var o=A(r+"ms",9),a=A(e,25),s=t.rank,u=t.size,c=A(t.shape.toString(),14);console.log("%c"+a+"\t%c"+o+"\t%c"+s+"D "+c+"\t%c"+u+"\t%c"+i,"font-weight:bold","color:red","color:blue","color: orange","color: green")},e}(),ae=20,se=3,ue=7;function ce(e,t,n){return A(Array.isArray(e)?parseFloat(e[0].toFixed(ue))+" + "+parseFloat(e[1].toFixed(ue))+"j":V(e)?"'"+e+"'":"bool"===n?le(e):parseFloat(e.toFixed(ue)).toString(),t)}function le(e){return 0===e?"false":"true"}function fe(e){for(var t=[],n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}var he=function(){function e(e,t,n){var r=this;if(this.dtype=t,this.shape=e.slice(),this.size=S(e),null!=n){var i=n.length;w(i===this.size,function(){return"Length of values '"+i+"' does not match the size inferred by the shape '"+r.size+"'."})}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||j(t,this.size),this.strides=X(e)}return e.prototype.set=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];0===n.length&&(n=[0]),w(n.length===this.rank,function(){return"The number of provided coordinates ("+n.length+") must match the rank ("+t.rank+")"});var i=this.locToIndex(n);this.values[i]=e},e.prototype.get=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];0===e.length&&(e=[0]);for(var n=0,r=0,i=e;r<i.length;r++){var o=i[r];if(o<0||o>=this.shape[n]){var a="Requested out of range element at "+e+". Buffer shape="+this.shape;throw new Error(a)}n++}for(var s=e[e.length-1],u=0;u<e.length-1;++u)s+=this.strides[u]*e[u];return this.values[s]},e.prototype.locToIndex=function(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];for(var t=e[e.length-1],n=0;n<e.length-1;++n)t+=this.strides[n]*e[n];return t},e.prototype.indexToLoc=function(e){if(0===this.rank)return[];if(1===this.rank)return[e];for(var t=new Array(this.shape.length),n=0;n<t.length-1;++n)t[n]=Math.floor(e/this.strides[n]),e-=t[n]*this.strides[n];return t[t.length-1]=e,t},Object.defineProperty(e.prototype,"rank",{get:function(){return this.shape.length},enumerable:!0,configurable:!0}),e.prototype.toTensor=function(){return ve.make(this.shape,{values:this.values},this.dtype)},e}(),de=null,pe=null,me=null,ve=function(){function e(e,t,n,r,i){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=S(e),this.strides=X(e),this.dataId=null!=r?r:{},this.id=de().nextTensorId(),this.rankType=this.rank<5?this.rank.toString():"higher",de().registerTensor(this,i),null!=n&&de().write(i,this.dataId,n)}return e.make=function(t,n,r,i){return new e(t,r,n.values,n.dataId,i)},e.prototype.flatten=function(){return this.throwIfDisposed(),this.as1D()},e.prototype.asScalar=function(){return this.throwIfDisposed(),w(1===this.size,function(){return"The array must have only 1 element."}),this.reshape([])},e.prototype.as1D=function(){return this.throwIfDisposed(),this.reshape([this.size])},e.prototype.as2D=function(e,t){return this.throwIfDisposed(),this.reshape([e,t])},e.prototype.as3D=function(e,t,n){return this.throwIfDisposed(),this.reshape([e,t,n])},e.prototype.as4D=function(e,t,n,r){return this.throwIfDisposed(),this.reshape([e,t,n,r])},e.prototype.as5D=function(e,t,n,r,i){return this.throwIfDisposed(),this.reshape([e,t,n,r,i])},e.prototype.asType=function(e){return this.throwIfDisposed(),pe.cast(this,e)},Object.defineProperty(e.prototype,"rank",{get:function(){return this.shape.length},enumerable:!0,configurable:!0}),e.prototype.buffer=function(){return c(this,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return[4,this.data()];case 1:return e=t.sent(),[2,pe.buffer(this.shape,this.dtype,e)]}})})},e.prototype.bufferSync=function(){return pe.buffer(this.shape,this.dtype,this.dataSync())},e.prototype.array=function(){return c(this,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return[4,this.data()];case 1:return e=t.sent(),[2,J(this.shape,e)]}})})},e.prototype.arraySync=function(){return J(this.shape,this.dataSync())},e.prototype.data=function(){return c(this,void 0,void 0,function(){return l(this,function(e){return this.throwIfDisposed(),[2,de().read(this.dataId)]})})},e.prototype.dataSync=function(){return this.throwIfDisposed(),de().readSync(this.dataId)},e.prototype.dispose=function(){this.isDisposed||(de().disposeTensor(this),this.isDisposedInternal=!0)},Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this.isDisposedInternal},enumerable:!0,configurable:!0}),e.prototype.throwIfDisposed=function(){if(this.isDisposed)throw new Error("Tensor is disposed.")},e.prototype.toFloat=function(){return this.asType("float32")},e.prototype.toInt=function(){return this.asType("int32")},e.prototype.toBool=function(){return this.asType("bool")},e.prototype.print=function(e){return void 0===e&&(e=!1),pe.print(this,e)},e.prototype.reshape=function(e){return this.throwIfDisposed(),pe.reshape(this,e)},e.prototype.reshapeAs=function(e){return this.throwIfDisposed(),this.reshape(e.shape)},e.prototype.expandDims=function(e){return void 0===e&&(e=0),pe.expandDims(this,e)},e.prototype.cumsum=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=!1),void 0===n&&(n=!1),pe.cumsum(this,e,t,n)},e.prototype.squeeze=function(e){return this.throwIfDisposed(),pe.squeeze(this,e)},e.prototype.clone=function(){return this.throwIfDisposed(),pe.clone(this)},e.prototype.oneHot=function(e,t,n){return this.throwIfDisposed(),pe.oneHot(this,e,t,n)},e.prototype.toString=function(e){return void 0===e&&(e=!1),function(e,t,n,r){var i=X(t),o=function(e,t,n,r){var i=S(t),o=r[r.length-1],a=new Array(o).fill(0),s=t.length,u="complex64"===n?fe
vendor: 9,366 bytes, line 1
1(e):e;if(s>1)for(var c=0;c<i/o;c++)for(var l=c*o,f=0;f<o;f++)a[f]=Math.max(a[f],ce(u[l+f],0,n).length);return a}(e,t,n,i),a=t.length,s=function e(t,n,r,i,o,a){void 0===a&&(a=!0);var s="complex64"===r?2:1,u=n[0],c=n.length;if(0===c)return"complex64"===r?[ce(fe(t)[0],0,r)]:"bool"===r?[le(t[0])]:[t[0].toString()];if(1===c){if(u>ae){var l=se*s,f=Array.from(t.slice(0,l)),h=Array.from(t.slice(u-se*s,u));return"complex64"===r&&(f=fe(f),h=fe(h)),["["+f.map(function(e,t){return ce(e,o[t],r)}).join(", ")+", ..., "+h.map(function(e,t){return ce(e,o[u-se+t],r)}).join(", ")+"]"]}return["["+("complex64"===r?fe(t):Array.from(t)).map(function(e,t){return ce(e,o[t],r)}).join(", ")+"]"]}var d=n.slice(1),p=i.slice(1),m=i[0]*s,v=[];if(u>ae){for(var g=0;g<se;g++){var y=(b=g*m)+m;v.push.apply(v,e(t.slice(b,y),d,r,p,o,!1))}for(v.push("..."),g=u-se;g<u;g++)y=(b=g*m)+m,v.push.apply(v,e(t.slice(b,y),d,r,p,o,g===u-1))}else for(g=0;g<u;g++){var b;y=(b=g*m)+m,v.push.apply(v,e(t.slice(b,y),d,r,p,o,g===u-1))}var w=2===c?",":"";for(v[0]="["+v[0]+w,g=1;g<v.length-1;g++)v[g]=" "+v[g]+w;var x=",\n";for(g=2;g<c;g++)x+="\n";return v[v.length-1]=" "+v[v.length-1]+"]"+(a?"":x),v}(e,t,n,i,o),u=["Tensor"];return r&&(u.push(" dtype: "+n),u.push(" rank: "+a),u.push(" shape: ["+t+"]"),u.push(" values:")),u.push(s.map(function(e){return" "+e}).join("\n")),u.join("\n")}(this.dataSync(),this.shape,this.dtype,e)},e.prototype.tile=function(e){return this.throwIfDisposed(),pe.tile(this,e)},e.prototype.gather=function(e,t){return void 0===t&&(t=0),this.throwIfDisposed(),pe.gather(this,e,t)},e.prototype.matMul=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=!1),this.throwIfDisposed(),pe.matMul(this,e,t,n)},e.prototype.dot=function(e){return this.throwIfDisposed(),pe.dot(this,e)},e.prototype.norm=function(e,t,n){return void 0===e&&(e="euclidean"),void 0===t&&(t=null),void 0===n&&(n=!1),this.throwIfDisposed(),pe.norm(this,e,t,n)},e.prototype.slice=function(e,t){return this.throwIfDisposed(),pe.slice(this,e,t)},e.prototype.reverse=function(e){return this.throwIfDisposed(),pe.reverse(this,e)},e.prototype.concat=function(t,n){return void 0===n&&(n=0),this.throwIfDisposed(),t instanceof e&&(t=[t]),pe.concat([this].concat(t),n)},e.prototype.split=function(e,t){return void 0===t&&(t=0),this.throwIfDisposed(),pe.split(this,e,t)},e.prototype.stack=function(e,t){return void 0===t&&(t=0),pe.stack([this,e],t)},e.prototype.unstack=function(e){return void 0===e&&(e=0),pe.unstack(this,e)},e.prototype.pad=function(e,t){return void 0===t&&(t=0),pe.pad(this,e,t)},e.prototype.batchNormalization=function(e,t,n,r,i){return void 0===n&&(n=.001),me("tf.batchNormalization() is going away. Use tf.batchNorm() instead, and note the positional argument change of scale, offset, and varianceEpsilon"),this.batchNorm(e,t,i,r,n)},e.prototype.batchNorm=function(e,t,n,r,i){return void 0===i&&(i=.001),this.throwIfDisposed(),pe.batchNorm(this,e,t,n,r,i)},e.prototype.all=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),pe.all(this,e,t)},e.prototype.any=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),pe.any(this,e,t)},e.prototype.logSumExp=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),pe.logSumExp(this,e,t)},e.prototype.sum=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),pe.sum(this,e,t)},e.prototype.prod=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),pe.prod(this,e,t)},e.prototype.mean=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),pe.mean(this,e,t)},e.prototype.min=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),pe.min(this,e,t)},e.prototype.max=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.throwIfDisposed(),pe.max(this,e,t)},e.prototype.argMin=function(e){return void 0===e&&(e=null),this.throwIfDisposed(),pe.argMin(this,e)},e.prototype.argMax=function(e){return void 0===e&&(e=null),this.throwIfDisposed(),pe.argMax(this,e)},e.prototype.cast=function(e){return this.throwIfDisposed(),pe.cast(this,e)},e.prototype.add=function(e){return this.throwIfDisposed(),pe.add(this,e)},e.prototype.addStrict=function(e){return this.throwIfDisposed(),pe.addStrict(this,e)},e.prototype.atan2=function(e){return this.throwIfDisposed(),pe.atan2(this,e)},e.prototype.sub=function(e){return this.throwIfDisposed(),pe.sub(this,e)},e.prototype.subStrict=function(e){return this.throwIfDisposed(),pe.subStrict(this,e)},e.prototype.pow=function(e){return this.throwIfDisposed(),pe.pow(this,e)},e.prototype.powStrict=function(e){return this.throwIfDisposed(),pe.powStrict(this,e)},e.prototype.mul=function(e){return this.throwIfDisposed(),pe.mul(this,e)},e.prototype.mulStrict=function(e){return this.throwIfDisposed(),pe.mulStrict(this,e)},e.prototype.div=function(e){return this.throwIfDisposed(),pe.div(this,e)},e.prototype.floorDiv=function(e){return this.throwIfDisposed(),pe.floorDiv(this,e)},e.prototype.divStrict=function(e){return this.throwIfDisposed(),pe.divStrict(this,e)},e.prototype.minimum=function(e){return this.throwIfDisposed(),pe.minimum(this,e)},e.prototype.minimumStrict=function(e){return this.throwIfDisposed(),pe.minimumStrict(this,e)},e.prototype.maximum=function(e){return this.throwIfDisposed(),pe.maximum(this,e)},e.prototype.maximumStrict=function(e){return this.throwIfDisposed(),pe.maximumStrict(this,e)},e.prototype.mod=function(e){return this.throwIfDisposed(),pe.mod(this,e)},e.prototype.modStrict=function(e){return this.throwIfDisposed(),pe.modStrict(this,e)},e.prototype.squaredDifference=function(e){return this.throwIfDisposed(),pe.squaredDifference(this,e)},e.prototype.squaredDifferenceStrict=function(e){return this.throwIfDisposed(),pe.squaredDifferenceStrict(this,e)},e.prototype.transpose=function(e){return this.throwIfDisposed(),pe.transpose(this,e)},e.prototype.notEqual=function(e){return this.throwIfDisposed(),pe.notEqual(this,e)},e.prototype.notEqualStrict=function(e){return this.throwIfDisposed(),pe.notEqualStrict(this,e)},e.prototype.less=function(e){return this.throwIfDisposed(),pe.less(this,e)},e.prototype.lessStrict=function(e){return this.throwIfDisposed(),pe.lessStrict(this,e)},e.prototype.equal=function(e){return this.throwIfDisposed(),pe.equal(this,e)},e.prototype.equalStrict=function(e){return this.throwIfDisposed(),pe.equalStrict(this,e)},e.prototype.lessEqual=function(e){return this.throwIfDisposed(),pe.lessEqual(this,e)},e.prototype.lessEqualStrict=function(e){return this.throwIfDisposed(),pe.lessEqualStrict(this,e)},e.prototype.greater=function(e){return this.throwIfDisposed(),pe.greater(this,e)},e.prototype.greaterStrict=function(e){return this.throwIfDisposed(),pe.greaterStrict(this,e)},e.prototype.greaterEqual=function(e){return this.throwIfDisposed(),pe.greaterEqual(this,e)},e.prototype.greaterEqualStrict=function(e){return this.throwIfDisposed(),pe.greaterEqualStrict(this,e)},e.prototype.logicalAnd=function(e){return this.throwIfDisposed(),pe.logicalAnd(this,e)},e.prototype.logicalOr=function(e){return this.throwIfDisposed(),pe.logicalOr(this,e)},e.prototype.logicalNot=function(){return this.throwIfDisposed(),pe.logicalNot(this)},e.prototype.logicalXor=function(e){return this.throwIfDisposed(),pe.logicalXor(this,e)},e.prototype.where=function(e,t){return this.throwIfDisposed(),pe.where(e,this,t)},e.prototype.neg=function(){return this.throwIfDisposed(),pe.neg(this)},e.prototype.ceil=function(){return this.throwIfDisposed(),pe.ceil(this)},e.prototype.floor=function(){return this.throwIfDisposed(),pe.floor(this)},e.prototype.sign=function(){return this.throwIfDisposed(),pe.sign(this)},e.prototype.isNaN=function(){return this.throwIfDisposed(),pe.isNaN(this)},e.prototype.isInf=function(){return this.throwIfDisposed(),pe.isInf(this)},e.prototype.isFinite=function(){return this.throwIfDisposed(),pe.isFinite(this)},e.prototype.exp=function(){return this.throwIfDisposed(),pe.exp(this)},e.prototype.expm1=function(){return this.throwIfDisposed(),pe.expm1(this)},e.prototype.log=function(){return this.throwIfDisposed(),pe.log(this)},e.prototype.log1p=function(){return this.throwIfDisposed(),pe.log1p(this)},e.prototype.sqrt=function(){return this.throwIfDisposed(),pe.sqrt(this)},e.prototype.rsqrt=function(){return this.throwIfDisposed(),pe.rsqrt(this)},e.prototype.square=function(){return this.throwIfDisposed(),pe.square(this)},e.prototype.reciprocal=function(){return this.throwIfDisposed(),pe.reciprocal(this)},e.prototype.abs=function(){return this.throwIfDisposed(),pe.abs(this)},e.prototype.clipByValue=function(e,t){return this.throwIfDisposed(),pe.clipByValue(this,e,t)},e.prototype.relu=function(){return this.throwIfDisposed(),pe.relu(this)},e.prototype.elu=function(){return this.throwIfDisposed(),pe.elu(this)},e.prototype.selu=function(){return this.throwIfDisposed(),pe.selu(this)},e.prototype.leakyRelu=function(e){return void 0===e&&(e=.2),this.throwIfDisposed(),pe.leakyRelu(this,e)},e.prototype.prelu=function(e){return this.throwIfDisposed(),pe.prelu(this,e)},e.prototype.sigmoid=function(){return this.throwIfDisposed(),pe.sigmoid(this)},e.prototype.logSigmoid=function(){return this.throwIfDisposed(),pe.logSigmoid(this)},e.prototype.softplus=function(){return this.throwIfDisposed(),pe.s
1oftplus(this)},e.prototype.zerosLike=function(){return this.throwIfDisposed(),pe.zerosLike(this)},e.prototype.onesLike=function(){return this.throwIfDisposed(),pe.onesLike(this)},e.prototype.sin=function(){return this.throwIfDisposed(),pe.sin(this)},e.prototype.cos=function(){return this.throwIfDisposed(),pe.cos(this)},e.prototype.tan=function(){return this.throwIfDisposed(),pe.tan(this)},e.prototype.asin=function(){return this.throwIfDisposed(),pe.asin(this)},e.prototype.acos=function(){return this.throwIfDisposed(),pe.acos(this)},e.prototype.atan=function(){return this.throwIfDisposed(),pe.atan(this)},e.prototype.sinh=function(){return this.throwIfDisposed(),pe.sinh(this)},e.prototype.cosh=function(){return this.throwIfDisposed(),pe.cosh(this)},e.prototype.tanh=function(){return this.throwIfDisposed(),pe.tanh(this)},e.prototype.asinh=function(){return this.throwIfDisposed(),pe.asinh(this)},e.prototype.acosh=function(){return this.throwIfDisposed(),pe.acosh(this)},e.prototype.atanh=function(){return this.throwIfDisposed(),pe.atanh(this)},e.prototype.erf=function(){return this.throwIfDisposed(),pe.erf(this)},e.prototype.round=function(){return this.throwIfDisposed(),pe.round(this)},e.prototype.step=function(e){return void 0===e&&(e=0),this.throwIfDisposed(),pe.step(this,e)},e.prototype.softmax=function(e){return void 0===e&&(e=-1),this.throwIfDisposed(),pe.softmax(this,e)},e.prototype.logSoftmax=function(e){return void 0===e&&(e=-1),this.throwIfDisposed(),pe.logSoftmax(this,e)},e.prototype.resizeBilinear=function(e,t){return void 0===t&&(t=!1),this.throwIfDisposed(),pe.image.resizeBilinear(this,e,t)},e.prototype.resizeNearestNeighbor=function(e,t){return void 0===t&&(t=!1),this.throwIfDisposed(),pe.image.resizeNearestNeighbor(this,e,t)},e.prototype.conv1d=function(e,t,n,r,i,o){return void 0===r&&(r="NWC"),void 0===i&&(i=1),this.throwIfDisposed(),pe.conv1d(this,e,t,n,r,i,o)},e.prototype.conv2d=function(e,t,n,r,i,o){return void 0===r&&(r="NHWC"),void 0===i&&(i=[1,1]),this.throwIfDisposed(),pe.conv2d(this,e,t,n,r,i,o)},e.prototype.conv2dTranspose=function(e,t,n,r,i){return this.throwIfDisposed(),pe.conv2dTranspose(this,e,t,n,r,i)},e.prototype.depthwiseConv2D=function(e,t,n,r,i,o){return void 0===r&&(r="NHWC"),void 0===i&&(i=[1,1]),this.throwIfDisposed(),pe.depthwiseConv2d(this,e,t,n,r,i,o)},e.prototype.separableConv2d=function(e,t,n,r,i,o){return void 0===i&&(i=[1,1]),void 0===o&&(o="NHWC"),this.throwIfDisposed(),pe.separableConv2d(this,e,t,n,r,i,o)},e.prototype.avgPool=function(e,t,n,r){return this.throwIfDisposed(),pe.avgPool(this,e,t,n,r)},e.prototype.maxPool=function(e,t,n,r){return this.throwIfDisposed(),pe.maxPool(this,e,t,n,r)},e.prototype.localResponseNormalization=function(e,t,n,r){return void 0===e&&(e=5),void 0===t&&(t=1),void 0===n&&(n=1),void 0===r&&(r=.5),pe.localResponseNormalization(this,e,t,n,r)},e.prototype.pool=function(e,t,n,r,i){return this.throwIfDisposed(),pe.pool(this,e,t,n,r,i)},e.prototype.variable=function(e,t,n){return void 0===e&&(e=!0),this.throwIfDisposed(),ge.variable(this,e,t,n)},e.prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),pe.unsortedSegmentSum(this,e,t)},e.prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),pe.batchToSpaceND(this,e,t)},e.prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),pe.spaceToBatchND(this,e,t)},e.prototype.topk=function(e,t){return void 0===e&&(e=1),void 0===t&&(t=!0),this.throwIfDisposed(),pe.topk(this,e,t)},e.prototype.stridedSlice=function(e,t,n,r,i,o,a,s){return void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=0),this.throwIfDisposed(),pe.stridedSlice(this,e,t,n,r,i,o,a,s)},e.prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),pe.depthToSpace(this,e,t)},e.prototype.fft=function(){return this.throwIfDisposed(),pe.spectral.fft(this)},e.prototype.ifft=function(){return this.throwIfDisposed(),pe.spectral.ifft(this)},e.prototype.rfft=function(){return this.throwIfDisposed(),pe.spectral.rfft(this)},e.prototype.irfft=function(){return this.throwIfDisposed(),pe.spectral.irfft(this)},e}();Object.defineProperty(ve,Symbol.hasInstance,{value:function(e){return!!e&&null!=e.dataId&&null!=e.shape&&null!=e.dtype}});var ge=function(e){function t(t,n,r){void 0===n&&(n=!0);var i=e.call(this,t.shape,t.dtype,null,t.dataId)||this;i.trainable=n,i.name=r,null==i.name&&(i.name=de().nextVariableId().toString());try{de().registerVariable(i)}catch(e){throw de().disposeTensor(i),e}return i}return s(t,e),t.variable=function(e,n,r,i){return void 0===n&&(n=!0),null!=i&&i!==e.dtype&&(e=e.asType(i)),new t(e,n,r)},t.prototype.assign=function(e){if(e.dtype!==this.dtype)throw new Error("dtype of the new value ("+e.dtype+") and previous value ("+this.dtype+") must match");if(!E(e.shape,this.shape))throw new Error("shape of the new value ("+e.shape+") and previous value ("+this.shape+") must match");de().disposeTensor(this),this.dataId=e.dataId,de().registerTensor(this)},t.prototype.dispose=function(){de().disposeVariable(this),this.isDisposedInternal=!0},t}(ve);Object.defineProperty(ge,Symbol.hasInstance,{value:function(e){return e instanceof ve&&null!=e.assign&&e.assign instanceof Function}});var ye,be,we,xe,_e,ke,Se=ge.variable;(ke=ye||(ye={})).R0="R0",ke.R1="R1",ke.R2="R2",ke.R3="R3",ke.R4="R4",ke.R5="R5",ke.R6="R6",function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(be||(be={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(we||(we={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(xe||(xe={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(_e||(_e={}));var Ee={float32:xe,int32:be,bool:we,complex64:_e};function Ce(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error("Can not upcast "+e+" with "+t)}return Ee[e][t]}function Ne(e){return Ce(e,"int32")}function Oe(e,t){if(e.dtype===t.dtype)return[e,t];var n=Ce(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function Ae(e,t){w(e.dtype===t.dtype,function(){return"The dtypes of the first("+e.dtype+") and second("+t.dtype+") input must match"})}function Te(e){var t=[];return function e(t,n,r){if(null!=t)if(t instanceof ve)n.push(t);else if(i=t,Array.isArray(i)||"object"==typeof i){var i,o=t;for(var a in o){var s=o[a];r.has(s)||(r.add(s),e(s,n,r))}}}(e,t,new Set),t}var Ie,Re=Object.freeze({makeTypesMatch:Oe,assertTypesMatch:Ae,isTensorInList:function(e,t){for(var n=0;n<t.length;n++)if(t[n].id===e.id)return!0;return!1},getTensorsInContainer:Te}),Me=function(){function e(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null}}return e.prototype.dispose=function(){for(var e in this.registeredVariables)this.registeredVariables[e].dispose()},e}(),De=function(){function e(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Me}return e.prototype.ready=function(){return c(this,void 0,void 0,function(){var e,t,n;return l(this,function(r){switch(r.label){case 0:if(null!=this.pendingBackendInit)return[2,this.pendingBackendInit.then(function(){})];if(null!=this.backendInstance)return[2];e=this.getSortedBackends(),t=0,r.label=1;case 1:return t<e.length?(n=e[t],[4,this.initializeBackend(n).success]):[3,4];case 2:if(r.sent())return this.setBackend(n),[2];r.label=3;case 3:return t++,[3,1];case 4:throw new Error("Could not initialize any backends, all backend initializations failed.")}})})},Object.defineProperty(e.prototype,"backend",{get:function(){if(null!=this.pendingBackendInit)throw new Error("Backend '"+this.backendName+"' has not yet been initialized. Make sure to await tf.ready() before calling other methods");if(null==this.backendInstance){var e=this.initializeBackendsAndReturnBest(),t=e.name;if(e.asyncInit)throw new Error("The highest priority backend '"+t+"' has not yet been initialized. Make sure to await tf.ready() before calling other methods");this.setBackend(t)}return this.backendInstance},enumerable:!0,configurable:!0}),e.prototype.backendNames=function(){return Object.keys(this.registryFactory)},e.prototype.findBackend=function(e){if(!(e in this.registry)){if(!(e in this.registryFactory))return null;if(this.initializeBackend(e).asyncInit)return null}return this.registry[e]},e.prototype.findBackendFactory=function(e){return e in this.registryFactory?this.registryFactory[e].factory:null},e.prototype.registerBackend=function(e,t,n){return void 0===n&&(n=1),e in this.registryFactory?(console.warn(e+" backend was already registered. Reusing existing backend factory."),!1):(this.registryFactory[e]={factory:t,priority:n},!0)},e.prototype.setBackend=function(e){return c(this,void 0,void 0,function(){var t,n,r;return l(this,function(i){switch(i.label){case 0:if(null==this.registryFactory[e])throw new Error("Backend name '"+e+"' not found in registry");return this.backendName=e,null!=this.registry[e]?[3,4]:(this.backendInstance=null,t=this.initializeBackend(e),n=t.success,t.asyncInit?[4,n]:[3,2]);case 1:return r=i.sent(),[3,3];case 2:r=n,i.label=3;case 3:if(!r)return[2,!1];i.label=4;case 4:return this.backendInstance=this.registry[e],this.profiler=new ie(this.backendInstance),[2,!0]}})})},e.prototype.initializeBackend=function(e){var t=this,n=je.registryFactory[e];if(null==n)throw new Error("Cannot initialize backend "+e+", no registration found.");try{var r=n.factory();if(Promise.resolve(r)===r){var i=++this.pendingBackendInitId,o=r.then(function(n){return!(i<t.pendingBackendInitId)&&(t.registry[e]=n,t.pendingBackendInit=null,!0)}).catch(function(n){return!(i<t.pendingBackendInitId)&&(t.pendingBackendInit=null,console.warn("Initialization of backend "+e+" failed"),console.warn(n.stack||n.message),!1)});return this.pendingBackendInit=o,{success:o,asyncInit:!0}}return this.registry[e]=r,{success:!0,asyncInit:!1}}catch(t){return console.warn("Initialization of backend "+e+" failed"),console.warn(t.stack||t.message),{success:!1,asyncInit:!1}}},e.prototype.removeBackend=function(e){if(!(e in this.registryFactory))throw new Error(e+" backend not found in registry");this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)},e.prototype.getSortedBackends=function(){var e=this;if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort(function(t,n){return e.registryFactory[n].priority-e.registryFactory[t].priority})},e.prototype.initializeBackendsAndReturnBest=function(){for(var e=this.getSortedBackends(),t=0;t<e.length;t++){var n=e[t],r=this.initializeBackend(n),i=r.success,o=r.asyncInit;if(o||i)return{name:n,asyncInit:o}}throw new Error("Could not initialize any backends, all backend initializations failed.")},e.prototype.moveData=function(e,t){this.write(e,t,this.readSync(t))},e.prototype.tidy=function(e,t){var n,r=this,i=null;if(null==t){if("function"!=typeof e)throw new Error("Please provide a function to tidy()");t=e}else{if("string"!=typeof e&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof t)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");i=e}return this.scopedRun(function(){return r.startScope(i)},function(){return r.endScope(n)},function(){return(n=t())instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n})},e.prototype.scopedRun=function(e,t,n){e();try{var r=n();return t(),r}catch(e){throw t(),e}},e.prototype.nextTensorId=function(){return e.nextTensorId++},e.prototype.nextVariableId=function(){return e.nextVariableId++},e.prototype.clone=function(e){var t=ve.make(e.shape,{dataId:e.dataId},e.dtype);return this.addTapeNode([e],t,function(e){return[e.toFloat()]}),t},e.prototype.runKernel=function(e,t,n){var r,i=this,o=[],a=this.isTapeOn(),s=null!=this.state.activeScope?this.state.activeScope.name:"",u=function(e){a&&(o=e.map(function(e){return i.keep(i.clone(e))}))},c=this.state.numBytes,l=this.state.numTensors;if(this.scopedRun(function(){return i.state.kernelDepth++},function(){return i.state.kernelDepth--},function(){r=i.ENV.getBool("DEBUG")?i.profiler.profileKernel(s,function(){return e(i.backend,u)}):e(i.backend,u)}),a){var f={id:this.state.nextTapeNodeId++,name:s,inputs:t,outputs:Array.isArray(r)?r:[r],saved:o};null!=n&&(f.gradient=function(e){return n(e,o)}),this.state.activeTape.push(f)}return this.state.profiling&&this.state.activeProfile.kernels.push({name:s,bytesAdded:this.state.numBytes-c,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-l,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(t).map(function(e){return t[e].shape}),outputShape:Array.isArray(r)?r.map(function(e){return e.shape}):r.shape}),r},e.prototype.registerTensor=function(e,t){var n=this.state.tensorInfo.has(e.dataId)?this.state.tensorInfo.get(e.dataId).refCount:0;
1if(this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++,0===n){this.state.numDataBuffers++;var r=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(r=e.size*U(e.dtype)),this.state.tensorInfo.set(e.dataId,{backend:null!=t?t:this.backend,dtype:e.dtype,shape:e.shape,bytes:r,refCount:0}),this.state.numBytes+=r,null!=t?t.register(e.dataId,e.shape,e.dtype):this.backend.register(e.dataId,e.shape,e.dtype)}this.state.tensorInfo.get(e.dataId).refCount++,e instanceof ge||this.track(e)},e.prototype.registerVariable=function(e){if(null!=this.state.registeredVariables[e.name])throw new Error("Variable with name "+e.name+" was already registered");this.state.registeredVariables[e.name]=e},e.prototype.disposeTensor=function(e){if(this.state.tensorInfo.has(e.dataId)){this.state.numTensors--,"string"===e.dtype&&this.state.numStringTensors--;var t=this.state.tensorInfo.get(e.dataId);t.refCount<=1?("complex64"!==e.dtype&&(this.state.numBytes-=t.bytes),this.state.numDataBuffers--,t.backend.disposeData(e.dataId),this.state.tensorInfo.delete(e.dataId)):this.state.tensorInfo.get(e.dataId).refCount--}},e.prototype.disposeVariables=function(){for(var e in this.state.registeredVariables){var t=this.state.registeredVariables[e];this.disposeVariable(t)}},e.prototype.disposeVariable=function(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]},e.prototype.memory=function(){var e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e},e.prototype.profile=function(e){return c(this,void 0,void 0,function(){var t,n;return l(this,function(r){return this.state.profiling=!0,t=this.state.numBytes,n=this.state.numTensors,this.state.activeProfile.kernels=[],this.state.activeProfile.result=e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max.apply(Math,this.state.activeProfile.kernels.map(function(e){return e.totalBytesSnapshot})),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n,[2,this.state.activeProfile]})})},e.prototype.isTapeOn=function(){return this.state.gradientDepth>
10&&0===this.state.kernelDepth},e.prototype.addTapeNode=function(e,t,n){var r={};e.forEach(function(e,t){r[t]=e});var i={id:this.state.nextTapeNodeId++,name:this.state.activeScope.name,inputs:r,outputs:[t],gradient:function(e){var t=n(e),r={};return t.forEach(function(e,t){r[t]=function(){return e}}),r}};this.state.activeTape.push(i)},e.prototype.keep=function(e){return e.kept=!0,e},e.prototype.startTape=function(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++},e.prototype.endTape=function(){this.state.gradientDepth--},e.prototype.startScope=function(e){var t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t},e.prototype.endScope=function(e){for(var t=this,n=Te(e),r=new Set(n.map(function(e){return e.id})),i=0;i<this.state.activeScope.track.length;i++){var o=this.state.activeScope.track[i];o.kept||r.has(o.id)||o.dispose()}var a=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],n.forEach(function(e){e.kept||e.scopeId!==a.id||t.track(e)})},e.prototype.gradients=function(e,t,n,r){var i=this;if(void 0===r&&(r=!1),w(t.length>0,function(){return"gradients() received an empty list of xs."}),null!=n&&"float32"!==n.dtype)throw new Error("dy must have 'float32' dtype, but has '"+n.dtype+"'");var o=this.scopedRun(function(){return i.startTape()},function(){return i.endTape()},function(){return i.tidy("forward",e)});w(o instanceof ve,function(){return"The result y returned by f() must be a tensor."});var a=function(e,t,n){for(var r={},i={},o=0;o<t.length;o++)r[t[o].id]=!0;for(o=0;o<e.length;o++){var a=(p=e[o]).inputs;for(var s in a){for(var u=a[s],c=!1,l=0;l<t.length;l++)if(r[u.id]){p.outputs.forEach(function(e){return r[e.id]=!0}),c=!0,i[p.id]=!0;break}if(c)break}}var f={};f[n.id]=!0;var h={};for(o=e.length-1;o>=0;o--)for(a=(p=e[o]).inputs,l=0;l<p.outputs.length;l++)if(f[p.outputs[l].id]){for(var s in a)f[a[s].id]=!0,h[p.id]=!0;break}var d=[];for(o=0;o<e.length;o++){var p;if(i[(p=e[o]).id]&&h[p.id]){var m={};for(var s in p.inputs){var v=p.inputs[s];r[v.id]&&(m[s]=v)}var g=Object.assign({},p);g.inputs=m,g.outputs=p.outputs,d.push(g)}}return d}(this.state.activeTape,t,o);if(!r&&0===a.length&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",function(){var e,r,s={};s[o.id]=null==n?(r=Z(S(e=o.shape),"float32"),ve.make(e,{values:r})):n,function(e,t,n){for(var r=function(r){var i=t[r],o=[];if(i.outputs.forEach(function(t){var n=e[t.id];if(null!=n)o.push(n);else{var r=ve.make(t.shape,{values:Q(t.size,t.dtype)},t.dtype);o.push(r)}}),null==i.gradient)throw new Error("Cannot compute gradient: gradient function not found for "+i.name+".");var a=i.gradient(1===i.outputs.length?o[0]:o),s=function(t){if(!(t in a))throw new Error("Cannot backprop through input "+t+". Available gradients found: "+Object.keys(a)+".");var r=n(function(){return a[t]()});if("float32"!==r.dtype)throw new Error("Error in gradient for op "+i.name+". The gradient of input "+t+" must have 'float32' dtype, but has '"+r.dtype+"'");var o=i.inputs[t];if(!E(r.shape,o.shape))throw new Error("Error in gradient for op "+i.name+". The gradient of input '"+t+"' has shape '"+r.shape+"', which does not match the shape of the input '"+o.shape+"'");if(null==e[o.id])e[o.id]=r;else{var s=e[o.id];e[o.id]=s.add(r),s.dispose()}};for(var u in i.inputs)s(u)},i=t.length-1;i>=0;i--)r(i)}(s,a,function(e){return i.tidy(e)});var u=t.map(function(e){return s[e.id]});return 0===i.state.gradientDepth&&(i.state.activeTape.forEach(function(e){for(var t in e.saved)e.saved[t].dispose()}),i.state.activeTape=null),{value:o,grads:u}})},e.prototype.customGrad=function(e){var t=this;return w(K(e),function(){return"The f passed in customGrad(f) must be a function."}),function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];w(r.every(function(e){return e instanceof ve}),function(){return"The args passed in customGrad(f)(x1, x2,...) must all be tensors"});var o={};return r.forEach(function(e,t){o[t]=e}),t.runKernel(function(t,i){return w((n=e.apply(void 0,r.concat([i]))).value instanceof ve,function(){return"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"}),w(K(n.gradFunc),function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."}),n.value},o,function(e,t){var i=n.gradFunc(e,t),o=Array.isArray(i)?i:[i];w(o.length===r.length,function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."}),w(o.every(function(e){return e instanceof ve}),function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."});var a={};return o.forEach(function(e,t){a[t]=function(){return e}}),a})}},e.prototype.write=function(e,t,n){var r=this.state.tensorInfo.get(t),i=r.backend;if(e=e||this.backend,"string"===r.dtype){var o=W(n);this.state.numBytes+=o-r.bytes,r.bytes=o}e!==i&&(i.disposeData(t),r.backend=e,e.register(t,r.shape,r.dtype)),e.write(t,n)},e.prototype.readSync=function(e){return this.state.tensorInfo.get(e).backend.readSync(e)},e.prototype.read=function(e){return this.state.tensorInfo.get(e).backend.read(e)},e.prototype.fromPixels=function(e,t){return this.backend.fromPixels(e,t)},e.prototype.time=function(e){return c(this,void 0,void 0,function(){var t,n;return l(this,function(r){switch(r.label){case 0:return t=ee(),[4,this.backend.time(e)];
1case 1:return(n=r.sent()).wallMs=ee()-t,[2,n]}})})},e.prototype.track=function(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e},Object.defineProperty(e.prototype,"registeredVariables",{get:function(){return this.state.registeredVariables},enumerable:!0,configurable:!0}),e.prototype.reset=function(){for(var e in this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Me,this.registry)this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null},e.nextTensorId=0,e.nextVariableId=0,e}(),je=function(){var t=function(){if(null==Ie){var t=void 0;if("undefined"!=typeof window)t=window;else if("undefined"!=typeof r)t=r;else{if("undefined"==typeof e)throw new Error("Could not find a global object");t=e}Ie=t}return Ie}();if(null==t._tfengine){var n=new h(t);t._tfengine=new De(n)}return p(t._tfengine.ENV),de=function(){return t._tfengine},t._tfengine}();function Pe(){return"undefined"!=typeof window}f.registerFlag("DEBUG",function(){return!1},function(e){e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")}),f.registerFlag("IS_BROWSER",function(){return Pe()}),f.registerFlag("IS_NODE",function(){return"undefined"!=typeof e&&void 0!==e.versions&&void 0!==e.versions.node}),f.registerFlag("IS_CHROME",function(){return"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}),f.registerFlag("PROD",function(){return!1}),f.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",function(){return!f.getBool("PROD")}),f.registerFlag("DEPRECATION_WARNINGS_ENABLED",function(){return!0}),f.registerFlag("IS_TEST",function(){return!1});var ze={},Le={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function Be(e,t){ze[e]=t}function Fe(e){e in ze||(ze[e]=function(e){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");var t=document.createElement("canvas");return t.addEventListener("webglcontextlost",function(t){t.preventDefault(),delete ze[e]},!1),1===e?t.getContext("webgl",Le)||t.getContext("experimental-webgl",Le):t.getContext("webgl2",Le)}(e));var t=ze[e];return t.isContextLost()?(delete ze[e],Fe(e)):(t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.disable(t.BLEND),t.disable(t.DITHER),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SAMPLE_COVERAGE),t.enable(t.SCISSOR_TEST),t.enable(t.CULL_FACE),t.cullFace(t.BACK),ze[e])}function Ue(e,t,n){var r=n();return t&&function(e){var t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+He(e,t))}(e),r}var We=5.96e-8,Ve=65504;function qe(e){return!!(f.getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||We<Math.abs(e)&&Math.abs(e)<Ve)}function He(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return"Unknown error code "+t}}function Ge(e,t,n){return mt(e,t,function(){return e.getExtension(n)},'Extension "'+n+'" not supported on this browser.')}function Ke(e,t,n){var r=mt(e,t,function(){return e.createShader(e.VERTEX_SHADER)},"Unable to create vertex WebGLShader.");if(Ue(e,t,function(){return e.shaderSource(r,n)}),Ue(e,t,function(){return e.compileShader(r)}),!1===e.getShaderParameter(r,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(r)),new Error("Failed to compile vertex shader.");return r}function $e(e,t,n){var r=mt(e,t,function(){return e.createShader(e.FRAGMENT_SHADER)},"Unable to create fragment WebGLShader.");if(Ue(e,t,function(){return e.shaderSource(r,n)}),Ue(e,t,function(){return e.compileShader(r)}),!1===e.getShaderParameter(r,e.COMPILE_STATUS))throw function(e,t){var n=Je.exec(t);if(null==n)return console.log("Couldn't parse line number in error: "+t),void console.log(e);for(var r=+n[1],i=e.split("\n"),o=i.length.toString().length+2,a=i.map(function(e,t){return A((t+1).toString(),o)+e}),s=0,u=0;u<a.length;u++)s=Math.max(a[u].length,s);var c=a.slice(0,r-1),l=a.slice(r-1,r),f=a.slice(r);console.log(c.join("\n")),console.log(t.split("\n")[0]),console.log("%c "+A(l[0],s),"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(f.join("\n"))}(n,e.getShaderInfoLog(r)),new Error("Failed to compile fragment shader.");return r}var Xe,Ye,Je=/ERROR: [0-9]+:([0-9]+):/g;function Ze(e,t){return mt(e,t,function(){return e.createProgram()},"Unable to create WebGLProgram.")}function Qe(e,t,n){if(Ue(e,t,function(){return e.linkProgram(n)}),!1===e.getProgramParameter(n,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(n)),new Error("Failed to link vertex and fragment shaders.")}function et(e,t,n){if(Ue(e,t,function(){return e.validateProgram(n)}),!1===e.getProgramParameter(n,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(n)),new Error("Shader program validation failed.")}function tt(e,t,n){var r=mt(e,t,function(){return e.createBuffer()},"Unable to create WebGLBuffer");return Ue(e,t,function(){return e.bindBuffer(e.ARRAY_BUFFER,r)}),Ue(e,t,function(){return e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW)}),r}function nt(e,t,n){var r=mt(e,t,function(){return e.createBuffer()},"Unable to create WebGLBuffer");return Ue(e,t,function(){return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r)}),Ue(e,t,function(){return e.bufferData(e.ELEMENT_ARRAY_BUFFER,n,e.STATIC_DRAW)}),r}function rt(e,t){return mt(e,t,function(){return e.createTexture()},"Unable to create WebGLTexture.")}function it(e,t){var n=f.getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){var r="["+e+"x"+t+"]";
vendor: 10,498 bytes, line 1
1throw new Error("Requested texture size "+r+" is invalid.")}if(e>n||t>n)throw r="["+e+"x"+t+"]",new Error("Requested texture size "+r+" greater than WebGL maximum on this browser / GPU ["+n+"x"+n+"].")}function ot(e,t){return mt(e,t,function(){return e.createFramebuffer()},"Unable to create WebGLFramebuffer.")}function at(e,t,n,r,i,o,a,s){var u=e.getAttribLocation(n,r);return-1!==u&&(Ue(e,t,function(){return e.bindBuffer(e.ARRAY_BUFFER,i)}),Ue(e,t,function(){return e.vertexAttribPointer(u,o,e.FLOAT,!1,a,s)}),Ue(e,t,function(){return e.enableVertexAttribArray(u)}),!0)}function st(e,t,n,r){vt(e,r),Ue(e,t,function(){return e.activeTexture(e.TEXTURE0+r)}),Ue(e,t,function(){return e.bindTexture(e.TEXTURE_2D,n)})}function ut(e,t,n,r){return mt(e,t,function(){return e.getUniformLocation(n,r)},'uniform "'+r+'" not present in program.')}function ct(e,t,n){return e.getUniformLocation(t,n)}function lt(e,t,n,r,i,o){Ue(e,t,function(){return st(e,t,r,o)}),Ue(e,t,function(){return e.uniform1i(i,o)})}function ft(e,t,n,r){Ue(e,t,function(){return e.bindFramebuffer(e.FRAMEBUFFER,r)}),Ue(e,t,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)})}function ht(e,t,n){Ue(e,t,function(){return e.bindFramebuffer(e.FRAMEBUFFER,n)}),Ue(e,t,function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)})}function dt(e){var t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+pt(e,t))}function pt(e,t){switch(t){case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case e.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return"unknown error "+t}}function mt(e,t,n,r){var i=Ue(e,t,function(){return n()});if(null==i)throw new Error(r);return i}function vt(e,t){var n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(r<e.TEXTURE0||r>n)throw new Error("textureUnit must be in [gl.TEXTURE0, gl.TEXTURE"+n+"].")}function gt(e,t){return void 0===t&&(t=2),S(e.slice(0,e.length-t))}function yt(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]}function bt(e,t){var n;void 0===t&&(t=!1);var r=f.getNumber("WEBGL_MAX_TEXTURE_SIZE");if(t&&(r*=2,1===(e=e.map(function(t,n){return n>=e.length-2?y(e[n]):e[n]})).length&&(e=[2,e[0]])),2!==e.length){var i=M(e);e=i.newShape}var o=S(e);if(e.length<=1&&o<=r)return[1,o];if(2===e.length&&e[0]<=r&&e[1]<=r)return e;if(3===e.length&&e[0]*e[1]<=r&&e[2]<=r)return[e[0]*e[1],e[2]];if(3===e.length&&e[0]<=r&&e[1]*e[2]<=r)return[e[0],e[1]*e[2]];if(4===e.length&&e[0]*e[1]*e[2]<=r&&e[3]<=r)return[e[0]*e[1]*e[2],e[3]];if(4===e.length&&e[0]<=r&&e[1]*e[2]*e[3]<=r)return[e[0],e[1]*e[2]*e[3]];if(t){var a=gt(e),s=2,u=2;return e.length&&(s=(n=yt(e))[0],u=n[1]),O(o=a*(s/2)*(u/2)).map(function(e){return 2*e})}return O(o)}function wt(e){return e%2==0}function xt(e,t){if(E(e=e.slice(-2),t=t.slice(-2)))return!0;if(!e.length||!t.length)return!0;if(0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){var n=e.slice(-1)[0],r=t.slice(-1)[0];if(n===r)return!0;if(wt(n)&&wt(r)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&wt(e[0])&&wt(t[0])}function _t(e){if(null==Xe){var t=Fe(e);Xe=t.getParameter(t.MAX_TEXTURE_SIZE)}return Xe}function kt(e){if(null==Ye){var t=Fe(e);Ye=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,Ye)}function St(e){if(0===e)return 0;var t=Fe(e);return Et(t,"EXT_disjoint_timer_query_webgl2")&&2===e?2:Et(t,"EXT_disjoint_timer_query")?1:0}function Et(e,t){return null!=e.getExtension(t)}function Ct(e){try{if(null!=Fe(e))return!0}catch(e){return!1}return!1}function Nt(e){if(0===e)return!1;var t=Fe(e);if(1===e){if(!Et(t,"OES_texture_float"))return!1}else if(!Et(t,"EXT_color_buffer_float"))return!1;return At(t,e)}function Ot(e){if(0===e)return!1;var t=Fe(e);if(1===e){if(!Et(t,"OES_texture_float"))return!1;if(!Et(t,"WEBGL_color_buffer_float"))return!1}else if(!Et(t,"EXT_color_buffer_float"))return!1;return At(t,e)}function At(e,t){var n=e.createFramebuffer(),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);var i=2===t?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,i,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);var o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(r),e.deleteFramebuffer(n),o}function Tt(e){return 2===e&&null!=Fe(e).fenceSync}var It=Object.freeze({callAndCheck:Ue,canBeRepresented:qe,getWebGLErrorMessage:He,getExtensionOrThrow:Ge,createVertexShader:Ke,createFragmentShader:$e,createProgram:Ze,linkProgram:Qe,validateProgram:et,createStaticVertexBuffer:tt,createStaticIndexBuffer:nt,getNumChannels:function(){return 2===f.getNumber("WEBGL_VERSION")?1:4},createTexture:rt,validateTextureSize:it,createFramebuffer:ot,bindVertexBufferToProgramAttribute:at,bindTextureUnit:st,unbindTextureUnit:function(e,t,n){vt(e,n),Ue(e,t,function(){return e.activeTexture(e.TEXTURE0+n)}),Ue(e,t,function(){return e.bindTexture(e.TEXTURE_2D,null)})},getProgramUniformLocationOrThrow:ut,getProgramUniformLocation:ct,bindTextureToProgramUniformSampler:lt,bindCanvasToFramebuffer:function(e,t){Ue(e,t,function(){return e.bindFramebuffer(e.FRAMEBUFFER,null)}),Ue(e,t,function(){return e.viewport(0,0,e.canvas.width,e.canvas.height)}),Ue(e,t,function(){return e.scissor(0,0,e.canvas.width,e.canvas.height)})},bindColorTextureToFramebuffer:ft,unbindColorTextureFromFramebuffer:ht,validateFramebuffer:dt,getFramebufferErrorMessage:pt,getBatchDim:gt,getRowsCols:yt,getTextureShapeFromLogicalShape:bt,isReshapeFree:xt,get MAX_TEXTURE_SIZE(){return Xe},get MAX_TEXTURES_IN_SHADER(){return Ye},getWebGLMaxTextureSize:_t,getMaxTexturesInShader:kt,getWebGLDisjointQueryTimerVersion:St,isWebGLVersionEnabled:Ct,isRenderToFloatTextureEnabled:Nt,isDownloadFloatTextureEnabled:Ot,isWebGLFenceEnabled:Tt});function Rt(){f.set("PROD",!0)}function Mt(){f.set("DEBUG",!0)}function Dt(){f.set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function jt(e){f.getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function Pt(){je.disposeVariables()}function zt(){return je.memory()}function Lt(e){return je.profile(e)}function Bt(e,t){return je.tidy(e,t)}function Ft(e){Te(e).forEach(function(e){return e.dispose()})}function Ut(e){return je.keep(e)}function Wt(e){return je.time(e)}function Vt(e){return je.setBackend(e)}function qt(){return je.ready()}function Ht(){return je.backendName}function Gt(e){je.removeBackend(e)}function Kt(e){return je.findBackend(e)}function $t(e){return je.findBackendFactory(e)}function Xt(e,t,n){return void 0===n&&(n=1),je.registerBackend(e,t,n)}function Yt(){return je.backend}function Jt(e,t){f.setPlatform(e,t)}function Zt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];f.getBool("IS_TEST")||console.warn.apply(console,e)}function Qt(e,t,n,r){void 0===r&&(r=!0);var i=[];if(r)(i=i.concat(t.slice(0))).push(e[0]/n),i=i.concat(e.slice(1));else{i=i.concat(e[0]);for(var o=t.length,a=0;a<o;++a)i=i.concat([e[a+1]/t[a],t[a]]);i=i.concat(e.slice(o+1))}return i}function en(e,t,n){void 0===n&&(n=!0);var r=[];if(n){r.push(t);for(var i=t+1;i<e;++i)i<=2*t?(r.push(i),r.push(i-(t+1))):r.push(i)}else{var o=[],a=[];for(i=1;i<e;++i)i>=2*t+1||i%2==1?a.push(i):o.push(i);r.push.apply(r,o),r.push(0),r.push.apply(r,a)}return r}function tn(e,t,n,r){void 0===r&&(r=!0);var i=[];r?i.push(e[0]/n):i.push(e[0]*n);for(var o=1;o<e.length;++o)o<=t.length?r?i.push(t[o-1]*e[o]):i.push(e[o]/t[o-1]):i.push(e[o]);return i}function nn(e,t){for(var n=[0],r=0;r<t;++r)n.push(e[r][0]);return n}function rn(e,t,n){for(var r=e.slice(0,1),i=0;i<n;++i)r.push(e[i+1]-t[i][0]-t[i][1]);return r}function on(e,t){for(var n=0;n<e.length;++n)if(e[e.length-n-1]!==t-1-n)return!1;return!0}function an(e,t,n){for(var r=e.length+t.length,i=[],o=0,a=0,s=0;s<r;s++)-1===n.indexOf(s)?i.push(e[o++]):i.push(t[a++]);return i}function sn(e,t){for(var n=[],r=e.length,i=0;i<r;i++)-1===t.indexOf(i)&&n.push(e[i]);return[n,t.map(function(t){return e[t]})]}function un(e,t){return an(e,t.map(function(e){return 1}),t)}function cn(e,t,n){w(on(t,n),function(){return e+" supports only inner-most axes for now. Got axes "+t+" and rank-"+n+" input."})}function ln(e,t){if(on(e,t))return null;for(var n=[],r=0;r<t;++r)-1===e.indexOf(r)&&n.push(r);return e.forEach(function(e){return n.push(e)}),n}function fn(e){return e.map(function(e,t){return[t,e]}).sort(function(e,t){return e[1]-t[1]}).map(function(e){return e[0]})}function hn(e,t){for(var n=[],r=t-e;r<t;++r)n.push(r);return n}function dn(e,t){var n=e[0].length;e.forEach(function(e,t){w(e.length===n,function(){return"Error in concat"+n+"D: rank of tensors["+t+"] must be the same as the rank of the rest ("+n+")"})}),w(t>=0&&t<n,function(){return"Error in concat"+n+"D: axis must be between 0 and "+(n-1)+"."});var r=e[0];e.forEach(function(e,i){for(var o=0;o<n;o++)w(o===t||e[o]===r[o],function(){return"Error in concat"+n+"D: Shape of tensors["+i+"] ("+e+") does not match the shape of the rest ("+r+") along the non-concatenated axis "+i+"."})})}function pn(e,t){for(var n=e[0].slice(),r=1;r<e.length;r++)n[t]+=e[r][t];return n}function mn(e,t){if(e.rank<1)throw new Error("tf.gatherND() expects the input to be rank 1 or higher, but the rank was "+e.rank+".");if(t.rank<1)throw new Error("tf.gatherND() expects the indices to be rank 1 or higher, but the rank was "+t.rank+".");if("int32"!==t.dtype)throw new Error("tf.gatherND() expects the indices to be int32 type, but the dtype was "+t.dtype+".");if(t.shape[t.rank-1]>e.rank)throw new Error("index innermost dimension length must be <= tensor rank; saw: "+t.shape[t.rank-1]+" vs. "+e.rank);if(0===e.size)throw new Error("Requested more than 0 entries, but input is empty. Input shape: "+e.shape+".");for(var n=t.shape,r=n[n.length-1],i=1,o=0;o<n.length-1;++o)i*=n[o];var a=e.shape,s=n.slice();s.pop();var u=1;for(o=r;o<e.rank;++o)u*=a[o],s.push(a[o]);var c=X(e.shape).map(function(e){return e/u}).concat([1]).slice(0,r);return[s,i,u,c]}
1f.registerFlag("HAS_WEBGL",function(){return f.getNumber("WEBGL_VERSION")>0}),f.registerFlag("WEBGL_VERSION",function(){return Ct(2)?2:Ct(1)?1:0}),f.registerFlag("WEBGL_BUFFER_SUPPORTED",function(){return 2===f.get("WEBGL_VERSION")}),f.registerFlag("WEBGL_CPU_FORWARD",function(){return!0}),f.registerFlag("WEBGL_PACK",function(){return f.getBool("HAS_WEBGL")}),f.registerFlag("WEBGL_PACK_NORMALIZATION",function(){return f.getBool("WEBGL_PACK")}),f.registerFlag("WEBGL_PACK_CLIP",function(){return f.getBool("WEBGL_PACK")}),f.registerFlag("WEBGL_PACK_DEPTHWISECONV",function(){return f.getBool("WEBGL_PACK")}),f.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",function(){return f.getBool("WEBGL_PACK")}),f.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",function(){return f.getBool("WEBGL_PACK")}),f.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",function(){return f.getBool("WEBGL_PACK")}),f.registerFlag("WEBGL_PACK_REDUCE",function(){return f.getBool("WEBGL_PACK")}),f.registerFlag("WEBGL_LAZILY_UNPACK",function(){return f.getBool("WEBGL_PACK")}),f.registerFlag("WEBGL_CONV_IM2COL",function(){return f.getBool("WEBGL_PACK")}),f.registerFlag("WEBGL_MAX_TEXTURE_SIZE",function(){return _t(f.getNumber("WEBGL_VERSION"))}),f.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",function(){return kt(f.getNumber("WEBGL_VERSION"))}),f.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",function(){var e=f.getNumber("WEBGL_VERSION");return 0===e?0:St(e)}),f.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",function(){return f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&(e=navigator.userAgent||navigator.vendor||window.opera,!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))));var e}),f.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",function(){return Nt(f.getNumber("WEBGL_VERSION"))}),f.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",function(){return Ot(f.getNumber("WEBGL_VERSION"))}),f.registerFlag("WEBGL_FENCE_API_ENABLED",function(){return Tt(f.getNumber("WEBGL_VERSION"))}),f.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",function(){return f.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0}),me=jt;var vn=30;function gn(e){return e<=vn?e:$(e,Math.floor(Math.sqrt(e)))}function yn(e,t,n){for(var r=t.rank>1?t.shape[t.rank-1]:1,i=n.length,o=1,a=r;a<i;++a)o*=n[a];var s=r<1?1:r;return{sliceRank:r,numUpdates:t.size/s,sliceSize:o,strides:X(n.slice(0,r)).concat([1]),outputSize:S(n)}}function bn(e,t,n,r,i,o,a,s,u){if(void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=0),void 0===u&&(u=0),0!==a)throw new Error("ellipsis mask is not yet supported");if(0!==s)throw new Error("new axis mask is not yet supported");for(var c=[],l=[],f=[],h=0;h<e.length;h++)c[h]=wn(i,t,r,e,h),l[h]=xn(o,n,r,e,h),u&1<<h&&(l[h]=c[h]+1,f.push(h));var d=new Array(e.length).fill(0);return d=d.map(function(e,t){for(var n=0,i=r[t]||1,o=c[t];!(i>0?o>=l[t]:o<=l[t]);o+=i)n+=1;return n}),[c,d,f]}function wn(e,t,n,r,i){var o=t[i],a=n[i]||1;(e&1<<i||null==o)&&(o=a>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var s=r[i];return o<0&&(o+=s),g(0,o,s-1)}function xn(e,t,n,r,i){var o=t[i],a=n[i]||1;(e&1<<i||null==o)&&(o=a>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var s=r[i];return o<0&&(o+=s),a>0?g(0,o,s):g(-1,o,s-1)}
1function _n(e,t,n){for(var r=n.length,i=0;i<n.length;i++)if(n[i]>1){r=i;break}for(i=r+1;i<n.length;i++)if(t[i]>0||n[i]!==e[i])return!1;return!0}function kn(e,t){for(var n=e.length>0?e[e.length-1]:1,r=0;r<e.length-1;r++)n+=e[r]*t[r];return n}function Sn(e){var t=e;if(F(e))return[e.length];if(!Array.isArray(e))return[];for(var n=[];Array.isArray(t)||F(t);)n.push(t.length),t=t[0];return Array.isArray(e)&&f.getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&function e(t,n,r){if(r=r||[],Array.isArray(t)||F(t)){w(n.length>0,function(){return"Element arr["+r.join("][")+"] should be a primitive, but is an array of "+t.length+" elements"}),w(t.length===n[0],function(){return"Element arr["+r.join("][")+"] should have "+n[0]+" elements, but has "+t.length+" elements"});for(var i=n.slice(1),o=0;o<t.length;++o)e(t[o],i,r.concat(o))}else w(0===n.length,function(){return"Element arr["+r.join("][")+"] is a primitive, but should be an array/TypedArray of "+n[0]+" elements"})}(e,n,[]),n}function En(e,t,n,r){if(null!=e&&("numeric"!==e&&e!==t||"numeric"===e&&"string"===t))throw new Error("Argument '"+n+"' passed to '"+r+"' must be "+e+" tensor, but got "+t+" tensor")}function Cn(e,t,n,r){if(void 0===r&&(r="numeric"),e instanceof ve)return En(r,e.dtype,t,n),e;var i=G(e);if("string"!==i&&["bool","int32","float32"].indexOf(r)>=0&&(i=r),En(r,i,t,n),null==e||!F(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){var o=null==e?"null":e.constructor.name;throw new Error("Argument '"+t+"' passed to '"+n+"' must be a Tensor or TensorLike, but got '"+o+"'")}var a=Sn(e);F(e)||Array.isArray(e)||(e=[e]);var s="string"!==i?Y(e,i,f.getBool("DEBUG")):k(e);return ve.make(a,{values:s},i)}function Nn(e,t,n,r){if(void 0===r&&(r="numeric"),!Array.isArray(e))throw new Error("Argument "+t+" passed to "+n+" must be a `Tensor[]` or `TensorLike[]`");return e.map(function(e,r){return Cn(e,t+"["+r+"]",n)},r)}function On(e){return w(K(e),function(){return"The f passed in grad(f) must be a function"}),function(t,n){var r=Cn(t,"x","tf.grad",null),i=null!=n?Cn(n,"dy","tf.grad"):null;return je.tidy(function(){var t=je.gradients(function(){return e(r)},[r],i),n=t.value,o=t.grads;return null!=i&&x(n.shape,i.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Dn(o),o[0]})}}function An(e){return w(K(e),function(){return"The f passed in grads(f) must be a function"}),function(t,n){w(Array.isArray(t),function(){return"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s"});var r=Nn(t,"args","tf.grads",null),i=null!=n?Cn(n,"dy","tf.grads"):null;return je.tidy(function(){var t=je.gradients(function(){return e.apply(void 0,r)},r,i),n=t.value,o=t.grads;return null!=i&&x(n.shape,i.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Dn(o),o})}}function Tn(e){return w(K(e),function(){return"The f passed in valueAndGrad(f) must be a function"}),function(t,n){w(t instanceof ve,function(){return"The x passed in valueAndGrad(f)(x) must be a tensor"}),w(null==n||n instanceof ve,function(){return"The dy passed in valueAndGrad(f)(x, dy) must be a tensor"});var r=je.gradients(function(){return e(t)},[t],n),i=r.grads,o=r.value;return Dn(i),{grad:i[0],value:o}}}function In(e){return w(K(e),function(){return"The f passed in valueAndGrads(f) must be a function"}),function(t,n){w(Array.isArray(t)&&t.every(function(e){return e instanceof ve}),function(){return"The args passed in valueAndGrads(f)(args) must be array of tensors"}),w(null==n||n instanceof ve,function(){return"The dy passed in valueAndGrads(f)(args, dy) must be a tensor"});var r=je.gradients(function(){return e.apply(void 0,t)},t,n);return null!=n&&x(r.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Dn(r.grads),r}}function Rn(e,t){w(K(e),function(){return"The f passed in variableGrads(f) must be a function"}),w(null==t||Array.isArray(t)&&t.every(function(e){return e instanceof ge}),function(){return"The varList passed in variableGrads(f, varList) must be an array of variables"});var n=null!=t;if(!n)for(var r in t=[],je.registeredVariables)t.push(je.registeredVariables[r]);var i=n?t.filter(function(e){return!e.trainable}):null,o=t.length;w((t=t.filter(function(e){return e.trainable})).length>0,function(){return"variableGrads() expects at least one of the input variables to be trainable, but none of the "+o+" variables is trainable."});var a=je.gradients(e,t,null,!0),s=a.value,u=a.grads;w(u.some(function(e){return null!=e}),function(){return"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."}),w(0===s.rank,function(){return"The f passed in variableGrads(f) must return a scalar, but it returned a rank-"+s.rank+" tensor"});var c={};return t.forEach(function(e,t){null!=u[t]&&(c[e.name]=u[t])}
vendor: 5,719 bytes, line 1
1),null!=i&&i.forEach(function(e){return c[e.name]=null}),{value:s,grads:c}}function Mn(e){return je.customGrad(e)}function Dn(e){if(e.filter(function(e){return null==e}).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.")}function jn(e){var t=Object.keys(e);if(1!==t.length)throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with "+t.length+" keys.");var n=t[0],r=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1));var i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];je.startScope(n);try{var i=r.apply(void 0,e);return i instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),je.endScope(i),i}catch(e){throw je.endScope(null),e}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}var Pn=jn({softmax_:function(e,t){void 0===t&&(t=-1);var n=Cn(e,"logits","softmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error("Softmax along a non-last dimension is not yet supported. Logits was rank "+n.rank+" and dim was "+t);return Mn(function(e,n){var r=e.logSumExp([t],!0),i=e.toFloat().sub(r).exp();return n([i]),{value:i,gradFunc:function(e,n){var r=n[0],i=e.mul(r);return i.sub(i.sum([t],!0).mul(r))}}})(n)}}),zn=jn({logSoftmax_:function(e,t){void 0===t&&(t=-1);var n=Cn(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error("Log Softmax along a non-last dimension is not yet supported. Logits was rank "+n.rank+" and axis was "+t);return Mn(function(e,n){var r=e.max(t,!0),i=e.sub(r),o=i.toFloat().sub(i.exp().sum(t,!0).log());return n([o]),{value:o,gradFunc:function(e,n){var r=n[0].exp();return e.sub(e.sum(t,!0).mul(r))}}})(n)}}),Ln=jn({complex_:function(e,t){var n=Cn(e,"real","complex"),r=Cn(t,"imag","complex");return x(n.shape,r.shape,"real and imag shapes, "+n.shape+" and "+r.shape+", must match in call to tf.complex()."),je.runKernel(function(e){return e.complex(n,r)},{$real:n,$imag:r})}}),Bn=jn({real_:function(e){var t=Cn(e,"input","real");return je.runKernel(function(e){return e.real(t)},{$input:t})}}),Fn=jn({imag_:function(e){var t=Cn(e,"input","imag");return je.runKernel(function(e){return e.imag(t)},{$input:t})}});function Un(e,t,n){if(null==n&&(n=G(e)),"complex64"===n)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!F(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");var r=Sn(e);if(null!=t){te(t);var i=S(t),o=S(r);w(i===o,function(){return"Based on the provided shape, ["+t+"], the tensor should have "+i+" values but has "+o});for(var a=0;a<r.length;++a){var s=r[a],u=a!==r.length-1||s!==S(t.slice(a));w(r[a]===t[a]||!u,function(){return"Error creating a new Tensor. Inferred shape ("+r+") does not match the provided shape ("+t+"). "})}}return F(e)||Array.isArray(e)||(e=[e]),t=t||r,e="string"!==n?Y(e,n,f.getBool("DEBUG")):k(e),ve.make(t,{values:e},n)}function Wn(e,t){if((F(e)||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");return Un(e,[],t)}function Vn(e,t){_(e);var n=Sn(e);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Un(e,n,t)}function qn(e,t,n){if(_(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");var r=Sn(e);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Un(e,t=t||r,n)}function Hn(e,t,n){if(_(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");var r=Sn(e);if(3!==r.length&&1!==r.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Un(e,t=t||r,n)}function Gn(e,t,n){if(_(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");var r=Sn(e);if(4!==r.length&&1!==r.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Un(e,t=t||r,n)}function Kn(e,t,n){if(_(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");var r=Sn(e);if(5!==r.length&&1!==r.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Un(e,t=t||r,n)}function $n(e,t,n){if(_(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");var r=Sn(e);if(6!==r.length&&1!==r.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return Un(e,t=t||r,n)}function Xn(e,t){if(void 0===t&&(t="float32"),"complex64"===t){var n=Xn(e,"float32"),r=Yn(e,"float32");return Ln(n,r)}var i=Z(S(e),t);return ve.make(e,{values:i},t)}function Yn(e,t){if(void 0===t&&(t="float32"),"complex64"===t){var n=Yn(e,"float32"),r=Yn(e,"float32");return Ln(n,r)}var i=Q(S(e),t);return ve.make(e,{values:i},t)}
1function Jn(e,t,n){return je.runKernel(function(r){return r.fill(e,t,n)},{})}function Zn(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");return je.runKernel(function(r){return r.linspace(e,t,n)},{})}function Qn(e,t,n,r){if(void 0===n&&(n=1),void 0===r&&(r="float32"),0===n)throw new Error("Cannot have a step of zero");if(e===t||e<t&&n<0||t<e&&n>1)return Yn([0],r);var i=Q(Math.abs(Math.ceil((t-e)/n)),r);t<e&&1===n&&(n=-1),i[0]=e;for(var o=1;o<i.length;o++)i[o]=i[o-1]+n;return Vn(i,r)}var er=jn({onesLike_:function(e){var t=Cn(e,"x","onesLike");if("complex64"===t.dtype){var n=er(Bn(t)),r=tr(Fn(t));return Ln(n,r)}return je.runKernel(function(e){return e.onesLike(t)},{$x:t},function(e,t){return{$x:function(){return tr(e)}}})}}),tr=jn({zerosLike_:function(e){var t=Cn(e,"x","zerosLike");return je.runKernel(function(e){return e.zerosLike(t)},{$x:t},function(e,t){return{$x:function(){return tr(e)}}})}}),nr=function(){function e(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap}return e.prototype.get=function(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)},e.prototype.set=function(e,t){this.data.set(e,t)},e.prototype.has=function(e){return this.data.has(e)},e.prototype.delete=function(e){return this.data.delete(e)},e}(),rr=function(){function e(){}return e.prototype.time=function(e){throw new Error("Not yet implemented.")},e.prototype.read=function(e){throw new Error("Not yet implemented.")},e.prototype.readSync=function(e){throw new Error("Not yet implemented.")},e.prototype.disposeData=function(e){throw new Error("Not yet implemented.")},e.prototype.write=function(e,t){throw new Error("Not yet implemented.")},e.prototype.fromPixels=function(e,t){throw new Error("Not yet implemented.")},e.prototype.register=function(e,t,n){throw new Error("Not yet implemented.")},e.prototype.memory=function(){throw new Error("Not yet implemented.")},e.prototype.floatPrecision=function(){throw new Error("Not yet implemented")},e.prototype.epsilon=function(){return 32===this.floatPrecision()?1e-7:1e-4},e.prototype.batchMatMul=function(e,t,n,r){throw new Error("Not yet implemented")},e.prototype.fusedBatchMatMul=function(e,t,n,r,i,o){throw new Error("Not yet implemented")},e.prototype.slice=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.stridedSlice=function(e,t,n,r,i,o,a,s,u){throw new Error("Not yet implemented")},e.prototype.unstack=function(e,t){throw new Error("Not yet implemented")},e.prototype.reverse=function(e,t){throw new Error("Not yet implemented")},e.prototype.concat=function(e,t){throw new Error("Not yet implemented")},e.prototype.neg=function(e){throw new Error("Not yet implemented")},e.prototype.add=function(e,t){throw new Error("Not yet implemented")},e.prototype.addN=function(e){throw new Error("Not yet implemented")},e.prototype.subtract=function(e,t){throw new Error("Not yet implemented")},e.prototype.multiply=function(e,t){throw new Error("Not yet implemented")},e.prototype.realDivide=function(e,t){throw new Error("Not yet implemented")},e.prototype.floorDiv=function(e,t){throw new Error("Not yet implemented")},e.prototype.sum=function(e,t){throw new Error("Not yet implemented")},e.prototype.prod=function(e,t){throw new Error("Not yet implemented")},e.prototype.unsortedSegmentSum=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.argMin=function(e,t){throw new Error("Not yet implemented")},e.prototype.argMax=function(e,t){throw new Error("Not yet implemented")},e.prototype.equal=function(e,t){throw new Error("Not yet implemented")},e.prototype.notEqual=function(e,t){throw new Error("Not yet implemented")},e.prototype.less=function(e,t){throw new Error("Not yet implemented")},e.prototype.lessEqual=function(e,t){throw new Error("Not yet implemented")},e.prototype.greater=function(e,t){throw new Error("Not yet implemented")},e.prototype.greaterEqual=function(e,t){throw new Error("Not yet implemented")},e.prototype.logicalNot=function(e){throw new Error("Not yet implemented")},e.prototype.logicalAnd=function(e,t){throw new Error("Not yet implemented")},e.prototype.logicalOr=function(e,t){throw new Error("Not yet implemented")},e.prototype.where=function(e){throw new Error("Not yet implemented")},e.prototype.select=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.topk=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.min=function(e,t){throw new Error("Not yet implemented")},e.prototype.minimum=function(e,t){throw new Error("Not yet implemented")},e.prototype.mod=function(e,t){throw new Error("Not yet implemented")},e.prototype.max=function(e,t){throw new Error("Not yet implemented")},e.prototype.maximum=function(e,t){throw new Error("Not yet implemented")},e.prototype.all=function(e,t){throw new Error("Not yet implemented")},e.prototype.any=function(e,t){throw new Error("Not yet implemented")},e.prototype.squaredDifference=function(e,t){throw new Error("Not yet implemented")},e.prototype.ceil=function(e){throw new Error("Not yet implemented")},e.prototype.floor=function(e){throw new Error("Not yet implemented")},e.prototype.round=function(e){throw new Error("Not yet implemented")},e.prototype.sign=function(e){throw new Error("Not yet implemented")},e.prototype.isNaN=function(e){throw new Error("Not yet implemented")},e.prototype.isInf=function(e){throw new Error("Not yet implemented")},e.prototype.isFinite=function(e){throw new Error("Not yet implemented")},e.prototype.pow=function(e,t){throw new Error("Not yet implemented")},e.prototype.exp=function(e){throw new Error("Not yet implemented")},e.prototype.expm1=function(e){throw new Error("Not yet implemented")},e.prototype.log=function(e){throw new Error("Not yet implemented")},e.prototype.log1p=function(e){throw new Error("Not yet implemented")},e.prototype.sqrt=function(e){throw new Error("Not yet implemented")},e.prototype.rsqrt=function(e){throw new Error("Not yet implemented")},e.prototype.square=function(e){throw new Error("Not yet implemented")},e.prototype.reciprocal=function(e){throw new Error("Not yet implemented")},e.prototype.relu=function(e){throw new Error("Not yet implemented")},e.prototype.prelu=function(e,t){throw new Error("Not yet implemented")},e.prototype.elu=function(e){throw new Error("Not yet implemented")},e.prototype.eluDer=function(e,t){throw new Error("Not yet implemented")},e.prototype.selu=function(e){throw new Error("Not yet implemented")},e.prototype.int=function(e){throw new Error("Not yet implemented")},e.prototype.clip=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.abs=function(e){throw new Error("Not yet implemented")},e.prototype.complexAbs=function(e){throw new Error("Not yet implemented")},e.prototype.sigmoid=function(e){throw new Error("Not yet implemented")},e.prototype.softplus=function(e){throw new Error("Not yet implemented")},e.prototype.sin=function(e){throw new Error("Not yet implemented")},e.prototype.cos=function(e){throw new Error("Not yet implemented")},e.prototype.tan=function(e){throw new Error("Not yet implemented")},e.prototype.asin=function(e){throw new Error("Not yet implemented")},e.prototype.acos=function(e){throw new Error("Not yet implemented")},e.prototype.atan=function(e){throw new Error("Not yet implemented")},e.prototype.atan2=function(e,t){throw new Error("Not yet implemented")},e.prototype.sinh=function(e){throw new Error("Not yet implemented")},e.prototype.cosh=function(e){throw new Error("Not yet implemented")},e.prototype.tanh=function(e){throw new Error("Not yet implemented")},e.prototype.asinh=function(e){throw new Error("Not yet implemented")},e.prototype.acosh=function(e){throw new Error("Not yet implemented")},e.prototype.atanh=function(e){throw new Error("Not yet implemented")},e.prototype.erf=function(e){throw new Error("Not yet implemented")},e.prototype.step=function(e,t){throw new Error("Not yet implemented")},e.prototype.conv2d=function(e,t,n){throw new Error("Not yet implemented")}
vendor: 11,425 bytes, line 1
1,e.prototype.conv2dDerInput=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.conv2dDerFilter=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.depthwiseConv2D=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.depthwiseConv2DDerInput=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.depthwiseConv2DDerFilter=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.conv3d=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.conv3dDerInput=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.conv3dDerFilter=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.maxPool=function(e,t){throw new Error("Not yet implemented")},e.prototype.maxPoolBackprop=function(e,t,n,r){throw new Error("Not yet implemented")},e.prototype.avgPool=function(e,t){throw new Error("Not yet implemented")},e.prototype.avgPoolBackprop=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.reshape=function(e,t){throw new Error("Not yet implemented")},e.prototype.cast=function(e,t){throw new Error("Not yet implemented")},e.prototype.tile=function(e,t){throw new Error("Not yet implemented")},e.prototype.pad=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.transpose=function(e,t){throw new Error("Not yet implemented")},e.prototype.gather=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.gatherND=function(e,t){throw new Error("Not yet implemented")},e.prototype.scatterND=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.batchToSpaceND=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.spaceToBatchND=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.resizeBilinear=function(e,t,n,r){throw new Error("Not yet implemented")},e.prototype.resizeBilinearBackprop=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.resizeNearestNeighbor=function(e,t,n,r){throw new Error("Not yet implemented")},e.prototype.resizeNearestNeighborBackprop=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.batchNormalization=function(e,t,n,r,i,o){throw new Error("Not yet implemented")},e.prototype.localResponseNormalization4D=function(e,t,n,r,i){throw new Error("Not yet implemented")},e.prototype.LRNGrad=function(e,t,n,r,i,o,a){throw new Error("Not yet implemented")},e.prototype.multinomial=function(e,t,n,r){throw new Error("Not yet implemented")},e.prototype.oneHot=function(e,t,n,r){throw new Error("Not yet implemented")},e.prototype.cumsum=function(e,t,n,r){throw new Error("Not yet implemented")},e.prototype.nonMaxSuppression=function(e,t,n,r,i){throw new Error("Not yet implemented")},e.prototype.fft=function(e){throw new Error("Not yet implemented")},e.prototype.ifft=function(e){throw new Error("Not yet implemented")},e.prototype.complex=function(e,t){throw new Error("Not yet implemented")},e.prototype.real=function(e){throw new Error("Not yet implemented")},e.prototype.imag=function(e){throw new Error("Not yet implemented")},e.prototype.cropAndResize=function(e,t,n,r,i,o){throw new Error("Not yet implemented")},e.prototype.depthToSpace=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.split=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.sparseToDense=function(e,t,n,r){throw new Error("Not yet implemented")},e.prototype.fill=function(e,t,n){throw new Error("Not yet implemented.")},e.prototype.onesLike=function(e){throw new Error("Not yet implemented")},e.prototype.zerosLike=function(e){throw new Error("Not yet implemented")},e.prototype.linspace=function(e,t,n){throw new Error("Not yet implemented")},e.prototype.dispose=function(){throw new Error("Not yet implemented")},e}();function ir(e,t){for(var n=e.length,r=[],i=0;i<n;i++){var o=n-1-i,a=e[o]||1;(t[t.length-1-i]||1)>1&&1===a&&r.unshift(o)}return r}function or(e,t){for(var n=[],r=0;r<t.length;r++){var i=e[e.length-r-1],o=t.length-r-1,a=t[o];(null==i||1===i&&a>1)&&n.unshift(o)}return n}function ar(e,t){for(var n=[],r=Math.max(e.length,t.length),i=0;i<r;i++){var o=e[e.length-i-1];null==o&&(o=1);var a=t[t.length-i-1];if(null==a&&(a=1),1===o)n.unshift(a);else if(1===a)n.unshift(o);else{if(o!==a)throw Error("Operands could not be broadcast together with shapes "+e+" and "+t+".");n.unshift(o)}}return n}function sr(e,t,n,r,i,o,a){void 0===a&&(a="channelsLast");var s,u=fr(t),c=u[0],l=u[1];if("channelsLast"===a)s=[c,l,e[3],e[3]];else{if("channelsFirst"!==a)throw new Error("Unknown dataFormat "+a);s=[c,l,e[1],e[1]]}return ur(e,s,n,r,i,o,!1,a)}function ur(e,t,n,r,i,o,a,s){void 0===a&&(a=!1),void 0===s&&(s="channelsLast");var u=[-1,-1,-1,-1],c=u[0],l=u[1],f=u[2],h=u[3];if("channelsLast"===s)c=e[0],l=e[1],f=e[2],h=e[3];else{if("channelsFirst"!==s)throw new Error("Unknown dataFormat "+s);c=e[0],h=e[1],l=e[2],f=e[3]}var d,p=t[0],m=t[1],v=t[3],g=fr(n),y=g[0],b=g[1],x=fr(r),_=x[0],k=x[1],S=dr(p,_),E=dr(m,k),N=function(e,t,n,r,i,o,a,s){var u,c,l;if("number"==typeof e){u={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};var f=function(e,t,n,r,i,o){null==i&&(i=lr(e,t,r));var a=e[1],s=pr((e[0]-t+2*i)/r+1,o);w(C(s),function(){return"The output # of rows ("+s+") must be an integer. Change the stride and/or zero pad parameters"});var u=pr((a-t+2*i)/r+1,o);return w(C(u),function(){return"The output # of columns ("+u+") must be an integer. Change the stride and/or zero pad parameters"}),[s,u,1]}([t,n,1],o,0,r,e,s);c=f[0],l=f[1]}else if("same"===e){c=Math.ceil(t/r),l=Math.ceil(n/i);var h=Math.max(0,(c-1)*r+o-t),d=Math.max(0,(l-1)*i+a-n),p=Math.floor(h/2),m=h-p,v=Math.floor(d/2);u={top:p,bottom:m,left:v,right:d-v,type:"SAME"}}else{if("valid"!==e)throw Error("Unknown padding parameter: "+e);u={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((t-o+1)/r),l=Math.ceil((n-a+1)/i)}return{padInfo:u,outHeight:c,outWidth:l}}(i,l,f,y,b,S,E,o),O=N.padInfo,A=N.outHeight,T=N.outWidth,I=a?v*h:v;return"channelsFirst"===s?d=[c,I,A,T]:"channelsLast"===s&&(d=[c,A,T,I]),{batchSize:c,dataFormat:s,inHeight:l,inWidth:f,inChannels:h,outHeight:A,outWidth:T,outChannels:I,padInfo:O,strideHeight:y,strideWidth:b,filterHeight:p,filterWidth:m,effectiveFilterHeight:S,effectiveFilterWidth:E,dilationHeight:_,dilationWidth:k,inShape:e,outShape:d,filterShape:t}}function cr(e,t,n,r,i,o,a){void 0===o&&(o=!1),void 0===a&&(a="channelsLast");var s=[-1,-1,-1,-1,-1],u=s[0],c=s[1],l=s[2],f=s[3],h=s[4];if("channelsLast"===a)u=e[0],c=e[1],l=e[2],f=e[3],h=e[4];else{if("channelsFirst"!==a)throw new Error("Unknown dataFormat "+a);u=e[0],h=e[1],c=e[2],l=e[3],f=e[4]}var d,p=t[0],m=t[1],v=t[2],g=t[4],y=hr(n),b=y[0],w=y[1],x=y[2],_=hr(r),k=_[0],S=_[1],E=_[2],C=function(e,t,n,r,i,o,a,s,u,c){var l,f,h,d;if("same"===e){var p=((f=Math.ceil(t/i))-1)*i+s-t,m=((h=Math.ceil(n/o))-1)*o+u-n,v=((d=Math.ceil(r/a))-1)*a+c-r,g=Math.floor(p/2),y=p-g,b=Math.floor(m/2),w=m-b,x=Math.floor(v/2);l={top:b,bottom:w,left:x,right:v-x,front:g,back:y,type:"SAME"}}else{if("valid"!==e)throw Error("Unknown padding parameter: "+e);l={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},f=Math.ceil((t-s+1)/i),h=Math.ceil((n-u+1)/o),d=Math.ceil((r-c+1)/a)}return{padInfo:l,outDepth:f,outHeight:h,outWidth:d}}(i,c,l,f,b,w,x,dr(p,k),dr(m,S),dr(v,E)),N=C.padInfo,O=C.outDepth,A=C.outHeight,T=C.outWidth,I=o?g*h:g;return"channelsFirst"===a?d=[u,I,O,A,T]:"channelsLast"===a&&(d=[u,O,A,T,I]),{batchSize:u,dataFormat:a,inDepth:c,inHeight:l,inWidth:f,inChannels:h,outDepth:O,outHeight:A,outWidth:T,outChannels:I,padInfo:N,strideDepth:b,strideHeight:w,strideWidth:x,filterDepth:p,filterHeight:m,filterWidth:v,dilationDepth:k,dilationHeight:S,dilationWidth:E,inShape:e,outShape:d,filterShape:t}}function lr(e,t,n,r){void 0===r&&(r=1);var i=dr(t,r);return Math.floor((e[0]*(n-1)-n+i)/2)}function fr(e){return"number"==typeof e?[e,e]:e}function hr(e){return"number"==typeof e?[e,e,e]:e}function dr(e,t){return t<=1?e:e+(e-1)*(t-1)}function pr(e,t){if(!t)return e;switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error("Unknown roundingMode "+t)}}function mr(e){var t=fr(e),n=t[0],r=t[1];return 1===n&&1===r}function vr(e,t){return mr(e)||mr(t)}function gr(e,t,n){if("complex64"===t){if("complex64"===e.dtype)return e.clone();var r=Yn(e.shape),i=e.toFloat(),o=n.complex(i,r);return r.dispose(),i.dispose(),o}if(!B(e.dtype,t))return ve.make(e.shape,{dataId:e.dataId},t);if("complex64"===e.dtype){var a=n.real(e);return o=a.cast(t),a.dispose(),o}if("int32"===t)return n.int(e);if("bool"===t){var s=Wn(0,e.dtype);return o=n.notEqual(e,s),s.dispose(),o}throw new Error("Error in Cast: failed to cast "+e.dtype+" to "+t)}function yr(e,t){return ve.make(t,{dataId:e.dataId},e.dtype)}function br(e,t,n){var r=(t-e)/(n-1),i=Q(n,"float32");i[0]=e;for(var o=1;o<i.length;o++)i[o]=i[o-1]+r;return Vn(i,"float32")}var wr=Object.freeze({castTensor:gr,reshapeTensor:yr,linspaceImpl:br,upcastType:Ce,axesAreInnerMostDims:on,combineLocations:an,computeOutAndReduceShapes:sn,expandShapeToKeepDim:un,assertAxesAreInnerMostDims:cn,getAxesPermutation:ln,getUndoAxesPermutation:fn,getInnerMostAxes:hn,getBroadcastDims:ir,getReductionAxes:or,assertAndGetBroadcastShape:ar,assertParamsConsistent:dn,computeOutShape:pn,computePool2DInfo:sr,computeConv2DInfo:ur,computeConv3DInfo:cr,computeDefaultPad:lr,tupleValuesAreOne:mr,eitherStridesOrDilationsAreOne:vr});function xr(e,t){if(e.length!==t.length)throw new Error("Cannot merge real and imag arrays of different lengths. real:"+e.length+", imag: "+t.length+".");for(var n=new Float32Array(2*e.length),r=0;r<n.length;r+=2)n[r]=e[r/2],n[r+1]=t[r/2];return n}function _r(e,t){return{real:e[2*t],imag:e[2*t+1]}}function kr(e,t,n,r){e[2*r]=t,e[2*r+1]=n}function Sr(e,t,n){var r=(n?2:-2)*Math.PI*(e/t);return{real:Math.cos(r),imag:Math.sin(r)}}function Er(e,t,n,r,i){for(var o=Array.from(t).map(function(e,t){return{score:e,boxIndex:t}}).filter(function(e){return e.score>i}).sort(function(e,t){return t.score-e.score}),a=[],s=0;s<o.length;s++){var u=o[s],c=u.score,l=u.boxIndex;if(c<i)break;for(var f=!1,h=a.length-1;h>=0;--h)if(Cr(e,l,a[h])>=r){f=!0;break}if(!f&&(a.push(l),a.length>=n))break}return Vn(a,"int32")}function Cr(e,t,n){var r=e.subarray(4*t,4*t+4),i=e.subarray(4*n,4*n+4),o=Math.min(r[0],r[2]),a=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),u=Math.max(r[1],r[3]),c=Math.min(i[0],i[2]),l=Math.min(i[1],i[3]),f=Math.max(i[0],i[2]),h=Math.max(i[1],i[3]),d=(s-o)*(u-a),p=(f-c)*(h-l);if(d<=0||p<=0)return 0;var m=Math.max(o,c),v=Math.max(a,l),g=Math.min(s,f),y=Math.min(u,h),b=Math.max(g-m,0)*Math.max(y-v,0);return b/(d+p-b)}function Nr(e,t,n){var r=new Array(e.rank).fill(0),i=e.shape.slice();return t.map(function(t){i[n]=t;var o=e.slice(r,i);return r[n]+=t,o})}function Or(e,t,n,r,i){for(var o=t[t.length-1],a=[e.length/o,o],s=a[0],u=a[1],c=D(n,s*r),l=D("int32",s*r),f=0;f<s;f++){for(var h=f*u,d=e.subarray(h,h+u),p=[],m=0;m<d.length;m++)p.push({value:d[m],index:m});p.sort(function(e,t){return t.value-e.value});var v=f*r,g=c.subarray(v,v+r),y=l.subarray(v,v+r);for(m=0;m<r;m++)g[m]=p[m].value,y[m]=p[m].index}var b=t.slice();return b[b.length-1]=r,[Un(c,b,n),Un(l,b,"int32")]}var Ar=jn({concat_:function(e,t){void 0===t&&(t=0),w(e.length>=1,function(){return"Pass at least one tensor to concat"});var n=Nn(e,"tensors","concat");t=R(t,n[0].shape)[0];var r=pn(n.map(function(e){return e.shape}),t);
1if(0===S(r))return Un([],r);if(1===(n=n.filter(function(e){return e.size>0})).length)return n[0];var i=n.map(function(e){return e.shape});dn(i,t);var o=n;return je.runKernel(function(e){return e.concat(n,t)},o,function(e){var n=i.map(function(e){return e[t]});return Dr(e,n,t).map(function(e){return function(){return e}})})}}),Tr=jn({concat1d_:function(e){return Ar(e,0)}}),Ir=jn({concat2d_:function(e,t){return Ar(e,t)}}),Rr=jn({concat3d_:function(e,t){return Ar(e,t)}}),Mr=jn({concat4d_:function(e,t){return Ar(e,t)}}),Dr=jn({split_:function(e,t,n){void 0===n&&(n=0);var r,i=Cn(e,"x","split");return n=R(n,i.shape)[0],"number"==typeof t?(w(i.shape[n]%t==0,function(){return"Number of splits must evenly divide the axis."}),r=new Array(t).fill(i.shape[n]/t)):(w(i.shape[n]===t.reduce(function(e,t){return e+t}),function(){return"The sum of sizes must match the size of the axis dimension."}),r=t),je.runKernel(function(e){return e.split(i,r,n)},{$x:i},function(e){return{$x:function(){return Ar(e,n)}}})}});function jr(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof r||"undefined"!=typeof self&&self;var Pr=jr(function(e){!function(e,t,n){function r(e){var t,n=this,r=(t=4022871197,function(e){e=e.toString();for(var n=0;n<e.length;n++){var r=.02519603282416938*(t+=e.charCodeAt(n));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function i(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function o(e,t){var n=new r(e),o=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+1.1102230246251565e-16*(2097152*a()|0)},a.quick=a,o&&("object"==typeof o&&i(o,n),a.state=function(){return i(n,{})}),a}t&&t.exports?t.exports=o:this.alea=o}(0,e)}),zr=jr(function(e){!function(e,t,n){function r(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;
vendor: 7,659 bytes, line 1
1r++)t.x^=0|n.charCodeAt(r),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function o(e,t){var n=new r(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&("object"==typeof o&&i(o,n),a.state=function(){return i(n,{})}),a}t&&t.exports?t.exports=o:this.xor128=o}(0,e)}),Lr=jr(function(e){!function(e,t,n){function r(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function o(e,t){var n=new r(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&("object"==typeof o&&i(o,n),a.state=function(){return i(n,{})}),a}t&&t.exports?t.exports=o:this.xorwow=o}(0,e)}),Br=jr(function(e){!function(e,t,n){function r(e){var t=this;t.next=function(){var e,n,r=t.x,i=t.i;return e=r[i],n=(e^=e>>>7)^e<<24,n^=(e=r[i+1&7])^e>>>10,n^=(e=r[i+3&7])^e>>>3,n^=(e=r[i+4&7])^e<<7,e=r[i+7&7],n^=(e^=e<<13)^e<<9,r[i]=n,t.i=i+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function i(e,t){return t.x=e.x.slice(),t.i=e.i,t}function o(e,t){null==e&&(e=+new Date);var n=new r(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(o.x&&i(o,n),a.state=function(){return i(n,{})}),a}t&&t.exports?t.exports=o:this.xorshift7=o}(0,e)}),Fr=jr(function(e){!function(e,t,n){function r(e){var t=this;t.next=function(){var e,n,r=t.w,i=t.X,o=t.i;return t.w=r=r+1640531527|0,n=i[o+34&127],e=i[o=o+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=i[o]=n^e,t.i=o,n+(r^r>>>16)|0},function(e,t){var n,r,i,o,a,s=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),i=0,o=-32;o<u;++o)t&&(r^=t.charCodeAt((o+32)%t.length)),0===o&&(a=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,o>=0&&(a=a+1640531527|0,i=0==(n=s[127&o]^=r+a)?i+1:0);for(i>=128&&(s[127&(t&&t.length||0)]=-1),i=127,o=512;o>0;--o)r=s[i+34&127],n=s[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[i]=r^n;e.w=a,e.X=s,e.i=i}(t,e)}function i(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function o(e,t){null==e&&(e=+new Date);var n=new r(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&(o.X&&i(o,n),a.state=function(){return i(n,{})}),a}t&&t.exports?t.exports=o:this.xor4096=o}(0,e)}),Ur=jr(function(e){!function(e,t,n){function r(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,i=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^i,t.a=i-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}function i(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function o(e,t){var n=new r(e),o=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,o&&("object"==typeof o&&i(o,n),a.state=function(){return i(n,{})}),a}t&&t.exports?t.exports=o:this.tychei=o}(0,e)}),Wr=jr(function(e){!function(t,r){var i,o=this,a=256,s=6,u="random",c=r.pow(a,s),l=r.pow(2,52),f=2*l,h=a-1;function d(e,n,h){var d=[],y=v(function e(t,n){var r,i=[],o=typeof t;if(n&&"object"==o)for(r in t)try{i.push(e(t[r],n-1))}catch(e){}return i.length?i:"string"==o?t:t+"\0"}((n=1==n?{entropy:!0}:n||{}).entropy?[e,g(t)]:null==e?function(){try{var e;return i&&(e=i.randomBytes)?e=e(a):(e=new Uint8Array(a),(o.crypto||o.msCrypto).getRandomValues(e)),g(e)}catch(e){var n=o.navigator,r=n&&n.plugins;return[+new Date,o,r,o.screen,g(t)]}}():e,3),d),b=new p(d),w=function(){for(var e=b.g(s),t=c,n=0;e<l;)e=(e+n)*a,t*=a,n=b.g(1);for(;e>=f;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|b.g(4)},w.quick=function(){return b.g(4)/4294967296},w.double=w,v(g(b.S),t),(n.pass||h||function(e,t,n,i){return i&&(i.S&&m(i,b),e.state=function(){return m(b,{})}),n?(r[u]=e,t):e})(w,y,"global"in n?n.global:this==r,n.state)}function p(e){var t,n=e.length,r=this,i=0,o=r.i=r.j=0,s=r.S=[];for(n||(e=[n++]);i<a;)s[i]=i++;for(i=0;i<a;i++)s[i]=s[o=h&o+e[i%n]+(t=s[i])],s[o]=t;(r.g=function(e){for(var t,n=0,i=r.i,o=r.j,s=r.S;e--;)t=s[i=h&i+1],n=n*a+s[h&(s[i]=s[o=h&o+t])+(s[o]=t)];return r.i=i,r.j=o,n})(a)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function v(e,t){for(var n,r=e+"",i=0;i<r.length;)t[h&i]=h&(n^=19*t[h&i])+r.charCodeAt(i++);return g(t)}function g(e){return String.fromCharCode.apply(0,e)}if(r["seed"+u]=d,v(r.random(),t),e.exports){e.exports=d;try{i=n(81)}catch(e){}}}([],Math)});Wr.alea=Pr,Wr.xor128=zr,Wr.xorwow=Lr,Wr.xorshift7=Br,Wr.xor4096=Fr,Wr.tychei=Ur;var Vr=Wr.alea,qr=function(){function e(e,t,n,r,i){this.mean=e,this.stdDev=t,this.dtype=n,this.nextVal=NaN,this.truncated=r,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);var o=i||Math.random();this.random=Vr(o.toString())}return e.prototype.nextValue=function(){if(!isNaN(this.nextVal)){var e=this.nextVal;return this.nextVal=NaN,e}for(var t,n,r=!1;!r;){var i=void 0,o=void 0,a=void 0;do{a=(i=2*this.random()-1)*i+(o=2*this.random()-1)*o}while(a>=1||0===a);var s=Math.sqrt(-2*Math.log(a)/a);t=this.mean+this.stdDev*i*s,n=this.mean+this.stdDev*o*s,this.truncated&&!this.isValidTruncated(t)||(r=!0)}return this.truncated&&!this.isValidTruncated(n)||(this.nextVal=this.convertValue(n)),this.convertValue(t)},e.prototype.convertValue=function(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)},e.prototype.isValidTruncated=function(e){return e<=this.upper&&e>=this.lower},e}(),Hr=function(){function e(e,t,n,r){void 0===e&&(e=0),void 0===t&&(t=1),void 0===r&&(r=Math.random());var i=this;if(this.canReturnFloat=function(){return null==i.dtype||"float32"===i.dtype},this.min=e,this.range=t-e,this.dtype=n,!this.canReturnFloat()&&this.range<=1)throw new Error("The difference between "+e+" - "+t+" <= 1 and dtype is not float");this.random=Vr(r.toString())}return e.prototype.convertValue=function(e){return this.canReturnFloat()?e:Math.round(e)},e.prototype.nextValue=function(){return this.convertValue(this.min+this.range*this.random())},e}();function Gr(e,t,n){return void 0===t&&(t="float32"),t=t||"float32",te(e),new he(e,t,n)}function Kr(e,t){void 0===t&&(t=!1),console.log(e.toString(t))}var $r=jn({batchToSpaceND_:function(e,t,n){var r=Cn(e,"x","batchToSpaceND"),i=t.reduce(function(e,t){return e*t});return w(r.rank>=1+t.length,function(){return"input rank is "+r.rank+" but should be > than blockShape.length "+t.length}),w(n.length===t.length,function(){return"crops.length is "+n.length+" but should be equal to blockShape.length "+t.length}),w(r.shape[0]%i==0,function(){return"input tensor batch is "+r.shape[0]+" but is not divisible by the product of the elements of blockS
1hape "+t.join(" * ")+" === "+i}),je.runKernel(function(e){return e.batchToSpaceND(r,t,n)},{$x:r},function(e){return{$x:function(){return e.spaceToBatchND(t,n)}}})}}),Xr=jn({cast_:function(e,t){var n=Cn(e,"x","cast");if(!L(t))throw new Error("Failed to cast to unknown dtype "+t);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");return je.runKernel(function(e){return e.cast(n,t)},{$x:n},function(e){return{$x:function(){return e.clone()}}})}}),Yr=jn({clone_:function(e){var t=Cn(e,"x","clone",null);return je.runKernel(function(e){return ve.make(t.shape,{dataId:t.dataId},t.dtype)},{$x:t},function(e){return{$x:function(){return e.toFloat()}}})}}),Jr=jn({cumsum_:function(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=!1),void 0===r&&(r=!1);var i=Cn(e,"x","cumsum"),o=ln([t|=0],i.rank),a=i;null!=o&&(a=i.transpose(o));var s=hn(1,i.rank)[0],u=je.runKernel(function(e){return e.cumsum(a,s,n,r)},{permutedX:a},function(e){return{permutedX:function(){return e.cumsum(t,n,!r)}}});return null!=o&&(u=u.transpose(o)),u}}),Zr=jn({depthToSpace_:function(e,t,n){void 0===n&&(n="NHWC");var r=Cn(e,"x","depthToSpace"),i="NHWC"===n?r.shape[1]:r.shape[2],o="NHWC"===n?r.shape[2]:r.shape[3],a="NHWC"===n?r.shape[3]:r.shape[1];return w(i*t>=0,function(){return"Negative dimension size caused by overflow when multiplying\n "+i+" and "+t+" for depthToSpace with input shape\n "+r.shape}),w(o*t>=0,function(){return"Negative dimension size caused by overflow when multiplying\n "+o+" and "+t+" for depthToSpace with input shape\n "+r.shape}),w(a%(t*t)==0,function(){return"Dimension size must be evenly divisible by "+t*t+" but is "+a+" for depthToSpace with input shape "+r.shape}),je.runKernel(function(e){return e.depthToSpace(r,t,n)},{$x:r})}}),Qr=jn({expandDims_:function(e,t){void 0===t&&(t=0);var n=Cn(e,"x","expandDims");w(t<=n.rank,function(){return"Axis must be <= rank of the tensor"});var r=n.shape.slice();return t<0&&(w(-(n.rank+1)<=t,function(){return"Axis must be in the interval ["+-(n.rank+1)+", "+n.rank+"]"}),t=n.rank+t+1),r.splice(t,0,1),fi(n,r)}}),ei=jn({eye_:function(e,t,n,r){void 0===r&&(r="float32"),null==t&&(t=e);for(var i=Gr([e,t],r),o=e<=t?e:t,a=0;a<o;++a)i.set(1,a,a);var s=i.toTensor().as2D(e,t);if(null==n)return s;if(1===n.length)return mi(Qr(s,0),[n[0],1,1]);if(2===n.length)return mi(Qr(Qr(s,0),0),[n[0],n[1],1,1]);if(3===n.length)return mi(Qr(Qr(Qr(s,0),0),0),[n[0],n[1],n[2],1,1]);throw new Error("eye() currently supports only 1D and 2D batchShapes, but received "+n.length+"D.")}}),ti=jn({multinomial_:function(e,t,n,r){void 0===r&&(r=!1);var i=Cn(e,"logits","multinomial"),o=i.size,a=i.rank;if(o<2)throw new Error("Error in multinomial: you need at least 2 outcomes, but got "+o+".");if(a>2)throw new Error("Rank of probabilities must be 1 or 2, but is "+a);n=n||Math.random();var s=1===a?i.as2D(1,-1):i,u=je.runKernel(function(e){return e.multinomial(s,r,t,n)},{logits2D:s});return 1===a?u.as1D():u}}),ni=jn({oneHot_:function(e,t,n,r){if(void 0===n&&(n=1),void 0===r&&(r=0),t<2)throw new Error("Error in oneHot: depth must be >=2, but it is "+t);var i=Cn(e,"indices","oneHot","int32"),o=i.shape.concat([t]);return i=i.flatten(),je.runKernel(function(e){return e.oneHot(i,t,n,r)},{$indices:i},function(e){return{$indices:function(){return Yn(i.shape,"float32")}}}).reshape(o)}}),ri=jn({pad_:function(e,t,n){void 0===n&&(n=0);var r=Cn(e,"x","pad");if(0===r.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");var i=t.map(function(e){return e[0]});return je.runKernel(function(e){return e.pad(r,t,n)},{$x:r},function(e){return{$x:function(){return e.slice(i,r.shape)}}})}}),ii=jn({pad1d_:function(e,t,n){return void 0===n&&(n=0),w(2===t.length,function(){return"Invalid number of paddings. Must be length of 2."}),ri(e,[t],n)}}),oi=jn({pad2d_:function(e,t,n){return void 0===n&&(n=0),w(2===t.length&&2===t[0].length&&2===t[1].length,function(){return"Invalid number of paddings. Must be length of 2 each."}),ri(e,t,n)}}),ai=jn({pad3d_:function(e,t,n){return void 0===n&&(n=0),w(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,function(){return"Invalid number of paddings. Must be length of 2 each."}),ri(e,t,n)}}),si=jn({pad4d_:function(e,t,n){return void 0===n&&(n=0),w(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,function(){return"Invalid number of paddings. Must be length of 2 each."}),ri(e,t,n)}}),ui=jn({rand_:function(e,t,n){var r=S(e),i=null;if(null==n||"float32"===n)i=new Float32Array(r);else if("int32"===n)i=new Int32Array(r);else{if("bool"!==n)throw new Error("Unknown data type "+n);i=new Uint8Array(r)}for(var o=0;o<r;o++)i[o]=t();return ve.make(e,{values:i},n)}}),ci=jn({randomNormal_:function(e,t,n,r,i){if(void 0===t&&(t=0),void 0===n&&(n=1),null!=r&&"bool"===r)throw new Error("Unsupported data type "+r);for(var o=new qr(t,n,r,!1,i),a=Gr(e,r),s=0;s<a.values.length;s++)a.values[s]=o.nextValue();return a.toTensor()}}),li=jn({randomUniform_:function(e,t,n,r,i){void 0===t&&(t=0),void 0===n&&(n=1),void 0===r&&(r="float32");for(var o=Gr(e,r),a=new Hr(t,n,null,i),s=0;s<o.values.length;s++)o.values[s]=a.nextValue();return o.toTensor()}}),fi=jn({reshape_:function(e,t){var n=Cn(e,"x","reshape",null);return t=I(t,n.size),w(n.size===S(t),function(){return"new shape and old shape must have the same number of elements."}),je.runKernel(function(e){return e.reshape(n,t)},{$x:n},function(e){return{$x:function(){return e.reshape(n.shape)}}})}}),hi=jn({spaceToBatchND_:function(e,t,n){var r=Cn(e,"x","spaceToBatchND");return w(r.rank>=1+t.length,function(){return"input rank "+r.rank+" should be > than [blockShape] "+t.length}),w(n.length===t.length,function(){return"paddings.shape[0] "+n.length+" must be equal to [blockShape] "+t.length}),w(r.shape.reduce(function(e,r,i){return i>0&&i<=t.length?e&&(r+n[i-1][0]+n[i-1][1])%t[i-1]==0:e},!0),function(){return"input spatial dimensions "+r.shape.slice(1)+" with paddings "+n.toString()+" must be divisible by blockShapes "+t.toString()}),je.runKernel(function(e){return e.spaceToBatchND(r,t,n)},{$x:r},function(e){return{$x:function(){return e.batchToSpaceND(t,n)}}})}}),di=jn({squeeze_:function(e,t){var n=Cn(e,"x","squeeze");return fi(n,M(n.shape,t).newShape)}}),pi=jn({stack_:function(e,t){void 0===t&&(t=0);var n=Nn(e,"tensors","stack");if(w(n.length>=1,function(){return"Pass at least one tensor to tf.stack"}),1===n.length)return n[0].expandDims(t);var r=n[0].rank,i=n[0].shape,o=n[0].dtype;w(t<=r,function(){return"Axis must be <= rank of the tensor"}
vendor: 4,334 bytes, line 1
1),n.forEach(function(e){x(i,e.shape,"All tensors passed to stack must have matching shapes")}),n.forEach(function(e){w(o===e.dtype,function(){return"All tensors passed to stack must have matching dtypes"})});var a=n.map(function(e){return e.expandDims(t)});return Ar(a,t)}}),mi=jn({tile_:function(e,t){var n=Cn(e,"x","tile");return w(n.rank===t.length,function(){return"Error in transpose: rank of input "+n.rank+" must match length of reps "+t+"."}),je.runKernel(function(e,r){var i=e.tile(n,t);return r([n]),i},{$x:n},function(e,n){var r=n[0];return{$x:function(){var n=tr(r);if(1===r.rank)for(var i=0;i<t[0];++i)n=n.add(e.slice([i*r.shape[0]],[r.shape[0]]));else if(2===r.rank)for(i=0;i<t[0];++i)for(var o=0;o<t[1];++o)n=n.add(e.slice([i*r.shape[0],o*r.shape[1]],[r.shape[0],r.shape[1]]));else if(3===r.rank)for(i=0;i<t[0];++i)for(o=0;o<t[1];++o)for(var a=0;a<t[2];++a)n=n.add(e.slice([i*r.shape[0],o*r.shape[1],a*r.shape[2]],[r.shape[0],r.shape[1],r.shape[2]]));else{if(4!==r.rank)throw new Error("Gradient for tile operation is not implemented for rank-"+r.rank+" tensors yet.");for(i=0;i<t[0];++i)for(o=0;o<t[1];++o)for(a=0;a<t[2];++a)for(var s=0;s<t[3];++s)n=n.add(e.slice([i*r.shape[0],o*r.shape[1],a*r.shape[2],s*r.shape[3]],[r.shape[0],r.shape[1],r.shape[2],r.shape[3]]))}return n}}})}}),vi=jn({truncatedNormal_:function(e,t,n,r,i){if(void 0===t&&(t=0),void 0===n&&(n=1),null!=r&&"bool"===r)throw new Error("Unsupported data type "+r);for(var o=new qr(t,n,r,!0,i),a=Gr(e,r),s=0;s<a.values.length;s++)a.values[s]=o.nextValue();return a.toTensor()}}),gi=jn({unstack_:function(e,t){void 0===t&&(t=0),t=t||0;var n=Cn(e,"x","unstack");return w(t>=-n.shape.length&&t<n.shape.length,function(){return"Axis = "+t+" is not in [-"+n.shape.length+", "+n.shape.length+")"}),t<0&&(t+=n.shape.length),je.runKernel(function(e){return e.unstack(n,t)},{$x:n},function(e){return{$x:function(){return pi(e,t)}}})}}),yi=function(e,t){return c(this,void 0,void 0,function(){var n,r,i,o,a,s,u,c,f,h;return l(this,function(l){switch(l.label){case 0:return n=Cn(e,"x","setdiff1d"),r=Cn(t,"y","setdiff1d"),w(n.dtype===r.dtype,function(){return"x and y should have the same dtype, but got x ("+n.dtype+") and y ("+r.dtype+")."}),w(1===n.rank,function(){return"x should be 1D tensor, but got x ("+n.shape+")."}),w(1===r.rank,function(){return"y should be 1D tensor, but got y ("+r.shape+")."}),[4,n.data()];case 1:return i=l.sent(),[4,r.data()];case 2:for(o=l.sent(),a=new Set(o),s=0,f=0;f<i.length;f++)a.has(i[f])||s++;for(u=new he([s],n.dtype),c=new he([s],"int32"),f=0,h=0;f<i.length;f++)a.has(i[f])||(u.values[h]=i[f],c.values[h]=f,h++);return[2,[u.toTensor(),c.toTensor()]]}})})};function bi(e,t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(r);var i=Gr(e,"int32"),o=Gr([n.length,e.length],"int32");for(r=0;r<n.length;r++){var a=i.indexToLoc(n[r]),s=r*e.length;o.values.set(a,s)}return o.toTensor()}var wi=function(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map(function(e,t){return"T"+t});var n=[];this.variableNames.forEach(function(e){n.push("float v"+e+" = get"+e+"AtOutCoords();")});var r=this.variableNames.map(function(e){return"v"+e}).join(" + ");this.userCode="\n void main() {\n "+n.join("\n ")+"\n\n float result = "+r+";\n setOutput(result);\n }\n "},xi=function(e,t){this.outputShape=[],this.usesPackedTextures=!0,this.outputShape=e,this.variableNames=t.map(function(e,t){return"T"+t});var n=[];this.variableNames.forEach(function(e){n.push("vec4 v"+e+" = get"+e+"AtOutCoords();")});var r=this.variableNames.map(function(e){return"v"+e}).join(" + ");this.userCode="\n void main() {\n "+n.join("\n ")+"\n\n vec4 result = "+r+";\n setOutput(result);\n }\n "},_i=function(e,t,n){this.variableNames=["A"];var r=e.windowSize,i=e.batchSize,o=e.inSize,a=Math.ceil(o/r);n||this.variableNames.push("bestIndicesA"),this.outputShape=[i,a];var s="max"===t?">":"<",u=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+r+";\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < "+r+";
1 i++) {\n int inIdx = "+u+";\n float candidate = getA(batch, inIdx);\n if (candidate "+s+" bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n "};function ki(e,t){return["x","y","z","w","u","v"].slice(0,t).map(function(t){return e+"."+t})}function Si(e,t){return 1===t?[e]:ki(e,t)}function Ei(){var e,t,n,r,i,o,a,s,u,c;return 2===f.getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",r="in",i="texture",o="outputColor",a="out vec4 outputColor;",s="\n bool isnan_custom(float val) {\n return (val > 0. || val < 0. || val == 0.) ? false : true;\n }\n ",u="\n const float INFINITY = uintBitsToFloat(uint(0x7f800000));\n ",c="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(e="",t="attribute",n="varying",r="varying",i="texture2D",o="gl_FragColor",a="",s="\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n ",u="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",c="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:e,attribute:t,varyingVs:n,varyingFs:r,texture2D:i,output:o,defineOutput:a,defineSpecialNaN:s,defineSpecialInf:u,defineRound:c}}function Ci(e,t,n){void 0===n&&(n="index");var r=X(t);return r.map(function(t,i){return"int "+e[i]+" = "+n+" / "+t+"; "+(i===r.length-1?"int "+e[i+1]+" = "+n+" - "+e[i]+" * "+t:"index -= "+e[i]+" * "+t)+";"}).join("")}function Ni(e){return 1===e.length?""+e[0]:"vec"+e.length+"("+e.join(",")+")"}function Oi(e){return"\n int getFlatIndex(ivec3 coords) {\n return round("+function(e,t){if(e.length!==t.length)throw new Error("Vectors to be dotted must be of the same length -got "+e.length+" and "+t.length);for(var n=[],r=Math.floor(e.length/4),i=e.length%4,o=0;o<r;o++){var a=e.slice(4*o,4*o+4),s=t.slice(4*o,4*o+4);n.push(Ni(a)+", "+Ni(s))}return 0!==i&&(a=e.slice(4*r),s=t.slice(4*r),1===a.length&&(a=a.map(function(e){return"float("+e+")"}),s=s.map(function(e){return"float("+e+")"})),n.push(Ni(a)+", "+Ni(s))),n.map(function(e,t){return"dot("+e+")"}).join("+")}(["coords.x","coords.y","coords.z"],X(e).map(function(e){return e.toString()}).concat(["1."]))+");\n }\n"}function Ai(e,t,n,r){var i=[];e.forEach(function(e){var t=S(e.shapeInfo.logicalShape);e.shapeInfo.isUniform?i.push("uniform float "+e.name+(t>1?"["+t+"]":"")+";"):(i.push("uniform sampler2D "+e.name+";"),i.push("uniform int offset"+e.name+";"))});var o,a,s=i.join("\n"),u=e.map(function(e){return function(e,t,n){void 0===n&&(n=!1);var r="";r+=n?function e(t){var n,r,i;switch(t.shapeInfo.logicalShape.length){case 0:return n=t.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=Ei(),"\n vec4 "+r+"() {\n return "+i.texture2D+"("+n+", halfCR);\n }\n ";case 1:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1),r=e.shapeInfo.texShape,i=[Math.ceil(r[0]/2),Math.ceil(r[1]/2)],o=Ei();return"\n vec4 "+n+"(int index) {\n vec2 uv = packedUVfrom1D(\n "+i[0]+", "+i[1]+", index);\n return "+o.texture2D+"("+t+", uv);\n }\n "}(t);case 2:return function(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e.shapeInfo.texShape,o=i[0],a=i[1],s=Ei();if(null!=i&&E(t,i))return"\n vec4 "+r+"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2("+a+".0, "+o+".0);\n\n return "+s.texture2D+"("+n+", uv);\n }\n ";var u=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)],c=Math.ceil(t[1]/2);return"\n vec4 "+r+"(int row, int col) {\n vec2 uv = packedUVfrom2D("+c+", "+u[0]+", "+u[1]+", row, col);\n return "+s.texture2D+"("+n+", uv);\n }\n "}(t);case 3:return function(t){var n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=t.shapeInfo.texShape,a=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)];if(1===n[0]){var s=n.slice(1),u=zi(t,s);return"\n "+e(u)+"\n vec4 "+i+"(int b, int row, int col) {\n return "+i+"("+Li(["b","row","col"],[1,2])+");\n }\n "}var c=a[0],l=a[1],f=Math.ceil(n[2]/2),h=f*Math.ceil(n[1]/2),d=Ei();return"\n vec4 "+i+"(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n "+c+", "+l+", "+h+", "+f+", b, row, col);\n return "+d.texture2D+"("+r+", uv);\n }\n "}(t);default:return function(e){for(var t=e.shapeInfo.logicalShape,n=t.length,r=e.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=e.shapeInfo.texShape,a=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)],s=a[0],u=a[1],c=Math.ceil(t[n-1]/2),l=c*Math.ceil(t[n-2]/2),f="int b, int row, int col",h="b * "+l+" + (row / 2) * "+c+" + (col / 2)",d=2;d<n-1;d++)f="int b"+d+", "+f,l*=t[n-d-1],h="b"+d+" * "+l+" + "+h;var p=Ei();return"\n vec4 "+i+"("+f+") {\n int index = "+h+";\n int texR = index / "+u+";\n int texC = index - texR * "+u+";\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+u+", "+s+");\n return "+p.texture2D+"("+r+", uv);\n }\n "}(t)}}(e):function e(t){var n=t.shapeInfo.logicalShape;switch(n.length){case 0:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1);if(e.shapeInfo.isUniform)return"float "+n+"() {return "+t+";}";var r=e.shapeInfo.texShape,i=r[0],o=r[1];if(1===i&&1===o)return"\n float "+n+"() {\n return sampleTexture("+t+", halfCR
1);\n }\n ";var a=e.shapeInfo.texShape,s=a[0],u=a[1],c=Di(t);return"\n float "+n+"() {\n vec2 uv = uvFromFlat("+s+", "+u+", "+c+");\n return sampleTexture("+t+", uv);\n }\n "}(t);case 1:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1);if(e.shapeInfo.isUniform)return"\n float "+n+"(int index) {\n "+ji(e)+"\n }\n ";var r=e.shapeInfo.texShape,i=r[0],o=r[1];if(1===o&&1===i)return"\n float "+n+"(int index) {\n return sampleTexture("+t+", halfCR);\n }\n ";var a=Di(t);return 1===o?"\n float "+n+"(int index) {\n vec2 uv = vec2(0.5, (float(index + "+a+") + 0.5) / "+i+".0);\n return sampleTexture("+t+", uv);\n }\n ":1===i?"\n float "+n+"(int index) {\n vec2 uv = vec2((float(index + "+a+") + 0.5) / "+o+".0, 0.5);\n return sampleTexture("+t+", uv);\n }\n ":"\n float "+n+"(int index) {\n vec2 uv = uvFromFlat("+i+", "+o+", index + "+a+");\n return sampleTexture("+t+", uv);\n }\n "}(t);case 2:return function(t){var n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=t.shapeInfo.texShape;if(null!=o&&E(n,o)){var a=o[0],s=o[1];return"\n float "+i+"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2("+s+".0, "+a+".0);\n return sampleTexture("+r+", uv);\n }\n "}var u=M(n),c=u.newShape,l=u.keptDims,f=c;if(f.length<n.length){var h=zi(t,f);return"\n "+e(h)+"\n float "+i+"(int row, int col) {\n return "+i+"("+Li(["row","col"],l)+");\n }\n "}if(t.shapeInfo.isUniform)return"\n float "+i+"(int row, int col) {\n int index = round(dot(vec2(row, col), vec2("+n[1]+", 1)));\n "+ji(t)+"\n }\n ";var d=o[0],p=o[1],m=Di(r);return 1===p?"\n float "+i+"(int row, int col) {\n float index = dot(vec3(row, col, "+m+"), vec3("+n[1]+", 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / "+d+".0);\n return sampleTexture("+r+", uv);\n }\n ":1===d?"\n float "+i+"(int row, int col) {\n float index = dot(vec3(row, col, "+m+"), vec3("+n[1]+", 1, 1));\n vec2 uv = vec2((index + 0.5) / "+p+".0, 0.5);\n return sampleTexture("+r+", uv);\n }\n ":"\n float "+i+"(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+n[1]+" + col + "+m+";\n vec2 uv = uvFromFlat("+d+", "+p+", index);\n return sampleTexture("+r+", uv);\n }\n"}(t);case 3:return function(t){var n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[1]*n[2],a=n[2],s=M(n),u=s.newShape,c=s.keptDims,l=u;if(l.length<n.length){var f=zi(t,l);return"\n "+e(f)+"\n float "+i+"(int row, int col, int depth) {\n return "+i+"("+Li(["row","col","depth"],c)+");\n }\n "}if(t.shapeInfo.isUniform)return"\n float "+i+"(int row, int col, int depth) {\n int index = round(dot(vec3(row, col, depth),\n vec3("+o+", "+a+", 1)));\n "+ji(t)+"\n }\n ";var h=t.shapeInfo.texShape,d=h[0],p=h[1],m=t.shapeInfo.flatOffset;if(p===o&&null==m)return"\n float "+i+"(int row, int col, int depth) {\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2("+a+", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+p+".0, "+d+".0);\n return sampleTexture("+r+", uv);\n }\n ";if(p===a&&null==m)return"\n float "+i+"(int row, int col, int depth) {\n float texR = dot(vec2(row, col), vec2("+n[1]+", 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+p+".0, "+d+".0);\n return sampleTexture("+r+", uv);\n }\n ";var v=Di(r);return"\n float "+i+"(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+o+" + col * "+a+" + depth + "+v+";\n vec2 uv = uvFromFlat("+d+", "+p+", index);\n return sampleTexture("+r+", uv);\n }\n "}(t);case 4:return function(t){var n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[3],a=n[2]*o,s=n[1]*a,u=M(n),c=u.newShape,l=u.keptDims;if(c.length<n.length){var f=zi(t,c);return"\n "+e(f)+"\n float "+i+"(int row, int col, int depth, int depth2) {\n return "+i+"("+Li(["row","col","depth","depth2"],l)+");\n }\n "}if(t.shapeInfo.isUniform)return"\n float "+i+"(int row, int col, int depth, int depth2) {\n int index = round(dot(vec4(row, col, depth, depth2),\n vec4("+s+", "+a+", "+o+", 1)));\n "+ji(t)+"\n }\n ";var h=t.shapeInfo.flatOffset,d=t.shapeInfo.texShape,p=d[0],m=d[1];if(m===s&&null==h)return"\n float "+i+"(int row, int col, int depth, int depth2) {\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3("+a+", "+o+", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+m+".0, "+p+".0);\n return sampleTexture("+r+", uv);\n }\n ";if(m===o&&null==h)return"\n float "+i+"(int row, int col, int depth, int depth2) {\n float texR = dot
1(vec3(row, col, depth),\n vec3("+n[1]*n[2]+", "+n[2]+", 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+m+".0, "+p+".0);\n return sampleTexture("+r+", uv);\n }\n ";var v=Di(r);return"\n float "+i+"(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+s+" + col * "+a+" +\n depth * "+o+" + depth2;\n vec2 uv = uvFromFlat("+p+", "+m+", index + "+v+");\n return sampleTexture("+r+", uv);\n }\n "}(t);case 5:return function(t){var n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[4],a=n[3]*o,s=n[2]*a,u=n[1]*s,c=M(n),l=c.newShape,f=c.keptDims;if(l.length<n.length){var h=zi(t,l);return"\n "+e(h)+"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n return "+i+"("+Li(["row","col","depth","depth2","depth3"],f)+");\n }\n "}if(t.shapeInfo.isUniform)return"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n float index = dot(\n vec4(row, col, depth, depth2),\n vec4("+u+", "+s+", "+a+", "+o+")) +\n depth3;\n "+ji(t)+"\n }\n ";var d=t.shapeInfo.flatOffset,p=t.shapeInfo.texShape,m=p[0],v=p[1];if(v===u&&null==d)return"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4("+s+", "+a+", "+o+", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+v+".0, "+m+".0);\n return sampleTexture("+r+", uv);\n }\n ";if(v===o&&null==d)return"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n float texR = dot(\n vec4(row, col, depth, depth2),\n vec4("+n[1]*n[2]*n[3]+",\n "+n[2]*n[3]+", "+n[3]+", 1));\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+v+".0, "+m+".0);\n return sampleTexture("+r+", uv);\n }\n ";var g=Di(r);return"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+u+" + col * "+s+" + depth * "+a+" +\n depth2 * "+o+" + depth3 + "+g+";\n vec2 uv = uvFromFlat("+m+", "+v+", index);\n return sampleTexture("+r+", uv);\n }\n "}(t);case 6:return function(t){var n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=M(n),a=o.newShape,s=o.keptDims;if(a.length<n.length){var u=zi(t,a);return"\n "+e(u)+"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return "+i+"("+Li(["row","col","depth","depth2","depth3","depth4"],s)+");\n }\n "}var c=n[5],l=n[4]*c,f=n[3]*l,h=n[2]*f,d=n[1]*h;if(t.shapeInfo.isUniform)return"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = round(dot(\n vec4(row, col, depth, depth2),\n vec4("+d+", "+h+", "+f+", "+l+")) +\n dot(\n vec2(depth3, depth4),\n vec2("+c+", 1)));\n "+ji(t)+"\n }\n ";var p=t.shapeInfo.flatOffset,m=t.shapeInfo.texShape,v=m[0],g=m[1];if(g===d&&null==p)return"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4("+h+", "+f+", "+l+", "+c+")) +\n float(depth4);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+g+".0, "+v+".0);\n return sampleTexture("+r+", uv);\n }\n ";if(g===c&&null==p)return"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n float texR = dot(vec4(row, col, depth, depth2),\n vec4("+n[1]*n[2]*n[3]*n[4]+",\n "+n[2]*n[3]*n[4]+",\n "+n[3]*n[4]+",\n "+n[4]+")) + float(depth3);\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+g+".0, "+v+".0);\n return sampleTexture("+r+", uv);\n }\n ";var y=Di(r);return"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only w
1orks on floats.\n int index = row * "+d+" + col * "+h+" + depth * "+f+" +\n depth2 * "+l+" + depth3 * "+c+" + depth4 + "+y+";\n vec2 uv = uvFromFlat("+v+", "+g+", index);\n return sampleTexture("+r+", uv);\n }\n "}(t);default:throw new Error(n.length+"-D input sampling is not yet supported")}}(e);var i=e.shapeInfo.logicalShape,o=t.logicalShape;return i.length<=o.length&&(r+=n?function(e,t){var n,r=e.name,i=r.charAt(0).toUpperCase()+r.slice(1),o="get"+i+"AtOutCoords",a=e.shapeInfo.logicalShape.length,s=t.logicalShape.length,u=ir(e.shapeInfo.logicalShape,t.logicalShape),c=Pi(s),l=s-a,f=["x","y","z","w","u","v"];n=0===a?"":s<2&&u.length>=1?"coords = 0;":u.map(function(e){return"coords."+f[e+l]+" = 0;"}).join("\n");var h;h=s<2&&a>0?"coords":e.shapeInfo.logicalShape.map(function(e,t){return"coords."+f[t+l]}).join(", ");var d="return outputValue;",p=1===S(e.shapeInfo.logicalShape),m=1===S(t.logicalShape);if(1!==a||p||m){if(p&&!m)d=1===s?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(u.length){var v=a-2,g=a-1;u.indexOf(v)>-1&&u.indexOf(g)>-1?d="return vec4(outputValue.x);":u.indexOf(v)>-1?d="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":u.indexOf(g)>-1&&(d="return vec4(outputValue.xx, outputValue.zz);")}}else d="\n return vec4(outputValue.xy, outputValue.xy);\n ";return"\n vec4 "+o+"() {\n "+c+" coords = getOutputCoords();\n "+n+"\n vec4 outputValue = get"+i+"("+h+");\n "+d+"\n }\n "}(e,t):function(e,t){var n=e.name,r=n.charAt(0).toUpperCase()+n.slice(1),i="get"+r+"AtOutCoords",o=t.texShape,a=e.shapeInfo.texShape,s=e.shapeInfo.logicalShape.length,u=t.logicalShape.length;if(!e.shapeInfo.isUniform&&s===u&&null==e.shapeInfo.flatOffset&&E(a,o))return"\n float "+i+"() {\n return sampleTexture("+n+", resultUV);\n }\n ";var c=Pi(u),l=ir(e.shapeInfo.logicalShape,t.logicalShape),f=u-s,h=["x","y","z","w","u","v"];return"\n float "+i+"() {\n "+c+" coords = getOutputCoords();\n "+(0===s?"":u<2&&l.length>=1?"coords = 0;":l.map(function(e){return"coords."+h[e+f]+" = 0;"}).join("\n"))+"\n return get"+r+"("+(u<2&&s>0?"coords":e.shapeInfo.logicalShape.map(function(e,t){return"coords."+h[t+f]}).join(", "))+");\n }\n "}(e,t)),r}(e,t,r)}).join("\n"),c=t.texShape,l=Ei(),f="\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return "+l.texture2D+"(textureSampler, uv).r;\n }\n ",h=function(e){return e.version+"\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n "+e.varyingFs+" vec2 resultUV;\n "+e.defineOutput+"\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n #define isnan(value) isnan_custom(value)\n "+e.defineSpecialNaN+"\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n\n "+e.defineSpecialInf+"\n "+e.defineRound+"\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n "+Ti+"\n "+Ii+"\n "+Ri+"\n "}(l);return t.isPacked?(o=function(e,t){switch(e.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(e,t){var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return 1===n[0]?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * "+n[1]+".0);\n }\n ":1===n[1]?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * "+n[0]+".0);\n }\n ":"\n int getOutputCoords() {\n ivec2 resTexRC = ive
1c2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n return resTexRC.x * "+n[1]+" + resTexRC.y;\n }\n "}(0,t);case 2:return function(e,t){var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(E(e,t))return"\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2("+n[0]+", "+n[1]+"));\n }\n ";var r=Math.ceil(e[1]/2);return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n\n int index = resTexRC.x * "+n[1]+" + resTexRC.y;\n int r = 2 * (index / "+r+");\n int c = imod(index, "+r+") * 2;\n\n return ivec2(r, c);\n }\n "}(e,t);case 3:return n=e,r=t,i=[Math.ceil(r[0]/2),Math.ceil(r[1]/2)],a=(o=Math.ceil(n[2]/2))*Math.ceil(n[1]/2),"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+i[0]+", "+i[1]+"));\n int index = resTexRC.x * "+i[1]+" + resTexRC.y;\n\n int b = index / "+a+";\n index -= b * "+a+";\n\n int r = 2 * (index / "+o+");\n int c = imod(index, "+o+") * 2;\n\n return ivec3(b, r, c);\n }\n ";default:return function(e,t){for(var n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),i=r*Math.ceil(e[e.length-2]/2),o=i,a="",s="b, r, c",u=2;u<e.length-1;u++)a="\n int b"+u+" = index / "+(o*=e[e.length-u-1])+";\n index -= b"+u+" * "+o+";\n "+a,s="b"+u+", "+s;return"\n ivec"+e.length+" getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n int index = resTexRC.x * "+n[1]+" + resTexRC.y;\n\n "+a+"\n\n int b = index / "+i+";\n index -= b * "+i+";\n\n int r = 2 * (index / "+r+");\n int c = imod(index, "+r+") * 2;\n\n return ivec"+e.length+"("+s+");\n }\n "}(e,t)}var n,r,i,o,a}(t.logicalShape,c),a="\n void setOutput(vec4 val) {\n "+l.output+" = val;\n }\n "):(o=function(e,t){switch(e.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(e,t){return 1===t[0]?"\n int getOutputCoords() {\n return int(resultUV.x * "+t[1]+".0);\n }\n ":1===t[1]?"\n int getOutputCoords() {\n return int(resultUV.y * "+t[0]+".0);\n }\n ":"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n return resTexRC.x * "+t[1]+" + resTexRC.y;\n }\n "}(0,t);case 2:return function(e,t){return E(e,t)?"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2("+t[0]+", "+t[1]+"));\n }\n ":1===e[1]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n return ivec2(index, 0);\n }\n ":1===e[0]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n return ivec2(0, index);\n }\n ":"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n int r = index / "+e[1]+";\n int c = index - r * "+e[1]+";\n return ivec2(r, c);\n }\n "}(e,t);case 3:return n=t,r=Ci(["r","c","d"],e),"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n int index = resTexRC.x * "+n[1]+" + resTexRC.y;\n "+r+"\n return ivec3(r, c, d);\n }\n ";case 4:return function(e,t){var n=Ci(["r","c","d","d2"],e);return"\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n "+n+"\n return ivec4(r, c, d, d2);\n }\n "}(e,t);case 5:return function(e,t){var n=Ci(["r","c","d","d2","d3"],e);return"\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ive
1c2(resultUV.yx * vec2("+t[0]+",\n "+t[1]+"));\n\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n "+n+"\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n "}(e,t);case 6:return function(e,t){var n=Ci(["r","c","d","d2","d3","d4"],e);return"\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+t[0]+", "+t[1]+"));\n int index = resTexRC.x * "+t[1]+" + resTexRC.y;\n\n "+n+"\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n "}(e,t);default:throw new Error(e.length+"-D output sampling is not yet supported")}var n,r}(t.logicalShape,c),a="\n void setOutput(float val) {\n "+l.output+" = vec4(val, 0, 0, 0);\n }\n "),r&&(h+=Mi),[h,f,a,s,o,u,n].join("\n")}var Ti="\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Ii="\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n int texNumC, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Ri="\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Mi="\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n float getChannel(vec4 frag, int dim) {\n float modCoord = mod(float(dim), 2.);\n return modCoord == 0. ? frag.r : frag.g;\n }\n";function Di(e){return"offset"+e}function ji(e){var t=e.name,n=S(e.shapeInfo.logicalShape);return n<2?"return "+t+";":"\n for (int i = 0; i < "+n+"; i++) {\n if (i == index) {\n return "+t+"[i];\n }\n }\n "}function Pi(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error("GPU for rank "+e+" is not yet supported")}function zi(e,t){var n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function Li(e,t){return t.map(function(t){return e[t]}).join(", ")}var Bi=function(e,t,n,r){this.variableNames=["A"],this.usesPackedTextures=!0,w(e.length>2,function(){return"Packed arg"+(n.charAt(0).toUpperCase()+n.slice(1))+" supports only inputs with rank above 2."});var i=e[e.length-1],o=Math.ceil(i/t);this.outputShape=e.slice(0,-1),o>1&&this.outputShape.push(o),r||this.variableNames.push("bestIndicesA");var a,s,u=this.outputShape,c=u.length,l=Pi(c),f=Si("coords",c);if(1===o){var h=Pi(s=c+1);a="\n "+h+" sourceLocR = "+h+"("+f.join()+", 0);\n ++"+f[c-1]+";\n "+h+" sourceLocG = "+h+"("+f.join()+", 0);\n ++"+f[c-2]+";\n "+h+" sourceLocA = "+h+"("+f.join()+", 0);\n --"+f[c-1]+";\n "+h+" sourceLocB = "+h+"("+f.join()+", 0);\n --"+f[c-2]+";"}else s=c,a="\n "+l+" sourceLocR = coords;\n ++"+f[c-1]+";\n "+l+" sourceLocG = coords;\n ++"+f[c-2]+";\n "+l+" sourceLocA = coords;\n --"+f[c-1]+";\n "+l+" sourceLocB = coords;\n --"+f[c-2]+";";var d=["x","y","z","w","u","v"].slice(0,s),p="."+d[s-1],m=d.map(function(e){return"int "+e}),v=Si("sourceLocR",s-1).concat("inIdx.r"),g=Si("sourceLocG",s-1).concat("inIdx.g"),y=Si("sourceLocB",s-1).concat("inIdx.b"),b=Si("sourceLocA",s-1).concat("inIdx.a"),x="max"===n?"greaterThan":"lessThan",_=r?"":"\n inIdx = round(vec4(getBestIndicesAChannel("+v.join()+"),\n getBestIndicesAChannel("+g.join()+"),\n getBestIndicesAChannel("+y.join()+"),\n getBestIndicesAChannel("+b.join()+")));",k="vec4(\n getAChannel("+v.join()+"),\n hasNextCol ? getAChannel("+g.join()+") : 0.,\n hasNextRow ? getAChannel("+y.join()+") : 0.,\n hasNextRow && hasNextCol ? getAChannel("+b.join()+") : 0.)",S=r?"":"\n float getBestIndicesAChannel("+m.join()+") {\n return getChannel(getBestIndicesA("+d.join()+"),\n vec2("+d.slice(-2).join()+"));\n }";this.userCode="\n float getAChannel("+m.join()+") {\n return getChannel(getA("+d.join()+"),\n vec2("+d.slice(-2).join()+"));\n }\n "+S+"\n void main() {\n "+l+" coords = getOutputCoords();\n bool hasNextCol = "+f[c-1]+" < "+(u[c-1]-1)+";\n bool hasNextRow = "+f[c-2]+" < "+(u[c-2]-1)+";\n "+a+"\n ivec4 srcIdx = ivec4(sourceLocR"+p+", sourceLocG"+p+",\n sourceLocB"+p+", sourceLocA"+p+") * "+t+";\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = "+k+";\n\n for (int i = 0; i < "+t+";
1 i++) {\n inIdx = srcIdx;\n "+_+"\n vec4 candidate = "+k+";\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4("+x+"(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n "},Fi=function(e){this.variableNames=["dy"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,i=e.strideWidth,o=e.dilationHeight,a=e.dilationWidth,s=e.effectiveFilterHeight,u=e.effectiveFilterWidth,c=s-1-e.padInfo.top,l=u-1-e.padInfo.left,f=1/(t*n);this.userCode="\n const ivec2 pads = ivec2("+c+", "+l+");\n const float avgMultiplier = float("+f+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+s+";\n wR += "+o+") {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+u+";\n wC+= "+a+") {\n float dyC = float(dyCCorner + wC) / "+i+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n "},Ui=function(e,t,n,r,i,o){this.outputShape=[],this.variableNames=["x","mean","variance"],ar(e,t),ar(e,n);var a="0.0";null!=r&&(ar(e,r),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");var s="1.0";null!=i&&(ar(e,i),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode="\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = "+a+";\n float scale = "+s+";\n float inv = scale * inversesqrt(variance + float("+o+"));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n "},Wi=function(e,t,n,r,i,o){this.usesPackedTextures=!0,this.variableNames=["x","mean","variance"],ar(e,t),ar(e,n);var a="vec4(0.0)";null!=r&&(ar(e,r),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");var s="vec4(1.0)";null!=i&&(ar(e,i),this.variableNames.push("scale"),s="getScaleAtOutCoords()"),this.outputShape=e,this.userCode="\n void main() {\n vec4 offset = "+a+";\n vec4 scale = "+s+";\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4("+o+"));\n\n setOutput((x - mean) * inv + offset);\n }\n "},Vi=function(e,t,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=ar(t,n),this.userCode="\n float binaryOpComplex(\n float areal, float aimag, float breal, float bimag) {\n "+e+"\n }\n\n void main() {\n float areal = getARealAtOutCoords();\n float aimag = getAImagAtOutCoords();\n float breal = getBRealAtOutCoords();\n float bimag = getBImagAtOutCoords();\n setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n }\n "},qi="return a + b;",Hi="return a - b;",Gi="return a * b;",Ki=function(e,t,n){this.variableNames=["A","B"],this.outputShape=ar(t,n),this.userCode="\n float binaryOperation(float a, float b) {\n "+e+"\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n "},$i=function(e,t,n,r){void 0===r&&(r=!1),this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.usesPackedTextures=!0,this.outputShape=ar(t,n);var i=this.outputShape.length,o="";if(r)if(0===i||1===S(this.outputShape))o="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else if(o="\n "+Pi(i)+" coords = getOutputCoords();\n ",1===i)o+="\n result.y = (coords + 1) >= "+this.outputShape[0]+" ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ";else{var a=Si("coords",i);o+="\n bool nextRowOutOfBounds =\n ("+a[i-2]+" + 1) >= "+this.outputShape[i-2]+";\n bool nextColOutOfBounds =\n ("+a[i-1]+" + 1) >= "+this.outputShape[i-1]+";\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n "}this.userCode="\n vec4 binaryOperation(vec4 a, vec4 b) {\n "+e+"\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n "+o+"\n\n setOutput(result);\n }\n "},Xi=function(){function e(e){this.variableNames=["A"],this.outputShape=e,this.userCode="\n uniform float min;\n uniform float max;\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, min, max));\n }\n "}return e.prototype.getCustomSetupFunc=function(e,t){var n=this;return function(r,i){null==n.minLoc&&(n.minLoc=r.getUniformLocationNoThrow(i,"min"),n.maxLoc=r.getUniformLocationNoThrow(i,"max")),r.gl.uniform1f(n.minLoc,e),r.gl.uniform1f(n.maxLoc,t)}},e}(),Yi=function(){function e(e){this.variableNames=["A"],this.usesPackedTextures=!0,this.outputShape=e,this.userCode="\n uniform float min;\n uniform float max;\n\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(min), vec4(max)));\n }\n "}return e.prototype.getCustomSetupFunc=function(e,t){var n=this;return function(r,i){null==n.minLoc&&(n.minLoc=r.getUniformLocationNoThrow(i,"min"),n.maxLoc=r.getUniformLocationNoThrow(i,"max")),r.gl.uniform1f(n.minLoc,e),r.gl.uniform1f(n.maxLoc,t)}},e}(),Ji=function(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "},Zi=function(e){this.outputShape=[],this.outputShape=pn(e,1),this.variableNames=e.map(function(e,t){return"T"+t});var t=new Array(e.length-1);t[0]=e[0][1];for(var n=1;n<t.length;n++)t[n]=t[n-1]+e[n][1];var r=["if (yC < "+t[0]+") setOutput(getT0(yR, yC));"];for(n=1;n<t.length;n++){var i=t[n-1];r.push("else if (yC < "+t[n]+") setOutput(getT"+n+"(yR, yC-"+i+"));")}var o=t.length,a=t[t.length-1];r.push("else setOutput(getT"+o+"(yR, yC-"+a+"));"),this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n "+r.join("\n ")+"\n }\n "},Qi=function(e,t){this.usesPackedTextures=!0,this.outputShape=[],this.outputShape=pn(e,t);var n=this.outputShape,r=n.length,i=Pi(r),o=Si("coords",r),a=["x","y","z","w","u","v"].slice(0,r);this.variableNames=e.map(function(e,t){return"T"+t});var s=new Array(e.length-1);s[0]=e[0][t];for(var u=1;u<s.length;u++)s[u]=s[u-1]+e[u][t];var c=a[t],l="vec2("+a.slice(-2).join()+")",f=a.join(),h="if ("+c+" < "+s[0]+")\n return getChannel(getT0("+f+"), "+l+");";for(u=1;u<s.length;u++){var d=s[u-1];h+="\n else if ("+c+" < "+s[u]+") {\n "+c+" -= "+d+";\n return getChannel(getT"+u+"("+f+"), "+l+");\n }"}var p=s.length;h+="\n else {\n "+c+" -= "+s[s.length-1]+";\n return getChannel(getT"+p+"("+f+"), "+l+");\n }",this.userCode="\n float getValue("+a.map(function(e){return"int "+e})+") {\n "+h+"\n }\n\n void main() {\n "+i+" coords = getOutputCoords();\n vec4 result = vec4(getValue("+o+"), 0., 0., 0.);\n if (++"+o[r-1]+" < "+n[r-1]+") {\n result.g = getValue("+o+");\n }\n if (++"+o[r-2]+" < "+n[r-2]+") {\n result.a = getValue("+o+");\n }\n if ("+o[r-2]+" < "+n[r-2]+" &&\n --"+o[r-1]+" < "+n[r-1]+") {\n result.b = getValue("+o+");\n }\n setOutput(result);\n }\n "},eo=function(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;var t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,i=e.padInfo.left;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < "+e.batchSize+"; b++) {\n for (int yR = 0; yR < "+e.outHeight+"; yR++) {\n int xR = wR + yR * "+t+" - "+r+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+i+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "},to=function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.top,a=n-1-e.padInfo.left;this.userCode="\n const ivec2 pads = ivec2("+o+", "+a+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+t+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+i+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n for (int d2 = 0; d2 < "+e.outChannels+"; d2++) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "},no=function(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;var t=e.strideDepth,n=e.strideHeight,r=e.strideWidth,i=e.padInfo.front,o=e.padInfo.top,a=e.padInfo.left;this.userCode="\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < "+e.batchSize+"; b++) {\n for (int yF = 0; yF < "+e.outDepth+";
1 yF++) {\n int xF = wF + yF * "+t+" - "+i+";\n\n if (xF < 0 || xF >= "+e.inDepth+") {\n continue;\n }\n\n for (int yR = 0; yR < "+e.outHeight+"; yR++) {\n int xR = wR + yR * "+n+" - "+o+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+r+" - "+a+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n "},ro=function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterDepth,n=e.filterHeight,r=e.filterWidth,i=e.strideDepth,o=e.strideHeight,a=e.strideWidth,s=t-1-e.padInfo.front,u=n-1-e.padInfo.top,c=r-1-e.padInfo.left;this.userCode="\n const ivec3 pads = ivec3("+s+", "+u+", "+c+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < "+t+"; wF++) {\n float dyF = float(dyFCorner + wF) / "+i+".0;\n\n if (dyF < 0.0 || dyF >= "+e.outDepth+".0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = "+t+" - 1 - wF;\n\n for (int wR = 0; wR < "+n+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+o+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+n+" - 1 - wR;\n\n for (int wC = 0; wC < "+r+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+a+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+r+" - 1 - wC;\n\n for (int d2 = 0; d2 < "+e.outChannels+"; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n "},io=function(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;var t=e.strideHeight,n=e.strideWidth,r=e.padInfo.top,i=e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * "+o+" + dm;\n\n float dotProd = 0.0;\n\n // TODO: Vec4 over the batch size\n for (int b = 0; b < "+e.batchSize+"; b++) {\n for (int yR = 0; yR < "+e.outHeight+"; yR++) {\n int xR = wR + yR * "+t+" - "+r+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+e.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+i+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "},oo=function(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;var t=e.filterHeight,n=e.filterWidth,r=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.top,a=n-1-e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode="\n const ivec2 pads = ivec2("+o+", "+a+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < "+t+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+t+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+i+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n // TODO: Vec4 over the channelMul\n for (int dm = 0; dm < "+s+"; dm++) {\n int d2 = d1 * "+s+" + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "},ao=function(e){this.variableNames=["x","W"],this.outputShape=e.outShape;var t=e.padInfo.top,n=e.padInfo.left,r=e.strideHeight,i=e.strideWidth,o=e.dilationHeight,a=e.dilationWidth,s=e.filterHeight,u=e.filterWidth,c=4*Math.floor(e.inChannels/4),l=e.inChannels%4;this.userCode="\n const ivec2 strides = ivec2("+r+", "+i+");\n const ivec2 pads = ivec2("+t+", "+n+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+s+"; wR++) {\n int xR = xRCorner + wR * "+o+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+u+"; wC++) {\n int xC = xCCorner + wC * "+a+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n for (int d1 = 0; d1 < "+c+"; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if ("+(1===l)+") {\n dotProd +=\n getX(batch, xR, xC, "+c+") *\n getW(wR, wC, "+c+", d2);\n } else if ("+(2===l)+") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, "+c+"),\n getX(batch, xR, xC, "+c+" + 1)\n );\n vec2 wValues = vec2(\n getW(wR, wC, "+c+", d2),\n getW(wR, wC, "+c+" + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if ("+(3===l)+") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, "+c+"),\n getX(batch, xR, xC, "+c+" + 1),\n getX(batch, xR, xC, "+c+" + 2)\n );\n vec3 wValues = vec3(\n getW(wR, wC, "+c+", d2),\n getW(wR, wC, "+c+" + 1, d2),\n getW(wR, wC, "+c+" + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n setOutput(dotProd);\n }\n "},so=function(e){this.variableNames=["x","W"],this.outputShape=e.outShape;var t=e.padInfo.front,n=e.padInfo.top,r=e.padInfo.left,i=e.strideDepth,o=e.strideHeight,a=e.strideWidth,s=e.dilationDepth,u=e.dilationHeight,c=e.dilationWidth,l=e.filterDepth,f=e.filterHeight,h=e.filterWidth,d=4*Math.floor(e.inChannels/4),p=e.inChannels%4;this.userCode="\n const ivec3 strides = ivec3("+i+", "+o+", "+a+");\n const ivec3 pads = ivec3("+t+", "+n+", "+r+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < "+l+";
1 wF++) {\n int xF = xFCorner + wF * "+s+";\n\n if (xF < 0 || xF >= "+e.inDepth+") {\n continue;\n }\n\n for (int wR = 0; wR < "+f+"; wR++) {\n int xR = xRCorner + wR * "+u+";\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+h+"; wC++) {\n int xC = xCCorner + wC * "+c+";\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n for (int d1 = 0; d1 < "+d+"; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if ("+(1===p)+") {\n dotProd +=\n getX(batch, xF, xR, xC, "+d+") *\n getW(wF, wR, wC, "+d+", d2);\n } else if ("+(2===p)+") {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, "+d+"),\n getX(batch, xF, xR, xC, "+d+" + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, "+d+", d2),\n getW(wF, wR, wC, "+d+" + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if ("+(3===p)+") {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, "+d+"),\n getX(batch, xF, xR, xC, "+d+" + 1),\n getX(batch, xF, xR, xC, "+d+" + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, "+d+", d2),\n getW(wF, wR, wC, "+d+" + 1, d2),\n getW(wF, wR, wC, "+d+" + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n "},uo=function(e){this.variableNames=["x","W"],this.outputShape=e.outShape;var t=e.inHeight,n=e.inWidth,r=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,a=e.strideWidth,s=e.dilationHeight,u=e.dilationWidth,c=e.filterHeight,l=e.filterWidth,f=e.outChannels/e.inChannels;this.userCode="\n const ivec2 strides = ivec2("+o+", "+a+");\n const ivec2 pads = ivec2("+r+", "+i+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / "+f+";\n int q = d2 - d1 * "+f+";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TODO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < "+c+"; wR++) {\n int xR = xRCorner + wR * "+s+";\n\n if (xR < 0 || xR >= "+t+") {\n continue;\n }\n\n for (int wC = 0; wC < "+l+"; wC++) {\n int xC = xCCorner + wC * "+u+";\n\n if (xC < 0 || xC >= "+n+") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n setOutput(dotProd);\n }\n "},co=function(e){this.variableNames=["x","W"],this.usesPackedTextures=!0,this.outputShape=e.outShape;for(var t=e.inHeight,n=e.inWidth,r=e.padInfo.top,i=e.padInfo.left,o=e.strideHeight,a=e.strideWidth,s=e.dilationHeight,u=e.dilationWidth,c=e.filterHeight,l=e.filterWidth,f=l,h="int xR; int xC; int xCOffset;",d=0;d<c;d++)for(var p=0;p<l;p++)h+="\n vec4 xTexelR"+d+"C"+2*p+" = vec4(0.);\n vec4 wR"+d+"C"+p+" = vec4(0.);\n vec4 xR"+d+"C"+p+" = vec4(0.);";for(d=0;d<c;d++)for(var m=0;m<f;m++){if(h+="\n xR = xRCorner + "+d*s+";\n xC = xCCorner + "+(p=2*m)*u+";\n ",1===a){if(p<l&&(h+=i%2==1?"\n xCOffset = xC + 1;\n if(xR >= 0 && xR < "+t+" && xCOffset >= 0 && xCOffset < "+n+") {\n xTexelR"+d+"C"+p+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+d+"C"+p+" = vec4(0.);\n }\n\n xCOffset = xC + 1 - 2;\n if(xR >= 0 && xR < "+t+" && xCOffset >= 0 && xCOffset < "+n+") {\n vec4 previous = getX(batch, xR, xCOffset, d1);\n xR"+d+"C"+p+" = vec4(previous.zw, xTexelR"+d+"C"+p+".xy);\n } else {\n xR"+d+"C"+p+" = vec4(0, 0, xTexelR"+d+"C"+p+".xy);\n }\n ":"\n if(xR >= 0 && xR < "+t+" && xC >= 0 && xC < "+n+") {\n xTexelR"+d+"C"+p+" = getX(batch, xR, xC, d1);\n } else {\n xTexelR"+d+"C"+p+" = vec4(0.);\n }\n\n xR"+d+"C"+p+" = xTexelR"+d+"C"+p+";\n ",p+1<l)){var v=i%2==0?y(u):u;u%2==0&&i%2==1||u%2!=0&&i%2!=1?(h+="\n xCOffset = xC + "+i%2+" + "+v+";\n\n if(xR >= 0 && xR < "+t+" &&\n xCOffset >= 0 && xCOffset < "+n+") {\n xTexelR"+d+"C"+(p+2)+" = getX(batch, xR, xCOffset, d1);\n }\n ",u>1&&(h+="\n xCOffset -= 2;\n if(xR >= 0 && xR < "+t+" &&\n xCOffset >= 0 && xCOffset < "+n+") {\n xTexelR"+d+"C"+p+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+d+"C"+p+" = vec4(0.);\n }\n "),h+="\n xR"+d+"C"+(p+1)+" = vec4(\n xTexelR"+d+"C"+p+".zw, xTexelR"+d+"C"+(p+2)+".xy);\n "):h+="\n xCOffset = xC + "+v+";\n\n if(xR >= 0 && xR < "+t+" &&\n xCOffset >= 0 && xCOffset < "+n+") {\n xTexelR"+d+"C"+(p+2)+" = getX(batch, xR, xCOffset, d1);\n }\n\n xR"+d+"C"+(p+1)+" = xTexelR"+d+"C"+(p+2)+";\n "}}else p<l&&(h+="\n if(xR >= 0 && xR < "+t+") {\n ",i%2==1?(h+="\n xCOffset = xC + 1 - "+a+";\n if(xCOffset >= 0 && xCOffset < "+n+") {\n xTexelR"+d+"C"+p+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+d+"C"+p+" = vec4(0.);\n }\n\n if(xC + 1 >= 0 && xC + 1 < "+n+") {\n xTexelR"+d+"C"+(p+2)+" = getX(batch, xR, xC + 1, d1);\n } else {\n xTexelR"+d+"C"+(p+2)+" = vec4(0.);\n }\n\n xR"+d+"C"+p+" = vec4(\n xTexelR"+d+"C"+p+".zw, xTexelR"+d+"C"+(p+2)+".zw);\n ",p+1<l&&(h+="\n vec4 final = vec4(0.);\n xCOffset = xC + 1 + "+a+";\n if(xCOffset >= 0 && xCOffset < "+n+") {\n final = getX(batch, xR, xCOffset, d1);\n }\n xR"+d+"C"+(p+1)+" = vec4(xTexelR"+d+"C"+(p+2)+".xy, final.xy);\n ")):(h+="\n if(xC >= 0 && xC < "+n+") {\n xTexelR"+d+"C"+p+" = getX(batch, xR, xC, d1);\n } else {\n xTexelR"+d+"C"+p+" = vec4(0.);\n }\n\n xCOffset = xC + "+a+";\n if(xCOffset >= 0 && xCOffset < "+n+") {\n xTexelR"+d+"C"+(p+2)+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+d+"C"+(p+2)+" = vec4(0.);\n }\n\n xR"+d+"C"+p+" = vec4(\n xTexelR"+d+"C"+p+".xy, xTexelR"+d+"C"+(p+2)+".xy);\n ",p+1<l&&(h+="\n xR"+d+"C"+(p+1)+" = vec4(\n xTexelR"+d+"C"+p+".zw, xTexelR"+d+"C"+(p+2)+".zw);\n ")),h+="}");p<l&&(h+="\n vec4 wTexelR"+d+"C"+p+" = getW("+d+", "+p+", d1, q);\n wR"+d+"C"+p+" = vec4(wTexelR"+d+"C"+p+".xz, wTexelR"+d+"C"+p+".xz);\n ",p+1<l&&(h+="\n vec4 wTexelR"+d+"C"+(p+1)+" = getW("+d+", "+(p+1)+", d1, q);\n wR"+d+"C"+(p+1)+" =\n vec4(wTexelR"+d+"C"+(p+1)+".xz, wTexelR"+d+"C"+(p+1)+".xz);"))}for(d=0;d<c;d++)for(p=0;p<l;p++)h+="result += xR"+d+"C"+p+" * wR"+d+"C"+p+";";this.userCode="\n const ivec2 strides = ivec2("+o+", "+a+");\n const ivec2 pads = ivec2("+r+", "+i+");\n\n void main() {\n\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2;\n int q = 0;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n vec4 result = vec4(0.);\n\n "+h+"\n\n setOutput(result);\n }\n "},lo=function(e,t,n,r,i){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];var o=e[0],a=e[1],s=e[2],u=e[3],c=t[0],l=n[0],f=n[1];this.outputShape=[c,l,f,u];var h="bilinear"===r?1:0,d=[a-1+".0",s-1+".0"],p=d[0],m=d[1],v=l>1?[""+(a-1)/(l-1),"(y2-y1) * height_ratio","y1*"+p+" + float(y)*(height_scale)"]:["0.0","0.0","0.5 * (y1+y2) * "+p],g=v[0],y=v[1],b=v[2],w=f>1?[""+(s-1)/(f-1),"(x2-x1) * width_ratio","x1*"+m+" + float(x)*(width_scale)"]:["0.0","0.0","0.5 * (x1+x2) * "+m],x=w[0],_=w[1],k=w[2];this.userCode="\n const float height_ratio = float("+g+");\n const float width_ratio = float("+x+");\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= "+o+") {\n return;\n }\n\n float height_scale = "+y+";\n float width_scale = "+_+";\n\n float in_y = "+b+";\n if( in_y < 0.0 || in_y > "+p+" ) {\n setOutput(float("+i+"));\n return;\n }\n float in_x = "+k+";\n if( in_x < 0.0 || in_x > "+m+" ) {\n setOutput(float("+i+"));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if("+h+" == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n "},fo=function(e,t,n){this.variableNames=["x"],this.outputShape=e;var r=e.length,i=e[e.length-1],o=n?"<":">";this.userCode="\n int getIndex(int i) {\n "+(n?"return "+i+" -i - 1;":"return i;")+"\n }\n\n void main() {\n "+Pi(r)+" coords = getOutputCoords();\n int end = "+ho(r,"coords")+";\n float val = 0.0;\n for (int i = "+i+" - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx "+o+" end) {\n continue;\n }\n if (idx == end && "+t+") {\n continue;\n }\n "+ho(r,"coords")+" = idx;\n val += getX("+function(e,t){if(1===r)return""+t;if(2===r)return t+".x, "+t+".y";if(3===r)return t+".x, "+t+".y, "+t+".z";if(4===r)return t+".x, "+t+".y, "+t+".z, "+t+".w";throw Error("Cumulative sum for rank "+r+" is not yet supported")}
1(0,"coords")+");\n }\n setOutput(val);\n }\n "};function ho(e,t){if(1===e)return""+t;if(2===e)return t+".y";if(3===e)return t+".z";if(4===e)return t+".w";throw Error("Cumulative sum for rank "+e+" is not yet supported")}var po,mo,vo=function(){function e(e,t,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=n,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = "+this.getHeightCoordString()+";\n int w = "+this.getWidthCoordString()+";\n int d = "+this.getDepthCoordString()+";\n\n int in_h = h / "+t+";\n int offset_h = imod(h, "+t+");\n int in_w = w / "+t+";\n int offset_w = imod(w, "+t+");\n int offset_d = (offset_h * "+t+" + offset_w) *\n "+this.getOutputDepthSize()+";\n int in_d = d + offset_d;\n\n float result = "+this.getInputSamplingString()+";\n setOutput(result);\n }\n "}return e.prototype.getHeightCoordString=function(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"},e.prototype.getWidthCoordString=function(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"},e.prototype.getDepthCoordString=function(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"},e.prototype.getOutputDepthSize=function(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]},e.prototype.getInputSamplingString=function(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"},e}(),go=function(e){this.variableNames=["A"];var t=Ei();this.outputShape=e,this.userCode="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float x = getAAtOutCoords();\n "+t.output+" = encode_float(x);\n }\n "},yo=function(e,t){this.variableNames=["A"];var n=Ei(),r=t[0],i=t[1];this.outputShape=e,this.userCode="\n "+Oi(e)+"\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n int flatIndex = getFlatIndex(coords);\n int offset = imod(flatIndex, 4);\n\n flatIndex /= 4;\n int r = flatIndex / "+i+";\n int c = imod(flatIndex, "+i+");\n vec2 uv = (vec2(c, r) + halfCR) / vec2("+i+".0, "+r+".0);\n vec4 values = "+n.texture2D+"(A, uv);\n\n float result;\n\n if(offset == 0) {\n result = values[0];\n } else if(offset == 1) {\n result = values[1];\n } else if(offset == 2) {\n result = values[2];\n } else {\n result = values[3];\n }\n\n "+n.output+" = vec4(result, 0., 0., 0.);\n }\n "},bo=function(e,t){this.variableNames=["A"];var n=Ei(),r=t[0],i=t[1];this.outputShape=e;for(var o="",a=0;a<=1;a++)for(var s=0;s<=1;s++){var u=2*a+s;o+="\n localCoords = coords;\n if(localCoords[2] + "+s+" < "+e[2]+") {\n localCoords[2] += "+s+";\n if(localCoords[1] + "+a+" < "+e[1]+") {\n localCoords[1] += "+a+";\n\n flatIndex = getFlatIndex(localCoords);\n offset = imod(flatIndex, 4);\n \n flatIndex /= 4;\n r = flatIndex / "+i+";\n c = imod(flatIndex, "+i+");\n uv = (vec2(c, r) + halfCR) / vec2("+i+".0, "+r+".0);\n values = "+n.texture2D+"(A, uv);\n\n if(offset == 0) {\n result["+u+"] = values[0];\n } else if(offset == 1) {\n result["+u+"] = values[1];\n } else if(offset == 2) {\n result["+u+"] = values[2];\n } else {\n result["+u+"] = values[3];\n }\n }\n }\n "}this.userCode="\n "+Oi(e)+"\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n vec4 result = vec4(0.);\n int flatIndex, r, c, offset;\n ivec3 localCoords;\n vec2 uv;\n vec4 values;\n \n "+o+"\n\n "+n.output+" = result;\n }\n "},wo=function(e,t,n){this.variableNames=["real","imag"];var r=t[1];this.outputShape=t;var i=n?"2.0 * "+Math.PI:"-2.0 * "+Math.PI,o=n?r+".0":"1.0";this.userCode="\n const float exponentMultiplier = "+i+";\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n "+e+"\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float("+r+");\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < "+r+";
1 i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / "+o+";\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n "},xo=function(){function e(e,t){this.outputShape=[],this.variableNames=["x"],this.outputShape=e,this.userCode="\n uniform float value;\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;return function(n,r){null==t.valueLoc&&(t.valueLoc=n.getUniformLocationNoThrow(r,"value")),n.gl.uniform1f(t.valueLoc,e)}},e}(),_o=function(e){this.variableNames=["A"];var t=Ei(),n=e[0],r=e[1];this.outputShape=e,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+r+".0, "+n+".0);\n\n vec4 values = "+t.texture2D+"(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n "},ko=function(e){this.variableNames=["A"];var t=Ei(),n=e[0],r=e[1];this.outputShape=e,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+r+".0, "+n+".0);\n vec4 values = "+t.texture2D+"(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n "+t.output+" = result;\n }\n "},So=function(e,t,n){this.variableNames=["A","indices"];var r=e.slice();r[n]=t,this.outputShape=r,this.rank=r.length;var i=Pi(this.rank),o=function(e,t){var n=e.length;if(n>4)throw Error("Gather for rank "+n+" is not yet supported");if(1===n)return"int(getIndices(resRC))";for(var r=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],o=0;o<e.length;o++)o===t?i.push("int(getIndices("+r[o]+"))"):i.push(""+r[o]);return i.join()}(e,n);this.userCode="\n void main() {\n "+i+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "},Eo=function(e,t,n){this.sliceDim=e,this.strides=t,this.variableNames=["x","indices"],this.outputShape=n;var r=Pi(t.length),i=Pi(n.length),o=this.sliceDim>1?"strides[j]":"strides";this.userCode="\n "+r+" strides = "+r+"("+this.strides+");\n void main() {\n "+i+" coords = getOutputCoords();\n int flattenIndex = 0;\n for (int j = 0; j < "+this.sliceDim+";
1 j++) {\n int index = round(getIndices(coords[0], j));\n flattenIndex += index * "+o+";\n }\n setOutput(getX(flattenIndex, coords[1]));\n }\n "};function Co(e,t){return[t,e]}function No(e,t){return e*t}function Oo(e,t,n){var r=function(e,t){if(e%t!=0)throw new Error("unpackedSize ("+e+") must be a multiple of "+t);return e/t}(e.length,n);if(t.length<r)throw new Error("matrix length ("+t.length+") must be >= "+r);for(var i=0,o=0;o<e.length;o+=n)t[i++]=e[o]}function Ao(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function To(e,t){var n=Ao(e,t);return n[0]*n[1]*4}function Io(e,t,n,r,i){var o=n*r;if(i.length<o)throw new Error("matrix length ("+i.length+") must be >= "+o);for(var a=r%2==1,s=n%2==1,u=Math.floor(r/2),c=Math.floor(n/2),l=Math.ceil(r/2),f=l*Math.ceil(n/2),h=y(n)*y(r),d=0;d<t;d++){for(var p=d*n*r,m=d*h,v=a?4:0,g=r+(a?1:0),b=m,w=p,x=p+r,_=0;_<c;++_){for(var k=0;k<u;++k)i[w++]=e[b++],i[w++]=e[b++],i[x++]=e[b++],i[x++]=e[b++];b+=v,w+=g,x+=g}if(a){b=m+4*(l-1);var S=p+r-1;for(v=4*l,g=2*r,_=0;_<c;++_)i[S]=e[b],i[S+r]=e[b+2],b+=v,S+=g}if(s){for(b=m+4*(f-l),S=p+(n-1)*r,k=0;k<u;++k)i[S++]=e[b++],i[S++]=e[b++],b+=2;a&&(i[p+n*r-1]=e[b])}}return i}function Ro(e,t){var n=Ei();return Ke(e,t,n.version+"\n precision highp float;\n "+n.attribute+" vec3 clipSpacePos;\n "+n.attribute+" vec2 uv;\n "+n.varyingVs+" vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }")}function Mo(e,t){return tt(e,t,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function Do(e,t){return nt(e,t,new Uint16Array([0,1,2,2,1,3]))}function jo(e,t){var n,r,i,o,a,s,u,c,l=e;return 2===f.getNumber("WEBGL_VERSION")?(n=l.R32F,r=l.R16F,i=l.RGBA16F,o=l.RGBA32F,a=l.RED,s=4,u=1,c=l.HALF_FLOAT):(n=e.RGBA,r=e.RGBA,i=e.RGBA,o=l.RGBA,a=e.RGBA,s=4,u=4,c=null!=t?t.HALF_FLOAT_OES:null),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:o,textureFormatFloat:a,downloadTextureFormat:e.RGBA,downloadUnpackNumChannels:s,defaultNumChannels:u,textureTypeHalfFloat:c}}function Po(e,t,n,r,i,o,a){it(n,r);var s=rt(e,t),u=e.TEXTURE_2D;return Ue(e,t,function(){return e.bindTexture(u,s)}),Ue(e,t,function(){return e.texParameteri(u,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)}),Ue(e,t,function(){return e.texParameteri(u,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}),Ue(e,t,function(){return e.texParameteri(u,e.TEXTURE_MIN_FILTER,e.NEAREST)}),Ue(e,t,function(){return e.texParameteri(u,e.TEXTURE_MAG_FILTER,e.NEAREST)}),Ue(e,t,function(){return e.texImage2D(u,0,i,n,r,0,o,a,null)}),Ue(e,t,function(){return e.bindTexture(e.TEXTURE_2D,null)}),s}function zo(e,t,n,r,i){var o=Co(n,r);return Po(e,t,o[0],o[1],i.internalFormatFloat,i.textureFormatFloat,e.FLOAT)}function Lo(e,t,n,r,i){var o=Co(n,r);return Po(e,t,o[0],o[1],i.internalFormatHalfFloat,i.textureFormatFloat,i.textureTypeHalfFloat)}function Bo(e,t,n,r,i){var o=Co(n,r);return Po(e,t,o[0],o[1],e.RGBA,e.RGBA,e.UNSIGNED_BYTE)}function Fo(e,t,n,r,i){var o=Ao(n,r);return Po(e,t,o[0],o[1],i.internalFormatPackedFloat,e.RGBA,e.FLOAT)}function Uo(e,t,n,r,i){var o=Ao(n,r);return Po(e,t,o[0],o[1],i.internalFormatPackedHalfFloat,e.RGBA,i.textureTypeHalfFloat)}function Wo(e,t,n,r){return Ue(e,t,function(){return e.bindBuffer(e.ARRAY_BUFFER,r)}),at(e,t,n,"clipSpacePos",r,3,20,0)&&at(e,t,n,"uv",r,2,20,12)}function Vo(e,t,n,r,i,o,a){Ue(e,t,function(){return e.bindTexture(e.TEXTURE_2D,n)});var s=new Float32Array(r*i*4);s.set(o),Ue(e,t,function(){return e.texImage2D(e.TEXTURE_2D,0,a.internalFormatPackedFloat,r,i,0,e.RGBA,e.FLOAT,s)}),Ue(e,t,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function qo(e,t,n,r){Ue(e,t,function(){return e.bindTexture(e.TEXTURE_2D,n)}),r.data instanceof Uint8Array?Ue(e,t,function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.width,r.height,0,e.RGBA,e.UNSIGNED_BYTE,r.data)}):Ue(e,t,function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r)}),Ue(e,t,function(){return e.bindTexture(e.TEXTURE_2D,null)})}function Ho(e,t,n,r,i){var o=e.createBuffer();Ue(e,t,function(){return e.bindBuffer(e.PIXEL_PACK_BUFFER,o)});var a=4*No(n*r,i.downloadUnpackNumChannels);return Ue(e,t,function(){return e.bufferData(e.PIXEL_PACK_BUFFER,a,e.STREAM_READ)}),Ue(e,t,function(){return e.readPixels(0,0,r,n,e.RGBA,e.FLOAT,0)}),Ue(e,t,function(){return e.bindBuffer(e.PIXEL_PACK_BUFFER,null)}),o}function Go(e,t,n,r,i){var o=e,a=new Float32Array(No(n*r,i.downloadUnpackNumChannels));o.bindBuffer(o.PIXEL_PACK_BUFFER,t),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,a),o.bindBuffer(o.PIXEL_PACK_BUFFER,null);var s=new Float32Array(n*r);return Oo(a,s,i.downloadUnpackNumChannels),s}function Ko(e,t,n,r,i){var o=Co(n,r),a=o[0],s=o[1],u=new Float32Array(No(n*r,i.downloadUnpackNumChannels));Ue(e,t,function(){return e.readPixels(0,0,a,s,i.downloadTextureFormat,e.FLOAT,u)});var c=new Float32Array(n*r);return Oo(u,c,i.downloadUnpackNumChannels),c}function $o(e,t,n,r,i){var o=Co(n,r),a=o[0],s=o[1],u=new Uint8Array(No(n*r,4));return Ue(e,t,function(){return e.readPixels(0,0,a,s,i.downloadTextureFormat,e.UNSIGNED_BYTE,u)}),new Float32Array(u.buffer)}function Xo(e,t,n,r,i,o,a,s){var u=e,c=new Float32Array(To(o,a));u.bindBuffer(u.PIXEL_PACK_BUFFER,t),u.getBufferSubData(u.PIXEL_PACK_BUFFER,0,c),u.bindBuffer(u.PIXEL_PACK_BUFFER,null);var l=new Float32Array(S([n,r,i]));return Io(c,n,r,i,l),l}function Yo(e,t,n,r,i,o,a,s){var u=Ao(o,a),c=u[0],l=u[1],f=new Float32Array(To(o,a));Ue(e,t,function(){return e.readPixels(0,0,c,l,e.RGBA,e.FLOAT,f)});var h=new Float32Array(S([n,r,i]));return Io(f,n,r,i,h)}!function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(po||(po={})),function(e){e[e.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",e[e.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",e[e.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",e[e.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",e[e.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(mo||(mo={}));var Jo=Object.freeze({createVertexShader:Ro,createVertexBuffer:Mo,createIndexBuffer:D
1o,getTextureConfig:jo,createFloat32MatrixTexture:zo,createFloat16MatrixTexture:Lo,createUnsignedBytesMatrixTexture:Bo,createPackedMatrixTexture:Fo,createFloat16PackedMatrixTexture:Uo,bindVertexProgramAttributeStreams:Wo,uploadDenseMatrixToTexture:Vo,uploadPixelDataToTexture:qo,createBufferFromOutputTexture:Ho,downloadFloat32MatrixFromBuffer:Go,downloadFloat32MatrixFromOutputTexture:Ko,downloadByteEncodedFloatMatrixFromOutputTexture:$o,downloadPackedMatrixFromBuffer:Xo,downloadMatrixFromPackedOutputTexture:Yo}),Zo=function(){function e(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];var t=f.getNumber("WEBGL_VERSION");null!=e?(this.gl=e,Be(t,e)):this.gl=Fe(t),1===f.getNumber("WEBGL_VERSION")?(this.textureFloatExtension=Ge(this.gl,this.debug,"OES_texture_float"),this.colorBufferFloatExtension=this.gl.getExtension("WEBGL_color_buffer_float"),f.getBool("WEBGL_RENDER_FLOAT32_ENABLED")||(this.textureHalfFloatExtension=Ge(this.gl,this.debug,"OES_texture_half_float"),this.colorBufferHalfFloatExtension=this.gl.getExtension("EXT_color_buffer_half_float"))):this.colorBufferFloatExtension=Ge(this.gl,this.debug,"EXT_color_buffer_float"),this.vertexBuffer=Mo(this.gl,this.debug),this.indexBuffer=Do(this.gl,this.debug),this.framebuffer=ot(this.gl,this.debug),this.textureConfig=jo(this.gl,this.textureHalfFloatExtension)}return Object.defineProperty(e.prototype,"debug",{get:function(){return f.getBool("DEBUG")},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){var e=this;if(!this.disposed){null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");var t=this.gl;Ue(t,this.debug,function(){return t.finish()}),Ue(t,this.debug,function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)}),Ue(t,this.debug,function(){return t.deleteFramebuffer(e.framebuffer)}),Ue(t,this.debug,function(){return t.bindBuffer(t.ARRAY_BUFFER,null)}),Ue(t,this.debug,function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}),Ue(t,this.debug,function(){return t.deleteBuffer(e.indexBuffer)}),this.disposed=!0}},e.prototype.createFloat32MatrixTexture=function(e,t){return this.throwIfDisposed(),zo(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.createFloat16MatrixTexture=function(e,t){return this.throwIfDisposed(),Lo(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.createUnsignedBytesMatrixTexture=function(e,t){return this.throwIfDisposed(),Bo(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.uploadPixelDataToTexture=function(e,t){this.throwIfDisposed(),qo(this.gl,this.debug,e,t)},e.prototype.uploadDenseMatrixToTexture=function(e,t,n,r){this.throwIfDisposed(),Vo(this.gl,this.debug,e,t,n,r,this.textureConfig)},e.prototype.createFloat16PackedMatrixTexture=function(e,t){return this.throwIfDisposed(),Uo(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.createPackedMatrixTexture=function(e,t){return this.throwIfDisposed(),Fo(this.gl,this.debug,e,t,this.textureConfig)},e.prototype.deleteMatrixTexture=function(e){var t=this;this.throwIfDisposed(),this.outputTexture===e&&(ht(this.gl,this.debug,this.framebuffer),this.outputTexture=null),Ue(this.gl,this.debug,function(){return t.gl.deleteTexture(e)})},e.prototype.downloadFloat32MatrixFromOutputTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return Ko(r.gl,r.debug,t,n,r.textureConfig)})},e.prototype.downloadByteEncodedFloatMatrixFromOutputTexture=function(e,t,n){var r=this;return this.downloadMatrixDriver(e,function(){return $o(r.gl,r.debug,t,n,r.textureConfig)})},e.prototype.downloadPackedMatrixFromBuffer=function(e,t,n,r,i,o){return Xo(this.gl,e,t,n,r,i,o,this.textureConfig)},e.prototype.downloadFloat32MatrixFromBuffer=function(e,t,n){return Go(this.gl,e,t,n,this.textureConfig)},e.prototype.createBufferFromTexture=function(e,t,n){this.bindTextureToFrameBuffer(e);var r=Ho(this.gl,this.debug,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r},e.prototype.createAndWaitForFence=function(){var e=this.createFence(this.gl);
1return this.pollFence(e)},e.prototype.createFence=function(e){var t,n,r=this;if(f.getBool("WEBGL_FENCE_API_ENABLED")){var i=e,o=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=function(){var e=i.clientWaitSync(o,0,0);return e===i.ALREADY_SIGNALED||e===i.CONDITION_SATISFIED},t=o}else f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=function(){return r.isQueryAvailable(t,f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}):n=function(){return!0};return{query:t,isFencePassed:n}},e.prototype.downloadMatrixFromPackedTexture=function(e,t,n,r,i,o){var a=this;return this.downloadMatrixDriver(e,function(){return Yo(a.gl,a.debug,t,n,r,i,o,a.textureConfig)})},e.prototype.createProgram=function(e){this.throwIfDisposed();var t=this.gl,n=$e(t,this.debug,e),r=Ro(t,this.debug),i=Ze(t,this.debug);return Ue(t,this.debug,function(){return t.attachShader(i,r)}),Ue(t,this.debug,function(){return t.attachShader(i,n)}),Qe(t,this.debug,i),this.debug&&et(t,this.debug,i),this.vertexAttrsAreBound||(this.setProgram(i),this.vertexAttrsAreBound=Wo(t,this.debug,this.program,this.vertexBuffer)),i},e.prototype.deleteProgram=function(e){var t=this;this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&Ue(this.gl,this.debug,function(){return t.gl.deleteProgram(e)})},e.prototype.setProgram=function(e){var t=this;this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&et(this.gl,this.debug,this.program),Ue(this.gl,this.debug,function(){return t.gl.useProgram(e)})},e.prototype.getUniformLocation=function(e,t,n){return void 0===n&&(n=!0),this.throwIfDisposed(),n?ut(this.gl,this.debug,e,t):ct(this.gl,e,t)},e.prototype.getAttributeLocation=function(e,t){var n=this;return this.throwIfDisposed(),Ue(this.gl,this.debug,function(){return n.gl.getAttribLocation(e,t)})},e.prototype.getUniformLocationNoThrow=function(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)},e.prototype.setInputMatrixTexture=function(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),lt(this.gl,this.debug,this.program,e,t,n)},e.prototype.setOutputMatrixTexture=function(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)},e.prototype.setOutputPackedMatrixTexture=function(e,t,n){this.throwIfDisposed();var r=Ao(t,n),i=r[0],o=r[1];this.setOutputMatrixTextureDriver(e,i,o)},e.prototype.setOutputMatrixWriteRegion=function(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)},e.prototype.setOutputPackedMatrixWriteRegion=function(e,t,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")},e.prototype.debugValidate=function(){null!=this.program&&et(this.gl,this.debug,this.program),dt(this.gl)},e.prototype.executeProgram=function(){this.throwIfDisposed(),this.throwIfNoProgram();var e=this.gl;this.debug&&this.debugValidate(),Ue(e,this.debug,function(){return e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)})},e.prototype.blockUntilAllProgramsCompleted=function(){var e=this;this.throwIfDisposed(),Ue(this.gl,this.debug,function(){return e.gl.finish()})},e.prototype.getQueryTimerExtension=function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=Ge(this.gl,this.debug,2===f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension},e.prototype.getQueryTimerExtensionWebGL2=function(){return this.getQueryTimerExtension()},e.prototype.getQueryTimerExtensionWebGL1=function(){return this.getQueryTimerExtension()},e.prototype.beginQuery=function(){if(2===f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.gl,t=this.getQueryTimerExtensionWebGL2(),n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}var r=this.getQueryTimerExtensionWebGL1(),i=r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT,i),i},e.prototype.endQuery=function(){if(2!==f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}else{var t=this.gl,n=this.getQueryTimerExtensionWebGL2();t.endQuery(n.TIME_ELAPSED_EXT)}},e.prototype.waitForQueryAndGetTime=function(e){return c(this,void 0,void 0,function(){var t=this;return l(this,function(n){switch(n.label){case 0:return[4,T(function(){return t.disposed||t.isQueryAvailable(e,f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))})];case 1:return n.sent(),[2,this.getQueryTime(e,f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))]}})})},e.prototype.getQueryTime=function(e,t){if(0===t)return null;if(2===t){var n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}
1var r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(e,r.QUERY_RESULT_EXT)/1e6},e.prototype.isQueryAvailable=function(e,t){if(0===t)return!0;if(2===t){var n=this.gl,r=this.getQueryTimerExtensionWebGL2(),i=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),i&&!this.disjoint}return i=(r=this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(e,r.QUERY_RESULT_AVAILABLE_EXT),null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),i&&!this.disjoint},e.prototype.pollFence=function(e){var t=this;return new Promise(function(n){t.addItemToPoll(function(){return e.isFencePassed()},function(){return n()})})},e.prototype.pollItems=function(){for(var e=function(e){for(var t=0;t<e.length;++t){if(!e[t]())break}return t-1}(this.itemsToPoll.map(function(e){return e.isDoneFn})),t=0;t<=e;++t)(0,this.itemsToPoll[t].resolveFn)();this.itemsToPoll=this.itemsToPoll.slice(e+1)},e.prototype.addItemToPoll=function(e,t){var n=this;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||T(function(){return n.pollItems(),0===n.itemsToPoll.length})},e.prototype.bindTextureToFrameBuffer=function(e){this.throwIfDisposed(),ft(this.gl,this.debug,e,this.framebuffer),this.debug&&dt(this.gl)},e.prototype.unbindTextureToFrameBuffer=function(){null!=this.outputTexture?(ft(this.gl,this.debug,this.outputTexture,this.framebuffer),this.debug&&dt(this.gl)):ht(this.gl,this.debug,this.framebuffer)},e.prototype.downloadMatrixDriver=function(e,t){this.bindTextureToFrameBuffer(e);var n=t();return this.unbindTextureToFrameBuffer(),n},e.prototype.setOutputMatrixTextureDriver=function(e,t,n){this.throwIfDisposed();var r=this.gl;ft(r,this.debug,e,this.framebuffer),this.debug&&dt(r),this.outputTexture=e,Ue(r,this.debug,function(){return r.viewport(0,0,t,n)}),Ue(r,this.debug,function(){return r.scissor(0,0,t,n)})},e.prototype.setOutputMatrixWriteRegionDriver=function(e,t,n,r){var i=this;this.throwIfDisposed(),Ue(this.gl,this.debug,function(){return i.gl.scissor(e,t,n,r)})},e.prototype.throwIfDisposed=function(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")},e.prototype.throwIfNoProgram=function(){if(null==this.program)throw new Error("No GPU program is currently set.")},e}();function Qo(e,t){if(e.length!==t.length)throw Error("Binary was compiled with "+e.length+" inputs, but was executed with "+t.length+" inputs");e.forEach(function(e,n){var r=e.logicalShape,i=t[n],o=i.shape;if(!E(r,o))throw Error("Binary was compiled with different shapes than the current args. Shapes "+r+" and "+o+" must match");if(!e.isUniform||!i.isUniform){var a=e.texShape,s=i.isUniform?null:i.texData.texShape;if(!E(a,s))throw Error("Binary was compiled with different texture shapes than the current args. Shape "+a+" and "+s+" must match")}})}var ea=function(e,t,n){this.variableNames=["A"],this.usesPackedTextures=!0,this.outputShape=e;var r=n.filterWidth,i=n.inChannels,o=n.strideWidth,a=n.strideHeight,s=n.padInfo,u=n.outWidth,c=n.dilationWidth,l=n.dilationHeight,f=s.left,h=s.top,d=i*r,p=Ei();this.userCode="\n void main() {\n ivec2 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n int blockIndex = rc.y + col;\n int pos = rc.x + row;\n\n if(blockIndex >= "+e[1]+" || pos >= "+e[0]+") continue;\n\n int offsetY = int(blockIndex / ("+u+")) * "+a+" - "+h+";\n int d0 = offsetY + "+l+" * (pos / "+d+");\n\n if(d0 >= "+t[0]+" || d0 < 0) continue;\n\n int offsetX = int(mod(float(blockIndex), "+u+".) * "+o+". - "+f+".);\n int d1 = offsetX + "+c+" * (int(mod(float(pos), "+d+".) / "+i+".));\n\n if(d1 >= "+t[1]+" || d1 < 0) continue;\n\n vec2 innerDims = vec2(d1, int(mod(float(pos), "+i+".)));\n result[row * 2 + col] = getChannel(getA(d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n\n "+p.output+" = result;\n }\n "},ta=function(e,t,n,r,i){this.variableNames=["x"],this.outputShape=[];var o,a=t,s=e[3]-1;this.outputShape=e;var u="float("+n+") + float("+r+") * sum";o=.5===i?"inversesqrt("+u+")":1===i?"1.0/("+u+")":"exp(log("+u+") * float(-"+i+"));",this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;
1\n for (int j = -"+a+"; j <= "+a+"; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= "+s+") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * "+o+";\n setOutput(val);\n }\n "},na=function(e,t,n,r,i){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=r,this.beta=i,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < "+this.depth+"; ++d) {\n int depthBegin = int(max(0.0, float(d - "+t+")));\n int depthEnd = int(min(float("+this.depth+"),\n float(d + "+t+" + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = "+this.depth+";\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float("+r+") * norm + float("+n+");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float("+r+")\n * float("+i+")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * "+i+");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n "},ra=function(e,t,n,r,i){this.variableNames=["x"],this.outputShape=[],this.usesPackedTextures=!0;var o,a=t,s=e[3]-1;this.outputShape=e;var u="float("+n+") + float("+r+") * sum";o=.5===i?"inversesqrt("+u+")":1===i?"1.0/("+u+")":"exp(log("+u+") * float(-"+i+"));",this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < "+this.outputShape[3]+";\n bool hasNextRow = c < "+this.outputShape[2]+";\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - "+a+";\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - "+a+"; j <= "+a+"; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2("+s+"));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * "+o+";\n setOutput(result);\n }\n "},ia=function(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;var t=e.strideHeight,n=e.strideWidth,r=e.dilationHeight,i=e.effectiveFilterHeight,o=e.effectiveFilterWidth,a=i-1-e.padInfo.top,s=o-1-e.padInfo.left,u=i*o-1;this.userCode="\n const ivec2 pads = ivec2("+a+", "+s+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+i+";\n wR += "+r+") {\n float dyR = float(dyRCorner + wR) / "+t+".0;\n\n if (dyR < 0.0 || dyR >= "+e.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+o+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+n+".0;\n\n if (dyC < 0.0 || dyC >= "+e.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = "+u+" - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * "+o+" + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n "},oa=function(e,t,n,r,i,o){void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===o&&(o=null),this.variableNames=["matrixA","matrixB"],this.usesPackedTextures=!0,this.outputShape=t;var a=n?e[1]:e[2],s=Math.ceil(a/2),u=n?"i * 2, rc.y":"rc.y, i * 2",c=r?"rc.z, i * 2":"i * 2, rc.z",l=n?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=r?["b.xzxz","b.
1ywyw"]:["b.xyxy","b.zwzw"],h="",d="";o&&(h="vec4 activation(vec4 x) {\n "+o+"\n }",d="result = activation(result);");var p=i?"result += getBiasAtOutCoords();":"";i&&this.variableNames.push("bias"),this.userCode="\n "+h+"\n\n const float sharedDimension = "+s+".0;\n\n vec4 dot2x2ARowBCol(ivec3 rc) {\n vec4 result = vec4(0);\n for (int i = 0; i < "+s+"; i++) {\n vec4 a = getMatrixA(rc.x, "+u+");\n vec4 b = getMatrixB(rc.x, "+c+");\n\n result += ("+l[0]+" * "+f[0]+") + ("+l[1]+" * "+f[1]+");\n }\n return result;\n }\n\n void main() {\n ivec3 rc = getOutputCoords();\n vec4 result = dot2x2ARowBCol(rc);\n\n "+p+"\n\n "+d+"\n\n setOutput(result);\n }\n "},aa=function(){function e(e,t,n){this.variableNames=["probs"],this.outputShape=[e,n],this.userCode="\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < "+(t-1)+"; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float("+(t-1)+"));\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;return function(n,r){null==t.seedLoc&&(t.seedLoc=n.getUniformLocation(r,"seed")),n.gl.uniform1f(t.seedLoc,e)}},e}(),sa=function(e,t,n,r){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float("+r+"), float("+n+"),\n float(index == coords.y)));\n }\n "},ua=function(e){this.variableNames=["A"],this.isPackShader=!0,this.outputShape=e;var t=e.length;if(0===t)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{var n=Si("rc",t),r=Pi(t),i=function(e,t,n){if(1===e)return"rc > "+t[0];for(var r="",i=e-2;i<e;i++)r+=n[i]+" >= "+t[i],i<e-1&&(r+="||");return r}(t,e,n),o=function(e,t,n,r){if(1===e)return"";var i=r.slice(-2);return"\n int r = "+i[0]+";\n int c = "+i[1]+";\n int rp1 = r + 1;\n int cp1 = c + 1;\n\n bool cEdge = cp1 >= "+t+";\n bool rEdge = rp1 >= "+n+";\n "}(t,e[e.length-1],e[e.length-2],n),a=function(e,t){var n=e.length,r=function(e,t){for(var n=[],r=0;r<=1;r++)for(var i=0;i<=1;i++){for(var o=(0===r?"r":"rp1")+", "+(0===i?"c":"cp1"),a=2;a<e;a++)o=t[t.length-1-a]+","+o;n.push(o)}return n}(n,t);return 1===n?"getA(rc),\n rc + 1 >= "+e[0]+" ? 0. : getA(rc + 1),\n 0, 0":"getA("+r[0]+"),\n cEdge ? 0. : getA("+r[1]+"),\n rEdge ? 0. : getA("+r[2]+"),\n rEdge || cEdge ? 0. : getA("+r[3]+")"}(e,n);this.userCode="\n void main() {\n "+r+" rc = getOutputCoords();\n\n if("+i+") {\n setOutput(vec4(0));\n } else {\n "+o+"\n\n setOutput(vec4("+a+"));\n }\n }\n "}},ca=function(e,t,n){this.variableNames=["x"],this.outputShape=t.map(function(t,n){return t[0]+e[n]+t[1]});var r=e.length,i=Pi(r),o=t.map(function(e){return e[0]}).join(","),a=t.map(function(t,n){return t[0]+e[n]}).join(","),s=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);this.userCode=1!==r?"\n "+i+" start = "+i+"("+o+");\n "+i+" end = "+i+"("+a+");\n\n void main() {\n "+i+" outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float("+n+"));\n } else {\n "+i+" coords = outC - start;\n setOutput(getX("+s+"));\n }\n }\n ":"\n int start = "+o+";\n int end = "+a+";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float("+n+"));\n } else {\n setOutput(getX(outC - start));\n }\n }\n "},la=function(e,t,n){this.variableNames=["x"],this.usesPackedTextures=!0,this.outputShape=t.map(function(t,n){return t[0]+e[n]+t[1]});for(var r=e.length,i=Pi(r),o=t.map(function(e){return e[0]}).join(","),a=t.map(function(t,n){return t[0]+e[n]}).join(","),s=Si("rc",r),u=Si("source",r),c=s[r-1]+" < "+this.outputShape[r-1],l=1===r?"source":"vec2("+u.slice(-2).join()+")",f=[i+" rc = outputLoc;",s[r-1]+" += 1;\n if("+c+") {\n ",1===r?"":"}\n rc = outputLoc;\n "+s[r-2]+" += 1;\n if("+s[r-2]+" < "+this.outputShape[r-2]+") {",1===r?"":" "+s[r-1]+" += 1;\n if("+c+") {"],h=1===r?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",d="",p=0,m=1===r?2:4;p<m;p++)d+="\n "+f[p]+"\n if ("+h+") {\n result["+p+"] = float("+n+");\n } else {\n "+i+" source = rc - start;\n result["+p+"] = getChannel(getX("+u.join()+"), "+l+");\n }\n ";d+=1===r?"} ":"}}",this.userCode="\n const "+i+" start = "+i+"("+o+");\n const "+i+" end = "+i+"("+a+");\n\n void main() {\n "+i+" outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n "+d+"\n setOutput(result);\n }\n "},fa=function(e,t,n){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");var r=e.filterWidth,i=e.strideHeight,o=e.strideWidth,a=e.dilationHeight,s=e.dilationWidth,u=e.effectiveFilterHeight,c=e.effectiveFilterWidth,l=e.padInfo.top,f=e.padInfo.left;this.outputShape=e.outShape;var h="avg"===t,d="0.0";if(h||(d="-1.0 / 1e-20"),n)this.userCode="\n const ivec2 strides = ivec2("+i+", "+o+");\n const ivec2 pads = ivec2("+l+", "+f+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < "+u+";\n wR += "+a+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+c+";\n wC += "+s+") {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= "+e.inWidth+") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value >= currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * "+c+" + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ";else{var p=t+"("+t+"("+t+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===t&&(p="avgValue / count");var m=4*Math.floor(r/4),v=r%4,g="\n if ("+h+") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n ";this.userCode="\n const ivec2 strides = ivec2("+i+", "+o+");\n const ivec2 pads = ivec2("+l+", "+f+");\n const float initializationValue = "+d+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= "+e.inWidth+") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4("+d+");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < "+u+";\n wR += "+a+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+e.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+m+"; wC += 4) {\n int xC = xCCorner + wC * "+s+";\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + "+s+", d),\n getValue(batch, xR, xC + 2 * "+s+", d),\n getValue(batch, xR, xC + 3 * "+s+", d)\n );\n\n "+g+"\n }\n\n int xC = xCCorner + "+m+";\n if ("+(1===v)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+g+"\n } else if ("+(2===v)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + "+s+", d),\n initializationValue,\n initializationValue\n );\n\n "+g+"\n } else if ("+(3===v)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + "+s+", d),\n getValue(batch, xR, xC + 2 * "+s+", d),\n initializationValue\n );\n\n "+g+"\n }\n }\n setOutput("+p+");\n }\n "}},ha=function(e,t){this.variableNames=["x"];var n=e.windowSize,r=e.batchSize,i=e.inSize,o=Math.ceil(i/n);this.outputShape=[r,o];var a="0.0",s="";"prod"===t?a="1.0":"min"===t?(a="1.0 / 1e-20",s="min"):"max"===t&&(
vendor: 3,828 bytes, line 1
1a="-1.0 / 1e-20",s="max");var u=t+"("+t+"("+t+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum"===t?u="sumValue":"prod"===t?u="prodValue":"all"===t?u="allValue":"any"===t&&(u="anyValue");var c=4*Math.floor(n/4),l=n%4,f="\n if ("+("sum"===t)+") {\n sumValue += dot(values, ones);\n } else if ("+("prod"===t)+") {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = "+s+"(values, minMaxValue);\n }\n ",h="vec4";"all"===t?(a="1.0",f="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",h="bvec4"):"any"===t&&(a="0.0",f="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",h="bvec4");var d="";i%n>0&&(d="\n if (inIdx < 0 || inIdx >= "+i+") {\n return initializationValue;\n }\n "),this.userCode="\n const float initializationValue = "+a+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n "+d+"\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+n+";\n\n vec4 minMaxValue = vec4("+a+");\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < "+c+"; i += 4) {\n int inIdx = inOffset + i;\n "+h+" values = "+h+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n "+f+"\n }\n\n int inIdx = inOffset + "+c+";\n if ("+(1===l)+") {\n "+h+" values = "+h+"(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+f+"\n } else if ("+(2===l)+") {\n "+h+" values = "+h+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n "+f+"\n } else if ("+(3===l)+") {\n "+h+" values = "+h+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n "+f+"\n }\n setOutput("+u+");\n }\n "},da=function(e,t){this.variableNames=["A"],this.usesPackedTextures=!0,this.outputShape=e;for(var n="",r=0;r<4;r++){var i="thisRC = rc;";r%2==1&&(i+="thisRC.z += 1;"),r>1&&(i+="thisRC.y += 1;"),n+="\n "+i+"\n "+(r>0?"if(thisRC.y < rows && thisRC.z < cols){":"")+"\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result["+r+"] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n "+(r>0?"}":"")+"\n "}this.userCode="\n \n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n "+Ci(["r","c","d"],t)+"\n return ivec3(r, c, d);\n }\n \n "+Oi(e)+"\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = "+e[1]+";\n int cols = "+e[2]+";
1\n\n "+n+"\n\n setOutput(result);\n }\n "},pa=function(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,i=r[1],o=r[2],a=e.shape,s=a[1],u=a[2],c=[n&&s>1?i-1:i,n&&u>1?o-1:o],l=[n&&s>1?s-1:s,n&&u>1?u-1:u],f=c[0]/l[0],h=c[1]/l[1],d=1/f,p=1/h,m=2*Math.ceil(d)+2,v=2*Math.ceil(p)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+f+");\n const float widthScale = float("+h+");\n\n const float invHeightScale = float("+d+");\n const float invWidthScale = float("+p+");\n\n const int winHeight = int("+m+");\n const int winWidth = int("+v+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+s+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+u+") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), "+(i-1)+".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), "+(o-1)+".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "},ma=function(e,t,n,r){this.variableNames=["A"],this.outputShape=[];var i=e[0],o=e[1],a=e[2],s=e[3];this.outputShape=[i,t,n,s];var u=[r&&t>1?o-1:o,r&&n>1?a-1:a],c=[r&&t>1?t-1:t,r&&n>1?n-1:n];this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+u[0]/c[0]+",\n "+u[1]/c[1]+");\n const vec2 inputShapeRC = vec2("+o+".0, "+a+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n "},va=function(e,t,n,r){this.variableNames=["A"],this.usesPackedTextures=!0,this.outputShape=[];var i=e[0],o=e[1],a=e[2],s=e[3];this.outputShape=[i,t,n,s];var u=[r&&t>1?o-1:o,r&&n>1?a-1:a],c=[r&&t>1?t-1:t,r&&n>1?n-1:n];this.userCode="\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n "+u[0]/c[0]+",\n "+u[1]/c[1]+",\n "+u[1]/c[1]+");\n const vec3 inputShapeRC = vec3("+o+".0, "+a+".0,\n "+a+".0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = vec3(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(sourceFracIndexRC);\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n \n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < "+(s-1)+"; \n bool hasNextRow = coords.z < "+(n-1)+"
vendor: 2,064 bytes, line 1
1;\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n
1"},ga=function(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t.shape;var r=t.shape,i=r[1],o=r[2],a=e.shape,s=a[1],u=a[2],c=[n&&s>1?i-1:i,n&&u>1?o-1:o],l=[n&&s>1?s-1:s,n&&u>1?u-1:u],f=c[0]/l[0],h=c[1]/l[1],d=1/f,p=1/h,m=2*Math.ceil(d)+2,v=2*Math.ceil(p)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+f+");\n const float widthScale = float("+h+");\n\n const float invHeightScale = float("+d+");\n const float invWidthScale = float("+p+");\n\n const int winHeight = int("+m+");\n const int winWidth = int("+v+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+s+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+u+") {\n continue;\n }\n\n float sourceFracRow =\n float("+c[0]+") *\n (float(dyR) / float("+l[0]+"));\n\n float sourceFracCol =\n float("+c[1]+") *\n (float(dyC) / float("+l[1]+"));\n\n int sourceNearestRow = int(min(\n float(int("+i+") - 1),\n "+n+" ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int("+o+") - 1),\n "+n+" ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "},ya=function(e,t,n,r){this.variableNames=["A"],this.outputShape=[];var i=e[0],o=e[1],a=e[2],s=e[3];this.outputShape=[i,t,n,s];var u=[r&&t>1?o-1:o,r&&n>1?a-1:a],c=[r&&t>1?t-1:t,r&&n>1?n-1:n],l=r?"0.5":"0.0";this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+u[0]/c[0]+",\n "+u[1]/c[1]+");\n const vec2 inputShapeRC = vec2("+o+".0, "+a+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + "+l+")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n "},ba=function(e,t){this.variableNames=["x"];var n=e.length;if(n>4)throw new Error("WebGL backend: Reverse of rank-"+n+" tensor is not yet supported");if(this.outputShape=e,1!==n){var r=e.map(function(n,r){return function(n){return-1!==t.indexOf(n)&&1!==e[n]?e[n]+" - coords["+n+"] - 1":"coords["+n+"]"}(r)}).join(","),i=Pi(n);this.userCode="\n void main() {\n "+i+" coords = getOutputCoords();\n setOutput(getX("+r+"));\n }\n "}else this.userCode="\n void main() {\n int coord = getOutputCoords();\n setOutput(getX("+e[0]+" - coord - 1));\n }\n "},wa=function(e,t){this.variableNames=["x"],this.usesPackedTextures=!0;var n=e.length;if(n>4)throw new Error("WebGL backend: Reverse of rank-"+n+" tensor is not yet supported");this.outputShape=e;var r=Si("rc",n),i=r[n-1]+" + 1 < "+this.outputShape[n-1],o=r[n-2]+" + 1 < "+this.outputShape[n-2],a=Pi(n);function s(n){var r=e.map(function(r,i){return function(n,r){return-1!==t.indexOf(n)&&1!==e[n]?e[n]+" - "+r[n]+" - 1":""+r[n]}(i,n)});return"getChannel(getX("+r.join(",")+"), vec2("+r.slice(-2).join(",")+"))"}this.userCode=1===n?"\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX("+e[0]+" - rc - 1),\n "+e[0]+" - rc - 1);\n if("+i+"){\n result.g = getChannel(getX("+e[0]+" - (rc + 1) - 1),\n "+e[0]+" - (rc + 1) - 1);\n }\n setOutput(result);\n }\n ":"\n void main() {\n "+a+" rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = "+s(r.slice())+";\n if("+i+"){\n result.g = "+function(e){return e[n-1]="("+e[n-1]+" + 1)",s(e)}(r.slice())+";\n }\n if("+o+") {\n result.b = "+function(e){return e[n-2]="("+e[n-2]+" + 1)",s(e)}(r.slice())+";\n if("+i+") {\n result.a = "+function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",s(e)}(r.slice())+";\n }\n }\n setOutput(result);\n }\n "},xa=function(e,t,n,r,i,o,a){void 0===a&&(a=!0),this.variableNames=["updates","indices","defaultValue"],this.outputShape=o;var s=Pi(i.length),u=Pi(o.length),c="";1===n?c="i":2===n&&(c="i, j");var l="getIndices("+c+")",f="";1===r?f="i":2===r&&(f="i, coords[1]");
1var h="getUpdates("+f+")",d=t>1?"strides[j]":"strides";this.userCode="\n "+s+" strides = "+s+"("+i+");\n\n void main() {\n "+u+" coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < "+e+"; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < "+t+"; j++) {\n int index = round("+l+");\n flattenedIndex += index * "+d+";\n }\n if (flattenedIndex == coords[0]) {\n sum += "+h+";\n found = true;\n }\n }\n setOutput(mix(getDefaultValue(), sum, float(found)));\n }\n "},_a=function(e,t){this.variableNames=["x","segmentIds"];var n=e.windowSize,r=e.batchSize,i=e.inSize,o=e.numSegments,a=o*Math.ceil(i/n);this.outputShape=[r,a];var s=4*Math.floor(n/4),u=n%4,c="\n sumValue += dot(values, segFilter);\n ",l="";i%n>0&&(l="\n if (inIdx < 0 || inIdx >= "+i+") {\n return initializationValue;\n }\n ");var f="";i%n>0&&(f="\n if (inIdx < 0 || inIdx >= "+i+") {\n return -1.0;\n }\n "),this.userCode="\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n "+l+"\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n "+f+"\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n "+o+")) * float("+n+"));\n int currentSeg = int(mod(float(outIdx), float("+o+")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < "+s+"; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n "+c+"\n }\n\n int inIdx = inOffset + "+s+";\n if ("+(1===u)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n "+c+"\n } else if ("+(2===u)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n "+c+"\n } else if ("+(3===u)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n "+c+"\n }\n setOutput(sumValue);\n }\n "},ka=function(e,t,n){var r,i;if(this.variableNames=["c","a","b"],this.outputShape=t,n>4)throw Error("Where for rank "+n+" is not yet supported");if(1===n)i="resRC",r="resRC";else{for(var o=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[],s=[],u=0;u<t.length;u++)s.push(""+o[u]),u<e&&a.push(""+o[u]);r=a.join(),i=s.join()}var c=Pi(n);this.userCode="\n void main() {\n "+c+" resRC = getOutputCoords();\n float cVal = getC("+r+");\n if (cVal >= 1.0) {\n setOutput(getA("+i+"));\n } else {\n setOutput(getB("+i+"));\n }\n }\n "},Sa=function(){function e(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;var t,n=Pi(this.rank),r="uniform int start["+this.rank+"];",i=function(e){if(1===e)return"sourceLoc";if(e<=6)return Ea.slice(0,e).map(function(e){return"sourceLoc."+e}).join(",");throw Error("Slicing for rank "+e+" is not yet supported")}(this.rank);t="\n "+n+" sourceLoc;\n "+n+" coords = getOutputCoords();\n "+e.map(function(e,t){return"sourceLoc."+Ea[t]+" = start["+t+"] + coords."+Ea[t]+";"}).join("\n")+"\n ",this.userCode="\n "+r+"\n void main() {\n "+t+"\n setOutput(getSource("+i+"));\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+e.length+")");return function(n,r){null==t.startLoc&&(t.startLoc=n.getUniformLocationNoThrow(r,"start"),null==t.startLoc)||n.gl.uniform1iv(t.startLoc,e)}},e}(),Ea=["x","y","z","w","u","v"],Ca=function(){function e(e){this.variableNames=["source"],this.usesPackedTextures=!0,this.outputShape=e,this.rank=e.length;var t=Pi(this.rank),n=Si("coords",this.rank),r=Si("sourceLoc",this.rank),i=1===this.rank?"sourceLoc":"vec2("+r.slice(-2).join()+")",o="getChannel(getSource("+r.join()+"), "+i+")",a="\n result.x = "+o+";\n if (++"+n[this.rank-1]+" < "+e[this.rank-1]+") {\n ++"+r[this.rank-1]+";\n result.y = "+o+";\n --"+r[this.rank-1]+";\n }\n ",s=1===this.rank?"":"\n --"+n[this.rank-1]+";\n if (++"+n[this.rank-2]+" < "+e[this.rank-2]+") {\n ++"+r[this.rank-2]+";\n result.z = "+o+";\n if (++"+n[this.rank-1]+" < "+e[this.rank-1]+") {\n ++"+r[this.rank-1]+";\n result.w = "+o+";\n }\n }
1\n ",u=this.rank<=4?"sourceLoc = coords +\n "+t+"("+e.map(function(e,t){return"start["+t+"]"}).join()+");":e.map(function(e,t){return r[t]+" = "+n[t]+" + start["+t+"];"}).join("\n");this.userCode="\n uniform int start["+this.rank+"];\n void main() {\n "+t+" coords = getOutputCoords();\n "+t+" sourceLoc;\n "+u+" \n vec4 result = vec4(0.);\n "+a+"\n "+s+"\n setOutput(result);\n }\n "}return e.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+e.length+")");return function(n,r){null==t.startLoc&&(t.startLoc=n.getUniformLocationNoThrow(r,"start"),null==t.startLoc)||n.gl.uniform1iv(t.startLoc,e)}},e}(),Na=function(e,t,n,r){this.variableNames=["x"];var i=n.filter(function(e,t){return-1===r.indexOf(t)});this.outputShape=i;var o=n.length,a=Pi(n.length),s=Pi(i.length),u="";if(1===o)u="coords * strides + begin";else{var c=0;u=n.map(function(e,t){return-1===r.indexOf(t)?(c++,1===i.length?"coords * strides["+t+"] + begin["+t+"]":"coords["+(c-1)+"] * strides["+t+"] + begin["+t+"]"):"begin["+t+"]"}).join(",")}this.userCode="\n "+a+" begin = "+a+"("+e+");\n "+a+" strides = "+a+"("+t+");\n\n void main() {\n "+s+" coords = getOutputCoords();\n setOutput(getX("+u+"));\n }\n "},Oa=function(){function e(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return e.prototype.acquireTexture=function(e,t,n){var r,i=Aa(t,n),o=Ta(e,i,n);if(o in this.freeTextures||(this.freeTextures[o]=[]),o in this.usedTextures||(this.usedTextures[o]=[]),this.freeTextures[o].length>0){this.numFreeTextures--,this.numUsedTextures++,this.log();var a=this.freeTextures[o].shift();return this.usedTextures[o].push(a),a}return this.numUsedTextures++,this.log(),i===mo.PACKED_2X2_FLOAT32?r=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):i===mo.PACKED_2X2_FLOAT16?r=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):i===mo.UNPACKED_FLOAT32?r=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):i===mo.UNPACKED_FLOAT16?r=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):i===mo.PACKED_4X1_UNSIGNED_BYTE&&(r=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[o].push(r),r},e.prototype.releaseTexture=function(e,t,n,r){if(null!=this.freeTextures){var i=Ta(t,Aa(n,r),r);i in this.freeTextures||(this.freeTextures[i]=[]),this.freeTextures[i].push(e),this.numFreeTextures++,this.numUsedTextures--;var o=this.usedTextures[i],a=o.indexOf(e);if(a<0)throw new Error("Cannot release a texture that was never provided by this texture manager");o.splice(a,1),this.log()}},e.prototype.log=function(){if(this.logEnabled){var e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",this.numFreeTextures+" / "+this.numUsedTextures,"("+e+")")}},e.prototype.getNumUsedTextures=function(){return this.numUsedTextures},e.prototype.getNumFreeTextures=function(){return this.numFreeTextures},e.prototype.dispose=function(){var e=this;if(null!=this.freeTextures){for(var t in this.freeTextures)this.freeTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});for(var t in this.usedTextures)this.usedTextures[t].forEach(function(t){e.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0}},e}();function Aa(e,t){if(e===po.UPLOAD)return mo.PACKED_2X2_FLOAT32;if(e===po.RENDER||null==e)return t?f.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?mo.PACKED_2X2_FLOAT32:mo.PACKED_2X2_FLOAT16:f.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?mo.UNPACKED_FLOAT32:mo.UNPACKED_FLOAT16;if(e===po.DOWNLOAD||e===po.PIXELS)return mo.PACKED_4X1_UNSIGNED_BYTE;throw new Error("Unknown logical texture type "+e)}function Ta(e,t,n){return e[0]+"_"+e[1]+"_"+t+"_"+n}var Ia=function(e,t){this.variableNames=["A"];for(var n=new Array(e.length),r=0;r<n.length;r++)n[r]=e[r]*t[r];this.outputShape=n,this.rank=n.length;var i=Pi(this.rank),o=function(e){var t=e.length;if(t>5)throw Error("Tile for rank "+t+" is not yet supported");if(1===t)return"imod(resRC, "+e[0]+")";for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[],i=0;i<e.length;i++)r.push("imod("+n[i]+", "+e[i]+")");return r.join()}(e);this.userCode="\n void main() {\n "+i+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "},Ra=function(e,t){this.variableNames=["A"];for(var n=new Array(e.length),r=0;r<n.length;r++)n[r]=e[t[r]];this.outputShape=n,this.rank=n.length;var i=Pi(this.rank),o=function(e){var t=e.length;if(t>6)throw Error("Transpose for rank "+t+" is not yet supported");for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(t),i=0;i<e.length;i++)r[e[i]]=n[i];return r.join()}(t);this.userCode="\n void main() {\n "+i+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "},Ma=function(e,t){this.variableNames=["A"],this.usesPackedTextures=!0;for(var n=new Array(e.length),r=0;r<n.length;r++)n[r]=e[t[r]];if(this.outputShape=n,this.rank=n.length,this.rank>6)throw Error("Packed transpose for rank "+this.rank+" is not yet supported.");var i=Pi(this.rank),o=ki("rc",this.rank),a=new Array(this.rank);for(r=0;r<t.length;r++)a[t[r]]=o[r];var s="vec2("+a.slice(-2).join()+")",u="++"+o[this.rank-1]+" < "+n[this.rank-1],c="getChannel(getA("+a.join()+"), "+s+")";this.userCode="\n void main() {\n "+i+" rc = getOutputCoords();\n vec4 result = vec4(0.);\n result[0] = "+c+";\n if("+u+") {\n result[1] = "+c+";\n }\n --"+o[this.rank-1]+";\n if(++"+o[this.rank-2]+" < "+n[this.rank-2]+") {\n result[2] = "+c+";\n if("+u+") {\n result[3] = "+c+";\n }\n } \n setOutput(result);\n }\n "},Da=1.7580993408473768,ja=1.0507009873554805,Pa=function(e,t){this.variableNames=["A"],this.outputShape=e,this.userCode="\n float unaryOperation(float x) {\n "+t+"\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n "},za="if (isnan(x)) return x;
1",La=za+"\n return (x < 0.0) ? 0.0 : x;\n",Ba="return exp(x);",Fa="\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",Ua=function(e,t){this.variableNames=["A"],this.usesPackedTextures=!0,this.outputShape=e,this.userCode="\n vec4 unaryOperation(vec4 x) {\n "+t+"\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n "},Wa=function(e){this.variableNames=["A"],this.usesPackedTextures=!0,this.outputShape=e;var t=e.length,n=Si("rc",t),r=Pi(t),i=function(e,t){if(1===e)return"rc";for(var n="",r=0;r<e;r++)n+=t[r],r<e-1&&(n+=",");return n}(t,n),o=n.slice(-2),a=t<=1?"rc":"vec2("+o.join(",")+")";this.userCode="\n void main() {\n "+r+" rc = getOutputCoords();\n vec4 packedInput = getA("+i+");\n\n setOutput(getChannel(packedInput, "+a+"));\n }\n "},Va={},qa=600,Ha=function(){function e(e){if(this.gpgpu=e,this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.warnedAboutMemory=!1,this.disposed=!1,!f.getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(null==e){var t=Fe(f.getNumber("WEBGL_VERSION"));this.binaryCache=(n=f.getNumber("WEBGL_VERSION"))in Va?Va[n]:(Va[n]={},Va[n]),this.gpgpu=new Zo(t),this.canvas=t.canvas,this.gpgpuCreatedLocally=!0}else this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=e.gl.canvas;var n;this.textureManager=new Oa(this.gpgpu),this.numMBBeforeWarning=null==f.global.screen?1024:f.global.screen.height*f.global.screen.width*window.devicePixelRatio*qa/1024/1024,this.texData=new nr(this,je)}return e.prototype.register=function(e,t,n){if(this.texData.has(e))throw new Error("Data buffer is already registered");this.texData.set(e,{shape:t,dtype:n})},e.prototype.fromPixels=function(e,t){if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");var n=[e.height,e.width],r=[e.height,e.width,t];if(f.getBool("IS_BROWSER")){if(!(e instanceof HTMLVideoElement||e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e.data instanceof Uint8Array))throw new Error("pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData or {data: Uint32Array, width: number, height: number}, but was "+e.constructor.name);if(e instanceof HTMLVideoElement){if(null==this.fromPixels2DContext){if("complete"!==document.readyState)throw new Error("The DOM is not ready yet. Please call tf.browser.fromPixels() once the DOM is ready. One way to do that is to add an event listener for `DOMContentLoaded` on the document object");this.fromPixels2DContext=document.createElement("canvas").getContext("2d")}this.fromPixels2DContext.canvas.width=e.width,this.fromPixels2DContext.canvas.height=e.height,this.fromPixels2DContext.drawImage(e,0,0,e.width,e.height),e=this.fromPixels2DContext.canvas}}var i,o,a=this.makeTensorHandle(n,"int32");if(this.texData.get(a.dataId).usage=po.PIXELS,this.gpgpu.uploadPixelDataToTexture(this.getTexture(a.dataId),e),f.getBool("WEBGL_PACK")){i=new ko(r);var s=this.makePackedTensor(i.outputShape,a.dtype);o=this.compileAndRun(i,[a],s)}else i=new _o(r),o=this.compileAndRun(i,[a]);return this.disposeData(a.dataId),o},e.prototype.makeTensorHandle=function(e,t){var n={};return this.register(n,e,t),{dataId:n,shape:e,dtype:t}},e.prototype.write=function(e,t){if(null==t)throw new Error("MathBackendWebGL.write(): values can not be null");if(f.getBool("DEBUG"))for(var n=0;n<t.length;n++){var r=t[n];if(!qe(r))throw Error("The value "+r+" cannot be represented on this device.")}var i=this.texData.get(e);if("complex64"===i.dtype)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.releaseGPUData(e),i.usage=po.UPLOAD,i.values=t},e.prototype.readSync=function(e){var t=this.texData.get(e),n=t.values,r=t.dtype,i=t.complexTensors,o=t.slice,a=t.shape;if(null!=o){var s=new Pa(a,"return x;"),u=this.compileAndRun(s,[{dataId:e,shape:a,dtype:r}]),c=this.readSync(u.dataId);return u.dispose(),c}if(null!=n)return this.convertAndCacheOnCPU(e);if("string"===r)return n;var l,f,h=null!=this.activeTimers;return h&&(l=performance.now()),f="complex64"===r?xr(i.real.dataSync(),i.imag.dataSync()):this.getValuesFromTexture(e),h&&(this.downloadWaitMs+=performance.now()-l),this.convertAndCacheOnCPU(e,f)},e.prototype.read=function(e){return c(this,void 0,void 0,function(){var t,n,r,i,o,a,s,u,c,h,d,p,m,v,g,y,b,w,x,_,k,E,C,N,O,A,T,I;return l(this,function(l){switch(l.label){case 0:if(this.pendingRead.has(e))return r=this.pendingRead.get(e),[2,new Promise(function(e){return r.push(e)})];if(i=this.texData.get(e),o=i.texture,a=i.values,s=i.texShape,u=i.isPacked,c=i.shape,h=i.slice,d=i.dtype,p=i.complexTensors,null!=h)return m=new Pa(c,"return x;"),v=this.compileAndRun(m,[{dataId:e,shape:c,dtype:d}]),g=this.read(v.dataId),v.dispose(),[2,g];if(null!=a)return[2,this.convertAndCacheOnCPU(e)];if(this.pendingRead.set(e,[]),!f.getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===f.getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");return y=null,"complex64"===d?[3,2]:(b=s[1],w=s[0],u&&(t=Ao(s[0],s[1]),b=t[0],w=t[1]),f.get("WEBGL_BUFFER_SUPPORTED")&&(y=this.gpgpu.createBufferFromTexture(o,w,b)),[4,this.gpgpu.createAndWaitForFence()]);case 1:l.sent(),l.label=2;case 2:return"complex64"!==d?[3,4]:[4,Promise.all([p.real.data(),p.imag.data()])];case 3:return _=l.sent(),k=_[0],E=_[1],x=xr(k,E),[3,5];case 4:null==y?x=this.getValuesFromTexture(e):(C=S(c),u?(N=gt(c),O=1,A=1,c.length&&(n=yt(c),O=n[0],A=n[1]),x=this.gpgpu.downloadPackedMatrixFromBuffer(y,N,O,A,s[0],s[1]).subarray(0,C)):x=this.gpgpu.downloadFloat32MatrixFromBuffer(y,s[0],s[1]).subarray(0,C)),l.label=5;case 5:return T=this.convertAndCacheOnCPU(e,x),I=this.pendingRead.get(e),this.pendingRead.delete(e),I.forEach(function(e){return e(T)}),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)),[2,T]}})})},e.prototype.getValuesFromTexture=function(e){var t,n=this,r=this.texData.get(e),i=r.shape,o=r.dtype,a=r.texture,s=r.texShape,u=S(i);if(f.getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){if(this.texData.get(e).isPacked){var c=gt(i),l=1,h=1;return i.length&&(l=(t=yt(i))[0],h=t[1]),this.gpgpu.downloadMatrixFromPackedTexture(a,c,l,h,s[0],s[1]).subarray(0,u)}return this.gpgpu.downloadFloat32MatrixFromOutputTexture(a,s[0],s[1]).subarray(0,u)}var d=this.makeTensorHandle(i,"float32");d.size=S(i),this.texData.get(d.dataId).usage=po.DOWNLOAD;var p=Bt(function(){var t=new go(i);return n.compileAndRun(t,[{shape:i,dtype:o,dataId:e}],d,null)}),m=this.texData.get(p.dataId),v=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(m.texture,m.texShape[0],m.texShape[1]).subarray(0,u);return this.disposeData(d.dataId),v},e.prototype.time=function(e){return c(this,void 0,void 0,function(){var t,n,r,i,o,a,s;return l(this,function(u){switch(u.label){case 0:return t=this.activeTimers,n=[],r=!1,null==this.programTimersStack?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,e(),i=k(this.activeTimers.map(function(e){return e.query})).filter(function(e){return null!=e}),o=k(this.activeTimers.map(function(e){return e.name})).filter(function(e){return null!=e}),this.activeTimers=t,r&&(this.programTimersStack=null),[4,Promise.all(i)];case 1:return a=u.sent(),s={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:b(a),getExtraProfileInfo:function(){return a.map(function(e,t){return{name:o[t],ms:e}}).map(function(e){return e.name+": "+e.ms}).join(", ")},wallMs:null},this.uploadWaitMs=0,this.downloadWaitMs=0,[2,s]}})})},e.prototype.memory=function(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU}},e.prototype.startTimer=function(){return f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?this.gpgpu.beginQuery():{startMs:performance.now(),endMs:null}},e.prototype.endTimer=function(e){return f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(this.gpgpu.endQuery(),e):(e.endMs=performance.now(),e)},e.prototype.getQueryTime=function(e){return c(this,void 0,void 0,function(){var t;return l(this,function(n){return f.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?[2,this.gpgpu.waitForQueryAndGetTime(e)]:[2,(t=e).endMs-t.startMs]})})},e.prototype.disposeData=function(e){if(!this.pendingDisposal.has(e))if(this.pendingRead.has(e))this.pendingDisposal.add(e);else if(this.texData.has(e)){this.releaseGPUData(e);
vendor: 15,754 bytes, line 1
1var t=this.texData.get(e).complexTensors;null!=t&&(t.real.dispose(),t.imag.dispose()),this.texData.delete(e)}},e.prototype.releaseGPUData=function(e){var t=this.texData.get(e),n=t.texture,r=t.dtype,i=t.texShape,o=t.usage,a=t.isPacked,s=t.slice,u=s&&s.origDataId||e,c=this.dataRefCount.get(u);c>1?this.dataRefCount.set(u,c-1):(this.dataRefCount.delete(u),null!=n&&(this.numBytesInGPU-=this.computeBytes(i,r),this.textureManager.releaseTexture(n,i,o,a)));var l=this.texData.get(e);l.texture=null,l.texShape=null,l.isPacked=!1,l.slice=null},e.prototype.getTexture=function(e){return this.uploadToGPU(e),this.texData.get(e).texture},e.prototype.getCPUBackend=function(){return f.getBool("WEBGL_CPU_FORWARD")?(null==this.cpuBackend&&(this.cpuBackend=je.findBackend("cpu")),this.cpuBackend):null},e.prototype.shouldExecuteOnCPU=function(e,t){var n=this;return void 0===t&&(t=128),null!=this.getCPUBackend()&&e.every(function(e){return null==n.texData.get(e.dataId).texture&&e.size<t})},e.prototype.getGPGPUContext=function(){return this.gpgpu},e.prototype.getCanvas=function(){return this.canvas},e.prototype.complex=function(e,t){var n=this.makeOutputArray(e.shape,"complex64");return this.texData.get(n.dataId).complexTensors={real:je.keep(e.clone()),imag:je.keep(t.clone())},n},e.prototype.real=function(e){return this.texData.get(e.dataId).complexTensors.real.clone()},e.prototype.imag=function(e){return this.texData.get(e.dataId).complexTensors.imag.clone()},e.prototype.slice=function(e,t,n){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.slice(e,t,n);if(0===S(n))return Un([],n,e.dtype);var r=this.texData.get(e.dataId).isPacked,i=_n(e.shape,t,n);if(r||!i){var o=f.getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Ca(n):new Sa(n),a=o.getCustomSetupFunc(t);return this.compileAndRun(o,[e],null,a)}return this.uploadToGPU(e.dataId),this.shallowSlice(e,t,n)},e.prototype.shallowSlice=function(e,t,n){var r=this.texData.get(e.dataId),i=ve.make(n,{},e.dtype,this),o=this.texData.get(i.dataId);Object.assign(o,r),o.shape=n,o.dtype=e.dtype;var a=kn(t,e.strides);r.slice&&(a+=r.slice.flatOffset),o.slice={flatOffset:a,origDataId:r.slice&&r.slice.origDataId||e.dataId};var s=this.dataRefCount.get(o.slice.origDataId)||1;return this.dataRefCount.set(o.slice.origDataId,s+1),i},e.prototype.stridedSlice=function(e,t,n,r,i,o,a,s,u){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.stridedSlice(e,t,n,r,i,o,a,s,u);var c=bn(e.shape,t,n,r,i,o,a,s,u),l=c[0],f=c[1],h=c[2],d=f.filter(function(e,t){return-1===h.indexOf(t)});if(d.some(function(e){return 0===e}))return Un([],d);var p=new Na(l,r,f,h);return this.compileAndRun(p,[e])},e.prototype.reverse=function(e,t){var n=f.getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new wa(e.shape,t):new ba(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.concat=function(e,t){if(this.shouldExecuteOnCPU(e))return this.cpuBackend.concat(e,t);if(1===e.length)return e[0];if(e.length>f.getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){var n=Math.floor(e.length/2),r=this.concat(e.slice(0,n),t),i=this.concat(e.slice(n),t);return this.concat([r,i],t)}if(f.getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].rank>1){var o=new Qi(e.map(function(e){return e.shape}),t);return this.compileAndRun(o,e)}var a=pn(e.map(function(e){return e.shape}),t),s=e.map(function(e){return e.as2D(-1,S(e.shape.slice(t)))}),u=new Zi(s.map(function(e){return e.shape}));return this.compileAndRun(u,s).reshape(a)},e.prototype.neg=function(e){var t=new Pa(e.shape,"return -x;");return this.compileAndRun(t,[e])},e.prototype.batchMatMul=function(e,t,n,r){var i=n?e.shape[2]:e.shape[1],o=r?t.shape[1]:t.shape[2],a=n?e.shape[1]:e.shape[2],s=e.shape[0];if((1===i||1===o)&&a>1e3){n&&(e=e.transpose([0,2,1])),r&&(t=t.transpose([0,2,1]));var u=1===o?e:e.as3D(s,a,1),c=1===o?2:1,l=1===o?t.as3D(s,1,a):t;return this.multiply(u,l).sum(c,!0)}var f=Ce(e.dtype,t.dtype),h=new oa(e.shape,[s,i,o],n,r),d=this.makePackedTensor(h.outputShape,f);return this.compileAndRun(h,[e,t],d)},e.prototype.fusedBatchMatMul=function(e,t,n,r,i,o){var a=n?e.shape[2]:e.shape[1],s=r?t.shape[1]:t.shape[2],u=e.shape[0],c=Ce(e.dtype,t.dtype),l=new oa(e.shape,[u,a,s],n,r,!!i,o?function(e,t){if(void 0===t&&(t=!1),"linear"===o)return"return x;";if("relu"===o)return t?Fa:La;throw new Error("Activation "+o+" has not been implemented for the WebGL backend.")}(0,!0):null),f=this.makePackedTensor(l.outputShape,c),h=[e,t];return i&&h.push(i),this.compileAndRun(l,h,f)},e.prototype.multiply=function(e,t){if("complex64"===e.dtype){var n=this.texData.get(e.dataId),r=this.texData.get(t.dataId),i=new Vi("return areal * breal - aimag * bimag;",e.shape,t.shape),o=new Vi("return areal * bimag + aimag * breal;",e.shape,t.shape),a=[this.makeComplexComponentTensorHandle(e,n.complexTensors.real),this.makeComplexComponentTensorHandle(e,n.complexTensors.imag),this.makeComplexComponentTensorHandle(t,r.complexTensors.real),this.makeComplexComponentTensorHandle(t,r.complexTensors.imag)],s=this.compileAndRun(i,a),u=this.compileAndRun(o,a),c=this.complex(s,u);return s.dispose(),u.dispose(),c}if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.multiply(e,t);if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,Gi,e.dtype);var l=new Ki(Gi,e.shape,t.shape),h=this.makeOutputArray(l.outputShape,e.dtype);return this.compileAndRun(l,[e,t],h)},e.prototype.batchNormalization=function(e,t,n,r,i,o){var a=[e,t,n],s=null;null!=o&&(s=o.shape,a.push(o));var u=null;if(null!=i&&(u=i.shape,a.push(i)),f.getBool("WEBGL_PACK_NORMALIZATION")){var c=new Wi(e.shape,t.shape,n.shape,s,u,r);return this.compileAndRun(c,a)}var l=new Ui(e.shape,t.shape,n.shape,s,u,r);return this.compileAndRun(l,a)},e.prototype.localResponseNormalization4D=function(e,t,n,r,i){var o=f.getBool("WEBGL_PACK_NORMALIZATION")?new ra(e.shape,t,n,r,i):new ta(e.shape,t,n,r,i);return this.compileAndRun(o,[e])},e.prototype.LRNGrad=function(e,t,n,r,i,o,a){var s=new na(t.shape,r,i,o,a);return this.compileAndRun(s,[t,n,e])},e.prototype.tile=function(e,t){var n=new Ia(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.pad=function(e,t,n){var r=f.getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new la(e.shape,t,n):new ca(e.shape,t,n);return this.compileAndRun(r,[e])},e.prototype.transpose=function(e,t){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.transpose(e,t);var n=f.getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Ma(e.shape,t):new Ra(e.shape,t);return this.compileAndRun(n,[e])},e.prototype.gather=function(e,t,n){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.gather(e,t,n);var r=new So(e.shape,t.size,n);return this.compileAndRun(r,[e,t])},e.prototype.batchToSpaceND=function(e,t,n){w(e.rank<=4,function(){return"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"});var r=t.reduce(function(e,t){return e*t}),i=Qt(e.shape,t,r),o=en(i.length,t.length),a=tn(e.shape,t,r),s=nn(n,t.length),u=rn(a,n,t.length);return e.reshape(i).transpose(o).reshape(a).slice(s,u)},e.prototype.spaceToBatchND=function(e,t,n){w(e.rank<=4,function(){return"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"});var r=t.reduce(function(e,t){return e*t}),i=[[0,0]];i.push.apply(i,n);for(var o=1+t.length;o<e.shape.length;++o)i.push([0,0]);var a=e.pad(i),s=Qt(a.shape,t,r,!1),u=en(s.length,t.length,!1),c=tn(a.shape,t,r,!1);return a.reshape(s).transpose(u).reshape(c)},e.prototype.reduce=function(e,t,n){var r=e.shape[0],i=e.shape[1],o=gn(i),a=new ha({windowSize:o,inSize:i,batchSize:r},t),s=a.outputShape,u=s[0],c=s[1],l=this.makeOutputArray([u,c],n);return this.compileAndRun(a,[e],l),1===l.shape[1]?l:this.reduce(l,t,n)},e.prototype.argReduce=function(e,t,n){void 0===n&&(n=null);var r=e.shape[0],i=e.shape[1];null!=n&&(r=n.shape[0],i=n.shape[1]);var o=gn(i),a=new _i({windowSize:o,inSize:i,batchSize:r},t,null==n),s=a.outputShape,u=s[0],c=s[1],l=this.makeOutputArray([u,c],"int32"),f=[e];return null!=n&&f.push(n),this.compileAndRun(a,f,l),1===l.shape[1]?l:this.argReduce(e,t,l)},e.prototype.argReducePacked=function(e,t,n){void 0===n&&(n=null);var r=null!=n?n.shape:e.shape,i=gn(r[r.length-1]),o=new Bi(r,i,t,null==n),a=this.makePackedTensor(o.outputShape,"int32"),s=null==n?[e]:[e,n];return this.compileAndRun(o,s,a),a.rank===e.rank?this.argReducePacked(e,t,a):a},e.prototype.sum=function(e,t){cn("sum",t,e.rank);var n=sn(e.shape,t),r=n[0],i=S(n[1]),o=e.as2D(-1,i),a=Ne(e.dtype);return this.reduce(o,"sum",a).reshape(r)},e.prototype.prod=function(e,t){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.prod(e,t);var n=sn(e.shape,t),r=n[0],i=S(n[1]),o=e.as2D(-1,i),a=Ne(e.dtype);return this.reduce(o,"prod",a).reshape(r)},e.prototype.unsortedSegmentSum=function(e,t,n){var r=0,i=ln([r],e.rank),o=e;null!=i&&(o=e.transpose(i),r=hn(1,e.rank)[0]);var a=function(e,t,n){for(var r=[],i=e.length,o=0;o<i;o++)o!==t?r.push(e[o]):r.push(n);return r}(o.shape,r,n),s=S([o.shape[r]]),u=o.as2D(-1,s),c=Ne(e.dtype),l=this.segOpCompute(u,"unsortedSegmentSum",t,c,n).reshape(a);return null!=i&&(l=l.transpose(fn(i))),l},e.prototype.segOpCompute=function(e,t,n,r,i){var o=e.shape[0],a=e.shape[1],s=function(e,t){var n,r=!1;for(e<=vn?(n=e,r=!0):n=$(e,Math.floor(Math.sqrt(e)));!r;)n>t||n===e?r=!0:n=$(e,n+1);return n}(a,i),u=new _a({windowSize:s,inSize:a,batchSize:o,numSegments:i},t),c=u.outputShape,l=c[0],f=c[1],h=this.makeOutputArray([l,f],r);return this.compileAndRun(u,[e,n],h),h.shape[1]===i?h:(n=Qn(0,i).tile([a/s]),this.segOpCompute(h,t,n,r,i))},e.prototype.argMinMaxReduce=function(e,t,n){var r=[t];if(cn("arg"+n.charAt(0).toUpperCase()+n.slice(1),r,e.rank),!f.getBool("WEBGL_PACK_REDUCE")||e.rank<=2){var i=sn(e.shape,r),o=i[0],a=S(i[1]),s=e.as2D(-1,a);return this.argReduce(s,n).reshape(o)}return this.argReducePacked(e,n)},e.prototype.argMin=function(e,t){return this.argMinMaxReduce(e,t,"min")},e.prototype.argMax=function(e,t){return this.argMinMaxReduce(e,t,"max")},e.prototype.cumsum=function(e,t,n,r){if(t!==e.rank-1)throw new Error("WebGL cumsum shader expects an inner-most axis="+(e.rank-1)+" but got axis="+t);var i=new fo(e.shape,n,r);return this.compileAndRun(i,[e])},e.prototype.equal=function(e,t){if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(equal(a, b));\n","bool");var n=new Ki("return float(a == b);",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[e,t],r)},e.prototype.notEqual=function(e,t){if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(notEqual(a, b));\n","bool");var n=new Ki("return float(a != b);",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[e,t],r)},e.prototype.less=function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.less(e,t);if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(lessThan(a, b));\n","bool");var n=new Ki("return float(a < b);",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[e,t],r)},e.prototype.lessEqual=function(e,t){if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(lessThanEqual(a, b));\n","bool");var n=new Ki("return float(a <= b);",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[e,t],r)},e.prototype.greater=function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.greater(e,t);if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(greaterThan(a, b));\n","bool");var n=new Ki("return float(a > b);",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[e,t],r)},e.prototype.greaterEqual=function(e,t){if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(greaterThanEqual(a, b));\n","bool");var n=new Ki("return float(a >= b);",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[e,t],r)},e.prototype.logicalNot=function(e){var t=new Pa(e.shape,"return float(!(x >= 1.0));");return this.compileAndRun(t,[e])},e.prototype.logicalAnd=function(e,t){if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n","bool");var n=new Ki("return float(a >= 1.0 && b >= 1.0);",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[e,t],r)},e.prototype.logicalOr=function(e,t){if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n","bool");var n=new Ki("return float(a >= 1.0 || b >= 1.0);",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"bool");return this.compileAndRun(n,[e,t],r)},e.prototype.select=function(e,t,n){var r=new ka(e.rank,t.shape,t.rank),i=this.makeOutputArray(r.outputShape,Ce(t.dtype,n.dtype));return this.compileAndRun(r,[e,t,n],i)},e.prototype.where=function(e){Zt("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");var t=e.dataSync();return bi(e.shape,t)},e.prototype.topk=function(e,t,n){return Or(e.dataSync(),e.shape,e.dtype,t)},e.prototype.min=function(e,t){cn("min",t,e.rank);var n=sn(e.shape,t),r=n[0],i=S(n[1]),o=e.as2D(-1,i);return this.reduce(o,"min",o.dtype).reshape(r)},e.prototype.minimum=function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.minimum(e,t);var n=f.getBool("WEBGL_PACK_BINARY_OPERATIONS")?new $i("\n vec4 result = vec4(min(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Ki("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return min(a, b);\n",e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.mod=function(e,t){var n=f.getBool("WEBGL_PACK_BINARY_OPERATIONS")?new $i("\n vec4 result = mod(a, b);\n vec4 isNaN = vec4(equal(b, vec4(0.0)));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Ki("if (b == 0.0) return NAN;\n return mod(a, b);",e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.max=function(e,t){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.max(e,t);cn("max",t,e.rank);var n=sn(e.shape,t),r=n[0],i=S(n[1]),o=e.as2D(-1,i);return this.reduce(o,"max",o.dtype).reshape(r)},e.prototype.maximum=function(e,t){if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.maximum(e,t);var n=f.getBool("WEBGL_PACK_BINARY_OPERATIONS")?new $i("\n vec4 result = vec4(max(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Ki("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return max(a, b);\n",e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.all=function(e,t){cn("all",t,e.rank);var n=sn(e.shape,t),r=n[0],i=S(n[1]),o=e.as2D(-1,i);return this.reduce(o,"all",o.dtype).reshape(r)},e.prototype.any=function(e,t){cn("any",t,e.rank);var n=sn(e.shape,t),r=n[0],i=S(n[1]),o=e.as2D(-1,i);return this.reduce(o,"any",o.dtype).reshape(r)},e.prototype.squaredDifference=function(e,t){var n=f.getBool("WEBGL_PACK_BINARY_OPERATIONS")?new $i("return (a
1- b) * (a - b);",e.shape,t.shape):new Ki("return (a - b) * (a - b);",e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.realDivide=function(e,t){if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(b.x == 0.0) {\n result.x = NAN;\n } else if(a.x == b.x) {\n result.x = 1.;\n }\n if(b.y == 0.0) {\n result.y = NAN;\n } else if(a.y == b.y) {\n result.y = 1.;\n }\n if(b.z == 0.0) {\n result.z = NAN;\n } else if(a.z == b.z) {\n result.z = 1.;\n }\n if(b.w == 0.0) {\n result.w = NAN;\n } else if(a.w == b.w) {\n result.w = 1.;\n }\n \n return result;\n","float32",!0);var n=new Ki("\nif (b == 0.0) {\n return NAN;\n} \nif (a == b) {\n return 1.0;\n};\nreturn a / b;",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"float32");return this.compileAndRun(n,[e,t],r)},e.prototype.floorDiv=function(e,t){if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n","int32");var n=new Ki("\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",e.shape,t.shape),r=this.makeOutputArray(n.outputShape,"int32");return this.compileAndRun(n,[e,t],r)},e.prototype.add=function(e,t){if("complex64"===e.dtype&&"complex64"===t.dtype)return this.complexSeparableBinaryOp(e,t,qi);if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.add(e,t);var n=Ce(e.dtype,t.dtype);if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,qi,n);var r=new Ki(qi,e.shape,t.shape),i=this.makeOutputArray(r.outputShape,n);return this.compileAndRun(r,[e,t],i)},e.prototype.packedBinaryOp=function(e,t,n,r,i){void 0===i&&(i=!1);var o=new $i(n,e.shape,t.shape,i),a=this.makePackedTensor(o.outputShape,r);return this.compileAndRun(o,[e,t],a)},e.prototype.complexSeparableBinaryOp=function(e,t,n){var r=this,i=this.texData.get(e.dataId),o=this.texData.get(t.dataId),a=[[i.complexTensors.real,o.complexTensors.real],[i.complexTensors.imag,o.complexTensors.imag]].map(function(i){var o=i[0],a=i[1],s=r.makeComplexComponentTensorHandle(e,o),u=r.makeComplexComponentTensorHandle(t,a),c=new Ki(n,e.shape,t.shape),l=r.makeOutputArray(c.outputShape,Ce(o.dtype,a.dtype));return r.compileAndRun(c,[s,u],l)}),s=a[0],u=a[1],c=this.complex(s,u);return s.dispose(),u.dispose(),c},e.prototype.makeComplexComponentTensorHandle=function(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}},e.prototype.addN=function(e){if(1===e.length)return e[0];if(e.length>f.get("WEBGL_MAX_TEXTURES_IN_SHADER")){var t=Math.floor(e.length/2),n=this.addN(e.slice(0,t)),r=this.addN(e.slice(t));return this.addN([n,r])}var i=e.map(function(e){return e.dtype}).reduce(function(e,t){return Ce(e,t)}),o=e.map(function(e){return e.shape}),a=f.getBool("WEBGL_PACK"),s=a?new xi(e[0].shape,o):new wi(e[0].shape,o),u=a?this.makePackedTensor(s.outputShape,i):this.makeOutputArray(s.outputShape,i);return this.compileAndRun(s,e,u)},e.prototype.subtract=function(e,t){if("complex64"===e.dtype&&"complex64"===t.dtype)return this.complexSeparableBinaryOp(e,t,Hi);if(this.shouldExecuteOnCPU([e,t]))return this.cpuBackend.subtract(e,t);var n=Ce(e.dtype,t.dtype);if(f.getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(e,t,Hi,e.dtype);var r=new Ki(Hi,e.shape,t.shape),i=this.makeOutputArray(r.outputShape,n);return this.compileAndRun(r,[e,t],i)},e.prototype.pow=function(e,t){var n=f.getBool("WEBGL_PACK_BINARY_OPERATIONS"),r=n?new $i("\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Ki("\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nreturn (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",e.shape,t.shape),i=Ce(e.dtype,t.dtype),o=n?this.makePackedTensor(r.outputShape,i):this.makeOutputArray(r.outputShape,i);return this.compileAndRun(r,[e,t],o)},e.prototype.ceil=function(e){var t=new Pa(e.shape,"return ceil(x);");return this.compileAndRun(t,[e])},e.prototype.floor=function(e){var t=new Pa(e.shape,"return floor(x);");return this.compileAndRun(t,[e])},e.prototype.sign=function(e){var t=new Pa(e.shape,"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n");return this.compileAndRun(t,[e])},e.prototype.isNaN=function(e){var t=new Pa(e.shape,"return float(isnan(x));"),n=this.makeOutputArray(t.outputShape,"bool");return this.compileAndRun(t,[e],n)},e.prototype.isInf=function(e){var t=new Pa(e.shape,"return float(isinf(x));"),n=this.makeOutputArray(t.outputShape,"bool");return this.compileAndRun(t,[e],n)},e.prototype.isFinite=function(e){var t=new Pa(e.shape,"return float(!isnan(x) && !isinf(x));"),n=this.makeOutputArray(t.outputShape,"bool");return this.compileAndRun(t,[e],n)},e.prototype.round=function(e){var t=new Pa(e.shape,"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n");return this.compileAndRun(t,[e])},e.prototype.exp=function(e){var t;return t=f.getBool("WEBGL_PACK")?new Ua(e.shape,Ba):new Pa(e.shape,Ba),this.compileAndRun(t,[e])},e.prototype.expm1=function(e){var t=new Pa(e.shape,"return exp(x) - 1.0;");return this.compileAndRun(t,[e])},e.prototype.log=function(e){var t;return t=f.getBool("WEBGL_PACK")?new Ua(e.shape,"\n vec4 result = log(x);\n vec4 isNaN = vec4(lessThan(x, vec4(0.0)));\n result.r = isNaN.r == 1.0 ? NAN : result.r;\n result.g = isNaN.g == 1.0 ? NAN : result.g;\n result.b = isNaN.b == 1.0 ? NAN : result.b;\n result.a = isNaN.a == 1.0 ? NAN : result.a;\n\n return result;\n"):new Pa(e.shape,"if (x < 0.0) return NAN;\n return log(x);"),this.compileAndRun(t,[e])},e.prototype.log1p=function(e){var t=new Pa(e.shape,"return log(1.0 + x);");return this.compileAndRun(t,[e])},e.prototype.sqrt=function(e){var t=new Pa(e.shape,"return sqrt(x);");return this.compileAndRun(t,[e])},e.prototype.rsqrt=function(e){if(this.shouldExecuteOnCPU([e]))return this.cpuBackend.rsqrt(e);var t=new Pa(e.shape,"return inversesqrt(x);");return this.compileAndRun(t,[e])},e.prototype.square=function(e){var t=new Pa(e.shape,"return x * x;");return this.compileAndRun(t,[e])},e.prototype.reciprocal=function(e){var t=new Pa(e.shape,"return 1.0 / x;");return this.compileAndRun(t,[e])},e.prototype.relu=function(e){var t;return t=f.getBool("WEBGL_PACK")?new Ua(e.shape,Fa):new Pa(e.shape,La),this.compileAndRun(t,[e])},e.prototype.prelu=function(e,t){var n=f.getBool("WEBGL_PACK_BINARY_OPERATIONS")?new $i("\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));
1\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",e.shape,t.shape):new Ki("return (a < 0.) ? b * a : a;",e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.elu=function(e){var t=new Pa(e.shape,"return (x >= 0.0) ? x : (exp(x) - 1.0);");return this.compileAndRun(t,[e])},e.prototype.eluDer=function(e,t){var n=f.getBool("WEBGL_PACK_BINARY_OPERATIONS")?new $i("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",e.shape,t.shape):new Ki("return (b >= 1.0) ? a : a * (b + 1.0);",e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.selu=function(e){var t=new Pa(e.shape,"\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = 1.7580993408473768;\n float scale = 1.0507009873554805;\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n");return this.compileAndRun(t,[e])},e.prototype.int=function(e){var t=new Pa(e.shape,"return float(int(x));"),n=this.makeOutputArray(t.outputShape,"int32");return this.compileAndRun(t,[e],n)},e.prototype.clip=function(e,t,n){var r,i=(r=f.getBool("WEBGL_PACK_CLIP")?new Yi(e.shape):new Xi(e.shape)).getCustomSetupFunc(t,n);return this.compileAndRun(r,[e],null,i)},e.prototype.abs=function(e){var t=new Pa(e.shape,"return abs(x);");return this.compileAndRun(t,[e])},e.prototype.complexAbs=function(e){var t=this.texData.get(e.dataId),n=new Ji(e.shape),r=[this.makeComplexComponentTensorHandle(e,t.complexTensors.real),this.makeComplexComponentTensorHandle(e,t.complexTensors.imag)];return this.compileAndRun(n,r)},e.prototype.sigmoid=function(e){var t=new Pa(e.shape,"return 1.0 / (1.0 + exp(-1.0 * x));");return this.compileAndRun(t,[e])},e.prototype.softplus=function(e){var t=new Pa(e.shape,"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n");return this.compileAndRun(t,[e])},e.prototype.sin=function(e){var t=new Pa(e.shape,"if (isnan(x)) return x;\n return sin(x);\n");return this.compileAndRun(t,[e])},e.prototype.cos=function(e){var t=new Pa(e.shape,"if (isnan(x)) return x;\n return cos(x);\n");return this.compileAndRun(t,[e])},e.prototype.tan=function(e){var t=new Pa(e.shape,"return tan(x);");return this.compileAndRun(t,[e])},e.prototype.asin=function(e){var t=new Pa(e.shape,"return asin(x);");return this.compileAndRun(t,[e])},e.prototype.acos=function(e){var t=new Pa(e.shape,"return acos(x);");return this.compileAndRun(t,[e])},e.prototype.atan=function(e){var t=new Pa(e.shape,"if (isnan(x)) return x;\n return atan(x);\n");return this.compileAndRun(t,[e])},e.prototype.atan2=function(e,t){var n=f.getBool("WEBGL_PACK_BINARY_OPERATIONS")?new $i("\n vec4 result = atan(a, b);\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",e.shape,t.shape):new Ki("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return atan(a, b);\n",e.shape,t.shape);return this.compileAndRun(n,[e,t])},e.prototype.sinh=function(e){var t=new Pa(e.shape,"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n");return this.compileAndRun(t,[e])},e.prototype.cosh=function(e){var t=new Pa(e.shape,"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n");return this.compileAndRun(t,[e])},e.prototype.tanh=function(e){var t=new Pa(e.shape,"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n");return this.compileAndRun(t,[e])},e.prototype.asinh=function(e){var t=new Pa(e.shape,"return log(x + sqrt(x * x + 1.0));");return this.compileAndRun(t,[e])},e.prototype.acosh=function(e){var t=new Pa(e.shape,"if (isnan(x)) return x;\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));");return this.compileAndRun(t,[e])},e.prototype.atanh=function(e){var t=new Pa(e.shape,"if (isnan(x)) return x;\n if ((x < -1.0) || (x > 1.0)) return NAN;
1\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;");return this.compileAndRun(t,[e])},e.prototype.erf=function(e){var t=new Pa(e.shape,'\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = 0.3275911;\n float a1 = 0.254829592;\n float a2 = -0.284496736;\n float a3 = 1.421413741;\n float a4 = -1.453152027;\n float a5 = 1.061405429;\n\n float t = 1.0 / (1.0 + p * x);\n return 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);\n');return this.compileAndRun(t,[e])},e.prototype.step=function(e,t){var n=new Pa(e.shape,function(e){return void 0===e&&(e=0),za+"\n return x > 0.0 ? 1.0 : float("+e+");\n "}(t));return this.compileAndRun(n,[e])},e.prototype.conv2dByMatMul=function(e,t,n){var r=e.shape,i=this.texData.get(e.dataId),o=n.inChannels,a=r[0]*r[1]*r[2],s=n.outChannels,u=(1===a||1===s)&&o>1e3,c=r[2]%2!=0&&!!i.isPacked;if(u||!f.getBool("WEBGL_LAZILY_UNPACK")||!f.getBool("WEBGL_PACK_BINARY_OPERATIONS")||!c){var l=this.reshape(e,[1,r[0]*r[1]*r[2],n.inChannels]),h=this.reshape(t,[1,n.inChannels,n.outChannels]);return this.reshape(this.batchMatMul(l,h,!1,!1),n.outShape)}var d=ve.make([1,r[0]*r[1]*(r[2]+1),n.inChannels],{dataId:e.dataId},e.dtype,this),p=i.shape;i.shape=i.shape.slice(),i.shape[i.shape.length-2]++,w(xt(i.shape,d.shape),function(){return"packed reshape "+i.shape+" to "+d.shape+" isn't free"});var m=this.reshape(t,[1,n.inChannels,n.outChannels]),v=this.batchMatMul(d,m,!1,!1),g=this.texData.get(v.dataId);return w(g.isPacked,function(){return"batchMatMul result is expected to be packed"}),i.shape=p,g.shape=n.outShape,ve.make(n.outShape,{dataId:v.dataId},v.dtype,this)},e.prototype.conv2dWithIm2Row=function(e,t,n){var r=n.filterWidth,i=n.filterHeight,o=n.inChannels,a=n.outWidth,s=n.outHeight,u=r*i*o,c=s*a,l=[u,c],f=e.squeeze([0]),h=t.reshape([1,u,-1]),d=new ea(l,f.shape,n),p=this.compileAndRun(d,[f]).reshape([1,l[0],l[1]]),m=new oa(p.shape,[1,c,n.outChannels],!0,!1);return this.compileAndRun(m,[p,h]).reshape([1,s,a,n.outChannels])},e.prototype.conv2d=function(e,t,n){if(1===n.filterHeight&&1===n.filterWidth&&1===n.dilationHeight&&1===n.dilationWidth&&1===n.strideHeight&&1===n.strideWidth&&("SAME"===n.padInfo.type||"VALID"===n.padInfo.type))return this.conv2dByMatMul(e,t,n);if(f.getBool("WEBGL_CONV_IM2COL")&&1===e.shape[0])return this.conv2dWithIm2Row(e,t,n);var r=new ao(n);return this.compileAndRun(r,[e,t])},e.prototype.conv2dDerInput=function(e,t,n){var r=new to(n);return this.compileAndRun(r,[e,t])},e.prototype.conv2dDerFilter=function(e,t,n){var r=new eo(n);return this.compileAndRun(r,[e,t])},e.prototype.depthwiseConv2D=function(e,t,n){var r;return f.getBool("WEBGL_PACK_DEPTHWISECONV")&&n.strideWidth<=2&&n.outChannels/n.inChannels==1?(r=new co(n),this.compileAndRun(r,[e,t],this.makePackedTensor(n.outShape,e.dtype))):(r=new uo(n),this.compileAndRun(r,[e,t]))},e.prototype.depthwiseConv2DDerInput=function(e,t,n){var r=new oo(n);return this.compileAndRun(r,[e,t])},e.prototype.depthwiseConv2DDerFilter=function(e,t,n){var r=new io(n);return this.compileAndRun(r,[e,t])},e.prototype.conv3d=function(e,t,n){var r=new so(n);return this.compileAndRun(r,[e,t])},e.prototype.conv3dDerInput=function(e,t,n){var r=new ro(n);return this.compileAndRun(r,[e,t])},e.prototype.conv3dDerFilter=function(e,t,n){var r=new no(n);return this.compileAndRun(r,[e,t])},e.prototype.maxPool=function(e,t){var n=new fa(t,"max",!1),r=this.makeOutputArray(n.outputShape,e.dtype);return this.compileAndRun(n,[e],r)},e.prototype.avgPool=function(e,t){var n=new fa(t,"avg",!1),r=this.makeOutputArray(n.outputShape,"float32");return this.compileAndRun(n,[e],r)},e.prototype.maxPoolBackprop=function(e,t,n,r){var i=new fa(r,"max",!0),o=this.compileAndRun(i,[t]),a=new ia(r),s=this.makeOutputArray(a.outputShape,t.dtype),u=this.compileAndRun(a,[e,o],s);return o.dispose(),u},e.prototype.avgPoolBackprop=function(e,t,n){var r=new Fi(n),i=this.makeOutputArray(r.outputShape,t.dtype);return this.compileAndRun(r,[e],i)},e.prototype.cast=function(e,t){return gr(e,t,this)},e.prototype.unstack=function(e,t){for(var n=e.shape[t],r=new Array(e.rank-1),i=0,o=0;o<e.rank;o++)o!==t&&(r[i++]=e.shape[o]);var a=new Array(e.rank).fill(0),s=e.shape.slice();s[t]=1;var u=new Array(n);for(o=0;o<u.length;o++)a[t]=o,u[o]=this.slice(e,a,s).reshape(r);return u},e.prototype.reshape=function(e,t){var n=this.texData.get(e.dataId);return!n.isPacked||xt(e.shape,t)||null!==n.texture&&xt(n.shape,t)?yr(e,t):this.packedReshape(e,t)},e.prototype.resizeBilinear=function(e,t,n,r){var i=f.getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new va(e.shape,t,n,r):new ma(e.shape,t,n,r);return this.compileAndRun(i,[e])},e.prototype.resizeBilinearBackprop=function(e,t,n){var r=new pa(e,t,n
1);return this.compileAndRun(r,[e])},e.prototype.resizeNearestNeighbor=function(e,t,n,r){var i=new ya(e.shape,t,n,r);return this.compileAndRun(i,[e])},e.prototype.resizeNearestNeighborBackprop=function(e,t,n){var r=new ga(e,t,n);return this.compileAndRun(r,[e])},e.prototype.multinomial=function(e,t,n,r){var i=t?e:Pn(e),o=i.shape[0],a=i.shape[1],s=new aa(o,a,n),u=this.makeOutputArray(s.outputShape,"int32"),c=s.getCustomSetupFunc(r);return this.compileAndRun(s,[i],u,c)},e.prototype.oneHot=function(e,t,n,r){var i=new sa(e.size,t,n,r);return this.compileAndRun(i,[e])},e.prototype.nonMaxSuppression=function(e,t,n,r,i){return Zt("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"),Er(e.dataSync(),t.dataSync(),n,r,i)},e.prototype.cropAndResize=function(e,t,n,r,i,o){var a=new lo(e.shape,t.shape,r,i,o);return this.compileAndRun(a,[e,t,n])},e.prototype.depthToSpace=function(e,t,n){w(t>1,function(){return"blockSize should be > 1 for depthToSpace, but was: "+t});var r=e.shape[0],i="NHWC"===n?e.shape[1]:e.shape[2],o="NHWC"===n?e.shape[2]:e.shape[3],a="NHWC"===n?e.shape[3]:e.shape[1],s=i*t,u=o*t,c=a/(t*t),l=new vo("NHWC"===n?[r,s,u,c]:[r,c,s,u],t,n);return this.compileAndRun(l,[e])},e.prototype.split=function(e,t,n){return Nr(e,t,n)},e.prototype.scatterND=function(e,t,n){var r=yn(0,e,n),i=r.sliceRank,o=r.numUpdates,a=r.sliceSize,s=r.strides,u=r.outputSize,c=[u/a,a],l=e.reshape([o,i]),f=t.reshape([o,a]);if(0===u)return yr(Un([]),n);var h=Wn(0),d=new xa(o,i,l.rank,f.rank,s,c);return this.compileAndRun(d,[f,l,h]).reshape(n)},e.prototype.sparseToDense=function(e,t,n,r){var i=yn(0,e,n),o=i.sliceRank,a=i.numUpdates,s=i.strides,u=i.outputSize,c=new xa(a,o,e.rank,t.rank,s,[u,1],!1);return this.compileAndRun(c,[t,e,r]).reshape(n)},e.prototype.fft=function(e){return this.fftImpl(e,!1)},e.prototype.ifft=function(e){return this.fftImpl(e,!0)},e.prototype.fftImpl=function(e,t){var n=this.texData.get(e.dataId),r=new wo("return real * expR - imag * expI;",e.shape,t),i=new wo("return real * expI + imag * expR;",e.shape,t),o=[this.makeComplexComponentTensorHandle(e,n.complexTensors.real),this.makeComplexComponentTensorHandle(e,n.complexTensors.imag)],a=this.compileAndRun(r,o),s=this.compileAndRun(i,o),u=this.complex(a,s).as2D(e.shape[0],e.shape[1]);return a.dispose(),s.dispose(),u},e.prototype.gatherND=function(e,t){var n=t.shape,r=n[n.length-1],i=mn(e,t),o=i[0],a=i[1],s=i[2],u=i[3],c=t.reshape([a,r]),l=e.reshape([e.size/s,s]),f=new Eo(r,u,[a,s]);return this.compileAndRun(f,[l,c]).reshape(o)},e.prototype.fill=function(e,t,n){if("string"===(n=n||G(t))){var r=j(n,S(e));return r.fill(t),ve.make(e,{values:r},n)}var i=new xo(e,t),o=i.getCustomSetupFunc(t),a=this.makeOutputArray(e,n);return this.compileAndRun(i,[],a,o)},e.prototype.onesLike=function(e){if("string"===e.dtype)throw new Error("onesLike is not supported under string dtype");return this.fill(e.shape,1,e.dtype)},e.prototype.zerosLike=function(e){return this.fill(e.shape,"string"===e.dtype?"":0,e.dtype)},e.prototype.linspace=function(e,t,n){return br(e,t,n)},e.prototype.makeOutputArray=function(e,t){return ve.make(e,{},t,this)},e.prototype.makePackedTensor=function(e,t){var n=ve.make(e,{},t,this);return this.texData.get(n.dataId).isPacked=!0,n},e.prototype.unpackTensor=function(e){var t=new Wa(e.shape);return this.compileAndRun(t,[e],ve.make(t.outputShape,{},e.dtype,this))},e.prototype.packTensor=function(e){var t=new ua(e.shape);return this.compileAndRun(t,[e],this.makePackedTensor(e.shape,e.dtype))},e.prototype.packedReshape=function(e,t){var n=e.reshape([gt(e.shape)].concat(yt(e.shape))),r=[gt(t)].concat(yt(t)),i=new da(r,n.shape);return this.compileAndRun(i,[n]).reshape(t)},e.prototype.compileAndRun=function(e,t,n,r){var i=this;if(null==n&&(n=e.usesPackedTextures?this.makePackedTensor(e.outputShape,t[0].dtype):this.makeOutputArray(e.outputShape,t[0].dtype)),0===n.size)return this.texData.get(n.dataId).values=D(n.dtype,0),n;var o=t.map(function(t){if("complex64"===t.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");var n=i.texData.get(t.dataId);if(null==n.texture){if(!e.usesPackedTextures&&S(t.shape)<=f.getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.usesPackedTextures&&(n.isPacked=!0,n.shape=t.shape)}else if(!!n.isPacked!=!!e.usesPackedTextures)t=n.isPacked?i.unpackTensor(t):i.packTensor(t),n=i.texData.get(t.dataId);else if(n.isPacked&&!xt(n.shape,t.shape)){var r=t,o=t.shape;t.shape=n.shape,t=i.packedReshape(t,o),n=i.texData.get(t.dataId),r.shape=o}return i.uploadToGPU(t.dataId),{shape:t.shape,texData:n,isUniform:!1}});this.uploadToGPU(n.dataId);var a,s={shape:n.shape,texData:this.texData.get(n.dataId),isUniform:!1},u=function(e,t,n){var r="";
1o.concat(n).forEach(function(e){var t=null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0,n=e.isUniform?"uniform":e.texData.texShape;r+=e.shape+"_"+n+"_"+t});var i=e.userCode;return e.constructor.name+"_"+r+"_"+i}(e,0,s),c=this.getAndSaveBinary(u,function(){return function(e,t,n,r){var i=t.userCode,o=n.map(function(e,n){var r={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(r.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:r}}),a=o.map(function(e){return e.shapeInfo}),s={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},u=Ai(o,s,i,t.usesPackedTextures),c=e.createProgram(u),l=null,h=e.getUniformLocation(c,"NAN",!1);1===f.getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(c,"INFINITY",!1));for(var d={},p=0;p<t.variableNames.length;p++){var m=t.variableNames[p];d[m]=e.getUniformLocation(c,m,!1),d["offset"+m]=e.getUniformLocation(c,"offset"+m,!1)}return{program:t,source:u,webGLProgram:c,uniformLocations:d,inShapeInfos:a,outShapeInfo:s,infLoc:l,nanLoc:h}}(i.gpgpu,e,o,s)}),l=null!=this.activeTimers;return l&&(a=this.startTimer()),function(e,t,n,r,i){Qo(t.inShapeInfos,n),Qo([t.outShapeInfo],[r]);var o=r.texData.texture,a=r.texData.texShape;r.texData.isPacked?e.setOutputPackedMatrixTexture(o,a[0],a[1]):e.setOutputMatrixTexture(o,a[0],a[1]),e.setProgram(t.webGLProgram),1===f.getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN),n.forEach(function(n,r){var i=t.program.variableNames[r],o=t.uniformLocations[i],a=t.uniformLocations["offset"+i];if(null!=o)if(n.isUniform)if(S(n.shape)<2)e.gl.uniform1f(o,n.uniformValues[0]);else{var s=n.uniformValues;s instanceof Float32Array||(s=new Float32Array(s)),e.gl.uniform1fv(o,s)}else null!=n.texData.slice&&null!=a&&e.gl.uniform1i(a,n.texData.slice.flatOffset),e.setInputMatrixTexture(n.texData.texture,o,r)}),null!=i&&i(e,t.webGLProgram),e.executeProgram()}(this.gpgpu,c,o,s,r),l&&(a=this.endTimer(a),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(a)})),f.getBool("WEBGL_LAZILY_UNPACK")||!this.texData.get(n.dataId).isPacked||e.isPackShader?n:this.unpackTensor(n)},e.prototype.getAndSaveBinary=function(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]},e.prototype.getTextureManager=function(){return this.textureManager},e.prototype.dispose=function(){this.disposed||(this.textureManager.dispose(),this.canvas.remove(),null!=this.fromPixels2DContext&&this.fromPixels2DContext.canvas.remove(),this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)},e.prototype.floatPrecision=function(){var e=this;return null==this.floatPrecisionValue&&(this.floatPrecisionValue=Bt(function(){var t=f.getBool("DEBUG");f.set("DEBUG",!1);var n=e.abs(Wn(1e-8)).dataSync()[0];return f.set("DEBUG",t),n>0?32:16})),this.floatPrecisionValue},e.prototype.epsilon=function(){return 32===this.floatPrecision()?1e-7:1e-4},e.prototype.uploadToGPU=function(e){var t,n=this.texData.get(e),r=n.shape,i=n.dtype,o=n.values,a=n.texture,s=n.usage,u=n.isPacked;if(null==a){var c,l=null!=this.activeTimers;l&&(c=performance.now());var f=bt(r,u);if(n.texShape=f,null!=o){var h=[1,1,1];0===r.length||1===r.length&&1===r[0]||(h=[gt(r)].concat(yt(r)));var d=void 0,p=f[1],m=f[0];u?(p=(t=Ao(f[0],f[1]))[0],m=t[1],d=new bo(h,[m,p])):d=new yo(h,[m,p]);var v=this.makeTensorHandle([m,p],i);this.texData.get(v.dataId).usage=po.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(v.dataId),p,m,o);var g=this.makeTensorHandle(d.outputShape,v.dtype);g.size=S(d.outputShape),this.texData.get(g.dataId).isPacked=u,this.compileAndRun(d,[v],g);var y=this.texData.get(g.dataId);n.texture=y.texture,n.texShape=y.texShape,n.isPacked=y.isPacked,n.usage=y.usage,this.disposeData(v.dataId),this.texData.delete(g.dataId),n.values=null,l&&(this.uploadWaitMs+=performance.now()-c)}else{var b=this.acquireTexture(f,s,i,u);n.texture=b}}},e.prototype.convertAndCacheOnCPU=function(e,t){var n=this.texData.get(e),r=n.dtype;return this.releaseGPUData(e),null!=t&&(n.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){for(var n="int32"===t?new Int32Array(e.length):new Uint8Array(e.length),r=0;r<n.length;++r)n[r]=Math.round(e[r]);return n}throw new Error("Unknown dtype "+t)}(t,r)),n.values},e.prototype.acquireTexture=function(e,t,n,r){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){var i=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn("High memory usage in GPU: "+i+" MB, most likely due to a memory leak")}return this.textureManager.acquireTexture(e,t,r)},e.prototype.computeBytes=function(e,t){return e[0]*e[1]*U(t)},e}();Pe()&&je.registerBackend("webgl",function(){return new Ha},2);var Ga=jn({abs_:function(e){var t=Cn(e,"x","abs");return"complex64"===t.dtype?je.runKernel(function(e){return e.complexAbs(t)},{$x:t}):je.runKernel(function(e,n){var r=e.abs(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];
1return{$x:function(){return e.mul(n.toFloat().step(-1))}}})}}),Ka=jn({acos_:function(e){var t=Cn(e,"x","acos");return je.runKernel(function(e,n){var r=e.acos(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.divStrict(Wn(1).sub(n.toFloat().square()).sqrt()).neg()}}})}}),$a=jn({acosh_:function(e){var t=Cn(e,"x","acosh");return je.runKernel(function(e,n){var r=e.acosh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.divStrict(n.toFloat().square().sub(1).sqrt())}}})}}),Xa=jn({asin_:function(e){var t=Cn(e,"x","asin");return je.runKernel(function(e,n){var r=e.asin(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.divStrict(Wn(1).sub(n.toFloat().square()).sqrt())}}})}}),Ya=jn({asinh_:function(e){var t=Cn(e,"x","asinh");return je.runKernel(function(e,n){var r=e.asinh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.divStrict(Wn(1).add(n.toFloat().square()).sqrt())}}})}}),Ja=jn({atan_:function(e){var t=Cn(e,"x","atan");return je.runKernel(function(e,n){var r=e.atan(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.toFloat().square().add(1))}}})}}),Za=jn({atanh_:function(e){var t=Cn(e,"x","atanh");return je.runKernel(function(e,n){var r=e.atanh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(Wn(1).sub(n.toFloat().square()))}}})}}),Qa=jn({ceil_:function(e){var t=Cn(e,"x","ceil");return je.runKernel(function(e){return e.ceil(t)},{$x:t},function(e){return{$x:function(){return tr(e)}}})}}),es=jn({clipByValue_:function(e,t,n){var r=Cn(e,"x","clipByValue");return w(t<=n,function(){return"Error in clip: min ("+t+") must be less than or equal to max ("+n+")."}),je.runKernel(function(e,i){var o=e.clip(r,t,n);return i([r]),o},{$x:r},function(e,r){var i=r[0];return{$x:function(){return e.where(i.greaterEqual(t).logicalAnd(i.lessEqual(n)),tr(e))}}})}}),ts=jn({cos_:function(e){var t=Cn(e,"x","cos");return je.runKernel(function(e,n){var r=e.cos(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];
vendor: 8,581 bytes, line 1
1return{$x:function(){return n.toFloat().sin().neg().mul(e)}}})}}),ns=jn({cosh_:function(e){var t=Cn(e,"x","cosh");return je.runKernel(function(e,n){var r=e.cosh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return n.toFloat().sinh().mulStrict(e)}}})}}),rs=jn({erf_:function(e){var t=Cn(e,"x","erf");return w("int32"===t.dtype||"float32"===t.dtype,function(){return"Input dtype must be `int32` or `float32`."}),"int32"===t.dtype&&(t=t.toFloat()),je.runKernel(function(e,n){var r=e.erf(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.square().neg().exp().mul(2/Math.sqrt(Math.PI)))}}})}}),is=jn({exp_:function(e){var t=Cn(e,"x","exp");return je.runKernel(function(e,n){var r=e.exp(t);return n([r]),r},{$x:t},function(e,t){return{$x:function(){return e.mulStrict(t[0])}}})}}),os=jn({expm1_:function(e){var t=Cn(e,"x","expm1");return je.runKernel(function(e,n){var r=e.expm1(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.exp())}}})}}),as=jn({floor_:function(e){var t=Cn(e,"x","floor");return je.runKernel(function(e){return e.floor(t)},{$x:t},function(e){return{$x:function(){return tr(e)}}})}}),ss=jn({log_:function(e){var t=Cn(e,"x","log");return je.runKernel(function(e,n){var r=e.log(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.toFloat())}}})}}),us=jn({log1p_:function(e){var t=Cn(e,"x","log1p");return je.runKernel(function(e,n){var r=e.log1p(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.add(1))}}})}}),cs=jn({logSigmoid_:function(e){var t=Cn(e,"x","logSigmoid");return je.runKernel(function(e,n){var r=e.softplus(t.neg()).neg();return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.neg().sigmoid())}}})}}),ls=jn({neg_:function(e){var t=Cn(e,"x","neg");return je.runKernel(function(e){return e.neg(t)},{$x:t},function(e){return{$x:function(){return e.neg()}}})}}),fs=jn({reciprocal_:function(e){var t=Cn(e,"x","reciprocal");return je.runKernel(function(e,n){var r=e.reciprocal(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.square().neg())}}})}}),hs=jn({round_:function(e){var t=Cn(e,"x","round");return je.runKernel(function(e){return e.round(t)},{$x:t},function(e){return{$x:function(){return tr(e)}}})}}),ds=jn({rsqrt_:function(e){var t=Cn(e,"x","rsqrt");return je.runKernel(function(e,n){var r=e.rsqrt(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.pow(1.5).mul(2)).neg()}}})}}),ps=jn({sigmoid_:function(e){var t=Cn(e,"x","sigmoid");return je.runKernel(function(e,n){var r=e.sigmoid(t);return n([r]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.mul(Wn(1).sub(n)))}}})}}),ms=jn({sign_:function(e){var t=Cn(e,"x","sign");return je.runKernel(function(e){return e.sign(t)},{$x:t},function(e){return{$x:function(){return tr(e)}}})}}),vs=jn({isNaN_:function(e){var t=Cn(e,"x","isNaN");return je.runKernel(function(e){return e.isNaN(t)},{$x:t},function(e){return{$x:function(){return tr(e)}}})}}),gs=jn({isInf_:function(e){var t=Cn(e,"x","isInf");return je.runKernel(function(e){return e.isInf(t)},{$x:t},function(e){return{$x:function(){return tr(e)}}})}}),ys=jn({isFinite_:function(e){var t=Cn(e,"x","isFinite");return je.runKernel(function(e){return e.isFinite(t)},{$x:t},function(e){return{$x:function(){return tr(e)}}})}}),bs=jn({sin_:function(e){var t=Cn(e,"x","sin");return je.runKernel(function(e,n){var r=e.sin(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return n.toFloat().cos().mul(e)}}})}}),ws=jn({sinh_:function(e){var t=Cn(e,"x","sinh");return je.runKernel(function(e,n){var r=e.sinh(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return n.toFloat().cosh().mulStrict(e)}}})}}),xs=jn({softplus_:function(e){var t=Cn(e,"x","softplus");return je.runKernel(function(e,n){var r=e.softplus(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.sigmoid())}}})}}),_s=jn({sqrt_:function(e){var t=Cn(e,"x","sqrt");return je.runKernel(function(e,n){var r=e.sqrt(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.toFloat().sqrt().mul(2))}}})}}),ks=jn({square_:function(e){var t=Cn(e,"x","square");return je.runKernel(function(e,n){return n([t]),e.square(t)},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mul(n.toFloat().mul(2))}}})}}),Ss=jn({step_:function(e,t){void 0===t&&(t=0);var n=Cn(e,"x","step");return je.runKernel(function(e){return e.step(n,t)},{$x:n},function(e){return{$x:function(){return tr(e)}}})}}),Es=jn({tan_:function(e){var t=Cn(e,"x","tan");return je.runKernel(function(e,n){var r=e.tan(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.div(n.cos().square())}}})}}),Cs=jn({tanh_:function(e){var t=Cn(e,"x","tanh");return je.runKernel(function(e,n){var r=e.tanh(t);return n([r]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return Wn(1).sub(n.square()).mulStrict(e)}}})}});function Ns(e,t,n,r,i,o){var a,s,u=Cn(e,"x","batchNorm"),c=Cn(t,"mean","batchNorm"),l=Cn(n,"variance","batchNorm");return null!=i&&(a=Cn(i,"scale","batchNorm")),null!=r&&(s=Cn(r,"offset","batchNorm")),w(2===u.rank,function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+u.rank+"."}),w(2===c.rank||1===c.rank,function(){return"Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank "+c.rank+"."}),w(2===l.rank||1===l.rank,function(){return"Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank "+l.rank+"."}),null!=a&&w(2===a.rank||1===a.rank,function(){return"Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank "+a.rank+"."}),null!=s&&w(2===s.rank||1===s.rank,function(){return"Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank "+s.rank+"."}),Ts(u,c,l,s,a,o)}function Os(e,t,n,r,i,o){var a,s,u=Cn(e,"x","batchNorm"),c=Cn(t,"mean","batchNorm"),l=Cn(n,"variance","batchNorm");return null!=i&&(a=Cn(i,"scale","batchNorm")),null!=r&&(s=Cn(r,"offset","batchNorm")),w(3===u.rank,function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+u.rank+"."}),w(3===c.rank||1===c.rank,function(){return"Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank "+c.rank+"."}),w(3===l.rank||1===l.rank,function(){return"Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank "+l.rank+"."}),null!=a&&w(3===a.rank||1===a.rank,function(){return"Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank "+a.rank+"."}),null!=s&&w(3===s.rank||1===s.rank,function(){return"Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank "+s.rank+"."}),Ts(u,c,l,s,a,o)}function As(e,t,n,r,i,o){var a,s,u=Cn(e,"x","batchNorm"),c=Cn(t,"mean","batchNorm"),l=Cn(n,"variance","batchNorm");return null!=i&&(a=Cn(i,"scale","batchNorm")),null!=r&&(s=Cn(r,"offset","batchNorm")),w(4===u.rank,function(){return"Error in batchNorm4D: x must be rank 4 but got rank "+u.rank+"."}),w(4===c.rank||1===c.rank,function(){return"Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank "+c.rank+"."}),w(4===l.rank||1===l.rank,function(){return"Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank "+l.rank+"."}),null!=a&&w(4===a.rank||1===a.rank,function(){return"Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank "+a.rank+"."}),null!=s&&w(4===s.rank||1===s.rank,function(){return"Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank "+s.rank+"."}),Ts(u,c,l,s,a,o)}function Ts(e,t,n,r,i,o){null==o&&(o=.001);var a,s,u,c=Cn(e,"x","batchNorm"),l=Cn(t,"mean","batchNorm"),f=Cn(n,"variance","batchNorm");return null!=i&&(a=Cn(i,"scale","batchNorm")),null!=r&&(s=Cn(r,"offset","batchNorm")),w(l.rank===f.rank,function(){return"Batch normalization gradient requires mean and variance to have equal ranks."}),w(null==s||l.rank===s.rank,function(){return"Batch normalization gradient requires mean and offset to have equal ranks."}),w(null==a||l.rank===a.rank,function(){return"Batch normalization gradient requires mean and scale to have equal ranks."}),u=0===c.rank||1===c.rank?c.as4D(1,1,1,c.size):2===c.rank?c.as4D(1,1,c.shape[0],c.shape[1]):3===c.rank?c.as4D(1,c.shape[0],c.shape[1],c.shape[2]):c,je.runKernel(function(e,t){var n=e.batchNormalization(u,Is(l),Is(f),o,Is(a),Is(s));return t([c,l,f,a]),n},{$x:c,$mean:l,$variance:f,$scale:a,$offset:s},function(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=null==a?Wn(1):a,c=or(r.shape,u.shape),l=[];
1if(1===r.rank){for(var f=0;f<u.shape.length-1;++f)l.push(u.shape[f]);l.push(1)}var h=n.sub(r),d=e.mul(s),p=ds(i.add(Wn(o))),m=p.mul(p).mul(p).mul(Wn(-.5));return{$x:function(){return 1===r.rank?e.mul(mi(p.as4D(1,1,1,r.shape[0]),l)).mul(s).reshape(n.shape):e.mul(p).mul(s).reshape(n.shape)},$mean:function(){var e=p.mul(Wn(-1)).mul(d);return 1===r.rank&&(e=e.sum(c)),e.reshape(r.shape)},$variance:function(){var e=m.mul(h).mul(d);return 1===r.rank&&(e=e.sum(c)),e.reshape(r.shape)},$scale:function(){var t=h.mul(p),n=e.mul(t);return 1===r.rank&&(n=n.sum(c)),n.reshape(r.shape)},$offset:function(){var t=e;return 1===r.rank&&(t=t.sum(c)),t.reshape(r.shape)}}}).reshape(c.shape)}function Is(e){return null==e?null:0===e.rank?e.as1D():1===e.rank?e:2===e.rank?e.as4D(1,1,e.shape[0],e.shape[1]):3===e.rank?e.as4D(1,e.shape[0],e.shape[1],e.shape[2]):e}function Rs(){jt("tf.batchNormalization() is going away. Use tf.batchNorm() instead, and note the positional argument change of scale, offset, and varianceEpsilon")}var Ms=jn({batchNormalization2d_:function(e,t,n,r,i,o){return void 0===r&&(r=.001),Rs(),Ns(e,t,n,o,i,r)}}),Ds=jn({batchNormalization3d_:function(e,t,n,r,i,o){return void 0===r&&(r=.001),Rs(),Os(e,t,n,o,i,r)}}),js=jn({batchNormalization4d_:function(e,t,n,r,i,o){return void 0===r&&(r=.001),Rs(),As(e,t,n,o,i,r)}}),Ps=jn({batchNormalization_:function(e,t,n,r,i,o){return void 0===r&&(r=.001),Rs(),Ts(e,t,n,o,i,r)}}),zs=jn({batchNorm_:Ts}),Ls=jn({batchNorm2d_:Ns}),Bs=jn({batchNorm3d_:Os}),Fs=jn({batchNorm4d_:As});function Us(e,t,n,r,i,o){w(e.length===t.rank,function(){return"Length of inShape ("+e.length+") and rank of dy ("+t.rank+") must match"});var a=e,s=t,u=!1;3===t.rank&&(u=!0,s=t.as4D(1,t.shape[0],t.shape[1],t.shape[2]),a=[1,e[0],e[1],e[2]]);var c=a[3],l=s.shape[3];w(4===a.length,function(){return"Error in conv2dDerInput: inShape must be length 4, but got length "+a.length+"."}),w(4===s.rank,function(){return"Error in conv2dDerInput: dy must be rank 4, but got rank "+s.rank}),w(4===n.rank,function(){return"Error in conv2dDerInput: filter must be rank 4, but got rank "+n.rank}),w(c===n.shape[2],function(){return"Error in conv2dDerInput: depth of input ("+c+") must match input depth for filter "+n.shape[2]+"."}),w(l===n.shape[3],function(){return"Error in conv2dDerInput: depth of output ("+l+") must match output depth for filter "+n.shape[3]+"."}),null!=o&&w(C(i),function(){return"Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode "+o+" but got pad "+i+"."});var f=ur(a,n.shape,r,1,i,o),h=je.runKernel(function(e,t){var r=e.conv2dDerInput(s,n,f);return t([n,s]),r},{dy4D:s,filter:n},function(e,t){var n=t[0],a=t[1];return{dy4D:function(){return Hs(e,n,r,i,"NHWC",1,o)},filter:function(){return Ks(e,a,n.shape,r,i,o)}}});return u?h.as3D(h.shape[1],h.shape[2],h.shape[3]):h}function Ws(e,t,n,r,i,o){var a=e;3===e.rank&&(a=e.as4D(1,e.shape[0],e.shape[1],e.shape[2]));var s=t;3===s.rank&&(s=t.as4D(1,t.shape[0],t.shape[1],t.shape[2])),w(4===a.rank,function(){return"Error in conv2dDerFilter: input must be rank 4, but got shape "+a.shape+"."}),w(4===s.rank,function(){return"Error in conv2dDerFilter: dy must be rank 4, but got shape "+s.shape+"."}),w(4===n.length,function(){return"Error in conv2dDerFilter: filterShape must be length 4, but got "+n+"."}),w(a.shape[3]===n[2],function(){return"Error in conv2dDerFilter: depth of input "+a.shape[3]+") must match input depth in filter ("+n[2]+"."}),w(s.shape[3]===n[3],function(){return"Error in conv2dDerFilter: depth of dy ("+s.shape[3]+") must match output depth for filter ("+n[3]+")."}),null!=o&&w(C(i),function(){return"Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode "+o+" but got pad "+i+"."});var u=ur(a.shape,n,r,1,i,o);return je.runKernel(function(e){return e.conv2dDerFilter(a,s,u)},{x4D:a,dy4D:s})}function Vs(e){var t=function(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}(e),n=t[0],r=t[1],i=t[2];return 1===n&&1===r&&1===i}var qs=jn({conv1d_:function(e,t,n,r,i,o,a){void 0===i&&(i="NWC"),void 0===o&&(o=1);var s=Cn(e,"x","conv1d"),u=Cn(t,"filter","conv1d"),c=s,l=!1;2===s.rank&&(l=!0,c=s.as3D(1,s.shape[0],s.shape[1])),w(3===c.rank,function(){return"Error in conv1d: input must be rank 3, but got rank "+c.rank+"."}),w(3===u.rank,function(){return"Error in conv1d: filter must be rank 3, but got rank "+u.rank+"."}),null!=a&&w(C(r),function(){return"Error in conv1d: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+r
vendor: 21,365 bytes, line 1
1+"."}),w(c.shape[2]===u.shape[1],function(){return"Error in conv1d: depth of input ("+c.shape[2]+") must match input depth for filter "+u.shape[1]+"."}),w(vr(n,o),function(){return"Error in conv1D: Either stride or dilation must be 1. Got stride "+n+" and dilation '"+o+"'"}),w("NWC"===i,function(){return"Error in conv1d: got dataFormat of "+i+" but only NWC is currently supported."});var f=u.as4D(1,u.shape[0],u.shape[1],u.shape[2]),h=c.as4D(c.shape[0],1,c.shape[1],c.shape[2]),d=Hs(h,f,[1,n],r,"NHWC",[1,o],a);return l?d.as2D(d.shape[2],d.shape[3]):d.as3D(d.shape[0],d.shape[2],d.shape[3])}}),Hs=jn({conv2d_:function(e,t,n,r,i,o,a){void 0===i&&(i="NHWC"),void 0===o&&(o=[1,1]);var s=Cn(e,"x","conv2d"),u=Cn(t,"filter","conv2d"),c=s,l=!1;3===s.rank&&(l=!0,c=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),w(4===c.rank,function(){return"Error in conv2d: input must be rank 4, but got rank "+c.rank+"."}),w(4===u.rank,function(){return"Error in conv2d: filter must be rank 4, but got rank "+u.rank+"."}),null!=a&&w(C(r),function(){return"Error in conv2d: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+r+"."}),w(c.shape[3]===u.shape[2],function(){return"Error in conv2d: depth of input ("+c.shape[3]+") must match input depth for filter "+u.shape[2]+"."}),w(vr(n,o),function(){return"Error in conv2D: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+o+"'"}),w("NHWC"===i,function(){return"Error in conv2d: got dataFormat of "+i+" but only NHWC is currently supported."});var f=ur(c.shape,u.shape,n,o,r,a),h=je.runKernel(function(e,t){var n=e.conv2d(c,u,f);return t([u,c]),n},{x:c,$filter:u},function(e,t){var i=t,a=i[0],s=i[1];return w(mr(o),function(){return"Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+o+"'"}),{x:function(){return Us(s.shape,e,a,n,r)},$filter:function(){return Ws(s,e,a.shape,n,r)}}});return l?h.as3D(h.shape[1],h.shape[2],h.shape[3]):h}}),Gs=jn({conv3d_:function(e,t,n,r,i,o){void 0===i&&(i="NDHWC"),void 0===o&&(o=[1,1,1]);var a=Cn(e,"x","conv3d"),s=Cn(t,"filter","conv3d"),u=a,c=!1;4===a.rank&&(c=!0,u=a.as5D(1,a.shape[0],a.shape[1],a.shape[2],a.shape[3])),w(5===u.rank,function(){return"Error in conv3d: input must be rank 5, but got rank "+u.rank+"."}),w(5===s.rank,function(){return"Error in conv3d: filter must be rank 5, but got rank "+s.rank+"."}),w(u.shape[4]===s.shape[3],function(){return"Error in conv3d: depth of input ("+u.shape[4]+") must match input depth for filter "+s.shape[3]+"."}),w(function(e,t){return Vs(n)||Vs(t)}(0,o),function(){return"Error in conv3D: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+o+"'"}),w("NDHWC"===i,function(){return"Error in conv3d: got dataFormat of "+i+" but only NDHWC is currently supported."});var l=cr(u.shape,s.shape,n,o,r),f=je.runKernel(function(e,t){var n=e.conv3d(u,s,l);return t([u,s]),n},{x:u,$filter:s},function(e,t){w(Vs(o),function(){return"Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+o+"'"});var i=t[0],a=t[1];return{x:function(){return function(e,t,n,r,i){w(e.length===t.rank,function(){return"Length of inShape ("+e.length+") and rank of dy ("+t.rank+") must match"});var o=e,a=t,s=!1;4===t.rank&&(s=!0,a=t.as5D(1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]),o=[1,e[0],e[1],e[2],e[3]]);var u=o[4],c=a.shape[4];w(5===o.length,function(){return"Error in conv3dDerInput: inShape must be length 5, but got length "+o.length+"."}),w(5===a.rank,function(){return"Error in conv3dDerInput: dy must be rank 5, but got rank "+a.rank}),w(5===n.rank,function(){return"Error in conv3dDerInput: filter must be rank 5, but got rank "+n.rank}),w(u===n.shape[3],function(){return"Error in conv3dDerInput: depth of input ("+u+") must match input depth for filter "+n.shape[3]+"."}),w(c===n.shape[4],function(){return"Error in conv3dDerInput: depth of output ("+c+") must match output depth for filter "+n.shape[4]+"."});var l=cr(o,n.shape,r,1,i),f=je.runKernel(function(e){return e.conv3dDerInput(a,n,l)},{dy5D:a});return s?f.as4D(f.shape[1],f.shape[2],f.shape[3],f.shape[4]):f}(i.shape,e,a,n,r)},$filter:function(){return function(e,t,n,r,i){var o=e;4===e.rank&&(o=e.as5D(1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]));var a=t;4===a.rank&&(a=t.as5D(1,t.shape[0],t.shape[1],t.shape[2],t.shape[3])),w(5===o.rank,function(){return"Error in conv3dDerFilter: input must be rank 5, but got shape "+o.shape+"."}),w(5===a.rank,function(){return"Error in conv3dDerFilter: dy must be rank 5, but got shape "+a.shape+"."}),w(5===n.length,function(){return"Error in conv3dDerFilter: filterShape must be length 5, but got "+n+"."}),w(o.shape[4]===n[3],function(){return"Error in conv3dDerFilter: depth of input "+o.shape[4]+") must match input depth in filter ("+n[3]+"."}),w(a.shape[4]===n[4],function(){return"Error in conv3dDerFilter: depth of dy ("+a.shape[4]+") must match output depth for filter ("+n[4]+")."});var s=cr(o.shape,n,r,1,i);return je.runKernel(function(e){return e.conv3dDerFilter(o,a,s)},{x5D:o,dy5D:a})}(i,e,a.shape,n,r)}}});return c?f.as4D(f.shape[1],f.shape[2],f.shape[3],f.shape[4]):f}}),Ks=jn({conv2dDerFilter_:Ws}),$s=jn({depthwiseConv2d_:function(e,t,n,r,i,o,a){void 0===i&&(i="NHWC"),void 0===o&&(o=[1,1]);var s=Cn(e,"x","depthwiseConv2d"),u=Cn(t,"filter","depthwiseConv2d"),c=s,l=!1;3===s.rank&&(l=!0,c=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),w(4===c.rank,function(){return"Error in depthwiseConv2d: input must be rank 4, but got rank "+c.rank+"."}),w(4===u.rank,function(){return"Error in depthwiseConv2d: filter must be rank 4, but got rank "+u.rank+"."}),w(c.shape[3]===u.shape[2],function(){return"Error in depthwiseConv2d: number of input channels ("+c.shape[3]+") must match the inChannels dimension in filter "+u.shape[2]+"."}),null==o&&(o=[1,1]),w(vr(n,o),function(){return"Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+o+"'"}),null!=a&&w(C(r),function(){return"Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+r+"."});var f=ur(c.shape,u.shape,n,o,r,a,!0),h=je.runKernel(function(e,t){var n=e.depthwiseConv2D(c,u,f);return t([c,u]),n},{x:c,$filter:u},function(e,t){w(mr(o),function(){return"Error in gradient of depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '"+o+"'"});var n=t[0],r=t[1];return{x:function(){return function(e,t,n,r){var i=t,o=!1;3===t.rank&&(o=!0,i=t.as4D(1,t.shape[0],t.shape[1],t.shape[2]));var a=je.runKernel(function(e){return e.depthwiseConv2DDerInput(i,n,r)},{dy4D:i});return o?a.as3D(a.shape[1],a.shape[2],a.shape[3]):a}(n.shape,e,r,f)},$filter:function(){return function(e,t,n,r){var i=e;3===e.rank&&(i=e.as4D(1,e.shape[0],e.shape[1],e.shape[2]));var o=t;return 3===o.rank&&(o=t.as4D(1,t.shape[0],t.shape[1],t.shape[2])),je.runKernel(function(e){return e.depthwiseConv2DDerFilter(i,o,r)},{x4D:i,dy4D:o})}(n,e,r.shape,f)}}});return l?h.as3D(h.shape[1],h.shape[2],h.shape[3]):h}}),Xs=jn({separableConv2d_:function(e,t,n,r,i,o,a){void 0===o&&(o=[1,1]),void 0===a&&(a="NHWC");var s=Cn(e,"x","separableConv2d"),u=Cn(t,"depthwiseFilter","separableConv2d"),c=Cn(n,"pointwiseFilter","separableConv2d"),l=s,f=!1;if(3===s.rank&&(f=!0,l=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),"NCHW"===a)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");w(4===l.rank,function(){return"Error in separableConv2d: input must be rank 4, but got rank "+l.rank+"."}),w(4===u.rank,function(){return"Error in separableConv2d: depthwise filter must be rank 4, but got rank "+u.rank+"."}),w(4===c.rank,function(){return"Error in separableConv2d: pointwise filter must be rank 4, but got rank "+u.rank+"."}),w(1===c.shape[0],function(){return"Error in separableConv2d: the first dimension of pointwise filter must be 1, but got "+c.shape[0]+"."}),w(1===c.shape[1],function(){return"Error in separableConv2d: the second dimension of pointwise filter must be 1, but got "+c.shape[1]+"."});var h=u.shape[2],d=u.shape[3];w(c.shape[2]===h*d,function(){return"Error in separableConv2d: the third dimension of pointwise filter must be "+h*d+", but got "+c.shape[2]+"."});var p=$s(l,u,r,i,a,o),m=Hs(p,c,1,"valid",a);return f?m.as3D(m.shape[1],m.shape[2],m.shape[3]):m}}),Ys=jn({conv2dTranspose_:function(e,t,n,r,i,o){return Us(n,Cn(e,"x","conv2dTranspose"),Cn(t,"filter","conv2dTranspose"),r,i,o)}}),Js=jn({matMul_:function(e,t,n,r){var i;void 0===n&&(n=!1),void 0===r&&(r=!1);var o=Cn(e,"a","matMul"),a=Cn(t,"b","matMul");i=Oe(o,a),o=i[0],a=i[1];var s=n?o.shape[o.rank-2]:o.shape[o.rank-1],u=r?a.shape[a.rank-1]:a.shape[a.rank-2],c=n?o.shape[o.rank-1]:o.shape[o.rank-2],l=r?a.shape[a.rank-2]:a.shape[a.rank-1],f=o.shape.slice(0,-2),h=a.shape.slice(0,-2),d=S(f),p=S(h);w(o.rank>=2&&a.rank>=2&&o.rank===a.rank,function(){return"Error in matMul: inputs must have the same rank of at least 2, got ranks "+o.rank+" and "+a.rank+"."}),w(E(f,h),function(){return"Error in matMul: outer dimensions ("+f+") and ("+h+") of Tensors with shapes "+o.shape+" and "+a.shape+" must match."}),w(s===u,function(){return"Error in matMul: inner shapes ("+s+") and ("+u+") of Tensors with shapes "+o.shape+" and "+a.shape+" and transposeA="+n+" and transposeB="+r+" must match."});var m=o.shape.slice(0,-2).concat([c,l]),v=n?o.as3D(d,s,c):o.as3D(d,c,s),g=r?a.as3D(p,l,u):a.as3D(p,u,l);return je.runKernel(function(e,t){var i=e.batchMatMul(v,g,n,r);return t([v,g]),i},{$a:v,$b:g},function(e,t){var i=t,o=i[0],a=i[1];return n||r?!n&&r?{$a:function(){return e.matMul(a,!1,!1)},$b:function(){return e.matMul(o,!0,!1)}}:n&&!r?{$a:function(){return a.matMul(e,!1,!0)},$b:function(){return o.matMul(e,!1,!1)}}:{$a:function(){return a.matMul(e,!0,!0)},$b:function(){return e.matMul(o,!0,!0)}}:{$a:function(){return e.matMul(a,!1,!0)},$b:function(){return o.matMul(e,!0,!1)}}}).reshape(m)}}),Zs=jn({dot_:function(e,t){var n=Cn(e,"t1","dot"),r=Cn(t,"t2","dot");w(!(1!==n.rank&&2!==n.rank||1!==r.rank&&2!==r.rank),function(){return"Error in dot: inputs must all be rank 1 or 2, but got ranks "+n.rank+" and "+r.rank+"."});var i=1===n.rank?n.size:n.shape[1],o=1===r.rank?r.size:r.shape[0];return w(i===o,function(){return"Error in dot: inner dimensions of inputs must match, but got "+i+" and "+o+"."}),1===n.rank&&1===r.rank?n.as2D(1,-1).matMul(r.as2D(-1,1)).asScalar():1===n.rank&&2===r.rank?n.as2D(1,-1).matMul(r.as2D(r.shape[0],r.shape[1])).as1D():2===n.rank&&1===r.rank?n.matMul(r.as2D(-1,1)).as1D():n.matMul(r.as2D(r.shape[0],r.shape[1]))}}),Qs=jn({outerProduct_:function(e,t){var n=Cn(e,"v1","outerProduct"),r=Cn(t,"v2","outerProduct");return w(1===n.rank&&1===r.rank,function(){return"Error in outerProduct: inputs must be rank 1, but got ranks "+n.rank+" and "+r.rank+"."}),n.as2D(-1,1).matMul(r.as2D(1,-1))}}),eu=jn({reverse_:function(e,t){var n=Cn(e,"x","reverse");if(0===n.rank)return n.clone();var r=R(t,n.shape);return je.runKernel(function(e){return e.reverse(n,r)},{$x:n},function(e){return{$x:function(){return e.reverse(r)}}}).reshapeAs(n)}}),tu=jn({reverse1d_:function(e){var t=Cn(e,"x","reverse");return w(1===t.rank,function(){return"Error in reverse1D: x must be rank 1 but got rank "+t.rank+"."}),eu(t,0)}}),nu=jn({reverse2d_:function(e,t){var n=Cn(e,"x","reverse");return w(2===n.rank,function(){return"Error in reverse2D: x must be rank 2 but got rank "+n.rank+"."}),eu(n,t)}}),ru=jn({reverse3d_:function(e,t){var n=Cn(e,"x","reverse");return w(3===n.rank,function(){return"Error in reverse3D: x must be rank 3 but got rank "+n.rank+"."}),eu(n,t)}}),iu=jn({reverse4d_:function(e,t){var n=Cn(e,"x","reverse");return w(4===n.rank,function(){return"Error in reverse4D: x must be rank 4 but got rank "+n.rank+"."}),eu(n,t)}});function ou(e,t,n,r,i,o){var a=Cn(e,"x","maxPool"),s=a,u=!1;3===a.rank&&(u=!0,s=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),null==r&&(r=[1,1]),w(4===s.rank,function(){return"Error in maxPool: input must be rank 4 but got rank "+s.rank+"."}),w(vr(n,r),function(){return"Error in maxPool: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+r+"'"}),null!=o&&w(C(i),function(){return"Error in maxPool: pad must be an integer when using, dimRoundingMode "+o+" but got pad "+i+"."});var c=sr(s.shape,t,n,r,i,o),l=je.runKernel(function(e,t){var n=e.maxPool(s,c);return t([s,n]),n},{x:s},function(e,o){var a=o[0],s=o[1];return{x:function(){return function(e,t,n,r,i,o,a,s){var u=Cn(e,"dy","maxPoolBackprop"),c=Cn(t,"input","maxPoolBackprop"),l=Cn(n,"output","maxPoolBackprop");w(c.rank===u.rank,function(){return"Rank of input ("+c.rank+") does not match rank of dy ("+u.rank+")"}),null==o&&(o=[1,1]),w(vr(i,o),function(){return"Error in maxPoolBackProp: Either strides or dilations must be 1. Got strides "+i+" and dilations '"+o+"'"}),w(4===u.rank,function(){return"Error in maxPoolBackprop: dy must be rank 4 but got rank "+u.rank+"."}),w(4===c.rank,function(){return"Error in maxPoolBackprop: input must be rank 4 but got rank "+c.rank+"."});var f=sr(c.shape,r,i,o,a,s);return je.runKernel(function(e){return e.maxPoolBackprop(u,c,l,f)},{$dy:u,$input:c})}(e,a,s,t,n,r,i)}}});return u?l.as3D(l.shape[1],l.shape[2],l.shape[3]):l}function au(e,t,n,r,i,o){var a=Cn(e,"x","avgPool","float32");null==r&&(r=[1,1]),w(vr(n,r),function(){return"Error in avgPool: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+r+"'"});var s=a,u=!1;3===a.rank&&(u=!0,s=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),w(4===s.rank,function(){return"Error in avgPool: x must be rank 4 but got rank "+s.rank+"."}),null!=o&&w(C(i),function(){return"Error in avgPool: pad must be an integer when using, dimRoundingMode "+o+" but got pad "+i+"."});var c=sr(s.shape,t,n,r,i,o),l=je.runKernel(function(e){return e.avgPool(s,c)},{x:s},function(e){return{x:function(){return function(e,t,n,r,i,o){var a=Cn(e,"dy","avgPoolBackprop"),s=Cn(t,"input","avgPoolBackprop");w(s.rank===a.rank,function(){return"Rank of input ("+s.rank+") does not match rank of dy ("+a.rank+")"}),null==i&&(i=[1,1]),w(vr(r,i),function(){return"Error in avgPoolBackprop: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+i+"'"});var u=s,c=a,l=!1;3===s.rank&&(l=!0,u=s.as4D(1,s.shape[0],s.shape[1],s.shape[2]),c=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),w(4===c.rank,function(){return"Error in avgPoolBackprop: dy must be rank 4 but got rank "+c.rank+"."}),w(4===u.rank,function(){return"Error in avgPoolBackprop: input must be rank 4 but got rank "+u.rank+"."});var f=sr(u.shape,n,r,i,o),h=je.runKernel(function(e){return e.avgPoolBackprop(c,u,f)},{dy4D:c,input4D:u});return l?h.as3D(h.shape[1],h.shape[2],h.shape[3]):h}(e,s,t,n,r,i)}}});return l=l.cast(a.dtype),u?l.as3D(l.shape[1],l.shape[2],l.shape[3]):l}var su=jn({maxPool_:function(e,t,n,r,i){return ou(e,t,n,1,r,i)}}),uu=jn({avgPool_:function(e,t,n,r,i){return au(e,t,n,1,r,i)}}),cu=jn({pool_:function(e,t,n,r,i,o){null==i&&(i=[1,1]),null==o&&(o=1),0===r&&(r="valid");var a=Cn(e,"x","maxPool"),s=a,u=!1;3===a.rank&&(u=!0,s=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),w(vr(o,i),function(){return"Error in pool: Either strides or dilations must be 1. Got strides "+o+" and dilations '"+i+"'"});var c,l=sr(s.shape,t,o,i,r),f=[l.dilationHeight,l.dilationWidth];c="same"===r?function(e,t){var n=e.map(function(e,n){return e+(e-1)*(t[n]-1)}).map(function(e){return e-1}),r=n.map(function(e){return Math.floor(e/2)}),i=n.map(function(e,t){return e-r[t]});return n.map(function(e,t){return[r[t],i[t]]})}([l.filterHeight,l.filterWidth],f):[[0,0],[0,0]];var h=1===f[0]&&1===f[1],d=function(e,t,n){var r=n.map(function(e){return e[0]}),i=n.map(function(e){return e[1]}),o=e.concat(r,i),a=t.map(function(e,t){return(e-o[t]%e)%e}),s=i.map(function(e,t){return e+a[t]});return[t.map(function(e,t){return[r[t],s[t]]}),t.map(function(e,t){return[0,a[t]]})]}([l.inHeight,l.inWidth],f,c),p=d[0],m=d[1],v=h?r:"valid",g=h?s:hi(s,f,p),y=("avg"===n?function(){return au(g,t,o,1,v)}:function(){return ou(g,t,o,1,v)})(),b=h?y:$r(y,f,m);return u?b.as3D(b.shape[1],b.shape[2],b.shape[3]):b}}),lu=jn({slice_:function(e,t,n){var r,i,o=Cn(e,"x","slice");if(0===o.rank)throw new Error("Slicing scalar is not possible");r="number"==typeof t?[t].concat(new Array(o.rank-1).fill(0)):t.length<o.rank?t.concat(new Array(o.rank-t.length).fill(0)):t.slice(),i=(i=null==n?new Array(o.rank).fill(-1):"number"==typeof n?[n].concat(new Array(o.rank-1).fill(-1)):n.length<o.rank?n.concat(new Array(o.rank-n.length).fill(-1)):n).map(function(e,t){return e>=0?e:(w(-1===e,function(){return"Bad value in size"}),o.shape[t]-r[t])}),function(e,t,n){w(e.rank===t.length,function(){return"Error in slice"+e.rank+"D: Length of begin "+t+" must match the rank of the array ("+e.rank+")."}),w(e.rank===n.length,function(){return"Error in slice"+e.rank+"D: Length of size "+n+" must match the rank of the array ("+e.rank+")."});for(var r=function(r){w(t[r]+n[r]<=e.shape[r],function(){return"Error in slice"+e.rank+"D: begin["+r+"] + size["+r+"] ("+(t[r]+n[r])+") would overflow input.shape["+r+"] ("+e.shape[r]+")"})},i=0;i<e.rank;++i)r(i)}(o,r,i);var a=o.shape;return je.runKernel(function(e){return e.slice(o,r,i)},{$x:o},function(e){for(var t=[],n=0;n<e.rank;n++)t.push([r[n],a[n]-r[n]-i[n]]);return{$x:function(){return e.pad(t)}}})}}),fu=jn({slice1d_:function(e,t,n){var r=Cn(e,"x","slice1d");return w(1===r.rank,function(){return"slice1d expects a rank-1 tensor, but got a rank-"+r.rank+" tensor"}),lu(r,[t],[n])}}),hu=jn({slice2d_:function(e,t,n){var r=Cn(e,"x","slice2d");return w(2===r.rank,function(){return"slice2d expects a rank-2 tensor, but got a rank-"+r.rank+" tensor"}),lu(r,t,n)}}),du=jn({slice3d_:function(e,t,n){var r=Cn(e,"x","slice3d");return w(3===r.rank,function(){return"slice3d expects a rank-3 tensor, but got a rank-"+r.rank+" tensor"}),lu(r,t,n)}}),pu=jn({slice4d_:function(e,t,n){var r=Cn(e,"x","slice4d");return w(4===r.rank,function(){return"slice4d expects a rank-4 tensor, but got a rank-"+r.rank+" tensor"}),lu(r,t,n)}});function mu(e,t,n,r,i){return t.rank<n.rank&&(t=t.reshape(un(t.shape,r))),e.rank<n.rank&&(e=e.reshape(un(e.shape,r))),{$x:function(){var r=e.mul(n.equal(t).cast(e.dtype));return null==i?r:r.transpose(i)}}}var vu=jn({all_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=Cn(e,"x","all","bool"),i=R(t,r.shape),o=i,a=ln(o,r.rank);null!=a&&(r=r.transpose(a),o=hn(o.length,r.rank));var s=je.runKernel(function(e){return e.all(r,o)},{$x:r});if(n){var u=un(s.shape,i);return s.reshape(u)}return s}}),gu=jn({any_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=Cn(e,"x","any","bool"),i=R(t,r.shape),o=i,a=ln(o,r.rank);null!=a&&(r=r.transpose(a),o=hn(o.length,r.rank));var s=je.runKernel(function(e){return e.any(r,o)},{$x:r});if(n){var u=un(s.shape,i);return s.reshape(u)}return s}}),yu=jn({argMax_:function(e,t){void 0===t&&(t=0);var n=Cn(e,"x","argMax");null==t&&(t=0);var r=R(t,n.shape),i=ln(r,n.rank);return null!=i&&(n=n.transpose(i),r=hn(r.length,n.rank)),je.runKernel(function(e,t){var i=e.argMax(n,r[0]);return t([n]),i},{$x:n},function(e,t){var n=t[0];return{$x:function(){return tr(n)}}})}}),bu=jn({argMin_:function(e,t){void 0===t&&(t=0);var n=Cn(e,"x","argMin");null==t&&(t=0);var r=R(t,n.shape),i=ln(r,n.rank);return null!=i&&(n=n.transpose(i),r=hn(r.length,n.rank)),je.runKernel(function(e,t){var i=e.argMin(n,r[0]);return t([n]),i},{$x:n},function(e,t){var n=t[0];return{$x:function(){return tr(n)}}})}}),wu=jn({logSumExp_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=Cn(e,"x","logSumExp"),i=R(t,r.shape),o=r.max(i,!0),a=r.sub(o).exp().sum(i).log(),s=o.reshape(a.shape).add(a);if(n){var u=un(s.shape,i);return s.reshape(u)}return s}}),xu=jn({max_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=Cn(e,"x","max"),i=r,o=R(t,r.shape),a=o,s=ln(a,r.rank);null!=s&&(r=r.transpose(s),a=hn(a.length,r.rank));var u=je.runKernel(function(e,t){var n=e.max(r,a);return t([i,n]),n},{$x:r},function(e,t){return mu(e,t[1],t[0],o,s)});if(n){var c=un(u.shape,o);u=u.reshape(c)}return u}}),_u=jn({mean_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=Cn(e,"x","mean"),i=R(t,r.shape),o=S(sn(r.shape,i)[1]);return Mn(function(e){var r=Wn(o);return{value:(r.dtype===e.dtype?e:e.cast(r.dtype)).div(r).sum(t,n),gradFunc:function(t){var n=e.shape.slice();return i.forEach(function(e){n[e]=1}),t.reshape(n).mul(Xn(e.shape,"float32")).div(o)}}})(r)}}),ku=jn({min_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=Cn(e,"x","min"),i=r,o=R(t,r.shape),a=o,s=ln(a,r.rank);null!=s&&(r=r.transpose(s),a=hn(a.length,r.rank));var u=je.runKernel(function(e,t){var n=e.min(r,a);return t([i,n]),n},{$x:r},function(e,t){return mu(e,t[1],t[0],o,s)});if(n){var c=un(u.shape,o);u=u.reshape(c)}return u}}),Su=jn({moments_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=R(t,(e=Cn(e,"x","moments")).shape),i=e.mean(r,n),o=i.shape;n||(o=un(i.shape,r));var a=e.toFloat().sub(i.reshape(o)).square();return{mean:i,variance:a.mean(r,n)}}}),Eu=jn({sum_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=Cn(e,"x","sum");"bool"===r.dtype&&(r=r.toInt());var i=R(t,r.shape);return Mn(function(e){var t=ln(i,e.rank),r=i,o=e;null!=t&&(o=e.transpose(t),r=hn(r.length,e.rank));var a=je.runKernel(function(e){return e.sum(o,r)},{permutedX:o});
vendor: 4,966 bytes, line 1
1if(n){var s=un(a.shape,i);a=a.reshape(s)}return{value:a,gradFunc:function(t){var n=e.shape.slice();return i.forEach(function(e){n[e]=1}),t.reshape(n).mul(Xn(e.shape,"float32"))}}})(r)}}),Cu=jn({prod_:function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1);var r=Cn(e,"x","prod");"bool"===r.dtype&&(r=r.toInt());var i=R(t,r.shape),o=ln(i,r.rank),a=i,s=r;null!=o&&(s=r.transpose(o),a=hn(a.length,r.rank));var u=je.runKernel(function(e){return e.prod(s,a)},{permutedX:s});if(n){var c=un(u.shape,i);u=u.reshape(c)}return u}}),Nu=jn({equal_:function(e,t){var n,r=Cn(e,"a","equal"),i=Cn(t,"b","equal");return n=Oe(r,i),r=n[0],i=n[1],ar(r.shape,i.shape),je.runKernel(function(e){return e.equal(r,i)},{$a:r,$b:i})}}),Ou=jn({equalStrict_:function(e,t){var n=Cn(e,"a","equalStrict"),r=Cn(t,"b","equalStrict");return x(n.shape,r.shape,"Error in equalStrict: "),n.equal(r)}}),Au=jn({greater_:function(e,t){var n,r=Cn(e,"a","greater"),i=Cn(t,"b","greater");return n=Oe(r,i),r=n[0],i=n[1],ar(r.shape,i.shape),je.runKernel(function(e){return e.greater(r,i)},{$a:r,$b:i})}}),Tu=jn({greaterEqual_:function(e,t){var n,r=Cn(e,"a","greaterEqual"),i=Cn(t,"b","greaterEqual");return n=Oe(r,i),r=n[0],i=n[1],ar(r.shape,i.shape),je.runKernel(function(e,t){var n=e.greaterEqual(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){return tr(n)},$b:function(){return tr(r)}}})}}),Iu=jn({greaterEqualStrict_:function(e,t){var n=Cn(e,"a","greaterEqualStrict"),r=Cn(t,"b","greaterEqualStrict");return x(n.shape,r.shape,"Error in greaterEqualStrict: "),n.greaterEqual(r)}}),Ru=jn({greaterStrict_:function(e,t){var n=Cn(e,"a","greaterStrict"),r=Cn(t,"b","greaterStrict");return x(n.shape,r.shape,"Error in greaterStrict: "),n.greater(r)}}),Mu=jn({less_:function(e,t){var n,r=Cn(e,"a","less"),i=Cn(t,"b","less");return n=Oe(r,i),r=n[0],i=n[1],ar(r.shape,i.shape),je.runKernel(function(e){return e.less(r,i)},{$a:r,$b:i})}}),Du=jn({lessEqual_:function(e,t){var n,r=Cn(e,"a","lessEqual"),i=Cn(t,"b","lessEqual");return n=Oe(r,i),r=n[0],i=n[1],ar(r.shape,i.shape),je.runKernel(function(e){return e.lessEqual(r,i)},{$a:r,$b:i})}}),ju=jn({lessEqualStrict_:function(e,t){var n=Cn(e,"a","lessEqualStrict"),r=Cn(t,"b","lessEqualStrict");return x(n.shape,r.shape,"Error in lessEqualStrict: "),n.lessEqual(r)}}),Pu=jn({lessStrict_:function(e,t){var n=Cn(e,"a","lessStrict"),r=Cn(t,"b","lessStrict");return x(n.shape,r.shape,"Error in lessStrict: "),n.less(r)}}),zu=jn({notEqual_:function(e,t){var n,r=Cn(e,"a","notEqual"),i=Cn(t,"b","notEqual");return n=Oe(r,i),r=n[0],i=n[1],ar(r.shape,i.shape),je.runKernel(function(e){return e.notEqual(r,i)},{$a:r,$b:i})}}),Lu=jn({notEqualStrict_:function(e,t){var n=Cn(e,"a","notEqualStrict"),r=Cn(t,"b","notEqualStrict");return x(n.shape,r.shape,"Error in notEqualStrict: "),n.notEqual(r)}}),Bu=jn({add_:function(e,t){var n,r=Cn(e,"a","add"),i=Cn(t,"b","add");n=Oe(r,i),r=n[0],i=n[1];var o=ar(r.shape,i.shape);return je.runKernel(function(e){return e.add(r,i)},{$a:r,$b:i},function(e){return{$a:function(){var t=e,n=or(r.shape,o);return n.length>0&&(t=t.sum(n)),t.reshape(r.shape)},$b:function(){var t=e,n=or(i.shape,o);return n.length>0&&(t=t.sum(n)),t.reshape(i.shape)}}})}}),Fu=jn({addN_:function(e){w(Array.isArray(e),function(){return"The argument passed to tf.addN() must be a list of tensors"}),w(e.length>=1,function(){return"Must pass at least one tensor to tf.addN(), but got "+e.length});var t=e.map(function(e,t){return Cn(e,"tensors"+t,"addN")}),n=t[0];t.forEach(function(e){if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(function(e){if(!E(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});var r=t;return je.runKernel(function(e){return e.addN(t)},r,function(e){var n={};return t.forEach(function(t,r){n[r]=function(){return e.clone()}}),n})}}),Uu=jn({addStrict_:function(e,t){var n=Cn(e,"a","addStrict"),r=Cn(t,"b","addStrict");return x(n.shape,r.shape,"Error in addStrict: "),n.add(r)}}),Wu=jn({atan2_:function(e,t){var n,r=Cn(e,"a","atan2"),i=Cn(t,"b","atan2");n=Oe(r,i),r=n[0],i=n[1];var o=ar(r.shape,i.shape);return je.runKernel(function(e,t){var n=e.atan2(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){var t=Bu(n.square(),r.square()),i=e.mul(r.div(t)),a=or(n.shape,o);return a.length>0&&(i=i.sum(a)),i.reshape(n.shape)},$b:function(){var t=Bu(n.square(),r.square()),i=ls(e.mul(n.div(t))),a=or(r.shape,o);return a.length>0&&(i=i.sum(a)),i.reshape(r.shape)}}})}}),Vu=jn({div_:function(e,t){var n,r=Cn(e,"a","div"),i=Cn(t,"b","div");if(n=Oe(r,i),r=n[0],i=n[1],"int32"===r.dtype&&"int32"===i.dtype)return Hu(r,i);var o=ar(r.shape,i.shape);return je.runKernel(function(e,t){var n=e.realDivide(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){var t=e.div(r.toFloat()),i=or(n.shape,o);return i.length>0?t.sum(i).reshape(n.shape):t}
vendor: 6,397 bytes, line 1
1,$b:function(){var t=e.mul(n.toFloat()),i=or(r.shape,o);i.length>0&&(t=t.sum(i).reshape(r.shape));var a=r.square();return t.div(a.toFloat()).neg()}}})}}),qu=jn({divStrict_:function(e,t){var n=Cn(e,"a","div"),r=Cn(t,"b","div");return x(n.shape,r.shape,"Error in divideStrict: "),n.div(r)}}),Hu=jn({floorDiv_:function(e,t){var n,r=Cn(e,"a","floorDiv"),i=Cn(t,"b","floorDiv");n=Oe(r,i),r=n[0],i=n[1];var o=ar(r.shape,i.shape);return je.runKernel(function(e,t){var n=e.floorDiv(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){var t=e.div(r.toFloat()),i=or(n.shape,o);return i.length>0?t.sum(i).reshape(n.shape):t},$b:function(){var t=e.mul(n.toFloat()),i=or(r.shape,o);i.length>0&&(t=t.sum(i).reshape(r.shape));var a=r.square();return t.div(a.toFloat()).neg()}}})}}),Gu=jn({maximum_:function(e,t){var n,r=Cn(e,"a","maximum"),i=Cn(t,"b","maximum");return n=Oe(r,i),r=n[0],i=n[1],"bool"===r.dtype&&(r=r.toInt(),i=i.toInt()),ar(r.shape,i.shape),je.runKernel(function(e,t){var n=e.maximum(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){return e.mul(n.greaterEqual(r).toFloat())},$b:function(){return e.mul(n.less(r).toFloat())}}})}}),Ku=jn({maximumStrict_:function(e,t){var n=Cn(e,"a","maximumStrict"),r=Cn(t,"b","maximumStrict");return x(n.shape,r.shape,"Error in maximumStrict: "),n.maximum(r)}}),$u=jn({minimum_:function(e,t){var n,r=Cn(e,"a","minimum"),i=Cn(t,"b","minimum");return n=Oe(r,i),r=n[0],i=n[1],"bool"===r.dtype&&(r=r.toInt(),i=i.toInt()),ar(r.shape,i.shape),je.runKernel(function(e,t){var n=e.minimum(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){return e.mul(n.lessEqual(r).toFloat())},$b:function(){return e.mul(n.greater(r).toFloat())}}})}}),Xu=jn({minimumStrict_:function(e,t){var n=Cn(e,"a","minimumStrict"),r=Cn(t,"b","minimumStrict");return x(n.shape,r.shape,"Error in minimumStrict: "),n.minimum(r)}}),Yu=jn({mod_:function(e,t){var n,r=Cn(e,"a","mod"),i=Cn(t,"b","mod");n=Oe(r,i),r=n[0],i=n[1];var o=ar(r.shape,i.shape);return je.runKernel(function(e,t){var n=e.mod(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){var t=or(n.shape,o);return t.length>0?e.sum(t).reshape(n.shape):e},$b:function(){var t=e.mul(n.div(r).floor().neg()),i=or(r.shape,o);return i.length>0?t.sum(i).reshape(r.shape):t}}})}}),Ju=jn({modStrict_:function(e,t){var n=Cn(e,"a","modStrict"),r=Cn(t,"b","modStrict");return x(n.shape,r.shape,"Error in modStrict: "),n.mod(r)}}),Zu=jn({mul_:function(e,t){var n,r=Cn(e,"a","mul"),i=Cn(t,"b","mul");n=Oe(r,i),r=n[0],i=n[1];var o=ar(r.shape,i.shape);return je.runKernel(function(e,t){var n=e.multiply(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1];return{$a:function(){var t=e.mul(r.toFloat()),i=or(n.shape,o);return i.length>0?t.sum(i).reshape(n.shape):t},$b:function(){var t=e.mul(n.toFloat()),i=or(r.shape,o);return i.length>0?t.sum(i).reshape(r.shape):t}}})}}),Qu=jn({mulStrict_:function(e,t){var n=Cn(e,"a","mul"),r=Cn(t,"b","mul");return x(n.shape,r.shape,"Error in multiplyStrict: "),n.mul(r)}}),ec=jn({pow_:function(e,t){var n=Cn(e,"base","pow"),r=Cn(t,"exp","pow"),i=ar(n.shape,r.shape);return e=n.cast(Ce(n.dtype,r.dtype)),t=r.cast(Ce(n.dtype,r.dtype)),je.runKernel(function(e,t){var i=e.pow(n,r);return t([n,r,i]),i},{$base:n,$exp:r},function(e,t){var n=t[0],r=t[1],o=t[2];return{$base:function(){var t=r.toFloat(),o=e.mul(t.mul(n.pow(t.sub(Wn(1))))),a=or(n.shape,i);return a.length>0&&(o=o.sum(a)),o.reshape(n.shape)},$exp:function(){var t=n.greater(0),a=n.log().where(t,tr(n)),s=e.mul(o.mul(a)),u=or(r.shape,i);return u.length>0&&(s=s.sum(u)),s.reshape(r.shape)}}})}}),tc=jn({powStrict_:function(e,t){return x(e.shape,t.shape,"Error in powStrict: "),e.pow(t)}}),nc=jn({squaredDifference_:function(e,t){var n,r=Cn(e,"a","squaredDifference"),i=Cn(t,"b","squaredDifference");return n=Oe(r,i),r=n[0],i=n[1],ar(r.shape,i.shape),je.runKernel(function(e,t){var n=e.squaredDifference(r,i);return t([r,i]),n},{$a:r,$b:i},function(e,t){var n=t[0],r=t[1],i=Wn(2);return{$a:function(){return e.mul(n.sub(r).mul(i))},$b:function(){return e.mul(r.sub(n).mul(i))}}})}}),rc=jn({squaredDifferenceStrict_:function(e,t){var n=Cn(e,"a","squaredDifferenceStrict"),r=Cn(t,"b","squaredDifferenceStrict");return x(n.shape,r.shape,"Error in squaredDifferenceStrict: "),n.squaredDifference(r)}}),ic=jn({sub_:function(e,t){var n,r=Cn(e,"a","sub"),i=Cn(t,"b","sub");n=Oe(r,i),r=n[0],i=n[1];var o=ar(r.shape,i.shape);return je.runKernel(function(e){return e.subtract(r,i)},{$a:r,$b:i},function(e){return{$a:function(){var t=e,n=or(r.shape,o);return n.length>0&&(t=t.sum(n)),t.reshape(r.shape)},$b:function(){var t=e,n=or(i.shape,o);return n.length>0&&(t=t.sum(n)),t.neg().reshape(i.shape)}}})}}),oc=jn({subStrict_:function(e,t){var n=Cn(e,"a","subStrict"),r=Cn(t,"b","subStrict");return x(n.shape,r.shape,"Error in subStrict: "),n.sub(r)}}),ac=jn({logicalAnd_:function(e,t){var n=Cn(e,"a","logicalAnd","bool"),r=Cn(t,"b","logicalAnd","bool");return ar(n.shape,r.shape),je.runKernel(function(e){return e.logicalAnd(n,r)},{$a:n,$b:r})}}),sc=jn({logicalNot_:function(e){var t=Cn(e,"x","logicalNot","bool");return je.runKernel(function(e){return e.logicalNot(t)},{$x:t})}}),uc=jn({logicalOr_:function(e,t){var n=Cn(e,"a","logicalOr","bool"),r=Cn(t,"b","logicalOr","bool");return ar(n.shape,r.shape),je.runKernel(function(e){return e.logicalOr(n,r)},{$a:n,$b:r})}}),cc=jn({logicalXor_:function(e,t){var n=Cn(e,"a","logicalXor","bool"),r=Cn(t,"b","logicalXor","bool");return ar(n.shape,r.shape),uc(e,t).logicalAnd(ac(e,t).logicalNot())}}),lc=jn({where_:function(e,t,n){var r=Cn(t,"a","where"),i=Cn(n,"b","where"),o=Cn(e,"condition","where","bool");return x(r.shape,i.shape,"Error in where: "),1===o.rank?w(o.shape[0]===r.shape[0],function(){return"The first dimension of `a` must match the size of `condition`."}):x(o.shape,i.shape,"Error in where: "),je.runKernel(function(e,t){var n=e.select(o,r,i);return t([o]),n},{$condition:o,$a:r,$b:i},function(e,t){var n=t[0];return{$condition:function(){return tr(n).toFloat()},$a:function(){return e.mul(n.cast(e.dtype))},$b:function(){return e.mul(n.logicalNot().cast(e.dtype))}}})}}),fc=function(e){return c(this,void 0,void 0,function(){var t,n,r;return l(this,function(i){switch(i.label){case 0:return[4,(t=Cn(e,"condition","whereAsync","bool")).data()];
vendor: 5,571 bytes, line 1
1case 1:return n=i.sent(),r=bi(t.shape,n),e!==t&&t.dispose(),[2,r]}})})},hc=jn({elu_:function(e){var t=Cn(e,"x","elu");return je.runKernel(function(e,n){var r=e.elu(t);return n([r]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return je.runKernel(function(t){return t.eluDer(e,n)},{dy:e,y:n})}}})}}),dc=jn({leakyRelu_:function(e,t){void 0===t&&(t=.2);var n=Cn(e,"x","leakyRelu");return Gu(Wn(t).mul(n),n)}}),pc=jn({prelu_:function(e,t){var n=Cn(e,"x","prelu"),r=Cn(t,"alpha","prelu");return je.runKernel(function(e,t){var i=e.prelu(n,r);return t([n,r]),i},{$x:n,$alpha:r},function(e,t){var n=t[0],r=t[1],i=n.greater(0);return{$x:function(){return lc(i,e,e.mul(r))},$alpha:function(){var t=lc(i,tr(e),e.mul(n)),o=or(r.shape,e.shape);return o.length>0&&(t=t.sum(o)),t.reshape(r.shape)}}})}}),mc=jn({relu_:function(e){var t=Cn(e,"x","relu");return"bool"===t.dtype?t.toInt():je.runKernel(function(e,n){var r=e.relu(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){return e.mulStrict(n.step().toFloat())}}})}}),vc=jn({selu_:function(e){var t=Cn(e,"x","selu");return je.runKernel(function(e,n){var r=e.selu(t);return n([t]),r},{$x:t},function(e,t){var n=t[0];return{$x:function(){var t=n.greater(Wn(0)),r=Wn(Da),i=Wn(ja),o=e.mul(i),a=e.mul(r).mul(n.toFloat().exp());return lc(t,o,a)}}})}}),gc=jn({transpose_:function(e,t){var n=Cn(e,"x","transpose");return null==t&&(t=n.shape.map(function(e,t){return t}).reverse()),w(n.rank===t.length,function(){return"Error in transpose: rank of input "+n.rank+" must match length of perm "+t+"."}),t.forEach(function(e){w(e>=0&&e<n.rank,function(){return"All entries in 'perm' must be between 0 and "+(n.rank-1)+" but got "+t})}),n.rank<=1?n.clone():je.runKernel(function(e){return e.transpose(n,t)},{$x:n},function(e){var n=fn(t);return{$x:function(){return e.transpose(n)}}})}}),yc=jn({localResponseNormalization_:function(e,t,n,r,i){void 0===t&&(t=5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=.5);var o=Cn(e,"x","localResponseNormalization");w(4===o.rank||3===o.rank,function(){return"Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank "+o.rank+"."}),w(C(t),function(){return"Error in localResponseNormalization: depthRadius must be an integer but got depthRadius "+t+"."});var a=o,s=!1;3===o.rank&&(s=!0,a=o.as4D(1,o.shape[0],o.shape[1],o.shape[2]));var u=je.runKernel(function(e,o){var s=e.localResponseNormalization4D(a,t,n,r,i);return o([a,s]),s},{x4D:a},function(e,o){var a=o[0],s=o[1];return{x4D:function(){return je.runKernel(function(o){return o.LRNGrad(e,a,s,t,n,r,i)},{})}}});return s?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}}),bc=jn({norm_:function(e,t,n,r){void 0===t&&(t="euclidean"),void 0===n&&(n=null),void 0===r&&(r=!1);var i=function e(t,n,r){if(void 0===r&&(r=null),0===t.rank)return t.abs();if(1!==t.rank&&null===r)return e(t.reshape([-1]),n,r);if(1===t.rank||"number"==typeof r||Array.isArray(r)&&1===r.length){if(1===n)return t.abs().sum(r);if(n===1/0)return t.abs().max(r);if(n===-1/0)return t.abs().min(r);if("euclidean"===n||2===n)return t.abs().pow(Wn(2,"int32")).sum(r).sqrt();throw new Error("Error in norm: invalid ord value: "+n)}if(Array.isArray(r)&&2===r.length){if(1===n)return t.abs().sum(r[0]).max(r[1]-1);if(n===1/0)return t.abs().sum(r[1]).max(r[0]);if(n===-1/0)return t.abs().sum(r[1]).min(r[0]);if("fro"===n||"euclidean"===n)return t.square().sum(r).sqrt();throw new Error("Error in norm: invalid ord value: "+n)}throw new Error("Error in norm: invalid axis: "+r)}(e=Cn(e,"x","norm"),t,n),o=i.shape;if(r){var a=R(n,e.shape);o=un(i.shape,a)}return i.reshape(o)}});function wc(e,t){for(var n=[],r=e;r<t;++r)n.push(r);return n}function xc(e){for(var t=[],n=0;n<e.length;++n)for(var r=0;r<e[n].length;++r)t.push(e[n][r]);return t}var _c=jn({gather_:function(e,t,n){void 0===n&&(n=0);var r=Cn(e,"x","gather"),i=Cn(t,"indices","gather","int32");n=R(n,r.shape)[0];var o=function(e,t,n){for(var r=e.shape[n],i=[],o=1,a=1,s=0;s<n;s++)i.push(e.shape[s]),o*=e.shape[s];for(s=0;s<t.rank;s++)i.push(t.shape[s]);for(s=n+1;s<e.rank;s++)i.push(e.shape[s]),a*=e.shape[s];return{batchSize:o,sliceSize:a,dimSize:r,outputShape:i}}(r,i,n);return je.runKernel(function(e,t){var o=e.gather(r,i.flatten(),n);return t([i]),o},{$x:r},function(e,t){var i=t[0];return{$x:function(){var t=r.shape,o=i.size,a=t.slice(0,n),s=a.length,u=t.slice(n,t.length).slice(1),c=u.length,l=wc(0,s),f=wc(s+1,s+1+c),h=xc([a,[o],u]),d=e.reshape(h),p=i.reshape([o]),m=xc([[s],l,f]),v=d.transpose(m),g=kc(v,p,r.shape[n]),y=fn(m);return g.transpose(y)}}}).reshape(o.outputShape)}}),kc=jn({unsortedSegmentSum_:function(e,t,n){var r=Cn(e,"x","unsortedSegmentSum"),i=Cn(t,"segmentIds","unsortedSegmentSum","int32");return w(C(n),function(){return"numSegments must be of dtype int"}),je.runKernel(function(e,t){var o=e.unsortedSegmentSum(r,i,n);return t([i]),o},{$x:r},function(e,t){var n=t[0];return{$x:function(){return function(e,t){for(var n=Gu(t,tr(t)),r=_c(e,n),i=Tu(t,Wn(0,"int32")),o=r.rank-i.rank,a=0;a<o;++a)i=Qr(i,a+1);i=ac(i,Xn(r.shape,"bool"));var s=tr(r);return lc(i,r,s)}(e,n)}}})}}),Sc=jn({basicLSTMCell_:function(e,t,n,r,i,o){var a=Cn(e,"forgetBias","basicLSTMCell"),s=Cn(t,"lstmKernel","basicLSTMCell"),u=Cn(n,"lstmBias","basicLSTMCell"),c=Cn(r,"data","basicLSTMCell"),l=Cn(i,"c","basicLSTMCell"),f=Cn(o,"h","basicLSTMCell"),h=c.concat(f,1).matMul(s).add(u),d=h.shape[0],p=h.shape[1]/4,m=[d,p],v=h.slice([0,0],m),g=h.slice([0,p],m),y=h.slice([0,2*p],m),b=h.slice([0,3*p],m),w=v.sigmoid().mulStrict(g.tanh()).addStrict(l.mulStrict(a.add(y).sigmoid())
1),x=w.tanh().mulStrict(b.sigmoid());return[w,x]}}),Ec=jn({multiRNNCell_:function(e,t,n,r){for(var i=Cn(t,"data","multiRNNCell"),o=Nn(n,"c","multiRNNCell"),a=Nn(r,"h","multiRNNCell"),s=i,u=[],c=0;c<e.length;c++){var l=e[c](s,o[c],a[c]);u.push(l[0]),u.push(l[1]),s=l[1]}var f=[],h=[];for(c=0;c<u.length;c+=2)f.push(u[c]),h.push(u[c+1]);return[f,h]}}),Cc=jn({movingAverage_:function(e,t,n,r,i){void 0===i&&(i=!0);var o=Cn(e,"v","movingAverage"),a=Cn(t,"x","movingAverage"),s=Cn(n,"decay","movingAverage");Ae(o,a),w(E(o.shape,a.shape),function(){return"Shape mismatch in v and x"});var u=Wn(1),c=u.sub(s),l=a.sub(o).mul(c);if(i){w(null!=r,function(){return"When using zeroDebias: true, step is required."});var f=Cn(r,"step","movingAverage");l=l.div(u.sub(ec(s,f)))}return o.add(l)}}),Nc=jn({stridedSlice_:function(e,t,n,r,i,o,a,s,u){if(void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=0),void 0===u&&(u=0),0!==a)throw new Error("ellipsis mask is not yet supported");if(0!==s)throw new Error("new axis mask is not yet supported");var c=Cn(e,"x","stridedSlice");if(r.every(function(e){return 1===e})){var l=bn(c.shape,t,n,r,i,o,a,s,u),f=l[0],h=l[1],d=l[2],p=h.filter(function(e,t){return-1===d.indexOf(t)});return lu(c,f,h).reshape(p)}return je.runKernel(function(e){return e.stridedSlice(c,t,n,r,i,o,a,s,u)},{$x:c})}}),Oc=jn({topk_:function(e,t,n){void 0===t&&(t=1),void 0===n&&(n=!0);var r=Cn(e,"x","topk");
1if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");var i=r.shape[r.shape.length-1];if(t>i)throw new Error("'k' passed to topk() must be <= the last dimension ("+i+") but got "+t);var o=je.runKernel(function(e){return e.topk(r,t,n)},{$x:r});return{values:o[0],indices:o[1]}}}),Ac=jn({scatterND_:function(e,t,n){var r=Cn(e,"indices","scatterND","int32"),i=Cn(t,"updates","scatterND");return function(e,t,n){if(t.rank<1)throw new Error("tf.scatterND() expects the indices to be rank 1 or higher, but the rank was "+t.rank+".");if(e.rank<1)throw new Error("tf.scatterND() expects the updates to be rank 1 or higher, but the rank was "+e.rank+".");if("int32"!==t.dtype)throw new Error("The dtype of 'indices' should be int32, but got dtype: "+t.dtype);if(n.length<1)throw new Error("Output rank must be greater or equal to 1, but got shape: "+n);if(0===n.length){if(0===t.size)throw new Error("Indices specified for empty output. indices shape: "+t.shape);if(0===e.size)throw new Error("Updates specified for empty output. updates shape: "+e.shape)}!function(e,t,n){var r=t.rank>1?t.shape[t.rank-1]:1,i=t.rank>1?t.rank-1:1,o="Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: "+n.shape+", indices.shape: "+t.shape+", shape: "+e+", sliceDim: "+r+", and batchDim: "+i+".";if(n.rank<i)throw new Error(o+" update.rank < "+i+". ");if(e.length<r+(n.rank-i))throw new Error(o+" Output shape length < "+(r+(n.rank-i)));if(n.rank!==i+e.length-r)throw new Error(o+" update.rank != "+(i+e.length-r));for(var a=0;a<i;++a)if(n.shape[a]!==t.shape[a])throw new Error(o+" updates.shape["+a+"] ("+n.shape[a]+") != indices.shape["+a+"] ("+t.shape[a]+").");for(a=0;a<n.rank-i;++a)if(n.shape[a+i]!==e[a+r])throw new Error(o+" updates.shape["+(a+i)+"] ("+n.shape[a+i]+") != shape["+(a+i)+"] ("+e[a+i]+")")}(n,t,e)}(i,r,n),je.runKernel(function(e){return e.scatterND(r,i,n)},{$indices:r,$updates:i})}}),Tc=jn({fft_:function(e){w("complex64"===e.dtype,function(){return"The dtype for tf.spectral.fft() must be complex64 but got "+e.dtype+"."});var t=e.shape[e.shape.length-1],n=e.size/t,r=e.as2D(n,t);return je.runKernel(function(e){return e.fft(r)},{input:e}).reshape(e.shape)}}),Ic=jn({ifft_:function(e){w("complex64"===e.dtype,function(){return"The dtype for tf.spectral.ifft() must be complex64 but got "+e.dtype+"."});var t=e.shape[e.shape.length-1],n=e.size/t,r=e.as2D(n,t);return je.runKernel(function(e){return e.ifft(r)},{input:e}).reshape(e.shape)}}),Rc=jn({rfft_:function(e,t){w("float32"===e.dtype,function(){return"The dtype for rfft() must be real value but got "+e.dtype});var n,r=e.shape[e.shape.length-1],i=e.size/r;if(null!=t&&t<r){var o=e.shape.map(function(e){return 0}),a=e.shape.map(function(e){return e});a[e.shape.length-1]=t,n=e.slice(o,a),r=t}else if(null!=t&&t>r){var s=e.shape.map(function(e){return e});s[e.shape.length-1]=t-r,n=e.concat(Yn(s),e.shape.length-1),r=t}else n=e;var u=n.zerosLike(),c=Ln(n,u).as2D(i,r),l=Tc(c),f=Math.floor(r/2)+1,h=Bn(l),d=Fn(l),p=h.split([f,r-f],h.shape.length-1),m=d.split([f,r-f],d.shape.length-1),v=n.shape.slice();return v[n.shape.length-1]=f,Ln(p[0],m[0]).reshape(v)}}),Mc=jn({irfft_:function(e){var t=e.shape[e.shape.length-1],n=e.size/t;if(t<=2){var r=e.as2D(n,t),i=Ic(r);return Bn(i)}var o=[n,2*(t-1)],a=Bn(e).as2D(n,t),s=Fn(e).as2D(n,t),u=a.slice([0,1],[n,t-2]).reverse(1),c=s.slice([0,1],[n,t-2]).reverse(1).mul(Wn(-1)),l=a.concat(u,1),f=s.concat(c,1);return r=Ln(l,f).as2D(o[0],o[1]),i=Ic(r),Bn(i)}}),Dc=Object.freeze({fft:Tc,ifft:Ic,rfft:Rc,irfft:Mc}),jc=jn({sparseToDense_:function(e,t,n,r){void 0===r&&(r=0);var i=Cn(e,"sparseIndices","sparseToDense","int32"),o=Cn(t,"sparseValues","sparseToDense"),a=Cn(r,"defaultValue","sparseToDense",o.dtype);return function(e,t,n,r){if("int32"!==e.dtype)throw new Error("tf.sparseToDense() expects the indices to be int32 type, but the dtype was "+e.dtype+".");if(e.rank>2)throw new Error("sparseIndices should be a scalar, vector, or matrix, but got shape "+e.shape+".");var i=e.rank>0?e.shape[0]:1,o=e.rank>1?e.shape[1]:1;if(n.length!==o)throw new Error("outputShape has incorrect number of elements:, "+n.length+", should be: "+o+".");var a=t.size;if(0!==t.rank&&(1!==t.rank||a!==i))throw new Error("sparseValues has incorrect shape "+t.shape+", should be [] or ["+i+"]");if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(i,o,n,a),je.runKernel(function(e){return e.sparseToDense(i,o,n,a)},{$sparseIndices:i,$sparseValues:o,$defaultValue:a})}}),Pc=jn({gatherND_:function(e,t){var n=Cn(t,"indices","gatherND","int32"),r=Cn(e,"x","gatherND");return je.runKernel(function(e){return e.gatherND(r,n)},{$x:r,$indices:n})}}),zc=jn({dropout_:function(e,t,n,r){if(null!=n&&!E(e.shape,n))throw new Error("Non-default noise shape is not implemented yet: "+JSON.stringify(n));var i=li(e.shape,0,1,"float32",r).greater(t);return i=i.div(ic(1,t)),e.mul(i)}});function Lc(e,t,n){for(var r=1-e%2,i=new Float32Array(e),o=0;o<e;++o){var a=2*Math.PI*o/(e+r-1);i[o]=t-n*Math.cos(a)}return Vn(i,"float32")}var Bc,Fc=jn({hannWindow_:function(e){return Lc(e,.5,.5)}}),Uc=jn({hammingWindow_:function(e){return Lc(e,.54,.46)}}),Wc=jn({frame_:function(e,t,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=0);for(var o=0,a=[];o+t<=e.size;)a.push(lu(e,o,t)),o+=n;if(r){var s=o+t-e.size,u=Ar([lu(e,o,t-s),Jn([s],i)]);a.push(u)}return 0===a.length?qn([],[0,t]):Ar(a).as2D(a.length,t)}}),Vc=Object.freeze({hannWindow:Fc,hammingWindow:Uc,frame:Wc});!function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(Bc||(Bc={}));var qc=jn({absoluteDifference_:function(e,t,n,r){void 0===r&&(r=Bc.SUM_BY_NONZERO_WEIGHTS);var i=Cn(e,"labels","absoluteDifference"),o=Cn(t,"predictions","absoluteDifference"),a=null;null!=n&&(a=Cn(n,"weights","absoluteDifference")),x(i.shape,o.shape,"Error in absoluteDifference: ");var s=i.sub(o).abs();return Hc(s,a,r)}}),Hc=jn({computeWeightedLoss_:function(e,t,n){void 0===n&&(n=Bc.SUM_BY_NONZERO_WEIGHTS);var r=Cn(e,"losses","computeWeightedLoss"),i=null;null!=t&&(i=Cn(t,"weights","computeWeightedLoss"));var o=null==i?r:r.mul(i);if(n===Bc.NONE)return o;
vendor: 4,228 bytes, line 1
1if(n===Bc.SUM)return o.sum();if(n===Bc.MEAN){if(null==i)return o.mean();var a=r.size/i.size,s=o.sum().div(i.sum());return a>1?s.div(Wn(a)):s}if(n===Bc.SUM_BY_NONZERO_WEIGHTS){if(null==i)return o.sum().div(Wn(r.size));var u=i.mul(Xn(r.shape)).notEqual(Wn(0)).sum().toFloat();return o.sum().div(u)}throw Error("Unknown reduction: "+n)}}),Gc=jn({cosineDistance_:function(e,t,n,r,i){void 0===i&&(i=Bc.SUM_BY_NONZERO_WEIGHTS);var o=Cn(e,"labels","cosineDistance"),a=Cn(t,"predictions","cosineDistance"),s=null;null!=r&&(s=Cn(r,"weights","cosineDistance")),x(o.shape,a.shape,"Error in cosineDistance: ");var u=Wn(1).sub(o.mul(a).sum(n,!0));return Hc(u,s,i)}}),Kc=jn({hingeLoss_:function(e,t,n,r){void 0===r&&(r=Bc.SUM_BY_NONZERO_WEIGHTS);var i=Cn(e,"labels","hingeLoss"),o=Cn(t,"predictions","hingeLoss"),a=null;null!=n&&(a=Cn(n,"weights","hingeLoss")),x(i.shape,o.shape,"Error in hingeLoss: ");var s=Wn(1);i=Wn(2).mul(i).sub(s);var u=s.sub(i.mul(o)).relu();return Hc(u,a,r)}}),$c=jn({huberLoss_:function(e,t,n,r,i){void 0===r&&(r=1),void 0===i&&(i=Bc.SUM_BY_NONZERO_WEIGHTS);var o=Cn(e,"labels","huberLoss"),a=Cn(t,"predictions","huberLoss"),s=null;null!=n&&(s=Cn(n,"weights","huberLoss")),x(o.shape,a.shape,"Error in huberLoss: ");var u=Wn(r),c=a.sub(o).abs(),l=$u(c,u),f=c.sub(l),h=Wn(.5).mul(l.square()).add(u.mul(f));return Hc(h,s,i)}}),Xc=jn({logLoss_:function(e,t,n,r,i){void 0===r&&(r=1e-7),void 0===i&&(i=Bc.SUM_BY_NONZERO_WEIGHTS);var o=Cn(e,"labels","logLoss"),a=Cn(t,"predictions","logLoss"),s=null;null!=n&&(s=Cn(n,"weights","logLoss")),x(o.shape,a.shape,"Error in logLoss: ");var u=Wn(1),c=Wn(r),l=o.mul(a.add(c).log()).neg().sub(u.sub(o).mul(u.sub(a).add(c).log()));return Hc(l,s,i)}}),Yc=jn({meanSquaredError_:function(e,t,n,r){void 0===r&&(r=Bc.SUM_BY_NONZERO_WEIGHTS);var i=Cn(e,"labels","meanSquaredError"),o=Cn(t,"predictions","meanSquaredError"),a=null;null!=n&&(a=Cn(n,"weights","meanSquaredError")),x(i.shape,o.shape,"Error in meanSquaredError: ");var s=i.squaredDifference(o);return Hc(s,a,r)}}),Jc=jn({sigmoidCrossEntropy_:function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=Bc.SUM_BY_NONZERO_WEIGHTS);var o=Cn(e,"multiClassLabels","sigmoidCrossEntropy"),a=Cn(t,"logits","sigmoidCrossEntropy"),s=null;if(null!=n&&(s=Cn(n,"weights","sigmoidCrossEntropy")),x(o.shape,a.shape,"Error in sigmoidCrossEntropy: "),r>0){var u=Wn(r),c=Wn(1),l=Wn(.5);o=o.mul(c.sub(u)).add(l.mul(u))}var f=function(e,t){var n=Cn(e,"labels","sigmoidCrossEntropyWithLogits"),r=Cn(t,"logits","sigmoidCrossEntropyWithLogits");x(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");var i=r.relu(),o=r.mul(n),a=r.abs().neg().exp().log1p();return i.sub(o).add(a)}(o,a);return Hc(f,s,i)}}),Zc=jn({softmaxCrossEntropy_:function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=Bc.SUM_BY_NONZERO_WEIGHTS);var o=Cn(e,"onehotLabels","softmaxCrossEntropy"),a=Cn(t,"logits","softmaxCrossEntropy"),s=null;if(null!=n&&(s=Cn(n,"weights","softmaxCrossEntropy")),x(o.shape,a.shape,"Error in softmaxCrossEntropy: "),r>0){var u=Wn(r),c=Wn(1),l=Wn(o.shape[1]);o=o.mul(c.sub(u)).add(u.div(l))}var f=function(e,t,n){if(void 0===n&&(n=-1),-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error("Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank "+t.rank+" and dim was "+n);return Mn(function(e,t,r){var i=t.logSumExp([n],!0),o=t.toFloat().sub(i);return r([e,o]),{value:o.mul(e).neg().sum([n]),gradFunc:function(e,t){var r=t[0],i=t[1],o=un(e.shape,[n]);return[e.reshape(o).mul(r.toFloat().sub(i.exp())),e.reshape(o).mul(i.exp().sub(r.toFloat()))]}}})(e,t)}(o,a);return Hc(f,s,i)}}),Qc=Object.freeze({get Reduction(){return Bc},absoluteDifference:qc,computeWeightedLoss:Hc,cosineDistance:Gc,hingeLoss:Kc,huberLoss:$c,logLoss:Xc,meanSquaredError:Yc,sigmoidCrossEntropy:Jc,softmaxCrossEntropy:Zc});function el(e,t){return void 0===t&&(t=!1),je.tidy(function(){if(2!==e.shape.length)throw new Error("qr2d() requires a 2D Tensor, but got a "+e.shape.length+"D Tensor.");for(var n=e.shape[0],r=e.shape[1],i=ei(n),o=e.clone(),a=qn([[1]],[1,1]),s=a.clone(),u=n>=r?r:n,c=function(e){var t,u=o,c=s,l=i;t=je.tidy(function(){var t=o.slice([e,e],[n-e,1]),u=t.norm(),c=o.slice([e,e],[1,1]),l=c.sign().neg(),f=c.sub(l.mul(u)),h=t.div(f);
1s=1===h.shape[0]?a.clone():a.concat(h.slice([1,0],[h.shape[0]-1,h.shape[1]]),0);var d=l.matMul(f).div(u).neg(),p=o.slice([e,0],[n-e,r]),m=d.mul(s);o=0===e?p.sub(m.matMul(s.transpose().matMul(p))):o.slice([0,0],[e,r]).concat(p.sub(m.matMul(s.transpose().matMul(p))),0);var v=i.slice([0,e],[n,i.shape[1]-e]);return i=0===e?v.sub(v.matMul(s).matMul(m.transpose())):i.slice([0,0],[n,e]).concat(v.sub(v.matMul(s).matMul(m.transpose())),1),[s,o,i]}),s=t[0],o=t[1],i=t[2],Ft([u,c,l])},l=0;l<u;++l)c(l);return!t&&n>r&&(i=i.slice([0,0],[n,r]),o=o.slice([0,0],[r,r])),[i,o]})}var tl=jn({gramSchmidt_:function(e){var t;if(Array.isArray(e)){t=!1,w(null!=e&&e.length>0,function(){return"Gram-Schmidt process: input must not be null, undefined, or empty"});for(var n=e[0].shape[0],r=function(t){w(e[t].shape[0]===n,function(){return"Gram-Schmidt: Non-unique lengths found in the input vectors: ("+e[t].shape[0]+" vs. "+n+")"})},i=1;i<e.length;++i)r(i)}else t=!0,e=Dr(e,e.shape[0],0).map(function(e){return di(e,[0])});w(e.length<=e[0].shape[0],function(){return"Gram-Schmidt: Number of vectors ("+e.length+") exceeds number of dimensions ("+e[0].shape[0]+")."});var o=[],a=e,s=function(e){o.push(je.tidy(function(){var t=a[e];if(e>0)for(var n=0;n<e;++n){var r=Eu(o[n].mulStrict(t)).mul(o[n]);t=t.sub(r)}return t.div(bc(t,"euclidean"))}))};for(i=0;i<e.length;++i)s(i);return t?pi(o,0):o}}),nl=jn({qr_:function(e,t){if(void 0===t&&(t=!1),e.rank<2)throw new Error("qr() requires input tensor to have a rank >= 2, but got rank "+e.rank);if(2===e.rank)return el(e,t);var n=e.shape.slice(0,e.shape.length-2).reduce(function(e,t){return e*t}),r=gi(e.reshape([n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),i=[],o=[];return r.forEach(function(e){var n=el(e,t),r=n[0],a=n[1];i.push(r),o.push(a)}),[pi(i,0).reshape(e.shape),pi(o,0).reshape(e.shape)]}}),rl=Object.freeze({gramSchmidt:tl,qr:nl});function il(e,t,n,r,i){null==r&&(r=.5),null==i&&(i=Number.NEGATIVE_INFINITY);var o=e.shape[0];return n=Math.min(n,o),w(0<=r&&r<=1,function(){return"iouThreshold must be in [0, 1], but was '"+r+"'"}),w(2===e.rank,function(){return"boxes must be a 2D tensor, but was of rank '"+e.rank+"'"}),w(4===e.shape[1],function(){return"boxes must have 4 columns, but 2nd dimension was "+e.shape[1]}),w(1===t.rank,function(){return"scores must be a 1D tensor"}),w(t.shape[0]===o,function(){return"scores has incompatible shape with boxes. Expected "+o+", but was "+t.shape[0]}),{maxOutputSize:n,iouThreshold:r,scoreThreshold:i}}var ol=jn({resizeBilinear_:function(e,t,n){void 0===n&&(n=!1);var r=Cn(e,"images","resizeBilinear");w(3===r.rank||4===r.rank,function(){return"Error in resizeBilinear: x must be rank 3 or 4, but got rank "+r.rank+"."}),w(2===t.length,function(){return"Error in resizeBilinear: new shape must 2D, but got shape "+t+"."});var i=r,o=!1;3===r.rank&&(o=!0,i=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var a=t[0],s=t[1],u=je.runKernel(function(e,t){return t([i]),e.resizeBilinear(i,a,s,n)},{batchImages:i},function(e,t){return{batchImages:function(){return je.runKernel(function(r){return r.resizeBilinearBackprop(e,t[0],n)},{})}}});return o?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}}),al=jn({resizeNearestNeighbor_:function(e,t,n){void 0===n&&(n=!1);var r=Cn(e,"images","resizeNearestNeighbor");w(3===r.rank||4===r.rank,function(){return"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank "+r.rank+"."}),w(2===t.length,function(){return"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+t+"."}),w("float32"===r.dtype||"int32"===r.dtype,function(){return"`images` must have `int32` or `float32` as dtype"});var i=r,o=!1;3===r.rank&&(o=!0,i=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var a=t[0],s=t[1],u=je.runKernel(function(e,t){return t([i]),e.resizeNearestNeighbor(i,a,s,n)},{batchImages:i},function(e,t){return{batchImages:function(){return je.runKernel(function(r){return r.resizeNearestNeighborBackprop(e,t[0],n)},{})}}});return o?u.as3D(u.shape[1],u.shape[2],u.shape[3]):u}}),sl=jn({nonMaxSuppression_:function(e,t,n,r,i){void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY);var o=Cn(e,"boxes","nonMaxSuppression"),a=Cn(t,"scores","nonMaxSuppression"),s=il(o,a,n,r,i);return n=s.maxOutputSize,r=s.iouThreshold,i=s.scoreThreshold,je.runKernel(function(e){return e.nonMaxSuppression(o,a,n,r,i)},{$boxes:o})}}),ul=jn({cropAndResize_:function(e,t,n,r,i,o){var a=Cn(e,"image","cropAndResize","float32"),s=Cn(t,"boxes","cropAndResize","float32"),u=Cn(n,"boxInd","cropAndResize","int32");i=i||"bilinear",o=o||0;var c=s.shape[0];return w(4===a.rank,function(){return"Error in cropAndResize: image must be rank 4,but got rank "+a.rank+"."}),w(2===s.rank&&4===s.shape[1],function(){return"Error in cropAndResize: boxes must be have size ["+c+",4] but had shape "+s.shape+"."}),w(1===u.rank&&u.shape[0]===c,function(){return"Error in cropAndResize: boxInd must be have size ["+c+"] but had shape "+s.shape+"."}),w(2===r.length,function(){return"Error in cropAndResize: cropSize must be of length 2, but got length "+r.length+"."}),w(r[0]>=1&&r[1]>=1,function(){return"cropSize must be atleast [1,1], but was "+r}),w("bilinear"===i||"nearest"===i,function(){return"method must be bilinear or nearest, but was "+i}),je.runKernel(function(e,t){return e.cropAndResize(a,s,u,r,i,o)},{$image:a,$boxes:s})}}),cl=Object.freeze({resizeBilinear:ol,resizeNearestNeighbor:al,nonMaxSuppression:sl,nonMaxSuppressionAsync:function(e,t,n,r,i){return void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY),c(this,void 0,void 0,function(){var o,a,s,u,c,f;return l(this,function(l){switch(l.label){case 0:return o=Cn(e,"boxes","nonMaxSuppressionAsync"),a=Cn(t,"scores","nonMaxSuppressionAsync"),s=il(o,a,n,r,i),n=s.maxOutputSize,r=s.iouThreshold,i=s.scoreThreshold,[4,o.data()];case 1:return u=l.sent(),[4,a.data()];case 2:return c=l.sent(),f=Er(u,c,n,r,i),o!==e&&o.dispose(),a!==t&&a.dispose(),[2,f]}})})},cropAndResize:ul}),ll=jn({matMul_:function(e,t,n,r,i,o){var a;void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===o&&(o="linear");var s=Cn(e,"a","fused matMul"),u=Cn(t,"b","fused matMul");a=Oe(s,u),s=a[0],u=a[1];var c=n?s.shape[s.rank-2]:s.shape[s.rank-1],l=r?u.shape[u.rank-1]:u.shape[u.rank-2],f=n?s.shape[s.rank-1]:s.shape[s.rank-2],h=r?u.shape[u.rank-2]:u.shape[u.rank-1],d=s.shape.slice(0,-2),p=u.shape.slice(0,-2),m=S(d),v=S(p);w(s.rank>=2&&u.rank>=2&&s.rank===u.rank,function(){return"Error in fused matMul: inputs must have the same rank of at least 2, got ranks "+s.rank+" and "+u.rank+"."}),w(E(d,p),function(){return"Error in fused matMul: outer dimensions ("+d+") and ("+p+") of Tensors with shapes "+s.shape+" and "+u.shape+" must match."}),w(c===l,function(){return"Error in fused matMul: inner shapes ("+c+") and ("+l+") of Tensors with shapes "+s.shape+" and "+u.shape+" and transposeA="+n+" and transposeB="+r+" must match."});var g,y=s.shape.slice(0,-2).concat([f,h]),b=n?s.as3D(m,c,f):s.as3D(m,f,c),x=r?u.as3D(v,h,l):u.as3D(v,l,h);null!=i&&ar(y,(g=Oe(g=Cn(i,"bias","fused matMul"),s)[0]).shape);var _={$a:b,$b:x};return null!=i&&(_.$bias=g),je.runKernel(function(e,t){var i=e.fusedBatchMatMul(b,x,n,r,g,o);return t([b,x,i]),i},_,function(e,t){var a,s=t[0],u=t[1],c=t[2];if(null==o||"linear"===o)a=e;else{if("relu"!==o)throw new Error("Gradient for activation "+o+" has not been implemented yet.");a=e.mul(c.step())}var l={};return null!=i&&(l={$bias:function(){var e=a,t=or(g.shape,a.shape);return t.length>0&&(e=e.sum(t)),e.reshape(g.shape)}}),n||r?!n&&r?Object.assign({$a:function(){return a.matMul(u,!1,!1)},$b:function(){return a.matMul(s,!0,!1)}},l):n&&!r?Object.assign({$a:function(){return u.matMul(a,!1,!0)},$b:function(){return s.matMul(a,!1,!1)}},l):Object.assign({$a:function(){return u.matMul(a,!0,!0)},$b:function(){return a.matMul(s,!0,!0)}},l):Object.assign({$a:function(){return a.matMul(u,!1,!0)},$b:function(){return s.matMul(a,!0,!1)}},l)}).reshape(y)}}),fl=Object.freeze({matMul:ll}),hl=Object.freeze({image:cl,linalg:rl,losses:Qc,spectral:Dc,fused:fl,signal:Vc,op:jn,batchNormalization2d:Ms,batchNormalization3d:Ds,batchNormalization4d:js,batchNormalization:Ps,batchNorm:zs,batchNorm2d:Ls,batchNorm3d:Bs,batchNorm4d:Fs,complex:Ln,real:Bn,imag:Fn,concat:Ar,concat1d:Tr,concat2d:Ir,concat3d:Rr,concat4d:Mr,split:Dr,conv1d:qs,conv2d:Hs,conv3d:Gs,conv2dDerFilter:Ks,depthwiseConv2d:$s,separableConv2d:Xs,conv2dTranspose:Ys,matMul:Js,dot:Zs,outerProduct:Qs,reverse:eu,reverse1d:tu,reverse2d:nu,reverse3d:ru,reverse4d:iu,maxPool:su,avgPool:uu,pool:cu,slice:lu,slice1d:fu,slice2d:hu,slice3d:du,slice4d:pu,abs:Ga,acos:Ka,acosh:$a,asin:Xa,asinh:Ya,atan:Ja,atanh:Za,ceil:Qa,clipByValue:es,cos:ts,cosh:ns,erf:rs,exp:is,expm1:os,floor:as,log:ss,log1p:u
1s,logSigmoid:cs,neg:ls,reciprocal:fs,round:hs,rsqrt:ds,sigmoid:ps,sign:ms,isNaN:vs,isInf:gs,isFinite:ys,sin:bs,sinh:ws,softplus:xs,sqrt:_s,square:ks,step:Ss,tan:Es,tanh:Cs,all:vu,any:gu,argMax:yu,argMin:bu,logSumExp:wu,max:xu,mean:_u,min:ku,moments:Su,sum:Eu,prod:Cu,equal:Nu,equalStrict:Ou,greater:Au,greaterEqual:Tu,greaterEqualStrict:Iu,greaterStrict:Ru,less:Mu,lessEqual:Du,lessEqualStrict:ju,lessStrict:Pu,notEqual:zu,notEqualStrict:Lu,add:Bu,addN:Fu,addStrict:Uu,atan2:Wu,div:Vu,divStrict:qu,floorDiv:Hu,maximum:Gu,maximumStrict:Ku,minimum:$u,minimumStrict:Xu,mod:Yu,modStrict:Ju,mul:Zu,mulStrict:Qu,pow:ec,powStrict:tc,squaredDifference:nc,squaredDifferenceStrict:rc,sub:ic,subStrict:oc,elu:hc,leakyRelu:dc,prelu:pc,relu:mc,selu:vc,logicalAnd:ac,logicalNot:sc,logicalOr:uc,logicalXor:cc,where:lc,whereAsync:fc,buffer:Gr,print:Kr,batchToSpaceND:$r,cast:Xr,clone:Yr,cumsum:Jr,depthToSpace:Zr,expandDims:Qr,eye:ei,multinomial:ti,oneHot:ni,pad:ri,pad1d:ii,pad2d:oi,pad3d:ai,pad4d:si,rand:ui,randomNormal:ci,randomUniform:li,reshape:fi,spaceToBatchND:hi,squeeze:di,stack:pi,tile:mi,truncatedNormal:vi,unstack:gi,setdiff1dAsync:yi,fill:Jn,linspace:Zn,ones:Xn,range:Qn,scalar:Wn,tensor:Un,tensor1d:Vn,tensor2d:qn,tensor3d:Hn,tensor4d:Gn,tensor5d:Kn,tensor6d:$n,zeros:Yn,onesLike:er,zerosLike:tr,transpose:gc,softmax:Pn,logSoftmax:zn,localResponseNormalization:yc,norm:bc,gather:_c,unsortedSegmentSum:kc,basicLSTMCell:Sc,multiRNNCell:Ec,movingAverage:Cc,stridedSlice:Nc,topk:Oc,scatterND:Ac,fft:Tc,ifft:Ic,rfft:Rc,irfft:Mc,sparseToDense:jc,gatherND:Pc,dropout:zc,hannWindow:Fc,hammingWindow:Uc,frame:Wc}),dl=function(){function e(){this.blockSize=48,this.firstUse=!0,f.get("IS_BROWSER")&&(this.fromPixels2DContext=document.createElement("canvas").getContext("2d")),this.data=new nr(this,je)}return e.prototype.register=function(e,t,n){if(this.firstUse&&(this.firstUse=!1,f.get("IS_NODE")&&Zt("\n============================\nHi there \ud83d\udc4b. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================\n")),this.data.has(e))throw new Error("Data buffer is already registered");this.data.set(e,{dtype:n})},e.prototype.write=function(e,t){if(null==t)throw new Error("MathBackendCPU.write(): values can not be null");this.data.get(e).values=t},e.prototype.fromPixels=function(e,t){if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");var n,r;if(f.get("IS_NODE")&&null==e.getContext)throw new Error("When running in node, pixels must be an HTMLCanvasElement like the one returned by the `canvas` npm package");if(null!=e.getContext)n=e.getContext("2d").getImageData(0,0,e.width,e.height).data;else if(e instanceof ImageData||e.data instanceof Uint8Array)n=e.data;else{if(!(e instanceof HTMLImageElement||e instanceof HTMLVideoElement))throw new Error("pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData or {data: Uint32Array, width: number, height: number}, but was "+e.constructor.name);if(null==this.fromPixels2DContext)throw new Error("Can't read pixels from HTMLImageElement outside the browser.");this.fromPixels2DContext.canvas.width=e.width,this.fromPixels2DContext.canvas.height=e.height,this.fromPixels2DContext.drawImage(e,0,0,e.width,e.height),n=this.fromPixels2DContext.getImageData(0,0,e.width,e.height).data}if(4===t)r=new Int32Array(n);else{var i=e.width*e.height;r=new Int32Array(i*t);for(var o=0;o<i;o++)for(var a=0;a<t;++a)r[o*t+a]=n[4*o+a]}return Hn(r,[e.height,e.width,t],"int32")},e.prototype.read=function(e){return c(this,void 0,void 0,function(){return l(this,function(t){return[2,this.readSync(e)]})})},e.prototype.readSync=function(e){var t=this.data.get(e),n=t.dtype,r=t.complexTensors;return"complex64"===n?xr(this.readSync(r.real.dataId),this.readSync(r.imag.dataId)):this.data.get(e).values},e.prototype.bufferSync=function(e){return Gr(e.shape,e.dtype,this.readSync(e.dataId))},e.prototype.disposeData=function(e){if(this.data.has(e)){var t=this.data.get(e).
vendor: 31,813 bytes, line 1
1complexTensors;null!=t&&(t.real.dispose(),t.imag.dispose()),this.data.delete(e)}},e.prototype.time=function(e){return c(this,void 0,void 0,function(){var t;return l(this,function(n){return t=ee(),e(),[2,{kernelMs:ee()-t}]})})},e.prototype.memory=function(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}},e.prototype.complex=function(e,t){var n=ve.make(e.shape,{},"complex64");return this.data.get(n.dataId).complexTensors={real:je.keep(e.clone()),imag:je.keep(t.clone())},n},e.prototype.real=function(e){return this.data.get(e.dataId).complexTensors.real.clone()},e.prototype.imag=function(e){return this.data.get(e.dataId).complexTensors.imag.clone()},e.prototype.assertNotComplex=function(e,t){Array.isArray(e)||(e=[e]),e.forEach(function(e){null!=e&&w("complex64"!==e.dtype,function(){return t+" does not support complex64 tensors."})})},e.prototype.slice=function(e,t,n){if(this.assertNotComplex(e,"slice"),_n(e.shape,t,n)){var r=kn(t,e.strides),i=S(n);return Un(this.readSync(e.dataId).subarray(r,r+i),n,e.dtype)}for(var o=Gr(n,e.dtype),a=this.bufferSync(e),s=0;s<o.size;++s){var u=o.indexToLoc(s).map(function(e,n){return e+t[n]});o.values[s]=a.get.apply(a,u)}return o.toTensor()},e.prototype.stridedSlice=function(e,t,n,r,i,o,a,s,u){this.assertNotComplex(e,"stridedSlice");var c=bn(e.shape,t,n,r,i,o,a,s,u),l=c[0],f=c[1],h=c[2],d=f.filter(function(e,t){return-1===h.indexOf(t)});if(d.some(function(e){return 0===e}))return Un([],d);for(var p=Gr(f,e.dtype),m=this.bufferSync(e),v=0;v<p.size;v++){for(var g=p.indexToLoc(v),y=new Array(g.length),b=0;b<y.length;b++)y[b]=g[b]*r[b]+l[b];p.set.apply(p,[m.get.apply(m,y)].concat(g))}return p.toTensor().reshape(d)},e.prototype.unstack=function(e,t){for(var n=e.shape[t],r=new Array(e.rank-1),i=0,o=0;o<e.rank;o++)o!==t&&(r[i++]=e.shape[o]);var a=new Array(e.rank).fill(0),s=e.shape.slice();s[t]=1;var u=new Array(n);for(o=0;o<u.length;o++)a[t]=o,u[o]=this.slice(e,a,s).reshape(r);return u},e.prototype.reverse=function(e,t){this.assertNotComplex(e,"reverse");for(var n=Gr(e.shape,e.dtype),r=this.bufferSync(e),i=function(i){var o=n.indexToLoc(i),a=o.slice();t.forEach(function(t){return a[t]=e.shape[t]-1-a[t]}),n.set.apply(n,[r.get.apply(r,a)].concat(o))},o=0;o<n.size;o++)i(o);return n.toTensor()},e.prototype.concat=function(e,t){var n=this;this.assertNotComplex(e,"concat");var r=e.map(function(e){var n=S(e.shape.slice(t));return e.as2D(-1,n)}),i=pn(r.map(function(e){return e.shape}),1),o=Gr(i,e[0].dtype).values;if(1===r[0].shape[0]){var a=0;r.forEach(function(e){o.set(n.readSync(e.dataId),a),a+=e.size})}else{var s=0;r.forEach(function(e){for(var t=n.readSync(e.dataId),r=0,a=0;a<e.shape[0];++a)for(var u=a*i[1]+s,c=0;c<e.shape[1];++c)o[u+c]=t[r++];s+=e.shape[1]})}var u=pn(e.map(function(e){return e.shape}),t);return Un(o,u,e[0].dtype)},e.prototype.neg=function(e){return this.assertNotComplex(e,"neg"),this.multiply(Wn(-1),e)},e.prototype.add=function(e,t){return"complex64"===e.dtype||"complex64"===t.dtype?this.broadcastedBinaryComplexOp(e.cast("complex64"),t.cast("complex64"),function(e,t,n,r){return{real:e+n,imag:t+r}}):this.broadcastedBinaryOp(e,t,Ce(e.dtype,t.dtype),function(e,t){return e+t})},e.prototype.addN=function(e){var t=this;this.assertNotComplex(e,"addN");for(var n=e.map(function(e){return t.readSync(e.dataId)}),r=Gr(e[0].shape,e[0].dtype),i=r.values,o=0;o<e.length;o++)for(var a=n[o],s=0;s<i.length;s++)i[s]+=a[s];return r.toTensor()},e.prototype.subtract=function(e,t){return"complex64"===e.dtype||"complex64"===t.dtype?this.broadcastedBinaryComplexOp(e.cast("complex64"),t.cast("complex64"),function(e,t,n,r){return{real:e-n,imag:t-r}}):this.broadcastedBinaryOp(e,t,Ce(e.dtype,t.dtype),function(e,t){return e-t})},e.prototype.pow=function(e,t){return this.assertNotComplex([e,t],"pow"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.pow(e,t)})},e.prototype.batchMatMul=function(e,t,n,r){this.assertNotComplex([e,t],"matMul");for(var i=n?e.shape[1]:e.shape[2],o=n?e.shape[2]:e.shape[1],a=r?t.shape[1]:t.shape[2],s=e.shape[0],u=this.readSync(e.dataId),c=this.readSync(t.dataId),l=n?[e.strides[0],1,e.strides[1]]:[e.strides[0],e.strides[1],1],f=l[0],h=l[1],d=l[2],p=r?[1,t.strides[1],t.strides[0]]:[t.strides[1],1,t.strides[0]],m=p[0],v=p[1],g=p[2],y=o*a,b=Gr([s,o,a],e.dtype),w=b.values,x=this.blockSize,_=0;_<s;_++)for(var k=0;k<o;k+=x)for(var S=0;S<a;S+=x)for(var E=0;E<i;E+=x)for(var C=Math.min(k+x,o),N=Math.min(S+x,a),O=Math.min(E+x,i),A=k;A<C;A++)for(var T=S;T<N;T++){for(var I=0,R=E;R<O;R++)I+=u[_*f+A*h+R*d]*c[R*m+T*v+_*g];w[_*y+(A*a+T)]+=I}return b.toTensor()},e.prototype.fusedBatchMatMul=function(e,t,n,r,i,o){var a=this.batchMatMul(e,t,n,r);return i&&(a=this.add(a,i)),o&&(a=function(e,t,n){if("linear"===t)return e.linear(n);if("relu"===t)return e.relu(n);throw new Error("Activation "+t+" has not been implemented for the CPU backend.")}(this,o,a)),a},e.prototype.multiply=function(e,t){return"complex64"===e.dtype||"complex64"===t.dtype?this.broadcastedBinaryComplexOp(e.cast("complex64"),t.cast("complex64"),function(e,t,n,r){return{real:e*n-t*r,imag:e*r+t*n}}):this.broadcastedBinaryOp(e,t,Ce(e.dtype,t.dtype),function(e,t){return e*t})},e.prototype.realDivide=function(e,t){return this.assertNotComplex([e,t],"realDivide"),this.broadcastedBinaryOp(e,t,"float32",function(e,t){return e/t})},e.prototype.floorDiv=function(e,t){return this.assertNotComplex([e,t],"floorDiv"),this.broadcastedBinaryOp(e,t,"int32",function(e,t){return Math.floor(e/t)})},e.prototype.sum=function(e,t){this.assertNotComplex(e,"sum"),cn("sum",t,e.rank);for(var n=sn(e.shape,t),r=n[0],i=n[1],o=Yn(r,Ce(e.dtype,"int32")),a=S(i),s=this.readSync(o.dataId),u=this.readSync(e.dataId),c=0;c<s.length;++c){for(var l=c*a,f=0,h=0;h<a;++h)f+=u[l+h];s[c]=f}return o},e.prototype.prod=function(e,t){this.assertNotComplex(e,"sum");for(var n=sn(e.shape,t),r=n[0],i=n[1],o=Yn(r,Ce(e.dtype,"int32")),a=S(i),s=this.readSync(o.dataId),u=this.readSync(e.dataId),c=0;c<s.length;++c){for(var l=c*a,f=1,h=0;h<a;++h)f*=u[l+h];s[c]=f}return o},e.prototype.unsortedSegmentSum=function(e,t,n){this.assertNotComplex(e,"unsortedSegmentSum");for(var r=[],i=e.rank-t.rank,o=0;o<i;++o)t=t.expandDims(o+1);for(o=0;o<n;++o){var a=Wn(o,"int32"),s=Nu(a,t).asType("float32").mul(e).sum(0);r.push(s)}return pi(r)},e.prototype.argMin=function(e,t){this.assertNotComplex(e,"argMin");var n=[t];cn("argMin",n,e.rank);for(var r=sn(e.shape,n),i=r[0],o=r[1],a=Yn(i,"int32"),s=S(o),u=this.readSync(a.dataId),c=this.readSync(e.dataId),l=0;l<u.length;++l){for(var f=l*s,h=c[f],d=0,p=0;p<s;++p){var m=c[f+p];m<h&&(h=m,d=p)}u[l]=d}return a},e.prototype.argMax=function(e,t){this.assertNotComplex(e,"argMax");var n=[t];cn("argMax",n,e.rank);for(var r=sn(e.shape,n),i=r[0],o=r[1],a=Yn(i,"int32"),s=S(o),u=this.readSync(a.dataId),c=this.readSync(e.dataId),l=0;l<u.length;++l){for(var f=l*s,h=c[f],d=0,p=0;p<s;++p){var m=c[f+p];m>h&&(h=m,d=p)}u[l]=d}return a},e.prototype.cumsum=function(e,t,n,r){if(this.assertNotComplex(e,"cumsum"),t!==e.rank-1)throw new Error("backend.cumsum in CPU expects an inner-most axis="+(e.rank-1)+" but got axis="+t);for(var i=Ce(e.dtype,"int32"),o=Yn(e.shape,i),a=this.readSync(o.dataId),s=this.readSync(e.dataId),u=e.shape[e.rank-1],c=r?function(e,t){return e+u-t-1}:function(e,t){return e+t},l=0;l<s.length;l+=u)for(var f=0;f<u;f++){var h=c(l,f);if(0===f)a[h]=n?0:s[h];else{var d=c(l,f-1);a[h]=n?s[d]+a[d]:s[h]+a[d]}}return o},e.prototype.equal=function(e,t){return this.assertNotComplex([e,t],"equal"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e===t?1:0})},e.prototype.notEqual=function(e,t){return this.assertNotComplex([e,t],"notEqual"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e!==t?1:0})},e.prototype.less=function(e,t){return this.assertNotComplex([e,t],"less"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e<t?1:0})},e.prototype.lessEqual=function(e,t){return this.assertNotComplex([e,t],"lessEqual"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e<=t?1:0})},e.prototype.greater=function(e,t){return this.assertNotComplex([e,t],"greater"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e>t?1:0})},e.prototype.greaterEqual=function(e,t){return this.assertNotComplex([e,t],"greaterEqual"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e>=t?1:0})},e.prototype.logicalNot=function(e){this.assertNotComplex(e,"logicalNot");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t[r]?0:1;return ve.make(e.shape,{values:n},"bool")},e.prototype.logicalAnd=function(e,t){return this.assertNotComplex([e,t],"logicalAnd"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e&&t})},e.prototype.logicalOr=function(e,t){return this.assertNotComplex([e,t],"logicalOr"),this.broadcastedBinaryOp(e,t,"bool",function(e,t){return e||t})},e.prototype.select=function(e,t,n){this.assertNotComplex([e,t,n],"select");for(var r=this.readSync(e.dataId),i=this.readSync(t.dataId),o=this.readSync(n.dataId),a=Yn(t.shape,Ce(t.dtype,n.dtype)),s=this.readSync(a.dataId),u=0,c=0===e.rank||e.rank>1||1===t.rank?1:t.shape[1],l=0;l<r.length;l++)for(var f=0;f<c;f++)1===r[l]?s[u++]=i[l]:s[u++]=o[l];return a},e.prototype.where=function(e){this.assertNotComplex([e],"where");var t=this.readSync(e.dataId);return bi(e.shape,t)},e.prototype.topk=function(e,t,n){return this.assertNotComplex(e,"topk"),Or(this.readSync(e.dataId),e.shape,e.dtype,t)},e.prototype.min=function(e,t){this.assertNotComplex(e,"min"),cn("min",t,e.rank);for(var n=sn(e.shape,t),r=n[0],i=n[1],o=Yn(r,e.dtype),a=S(i),s=this.readSync(o.dataId),u=this.readSync(e.dataId),c=0;c<s.length;++c){for(var l=c*a,f=u[l],h=0;h<a;++h){var d=u[l+h];d<f&&(f=d)}s[c]=f}return o},e.prototype.minimum=function(e,t){return this.assertNotComplex([e,t],"minimum"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.min(e,t)})},e.prototype.mod=function(e,t){return this.assertNotComplex([e,t],"mod"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){var n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})},e.prototype.max=function(e,t){this.assertNotComplex(e,"max"),cn("max",t,e.rank);for(var n=sn(e.shape,t),r=n[0],i=n[1],o=Yn(r,e.dtype),a=S(i),s=this.readSync(o.dataId),u=this.readSync(e.dataId),c=0;c<s.length;++c){for(var l=c*a,f=u[l],h=0;h<a;++h){var d=u[l+h];d>f&&(f=d)}s[c]=f}return o},e.prototype.maximum=function(e,t){return this.assertNotComplex([e,t],"maximum"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.max(e,t)})},e.prototype.all=function(e,t){this.assertNotComplex(e,"all"),cn("all",t,e.rank);for(var n=sn(e.shape,t),r=n[0],i=n[1],o=Yn(r,e.dtype),a=S(i),s=this.readSync(o.dataId),u=this.readSync(e.dataId),c=0;c<s.length;++c){for(var l=c*a,f=u[l],h=0;h<a;++h){var d=u[l+h];f=f&&d}s[c]=f}return o},e.prototype.any=function(e,t){this.assertNotComplex(e,"any"),cn("any",t,e.rank);for(var n=sn(e.shape,t),r=n[0],i=n[1],o=Yn(r,e.dtype),a=S(i),s=this.readSync(o.dataId),u=this.readSync(e.dataId),c=0;c<s.length;++c){for(var l=c*a,f=u[l],h=0;h<a;++h){var d=u[l+h];f=f||d}s[c]=f}return o},e.prototype.squaredDifference=function(e,t){return this.assertNotComplex([e,t],"squaredDifference"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){var n=e-t;return n*n})},e.prototype.ceil=function(e){this.assertNotComplex(e,"ceil");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.ceil(t[r]);return ve.make(e.shape,{values:n})},e.prototype.floor=function(e){this.assertNotComplex(e,"floor");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.floor(t[r]);return ve.make(e.shape,{values:n})},e.prototype.sign=function(e){this.assertNotComplex(e,"x");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)t[r]<0?n[r]=-1:t[r]>0?n[r]=1:n[r]=0;return ve.make(e.shape,{values:n})},e.prototype.isNaN=function(e){this.assertNotComplex(e,"x");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)Number.isNaN(t[r])&&(n[r]=1);return ve.make(e.shape,{values:n},"bool")},e.prototype.isInf=function(e){this.assertNotComplex(e,"x");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)Math.abs(t[r])===1/0&&(n[r]=1);return ve.make(e.shape,{values:n},"bool")},e.prototype.isFinite=function(e){this.assertNotComplex(e,"x");for(var t=this.readSync(e.dataId),n=new Uint8Array(t.length),r=0;r<t.length;++r)Number.isFinite(t[r])&&(n[r]=1);return ve.make(e.shape,{values:n},"bool")},e.prototype.round=function(e){this.assertNotComplex(e,"round");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=Math.floor(t[r]);t[r]-i<.5?n[r]=Math.floor(t[r]):t[r]-i>.5?n[r]=Math.ceil(t[r]):n[r]=i%2==0?i:i+1}return ve.make(e.shape,{values:n})},e.prototype.exp=function(e){this.assertNotComplex(e,"exp");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.exp(t[r]);return ve.make(e.shape,{values:n})},e.prototype.expm1=function(e){this.assertNotComplex(e,"expm1");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=Math.expm1(t[r]);return ve.make(e.shape,{values:n})},e.prototype.log=function(e){this.assertNotComplex(e,"log");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=t[r];n[r]=Math.log(i)}return ve.make(e.shape,{values:n})},e.prototype.log1p=function(e){this.assertNotComplex(e,"log1p");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=t[r];n[r]=Math.log1p(i)}return ve.make(e.shape,{values:n})},e.prototype.sqrt=function(e){this.assertNotComplex(e,"sqrt");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=t[r];n[r]=Math.sqrt(i)}return ve.make(e.shape,{values:n})},e.prototype.rsqrt=function(e){this.assertNotComplex(e,"rsqrt");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=t[r];n[r]=1/Math.sqrt(i)}return ve.make(e.shape,{values:n})},e.prototype.square=function(e){this.assertNotComplex(e,"square");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r){var i=t[r];n[r]=i*i}return ve.make(e.shape,{values:n})},e.prototype.reciprocal=function(e){this.assertNotComplex(e,"reciprocal");for(var t=this.readSync(e.dataId),n=new Float32Array(t.length),r=0;r<t.length;++r)n[r]=1/t[r];return ve.make(e.shape,{values:n})},e.prototype.linear=function(e){return e},e.prototype.relu=function(e){this.assertNotComplex(e,"relu");for(var t=Yn(e.shape,e.dtype),n=this.readSync(t.dataId),r=this.readSync(e.dataId),i=0;i<r.length;++i)n[i]=Math.max(0,r[i]);return t},e.prototype.prelu=function(e,t){return this.assertNotComplex([e,t],"prelu"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return e<0?t*e:e})},e.prototype.elu=function(e){this.assertNotComplex(e,"elu");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r){var i=n[r];t[r]=i>=0?i:Math.exp(i)-1}return ve.make(e.shape,{values:t})},e.prototype.eluDer=function(e,t){this.assertNotComplex([e,t],"eluDer");for(var n=new Float32Array(t.size),r=this.readSync(t.dataId),i=this.readSync(e.dataId),o=0;o<r.length;++o){var a=r[o];n[o]=a>=1?i[o]:i[o]*(a+1)}return ve.make(t.shape,{values:n})},e.prototype.selu=function(e){this.assertNotComplex(e,"selu");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r){var i=n[r];t[r]=i>=0?1.0507009873554805*i:1.7580993408473768*(Math.exp(i)-1)}return ve.make(e.shape,{values:t})},e.prototype.clip=function(e,t,n){this.assertNotComplex(e,"clip");for(var r=new Float32Array(e.size),i=this.readSync(e.dataId),o=0;o<i.length;++o){var a=i[o];r[o]=a>n?n:a<t?t:a}return ve.make(e.shape,{values:r})},e.prototype.abs=function(e){for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.abs(n[r]);return ve.make(e.shape,{values:t})},e.prototype.complexAbs=function(e){for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<e.size;++r){var i=n[2*r],o=n[2*r+1];t[r]=Math.hypot(i,o)}return ve.make(e.shape,{values:t})},e.prototype.int=function(e){this.assertNotComplex(e,"int");for(var t=new Int32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=n[r];return ve.make(e.shape,{values:t},"int32")},e.prototype.sigmoid=function(e){this.assertNotComplex(e,"sigmoid");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=1/(1+Math.exp(-n[r]));return ve.make(e.shape,{values:t})},e.prototype.softplus=function(e){this.assertNotComplex(e,"softplus");for(var t=Math.log(1.1920928955078125e-7)+2,n=new Float32Array(e.size),r=this.readSync(e.dataId),i=0;i<r.length;++i){var o,a=r[i]>-t,s=r[i]<t,u=Math.exp(r[i]);o=s?u:a?r[i]:Math.log(1+u),n[i]=o}return ve.make(e.shape,{values:n})},e.prototype.sin=function(e){this.assertNotComplex(e,"sin");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.sin(n[r]);return ve.make(e.shape,{values:t})},e.prototype.cos=function(e){this.assertNotComplex(e,"cos");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.cos(n[r]);return ve.make(e.shape,{values:t})},e.prototype.tan=function(e){this.assertNotComplex(e,"tan");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.tan(n[r]);return ve.make(e.shape,{values:t})},e.prototype.asin=function(e){this.assertNotComplex(e,"asin");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.asin(n[r]);return ve.make(e.shape,{values:t})},e.prototype.acos=function(e){this.assertNotComplex(e,"acos");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.acos(n[r]);return ve.make(e.shape,{values:t})},e.prototype.atan=function(e){this.assertNotComplex(e,"atan");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.atan(n[r]);return ve.make(e.shape,{values:t})},e.prototype.atan2=function(e,t){return this.assertNotComplex([e,t],"atan2"),this.broadcastedBinaryOp(e,t,e.dtype,function(e,t){return Math.atan2(e,t)})},e.prototype.sinh=function(e){this.assertNotComplex(e,"sinh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.sinh(n[r]);return ve.make(e.shape,{values:t})},e.prototype.cosh=function(e){this.assertNotComplex(e,"cosh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.cosh(n[r]);return ve.make(e.shape,{values:t})},e.prototype.tanh=function(e){this.assertNotComplex(e,"tanh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=N(n[r]);return ve.make(e.shape,{values:t})},e.prototype.asinh=function(e){this.assertNotComplex(e,"asinh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.asinh(n[r]);return ve.make(e.shape,{values:t})},e.prototype.acosh=function(e){this.assertNotComplex(e,"acosh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.acosh(n[r]);return ve.make(e.shape,{values:t})},e.prototype.atanh=function(e){this.assertNotComplex(e,"atanh");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r)t[r]=Math.atanh(n[r]);return ve.make(e.shape,{values:t})},e.prototype.erf=function(e){this.assertNotComplex(e,"erf");for(var t=new Float32Array(e.size),n=this.readSync(e.dataId),r=0;r<n.length;++r){var i=n[r],o=1/(1+.3275911*i);t[r]=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-i*i)}return ve.make(e.shape,{values:t})},e.prototype.step=function(e,t){void 0===t&&(t=0),this.assertNotComplex(e,"step");for(var n=new Float32Array(e.size),r=this.readSync(e.dataId),i=0;i<r.length;++i){var o=r[i];isNaN(o)?n[i]=NaN:n[i]=o>0?1:t}return ve.make(e.shape,{values:n})},e.prototype.conv2d=function(e,t,n){this.assertNotComplex([e,t],"conv2d");for(var r=n.filterHeight,i=n.filterWidth,o=n.dilationHeight,a=n.dilationWidth,s=n.padInfo.left,u=n.padInfo.top,c=Gr(n.outShape,e.dtype),l=this.readSync(e.dataId),f=this.readSync(t.dataId),h=c.values,d=0;d<n.batchSize;++d)for(var p=d*e.strides[0],m=d*c.strides[0],v=0;v<n.outHeight;++v)for(var g=m+v*c.strides[1],y=v*n.strideHeight-u,b=0;b<r;b++){var w=y+b*o;if(!(w<0||w>=n.inHeight))for(var x=b*t.strides[0],_=p+w*e.strides[1],k=0;k<n.outWidth;++k)for(var S=g+k*n.outChannels,E=k*n.strideWidth-s,C=0;C<i;C++){var N=E+C*a;if(!(N<0||N>=n.inWidth))for(var O=x+C*t.strides[1],A=_+N*n.inChannels,T=O,I=0;I<n.inChannels;++I){for(var R=l[A+I],M=0;M<n.outChannels;++M)h[S+M]+=R*f[T+M];T+=n.outChannels}}}return c.toTensor()},e.prototype.conv3d=function(e,t,n){for(var r=n.filterDepth,i=n.filterHeight,o=n.filterWidth,a=n.dilationDepth,s=n.dilationHeight,u=n.dilationWidth,c=n.padInfo.front,l=n.padInfo.left,f=n.padInfo.top,h=Gr(n.outShape,e.dtype),d=this.readSync(e.dataId),p=this.readSync(t.dataId),m=h.values,v=0;v<n.batchSize;++v)for(var g=v*e.strides[0],y=v*h.strides[0],b=0;b<n.outDepth;++b)for(var w=y+b*h.strides[1],x=b*n.strideDepth-c,_=0;_<r;_++){var k=x+_*a;if(!(k<0||k>=n.inDepth))for(var S=_*t.strides[0],E=g+k*e.strides[1],C=0;C<n.outHeight;++C)for(var N=w+C*h.strides[2],O=C*n.strideHeight-f,A=0;A<i;A++){var T=O+A*s;if(!(T<0||T>=n.inHeight))for(var I=S+A*t.strides[1],R=E+T*e.strides[2],M=0;M<n.outWidth;++M)for(var D=N+M*n.outChannels,j=M*n.strideWidth-l,P=0;P<o;P++){var z=j+P*u;if(!(z<0||z>=n.inWidth))for(var L=I+P*t.strides[2],B=R+z*n.inChannels,F=L,U=0;U<n.inChannels;++U){for(var W=d[B+U],V=0;V<n.outChannels;++V)m[D+V]+=W*p[F+V];F+=n.outChannels}}}}return h.toTensor()},e.prototype.conv2dDerInput=function(e,t,n){this.assertNotComplex([e,t],"conv2dDerInput");for(var r=Gr(n.inShape,"float32"),i=r.values,o=r.strides,a=o[0],s=o[1],u=o[2],c=this.readSync(e.dataId),l=e.strides,f=l[0],h=l[1],d=l[2],p=this.readSync(t.dataId),m=t.strides,v=m[0],g=m[1],y=m[2],b=n.batchSize,w=n.filterHeight,x=n.filterWidth,_=n.inChannels,k=n.inHeight,S=n.inWidth,E=n.outChannels,C=n.outHeight,N=n.outWidth,O=n.strideHeight,A=n.strideWidth,T=w-1-n.padInfo.top,I=x-1-n.padInfo.left,R=0;R<b;++R)for(var M=0;M<_;++M)for(var D=0;D<k;++D)for(var j=D-T,P=Math.max(0,Math.ceil(j/O)),z=Math.min(C,(w+j)/O),L=0;L<S;++L){for(var B=L-I,F=Math.max(0,Math.ceil(B/A)),U=Math.min(N,(x+B)/A),W=0,V=P;V<z;++V)for(var q=V*O-j,H=F;H<U;++H)for(var G=f*R+h*V+d*H,K=v*(w-1-q)+g*(x-1-(H*A-B))+y*M,$=0;$<E;++$)W+=c[G+$]*p[K+$];i[a*R+s*D+u*L+M]=W}return r.toTensor()},e.prototype.conv3dDerInput=function(e,t,n){for(var r=Gr(n.inShape,"float32"),i=r.values,o=r.strides,a=o[0],s=o[1],u=o[2],c=o[3],l=this.readSync(e.dataId),f=e.strides,h=f[0],d=f[1],p=f[2],m=f[3],v=this.readSync(t.dataId),g=t.strides,y=g[0],b=g[1],w=g[2],x=g[3],_=n.batchSize,k=n.filterDepth,S=n.filterHeight,E=n.filterWidth,C=n.inChannels,N=n.inDepth,O=n.inHeight,A=n.inWidth,T=n.outChannels,I=n.outDepth,R=n.outHeight,M=n.outWidth,D=n.strideDepth,j=n.strideHeight,P=n.strideWidth,z=k-1-n.padInfo.front,L=S-1-n.padInfo.top,B=E-1-n.padInfo.left,F=0;F<_;++F)for(var U=0;U<C;++U)for(var W=0;W<N;++W)for(var V=W-z,q=Math.max(0,Math.ceil(V/D)),H=Math.min(I,(k+V)/D),G=0;G<O;++G)for(var K=G-L,$=Math.max(0,Math.ceil(K/j)),X=Math.min(R,(S+K)/j),Y=0;Y<A;++Y){for(var J=Y-B,Z=Math.max(0,Math.ceil(J/P)),Q=Math.min(M,(E+J)/P),ee=0,te=q;te<H;++te)for(var ne=te*D-V,re=$;re<X;++re)for(var ie=re*j-K,oe=Z;oe<Q;++oe)for(var ae=h*F+d*te+p*re+m*oe,se=y*(k-1-ne)+b*(S-1-ie)+w*(E-1-(oe*P-J))+x*U,ue=0;ue<T;++ue)ee+=l[ae+ue]*v[se+ue];i[a*F+s*W+u*G+c*Y+U]=ee}return r.toTensor()},e.prototype.conv2dDerFilter=function(e,t,n){this.assertNotComplex([e,t],"conv2dDerFilter");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,a=n.filterWidth,s=Gr(n.filterShape,"float32"),u=n.padInfo.left,c=n.padInfo.top,l=this.bufferSync(e),f=this.bufferSync(t),h=0;h<o;++h)for(var d=Math.max(0,Math.ceil((c-h)/r)),p=Math.min(n.outHeight,(n.inHeight+c-h)/r),m=0;m<a;++m)for(var v=Math.max(0,Math.ceil((u-m)/i)),g=Math.min(n.outWidth,(n.inWidth+u-m)/i),y=0;y<n.inChannels;++y)for(var b=0;b<n.outChannels;++b){for(var w=0,x=0;x<n.batchSize;++x)for(var _=d;_<p;++_)for(var k=h+_*r-c,S=v;S<g;++S){var E=m+S*i-u;w+=l.get(x,k,E,y)*f.get(x,_,S,b)}s.set(w,h,m,y,b)}return s.toTensor()},e.prototype.conv3dDerFilter=function(e,t,n){for(var r=n.strideDepth,i=n.strideHeight,o=n.strideWidth,a=n.filterDepth,s=n.filterHeight,u=n.filterWidth,c=Gr(n.filterShape,"float32"),l=c.values,f=c.strides,h=f[0],d=f[1],p=f[2],m=f[3],v=this.readSync(t.dataId),g=t.strides,y=g[0],b=g[1],w=g[2],x=g[3],_=this.readSync(e.dataId),k=e.strides,S=k[0],E=k[1],C=k[2],N=k[3],O=n.padInfo.front,A=n.padInfo.left,T=n.padInfo.top,I=0;I<a;++I)for(var R=Math.max(0,Math.ceil((O-I)/r)),M=Math.min(n.outDepth,(n.inDepth+O-I)/r),D=I*h,j=0;j<s;++j)for(var P=Math.max(0,Math.ceil((T-j)/i)),z=Math.min(n.outHeight,(n.inHeight+T-j)/i),L=j*d+D,B=0;B<u;++B)for(var F=Math.max(0,Math.ceil((A-B)/o)),U=Math.min(n.outWidth,(n.inWidth+A-B)/o),W=B*p+L,V=0;V<n.inChannels;++V)for(var q=V*m+W,H=0;H<n.outChannels;++H){for(var G=0,K=0;K<n.batchSize;++K)for(var $=K*S,X=K*y,Y=R;Y<M;++Y)for(var J=(I+Y*r-O)*E+$,Z=Y*b+X,Q=P;Q<z;++Q)for(var ee=(j+Q*i-T)*C+J,te=Q*w+Z,ne=F;ne<U;++ne){var re=ne*x+te;G+=_[(B+ne*o-A)*N+ee+V]*v[re+H]}l[q+H]=G}return c.toTensor()},e.prototype.depthwiseConv2D=function(e,t,n){this.assertNotComplex([e,t],"depthwiseConv2D");for(var r=n.filterHeight,i=n.filterWidth,o=n.dilationHeight,a=n.dilationWidth,s=n.padInfo.left,u=n.padInfo.top,c=n.outChannels/n.inChannels,l=Gr(n.outShape,e.dtype),f=this.readSync(e.dataId),h=this.readSync(t.dataId),d=l.values,p=0;p<n.batchSize;++p)for(var m=p*e.strides[0],v=p*l.strides[0],g=0;g<n.outHeight;++g)for(var y=v+g*l.strides[1],b=g*n.strideHeight-s,w=0;w<r;++w){var x=b+w*o;if(!(x<0||x>=n.inHeight))for(var _=w*t.strides[0],k=m+x*e.strides[1],S=0;S<n.outWidth;++S)for(var E=y+S*l.strides[2],C=S*n.strideWidth-u,N=0;N<i;++N){var O=C+N*a;if(!(O<0||O>=n.inWidth))for(var A=_+N*t.strides[1],T=k+O*n.inChannels,I=E,R=A,M=0;M<n.inChannels;++M){for(var D=f[T+M],j=0;j<c;++j)d[I+j]+=D*h[R+j];I+=c,R+=c}}}return l.toTensor()},e.prototype.depthwiseConv2DDerInput=function(e,t,n){this.assertNotComplex([e,t],"depthwiseConv2DDerInput");for(var r=Gr(n.inShape,"float32"),i=r.values,o=r.strides,a=o[0],s=o[1],u=o[2],c=this.readSync(e.dataId),l=e.strides,f=l[0],h=l[1],d=l[2],p=this.readSync(t.dataId),m=t.strides,v=m[0],g=m[1],y=m[2],b=n.batchSize,w=n.filterHeight,x=n.filterWidth,_=n.inChannels,k=n.inHeight,S=n.inWidth,E=n.outChannels,C=n.outHeight,N=n.outWidth,O=n.strideHeight,A=n.strideWidth,T=w-1-n.padInfo.top,I=x-1-n.padInfo.left,R=E/_,M=0;M<b;++M)for(var D=0;D<_;++D)for(var j=0;j<k;++j)for(var P=j-T,z=Math.max(0,Math.ceil(P/O)),L=Math.min(C,(w+P)/O),B=0;B<S;++B){for(var F=B-I,U=Math.max(0,Math.ceil(F/A)),W=Math.min(N,(x+F)/A),V=0,q=z;q<L;++q)for(var H=q*O-P,G=U;G<W;++G)for(var K=f*M+h*q+d*G,$=v*(w-1-H)+g*(x-1-(G*A-F))+y*D,X=0;X<R;++X)V+=c[K+(D*R+X)]*p[$+X];i[a*M+s*j+u*B+D]=V}return r.toTensor()},e.prototype.depthwiseConv2DDerFilter=function(e,t,n){this.assertNotComplex([e,t],"depthwiseConv2DDerFilter");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,a=n.filterWidth,s=Gr(n.filterShape,"float32"),u=n.padInfo.left,c=n.padInfo.top,l=n.outChannels/n.inChannels,f=this.bufferSync(e),h=this.bufferSync(t),d=0;d<o;++d)for(var p=Math.max(0,Math.ceil((c-d)/r)),m=Math.min(n.outHeight,(n.inHeight+c-d)/r),v=0;v<a;++v)for(var g=Math.max(0,Math.ceil((u-v)/i)),y=Math.min(n.outWidth,(n.inWidth+u-v)/i),b=0;b<n.outChannels;++b){for(var w=Math.trunc(b/l),x=b%l,_=0,k=0;k<n.batchSize;++k)for(var S=p;S<m;++S)for(var E=d+S*r-c,C=g;C<y;++C){var N=v+C*i-u;_+=f.get(k,E,N,w)*h.get(k,S,C,b)}s.set(_,d,v,w,x)}return s.toTensor()},e.prototype.tile=function(e,t){this.assertNotComplex(e,"tile");for(var n=new Array(e.rank),r=0;r<n.length;r++)n[r]=e.shape[r]*t[r];var i=Gr(n,e.dtype),o=this.bufferSync(e);for(r=0;r<i.values.length;++r){for(var a=i.indexToLoc(r),s=new Array(e.rank),u=0;u<s.length;u++)s[u]=a[u]%e.shape[u];var c=o.locToIndex(s);i.values[r]=o.values[c]}return i.toTensor()},e.prototype.pad=function(e,t,n){this.assertNotComplex(e,"pad");var r=t.map(function(t,n){return t[0]+e.shape[n]+t[1]}),i=t.map(function(e){return e[0]}),o=this.bufferSync(e),a=Gr(r,e.dtype);0!==n&&a.values.fill(n);for(var s=0;s<e.size;s++){var u=o.indexToLoc(s),c=u.map(function(e,t){return e+i[t]});a.set.apply(a,[o.get.apply(o,u)].concat(c))}return a.toTensor()},e.prototype.transpose=function(e,t){this.assertNotComplex(e,"transpose");for(var n=new Array(e.rank),r=0;r<n.length;r++)n[r]=e.shape[t[r]];var i=this.readSync(e.dataId),o=Gr(n,e.dtype),a=this.bufferSync(e);for(r=0;r<e.size;++r){for(var s=a.indexToLoc(r),u=new Array(s.length),c=0;c<u.length;c++)u[c]=s[t[c]];var l=o.locToIndex(u);o.values[l]=i[r]}return o.toTensor()},e.prototype.gather=function(e,t,n){this.assertNotComplex([e,t],"gather");var r=e.shape.slice(),i=this.readSync(t.dataId);r[n]=i.length;for(var o=Gr(r,e.dtype),a=this.bufferSync(e),s=0;s<o.size;++s){var u=o.indexToLoc(s),c=u.slice();c[n]=i[u[n]];var l=a.locToIndex(c);o.values[s]=a.values[l]}return o.toTensor()},e.prototype.batchToSpaceND=function(e,t,n){this.assertNotComplex([e],"batchToSpaceND");var r=t.reduce(function(e,t){return e*t}),i=Qt(e.shape,t,r),o=en(i.length,t.length),a=tn(e.shape,t,r),s=nn(n,t.length),u=rn(a,n,t.length);return e.reshape(i).transpose(o).reshape(a).slice(s,u)},e.prototype.spaceToBatchND=function(e,t,n){this.assertNotComplex([e],"spaceToBatchND");var r=t.reduce(function(e,t){return e*t}),i=[[0,0]];i.push.apply(i,n);for(var o=1+t.length;o<e.shape.length;++o)i.push([0,0]);var a=e.pad(i),s=Qt(a.shape,t,r,!1),u=en(s.length,t.length,!1),c=tn(a.shape,t,r,!1);return a.reshape(s).transpose(u).reshape(c)},e.prototype.pool=function(e,t,n){this.assertNotComplex(e,"pool");for(var r=t.strideHeight,i=t.strideWidth,o=t.dilationHeight,a=t.dilationWidth,s=t.effectiveFilterHeight,u=t.effectiveFilterWidth,c=t.padInfo.top,l=t.padInfo.left,f="max"===n?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,h=this.readSync(e.dataId),d=Gr(t.outShape,e.dtype),p=d.values,m=t.outShape[1]*t.outShape[2]*t.outShape[3],v=t.outShape[2]*t.outShape[3],g=t.outShape[3],y=0;y<t.batchSize;++y)for(var b=y*m,w=y*e.strides[0],x=0;x<t.inChannels;++x)for(var _=0;_<t.outHeight;++_)for(var k=_*r-c,S=Math.max(0,k),E=Math.min(t.inHeight,s+k),C=b+_*v,N=0;N<t.outWidth;++N){for(var O=N*i-l,A=Math.max(0,O),T=Math.min(t.inWidth,u+O),I=f,R=0,M=0,D=S;D<E;D+=o){for(var j=w+D*e.strides[1],P=A;P<T;P+=a){var z=h[j+P*e.strides[2]+x];"max"===n&&z>I?I=z:"avg"===n&&(R+=z,M++)}if(isNaN(I))break}p[C+N*g+x]="avg"===n?R/M:I}return d.toTensor()},e.prototype.maxPool=function(e,t){return this.pool(e,t,"max")},e.prototype.maxPoolPositions=function(e,t){for(var n=Gr(t.outShape,"int32"),r=t.strideHeight,i=t.strideWidth,o=t.dilationHeight,a=t.dilationWidth,s=t.effectiveFilterHeight,u=t.effectiveFilterWidth,c=t.padInfo.top,l=t.padInfo.left,f=this.bufferSync(e),h=0;h<t.batchSize;++h)for(var d=0;d<t.inChannels;++d)for(var p=0;p<t.outHeight;++p){for(var m=p*r-c,v=m;v<0;)v+=o;for(var g=Math.min(t.inHeight,s+m),y=0;y<t.outWidth;++y){for(var b=y*i-l,w=b;w<0;)w+=a;for(var x=Math.min(t.inWidth,u+b),_=Number.NEGATIVE_INFINITY,k=-1,S=v;S<g;S+=o)for(var E=S-m,C=w;C<x;C+=a){var N=C-b,O=f.get(h,S,C,d);O>_&&(_=O,k=E*u+N)}n.set(k,h,p,y,d)}}return n.toTensor()},e.prototype.maxPoolBackprop=function(e,t,n,r){this.assertNotComplex([t,n],"maxPoolBackprop");for(var i=this.maxPoolPositions(t,r),o=r.strideHeight,a=r.strideWidth,s=r.dilationHeight,u=r.dilationWidth,c=r.effectiveFilterHeight,l=r.effectiveFilterWidth,f=l-1-r.padInfo.left,h=c-1-r.padInfo.top,d=Gr(t.shape,"float32"),p=this.bufferSync(i),m=this.bufferSync(e),v=0;v<r.batchSize;++v)for(var g=0;g<r.inChannels;++g)for(var y=0;y<r.inHeight;++y)for(var b=0;
vendor: 10,249 bytes, line 1
1b<r.inWidth;++b){for(var w=y-h,x=b-f,_=0,k=0;k<c;k+=s){var S=(w+k)/o;if(!(S<0||S>=r.outHeight||Math.floor(S)!==S))for(var E=0;E<l;E+=u){var C=(x+E)/a;if(!(C<0||C>=r.outWidth||Math.floor(C)!==C)){var N=c*l-1-p.get(v,S,C,g)===k*l+E?1:0;0!==N&&(_+=m.get(v,S,C,g)*N)}}}d.set(_,v,y,b,g)}return d.toTensor()},e.prototype.avgPoolBackprop=function(e,t,n){this.assertNotComplex([e,t],"avgPoolBackprop");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,a=n.filterWidth,s=n.dilationHeight,u=n.dilationWidth,c=n.effectiveFilterHeight,l=n.effectiveFilterWidth,f=l-1-n.padInfo.left,h=c-1-n.padInfo.top,d=Gr(t.shape,"float32"),p=1/(o*a),m=this.bufferSync(e),v=0;v<n.batchSize;++v)for(var g=0;g<n.inChannels;++g)for(var y=0;y<n.inHeight;++y)for(var b=0;b<n.inWidth;++b){for(var w=y-h,x=b-f,_=0,k=0;k<c;k+=s){var S=(w+k)/r;if(!(S<0||S>=n.outHeight||Math.floor(S)!==S))for(var E=0;E<l;E+=u){var C=(x+E)/i;C<0||C>=n.outWidth||Math.floor(C)!==C||(_+=m.get(v,S,C,g))}}d.set(_*p,v,y,b,g)}return d.toTensor()},e.prototype.cast=function(e,t){return gr(e,t,this)},e.prototype.reshape=function(e,t){return yr(e,t)},e.prototype.avgPool=function(e,t){return this.assertNotComplex(e,"avgPool"),this.pool(e,t,"avg").toFloat()},e.prototype.resizeBilinear=function(e,t,n,r){this.assertNotComplex(e,"resizeBilinear");for(var i=e.shape,o=i[0],a=i[1],s=i[2],u=i[3],c=this.readSync(e.dataId),l=new Float32Array(S([o,t,n,u])),f=[r&&t>1?a-1:a,r&&n>1?s-1:s],h=[r&&t>1?t-1:t,r&&n>1?n-1:n],d=0,p=f[0]/h[0],m=f[1]/h[1],v=0;v<o;v++)for(var g=0;g<t;g++)for(var y=p*g,b=Math.floor(y),w=y-b,x=Math.min(a-1,Math.ceil(y)),_=v*e.strides[0]+b*e.strides[1],k=v*e.strides[0]+x*e.strides[1],E=0;E<n;E++)for(var C=m*E,N=Math.floor(C),O=C-N,A=Math.min(s-1,Math.ceil(C)),T=_+N*e.strides[2],I=k+N*e.strides[2],R=_+ +A*e.strides[2],M=k+A*e.strides[2],D=0;D<u;D++){var j=c[T+D],P=c[I+D],z=j+(c[R+D]-j)*O,L=z+(P+(c[M+D]-P)*O-z)*w;l[d++]=L}return Un(l,[o,t,n,u])},e.prototype.resizeBilinearBackprop=function(e,t,n){this.assertNotComplex([e,t],"resizeBilinearBackprop");for(var r=t.shape,i=r[0],o=r[1],a=r[2],s=r[3],u=e.shape,c=u[1],l=u[2],f=new Float32Array(i*o*a*s),h=[n&&c>1?o-1:o,n&&l>1?a-1:a],d=[n&&c>1?c-1:c,n&&l>1?l-1:l],p=h[0]/d[0],m=h[1]/d[1],v=this.readSync(e.dataId),g=0,y=0;y<i;y++)for(var b=y*t.strides[0],w=0;w<c;w++)for(var x=w*p,_=Math.floor(x),k=Math.min(Math.ceil(x),o-1),S=b+_*t.strides[1],E=b+k*t.strides[1],C=x-_,N=1-C,O=0;O<l;O++)for(var A=O*m,T=Math.floor(A),I=Math.min(Math.ceil(A),a-1),R=A-T,M=1-R,D=S+T*t.strides[2],j=S+I*t.strides[2],P=E+T*t.strides[2],z=E+I*t.strides[2],L=N*M,B=N*R,F=C*M,U=C*R,W=0;W<s;W++){var V=v[g++];f[D+W]+=V*L,f[j+W]+=V*B,f[P+W]+=V*F,f[z+W]+=V*U}return Gn(f,[i,a,o,s],t.dtype)},e.prototype.resizeNearestNeighbor=function(e,t,n,r){this.assertNotComplex(e,"resizeNearestNeighbor");for(var i=e.shape,o=i[0],a=i[1],s=i[2],u=i[3],c=this.readSync(e.dataId),l=new Float32Array(o*t*n*u),f=[r&&t>1?a-1:a,r&&n>1?s-1:s],h=[r&&t>1?t-1:t,r&&n>1?n-1:n],d=f[0]/h[0],p=f[1]/h[1],m=0,v=0;v<o;v++)for(var g=v*e.strides[0],y=0;y<t;y++)for(var b=d*y,w=g+Math.min(a-1,r?Math.round(b):Math.floor(b))*e.strides[1],x=0;x<n;x++)for(var _=p*x,k=w+Math.min(s-1,r?Math.round(_):Math.floor(_))*e.strides[2],S=0;S<u;S++){var E=c[k+S];l[m++]=E}return Un(l,[o,t,n,u],e.dtype)},e.prototype.resizeNearestNeighborBackprop=function(e,t,n){this.assertNotComplex([e,t],"resizeNearestNeighborBackprop");for(var r=t.shape,i=r[0],o=r[1],a=r[2],s=r[3],u=e.shape,c=u[1],l=u[2],f=new Float32Array(i*o*a*s),h=this.readSync(e.dataId),d=[n&&c>1?o-1:o,n&&l>1?a-1:a],p=[n&&c>1?c-1:c,n&&l>1?l-1:l],m=d[0]/p[0],v=d[1]/p[1],g=1/m,y=1/v,b=2*Math.ceil(g)+2,w=2*Math.ceil(y)+2,x=0;x<i;x++)for(var _=x*t.strides[0],k=0;k<o;k++)for(var S=_+k*t.strides[1],E=Math.floor(k*g),C=Math.floor(E-b/2),N=0;N<a;N++)for(var O=S+N*t.strides[2],A=Math.floor(N*y),T=Math.floor(A-w/2),I=0;I<s;I++){for(var R=0,M=0;M<b;M++){var D=M+C;if(!(D<0||D>=c)){var j=_+D*e.strides[1],P=D*m;if(k===Math.min(o-1,n?Math.round(P):Math.floor(P)))for(var z=0;z<w;z++){var L=z+T;if(!(L<0||L>=l)){var B=j+L*e.strides[2],F=L*v;N===Math.min(a-1,n?Math.round(F):Math.floor(F))&&(R+=h[B+I])}}}}f[O+I]=R}return Gn(f,t.shape,t.dtype)},e.prototype.batchNormalization=function(e,t,n,r,i,o){this.assertNotComplex([e,t,n,i,o],"batchNorm");for(var a=this.readSync(e.dataId),s=this.readSync(t.dataId),u=this.readSync(n.dataId),c=i?this.readSync(i.dataId):new Float32Array([1]),l=o?this.readSync(o.dataId):new Float32Array([0]),f=new Float32Array(a.length),h=l.length,d=c.length,p=u.length,m=s.length,v=0,g=0,y=0,b=0,w=0;w<a.length;++w)f[w]=l[v++]+(a[w]-s[g++])*c[y++]/Math.sqrt(u[b++]+r),v>=h&&(v=0),g>=m&&(g=0),y>=d&&(y=0),b>=p&&(b=0);return Gn(f,e.shape)},e.prototype.localResponseNormalization4D=function(e,t,n,r,i){this.assertNotComplex(e,"localResponseNormalization4D");var o=e.shape[3],a=o-1,s=this.readSync(e.dataId),u=e.size,c=new Float32Array(u);function l(e){for(var n=e%o,r=e-n+Math.max(0,n-t),i=e-n+Math.min(n+t,a),u=0;r<=i;r++){var c=s[r];u+=c*c}return u}for(var f=0;f<u;f++){var h=l(f),d=s[f]*Math.pow(n+r*h,-i);c[f]=d}return Gn(c,e.shape)},e.prototype.LRNGrad=function(e,t,n,r,i,o,a){this.assertNotComplex(e,"LRNGrad");for(var s=e.shape[3],u=this.readSync(e.dataId),c=this.readSync(t.dataId),l=this.readSync(n.dataId),f=new Float32Array(e.size),h=e.size,d=0;d<h;d++){for(var p=d%s,m=d-p+Math.max(0,p-r),v=d-p+Math.min(s,p+r+1),g=0,y=m;y<v;y++)g+=Math.pow(c[y],2);for(g=o*g+i,y=m;y<v;y++){var b=-2*o*a*c[y]*l[d]/g;d===y&&(b+=Math.pow(g,-a)),b*=u[d],f[y]+=b}}return Gn(f,e.shape)},e.prototype.multinomial=function(e,t,n,r){this.assertNotComplex(e,"multinomial");for(var i=t?e:Pn(e),o=i.shape[0],a=i.shape[1],s=Yn([o,n],"int32"),u=this.readSync(s.dataId),c=this.readSync(i.dataId),l=0;l<o;++l){var f=l*a,h=new Float32Array(a-1);h[0]=c[f];for(var d=1;d<h.length;++d)h[d]=h[d-1]+c[f+d];for(var p=Vr(r.toString()),m=l*n,v=0;v<n;++v){var g=p();u[m+v]=h.length;for(var y=0;y<h.length;y++)if(g<h[y]){u[m+v]=y;break}}}return s},e.prototype.oneHot=function(e,t,n,r){this.assertNotComplex(e,"oneHot");var i=new Float32Array(e.size*t);i.fill(r);for(var o=this.readSync(e.dataId),a=0;a<e.size;++a)o[a]>=0&&o[a]<t&&(i[a*t+o[a]]=n);return qn(i,[e.size,t],"int32")},e.prototype.nonMaxSuppression=function(e,t,n,r,i){return this.assertNotComplex(e,"nonMaxSuppression"),Er(this.readSync(e.dataId),this.readSync(t.dataId),n,r,i)},e.prototype.fft=function(e){return this.fftBatch(e,!1)},e.prototype.ifft=function(e){return this.fftBatch(e,!0)},e.prototype.fftBatch=function(e,t){for(var n=e.shape[0],r=e.shape[1],i=Gr(e.shape,"float32"),o=Gr(e.shape,"float32"),a=Bn(e).as2D(n,r),s=Fn(e).as2D(n,r),u=0;u<n;u++)for(var c=a.slice([u,0],[1,r]),l=s.slice([u,0],[1,r]),f=Ln(c,l),h=this.readSync(this.fftImpl(f,t).dataId),d=0;d<r;d++){var p=_r(h,d);i.values[u*r+d]=p.real,o.values[u*r+d]=p.imag}return Ln(i.toTensor(),o.toTensor()).as2D(n,r)},e.prototype.fftImpl=function(e,t){var n=e.as1D(),r=n.size;if(this.isExponentOf2(r)){var i=this.fftRadix2(n,r,t).as2D(e.shape[0],e.shape[1]);return t&&(i=Ln(Bn(i).div(Wn(r)),Fn(i).div(Wn(r)))),i}var o=this.readSync(e.dataId),a=function(e){for(var t=new Float32Array(e.length/2),n=new Float32Array(e.length/2),r=0;r<e.length;r+=2)t[r/2]=e[r],n[r/2]=e[r+1];return{real:t,imag:n}}(this.fourierTransformByMatmul(o,r,t));return Ln(a.real,a.imag).as2D(e.shape[0],e.shape[1])},e.prototype.isExponentOf2=function(e){return 0==(e&e-1)},e.prototype.fftRadix2=function(e,t,n){if(1===t)return e;var r=this.readSync(e.dataId),i=t/2,o=function(e){for(var t=Math.ceil(e.length/4),n=new Float32Array(t),r=new Float32Array(t),i=0;i<e.length;i+=4)n[Math.floor(i/4)]=e[i],r[Math.floor(i/4)]=e[i+1];return{real:n,imag:r}}(r),a=Ln(o.real,o.imag).as1D(),s=function(e){for(var t=Math.floor(e.length/4),n=new Float32Array(t),r=new Float32Array(t),i=2;i<e.length;i+=4)n[Math.floor(i/4)]=e[i],r[Math.floor(i/4)]=e[i+1];return{real:n,imag:r}}(r),u=Ln(s.real,s.imag).as1D();a=this.fftRadix2(a,i,n),u=this.fftRadix2(u,i,n);var c=function(e,t){for(var n=new Float32Array(e/2),r=new Float32Array(e/2),i=0;i<Math.ceil(e/2);i++){var o=(t?2:-2)*Math.PI*(i/e);n[i]=Math.cos(o),r[i]=Math.sin(o)}return{real:n,imag:r}}(t,n),l=Ln(c.real,c.imag).mul(u),f=a.add(l),h=a.sub(l),d=Bn(f).concat(Bn(h)),p=Fn(f).concat(Fn(h));return Ln(d,p).as1D()},e.prototype.fourierTransformByMatmul=function(e,t,n){for(var r=new Float32Array(2*t),i=0;i<t;i++){for(var o=0,a=0,s=0;s<t;s++){var u=Sr(i*s,t,n),c=_r(e,s);o+=c.real*u.real-c.imag*u.imag,a+=c.real*u.imag+c.imag*u.real}n&&(o/=t,a/=t),kr(r,o,a,i)}return r},e.prototype.depthToSpace=function(e,t,n){w("NHWC"===n,function(){return"Only NHWC dataFormat supported on CPU for depthToSpace. Got "+n}),w(t>1,function(){return"blockSize should be > 1 for depthToSpace, but was: "+t});for(var r=e.shape[0],i=e.shape[1],o=e.shape[2],a=e.shape[3],s=i*t,u=o*t,c=a/(t*t),l=this.readSync(e.dataId),f=new Float32Array(r*s*u*c),h=0,d=0;d<r;++d)for(var p=0;p<s;++p)for(var m=Math.floor(p/t),v=p%t,g=0;g<u;++g)for(var y=Math.floor(g/t),b=(v*t+g%t)*c,x=0;x<c;++x){var _=x+b+a*(y+o*(m+i*d));f[h++]=l[_]}return Gn(f,[r,s,u,c])},e.prototype.broadcastedBinaryOp=function(e,t,n,r){var i=ar(e.shape,t.shape),o=Gr(i,n),a=this.readSync(e.dataId),s=this.readSync(t.dataId),u=ir(e.shape,i),c=ir(t.shape,i),l=o.values;if(u.length+c.length===0)for(var f=0;f<l.length;++f)l[f]=r(a[f%a.length],s[f%s.length]);else{var h=this.bufferSync(e),d=this.bufferSync(t),p=function(n){var i=o.indexToLoc(n),f=i.slice(-e.rank);u.forEach(function(e){return f[e]=0});var p=h.locToIndex(f),m=i.slice(-t.rank);c.forEach(function(e){return m[e]=0});var v=d.locToIndex(m);l[n]=r(a[p],s[v])};for(f=0;f<l.length;++f)p(f)}return o.toTensor()},e.prototype.broadcastedBinaryComplexOp=function(e,t,n){var r=ar(e.shape,t.shape),i=Gr(r,"float32"),o=Gr(r,"float32"),a=this.readSync(e.dataId),s=this.readSync(t.dataId),u=ir(e.shape,r),c=ir(t.shape,r),l=i.values,f=o.values;if(u.length+c.length===0)for(var h=0;h<l.length;h++){var d=h%a.length,p=h%s.length,m=n(a[2*d],a[2*d+1],s[2*p],s[2*p+1]);l[h]=m.real,f[h]=m.imag}else{var v=this.bufferSync(this.data.get(e.dataId).complexTensors.real),g=this.bufferSync(this.data.get(t.dataId).complexTensors.real),y=function(r){var o=i.indexToLoc(r),h=o.slice(-e.rank);u.forEach(function(e){return h[e]=0});var d=v.locToIndex(h),p=o.slice(-t.rank);
1c.forEach(function(e){return p[e]=0});var m=g.locToIndex(p),y=n(a[2*d],a[2*d+1],s[2*m],s[2*m+1]);l[r]=y.real,f[r]=y.imag};for(h=0;h<l.length;h++)y(h)}return this.complex(i.toTensor(),o.toTensor())},e.prototype.split=function(e,t,n){return Nr(e,t,n)},e.prototype.dispose=function(){},e.prototype.floatPrecision=function(){return 32},e.prototype.epsilon=function(){return 1e-7},e.prototype.cropAndResize=function(e,t,n,r,i,o){for(var a=e.shape,s=a[0],u=a[1],c=a[2],l=a[3],f=t.shape[0],h=r[0],d=r[1],p=Gr([f,h,d,l],e.dtype),m=this.readSync(t.dataId),v=this.readSync(n.dataId),g=this.readSync(e.dataId),y=e.strides,b=p.strides,w=0;w<f;w++){var x=4*w,_=m[x],k=m[x+1],S=m[x+2],E=m[x+3],C=v[w];if(!(C>=s))for(var N=h>1?(S-_)*(u-1)/(h-1):0,O=d>1?(E-k)*(c-1)/(d-1):0,A=0;A<h;A++){var T=h>1?_*(u-1)+A*N:.5*(_+S)*(u-1);if(T<0||T>u-1)for(var I=0;I<d;I++)for(var R=0;R<l;R++){var M=R+I*b[2]+A*b[1]+w*b[0];p.values[M]=o}else if("bilinear"===i){var D=Math.floor(T),j=Math.ceil(T),P=T-D;for(I=0;I<d;I++)if((H=d>1?k*(c-1)+I*O:.5*(k+E)*(c-1))<0||H>c-1)for(R=0;R<l;R++)M=R+I*b[2]+A*b[1]+w*b[0],p.values[M]=o;else{var z=Math.floor(H),L=Math.ceil(H),B=H-z;for(R=0;R<l;R++){var F=g[M=R+z*y[2]+D*y[1]+C*y[0]],U=g[M=R+L*y[2]+D*y[1]+C*y[0]],W=g[M=R+z*y[2]+j*y[1]+C*y[0]],V=F+(U-F)*B,q=W+(g[M=R+L*y[2]+j*y[1]+C*y[0]]-W)*B;M=R+I*b[2]+A*b[1]+w*b[0],p.values[M]=V+(q-V)*P}}}else for(I=0;I<d;++I){var H;if((H=d>1?k*(c-1)+I*O:.5*(k+E)*(c-1))<0||H>c-1)for(R=0;R<l;R++)M=R+I*b[2]+A*b[1]+w*b[0],p.values[M]=o;else{var G=Math.round(H),K=Math.round(T);for(R=0;R<l;R++){var $=R+G*y[2]+K*y[1]+C*y[0],X=R+I*b[2]+A*b[1]+w*b[0];p.values[X]=g[$]}}}}}return p.toTensor()},e.prototype.sparseToDense=function(e,t,n,r){var i=yn(0,e,n),o=i.sliceRank,a=i.numUpdates,s=i.sliceSize,u=i.strides,c=i.outputSize;return this.scatter(e,t,n,c,s,a,o,u,r,!1)},e.prototype.gatherND=function(e,t){var n=t.shape,r=n[n.length-1],i=mn(e,t),o=i[0],a=i[1],s=i[2],u=i[3];if(0===a)return Un([],o,e.dtype);for(var c=new he([a,s],e.dtype),l=this.readSync(t.dataId),f=this.readSync(e.dataId),h=0;h<a;h++){for(var d=[],p=0,m=0;m<r;m++){var v=l[h*r+m];p+=v*u[m],d.push(v)}if(p<0||p>=e.size/s)throw new Error("Invalid indices: "+d+" does not index into "+e.shape);for(var g=0;g<s;g++)c.values[h*s+g]=f[p*s+g]}return c.toTensor().reshape(o)},e.prototype.scatterND=function(e,t,n){var r=yn(0,e,n),i=r.sliceRank,o=r.numUpdates,a=r.sliceSize,s=r.strides,u=r.outputSize,c=Wn(0);return this.scatter(e,t,n,u,a,o,i,s,c,!0)},e.prototype.fill=function(e,t,n){var r=j(n=n||G(t),S(e));return r.fill(t),ve.make(e,{values:r},n)},e.prototype.onesLike=function(e){if("string"===e.dtype)throw new Error("onesLike is not supported for string tensors");return this.fill(e.shape,1,e.dtype)},e.prototype.zerosLike=function(e){var t=j(e.dtype,S(e.shape));return ve.make(e.shape,{values:t},e.dtype)},e.prototype.linspace=function(e,t,n){return br(e,t,n)},e.prototype.scatter=function(e,t,n,r,i,o,a,s,u,c){var l=[r/i,i],f=this.readSync(e.dataId),h=this.readSync(t.dataId);if(0===r)return Un([],n,t.dtype);var d=new he(l,t.dtype);d.values.fill(this.readSync(u.dataId)[0]);for(var p=0;p<o;p++){for(var m=[],v=0,g=0;g<a;g++){var y=f[p*a+g];m.push(y),v+=y*s[g]}if(v<0||v>=r/i)throw new Error("Invalid indices: "+m+" does not index into "+n);for(var b=0;b<i;b++)c?d.values[v*i+b]+=h[p*i+b]:d.values[v*i+b]=0===t.rank?h[0]:h[p*i+b]}return d.toTensor().reshape(n)},e}();je.registerBackend("cpu",function(){return new dl},1);var pl=function(){function e(){}return e.prototype.fetch=function(e,t){return fetch(e,t)},e}();f.get("IS_BROWSER")&&f.setPlatform("browser",new pl);var ml,vl=function(){function e(){}return e.prototype.fetch=function(e,t){return null!=f.global.fetch?f.global.fetch(e,t):(null==ml&&(ml=n(227)),ml(e,t))},e}();f.get("IS_NODE")&&f.setPlatform("node",new vl);var gl={float32:4,int32:4,uint16:2,uint8:1,bool:1};function yl(e,t){for(var n={},r=0,i=function(t){var i=t.name,o=t.dtype,a=t.shape,s=S(a),u=void 0;if("quantization"in t){var c=t.quantization;if("uint8"!==c.dtype&&"uint16"!==c.dtype)throw new Error("Weight "+t.name+" has unknown quantization dtype "+c.dtype+". Supported quantization dtypes are: 'uint8' and 'uint16'.");var l=gl[c.dtype],f=e.slice(r,r+s*l),h="uint8"===c.dtype?new Uint8Array(f):new Uint16Array(f);if("float32"===o)u=Float32Array.from(h,function(e){return e*c.scale+c.min});else{if("int32"!==o)throw new Error("Unsupported dtype in weight '"+i+"': "+o);u=Int32Array.from(h,function(e){return Math.round(e*c.scale+c.min)})}r+=s*l}else{var d=gl[o];if(f=e.slice(r,r+s*d),"float32"===o)u=new Float32Array(f);else if("int32"===o)u=new Int32Array(f);else{if("bool"!==o)throw new Error("Unsupported dtype in weight '"+i+"': "+o);
1u=new Uint8Array(f)}r+=s*d}var p=void 0;if("float32"===o)p=Un(u,a,"float32");else if("int32"===o)p=Un(u,a,"int32");else{if("bool"!==o)throw new Error("Unsupported dtype in weight '"+i+"': "+o);p=Un(u,a,"bool")}n[i]=p},o=0,a=t;o<a.length;o++)i(a[o]);return n}function bl(e){if(null===e)throw new Error("Invalid input value: "+JSON.stringify(e));var t=0,n=[];e.forEach(function(e){if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error("Unsupported TypedArray subtype: "+e.constructor.name)});var r=new Uint8Array(t),i=0;return n.forEach(function(e){r.set(new Uint8Array(e.buffer),i),i+=e.byteLength}),r.buffer}var wl="undefined"!=typeof i&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function xl(e){return wl?i.byteLength(e):new Blob([e]).size}function _l(e){var t=0;e.forEach(function(e){t+=e.byteLength});var n=new Uint8Array(t),r=0;return e.forEach(function(e){n.set(new Uint8Array(e),r),r+=e.byteLength}),n.buffer}function kl(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);var t=e.split("/");return t[t.length-1]}function Sl(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:xl(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:xl(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:e.weightData.byteLength}}var El=function(){function e(){this.saveRouters=[],this.loadRouters=[]}return e.getInstance=function(){return null==e.instance&&(e.instance=new e),e.instance},e.registerSaveRouter=function(t){e.getInstance().saveRouters.push(t)},e.registerLoadRouter=function(t){e.getInstance().loadRouters.push(t)},e.getSaveHandlers=function(t){return e.getHandlers(t,"save")},e.getLoadHandlers=function(t,n){return e.getHandlers(t,"load",n)},e.getHandlers=function(t,n,r){var i=[];return("load"===n?e.getInstance().loadRouters:e.getInstance().saveRouters).forEach(function(e){var n=e(t,r);null!==n&&i.push(n)}),i},e}(),Cl="://",Nl=function(){function e(){this.managers={}}return e.getInstance=function(){return null==e.instance&&(e.instance=new e),e.instance},e.registerManager=function(t,n){w(null!=t,function(){return"scheme must not be undefined or null."}),t.endsWith(Cl)&&(t=t.slice(0,t.indexOf(Cl))),w(t.length>0,function(){return"scheme must not be an empty string."});var r=e.getInstance();w(null==r.managers[t],function(){return"A model store manager is already registered for scheme '"+t+"'."}),r.managers[t]=n},e.getManager=function(e){var t=this.getInstance().managers[e];if(null==t)throw new Error("Cannot find model manager for scheme '"+e+"'");return t},e.getSchemes=function(){return Object.keys(this.getInstance().managers)},e}();function Ol(e){if(-1===e.indexOf(Cl))throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+Nl.getSchemes().join(","));return{scheme:e.split(Cl)[0],path:e.split(Cl)[1]}}function Al(e,t,n){return void 0===n&&(n=!1),c(this,void 0,void 0,function(){var r,i,o,a,s,u,c,f,h;return l(this,function(l){switch(l.label){case 0:return w(e!==t,function(){return"Old path and new path are the same: '"+e+"'"}),w((r=El.getLoadHandlers(e)).length>0,function(){return"Copying failed because no load handler is found for source URL "+e+"."}),w(r.length<2,function(){return"Copying failed because more than one ("+r.length+") load handlers for source URL "+e+"."}),i=r[0],w((o=El.getSaveHandlers(t)).length>0,function(){return"Copying failed because no save handler is found for destination URL "+t+"."}),w(o.length<2,function(){return"Copying failed because more than one ("+r.length+") save handlers for destination URL "+t+"."}),a=o[0],s=Ol(e).scheme,u=Ol(e).path,c=s===Ol(e).scheme,[4,i.load()];case 1:return f=l.sent(),n&&c?[4,Nl.getManager(s).removeModel(u)]:[3,3];case 2:l.sent(),l.label=3;case 3:return[4,a.save(f)];case 4:return h=l.sent(),!n||c?[3,6]:[4,Nl.getManager(s).removeModel(u)];case 5:l.sent(),l.label=6;case 6:return[2,h.modelArtifactsInfo]}})})}var Tl="models_store",Il="model_info_store";
vendor: 4,183 bytes, line 1
1function Rl(){if(!f.getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");var e=window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Ml(e){var t=e.result;t.createObjectStore(Tl,{keyPath:"modelPath"}),t.createObjectStore(Il,{keyPath:"modelPath"})}var Dl=function(){function e(e){if(this.indexedDB=Rl(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}return e.prototype.save=function(e){return c(this,void 0,void 0,function(){return l(this,function(t){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return[2,this.databaseAction(this.modelPath,e)]})})},e.prototype.load=function(){return c(this,void 0,void 0,function(){return l(this,function(e){return[2,this.databaseAction(this.modelPath)]})})},e.prototype.databaseAction=function(e,t){var n=this;return new Promise(function(e,r){var i=n.indexedDB.open("tensorflowjs",1);i.onupgradeneeded=function(){return Ml(i)},i.onsuccess=function(){var o=i.result;if(null==t){var a=o.transaction(Tl,"readonly"),s=a.objectStore(Tl).get(n.modelPath);s.onsuccess=function(){if(null==s.result)return o.close(),r(new Error("Cannot find model with path '"+n.modelPath+"' in IndexedDB."));e(s.result.modelArtifacts)},s.onerror=function(e){return o.close(),r(s.error)},a.oncomplete=function(){return o.close()}}else{var u,c=Sl(t),l=o.transaction(Il,"readwrite"),f=l.objectStore(Il),h=f.put({modelPath:n.modelPath,modelArtifactsInfo:c});h.onsuccess=function(){var i=(u=o.transaction(Tl,"readwrite")).objectStore(Tl).put({modelPath:n.modelPath,modelArtifacts:t,modelArtifactsInfo:c});i.onsuccess=function(){return e({modelArtifactsInfo:c})},i.onerror=function(e){var t=(f=l.objectStore(Il)).delete(n.modelPath);t.onsuccess=function(){return o.close(),r(i.error)},t.onerror=function(e){return o.close(),r(i.error)}}},h.onerror=function(e){return o.close(),r(h.error)},l.oncomplete=function(){null==u?o.close():u.oncomplete=function(){return o.close()}}}},i.onerror=function(e){return r(i.error)}})},e.URL_SCHEME="indexeddb://",e}(),jl=function(e){return f.getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Dl.URL_SCHEME)?(t=e.slice(Dl.URL_SCHEME.length),new Dl(t)):null;var t};El.registerSaveRouter(jl),El.registerLoadRouter(jl);var Pl=function(){function e(){this.indexedDB=Rl()}return e.prototype.listModels=function(){return c(this,void 0,void 0,function(){var e=this;return l(this,function(t){return[2,new Promise(function(t,n){var r=e.indexedDB.open("tensorflowjs",1);r.onupgradeneeded=function(){return Ml(r)},r.onsuccess=function(){var e=r.result,i=e.transaction(Il,"readonly"),o=i.objectStore(Il).getAll();o.onsuccess=function(){for(var e={},n=0,r=o.result;n<r.length;n++){var i=r[n];e[i.modelPath]=i.modelArtifactsInfo}t(e)},o.onerror=function(t){return e.close(),n(o.error)},i.oncomplete=function(){return e.close()}},r.onerror=function(e){return n(r.error)}})]})})},e.prototype.removeModel=function(e){return c(this,void 0,void 0,function(){var t=this;return l(this,function(n){var r;return e=(r=e).startsWith(Dl.URL_SCHEME)?r.slice(Dl.URL_SCHEME.length):r,[2,new Promise(function(n,r){var i=t.indexedDB.open("tensorflowjs",1);i.onupgradeneeded=function(){return Ml(i)},i.onsuccess=function(){var t,o=i.result,a=o.transaction(Il,"readwrite"),s=a.objectStore(Il),u=s.get(e);u.onsuccess=function(){if(null==u.result)return o.close(),r(new Error("Cannot find model with path '"+e+"' in IndexedDB."));var i=s.delete(e),a=function(){var i=(t=o.transaction(Tl,"readwrite")).objectStore(Tl).delete(e);i.onsuccess=function(){return n(u.result.modelArtifactsInfo)},i.onerror=function(e){return r(u.error)}};i.onsuccess=a,i.onerror=function(e){return a(),o.close(),r(u.error)}},u.onerror=function(e){return o.close(),r(u.error)},a.oncomplete=function(){null==t?o.close():t.oncomplete=function(){return o.close()}}},i.onerror=function(e){return r(i.error)}})]})})},e}();
1if(f.getBool("IS_BROWSER"))try{Nl.registerManager(Dl.URL_SCHEME,new Pl)}catch(ke){}var zl="/",Ll="tensorflowjs_models",Bl="info",Fl="model_topology",Ul="weight_specs",Wl="weight_data",Vl="model_metadata";function ql(e){return{info:[Ll,e,Bl].join(zl),topology:[Ll,e,Fl].join(zl),weightSpecs:[Ll,e,Ul].join(zl),weightData:[Ll,e,Wl].join(zl),modelMetadata:[Ll,e,Vl].join(zl)}}function Hl(e){var t=e.split(zl);if(t.length<3)throw new Error("Invalid key format: "+e);return t.slice(1,t.length-1).join(zl)}var Gl=function(){function e(e){if(!f.getBool("IS_BROWSER")||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=ql(this.modelPath)}return e.prototype.save=function(e){return c(this,void 0,void 0,function(){var t,n,r;return l(this,function(o){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),r=Sl(e);try{return this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,(a=e.weightData,wl?i.from(a).toString("base64"):btoa(String.fromCharCode.apply(null,new Uint8Array(a))))),this.LS.setItem(this.keys.modelMetadata,JSON.stringify({format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy})),[2,{modelArtifactsInfo:r}]}catch(e){throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error("Failed to save model '"+this.modelPath+"' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes="+r.modelTopologyBytes+", weightSpecsBytes="+r.weightSpecsBytes+", weightDataBytes="+r.weightDataBytes+".")}var a;return[2]})})},e.prototype.load=function(){return c(this,void 0,void 0,function(){var e,t,n,r,o,a,s;return l(this,function(u){if(null==(e=JSON.parse(this.LS.getItem(this.keys.info))))throw new Error("In local storage, there is no model with name '"+this.modelPath+"'");if("JSON"!==e.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");if(t={},null==(n=JSON.parse(this.LS.getItem(this.keys.topology))))throw new Error("In local storage, the topology of model '"+this.modelPath+"' is missing.");if(t.modelTopology=n,null==(r=JSON.parse(this.LS.getItem(this.keys.weightSpecs))))throw new Error("In local storage, the weight specs of model '"+this.modelPath+"' are missing.");if(t.weightSpecs=r,null!=(o=this.LS.getItem(this.keys.modelMetadata))&&(a=JSON.parse(o),t.format=a.format,t.generatedBy=a.generatedBy,t.convertedBy=a.convertedBy),null==(s=this.LS.getItem(this.keys.weightData)))throw new Error("In local storage, the binary weight values of model '"+this.modelPath+"' are missing.");return t.weightData=function(e){if(wl){var t=i.from(e,"base64");return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}for(var n=atob(e),r=new Uint8Array(n.length),o=0;o<n.length;++o)r.set([n.charCodeAt(o)],o);return r.buffer}(s),[2,t]})})},e.URL_SCHEME="localstorage://",e}(),Kl=function(e){return f.getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Gl.URL_SCHEME)?(t=e.slice(Gl.URL_SCHEME.length),new Gl(t)):null;var t};El.registerSaveRouter(Kl),El.registerLoadRouter(Kl);var $l=function(){function e(){w(f.getBool("IS_BROWSER"),function(){return"Current environment is not a web browser"}),w(void 0!==window.localStorage,function(){return"Current browser does not appear to support localStorage"}),this.LS=window.localStorage}return e.prototype.listModels=function(){return c(this,void 0,void 0,function(){var e,t,n,r,i,o;return l(this,function(a){for(e={},t=Ll+zl,n=zl+Bl,r=0;r<this.LS.length;++r)(i=this.LS.key(r)).startsWith(t)&&i.endsWith(n)&&(o=Hl(i),e[o]=JSON.parse(this.LS.getItem(i)));return[2,e]})})},e.prototype.removeModel=function(e){return c(this,void 0,void 0,function(){var t,n;return l(this,function(r){var i;if(e=(i=e).startsWith(Gl.URL_SCHEME)?i.slice(Gl.URL_SCHEME.length):i,t=ql(e),null==this.LS.getItem(t.info))throw new Error("Cannot find model at path '"+e+"'");return n=JSON.parse(this.LS.getItem(t.info)),this.LS.removeItem(t.info),this.LS.removeItem(t.topology),this.LS.removeItem(t.weightSpecs),this.LS.removeItem(t.weightData),[2,n]})})},e}();
1if(f.getBool("IS_BROWSER"))try{Nl.registerManager(Gl.URL_SCHEME,new $l)}catch(ke){}var Xl="model",Yl=".json",Jl=".weights.bin";function Zl(e){return new Promise(function(e){return setTimeout(e)}).then(e)}var Ql=function(){function e(t){if(!f.getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");t.startsWith(e.URL_SCHEME)&&(t=t.slice(e.URL_SCHEME.length)),null!=t&&0!==t.length||(t=Xl),this.modelTopologyFileName=t+Yl,this.weightDataFileName=t+Jl}return e.prototype.save=function(e){return c(this,void 0,void 0,function(){var t,n,r,i,o,a;return l(this,function(s){switch(s.label){case 0:if(t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"})),!(e.modelTopology instanceof ArrayBuffer))return[3,1];throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");case 1:return n=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n},i=window.URL.createObjectURL(new Blob([JSON.stringify(r)],{type:"application/json"})),(o=null==this.jsonAnchor?document.createElement("a"):this.jsonAnchor).download=this.modelTopologyFileName,o.href=i,[4,Zl(function(){return o.dispatchEvent(new MouseEvent("click"))})];case 2:return s.sent(),null==e.weightData?[3,4]:((a=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor).download=this.weightDataFileName,a.href=t,[4,Zl(function(){return a.dispatchEvent(new MouseEvent("click"))})]);case 3:s.sent(),s.label=4;case 4:return[2,{modelArtifactsInfo:Sl(e)}]}})})},e.URL_SCHEME="downloads://",e}(),ef=function(){function e(e){if(null==e||e.length<1)throw new Error("When calling browserFiles, at least 1 file is required, but received "+e);this.files=e}return e.prototype.load=function(){return c(this,void 0,void 0,function(){var e,t,n=this;return l(this,function(r){return e=this.files[0],t=this.files.slice(1),[2,new Promise(function(r,i){var o=new FileReader;o.onload=function(o){var a=JSON.parse(o.target.result),s=a.modelTopology;if(null!=s){0===t.length&&r({modelTopology:s});var u=a.weightsManifest;if(null!=u){var c;try{c=n.checkManifestAndWeightFiles(u,t)}catch(e){return void i(e)}var l=[],f=[],h=[];u.forEach(function(e){e.paths.forEach(function(e){f.push(e),h.push(null)}),l.push.apply(l,e.weights)}),u.forEach(function(e){e.paths.forEach(function(e){var t=new FileReader;t.onload=function(t){var n=t.target.result,i=f.indexOf(e);h[i]=n,-1===h.indexOf(null)&&r({modelTopology:s,weightSpecs:l,weightData:_l(h)})},t.onerror=function(t){return i("Failed to weights data from file of path '"+e+"'.")},t.readAsArrayBuffer(c[e])})})}else i(new Error("weightManifest field is missing from file "+e.name))}else i(new Error("modelTopology field is missing from file "+e.name))},o.onerror=function(t){return i("Failed to read model topology and weights manifest JSON from file '"+e.name+"'. BrowserFiles supports loading Keras-style tf.Model artifacts only.")},o.readAsText(e)})]})})},e.prototype.checkManifestAndWeightFiles=function(e,t){for(var n=[],r=t.map(function(e){return kl(e.name)}),i={},o=0,a=e;o<a.length;o++)a[o].paths.forEach(function(e){var o=kl(e);if(-1!==n.indexOf(o))throw new Error("Duplicate file basename found in weights manifest: '"+o+"'");if(n.push(o),-1===r.indexOf(o))throw new Error("Weight file with basename '"+o+"' is not provided.");i[e]=t[r.indexOf(o)]});if(n.length!==t.length)throw new Error("Mismatch in the number of files in weights manifest ("+n.length+") and the number of weight files provided ("+t.length+").");return i},e}();function tf(e,t,n,r){!function(e){w(null!=e&&Array.isArray(e)&&e.length>0,function(){return"promises must be a none empty array"})}(e),function(e,t){w(e>=0&&e<=1,function(){return"Progress fraction must be in range [0, 1], but got startFraction "+e}),w(t>=0&&t<=1,function(){return"Progress fraction must be in range [0, 1], but got endFraction "+t}),w(t>=e,function(){return"startFraction must be no more than endFraction, but got startFraction "+e+" and endFraction "+t})}(n=null==n?0:n,r=null==r?1:r);var i=0;return Promise.all(e.map(function(o){return o.then(function(o){var a=n+ ++i/e.length*(r-n);return t(a),o}),o}))}function nf(e,t){return c(this,void 0,void 0,function(){var n,r,i,o,a,s,u,c,f;return l(this,function(l){switch(l.label){case 0:return null==t&&(t={}),n=null==t.fetchFunc?ne:t.fetchFunc,r=e.map(function(e){return n(e,t.requestInit)}),i=0,o=.5,null!=t.onProgress?[3,2]:[4,Promise.all(r)];case 1:return a=l.sent(),[3,4];case 2:return[4,tf(r,t.onProgress,i,o)];case 3:a=l.sent(),l.label=4;case 4:return s=a.map(function(e){return e.arrayBuffer()}),u=.5,c=1,null!=t.onProgress?[3,6]:[4,Promise.all(s)];case 5:return f=l.sent(),[3,8];case 6:return[4,tf(s,t.onProgress,u,c)];case 7:f=l.sent(),l.label=8;case 8:return[2,f]}})})}function rf(e){var t=this;return function(n,r,i){return void 0===r&&(r=""),c(t,void 0,void 0,function(){var t,o,a,s,u,c,f,h,d,p;return l(this,function(l){switch(l.label){case 0:if(t=n.map(function(){return!1}),o={},a=null!=i?i.map(function(){return!1}
vendor: 4,208 bytes, line 1
1):[],s=[],n.forEach(function(e,n){var r=0;e.weights.forEach(function(e){var u="quantization"in e?e.quantization.dtype:e.dtype,c=gl[u]*S(e.shape),l=function(){t[n]=!0,null==o[n]&&(o[n]=[]),o[n].push({manifestEntry:e,groupOffset:r,sizeBytes:c})};null!=i?i.forEach(function(t,n){t===e.name&&(l(),a[n]=!0)}):l(),s.push(e.name),r+=c})}),!a.every(function(e){return e}))throw u=i.filter(function(e,t){return!a[t]}),new Error("Could not find weights in manifest with names: "+u.join(", ")+". \nManifest JSON has weights with names: "+s.join(", ")+".");return c=t.reduce(function(e,t,n){return t&&e.push(n),e},[]),f=[],c.forEach(function(e){n[e].paths.forEach(function(e){var t=r+(r.endsWith("/")?"":"/")+e;f.push(t)})}),[4,e(f)];case 1:return h=l.sent(),d={},p=0,c.forEach(function(e){for(var t=n[e].paths.length,r=0,i=0;i<t;i++)r+=h[p+i].byteLength;for(var a=new ArrayBuffer(r),s=new Uint8Array(a),u=0,c=0;c<t;c++){var l=new Uint8Array(h[p+c]);s.set(l,u),u+=l.byteLength}o[e].forEach(function(e){var t=yl(a.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(var n in t)d[n]=t[n]}),p+=t}),[2,d]}})})}}El.registerSaveRouter(function(e){return f.getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Ql.URL_SCHEME)?(void 0===(t=e.slice(Ql.URL_SCHEME.length))&&(t="model"),new Ql(t)):null;var t});var of=function(){function e(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,null!=t.fetchFunc?(w("function"==typeof t.fetchFunc,function(){return"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"}),this.fetch=t.fetchFunc):this.fetch=ne,w(null!=e&&e.length>0,function(){return"URL path for http must not be null, undefined or empty."}),Array.isArray(e)&&w(2===e.length,function(){return"URL paths for http must have a length of 2, (actual length is "+e.length+")."}),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}return e.prototype.save=function(e){return c(this,void 0,void 0,function(){var t,n,r,i;return l(this,function(o){switch(o.label){case 0:if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");return(t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,n=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],r={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:n},t.body.append("model.json",new Blob([JSON.stringify(r)],{type:"application/json"}),"model.json"),null!=e.weightData&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:"application/octet-stream"}),"model.weights.bin"),[4,this.fetch(this.path,t)];case 1:if((i=o.sent()).ok)return[2,{modelArtifactsInfo:Sl(e),responses:[i]}];throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+i.status+".")}})})},e.prototype.load=function(){return c(this,void 0,void 0,function(){var e,t,n,r,i,o,a,s;return l(this,function(u){switch(u.label){case 0:return[4,this.fetch(this.path,this.requestInit)];case 1:if(!(e=u.sent()).ok)throw new Error("Request to "+this.path+" failed with status code "+e.status+". Please verify this URL points to the model JSON of the model to load.");u.label=2;case 2:return u.trys.push([2,4,,5]),[4,e.json()];case 3:return t=u.sent(),[3,5];case 4:throw u.sent(),n="Failed to parse model JSON of response from "+this.path+".",this.path.endsWith(".pb")?n+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":n+=" Please make sure the server is serving valid JSON for this request.",new Error(n);case 5:if(r=t.modelTopology,i=t.weightsManifest,null==r&&null==i)throw new Error("The JSON from HTTP path "+this.path+" contains
1neither model topology or manifest for weights.");return null==i?[3,7]:[4,this.loadWeights(i)];case 6:s=u.sent(),o=s[0],a=s[1],u.label=7;case 7:return[2,{modelTopology:r,weightSpecs:o,weightData:a}]}})})},e.prototype.loadWeights=function(e){return c(this,void 0,void 0,function(){var t,n,r,i,o,a,s,u,c,f,h;return l(this,function(l){switch(l.label){case 0:for(t=Array.isArray(this.path)?this.path[1]:this.path,n=function(e){var t=e.lastIndexOf("/"),n=e.lastIndexOf("?");return[e.substring(0,t)+"/",n>t?e.substring(n):""]}(t),r=n[0],i=n[1],o=this.weightPathPrefix||r,a=[],s=0,u=e;s<u.length;s++)c=u[s],a.push.apply(a,c.weights);return f=[],e.forEach(function(e){e.paths.forEach(function(e){f.push(o+e+i)})}),[4,nf(f,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress})];case 1:return h=l.sent(),[2,[a,_l(h)]]}})})},e.URL_SCHEME_REGEX=/^https?:\/\//,e}();function af(e){return null!=e.match(of.URL_SCHEME_REGEX)}var sf=function(e,t){return(Array.isArray(e)?e.every(function(e){return af(e)}):af(e))?uf(e,{onProgress:t}):null};function uf(e,t){return new of(e,t)}El.registerSaveRouter(sf),El.registerLoadRouter(sf);var cf=function(){function e(e,t,n){this.modelTopology=e,this.weightSpecs=t,this.weightData=n}return e.prototype.load=function(){return c(this,void 0,void 0,function(){var e;return l(this,function(t){return e={},null!=this.modelTopology&&(e=u({modelTopology:this.modelTopology},e)),null!=this.weightSpecs&&this.weightSpecs.length>0&&(e=u({weightSpecs:this.weightSpecs},e)),null!=this.weightData&&this.weightData.byteLength>0&&(e=u({weightData:this.weightData},e)),[2,e]})})},e}(),lf=function(){function e(e){this.saveHandler=e}return e.prototype.save=function(e){return c(this,void 0,void 0,function(){return l(this,function(t){return[2,this.saveHandler(e)]})})},e}(),ff=Object.freeze({browserFiles:function(e){return new ef(e)},browserHTTPRequest:function(e,t){return uf(e,t)},concatenateArrayBuffers:_l,decodeWeights:yl,encodeWeights:function(e,t){return c(this,void 0,void 0,function(){var n,r,i,o,a,s,u;return l(this,function(c){switch(c.label){case 0:for(n=[],r=[],i=Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e),o=0;o<i.length;++o){if(a=i[o],"float32"!==(s=Array.isArray(e)?e[o].tensor:e[a]).dtype&&"int32"!==s.dtype&&"bool"!==s.dtype)throw new Error("Unsupported dtype in weight '"+a+"': "+s.dtype);u={name:a,shape:s.shape,dtype:s.dtype},null!=t&&(u.group=t),n.push(u),r.push(s.data())}return[4,Promise.all(r)];case 1:return[2,{data:bl(c.sent()),specs:n}]}})})},fromMemory:function(e,t,n){return new cf(e,t,n)},getLoadHandlers:function(e,t){return El.getLoadHandlers(e,t)},getModelArtifactsInfoForJSON:Sl,getSaveHandlers:function(e){return El.getSaveHandlers(e)},http:uf,isHTTPScheme:af,loadWeights:function(e,t,n,r){return void 0===t&&(t=""),c(this,void 0,void 0,function(){return l(this,function(i){return[2,rf(function(e){return nf(e,{requestInit:r})})(e,t,n)]})})},registerLoadRouter:function(e){return El.registerLoadRouter(e)},registerSaveRouter:function(e){return El.registerSaveRouter(e)},weightsLoaderFactory:rf,withSaveHandler:function(e){return new lf(e)},copyModel:function(e,t){return c(this,void 0,void 0,function(){return l(this,function(n){return[2,Al(e,t,!1)]})})},listModels:function(){return c(this,void 0,void 0,function(){var e,t,n,r,i,o,a;return l(this,function(s){switch(s.label){case 0:e=Nl.getSchemes(),t={},n=0,r=e,s.label=1;case 1:return n<r.length?(i=r[n],[4,Nl.getManager(i).listModels()]):[3,4];case 2:for(a in o=s.sent())t[i+Cl+a]=o[a];s.label=3;case 3:return n++,[3,1];case 4:return[2,t]}})})},moveModel:function(e,t){return c(this,void 0,void 0,function(){return l(this,function(n){return[2,Al(e,t,!0)]})})},removeModel:function(e){return c(this,void 0,void 0,function(){var t;return l(this,function(n){return t=Ol(e),[2,Nl.getManager(t.scheme).removeModel(t.path)]})})}}),hf=jn({confusionMatrix_:function(e,t,n){var r=Cn(e,"labels","confusionMatrix"),i=Cn(t,"predictions","confusionMatrix");w(null==n||n>0&&Number.isInteger(n),function(){return"If provided, numClasses must be a positive integer, but got "+n}),w(1===r.rank,function(){return"Expected the rank of labels to be 1, but got "+r.rank}),w(1===i.rank,function(){return"Expected the rank of predictions to be 1, but got "+i.rank}),w(r.shape[0]===i.shape[0],function(){return"Mismatch in the number of examples: "+r.shape[0]+" vs. "+i.shape[0]+". Labels and predictions should have the same number of elements."}),w(n>0&&Number.isInteger(n),function(){return"numClasses is required to be a positive integer, but got "+n});var o=ni(r.asType("int32"),n),a=ni(i.asType("int32"),n);return o.transpose().matMul(a).asType("int32")}}),df=Object.freeze({confusionMatrix:hf}),pf=jn({fromPixels_:function(e,t){if(void 0===t&&(t=3),t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");return je.fromPixels(e,t)}}),mf=Object.freeze({toPixels:function(e,t){return c(this,void 0,void 0,function(){var n,r,i,o,a,s,u,c,f,h,d,p,m,v,g,y,b,w,x,_,k,S,E;return l(this,function(l){switch(l.label){case 0:if(n=Cn(e,"img","toPixels"),e instanceof ve||(n=n.toInt()),2!==n.rank&&3!==n.rank)throw new Error("toPixels only supports rank 2 or 3 tensors, got rank "+n.rank+".");if(r=n.shape.slice(0,2),i=r[0],o=r[1],(a=2===n.rank?1:n.shape[2])>4||2===a)throw new Error("toPixels only supports depth of size 1, 3 or 4 but got "+a);return[4,n.data()];case 1:return s=l.sent(),u=n.min(),c=n.max(),[4,Promise.all([u.data(),c.data()])];case 2:if(f=l.sent(),h=f[0],d=f[1],p=h[0],m=d[0],u.dispose(),c.dispose(),"float32"===n.dtype){if(p<0||m>1)throw new Error("Tensor values for a float32 Tensor must be in the range [0 - 1] but got range ["+p+" - "+m+"].")}else{if("int32"!==n.dtype)throw new Error("Unsupported type for toPixels: "+n.dtype+". Please use float32 or int32 tensors.");if(p<0||m>255)throw new Error("Tensor values for a int32 Tensor must be in the range [0 - 255] but got range ["+p+" - "+m+"].")}for(v="float32"===n.dtype?255:1,g=new Uint8ClampedArray(o*i*4),y=0;y<i*o;++y)b=void 0,w=void 0,x=void 0,_=void 0,1===a?(b=s[y]*v,w=s[y]*v,x=s[y]*v,_=255):3===a?(b=s[3*y]*v,w=s[3*y+1]*v,x=s[3*y+2]*v,_=255):4===a&&(b=s[4*y]*v,w=s[4*y+1]*v,x=s[4*y+2]*v,_=s[4*y+3]*v),g[0+(k=4*y)]=Math.round(b),g[k+1]=Math.round(w),g[k+2]=Math.round(x),g[k+3]=Math.round(_);return null!=t&&(t.width=o,t.height=i,S=t.getContext("2d"),E=new ImageData(g,o,i),S.putImageData(E,0,0)),n!==e&&n.dispose(),[2,g]}})})},fromPixels:pf}),vf=function(){function e(){}return e.prototype.getClassName=function(){return this.constructor.className},e.fromConfig=function(e,t){return new e(t)},e}(),gf=function(){function e(){this.classNameMap={}}return e.getMap=function(){return null==e.instance&&(e.instance=new e),e.instance},e.register=function(t){e.getMap().classNameMap[t.className]=[t,t.fromConfig]},e}();function yf(e){w(null!=e.className,function(){return"Class being registered does not have the static className property defined."}),w("string"==typeof e.className,function(){return"className is required to be a string, but got type "+typeof e.className}),w(e.className.length>0,function(){return"Class being registered has an empty-string as its className, which is disallowed."}),gf.register(e)}var bf=Object.freeze({Serializable:vf,SerializationMap:gf,registerClass:yf}),wf=.001,xf=.1;function _f(){return 32===je.backend.floatPrecision()?wf:xf}function kf(e,t,n){var r=!0;if((F(e)||F(t))&&(r=!1),F(e)&&F(t)&&(r=!0),r){var i=e.constructor.name,o=t.constructor.name;if(i!==o)throw new Error("Arrays are of different type. Actual: "+i+". Expected: "+o)}if(Array.isArray(e)&&Array.isArray(t)){var a=Sn(e),s=Sn(t);if(!E(a,s))throw new Error("Arrays have different shapes. Actual: ["+a+"]. Expected: ["+s+"]")}var u=F(e)?e:k(e),c=F(t)?t:k(t);if(u.length!==c.length)throw new Error("Arrays have different lengths actual: "+u.length+" vs expected: "+c.length+".\nActual: "+u+".\nExpected: "+c+".");for(var l=0;l<c.length;++l){var f=u[l],h=c[l];if(!n(f,h))throw new Error("Arrays differ: actual["+l+"] = "+f+", expected["+l+"] = "+h+".\nActual: "+u+".\nExpected: "+c+".")}}function Sf(e,t,n){return!isFinite(e)&&!isFinite(t)||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}var Ef=Object.freeze({TEST_EPSILON_FLOAT16:xf,expectArraysClose:function(e,t,n){return null==n&&(n=_f()),kf(e,t,function(e,t){return Sf(e,t,n)})},testEpsilon:_f,expectPromiseToFail:function(e,t){e().then(function(){return t.fail()},function(){return t()})},expectArraysEqual:function(e,t){var n="string"==typeof t||"number"==typeof t||"boolean"==typeof t?[t]:t;return V(e)||V(e[0])||V(t)||V(t[0])?kf(e,n,function(e,t){return e==t}):kf(e,t,function(e,t){return Sf(e,t,0)})},expectNumbersClose:function(e,t,n){if(null==n&&(n=_f()),!Sf(e,t,n))throw new Error("Numbers differ: actual === "+e+", expected === "+t)},expectValuesInRange:function(e,t,n){for(var r=0;r<e.length;r++)if(e[r]<t||e[r]>n)throw new Error("Value out of range:"+e[r]+" low: "+t+", high: "+n)},expectArrayBuffersEqual:function(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}}),Cf="1.2.1",Nf=Object.freeze({gpgpu_util:Jo,webgl_util:It,MathBacken
vendor: 13,470 bytes, line 1
1dWebGL:Ha,setWebGLContext:Be,GPGPUContext:Zo}),Of=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.minimize=function(e,t,n){void 0===t&&(t=!1);var r=this.computeGradients(e,n),i=r.value,o=r.grads;if(null!=n){var a=n.map(function(e){return{name:e.name,tensor:o[e.name]}});this.applyGradients(a)}else this.applyGradients(o);return Ft(o),t?i:(i.dispose(),null)},Object.defineProperty(t.prototype,"iterations",{get:function(){return null==this.iterations_&&(this.iterations_=0),this.iterations_},enumerable:!0,configurable:!0}),t.prototype.incrementIterations=function(){this.iterations_=this.iterations+1},t.prototype.computeGradients=function(e,t){return Rn(e,t)},t.prototype.dispose=function(){null!=this.iterations_&&Ft(this.iterations_)},t.prototype.saveIterations=function(){return c(this,void 0,void 0,function(){return l(this,function(e){return null==this.iterations_&&(this.iterations_=0),[2,{name:"iter",tensor:Wn(this.iterations_,"int32")}]})})},t.prototype.getWeights=function(){return c(this,void 0,void 0,function(){return l(this,function(e){throw new Error("getWeights() is not implemented for this optimizer yet.")})})},t.prototype.setWeights=function(e){return c(this,void 0,void 0,function(){return l(this,function(e){throw new Error("setWeights() is not implemented for this optimizer class "+this.getClassName())})})},t.prototype.extractIterations=function(e){return c(this,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:return t=this,[4,e[0].tensor.data()];case 1:return t.iterations_=n.sent()[0],[2,e.slice(1)]}})})},t}(vf);Object.defineProperty(Of,Symbol.hasInstance,{value:function(e){return null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients}});var Af=function(e){function t(t,n,r){void 0===r&&(r=null);var i=e.call(this)||this;return i.learningRate=t,i.rho=n,i.epsilon=r,i.accumulatedGrads=[],i.accumulatedUpdates=[],null==r&&(i.epsilon=je.backend.epsilon()),i}return s(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=je.registeredVariables[n];null==t.accumulatedGrads[r]&&(t.accumulatedGrads[r]={originalName:n+"/accum_grad",variable:Bt(function(){return tr(i).variable(!1)})}),null==t.accumulatedUpdates[r]&&(t.accumulatedUpdates[r]={originalName:n+"/accum_var",variable:Bt(function(){return tr(i).variable(!1)})});var o=Array.isArray(e)?e[r].tensor:e[n];if(null!=o){var a=t.accumulatedGrads[r].variable,s=t.accumulatedUpdates[r].variable;Bt(function(){var e=a.mul(t.rho).add(o.square().mul(1-t.rho)),n=s.add(t.epsilon).sqrt().div(a.add(t.epsilon).sqrt()).mul(o),r=s.mul(t.rho).add(n.square().mul(1-t.rho));a.assign(e),s.assign(r);var u=n.mul(-t.learningRate).add(i);i.assign(u)})}}),this.incrementIterations()},t.prototype.dispose=function(){null!=this.accumulatedUpdates&&(Ft(this.accumulatedGrads.map(function(e){return e.variable})),Ft(this.accumulatedUpdates.map(function(e){return e.variable})))},t.prototype.getWeights=function(){return c(this,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return e=this.accumulatedGrads.concat(this.accumulatedUpdates),[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(e.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return c(this,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:return[4,this.extractIterations(e)];case 1:return e=n.sent(),t=e.length/2,this.accumulatedGrads=e.slice(0,t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),this.accumulatedUpdates=e.slice(t,2*t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.rho,t.epsilon)},t.className="AdadeltaOptimizer",t}(Of);yf(Af);var Tf=function(e){function t(t,n){void 0===n&&(n=.1);var r=e.call(this)||this;return r.learningRate=t,r.initialAccumulatorValue=n,r.accumulatedGrads=[],r}return s(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=je.registeredVariables[n];null==t.accumulatedGrads[r]&&(t.accumulatedGrads[r]={originalName:n+"/accumulator",variable:Bt(function(){return Jn(i.shape,t.initialAccumulatorValue).variable(!1)})});var o=Array.isArray(e)?e[r].tensor:e[n];if(null!=o){var a=t.accumulatedGrads[r].variable;Bt(function(){var e=a.add(o.square());a.assign(e);var n=o.div(e.add(je.backend.epsilon()).sqrt()).mul(-t.learningRate).add(i);i.assign(n)})}}),this.incrementIterations()},t.prototype.dispose=function(){null!=this.accumulatedGrads&&Ft(this.accumulatedGrads.map(function(e){return e.variable}))},t.prototype.getWeights=function(){return c(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.saveIterations()];case 1:return[2,[e.sent()].concat(this.accumulatedGrads.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return c(this,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,this.extractIterations(e)];case 1:return e=t.sent(),this.accumulatedGrads=e.map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}},t.fromConfig=function(e,t){return new e(t.learningRate,t.initialAccumulatorValue)},t.className="Adagrad",t}(Of);yf(Tf);var If=function(e){function t(t,n,r,i){void 0===i&&(i=null);var o=e.call(this)||this;return o.learningRate=t,o.beta1=n,o.beta2=r,o.epsilon=i,o.accumulatedFirstMoment=[],o.accumulatedSecondMoment=[],Bt(function(){o.accBeta1=Wn(n).variable(),o.accBeta2=Wn(r).variable()}),null==i&&(o.epsilon=je.backend.epsilon()),o}return s(t,e),t.prototype.applyGradients=function(e){var t=this,n=Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e);Bt(function(){var r=ic(1,t.accBeta1),i=ic(1,t.accBeta2);n.forEach(function(n,o){var a=je.registeredVariables[n];null==t.accumulatedFirstMoment[o]&&(t.accumulatedFirstMoment[o]={originalName:n+"/m",variable:Bt(function(){return tr(a).variable(!1)})}),null==t.accumulatedSecondMoment[o]&&(t.accumulatedSecondMoment[o]={originalName:n+"/v",variable:Bt(function(){return tr(a).variable(!1)})});var s=Array.isArray(e)?e[o].tensor:e[n];if(null!=s){var u=t.accumulatedFirstMoment[o].variable,c=t.accumulatedSecondMoment[o].variable,l=u.mul(t.beta1).add(s.mul(1-t.beta1)),f=c.mul(t.beta2).add(s.square().mul(1-t.beta2)),h=l.div(r),d=f.div(i);u.assign(l),c.assign(f);var p=h.div(d.sqrt().add(t.epsilon)).mul(-t.learningRate).add(a);a.assign(p)}}),t.accBeta1.assign(t.accBeta1.mul(t.beta1)),t.accBeta2.assign(t.accBeta2.mul(t.beta2))}),this.incrementIterations()},t.prototype.dispose=function(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Ft(this.accumulatedFirstMoment.map(function(e){return e.variable})),null!=this.accumulatedSecondMoment&&Ft(this.accumulatedSecondMoment.map(function(e){return e.variable}))},t.prototype.getWeights=function(){return c(this,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return e=this.accumulatedFirstMoment.concat(this.accumulatedSecondMoment),[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(e.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return c(this,void 0,void 0,function(){var t,n=this;return l(this,function(r){switch(r.label){case 0:return[4,this.extractIterations(e)];case 1:return e=r.sent(),Bt(function(){n.accBeta1.assign(ec(n.beta1,n.iterations_+1)),n.accBeta2.assign(ec(n.beta2,n.iterations_+1))}),t=e.length/2,this.accumulatedFirstMoment=e.slice(0,t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),this.accumulatedSecondMoment=e.slice(t,2*t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)},t.className="Adam",t}(Of);yf(If);var Rf=function(e){function t(t,n,r,i,o){void 0===i&&(i=null),void 0===o&&(o=0);var a=e.call(this)||this;return a.learningRate=t,a.beta1=n,a.beta2=r,a.epsilon=i,a.decay=o,a.accumulatedFirstMoment=[],a.accumulatedWeightedInfNorm=[],Bt(function(){a.iteration=Wn(0).variable(),a.accBeta1=Wn(n).variable()}),null==i&&(a.epsilon=je.backend.epsilon()),a}return s(t,e),t.prototype.applyGradients=function(e){var t=this,n=Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e);Bt(function(){var r=ic(1,t.accBeta1),i=Vu(-t.learningRate,t.iteration.mul(t.decay).add(1));n.forEach(function(n,o){var a=je.registeredVariables[n];null==t.accumulatedFirstMoment[o]&&(t.accumulatedFirstMoment[o]={originalName:n+"/m",variable:tr(a).variable(!1)}),null==t.accumulatedWeightedInfNorm[o]&&(t.accumulatedWeightedInfNorm[o]={originalName:n+"/v",variable:tr(a).variable(!1)});var s=Array.isArray(e)?e[o].tensor:e[n];if(null!=s){var u=t.accumulatedFirstMoment[o].variable,c=t.accumulatedWeightedInfNorm[o].variable,l=u.mul(t.beta1).add(s.mul(1-t.beta1)),f=c.mul(t.beta2),h=s.abs(),d=f.maximum(h);u.assign(l),c.assign(d);var p=i.div(r).mul(l.div(d.add(t.epsilon))).add(a);a.assign(p)}}),t.iteration.assign(t.iteration.add(1)),t.accBeta1.assign(t.accBeta1.mul(t.beta1))}),this.incrementIterations()},t.prototype.dispose=function(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Ft(this.accumulatedFirstMoment.map(function(e){return e.variable})),null!=this.accumulatedWeightedInfNorm&&Ft(this.accumulatedWeightedInfNorm.map(function(e){return e.variable}))},t.prototype.getWeights=function(){return c(this,void 0,void 0,function(){return l(this,function(e){throw new Error("getWeights() is not implemented for Adamax yet.")})})},t.prototype.setWeights=function(e){return c(this,void 0,void 0,function(){return l(this,function(e){throw new Error("setWeights() is not implemented for Adamax yet.")})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}},t.fromConfig=function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)},t.className="Adamax",t}(Of);yf(Rf);var Mf=function(e){function t(t){var n=e.call(this)||this;return n.learningRate=t,n.setLearningRate(t),n}return s(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=Array.isArray(e)?e[r].tensor:e[n];if(null!=i){var o=je.registeredVariables[n];Bt(function(){var e=t.c.mul(i).add(o);o.assign(e)})}}),this.incrementIterations()},t.prototype.setLearningRate=function(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=Ut(Wn(-e))},t.prototype.dispose=function(){this.c.dispose()},t.prototype.getWeights=function(){return c(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.saveIterations()];case 1:return[2,[e.sent()]]}})})},t.prototype.setWeights=function(e){return c(this,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,this.extractIterations(e)];case 1:if(0!==(e=t.sent()).length)throw new Error("SGD optimizer does not have settable weights.");return[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate}},t.fromConfig=function(e,t){return new e(t.learningRate)},t.className="SGD",t}(Of);yf(Mf);var Df=function(e){function t(t,n,r){void 0===r&&(r=!1);var i=e.call(this,t)||this;return i.learningRate=t,i.momentum=n,i.useNesterov=r,i.accumulations=[],i.m=Wn(i.momentum),i}return s(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=je.registeredVariables[n];null==t.accumulations[r]&&(t.accumulations[r]={originalName:n+"/momentum",variable:Bt(function(){return tr(i).variable(!1)})});var o=t.accumulations[r].variable,a=Array.isArray(e)?e[r].tensor:e[n];null!=a&&Bt(function(){var e,n=t.m.mul(o).add(a);e=t.useNesterov?t.c.mul(a.add(n.mul(t.m))).add(i):t.c.mul(n).add(i),o.assign(n),i.assign(e)})}),this.incrementIterations()},t.prototype.dispose=function(){this.m.dispose(),null!=this.accumulations&&Ft(this.accumulations.map(function(e){return e.variable}))},t.prototype.setMomentum=function(e){this.momentum=e},t.prototype.getWeights=function(){return c(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.saveIterations()];case 1:return[2,[e.sent()].concat(this.accumulations.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return c(this,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,this.extractIterations(e)];case 1:return e=t.sent(),this.accumulations=e.map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov
1:this.useNesterov}},t.fromConfig=function(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)},t.className="MomentumOptimizer",t}(Mf);yf(Df);var jf=function(e){function t(t,n,r,i,o){void 0===n&&(n=.9),void 0===r&&(r=0),void 0===i&&(i=null),void 0===o&&(o=!1);var a=e.call(this)||this;return a.learningRate=t,a.decay=n,a.momentum=r,a.epsilon=i,a.accumulatedMeanSquares=[],a.accumulatedMoments=[],a.accumulatedMeanGrads=[],a.centered=o,null==i&&(a.epsilon=je.backend.epsilon()),a}return s(t,e),t.prototype.applyGradients=function(e){var t=this;(Array.isArray(e)?e.map(function(e){return e.name}):Object.keys(e)).forEach(function(n,r){var i=je.registeredVariables[n];null==t.accumulatedMeanSquares[r]&&(t.accumulatedMeanSquares[r]={originalName:n+"/rms",variable:Bt(function(){return tr(i).variable(!1)})}),null==t.accumulatedMoments[r]&&(t.accumulatedMoments[r]={originalName:n+"/momentum",variable:Bt(function(){return tr(i).variable(!1)})}),null==t.accumulatedMeanGrads[r]&&t.centered&&(t.accumulatedMeanGrads[r]={originalName:n+"/mg",variable:Bt(function(){return tr(i).variable(!1)})});var o=Array.isArray(e)?e[r].tensor:e[n];if(null!=o){var a=t.accumulatedMeanSquares[r].variable,s=t.accumulatedMoments[r].variable;Bt(function(){var e=a.mul(t.decay).add(o.square().mul(1-t.decay));if(t.centered){var n=t.accumulatedMeanGrads[r].variable,u=n.mul(t.decay).add(o.mul(1-t.decay)),c=s.mul(t.momentum).add(o.mul(t.learningRate).div(e.sub(u.square().add(t.epsilon)).sqrt()));a.assign(e),n.assign(u),s.assign(c);var l=i.sub(c);i.assign(l)}else{var f=a.mul(t.decay).add(o.square().mul(1-t.decay));c=s.mul(t.momentum).add(o.mul(t.learningRate).div(f.add(t.epsilon).sqrt())),a.assign(f),s.assign(c),l=i.sub(c),i.assign(l)}})}}),this.incrementIterations()},t.prototype.dispose=function(){null!=this.accumulatedMeanSquares&&Ft(this.accumulatedMeanSquares.map(function(e){return e.variable})),null!=this.accumulatedMeanGrads&&this.centered&&Ft(this.accumulatedMeanGrads.map(function(e){return e.variable})),null!=this.accumulatedMoments&&Ft(this.accumulatedMoments.map(function(e){return e.variable}))},t.prototype.getWeights=function(){return c(this,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return e=this.accumulatedMeanSquares.concat(this.accumulatedMoments),this.centered&&e.push.apply(e,this.accumulatedMeanGrads),[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(e.map(function(e){return{name:e.originalName,tensor:e.variable}}))]}})})},t.prototype.setWeights=function(e){return c(this,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:return[4,this.extractIterations(e)];case 1:return e=n.sent(),t=this.centered?e.length/3:e.length/2,this.accumulatedMeanSquares=e.slice(0,t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),this.accumulatedMoments=e.slice(t,2*t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}}),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map(function(e){return{originalName:e.name,variable:e.tensor.variable(!1)}})),[2]}})})},t.prototype.getConfig=function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}},t.fromConfig=function(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)},t.className="RMSProp",t}(Of);yf(jf);var Pf=function(){function e(){}return e.sgd=function(e){return new Mf(e)},e.momentum=function(e,t,n){return void 0===n&&(n=!1),new Df(e,t,n)},e.rmsprop=function(e,t,n,r,i){return void 0===t&&(t=.9),void 0===n&&(n=0),void 0===r&&(r=null),void 0===i&&(i=!1),new jf(e,t,n,r,i)},e.adam=function(e,t,n,r){return void 0===e&&(e=.001),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),new If(e,t,n,r)},e.adadelta=function(e,t,n){return void 0===e&&(e=.001),void 0===t&&(t=.95),void 0===n&&(n=null),new Af(e,t,n)},e.adamax=function(e,t,n,r,i){return void 0===e&&(e=.002),void 0===t&&(t=.9),void 0===n&&(n=.999),void 0===r&&(r=null),void 0===i&&(i=0),new Rf(e,t,n,r,i)},e.adagrad=function(e,t){return void 0===t&&(t=.1),new Tf(e,t)},e}(),zf={sgd:Pf.sgd,momentum:Pf.momentum,adadelta:Pf.adadelta,adagrad:Pf.adagrad,rmsprop:Pf.rmsprop,adamax:Pf.adamax,adam:Pf.adam},Lf="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof o?o:function(e){return e()};function Bf(){return new Promise(function(e){return Lf(function(){return e()})})}pe=hl}.call(this,n(31),n(17),n(15).Buffer,n(80).setImmediate)},function(e,t,n){e.exports=n(139)()},function(e,t,n){"use strict";e.exports=n(130)},function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"c",function(){return s}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return f}),n.d(t,"a",function(){return h});n(122);var r,i=n(1),o=n.n(i);function a(e,t){return void 0===e&&(e=""),void 0===t&&(t=r),t?e.split(" ").map(function(e){return t[e]||e}).join(" "):e}function s(e,t){var n={};return Object.keys(e).forEach(function(r){-1===t.indexOf(r)&&(n[r]=e[r])}),n}var u={};function c(e){u[e]||("undefined"!==typeof console&&console.error(e),u[e]=!0)}var l="object"===typeof window&&window.Element||function(){};o.a.oneOfType([o.a.string,o.a.func,function(e,t,n){if(!(e[t]instanceof l))return new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Expected prop to be an instance of Element. Validation failed.")},o.a.shape({current:o.a.any})]);var f=o.a.oneOfType([o.a.func,o.a.string,o.a.shape({$$typeof:o.a.symbol,render:
1o.a.func}),o.a.arrayOf(o.a.oneOfType([o.a.func,o.a.string,o.a.shape({$$typeof:o.a.symbol,render:o.a.func})]))]),h={esc:27,space:32,enter:13,tab:9,up:38,down:40,home:36,end:35,n:78,p:80};"undefined"===typeof window||!window.document||window.document.createElement},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",function(){return r})},function(e,t){"function"===typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var r=n(15),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.r(t);var r=n(0),i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a,s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function u(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function c(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function l(){return null==a&&(a=Object(r.backend)().epsilon()),a}var f=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return o(t,e),t}(Error),h=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return o(t,e),t}(Error),d=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return o(t,e),t}(Error),p=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return o(t,e),t}(Error),m=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return o(t,e),t}(Error);!function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}o(t,e)}(Error);function v(e,t){if(Array.isArray(e)){for(var n=[],r=0;r<t;r++)n=n.concat(e);return n}return(n=new Array(t)).fill(e),n}
1function g(e,t){if(!e)throw new m(t)}function y(e,t){for(var n=0,r=0,i=e;r<i.length;r++)i[r]===t&&n++;return n}function b(e){return 1===e.length?e[0]:e}function w(e){return Array.isArray(e)?e:[e]}function x(e){var t=e.replace(/(.)([A-Z][a-z0-9]+)/g,"$1_$2").replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase();return"_"!==t[0]?t:"private"+t}function _(e){return e.length<=1?e:-1===e.indexOf("_")?e:e.replace(/[_]+(\w|$)/g,function(e,t){return t.toUpperCase()})}var k={};function S(e){if(null===e||void 0===e)return null;var t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function E(e,t,n,r,i){var o,a,u;if(void 0===t&&(t={}),void 0===n&&(n={}),void 0===r&&(r="object"),void 0===i&&(i=!1),"string"==typeof e){var c=e,l=void 0;if(c in n)l=n[c];else if(c in k)l=k[c];else if(null==(l=t[c]))throw new d("Unknown "+r+": "+e+". This may be due to one of the following reasons:\n1. The "+r+" is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom "+r+" is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().");return l}var f=e;if(null==f.className||null==f.config)throw new d(r+": Improper config format: "+JSON.stringify(f)+".\n'className' and 'config' must set.");var h=f.className,p=void 0,m=void 0;if(h in n?(p=(o=n[h])[0],m=o[1]):h in k?(p=(a=k.className)[0],m=a[1]):h in t&&(p=(u=t[h])[0],m=u[1]),null==p)throw new d("Unknown "+r+": "+h+". This may be due to one of the following reasons:\n1. The "+r+" is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom "+r+" is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().");if(null!=m){for(var v={},g=0,y=Object.keys(k);g<y.length;g++)v[E=y[g]]=k[E];for(var b=0,w=Object.keys(n);b<w.length;b++)v[E=w[b]]=n[E];f.config.customObjects=v;for(var x=s({},k),_=0,S=Object.keys(n);_<S.length;_++){var E=S[_];k[E]=n[E]}!function e(t){if(null!=t&&"object"==typeof t)if(Array.isArray(t))t.forEach(function(t){return e(t)});else for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n],o=t[i];null!=o&&"object"==typeof o&&(Array.isArray(o)||"ndarray"!==o.type||"number"!=typeof o.value?e(o):t[i]=o.value)}}(f.config);var C=m(p,f.config,n,i);return k=s({},x),C}x=s({},k);for(var N=0,O=Object.keys(n);N<O.length;N++)E=O[N],k[E]=n[E];return C=new p(f.config),k=s({},x),C}function C(e,t){return-1*function(e,t){return e<t?-1:e>t?1:0}(e,t)}function N(e){if(null==e)return e;for(var t=[],n=0,r=e;n<r.length;n++){var i=r[n];-1===t.indexOf(i)&&t.push(i)}return t}function O(e){if(null==e)throw new d("Invalid value in obj: "+JSON.stringify(e));for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function A(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new d(n+" is not a valid "+t+". Valid values are "+e+" or null/undefined.")}function T(e,t,n,r){return void 0===n&&(n=0),void 0===r&&(r=1/0),g(n>=0),g(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every(function(e){return typeof e===t})}function I(e,t){Array.isArray(e)?(r.util.assert(e.length>0,function(){return t+" is unexpectedly an empty array."}),e.forEach(function(e,n){return I(e,"element "+(n+1)+" of "+t)})):r.util.assert(Number.isInteger(e)&&e>0,function(){return"Expected "+t+" to be a positive integer, but got "+function e(t){return null===t?"null":Array.isArray(t)?"["+t.map(function(t){return e(t)}).join(",")+"]":"string"==typeof t?'"'+t+'"':""+t}(e)+"."})}function R(e,t){return Object(r.tidy)(function(){return Object(r.sqrt)(Object(r.sum)(Object(r.mulStrict)(e,e),t,!0))})}var M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.getConfig=function(){return{}},t}(r.serialization.Serializable),D=function(e){function t(t){var n=e.call(this)||this;return n.defaultMaxValue=2,n.defaultAxis=0,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return o(t,e),t.prototype.apply=function(e){var t=this;return Object(r.tidy)(function(){var n=R(e,t.axis),i=Object(r.clipByValue)(n,0,t.maxValue);return Object(r.mul)(e,Object(r.div)(i,Object(r.add)(l(),n)))})},t.prototype.getConfig=function(){return{maxValue:this.maxValue,axis:this.axis}},t.className="MaxNorm",t}(M);r.serialization.registerClass(D);var j=function(e){function t(t){var n=e.call(this)||this;return n.defaultAxis=0,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return o(t,e),t.prototype.apply=function(e){var t=this;return Object(r.tidy)(function(){return Object(r.div)(e,Object(r.add)(l(),R(e,t.axis)))})},t.prototype.getConfig=function(){return{axis:this.axis}},t.className="UnitNorm",t}(M);r.serialization.registerClass(j);var P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return Object(r.relu)(e)},t.className="NonNeg",t}(M);r.serialization.registerClass(P);var z=function(e){function t(t){var n=e.call(this)||this;return n.defaultMinValue=0,n.defaultMaxValue=1,n.defaultRate=1,n.defaultAxis=0,n.minValue=null!=t.minValue?t.minValue:n.defaultMinValue,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.rate=null!=t.rate?t.rate:n.defaultRate,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return o(t,e),t.prototype.apply=function(e){var t=this;return Object(r.tidy)(function(){var n=R(e,t.axis),i=Object(r.add)(Object(r.mul)(t.rate,Object(r.clipByValue)(n,t.minValue,t.maxValue)),Object(r.mul)(1-t.rate,n));return Object(r.mul)(e,Object(r.div)(i,Object(r.add)(l(),n)))})},t.prototype.getConfig=function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}},t.className="MinMaxNorm",t}(M);r.serialization.registerClass(z);
vendor: 4,277 bytes, line 1
1var L={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function B(e){return S(e)}function F(e,t){return void 0===t&&(t={}),E(e,r.serialization.SerializationMap.getMap().classNameMap,t,"constraint")}function U(e){return null==e?null:"string"==typeof e?F({className:e in L?L[e]:e,config:{}}):e instanceof M?e:F(e)}var W=Object.freeze({maxNorm:function(e){return new D(e)},unitNorm:function(e){return new j(e)},nonNeg:function(){return new P},minMaxNorm:function(e){return new z(e)}}),V=["channelsFirst","channelsLast"],q=["valid","same","causal"],H=["max","avg"],G=["sum","mul","concat","ave"],K=new Map;function $(e){A(V,"DataFormat",e)}function X(e){A(q,"PaddingMode",e)}var Y=[],J="/";function Z(e,t){Y.push(e);try{var n=t();return Y.pop(),n}catch(e){throw Y.pop(),e}}function Q(e){if(!ne(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===Y.length?"":Y.join(J)+J)+e}function ee(e){if(!ne(e))throw new Error("Not a valid tensor name: '"+e+"'");K.has(e)||K.set(e,0);var t=K.get(e);if(K.set(e,K.get(e)+1),t>0){var n=e+"_"+t;return K.set(n,1),n}return e}var te=new RegExp(/^[A-Za-z][-A-Za-z0-9\._\/]*$/);function ne(e){return!!e.match(te)}function re(e){return e===parseInt(e.toString(),10)}function ie(e,t,n){null==t&&(t=0),null==n&&(n=e.length);for(var r=1,i=t;i<n;++i)r*=e[i];return r}function oe(e){return e=Array.isArray(e)?new Float32Array(e):e,Object(r.tensor1d)(e)}function ae(e){return Object(r.min)(oe(e)).dataSync()[0]}function se(e){return Object(r.max)(oe(e)).dataSync()[0]}function ue(e,t){if(t<e)throw new d("end ("+t+") < begin ("+e+") is forbidden.");for(var n=[],r=e;r<t;++r)n.push(r);return n}function ce(e,t){return e.asType(t)}function le(e,t){void 0===t&&(t=-1);var n=e.shape.slice();return t<0&&(t=n.length+t+1),n.splice(t,0,1),e.reshape(n)}function fe(e,t,n){return Object(r.tidy)(function(){switch(e.rank){case 1:return Object(r.slice1d)(e,t,n);case 2:return Object(r.slice2d)(e,[t,0],[n,e.shape[1]]);case 3:return Object(r.slice3d)(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return Object(r.slice4d)(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);default:throw new d("sliceAlongFirstAxis() received an unsupported tensor rank: "+e.rank)}})}function he(e,t,n){return Object(r.tidy)(function(){switch(e.rank){case 1:return Object(r.slice1d)(e,t,n);case 2:return Object(r.slice2d)(e,[0,t],[e.shape[0],n]);case 3:return Object(r.slice3d)(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return Object(r.slice4d)(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new d("sliceAlongLastAxis() received an unsupported tensor rank: "+e.rank)}})}function de(e,t,n,i){return Object(r.tidy)(function(){switch(e.rank){case 1:return Object(r.slice1d)(e,t,n);case 2:switch(i){case 1:return fe(e,t,n);case 2:return he(e,t,n);default:throw new d("The axis is not within the rank of the tensor "+i)}case 3:switch(i){case 1:return fe(e,t,n);case 2:return Object(r.slice3d)(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return he(e,t,n);default:throw new d("The axis is not within the rank of the tensor "+i)}case 4:switch(i){case 1:return fe(e,t,n);case 2:return Object(r.slice4d)(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return Object(r.slice4d)(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return he(e,t,n);default:throw new d("The axis is not within the rank of the tensor "+i)}default:throw new d("sliceAlongLastAxis() received an unsupported tensor rank: "+e.rank)}})}function pe(e,t){var n;return void 0===t&&(t=-1),t<0&&(t=0!==(n=e[0].rank)?n:0),t===e[0].rank&&(t=-1),Object(r.concat)(e,t)}function me(e,t){switch(e.rank){case 1:return Object(r.concat1d)([e,t]);case 2:return Object(r.concat2d)([e,t],0);case 3:return Object(r.concat3d)([e,t],0);case 4:return Object(r.concat4d)([e,t],0);default:throw new d("concatAlongFirstAxis() received an unsupported tensor rank: "+e.rank)}}function ve(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new d("The length of input n ("+t.length+") does not match the number of dimensions in input x ("+e.rank+")");return Object(r.tile)(e,t)}function ge(e,t,n,i,o){return void 0===t&&(t=0),void 0===n&&(n=1),Object(r.randomNormal)(e,t,n,i,o)}function ye(e,t,n,i){if(e.rank<2||t.rank<2)throw new p("dot requires both inputs to be rank >
1= 2 but got x shape = "+e.shape+" and y shape = "+t.shape);if(t.rank>=3&&(u=e.shape.slice(-1)[0])!==(f=t.shape.slice(-2)[0]))throw new p("If rank y >= 3, then the second last dim of y must equal the last dim of x but got x shape = "+e.shape+" and y shape = "+t.shape);if(2===e.rank&&2===t.rank){var o=!1,a=!1;return r.fused.matMul(e,t,o,a,i?xe(e.rank,i,"channelsLast"):null,n)}var s=e.shape.slice(),u=s.pop();e=e.reshape([-1,u]);var c=t.shape.slice(),l=c.pop(),f=c.pop(),h=c.concat([l]),d=Array.from({length:t.rank},function(e,n){return 0===n?t.rank-2:n<=t.rank-2?n-1:n});t=t.transpose(d).reshape([f,-1]);var m=s.concat(h);return o=!1,a=!1,r.fused.matMul(e,t,o,a,i?xe(e.rank,i,"channelsLast"):null,n).reshape(m)}function be(e,t,n){return Object(r.tidy)(function(){return t=Array.isArray(t)?Object(r.tensor1d)(t,"int32"):t.toInt(),Object(r.gather)(e,t,n)})}function we(e){return Object(r.mulStrict)(e,e)}function xe(e,t,n){var r=t.shape;if(1!==t.rank&&t.rank!==e)throw new d("Unexpected bias dimensions: "+t.rank+"; expected it to be 1 or "+e);if(5===e){if("channelsFirst"===n)return 1===r.length?t.reshape([1,r[0],1,1,1]):t.reshape([1,r[3],r[0],r[1],r[2]]);if("channelsLast"===n)return 1===r.length?t.reshape([1,1,1,1,r[0]]):t.reshape([1].concat(r))}else if(4===e){if("channelsFirst"===n)return 1===r.length?t.reshape([1,r[0],1,1]):t.reshape([1,r[2],r[0],r[1]]);if("channelsLast"===n)return 1===r.length?t.reshape([1,1,1,r[0]]):t.reshape([1].concat(r))}else if(3===e){if("channelsFirst"===n)return 1===r.length?t.reshape([1,r[0],1]):t.reshape([1,r[1],r[0]]);if("channelsLast"===n)return 1===r.length?t.reshape([1,1,r[0]]):t.reshape([1].concat(r))}else if(e<3)return t;throw new d("Unsupported input rank by biasAdd: "+t.rank)}function _e(e,t,n){return Object(r.tidy)(function(){return null==n&&(n="channelsLast"),$(n),e.add(xe(e.rank,t,n))})}function ke(e,t,n,i){return Object(r.tidy)(function(){return Object(r.dropout)(e,t,n,i)})}function Se(e,t,n){return void 0===n&&(n=!1),n?e():t()}var Ee=["fanIn","fanOut","fanAvg"],Ce=["normal","uniform","truncatedNormal"];var Ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.fromConfigUsesCustomObjects=function(){return!1},t.prototype.getConfig=function(){return{}},t}(r.serialization.Serializable),Oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e,t){return Object(r.zeros)(e,t)},t.className="Zeros",t}(Ne);r.serialization.registerClass(Oe);var Ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e,t){return Object(r.ones)(e,t)},t.className="Ones",t}(Ne);r.serialization.registerClass(Ae);var Te=function(e){function t(t){var n=e.call(this)||this;if("object"!=typeof t)throw new d("Expected argument of type ConstantConfig but got "+t);if(void 0===t.value)throw new d("config must have value set but got "+t);return n.value=t.value,n}return o(t,e),t.prototype.apply=function(e,t){var n=this;return Object(r.tidy)(function(){return Object(r.mul)(Object(r.scalar)(n.value),Object(r.ones)(e,t))})},t.prototype.getConfig=function(){return{value:this.value}},t.className="Constant",t}(Ne);r.serialization.registerClass(Te);var Ie=function(e){function t(t){var n=e.call(this)||this;return n.DEFAULT_MINVAL=-.05,n.DEFAULT_MAXVAL=.05,n.minval=t.minval||n.DEFAULT_MINVAL,n.maxval=t.maxval||n.DEFAULT_MAXVAL,n.seed=t.seed,n}return o(t,e),t.prototype.apply=function(e,t){return Object(r.randomUniform)(e,this.minval,this.maxval,t)},t.prototype.getConfig=function(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}},t.className="RandomUniform",t}(Ne);r.serialization.registerClass(Ie);var Re=function(e){function t(t){var n=e.call(this)||this;return n.DEFAULT_MEAN=0,n.DEFAULT_STDDEV=.05,n.mean=t.mean||n.DEFAULT_MEAN,n.stddev=t.stddev||n.DEFAULT_STDDEV,n.seed=t.seed,n}return o(t,e),t.prototype.apply=function(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new p("randomNormal does not support dType "+t+".");return ge(e,this.mean,this.stddev,t,this.seed)},t.prototype.getConfig=function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}},t.className="RandomNormal",t}(Ne);r.serialization.registerClass(Re);var Me=function(e){function t(t){var n=e.call(this)||this;return n.DEFAULT_MEAN=0,n.DEFAULT_STDDEV=.05,n.mean=t.mean||n.DEFAULT_MEAN,n.stddev=t.stddev||n.DEFAULT_STDDEV,n.seed=t.seed,n}return o(t,e),t.prototype.apply=function(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new p("truncatedNormal does not support dType "+t+".");return Object(r.truncatedNormal)(e,this.mean,this.stddev,t,this.seed)},t.prototype.getConfig=function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}},t.className="TruncatedNormal",t}(Ne);r.serialization.registerClass(Me);var De=function(e){function t(t){var n=e.call(this)||this;return n.gain=null!=t.gain?t.gain:1,n}return o(t,e),t.prototype.apply=function(e,t){var n=this;return Object(r.tidy)(function(){if(2!==e.length||e[0]!==e[1])throw new d("Identity matrix initializer can only be used for 2D square matrices.");return Object(r.mul)(n.gain,Object(r.eye)(e[0]))})},t.prototype.getConfig=function(){return{gain:this.gain}},t.className="Identity",t}(Ne);r.serialization.registerClass(De);var je=function(e){function t(t){var n=e.call(this)||this;if(t.scale<0)throw new d("scale must be a positive float. Got: "+t.scale);return n.scale=null==t.scale?1:t.scale,n.mode=null==t.mode?"fanIn":t.mode,function(e){A(Ee,"FanMode",e)}(n.mode),n.distribution=null==t.distribution?"normal":t.distribution,function(e){A(Ce,"Distribution",e)}(n.distribution),n.seed=t.seed,n}return o(t,e),t.prototype.apply=function(e,t){var n=function(e,t){var n,r;if(void 0===t&&(t="channelsLast"),$(t),2===e.length)n=e[0],r=e[1];else if(-1!==[3,4,5].indexOf(e.length))if("channelsFirst"===t){var i=ie(e,2);n=e[1]*i,r=e[0]*i}else"channelsLast"===t&&(i=ie(e,0,e.length-2),n=e[e.length-2]*i,r=e[e.length-1]*i);else{var o=ie(e);n=Math.sqrt(o),r=Math.sqrt(o)}return[n,r]}(e),i=n[0],o=n[1],a=this.scale;if("fanIn"===this.mode?a/=Math.max(1,i):"fanOut"===this.mode?a/=Math.max(1,o):a/=Math.max(1,(i+o)/2),"normal"===this.distribution){var s=Math.sqrt(a);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new p(this.getClassName()+" does not support dType "+t+".");return Object(r.truncatedNormal)(e,0,s,t,this.seed)}var u=Math.sqrt(3*a);return Object(r.randomUniform)(e,-u,u,t)},t.prototype.getConfig=function(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}},t.className="VarianceScaling",t}(Ne);r.serialization.registerClass(je);var Pe=function(e){function t(t){return e.call(this,{scale:1,mode:"fanAvg",distribution:"uniform",seed:null==t?null:t.seed})||this}return o(t,e),t.prototype.getClassName=function(){return je.className},t.className="GlorotUniform",t}(je);r.serialization.registerClass(Pe);var ze=function(e){function t(t){return e.call(this,{scale:1,mode:"fanAvg",distribution:"normal",seed:null==t?null:t.seed})||this}return o(t,e),t.prototype.getClassName=function(){return je.className},t.className="GlorotNormal",t}(je);r.serialization.registerClass(ze);var Le=function(e){function t(t){return e.call(this,{scale:2,mode:"fanIn",distribution:"normal",seed:null==t?null:t.seed})||this}return o(t,e),t.prototype.getClassName=function(){return je.className},t.className="HeNormal",t}(je);r.serialization.registerClass(Le);var Be=function(e){function t(t){return e.call(this,{scale:2,mode:"fanIn",distribution:"uniform",seed:null==t?null:t.seed})||this}return o(t,e),t.prototype.getClassName=function(){return je.className},t.className="HeUniform",t}(je);r.serialization.registerClass(Be);var Fe=function(e){function t(t){return e.call(this,{scale:1,mode:"fanIn",distribution:"normal",seed:null==t?null:t.seed})||this}return o(t,e),t.prototype.getClassName=function(){return je.className},t.className="LeCunNormal",t}(je);r.serialization.registerClass(Fe);var Ue=function(e){function t(t){return e.call(this,{scale:1,mode:"fanIn",distribution:"uniform",seed:null==t?null:t.seed})||this}return o(t,e),t.prototype.getClassName=function(){return je.className},t.className="LeCunNormal",t}(je);r.serialization.registerClass(Ue);var We=function(e){function t(t){var n=e.call(this)||this;if(n.DEFAULT_GAIN=1,n.gain=null==t.gain?n.DEFAULT_GAIN:t.gain,n.seed=t.seed,null!=n.seed)throw new p("Random seed is not implemented for Orthogonal Initializer yet.");return n}return o(t,e),t.prototype.apply=function(e,t){var n=this;return Object(r.tidy)(function(){if(2!==e.length)throw new p("The Orthogonal Initializer does not support non-2D shapes yet.");e[0]*e[1]>2e3&&console.warn("Orthogonal initializer is being called on a matrix with more than 2000 ("+e[0]*e[1]+") elements: Slowness may result.");var t=ge(e[0]>e[1]?[e[1],e[0]]:e,0,1,"float32"),i=r.linalg.gramSchmidt(t);return e[0]>e[1]&&(i=i.transpose()),Object(r.mul)(n.gain,i)})},t.prototype.getConfig=function(){return{gain:this.gain,seed:this.seed}},t.className="Orthogonal",t}(Ne);r.serialization.registerClass(We);var Ve={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",le
vendor: 9,126 bytes, line 1
1CunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function qe(e,t){return void 0===t&&(t={}),E(e,r.serialization.SerializationMap.getMap().classNameMap,t,"initializer")}function He(e){return S(e)}function Ge(e){if("string"==typeof e){var t=e in Ve?Ve[e]:e;if("GlorotNormal"===t)return new ze;if("GlorotUniform"===t)return new Pe;if("HeNormal"===t)return new Le;if("HeUniform"===t)return new Be;if("LeCunNormal"===t)return new Fe;if("LeCunUniform"===t)return new Ue;var n={};return n.className=t,n.config={},qe(n)}return e instanceof Ne?e:qe(e)}var Ke=Object.freeze({zeros:function(){return new Oe},ones:function(){return new Ae},constant:function(e){return new Te(e)},randomUniform:function(e){return new Ie(e)},randomNormal:function(e){return new Re(e)},truncatedNormal:function(e){return new Me(e)},identity:function(e){return new De(e)},varianceScaling:function(e){return new je(e)},glorotUniform:function(e){return new Pe(e)},glorotNormal:function(e){return new ze(e)},heNormal:function(e){return new Le(e)},heUniform:function(e){return new Be(e)},leCunNormal:function(e){return new Fe(e)},leCunUniform:function(e){return new Ue(e)},orthogonal:function(e){return new We(e)}}),$e=0;function Xe(){return $e++}var Ye={};function Je(e){return void 0===e&&(e=""),e in Ye||(Ye[e]=0),Ye[e]+=1,e+Ye[e].toString()}function Ze(e){return Array.isArray(e)&&Array.isArray(e[0])}function Qe(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function et(e){var t;if(Array.isArray(e)){if(1!==e.length)throw new d("Expected Tensor length to be 1; got "+e.length);t=e[0]}else t=e;return t}function tt(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return(e=e)[0];throw new d("Expected exactly 1 Shape; got "+e.length)}return e}function nt(e){for(var t=0,n=0,r=e;n<r.length;n++){var i=r[n];0===i.shape.length?t+=1:t+=i.shape.reduce(function(e,t){return e*t})}return t}var rt="Variable",it=function(){function e(e,t,n,i,o){void 0===t&&(t="float32"),void 0===n&&(n=rt),void 0===i&&(i=!0),void 0===o&&(o=null),this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=Xe(),n=null==n?rt:n,this.originalName=Q(n),this.name=ee(this.originalName),this.trainable_=i,this.constraint=o,this.val=Object(r.variable)(e,this.trainable_,this.name,this.dtype)}return e.prototype.read=function(){return this.assertNotDisposed(),this.val},e.prototype.write=function(e){return this.assertNotDisposed(),function(e,t){if(e.shape.toString()!==t.shape.toString())throw new Error("Shape mismatch: "+JSON.stringify(e.shape)+" vs. "+JSON.stringify(t.shape))}(this.val,e),this.val.id!==e.id&&(this.val.assign(e),null!=this.constraint&&this.val.assign(this.constraint.apply(this.val))),this},e.prototype.dispose=function(){this.assertNotDisposed(),this.val.dispose()},e.prototype.assertNotDisposed=function(){if(this.val.isDisposed)throw new Error("LayersVariable "+this.name+" is already disposed.")},Object.defineProperty(e.prototype,"trainable",{get:function(){return this.trainable_},set:function(e){this.trainable_=e,this.val.trainable=e},enumerable:!0,configurable:!0}),e}();function ot(e){return e.map(function(e){return e.read()})}function at(e){e.forEach(function(e){e[0].write(e[1])})}var st=function(e){this.dtype=e.dtype,this.shape=e.shape,null!=e.shape?this.ndim=e.shape.length:this.ndim=e.ndim,this.maxNDim=e.maxNDim,this.minNDim=e.minNDim,this.axes=e.axes||{}},ut=function(e,t,n,r,i,o,a){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=r,this.callArgs=i,this.outputTensorIndex=a,this.id=Xe(),null!=o&&(this.originalName=Q(o),this.name=ee(this.originalName)),this.rank=t.length},ct=0,lt=function(){function e(e,t){this.callArgs=t,this.id=ct++,this.outboundLayer=e.outboundLayer,this.inboundLayers=e.inboundLayers,this.nodeIndices=e.nodeIndices,this.tensorIndices=e.tensorIndices,this.inputTensors=e.inputTensors,this.outputTensors=e.outputTensors,this.inputMasks=e.inputMasks,this.outputMasks=e.outputMasks,this.inputShapes=e.inputShapes,this.outputShapes=e.outputShapes;for(var n=0,r=e.inboundLayers;n<r.length;n++){var i=r[n];null!=i&&i.outboundNodes.push(this)}e.outboundLayer.inboundNodes.push(this)}return e.prototype.getConfig=function(){for(var e=[],t=0,n=this.inboundLayers;t<n.length;t++){var r=n[t];null!=r?e.push(r.name):e.push(null)}return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:e,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}},e}(),ft=0,ht=function(e){function t(t){var n=e.call(this)||this;n._callHook=null,n._addedWeightNames=[],n._stateful=!1,n.id=ft++,n.activityRegularizer=null,n.inputSpec=null,n.supportsMasking=!1,n._trainableWeights=[],n._nonTrainableWeights=[],n._losses=[],n._updates=[],n._built=!1,n.inboundNodes=[],n.outboundNodes=[];var r=t.name;if(!r){var i=n.getClassName();r=x(i)+"_"+Je(i)}if(n.name=r,n.trainable_=null==t.trainable||t.trainable,n.updatable=null==t.updatable||t.updatable,null!=t.inputShape||null!=t.batchInputShape){var o=void 0;if(null!=t.batchInputShape)o=t.batchInputShape;else if(null!=t.inputShape){var a=null;null!=t.batchSize&&(a=t.batchSize),o=[a].concat(t.inputShape)}n.batchInputShape=o;var s=t.dtype;null==s&&(s=t.inputDType),null==s&&(s="float32"),n.dtype=s}return null!=t.weights?n.initialWeights=t.weights:n.initialWeights=null,n._refCount=null,n.fastWeightInitDuringBuild=!1,n}return o(t,e),t.nodeKey=function(e,t){return e.name+"_ib-"+t.toString()},t.prototype.getNodeAtIndex=function(e,t){if(0===this.inboundNodes.length)throw new h("The layer has never been called and thus has no defined "+t+".");if(this.inboundNodes.length<=e)throw new d("Asked to get "+t+" at node "+e+", but the layer has only "+this.inboundNodes.length+" inbound nodes.");return this.inboundNodes[e]},t.prototype.getInputAt=function(e){return b(this.getNodeAtIndex(e,"input").inputTensors)},t.prototype.getOutputAt=function(e){return b(this.getNodeAtIndex(e,"output").outputTensors)},Object.defineProperty(t.prototype,"input",{get:function(){if(this.inboundNodes.length>1)throw new f("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new f("Layer "+this.name+" is not connected, no input to return.");return b(this.getNodeAtIndex(0,"input").inputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){if(0===this.inboundNodes.length)throw new f("Layer "+this.name+" has no inbound nodes.");if(this.inboundNodes.length>1)throw new f("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return b(this.getNodeAtIndex(0,"output").outputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"losses",{get:function(){return this._losses},enumerable:!0,configurable:!0}),t.prototype.calculateLosses=function(){return this.losses.map(function(e){return e()})},Object.defineProperty(t.prototype,"updates",{get:function(){return this._updates},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"built",{get:function(){return this._built},set:function(e){this._built=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trainable",{get:function(){return this.trainable_},set:function(e){this._trainableWeights.forEach(function(t){return t.trainable=e}),this.trainable_=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.trainable_?this._trainableWeights.filter(function(e){return e.trainable}):[]},set:function(e){this._trainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this._trainableWeights.filter(function(e){return!e.trainable}).concat(this._nonTrainableWeights):this._trainableWeights.concat(this._nonTrainableWeights)},set:function(e){this._nonTrainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"weights",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stateful",{get:function(){return this._stateful},enumerable:!0,configurable:!0}),t.prototype.resetStates=function(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")},t.prototype.assertInputCompatibility=function(e){if(e=w(e),null!=this.inputSpec&&0!==this.inputSpec.length){var t=w(this.inputSpec);if(e.length!==t.length)throw new d("Layer "+this.name+" expects "+t.length+" inputs, but it received "+e.length+" input tensors. Input received: "+e);for(var n=0;n<e.length;n++){var r=e[n],i=t[n];if(null!=i){var o=r.rank;if(null!=i.ndim&&o!==i.ndim)throw new d("Input "+n+" is incompatible with layer "+this.name+": expected ndim="+i.ndim+", found ndim="+o);if(null!=i.maxNDim&&o>i.maxNDim)throw new d("Input "+n+" is incompatible with layer "+this.name+": expected max_ndim
1="+i.maxNDim+", found ndim="+o);if(null!=i.minNDim&&o<i.minNDim)throw new d("Input "+n+" is incompatible with layer "+this.name+": expected min_ndim="+i.minNDim+", found ndim="+o+".");if(null!=i.dtype&&r.dtype!==i.dtype)throw new d("Input "+n+" is incompatible with layer "+this.name+" : expected dtype="+i.dtype+", found dtype="+r.dtype+".");if(i.axes){var a=r.shape;for(var s in i.axes){var u=Number(s),c=i.axes[s],l=u>=0?a[u]:a[a.length+u];if(null!=c&&-1===[c,null].indexOf(l))throw new d("Input "+n+" is incompatible with layer "+this.name+": expected axis "+u+" of input shape to have value "+c+" but got shape "+a+".")}}if(null!=i.shape)for(var f=0;f<i.shape.length;++f){var h=i.shape[f],p=r.shape[f];if(null!=h&&null!=p&&h!==p)throw new d("Input "+n+" is incompatible with layer "+this.name+": expected shape="+i.shape+", found shape="+r.shape+".")}}}}},t.prototype.call=function(e,t){return e},t.prototype.invokeCallHook=function(e,t){null!=this._callHook&&this._callHook(e,t)},t.prototype.setCallHook=function(e){this._callHook=e},t.prototype.clearCallHook=function(){this._callHook=null},t.prototype.apply=function(e,t){var n=this;t=t||{},this.assertNotDisposed();for(var r=w(e),i=!0,o=0,a=r;o<a.length;o++)if(!(a[o]instanceof ut)){i=!1;break}for(var s=!0,u=0,c=r;u<c.length;u++)if(c[u]instanceof ut){s=!1;break}if(i===s)throw new d("Arguments to apply() must be all SymbolicTensors or all Tensors");return Z(this.name,function(){if(!n.built){n.assertInputCompatibility(e);for(var i=[],o=0,a=w(e);o<a.length;o++){var u=a[o];i.push(u.shape)}n.build(b(i)),n.built=!0,n.initialWeights&&n.setWeights(n.initialWeights),null===n._refCount&&s&&(n._refCount=1)}if(n.assertInputCompatibility(e),s){for(var c=[],l=0,f=w(v=n.call(e,t));l<f.length;l++){var h=f[l];-1!==r.indexOf(h)&&(h=h.clone()),c.push(h)}if(v=b(c),null!=n.activityRegularizer)throw new p("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return v}var d=function(e){for(var t=[],n=0,r=e=w(e);n<r.length;n++){var i=r[n];t.push(i.shape)}return b(t)}(e),m=n.computeOutputShape(d),v=void 0,g="float32";if(n.warnOnIncompatibleInputShape(Array.isArray(e)?d[0]:d),v=null!=m&&m.length>0&&Array.isArray(m[0])?m.map(function(r,i){return new ut(g,r,n,w(e),t,n.name,i)}):new ut(g,m,n,w(e),t,n.name),n.addInboundNode(e,v,null,null,d,m,t),n._refCount++,null!=n.activityRegularizer)throw new p("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return v})},t.prototype.warnOnIncompatibleInputShape=function(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn("The rank of the input tensor provided (shape: "+JSON.stringify(e)+") does not match that of the batchInputShape ("+JSON.stringify(this.batchInputShape)+") of the layer "+this.name);else{var t=!1;this.batchInputShape.forEach(function(n,r){null!=n&&null!=e[r]&&e[r]!==n&&(t=!0)}),t&&console.warn("The shape of the input tensor ("+JSON.stringify(e)+") does not match the expectation of layer "+this.name+": "+JSON.stringify(this.batchInputShape))}},Object.defineProperty(t.prototype,"outputShape",{get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new f("The layer "+this.name+" has never been called and thus has no defined output shape.");for(var e=[],t=0,n=this.inboundNodes;t<n.length;t++){var r=n[t],i=JSON.stringify(r.outputShapes);-1===e.indexOf(i)&&e.push(i)}if(1===e.length){var o=this.inboundNodes[0].outputShapes;return Array.isArray(o)&&Array.isArray(o[0])&&1===o.length?o[0]:o}throw new f("The layer "+this.name+' has multiple inbound nodes with different output shapes. Hence the notion of "outut shape" is ill-defined for the layer.')},enumerable:!0,configurable:!0}),t.prototype.countParams=function(){if(!this.built)throw new h("You tried to call countParams() on "+this.name+", but the layer is not built yet. Build it first by calling build(batchInputShape).");return nt(this.weights)},t.prototype.build=function(e){this.built=!0},t.prototype.getWeights=function(e){return void 0===e&&(e=!1),ot(e?this.trainableWeights:this.weights)},t.prototype.setWeights=function(e){var t=this;
vendor: 4,682 bytes, line 1
1Object(r.tidy)(function(){var n=t.weights;if(n.length!==e.length)throw new d('You called setWeights(weights) on layer "'+t.name+'" with a weight list of length '+e.length+", but the layer was expecting "+n.length+" weights. Provided weights: "+e+"...");if(0!==n.length){for(var i=[],o=ot(n),a=0;a<o.length;++a){var s=o[a],u=n[a],c=e[a];if(!r.util.arraysEqual(s.shape,c.shape))throw new d("Layer weight shape "+s.shape+" not compatible with provided weight shape "+c.shape);i.push([u,c])}at(i)}})},t.prototype.addWeight=function(e,t,n,r,i,o,a){if(-1!==this._addedWeightNames.indexOf(e))throw new d("Duplicate weight name "+e+" for layer "+this.name);this._addedWeightNames.push(e),null==n&&(n="float32"),this.fastWeightInitDuringBuild&&(r=Ge("zeros"));var s=r.apply(t,n),u=new it(s,n,e,o,a);return s.dispose(),null!=i&&this.addLoss(function(){return i.apply(u.read())}),null==o&&(o=!0),o?this._trainableWeights.push(u):this._nonTrainableWeights.push(u),u},t.prototype.setFastWeightInitDuringBuild=function(e){this.fastWeightInitDuringBuild=e},t.prototype.addLoss=function(e){var t;null==e||Array.isArray(e)&&0===e.length||(e=w(e),void 0!==this._losses&&null!==this._losses&&(t=this.losses).push.apply(t,e))},t.prototype.computeOutputShape=function(e){return e},t.prototype.computeMask=function(e,t){var n=this;if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError("Layer "+this.name+" does not support masking, but was passed an inputMask.");t.forEach(function(e){if(null!=e)throw new TypeError("Layer "+n.name+" does not support masking, but was passed an inputMask.")})}return null}return t},t.prototype.addInboundNode=function(e,t,n,r,i,o,a){void 0===a&&(a=null);var s=w(e);t=w(t),n=w(n),r=w(r),i=Qe(i),o=Qe(o);for(var u=[],c=[],l=[],f=0,h=s;f<h.length;f++){var d=h[f];u.push(d.sourceLayer),c.push(d.nodeIndex),l.push(d.tensorIndex)}new lt({outboundLayer:this,inboundLayers:u,nodeIndices:c,tensorIndices:l,inputTensors:s,outputTensors:t,inputMasks:n,outputMasks:r,inputShapes:i,outputShapes:o},a);for(var p=0;p<t.length;p++)t[p].sourceLayer=this,t[p].nodeIndex=this.inboundNodes.length-1,t[p].tensorIndex=p},t.prototype.getConfig=function(){var e={name:this.name,trainable:this.trainable};return null!=this.batchInputShape&&(e.batchInputShape=this.batchInputShape),null!=this.dtype&&(e.dtype=this.dtype),e},t.prototype.disposeWeights=function(){return this.weights.forEach(function(e){return e.dispose()}),this.weights.length},t.prototype.assertNotDisposed=function(){if(0===this._refCount)throw new Error("Layer '"+this.name+"' is already disposed.")},t.prototype.dispose=function(){if(!this.built)throw new Error("Cannot dispose Layer "+this.name+" because it has not been built yet.");if(null===this._refCount)throw new Error("Cannot dispose Layer "+this.name+" because it has not been used yet.");this.assertNotDisposed();var e=0;return 0==--this._refCount&&(e=this.disposeWeights()),{refCountAfterDispose:this._refCount,numDisposedVariables:e}},t}(r.serialization.Serializable);var dt,pt,mt=function(e){function t(t){var n=e.call(this,{dtype:t.dtype,name:null!=t.name?t.name:Je("input").toString()})||this;if(null==t.batchSize&&(t.batchSize=null),null==t.sparse&&(t.sparse=!1),n.trainable=!1,n.built=!0,n.sparse=t.sparse,null!=t.inputShape&&null!=t.batchInputShape)throw new d("Only provide the inputShape OR batchInputShape argument to inputLayer, not both at the same time.");var r=t.batchInputShape;if(null==r){if(null==t.inputShape)throw new d("An InputLayer should be passed either a `batchInputShape` or an `inputShape`.");r=[t.batchSize].concat(t.inputShape)}else if(null!=t.batchSize)throw new d("Cannot specify batchSize if batchInputShape is specified when creating an InputLayer.");var i=t.dtype||"float32";n.batchInputShape=r,n.dtype=i,n.inputSpec=[{shape:r}];var o=new ut(n.dtype,n.batchInputShape,n,[],{},n.name);return o.nodeIndex=0,o.tensorIndex=0,new lt({outboundLayer:n,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:[o],outputTensors:[o],inputMasks:[null],outputMasks:[null],inputShapes:[r],outputShapes:[r]}),n}return o(t,e),t.prototype.apply=function(e,t){throw new d("Cannot pass any input to an InputLayer's apply() method. InputLayer name: "+this.name)},t.prototype.dispose=function(){return{refCountAfterDispose:this._refCount,numDisposedVariables:0}},t.prototype.getConfig=function(){return{batchInputShape:this.batchInputShape,dtype:this.dtype,sparse:this.sparse,name:this.name}},t.className="InputLayer",t}(ht);function vt(e){if(null==e.batchShape&&null==e.shape)throw new Error("Please provide to Input either a `shape` or a `batchShape` argument. Note that `shape` does not include the batch dimension.");
1if(null!=e.batchShape&&null!=e.shape)throw new d("Please provide either a `shape` or `batchShape` argument to Input, but not both.");var t=e.batchShape;null!=e.shape&&null==t&&(t=[null].concat(e.shape));var n=e.dtype;return null==n&&(n="float32"),new mt({batchInputShape:t,name:e.name,dtype:n,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}function gt(e){return u(this,void 0,void 0,function(){var t,n,i,o,a,s,u,l;return c(this,function(c){switch(c.label){case 0:if(null==e)return[2];for(o in t=[],n=[],i=[],e)"number"!=typeof(a=e[o])&&(s=a,t.push(s.data()),n.push(o),i.push(s));return t.length>0?[4,Promise.all(t)]:[3,2];case 1:for(u=c.sent(),l=0;l<u.length;++l)e[n[l]]=u[l][0];Object(r.dispose)(i),c.label=2;case 2:return[2]}})})}function yt(e){if(null!=e)for(var t in e){var n=e[t];"number"!=typeof n&&n.dispose()}}r.serialization.registerClass(mt),(pt=dt||(dt={}))[pt.SILENT=0]="SILENT",pt[pt.VERBOSE=1]="VERBOSE";var bt=125,wt=function(){function e(){this.validationData=null}return e.prototype.setParams=function(e){this.params=e},e.prototype.onEpochBegin=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(e){return[2]})})},e.prototype.onEpochEnd=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(e){return[2]})})},e.prototype.onBatchBegin=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(e){return[2]})})},e.prototype.onBatchEnd=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(e){return[2]})})},e.prototype.onTrainBegin=function(e){return u(this,void 0,void 0,function(){return c(this,function(e){return[2]})})},e.prototype.onTrainEnd=function(e){return u(this,void 0,void 0,function(){return c(this,function(e){return[2]})})},e.prototype.setModel=function(e){},e}(),xt=function(){function e(e,t){void 0===t&&(t=10),null==e&&(e=[]),this.callbacks=e,this.queueLength=t}return e.prototype.append=function(e){this.callbacks.push(e)},e.prototype.setParams=function(e){for(var t=0,n=this.callbacks;t<n.length;t++)n[t].setParams(e)},e.prototype.setModel=function(e){for(var t=0,n=this.callbacks;t<n.length;t++)n[t].setModel(e)},e.prototype.onEpochBegin=function(e,t){return u(this,void 0,void 0,function(){var n,r;return c(this,function(i){switch(i.label){case 0:null==t&&(t={}),n=0,r=this.callbacks,i.label=1;case 1:return n<r.length?[4,r[n].onEpochBegin(e,t)]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},e.prototype.onEpochEnd=function(e,t){return u(this,void 0,void 0,function(){var n,r;return c(this,function(i){switch(i.label){case 0:null==t&&(t={}),n=0,r=this.callbacks,i.label=1;case 1:return n<r.length?[4,r[n].onEpochEnd(e,t)]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},e.prototype.onBatchBegin=function(e,t){return u(this,void 0,void 0,function(){var n,r;return c(this,function(i){switch(i.label){case 0:null==t&&(t={}),n=0,r=this.callbacks,i.label=1;case 1:return n<r.length?[4,r[n].onBatchBegin(e,t)]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},e.prototype.onBatchEnd=function(e,t){return u(this,void 0,void 0,function(){var n,r;return c(this,function(i){switch(i.label){case 0:null==t&&(t={}),n=0,r=this.callbacks,i.label=1;case 1:return n<r.length?[4,r[n].onBatchEnd(e,t)]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},e.prototype.onTrainBegin=function(e){return u(this,void 0,void 0,function(){var t,n;return c(this,function(r){switch(r.label){case 0:null==e&&(e={}),t=0,n=this.callbacks,r.label=1;case 1:return t<n.length?[4,n[t].onTrainBegin(e)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},e.prototype.onTrainEnd=function(e){return u(this,void 0,void 0,function(){var t,n;return c(this,function(r){switch(r.label){case 0:null==e&&(e={}),t=0,n=this.callbacks,r.label=1;case 1:return t<n.length?[4,n[t].onTrainEnd(e)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},e}(),_t=function(e){function t(){return e.call(this)||this}return o(t,e),t.prototype.onEpochBegin=function(e){return u(this,void 0,void 0,function(){return c(this,function(e){return this.seen=0,this.totals={},[2]})})},t.prototype.onBatchEnd=function(e,t){return u(this,void 0,void 0,function(){var e,n,i,o,a=this;return c(this,function(s){for(o in null==t&&(t={}),e=null==t.size?0:t.size,this.seen+=e,n=function(n){var o=t[n];if("number"==typeof o)i.totals.hasOwnProperty(n)||(i.totals[n]=0),i.totals[n]=i.totals[n]+o*e;else{var s=void 0;n in i.totals?s=i.totals[n]:i.totals[n]=0,i.totals[n]=Object(r.tidy)(function(){return Object(r.add)(a.totals[n],Object(r.mul)(o,e))}),null!=s&&s.dispose()}},i=this,t)n(o);return[2]})})},t.prototype.onEpochEnd=function(e,t){return u(this,void 0,void 0,function(){var e,n,i,o,a,s=this;return c(this,function(u){if(null!=t)for(e=function(e){if(null==n.totals[e])return"continue";"number"==typeof n.totals[e]?t[e]=n.totals[e]/n.seen:Object(r.tidy)(function(){t[e]=Object(r.mul)(Object(r.div)(1,s.seen),s.totals[e]),s.totals[e].dispose(),Object(r.keep)(t[e])})},n=this,i=0,o=this.params.metrics;i<o.length;i++)a=o[i],e(a);return[2]})})},t}(wt),kt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.onTrainBegin=function(e){return u(this,void 0,void 0,function(){return c(this,function(e){return this.epoch=[],this.history={},[2]})})},t.prototype.onEpochEnd=function(e,t){return u(this,void 0,void 0,function(){var n;return c(this,function(r){for(n in null==t&&(t={}),this.epoch.push(e),t)null==this.history[n]&&(this.history[n]=[]),this.history[n].push(t[n]);return[2]})})},t.prototype.syncData=function(){return u(this,void 0,void 0,function(){var e,t,n,r,i,o,a,s,u;return c(this,function(c){switch(c.label){case 0:for(r in e=[],t=[],n=[],this.history)for(i=this.history[r],o=0;o<i.length;++o)"number"!=typeof i[o]&&(a=i[o],e.push(a.data()),t.push(r),n.push(o));return[4,Promise.all(e)];case 1:for(s=c.sent(),u=0;u<s.length;++u)this.history[t[u]][n[u]].dispose(),this.history[t[u]][n[u]]=s[u][0];return[2]}})})},t}(wt),St=function(e){function t(t,n){var i=e.call(this)||this;if(i.currentEpoch=0,i.yieldEvery=n||"auto","auto"===i.yieldEvery&&(i.yieldEvery=bt),"never"===i.yieldEvery&&null!=t.onYield)throw new Error("yieldEvery is `never` but you provided an `onYield` callback. Either change `yieldEvery` or remove the callback");return r.util.isNumber(i.yieldEvery)&&(i.maybeWait=function(e,t){var n,i=r.util.now();return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=r.util.now();return s-i<t?n:(i=s,n=e.apply(void 0,o))}}(i.maybeWait.bind(i),i.yieldEvery)),i.trainBegin=t.onTrainBegin,i.trainEnd=t.onTrainEnd,i.epochBegin=t.onEpochBegin,i.epochEnd=t.onEpochEnd,i.batchBegin=t.onBatchBegin,i.batchEnd=t.onBatchEnd,i.yield=t.onYield,i}return o(t,e),t.prototype.maybeWait=function(e,t,n){return u(this,void 0,void 0,function(){var i;return c(this,function(o){switch(o.label){case 0:return i=[],null==this.yield?[3,2]:[4,gt(n)];case 1:o.sent(),i.push(this.yield(e,t,n)),o.label=2;case 2:return i.push(Object(r.nextFrame)()),[4,Promise.all(i)];case 3:return o.sent(),[2]}})})},t.prototype.onEpochBegin=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(n){switch(n.label){case 0:return this.currentEpoch=e,null==this.epochBegin?[3,3]:[4,gt(t)];case 1:return n.sent(),[4,this.epochBegin(e,t)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},t.prototype.onEpochEnd=function(e,t){return u(this,void 0,void 0,function(){var n;return c(this,function(i){switch(i.label){case 0:return n=[],null==this.epochEnd?[3,2]:[4,gt(t)];case 1:i.sent(),n.push(this.epochEnd(e,t)),i.label=2;case 2:return"epoch"===this.yieldEvery&&n.push(Object(r.nextFrame)()),[4,Promise.all(n)];case 3:return i.sent(),[2]}})})},t.prototype.onBatchBegin=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(n){switch(n.label){case 0:return null==this.batchBegin?[3,3]:[4,gt(t)];case 1:return n.sent(),[4,this.batchBegin(e,t)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},t.prototype.onBatchEnd=function(e,t){return u(this,void 0,void 0,function(){var n;return c(this,function(i){switch(i.label){case 0:return n=[],null==this.batchEnd?[3,2]:[4,gt(t)];case 1:i.sent(),n.push(this.batchEnd(e,t)),i.label=2;case 2:return"batch"===this.yieldEvery?n.push(Object(r.nextFrame)()):r.util.isNumber(this.yieldEvery)&&n.push(this.maybeWait(this.currentEpoch,e,t)),[4,Promise.all(n)];case 3:return i.sent(),[2]}})})},t.prototype.onTrainBegin=function(e){return u(this,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return null==this.trainBegin?[3,3]:[4,gt(e)];case 1:return t.sent(),[4,this.trainBegin(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},t.prototype.onTrainEnd=function(e){return u(this,void 0,void 0,function(){return c(this,function(t){switch(t.label){case 0:return null==this.trainEnd?[3,3]:[4,gt(e)];case 1:return t.sent(),[4,this.trainEnd(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},t}(wt);function Et(e,t){return null==e&&(e={}),e instanceof wt?[e]:Array.isArray(e)&&e[0]instanceof wt?e:w(e).map(function(e){return new St(e,t)})}var Ct=function(){function e(){}return e.registerCallbackConstructor=function(t,n){r.util.assert(t>=0&&Number.isInteger(t),function(){return"Verbosity level is expected to be an integer >= 0, but got "+t}),e.checkForDuplicate(n),null==e.constructors[t]&&(e.constructors[t]=[]),e.constructors[t].push(n)},e.checkForDuplicate=function(t){for(var n in e.constructors)e.constructors[+n].forEac
1h(function(e){if(e===t)throw new d("Duplicate callback constructor.")})},e.clear=function(){e.constructors={}},e.createCallbacks=function(t){var n=[];for(var r in e.constructors){var i=+r;t>=i&&n.push.apply(n,e.constructors[i])}return n.map(function(e){return new e})},e.constructors={},e}();function Nt(e,t,n,r,i,o,a,s,u){var c=new kt,l=[new _t].concat(Ct.createCallbacks(t));null!=e&&l.push.apply(l,e),l.push(c);var f=new xt(l);return f.setParams({epochs:n,initialEpoch:r,samples:i,steps:o,batchSize:a,verbose:t,doValidation:s,metrics:u}),{callbackList:f,history:c}}function Ot(e,t){return Object(r.tidy)(function(){"float32"!==e.dtype&&(e=e.asType("float32"));var n=Object(r.sum)(we(e),t,!0),i=Object(r.fill)(n.shape,l()),o=Object(r.sqrt)(Object(r.maximum)(n,i));return Object(r.div)(e,o)})}function At(e,t){return Object(r.tidy)(function(){return Object(r.mean)(we(Object(r.sub)(t,e)),-1)})}function Tt(e,t){return Object(r.tidy)(function(){return Object(r.mean)(Object(r.abs)(Object(r.sub)(t,e)),-1)})}function It(e,t){return Object(r.tidy)(function(){var n=Object(r.sub)(e,t),i=Object(r.clipByValue)(Object(r.abs)(e),l(),Number.MAX_VALUE),o=Object(r.abs)(Object(r.div)(n,i));return Object(r.mul)(100,Object(r.mean)(o,-1))})}function Rt(e,t){return Object(r.tidy)(function(){var n=Object(r.clipByValue)(t,l(),Number.MAX_VALUE),i=Object(r.log)(Object(r.add)(1,n)),o=Object(r.clipByValue)(e,l(),Number.MAX_VALUE),a=Object(r.log)(Object(r.add)(1,o));return Object(r.mean)(we(Object(r.sub)(i,a)),-1)})}function Mt(e,t){return Object(r.tidy)(function(){var n=Object(r.maximum)(0,Object(r.sub)(1,Object(r.mul)(e,t)));return Object(r.mean)(we(n),-1)})}function Dt(e,t){return Object(r.tidy)(function(){var n=Object(r.maximum)(0,Object(r.sub)(1,Object(r.mul)(e,t)));return Object(r.mean)(n,-1)})}function jt(e,t){return Object(r.tidy)(function(){var n=Object(r.sum)(Object(r.mul)(e,t),-1),i=Object(r.max)(Object(r.mul)(Object(r.sub)(1,e),t),-1);return Object(r.maximum)(0,Object(r.add)(1,Object(r.sub)(i,n)))})}function Pt(e,t){return Object(r.tidy)(function(){var n=Math.log(2),i=Object(r.sub)(t,e),o=Object(r.sub)(Object(r.add)(i,Object(r.softplus)(Object(r.mul)(-2,i))),n);return Object(r.mean)(o,-1)})}function zt(e,t,n){return void 0===n&&(n=!1),Object(r.tidy)(function(){if(n)t=Object(r.softmax)(t);else{var i=Object(r.sum)(t,t.shape.length-1,!0);t=Object(r.div)(t,i)}return t=Object(r.clipByValue)(t,l(),1-l()),Object(r.neg)(Object(r.sum)(Object(r.mul)(e.toFloat(),Object(r.log)(t)),t.shape.length-1))})}function Lt(e,t){return Object(r.tidy)(function(){var n=Object(r.floor)(function(e){var t=[ie(e.shape)];return e.reshape(t)}(e)).toInt(),i=(t=Object(r.clipByValue)(t,l(),1-l())).shape;return zt(Object(r.oneHot)(n,i[i.length-1]).reshape(i),t,!1)})}function Bt(e,t){return Object(r.tidy)(function(){var n;return n=Object(r.clipByValue)(t,l(),1-l()),n=Object(r.log)(Object(r.div)(n,Object(r.sub)(1,n))),Object(r.mean)(function(e,t){if(!r.util.arraysEqual(e.shape,t.shape))throw new d("logits and labels must have the same shape, but got shapes "+JSON.stringify(e.shape)+" and "+JSON.stringify(t.shape));return Object(r.tidy)(function(){var n=t.relu(),r=t.abs().neg();return n.sub(t.mul(e)).add(r.exp().log1p())})}(e,n),-1)})}function Ft(e,t){return Object(r.tidy)(function(){var n=Object(r.clipByValue)(e,l(),1),i=Object(r.clipByValue)(t,l(),1);return Object(r.sum)(Object(r.mul)(e,Object(r.log)(Object(r.div)(n,i))),-1)})}function Ut(e,t){return Object(r.tidy)(function(){var n=Object(r.log)(Object(r.add)(l(),t));return Object(r.mean)(Object(r.sub)(t,Object(r.mul)(e,n)),-1)})}function Wt(e,t){return Object(r.tidy)(function(){var n=Ot(e,-1),i=Ot(t,-1),o=Object(r.mul)(n,i);return Object(r.neg)(Object(r.sum)(o,-1))})}function Vt(e){var t={meanSquaredError:At,meanAbsoluteError:Tt,meanAbsolutePercentageError:It,meanSquaredLogarithmicError:Rt,squaredHinge:Mt,hinge:Dt,categoricalHinge:jt,logcosh:Pt,categoricalCrossentropy:zt,sparseCategoricalCrossentropy:Lt,binaryCrossentropy:Bt,kullbackLeiblerDivergence:Ft,poisson:Ut,cosineProximity:Wt};if("string"==typeof e){if(e in t)return t[e];var n="Unknown loss "+e;throw e.toLowerCase().includes("softmaxcrossentropy")&&(n="Unknown loss "+e+'. Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy'),new d(n)}return e}function qt(e,t){return Object(r.tidy)(function(){var n=Object(r.mul)(.5,Object(r.onesLike)(t)),i=ce(Object(r.greater)(t,n),e.dtype);return Object(r.mean)(Object(r.equal)(e,i),-1)})}function Ht(e,t){return Object(r.tidy)(function(){return ce(Object(r.equal)(Object(r.argMax)(e,-1),Object(r.argMax)(t,-1)),"float32")})}function Gt(e,t){return Object(r.tidy)(function(){return Object(r.logicalAnd)(e.equal(1),t.equal(1)).sum().cast("float32")})}function Kt(e,t){return Object(r.tidy)(function(){var n=Gt(e,t),i=function(e,t){return Object(r.tidy)(function(){return Object(r.logicalAnd)(e.equal(0),t.equal(1)).sum().cast("float32")})}(e,t),o=n.add(i);return Object(r.where)(Object(r.greater)(o,0),n.div(o),0).cast("float32")})}function $t(e,t){return Object(r.tidy)(function(){var n=Gt(e,t),i=function(e,t){return Object(r.tidy)(function(){return Object(r.logicalAnd)(e.equal(1),t.equal(0)).sum().cast("float32")})}(e,t),o=n.add(i);return Object(r.where)(Object(r.greater)(o,0),n.div(o),0).cast("float32")})}function Xt(e,t){return Bt(e,t)}function Yt(e,t){return e.rank===t.rank&&(e=e.squeeze([e.rank-1]
vendor: 18,894 bytes, line 1
1)),(t=t.argMax(-1)).dtype!==e.dtype&&(t=t.asType(e.dtype)),Object(r.equal)(e,t).asType("float32")}var Jt=At,Zt=At,Qt=Tt,en=Tt,tn=It,nn=It,rn=zt,on=Wt,an=Lt;function sn(e,t,n,r){void 0===r&&(r=console.log);var i,o=function(e){var t=!0,n=[],r=[];for(var i in e.nodesByDepth)n.push(e.nodesByDepth[i]);for(var o=0,a=n;o<a.length;o++){var s=a[o];if(s.length>1||1===s.length&&s[0].inboundLayers.length>1){t=!1;break}r.push.apply(r,s)}if(t)for(var u=0,c=e.layers;u<c.length;u++){for(var l=!1,f=0,h=c[u].inboundNodes;f<h.length;f++){var d=h[f];if(-1!==r.indexOf(d)){if(l){t=!1;break}l=!0}}if(!t)break}return t}(e),a=["Layer (type)","Output shape","Param #"];if(o?(t=t||65,n=n||[.45,.85,1]):(t=t||98,n=n||[.33,.55,.67,1]),n[n.length-1]<=1&&(n=n.map(function(e){return Math.floor(t*e)})),!o)for(var s in a.push("Receives inputs"),i=[],e.nodesByDepth)i.push.apply(i,e.nodesByDepth[s]);r("_".repeat(t)),un(a,n,r),r("=".repeat(t));for(var u=e.layers,c=0;c<u.length;++c)o?cn(u[c],n,r):ln(u[c],n,i,r),r((c===u.length-1?"=":"_").repeat(t));e.checkTrainableWeightsConsistency();var l=function(e){return null!=e.collectedTrainableWeights?nt(e.collectedTrainableWeights):nt(e.trainableWeights)}(e),f=nt(e.nonTrainableWeights);r("Total params: "+(l+f)),r("Trainable params: "+l),r("Non-trainable params: "+f),r("_".repeat(t))}function un(e,t,n){void 0===n&&(n=console.log);for(var r="",i=0;i<e.length;++i)i>0&&(r=r.slice(0,r.length-1)+" "),r=(r+=e[i]).slice(0,t[i]),r+=" ".repeat(t[i]-r.length);n(r)}function cn(e,t,n){var r;try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}un([e.name+" ("+e.getClassName()+")",r,e.countParams().toString()],t,n)}function ln(e,t,n,r){var i;try{i=JSON.stringify(e.outputShape)}catch(e){i="multiple"}for(var o=[],a=0,s=e.inboundNodes;a<s.length;a++){var u=s[a];if(!(null!=n&&n.length>0&&-1===n.indexOf(u)))for(var c=0;c<u.inboundLayers.length;++c){var l=u.inboundLayers[c].name,f=u.nodeIndices[c],h=u.tensorIndices[c];o.push(l+"["+f+"]["+h+"]")}}var d=e.name,p=e.getClassName(),m=0===o.length?"":o[0];for(un([d+" ("+p+")",i,e.countParams().toString(),m],t,r),c=1;c<o.length;++c)un(["","","",o[c]],t,r)}function fn(e,t,n){return void 0===t&&(t={}),void 0===n&&(n=!1),E(e,r.serialization.SerializationMap.getMap().classNameMap,t,"layer",n)}function hn(e,t,n){return("inboundNodes"===e||"outputLayers"===e||"inputLayers"===e)&&0===t&&"string"==typeof n}function dn(e,t){if(null===e)return null;if("string"==typeof e)return _(e);if("number"==typeof e||"boolean"==typeof e)return e;if(e instanceof Array){for(var n=[],r=e.length,i=0;i<r;++i){var o=e[i];hn(t,i,o)?n.push(o):n.push(dn(o,t))}return n}for(var a={},s=0,u=Object.keys(e);s<u.length;s++){var c=u[s],l=e[c];if("name"===c&&"string"==typeof l)a[c]=l;else{var f=_(c);a[f]=dn(l,f)}}return a}var pn=function(){function e(t){if(this.id2Value={},this.id2Mask={},this.name2Id={},t instanceof e)for(var n in t.id2Value)this.id2Value[n]=t.id2Value[n],n in t.id2Mask&&(this.id2Mask[n]=t.id2Mask[n]);else{if(null==t)return;for(var r=0,i=t;r<i.length;r++){var o=i[r];this.add(o.key,o.value)}}}return e.prototype.add=function(e,t,n){if(null!=this.id2Value[e.id])throw new d("Duplicate key: name="+e.name+", id="+e.id);return this.id2Value[e.id]=function(e,t){if(null==e.dtype||e.dtype===t.dtype)return t;try{return Object(r.cast)(t,e.dtype)}catch(n){throw new d("The dtype of the feed ("+t.dtype+") can not be cast to the dtype of the key '"+e.name+"' ("+e.dtype+").")}}(e,t),this.name2Id[e.name]=e.id,null!=n&&(this.id2Mask[e.id]=n),this},e.prototype.addFeed=function(e){this.add(e.key,e.value)},e.prototype.hasKey=function(e){return null!=this.id2Value[e.id]},e.prototype.names=function(){return Object.keys(this.name2Id)},e.prototype.getValue=function(e){if(e instanceof ut){if(null==this.id2Value[e.id])throw new d("Nonexistent key: "+e.name);return this.id2Value[e.id]}var t=this.name2Id[e];if(null==t)throw new d("Feed dict has no SymbolicTensor name: "+e);return this.id2Value[t]},e.prototype.getMask=function(e){if(e instanceof ut){if(null==this.id2Value[e.id])throw new d("Nonexistent key: "+e.name);return this.id2Mask[e.id]}var t=this.name2Id[e];if(null==t)throw new d("Feed dict has no SymbolicTensor name: "+e);return this.id2Mask[t]},e.prototype.disposeMasks=function(){null!=this.id2Mask&&Object(r.dispose)(this.id2Mask)},e}(),mn={},vn={};function gn(e,t,n,i){for(var o=null!=n&&n.training,a=Array.isArray(e),s=a?e:[e],u=s.map(function(e){return e.name}),c=[],l=t.names(),f=0,h=u;f<h.length;f++){var d=h[f];-1!==l.indexOf(d)?c.push(t.getValue(d)):c.push(null)}null!=i&&(i.maxNumTensors=-1/0,i.minNumTensors=1/0);var p,m,v=u.join(",")+"|"+t.names().join(",");if(null==mn[v]){var g=function(e,t){r.util.assert(null!=e&&e.length>0,function(){return"Expected at least one fetch, got none"});var n=[],i={};if(1===e.length){var o=bn(e[0],t);n=o.sorted,i=o.recipientMap}else for(var a=new Set,s=0,u=e;s<u.length;s++){for(var c=bn(u[s],t),l=c.sorted,f=c.recipientMap,h=0,d=l;h<d.length;h++){var p=d[h];a.has(p.name)||(n.push(p),a.add(p.name))}var m=function(e){null==i[e]&&(i[e]=new Set),f[e].forEach(function(t){return i[e].add(t)})};for(var v in f)m(v)}return{sorted:n,recipientCounts:yn(i)}}(s,t);p=g.sorted,m=g.recipientCounts,mn[v]=p,vn[v]=m}p=mn[v],m={},o||Object.assign(m,vn[v]);for(var y=new pn(t),b=0;b<p.length;++b){if(null!=i){var x=Object(r.memory)().numTensors;x>i.maxNumTensors&&(i.maxNumTensors=x),x<i.minNumTensors&&(i.minNumTensors=x)}var _=p[b],k=_.sourceLayer;if(!(k instanceof mt)){for(var S=[],E=[],C=[],N=!1,O=0,A=_.inputs;O<A.length;O++){var T=A[O],I=y.getValue(T),R=y.getMask(T);S.push(I),E.push(R),null!=R&&(N=!0),o||(m[T.name]--,0!==m[T.name]||t.hasKey(T)||-1!==u.indexOf(T.name)||I.isDisposed||!0===T.sourceLayer.stateful||C.push(I))}N&&((n=n||{}).mask=E[0]);var M=w(k.apply(S,n)),D=null;k.supportsMasking&&(D=k.computeMask(S,E));for(var j=wn(_),P=Array.isArray(j)?j:[j],z=0;z<P.length;++z){y.hasKey(P[z])||y.add(P[z],M[z],Array.isArray(D)?D[0]:D);var L=u.indexOf(P[z].name);-1!==L&&(c[L]=M[z])}o||Object(r.dispose)(C)}}return y.disposeMasks(),a?c:c[0]}function yn(e){var t={};for(var n in e)t[n]=e[n].size;return t}function bn(e,t){for(var n=new Set,r=[],i={},o=0,a=t.names();o<a.length;o++){var s=a[o];n.add(s)}var u=[],c=[];for(u.push(e);u.length>0;){var l=u[u.length-1];if(n.has(l.name))u.pop();else{var f=c[c.length-1]===u.length-1;if(0===l.inputs.length||f)u.pop(),r.push(l),n.add(l.name),f&&c.pop();else{c.push(u.length-1);for(var h=0,d=l.inputs;h<d.length;h++){var p=d[h];null==i[p.name]&&(i[p.name]=new Set),i[p.name].add(l.name),n.has(p.name)||u.push(p)}}}}return{sorted:r,recipientMap:i}}function wn(e){var t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{for(var n=null,r=0;r<e.sourceLayer.inboundNodes.length;++r)for(var i=0,o=e.sourceLayer.inboundNodes[r].outputTensors;i<o.length;i++)if(o[i].id===e.id){n=r;break}t=e.sourceLayer.getOutputAt(n)}return t}var xn=function(e){function t(n){var r=e.call(this,{})||this;if(r.containerNodes=new Set,r.name=n.name,null==r.name){var i=r.getClassName().toLowerCase();r.name=Je(i)}if(r.supportsMasking=!1,r.trainable_=!0,r.updatable=!0,Array.isArray(n.inputs)?r.inputs=n.inputs.slice():r.inputs=[n.inputs],Array.isArray(n.outputs)?r.outputs=n.outputs.slice():r.outputs=[n.outputs],N(r.inputs).length!==r.inputs.length)throw new d("The list of inputs passed to the model is redundant. All inputs should only appear once. Found: "+r.inputs.map(function(e){return e.name}));N(r.outputs).length!==r.outputs.length&&console.warn("The list of outputs passed to the model is redundant. All outputs should only appear once. Found: "+r.outputs.map(function(e){return e.name})),r.inputLayers=[],r.inputLayersNodeIndices=[],r.inputLayersTensorIndices=[],r.outputLayers=[],r.outputLayersNodeIndices=[],r.outputLayersTensorIndices=[],r.layers=[];for(var o=0,a=r.outputs;o<a.length;o++){var s=(I=a[o]).sourceLayer,u=I.nodeIndex,c=I.tensorIndex;r.outputLayers.push(s),r.outputLayersNodeIndices.push(u),r.outputLayersTensorIndices.push(c)}for(var l=0,f=r.inputs;l<f.length;l++)s=(I=f[l]).sourceLayer,u=I.nodeIndex,c=I.tensorIndex,g(0===u,"input layer has >1 nodes"),g(0===c,"input layer has >1 tensors"),r.inputLayers.push(s),r.inputLayersNodeIndices.push(u),r.inputLayersTensorIndices.push(c);r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var p=0;p<r.inputLayers.length;p++){if(!((s=r.inputLayers[p])instanceof mt))throw new TypeError("Input layers to a LayersModel must be InputLayer objects. Received inputs: "+n.inputs+". Input "+p+" (0-based) originates from layer type "+s.getClassName()+".");r.inputNames.push(s.name),r.feedInputShapes.push(s.batchInputShape),r.feedInputNames.push(s.name)}for(var m=0,v=r.outputLayers;m<v.length;m++)s=v[m],r.outputNames.push(s.name);r.internalInputShapes=r.inputs.map(function(e){return e.shape}),r.internalOutputShapes=r.outputs.map(function(e){return e.shape});for(var y={},b={},w={},x={},_={},k=[],S=function e(n,i,o,a,s,u){null!=a&&null!=s&&null!=u||(a=n.sourceLayer,s=n.nodeIndex,u=n.tensorIndex);var c=a.inboundNodes[s];if(-1!==o.indexOf(c))throw new h("The tensor "+n.name+' at layer "'+a.name+'" is part of a cycle.');if(-1===i.indexOf(c)){r.containerNodes.add(t.nodeKey(a,s)),a.id in _||(_[a.id]=Object.keys(_).length),-1===o.indexOf(c)&&o.push(c);for(var l=c.inboundLayers.length,f=0;f<l;f++){e(c.inputTensors[f],i,o,c.inboundLayers[f],c.nodeIndices[f],c.tensorIndices[f])}for(i.push(c);o.indexOf(c)>=0;)o.splice(o.indexOf(c),1);k.push(c)}},E=[],O=[],A=0,T=r.outputs;A<T.length;A++){var I=T[A];S(I,E,O)}for(var R=0,M=k.slice().reverse();R<M.length;R++){b[(te=M[R]).id]=te,te.id in y||(y[te.id]=0);var D=y[te.id],j=null==w[te.outboundLayer.id]?0:w[te.outboundLayer.id];for(D=Math.max(D,j),w[te.outboundLayer.id]=D,x[te.outboundLayer.id]=te.outboundLayer,y[te.id]=D,p=0;p<te.inboundLayers.length;p++){var P=te.inboundLayers[p],z=(u=te.nodeIndices[p],P.inboundNodes[u]),L=null==y[z.id]?0:y[z.id];y[z.id]=Math.max(D+1,L),b[z.id]=z}}var B={};for(var F in y)(D=y[F])in B||(B[D]=[]),B[D].push(b[F]);var U={};for(var W in w)(D=w[W])in U||(U[D]=[]),U[D].push(x[W]);var V=Object.keys(U).map(function(e){return parseInt(e,10)}).sort(C);r.layers=[];for(var q=0,H=V;q<H.length;q++){var G=U[D=H[q]];G.sort(function(e,t){var n=_[e.id],r=_[t.id];return n<r?-1:n>r?1:0});for(var K=0,$=G;K<$.length;K++)s=$[K],r.layers.push(s)}r.layersByDepth=U,V=Object.keys(B).map(function(e){return parseInt(e,10)}).sort(C);for(var X=r.inputs.slice(),Y=[],J=0,Z=V;J<Z.length;J++)for(var Q=0,ee=B[D=Z[J]];Q<ee.length;Q++){var te;if(null!=(s=(te=ee[Q]).outboundLayer)){for(var ne=0,re=te.inputTensors;ne<re.length;ne++)if(I=re[ne],-1===X.indexOf(I))throw new h("Graph disconnected: cannot obtain value for tensor "+I+' at layer "'+s.name+'". The following previous layers were accessed without issue: '+Y);for(var ie=0,oe=te.outputTensors;ie<oe.length;ie++)I=oe[ie],X.push(I);Y.push(s.name)}}r.nodesByDepth=B;for(var ae=r.layers.map(function(e){return e.name}),se=function(e){var t=ae.filter(function(t){return t===e}).length;if(1!==t)throw new h('The name "'+e+'" is used '+t+" times in the model. All layer names should be unique. Layer names: "+JSON.stringify(ae))},ue=0,ce=ae;ue<ce.length;ue++)se(ce[ue]);return r.outboundNodes=[],r.inboundNodes=[],new lt({outboundLayer:r,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:r.inputs,outputTensors:r.outputs,inputMasks:r.inputs.map(function(e){return null}),outputMasks:r.outputs.map(function(e){return null}),inputShapes:r.inputs.map(function(e){return e.shape}),outputShapes:r.outputs.map(function(e){return e.shape})}),r.built=!0,r._refCount=1,r}return o(t,e),t.prototype.assertNotDisposed=function(){if(0===this._refCount)throw new Error("Container '"+this.name+"' is already disposed.")},t.prototype.dispose=function(){this.assertNotDisposed();var e={refCountAfterDispose:null,numDisposedVariables:0};if(0==--this._refCount)for(var t=0,n=this.layers;t<n.length;t++){var r=n[t];e.numDisposedVariables+=r.dispose().numDisposedVariables}return e.refCountAfterDispose=this._refCount,e},Object.defineProperty(t.prototype,"trainable",{get:function(){return this.trainable_},set:function(e){this.layers.forEach(function(t){t._trainableWeights.forEach(function(t){return t.trainable=e})}),this.trainable_=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trainableWeights",{get:function(){if(this._trainableWeights.length>0)throw new d("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];for(var e=[],t=0,n=this.layers;t<n.length;t++){var r=n[t];e=e.concat(r.trainableWeights)}return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){for(var e=[],t=0,n=this.layers;t<n.length;t++){var r=n[t];e.push.apply(e,r.nonTrainableWeights)}if(!this.trainable){for(var i=[],o=0,a=this.layers;o<a.length;o++)r=a[o],i.push.apply(i,r.trainableWeights);return i.concat(e)}return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"weights",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),t.prototype.loadWeights=function(e,t){void 0===t&&(t=!0);for(var n={},r=0,i=0,o=this.layers;i<o.length;i++)for(var a=0,s=o[i].weights;a<s.length;a++){var u=s[a];if(null!=n[u.originalName])throw new d("Duplicate weight name: "+u.originalName);n[u.originalName]=u,r++}var c=[];for(var l in e){if(null!=n[l])c.push([n[l],e[l]]);else if(t)throw new d("Provided weight data has no target variable: "+l);delete n[l]}if(t){var f=[];for(var h in n)f.push(h);if(f.length>0)throw new d(f.length+" of "+r+" weights are not set: "+f)}at(c)},t.prototype.updatedConfig=function(){var e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion="tfjs-layers 1.2.1",t.backend="TensorFlow.js",t},t.prototype.toJSON=function(e,t){void 0===t&&(t=!0);var n=function e(t,n){if(null===t||void 0===t)return null;if("string"==typeof t)return x(t);if("number"==typeof t||"boolean"==typeof t)return t;if(t instanceof Array){for(var r=[],i=t.length,o=0;o<i;++o){var a=t[o];hn(n,o,a)?r.push(a):r.push(e(a,n))}return r}for(var s={},u=0,c=Object.keys(t);u<c.length;u++){var l=c[u],f=t[l];s[x(l)]="name"!==l&&"className"!==l||"string"!=typeof f?e(f,l):f}return s}(this.updatedConfig());return t?JSON.stringify(n):n},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){e=w(e);for(var r=new pn,i=0;i<n.inputs.length;++i)r.add(n.inputs[i],e[i]);return gn(n.outputs,r,t)})},t.prototype.computeMask=function(e,t){var n=this;return Object(r.tidy)(function(){var r;return e=w(e),r=null==t?v(null,e.length):w(t),n.runInternalGraph(e,r)[1]})},t.prototype.computeOutputShape=function(e){var t=Qe(e);if(t.length!==this.inputLayers.length)throw new d("Invalid inputShape argument "+e+": model has "+this.inputLayers.length+" tensor inputs.");for(var n={},r=0;r<t.length;r++){var i=this.inputLayers[r],o=t[r];n[N=i.name+"_0_0"]=o}var a=Object.keys(this.nodesByDepth).map(function(e){return parseInt(e,10)}).sort(C);if(a.length>1)for(var s=0,u=a;s<u.length;s++)for(var c=u[s],l=0,f=this.nodesByDepth[c];l<f.length;l++){var h=f[l];if(i=h.outboundLayer,-1===this.inputLayers.map(function(e){return e.id}).indexOf(i.id)){for(var p=[],m=0;m<h.inboundLayers.length;m++){var v=h.inboundLayers[m],y=h.nodeIndices[m],w=h.tensorIndices[m],x=n[N=v.name+"_"+y+"_"+w];p.push(x)}var _=Qe(i.computeOutputShape(b(p))),k=i.inboundNodes.indexOf(h);for(m=0;m<_.length;m++)n[N=i.name+"_"+k+"_"+m]=_[m]}}var S=[],E=[];for(r=0;r<this.outputLayers.length;r++){i=this.outputLayers[r],k=this.outputLayersNodeIndices[r],w=this.outputLayersTensorIndices[r];var N=i.name+"_"+k+"_"+w;E.push(N)}for(r=0;r<E.length;r++){var O=E[r];g(O in n),S.push(n[O])}return b(S)},t.prototype.runInternalGraph=function(e,t){null==t&&(t=v(null,e.length));for(var n={},r=0;r<this.inputs.length;++r){var i=this.inputs[r],o=e[r],a=t[r];n[i.id]=[o,a]}for(var s=0,u=Object.keys(this.nodesByDepth).map(function(e){return parseInt(e,10)}).sort(C);s<u.length;s++)for(var c=u[s],l=0,f=this.nodesByDepth[c];l<f.length;l++){for(var h=f[l],d=h.outboundLayer,m=h.inputTensors,y=h.outputTensors,b=new Array,x=0,_=m;x<_.length;x++)(i=_[x]).id in n&&b.push(n[i.id]);if(b.length===m.length){var k={},S=void 0,E=void 0,N=void 0,O=void 0;if(null!=h.callArgs&&(k=h.callArgs),1===b.length){var A=b[0],T=A[0],I=A[1];null==k.mask&&(k.mask=I),N=w(d.call(T,k)),O=w(d.computeMask(T,I)),S=[T],E=[I]}else S=b.map(function(e){return e[0]}),E=b.map(function(e){return e[1]}),null==k.mask&&(k.mask=E),N=w(d.call(S,k)),O=w(d.computeMask(S,E));if(d.activityRegularizer)throw new p("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(r=0;r<y.length;++r)i=y[r],o=N[r],a=O[r],n[i.id]=[o,a]}}for(var R=[],M=[],D=[],j=0,P=this.outputs;j<P.length;j++){g((i=P[j]).id in n,"Could not compute output "+i.name+" : "+i.id);var z=n[i.id],L=z[0];a=z[1],D.push(L.shape),R.push(L),M.push(a)}return[R,M,D]},t.prototype.buildNodeConversionMap=function(e){for(var n,r={},i=0,o=this.layers;i<o.length;i++){var a=o[i];n=a instanceof t?1:0;for(var s=0;s<a.inboundNodes.length;s++){var u=t.nodeKey(a,s);this.containerNodes.has(u)&&(r[u]=n,n+=1)}}return r},t.prototype.getLayer=function(e,t){if(null!=t){if(this.layers.length<=t)throw new d("Was asked to retrieve layer at index "+t+", but model only has "+this.layers.length+" layer(s).");return this.layers[t]}if(null==e)throw new d("Provide either a layer name or layer index");for(var n=0,r=this.layers;n<r.length;n++){var i=r[n];if(i.name===e)return i}throw new d("No such layer: "+e)},t.prototype.calculateLosses=function(){var e=this;return Object(r.tidy)(function(){for(var n=[],r=0,i=e.layers;r<i.length;r++)for(var o=i[r],a=0;a<o.inboundNodes.length;++a){var s=t.nodeKey(o,a);e.containerNodes.has(s)&&n.push.apply(n,o.calculateLosses())}return n})},t.prototype.getConfig=function(){for(var e={name:this.name},n=this.buildNodeConversionMap(this.layers),r=[],i=0,o=this.layers;i<o.length;i++){for(var a=(w=o[i]).getClassName(),s=w.getConfig(),u=[],c=0;c<w.inboundNodes.length;c++){var l=w.inboundNodes[c],f=t.nodeKey(w,c),h={};if(this.containerNodes.has(f)){if(l.callArgs)try{JSON.stringify(l.callArgs),h=l.callArgs}catch(e){console.warn("Layer "+w.name+" was passed non-serializable keyword arguments: "+l.callArgs+". They will not be included in the serialized model (and thus will be missing at deserialization time)."),h={}}if(l.inboundLayers.length>0){for(var d=[],p=0;p<l.inboundLayers.length;p++){var m=l.inboundLayers[p],v=l.nodeIndices[p],g=l.tensorIndices[p];null==(_=n[t.nodeKey(m,v)])&&(_=0),d.push([m.name,_,g,h])}u.push(d)}}}var y={};
1y.name=w.name,y.className=a,y.config=s,y.inboundNodes=u,r.push(y)}e.layers=r;var b=[];for(p=0;p<this.inputLayers.length;p++){var w=this.inputLayers[p];v=this.inputLayersNodeIndices[p],f=t.nodeKey(w,v),this.containerNodes.has(f)&&(null!==(_=n[f])&&void 0!==_||(_=0),g=this.inputLayersTensorIndices[p],b.push([w.name,_,g]))}e.inputLayers=b;var x=[];for(p=0;p<this.outputLayers.length;p++){var _;if(w=this.outputLayers[p],v=this.outputLayersNodeIndices[p],f=t.nodeKey(w,v),this.containerNodes.has(f))null!==(_=n[f])&&void 0!==_||(_=0),g=this.outputLayersTensorIndices[p],x.push([w.name,_,g])}return e.outputLayers=x,e},t.fromConfig=function(e,t,n,r){void 0===n&&(n={}),void 0===r&&(r=!1);var i={},o={};function a(e,t){e.name in o?o[e.name].push(t):o[e.name]=[t]}function s(e,t){for(var n,r=[],o=0,s=t;o<s.length;o++){var u=s[o],c=u[0],l=u[1],f=u[2];if(n=null==u[3]?{}:u[3],!(c in i))return void a(e,t);var h=i[c];if(h.inboundNodes.length<=l)return void a(e,t);var d=h.inboundNodes[l];r.push(d.outputTensors[f])}r.length>0&&e.apply(b(r),n)}function u(e){var n=e.name,o=fn(e,null!=t.customObjects?t.customObjects:{});o.setFastWeightInitDuringBuild(r),i[n]=o,e.inboundNodes.forEach(function(e){if(!(e instanceof Array))throw new d("Corrupted configuration, expected array for nodeData: "+e);a(o,e)})}for(var c=t.name,l=t.layers,f=0,h=l;f<h.length;f++)u(v=h[f]);for(;!O(o);)for(var p=0,m=l;p<m.length;p++){var v=m[p];if((M=i[v.name]).name in o){var y=o[M.name];delete o[M.name];for(var w=0,x=y;w<x.length;w++)s(M,x[w])}}for(var _=[],k=[],S=0,E=t.inputLayers;S<E.length;S++){var C=(v=E[S])[0],N=v[1],A=v[2];g(C in i);var T=(M=i[C]).inboundNodes[N].outputTensors;_.push(T[A])}for(var I=0,R=t.outputLayers;I<R.length;I++){var M;C=(v=R[I])[0],N=v[1],A=v[2],g(C in i),T=(M=i[C]).inboundNodes[N].outputTensors,k.push(T[A])}return new e({inputs:_,outputs:k,name:c})},Object.defineProperty(t.prototype,"stateful",{get:function(){if(this._stateful)throw new d("Container instance unexpectedly has _stateful = true. The statefulness of a Container is determined by the Layers it contains. Its _stateful property must remain the default false.");for(var e=0,t=this.layers;e<t.length;e++)if(t[e].stateful)return!0;return!1},enumerable:!0,configurable:!0}),t.prototype.resetStates=function(){var e=this;Object(r.tidy)(function(){e.layers.forEach(function(e){e.stateful&&e.resetStates()})})},t}(ht),_n=32;function kn(e,t){var n,i,o=t;n=o.xs,i=o.ys,r.util.assert(null!=n&&null!=i,function(){return"A Dataset iterator for fitDataset() is expected to generate objects of the form `{xs: xVal, ys: yVal}`, where the two values may be `tf.Tensor`, an array of Tensors, or a map of string to Tensor. The provided Dataset instead generates "+t});var a=Sn("input",e.inputNames,n),s=Sn("output",e.outputNames,i),u=a[0].shape[0];r.util.assert(a.length===e.inputs.length,function(){return"LayersModel has "+e.inputs.length+" inputs, but the dataset provides "+a.length+" inputs. (Expected input keys: "+JSON.stringify(e.inputNames)+")"}),r.util.assert(s.length===e.outputs.length,function(){return"LayersModel has "+e.outputs.length+" outputs, but the dataset provides "+s.length+" outputs. (Expected output keys: "+JSON.stringify(e.outputNames)+")"});var c=function(t){r.util.assert(a[t].shape[0]===u,function(){return"Batch size mismatch: input "+e.inputNames[t]+" has "+a[t].shape[0]+"; expected "+u+" based on input "+e.inputNames[0]+"."})};for(var l in a)c(l);var f=function(t){r.util.assert(s[t].shape[0]===u,function(){return"Batch size mismatch: output "+e.outputNames[t]+" has "+s[t].shape[0]+"; expected "+u+" based on input "+e.inputNames[0]+"."})};for(var h in s)f(h);return a.concat(s)}function Sn(e,t,n){if(n instanceof r.Tensor)return[n];if(Array.isArray(n))return r.util.assert(n.length===t.length,function(){return"Received an array of "+n.length+" Tensors, but expected "+t.length+" to match the "+e+" keys "+t+"."}),n;for(var i=[],o=0,a=t;o<a.length;o++){var s=a[o];if(null==n[s])throw new d("The feature data generated by the dataset lacks the required "+e+" key '"+s+"'.");i.push(n[s])}return i}function En(e,t,n){return u(this,void 0,void 0,function(){var i,o,a,s,u,l,f,h,d,m,v,g,y,b,x,_,k,S,E,C,N,O,A,T,I,R,M;return c(this,function(c){switch(c.label){case 0:if(i=null!=n.batchesPerEpoch,r.util.assert(null!=e.optimizer,function(){return"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."}),r.util.assert(null!=n,function(){return"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."}),r.util.assert(null!=n.epochs&&n.epochs>0&&Number.isInteger(n.epochs),function(){return"For fitDataset(), config.epochs is expected to be a positive integer, but got "+n.epochs}
1),r.util.assert(!i||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),function(){return"For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got "+n.batchesPerEpoch}),r.util.assert(null==n.validationSplit,function(){return"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."}),e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0,c.label=1;case 1:return c.trys.push([1,,22,23]),o=null!=n.validationData,a=void 0,s=void 0,o&&(Cn(n.validationData)?r.util.assert(null==n.validationBatches||n.validationBatches>0&&Number.isInteger(n.validationBatches),function(){return"For fitDataset() with dataset-based validation, config.validationBatches is expected not to be provided, or to be a positive integer, but got "+n.validationBatches}):(u=function(e){if(3===e.length)throw new p("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData),a=u.xs,s=u.ys)),l=e.makeTrainFunction(),f=e.getDedupedMetricsNames(),void 0,h=o?f.slice().concat(f.map(function(e){return"val_"+e})):f.slice(),d=Et(n.callbacks,n.yieldEvery),m=null==n.verbose?1:n.verbose,v=Nt(d,m,n.epochs,null,null,function(e,t){var n=null;return null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size),n}(t,n),null,o,h),g=v.callbackList,y=v.history,g.setModel(e),e.history=y,[4,g.onTrainBegin()];case 2:return c.sent(),e.stopTraining_=!1,b=null==n.initialEpoch?0:n.initialEpoch,[4,t.iterator()];case 3:x=c.sent(),c.label=4;case 4:return b<n.epochs?(_={},[4,g.onEpochBegin(b)]):[3,19];case 5:return c.sent(),k=0,S=0,i?[3,7]:[4,t.iterator()];case 6:x=c.sent(),c.label=7;case 7:return!i||k<n.batchesPerEpoch?[4,x.next()]:[3,17];case 8:return E=c.sent(),i&&E.done?(console.warn("You provided `batchesPerEpoch` as "+n.batchesPerEpoch+", but your dataset iterator ran out of data after "+k+" batches; interrupting training. Make sure that your dataset can generate at least `batchesPerEpoch * epochs` batches (in this case, "+n.batchesPerEpoch*n.epochs+" batches). You may need to use the repeat() function when building your dataset."),[3,17]):null==E.value?[3,11]:(C=kn(e,E.value),(N={}).batch=S,N.size=C[0].shape[0],[4,g.onBatchBegin(S,N)]);case 9:for(c.sent(),O=l(C),Object(r.dispose)(C),M=0;M<f.length;++M)A=f[M],T=O[M],N[A]=T,Object(r.keep)(T);return[4,g.onBatchEnd(S,N)];case 10:c.sent(),yt(N),S++,k++,c.label=11;case 11:return(i?k>=n.batchesPerEpoch:E.done)?o?(I=void 0,Cn(n.validationData)?(R=w,[4,e.evaluateDataset(n.validationData,{batches:n.validationBatches})]):[3,13]):[3,15]:[3,16];case 12:return I=R.apply(void 0,[c.sent()]),[3,14];case 13:I=w(e.evaluate(a,s,{batchSize:null==n.validationBatchSize?_n:n.validationBatchSize,verbose:0})),c.label=14;case 14:for(M=0;M<e.metricsNames.length;++M)_["val_"+e.metricsNames[M]]=I[M];c.label=15;case 15:return[3,17];case 16:return e.stopTraining_?[3,17]:[3,7];case 17:return[4,g.onEpochEnd(b,_)];case 18:return c.sent(),b++,e.stopTraining_?[3,19]:[3,4];case 19:return[4,g.onTrainEnd()];case 20:return c.sent(),[4,e.history.syncData()];case 21:return c.sent(),[2,e.history];case 22:return e.isTraining=!1,[7];case 23:return[2]}})})}function Cn(e){return"function"==typeof e.iterator}function Nn(e,t,n){return u(this,void 0,void 0,function(){var i,o,a,s,u,l,f,h,d,m;return c(this,function(v){switch(v.label){case 0:if(i=null!=(n=n||{}).batches,o=e.testFunction,a=[],n.verbose>0)throw new p("Verbose mode is not implemented yet.");return r.util.assert(!i||n.batches>0&&Number.isInteger(n.batches),function(){return"Test loop expects `batches` to be a positive integer, but received "+JSON.stringify(n.batches)}),function(e){return"function"==typeof e.next}(t)?(u=t,[3,3]):[3,1];case 1:return[4,t.iterator()];case 2:u=v.sent(),v.label=3;case 3:s=u,l=0,f=0,h=function(){var t;return c(this,function(u){switch(u.label){case 0:return[4,s.next()];case 1:return t=u.sent(),a=Object(r.tidy)(function(){if(t.value){var n=kn(e,t.value),i=Object(r.tidy)(function(){return o(n)});if(Object(r.dispose)(n),0===f)for(var s=0;s<i.length;++s)a.push(Object(r.scalar)(0));var u=n[0].shape[0],c=function(e){var t=i[e],n=a[e];a[e]=Object(r.tidy)(function(){return Object(r.add)(a[e],Object(r.mul)(u,t))}),f>0&&Object(r.dispose)(n)};for(s=0;s<i.length;++s)c(s);Object(r.dispose)(i),l+=u,++f}return a}),t.done?(i&&console.warn("Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least `batches` batches (in this case, "+n.batches+" batches). You may need to use the repeat() function when building your dataset."),[2,"break"]):[2]}})},v.label=4;case 4:return!i||f<n.batches?[5,h()]:[3,6];case 5:return"break"===v.sent()?[3,6]:[3,4];case 6:for(d=0;d<a.length;++d)m=a[d],a[d]=Object(r.div)(a[d],l),Object(r.dispose)(m);return[2,b(a)]}})})}function On(e){r.util.assert(e>0&&Number.isInteger(e),function(){return"batchSize is required to be a positive integer, but got "+e})}
vendor: 25,653 bytes, line 1
1function An(e,t,n){return null==e?[null]:Array.isArray(e)?e.map(function(e){return fe(e,t,n-t)}):fe(e,t,n-t)}function Tn(e,t){return Object(r.tidy)(function(){return null==e?null:Array.isArray(e)?e.map(function(e){return Tn(e,t)}):be(e,"int32"===t.dtype?t:t.toInt())})}function In(e,t){for(var n=[],r=0,i=null;r<e;)(i=r+t)>=e&&(i=e),n.push([r,i]),r=i;return n}function Rn(e,t,n,i,o,a,s,l,f,h,m,v,g,y,b){return u(this,void 0,void 0,function(){var u,w,x,_,k,S,E,C;return c(this,function(N){switch(N.label){case 0:if(null==o&&(o=32),null==a&&(a=1),null==m&&(m=!0),null==g&&(g=0),u=!1,null!=f&&null!=h&&(u=!0),null!=b&&(u=!0,null==y))throw new d("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");return null!=(w=e.checkNumSamples(n,o,y,"steps_per_epoch"))&&(x=ue(0,w)),null==s&&(s=1),_=Nt(l,s,a,g,w,y,o,u,v),k=_.callbackList,S=_.history,k.setModel(e),e.history=S,[4,k.onTrainBegin()];case 1:N.sent(),e.stopTraining_=!1,E=function(a){var s,l,d,v,g;return c(this,function(b){switch(b.label){case 0:return[4,k.onEpochBegin(a)];case 1:if(b.sent(),s={},null==y)return[3,2];throw new p("stepsPerEpoch mode is not implemented yet.");case 2:if("batch"===m)throw new p("batch shuffling is not implemneted yet");m&&r.util.shuffle(x),l=Object(r.tensor1d)(x),d=In(w,o),v=function(a){var p;return c(this,function(c){switch(c.label){case 0:return p={},[4,k.onBatchBegin(a,p)];case 1:return c.sent(),Object(r.tidy)(function(){var c=d[a][0],m=d[a][1],v=fe(l,c,m-c);p.batch=a,p.size=m-c;for(var g=Tn(n,v),y=t(g),b=0;b<i.length;++b){var w=i[b],x=y[b];p[w]=x,Object(r.keep)(x)}if(a===d.length-1&&u){var _=e.testLoop(f,h,o);for(b=0;b<i.length;++b)w=i[b],x=_[b],Object(r.keep)(x),s["val_"+w]=x}}),[4,k.onBatchEnd(a,p)];case 2:return c.sent(),yt(p),e.stopTraining_?[2,"break"]:[2]}})},g=0,b.label=3;case 3:return g<d.length?[5,v(g)]:[3,6];case 4:if("break"===b.sent())return[3,6];b.label=5;case 5:return++g,[3,3];case 6:l.dispose(),b.label=7;case 7:return[4,k.onEpochEnd(a,s)];case 8:return b.sent(),e.stopTraining_?[2,"break"]:[2]}})},C=g,N.label=2;case 2:return C<a?[5,E(C)]:[3,5];case 3:if("break"===N.sent())return[3,5];N.label=4;case 4:return++C,[3,2];case 5:return[4,k.onTrainEnd()];case 6:return N.sent(),[4,e.history.syncData()];case 7:return N.sent(),[2,e.history]}})})}function Mn(e,t,n,r){return void 0===r&&(r={}),u(this,void 0,void 0,function(){var i,o,a,s,u,l,f,h,m,v,g,y,b,w,x,_,k,S,E;return c(this,function(c){switch(c.label){case 0:if(e.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");e.isTraining=!0,c.label=1;case 1:if(c.trys.push([1,,3,4]),On(f=null==r.batchSize?32:r.batchSize),h=e.standardizeUserData(t,n,!1,f),i=h[0],o=h[1],m=!1,v=void 0,null!=r.validationData&&r.validationData.length>0){if(m=!0,2!==r.validationData.length)throw 3===r.validationData.length?new p("validationData including sample weights is not supported yet."):new d("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; "+r.validationData+" is invalid.");a=r.validationData[0],s=r.validationData[1],g=e.standardizeUserData(a,s,!0,f),u=g[0],l=g[1],v=u.concat(l)}else null!=r.validationSplit&&r.validationSplit>0&&r.validationSplit<1?(m=!0,y=Math.floor(i[0].shape[0]*(1-r.validationSplit)),b=i[0].shape[0],u=An(i,y,b),i=An(i,0,y),l=An(o,y,b),o=An(o,0,y),v=u.concat(l)):null!=r.validationSteps&&(m=!0);return w=i.concat(o),e.checkTrainableWeightsConsistency(),x=e.makeTrainFunction(),_=e.getDedupedMetricsNames(),k=void 0,S=void 0,m?(e.makeTestFunction(),k=e.testFunction,S=_.slice().concat(_.map(function(e){return"val_"+e}))):(k=null,v=[],S=_.slice()),E=Et(r.callbacks,r.yieldEvery),[4,Rn(e,x,w,_,f,r.epochs,r.verbose,E,k,v,r.shuffle,S,r.initialEpoch,null,null)];case 2:return[2,c.sent()];case 3:return e.isTraining=!1,jn(i,t),jn(o,n),jn(u,a),jn(l,s),[7];case 4:return[2]}})})}function Dn(e){var t=[];e instanceof r.Tensor&&(e=[e]);for(var n=0;n<e.length;++n){var i=e[n];if(1===i.rank)t.push(le(i,1));else{if(0===i.rank)throw new Error("Expected tensor to be at least 1D, but received a 0D tensor (scalar).");t.push(i)}}return t}function jn(e,t){if(null!=e){var n=[];if(t instanceof r.Tensor)n.push(t.id);else if(Array.isArray(t))t.forEach(function(e){return n.push(e.id)});else if(null!=t)for(var i in t){var o=t[i];n.push(o.id)}var a=[];if(e instanceof r.Tensor)-1===n.indexOf(e.id)&&a.push(e);else if(Array.isArray(e))e.forEach(function(e){-1===n.indexOf(e.id)&&a.push(e)});else if(null!=e)for(var s in e){var u=e[s];-1===n.indexOf(u.id)&&a.push(u)}a.forEach(function(e){e.isDisposed||e.dispose()})}}function Pn(e){return Array.isArray(e)}function zn(e){return!function(e){return e instanceof r.Tensor}(e)&&!Pn(e)}function Ln(e,t,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=""),null==t||0===t.length){if(null!=e){var o=!1;if(Pn(e)&&e.length>0)o=!0;else if(zn(e)){for(var a in e)if(e.hasOwnProperty(a)){o=!0;break}}else o=!0;if(o)throw new d("Error when checking model "+i+" expected no data, but got "+e)}return[]}if(null==e)return t.map(function(e){return null});var s;if(zn(e)){e=e,s=[];for(var u=0,c=t;u<c.length;u++){var l=c[u];if(null==e[l])throw new d('No data provided for "'+l+'". Need data for each key in: '+t);s.push(e[l])}}else if(Pn(e)){if((e=e).length!==t.length)throw new d("Error when checking model "+i+": the Array of Tensors that you are passing to your model is not the size the model expected. Expected to see "+t.length+" Tensor(s), but instead got the following list of Tensor(s): "+e);s=e}else{if(e=e,t.length>1)throw new d("The model "+i+" expects "+t.length+" Tensor(s), but only received one Tensor. Found: Tensor with shape "+e.shape);s=[e]}if(s=Dn(s),null!=n)for(var f=0;f<t.length;++f)if(null!=n[f]){var h=s[f];if(h.shape.length!==n[f].length)throw new d("Error when checking "+i+": expected "+t[f]+" to have "+n[f].length+" dimension(s). but got array with shape "+h.shape);for(var p=0;p<n[f].length;++p)if(0!==p||r){var m=h.shape[p],v=n[f][p];if(null!=v&&v>=0&&m!==v)throw new d("Error when checking "+i+": expected "+t[f]+" to have shape ["+n[f]+"], but got array with shape ["+h.shape+"].")}}return s}function Bn(e,t,n,r,i){var o;if(void 0===r&&(r=!0),void 0===i&&(i=""),Array.isArray(e)){if(e.length!==t.length)throw new d("Error when checking model "+i+": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see "+t.length+" Tensor(s), but instead got "+e.length+" Tensors(s).");o=e}else{if(t.length>1)throw new d("The model expects "+t.length+" "+i+" Tensors, but only received one Tensor. Found: array with shape "+JSON.stringify(e.shape)+".");o=[e]}if(null!=n)for(var a=0;a<t.length;++a)if(null!=n[a]){var s=o[a];if(s.shape.length!==n[a].length)throw new d("Error when checking "+i+": expected "+t[a]+" to have "+n[a].length+" dimension(s), but got array with shape "+JSON.stringify(s.shape));for(var u=0;u<n[a].length;++u)if(0!==u||r){var c=s.shape[u],l=n[a][u];if(null!=l&&l!==c)throw new d("Error when checking "+i+": expected "+t[a]+" to have shape "+JSON.stringify(n[a])+" but got array with shape "+JSON.stringify(s.shape)+".")}}}var Fn=function(e){function t(t){var n=e.call(this,t)||this;return n.isTraining=!1,n}return o(t,e),t.prototype.summary=function(e,t,n){if(void 0===n&&(n=console.log),!this.built)throw new d("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");sn(this,e,t,n)},t.prototype.compile=function(e){var t=this;if(null==e.loss&&(e.loss=[]),this.loss=e.loss,"string"==typeof e.optimizer)this.optimizer_=function(e){var t={Adagrad:function(){return r.train.adagrad(.01)},Adadelta:function(){return r.train.adadelta(1,.95,l())},Adam:function(){return r.train.adam(.001,.9,.999,l())},Adamax:function(){return r.train.adamax(.002,.9,.999,l(),0)},RMSProp:function(){return r.train.rmsprop(.001,.9,0,l())},SGD:function(){return r.train.sgd(.01)}};if(t.adagrad=t.Adagrad,t.adadelta=t.Adadelta,t.adam=t.Adam,t.adamax=t.Adamax,t.rmsprop=t.RMSProp,t.sgd=t.SGD,e in t)return t[e]();throw new d("Unknown Optimizer "+e)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof r.Optimizer))throw new d("User-defined optimizer must be an instance of tf.Optimizer.");this.optimizer_=e.optimizer,this.isOptimizerOwned=!1}var n=[];if(Array.isArray(e.loss)||"string"==typeof e.loss||"function"==typeof e.loss)if(Array.isArray(e.loss)){if(e.loss.length!==this.outputs.length)throw new d("When passing an Array as loss, it should have one entry per model output. The model has "+this.outputs.length+" output(s), but you passed loss="+e.loss+".");var i=e.loss;n=i.map(function(e){return Vt(e)})}else{var o=Vt(e.loss);this.outputs.forEach(function(e){n.push(o)})}else{for(var a in e.loss=e.loss,e.loss)if(-1===this.outputNames.indexOf(a))throw new d('Unknown entry in loss dictionary: "'+a+'". Only expected the following keys: '+this.outputNames);for(var s=0,u=this.outputNames;s<u.length;s++){var c=u[s];null==e.loss[c]&&console.warn('Output "'+c+'" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to '+c+" during training"),n.push(Vt(e.loss[c]))}}this.lossFunctions=n,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(var f=0;f<this.outputs.length;++f){var h=this.internalOutputShapes[f],p=this.outputNames[f];this.feedOutputNames.push(p),this.feedOutputShapes.push(h),this.feedLossFns.push(this.lossFunctions[f])}var m=[];this.metrics=e.metrics,this.metricsNames=["loss"],this.metricsTensors=[],Z("loss",function(){for(var e=0;e<t.outputs.length;++e)if(-1===m.indexOf(e)){var n=t.lossFunctions[e];t.outputs.length>1&&(t.metricsTensors.push([n,e]),t.metricsNames.push(t.outputNames[e]+"_loss"))}});var v=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map(function(e){return[]});if(Array.isArray(e))return t.map(function(t){return e});if(null!=e){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r],a=e.hasOwnProperty(o)?e[o]:[];Array.isArray(a)||(a=[a]),n.push(a)}return n}throw new TypeError("Type of metrics argument not understood. Expected an Array or Object, found: "+e)}(e.metrics,this.outputNames);Z("metric",function(){for(var e=function(e){if(-1!==m.indexOf(e))return"continue";!function(n){for(var r,i,o,a=function(n){if(-1!==["accuracy","acc","crossentropy","ce"].indexOf(n)){var a=t.internalOutputShapes[e];1===a[a.length-1]||t.lossFunctions[e]===Bt?-1!==["accuracy","acc"].indexOf(n)?i=qt:-1!==["crossentropy","ce"].indexOf(n)&&(i=Xt):t.lossFunctions[e]===Lt?-1!==["accuracy","acc"].indexOf(n)?i=Yt:-1!==["crossentropy","ce"].indexOf(n)&&(i=an):-1!==["accuracy","acc"].indexOf(n)?i=Ht:-1!==["crossentropy","ce"].indexOf(n)&&(i=rn);var s=void 0;-1!==["accuracy","acc"].indexOf(n)?s="acc":-1!==["crossentropy","ce"].indexOf(n)&&(s="ce"),o=i,r=""+s}else{var u=function(e){var t={binaryAccuracy:qt,categoricalAccuracy:Ht,precision:Kt,categoricalCrossentropy:rn,sparseCategoricalCrossentropy:an,mse:Jt,MSE:Zt,mae:Qt,MAE:en,mape:tn,MAPE:nn,cosine:on};if("string"==typeof e&&e in t)return t[e];if("string"!=typeof e&&null!=e)return e;throw new d("Unknown metric "+e)}(n);o=u,r=""+n}var c;Z(r,function(){c=o}),function(e,n,r){t.outputNames.length>1&&(n=t.outputNames[e]+"_"+n),t.metricsNames.push(n),t.metricsTensors.push([r,e])}(e,r,c)},s=0,u=v[e];s<u.length;s++)a(u[s])}()},n=0;n<t.outputs.length;++n)e(n)}),this.collectedTrainableWeights=this.trainableWeights},t.prototype.checkTrainableWeightsConsistency=function(){null!=this.collectedTrainableWeights&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")},t.prototype.evaluate=function(e,t,n){void 0===n&&(n={});var r=null==n.batchSize?32:n.batchSize;On(r);var i=this.standardizeUserData(e,t,!0,r);try{var o=i[0].concat(i[1]);this.makeTestFunction();var a=this.testFunction;return b(this.testLoop(a,o,r,n.verbose,n.steps))}finally{jn(i[0],e),jn(i[1],t)}},t.prototype.evaluateDataset=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(n){return this.makeTestFunction(),[2,Nn(this,e,t)]})})},t.prototype.checkNumSamples=function(e,t,n,r){var i;if(void 0===r&&(r="steps"),null!=n){if(i=null,null!=t)throw new d("If "+r+" is set, batchSize must be null or undefined.Got batchSize = "+t)}else{if(null==e)throw new d("Either the input data should have a defined shape, or "+r+" shoud be specified.");i=Array.isArray(e)?e[0].shape[0]:e.shape[0]}return i},t.prototype.execute=function(e,t){if(Array.isArray(t)&&0===t.length)throw new d("`outputs` is an empty Array, which is not allowed.");var n=Array.isArray(t),i=n?t:[t],o=this.retrieveSymbolicTensors(i),a=new pn;if(e instanceof r.Tensor&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new d("The number of inputs provided ("+e.length+") does not match the number of inputs of this model ("+this.inputs.length+").");for(var s=0;s<this.inputs.length;++s)a.add(this.inputs[s],e[s])}else for(var u=0,c=this.inputs;u<c.length;u++){var l=c[u],f=e[l.name];if(null==f)throw new d("No value is provided for the model's input "+l.name);a.add(l,f)}var h=gn(o,a);return n?h:h[0]},t.prototype.retrieveSymbolicTensors=function(e){for(var t=v(null,e.length),n=e.length,r=0,i=this.layers;r<i.length;r++){for(var o=i[r],a=Array.isArray(o.output)?o.output:[o.output],s=a.map(function(e){return e.name}),u=0;u<e.length;++u){var c=s.indexOf(e[u]);if(-1!==c&&(t[u]=a[c],n--),0===n)break}if(0===n)break}if(n>0){var l=[];throw t.forEach(function(t,n){null==t&&l.push(e[n])}),new d("Cannot find SymbolicTensors for output name(s): "+JSON.stringify(l))}return t},t.prototype.predictLoop=function(e,t,n){var i=this;return void 0===t&&(t=32),void 0===n&&(n=!1),Object(r.tidy)(function(){var o=i.checkNumSamples(e);if(n)throw new p("Verbose predictLoop() is not implemented yet.");for(var a=In(o,t),s=i.outputs.map(function(e){return[]}),u=function(t){Object(r.tidy)(function(){var n=a[t][0],r=a[t][1],o=An(e,n,r),s=[];if(Array.isArray(o))for(var u=0;u<o.length;++u)s.push({key:i.inputs[u],value:o[u]});else s.push({key:i.inputs[0],value:o});var c=new pn(s);return gn(i.outputs,c)}).forEach(function(e,t){return s[t].push(e)})},c=0;c<a.length;++c)u(c);return b(s.map(function(e){return Object(r.concat)(e,0)}))})},t.prototype.predict=function(e,t){void 0===t&&(t={});var n=Dn(e);Bn(n,this.inputNames,this.feedInputShapes,!1);try{var r=null==t.batchSize?32:t.batchSize;return On(r),this.predictLoop(n,r)}finally{jn(n,e)}},t.prototype.predictOnBatch=function(e){return Bn(e,this.inputNames,this.feedInputShapes,!0),this.predictLoop(e,e.shape[0])},t.prototype.standardizeUserData=function(e,t,n,i){if(void 0===n&&(n=!0),null==this.optimizer_)throw new h("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");for(var o=[],a=0;a<this.feedOutputShapes.length;++a){var s=this.feedOutputShapes[a];this.feedLossFns[a]===Lt?o.push(s.slice(0,s.length-1).concat([1])):o.push(s)}if(function(e,t,n){var i=N(e.map(function(e){return e.shape[0]}));i.sort();var o=N(t.map(function(e){return e.shape[0]}));if(o.sort(),i.length>1)throw new d("All input Tensors (x) should have the same number of samples. Got array shapes: "+JSON.stringify(e.map(function(e){return e.shape})));if(o.length>1)throw new d("All target Tensors (y) should have the same number of samples. Got array shapes: "+JSON.stringify(t.map(function(e){return e.shape})));if(i.length>0&&o.length>0&&!r.util.arraysEqual(i,o))throw new d("Input Tensors should have the same number of samples as target Tensors. Found "+i[0]+" input sample(s) and "+o[0]+" target sample(s).")}(e=Ln(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=Ln(t,this.feedOutputNames,o,!1,"target")),function(e,t,n){for(var r=[At,Bt,zt],i=0;i<e.length;++i){var o=e[i],a=t[i],s=n[i];if(null!=a){if(a===zt&&1===o.shape[o.shape.length-1])throw new d("You are passing a target array of shape "+o.shape+" while using a loss 'categorical_crossentropy'. 'categorical_crossentropy'expects targets to be binary matrices (1s and 0s) of shape [samples, classes].");if(-1!==r.indexOf(a))for(var u=o.shape.slice(1),c=s.slice(1),l=0;l<u.length;++l){var f=u[l],h=c[l];if(null!=h&&f!==h)throw new d("A target Tensor with shape "+o.shape+" was passed for an output of shape "+s+", while using a loss function that expects targets to have the same shape as the output.")}}}}(t,this.feedLossFns,this.feedOutputShapes),this.stateful&&null!=i&&i>0&&e[0].shape[0]%i!=0)throw new d("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size "+i+". Found: "+e[0].shape[0]+" sample(s).");return[e,t,null]},t.prototype.testLoop=function(e,t,n,i,o){var a=this;return void 0===i&&(i=0),Object(r.tidy)(function(){var s=a.checkNumSamples(t,n,o,"steps"),u=[];if(i>0)throw new p("Verbose mode is not implemented yet.");if(null!=o)throw new p("steps mode in testLoop() is not implemented yet");for(var c=In(s,n),l=Object(r.tensor1d)(ue(0,s)),f=0;f<c.length;++f){var h=c[f][0],d=c[f][1],m=fe(l,h,d-h),v=Tn(t,m),g=e(v);if(0===f)for(var y=0;y<g.length;++y)u.push(Object(r.scalar)(0));for(y=0;y<g.length;++y){var b=g[y];u[y]=Object(r.add)(u[y],Object(r.mul)(d-h,b))}}for(y=0;y<u.length;++y)u[y]=Object(r.div)(u[y],s);return u})},t.prototype.getDedupedMetricsNames=function(){for(var e=this.metricsNames,t=[],n=0;n<e.length;++n){var r=e[n],i=r;y(e,r)>1&&(i+="_"+y(e.slice(0,n),r)),t.push(i)}return t},t.prototype.makeTrainFunction=function(){var e=this;return function(t){var n=t.slice(0,e.inputs.length),i=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),o=[],a=e.collectedTrainableWeights.map(function(e){return e.read()});return[e.optimizer_.minimize(function(){for(var t=[],a=0;a<e.inputs.length;++a)t.push({key:e.inputs[a],value:n[a]});var s,u=new pn(t),c=gn(e.outputs,u,{training:!0});for(a=0;a<e.lossFunctions.length;++a){var l=(0,e.lossFunctions[a])(i[a],c[a]);Object(r.mean)(l),s=0===a?l:Object(r.add)(s,l)}for(a=0;a<e.metricsTensors.length;++a){var f=e.metricsTensors[a][0],h=e.metricsTensors[a][1],d=Object(r.mean)(f(i[h],c[h]));Object(r.keep)(d),o.push(d)}return s=Object(r.mean)(s),e.calculateLosses().forEach(function(e){s=Object(r.add)(s,e)}),s},!0,a)].concat(o)}},t.prototype.makeTestFunction=function(){var e=this;this.testFunction=function(t){return Object(r.tidy)(function(){for(var n,i=[],o=t.slice(0,e.inputs.length),a=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),s=[],u=0;u<e.inputs.length;++u)s.push({key:e.inputs[u],value:o[u]});var c=new pn(s),l=gn(e.outputs,c);for(u=0;u<e.lossFunctions.length;++u){var f=e.lossFunctions[u],h=Object(r.mean)(f(a[u],l[u]));n=0===u?h:Object(r.add)(n,h),i.push(n)}for(u=0;u<e.metricsTensors.length;++u){var d=e.metricsTensors[u][0],p=e.metricsTensors[u][1],m=Object(r.mean)(d(a[p],l[p]));i.push(m)}return i})}},t.prototype.fit=function(e,t,n){return void 0===n&&(n={}),u(this,void 0,void 0,function(){return c(this,function(r){return[2,Mn(this,e,t,n)]})})},t.prototype.fitDataset=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(n){return[2,En(this,e,t)]})})},t.prototype.trainOnBatch=function(e,t){return u(this,void 0,void 0,function(){var n,i,o,a,s,u,l,f,h;return c(this,function(c){switch(c.label){case 0:n=this.standardizeUserData(e,t),i=n[0],o=n[1],a=this.makeTrainFunction(),s=a(i.concat(o)),u=[],l=0,f=s,c.label=1;case 1:return l<f.length?[4,f[l].data()]:[3,4];case 2:h=c.sent(),u.push(h[0]),c.label=3;case 3:return l++,[3,1];case 4:return Object(r.dispose)(s),[2,b(u)]}})})},t.prototype.getNamedWeights=function(e){for(var t={},n=null!=e&&e.trainableOnly,r=n?this.trainableWeights:this.weights,i=this.getWeights(n),o=0;o<r.length;++o)n&&!r[o].trainable||(t[r[o].originalName]=i[o]);return t},Object.defineProperty(t.prototype,"stopTraining",{get:function(){return this.stopTraining_},set:function(e){this.stopTraining_=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"optimizer",{get:function(){return this.optimizer_},set:function(e){this.optimizer_!==e&&(this.optimizer_=e,this.isOptimizerOwned=!1)},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){var t=e.prototype.dispose.call(this);if(0===t.refCountAfterDispose&&null!=this.optimizer&&this.isOptimizerOwned){var n=Object(r.memory)().numTensors;this.optimizer_.dispose(),t.numDisposedVariables+=n-Object(r.memory)().numTensors}return t},t.prototype.save=function(e,t){return u(this,void 0,void 0,function(){var n,i,o;return c(this,function(a){switch(a.label){case 0:if("string"==typeof e){if(0===(n=r.io.getSaveHandlers(e)).length)throw new d("Cannot find any save handlers for URL '"+e+"'");if(n.length>1)throw new d("Found more than one ("+n.length+") save handlers for URL '"+e+"'");e=n[0]}if(null==e.save)throw new d("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return[4,r.io.encodeWeights(this.getNamedWeights(t))];case 1:return i=a.sent(),!1,null,o=this.toJSON(null,!1),[2,e.save({modelTopology:o,weightData:i.data,weightSpecs:i.specs,format:"layers-model",generatedBy:"TensorFlow.js tfjs-layers v1.2.1",convertedBy:null})]}})})},t.className="Model",t}(xn);function Un(e,t,n){return u(this,void 0,void 0,function(){var i,o,a,s,u,l;return c(this,function(c){switch(c.label){case 0:if(null==n&&(n={}),null==e.load)throw new d("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");return[4,e.load()];case 1:if(i=c.sent(),null!=(o=i.modelTopology).model_config&&(o=o.model_config),a=null==n.strict||n.strict,s=null!=i.weightData&&null!=i.weightSpecs&&a,u=fn(dn(o),t,s),null!=i.weightData){if(null==i.weightSpecs)throw new d("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");l=r.io.decodeWeights(i.weightData,i.weightSpecs),u.loadWeights(l,a),Object(r.dispose)(l)}return[2,u]}})})}r.serialization.registerClass(Fn);var Wn=function(e){function t(t){var n=e.call(this,{inputs:[],outputs:[]})||this;if(t=t||{},n.trainable=!0,n._updatable=!0,n.built=!1,n.name=null!=t.name?t.name:Je("sequential_"),null!=t.layers)for(var r=0,i=t.layers;r<i.length;r++){var o=i[r];n.add(o)}return n}return o(t,e),t.prototype.checkShape=function(e){if(e.inboundNodes[0].outputTensors[0].shape.some(function(e){return e<0}))throw new d("Negative dimension size caused by adding layer "+e.name+" with input shape ["+e.inboundNodes[0].inputTensors[0].shape+"]")},t.prototype.add=function(e){var n,r=e instanceof t||e instanceof Fn;if(r){if(1!==(n=e).outputs.length)throw new d("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==n.inputs.length)throw new d("All layers in a Sequential model should have a single input tensor. For multi-input layers, use the functional API.")}if(0===this.outputs.length){if(0===e.inboundNodes.length){if(null==e.batchInputShape)throw new d("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");var i=vt({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(i)}if(r)this.outputs=n.outputs,this.inputs=n.inputs;else{if(1!==e.inboundNodes.length)throw new d("A layer added to a Sequential model must not already be connected somewhere else. LayersModel received layer "+e.name+" which has "+e.inboundNodes.length+" pre-existing inbound connections.");if(1!==e.inboundNodes[0].outputTensors.length)throw new d("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[e.inboundNodes[0].outputTensors[0]],this.inputs=function e(t,n,r){if((null==n||null!=r&&r>0)&&(n=t.sourceLayer,r=t.nodeIndex),0===n.inboundNodes.length)return[t];var i=n.inboundNodes[r];if(0===i.inboundLayers.length)return i.inputTensors;for(var o=[],a=0;a<i.inboundLayers.length;a++)for(var s=0,u=e(i.inputTensors[a],i.inboundLayers[a],i.nodeIndices[a]);s<u.length;s++){var c=u[s];-1===o.indexOf(c)&&o.push(c)}return o}(this.outputs[0])}this.inboundNodes=[],new lt({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:v(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map(function(e){return e.shape}),outputShapes:this.outputs[0].shape})}else{var o=e.apply(this.outputs[0]);if(Array.isArray(o))throw new TypeError("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");this.checkShape(e),this.outputs=[o],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1},t.prototype.pop=function(){if(0===this.layers.length)throw new TypeError("There are no layers in the model.");if(this.layers.pop(),0===this.layers.length)this.outputs=[],this.inboundNodes=[],this.outboundNodes=[];else{var e=this.layers.length-1;this.layers[e].outboundNodes=[],this.outputs=[this.layers[e].output],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}},t.prototype.call=function(e,t){return null==this.model&&this.build(),this.model.call(e,t)},t.prototype.build=function(e){if(tt(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");
1this.model=new Fn({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,this.model.updatable=this.updatable,this.supportsMasking=this.model.supportsMasking,this.inputLayers=this.model.inputLayers,this.inputLayersNodeIndices=this.model.inputLayersNodeIndices,this.inputLayersTensorIndices=this.model.inputLayersTensorIndices,this.outputLayers=this.model.outputLayers,this.outputLayersNodeIndices=this.model.outputLayersNodeIndices,this.outputLayersTensorIndices=this.model.outputLayersTensorIndices,this.nodesByDepth=this.model.nodesByDepth,this.containerNodes=this.model.containerNodes,this.outputNames=this.model.outputNames,this.inputNames=this.model.inputNames,this.built=!0},t.prototype.countParams=function(){return this.built||this.build(),e.prototype.countParams.call(this)},t.prototype.summary=function(t,n,r){void 0===r&&(r=console.log),this.built||this.build(),e.prototype.summary.call(this,t,n,r)},t.prototype.setWeights=function(e){null==this.model&&this.build(),this.model.setWeights(e)},Object.defineProperty(t.prototype,"updatable",{get:function(){return this._updatable},set:function(e){this.built&&(this.model.updatable=e),this._updatable=e},enumerable:!0,configurable:!0}),t.prototype.evaluate=function(e,t,n){if(void 0===n&&(n={}),!this.built)throw new h("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)},t.prototype.evaluateDataset=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(n){if(!this.built)throw new h("The model needs to be compiled before being used.");return[2,this.model.evaluateDataset(e,t)]})})},t.prototype.predict=function(e,t){return void 0===t&&(t={}),null==this.model&&this.build(),this.model.predict(e,t)},t.prototype.predictOnBatch=function(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)},t.prototype.compile=function(e){this.build(),this.model.compile(e),this.optimizer_=this.model.optimizer,this.isOptimizerOwned=this.model.isOptimizerOwned,this.loss=this.model.loss,this.metrics=this.model.metrics,this.metricsTensors=this.model.metricsTensors,this.metricsNames=this.model.metricsNames},Object.defineProperty(t.prototype,"optimizer",{get:function(){return this.model.optimizer},set:function(e){this.model.optimizer=e},enumerable:!0,configurable:!0}),t.prototype.fit=function(e,t,n){return void 0===n&&(n={}),u(this,void 0,void 0,function(){return c(this,function(r){if(!this.built)throw new h("The model needs to be compiled before being used.");return[2,this.model.fit(e,t,n)]})})},t.prototype.fitDataset=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(n){if(!this.built)throw new h("The model needs to be compiled before being used.");return[2,this.model.fitDataset(e,t)]})})},t.prototype.trainOnBatch=function(e,t){return u(this,void 0,void 0,function(){return c(this,function(n){return[2,this.model.trainOnBatch(e,t)]})})},t.fromConfig=function(e,n,i,o){var a;void 0===i&&(i={}),void 0===o&&(o=!1);var s={};if(n instanceof Array){if(null==n[0].className||"Merge"===n[0].className)throw new d("Legacy serialization format not supported yet.");a=n}else r.util.assert(null!=n.layers,function(){return"When the config data for a Sequential model is not an Array, it must be an Object that contains the 'layers' field."}),a=n.layers,delete n.layers,s=n;var u=new e(s);if(!(u instanceof t))throw new p("Sequential.fromConfig called on non-Sequential input: "+u);for(var c=0,l=a;c<l.length;c++){var f=fn(l[c],void 0,o);o&&f.setFastWeightInitDuringBuild(!0),u.add(f)}return u},Object.defineProperty(t.prototype,"stopTraining",{get:function(){if(null==this.model)throw new d("Cannot get the stopTraining property of a sequential model before it is compiled.");return this.model.stopTraining},set:function(e){if(null==this.model)throw new d("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e},enumerable:!0,configurable:!0}),t.prototype.getConfig=function(){for(var e=[],t=0,n=this.layers;t<n.length;t++){var r=n[t],i={};i.className=r.getClassName(),i.config=r.getConfig(),e.push(i)}return e},t.className="Sequential",t}(Fn);function Vn(e){return new Fn(e)}function qn(e){return new Wn(e)}function Hn(e,t){return null==t&&(t={}),function(e,t){return u(this,void 0,void 0,function(){var n;return c(this,function(i){if(null==t&&(t={}),"string"==typeof e){if(0===(n=r.io.getLoadHandlers(e)).length)n.push(r.io.browserHTTPRequest
vendor: 63,954 bytes, line 1
1(e,t));else if(n.length>1)throw new d("Found more than one ("+n.length+") load handlers for URL '"+e+"'");e=n[0]}return[2,Un(e,void 0,t)]})})}(e,t)}function Gn(e){return vt(e)}function Kn(e,t){Ct.registerCallbackConstructor(e,t)}r.serialization.registerClass(Wn);var $n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.getConfig=function(){return{}},t}(r.serialization.Serializable),Xn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e,t){return void 0===t&&(t=1),function(e,t){if(void 0===t&&(t=1),1!==t)throw new p("Support for alpha values other than 1 ("+t+") is not implemented yet.");return Object(r.elu)(e)}(e,t)},t.className="elu",t}($n);r.serialization.registerClass(Xn);var Yn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return Object(r.selu)(e)},t.className="selu",t}($n);r.serialization.registerClass(Yn);var Jn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return Object(r.relu)(e)},t.className="relu",t}($n);r.serialization.registerClass(Jn);var Zn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return Object(r.tidy)(function(){return Object(r.minimum)(6,Object(r.relu)(e))})},t.className="relu6",t}($n);r.serialization.registerClass(Zn);var Qn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return e},t.className="linear",t}($n);r.serialization.registerClass(Qn);var er=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return Object(r.sigmoid)(e)},t.className="sigmoid",t}($n);r.serialization.registerClass(er);var tr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return function(e){return Object(r.tidy)(function(){var t=Object(r.add)(.5,Object(r.mul)(.2,e));return Object(r.clipByValue)(t,0,1)})}(e)},t.className="hardSigmoid",t}($n);r.serialization.registerClass(tr);var nr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return Object(r.softplus)(e)},t.className="softplus",t}($n);r.serialization.registerClass(nr);var rr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return function(e){return Object(r.tidy)(function(){return Object(r.div)(e,Object(r.abs)(e).add(1))})}(e)},t.className="softsign",t}($n);r.serialization.registerClass(rr);var ir=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e){return Object(r.tanh)(e)},t.className="tanh",t}($n);r.serialization.registerClass(ir);var or=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e,t){return void 0===t&&(t=-1),Object(r.softmax)(e,t)},t.className="softmax",t}($n);r.serialization.registerClass(or);var ar=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e,t){return void 0===t&&(t=-1),Object(r.logSoftmax)(e,t)},t.className="logSoftmax",t}($n);function sr(e){return e.getClassName()}function ur(e,t){return void 0===t&&(t={}),E(e,r.serialization.SerializationMap.getMap().classNameMap,t,"activation")}function cr(e){var t;return null==e?ur(t={className:"linear",config:{}}):"string"==typeof e?((t={}).className=e,t.config={},ur(t)):e instanceof $n?e:ur(e)}r.serialization.registerClass(ar);var lr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(r.serialization.Serializable),fr=function(e){function t(t){var n=e.call(this)||this;return n.l1=null==t||null==t.l1?.01:t.l1,n.l2=null==t||null==t.l2?.01:t.l2,n.hasL1=0!==n.l1,n.hasL2=0!==n.l2,n}return o(t,e),t.prototype.apply=function(e){var t=this;return Object(r.tidy)(function(){var n=Object(r.zeros)([1]);return t.hasL1&&(n=Object(r.add)(n,Object(r.sum)(Object(r.mul)(t.l1,Object(r.abs)(e))))),t.hasL2&&(n=Object(r.add)(n,Object(r.sum)(Object(r.mul)(t.l2,we(e))))),n.asScalar()})},t.prototype.getConfig=function(){return{l1:this.l1,l2:this.l2}},t.fromConfig=function(e,t){return new e({l1:t.l1,l2:t.l2})},t.className="L1L2",t}(lr);r.serialization.registerClass(fr);var hr={l1l2:"L1L2"};function dr(e){return S(e)}function pr(e,t){return void 0===t&&(t={}),E(e,r.serialization.SerializationMap.getMap().classNameMap,t,"regularizer")}function mr(e){return null==e?null:"string"==typeof e?pr({className:e in hr?hr[e]:e,config:{}}):e instanceof lr?e:pr(e)}var vr=function(e){function t(t){var n=e.call(this,null==t?{}:t)||this;return n.supportsMasking=!0,null!=t&&(n.maxValue=t.maxValue),n}return o(t,e),t.prototype.call=function(e,t){e=et(e);var n=Object(r.relu)(e);return null!=this.maxValue&&(n=Object(r.clipByValue)(n,0,this.maxValue)),n},t.prototype.computeOutputShape=function(e){return e},t.prototype.getConfig=function(){var t={maxValue:this.maxValue},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="ReLU",t}(ht);r.serialization.registerClass(vr);var gr=function(e){function t(t){var n=e.call(this,null==t?{}:t)||this;return n.DEFAULT_ALPHA=.3,null==t&&(t={}),n.alpha=null==t.alpha?n.DEFAULT_ALPHA:t.alpha,n}return o(t,e),t.prototype.call=function(e,t){var n=et(e);return Object(r.leakyRelu)(n,this.alpha)},t.prototype.computeOutputShape=function(e){return e},t.prototype.getConfig=function(){var t={alpha:this.alpha},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="LeakyReLU",t}(ht);r.serialization.registerClass(gr);var yr=function(e){function t(t){var n=e.call(this,null==t?{}:t)||this;if(n.DEFAULT_ALPHA_INITIALIZER="zeros",null==t&&(t={}),n.supportsMasking=!0,n.alphaInitializer=Ge(t.alphaInitializer||n.DEFAULT_ALPHA_INITIALIZER),n.alphaRegularizer=mr(t.alphaRegularizer),n.alphaConstraint=U(t.alphaConstraint),null==t.sharedAxes)n.sharedAxes=null;else if(Array.isArray(t.sharedAxes))n.sharedAxes=t.sharedAxes;else{if("number"!=typeof t.sharedAxes)throw new d("Expected sharedAxes to be a number or an array of numbers, but got "+t.sharedAxes);n.sharedAxes=[t.sharedAxes]}return n}return o(t,e),t.prototype.build=function(e){var t=(e=tt(e)).slice(1);if(null!=this.sharedAxes)for(var n=0,r=this.sharedAxes;n<r.length;n++)t[(o=r[n])-1]=1;this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);var i={};if(null!=this.sharedAxes)for(var o=1;o<e.length;++o)i[o]=e[o];this.inputSpec=[new st({ndim:e.length,axes:i})],this.built=!0},t.prototype.call=function(e,t){return e=et(e),Object(r.prelu)(e,this.alpha.read())},t.prototype.getConfig=function(){var t={alphaInitializer:He(this.alphaInitializer),alphaRegularizer:dr(this.alphaRegularizer),alphaConstraint:B(this.alphaConstraint),sharedAxes:this.sharedAxes},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="PReLU",t}(ht);r.serialization.registerClass(yr);var br=function(e){function t(t){var n=e.call(this,null==t?{}:t)||this;if(n.DEFAULT_ALPHA=1,null==t&&(t={}),null!=t.alpha&&t.alpha!==n.DEFAULT_ALPHA)throw new p("Non-default alpha value ("+t.alpha+") is not supported by the ELU layer yet.");return n.alpha=null==t.alpha?n.DEFAULT_ALPHA:t.alpha,n}return o(t,e),t.prototype.call=function(e,t){var n=et(e);return Object(r.elu)(n)},t.prototype.computeOutputShape=function(e){return e},t.prototype.getConfig=function(){var t={alpha:this.alpha},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="ELU",t}(ht);r.serialization.registerClass(br);var wr=function(e){function t(t){var n=e.call(this,null==t?{}:t)||this;return n.DEFAULT_THETA=1,null==t&&(t={}),n.theta=null==t.theta?n.DEFAULT_THETA:t.theta,n}return o(t,e),t.prototype.call=function(e,t){var n=et(e);return n.mul(ce(n.greater(this.theta),"float32"))},t.prototype.computeOutputShape=function(e){return e},t.prototype.getConfig=function(){var t={theta:this.theta},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="ThresholdedReLU",t}(ht);r.serialization.registerClass(wr);var xr=function(e){function t(t){var n=e.call(this,null==t?{}:t)||this;return n.DEFAULT_AXIS=1,null==t&&(t={}),n.softmax=(new or).apply,n.axis=null==t.axis?n.DEFAULT_AXIS:t.axis,n}return o(t,e),t.prototype.call=function(e,t){var n=et(e);return this.softmax(n,this.axis)},t.prototype.computeOutputShape=function(e){return e},t.prototype.getConfig=function(){var t={axis:this.axis},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="Softmax",t}(ht);function _r(e,t,n){if("number"==typeof e)return v(e,t);if(e.length!==t)throw new d("The "+n+" argument must be an integer or tuple of "+t+" integers. Received: "+e.length+" elements.");for(var r=0;r<t;++r){var i=e[r];if(!re(i))throw new d("The "+n+" argument must be an integer or tuple of "+t+" integers. Received: "+JSON.stringify(e)+" including a non-integer number "+i)}return e}function kr(e,t,n,r,i){return void 0===i&&(i=1),null==e?e:(o="same"===n?e:e-(t+(t-1)*(i-1))+1,Math.floor((o+r-1)/r));var o}function Sr(e,t,n,r){if(null==e)return null;if("valid"===r)e=e*t+se([n-t,0]);else{if("same"!==r)throw new d("Unsupport padding mode: "+r+".");e*=t}return e}function Er(e,t){return Object(r.tidy)(function(){return $(t),"channelsFirst"===t?Object(r.transpose)(e,[0,2,3,1]):e})}function Cr(e,t,n,i,o,a,s){return void 0===i&&(i=[1,1,1]),void 0===o&&(o="valid"),Object(r.tidy)(function(){if(null==a&&(a="channelsLast"),$(a),4!==e.rank&&5!==e.rank)throw new d("conv3dWithBias expects input to be of rank 4 or 5, but received "+e.rank+".");if(4!==t.rank&&5!==t.rank)throw new d("conv3dWithBias expects kernel to be of rank 4 or 5, but received "+e.rank+".");var u=function(e,t){return Object(r.tidy)(function(){return $(t),"channelsFirst"===t?Object(r.transpose)(e,[0,2,3,4,1]):e})}(e,a);if("causal"===o)throw new p("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return u=Object(r.conv3d)(u,t,i,"same"===o?"same":"valid","NDHWC",s),null!=n&&(u=_e(u,n)),"channelsFirst"===a&&(u=Object(r.transpose)(u,[0,4,1,2,3])),u})}r.serialization.registerClass(xr);var Nr=function(e){function t(n,r){var i=e.call(this,r)||this;if(i.bias=null,i.DEFAULT_KERNEL_INITIALIZER="glorotNormal",i.DEFAULT_BIAS_INITIALIZER="zeros",t.verifyArgs(r),i.rank=n,I(i.rank,"rank"),1!==i.rank&&2!==i.rank&&3!==i.rank)throw new p("Convolution layer for rank other than 1, 2, or 3 ("+i.rank+") is not implemented yet.");if(i.kernelSize=_r(r.kernelSize,n,"kernelSize"),i.strides=_r(null==r.strides?1:r.strides,n,"strides"),i.padding=null==r.padding?"valid":r.padding,X(i.padding),i.dataFormat=null==r.dataFormat?"channelsLast":r.dataFormat,$(i.dataFormat),i.activation=cr(r.activation),i.useBias=null==r.useBias||r.useBias,i.biasInitializer=Ge(r.biasInitializer||i.DEFAULT_BIAS_INITIALIZER),i.biasConstraint=U(r.biasConstraint),i.biasRegularizer=mr(r.biasRegularizer),i.activityRegularizer=mr(r.activityRegularizer),i.dilationRate=_r(null==r.dilationRate?1:r.dilationRate,n,"dilationRate"),1===i.rank&&Array.isArray(i.dilationRate)&&1!==i.dilationRate.length)throw new d("dilationRate must be a number or an array of a single number for 1D convolution, but received "+JSON.stringify(i.dilationRate));if(2===i.rank){if("number"==typeof i.dilationRate)i.dilationRate=[i.dilationRate,i.dilationRate];else if(2!==i.dilationRate.length)throw new d("dilationRate must be a number or array of two numbers for 2D convolution, but received "+JSON.stringify(i.dilationRate))}else if(3===i.rank)if("number"==typeof i.dilationRate)i.dilationRate=[i.dilationRate,i.dilationRate,i.dilationRate];else if(3!==i.dilationRate.length)throw new d("dilationRate must be a number or array of three numbers for 3D convolution, but received "+JSON.stringify(i.dilationRate));return i}return o(t,e),t.verifyArgs=function(e){if(g("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!T(e.kernelSize,"number",1,3))throw new d("BaseConv expects config.kernelSize to be number or number[] with length 1, 2, or 3, but received "+JSON.stringify(e.kernelSize)+".")},t.prototype.getConfig=function(){var t={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:sr(this.activation),useBias:this.useBias,biasInitializer:He(this.biasInitializer),biasRegularizer:dr(this.biasRegularizer),activityRegularizer:dr(this.activityRegularizer),biasConstraint:B(this.biasConstraint)},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(ht),Or=function(e){function t(n,r){var i=e.call(this,n,r)||this;return i.kernel=null,t.verifyArgs(r),i.filters=r.filters,I(i.filters,"filters"),i.kernelInitializer=Ge(r.kernelInitializer||i.DEFAULT_KERNEL_INITIALIZER),i.kernelConstraint=U(r.kernelConstraint),i.kernelRegularizer=mr(r.kernelRegularizer),i}return o(t,e),t.prototype.build=function(e){var t;e=tt(e);var n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new d("The channel dimension of the input should be defined. Found "+e[n]);var r=e[n],i=this.kernelSize.concat([r,this.filters]);this.kernel=this.addWeight("kernel",i,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[{ndim:this.rank+2,axes:(t={},t[n]=r,t)}],this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var t;e=et(e);var i=null==n.bias?null:n.bias.read();if(1===n.rank)t=function(e,t,n,i,o,a,s){return void 0===i&&(i=1),void 0===o&&(o="valid"),void 0===s&&(s=1),Object(r.tidy)(function(){if(null==a&&(a="channelsLast"),$(a),3!==e.shape.length)throw new d("The input of a conv1dWithBias operation should be 3, but is "+e.shape.length+" instead.");if(3!==t.shape.length)throw new d("The kernel for a conv1dWithBias operation should be 3, but is "+t.shape.length+" instead");if(null!=n&&1!==n.shape.length)throw new d("The bias for a conv1dWithBias operation should be 1, but is "+t.shape.length+" instead");if("channelsFirst"===a&&(e=Object(r.transpose)(e,[0,2,1])),"causal"===o)throw new p("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");var u=Object(r.conv1d)(e,t,i,"same"===o?"same":"valid","NWC",s);return null!=n&&(u=_e(u,n)),u})}(e,n.kernel.read(),i,n.strides[0],n.padding,n.dataFormat,n.dilationRate[0]);else if(2===n.rank)t=function(e,t,n,i,o,a,s){return void 0===i&&(i=[1,1]),void 0===o&&(o="valid"),Object(r.tidy)(function(){if(null==a&&(a="channelsLast"),$(a),3!==e.rank&&4!==e.rank)throw new d("conv2dWithBias expects input to be of rank 3 or 4, but received "+e.rank+".");if(3!==t.rank&&4!==t.rank)throw new d("conv2dWithBias expects kernel to be of rank 3 or 4, but received "+e.rank+".");var u=Er(e,a);if("causal"===o)throw new p("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return u=Object(r.conv2d)(u,t,i,"same"===o?"same":"valid","NHWC",s),null!=n&&(u=_e(u,n)),"channelsFirst"===a&&(u=Object(r.transpose)(u,[0,3,1,2])),u})}(e,n.kernel.read(),i,n.strides,n.padding,n.dataFormat,n.dilationRate);else{if(3!==n.rank)throw new p("convolutions greater than 3D are not implemented yet.");t=Cr(e,n.kernel.read(),i,n.strides,n.padding,n.dataFormat,n.dilationRate)}return null!=n.activation&&(t=n.activation.apply(t)),t})},t.prototype.computeOutputShape=function(e){e=tt(e);for(var t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2),r=0;r<n.length;++r){var i=kr(n[r],this.kernelSize[r],this.padding,this.strides[r],"number"==typeof this.dilationRate?this.dilationRate:this.dilationRate[r]);t.push(i)}var o=[e[0]];return"channelsLast"===this.dataFormat?(o=o.concat(t)).push(this.filters):(o.push(this.filters),o=o.concat(t)),o},t.prototype.getConfig=function(){var t={filters:this.filters,kernelInitializer:He(this.kernelInitializer),kernelRegularizer:dr(this.kernelRegularizer),kernelConstraint:B(this.kernelConstraint)},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.verifyArgs=function(e){if(!("filters"in e)||"number"!=typeof e.filters||e.filters<1)throw new d("Convolution layer expected config.filters to be a 'number' > 0 but got "+JSON.stringify(e.filters))},t}(Nr),Ar=function(e){function t(n){var r=e.call(this,2,n)||this;return t.verifyArgs(n),r}return o(t,e),t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.rank,t},t.verifyArgs=function(e){if("number"!=typeof e.kernelSize&&!T(e.kernelSize,"number",1,2))throw new d("Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received "+JSON.stringify(e.kernelSize)+".")},t.className="Conv2D",t}(Or);r.serialization.registerClass(Ar);var Tr=function(e){function t(n){var r=e.call(this,3,n)||this;return t.verifyArgs(n),r}return o(t,e),t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.rank,t},t.verifyArgs=function(e){if("number"!=typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new d("Conv3D expects config.kernelSize to be number or [number, number, number], but received "+JSON.stringify(e.kernelSize)+".")},t.className="Conv3D",t}(Or);r.serialization.registerClass(Tr);var Ir=function(e){function t(t){var n=e.call(this,t)||this;if(n.inputSpec=[new st({ndim:4})],"same"!==n.padding&&"valid"!==n.padding)throw new d("Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode "+n.padding);return n}return o(t,e),t.prototype.build=function(e){var t;if(4!==(e=tt(e)).length)throw new d("Input should have rank 4; Received input shape: "+JSON.stringify(e));var n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new d("The channel dimension of the inputs should be defined. Found `None`.");var r=e[n],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new st({ndim:4,axes:(t={},t[n]=r,t)})],this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var t=et(e);if(4!==t.shape.length)throw new d("Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-"+t.shape.length);var i,o,a=t.shape,s=a[0];"channelsFirst"===n.dataFormat?(i=2,o=3):(i=1,o=2);var u=a[i],c=a[o],l=n.kernelSize[0],f=n.kernelSize[1],h=n.strides[0],p=n.strides[1],m=[s,Sr(u,h,l,n.padding),Sr(c,p,f,n.padding),n.filters];"channelsLast"!==n.dataFormat&&(t=Object(r.transpose)(t,[0,2,3,1]));var v=Object(r.conv2dTranspose)(t,n.kernel.read(),m,n.strides,n.padding);return"channelsLast"!==n.dataFormat&&(v=Object(r.transpose)(v,[0,3,1,2])),null!=n.bias&&(v=_e(v,n.bias.read(),n.dataFormat)),null!=n.activation&&(v=n.activation.apply(v)),v})},t.prototype.computeOutputShape=function(e){var t,n,r,i=(e=tt(e)).slice();"channelsFirst"===this.dataFormat?(t=1,n=2,r=3):(t=3,n=1,r=2);var o=this.kernelSize[0],a=this.kernelSize[1],s=this.strides[0],u=this.strides[1];return i[t]=this.filters,i[n]=Sr(i[n],s,o,this.padding),i[r]=Sr(i[r],u,a,this.padding),i},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.dilationRate,t},t.className="Conv2DTranspose",t}(Ar);r.serialization.registerClass(Ir);var Rr=function(e){function t(t){return e.call(this,2,t)||this}return o(t,e),t.className="SeparableConv2D",t}(function(e){function t(t,n){var r=e.call(this,t,n)||this;if(r.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",r.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",r.depthwiseKernel=null,r.pointwiseKernel=null,null==n.filters)throw new d("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=n.kernelInitializer||null!=n.kernelRegularizer||null!=n.kernelConstraint)throw new d("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=n.padding&&"same"!==n.padding&&"valid"!==n.padding)throw new d("SeparableConv"+r.rank+"D supports only padding modes: 'same' and 'valid', but received "+JSON.stringify(n.padding));return r.depthMultiplier=null==n.depthMultiplier?1:n.depthMultiplier,r.depthwiseInitializer=Ge(n.depthwiseInitializer||r.DEFAULT_DEPTHWISE_INITIALIZER),r.depthwiseRegularizer=mr(n.depthwiseRegularizer),r.depthwiseConstraint=U(n.depthwiseConstraint),r.pointwiseInitializer=Ge(n.depthwiseInitializer||r.DEFAULT_POINTWISE_INITIALIZER),r.pointwiseRegularizer=mr(n.pointwiseRegularizer),r.pointwiseConstraint=U(n.pointwiseConstraint),r}return o(t,e),t.prototype.build=function(e){var t;if((e=tt(e)).length<this.rank+2)throw new d("Inputs to SeparableConv"+this.rank+"D should have rank "+(this.rank+2)+", but received input shape: "+JSON.stringify(e));var n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n]||e[n]<0)throw new d("The channel dimension of the inputs should be defined, but found "+JSON.stringify(e[n]));for(var r=e[n],i=this.kernelSize.concat([r,this.depthMultiplier]),o=[],a=0;a<this.rank;++a)o.push(1);o.push(r*this.depthMultiplier,this.filters),this.depthwiseKernel=this.addWeight("depthwise_kernel",i,"float32",this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.pointwiseKernel=this.addWeight("pointwise_kernel",o,"float32",this.pointwiseInitializer,this.pointwiseRegularizer,!0,this.pointwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.inputSpec=[new st({ndim:this.rank+2,axes:(t={},t[n]=r,t)})],this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var t;if(e=et(e),1===n.rank)throw new p("1D separable convolution is not implemented yet.");return 2===n.rank&&("channelsFirst"===n.dataFormat&&(e=Object(r.transpose)(e,[0,2,3,1])),t=Object(r.separableConv2d)(e,n.depthwiseKernel.read(),n.pointwiseKernel.read(),n.strides,n.padding,n.dilationRate,"NHWC")),n.useBias&&(t=_e(t,n.bias.read(),n.dataFormat)),null!=n.activation&&(t=n.activation.apply(t)),"channelsFirst"===n.dataFormat&&(t=Object(r.transpose)(t,[0,3,1,2])),t})},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.rank,delete t.kernelInitializer,delete t.kernelRegularizer,delete t.kernelConstraint,t.depthwiseInitializer=He(this.depthwiseInitializer),t.pointwiseInitializer=He(this.pointwiseInitializer),t.depthwiseRegularizer=dr(this.depthwiseRegularizer),t.pointwiseRegularizer=dr(this.pointwiseRegularizer),t.depthwiseConstraint=B(this.depthwiseConstraint),t.pointwiseConstraint=B(this.pointwiseConstraint),t},t.className="SeparableConv",t}(Or));r.serialization.registerClass(Rr);var Mr=function(e){function t(n){var r=e.call(this,1,n)||this;return t.verifyArgs(n),r.inputSpec=[{ndim:3}],r}return o(t,e),t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.rank,delete t.dataFormat,t},t.verifyArgs=function(e){if("number"!=typeof e.kernelSize&&!T(e.kernelSize,"number",1,1))throw new d("Conv1D expects config.kernelSize to be number or number[] with length 1, but received "+JSON.stringify(e.kernelSize)+".")},t.className="Conv1D",t}(Or);r.serialization.registerClass(Mr);var Dr=function(e){function t(t){var n=e.call(this,t)||this;return"number"==typeof t.cropping?n.cropping=[[t.cropping,t.cropping],[t.cropping,t.cropping]]:"number"==typeof t.cropping[0]?n.cropping=[[t.cropping[0],t.cropping[0]],[t.cropping[1],t.cropping[1]]]:n.cropping=t.cropping,n.dataFormat=void 0===t.dataFormat?"channelsLast":t.dataFormat,n.inputSpec=[{ndim:4}],n}return o(t,e),t.prototype.computeOutputShape=function(e){return"channelsFirst"===this.dataFormat?[e[0],e[1],e[2]-this.cropping[0][0]-this.cropping[0][1],e[3]-this.cropping[1][0]-this.cropping[1][1]]:[e[0],e[1]-this.cropping[0][0]-this.cropping[0][1],e[2]-this.cropping[1][0]-this.cropping[1][1],e[3]]},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){return e=et(e),"channelsLast"===n.dataFormat?de(de(e,n.cropping[0][0],e.shape[1]-n.cropping[0][0]-n.cropping[0][1],2),n.cropping[1][0],e.shape[2]-n.cropping[1][1]-n.cropping[1][0],3):de(de(e,n.cropping[0][0],e.shape[2]-n.cropping[0][0]-n.cropping[0][1],3),n.cropping[1][0],e.shape[3]-n.cropping[1][1]-n.cropping[1][0],4)})},t.prototype.getConfig=function(){var t={cropping:this.cropping,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="Cropping2D",t}(ht);r.serialization.registerClass(Dr);var jr=function(e){function t(t){var n=e.call(this,t)||this;return n.DEFAULT_SIZE=[2,2],n.inputSpec=[{ndim:4}],n.size=null==t.size?n.DEFAULT_SIZE:t.size,n.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,n}return o(t,e),t.prototype.computeOutputShape=function(e){if("channelsFirst"===this.dataFormat){var t=null==e[2]?null:this.size[0]*e[2],n=null==e[3]?null:this.size[1]*e[3];return[e[0],e[1],t,n]}return t=null==e[1]?null:this.size[0]*e[1],n=null==e[2]?null:this.size[1]*e[2],[e[0],t,n,e[3]]},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var t=et(e),i=t.shape;if("channelsFirst"===n.dataFormat){t=Object(r.transpose)(t,[0,2,3,1]);var o=n.size[0]*i[2],a=n.size[1]*i[3],s=t.resizeNearestNeighbor([o,a]);return Object(r.transpose)(s,[0,3,1,2])}return o=n.size[0]*i[1],a=n.size[1]*i[2],t.resizeNearestNeighbor([o,a])})},t.prototype.getConfig=function(){var t={size:this.size,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="UpSampling2D",t}(ht);r.serialization.registerClass(jr);var Pr=function(e){function t(t){var n=e.call(this,2,t)||this;return n.depthwiseKernel=null,n.depthMultiplier=null==t.depthMultiplier?1:t.depthMultiplier,n.depthwiseInitializer=Ge(t.depthwiseInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.depthwiseConstraint=U(t.depthwiseConstraint),n.depthwiseRegularizer=mr(t.depthwiseRegularizer),n}return o(t,e),t.prototype.build=function(e){if((e=tt(e)).length<4)throw new d("Inputs to DepthwiseConv2D should have rank 4. Received input shape: "+JSON.stringify(e)+".");var t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new d("The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not ("+e[t]+").");var n=e[t],r=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",r,null,this.depthwiseInitializer,this.depthwiseRegularizer,!0,this.depthwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[n*this.depthMultiplier],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var t=function(e,t,n,i,o,a){return void 0===n&&(n=[1,1]),void 0===i&&(i="valid"),Object(r.tidy)(function(){null==o&&(o="channelsLast"),$(o);var s=Er(e,o);if(4!==e.rank)throw new d("Input for depthwiseConv2d is required to be 4-D, but is instead "+e.rank+"-D");if(4!==t.rank)throw new d("depthwiseKernel is required to be 4-D, but is instead "+t.rank+"-D");return s=Object(r.depthwiseConv2d)(s,t,n,"same"===i?"same":"valid","NHWC",a),"channelsFirst"===o&&(s=Object(r.transpose)(s,[0,3,1,2])),s})}(e=et(e),n.depthwiseKernel.read(),n.strides,n.padding,n.dataFormat,null);return n.useBias&&(t=_e(t,n.bias.read(),n.dataFormat)),null!=n.activation&&(t=n.activation.apply(t)),t})},t.prototype.computeOutputShape=function(e){e=tt(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],r="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,i=kr(t,this.kernelSize[0],this.padding,this.strides[0]),o=kr(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],r,i,o]:[e[0],i,o,r]},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return t.depthMultiplier=this.depthMultiplier,t.depthwiseInitializer=He(this.depthwiseInitializer),t.depthwiseRegularizer=dr(this.depthwiseRegularizer),t.depthwiseConstraint=B(this.depthwiseRegularizer),t},t.className="DepthwiseConv2D",t}(Nr);r.serialization.registerClass(Pr);var zr=function(e){function t(t){var n=e.call(this,t)||this;if(n.rate=Math.max(Math.min(t.rate,1),0),n.noiseShape=t.noiseShape,n.seed=t.seed,null!=n.seed)throw new p("Non-default seed is not implemented in Dropout layer yet: "+n.seed);return n.supportsMasking=!0,n}return o(t,e),t.prototype.getNoiseShape=function(e){if(null==this.noiseShape)return this.noiseShape;for(var t=e.shape,n=[],r=0;r<this.noiseShape.length;++r)n.push(null==this.noiseShape[r]?t[r]:this.noiseShape[r]);return n},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){n.invokeCallHook(e,t);var i=et(e);if(null!=n.noiseShape&&!r.util.arraysEqual(i.shape,n.noiseShape))throw new p("Non-default noise shape is not implemented in Dropout layer yet: "+JSON.stringify(n.noiseShape));if(0<n.rate&&n.rate<1){var o=null!=t.training&&t.training,a=n.getNoiseShape(i);return Se(function(){return ke(i,n.rate,a,n.seed)},function(){return i},o)}return e})},t.prototype.getConfig=function(){var t={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.prototype.dispose=function(){return e.prototype.dispose.call(this)},t.className="Dropout",t}(ht);r.serialization.registerClass(zr);var Lr=function(e){function t(t){var n=e.call(this,t)||this;if(n.activation=null,n.useBias=!0,n.kernel=null,n.bias=null,n.DEFAULT_KERNEL_INITIALIZER="glorotNormal",n.DEFAULT_BIAS_INITIALIZER="zeros",null==t.batchInputShape&&null==t.inputShape&&null!=t.inputDim){var r=null;null!=t.batchSize&&(r=t.batchSize),n.batchInputShape=[r,t.inputDim]}return n.units=t.units,I(n.units,"units"),n.activation=cr(t.activation),null!=t.useBias&&(n.useBias=t.useBias),n.kernelInitializer=Ge(t.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.biasInitializer=Ge(t.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelConstraint=U(t.kernelConstraint),n.biasConstraint=U(t.biasConstraint),n.kernelRegularizer=mr(t.kernelRegularizer),n.biasRegularizer=mr(t.biasRegularizer),n.activityRegularizer=mr(t.activityRegularizer),n.supportsMasking=!0,n.inputSpec=[{minNDim:2}],n}return o(t,e),t.prototype.build=function(e){var t,n=(e=tt(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[n,this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint))),this.inputSpec=[{minNDim:2,axes:(t={},t[-1]=n,t)}],this.built=!0},t.prototype.computeOutputShape=function(e){var t=(e=tt(e)).slice();return t[t.length-1]=this.units,t},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){n.invokeCallHook(e,t);var r,i=et(e),o=function(e){return"relu"===e?"relu":"linear"===e?"linear":null}(n.activation.getClassName());return null!=o?r=ye(i,n.kernel.read(),o,n.bias?n.bias.read():null):(r=ye(i,n.kernel.read()),null!=n.bias&&(r=_e(r,n.bias.read())),null!=n.activation&&(r=n.activation.apply(r))),r})},t.prototype.getConfig=function(){var t={units:this.units,activation:sr(this.activation),useBias:this.useBias,kernelInitializer:He(this.kernelInitializer),biasInitializer:He(this.biasInitializer),kernelRegularizer:dr(this.kernelRegularizer),biasRegularizer:dr(this.biasRegularizer),activityRegularizer:dr(this.activityRegularizer),kernelConstraint:B(this.kernelConstraint),biasConstraint:B(this.biasConstraint)},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="Dense",t}(ht);r.serialization.registerClass(Lr);var Br=function(e){function t(t){var n=e.call(this,t||{})||this;return n.inputSpec=[{minNDim:3}],n}return o(t,e),t.prototype.computeOutputShape=function(e){for(var t=0,n=(e=tt(e)).slice(1);t<n.length;t++)if(null==n[t])throw new d('The shape of the input to "Flatten" is not fully defined (got '+e.slice(1)+'). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.');return[e[0],ie(e,1)]},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){return n.invokeCallHook(e,t),function(e){if(e.rank<=1)throw new d("batchFlatten requires a minimum rank of 2. Got rank: "+e.rank+".");var t=[e.shape[0],ie(e.shape,1)];return e.reshape(t)}(et(e))})},t.className="Flatten",t}(ht);r.serialization.registerClass(Br);var Fr=function(e){function t(t){var n=e.call(this,t)||this;return n.supportsMasking=!0,n.activation=cr(t.activation),n}return o(t,e),t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){n.invokeCallHook(e,t);var r=et(e);return n.activation.apply(r)})},t.prototype.getConfig=function(){var t={activation:sr(this.activation)},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="Activation",t}(ht);r.serialization.registerClass(Fr);var Ur=function(e){function t(t){var n=e.call(this,t)||this;return n.n=t.n,n.inputSpec=[{ndim:2}],n}return o(t,e),t.prototype.computeOutputShape=function(e){return[e[0],this.n,e[1]]},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){return function(e,t){return Object(r.tidy)(function(){if(2!==e.shape.length)throw new d("repeat() expects a rank-2 tensor, but received a rank-"+e.shape.length+" tensor.");return ve(le(e,1),[1,t,1])})}(e=et(e),n.n)})},t.prototype.getConfig=function(){var t={n:this.n},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="RepeatVector",t}(ht);r.serialization.registerClass(Ur);var Wr=function(e){function t(t){var n=e.call(this,t)||this;n.targetShape=t.targetShape;for(var r=0;r<n.targetShape.length;++r)n.isUnknown(n.targetShape[r])&&(n.targetShape[r]=null);return n}return o(t,e),t.prototype.isUnknown=function(e){return e<0||null==e},t.prototype.fixUnknownDimension=function(e,t){for(var n="Total size of new array must be unchanged.",r=t.slice(),i=1,o=null,a=0;a<r.length;++a){var s=r[a];if(this.isUnknown(s)){if(null!==o)throw new d("Can only specifiy one unknown dimension.");o=a}else i*=s}var u=ie(e);if(null!==o){if(0===i||u%i!=0)throw new d(n);r[o]=u/i}else if(u!==i)throw new d(n);return r},t.prototype.computeOutputShape=function(e){for(var t=!1,n=0;n<e.length;++n)if(this.isUnknown(e[n])){t=!0;break}return t?e.slice(0,1).concat(this.targetShape):e.slice(0,1).concat(this.fixUnknownDimension(e.slice(1),this.targetShape))},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){n.invokeCallHook(e,t);var r=et(e),i=r.shape,o=i.slice(0,1).concat(n.fixUnknownDimension(i.slice(1),n.targetShape));return r.reshape(o)})},t.prototype.getConfig=function(){var t={targetShape:this.targetShape},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="Reshape",t}(ht);r.serialization.registerClass(Wr);var Vr=function(e){function t(t){var n=e.call(this,t)||this;if(null==t.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(t.dims))throw new Error("Permute constructor requires `dims` to be an Array, but received "+t.dims+" instead.");var i=ue(1,t.dims.length+1);if(!r.util.arraysEqual(t.dims.slice().sort(),i))throw new Error("Invalid permutation `dims`: "+JSON.stringify(t.dims)+" `dims` must contain consecutive integers starting from 1.");return n.dims=t.dims,n.dimsIncludingBatch=[0].concat(n.dims),n.inputSpec=[new st({ndim:n.dims.length+1})],n}return o(t,e),t.prototype.computeOutputShape=function(e){var t=(e=tt(e)).slice();return this.dims.forEach(function(n,r){t[r+1]=e[n]}),t},t.prototype.call=function(e,t){return Object(r.transpose)(et(e),this.dimsIncludingBatch)},t.prototype.getConfig=function(){var t={dims:this.dims},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="Permute",t}(ht);r.serialization.registerClass(Vr);var qr=function(e){function t(t){var n=e.call(this,null==t?{}:t)||this;return n.supportsMasking=!0,n.maskValue=null!=t?null==t.maskValue?0:t.maskValue:0,n}return o(t,e),t.prototype.computeOutputShape=function(e){return e},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this),n={maskValue:this.maskValue};return Object.assign(n,t),n},t.prototype.computeMask=function(e,t){var n=et(e);return Object(r.any)(Object(r.notEqual)(n,this.maskValue),-1)},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){n.invokeCallHook(e,t);var i=et(e),o=Object(r.any)(Object(r.notEqual)(i,n.maskValue),-1,!0);return i.mul(o.asType(i.dtype))})},t.className="Masking",t}(ht);r.serialization.registerClass(qr);var Hr=function(e){function t(t){var n=e.call(this,t)||this;if(n.embeddings=null,n.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==t.batchInputShape&&null==t.inputShape){var r=null;null!=t.batchSize&&(r=t.batchSize),null==t.inputLength?n.batchInputShape=[r,null]:n.batchInputShape=[r].concat(w(t.inputLength))}return n.inputDim=t.inputDim,I(n.inputDim,"inputDim"),n.outputDim=t.outputDim,I(n.outputDim,"outputDim"),n.embeddingsInitializer=Ge(t.embeddingsInitializer||n.DEFAULT_EMBEDDINGS_INITIALIZER),n.embeddingsRegularizer=mr(t.embeddingsRegularizer),n.activityRegularizer=mr(t.activityRegularizer),n.embeddingsConstraint=U(t.embeddingsConstraint),n.maskZero=t.maskZero,n.supportsMasking=t.maskZero,n.inputLength=t.inputLength,n}return o(t,e),t.prototype.build=function(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0},t.prototype.warnOnIncompatibleInputShape=function(e){},t.prototype.computeMask=function(e,t){var n=this;return Object(r.tidy)(function(){return n.maskZero?(e=et(e),Object(r.notEqual)(e,Object(r.zerosLike)(e))):null})},t.prototype.computeOutputShape=function(e){if(e=tt(e),null==this.inputLength)return e.concat([this.outputDim]);var t=w(this.inputLength);if(t.length!==e.length-1)throw new d('"inputLength" is '+this.inputLength+", but received input shape has shape "+e);for(var n=0,r=0;r<t.length;++r){var i=t[r],o=e[r+1];if(null!=i&&null!=o&&i!==o)throw new d('"inputLength" is '+this.inputLength+", but received input shape has shape "+e);null==i&&(t[n]=o),n++}return[e[0]].concat(t,[this.outputDim])},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){n.invokeCallHook(e,t);var r=et(e);return"int32"!==r.dtype&&(r=ce(r,"int32")),be(n.embeddings.read(),r.as1D()).reshape(tt(n.computeOutputShape(r.shape)))})},t.prototype.getConfig=function(){var t={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:He(this.embeddingsInitializer),embeddingsRegularizer:dr(this.embeddingsRegularizer),activityRegularizer:dr(this.activityRegularizer),embeddingsConstraint:B(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="Embedding",t}(ht);r.serialization.registerClass(Hr);var Gr=function(e){function t(t){var n=e.call(this,t||{})||this;return n.supportsMasking=!0,n}return o(t,e),t.prototype.mergeFunction=function(e){throw new p},t.prototype.computeElementwiseOpOutputShape=function(e,t){if(null==e||null==t)return null;if(e.length<t.length)return this.computeElementwiseOpOutputShape(t,e);if(0===t.length)return e;for(var n=e.slice(0,e.length-t.length),r=0;r<t.length;++r){var i=e[e.length-t.length+r],o=t[r];if(null==i||null==o||i<0||o<0)n.push(null);else if(1===i)n.push(o);else if(1===o)n.push(i);else{if(i!==o)throw new d("Operands could not be broadcast together with shapes "+JSON.stringify(e)+" "+JSON.stringify(t));n.push(i)}}return n},t.prototype.build=function(e){if(Array.isArray(e)&&!Array.isArray(e[0])&&(e=[tt(e)]),(e=e).length<2)throw new d("A merge layer should be called on an Array of at least 2 inputs. Got "+e.length+" input(s).");for(var t=[],n=0,r=e;n<r.length;n++)null!=(a=r[n])&&null!==a[0]&&t.push(a[0]);if((t=N(t)).length>1)throw new d("Can not merge tensors with different batch sizes. Got tensors with shapes: "+JSON.stringify(e)+".");for(var i=null==e[0]?null:e[0].slice(1),o=1;o<e.length;++o){var a=null==e[o]?null:e[o].slice(1);i=this.computeElementwiseOpOutputShape(i,a)}var s=e.map(function(e){return e.length});-1===e.indexOf(null)&&1===N(s).length?this.reshapeRequired=!1:this.reshapeRequired=!0},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){if(e=e,n.reshapeRequired){var t=[],i=e.map(function(e){return e.rank});if(-1===i.indexOf(null)){for(var o=se(i),a=0,s=e;a<s.length;a++){for(var u=(d=s[a]).rank,c=0;c<o-u;++c)d=le(d,1);t.push(d)}return n.mergeFunction(t)}for(var l=!1,f=0,h=e;f<h.length;f++){var d;if(null==(u=(d=h[f]).rank)){var p=d.shape,m=p[0],v=p.slice(1).concat([m]),g=d.reshape([m].concat(ie(p.slice(1))));g=(g=Object(r.transpose)(g,[1,0])).reshape(v),t.push(g),l=!0}else if(u>1){var y=ue(1,u).concat([0]);t.push(Object(r.transpose)(d,y)),l=!0}else t.push(d)}var b=n.mergeFunction(t),w=b.rank;if(l)if(null==w){var x=b.shape;v=[m=x[x.length-1]].concat(x.slice(0,x.length-1)),b=Object(r.transpose)(b.reshape([-1,m]),[1,0]).reshape(v)}else w>1&&(y=[w-1].concat(ue(0,w-1)),b=Object(r.transpose)(b,y));return b}return n.mergeFunction(e)})},t.prototype.computeOutputShape=function(e){var t;t=null==(e=e)[0]?null:e[0].slice(1);for(var n=1;n<e.length;++n){var r=null==e[n]?null:e[n].slice(1);t=this.computeElementwiseOpOutputShape(t,r)}for(var i=[],o=0,a=e;o<a.length;o++)null!=(r=a[o])&&null!==r[0]&&i.push(r[0]);return 1===(i=N(i)).length?i.concat(t):[null].concat(t)},t.prototype.computeMask=function(e,t){return Object(r.tidy)(function(){if(null==t)return null;if(!Array.isArray(t))throw new d("`mask` should be an Array");if(!Array.isArray(e))throw new d("`inputs` should be an Array");if(t.length!==e.length)throw new d("The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths ("+e.length+" vs "+t.length+")");if(t.every(function(e){return null==e}))return null;for(var n=(t=t.map(function(e){return null==e?e:Object(r.expandDims)(e,0)}))[0],i=1;i<t.length-1;++i)n=Object(r.logicalAnd)(n,t[i]);return n})},t}(ht),Kr=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.mergeFunction=function(e){return Object(r.tidy)(function(){for(var t=e[0].clone(),n=1;n<e.length;++n)t=Object(r.add)(t,e[n]);return t})},t.className="Add",t}(Gr);r.serialization.registerClass(Kr);var $r=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.mergeFunction=function(e){return Object(r.tidy)(function(){for(var t=e[0].clone(),n=1;n<e.length;++n)t=Object(r.mul)(t,e[n]);return t})},t.className="Multiply",t}(Gr);r.serialization.registerClass($r);var Xr=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.mergeFunction=function(e){return Object(r.tidy)(function(){for(var t=e[0].clone(),n=1;n<e.length;++n)t=Object(r.add)(t,e[n]);return Object(r.mul)(1/e.length,t)})},t.className="Average",t}(Gr);r.serialization.registerClass(Xr);var Yr=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.mergeFunction=function(e){return Object(r.tidy)(function(){for(var t=e[0],n=1;n<e.length;++n)t=Object(r.maximum)(t,e[n]);return t})},t.className="Maximum",t}(Gr);r.serialization.registerClass(Yr);var Jr=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.mergeFunction=function(e){return Object(r.tidy)(function(){for(var t=e[0],n=1;n<e.length;++n)t=Object(r.minimum)(t,e[n]);return t})},t.className="Minimum",t}(Gr);r.serialization.registerClass(Jr);var Zr=function(e){function t(t){var n=e.call(this,t)||this;return n.DEFAULT_AXIS=-1,null==t&&(t={}),n.axis=null==t.axis?n.DEFAULT_AXIS:t.axis,n.supportsMasking=!0,n.reshapeRequired=!1,n}return o(t,e),t.prototype.build=function(e){if(!Array.isArray(e)||!Array.isArray(e[0])||1===e.length)throw new d("A `Concatenate` layer should be called on a list of at least 2 inputs");for(var t=!0,n=0,i=e=e;n<i.length;n++)if(null!=(f=i[n])){t=!1;break}if(!t){for(var o=[],a=0;a<e.length;++a){var s=e[a].slice();s.splice(this.axis,1);for(var u=!1,c=0,l=o;c<l.length;c++){var f=l[c];if(r.util.arraysEqual(f,s)){u=!0;break}}u||o.push(s)}if(o.length>1)throw new d("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}},t.prototype.mergeFunction=function(e){var t=this;return Object(r.tidy)(function(){return pe(e,t.axis)})},t.prototype.computeOutputShape=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new d("A `Concatenate` layer should be called on a list of inputs.");for(var t=e,n=t[0].slice(),r=this.axis<0?n.length+this.axis:this.axis,i=0,o=t.slice(1);i<o.length;i++){var a=o[i];if(null==n[r]||null==a[r]){n[r]=null;break}n[r]+=a[r]}return n},t.prototype.computeMask=function(e,t){var n=this;if(null==t)return null;if(!Array.isArray(t))throw new d("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new d("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new d("Mismatch in the length of mask ("+t.length+") and the legnth of inputs ("+e.length+")");return Object(r.tidy)(function(){var i=!0;if(t.forEach(function(e){null==e||(i=!1)}),i)return null;for(var o=[],a=0;a<e.length;++a)null==t[a]?o.push(Object(r.onesLike)(e[a]).asType("bool")):t[a].rank<e[a].rank?o.push(Object(r.expandDims)(t[a],-1)):o.push(t[a]);var s=Object(r.concat)(o,n.axis);return Object(r.all)(s,-1,!1)})},t.prototype.getConfig=function(){var t={axis:this.axis},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="Concatenate",t}(Gr);function Qr(e,t){for(;e<0;)e+=t;return e}r.serialization.registerClass(Zr);var ei=function(e){function t(t){var n=e.call(this,t)||this;return n.axes=t.axes,n.normalize=null!=t.normalize&&t.normalize,n.supportsMasking=!0,n.reshapeRequired=!1,n}return o(t,e),t.prototype.build=function(e){r.util.assert(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),function(){return"A `Dot` layer should be called on a list of exactly 2 inputs."});var t=e[0],n=e[1];if(t.length>3||n.length>3)throw new p("Dot layer does not support tensors of 4D or higher rank yet.");var i=this.interpretAxes(t,n);if(t[i[0]]!==n[i[1]])throw new d("Dimension incompatibility: "+t[i[0]]+" !== "+n[i[1]])},t.prototype.mergeFunction=function(e){if(2!==e.length)throw new d("A `Dot` layer must be called on exactly 2 inputs, but received "+e.length+" input(s).");var t,n=e[0],i=e[1];return t=Array.isArray(this.axes)?this.axes.map(function(t,n){return Qr(t,e[n].shape.length)}):[Qr(this.axes,n.shape.length),Qr(this.axes,i.shape.length)],this.normalize&&(n=Ot(n,t[0]),i=Ot(i,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new p("batchDot is not implemented for tensors of 4D or higher rank yet");if(r.util.assert(e.shape.length>=2,function(){return"batchDot requires the rank of x to be >= 2, but got "+e.shape.length}),r.util.assert(e.shape.length>=2,function(){return"batchDot requires the rank of y to be >= 2, but got "+t.shape.length}),"number"==typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new p("batchDot is not implemented for complex64-type Tensors yet.");var i=e.shape.length,o=t.shape.length;null==n&&(n=[i-1,o-2]);var a=n;return Object(r.tidy)(function(){var n,r;if(i>o){n=i-o;for(var s=[],u=0;u<n;++u)s.push(1);t=t.reshape(t.shape.concat(s))}else if(o>i){for(n=o-i,s=[],u=0;u<n;++u)s.push(1);e=e.reshape(e.shape.concat(s))}else n=0;if(2===e.shape.length&&2===t.shape.length)r=a[0]===a[1]?e.mulStrict(t).sum(a[0]):e.transpose([1,0]).mulStrict(t).sum(a[1]);else{var c=a[0]!==e.shape.length-1,l=a[1]===t.shape.length-1;r=e.matMul(t,c,l)}if(n>0){var f,h=[];for(u=f=i>o?i+o-3:i-1;u<f+n;++u)h.push(u);r=r.squeeze(h)}return 1===r.shape.length&&(r=r.expandDims(1)),r})}(n,i,t)},t.prototype.interpretAxes=function(e,t){return Array.isArray(this.axes)?this.axes:[Qr(this.axes,e.length),Qr(this.axes,t.length)]},t.prototype.computeOutputShape=function(e){r.util.assert(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),function(){return"A `Dot` layer should be called on a list of exactly 2 inputs."});var t=e[0].slice(),n=e[1].slice();if(t.length>3||n.length>3)throw new p("Dot layer does not support tensors of 4D or higher rank yet.");var i=this.interpretAxes(t,n);t.splice(i[0],1),n.splice(i[1],1),n.splice(0,1);var o=t.concat(n);return 1===o.length&&o.push(1),o},t.prototype.computeMask=function(e,t){return null},t.prototype.getConfig=function(){var t={axes:this.axes,normalize:this.normalize},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="Dot",t}(Gr);r.serialization.registerClass(ei);var ti=function(e){function t(t){var n=e.call(this,t)||this;return n.supportsMasking=!0,n.stddev=t.stddev,n}return o(t,e),t.prototype.computeOutputShape=function(e){return e},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this),n={stddev:this.stddev};return Object.assign(n,t),n},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){n.invokeCallHook(e,t);var r=et(e);return Se(function(){return ge(r.shape,0,n.stddev).add(r)},function(){return r},t.training||!1)})},t.className="GaussianNoise",t}(ht);r.serialization.registerClass(ti);var ni=function(e){function t(t){var n=e.call(this,t)||this;return n.supportsMasking=!0,n.rate=t.rate,n}return o(t,e),t.prototype.computeOutputShape=function(e){return e},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this),n={rate:this.rate};return Object.assign(n,t),n},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){n.invokeCallHook(e,t);var r=et(e);return n.rate>0&&n.rate<1?Se(function(){var e=Math.sqrt(n.rate/(1-n.rate));return r.mul(ge(r.shape,1,e))},function(){return r},t.training||!1):r})},t.className="GaussianDropout",t}(ht);r.serialization.registerClass(ni);var ri=function(e){function t(t){var n=e.call(this,t)||this;return n.supportsMasking=!0,n.rate=t.rate,n.noiseShape=t.noiseShape,n}return o(t,e),t.prototype._getNoiseShape=function(e){return this.noiseShape||et(e).shape},t.prototype.computeOutputShape=function(e){return e},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this),n={rate:this.rate};return Object.assign(n,t),n},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){if(n.rate<1&&n.rate>0){var i=n._getNoiseShape(e);return Se(function(){var t=et(e),o=-1.7580993408473766,a=Object(r.greaterEqual)(Object(r.randomUniform)(i),n.rate);a=ce(a,"float32");var s=Math.pow((1-n.rate)*(1+n.rate*Math.pow(o,2)),-.5),u=-s*o*n.rate;return t.mul(a).add(a.add(-1).mul(o)).mul(s).add(u)},function(){return et(e)},t.training||!1)}return e})},t.className="AlphaDropout",t}(ht);function ii(e,t,n,i,o,a){var s;if(void 0===a&&(a=.001),2===e.rank)s=Object(r.batchNorm2d)(e,t,n,i,o,a);else if(3===e.rank)s=Object(r.batchNorm3d)(e,t,n,i,o,a);else{if(4!==e.rank)throw new p("batchNormalization is not implemented for array of rank "+e.rank+" yet");s=Object(r.batchNorm4d)(e,t,n,i,o,a)}return s}function oi(e,t,n,i,o){return void 0===o&&(o=.001),r.util.arraysEqual(i.slice().sort(),ue(0,e.rank-1))?function(e,t,n,i,o){return void 0===o&&(o=.001),Object(r.tidy)(function(){var a=Object(r.moments)(e,i),s=a.mean,u=a.variance;return[ii(e,s,u,n,t,o),s,u]})}(e,t,n,i,o):function(e,t,n,i,o){return void 0===o&&(o=.001),Object(r.tidy)(function(){for(var a=Object(r.moments)(e,i),s=a.mean,u=a.variance,c=[],l=0,f=ue(0,e.rank);l<f.length;l++){var h=f[l];-1!==i.indexOf(h)?c.push(1):c.push(e.shape[h])}var d=s.reshape(c),p=u.reshape(c),m=null==t?null:t.reshape(c),v=null==n?null:n.reshape(c);return[ii(e,d,p,v,m,o),s,u]})}(e,t,n,i,o)}r.serialization.registerClass(ri);var ai=function(e){function t(t){var n=this;return null==t&&(t={}),(n=e.call(this,t)||this).supportsMasking=!0,n.axis=null==t.axis?-1:t.axis,n.momentum=null==t.momentum?.99:t.momentum,n.epsilon=null==t.epsilon?.001:t.epsilon,n.center=null==t.center||t.center,n.scale=null==t.scale||t.scale,n.betaInitializer=Ge(t.betaInitializer||"zeros"),n.gammaInitializer=Ge(t.gammaInitializer||"ones"),n.movingMeanInitializer=Ge(t.movingMeanInitializer||"zeros"),n.movingVarianceInitializer=Ge(t.movingVarianceInitializer||"ones"),n.betaConstraint=U(t.betaConstraint),n.gammaConstraint=U(t.gammaConstraint),n.betaRegularizer=mr(t.betaRegularizer),n.gammaRegularizer=mr(t.gammaRegularizer),n}return o(t,e),t.prototype.build=function(e){var t;e=tt(e);var n=this.axis>=0?this.axis:this.axis+e.length,r=e[n];if(null==r)throw new d("Axis "+n+" of input tensor should have a defined dimension but the layer received an input with shape "+JSON.stringify(e)+".");this.inputSpec=[new st({ndim:e.length,axes:(t={},t[n]=r,t)})];var i=[r];this.scale&&(this.gamma=this.addWeight("gamma",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",i,null,this.movingVarianceInitializer,null,!1),this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var i=null!=t.training&&t.training,o=et(e),a=o.shape,s=a.length,u=ue(0,s),c=n.axis>=0?n.axis:n.axis+s;u.splice(c,1);var l=v(1,s);l[c]=a[c];var f=u.slice();f.sort();var h=!r.util.arraysEqual(f,ue(0,s).slice(0,s-1));if(!i)return function(){if(h){var e=n.movingMean.read().reshape(l),t=n.movingVariance.read().reshape(l),r=n.center?n.beta.read().reshape(l):null,i=n.scale?n.gamma.read().reshape(l):null;return ii(o,e,t,r,i,n.epsilon)}return ii(o,n.movingMean.read(),n.movingVariance.read(),null==n.beta?null:n.beta.read(),null==n.gamma?null:n.gamma.read(),n.epsilon)}();var d=oi(o,n.gamma.read(),n.beta.read(),u,n.epsilon),p=d[0],m=d[1],g=d[2],y=function(e,t,n){Object(r.tidy)(function(){var r=1-n,i=e.read(),o=i.sub(t).mul(r);e.write(i.sub(o))})};return y(n.movingMean,m,n.momentum),y(n.movingVariance,g,n.momentum),p})},t.prototype.getConfig=function(){var t={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:He(this.betaInitializer),gammaInitializer:He(this.gammaInitializer),movingMeanInitializer:He(this.movingMeanInitializer),movingVarianceInitializer:He(this.movingVarianceInitializer),betaRegularizer:dr(this.betaRegularizer),gammaRegularizer:dr(this.gammaRegularizer),betaConstraint:B(this.betaConstraint),gammaConstraint:B(this.gammaConstraint)},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="BatchNormalization",t}(ht);r.serialization.registerClass(ai);var si=function(e){function t(t){var n=this;if(null==t&&(t={}),(n=e.call(this,t)||this).dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,null==t.padding)n.padding=[[1,1],[1,1]];else if("number"==typeof t.padding)n.padding=[[t.padding,t.padding],[t.padding,t.padding]];else{if(t.padding=t.padding,2!==t.padding.length)throw new d("ZeroPadding2D expects padding to be a length-2 array, but received a length-"+t.padding.length+" array.");var r=void 0,i=void 0;if("number"==typeof t.padding[0])r=[t.padding[0],t.padding[0]],i=[t.padding[1],t.padding[1]];else{if(t.padding=t.padding,2!==t.padding[0].length)throw new d("ZeroPadding2D expects height padding to be a length-2 array, but received a length-"+t.padding[0].length+" array.");if(r=t.padding[0],2!==t.padding[1].length)throw new d("ZeroPadding2D expects width padding to be a length-2 array, but received a length-"+t.padding[1].length+" array.");i=t.padding[1]}n.padding=[r,i]}return n.inputSpec=[new st({ndim:4})],n}return o(t,e),t.prototype.computeOutputShape=function(e){var t,n;return e=tt(e),"channelsFirst"===this.dataFormat?(t=null!=e[2]&&e[2]>=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){return function(e,t,n){return Object(r.tidy)(function(){if(4!==e.rank)throw new d("temporalPadding expects input tensor to be 4-D, but received a "+e.rank+"-D tensor.");if(null==t&&(t=[[1,1],[1,1]]),2!==t.length||2!==t[0].length||2!==t[1].length)throw new d("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==n&&(n="channelsLast"),"channelsLast"!==n&&"channelsFirst"!==n)throw new d("Unknown data format: "+n+". Supported data formats are 'channelsLast' and 'channelsFirst.");var i;return i="channelsFirst"===n?[[0,0],[0,0],t[0],t[1]]:[[0,0],t[0],t[1],[0,0]],Object(r.pad)(e,i)})}(et(e),n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={padding:this.padding,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="ZeroPadding2D",t}(ht);function ui(e,t,n,i,o,a){return Object(r.tidy)(function(){var s;$(o),function(e){A(H,"PoolMode",e)}(a),X(i),null==n&&(n=[1,1]),null==i&&(i="valid"),null==o&&(o="channelsLast"),null==a&&(a="max"),e=Er(e,o);var u="same"===i?"same":"valid";return s="max"===a?Object(r.maxPool)(e,t,n,u):Object(r.avgPool)(e,t,n,u),"channelsFirst"===o&&(s=Object(r.transpose)(s,[0,3,1,2])),s})}r.serialization.registerClass(si);var ci=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=2),n=e.call(this,t)||this,"number"==typeof t.poolSize)n.poolSize=[t.poolSize];else{if(!Array.isArray(t.poolSize)||1!==t.poolSize.length||"number"!=typeof t.poolSize[0])throw new d("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(t.poolSize));n.poolSize=t.poolSize}if(I(n.poolSize,"poolSize"),null==t.strides)n.strides=n.poolSize;else if("number"==typeof t.strides)n.strides=[t.strides];else{if(!Array.isArray(t.strides)||1!==t.strides.length||"number"!=typeof t.strides[0])throw new d("strides for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(t.strides));n.strides=t.strides}return I(n.strides,"strides"),n.padding=null==t.padding?"valid":t.padding,X(n.padding),n.inputSpec=[new st({ndim:3})],n}return o(t,e),t.prototype.computeOutputShape=function(e){var t=kr((e=tt(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){n.invokeCallHook(e,t),e=le(et(e),2);var i=n.poolingFunction(et(e),[n.poolSize[0],1],[n.strides[0],1],n.padding,"channelsLast");return Object(r.squeeze)(i,[2])})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(ht),li=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return $(i),X(r),ui(e,t,n,r,i,"max")},t.className="MaxPooling1D",t}(ci);r.serialization.registerClass(li);var fi=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return $(i),X(r),ui(e,t,n,r,i,"avg")},t.className="AveragePooling1D",t}(ci);r.serialization.registerClass(fi);var hi=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=[2,2]),(n=e.call(this,t)||this).poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize],null==t.strides)n.strides=n.poolSize;else if(Array.isArray(t.strides)){if(2!==t.strides.length)throw new d("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length "+t.strides.length+".");n.strides=t.strides}else n.strides=[t.strides,t.strides];return I(n.poolSize,"poolSize"),I(n.strides,"strides"),n.padding=null==t.padding?"valid":t.padding,n.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,$(n.dataFormat),X(n.padding),n.inputSpec=[new st({ndim:4})],n}return o(t,e),t.prototype.computeOutputShape=function(e){e=tt(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=kr(t,this.poolSize[0],this.padding,this.strides[0]),n=kr(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){return n.invokeCallHook(e,t),n.poolingFunction(et(e),n.poolSize,n.strides,n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(ht),di=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return $(i),X(r),ui(e,t,n,r,i,"max")},t.className="MaxPooling2D",t}(hi);r.serialization.registerClass(di);var pi=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return $(i),X(r),ui(e,t,n,r,i,"avg")},t.className="AveragePooling2D",t}(hi);r.serialization.registerClass(pi);var mi=function(e){function t(t){var n=e.call(this,t)||this;return n.inputSpec=[new st({ndim:3})],n}return o(t,e),t.prototype.computeOutputShape=function(e){return[e[0],e[2]]},t.prototype.call=function(e,t){throw new p},t}(ht),vi=function(e){function t(t){return e.call(this,t||{})||this}return o(t,e),t.prototype.call=function(e,t){return Object(r.tidy)(function(){var t=et(e);return Object(r.mean)(t,1)})},t.className="GlobalAveragePooling1D",t}(mi);r.serialization.registerClass(vi);var gi=function(e){function t(t){return e.call(this,t||{})||this}return o(t,e),t.prototype.call=function(e,t){return Object(r.tidy)(function(){var t=et(e);return Object(r.max)(t,1)})},t.className="GlobalMaxPooling1D",t}(mi);r.serialization.registerClass(gi);var yi=function(e){function t(t){var n=e.call(this,t)||this;return n.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,$(n.dataFormat),n.inputSpec=[new st({ndim:4})],n}return o(t,e),t.prototype.computeOutputShape=function(e){return e=e,"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]},t.prototype.call=function(e,t){throw new p},t.prototype.getConfig=function(){var t={dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(ht),bi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var t=et(e);return"channelsLast"===n.dataFormat?Object(r.mean)(t,[1,2]):Object(r.mean)(t,[2,3])})},t.className="GlobalAveragePooling2D",t}(yi);r.serialization.registerClass(bi);var wi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var t=et(e);return"channelsLast"===n.dataFormat?Object(r.max)(t,[1,2]):Object(r.max)(t,[2,3])})},t.className="GlobalMaxPooling2D",t}(yi);function xi(e,t,n,r){if(Array.isArray(e)){if(null!=t||null!=n)throw new d("When input
1s is an array, neither initialState or constants should be provided");null!=r&&(n=e.slice(e.length-r,e.length),e=e.slice(0,e.length-r)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function i(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=i(t),constants:n=i(n)}}function _i(e,t,n,i,o,a,s,u){return void 0===i&&(i=!1),void 0===s&&(s=!1),void 0===u&&(u=!1),Object(r.tidy)(function(){var c=t.shape.length;if(c<3)throw new d("Input should be at least 3D, but is "+c+"D.");var l=[1,0].concat(ue(2,c));if(t=Object(r.transpose)(t,l),null!=a)throw new p("The rnn() functoin of the deeplearn.js backend does not support constants yet.");s&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=o&&((o=o.asType("bool").asType("float32")).rank===c-1&&(o=Object(r.expandDims)(o,-1)),o=Object(r.transpose)(o,l)),i&&(t=Object(r.reverse)(t,0),null!=o&&(o=Object(r.reverse)(o,0)));var f,h,m=[],v=n,g=t.shape[0],y=Object(r.unstack)(t);null!=o&&(h=Object(r.unstack)(o));for(var b,w=function(t){var n=y[t],i=Object(r.tidy)(function(){return e(n,v)});if(null==o)f=i[0],v=i[1];else{var a=Object(r.tidy)(function(){var e=h[t],n=Object(r.onesLike)(e).sub(e);return{output:i[0].mul(e).addStrict(v[0].mul(n)),newStates:v.map(function(t,r){return i[1][r].mul(e).addStrict(t.mul(n))})}});f=a.output,v=a.newStates}u&&m.push(f)},x=0;x<g;++x)w(x);return u&&(b=Object(r.stack)(m,1)),[f,b,v]})}r.serialization.registerClass(wi);var ki=function(e){function t(t){var n,r=e.call(this,t)||this;if(null==t.cell)throw new d("cell property is missing for the constructor of RNN.");if(null==(n=Array.isArray(t.cell)?new Ii({cells:t.cell}):t.cell).stateSize)throw new d("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");return r.cell=n,r.returnSequences=null!=t.returnSequences&&t.returnSequences,r.returnState=null!=t.returnState&&t.returnState,r.goBackwards=null!=t.goBackwards&&t.goBackwards,r._stateful=null!=t.stateful&&t.stateful,r.unroll=null!=t.unroll&&t.unroll,r.supportsMasking=!0,r.inputSpec=[new st({ndim:3})],r.stateSpec=null,r.states_=null,r.numConstants=null,r.keptStates=[],r}return o(t,e),t.prototype.getStates=function(){return null==this.states_?ue(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map(function(e){return null}):this.states_},t.prototype.setStates=function(e){this.states_=e},t.prototype.computeOutputShape=function(e){Ze(e)&&(e=e[0]),e=e;var t=this.cell.stateSize;Array.isArray(t)||(t=[t]);var n,r=t[0];if(n=this.returnSequences?[e[0],e[1],r]:[e[0],r],this.returnState){for(var i=[],o=0,a=t;o<a.length;o++){var s=a[o];i.push([e[0],s])}return[n].concat(i)}return n},t.prototype.computeMask=function(e,t){var n=this;return Object(r.tidy)(function(){Array.isArray(t)&&(t=t[0]);var e=n.returnSequences?t:null;if(n.returnState){var r=n.states.map(function(e){return null});return[e].concat(r)}return e})},Object.defineProperty(t.prototype,"states",{get:function(){if(null==this.states_){for(var e=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1,t=[],n=0;n<e;++n)t.push(null);return t}return this.states_},set:function(e){this.states_=e},enumerable:!0,configurable:!0}),t.prototype.build=function(e){if(null!=this.numConstants)throw new p("Constants support is not implemented in RNN yet.");Ze(e)&&(e=e[0]),e=e;var t=this.stateful?e[0]:null,n=e[e.length-1];this.inputSpec[0]=new st({shape:[t,null,n]});var i,o=[e[0]].concat(e.slice(2));if(this.cell.build(o),i=Array.isArray(this.cell.stateSize)?this.cell.stateSize:[this.cell.stateSize],null!=this.stateSpec){if(!r.util.arraysEqual(this.stateSpec.map(function(e){return e.shape[e.shape.length-1]}),i))throw new d("An initialState was passed that is not compatible with cell.stateSize. Received stateSpec="+this.stateSpec+"; However cell.stateSize is "+this.cell.stateSize)}else this.stateSpec=i.map(function(e){return new st({shape:[null,e]})});this.stateful&&this.resetStates()},t.prototype.resetStates=function(e,t){var n=this;void 0===t&&(t=!1),Object(r.tidy)(function(){if(!n.stateful)throw new f("Cannot call resetStates() on an RNN Layer that is not stateful.");var i=n.inputSpec[0].shape[0];if(null==i)throw new d("If an RNN is stateful, it needs to know its batch size. Specify the batch size of your input tensors: \n- If using a Sequential model, specify the batch size by passing a `batchInputShape` option to your first layer.\n- If using the functional API, specify the batch size by passing a `batchShape` option to your Input layer.");if(null==n.states_)Array.isArray(n.cell.stateSize)?n.states_=n.cell.stateSize.map(function(e){return Object(r.zeros)([i,e])}):n.states_=[Object(r.zeros)([i,n.cell.stateSize])];else if(null==e)Object(r.dispose)(n.states_),null!=n.keptStates&&(Object(r.dispose)(n.keptStates),n.keptStates=[]),Array.isArray(n.cell.stateSize)?n.states_=n.cell.stateSize.map(function(e){return Object(r.zeros)([i,e])}):n.states_[0]=Object(r.zeros)([i,n.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==n.states_.length)throw new d("Layer "+n.name+" expects "+n.states_.length+" state(s), but it received "+e.length+" state value(s). Input received: "+e);!0===t?n.keptStates.push(n.states_.slice()):Object(r.dispose)(n.states_);for(var o=0;o<n.states_.length;++o){var a=e[o],s=Array.isArray(n.cell.stateSize)?n.cell.stateSize[o
vendor: 36,262 bytes, line 1
1]:n.cell.stateSize,u=[i,s];if(!r.util.arraysEqual(a.shape,u))throw new d("State "+o+" is incompatible with layer "+n.name+": expected shape="+u+", received shape="+a.shape);n.states_[o]=a}}n.states_=n.states_.map(function(e){return Object(r.keep)(e.clone())})})},t.prototype.apply=function(t,n){var r=null==n?null:n.initialState,i=null==n?null:n.constants;null==n&&(n={});var o=xi(t,r,i,this.numConstants);t=o.inputs,r=o.initialState,i=o.constants;var a=[],s=[];if(null!=r){n.initialState=r,a=a.concat(r),this.stateSpec=[];for(var u=0,c=r;u<c.length;u++){var l=c[u];this.stateSpec.push(new st({shape:l.shape}))}s=s.concat(this.stateSpec)}if(null!=i&&(n.constants=i,a=a.concat(i),this.numConstants=i.length),a[0]instanceof ut){var f=[t].concat(a),h=this.inputSpec.concat(s),d=this.inputSpec;this.inputSpec=h;var p=e.prototype.apply.call(this,f,n);return this.inputSpec=d,p}return e.prototype.apply.call(this,t,n)},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var r=null==t?null:t.mask,i=null==t?null:t.training,o=null==t?null:t.initialState;e=et(e),null==o&&(o=n.stateful?n.states_:n.getInitialState(e));var a=Array.isArray(n.cell.stateSize)?n.cell.stateSize.length:1;if(o.length!==a)throw new d("RNN Layer has "+a+" state(s) but was passed "+o.length+" initial state(s).");n.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");var s={training:i},u=_i(function(e,t){var r=n.cell.call([e].concat(t),s);return[r[0],r.slice(1)]},e,o,n.goBackwards,r,null,n.unroll,n.returnSequences),c=u[0],l=u[1],f=u[2];n.stateful&&n.resetStates(f,i);var h=n.returnSequences?l:c;return n.returnState?[h].concat(f):h})},t.prototype.getInitialState=function(e){var t=this;return Object(r.tidy)(function(){var n=Object(r.zeros)(e.shape);return n=le(n=Object(r.sum)(n,[1,2])),Array.isArray(t.cell.stateSize)?t.cell.stateSize.map(function(e){return e>1?ve(n,[1,e]):n}):t.cell.stateSize>1?[ve(n,[1,t.cell.stateSize])]:[n]})},Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),t.prototype.setFastWeightInitDuringBuild=function(t){e.prototype.setFastWeightInitDuringBuild.call(this,t),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(t)},t.prototype.getConfig=function(){var t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);var n=this.cell.getConfig();t.cell={className:this.cell.getClassName(),config:n};var r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t.fromConfig=function(e,t,n){void 0===n&&(n={});var r=fn(t.cell,n);return new e(Object.assign(t,{cell:r}))},t.className="RNN",t}(ht);r.serialization.registerClass(ki);var Si=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(ht),Ei=function(e){function t(t){var n=e.call(this,t)||this;return n.DEFAULT_ACTIVATION="tanh",n.DEFAULT_KERNEL_INITIALIZER="glorotNormal",n.DEFAULT_RECURRENT_INITIALIZER="orthogonal",n.DEFAULT_BIAS_INITIALIZER="zeros",n.units=t.units,I(n.units,"units"),n.activation=cr(null==t.activation?n.DEFAULT_ACTIVATION:t.activation),n.useBias=null==t.useBias||t.useBias,n.kernelInitializer=Ge(t.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=Ge(t.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=Ge(t.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelRegularizer=mr(t.kernelRegularizer),n.recurrentRegularizer=mr(t.recurrentRegularizer),n.biasRegularizer=mr(t.biasRegularizer),n.kernelConstraint=U(t.kernelConstraint),n.recurrentConstraint=U(t.recurrentConstraint),n.biasConstraint=U(t.biasConstraint),n.dropout=ae([1,se([0,null==t.dropout?0:t.dropout])]),n.recurrentDropout=ae([1,se([0,null==t.recurrentDropout?0:t.recurrentDropout])]),n.stateSize=n.units,n.dropoutMask=null,n.recurrentDropoutMask=null,n}return o(t,e),t.prototype.build=function(e){e=tt(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){if(2!==(e=e).length)throw new d("SimpleRNNCell expects 2 input Tensors, got "+e.length+".");var i=e[1];e=e[0];var o,a=null!=t.training&&t.training;0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=Ri(function(){return Object(r.onesLike)(e)},n.dropout,a)),0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=Ri(function(){return Object(r.onesLike)(i)},n.recurrentDropout,a));var s=n.dropoutMask,u=n.recurrentDropoutMask;o=ye(null!=s?Object(r.mul)(e,s):e,n.kernel.read()),null!=n.bias&&(o=_e(o,n.bias.read())),null!=u&&(i=Object(r.mul)(i,u));var c=Object(r.add)(o,ye(i,n.recurrentKernel.read()));return null!=n.activation&&(c=n.activation.apply(c)),[c,c]})},t.prototype.getConfig=function(){var t={units:this.units,activation:sr(this.activation),useBias:this.useBias,kernelInitializer:He(this.kernelInitializer),recurrentInitializer:He(this.recurrentInitializer),biasInitializer:He(this.biasInitializer),kernelRegularizer:dr(this.kernelRegularizer),recurrentRegularizer:dr(this.recurrentRegularizer),biasRegularizer:dr(this.biasRegularizer),activityRegularizer:dr(this.activityRegularizer),kernelConstraint:B(this.kernelConstraint),recurrentConstraint:B(this.recurrentConstraint),biasConstraint:B(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="SimpleRNNCell",t}(Si);r.serialization.registerClass(Ei);var Ci=function(e){function t(t){return t.cell=new Ei(t),e.call(this,t)||this}return o(t,e),t.prototype.call=function(t,n){var i=this;return Object(r.tidy)(function(){null!=i.cell.dropoutMask&&(Object(r.dispose)(i.cell.dropoutMask),i.cell.dropoutMask=null),null!=i.cell.recurrentDropoutMask&&(Object(r.dispose)(i.cell.recurrentDropoutMask),i.cell.recurrentDropoutMask=null);var o=null==n?null:n.mask,a=null==n?null:n.training,s=null==n?null:n.initialState;return e.prototype.call.call(i,t,{mask:o,training:a,initialState:s})})},Object.defineProperty(t.prototype,"units",{get:function(){return this.cell.units},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activation",{get:function(){return this.cell.activation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useBias",{get:function(){return this.cell.useBias},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"kernelInitializer",{get:function(){return this.cell.kernelInitializer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentInitializer",{get:function(){return this.cell.recurrentInitializer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"biasInitializer",{get:function(){return this.cell.biasInitializer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"kernelRegularizer",{get:function(){return this.cell.kernelRegularizer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentRegularizer",{get:function(){return this.cell.recurrentRegularizer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"biasRegularizer",{get:function(){return this.cell.biasRegularizer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"kernelConstraint",{get:function(){return this.cell.kernelConstraint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentConstraint",{get:function(){return this.cell.recurrentConstraint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"biasConstraint",{get:function(){return this.cell.biasConstraint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropout",{get:function(){return this.cell.dropout},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentDropout",{get:function(){return this.cell.recurrentDropout},enumerable:!0,configurable:!0}),t.prototype.getConfig=function(){var t={units:this.units,activation:sr(this.activation),useBias:this.useBias,kernelInitializer:He(this.kernelInitializer),recurrentInitializer:He(this.recurrentInitializer),biasInitializer:He(this.biasInitializer),kernelRegularizer:dr(this.kernelRegularizer),recurrentRegularizer:dr(this.recurrentRegularizer),biasRegularizer:dr(this.biasRegularizer),activityRegularizer:dr(this.activityRegularizer),kernelConstraint:B(this.kernelConstraint),recurrentConstraint:B(this.recurrentConstraint),biasConstraint:B(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout},n=e.prototype.getConfig.call(this);return delete n.cell,Object.assign(t,n),t},t.fromConfig=function(e,t){return new e(t)},t.className="SimpleRNN",t}(ki);r.serialization.registerClass(Ci);var Ni=function(e){function t(t){var n=e.call(this,t)||this;return n.DEFAULT_ACTIVATION="tanh",n.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",n.DEFAULT_KERNEL_INITIALIZER="glorotNormal",n.DEFAULT_RECURRENT_INITIALIZER="orthogonal",n.DEFAULT_BIAS_INITIALIZER="zeros",n.units=t.units,I(n.units,"units"),n.activation=cr(void 0===t.activation?n.DEFAULT_ACTIVATION:t.activation),n.recurrentActivation=cr(void 0===t.recurrentActivation?n.DEFAULT_RECURRENT_ACTIVATION:t.recurrentActivation),n.useBias=null==t.useBias||t.useBias,n.kernelInitializer=Ge(t.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=Ge(t.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=Ge(t.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelRegularizer=mr(t.kernelRegularizer),n.recurrentRegularizer=mr(t.recurrentRegularizer),n.biasRegularizer=mr(t.biasRegularizer),n.kernelConstraint=U(t.kernelConstraint),n.recurrentConstraint=U(t.recurrentConstraint),n.biasConstraint=U(t.biasConstraint),n.dropout=ae([1,se([0,null==t.dropout?0:t.dropout])]),n.recurrentDropout=ae([1,se([0,null==t.recurrentDropout?0:t.recurrentDropout])]),n.implementation=t.implementation,n.stateSize=n.units,n.dropoutMask=null,n.recurrentDropoutMask=null,n}return o(t,e),t.prototype.build=function(e){var t=(e=tt(e))[e.length-1];this.kernel=this.addWeight("kernel",[t,3*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,3*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[3*this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){if(2!==(e=e).length)throw new d("GRUCell expects 2 input Tensors (inputs, h, c), got "+e.length+".");var i=null!=t.training&&t.training,o=e[1];e=e[0],0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=Ri(function(){return Object(r.onesLike)(e)},n.dropout,i,3)),0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=Ri(function(){return Object(r.onesLike)(o)},n.recurrentDropout,i,3));var a,s,u,c=n.dropoutMask,l=n.recurrentDropoutMask;0<n.dropout&&n.dropout<1&&(e=Object(r.mul)(e,c[0]));var f=ye(e,n.kernel.read());n.useBias&&(f=_e(f,n.bias.read())),0<n.recurrentDropout&&n.recurrentDropout<1&&(o=Object(r.mul)(o,l[0]));var h=n.recurrentKernel.read(),p=Object(r.split)(h,[2*n.units,n.units],h.rank-1),m=p[0],v=p[1],g=ye(o,m),y=Object(r.split)(f,3,f.rank-1),b=y[0],w=y[1],x=y[2],_=Object(r.split)(g,2,g.rank-1),k=_[0],S=_[1];a=n.recurrentActivation.apply(Object(r.add)(b,k)),s=n.recurrentActivation.apply(Object(r.add)(w,S));var E=ye(Object(r.mul)(s,o),v);u=n.activation.apply(Object(r.add)(x,E));var C=Object(r.add)(Object(r.mul)(a,o),Object(r.mul)(Object(r.add)(1,Object(r.neg)(a)),u));return[C,C]})},t.prototype.getConfig=function(){var t={units:this.units,activation:sr(this.activation),recurrentActivation:sr(this.recurrentActivation),useBias:this.useBias,kernelInitializer:He(this.kernelInitializer),recurrentInitializer:He(this.recurrentInitializer),biasInitializer:He(this.biasInitializer),kernelRegularizer:dr(this.kernelRegularizer),recurrentRegularizer:dr(this.recurrentRegularizer),biasRegularizer:dr(this.biasRegularizer),activityRegularizer:dr(this.activityRegularizer),kernelConstraint:B(this.kernelConstraint),recurrentConstraint:B(this.recurrentConstraint),biasConstraint:B(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="GRUCell",t}(Si);r.serialization.registerClass(Ni);var Oi=function(e){function t(t){return 0===t.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),t.cell=new Ni(t),e.call(this,t)||this}return o(t,e),t.prototype.call=function(t,n){var i=this;return Object(r.tidy)(function(){null!=i.cell.dropoutMask&&(Object(r.dispose)(i.cell.dropoutMask),i.cell.dropoutMask=null),null!=i.cell.recurrentDropoutMask&&(Object(r.dispose)(i.cell.recurrentDropoutMask),i.cell.recurrentDropoutMask=null);var o=null==n?null:n.mask,a=null==n?null:n.training,s=null==n?null:n.initialState;return e.prototype.call.call(i,t,{mask:o,training:a,initialState:s})})},Object.defineProperty(t.prototype,"units",{get:function(){return this.cell.units},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activation",{get:function(){return this.cell.activation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentActivation",{get:function(){return this.cell.recurrentActivation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useBias",{get:function(){return this.cell.useBias},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"kernelInitializer",{get:function(){return this.cell.kernelInitializer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentInitializer",{get:function(){return this.cell.recurrentInitializer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"biasInitializer",{get:function(){return this.cell.biasInitializer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"kernelRegularizer",{get:function(){return this.cell.kernelRegularizer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentRegularizer",{get:function(){return this.cell.recurrentRegularizer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"biasRegularizer",{get:function(){return this.cell.biasRegularizer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"kernelConstraint",{get:function(){return this.cell.kernelConstraint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentConstraint",{get:function(){return this.cell.recurrentConstraint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"biasConstraint",{get:function(){return this.cell.biasConstraint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropout",{get:function(){return this.cell.dropout},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentDropout",{get:function(){return this.cell.recurrentDropout},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"implementation",{get:function(){return this.cell.implementation},enumerable:!0,configurable:!0}),t.prototype.getConfig=function(){var t={units:this.units,activation:sr(this.activation),recurrentActivation:sr(this.recurrentActivation),useBias:this.useBias,kernelInitializer:He(this.kernelInitializer),recurrentInitializer:He(this.recurrentInitializer),biasInitializer:He(this.biasInitializer),kernelRegularizer:dr(this.kernelRegularizer),recurrentRegularizer:dr(this.recurrentRegularizer),biasRegularizer:dr(this.biasRegularizer),activityRegularizer:dr(this.activityRegularizer),kernelConstraint:B(this.kernelConstraint),recurrentConstraint:B(this.recurrentConstraint),biasConstraint:B(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation},n=e.prototype.getConfig.call(this);return delete n.cell,Object.assign(t,n),t},t.fromConfig=function(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)},t.className="GRU",t}(ki);r.serialization.registerClass(Oi);var Ai=function(e){function t(t){var n=e.call(this,t)||this;return n.DEFAULT_ACTIVATION="tanh",n.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",n.DEFAULT_KERNEL_INITIALIZER="glorotNormal",n.DEFAULT_RECURRENT_INITIALIZER="orthogonal",n.DEFAULT_BIAS_INITIALIZER="zeros",n.units=t.units,I(n.units,"units"),n.activation=cr(void 0===t.activation?n.DEFAULT_ACTIVATION:t.activation),n.recurrentActivation=cr(void 0===t.recurrentActivation?n.DEFAULT_RECURRENT_ACTIVATION:t.recurrentActivation),n.useBias=null==t.useBias||t.useBias,n.kernelInitializer=Ge(t.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=Ge(t.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=Ge(t.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.unitForgetBias=t.unitForgetBias,n.kernelRegularizer=mr(t.kernelRegularizer),n.recurrentRegularizer=mr(t.recurrentRegularizer),n.biasRegularizer=mr(t.biasRegularizer),n.kernelConstraint=U(t.kernelConstraint),n.recurrentConstraint=U(t.recurrentConstraint),n.biasConstraint=U(t.biasConstraint),n.dropout=ae([1,se([0,null==t.dropout?0:t.dropout])]),n.recurrentDropout=ae([1,se([0,null==t.recurrentDropout?0:t.recurrentDropout])]),n.implementation=t.implementation,n.stateSize=[n.units,n.units],n.dropoutMask=null,n.recurrentDropoutMask=null,n}return o(t,e),t.prototype.build=function(e){var t,n,r=(e=tt(e))[e.length-1];if(this.kernel=this.addWeight("kernel",[r,4*this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,4*this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){if(this.unitForgetBias){var i=this.biasInitializer,a=this.units;n=new((t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(e,t){var n=i.apply([a]),r=(new Ae).apply([a]),o=i.apply([2*a]);return me(me(n,r),o)},t}(Ne)).className="CustomInit",t)}else n=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,n,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){var i=null!=t.training&&t.training;if(3!==(e=e).length)throw new d("LSTMCell expects 3 input Tensors (inputs, h, c), got "+e.length+".");var o=e[1],a=e[2];e=e[0],0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=Ri(function(){return Object(r.onesLike)(e)},n.dropout,i,4)),0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=Ri(function(){return Object(r.onesLike)(o)},n.recurrentDropout,i,4));var s,u,c,l,f=n.dropoutMask,h=n.recurrentDropoutMask;0<n.dropout&&n.dropout<1&&(e=Object(r.mul)(e,f[0]));var p=ye(e,n.kernel.read());0<n.recurrentDropout&&n.recurrentDropout<1&&(o=Object(r.mul)(o,h[0])),p=Object(r.add)(p,ye(o,n.recurrentKernel.read())),n.useBias&&(p=_e(p,n.bias.read()));var m=Object(r.split)(p,4,p.rank-1),v=m[0],g=m[1],y=m[2],b=m[3];s=n.recurrentActivation.apply(v),u=n.recurrentActivation.apply(g),c=Object(r.add)(Object(r.mul)(u,a),Object(r.mul)(s,n.activation.apply(y))),l=n.recurrentActivation.apply(b);var w=Object(r.mul)(l,n.activation.apply(c));return[w,w,c]})},t.prototype.getConfig=function(){var t={units:this.units,activation:sr(this.activation),recurrentActivation:sr(this.recurrentActivation),useBias:this.useBias,kernelInitializer:He(this.kernelInitializer),recurrentInitializer:He(this.recurrentInitializer),biasInitializer:He(this.biasInitializer),unitForgetBias:this.unitForgetBias,kernelRegularizer:dr(this.kernelRegularizer),recurrentRegularizer:dr(this.recurrentRegularizer),biasRegularizer:dr(this.biasRegularizer),activityRegularizer:dr(this.activityRegularizer),kernelConstraint:B(this.kernelConstraint),recurrentConstraint:B(this.recurrentConstraint),biasConstraint:B(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="LSTMCell",t}(Si);r.serialization.registerClass(Ai);var Ti=function(e){function t(t){return 0===t.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),t.cell=new Ai(t),e.call(this,t)||this}return o(t,e),t.prototype.call=function(t,n){var i=this;return Object(r.tidy)(function(){null!=i.cell.dropoutMask&&(Object(r.dispose)(i.cell.dropoutMask),i.cell.dropoutMask=null),null!=i.cell.recurrentDropoutMask&&(Object(r.dispose)(i.cell.recurrentDropoutMask),i.cell.recurrentDropoutMask=null);var o=null==n?null:n.mask,a=null==n?null:n.training,s=null==n?null:n.initialState;return e.prototype.call.call(i,t,{mask:o,training:a,initialState:s})})},Object.defineProperty(t.prototype,"units",{get:function(){return this.cell.units},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activation",{get:function(){return this.cell.activation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentActivation",{get:function(){return this.cell.recurrentActivation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useBias",{get:function(){return this.cell.useBias},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"kernelInitializer",{get:function(){return this.cell.kernelInitializer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentInitializer",{get:function(){return this.cell.recurrentInitializer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"biasInitializer",{get:function(){return this.cell.biasInitializer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"unitForgetBias",{get:function(){return this.cell.unitForgetBias},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"kernelRegularizer",{get:function(){return this.cell.kernelRegularizer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentRegularizer",{get:function(){return this.cell.recurrentRegularizer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"biasRegularizer",{get:function(){return this.cell.biasRegularizer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"kernelConstraint",{get:function(){return this.cell.kernelConstraint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentConstraint",{get:function(){return this.cell.recurrentConstraint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"biasConstraint",{get:function(){return this.cell.biasConstraint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropout",{get:function(){return this.cell.dropout},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"recurrentDropout",{get:function(){return this.cell.recurrentDropout},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"implementation",{get:function(){return this.cell.implementation},enumerable:!0,configurable:!0}),t.prototype.getConfig=function(){var t={units:this.units,activation:sr(this.activation),recurrentActivation:sr(this.recurrentActivation),useBias:this.useBias,kernelInitializer:He(this.kernelInitializer),recurrentInitializer:He(this.recurrentInitializer),biasInitializer:He(this.biasInitializer),unitForgetBias:this.unitForgetBias,kernelRegularizer:dr(this.kernelRegularizer),recurrentRegularizer:dr(this.recurrentRegularizer),biasRegularizer:dr(this.biasRegularizer),activityRegularizer:dr(this.activityRegularizer),kernelConstraint:B(this.kernelConstraint),recurrentConstraint:B(this.recurrentConstraint),biasConstraint:B(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation},n=e.prototype.getConfig.call(this);return delete n.cell,Object.assign(t,n),t},t.fromConfig=function(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)},t.className="LSTM",t}(ki);r.serialization.registerClass(Ti);var Ii=function(e){function t(t){var n=e.call(this,t)||this;return n.cells=t.cells,n}return o(t,e),Object.defineProperty(t.prototype,"stateSize",{get:function(){for(var e=[],t=0,n=this.cells.slice().reverse();t<n.length;t++){var r=n[t];Array.isArray(r.stateSize)?e.push.apply(e,r.stateSize):e.push(r.stateSize)}return e},enumerable:!0,configurable:!0}),t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){for(var r=(e=e).slice(1),i=[],o=0,a=n.cells.slice().reverse();o<a.length;o++){var s=a[o];Array.isArray(s.stateSize)?i.push(r.splice(0,s.stateSize.length)):i.push(r.splice(0,1))}i.reverse();for(var u,c=[],l=0;l<n.cells.length;++l)s=n.cells[l],r=i[l],u=0===l?[e[0]].concat(r):[u[0]].concat(r),u=s.call(u,t),c.push(u.slice(1));r=[];for(var f=0,h=c.slice().reverse();f<h.length;f++){var d=h[f];r.push.apply(r,d)}return[u[0]].concat(r)})},t.prototype.build=function(e){var t;Ze(e)&&(e=e[0]),e=e;for(var n=0,r=this.cells;n<r.length;n++){var i=r[n];i.build(e),t=Array.isArray(i.stateSize)?i.stateSize[0]:i.stateSize,e=[e[0],t]}this.built=!0},t.prototype.getConfig=function(){for(var t=[],n=0,r=this.cells;n<r.length;n++){var i=r[n];t.push({className:i.getClassName(),config:i.getConfig()})}var o={cells:t},a=e.prototype.getConfig.call(this);return Object.assign(o,a),o},t.fromConfig=function(e,t,n){void 0===n&&(n={});for(var r=[],i=0,o=t.cells;i<o.length;i++){var a=o[i];r.push(fn(a,n))}return new e({cells:r})},Object.defineProperty(t.prototype,"trainableWeights",{get:function(){if(!this.trainable)return[];for(var e=[],t=0,n=this.cells;t<n.length;t++){var r=n[t];e.push.apply(e,r.trainableWeights)}return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){for(var e=[],t=0,n=this.cells;t<n.length;t++){var r=n[t];e.push.apply(e,r.nonTrainableWeights)}if(!this.trainable){for(var i=[],o=0,a=this.cells;o<a.length;o++)r=a[o],i.push.apply(i,r.trainableWeights);return i.concat(e)}return e},enumerable:!0,configurable:!0}),t.prototype.getWeights=function(){for(var e=[],t=0,n=this.cells;t<n.length;t++){var r=n[t];e.push.apply(e,r.weights)}return ot(e)},t.prototype.setWeights=function(e){for(var t=[],n=0,r=this.cells;n<r.length;n++)for(var i=r[n],o=i.weights.length,a=e.splice(o),s=0;s<i.weights.length;++s)t.push([i.weights[s],a[s]]);at(t)},t.className="StackedRNNCells",t}(Si);function Ri(e,t,n,i){function o(){return ke(e(),t)}if(void 0===n&&(n=null),void 0===i&&(i=1),i>1){for(var a=[],s=0;s<i;s++)a.push(Se(o,e,n));return a.map(function(e){return Object(r.keep)(e.clone())})}return Object(r.keep)(Se(o,e,n).clone())}r.serialization.registerClass(Ii);var Mi=function(e){function t(t){var n=e.call(this,t)||this;return n.layer=t.layer,n}return o(t,e),t.prototype.build=function(e){this.built=!0},Object.defineProperty(t.prototype,"trainable",{get:function(){return null!=this.layer&&this.layer.trainable},set:function(e){null!=this.layer&&(this.layer.trainable=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.layer.trainableWeights},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.layer.nonTrainableWeights},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updates",{get:function(){return this.layer._updates},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"losses",{get:function(){return this.layer.losses},enumerable:!0,configurable:!0}),t.prototype.getWeights=function(){return this.layer.getWeights()},t.prototype.setWeights=function(e){this.layer.setWeights(e)},t.prototype.getConfig=function(){var t={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.prototype.setFastWeightInitDuringBuild=function(t){e.prototype.setFastWeightInitDuringBuild.call(this,t),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(t)},t.fromConfig=function(e,t,n){void 0===n&&(n={});var r=fn(t.layer,n);delete t.layer;var i={layer:r};return Object.assign(i,t),new e(i)},t}(ht),Di=function(e){function t(t){var n=e.call(this,t)||this;return n.supportsMasking=!0,n}return o(t,e),t.prototype.build=function(t){if((t=tt(t)).length<3)throw new d("TimeDistributed layer expects an input shape >= 3D, but received input shape "+JSON.stringify(t));this.inputSpec=[{shape:t}];var n=[t[0]].concat(t.slice(2));this.layer.built||(this.layer.build(n),this.layer.built=!0),e.prototype.build.call(this,t)},t.prototype.computeOutputShape=function(e){var t=[(e=tt(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){return _i(function(e,r){return[et(n.layer.call(e,t)),[]]},e=et(e),[],!1,null,null,!1,!0)[1]})},t.className="TimeDistributed",t}(Mi);r.serialization.registerClass(Di);var ji="concat",Pi=function(e){function t(t){var n=e.call(this,t)||this,r=t.layer.getConfig(),i={};i.className=t.layer.getClassName(),i.config=r,n.forwardLayer=fn(i),r.goBackwards=!0!==r.goBackwards;var o={};if(o.className=t.layer.getClassName(),o.config=r,n.backwardLayer=fn(o),n.forwardLayer.name="forward_"+n.forwardLayer.name,n.backwardLayer.name="backward_"+n.backwardLayer.name,n.mergeMode=void 0===t.mergeMode?ji:t.mergeMode,function(e){A(G,"BidirectionalMergeMode",e)}(n.mergeMode),t.weights)throw new p("weights support is not implemented for Bidirectional layer yet.");return n._stateful=t.layer.stateful,n.returnSequences=t.layer.returnSequences,n.returnState=t.layer.returnState,n.supportsMasking=!0,n._trainable=!0,n.inputSpec=t.layer.inputSpec,n.numConstants=null,n}return o(t,e),Object.defineProperty(t.prototype,"trainable",{get:function(){return this._trainable},set:function(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)},enumerable:!0,configurable:!0}),t.prototype.getWeights=function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())},t.prototype.setWeights=function(e){var t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))},t.prototype.computeOutputShape=function(e){var t,n,r,i=this.forwardLayer.computeOutputShape(e);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(r=i.slice(1),t=i[0]):t=i[0],t=t,"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[t].concat(r).concat(r.slice()):b(n)},t.prototype.apply=function(t,n){var r=null==n?null:n.initialState,i=null==n?null:n.constants;null==n&&(n={});var o=xi(t,r,i,this.numConstants);if(t=o.inputs,r=o.initialState,i=o.constants,Array.isArray(t)&&(r=t.slice(1),t=t[0]),(null==r||0===r.length)&&null==i)return e.prototype.apply.call(this,t,n);var a=[],s=[];if(null!=r){var u=r.length;if(u%2>0)throw new d("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");n.initialState=r,a.push.apply(a,r);var c=r.map(function(e){return new st({shape:e.shape})});this.forwardLayer.stateSpec=c.slice(0,u/2),this.backwardLayer.stateSpec=c.slice(u/2),s.push.apply(s,c)}if(null!=i)throw new p("Support for constants in Bidirectional layers is not implemented yet.");for(var l=a[0]instanceof ut,f=0,h=a;f<h.length;f++)if(h[f]instanceof ut!==l)throw new d("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(l){var m=[t].concat(a),v=this.inputSpec.concat(s),g=this.inputSpec;this.inputSpec=v;var y=e.prototype.apply.call(this,m,n);return this.inputSpec=g,y}return e.prototype.apply.call(this,t,n)},t.prototype.call=function(e,t){var n=this;return Object(r.tidy)(function(){if(null!=t.mask)throw new p("The support for masking is not implemented for Bidirectional layers yet.");var i,o,a,s,u=t.initialState;if(null==u)i=n.forwardLayer.call(e,t),o=n.backwardLayer.call(e,t);else{var c=u.slice(0,u.length/2),l=u.slice(u.length/2);i=n.forwardLayer.call(e,Object.assign(t,{initialState:c})),o=n.backwardLayer.call(e,Object.assign(t,{initialState:l}))}return n.returnState&&(Array.isArray(i)&&(a=i.slice(1).concat(o.slice(1))),i=i[0],o=o[0]),n.returnSequences&&(o=Object(r.reverse)(o,1)),"concat"===n.mergeMode?s=pe([i,o]):"sum"===n.mergeMode?s=Object(r.add)(i,o):"ave"===n.mergeMode?s=Object(r.mul)(.5,Object(r.add)(i,o)):"mul"===n.mergeMode?s=Object(r.mul)(i,o):null==n.mergeMode&&(s=[i,o]),n.returnState?null==n.mergeMode?s.concat(a):[s].concat(a):s})},t.prototype.resetStates=function(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()},t.prototype.build=function(e){var t=this;Z(this.forwardLayer.name,function(){t.forwardLayer.build(e)}),Z(this.backwardLayer.name,function(){t.backwardLayer.build(e)}),this.built=!0},Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)},enumerable:!0,configurable:!0}),t.prototype.setFastWeightInitDuringBuild=function(t){e.prototype.setFastWeightInitDuringBuild.call(this,t),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(t),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(t)},t.prototype.getConfig=function(){var t={mergeMode:this.mergeMode},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.fromConfig=function(e,t){var n=fn(t.layer);if(delete t.layer,null!=t.numConstants)throw new p("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");var r=t;return r.layer=n,new e(r)},t.className="Bidirectional",t}(Mi);function zi(e){return new fi(e)}function Li(e){return new pi(e)}function Bi(e){return new gi(e)}function Fi(e){return new wi(e)}function Ui(e){return new li(e)}function Wi(e){return new di(e)}r.serialization.registerClass(Pi);var Vi=Bi,qi=Fi,Hi=Ui,Gi=Wi;var Ki=Object.freeze({inputLayer:function(e){return new mt(e)},elu:function(e){return new br(e)},reLU:function(e){return new vr(e)},leakyReLU:function(e){return new gr(e)},prelu:function(e){return new yr(e)},softmax:function(e){return new xr(e)},thresholdedReLU:function(e){return new wr(e)},conv1d:function(e){return new Mr(e)},conv2d:function(e){return new Ar(e)},conv2dTranspose:function(e){return new Ir(e)},conv3d:function(e){return new Tr(e)},separableConv2d:function(e){return new Rr(e)},cropping2D:function(e){return new Dr(e)},upSampling2d:function(e){return new jr(e)},depthwiseConv2d:function(e){return new Pr(e)},activation:function(e){return new Fr(e)},dense:function(e){return new Lr(e)},dropout:function(e){return new zr(e)},flatten:function(e){return new Br(e)},repeatVector:function(e){return new Ur(e)},reshape:function(e){return new Wr(e)},permute:function(e){return new Vr(e)},embedding:function(e){return new Hr(e)},add:function(e){return new Kr(e)},average:function(e){return new Xr(e)}
1,concatenate:function(e){return new Zr(e)},maximum:function(e){return new Yr(e)},minimum:function(e){return new Jr(e)},multiply:function(e){return new $r(e)},dot:function(e){return new ei(e)},batchNormalization:function(e){return new ai(e)},zeroPadding2d:function(e){return new si(e)},averagePooling1d:zi,avgPool1d:function(e){return zi(e)},avgPooling1d:function(e){return zi(e)},averagePooling2d:Li,avgPool2d:function(e){return Li(e)},avgPooling2d:function(e){return Li(e)},globalAveragePooling1d:function(e){return new vi(e)},globalAveragePooling2d:function(e){return new bi(e)},globalMaxPooling1d:Bi,globalMaxPooling2d:Fi,maxPooling1d:Ui,maxPooling2d:Wi,gru:function(e){return new Oi(e)},gruCell:function(e){return new Ni(e)},lstm:function(e){return new Ti(e)},lstmCell:function(e){return new Ai(e)},simpleRNN:function(e){return new Ci(e)},simpleRNNCell:function(e){return new Ei(e)},rnn:function(e){return new ki(e)},stackedRNNCells:function(e){return new Ii(e)},bidirectional:function(e){return new Pi(e)},timeDistributed:function(e){return new Di(e)},globalMaxPool1d:Vi,globalMaxPool2d:qi,maxPool1d:Hi,maxPool2d:Gi,Layer:ht,RNN:ki,RNNCell:Si,input:Gn,gaussianNoise:function(e){return new ti(e)},gaussianDropout:function(e){return new ni(e)},alphaDropout:function(e){return new ri(e)},masking:function(e){return new qr(e)}});var $i=Object.freeze({binaryAccuracy:function(e,t){return qt(e,t)},binaryCrossentropy:function(e,t){return Xt(e,t)},sparseCategoricalAccuracy:function(e,t){return Yt(e,t)},categoricalAccuracy:function(e,t){return Ht(e,t)},categoricalCrossentropy:function(e,t){return rn(e,t)},precision:function(e,t){return Kt(e,t)},recall:function(e,t){return $t(e,t)},cosineProximity:function(e,t){return Wt(e,t)},meanAbsoluteError:function(e,t){return Tt(e,t)},meanAbsolutePercentageError:function(e,t){return It(e,t)},MAPE:function(e,t){return It(e,t)},mape:function(e,t){return It(e,t)},meanSquaredError:function(e,t){return At(e,t)},MSE:function(e,t){return At(e,t)},mse:function(e,t){return At(e,t)}}),Xi=Object.freeze({modelFromJSON:function(e,t){return u(this,void 0,void 0,function(){var n,i,o,a,s,u,l,f;return c(this,function(c){switch(c.label){case 0:return"modelTopology"in e||(e={modelTopology:e}),null!=(n=(e=e).modelTopology).model_config&&(n=n.model_config),i=dn(n),o=fn(i,t),null==e.weightsManifest?[3,2]:[4,r.io.loadWeights(e.weightsManifest,e.pathPrefix,o.weights.map(function(e){return e.originalName}))];case 1:for(a=c.sent(),s={},u=0,l=o.weights;u<l.length;u++)f=l[u],s[f.originalName]=a[f.originalName];o.loadWeights(s),Object(r.dispose)(a),c.label=2;case 2:return[2,o]}})})}});var Yi=Object.freeze({l1l2:function(e){return new fr(e)},l1:function(e){return function(e){return new fr({l1:null!=e?e.l1:null,l2:0})}(e)},l2:function(e){return function(e){return new fr({l2:null!=e?e.l2:null,l1:0})}(e)}}),Ji=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.model=null,t}return o(t,e),t.prototype.setModel=function(e){if(!(e instanceof Fn))throw new Error("model must be a LayersModel, not some other Container");this.model=e},t}(wt);function Zi(e,t){return e<t}function Qi(e,t){return e>t}var eo=function(e){function t(t){var n=e.call(this)||this;if(null==t&&(t={}),t.restoreBestWeights)throw new p("restoreBestWeights = True is not implemented in EarlyStopping yet.");return n.monitor=t.monitor||"val_loss",n.minDelta=Math.abs(t.minDelta||0),n.patience=t.patience||0,n.verbose=t.verbose||0,n.mode=t.mode||"auto",n.baseline=t.baseline,-1===["auto","min","max"].indexOf(n.mode)&&(console.warn("EarlyStopping mode '"+n.mode+"' is invalid. Falling back to mode 'auto'."),n.mode="auto"),"min"===n.mode?n.monitorFunc=Zi:"max"===n.mode?n.monitorFunc=Qi:-1!==n.monitor.indexOf("acc")?n.monitorFunc=Qi:n.monitorFunc=Zi,n.monitorFunc===Zi&&(n.minDelta*=-1),n}return o(t,e),t.prototype.onTrainBegin=function(e){return u(this,void 0,void 0,function(){return c(this,function(e){return this.wait=0,this.stoppedEpoch=0,null!=this.baseline?this.best=this.baseline:this.best=this.monitorFunc===Zi?1/0:-1/0,[2]})})},t.prototype.onEpochEnd=function(e,t){return u(this,void 0,void 0,function(){var n;return c(this,function(r){switch(r.label){case 0:return[4,gt(t)];case 1:return r.sent(),null==(n=this.getMonitorValue(t))?[2]:(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)),[2])}})})},t.prototype.onTrainEnd=function(e){return u(this,void 0,void 0,function(){return c(this,function(e){return this.stoppedEpoch>0&&this.verbose&&console.log("Epoch "+this.stoppedEpoch+": early stopping."),[2]})})},t.prototype.getMonitorValue=function(e){null==e&&(e={});var t=e[this.monitor];return null==t&&console.warn("Metric for EarlyStopping "+this.monitor+" is not available. Available metrics are: "+Object.keys(e)),t},t}(Ji);var to={earlyStopping:function(e){return new eo(e)}},no=n(38),ro=n(55);n.d(t,"version",function(){return io}),n.d(t,"AdadeltaOptimizer",function(){return r.AdadeltaOptimizer}),n.d(t,"AdagradOptimizer",function(){return r.AdagradOptimizer}),n.d(t,"AdamOptimizer",function(){return r.AdamOptimizer}),n.d(t,"AdamaxOptimizer",function(){return r.AdamaxOptimizer}),n.d(t,"DataStorage",function(){return r.DataStorage}),n.d(t,"ENV",function(){return r.ENV}),n.d(t,"Environment",function(){return r.Environment}),n.d(t,"KernelBackend",function(){return r.KernelBackend}),n.d(t,"MomentumOptimizer",function(){return r.MomentumOptimizer}),n.d(t,"Optimizer",function(){return r.Optimizer}),n.d(t,"RMSPropOptimizer",function(){return r.RMSPropOptimizer}),n.d(t,"Rank",function(){return r.Rank}),n.d(t,"Reduction",function(){return r.Reduction}),n.d(t,"SGDOptimizer",function(){return r.SGDOptimizer}),n.d(t,"Tensor",function(){return r.Tensor}),n.d(t,"TensorBuffer",function(){return r.TensorBuffer}),n.d(t,"Variable",function(){return r.Variable}),n.d(t,"abs",function(){return r.abs}),n.d(t,"acos",function(){return r.acos}),n.d(t,"acosh",function(){return r.acosh}),n.d(t,"add",function(){return r.add}),n.d(t,"addN",function(){return r.addN}),n.d(t,"addStrict",function(){return r.addStrict}),n.d(t,"all",function(){return r.all}),n.d(t,"any",function(){return r.any}),n.d(t,"argMax",function(){return r.argMax}),n.d(t,"argMin",function(){return r.argMin}),n.d(t,"asin",function(){return r.asin}),n.d(t,"asinh",function(){return r.asinh}),n.d(t,"atan",function(){return r.atan}),n.d(t,"atan2",function(){return r.atan2}),n.d(t,"atanh",function(){return r.atanh}),n.d(t,"avgPool",function(){return r.avgPool}),n.d(t,"backend",function(){return r.backend}),n.d(t,"backend_util",function(){return r.backend_util}),n.d(t,"basicLSTMCell",function(){return r.basicLSTMCell}),n.d(t,"batchNorm",function(){return r.batchNorm}),n.d(t,"batchNorm2d",function(){return r.batchNorm2d}),n.d(t,"batchNorm3d",function(){return r.batchNorm3d}),n.d(t,"batchNorm4d",function(){return r.batchNorm4d}),n.d(t,"batchNormalization",function(){return r.batchNormalization}),n.d(t,"batchNormalization2d",function(){return r.batchNormalization2d}),n.d(t,"batchNormalization3d",function(){return r.batchNormalization3d}),n.d(t,"batchNormalization4d",function(){return r.batchNormalization4d}),n.d(t,"batchToSpaceND",function(){return r.batchToSpaceND}),n.d(t,"browser",function(){return r.browser}),n.d(t,"buffer",function(){return r.buffer}),n.d(t,"cast",function(){return r.cast}),n.d(t,"ceil",function(){return r.ceil}),n.d(t,"clipByValue",function(){return r.clipByValue}),n.d(t,"clone",function(){return r.clone}),n.d(t,"complex",function(){return r.complex}),n.d(t,"concat",function(){return r.concat}),n.d(t,"concat1d",function(){return r.concat1d}),n.d(t,"concat2d",function(){return r.concat2d}),n.d(t,"concat3d",function(){return r.concat3d}),n.d(t,"concat4d",function(){return r.concat4d}),n.d(t,"conv1d",function(){return r.conv1d}),n.d(t,"conv2d",function(){return r.conv2d}),n.d(t,"conv2dDerFilter",function(){return r.conv2dDerFilter}),n.d(t,"conv2dTranspose",function(){return r.conv2dTranspose}),n.d(t,"conv3d",function(){return r.conv3d}),n.d(t,"cos",function(){return r.cos}),n.d(t,"cosh",function(){return r.cosh}),n.d(t,"cumsum",function(){return r.cumsum}),n.d(t,"customGrad",function(){return r.customGrad}),n.d(t,"deprecationWarn",function(){return r.deprecationWarn}),n.d(t,"depthToSpace",function(){return r.depthToSpace}),n.d(t,"depthwiseConv2d",function(){return r.depthwiseConv2d}),n.d(t,"disableDeprecationWarnings",function(){return r.disableDeprecationWarnings}),n.d(t,"dispose",function(){return r.dispose}),n.d(t,"disposeVariables",function(){return r.disposeVariables}),n.d(t,"div",function(){return r.div}),n.d(t,"divStrict",function(){return r.divStrict}),n.d(t,"dot",function(){return r.dot}),n.d(t,"dropout",function(){return r.dropout}),n.d(t,"elu",function(){return r.elu}),n.d(t,"enableDebugMode",function(){return r.enableDebugMode}),n.d(t,"enableProdMode",function(){return r.enableProdMode}),n.d(t,"environment",function(){return r.environment}),n.d(t,"equal",function(){return r.equal}),n.d(t,"equalStrict",function(){return r.equalStrict}),n.d(t,"erf",function(){return r.erf}),n.d(t,"exp",function(){return r.exp}),n.d(t,"expandDims",function(){return r.expandDims}),n.d(t,"expm1",function(){return r.expm1}),n.d(t,"eye",function(){return r.eye}),n.d(t,"fft",function(){return r.fft}),n.d(t,"fill",function(){return r.fill}),n.d(t,"findBackend",function(){return r.findBackend}),n.d(t,"findBackendFactory",function(){return r.findBackendFactory}),n.d(t,"floor",function(){return r.floor}),n.d(t,"floorDiv",function(){return r.floorDiv}),n.d(t,"frame",function(){return r.frame}),n.d(t,"fused",function(){return r.fused}),n.d(t,"gather",function(){return r.gather}),n.d(t,"gatherND",function(){return r.gatherND}),n.d(t,"getBackend",function(){return r.getBackend}),n.d(t,"grad",function(){return r.grad}),n.d(t,"grads",function(){return r.grads}),n.d(t,"greater",function(){return r.greater}),n.d(t,"greaterEqual",function(){return r.greaterEqual}),n.d(t,"greaterEqualStrict",function(){return r.greaterEqualStrict}),n.d(t,"greaterStrict",function(){return r.greaterStrict}),n.d(t,"hammingWindow",function(){return r.hammingWindow}),n.d(t,"hannWindow",function(){return r.hannWindow}),n.d(t,"ifft",function(){return r.ifft}),n.d(t,"imag",function(){return r.imag}),n.d(t,"image",function(){return r.image}),n.d(t,"io",function(){return r.io}),n.d(t,"irfft",function(){return r.irfft}
1),n.d(t,"isFinite",function(){return r.isFinite}),n.d(t,"isInf",function(){return r.isInf}),n.d(t,"isNaN",function(){return r.isNaN}),n.d(t,"keep",function(){return r.keep}),n.d(t,"leakyRelu",function(){return r.leakyRelu}),n.d(t,"less",function(){return r.less}),n.d(t,"lessEqual",function(){return r.lessEqual}),n.d(t,"lessEqualStrict",function(){return r.lessEqualStrict}),n.d(t,"lessStrict",function(){return r.lessStrict}),n.d(t,"linalg",function(){return r.linalg}),n.d(t,"linspace",function(){return r.linspace}),n.d(t,"localResponseNormalization",function(){return r.localResponseNormalization}),n.d(t,"log",function(){return r.log}),n.d(t,"log1p",function(){return r.log1p}),n.d(t,"logSigmoid",function(){return r.logSigmoid}),n.d(t,"logSoftmax",function(){return r.logSoftmax}),n.d(t,"logSumExp",function(){return r.logSumExp}),n.d(t,"logicalAnd",function(){return r.logicalAnd}),n.d(t,"logicalNot",function(){return r.logicalNot}),n.d(t,"logicalOr",function(){return r.logicalOr}),n.d(t,"logicalXor",function(){return r.logicalXor}),n.d(t,"losses",function(){return r.losses}),n.d(t,"matMul",function(){return r.matMul}),n.d(t,"math",function(){return r.math}),n.d(t,"max",function(){return r.max}),n.d(t,"maxPool",function(){return r.maxPool}),n.d(t,"maximum",function(){return r.maximum}),n.d(t,"maximumStrict",function(){return r.maximumStrict}),n.d(t,"mean",function(){return r.mean}),n.d(t,"memory",function(){return r.memory}),n.d(t,"min",function(){return r.min}),n.d(t,"minimum",function(){return r.minimum}),n.d(t,"minimumStrict",function(){return r.minimumStrict}),n.d(t,"mod",function(){return r.mod}),n.d(t,"modStrict",function(){return r.modStrict}),n.d(t,"moments",function(){return r.moments}),n.d(t,"movingAverage",function(){return r.movingAverage}),n.d(t,"mul",function(){return r.mul}),n.d(t,"mulStrict",function(){return r.mulStrict}),n.d(t,"multiRNNCell",function(){return r.multiRNNCell}),n.d(t,"multinomial",function(){return r.multinomial}),n.d(t,"neg",function(){return r.neg}),n.d(t,"nextFrame",function(){return r.nextFrame}),n.d(t,"norm",function(){return r.norm}),n.d(t,"notEqual",function(){return r.notEqual}),n.d(t,"notEqualStrict",function(){return r.notEqualStrict}),n.d(t,"oneHot",function(){return r.oneHot}),n.d(t,"ones",function(){return r.ones}),n.d(t,"onesLike",function(){return r.onesLike}),n.d(t,"op",function(){return r.op}),n.d(t,"outerProduct",function(){return r.outerProduct}),n.d(t,"pad",function(){return r.pad}),n.d(t,"pad1d",function(){return r.pad1d}),n.d(t,"pad2d",function(){return r.pad2d}),n.d(t,"pad3d",function(){return r.pad3d}),n.d(t,"pad4d",function(){return r.pad4d}),n.d(t,"pool",function(){return r.pool}),n.d(t,"pow",function(){return r.pow}),n.d(t,"powStrict",function(){return r.powStrict}),n.d(t,"prelu",function(){return r.prelu}),n.d(t,"print",function(){return r.print}),n.d(t,"prod",function(){return r.prod}),n.d(t,"profile",function(){return r.profile}),n.d(t,"rand",function(){return r.rand}),n.d(t,"randomNormal",function(){return r.randomNormal}),n.d(t,"randomUniform",function(){return r.randomUniform}),n.d(t,"range",function(){return r.range}),n.d(t,"ready",function(){return r.ready}),n.d(t,"real",function(){return r.real}),n.d(t,"reciprocal",function(){return r.reciprocal}),n.d(t,"registerBackend",function(){return r.registerBackend}),n.d(t,"relu",function(){return r.relu}),n.d(t,"removeBackend",function(){return r.removeBackend}),n.d(t,"reshape",function(){return r.reshape}),n.d(t,"reverse",function(){return r.reverse}),n.d(t,"reverse1d",function(){return r.reverse1d}),n.d(t,"reverse2d",function(){return r.reverse2d}),n.d(t,"reverse3d",function(){return r.reverse3d}),n.d(t,"reverse4d",function(){return r.reverse4d}),n.d(t,"rfft",function(){return r.rfft}),n.d(t,"round",function(){return r.round}),n.d(t,"rsqrt",function(){return r.rsqrt}),n.d(t,"scalar",function(){return r.scalar}),n.d(t,"scatterND",function(){return r.scatterND}),n.d(t,"selu",function(){return r.selu}),n.d(t,"separableConv2d",function(){return r.separableConv2d}),n.d(t,"serialization",function(){return r.serialization}),n.d(t,"setBackend",function(){return r.setBackend}),n.d(t,"setPlatform",function(){return r.setPlatform}),n.d(t,"setdiff1dAsync",function(){return r.setdiff1dAsync}),n.d(t,"sigmoid",function(){return r.sigmoid}),n.d(t,"sign",function(){return r.sign}),n.d(t,"signal",function(){return r.signal}),n.d(t,"sin",function(){return r.sin}),n.d(t,"sinh",function(){return r.sinh}),n.d(t,"slice",function(){return r.slice}),n.d(t,"slice1d",function(){return r.slice1d}),n.d(t,"slice2d",function(){return r.slice2d}),n.d(t,"slice3d",function(){return r.slice3d}),n.d(t,"slice4d",function(){return r.slice4d}),n.d(t,"softmax",function(){return r.softmax}),n.d(t,"softplus",function(){return r.softplus}),n.d(t,"spaceToBatchND",function(){return r.spaceToBatchND}),n.d(t,"sparseToDense",function(){return r.sparseToDense}),n.d(t,"spectral",function(){return r.spectral}),n.d(t,"split",function(){return r.split}),n.d(t,"sqrt",function(){return r.sqrt}),n.d(t,"square",function(){return r.square}),n.d(t,"squaredDifference",function(){return r.squaredDifference}),n.d(t,"squaredDifferenceStrict",function(){return r.squaredDifferenceStrict}),n.d(t,"squeeze",function(){return r.squeeze}),n.d(t,"stack",function(){return r.stack}),n.d(t,"step",function(){return r.step}),n.d(t,"stridedSlice",function(){return r.stridedSlice}),n.d(t,"sub",function(){return r.sub}),n.d(t,"subStrict",function(){return r.subStrict}),n.d(t,"sum",function(){return r.sum}),n.d(t,"tan",function(){return r.tan}),n.d(t,"tanh",function(){return r.tanh}),n.d(t,"tensor",function(){return r.tensor}),n.d(t,"tensor1d",function(){return r.tensor1d}),n.d(t,"tensor2d",function(){return r.tensor2d}),n.d(t,"tensor3d",function(){return r.tensor3d}),n.d(t,"tensor4d",function(){return r.tensor4d}),n.d(t,"tensor5d",function(){return r.tensor5d}),n.d(t,"tensor6d",function(){return r.tensor6d}),n.d(t,"tensor_util",function(){return r.tensor_util}),n.d(t,"test_util",function(){return r.test_util}),n.d(t,"tidy",function(){return r.tidy}),n.d(t,"tile",function(){return r.tile}),n.d(t,"time",function(){return r.time}),n.d(t,"topk",function(){return r.topk}),n.d(t,"train",function(){return r.train}),n.d(t,"transpose",function(){return r.transpose}),n.d(t,"truncatedNormal",function(){return r.truncatedNormal}),n.d(t,"unsortedSegmentSum",function(){return r.unsortedSegmentSum}),n.d(t,"unstack",function(){return r.unstack}),n.d(t,"util",function(){return r.util}),n.d(t,"valueAndGrad",function(){return r.valueAndGrad}),n.d(t,"valueAndGrads",function(){return r.valueAndGrads}),n.d(t,"variable",function(){return r.variable}),n.d(t,"variableGrads",function(){return r.variableGrads}),n.d(t,"version_core",function(){return r.version_core}),n.d(t,"webgl",function(){return r.webgl}),n.d(t,"where",function(){return r.where}),n.d(t,"whereAsync",function(){return r.whereAsync}),n.d(t,"zeros",function(){return r.zeros}),n.d(t,"zerosLike",function(){return r.zerosLike}),n.d(t,"constraints",function(){return W}
1),n.d(t,"initializers",function(){return Ke}),n.d(t,"layers",function(){return Ki}),n.d(t,"metrics",function(){return $i}),n.d(t,"models",function(){return Xi}),n.d(t,"regularizers",function(){return Yi}),n.d(t,"CallbackList",function(){return xt}),n.d(t,"CustomCallback",function(){return St}),n.d(t,"History",function(){return kt}),n.d(t,"Callback",function(){return Ji}),n.d(t,"callbacks",function(){return to}),n.d(t,"EarlyStopping",function(){return eo}),n.d(t,"InputSpec",function(){return st}),n.d(t,"SymbolicTensor",function(){return ut}),n.d(t,"LayersModel",function(){return Fn}),n.d(t,"input",function(){return Gn}),n.d(t,"loadLayersModel",function(){return Hn}),n.d(t,"model",function(){return Vn}),n.d(t,"registerCallbackConstructor",function(){return Kn}),n.d(t,"sequential",function(){return qn}),n.d(t,"RNN",function(){return ki}),n.d(t,"Sequential",function(){return Wn}),n.d(t,"LayerVariable",function(){return it}),n.d(t,"version_layers",function(){return"1.2.1"}),n.d(t,"GraphModel",function(){return no.a}),n.d(t,"loadGraphModel",function(){return no.c}),n.d(t,"deregisterOp",function(){return no.b}),n.d(t,"registerOp",function(){return no.d}),n.d(t,"version_converter",function(){return no.e}),n.d(t,"data",function(){return ro});var io={"tfjs-core":r.version_core,"tfjs-data":ro.version_data,"tfjs-layers":"1.2.1","tfjs-converter":no.e,tfjs:"1.2.1"}},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var a=i.apply(null,r);a&&e.push(a)}else if("object"===o)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",function(){return r})},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a=n(181).Buffer}catch(S){}function s(e,t,n){for(var r=0,i=Math.min(e.length,n),o=t;o<i;o++){var a=e.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function u(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=r,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>
vendor: 4,319 bytes, line 1
126-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,i,o=0;for(n=e.length-6,r=0;n>=t;n-=6)i=s(e,n,n+6),this.words[r]|=i<<o&67108863,this.words[r+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==t&&(i=s(e,t,n+6),this.words[r]|=i<<o&67108863,this.words[r+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l<s;l+=r)c=u(e,l,l+r,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var f=1;for(c=u(e,l,e.length,t),l=0;l<a;l++)f*=t;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);n=0!==(o=s>>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],d=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:c[h-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r("undefined"!==typeof a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();
vendor: 4,173 bytes, line 1
1s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-i;s++)c[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[o-s-1]=a}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return r(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return r(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return r(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;
vendor: 6,390 bytes, line 1
1var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,n){var r,i,o,a=e.words,s=t.words,u=n.words,c=0,l=0|a[0],f=8191&l,h=l>>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],g=8191&v,y=v>>>13,b=0|a[3],w=8191&b,x=b>>>13,_=0|a[4],k=8191&_,S=_>>>13,E=0|a[5],C=8191&E,N=E>>>13,O=0|a[6],A=8191&O,T=O>>>13,I=0|a[7],R=8191&I,M=I>>>13,D=0|a[8],j=8191&D,P=D>>>13,z=0|a[9],L=8191&z,B=z>>>13,F=0|s[0],U=8191&F,W=F>>>13,V=0|s[1],q=8191&V,H=V>>>13,G=0|s[2],K=8191&G,$=G>>>13,X=0|s[3],Y=8191&X,J=X>>>13,Z=0|s[4],Q=8191&Z,ee=Z>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ve=(c+(r=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,W))+Math.imul(h,U)|0))<<13)|0;c=((o=Math.imul(h,W))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,W))+Math.imul(m,U)|0,o=Math.imul(m,W);var ge=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,H)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,U),i=(i=Math.imul(g,W))+Math.imul(y,U)|0,o=Math.imul(y,W),r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,H)|0;var ye=(c+(r=r+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,U),i=(i=Math.imul(w,W))+Math.imul(x,U)|0,o=Math.imul(x,W),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,H)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,H)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,$)|0;var be=(c+(r=r+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,J)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(k,U),i=(i=Math.imul(k,W))+Math.imul(S,U)|0,o=Math.imul(S,W),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,H)|0,r=r+Math.imul(g,K)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,$)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var we=(c+(r=r+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(C,U),i=(i=Math.imul(C,W))+Math.imul(N,U)|0,o=Math.imul(N,W),r=r+Math.imul(k,q)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,H)|0,r=r+Math.imul(w,K)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,$)|0,r=r+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,J)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(A,U),i=(i=Math.imul(A,W))+Math.imul(T,U)|0,o=Math.imul(T,W),r=r+Math.imul(C,q)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,H)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,r=r+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var _e=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,W))+Math.imul(M,U)|0,o=Math.imul(M,W),r=r+Math.imul(A,q)|0,i=(i=i+Math.imul(A,H)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,H)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,$)|0,r=r+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var ke=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,U),i=(i=Math.imul(j,W))+Math.imul(P,U)|0,o=Math.imul(P,W),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,H)|0,r=r+Math.imul(A,K)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,$)|0,r=r+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Se=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,U),i=(i=Math.imul(L,W))+Math.imul(B,U)|0,o=Math.imul(B,W),r=r+Math.imul(j,q)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,H)|0,r=r+Math.imul(R,K)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,$)|0,r=r+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,J)|0,r=r+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,
vendor: 4,519 bytes, line 1
1ce)|0,r=r+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var Ee=(c+(r=r+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,H))+Math.imul(B,q)|0,o=Math.imul(B,H),r=r+Math.imul(j,K)|0,i=(i=i+Math.imul(j,$)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,$)|0,r=r+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,J)|0,r=r+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,r=r+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var Ce=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,K),i=(i=Math.imul(L,$))+Math.imul(B,K)|0,o=Math.imul(B,$),r=r+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,r=r+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,he)|0;var Ne=(c+(r=r+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(L,Y),i=(i=Math.imul(L,J))+Math.imul(B,Y)|0,o=Math.imul(B,J),r=r+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,r=r+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),r=r+Math.imul(j,ne)|0,i=(i=i+Math.imul(j,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(N,fe)|0,o=o+Math.imul(N,he)|0;var Ae=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,he)|0;var Te=(c+(r=r+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,he)|0;var Ie=(c+(r=r+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0;var Re=(c+(r=r+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,fe),i=(i=Math.imul(L,he))+Math.imul(B,fe)|0,o=Math.imul(B,he);var Me=(c+(r=r+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(P,pe)|0)
vendor: 5,271 bytes, line 1
1)<<13)|0;c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863;var De=(c+(r=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(B,pe)|0))<<13)|0;return c=((o=Math.imul(B,me))+(i>>>13)|0)+(De>>>26)|0,De&=67108863,u[0]=ve,u[1]=ge,u[2]=ye,u[3]=be,u[4]=we,u[5]=xe,u[6]=_e,u[7]=ke,u[8]=Se,u[9]=Ee,u[10]=Ce,u[11]=Ne,u[12]=Oe,u[13]=Ae,u[14]=Te,u[15]=Ie,u[16]=Re,u[17]=Me,u[18]=De,0!==c&&(u[19]=c,n.length++),n};function p(e,t,n){return(new m).mulp(e,t,n)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=h),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,f=(0|e.words[l])*(0|t.words[c]),h=67108863&f;s=67108863&(h=h+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):p(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},m.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(1&e)<<t-i-1,e>>=1;return r},m.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a<o;a++)r[a]=t[e[a]],i[a]=n[e[a]]},m.prototype.transform=function(e,t,n,r,i,o){this.permute(o,e,t,n,r,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var f=u,h=c,d=0;d<a;d++){var p=n[l+d],m=r[l+d],v=n[l+d+a],g=r[l+d+a],y=f*v-h*g;g=f*g+h*v,v=y,n[l+d]=p+v,r[l+d]=m+g,n[l+d+a]=p-v,r[l+d+a]=m-g,d!==s&&(y=u*f-c*h,h=u*h+c*f,f=y)}},m.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},m.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},m.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&i,n=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,n,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)n[a]=0;r(0===o),r(0===(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},m.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),u=new Array(r),c=new Array(r),l=new Array(r),f=new Array(r),h=n.words;h.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,c,r),this.transform(a,o,s,u,r,i),this.transform(c,o,l,f,r,i);for(var d=0;d<r;d++){var p=s[d]*l[d]-u[d]*f[d];u[d]=s[d]*f[d]+u[d]*l[d],s[d]=p}return this.conjugate(s,u,r),this.transform(s,u,h,o,r,i),this.conjugate(h,o,r),this.normalize13b(h,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),p(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){r("number"===typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=(e.words[r]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(e){r("number"===typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<n;this.words[t]=u|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var i;r("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=n;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n
vendor: 4,923 bytes, line 1
1)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n)&&!!(this.words[n]&i)},o.prototype.imaskn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"===typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var i,o,a=e.length+n;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)s=(o=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(i,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var h=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;
vendor: 13,959 bytes, line 1
10===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;0===(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,a=n;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new _(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):n.strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(y,g),y.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r<n;r++)t.words[r]=e.words[r];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,r=10;r<e.length;r++){var o=0|e.words[r];e.words[r-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[r-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(b,g),i(w,g),i(x,g),x.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return v[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},_.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();r(v<p);var g=this.pow(f,new o(1).iushln(p-v-1));h=h.redMul(g),f=g.redSqr(),d=d.redMul(f),p=v}return h},_.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},_.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,_),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(78)(e))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";(function(e){var r=n(144),i=n(145),o=n(79);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(e,t,n);if("number"===typeof e){if("string"===typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"===typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,n,r):"string"===typeof t?function(e,t,n){"string"===typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!==typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!==typeof t.length||(r=t.length)!==r?s(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=s(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function h(e,t){var n=t.length<0?0:0|d(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&
vendor: 16,384 bytes, line 1
1(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 r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=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 t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,i);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;o<s;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){f=!1;break}if(f)return o}return-1}function y(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function b(e,t,n,r){return W(F(t,e.length-n),e,n,r)}function w(e,t,n,r){return W(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function _(e,t,n,r){return W(U(t),e,n,r)}function k(e,t,n,r){return W(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128===(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=C));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"===typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"===typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?E(this,0,e):function(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=e.slice(t,n),f=0;f<s;++f)if(c[f]!==l[f]){o=c[f],a=l[f];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"===typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function A(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=B(e[o]);return i}function T(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function I(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function j(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,r,o){return o||j(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function z(e,t,n,r,o){return o||j(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return z(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return z(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},u.prototype.fill=function(e,t,n,r){if("string"===typeof e){if("string"===typeof t?(r=t,t=0,n=this.length):"string"===typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!==typeof r)throw new TypeError("encoding must be a string");if("string"===typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"===typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=u.isBuffer(e)?e:F(new u(e,r).toString()),s=a.length;for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var n;t=t||1/0;f
1or(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function W(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(17))},function(e,t,n){e.exports=n(136)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=t;r.version=n(187).version,r.utils=n(188),r.rand=n(103),r.curve=n(53),r.curves=n(193),r.ec=n(201),r.eddsa=n(205)},function(e,t,n){"use strict";var r=!0,i="Invariant failed";t.a=function(e,t){if(!e)throw r?new Error(i):new Error(i+": "+(t||""))}},function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=n,n.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var r=n(4);function i(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],r=t&&t.split("/")||[],a=e&&i(e),s=t&&i(t),u=a||s;if(e&&i(e)?r=n:n.length&&(r.pop(),r=r.concat(n)),!r.length)return"/";var c=void 0;if(r.length){var l=r[r.length-1];c="."===l||".."===l||""===l}else c=!1;for(var f=0,h=r.length;h>=0;h--){var d=r[h];"."===d?o(r,h):".."===d?(o(r,h),f++):f&&(o(r,h),f--)}if(!u)for(;f--;f)r.unshift("..");!u||""===r[0]||r[0]&&i(r[0])||r.unshift("");var p=r.join("/");return c&&"/"!==p.substr(-1)&&(p+="/"),p},s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});var r="undefined"===typeof t?"undefined":s(t);if(r!==("undefined"===typeof n?"undefined":s(n)))return!1;if("object"===r){var i=t.valueOf(),o=n.valueOf();if(i!==t||o!==n)return e(i,o);var a=Object.keys(t),u=Object.keys(n);return a.length===u.length&&a.every(function(r){return e(t[r],n[r])})}return!1},c=n(19);function l(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function h(e,t){return function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function m(e,t,n,i){var o;"string"===typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invali
1d percent-encoding.'):s}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function v(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"===typeof e?e(t,n):e;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach(function(e){return e.apply(void 0,n)})}}}n.d(t,"a",function(){return k}),n.d(t,"b",function(){return O}),n.d(t,"d",function(){return T}),n.d(t,"c",function(){return m}),n.d(t,"f",function(){return v}),n.d(t,"e",function(){return p});var y=!("undefined"===typeof window||!window.document||!window.document.createElement);function b(e,t){t(window.confirm(e))}var w="popstate",x="hashchange";function _(){try{return window.history.state||{}}catch(e){return{}}}function k(e){void 0===e&&(e={}),y||Object(c.a)(!1);var t=window.history,n=function(){var e=window.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history}(),i=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,a=o.forceRefresh,s=void 0!==a&&a,u=o.getUserConfirmation,f=void 0===u?b:u,v=o.keyLength,k=void 0===v?6:v,S=e.basename?d(l(e.basename)):"";function E(e){var t=e||{},n=t.key,r=t.state,i=window.location,o=i.pathname+i.search+i.hash;return S&&(o=h(o,S)),m(o,r,n)}function C(){return Math.random().toString(36).substr(2,k)}var N=g();function O(e){Object(r.a)(F,e),F.length=t.length,N.notifyListeners(F.location,F.action)}function A(e){(function(e){void 0===e.state&&navigator.userAgent.indexOf("CriOS")})(e)||R(E(e.state))}function T(){R(E(_()))}var I=!1;function R(e){if(I)I=!1,O();else{N.confirmTransitionTo(e,"POP",f,function(t){t?O({action:"POP",location:e}):function(e){var t=F.location,n=D.indexOf(t.key);-1===n&&(n=0);var r=D.indexOf(e.key);-1===r&&(r=0);var i=n-r;i&&(I=!0,P(i))}(e)})}}var M=E(_()),D=[M.key];function j(e){return S+p(e)}function P(e){t.go(e)}var z=0;function L(e){1===(z+=e)&&1===e?(window.addEventListener(w,A),i&&window.addEventListener(x,T)):0===z&&(window.removeEventListener(w,A),i&&window.removeEventListener(x,T))}var B=!1;var F={length:t.length,action:"POP",location:M,createHref:j,push:function(e,r){var i=m(e,r,C(),F.location);N.confirmTransitionTo(i,"PUSH",f,function(e){if(e){var r=j(i),o=i.key,a=i.state;if(n)if(t.pushState({key:o,state:a},null,r),s)window.location.href=r;else{var u=D.indexOf(F.location.key),c=D.slice(0,-1===u?0:u+1);c.push(i.key),D=c,O({action:"PUSH",location:i})}else window.location.href=r}})},replace:function(e,r){var i=m(e,r,C(),F.location);N.confirmTransitionTo(i,"REPLACE",f,function(e){if(e){var r=j(i),o=i.key,a=i.state;if(n)if(t.replaceState({key:o,state:a},null,r),s)window.location.replace(r);else{var u=D.indexOf(F.location.key);-1!==u&&(D[u]=i.key),O({action:"REPLACE",location:i})}else window.location.replace(r)}})},go:P,goBack:function(){P(-1)},goForward:function(){P(1)},block:function(e){void 0===e&&(e=!1);var t=N.setPrompt(e);return B||(L(1),B=!0),function(){return B&&(B=!1,L(-1)),t()}},listen:function(e){var t=N.appendListener(e);return L(1),function(){L(-1),t()}}};return F}var S="hashchange",E={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+f(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:f,decodePath:l},slash:{encodePath:l,decodePath:l}};function C(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function N(e){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+e)}function O(e){void 0===e&&(e={}),y||Object(c.a)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),i=n.getUserConfirmation,o=void 0===i?b:i,a=n.hashType,s=void 0===a?"slash":a,u=e.basename?d(l(e.basename)):"",f=E[s],w=f.encodePath,x=f.decodePath;function _(){var e=x(C());return u&&(e=h(e,u)),m(e)}var k=g();function O(e){Object(r.a)(F,e),F.length=t.length,k.notifyListeners(F.location,F.action)}var A=!1,T=null;function I(){var e=C(),t=w(e);if(e!==t)N(t);else{var n=_(),r=F.location;if(!A&&v(r,n))return;if(T===p(n))return;T=null,function(e){if(A)A=!1,O();else{k.confirmTransitionTo(e,"POP",o,function(t){t?O({action:"POP",location:e}):function(e){var t=F.location,n=j.lastIndexOf(p(t));-1===n&&(n=0);var r=j.lastIndexOf(p(e));-1===r&&(r=0);var i=n-r;i&&(A=!0,P(i))}(e)})}}(n)}}var R=C(),M=w(R);R!==M&&N(M);var D=_(),j=[p(D)];function P(e){t.go(e)}var z=0;function L(e){1===(z+=e)&&1===e?window.addEventListener(S,I):0===z&&window.removeEventListener(S,I)}var B=!1;var F={length:t.length,action:"POP",location:D,createHref:function(e){return"#"+w(u+p(e))},push:function(e,t){var n=m(e,void 0,void 0,F.location);k.confirmTransitionTo(n,"PUSH",o,function(e){if(e){var t=p(n),r=w(u+t);if(C()!==r){T=t,function(e){window.location.hash=e}(r);var i=j.lastIndexOf(p(F.location)),o=j.slice(0,-1===i?0:i+1);o.push(t),j=o,O({action:"PUSH",location:n})}else O()}})},replace:function(e,t){var n=m(e,void 0,void 0,F.location);k.confirmTransitionTo(n,"REPLACE",o,function(e){if(e){var t=p(n),r=w(u+t);C()!==r&&(T=t,N(r));var i=j.indexOf(p(F.location));-1!==i&&(j[i]=t),O({action:"REPLACE",location:n})}})},go:P,goBack:function(){P(-1)},goForward:function(){P(1)},block:function(e){void 0===e&&(e=!1);var t=k.setPrompt(e);return B||(L(1),B=!0),function(){return B&&(B=!1,L(-1)),t()}},listen:function(e){var t=k.appendListener(e);return L(1),function(){L(-1),t()}}};return F}function A(e,t,n){return Math.min(Math.max(e,t),n)}function T(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,i=t.initialEntries,o=void 0===i?["/"]:i,a=t.initialIndex,s=void 0===a?0:a,u=t.keyLength,c=void 0===u?6:u,l=g();function f(e){Object(r.a)(w,e),w.length=w.entries.length,l.notifyListeners(w.location,w.action)}function h(){return Math.random().toString(36).substr(2,c)}var d=A(s,0,o.length-1),v=o.map(function(e){return m(e,void 0,"string"===typeof e?h():e.key||h())}),y=p;function b(e){var t=A(w.index+e,0,w.entries.length-1),r=w.entries[t];l.confirmTransitionTo(r,"POP",n,function(e){e?f({action:"POP",location:r,index:t}):f()})}var w={length:v.length,action:"POP",location:v[d],index:d,entries:v,createHref:y,push:function(e,t){var r=m(e,t,h(),w.location);l.confirmTransitionTo(r,"PUSH",n,function(e){if(e){var t=w.index+1,n=w.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}})},replace:function(e,t){var r=m(e,t,h(),w.location);l.confirmTransitionTo(r,"REPLACE",n,function(e){e&&(w.entries[w.index]=r,f({action:"REPLACE",location:r}))})},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t<w.entries.length},block:function(e){return void 0===e&&(e=!1),l.setPrompt(e)},listen:function(e){return l.appendListener(e)}};return w}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var r=n(11),i=n(2),o=n.n(i),a=n(36),s=n(22),u=(n(1),n(4)),c=n(8),l=n(19),f=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).history=Object(s.a)(t.props),t}return Object(r.a)(t,e),t.prototype.render=function(){return o.a.createElement(a.b,{history:this.history,children:this.props.children})},t}(o.a.Component);o.a.Component;var h=function(e){function t(){return e.apply(this,arguments)||this}Object(r.a)(t,e);var n=t.prototype;return n.handleClick=function(e,t){try{this.props.onClick&&this.props.onClick(e)}catch(n){throw e.preventDefault(),n}e.defaultPrevented||0!==e.button||this.props.target&&"_self"!==this.props.target||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),(this.props.replace?t.replace:t.push)(this.props.to))},n.render=function(){var e=this,t=this.props,n=t.innerRef,r=(t.replace,t.to),i=Object(c.a)(t,["innerRef","replace","to"]);return o.a.createElement(a.c.Consumer,null,function(t){t||Object(l.a)(!1);var a="string"===typeof r?Object(s.c)(r,null,null,t.location):r,c=a?t.history.createHref(a):"";return o.a.createElement("a",Object(u.a)({},i,{onClick:function(n){return e.handleClick(n,t.history)},href:c,ref:n}))})},t}(o.a.Component)},function(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,u,"next",e)}function u(e){r(a,i,o,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var r=n(20),i=n(5);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i<e.length;i+=2)n.push(parseInt(e[i]+e[i+1],16))}else for(var r=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?n[r++]=a:a<2048?(n[r++]=a>>6|192,n[r++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(i=0;i<e.length;i++)n[i]=0|e[i];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=s(e[n].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var i=e[r];"little"===t&&(i=a(i)),n+=u(i.toString(16))}return n},t.zero2=s,t.zero8=u,t.join32=function(e,t,n,i){var o=n-t;r(o%4===0);for(var a=new Array(o/4),s=0,u=t;s<a.length;s++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[s]=c>>>0}return a},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r<e.length;r++,i+=4){var o=e[r];"big"===t?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o<r?1:0)+n+i;e[t]=a>>>
10,e[t+1]=o},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,o,a,s){var u=0,c=t;return u+=(c=c+r>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+n+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0},t.sum64_5_hi=function(e,t,n,r,i,o,a,s,u,c){var l=0,f=t;return l+=(f=f+r>>>0)<t?1:0,l+=(f=f+o>>>0)<o?1:0,l+=(f=f+s>>>0)<s?1:0,e+n+i+a+u+(l+=(f=f+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,i,o,a,s,u,c){return t+r+o+s+c>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}var o=n(48);function a(e,t){return!t||"object"!==i(t)&&"function"!==typeof t?Object(o.a)(e):t}n.d(t,"a",function(){return a})},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}n.d(t,"a",function(){return i})},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}
1e.exports=n},function(e,t,n){var r=n(7).Buffer,i=n(59).Transform,o=n(63).StringDecoder;function a(e){i.call(this),this.hashMode="string"===typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(5)(a,i),a.prototype.update=function(e,t,n){"string"===typeof e&&(e=r.from(e,t));var i=this._update(e);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(i){r=i}finally{n(r)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(n){t=n}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},e.exports=a},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(2),i=n.n(r).a.createContext({})},function(e,t,n){"use strict";var r=n(2),i=n.n(r),o=n(32),a=n.n(o),s=n(1),u=n.n(s),c=n(71),l=n.n(c),f=1073741823;var h=i.a.createContext||function(e,t){var n,i,o="__create-react-context-"+l()()+"__",s=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=function(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter(function(t){return t!==e})},get:function(){return e},set:function(n,r){e=n,t.forEach(function(t){return t(e,r)})}}}(t.props.value),t}a()(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[o]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,i=e.value;((o=r)===(a=i)?0!==o||1/o===1/a:o!==o&&a!==a)?n=0:(n="function"===typeof t?t(r,i):f,0!==(n|=0)&&this.emitter.set(e.value,n))}var o,a},r.render=function(){return this.props.children},n}(r.Component);s.childContextTypes=((n={})[o]=u.a.object.isRequired,n);var c=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!==((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}a()(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=void 0===t||null===t?f:t},r.componentDidMount=function(){this.context[o]&&this.context[o].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=void 0===e||null===e?f:e},r.componentWillUnmount=function(){this.context[o]&&this.context[o].off(this.onUpdate)},r.getValue=function(){return this.context[o]?this.context[o].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(r.Component);return c.contextTypes=((i={})[o]=u.a.object,i),{Provider:s,Consumer:c}},d=n(11),p=n(22),m=n(19),v=n(73),g=n.n(v),y=n(4),b=(n(77),n(8));n(117);n.d(t,"a",function(){return C}),n.d(t,"b",function(){return x}),n.d(t,"d",function(){return E}),n.d(t,"c",function(){return w});var w=function(e){var t=h();return t.displayName=e,t}("Router"),x=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen(function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e})),n}Object(d.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return i.a.createElement(w.Provider,{children:this.props.children||null,value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}})},t}(i.a.Component);i.a.Component;i.a.Component;var _={},k=1e4,S=0;function E(e,t){void 0===t&&(t={}),"string"===typeof t&&(t={path:t});var n=t,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,u=n.sensitive,c=void 0!==u&&u;return[].concat(r).reduce(function(t,n){if(!n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=_[n]||(_[n]={});if(r[e])return r[e];var i=[],o={regexp:g()(e,i,t),keys:i};return S<k&&(r[e]=o,S++),o}
1(n,{end:o,strict:s,sensitive:c}),i=r.regexp,a=r.keys,u=i.exec(e);if(!u)return null;var l=u[0],f=u.slice(1),h=e===l;return o&&!h?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:h,params:a.reduce(function(e,t,n){return e[t.name]=f[n],e},{})}},null)}var C=function(e){function t(){return e.apply(this,arguments)||this}return Object(d.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(w.Consumer,null,function(t){t||Object(m.a)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?E(n.pathname,e.props):t.match,o=Object(y.a)({},t,{location:n,match:r}),a=e.props,s=a.children,u=a.component,c=a.render;(Array.isArray(s)&&0===s.length&&(s=null),"function"===typeof s)&&(void 0===(s=s(o))&&(s=null));return i.a.createElement(w.Provider,{value:o},s&&!function(e){return 0===i.a.Children.count(e)}(s)?s:o.match?u?i.a.createElement(u,o):c?c(o):null:null)})},t}(i.a.Component);function N(e){return"/"===e.charAt(0)?e:"/"+e}function O(e,t){if(!e)return t;var n=N(e);return 0!==t.pathname.indexOf(n)?t:Object(y.a)({},t,{pathname:t.pathname.substr(n.length)})}function A(e){return"string"===typeof e?e:Object(p.e)(e)}function T(e){return function(){Object(m.a)(!1)}}function I(){}i.a.Component;i.a.Component},function(e,t,n){"use strict";var r=n(50),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var o=n(43);o.inherits=n(5);var a=n(83),s=n(62);o.inherits(f,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var l=u[c];f.prototype[l]||(f.prototype[l]=s.prototype[l])}function f(e){if(!(this instanceof f))return new f(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||r.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return _e}),n.d(t,"c",function(){return ke}),n.d(t,"b",function(){return d}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return Se});var r,i,o,a=n(0),s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function u(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function c(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(o=r||(r={}))[o.DT_INVALID=0]="DT_INVALID",o[o.DT_FLOAT=1]="DT_FLOAT",o[o.DT_DOUBLE=2]="DT_DOUBLE",o[o.DT_INT32=3]="DT_INT32",o[o.DT_UINT8=4]="DT_UINT8",o[o.DT_INT16=5]="DT_INT16",o[o.DT_INT8=6]="DT_INT8",o[o.DT_STRING=7]="DT_STRING",o[o.DT_COMPLEX64=8]="DT_COMPLEX64",o[o.DT_INT64=9]="DT_INT64",o[o.DT_BOOL=10]="DT_BOOL",o[o.DT_QINT8=11]="DT_QINT8",o[o.DT_QUINT8=12]="DT_QUINT8",o[o.DT_QINT32=13]="DT_QINT32",o[o.DT_BFLOAT16=14]="DT_BFLOAT16",o[o.DT_FLOAT_REF=101]="DT_FLOAT_REF",o[o.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",o[o.DT_INT32_REF=103]="DT_INT32_REF",o[o.DT_UINT8_REF=104]="DT_UINT8_REF",o[o.DT_INT16_REF=105]="DT_INT16_REF",o[o.DT_INT8_REF=106]="DT_INT8_REF",o[o.DT_STRING_REF=107]="DT_STRING_REF",o[o.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",o[o.DT_INT64_REF=109]="DT_INT64_REF",o[o.DT_BOOL_REF=110]="DT_BOOL_REF",o[o.DT_QINT8_REF=111]="DT_QINT8_REF",o[o.DT_QUINT8_REF=112]="DT_QUINT8_REF",o[o.DT_QINT32_REF=113]="DT_QINT32_REF",o[o.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",function(e){!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(i||(i={}));var l={};
1function f(e,t){var n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};l[e]=n}function h(e){return l[e]}function d(e){delete l[e]}function p(e,t,n,r){var i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){var o=i.inputIndexStart,a=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?o+1:i.inputIndexEnd;if("tensor"===i.type)return m(t.inputNames[i.inputIndexStart],n,r);if("tensors"===i.type)return t.inputNames.slice(o,a).map(function(e){return m(e,n,r)});var s=Array.prototype.slice.call(m(t.inputNames.slice(o)[0],n,r).dataSync());return"number"===i.type?s[0]:s}var u=t.attrParams[e];return u&&u.value}function m(e,t,n){var r=y(e),i=r[0],o=r[1],a=n.currentContextIds.find(function(e){return!!t[g(i,e)]});return void 0!==a?t[g(i,a)][o]:void 0}function v(e,t){var n=y(e),r=n[0],i=n[1];return[g(r,t&&t.currentContextId),i]}function g(e,t){return t?e+"-"+t:e}function y(e){var t=e.lastIndexOf(":");return-1===t?[e,0]:[e.substring(0,t),Number(e.substring(t+1))]}function b(e,t){for(var n=[],r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}var w=Object.freeze({json:[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),x=Object.freeze({json:[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
1]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"clip_value_min",name:"clipValueMin",type:"number"},{tfName:"clip_value_max",name:"clipValueMax",type:"number"}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"clipValueMin",name:"clipValueMin",type:"number",defaultValue:0},{tfName:"clipValueMax",name:"clipValueMax",type:"number",defaultValue:6}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}
1]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),_=Object.freeze({json:[{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"}]}]}),k=Object.freeze({json:[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}
vendor: 4,503 bytes, line 1
1,{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]}]}),S=Object.freeze({json:[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0}
1,{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]}]}),E=Object.freeze({json:[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),C=Object.freeze({json:[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]}]}),N=Object.freeze({json:[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}]}),O=Object.freeze({json:[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}]}),A=Object.freeze({json:[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}
1,{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),T=Object.freeze({json:[{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),I=Object.freeze({json:[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}
1]}]}),R=Object.freeze({json:[{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]}]}),M=Object.freeze({json:[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool",notSupported:!0}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}
1]}]}),D=Object.freeze({json:[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}]}),j=Object.freeze({json:[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]}]}),P=function(){function e(){var e=[w,x,_,k,S,E,C,A,O,N,T,I,R,M,D,j],t=[].concat.apply([],e.map(function(e){return e.json}));this.opMappers=t.reduce(function(e,t){return e[t.tfOpName]=t,e},{})}return Object.defineProperty(e,"Instance",{get:function(){return this._instance||(this._instance=new this)},enumerable:!0,configurable:!0}),e.prototype.transformGraph=function(e){var t=this,n=[],r=[],i=e.node.reduce(function(e,i){return e[i.name]=t.mapNode(i),"Placeholder"===i.op&&n.push(e[i.name]),"Const"===i.op&&r.push(e[i.name]),e},{}),o=[],a=[],s=Object.keys(i);return s.forEach(function(e){var t=i[e];t.inputNames.forEach(function(e){var n=v(e)[0];t.inputs.push(i[n]),i[n].children.push(t)}),0===t.inputs.length&&o.push(t)}),s.forEach(function(e){var t=i[e];0===t.children.length&&a.push(t)}),{nodes:i,inputs:o,outputs:a,weights:r,placeholders:n}},e.prototype.mapNode=function(e){var t=h(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});var n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(function(e){return e.startsWith("^")?e.substr(1):e}),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr};return null!=t.inputs&&(n.inputParams=t.inputs.reduce(function(e,t){return e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e},{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce(function(t,n){var r=n.type,i=void 0;switch(n.type){case"string":void 0===(i=L(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=L(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":void 0===(i=K(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=K(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":void 0===(i=F(e.attr,n.tfName,n.defaultValue||0))&&n.tfDeprecatedName&&(i=F(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":void 0===(i=G(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=G(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":void 0===(i=B(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=B(e.attr,n.tfDeprecatedName,n.defaultValue));break;
1case"bool[]":void 0===(i=X(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=X(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":void 0===(i=H(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=H(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":void 0===(i=$(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=$(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":void 0===(i=W(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=W(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":void 0===(i=V(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=V(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error("Unsupported param type: "+n.type+" for op: "+e.op)}return t[n.name]={value:i,type:r},t},{})),n},e}();function z(t,n){var r=Array.isArray(t)?String.fromCharCode.apply(null,t):function(t){var n=a.ENV.global;if(void 0!==n.atob)return n.atob(t);if("undefined"!=typeof e)return new e(t,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(t);return n?r:r.toLowerCase()}function L(e,t,n,r){void 0===r&&(r=!1);var i=e[t];return null!=i?z(i.s,r):n}function B(e,t,n){var r=e[t];return r?r.b:n}function F(e,t,n){var r=e[t]||{},i=null!=r.i?r.i:null!=r.f?r.f:n;return"number"==typeof i?i:parseInt(i,10)}function U(e){switch("string"==typeof e&&(e=r[e]),e){case r.DT_FLOAT:return"float32";case r.DT_INT32:return"int32";case r.DT_BOOL:return"bool";case r.DT_DOUBLE:return"float32";case r.DT_STRING:return"string";default:return null}}function W(e,t,n){var r=e[t];return r&&r.type?U(r.type):n}function V(e,t,n){var r=e[t];return r&&r.list&&r.list.type?r.list.type.map(function(e){return U(e)}):n}function q(e){if(!e.unknownRank)return null!=e.dim?e.dim.map(function(e){return"number"==typeof e.size?e.size:parseInt(e.size,10)}):[]}function H(e,t,n){var r=e[t];return r&&r.shape?q(r.shape):n}function G(e,t,n){var r=e[t];return r?(r.list.f&&r.list.f.length?r.list.f:r.list.i).map(function(e){return"number"==typeof e?e:parseInt(e,10)}):n}function K(e,t,n,r){void 0===r&&(r=!1);var i=e[t];return i&&i.list&&i.list.s?i.list.s.map(function(e){return z(e,r)}):n}function $(e,t,n){var r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map(function(e){return q(e)}):n}function X(e,t,n){var r=e[t];return r&&r.list&&r.list.b?r.list.b:n}var Y=function(){function e(e,t,n){var r=this;this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(function(e){return r.getInput(e)}),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(function(e,t){return e[t]=r.getAttr(t),e},{}))}return e.prototype.getInput=function(e){return m(e,this.tensorMap,this.context)},e.prototype.getAttr=function(e,t){var n=this.node.rawAttrs[e];if(null!=n.tensor)return m(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return F(this.node.rawAttrs,e,t);if(null!=n.s)return L(this.node.rawAttrs,e,t);if(null!=n.b)return B(this.node.rawAttrs,e,t);if(null!=n.shape)return H(this.node.rawAttrs,e,t);if(null!=n.type)return W(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return G(this.node.rawAttrs,e,t);if(null!=n.list.s)return K(this.node.rawAttrs,e,t);if(null!=n.list.shape)return $(this.node.rawAttrs,e,t);if(null!=n.list.b)return X(this.node.rawAttrs,e,t);if(null!=n.list.type)return V(this.node.rawAttrs,e,t)}return t},e}(),J=function(e,t,n){switch(e.op){case"BiasAdd":case"Add":return[Object(a.add)(p("a",e,t,n),p("b",e,t,n))];case"AddN":return[Object(a.addN)(p("tensors",e,t,n))];case"FloorMod":case"Mod":return[Object(a.mod)(p("a",e,t,n),p("b",e,t,n))];case"Mul":return[Object(a.mul)(p("a",e,t,n),p("b",e,t,n))];case"RealDiv":case"Div":return[Object(a.div)(p("a",e,t,n),p("b",e,t,n))];case"FloorDiv":return[Object(a.floorDiv)(p("a",e,t,n),p("b",e,t,n))];case"Sub":return[Object(a.sub)(p("a",e,t,n),p("b",e,t,n))];case"Minimum":return[Object(a.minimum)(p("a",e,t,n),p("b",e,t,n))];case"Maximum":return[Object(a.maximum)(p("a",e,t,n),p("b",e,t,n))];case"Pow":return[Object(a.pow)(p("a",e,t,n),p("b",e,t,n))];case"SquaredDifference":return[Object(a.squaredDifference)(p("a",e,t,n),p("b",e,t,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}},Z=function(e,t,n){switch(e.op){case"Abs":return[Object(a.abs)(p("x",e,t,n))];case"Acos":return[Object(a.acos)(p("x",e,t,n))];case"Acosh":return[Object(a.acosh)(p("x",e,t,n))];case"Asin":return[Object(a.asin)(p("x",e,t,n))];case"Asinh":return[Object(a.asinh)(p("x",e,t,n))];case"Atan":return[Object(a.atan)(p("x",e,t,n))];case"Atan2":return[Object(a.atan2)(p("x",e,t,n),p("y",e,t,n))];case"Atanh":return[Object(a.atanh)(p("x",e,t,n))];case"Ceil":return[Object(a.ceil)(p("x",e,t,n))];case"Cos":return[Object(a.cos)(p("x",e,t,n))];case"Cosh":return[Object(a.cosh)(p("x",e,t,n))];case"Elu":return[Object(a.elu)(p("x",e,t,n))];case"Erf":return[Object(a.erf)(p("x",e,t,n))];case"Exp":return[Object(a.exp)(p("x",e,t,n))];case"Expm1":return[Object(a.expm1)(p("x",e,t,n))];case"Floor":return[Object(a.floor)(p("x",e,t,n))];case"Log":return[Object(a.log)(p("x",e,t,n))];case"Log1p":return[Object(a.log1p)(p("x",e,t,n))];case"Neg":return[Object(a.neg)(p("x",e,t,n))];case"Reciprocal":return[Object(a.reciprocal)(p("x",e,t,n))];case"Relu":return[Object(a.relu)(p("x",e,t,n))];case"Round":return[Object(a.round)(p("x",e,t,n))];case"Selu":return[Object(a.selu)(p("x",e,t,n))];case"Sigmoid":return[Object(a.sigmoid)(p("x",e,t,n))];case"Sin":return[Object(a.sin)(p("x",e,t,n))];case"Sign":return[Object(a.sign)(p("x",e,t,n))];case"Sinh":return[Object(a.sinh)(p("x",e,t,n))];case"Softplus":return[Object(a.softplus)(p("x",e,t,n))];case"Sqrt":return[Object(a.sqrt)(p("x",e,t,n))];case"Square":return[Object(a.square)(p("x",e,t,n))];case"Tanh":return[Object(a.tanh)(p("x",e,t,n))];case"Tan":return[Object(a.tan)(p("x",e,t,n))];case"Relu6":case"ClipByValue":return[Object(a.clipByValue)(p("x",e,t,n),p("clipValueMin",e,t,n),p("clipValueMax",e,t,n))];case"Rsqrt":return[Object(a.rsqrt)(m(e.inputNames[0],t,n))];case"Prod":return[Object(a.prod)(p("x",e,t,n),p("axes",e,t,n))];case"LeakyRelu":return[Object(a.leakyRelu)(p("x",e,t,n),p("alpha",e,t,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}},Q=function(){function e(t,n,r,i,o,a,s){this.name=t,this.dtype=n,this.maxSize=r,this.elementShape=i,this.identicalElementShapes=o,this.dynamicSize=a,this.clearAfterRead=s,this.tensors=[],this.closed_
vendor: 4,876 bytes, line 1
1=!1,this.id=e.nextId++}return Object.defineProperty(e.prototype,"closed",{get:function(){return this.closed_},enumerable:!0,configurable:!0}),e.prototype.clearAndClose=function(){this.tensors.forEach(function(e){return e.tensor.dispose()}),this.tensors=[],this.closed_=!0},e.prototype.size=function(){return this.tensors.length},e.prototype.read=function(e){if(this.closed_)throw new Error("TensorArray "+this.name+" has already been closed.");if(e<0||e>=this.tensors.length)throw new Error("Tried to read from index "+e+", but array size is: "+this.tensors.length);var t=this.tensors[e];if(t.cleared)throw new Error("TensorArray "+this.name+": Could not read index "+e+" twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).");return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor},e.prototype.readMany=function(e){var t=this;return e.map(function(e){return t.read(e)})},e.prototype.write=function(e,t){if(this.closed_)throw new Error("TensorArray "+this.name+" has already been closed.");if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error("Tried to write to index "+e+", but array is not resizeable and size is: "+this.maxSize);var n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+",\n because the value dtype is "+t.dtype+", but TensorArray dtype is "+this.dtype+".");if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),this.assertShapesMatchAllowUndefinedSize(this.elementShape,t.shape,"TensorArray "+this.name+": Could not write to TensorArray index "+e+"."),n&&n.read)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been read.");if(n&&n.written)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been written.");n.tensor=t,n.written=!0,this.tensors[e]=n},e.prototype.writeMany=function(e,t){var n=this;if(e.length!==t.length)throw new Error("TensorArray "+this.name+": could not write multiple tensors,because the index size: "+e.length+" is not the same as tensors size: "+t.length+".");e.forEach(function(e,r){return n.write(e,t[r])})},e.prototype.gather=function(e,t){if(t&&t!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but gather requested dtype "+t);if(!e){e=[];for(var n=0;n<this.size();n++)e.push(n)}if(0===e.length)return Object(a.tensor)([],[0].concat(this.elementShape));var r=this.readMany(e);return this.assertShapesMatchAllowUndefinedSize(this.elementShape,r[0].shape,"TensorArray shape mismatch: "),Object(a.stack)(r,0)},e.prototype.concat=function(e){if(e&&e!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but concat requested dtype "+e);if(0===this.size())return Object(a.tensor)([],[0].concat(this.elementShape));for(var t=[],n=0;n<this.size();n++)t.push(n);var r=this.readMany(t);return this.assertShapesMatchAllowUndefinedSize(this.elementShape,r[0].shape,"TensorArray shape mismatch: tensor array shape ("+this.elementShape+") vs first tensor shape ("+r[0].shape+")"),Object(a.concat)(r,0)},e.prototype.scatter=function(e,t){if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but tensor has dtype "+t.dtype);if(e.length!==t.shape[0])throw new Error("Expected len(indices) == tensor.shape[0], but saw: "+e.length+" vs. "+t.shape[0]);var n=Math.max.apply(Math,e);if(!this.dynamicSize&&n>=this.maxSize)throw new Error("Max index must be < array size ("+n+" vs. "+this.maxSize+")");this.writeMany(e,Object(a.unstack)(t,0))},e.prototype.split=function(e,t){var n=this;if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but tensor has dtype "+t.dtype);var r=0,i=e.map(function(e){return r+=e});if(r!==t.shape[0])throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n "+r+", and tensor's shape is: "+t.shape);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error("TensorArray's size is not equal to the size of lengths ("+this.maxSize+" vs. "+e.length+"), and the TensorArray is not marked as dynamically resizeable");var o=0===r?0:t.size/r,s=[];Object(a.tidy)(function(){t=t.reshape([1,r,o]);for(var u=0;u<e.length;++u){var c=[0,0===u?0:i[u-1],0],l=[1,e[u],o];s[u]=Object(a.slice)(t,c,l).reshape(n.elementShape)}return s});for(var u=[],c=0;c<e.length;c++)u[c]=c;this.writeMany(u,s)},e.prototype.assertShapesMatchAllowUndefinedSize=function(e,t,n){void 0===n&&(n=""),a.util.assert(this.shapesEqualAllowUndefinedSize(e,t),function(){return n+" Shapes "+e+" and "+t+" must match"})},e.prototype.shapesEqualAllowUndefinedSize=function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(-1!==e[n]&&-1!==t[n]&&e[n]!==t[n])return!1;return!0},e.nextId=0,e}();
1var ee=function(e,t,n){switch(e.op){case"Conv1D":var r=p("stride",e,t,n),i=p("pad",e,t,n),o=p("dataFormat",e,t,n).toUpperCase(),s=p("dilation",e,t,n);return[Object(a.conv1d)(p("x",e,t,n),p("filter",e,t,n),r,i,o,s)];case"Conv2D":r=p("strides",e,t,n),i=p("pad",e,t,n),o=p("dataFormat",e,t,n).toUpperCase();var u=p("dilations",e,t,n);return[Object(a.conv2d)(p("x",e,t,n),p("filter",e,t,n),[r[1],r[2]],i,o,[u[1],u[2]])];case"Conv2DBackpropInput":case"Conv2dTranspose":var c=p("outputShape",e,t,n);return r=p("strides",e,t,n),i=p("pad",e,t,n),[Object(a.conv2dTranspose)(p("x",e,t,n),p("filter",e,t,n),c,[r[1],r[2]],i)];case"DepthwiseConv2dNative":case"DepthwiseConv2d":return r=p("strides",e,t,n),i=p("pad",e,t,n),u=p("dilations",e,t,n),o=p("dataFormat",e,t,n).toUpperCase(),[Object(a.depthwiseConv2d)(p("input",e,t,n),p("filter",e,t,n),[r[1],r[2]],i,o,[u[1],u[2]])];case"AvgPool":r=p("strides",e,t,n),i=p("pad",e,t,n);var l=p("kernelSize",e,t,n);return[Object(a.avgPool)(p("x",e,t,n),[l[1],l[2]],[r[1],r[2]],i)];case"MaxPool":return r=p("strides",e,t,n),i=p("pad",e,t,n),l=p("kernelSize",e,t,n),[Object(a.maxPool)(p("x",e,t,n),[l[1],l[2]],[r[1],r[2]],i)];default:throw TypeError("Node type "+e.op+" is not implemented")}},te=function(e,t,n){switch(e.op){case"Fill":var r=p("shape",e,t,n),i=p("dtype",e,t,n),o=p("value",e,t,n);return[Object(a.fill)(r,o,i)];case"LinSpace":var s=p("start",e,t,n),u=p("stop",e,t,n),c=p("num",e,t,n);return[Object(a.linspace)(s,u,c)];case"OneHot":var l=p("indices",e,t,n),f=p("depth",e,t,n),h=p("onValue",e,t,n),d=p("offValue",e,t,n);return[Object(a.oneHot)(l,f,h,d)];case"Ones":return[Object(a.ones)(p("shape",e,t,n),p("dtype",e,t,n))];case"OnesLike":return[Object(a.onesLike)(p("x",e,t,n))];case"RandomUniform":return[Object(a.randomUniform)(p("shape",e,t,n),p("minval",e,t,n),p("maxval",e,t,n),p("dtype",e,t,n))];case"Range":s=p("start",e,t,n);var m=p("stop",e,t,n),v=p("step",e,t,n);return[Object(a.range)(s,m,v,p("dtype",e,t,n))];case"TruncatedNormal":r=p("shape",e,t,n);var g=p("mean",e,t,n),y=p("stdDev",e,t,n),b=p("seed",e,t,n);return[Object(a.truncatedNormal)(r,g,y,p("dtype",e,t,n),b)];case"Zeros":return[Object(a.zeros)(p("shape",e,t,n),p("dtype",e,t,n))];case"ZerosLike":return[Object(a.zerosLike)(p("x",e,t,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}};var ne=function(e,t,n){switch(e.op){case"TopKV2":var r=p("x",e,t,n),i=p("k",e,t,n),o=p("sorted",e,t,n),s=Object(a.topk)(r,i,o);return[s.values,s.indices];default:throw TypeError("Node type "+e.op+" is not implemented")}},re=function(e,t,n){switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":var r=p("default",e,t,n);return[m(e.name,t,n)||r];case"Placeholder":return[m(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":return[p("x",e,t,n).clone()];case"IdentityN":return p("x",e,t,n).map(function(e){return e.clone()});case"Snapshot":return[p("x",e,t,n).clone()];case"Shape":return[Object(a.tensor1d)(p("x",e,t,n).shape,"int32")];case"ShapeN":return p("x",e,t,n).map(function(e){return Object(a.tensor1d)(e.shape)});case"Size":return[Object(a.scalar)(p("x",e,t,n).size,"int32")];case"Rank":return[Object(a.scalar)(p("x",e,t,n).rank,"int32")];case"NoOp":return[];case"Print":var i=p("x",e,t,n),o=p("data",e,t,n),s=p("message",e,t,n),u=p("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(s);for(var c=0;c<o.length;c++)console.log(Array.prototype.slice.call(o[c].dataSync()).slice(0,u));return[i];default:throw TypeError("Node type "+e.op+" is not implemented")}},ie=function(e,t,n){switch(e.op){case"ResizeBilinear":var r=p("images",e,t,n),i=p("size",e,t,n),o=p("alignCorners",e,t,n);return[a.image.resizeBilinear(r,[i[0],i[1]],o)];case"ResizeNearestNeighbor":return r=p("images",e,t,n),i=p("size",e,t,n),o=p("alignCorners",e,t,n),[a.image.resizeNearestNeighbor(r,[i[0],i[1]],o)];case"CropAndResize":var s=p("image",e,t,n),u=p("boxes",e,t,n),c=p("boxInd",e,t,n),l=p("cropSize",e,t,n),f=p("method",e,t,n),h=p("extrapolationValue",e,t,n);return[a.image.cropAndResize(s,u,c,l,f,h)];default:throw TypeError("Node type "+e.op+" is not implemented")}},oe=function(e,t,n){switch(e.op){case"Equal":return[Object(a.equal)(p("a",e,t,n),p("b",e,t,n))];case"NotEqual":return[Object(a.notEqual)(p("a",e,t,n),p("b",e,t,n))];case"Greater":return[Object(a.greater)(p("a",e,t,n),p("b",e,t,n))];case"GreaterEqual":return[Object(a.greaterEqual)(p("a",e,t,n),p("b",e,t,n))];case"Less":return[Object(a.less)(p("a",e,t,n),p("b",e,t,n))];case"LessEqual":return[Object(a.lessEqual)(p("a",e,t,n),p("b",e,t,n))];case"LogicalAnd":return[Object(a.logicalAnd)(p("a",e,t,n),p("b",e,t,n))];case"LogicalNot":return[Object(a.logicalNot)(p("a",e,t,n))];case"LogicalOr":return[Object(a.logicalOr)(p("a",e,t,n),p("b",e,t,n))];case"Select":return[Object(a.where)(p("condition",e,t,n),p("a",e,t,n),p("b",e,t,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}},ae=function(e,t,n){switch(e.op){case"BatchMatMul":case"MatMul":return[Object(a.matMul)(p("a",e,t,n),p("b",e,t,n),p("transposeA",e,t,n),p("transposeB",e,t,n))];case"Transpose":return[Object(a.transpose)(p("x",e,t,n),p("perm",e,t,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}},se=function(e,t,n){switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":return[Object(a.batchNorm)(p("x",e,t,n),p("mean",e,t,n),p("variance",e,t,n),p("offset",e,t,n),p("scale",e,t,n),p("epsilon",e,t,n))];case"LRN":return[Object(a.localResponseNormalization)(p("x",e,t,n),p("radius",e,t,n),p("bias",e,t,n),p("alpha",e,t,n),p("beta",e,t,n))];case"Softmax":return[Object(a.softmax)(p("x",e,t,n))];case"LogSoftmax":return[Object(a.logSoftmax)(p("x",e,t,n))];case"SparseToDense":return[Object(a.sparseToDense)(p("sparseIndices",e,t,n),p("outputShape",e,t,n),p("sparseValues",e,t,n),p("defaultValue",e,t,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}}
1,ue=function(e,t,n){switch(e.op){case"Max":var r=p("axis",e,t,n),i=p("keepDims",e,t,n);return[Object(a.max)(p("x",e,t,n),r,i)];case"Mean":return r=p("axis",e,t,n),i=p("keepDims",e,t,n),[Object(a.mean)(p("x",e,t,n),r,i)];case"Min":return r=p("axis",e,t,n),i=p("keepDims",e,t,n),[Object(a.min)(p("x",e,t,n),r,i)];case"Sum":return r=p("axis",e,t,n),i=p("keepDims",e,t,n),[Object(a.sum)(p("x",e,t,n),r,i)];case"All":return r=p("axis",e,t,n),i=p("keepDims",e,t,n),[Object(a.all)(p("x",e,t,n),r,i)];case"Any":return r=p("axis",e,t,n),i=p("keepDims",e,t,n),[Object(a.any)(p("x",e,t,n),r,i)];case"ArgMax":return r=p("axis",e,t,n),[Object(a.argMax)(p("x",e,t,n),r)];case"ArgMin":return r=p("axis",e,t,n),[Object(a.argMin)(p("x",e,t,n),r)];case"Prod":return r=p("axis",e,t,n),i=p("keepDims",e,t,n),[Object(a.prod)(p("x",e,t,n),r,i)];default:throw TypeError("Node type "+e.op+" is not implemented")}},ce=function(e,t,n){switch(e.op){case"ConcatV2":case"Concat":var r=p("axis",e,t,n),i=p("tensors",e,t,n);return[Object(a.concat)(i,r)];case"GatherV2":case"Gather":r=p("axis",e,t,n);var o=p("x",e,t,n),s=p("indices",e,t,n);return[Object(a.gather)(o,s.asType("int32"),r)];case"ReverseV2":case"Reverse":return r=p("axis",e,t,n),o=p("x",e,t,n),[Object(a.reverse)(o,r)];case"Slice":var u=p("begin",e,t,n),c=p("size",e,t,n);return[Object(a.slice)(p("x",e,t,n),u,c)];case"StridedSlice":u=p("begin",e,t,n);var l=p("end",e,t,n),f=p("strides",e,t,n),h=p("beginMask",e,t,n),d=p("endMask",e,t,n),m=p("ellipsisMask",e,t,n),v=p("newAxisMask",e,t,n),g=p("shrinkAxisMask",e,t,n),y=p("x",e,t,n);if(1===u.length&&y.shape.length>1)for(var b=1;b<y.shape.length;b++)u.push(0),l.push(y.shape[b]),f.push(f[0]);return[Object(a.stridedSlice)(y,u,l,f,h,d,m,v,g)];case"Pack":return Object(a.tidy)(function(){var r=p("axis",e,t,n),i=p("tensors",e,t,n),o=i[0].shape,s=i[0].squeeze().shape,u=i.map(function(e){var t=a.util.arraysEqual(e.shape,o);if(!t&&!a.util.arraysEqual(e.squeeze().shape,s))throw new Error("the input tensors shape does not match");return t?e:e.reshape(o)});return[Object(a.stack)(u,r)]});case"Unpack":return Object(a.tidy)(function(){var r=p("axis",e,t,n),i=p("tensor",e,t,n);return Object(a.unstack)(i,r)});case"Tile":var w=p("reps",e,t,n);return[Object(a.tile)(p("x",e,t,n),w)];case"Split":case"SplitV":r=p("axis",e,t,n);var x=p("numOrSizeSplits",e,t,n);return Object(a.split)(p("x",e,t,n),x,r);case"ScatterNd":s=p("indices",e,t,n);var _=p("values",e,t,n),k=p("shape",e,t,n);return[Object(a.scatterND)(s,_,k)];case"GatherNd":var S=p("x",e,t,n);return s=p("indices",e,t,n),[Object(a.gatherND)(S,s)];case"SparseToDense":s=p("sparseIndices",e,t,n),k=p("outputShape",e,t,n);var E=p("sparseValues",e,t,n),C=p("defaultValue",e,t,n);return[Object(a.sparseToDense)(s,E,k,E.dtype===C.dtype?C:C.asType(E.dtype))];default:throw TypeError("Node type "+e.op+" is not implemented")}},le=function(e,t,n){switch(e.op){case"FFT":return[Object(a.fft)(p("x",e,t,n))];case"IFFT":return[Object(a.ifft)(p("x",e,t,n))];case"RFFT":return[Object(a.rfft)(p("x",e,t,n))];case"IRFFT":return[Object(a.irfft)(p("x",e,t,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}},fe=function(e,t,n){switch(e.op){case"Cast":return[Object(a.cast)(p("x",e,t,n),p("dtype",e,t,n))];case"ExpandDims":var r=p("axis",e,t,n);return[Object(a.expandDims)(p("x",e,t,n),r)];case"Squeeze":return r=p("axis",e,t,n),[Object(a.squeeze)(p("x",e,t,n),r)];case"Reshape":return[Object(a.reshape)(p("x",e,t,n),p("shape",e,t,n))];case"PadV2":case"Pad":return[Object(a.pad)(p("x",e,t,n),b(p("padding",e,t,n),2),p("constantValue",e,t,n))];case"SpaceToBatchND":var i=p("blockShape",e,t,n),o=b(p("paddings",e,t,n),2);return[Object(a.spaceToBatchND)(p("x",e,t,n),i,o)];case"BatchToSpaceND":i=p("blockShape",e,t,n);var s=b(p("crops",e,t,n),2);return[Object(a.batchToSpaceND)(p("x",e,t,n),i,s)];case"DepthToSpace":var u=p("blockSize",e,t,n),c=p("dataFormat",e,t,n).toUpperCase();return[Object(a.depthToSpace)(p("x",e,t,n),u,c)];default:throw TypeError("Node type "+e.op+" is not implemented")}};function he(e,t,n){var r=function(e,t,n){switch(e.category){case"arithmetic":return J(e,t,n);case"basic_math":return Z(e,t,n);case"control":return function(e,t,n){return u(this,void 0,void 0,function(){var r,i,o,s,u,l,f,h,d,v,g,y,b,w,x,_,k,S,E,C,N,O,A,T,I,R,M,D,j,P,z,L,B,F,U;return c(this,function(c){switch(c.label){case 0:switch(e.op){case"LoopCond":return[3,1];case"Switch":return[3,2];case"Merge":return[3,4];case"Enter":return[3,5];case"Exit":return[3,6];case"NextIteration":return[3,7];case"TensorArrayV3":return[3,8];case"TensorArrayWriteV3":return[3,9];case"TensorArrayReadV3":return[3,10];case"TensorArrayGatherV3":return[3,11];case"TensorArrayScatterV3":return[3,12];case"TensorArrayConcatV3":return[3,13];case"TensorArraySplitV3":return[3,14];case"TensorArraySizeV3":return[3,15];
1case"TensorArrayCloseV3":return[3,16]}return[3,17];case 1:return[2,[p("pred",e,t,n).clone()]];case 2:return r=p("pred",e,t,n),i=p("data",e,t,n),[4,r.data()];case 3:return[2,c.sent()[0]?[void 0,i.clone()]:[i.clone(),void 0]];case 4:return[2,(o=e.inputNames.find(function(e){return void 0!==m(e,t,n)}))?[m(o,t,n).clone()]:void 0];case 5:return s=p("frameName",e,t,n),u=p("tensor",e,t,n),n.enterFrame(s),[2,[u.clone()]];case 6:return l=p("tensor",e,t,n),n.exitFrame(),[2,[l.clone()]];case 7:return f=p("tensor",e,t,n),n.nextIteration(),[2,[f.clone()]];case 8:return h=p("size",e,t,n),d=p("dtype",e,t,n),v=p("elementShape",e,t,n),g=p("dynamicSize",e,t,n),y=p("clearAfterRead",e,t,n),b=p("identicalElementShapes",e,t,n),w=p("name",e,t,n),x=new Q(w,d,h,v,b,g,y),n.addTensorArray(x),[2,[Object(a.scalar)(x.id),Object(a.scalar)(1)]];case 9:return _=p("tensorArrayId",e,t,n),k=p("index",e,t,n),S=p("tensor",e,t,n),n.getTensorArray(_).write(k,S),[2,[Object(a.scalar)(1)]];case 10:return E=p("tensorArrayId",e,t,n),C=p("index",e,t,n),[2,[n.getTensorArray(E).read(C)]];case 11:return N=p("tensorArrayId",e,t,n),O=p("indices",e,t,n),A=p("dtype",e,t,n),[2,[n.getTensorArray(N).gather(O,A)]];case 12:return T=p("tensorArrayId",e,t,n),I=p("indices",e,t,n),R=p("tensor",e,t,n),n.getTensorArray(T).scatter(I,R),[2,[Object(a.scalar)(1)]];case 13:return M=p("tensorArrayId",e,t,n),D=n.getTensorArray(M),j=p("dtype",e,t,n),[2,[D.concat(j)]];case 14:return P=p("tensorArrayId",e,t,n),z=p("tensor",e,t,n),L=p("lengths",e,t,n),n.getTensorArray(P).split(L,z),[2,[Object(a.scalar)(1)]];case 15:return B=p("tensorArrayId",e,t,n),F=n.getTensorArray(B),[2,[Object(a.scalar)(F.size(),"int32")]];case 16:return U=p("tensorArrayId",e,t,n),n.getTensorArray(U).clearAndClose(),[2,[]];case 17:throw TypeError("Node type "+e.op+" is not implemented")}})})}(e,t,n);case"convolution":return ee(e,t,n);case"creation":return te(e,t,n);case"dynamic":return function(e,t,n){return u(this,void 0,void 0,function(){var r,i,o,s,u;return c(this,function(c){switch(c.label){case 0:switch(e.op){case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":return[3,1];case"Where":return[3,3];case"ListDiff":return[3,5]}return[3,7];case 1:return r=p("boxes",e,t,n),i=p("scores",e,t,n),o=p("maxOutputSize",e,t,n),s=p("iouThreshold",e,t,n),u=p("scoreThreshold",e,t,n),[4,a.image.nonMaxSuppressionAsync(r,i,o,s,u)];case 2:return[2,[c.sent()]];case 3:return[4,Object(a.whereAsync)(p("condition",e,t,n))];case 4:return[2,[c.sent()]];case 5:return[4,Object(a.setdiff1dAsync)(p("x",e,t,n),p("y",e,t,n))];case 6:return[2,c.sent()];case 7:throw TypeError("Node type "+e.op+" is not implemented")}})})}(e,t,n);case"evaluation":return ne(e,t,n);case"image":return ie(e,t,n);case"graph":return re(e,t,n);case"logical":return oe(e,t,n);case"matrices":return ae(e,t,n);case"normalization":return se(e,t,n);case"reduction":return ue(e,t,n);case"slice_join":return ce(e,t,n);case"spectral":return le(e,t,n);case"transformation":return fe(e,t,n);case"custom":var r=h(e.op);if(r&&r.customExecutor)return r.customExecutor(new Y(e,t,n));throw TypeError("Custom op "+e.op+" is not registered.");default:throw TypeError("Unknown op '"+e.op+"'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()")}}(e,t,n);return r instanceof Promise?r.then(function(e){return[].concat(e)}):[].concat(r)}var de=function(){function e(e,t){this.weightMap=e,this.tensorArrayMap=t,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}return e.prototype.newFrame=function(e,t){return{id:e,frameName:t,iterationId:0}},Object.defineProperty(e.prototype,"currentContext",{get:function(){return this.contexts},set:function(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentContextId",{get:function(){return this._currentContextIds[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentContextIds",{get:function(){return this._currentContextIds},enumerable:!0,configurable:!0}),e.prototype.generateCurrentContextIds=function(){for(var e=[],t=0;t<this.contexts.length-1;t++){var n=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(n))}e.push(""),this._currentContextIds=e},e.prototype.contextIdforContexts=function(e){return e?e.map(function(e){return 0===e.id&&0===e.iterationId?"":e.frameName+"-"+e.iterationId}).join("/"):""},e.prototype.enterFrame=function(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))},e.prototype.exitFrame=function(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()},e.prototype.nextIteration=function(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");this.contexts=this.contexts.slice(),this.lastId++;var e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))},e.prototype.getWeight=function(e){return this.weightMap[e]},e.prototype.addTensorArray=function(e){this.tensorArrayMap[e.id]=e},e.prototype.getTensorArray=function(e){return this.tensorArrayMap[e]},e}();function pe(e,t,n){for(var r=new Set,i=[],o=null,a=null,s=new Set,u=t.slice();u.length>0;){var c=u.pop();(ge(c)||ye(c))&&null==o&&(a=(o=c).children.map(function(e){return e.name}).filter(function(e){return r.has(e)})),r.add(c.name),null==n[c.name]&&null==e[c.name]&&(0!==c.inputs.length?c.inputs.forEac
1h(function(e){s.has(e.name)||(s.add(e.name),u.push(e))}):i.push(c.name))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:i,dynamicNode:o,syncInputs:a}}var me=["Switch","Merge","Enter","Exit","NextIteration"],ve=["NonMaxSuppressionV2","NonMaxSuppressionV3","Where"];function ge(e){return me.indexOf(e.op)>=0}function ye(e){return ve.indexOf(e.op)>=0}var be=function(){function e(e){this.graph=e,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this.placeholders=e.placeholders,this._outputs=e.outputs}return Object.defineProperty(e.prototype,"weightMap",{get:function(){return this._weightMap},set:function(e){var t=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})});this.weightIds=[].concat.apply([],t),this._weightMap=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.placeholders.map(function(e){return{name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this._outputs.map(function(e){return{name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.placeholders.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.outputs.map(function(e){return e.name})},enumerable:!0,configurable:!0}),e.prototype.getCompilationKey=function(e,t){var n=e.map(function(e){return e.name}).sort(),r=t.map(function(e){return e.name}).sort();return n.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)},e.prototype.compile=function(e,t){var n=pe(e,t,this.weightMap),r=n.missingInputs,i=n.dynamicNode,o=n.syncInputs;if(null!=i)throw new Error("This execution contains the node '"+i.name+"', which has the dynamic op '"+i.op+"'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs ["+o+"]");if(r.length>0){var a=t.map(function(e){return e.name}),s=Object.keys(e);throw new Error("Cannot compute the outputs ["+a+"] from the provided inputs ["+s+"]. Missing the following inputs: ["+r+"]")}return function(e,t,n){var r=n.usedNodes,i=n.inputs,o=[];Object.keys(i).map(function(t){return e.nodes[t]}).forEach(function(e){r.has(e.name)&&o.push(e)}),e.weights.forEach(function(e){r.has(e.name)&&o.push(e)});for(var a=new Set,s=[];o.length>0;){var u=o.pop();a.add(u.name),t[u.name]||s.push(u),u.children.forEach(function(e){!a.has(e.name)&&r.has(e.name)&&e.inputs.every(function(e){return a.has(e.name)})&&o.push(e)})}return s}(this.graph,this.weightMap,n)},e.prototype.execute=function(e,t){var n=this,r=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),this.checkOutputs(t);var i=r.map(function(e){return n.graph.nodes[e]}),o=t.map(function(e){return n.graph.nodes[y(e)[0]]}),u=this.getCompilationKey(i,o),c=this.compiledMap.get(u);null==c&&(c=this.compile(e,o),this.compiledMap.set(u,c));var l={};return Object(a.tidy)(function(){var r=new de(n._weightMap,l),i=s({},n.weightMap);Object.keys(e).forEach(function(t){i[t]=[e[t]]});for(var o=n.getFrozenTensorIds(i),a={},u=0;u<c.length;u++){var f=c[u];if(!i[f.name]){var h=he(f,i,r);if(h instanceof Promise)throw new Error("The execution of the op '"+f.op+"' returned a promise. Please use model.executeAsync() instead.");i[f.name]=h,n.checkTensorForDisposal(f.name,f,i,r,o,t,a)}}return t.map(function(e){return m(e,i,r)})})},e.prototype.getFrozenTensorIds=function(e){var t=[].concat.apply([],Object.keys(e).map(function(t){return e[t]}).map(function(e){return e.map(function(e){return e.id})}));return new Set(t)},e.prototype.checkTensorForDisposal=function(e,t,n,r,i,o,a){"control"!==t.category&&-1===o.indexOf(e)&&(n[e].forEach(function(e){null!=e&&(a[e.id]=(a[e.id]||0)+t.children.length)}),t.inputs.forEach(function(e){if("control"!==e.category){var t=function(e,t,n){return t[g(e,n.currentContextId)]}(e.name,n,r);null!=t&&t.forEach(function(e){if(e&&!i.has(e.id)){var t=a[e.id];
11===t?(e.dispose(),delete a[e.id]):null!=t&&a[e.id]--}})}}))},e.prototype.executeAsync=function(e,t){return u(this,void 0,void 0,function(){var n,r,i,o,a,s,u=this;return c(this,function(c){switch(c.label){case 0:return this.checkInputs(e),this.checkInputShapeAndType(e),n={},r=new de(this._weightMap,n),[4,this.executeWithControlFlow(e,r,t)];case 1:return i=c.sent(),o=t.map(function(e){return m(e,i,r)}),a=new Set(o.map(function(e){return e.id})),s=new Set(Object.keys(e).map(function(t){return e[t].id})),Object.keys(i).forEach(function(e){i[e].forEach(function(e){!e||e.isDisposed||a.has(e.id)||s.has(e.id)||-1!==u.weightIds.indexOf(e.id)||e.dispose()})}),[2,o]}})})},e.prototype.executeWithControlFlow=function(e,t,n){return u(this,void 0,void 0,function(){var r,i,o,a,u,l,f,h,d,p,v,g,b,w,x,_,k=this;return c(this,function(c){switch(c.label){case 0:r=Object.keys(e),i=r.map(function(e){return k.graph.nodes[e]}),o=n.map(function(e){return k.graph.nodes[y(e)[0]]}),a=pe(e,o,this.weightMap),u=a.usedNodes,l=a.missingInputs,f=a.dynamicNode,h=a.syncInputs,d=i.concat(this.graph.weights).map(function(e){return{node:e,contexts:t.currentContext}}),p=s({},this.weightMap),Object.keys(e).forEach(function(t){p[t]=[e[t]]}),v={},g=this.getFrozenTensorIds(p),b={},c.label=1;case 1:return d.length>0?(w=this.processStack(i,d,t,p,b,g,n,v,u),[4,Promise.all(w)]):[3,3];case 2:return c.sent(),[3,1];case 3:if(null==f&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead."),(x=o.filter(function(e){return!ge(e)&&!m(e.name,p,t)}).map(function(e){return e.name})).length>0)throw _="",null!=f&&(_="Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs ["+h+"]"),new Error("Cannot compute the outputs ["+x+"] from the provided inputs ["+r+"]. Consider providing the following inputs: ["+l+"]. "+_);return[2,p]}})})},e.prototype.processStack=function(e,t,n,r,i,o,a,s,u){for(var c=this,l=[],f=function(){var f=t.pop();n.currentContext=f.contexts;var d="";if("Enter"===f.node.op&&p("isConstant",f.node,r,n)&&(d=v(f.node.name,n)[0]),-1===e.indexOf(f.node)){var m=he(f.node,r,n);d||(d=v(f.node.name,n)[0]);var g=n.currentContext;m instanceof Promise?l.push(m.then(function(e){return r[d]=e,n.currentContext=g,c.checkTensorForDisposal(d,f.node,r,n,o,a,s),c.processChildNodes(f.node,t,n,r,i,u),e})):(r[d]=m,h.checkTensorForDisposal(d,f.node,r,n,o,a,s),h.processChildNodes(f.node,t,n,r,i,u))}else h.processChildNodes(f.node,t,n,r,i,u)},h=this;t.length>0;)f();return l},e.prototype.processChildNodes=function(e,t,n,r,i,o){e.children.forEach(function(e){var a=v(e.name,n)[0];!i[a]&&o.has(e.name)&&("Merge"===e.op?e.inputNames.some(function(e){return!!m(e,r,n)})&&(i[a]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every(function(e){return!!m(e,r,n)})&&(i[a]=!0,t.push({contexts:n.currentContext,node:e})))})},e.prototype.dispose=function(){var e=this;Object.keys(this.weightMap).forEach(function(t){return e.weightMap[t].forEach(function(e){return e.dispose()})})},e.prototype.checkInputShapeAndType=function(e){var t=this;Object.keys(e).forEach(function(n){var r=e[n],i=t.graph.nodes[n];if(i.attrParams.shape&&i.attrParams.shape.value){var o=i.attrParams.shape.value,s=o.length===r.shape.length&&r.shape.every(function(e,t){return-1===o[t]||o[t]===e});a.util.assert(s,function(){return"The shape of dict['"+i.name+"'] provided in model.execute(dict) must be ["+o+"], but was ["+r.shape+"]"})}i.attrParams.dtype&&i.attrParams.dtype.value&&a.util.assert(r.dtype===i.attrParams.dtype.value,function(){return"The dtype of dict['"+i.name+"'] provided in model.execute(dict) must be "+i.attrParams.dtype.value+", but was "+r.dtype})})},e.prototype.checkInputs=function(e){var t=this,n=Object.keys(e).filter(function(e){return!t.graph.nodes[e]});if(n.length>0)throw new Error("The dict provided in model.execute(dict) has keys: ["+n+"] that are not part of graph")},e.prototype.checkOutputs=function(e){var t=this;e.forEach(function(e){var n=y(e)[0];if(!t.graph.nodes[n])throw new Error("The output '"+e+"' is not found in the graph")})},e}(),we="?tfjs-format=file",xe="model.json",_e=function(){function e(e,t){void 0===t&&(t={}),this.modelUrl=e,this.loadOptions=t,this.version="n/a",null==t&&(this.loadOptions={})}return Object.defineProperty(e.prototype,"modelVersion",{get:function(){return this.version},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.executor.inputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.executor.outputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.executor.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this.executor.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weights",{get:function(){return this.executor.weightMap},enumerable:!0,configurable:!0}),e.prototype.findIOHandler=function(){var e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=a.io.browserHTTPRequest
1(e,this.loadOptions);else{var t=a.io.getLoadHandlers(e,this.loadOptions.onProgress);if(0===t.length)t.push(a.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error("Found more than one ("+t.length+") load handlers for URL '"+[e]+"'");this.handler=t[0]}},e.prototype.load=function(){return u(this,void 0,void 0,function(){var e,t,n;return c(this,function(r){switch(r.label){case 0:if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");return[4,this.handler.load()];case 1:return e=r.sent(),t=e.modelTopology,this.version=t.versions.producer+"."+t.versions.minConsumer,n=a.io.decodeWeights(e.weightData,e.weightSpecs),this.executor=new be(P.Instance.transformGraph(t)),this.executor.weightMap=this.convertTensorMapToTensorsMap(n),[2,!0]}})})},e.prototype.predict=function(e,t){return this.execute(e,this.outputNodes)},e.prototype.normalizeInputs=function(e){if(!(e instanceof a.Tensor||Array.isArray(e)))return e;if((e=Array.isArray(e)?e:[e]).length!==this.inputNodes.length)throw new Error("Input tensor count mismatch,the graph model has "+this.inputNodes.length+" placeholders, while there are "+e.length+" input tensors.");return this.inputNodes.reduce(function(t,n,r){return t[n]=e[r],t},{})},e.prototype.normalizeOutputs=function(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]},e.prototype.execute=function(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);var n=this.executor.execute(e,t);return n.length>1?n:n[0]},e.prototype.executeAsync=function(e,t){return u(this,void 0,void 0,function(){var n;return c(this,function(r){switch(r.label){case 0:return e=this.normalizeInputs(e),t=this.normalizeOutputs(t),[4,this.executor.executeAsync(e,t)];case 1:return[2,(n=r.sent()).length>1?n:n[0]]}})})},e.prototype.convertTensorMapToTensorsMap=function(e){return Object.keys(e).reduce(function(t,n){return t[n]=[e[n]],t},{})},e.prototype.dispose=function(){this.executor.dispose()},e}();function ke(e,t){return void 0===t&&(t={}),u(this,void 0,void 0,function(){var n;return c(this,function(r){switch(r.label){case 0:if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");return null==t&&(t={}),t.fromTFHub&&null==e.load&&(e.endsWith("/")||(e+="/"),e=""+e+xe+we),[4,(n=new _e(e,t)).load()];case 1:return r.sent(),[2,n]}})})}var Se="1.2.1"}).call(this,n(15).Buffer)},function(e,t,n){"use strict";(function(t,r){var i=65536,o=4294967295;var a=n(7).Buffer,s=t.crypto||t.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(e);if(e>0)if(e>i)for(var u=0;u<e;u+=i)s.getRandomValues(n.slice(u,u+i));else s.getRandomValues(n);if("function"===typeof t)return r.nextTick(function(){t(null,n)});return n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(17),n(31))},function(e,t,n){var r=n(7).Buffer;function i(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"===typeof e&&(t=t||"utf8",e=r.from(e,t));for(var n=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,c=Math.min(o-s,i-u),l=0;l<c;l++)n[u+l]=e[s+l];s+=c,(a+=c)%i===0&&this._update(n)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,n){"use strict";var r=n(124),i=n.n(r),o=n(33),a=n.n(o),s=n(32),u=n.n(s),c=n(6),l=n.n(c),f=n(12),h=n.n(f),d=n(2),p=n(74),m=n(125),v=n.n(m)()({setReferenceNode:void 0,referenceNode:void 0}),g=function(e){function t(){var t;return t=e.call(this)||this,h()(l()(l()(t)),"setReferenceNode",function(e){e&&t.state.context.referenceNode!==e&&t.setState(function(t){var n=t.context;return{context:a()({},n,{referenceNode:e})}})}),t.state={context:{setReferenceNode:t.setReferenceNode,referenceNode:void 0}},t}return u()(t,e),t.prototype.render=function(){return d.createElement(v.Provider,{value:this.state.context},this.props.children)},t}(d.Component),y=function(e){return Array.isArray(e)?e[0]:e},b=function(e){if("function"===typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}},w={position:"absolute",top:0,left:0,opacity:0,pointerEvents:"none"},x={},_=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t=e.call.apply(e,[this].concat(r))||this,h()(l()(l()(t)),"state",{data:void 0,placement:void 0}),h()(l()(l()(t)),"popperInstance",void 0),h()(l()(l()(t)),"popperNode",null),h()(l()(l()(t)),"arrowNode",null),h()(l()(l()(t)),"setPopperNode",function(e){e&&t.popperNode!==e&&(b(t.props.innerRef,e),t.popperNode=e,t.updatePopperInstance())}),h()(l()(l()(t)),"setArrowNode",function(e){t.arrowNode=e}),h()(l()(l()(t)),"updateStateModifier",{enabled:!0,order:900,fn:function(e){var n=e.placement;return t.setState({data:e,placement:n}),e}}),h()(l()(l()(t)),"getOptions",function(){return{placement:t.props.placement,eventsEnabled:t.props.eventsEnabled,positionFixed:t.props.positionFixed,modifiers:a()({},t.props.modifiers,{arrow:a()({},t.props.modifiers&&t.props.modifiers.arrow,{enabled:!!t.arrowNode,element:t.arrowNode}),applyStyle:{enabled:!1},updateStateModifier:t.updateStateModifier})}}),h()(l()(l()(t)),"getPopperStyle",function(){return t.popperNode&&t.state.data?a()({position:t.state.data.offsets.popper.position},t.state.data.styles):w}),h()(l()(l()(t)),"getPopperPlacement",function(){return t.state.data?t.state.placement:void 0}),h()(l()(l()(t)),"getArrowStyle",function(){return t.arrowNode&&t.state.data?t.state.data.arrowStyles:x}),h()(l()(l()(t)),"getOutOfBoundariesState",function(){return t.state.data?t.state.data.hide:void 0}),h()(l()(l()(t)),"destroyPopperInstance",function(){t.popperInstance&&(t.popperInstance.destroy(),t.popperInstance=null)}),h()(l()(l()(t)),"updatePopperInstance",function(){t.destroyPopperInstance();var e=l()(l()(t)).popperNode,n=t.props.referenceElement;n&&e&&(t.popperInstance=new p.a(n,e,t.getOptions()))}),h()(l()(l()(t)),"scheduleUpdate",function(){t.popperInstance&&t.popperInstance.scheduleUpdate()}),t}u()(t,e);var n=t.prototype;return n.componentDidUpdate=function(e,t){this.props.placement!==e.placement||this.props.referenceElement!==e.referenceElement||this.props.positionFixed!==e.positionFixed?this.updatePopperInstance():this.props.eventsEnabled!==e.eventsEnabled&&this.popperInstance&&(this.props.eventsEnabled?this.popperInstance.enableEventListeners():this.popperInstance.disableEventListeners()),t.placement!==this.state.placement&&this.scheduleUpdate()},n.componentWillUnmount=function(){b(this.props.innerRef,null),this.destroyPopperInstance()},n.render=function(){return y(this.props.children)({ref:this.setPopperNode,style:this.getPopperStyle(),placement:this.getPopperPlacement(),outOfBoundaries:this.getOutOfBoundariesState(),scheduleUpdate:this.scheduleUpdate,arrowProps:{ref:this.setArrowNode,style:this.getArrowStyle()}})},t}(d.Component);h()(_,"defaultProps",{placement:"bottom",eventsEnabled:!0,referenceElement:void 0,positionFixed:!1});p.a.placements;function k(e){var t=e.referenceElement,n=i()(e,["referenceElement"]);return d.createElement(v.Consumer,null,function(e){var r=e.referenceNode;return d.createElement(_,a()({referenceElement:void 0!==t?t:r},n))})}var S=n(126),E=n.n(S),C=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t=e.call.apply(e,[this].concat(r))||this,h()(l()(l()(t)),"refHandler",function(e){b(t.props.innerRef,e),b(t.props.setReferenceNode,e)}),t}return u()(t,e),t.prototype.render=function(){return E()(Boolean(this.props.setReferenceNode),"`Reference` should not be used outside of a `Manager` component."),y(this.props.children)({ref:this.refHandler})},t}(d.Component);function N(e){return d.createElement(v.Consumer,null,function(t){var n=t.setReferenceNode;return d.createElement(C,a()({setReferenceNode:n},e))})}n.d(t,"b",function(){return k}),n.d(t,"a",function(){return g}),n.d(t,"c",function(){return N})},function(e,t,n){"use strict";var r=n(5),i=n(58),o=n(64),a=n(65),s=n(34);function u(e){s.call(this,"digest"),this._hash=e}r(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"===typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"===typeof e},t.isString=function(e){return"string"===typeof e}
1,t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"===typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"===typeof e},t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=e.isBuffer}).call(this,n(15).Buffer)},function(e,t,n){(function(t){e.exports=function(e,n){for(var r=Math.min(e.length,n.length),i=new t(r),o=0;o<r;++o)i[o]=e[o]^n[o];return i}}).call(this,n(15).Buffer)},function(e,t,n){"use strict";var r=n(25),i=n(20);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=e>>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r}},function(e,t,n){var r=t;
1r.bignum=n(13),r.define=n(209).define,r.base=n(47),r.constants=n(109),r.decoders=n(214),r.encoders=n(216)},function(e,t,n){var r=t;r.Reporter=n(211).Reporter,r.DecoderBuffer=n(108).DecoderBuffer,r.EncoderBuffer=n(108).EncoderBuffer,r.Node=n(212)},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"decodeMultiplePoses",function(){return A}),n.d(t,"decodeSinglePose",function(){return H}),n.d(t,"MobileNet",function(){return a}),n.d(t,"partChannels",function(){return m}),n.d(t,"partIds",function(){return h}),n.d(t,"partNames",function(){return l}),n.d(t,"poseChain",function(){return d}),n.d(t,"load",function(){return ee}),n.d(t,"PoseNet",function(){return J}),n.d(t,"getAdjacentKeyPoints",function(){return R}),n.d(t,"getBoundingBox",function(){return j}),n.d(t,"getBoundingBoxPoints",function(){return P}),n.d(t,"scalePose",function(){return B});var r=n(0),i=n(38),o=[8,16,32];var a=function(){function e(e,t,n){this.model=e;var i=this.model.inputs[0].shape;r.util.assert(!(i[1]!==t&&-1!==i[1]||i[2]!==t&&-1!==i[2]),function(){return"Input shape ["+i[1]+", "+i[2]+"] must both be equal to "+t+" or -1"}),this.inputResolution=t,this.outputStride=n}return e.prototype.predict=function(e){var t=this;return Object(r.tidy)(function(){var n=function(e){return Object(r.tidy)(function(){return"int32"===e.dtype&&(e=e.toFloat()),e=Object(r.div)(e,127.5),Object(r.sub)(e,1)})}(e).expandDims(0),i=t.model.predict(n),o=i[0],a=i[1],s=i[2],u=i[3];return{heatmapScores:a.squeeze().sigmoid(),offsets:o.squeeze(),displacementFwd:s.squeeze(),displacementBwd:u.squeeze()}})},e.prototype.dispose=function(){this.model.dispose()},e}();function s(e){return Math.floor(e/2)}var u=function(){function e(e,t){this.priorityQueue=new Array(e),this.numberOfElements=-1,this.getElementValue=t}return e.prototype.enqueue=function(e){this.priorityQueue[++this.numberOfElements]=e,this.swim(this.numberOfElements)},e.prototype.dequeue=function(){var e=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,e},e.prototype.empty=function(){return-1===this.numberOfElements},e.prototype.size=function(){return this.numberOfElements+1},e.prototype.all=function(){return this.priorityQueue.slice(0,this.numberOfElements+1)},e.prototype.max=function(){return this.priorityQueue[0]},e.prototype.swim=function(e){for(;e>0&&this.less(s(e),e);)this.exchange(e,s(e)),e=s(e)},e.prototype.sink=function(e){for(;2*e<=this.numberOfElements;){var t=2*e;if(t<this.numberOfElements&&this.less(t,t+1)&&t++,!this.less(e,t))break;this.exchange(e,t),e=t}},e.prototype.getValueAt=function(e){return this.getElementValue(this.priorityQueue[e])},e.prototype.less=function(e,t){return this.getValueAt(e)<this.getValueAt(t)},e.prototype.exchange=function(e,t){var n=this.priorityQueue[e];this.priorityQueue[e]=this.priorityQueue[t],this.priorityQueue[t]=n},e}();function c(e,t,n,r,i,o){for(var a=o.shape,s=a[0],u=a[1],c=!0,l=Math.max(n-i,0),f=Math.min(n+i+1,s),h=l;h<f;++h){for(var d=Math.max(r-i,0),p=Math.min(r+i+1,u),m=d;m<p;++m)if(o.get(h,m,e)>t){c=!1;break}if(!c)break}return c}var l=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],f=l.length,h=l.reduce(function(e,t,n){return e[t]=n,e},{}),d=[["nose","leftEye"],["leftEye","leftEar"],["nose","rightEye"],["rightEye","rightEar"],["nose","leftShoulder"],["leftShoulder","leftElbow"],["leftElbow","leftWrist"],["leftShoulder","leftHip"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["nose","rightShoulder"],["rightShoulder","rightElbow"],["rightElbow","rightWrist"],["rightShoulder","rightHip"],["rightHip","rightKnee"],["rightKnee","rightAnkle"]],p=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]].map(function(e){var t=e[0],n=e[1];return[h[t],h[n]]}),m=["left_face","right_face","right_upper_leg_front","right_lower_leg_back","right_upper_leg_back","left_lower_leg_front","left_upper_leg_front","left_upper_leg_back","left_lower_leg_back","right_feet","right_lower_leg_front","left_feet","torso_front","torso_back","right_upper_arm_front","right_upper_arm_back","right_lower_arm_back","left_lower_arm_front","left_upper_arm_front","left_upper_arm_back","left_lower_arm_back","right_hand","right_lower_arm_front","left_hand"];function v(e,t,n,r){return{y:r.get(e,t,n),x:r.get(e,t,n+f)}}function g(e,t,n){var r=v(e.heatmapY,e.heatmapX,e.id,n),i=r.y,o=r.x;return{x:e.heatmapX*t+o,y:e.heatmapY*t+i}}function y(e,t,n){return e<t?t:e>n?n:e}function b(e,t){return{x:e.x+t.x,y:e.y+t.y}}var w=d.map(function(e){var t=e[0],n=e[1];return[h[t],h[n]]}),x=w.map(function(e){return e[1]}),_=w.map(function(e){return e[0]});
1function k(e,t,n,r){return{y:y(Math.round(e.y/t),0,n-1),x:y(Math.round(e.x/t),0,r-1)}}function S(e,t,n,r,i,o,a,s){void 0===s&&(s=2);for(var u=r.shape,c=u[0],f=u[1],h=function(e,t,n){var r=n.shape[2]/2;return{y:n.get(t.y,t.x,e),x:n.get(t.y,t.x,r+e)}}(e,k(t.position,o,c,f),a),d=b(t.position,h),p=0;p<s;p++){var m=k(d,o,c,f),g=v(m.y,m.x,n,i);d=b({x:m.x*o,y:m.y*o},{x:g.x,y:g.y})}var y=k(d,o,c,f),w=r.get(y.y,y.x,n);return{position:d,part:l[n],score:w}}function E(e,t,n,r,i,o){var a=t.shape[2],s=x.length,u=new Array(a),c=e.part,f=e.score,h=g(c,r,n);u[c.id]={score:f,part:l[c.id],position:h};for(var d=s-1;d>=0;--d){var p=x[d],m=_[d];u[p]&&!u[m]&&(u[m]=S(d,u[p],m,t,n,r,o))}for(d=0;d<s;++d)p=_[d],m=x[d],u[p]&&!u[m]&&(u[m]=S(d,u[p],m,t,n,r,i));return u}function C(e,t,n,r){var i=n.x,o=n.y;return e.some(function(e){var n=e.keypoints[r].position;return function(e,t,n,r){var i=n-e,o=r-t;return i*i+o*o}(o,i,n.y,n.x)<=t})}function N(e,t,n){return n.reduce(function(n,r,i){var o=r.position,a=r.score;return C(e,t,o,i)||(n+=a),n},0)/n.length}var O=1;function A(e,t,n,r,i,o,a,s){void 0===a&&(a=.5),void 0===s&&(s=20);for(var l=[],f=function(e,t,n){for(var r=n.shape,i=r[0],o=r[1],a=r[2],s=new u(i*o*a,function(e){return e.score}),l=0;l<i;++l)for(var f=0;f<o;++f)for(var h=0;h<a;++h){var d=n.get(l,f,h);d<e||c(h,d,l,f,t,n)&&s.enqueue({score:d,part:{heatmapY:l,heatmapX:f,id:h}})}return s}(a,O,e),h=s*s;l.length<o&&!f.empty();){var d=f.dequeue();if(!C(l,h,g(d.part,i,t),d.part.id)){var p=E(d,e,t,i,n,r),m=N(l,h,p);l.push({keypoints:p,score:m})}}return l}function T(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function I(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function R(e,t){return p.reduce(function(n,r){var i=r[0],o=r[1];return function(e,t,n){return e<n||t<n}(e[i].score,e[o].score,t)?n:(n.push([e[i],e[o]]),n)},[])}var M=Number.NEGATIVE_INFINITY,D=Number.POSITIVE_INFINITY;function j(e){return e.reduce(function(e,t){var n=e.maxX,r=e.maxY,i=e.minX,o=e.minY,a=t.position,s=a.x,u=a.y;return{maxX:Math.max(n,s),maxY:Math.max(r,u),minX:Math.min(i,s),minY:Math.min(o,u)}},{maxX:M,maxY:M,minX:D,minY:D})}function P(e){var t=j(e),n=t.minX,r=t.minY,i=t.maxX,o=t.maxY;return[{x:n,y:r},{x:i,y:r},{x:i,y:o},{x:n,y:o}]}function z(e,t){return void 0===t&&(t="float32"),T(this,void 0,void 0,function(){var n;return I(this,function(i){switch(i.label){case 0:return[4,e.data()];case 1:return n=i.sent(),[2,Object(r.buffer)(e.shape,t,n)]}})})}function L(e){return T(this,void 0,void 0,function(){return I(this,function(t){return[2,Promise.all(e.map(function(e){return z(e,"float32")}))]})})}function B(e,t,n,r,i){return void 0===r&&(r=0),void 0===i&&(i=0),{score:e.score,keypoints:e.keypoints.map(function(e){var o=e.score,a=e.part,s=e.position;return{score:o,part:a,position:{x:s.x*n+i,y:s.y*t+r}}})}}function F(e){return e instanceof r.Tensor?[e.shape[0],e.shape[1]]:[e.height,e.width]}function U(e,t,n){var i=t[0],o=t[1];void 0===n&&(n=!1);var a=F(e),s=a[0],u=a[1],c=o/i,l=[0,0,0,0],f=l[0],h=l[1],d=l[2],p=l[3];u/s<c?(f=0,h=0,d=Math.round(.5*(c*s-u)),p=Math.round(.5*(c*s-u))):(f=Math.round(.5*(1/c*u-s)),h=Math.round(.5*(1/c*u-s)),d=0,p=0);var m=function(e){return e instanceof r.Tensor?e:r.browser.fromPixels(e)}(e);return m=Object(r.pad3d)(m,[[f,h],[d,p],[0,0]]),{resized:n?m.reverse(1).resizeBilinear([i,o]):m.resizeBilinear([i,o]),paddedBy:[[f,h],[d,p]]}}function W(e){var t=e.shape,n=t[0],i=t[1],o=t[2];return Object(r.tidy)(function(){var t=e.reshape([n*i,o]).argMax(0),a=t.div(Object(r.scalar)(i,"int32")).expandDims(1),s=function(e,t){return Object(r.tidy)(function(){var n=e.div(Object(r.scalar)(t,"int32"));return e.sub(n.mul(Object(r.scalar)(t,"int32")))})}(t,i).expandDims(1);return Object(r.concat)([a,s],1)})}function V(e,t,n,r){return{y:r.get(e,t,n),x:r.get(e,t,n+f)}}function q(e,t,n){return Object(r.tidy)(function(){var i=function(e,t){for(var n=[],i=0;i<f;i++){var o=V(e.get(i,0).valueOf(),e.get(i,1).valueOf(),i,t),a=o.x,s=o.y;n.push(s),n.push(a)}return Object(r.tensor2d)(n,[f,2])}(e,n);
1return e.toTensor().mul(Object(r.scalar)(t,"int32")).toFloat().add(i)})}function H(e,t,n){return T(this,void 0,void 0,function(){var r,i,o,a,s,u,c,f,h,d;return I(this,function(p){switch(p.label){case 0:return r=0,i=W(e),[4,Promise.all([z(e),z(t),z(i,"int32")])];case 1:return o=p.sent(),a=o[0],s=o[1],u=o[2],[4,z(c=q(u,n,s))];case 2:return f=p.sent(),h=Array.from(function(e,t){for(var n=t.shape[0],r=new Float32Array(n),i=0;i<n;i++){var o=t.get(i,0),a=t.get(i,1);r[i]=e.get(o,a,i)}return r}(a,u)),d=h.map(function(e,t){return r+=e,{position:{y:f.get(t,0),x:f.get(t,1)},part:l[t],score:e}}),i.dispose(),c.dispose(),[2,{keypoints:d,score:r/d.length}]}})})}var G="https://storage.googleapis.com/tfjs-models/savedmodel/posenet/mobilenet/",K="https://storage.googleapis.com/tfjs-models/savedmodel/posenet/resnet50/";var $=function(){function e(e,t,n){this.model=e;var i=this.model.inputs[0].shape;r.util.assert(!(i[1]!==t&&-1!==i[1]||i[2]!==t&&-1!==i[2]),function(){return"Input shape ["+i[1]+", "+i[2]+"] must both be equal to "+t+" or -1"}),this.inputResolution=t,this.outputStride=n}return e.prototype.predict=function(e){var t=this;return Object(r.tidy)(function(){var n=function(e){return Object(r.tidy)(function(){"int32"===e.dtype&&(e=e.toFloat());var t=Object(r.tensor)([-123.15,-115.9,-103.06]);return e.add(t)})}(e).expandDims(0),i=t.model.predict(n),o=i[0],a=i[1],s=i[2];return{heatmapScores:i[3].squeeze().sigmoid(),offsets:s.squeeze(),displacementFwd:o.squeeze(),displacementBwd:a.squeeze()}})},e.prototype.dispose=function(){this.model.dispose()},e}(),X={architecture:"MobileNetV1",outputStride:16,inputResolution:513,multiplier:.75};var Y={flipHorizontal:!1,decodingMethod:"multi-person",maxDetections:5,scoreThreshold:.5,nmsRadius:20};var J=function(){function e(e){this.baseModel=e}return e.prototype.estimatePoses=function(e,t){return void 0===t&&(t=Y),T(this,void 0,void 0,function(){var n,i,a,s,u,c,l,f,h,d,p,m,v,g,y,b,w,x,_,k,S,E,C,N,O,T,R=this;return I(this,function(I){switch(I.label){case 0:return t=function(e){var t=["single-person","multi-person"];if(null==(e=e||Y).flipHorizontal&&(e.flipHorizontal=!1),null==e.decodingMethod&&(e.decodingMethod="multi-person"),t.indexOf(e.decodingMethod)<0)throw new Error("Invalid decoding method "+e.decodingMethod+". Should be one of "+t);if("multi-person"===e.decodingMethod){if(null==e.maxDetections&&(e.maxDetections=5),e.maxDetections<=0)throw new Error("Invalid maxDetections "+e.maxDetections+". Should be > 0 for decodingMethod "+e.decodingMethod+".");if(null==e.scoreThreshold&&(e.scoreThreshold=.5),e.scoreThreshold<0||e.scoreThreshold>1)throw new Error("Invalid scoreThreshold "+e.scoreThreshold+". Should be in range [0.0, 1.0] for decodingMethod "+e.decodingMethod+".");if(null==e.nmsRadius&&(e.nmsRadius=20),e.nmsRadius<=0)throw new Error("Invalid nmsRadius "+e.nmsRadius+". Should be positive for decodingMethod "+e.decodingMethod+".")}return e}(t),n=this.baseModel.outputStride,i=this.baseModel.inputResolution,function(e){r.util.assert("number"==typeof e,function(){return"outputStride is not a number"}),r.util.assert(o.indexOf(e)>=0,function(){return"outputStride of "+e+" is invalid. It must be either 8, 16, or 32"})}(n),function(e,t){r.util.assert("number"==typeof e,function(){return"resolution is not a number"}),r.util.assert((e-1)%t==0,function(){return"resolution of "+e+" is invalid for output stride "+t+"."})}(this.baseModel.inputResolution,n),a=F(e),s=a[0],u=a[1],l=(c=[0,0])[0],f=c[1],d=(h=[0,0,0,0])[0],p=h[1],m=h[2],v=h[3],l=i,f=i,x=Object(r.tidy)(function(){var t=U(e,[l,f]),n=t.resized,r=t.paddedBy;return d=r[0][0],p=r[0][1],m=r[1][0],v=r[1][1],R.baseModel.predict(n)}),g=x.heatmapScores,y=x.offsets,b=x.displacementFwd,w=x.displacementBwd,[4,L([g,y,b,w])];case 1:return _=I.sent(),k=_[0],S=_[1],E=_[2],C=_[3],"multi-person"!==t.decodingMethod?[3,3]:[4,A(k,S,E,C,n,t.maxDetections,t.scoreThreshold,t.nmsRadius)];case 2:return N=I.sent(),[3,5];case 3:return[4,H(g,y,n)];case 4:O=I.sent(),N=[O],I.label=5;case 5:return T=function(e,t,n,r,i){return void 0===r&&(r=0),void 0===i&&(i=0),1===n&&1===t&&0===r&&0===i?e:e.map(function(e){return B(e,t,n,r,i)})}(N,(s+d+p)/l,(u+m+v)/f,-d,-m),t.flipHorizontal&&(T=function(e,t){return t<=0?e:e.map(function(e){return function(e,t){return{score:e.score,keypoints:e.keypoints.map(function(e){var n=e.score,r=e.part,i=e.position;return{score:n,part:r,position:{x:t-1-i.x,y:i.y}}})}}(e,t)})}(T,u)),g.dispose(),y.dispose(),b.dispose(),w.dispose(),[2,T]}})})},e.prototype.dispose=function(){this.baseModel.dispose()},e}();function Z(e){return T(this,void 0,void 0,function(){var t,n,o,s,u,c,l;return I(this,function(f){switch(f.label){case 0:if(t=e.inputResolution,n=e.outputStride,o=e.quantBytes,s=e.multiplier,null==r)throw new Error("Cannot find TensorFlow.js. If you are using a <script> tag, please also include @tensorflow/tfjs on the page before using this\n model.");return u=function(e,t,n,r){var i={1:"100",.75:"075",.5:"050"},o="model-stride"+t+".json";return 4==r?G+"float/"+i[n]+"/"+o:G+"quant"+r+"/"+i[n]+"/"+o}(0,n,s,o),[4,Object(i.c)(e.modelUrl||u)];
1case 1:return c=f.sent(),l=new a(c,t,n),[2,new J(l)]}})})}function Q(e){return T(this,void 0,void 0,function(){var t,n,o,a,s,u;return I(this,function(c){switch(c.label){case 0:if(t=e.inputResolution,n=e.outputStride,o=e.quantBytes,null==r)throw new Error("Cannot find TensorFlow.js. If you are using a <script> tag, please also include @tensorflow/tfjs on the page before using this\n model.");return a=function(e,t){var n="model-stride"+e+".json";return 4==t?K+"float/"+n:K+"quant"+t+"/"+n}(n,o),[4,Object(i.c)(e.modelUrl||a)];case 1:return s=c.sent(),u=new $(s,t,n),[2,new J(u)]}})})}function ee(e){return void 0===e&&(e=X),T(this,void 0,void 0,function(){return I(this,function(t){return"ResNet50"===(e=function(e){var t=["MobileNetV1","ResNet50"],n={MobileNetV1:[8,16,32],ResNet50:[32,16]},r=[161,193,257,289,321,353,385,417,449,481,513,801],i={MobileNetV1:[.5,.75,1],ResNet50:[1]},o=[1,2,4];if(null==(e=e||X).architecture&&(e.architecture="MobileNetV1"),t.indexOf(e.architecture)<0)throw new Error("Invalid architecture "+e.architecture+". Should be one of "+t);if(null==e.outputStride&&(e.outputStride=16),n[e.architecture].indexOf(e.outputStride)<0)throw new Error("Invalid outputStride "+e.outputStride+". Should be one of "+n[e.architecture]+" for architecutre "+e.architecture+".");if(null==e.inputResolution&&(e.inputResolution=513),r.indexOf(e.inputResolution)<0)throw new Error("Invalid inputResolution "+e.inputResolution+". Should be one of "+r+" for architecutre "+e.architecture+".");if(null==e.multiplier&&(e.multiplier=1),i[e.architecture].indexOf(e.multiplier)<0)throw new Error("Invalid multiplier "+e.multiplier+". Should be one of "+i[e.architecture]+" for architecutre "+e.architecture+".");if(null==e.quantBytes&&(e.quantBytes=4),o.indexOf(e.quantBytes)<0)throw new Error("Invalid quantBytes "+e.quantBytes+". Should be one of "+o+" for architecutre "+e.architecture+".");return e}(e)).architecture?[2,Q(e)]:"MobileNetV1"===e.architecture?[2,Z(e)]:[2,null]})})}},function(e,t,n){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!==typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,i)});default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick(function(){e.apply(null,o)})}}}:e.exports=t}).call(this,n(31))},function(e,t,n){var r=n(7).Buffer;function i(e){r.isBuffer(e)||(e=r.from(e));for(var t=e.length/4|0,n=new Array(t),i=0;i<t;i++)n[i]=e.readUInt32BE(4*i);return n}function o(e){for(;0<e.length;e++)e[0]=0}function a(e,t,n,r,i){for(var o,a,s,u,c=n[0],l=n[1],f=n[2],h=n[3],d=e[0]^t[0],p=e[1]^t[1],m=e[2]^t[2],v=e[3]^t[3],g=4,y=1;y<i;y++)o=c[d>>>24]^l[p>>>16&255]^f[m>>>8&255]^h[255&v]^t[g++],a=c[p>>>24]^l[m>>>16&255]^f[v>>>8&255]^h[255&d]^t[g++],s=c[m>>>24]^l[v>>>16&255]^f[d>>>8&255]^h[255&p]^t[g++],u=c[v>>>24]^l[d>>>16&255]^f[p>>>8&255]^h[255&m]^t[g++],d=o,p=a,m=s,v=u;return o=(r[d>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&v])^t[g++],a=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[v>>>8&255]<<8|r[255&d])^t[g++],s=(r[m>>>24]<<24|r[v>>>16&255]<<16|r[d>
vendor: 38,338 bytes, line 1
1>>8&255]<<8|r[255&p])^t[g++],u=(r[v>>>24]<<24|r[d>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^t[g++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,n[a]=c,r[c]=a;var l=e[a],f=e[l],h=e[f],d=257*e[c]^16843008*c;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*f^257*l^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=l^e[e[e[h^l]]],s^=e[e[s]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=i(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),i=[],o=0;o<t;o++)i[o]=e[o];for(o=t;o<r;o++){var a=i[o-1];o%t===0?(a=a<<8|a>>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t===4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-t]^a}for(var c=[],l=0;l<r;l++){var f=r-l,h=i[f-(l%4?0:4)];c[l]=l<4||f<=4?h:u.INV_SUB_MIX[0][u.SBOX[h>>>24]]^u.INV_SUB_MIX[1][u.SBOX[h>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[h>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&h]]}this._nRounds=n,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=r.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},c.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var n=a(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=r.allocUnsafe(16);return o.writeUInt32BE(n[0],0),o.writeUInt32BE(n[3],4),o.writeUInt32BE(n[2],8),o.writeUInt32BE(n[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},function(e,t,n){var r=n(7).Buffer,i=n(58);e.exports=function(e,t,n,o){if(r.isBuffer(e)||(e=r.from(e,"binary")),t&&(r.isBuffer(t)||(t=r.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,s=r.alloc(a),u=r.alloc(o||0),c=r.alloc(0);a>0||o>0;){var l=new i;l.update(c),l.update(e),t&&l.update(t),c=l.digest();var f=0;if(a>0){var h=s.length-a;f=Math.min(a,c.length),c.copy(s,h,0,f),a-=f}if(f<c.length&&o>0){var d=u.length-o,p=Math.min(o,c.length-f);c.copy(u,d,f,f+p),o-=p}}return c.fill(0),{key:s,iv:u}}},function(e,t,n){"use strict";var r=t;r.base=n(189),r.short=n(190),r.mont=n(191),r.edwards=n(192)},function(e,t,n){var r=n(208),i=n(219),o=n(220),a=n(67),s=n(92),u=n(7).Buffer;function c(e){var t;"object"!==typeof e||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"===typeof e&&(e=u.from(e));var n,c,l=o(e,t),f=l.tag,h=l.data;switch(f){case"CERTIFICATE":c=r.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=r.PublicKey.decode(h,"der")),n=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=r.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+f);case"ENCRYPTED PRIVATE KEY":h=function(e,t){var n=e.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[e.algorithm.decrypt.cipher.algo.join(".")],c=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,f=parseInt(o.split("-")[1],10)/8,h=s.pbkdf2Sync(t,n,r,f,"sha1"),d=a.createDecipheriv(o,h,c),p=[];return p.push(d.update(l)),p.push(d.final()),u.concat(p)}(h=r.EncryptedPrivateKey.decode(h,"der"),t);case"PRIVATE KEY":switch(n=(c=r.PrivateKey.decode(h,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:r.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=r.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+f);case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return{curve:(h=r.ECPrivateKey.decode(h,"der")).parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+f)}}e.exports=c,c.signature=r.signature},function(e,t,n){"use strict";n.r(t),function(e,r){n.d(t,"array",function(){return Z}),n.d(t,"Dataset",function(){return Y}),n.d(t,"zip",function(){return Q}),n.d(t,"CSVDataset",function(){return ue}),n.d(t,"TextLineDataset",function(){return ne}),n.d(t,"csv",function(){return _e}),n.d(t,"func",function(){return ke}),n.d(t,"generator",function(){return Se}),n.d(t,"webcam",function(){return Ee}),n.d(t,"FileDataSource",function(){return we}),n.d(t,"URLDataSource",function(){return xe}),n.d(t,"version_data",function(){return Ce});var i=n(0),o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function a(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function s(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function u(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}"undefined"!=typeof window?window:"undefined"!=typeof e||"undefined"!=typeof self&&self;function c(e,t){return e(t={exports:{}},t.exports),t.exports}var l=c(function(e){!function(e,t,n){function r(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function i(e,t){var n=new function(e){var t,n=this,r=(t=4022871197,function(e){e=e.toString();for(var n=0;n<e.length;n++){var r=.02519603282416938*(t+=e.charCodeAt(n));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}(e),i=t&&t.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+1.1102230246251565e-16*(2097152*o()|0)},o.quick=o,i&&("object"==typeof i&&r(i,n),o.state=function(){return r(n,{})}),o}t&&t.exports?t.exports=i:this.alea=i}(0,e)}),f=c(function(e){!function(e,t,n){function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function i(e,t){var n=new function(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),t.next()}(e),i=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&r(i,n),o.state=function(){return r(n,{})}),o}t&&t.exports?t.exports=i:this.xor128=i}(0,e)}),h=c(function(e){!function(e,t,n){function r(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function i(e,t){var n=new function(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}(e),i=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&r(i,n),o.state=function(){return r(n,{})}),o}t&&t.exports?t.exports=i:this.xorwow=i}(0,e)}),d=c(function(e){!function(e,t,n){function r(e,t){return t.x=e.x.slice(),t.i=e.i,t}function i(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.x,i=t.i;return e=r[i],n=(e^=e>>>7)^e<<24,n^=(e=r[i+1&7])^e>>>10,n^=(e=r[i+3&7])^e>>>3,n^=(e=r[i+4&7])^e<<7,e=r[i+7&7],n^=(e^=e<<13)^e<<9,r[i]=n,t.i=i+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}(e),i=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,i&&(i.x&&r(i,n),o.state=function(){return r(n,{})}),o}t&&t.exports?t.exports=i:this.xorshift7=i}(0,e)}),p=c(function(e){!function(e,t,n){function r(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function i(e,t){null==e&&(e=+new Date);var n=new function(e){var t=this;t.next=function(){var e,n,r=t.w,i=t.X,o=t.i;return t.w=r=r+1640531527|0,n=i[o+34&127],e=i[o=o+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=i[o]=n^e,t.i=o,n+(r^r>>>16)|0},function(e,t){var n,r,i,o,a,s=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),i=0,o=-32;o<u;++o)t&&(r^=t.charCodeAt((o+32)%t.length)),0===o&&(a=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,o>=0&&(a=a+1640531527|0,i=0==(n=s[127&o]^=r+a)?i+1:0);for(i>=128&&(s[127&(t&&t.length||0)]=-1),i=127,o=512;o>0;--o)r=s[i+34&127],n=s[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[i]=r^n;e.w=a,e.X=s,e.i=i}(t,e)}(e),i=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,i&&(i.X&&r(i,n),o.state=function(){return r(n,{})}),o}t&&t.exports?t.exports=i:this.xor4096=i}(0,e)}),m=c(function(e){!function(e,t,n){function r(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function i(e,t){var n=new function(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,i=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^i,t.a=i-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}(e),i=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&r(i,n),o.state=function(){return r(n,{})}),o}t&&t.exports?t.exports=i:this.tychei=i}(0,e)}),v=c(function(e){!function(t,r){var i,o=this,a=256,s=6,u="random",c=r.pow(a,s),l=r.pow(2,52),f=2*l,h=a-1;function d(e,n,d){var g=[],y=m(function e(t,n){var r,i=[],o=typeof t;if(n&&"object"==o)for(r in t)try{i.push(e(t[r],n-1))}catch(e){}return i.length?i:"string"==o?t:t+"\0"}((n=1==n?{entropy:!0}:n||{}).entropy?[e,v(t)]:null==e?function(){try{var e;return i&&(e=i.randomBytes)?e=e(a):(e=new Uint8Array(a),(o.crypto||o.msCrypto).getRandomValues(e)),v(e)}catch(e){var n=o.navigator,r=n&&n.plugins;return[+new Date,o,r,o.screen,v(t)]}}():e,3),g),b=new function(e){var t,n=e.length,r=this,i=0,o=r.i=r.j=0,s=r.S=[];for(n||(e=[n++]);i<a;)s[i]=i++;for(i=0;i<a;i++)s[i]=s[o=h&o+e[i%n]+(t=s[i])],s[o]=t;(r.g=function(e){for(var t,n=0,i=r.i,o=r.j,s=r.S;e--;)t=s[i=h&i+1],n=n*a+s[h&(s[i]=s[o=h&o+t])+(s[o]=t)];return r.i=i,r.j=o,n})(a)}(g),w=function(){for(var e=b.g(s),t=c,n=0;e<l;)e=(e+n)*a,t*=a,n=b.g(1);for(;e>=f;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|b.g(4)},w.quick=function(){return b.g(4)/4294967296},w.double=w,m(v(b.S),t),(n.pass||d||function(e,t,n,i){return i&&(i.S&&p(i,b),e.state=function(){return p(b,{})}),n?(r[u]=e,t):e})(w,y,"global"in n?n.global:this==r,n.state)}function p(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function m(e,t){for(var n,r=e+"",i=0;i<r.length;)t[h&i]=h&(n^=19*t[h&i])+r.charCodeAt(i++);return v(t)}function v(e){return String.fromCharCode.apply(0,e)}if(r["seed"+u]=d,m(r.random(),t),e.exports){e.exports=d;try{i=n(81)}catch(e){}}}([],Math)});v.alea=l,v.xor128=f,v.xorwow=h,v.xorshift7=d,v.xor4096=p,v.tychei=m;var g=v.alea;function y(e,t,n,r){if(void 0===n&&(n=new Map),void 0===r&&(r=new Set),null==e)return null;if(r.has(e))throw new Error("Circular references are not supported.");if(n.has(e))return n.get(e);var i=t(e);if(i.recurse&&null!==i.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(i.recurse){if(_(e)){var o=Array.isArray(e)?[]:{};for(var a in r.add(e),e){var s=y(e[a],t,n,r);o[a]=s}return r.delete(e),o}throw new Error("Can't recurse into non-iterable type: "+e)}return n.set(e,i.value),i.value}function b(e,t){return void 0===t&&(t=w),function e(t,n,r){void 0===r&&(r=new Set);var i=t[0];if(r.has(i))throw new Error("Circular references are not supported.");var o=n(t);if(o.recurse&&null!==o.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(o.recurse){if(_(i)){var a=Array.isArray(i)?[]:{};r.add(i);var s=function(i){var o=e(t.map(function(e){return e[i]}),n,r);a[i]=o};for(var u in i)s(u);return r.delete(i),a}throw new Error("Can't recurse into non-iterable type: "+i)}return o.value}(e,t)}function w(e){return null===e?null:_(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function x(e,t){return s(this,void 0,void 0,function(){var n,r,i,o,a,s;return u(this,function(u){switch(u.label){case 0:n=new Map,y(e,t,n),r=0,i=Array.from(n.keys()),u.label=1;case 1:return r<i.length?(o=i[r],(a=n.get(o))instanceof Promise?[4,a]:[3,3]):[3,4];case 2:s=u.sent(),n.set(o,s),u.label=3;case 3:return r++,[3,1];case 4:return[2,y(e,t,n)]}})})}function _(e){return null!=e&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof i.Tensor))}function k(e){return function(e,t){return y(e,t)}(e,S)}function S(e){return e instanceof i.Tensor?{value:e.clone(),recurse:!1}:_(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}var E=function(){function e(e){if(this.capacity=e,this.begin=0,this.end=0,null==e)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(e<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(e),this.doubledCapacity=2*e}return e.prototype.wrap=function(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity},e.prototype.get=function(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]},e.prototype.set=function(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t},e.prototype.length=function(){var e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e},e.prototype.isFull=function(){return this.length()===this.capacity},e.prototype.isEmpty=function(){return 0===this.length()},e.prototype.push=function(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)},e.prototype.pushAll=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];this.push(r)}},e.prototype.pop=function(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);var e=this.get(this.end);return this.set(this.end,void 0),e},e.prototype.unshift=function(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)},e.prototype.shift=function(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");var e=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),e},e.prototype.shuffleExcise=function(e){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");var t=this.wrap(this.begin+e),n=this.get(t);return this.set(t,this.pop()),n},e}(),C=function(e){function t(){return e.call(this,t.INITIAL_CAPACITY)||this}return a(t,e),t.prototype.isFull=function(){return!1},t.prototype.push=function(t){e.prototype.isFull.call(this)&&this.expand(),e.prototype.push.call(this,t)},t.prototype.unshift=function(t){e.prototype.isFull.call(this)&&this.expand(),e.prototype.unshift.call(this,t)},t.prototype.expand=function(){for(var e=2*this.capacity,t=new Array(e),n=this.length(),r=0;r<n;r++)t[r]=this.get(this.wrap(this.begin+r));this.data=t,this.capacity=e,this.doubledCapacity=2*this.capacity,this.begin=0,this.end=n},t.INITIAL_CAPACITY=32,t}(E);function N(e){return new D(e)}function O(e){return new j(e)}function A(e,t){return new G(e,t)}function T(e,t){return void 0===t&&(t=I.FAIL),new K(e,t)}var I,R,M=function(){function e(){}return e.prototype.toArray=function(){return s(this,void 0,void 0,function(){var e,t;return u(this,function(n){switch(n.label){case 0:return e=[],[4,this.next()];case 1:t=n.sent(),n.label=2;case 2:return t.done?[3,4]:(e.push(t.value),[4,this.next()]);case 3:return t=n.sent(),[3,2];case 4:return[2,e]}})})},e.prototype.toArrayForTest=function(){return s(this,void 0,void 0,function(){var e,t,n;return u(this,function(r){switch(r.label){case 0:return e=this.prefetch(100),t=[],[4,e.next()];case 1:n=r.sent(),r.label=2;case 2:return n.done?[3,4]:(t.push(n.value),[4,e.next()]);case 3:return n=r.sent(),[3,2];case 4:return[2,t]}})})},e.prototype.resolveFully=function(){return s(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.next()];case 1:e=t.sent(),t.label=2;case 2:return e.done?[3,4]:[4,this.next()];case 3:return e=t.sent(),[3,2];case 4:return[2]}})})},e.prototype.resolveWhile=function(e){return s(this,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return[4,this.next()];case 1:t=r.sent(),n=e(t.value),r.label=2;case 2:return t.done||!n?[3,4]:[4,this.next()];case 3:return t=r.sent(),n=e(t.value),[3,2];case 4:return[2]}})})},e.prototype.handleErrors=function(e){return new W(this,e)},e.prototype.filter=function(e){return new F(this,e)},e.prototype.map=function(e){return new U(this,e)},e.prototype.mapAsync=function(e){return new V(this,e)},e.prototype.serialMapAsync=function(e){return new V(this,e).serial()},e.prototype.flatmap=function(e){return new H(this,e)},e.prototype.forEachAsync=function(e){return s(this,void 0,void 0,function(){return u(this,function(t){return[2,this.map(e).resolveFully()]})})},e.prototype.serialForEach=function(e){return s(this,void 0,void 0,function(){return u(this,function(t){return[2,this.serialMapAsync(e).resolveWhile(function(e){return!0===e})]})})},e.prototype.rowMajorBatch=function(e,t){return void 0===t&&(t=!0),new B(this,e,t)},e.prototype.columnMajorBatch=function(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=w),this.rowMajorBatch(e,t).map(function(e){return b(e,n)})},e.prototype.concatenate=function(e,t){return new G(N([this,e]),t)},e.prototype.take=function(e){return e<0||null==e?this:new L(this,e)},e.prototype.skip=function(e){return e<0||null==e?this:new z(this,e)},e.prototype.prefetch=function(e){return new $(this,e)},e.prototype.shuffle=function(e,t){return new X(this,e,t)},e.prototype.serial=function(){return new P(this)},e}(),D=function(e){function t(t){var n=e.call(this)||this;return n.items=t,n.trav=0,n}return a(t,e),t.prototype.summary=function(){return"Array of "+this.items.length+" items"},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e;return u(this,function(t){return this.trav>=this.items.length?[2,{value:null,done:!0}]:(e=this.items[this.trav],this.trav++,[2,{value:k(e),done:!1}])})})},t}(M),j=function(e){function t(t){var n=e.call(this)||this;return n.nextFn=t,n}return a(t,e),t.prototype.summary=function(){return"Function call"},t.prototype.next=function(){return s(this,void 0,void 0,function(){return u(this,function(e){try{return[2,this.nextFn()]}catch(e){throw e.message="Error thrown while iterating through a dataset: "+e.message,e}return[2]})})},t}(M),P=function(e){function t(t){var n=e.call(this)||this;return n.upstream=t,n.lastRead=Promise.resolve({value:null,done:!1}),n}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> Serial"},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e=this;return u(this,function(t){return this.lastRead=this.lastRead.then(function(){return e.serialNext()}),[2,this.lastRead]})})},t.prototype.serialNext=function(){return s(this,void 0,void 0,function(){return u(this,function(e){return[2,this.upstream.next()]})})},t}(M),z=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.maxCount=n,r.count=0,r.lastRead=Promise.resolve({value:null,done:!1}),r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> Skip"},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e=this;return u(this,function(t){return this.lastRead=this.lastRead.then(function(){return e.serialNext()}),[2,this.lastRead]})})},t.prototype.serialNext=function(){return s(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return this.count++<this.maxCount?[4,this.upstream.next()]:[3,2];case 1:return(e=t.sent()).done?[2,e]:(Object(i.dispose)(e.value),[3,0]);case 2:return[2,this.upstream.next()]}})})},t}(M),L=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.maxCount=n,r.count=0,r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> Take"},t.prototype.next=function(){return s(this,void 0,void 0,function(){return u(this,function(e){return this.count++>=this.maxCount?[2,{value:null,done:!0}]:[2,this.upstream.next()]})})},t}(M),B=function(e){function t(t,n,r){void 0===r&&(r=!0);var i=e.call(this)||this;return i.upstream=t,i.batchSize=n,i.enableSmallLastBatch=r,i.lastRead=Promise.resolve({value:null,done:!1}),i}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> RowMajorBatch"},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e=this;return u(this,function(t){return this.lastRead=this.lastRead.then(function(){return e.serialNext()}),[2,this.lastRead]})})},t.prototype.serialNext=function(){return s(this,void 0,void 0,function(){var e,t;return u(this,function(n){switch(n.label){case 0:e=[],n.label=1;case 1:return e.length<this.batchSize?[4,this.upstream.next()]:[3,3];case 2:return(t=n.sent()).done?this.enableSmallLastBatch&&e.length>0?[2,{value:e,done:!1}]:[2,{value:null,done:!0}]:(e.push(t.value),[3,1]);case 3:return[2,{value:e,done:!1}]}})})},t}(M),F=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.predicate=n,r.lastRead=Promise.resolve({value:null,done:!1}),r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> Filter"},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e=this;return u(this,function(t){return this.lastRead=this.lastRead.then(function(){return e.serialNext()}),[2,this.lastRead]})})},t.prototype.serialNext=function(){return s(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.upstream.next()];case 1:return(e=t.sent()).done||this.predicate(e.value)?[2,e]:(Object(i.dispose)(e.value),[3,0]);case 2:return[2]}})})},t}(M),U=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.transform=n,r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> Map"},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e,t,n,r,o,a,s;return u(this,function(u){switch(u.label){case 0:return[4,this.upstream.next()];case 1:if((e=u.sent()).done)return[2,{value:null,done:!0}];for(t=i.tensor_util.getTensorsInContainer(e.value),n=this.transform(e.value),r=i.tensor_util.getTensorsInContainer(n),o=0,a=t;o<a.length;o++)s=a[o],i.tensor_util.isTensorInList(s,r)||s.dispose();return[2,{value:n,done:!1}]}})})},t}(M),W=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.handler=n,r.count=0,r.lastRead=Promise.resolve({value:null,done:!1}),r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> handleErrors"},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e=this;return u(this,function(t){return this.lastRead=this.lastRead.then(function(){return e.serialNext()}),[2,this.lastRead]})})},t.prototype.serialNext=function(){return s(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.upstream.next()];case 2:return[2,t.sent()];case 3:return e=t.sent(),this.handler(e)?[3,4]:[2,{value:null,done:!0}];case 4:return[3,0];case 5:return[2]}})})},t}(M),V=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.transform=n,r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> AsyncMap"},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e,t,n,r,o,a,s;return u(this,function(u){switch(u.label){case 0:return[4,this.upstream.next()];case 1:return(e=u.sent()).done?[2,{value:null,done:!0}]:(t=i.tensor_util.getTensorsInContainer(e.value),[4,this.transform(e.value)]);case 2:for(n=u.sent(),r=i.tensor_util.getTensorsInContainer(n),o=0,a=t;o<a.length;o++)s=a[o],i.tensor_util.isTensorInList(s,r)||s.dispose();return[2,{value:n,done:!1}]}})})},t}(M),q=function(e){function t(){var t=e.call(this)||this;return t.outputQueue=new C,t.lastRead=Promise.resolve({value:null,done:!1}),t}return a(t,e),t.prototype.next=function(){return s(this,void 0,void 0,function(){var e=this;return u(this,function(t){return this.lastRead=this.lastRead.then(function(){return e.serialNext()}),[2,this.lastRead]})})},t.prototype.serialNext=function(){return s(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return 0!==this.outputQueue.length()?[3,2]:[4,this.pump()];case 1:return e.sent()?[3,0]:[2,{value:null,done:!0}];case 2:return[2,{value:this.outputQueue.shift(),done:!1}]}})})},t}(M),H=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.transform=n,r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> Flatmap"},t.prototype.pump=function(){return s(this,void 0,void 0,function(){var e,t,n,r,o,a,s;return u(this,function(u){switch(u.label){case 0:return[4,this.upstream.next()];case 1:if((e=u.sent()).done)return[2,!1];for(t=i.tensor_util.getTensorsInContainer(e.value),n=this.transform(e.value),r=i.tensor_util.getTensorsInContainer(n),this.outputQueue.pushAll(n),o=0,a=t;o<a.length;o++)s=a[o],i.tensor_util.isTensorInList(s,r)||s.dispose();return[2,!0]}})})},t}(q),G=function(e){function t(t,n){var r=e.call(this)||this;return r.baseErrorHandler=n,r.lastRead=null,r.iterator=null,r.moreIterators=t,r}return a(t,e),t.prototype.summary=function(){return"TODO: fill in upstream of chained summaries -> Chained"},t.prototype.next=function(){return s(this,void 0,void 0,function(){return u(this,function(e){return this.lastRead=this.readFromChain(this.lastRead),[2,this.lastRead]})})},t.prototype.readFromChain=function(e){return s(this,void 0,void 0,function(){var t,n;return u(this,function(r){switch(r.label){case 0:return[4,e];case 1:return r.sent(),null!=this.iterator?[3,3]:[4,this.moreIterators.next()];case 2:if((t=r.sent()).done)return[2,{value:null,done:!0}];this.iterator=t.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler)),r.label=3;case 3:return[4,this.iterator.next()];case 4:return(n=r.sent()).done?(this.iterator=null,[2,this.readFromChain(e)]):[2,n]}})})},t}(M);(R=I||(I={}))[R.FAIL=0]="FAIL",R[R.SHORTEST=1]="SHORTEST",R[R.LONGEST=2]="LONGEST";var K=function(e){function t(t,n){void 0===n&&(n=I.FAIL);var r=e.call(this)||this;return r.iterators=t,r.mismatchMode=n,r.count=0,r.currentPromise=null,r}return a(t,e),t.prototype.summary=function(){return"{TODO: fill in upstream of zip summaries} -> Zip"},t.prototype.nextState=function(e){return s(this,void 0,void 0,function(){function t(e){return e instanceof M?{value:e.next().then(function(e){return n++,e.done&&r++,e.value}),recurse:!1}:{value:null,recurse:!0}}var n,r,i;return u(this,function(o){switch(o.label){case 0:return[4,e];case 1:return o.sent(),n=0,r=0,[4,x(this.iterators,t)];case 2:if(i=o.sent(),n===r)return[2,{value:null,done:!0}];if(r>0)switch(this.mismatchMode){case I.FAIL:throw new Error("Zipped streams should have the same length. Mismatched at element "+this.count+".");case I.SHORTEST:return[2,{value:null,done:!0}];case I.LONGEST:}return this.count++,[2,{value:i,done:!1}]}})})},t.prototype.next=function(){return s(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return this.currentPromise=this.nextState(this.currentPromise),[4,this.currentPromise];case 1:return[2,e.sent()]}})})},t}(M),$=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.bufferSize=n,r.buffer=new E(n),r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> Prefetch"},t.prototype.refill=function(){for(;!this.buffer.isFull();){var e=this.upstream.next();this.buffer.push(e)}},t.prototype.next=function(){return this.refill(),this.buffer.shift()},t}(M),X=function(e){function t(t,n,r){var o=e.call(this,t,n)||this;return o.upstream=t,o.windowSize=n,o.upstreamExhausted=!1,o.random=g(r||i.util.now().toString()),o.lastRead=Promise.resolve({value:null,done:!1}),o}return a(t,e),t.prototype.next=function(){return s(this,void 0,void 0,function(){var e=this;return u(this,function(t){return this.lastRead=this.lastRead.then(function(){return e.serialNext()}),[2,this.lastRead]})})},t.prototype.randomInt=function(e){return Math.floor(this.random()*e)},t.prototype.chooseIndex=function(){return this.randomInt(this.buffer.length())},t.prototype.serialNext=function(){return s(this,void 0,void 0,function(){var e,t;return u(this,function(n){switch(n.label){case 0:this.upstreamExhausted||this.refill(),n.label=1;case 1:return this.buffer.isEmpty()?[3,3]:(e=this.chooseIndex(),[4,this.buffer.shuffleExcise(e)]);case 2:return(t=n.sent()).done?(this.upstreamExhausted=!0,[3,1]):(this.refill(),[2,t]);case 3:return[2,{value:null,done:!0}]}})})},t}($),Y=function(){function e(){this.size=null}return e.prototype.batch=function(e,t){var n=this;void 0===t&&(t=!0);var r=this;return i.util.assert(e>0,function(){return"batchSize needs to be positive, but it is\n "+e}),J(function(){return s(n,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,r.iterator()];case 1:return[2,n.sent().columnMajorBatch(e,t,ee)]}})})},this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e))},e.prototype.concatenate=function(e){var t=this,n=this;return J(function(){return s(t,void 0,void 0,function(){var t,r;return u(this,function(i){switch(i.label){case 0:return[4,n.iterator()];case 1:return r=(t=i.sent()).concatenate,[4,e.iterator()];case 2:return[2,r.apply(t,[i.sent()])]}})})},this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null)},e.prototype.filter=function(e){var t=this,n=this;return J(function(){return s(t,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,n.iterator()];case 1:return[2,t.sent().filter(function(t){return Object(i.tidy)(function(){return e(t)})})]}})})},this.size===1/0?1/0:null)},e.prototype.forEachAsync=function(e){return s(this,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,this.iterator()];case 1:return[2,t.sent().forEachAsync(e)]}})})},e.prototype.forEach=function(e){return s(this,void 0,void 0,function(){return u(this,function(t){return Object(i.deprecationWarn)("dataset.forEach() is deprecated and will be removed. Please use dataset.forEachAsync() instead"),[2,this.forEachAsync(e)]})})},e.prototype.map=function(e){var t=this,n=this;return J(function(){return s(t,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,n.iterator()];case 1:return[2,t.sent().map(function(t){return Object(i.tidy)(function(){return e(t)})})]}})})},this.size)},e.prototype.mapAsync=function(e){var t=this,n=this;return J(function(){return s(t,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,n.iterator()];case 1:return[2,t.sent().mapAsync(e)]}})})},this.size)},e.prototype.prefetch=function(e){var t=this;if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");var n=this;return J(function(){return s(t,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,n.iterator()];case 1:return[2,t.sent().prefetch(e)]}})})},this.size)},e.prototype.repeat=function(e){var t=this,n=this;return J(function(){return s(t,void 0,void 0,function(){var t=this;return u(this,function(r){return[2,A(O(function(){return s(t,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return e={},[4,n.iterator()];case 1:return[2,(e.value=t.sent(),e.done=!1,e)]}})})}).take(e))]})})},null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null)},e.prototype.skip=function(e){var t=this,n=this;return J(function(){return s(t,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,n.iterator()];case 1:return[2,t.sent().skip(e)]}})})},null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size<e||void 0===e||e<0)?0:null)},e.prototype.shuffle=function(e,t,n){var r=this;if(void 0===n&&(n=!0),null==e||e<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError("`Dataset.shuffle()` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for `tf.Tensor`s), consider setting bufferSize to the dataset size ("+this.size+" elements)");var o=this,a=g(t||i.util.now().toString());return J(function(){return s(r,void 0,void 0,function(){var t;return u(this,function(r){switch(r.label){case 0:return t=a.int32(),n&&(t+=a.int32()),[4,o.iterator()];case 1:return[2,r.sent().shuffle(e,t.toString())]}})})},this.size)},e.prototype.take=function(e){var t=this,n=this;return J(function(){return s(t,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,n.iterator()];case 1:return[2,t.sent().take(e)]}})})},null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null)},e.prototype.toArray=function(){return s(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return[4,this.iterator()];case 1:return[2,e.sent().toArray()]}})})},e.prototype.toArrayForTest=function(){return s(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return[4,this.iterator()];case 1:return[2,e.sent().toArrayForTest()]}})})},e.MAX_BUFFER_SIZE=1e4,e}();function J(e,t){return void 0===t&&(t=null),new(function(n){function r(){var e=null!==n&&n.apply(this,arguments)||this;return e.size=t,e}return a(r,n),r.prototype.iterator=function(){return s(this,void 0,void 0,function(){return u(this,function(t){return[2,e()]})})},r}(Y))}function Z(e){var t=this;return J(function(){return s(t,void 0,void 0,function(){return u(this,function(t){return[2,N(e)]})})},e.length)}function Q(e){var t,n=this;if(!_(e))throw new Error("The argument to zip() must be an object or array.");if(Array.isArray(e))for(var r=0;r<e.length;r++)t=null==t?e[r].size:Math.min(t,e[r].size);else if(e instanceof Object)for(var i in e)t=null==t?e[i].size:Math.min(t,e[i].size);return J(function(){return s(n,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,x(e,function(e){if(e instanceof Y)return{value:e.iterator(),recurse:!1};if(_(e))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")})];case 1:return[2,T(t.sent(),I.SHORTEST)]}})})},t)}function ee(e){return null===e?null:function(e){return null==e||function(e){return null===e||"object"!=typeof e&&"function"!=typeof e}(e)||Array.isArray(e)||"object"==typeof e&&e instanceof i.Tensor||i.util.isTypedArray(e)}(e[0])?{value:te(e),recurse:!1}:{value:null,recurse:!0}}function te(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof i.Tensor?Object(i.stack)(e):Object(i.tensor)(e)}var ne=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return a(t,e),t.prototype.iterator=function(){return s(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.input.iterator()];
1case 1:return e=t.sent(),[2,e.decodeUTF8().split("\n").map(function(e){return e.endsWith("\r")&&(e=e.slice(0,-1)),e})]}})})},t}(Y),re=Symbol("out"),ie=Symbol("field"),oe=Symbol("quote"),ae=Symbol("quoteafterquote"),se=Symbol("quoteinquote"),ue=function(e){function t(t,n){var r=e.call(this)||this;return r.input=t,r.hasHeader=!0,r.fullColumnNames=null,r.columnNamesValidated=!1,r.columnConfigs=null,r.configuredColumnsOnly=!1,r.delimiter=",",r.delimWhitespace=!1,r.base=new ne(t),n||(n={}),r.hasHeader=!1!==n.hasHeader,r.fullColumnNames=n.columnNames,r.columnConfigs=n.columnConfigs,r.configuredColumnsOnly=n.configuredColumnsOnly,n.delimWhitespace?(i.util.assert(null==n.delimiter,function(){return"Delimiter should not be provided when delimWhitespace is true."}),r.delimWhitespace=!0,r.delimiter=" "):r.delimiter=n.delimiter?n.delimiter:",",r}return a(t,e),t.prototype.columnNames=function(){return s(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return this.columnNamesValidated?[3,2]:[4,this.setColumnNames()];case 1:e.sent(),e.label=2;case 2:return[2,this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames]}})})},t.prototype.setColumnNames=function(){return s(this,void 0,void 0,function(){var e,t,n,r,o,a,s=this;return u(this,function(u){switch(u.label){case 0:return[4,this.maybeReadHeaderLine()];case 1:if(e=u.sent(),!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");if(this.fullColumnNames&&e&&i.util.assert(e.length===this.fullColumnNames.length,function(){return"The length of provided columnNames ("+s.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."}),this.fullColumnNames||(this.fullColumnNames=e),t=this.fullColumnNames.reduce(function(e,t){return e[t]=e[t]+1||1,e},{}),n=Object.keys(t).filter(function(e){return t[e]>1}),i.util.assert(0===n.length,function(){return"Duplicate column names found: "+n.toString()}),this.columnConfigs)for(r=0,o=Object.keys(this.columnConfigs);r<o.length;r++)if(a=o[r],-1===this.fullColumnNames.indexOf(a))throw new Error('The key "'+a+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").");return this.columnNamesValidated=!0,[2]}})})},t.prototype.maybeReadHeaderLine=function(){return s(this,void 0,void 0,function(){var e,t;return u(this,function(n){switch(n.label){case 0:return this.hasHeader?[4,this.base.iterator()]:[3,3];case 1:return[4,n.sent().next()];case 2:if((e=n.sent()).done)throw new Error("No data was found for CSV parsing.");return t=e.value,[2,this.parseRow(t,!1)];case 3:return[2,null]}})})},t.prototype.iterator=function(){return s(this,void 0,void 0,function(){var e,t=this;return u(this,function(n){switch(n.label){case 0:return this.columnNamesValidated?[3,2]:[4,this.setColumnNames()];case 1:n.sent(),n.label=2;case 2:return[4,this.base.iterator()];case 3:return e=n.sent(),this.hasHeader&&(e=e.skip(1)),[2,e.map(function(e){return t.makeDataElement(e)})]}})})},t.prototype.makeDataElement=function(e){for(var t=this.parseRow(e),n={},r={},i=0;i<this.fullColumnNames.length;i++){var o=this.fullColumnNames[i],a=this.columnConfigs?this.columnConfigs[o]:null;if(!this.configuredColumnsOnly||a){var s=t[i],u=null;if(""===s)if(a&&void 0!==a.default)u=a.default;else{if(a&&(a.required||a.isLabel))throw new Error("Required column "+o+" is empty in this line: "+e);u=void 0}else{var c=Number(s);if(isNaN(c))u=a&&"bool"===a.dtype?this.getBoolean(s):s;else if(a&&a.dtype)switch(a.dtype){case"float32":u=c;break;case"int32":u=Math.floor(c);break;case"bool":u=this.getBoolean(s);break;default:u=c}else u=c}a&&a.isLabel?r[o]=u:n[o]=u}}return 0===Object.keys(r).length?n:{xs:n,ys:r}},t.prototype.getBoolean=function(e){return"1"===e||"true"===e.toLowerCase()?1:0},t.prototype.parseRow=function(e,t){void 0===t&&(t=!0);for(var n=[],r=0,i=e.length,o=re,a=0;a<i;a++)switch(o){case re:switch(e.charAt(a)){case'"':r=a+1,o=oe;break;case this.delimiter:if(r=a+1," "===this.delimiter&&this.delimWhitespace)break;n.push(""),o=re;break;default:o=ie,r=a}break;case ie:switch(e.charAt(a)){case this.delimiter:n.push(e.substring(r,a)),o=re,r=a+1}break;case oe:switch(e.charAt(a)){case'"':o=ae}break;case ae:switch(e.charAt(a)){case this.delimiter:n.push(e.substring(r,a-1)),o=re,r=a+1;break;case'"':o=oe;break;default:o=se}break;case se:switch(e.charAt(a)){case'"':o=oe}}if(o===ae?n.push(e.substring(r,i-1)):n.push(e.substring(r)),t&&n.length!==this.fullColumnNames.length)throw new Error("Invalid row in csv file. Should have "+this.fullColumnNames.length+" elements in a row, but got "+n);return n},t}(Y),ce=function(e){function t(t,n){var r=e.call(this)||this;if(r.webcamVideoElement=t,r.webcamConfig=n,r.isClosed=!0,r.resize=!1,r.needToResize())if(r.resize=!0,r.cropSize=[r.webcamConfig.resizeHeight,r.webcamConfig.resizeWidth],r.cropBoxInd=Object(i.tensor1d)([0],"int32"),r.webcamConfig.centerCrop){var o=1*r.webcamConfig.resizeWidth/r.webcamVideoElement.width,a=1*r.webcamConfig.resizeHeight/r.webcamVideoElement.height,s=(1-o)/2,u=(1-a)/2,c=s+o,l=a+u;r.cropBox=Object(i.tensor2d)([u,s,l,c],[1,4])}else r.cropBox=Object(i.tensor2d)([0,0,1,1],[1,4]);return r}return a(t,e),t.prototype.summary=function(){return"webcam"},t.create=function(e,n){return void 0===n&&(n={}),s(this,void 0,void 0,function(){var r;return u(this,function(o){switch(o.label){case 0:if(i.ENV.get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!n.resizeWidth||!n.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=n.resizeWidth,e.height=n.resizeHeight}return[4,(r=new t(e,n)).start()];case 1:return o.sent(),[2,r]}})})},t.prototype.start=function(){return s(this,void 0,void 0,function(){var e,t,n=this;return u(this,function(r){switch(r.label){case 0:this.webcamConfig.facingMode&&i.util.assert("user"===this.webcamConfig.facingMode||"environment"===this.webcamConfig.facingMode,function(){return"Invalid webcam facing mode: "+n.webcamConfig.facingMode+". Please provide 'user' or 'environment'"}),r.label=1;case 1:return r.trys.push([1,3,,4]),e=this,[4,navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})];case 2:return e.stream=r.sent(),[3,4];case 3:throw(t=r.sent()).message="Error thrown while initializing video stream
1: "+t.message,t;case 4:if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,[2,new Promise(function(e){n.webcamVideoElement.onloadedmetadata=function(){e()}})]}})})},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e;return u(this,function(t){if(this.isClosed)return[2,{value:null,done:!0}];try{e=i.browser.fromPixels(this.webcamVideoElement)}catch(e){throw new Error("Error thrown converting video to pixels: "+JSON.stringify(e))}if(!this.resize)return[2,{value:e,done:!1}];try{return[2,{value:this.cropAndResizeFrame(e),done:!1}]}catch(e){throw new Error("Error thrown cropping the video: "+e.message)}finally{e.dispose()}return[2]})})},t.prototype.needToResize=function(){return!(!this.webcamConfig.resizeWidth||!this.webcamConfig.resizeHeight||this.webcamVideoElement.width===this.webcamConfig.resizeWidth&&this.webcamVideoElement.height===this.webcamConfig.resizeHeight)},t.prototype.cropAndResizeFrame=function(e){var t=this;return Object(i.tidy)(function(){var n,r=e.toFloat().expandDims(0),o=(n=i.image.cropAndResize(r,t.cropBox,t.cropBoxInd,t.cropSize,"bilinear")).shape;return n.reshape(o.slice(1))})},t.prototype.capture=function(){return s(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.next()];case 1:return[2,e.sent().value]}})})},t.prototype.stop=function(){this.stream.getTracks().forEach(function(e){return e.stop()});try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0},t.prototype.toArray=function(){throw new Error("Can not convert infinite video stream to array.")},t}(M),le=function(){},fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.split=function(e){return new he(this,e)},t}(M),he=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.impl=new de(t,n),r}return a(t,e),t.prototype.summary=function(){return this.impl.summary()},t.prototype.next=function(){return s(this,void 0,void 0,function(){return u(this,function(e){return[2,this.impl.next()]})})},t}(fe),de=function(e){function t(t,n){var r=e.call(this)||this;return r.upstream=t,r.separator=n,r.carryover="",r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> Split('"+this.separator+"')"},t.prototype.pump=function(){return s(this,void 0,void 0,function(){var e,t,n,r,i;return u(this,function(o){switch(o.label){case 0:return[4,this.upstream.next()];case 1:if((e=o.sent()).done)return""===this.carryover?[2,!1]:(this.outputQueue.push(this.carryover),this.carryover="",[2,!0]);for((t=e.value.split(this.separator))[0]=this.carryover+t[0],n=0,r=t.slice(0,-1);n<r.length;n++)i=r[n],this.outputQueue.push(i);return this.carryover=t[t.length-1],[2,!0]}})})},t}(q),pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.decodeUTF8=function(){return new me(this)},t}(M),me=function(e){function t(t){var n=e.call(this)||this;return n.upstream=t,n.impl=new ve(t),n}return a(t,e),t.prototype.summary=function(){return this.impl.summary()},t.prototype.next=function(){return s(this,void 0,void 0,function(){return u(this,function(e){return[2,this.impl.next()]})})},t}(fe),ve=function(e){function t(t){var r=e.call(this)||this;if(r.upstream=t,i.ENV.get("IS_BROWSER"))r.decoder=new TextDecoder("utf-8");else{var o=n(228).StringDecoder;r.decoder=new o("utf8")}return r}return a(t,e),t.prototype.summary=function(){return this.upstream.summary()+" -> Utf8"},t.prototype.pump=function(){return s(this,void 0,void 0,function(){var e,t,n;return u(this,function(o){switch(o.label){case 0:return[4,this.upstream.next()];case 1:return(e=o.sent()).done?[2,!1]:(t=e.value,n=i.ENV.get("IS_BROWSER")?this.decoder.decode(t,{stream:!0}):this.decoder.write(r.from(t.buffer)),this.outputQueue.push(n),[2,!0])}})})},t}(q),ge=function(e){function t(t,n){void 0===n&&(n={});var r=e.call(this)||this;return r.file=t,r.options=n,i.util.assert(t instanceof Uint8Array||!!i.ENV.get("IS_BROW
1SER")&&(t instanceof File||t instanceof Blob),function(){return"FileChunkIterator only supports File, Blob and Uint8Array right now."}),r.offset=n.offset||0,r.chunkSize=n.chunkSize||1048576,r}return a(t,e),t.prototype.summary=function(){return"FileChunks "+this.file},t.prototype.next=function(){return s(this,void 0,void 0,function(){var e,t,n=this;return u(this,function(r){switch(r.label){case 0:return this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size)?[2,{value:null,done:!0}]:(e=new Promise(function(e,t){var r=n.offset+n.chunkSize;if(n.file instanceof Uint8Array)e(new Uint8Array(n.file.slice(n.offset,r)));else{var i=new FileReader;i.onload=function(n){var r=i.result;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),!(r instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(r)},i.onabort=function(e){return t(new Error("Aborted"))},i.onerror=function(e){return t(new Error(e.type))};var o=n.file.slice(n.offset,r);i.readAsArrayBuffer(o)}n.offset=r}),t={},[4,e]);case 1:return[2,(t.value=r.sent(),t.done=!1,t)]}})})},t}(pe);function ye(e,t){return void 0===t&&(t={}),s(this,void 0,void 0,function(){var r,o,a,s;return u(this,function(u){switch(u.label){case 0:return i.ENV.get("IS_BROWSER")?[4,fetch(e)]:[3,5];case 1:return(r=u.sent()).ok?[4,r.blob()]:[3,3];case 2:return o=u.sent(),[2,new ge(o,t)];case 3:throw new Error(r.statusText);case 4:return[3,9];case 5:if(a=n(229),"string"!=typeof e)throw new Error("URL must be a string. Request objects are not supported in the node.js environment yet.");return[4,a(e)];case 6:return(r=u.sent()).ok?[4,r.buffer()]:[3,8];case 7:return s=u.sent(),[2,new ge(s,t)];case 8:throw new Error(r.statusText);case 9:return[2]}})})}function be(e){return"string"==typeof e&&"file://"===e.substr(0,7)}var we=function(e){function t(t,n){void 0===n&&(n={});var r=e.call(this)||this;return r.input=t,r.options=n,r}return a(t,e),t.prototype.iterator=function(){return s(this,void 0,void 0,function(){var e;return u(this,function(t){return be(this.input)&&i.ENV.get("IS_NODE")&&(e=n(230),this.input=e.readFileSync(this.input.substr(7))),[2,new ge(this.input,this.options)]})})},t}(le),xe=function(e){function t(t,n){void 0===n&&(n={});var r=e.call(this)||this;return r.url=t,r.fileOptions=n,r}return a(t,e),t.prototype.iterator=function(){return s(this,void 0,void 0,function(){return u(this,function(e){return be(this.url)?[2,new we(this.url,this.fileOptions).iterator()]:[2,ye(this.url,this.fileOptions)]})})},t}(le);function _e(e,t){return void 0===t&&(t={}),new ue(new xe(e),t)}function ke(e){var t=this,n=O(e);return J(function(){return s(t,void 0,void 0,function(){return u(this,function(e){return[2,n]})})})}function Se(e){var t=this;return J(function(){return s(t,void 0,void 0,function(){var t;return u(this,function(n){switch(n.label){case 0:return[4,e()];case 1:return t=n.sent(),[2,O(function(){return t.next()})]}})})})}function Ee(e,t){return s(this,void 0,void 0,function(){return u(this,function(n){return[2,ce.create(e,t)]})})}var Ce="1.2.1"}.call(this,n(17),n(15).Buffer)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var r=n(5),i=n(82),o=n(7).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<<t|e>>>32-t}function c(e,t,n,r,i,o,a){return u(e+(t&n|~t&r)+i+o|0,a)+t|0}function l(e,t,n,r,i,o,a){return u(e+(t&r|n&~r)+i+o|0,a)+t|0}function f(e,t,n,r,i,o,a){return u(e+(t^n^r)+i+o|0,a)+t|0}function h(e,t,n,r,i,o,a){return u(e+(n^(t|~r))+i+o|0,a)+t|0}r(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;n=c(n,r,i,o,e[0],3614090360,7),o=c(o,n,r,i,e[1],3905402710,12),i=c(i,o,n,r,e[2],606105819,17),r=c(r,i,o,n,e[3],3250441966,22),n=c(n,r,i,o,e[4],4118548399,7),o=c(o,n,r,i,e[5],1200080426,12),i=c(i,o,n,r,e[6],2821735955,17),r=c(r,i,o,n,e[7],4249261313,22),n=c(n,r,i,o,e[8],1770035416,7),o=c(o,n,r,i,e[9],2336552879,12),i=c(i,o,n,r,e[10],4294925233,17),r=c(r,i,o,n,e[11],2304563134,22),n=c(n,r,i,o,e[12],1804603682,7),o=c(o,n,r,i,e[13],4254626195,12),i=c(i,o,n,r,e[14],2792965006,17),n=l(n,r=c(r,i,o,n,e[15],1236535329,22),i,o,e[1],4129170786,5),o=l(o,n,r,i,e[6],3225465664,9),i=l(i,o,n,r,e[11],643717713,14),r=l(r,i,o,n,e[0],3921069994,20),n=l(n,r,i,o,e[5],3593408605,5),o=l(o,n,r,i,e[10],38016083,9),i=l(i,o,n,r,e[15],3634488961,14),r=l(r,i,o,n,e[4],3889429448,20),n=l(n,r,i,o,e[9],568446438,5),o=l(o,n,r,i,e[14],3275163606,9),i=l(i,o,n,r,e[3],4107603335,14),r=l(r,i,o,n,e[8],1163531501,20),n=l(n,r,i,o,e[13],2850285829,5),o=l(o,n,r,i,e[2],4243563512,9),i=l(i,o,n,r,e[7],1735328473,14),n=f(n,r=l(r,i,o,n,e[12],2368359562,20),i,o,e[5],4294588738,4),o=f(o,n,r,i,e[8],2272392833,11),i=f(i,o,n,r,e[11],1839030562,16),r=f(r,i,o,n,e[14],4259657740,23),n=f(n,r,i,o,e[1],2763975236,4),o=f(o,n,r,i,e[4],1272893353,11),i=f(i,o,n,r,e[7],4139469664,16),r=f(r,i,o,n,e[10],3200236656,23),n=f(n,r,i,o,e[13],681279174,4),o=f(o,n,r,i,e[0],3936430074,11),i=f(i,o,n,r,e[3],3572445317,16),r=f(r,i,o,n,e[6],76029189,23),n=f(n,r,i,o,e[9],3654602809,4),o=f(o,n,r,i,e[12],3873151461,11),i=f(i,o,n,r,e[15],530742520,16),n=h(n,r=f(r,i,o,n,e[2],3299628645,23),i,o,e[0],4096336452,6),o=h(o,n,r,i,e[7],1126891415,10),i=h(i,o,n,r,e[14],2878612391,15),r=h(r,i,o,n,e[5],4237533241,21),n=h(n,r,i,o,e[12],1700485571,6),o=h(o,n,r,i,e[3],2399980690,10),i=h(i,o,n,r,e[10],4293915773,15),r
1=h(r,i,o,n,e[1],2240044497,21),n=h(n,r,i,o,e[8],1873313359,6),o=h(o,n,r,i,e[15],4264355552,10),i=h(i,o,n,r,e[6],2734768916,15),r=h(r,i,o,n,e[13],1309151649,21),n=h(n,r,i,o,e[4],4149444226,6),o=h(o,n,r,i,e[11],3174756917,10),i=h(i,o,n,r,e[2],718787259,15),r=h(r,i,o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,n){e.exports=i;var r=n(60).EventEmitter;function i(){r.call(this)}n(5)(i,r),i.Readable=n(61),i.Writable=n(152),i.Duplex=n(153),i.Transform=n(154),i.PassThrough=n(155),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"===typeof e.destroy&&e.destroy())}function c(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",c),e.on("error",c),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e}},function(e,t,n){"use strict";var r,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,o,a,s;if("function"!==typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"===typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,e))}.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"===typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!==typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"===typeof u)o(u,this,t);else{var c=u.length,l=p(u,c);for(n=0;n<c;++n)o(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);
vendor: 16,238 bytes, line 1
1if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!==typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(83)).Stream=t,t.Readable=t,t.Writable=n(62),t.Duplex=n(37),t.Transform=n(86),t.PassThrough=n(151)},function(e,t,n){"use strict";(function(t,r,i){var o=n(50);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:o.nextTick;y.WritableState=g;var c=n(43);c.inherits=n(5);var l={deprecate:n(150)},f=n(84),h=n(7).Buffer,d=i.Uint8Array||function(){};var p,m=n(85);function v(){}function g(e,t){s=s||n(37),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,i);else{var a=_(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||x(e,n),r?u(w,e,n,a,i):w(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||n(37),!p.call(y,this)&&!(this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function x(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,f=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,l,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function S(e,t){var n=_(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"===typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(r=e,h.isBuffer(r)||r instanceof d);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"===typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!==typeof n&&(n=v),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"===typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=h.from(t,n));return t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,s,r,i,o);return u}(this,i,s,e,t,n)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||x(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"===typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(31),n(80).setImmediate,n(17))},function(e,t,n){"use strict";var r=n(7).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!==typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\ufffd":t},o.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=a(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=a(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=a(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";var r=n(15).Buffer,i=n(5),o=n(82),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function m(e,t,n,r,i,o,a,s){return p(e+(t^n^r)+o+a|0,s)+i|0}function v(e,t,n,r,i,o,a,s){return p(e+(t&n|~t&r)+o+a|0,s)+i|0}function g(e,t,n,r,i,o,a,s){return p(e+((t|~n)^r)+o+a|0,s)+i|0}function y(e,t,n,r,i,o,a,s){return p(e+(t&r|n&~r)+o+a|0,s)+i|0}function b(e,t,n,r,i,o,a,s){return p(e+(t^(n|~r))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,x=0|this._b,_=0|this._c,k=0|this._d,S=0|this._e,E=0;E<80;E+=1){var C,N;E<16?(C=m(n,r,i,o,d,e[s[E]],f[0],c[E]),N=b(w,x,_,k,S,e[u[E]],h[0],l[E])):E<32?(C=v(n,r,i,o,d,e[s[E]],f[1],c[E]),N=y(w,x,_,k,S,e[u[E]],h[1],l[E])):E<48?(C=g(n,r,i,o,d,e[s[E]],f[2],c[E]),N=g(w,x,_,k,S,e[u[E]],h[2],l[E])):E<64?(C=y(n,r,i,o,d,e[s[E]],f[3],c[E]),N=v(w,x,_,k,S,e[u[E]],h[3],l[E])):(C=b(n,r,i,o,d,e[s[E]],f[4],c[E]),N=m(w,x,_,k,S,e[u[E]],h[4],l[E])),n=d,d=o,o=p(i,10),i=r,r=C,w=S,S=k,k=p(_,10),_=x,x=N}var O=this._b+i+k|0;this._b=this._c+o+S|0,this._c=this._d+d+w|0,this._d=this._e+n+x|0,this._e=this._a+r+_|0,this._a=O},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,n){(t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n}).sha=n(156),t.sha1=n(157),t.sha224=n(158),t.sha256=n(87),t.sha384=n(159),t.sha512=n(88)},function(e,t,n){"use strict";t.utils=n(165),t.Cipher=n(166),t.DES=n(167),t.CBC=n(168),t.EDE=n(169)},function(e,t,n){var r=n(170),i=n(178),o=n(98);t.createCipher=t.Cipher=r.createCipher,t.createCipheriv=t.Cipheriv=r.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},function(e,t,n){var r={ECB:n(171),CBC:n(172),CFB:n(173),CFB8:n(174),CFB1:n(175),OFB:n(176),CTR:n(96),GCM:n(96)},i=n(98);for(var o in i)i[o].module=r[i[o].mode];e.exports=i},function(e,t,n){(function(t){var r=n(13),i=n(39);function o(e,n){var i=function(e){var t=a(e);return{blinder:t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(n),o=n.modulus.byteLength(),s=(r.mont(n.modulus),new r(e).mul(i.blinder).umod(n.modulus)),u=s.toRed(r.mont(n.prime
11)),c=s.toRed(r.mont(n.prime2)),l=n.coefficient,f=n.prime1,h=n.prime2,d=u.redPow(n.exponent1),p=c.redPow(n.exponent2);d=d.fromRed(),p=p.fromRed();var m=d.isub(p).imul(l).umod(f);return m.imul(h),p.iadd(m),new t(p.imul(i.unblinder).umod(n.modulus).toArray(!1,o))}function a(e){for(var t=e.modulus.byteLength(),n=new r(i(t));n.cmp(e.modulus)>=0||!n.umod(e.prime1)||!n.umod(e.prime2);)n=new r(i(t));return n}e.exports=o,o.getr=a}).call(this,n(15).Buffer)},function(e,t,n){var r=t;r.utils=n(25),r.common=n(45),r.sha=n(194),r.ripemd=n(198),r.hmac=n(199),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},function(e,t,n){"use strict";(function(t){var n="__global_unique_id__";e.exports=function(){return t[n]=(t[n]||0)+1}}).call(this,n(17))},function(e,t,n){(function(e,r){var i;(function(){var o,a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",c="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",h=1,d=2,p=4,m=1,v=2,g=1,y=2,b=4,w=8,x=16,_=32,k=64,S=128,E=256,C=512,N=30,O="...",A=800,T=16,I=1,R=2,M=1/0,D=9007199254740991,j=1.7976931348623157e308,P=NaN,z=4294967295,L=z-1,B=z>>>1,F=[["ary",S],["bind",g],["bindKey",y],["curry",w],["curryRight",x],["flip",C],["partial",_],["partialRight",k],["rearg",E]],U="[object Arguments]",W="[object Array]",V="[object AsyncFunction]",q="[object Boolean]",H="[object Date]",G="[object DOMException]",K="[object Error]",$="[object Function]",X="[object GeneratorFunction]",Y="[object Map]",J="[object Number]",Z="[object Null]",Q="[object Object]",ee="[object Proxy]",te="[object RegExp]",ne="[object Set]",re="[object String]",ie="[object Symbol]",oe="[object Undefined]",ae="[object WeakMap]",se="[object WeakSet]",ue="[object ArrayBuffer]",ce="[object DataView]",le="[object Float32Array]",fe="[object Float64Array]",he="[object Int8Array]",de="[object Int16Array]",pe="[object Int32Array]",me="[object Uint8Array]",ve="[object Uint8ClampedArray]",ge="[object Uint16Array]",ye="[object Uint32Array]",be=/\b__p \+= '';/g,we=/\b(__p \+=) '' \+/g,xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_e=/&(?:amp|lt|gt|quot|#39);/g,ke=/[&<>"']/g,Se=RegExp(_e.source),Ee=RegExp(ke.source),Ce=/<%-([\s\S]+?)%>/g,Ne=/<%([\s\S]+?)%>/g,Oe=/<%=([\s\S]+?)%>/g,Ae=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Te=/^\w*$/,Ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Re=/[\\^$.*+?()[\]{}|]/g,Me=RegExp(Re.source),De=/^\s+|\s+$/g,je=/^\s+/,Pe=/\s+$/,ze=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Le=/\{\n\/\* \[wrapped with (.+)\] \*/,Be=/,? & /,Fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ue=/\\(\\)?/g,We=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ve=/\w*$/,qe=/^[-+]0x[0-9a-f]+$/i,He=/^0b[01]+$/i,Ge=/^\[object .+?Constructor\]$/,Ke=/^0o[0-7]+$/i,$e=/^(?:0|[1-9]\d*)$/,Xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 4,299 bytes, line 1
17f]/g,Ye=/($^)/,Je=/['\n\r\u2028\u2029\\]/g,Ze="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Qe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",et="[\\ud800-\\udfff]",tt="["+Qe+"]",nt="["+Ze+"]",rt="\\d+",it="[\\u2700-\\u27bf]",ot="[a-z\\xdf-\\xf6\\xf8-\\xff]",at="[^\\ud800-\\udfff"+Qe+rt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",st="\\ud83c[\\udffb-\\udfff]",ut="[^\\ud800-\\udfff]",ct="(?:\\ud83c[\\udde6-\\uddff]){2}",lt="[\\ud800-\\udbff][\\udc00-\\udfff]",ft="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ht="(?:"+ot+"|"+at+")",dt="(?:"+ft+"|"+at+")",pt="(?:"+nt+"|"+st+")"+"?",mt="[\\ufe0e\\ufe0f]?"+pt+("(?:\\u200d(?:"+[ut,ct,lt].join("|")+")[\\ufe0e\\ufe0f]?"+pt+")*"),vt="(?:"+[it,ct,lt].join("|")+")"+mt,gt="(?:"+[ut+nt+"?",nt,ct,lt,et].join("|")+")",yt=RegExp("['\u2019]","g"),bt=RegExp(nt,"g"),wt=RegExp(st+"(?="+st+")|"+gt+mt,"g"),xt=RegExp([ft+"?"+ot+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[tt,ft,"$"].join("|")+")",dt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[tt,ft+ht,"$"].join("|")+")",ft+"?"+ht+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ft+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rt,vt].join("|"),"g"),_t=RegExp("[\\u200d\\ud800-\\udfff"+Ze+"\\ufe0e\\ufe0f]"),kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,St=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Et=-1,Ct={};Ct[le]=Ct[fe]=Ct[he]=Ct[de]=Ct[pe]=Ct[me]=Ct[ve]=Ct[ge]=Ct[ye]=!0,Ct[U]=Ct[W]=Ct[ue]=Ct[q]=Ct[ce]=Ct[H]=Ct[K]=Ct[$]=Ct[Y]=Ct[J]=Ct[Q]=Ct[te]=Ct[ne]=Ct[re]=Ct[ae]=!1;var Nt={};Nt[U]=Nt[W]=Nt[ue]=Nt[ce]=Nt[q]=Nt[H]=Nt[le]=Nt[fe]=Nt[he]=Nt[de]=Nt[pe]=Nt[Y]=Nt[J]=Nt[Q]=Nt[te]=Nt[ne]=Nt[re]=Nt[ie]=Nt[me]=Nt[ve]=Nt[ge]=Nt[ye]=!0,Nt[K]=Nt[$]=Nt[ae]=!1;var Ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},At=parseFloat,Tt=parseInt,It="object"==typeof e&&e&&e.Object===Object&&e,Rt="object"==typeof self&&self&&self.Object===Object&&self,Mt=It||Rt||Function("return this")(),Dt=t&&!t.nodeType&&t,jt=Dt&&"object"==typeof r&&r&&!r.nodeType&&r,Pt=jt&&jt.exports===Dt,zt=Pt&&It.process,Lt=function(){try{var e=jt&&jt.require&&jt.require("util").types;return e||zt&&zt.binding&&zt.binding("util")}catch(t){}}(),Bt=Lt&&Lt.isArrayBuffer,Ft=Lt&&Lt.isDate,Ut=Lt&&Lt.isMap,Wt=Lt&&Lt.isRegExp,Vt=Lt&&Lt.isSet,qt=Lt&&Lt.isTypedArray;function Ht(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Gt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function Kt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function $t(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Xt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Yt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Jt(e,t){return!!(null==e?0:e.length)&&un(e,t,0)>-1}function Zt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Qt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function en(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function tn(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function nn(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function rn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var on=hn("length");function an(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function sn(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}
vendor: 21,134 bytes, line 1
1function un(e,t,n){return t===t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):sn(e,ln,n)}function cn(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function ln(e){return e!==e}function fn(e,t){var n=null==e?0:e.length;return n?mn(e,t)/n:P}function hn(e){return function(t){return null==t?o:t[e]}}function dn(e){return function(t){return null==e?o:e[t]}}function pn(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function mn(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==o&&(n=n===o?a:n+a)}return n}function vn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function gn(e){return function(t){return e(t)}}function yn(e,t){return Qt(t,function(t){return e[t]})}function bn(e,t){return e.has(t)}function wn(e,t){for(var n=-1,r=e.length;++n<r&&un(t,e[n],0)>-1;);return n}function xn(e,t){for(var n=e.length;n--&&un(t,e[n],0)>-1;);return n}var _n=dn({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),kn=dn({"&":"&","<":"<",">":">",'"':""","'":"'"});function Sn(e){return"\\"+Ot[e]}function En(e){return _t.test(e)}function Cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Nn(e,t){return function(n){return e(t(n))}}function On(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==f||(e[n]=f,o[i++]=n)}return o}function An(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Tn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function In(e){return En(e)?function(e){var t=wt.lastIndex=0;for(;wt.test(e);)++t;return t}(e):on(e)}function Rn(e){return En(e)?function(e){return e.match(wt)||[]}(e):function(e){return e.split("")}(e)}var Mn=dn({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Dn=function e(t){var n=(t=null==t?Mt:Dn.defaults(Mt.Object(),t,Dn.pick(Mt,St))).Array,r=t.Date,i=t.Error,Ze=t.Function,Qe=t.Math,et=t.Object,tt=t.RegExp,nt=t.String,rt=t.TypeError,it=n.prototype,ot=Ze.prototype,at=et.prototype,st=t["__core-js_shared__"],ut=ot.toString,ct=at.hasOwnProperty,lt=0,ft=function(){var e=/[^.]+$/.exec(st&&st.keys&&st.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ht=at.toString,dt=ut.call(et),pt=Mt._,mt=tt("^"+ut.call(ct).replace(Re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vt=Pt?t.Buffer:o,gt=t.Symbol,wt=t.Uint8Array,_t=vt?vt.allocUnsafe:o,Ot=Nn(et.getPrototypeOf,et),It=et.create,Rt=at.propertyIsEnumerable,Dt=it.splice,jt=gt?gt.isConcatSpreadable:o,zt=gt?gt.iterator:o,Lt=gt?gt.toStringTag:o,on=function(){try{var e=Lo(et,"defineProperty");return e({},"",{}),e}catch(t){}}(),dn=t.clearTimeout!==Mt.clearTimeout&&t.clearTimeout,jn=r&&r.now!==Mt.Date.now&&r.now,Pn=t.setTimeout!==Mt.setTimeout&&t.setTimeout,zn=Qe.ceil,Ln=Qe.floor,Bn=et.getOwnPropertySymbols,Fn=vt?vt.isBuffer:o,Un=t.isFinite,Wn=it.join,Vn=Nn(et.keys,et),qn=Qe.max,Hn=Qe.min,Gn=r.now,Kn=t.parseInt,$n=Qe.random,Xn=it.reverse,Yn=Lo(t,"DataView"),Jn=Lo(t,"Map"),Zn=Lo(t,"Promise"),Qn=Lo(t,"Set"),er=Lo(t,"WeakMap"),tr=Lo(et,"create"),nr=er&&new er,rr={},ir=la(Yn),or=la(Jn),ar=la(Zn),sr=la(Qn),ur=la(er),cr=gt?gt.prototype:o,lr=cr?cr.valueOf:o,fr=cr?cr.toString:o;function hr(e){if(Ns(e)&&!vs(e)&&!(e instanceof vr)){if(e instanceof mr)return e;if(ct.call(e,"__wrapped__"))return fa(e)}return new mr(e)}var dr=function(){function e(){}return function(t){if(!Cs(t))return{};if(It)return It(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function pr(){}function mr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function vr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=z,this.__views__=[]}function gr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function yr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function br(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function wr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new br;++t<n;)this.add(e[t])}function xr(e){var t=this.__data__=new yr(e);this.size=t.size}function _r(e,t){var n=vs(e),r=!n&&ms(e),i=!n&&!r&&ws(e),o=!n&&!r&&!i&&js(e),a=n||r||i||o,s=a?vn(e.length,nt):[],u=s.length;for(var c in e)!t&&!ct.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ho(c,u))||s.push(c);return s}function kr(e){var t=e.length;return t?e[wi(0,t-1)]:o}function Sr(e,t){return sa(to(e),Mr(t,0,e.length))}function Er(e){return sa(to(e))}function Cr(e,t,n){(n===o||hs(e[t],n))&&(n!==o||t in e)||Ir(e,t,n)}function Nr(e,t,n){var r=e[t];ct.call(e,t)&&hs(r,n)&&(n!==o||t in e)||Ir(e,t,n)}function Or(e,t){for(var n=e.length;n--;)if(hs(e[n][0],t))return n;return-1}function Ar(e,t,n,r){return Lr(e,function(e,i,o){t(r,e,n(e),o)}),r}function Tr(e,t){return e&&no(t,ru(t),e)}function Ir(e,t,n){"__proto__"==t&&on?on(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Rr(e,t){for(var r=-1,i=t.length,a=n(i),s=null==e;++r<i;)a[r]=s?o:Zs(e,t[r]);return a}function Mr(e,t,n){return e===e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function Dr(e,t,n,r,i,a){var s,u=t&h,c=t&d,l=t&p;if(n&&(s=i?n(e,r,i,a):n(e)),s!==o)return s;if(!Cs(e))return e;var f=vs(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ct.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return to(e,s)}else{var m=Uo(e),v=m==$||m==X;if(ws(e))return Xi(e,u);if(m==Q||m==U||v&&!i){if(s=c||v?{}:Vo(e),!u)return c?function(e,t){return no(e,Fo(e),t)}(e,function(e,t){return e&&no(t,iu(t),e)}(s,e)):function(e,t){return no(e,Bo(e),t)}(e,Tr(s,e))}else{if(!Nt[m])return i?e:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case ue:return Yi(e);case q:case H:return new i(+e);case ce:return function(e,t){var n=t?Yi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case le:case fe:case he:case de:case pe:case me:case ve:case ge:case ye:return Ji(e,n);case Y:return new i;case J:case re:return new i(e);case te:return function(e){var t=new e.constructor(e.source,Ve.exec(e));return t.lastIndex=e.lastIndex,t}(e);case ne:return new i;case ie:return r=e,lr?et(lr.call(r)):{}}}(e,m,u)}}a||(a=new xr);var g=a.get(e);if(g)return g;if(a.set(e,s),Rs(e))return e.forEach(function(r){s.add(Dr(r,t,n,r,e,a))}),s;if(Os(e))return e.forEach(function(r,i){s.set(i,Dr(r,t,n,i,e,a))}),s;var y=f?o:(l?c?Io:To:c?iu:ru)(e);return Kt(y||e,function(r,i){y&&(r=e[i=r]),Nr(s,i,Dr(r,t,n,i,e,a))}),s}function jr(e,t,n){var r=n.length;if(null==e)return!r;for(e=et(e);r--;){var i=n[r],a=t[i],s=e[i];if(s===o&&!(i in e)||!a(s))return!1}return!0}function Pr(e,t,n){if("function"!=typeof e)throw new rt(u);return ra(function(){e.apply(o,n)},t)}function zr(e,t,n,r){var i=-1,o=Jt,s=!0,u=e.length,c=[],l=t.length;if(!u)return c;n&&(t=Qt(t,gn(n))),r?(o=Zt,s=!1):t.length>=a&&(o=bn,s=!1,t=new wr(t));e:for(;++i<u;){var f=e[i],h=null==n?f:n(f);if(f=r||0!==f?f:0,s&&h===h){for(var d=l;d--;)if(t[d]===h)continue e;c.push(f)}else o(t,h,r)||c.push(f)}return c}hr.templateSettings={escape:Ce,evaluate:Ne,interpolate:Oe,variable:"",imports:{_:hr}},hr.prototype=pr.prototype,hr.prototype.constructor=hr,mr.prototype=dr(pr.prototype),mr.prototype.constructor=mr,vr.prototype=dr(pr.prototype),vr.prototype.constructor=vr,gr.prototype.clear=function(){this.__data__=tr?tr(null):{},this.size=0},gr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},gr.prototype.get=function(e){var t=this.__data__;if(tr){var n=t[e];return n===c?o:n}return ct.call(t,e)?t[e]:o},gr.prototype.has=function(e){var t=this.__data__;return tr?t[e]!==o:ct.call(t,e)},gr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=tr&&t===o?c:t,this},yr.prototype.clear=function(){this.__data__=[],this.size=0},yr.prototype.delete=function(e){var t=this.__data__,n=Or(t,e);return!(n<0)&&(n==t.length-1?t.pop():Dt.call(t,n,1),--this.size,!0)},yr.prototype.get=function(e){var t=this.__data__,n=Or(t,e);return n<0?o:t[n][1]},yr.prototype.has=function(e){return Or(this.__data__,e)>-1},yr.prototype.set=function(e,t){var n=this.__data__,r=Or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},br.prototype.clear=function(){this.size=0,this.__data__={hash:new gr,map:new(Jn||yr),string:new gr}},br.prototype.delete=function(e){var t=Po(this,e).delete(e);return this.size-=t?1:0,t},br.prototype.get=function(e){return Po(this,e).get(e)},br.prototype.has=function(e){return Po(this,e).has(e)},br.prototype.set=function(e,t){var n=Po(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},wr.prototype.add=wr.prototype.push=function(e){return this.__data__.set(e,c),this},wr.prototype.has=function(e){return this.__data__.has(e)},xr.prototype.clear=function(){this.__data__=new yr,this.size=0},xr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},xr.prototype.get=function(e){return this.__data__.get(e)},xr.prototype.has=function(e){return this.__data__.has(e)},xr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof yr){var r=n.__data__;if(!Jn||r.length<a-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new br(r)}return n.set(e,t),this.size=n.size,this};var Lr=oo(Gr),Br=oo(Kr,!0);function Fr(e,t){var n=!0;return Lr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function Ur(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],s=t(a);if(null!=s&&(u===o?s===s&&!Ds(s):n(s,u)))var u=s,c=a}return c}function Wr(e,t){var n=[];return Lr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function Vr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=qo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?Vr(s,t-1,n,r,i):en(i,s):r||(i[i.length]=s)}return i}var qr=ao(),Hr=ao(!0);function Gr(e,t){return e&&qr(e,t,ru)}function Kr(e,t){return e&&Hr(e,t,ru)}function $r(e,t){return Yt(t,function(t){return ks(e[t])})}function Xr(e,t){for(var n=0,r=(t=Hi(t,e)).length;null!=e&&n<r;)e=e[ca(t[n++])];return n&&n==r?e:o}function Yr(e,t,n){var r=t(e);return vs(e)?r:en(r,n(e))}function Jr(e){return null==e?e===o?oe:Z:Lt&&Lt in et(e)?function(e){var t=ct.call(e,Lt),n=e[Lt];try{e[Lt]=o;var r=!0}catch(a){}var i=ht.call(e);return r&&(t?e[Lt]=n:delete e[Lt]),i}(e):function(e){return ht.call(e)}(e)}function Zr(e,t){return e>t}function Qr(e,t){return null!=e&&ct.call(e,t)}function ei(e,t){return null!=e&&t in et(e)}function ti(e,t,r){for(var i=r?Zt:Jt,a=e[0].length,s=e.length,u=s,c=n(s),l=1/0,f=[];u--;){var h=e[u];u&&t&&(h=Qt(h,gn(t))),l=Hn(h.length,l),c[u]=!r&&(t||a>=120&&h.length>=120)?new wr(u&&h):o}h=e[0];var d=-1,p=c[0];e:for(;++d<a&&f.length<l;){var m=h[d],v=t?t(m):m;if(m=r||0!==m?m:0,!(p?bn(p,v):i(f,v,r))){for(u=s;--u;){var g=c[u];if(!(g?bn(g,v):i(e[u],v,r)))continue e}p&&p.push(v),f.push(m)}}return f}function ni(e,t,n){var r=null==(e=ea(e,t=Hi(t,e)))?e:e[ca(_a(t))];return null==r?o:Ht(r,e,n)}function ri(e){return Ns(e)&&Jr(e)==U}function ii(e,t,n,r,i){return e===t||(null==e||null==t||!Ns(e)&&!Ns(t)?e!==e&&t!==t:function(e,t,n,r,i,a){var s=vs(e),u=vs(t),c=s?W:Uo(e),l=u?W:Uo(t),f=(c=c==U?Q:c)==Q,h=(l=l==U?Q:l)==Q,d=c==l;if(d&&ws(e)){if(!ws(t))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new xr),s||js(e)?Oo(e,t,n,r,i,a):function(e,t,n,r,i,o,a){switch(n){case ce:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ue:return!(e.byteLength!=t.byteLength||!o(new wt(e),new wt(t)));case q:case H:case J:return hs(+e,+t);case K:return e.name==t.name&&e.message==t.message;case te:case re:return e==t+"";case Y:var s=Cn;case ne:var u=r&m;if(s||(s=An),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;r|=v,a.set(e,t);var l=Oo(s(e),s(t),r,i,o,a);return a.delete(e),l;case ie:if(lr)return lr.call(e)==lr.call(t)}return!1}(e,t,c,n,r,i,a);if(!(n&m)){var p=f&&ct.call(e,"__wrapped__"),g=h&&ct.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,b=g?t.value():t;return a||(a=new xr),i(y,b,n,r,a)}}return!!d&&(a||(a=new xr),function(e,t,n,r,i,a){var s=n&m,u=To(e),c=u.length,l=To(t).length;if(c!=l&&!s)return!1;for(var f=c;f--;){var h=u[f];if(!(s?h in t:ct.call(t,h)))return!1}var d=a.get(e);if(d&&a.get(t))return d==t;var p=!0;a.set(e,t),a.set(t,e);for(var v=s;++f<c;){h=u[f];var g=e[h],y=t[h];if(r)var b=s?r(y,g,h,t,e,a):r(g,y,h,e,t,a);if(!(b===o?g===y||i(g,y,n,r,a):b)){p=!1;break}v||(v="constructor"==h)}if(p&&!v){var w=e.constructor,x=t.constructor;w!=x&&"constructor"in e&&"constructor"in t&&!("function"==typeof w&&w instanceof w&&"function"==typeof x&&x instanceof x)&&(p=!1)}return a.delete(e),a.delete(t),p}(e,t,n,r,i,a))}(e,t,n,r,ii,i))}function oi(e,t,n,r){var i=n.length,a=i,s=!r;if(null==e)return!a;for(e=et(e);i--;){var u=n[i];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++i<a;){var c=(u=n[i])[0],l=e[c],f=u[1];if(s&&u[2]){if(l===o&&!(c in e))return!1}else{var h=new xr;if(r)var d=r(l,f,c,e,t,h);if(!(d===o?ii(f,l,m|v,r,h):d))return!1}}return!0}function ai(e){return!(!Cs(e)||(t=e,ft&&ft in t))&&(ks(e)?mt:Ge).test(la(e));var t}function si(e){return"function"==typeof e?e:null==e?Au:"object"==typeof e?vs(e)?di(e[0],e[1]):hi(e):Lu(e)}function ui(e){if(!Yo(e))return Vn(e);var t=[];for(var n in et(e))ct.call(e,n)&&"constructor"!=n&&t.push(n);return t}function ci(e){if(!Cs(e))return function(e){var t=[];if(null!=e)for(var n in et(e))t.push(n);return t}(e);var t=Yo(e),n=[];for(var r in e)("constructor"!=r||!t&&ct.call(e,r))&&n.push(r);return n}function li(e,t){return e<t}function fi(e,t){var r=-1,i=ys(e)?n(e.length):[];return Lr(e,function(e,n,o){i[++r]=t(e,n,o)}),i}function hi(e){var t=zo(e);return 1==t.length&&t[0][2]?Zo(t[0][0],t[0][1]):function(n){return n===e||oi(n,e,t)}}function di(e,t){return Ko(e)&&Jo(t)?Zo(ca(e),t):function(n){var r=Zs(n,e);return r===o&&r===t?Qs(n,e):ii(t,r,m|v)}}function pi(e,t,n,r,i){e!==t&&qr(t,function(a,s){if(Cs(a))i||(i=new xr),function(e,t,n,r,i,a,s){var u=ta(e,n),c=ta(t,n),l=s.get(c);if(l)Cr(e,n,l);else{var f=a?a(u,c,n+"",e,t,s):o,h=f===o;if(h){var d=vs(c),p=!d&&ws(c),m=!d&&!p&&js(c);f=c,d||p||m?vs(u)?f=u:bs(u)?f=to(u):p?(h=!1,f=Xi(c,!0)):m?(h=!1,f=Ji(c,!0)):f=[]:Ts(c)||ms(c)?(f=u,ms(u)?f=Vs(u):Cs(u)&&!ks(u)||(f=Vo(c))):h=!1}h&&(s.set(c,f),i(f,c,r,a,s),s.delete(c)),Cr(e,n,f)}}(e,t,s,n,pi,r,i);else{var u=r?r(ta(e,s),a,s+"",e,t,i):o;u===o&&(u=a),Cr(e,s,u)}},iu)}function mi(e,t){var n=e.length;if(n)return Ho(t+=t<0?n:0,n)?e[t]:o}function vi(e,t,n){var r=-1;return t=Qt(t.length?t:[Au],gn(jo())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(fi(e,function(e,n,i){return{criteria:Qt(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var u=Zi(i[r],o[r]);if(u){if(r>=s)return u;var c=n[r];return u*("desc"==c?-1:1)}}return e.index-t.index}(e,t,n)})}function gi(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Xr(e,a);n(s,a)&&Ei(o,Hi(a,e),s)}return o}function yi(e,t,n,r){var i=r?cn:un,o=-1,a=t.length,s=e;for(e===t&&(t=to(t)),n&&(s=Qt(e,gn(n)));++o<a;)for(var u=0,c=t[o],l=n?n(c):c;(u=i(s,l,u,r))>-1;)s!==e&&Dt.call(s,u,1),Dt.call(e,u,1);return e}function bi(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;Ho(i)?Dt.call(e,i,1):zi(e,i)}}return e}function wi(e,t){return e+Ln($n()*(t-e+1))}function xi(e,t){var n="";if(!e||t<1||t>D)return n;do{t%2&&(n+=e),(t=Ln(t/2))&&(e+=e)}while(t);return n}function _i(e,t){return ia(Qo(e,t,Au),e+"")}function ki(e){return kr(hu(e))}function Si(e,t){var n=hu(e);return sa(n,Mr(t,0,n.length))}function Ei(e,t,n,r){if(!Cs(e))return e;for(var i=-1,a=(t=Hi(t,e)).length,s=a-1,u=e;null!=u&&++i<a;){var c=ca(t[i]),l=n;if(i!=s){var f=u[c];(l=r?r(f,c,u):o)===o&&(l=Cs(f)?f:Ho(t[i+1])?[]:{})}Nr(u,c,l),u=u[c]}return e}var Ci=nr?function(e,t){return nr.set(e,t),e}:Au,Ni=on?function(e,t){return on(e,"toString",{configurable:!0,enumerable:!1,value:Cu(t),writable:!0})}:Au;function Oi(e){return sa(hu(e))}function Ai(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=n(o);++i<o;)a[i]=e[i+t];return a}function Ti(e,t){var n;return Lr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function Ii(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t===t&&i<=B){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!Ds(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return Ri(e,t,Au,n)}function Ri(e,t,n,r){t=n(t);for(var i=0,a=null==e?0:e.length,s=t!==t,u=null===t,c=Ds(t),l=t===o;i<a;){var f=Ln((i+a)/2),h=n(e[f]),d=h!==o,p=null===h,m=h===h,v=Ds(h);if(s)var g=r||m;else g=l?m&&(r||d):u?m&&d&&(r||!p):c?m&&d&&!p&&(r||!v):!p&&!v&&(r?h<=t:h<t);g?i=f+1:a=f}return Hn(a,L)}function Mi(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!hs(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function Di(e){return"number"==typeof e?e:Ds(e)?P:+e}function ji(e){if("string"==typeof e)return e;if(vs(e))return Qt(e,ji)+"";if(Ds(e))return fr?fr.call(e):"";var t=e+"";return"0"==t&&1/e==-M?"-0":t}function Pi(e,t,n){var r=-1,i=Jt,o=e.length,s=!0,u=[],c=u;if(n)s=!1,i=Zt;else if(o>=a){var l=t?null:_o(e);if(l)return An(l);s=!1,i=bn,c=new wr}else c=t?[]:u;e:for(;++r<o;){var f=e[r],h=t?t(f):f;if(f=n||0!==f?f:0,s&&h===h){for(var d=c.length;d--;)if(c[d]===h)continue e;t&&c.push(h),u.push(f)}else i(c,h,n)||(c!==u&&c.push(h),u.push(f))}return u}function zi(e,t){return null==(e=ea(e,t=Hi(t,e)))||delete e[ca(_a(t))]}function Li(e,t,n,r){return Ei(e,t,n(Xr(e,t)),r)}function Bi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Ai(e,r?0:o,r?o+1:i):Ai(e,r?o+1:0,r?i:o)}function Fi(e,t){var n=e;return n instanceof vr&&(n=n.value()),tn(t,function(e,t){return t.func.apply(t.thisArg,en([e],t.args))},n)}function Ui(e,t,r){var i=e.length;if(i<2)return i?Pi(e[0]):[];for(var o=-1,a=n(i);++o<i;)for(var s=e[o],u=-1;++u<i;)u!=o&&(a[o]=zr(a[o]||s,e[u],t,r));return Pi(Vr(a,1),t,r)}function Wi(e,t,n){for(var r=-1,i=e.length,a=t.length,s={};++r<i;){var u=r<a?t[r]:o;n(s,e[r],u)}return s}function Vi(e){return bs(e)?e:[]}function qi(e){return"function"==typeof e?e:Au}function Hi(e,t){return vs(e)?e:Ko(e,t)?[e]:ua(qs(e))}var Gi=_i;function Ki(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:Ai(e,t,n)}var $i=dn||function(e){return Mt.clearTimeout(e)};function Xi(e,t){if(t)return e.slice();var n=e.length,r=_t?_t(n):new e.constructor(n);return e.copy(r),r}function Yi(e){var t=new e.constructor(e.byteLength);return new wt(t).set(new wt(e)),t}function Ji(e,t){var n=t?Yi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Zi(e,t){if(e!==t){var n=e!==o,r=null===e,i=e===e,a=Ds(e),s=t!==o,u=null===t,c=t===t,l=Ds(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!i)return 1;
vendor: 4,453 bytes, line 1
1if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||u&&n&&i||!s&&i||!c)return-1}return 0}function Qi(e,t,r,i){for(var o=-1,a=e.length,s=r.length,u=-1,c=t.length,l=qn(a-s,0),f=n(c+l),h=!i;++u<c;)f[u]=t[u];for(;++o<s;)(h||o<a)&&(f[r[o]]=e[o]);for(;l--;)f[u++]=e[o++];return f}function eo(e,t,r,i){for(var o=-1,a=e.length,s=-1,u=r.length,c=-1,l=t.length,f=qn(a-u,0),h=n(f+l),d=!i;++o<f;)h[o]=e[o];for(var p=o;++c<l;)h[p+c]=t[c];for(;++s<u;)(d||o<a)&&(h[p+r[s]]=e[o++]);return h}function to(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function no(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var u=t[a],c=r?r(n[u],e[u],u,n,e):o;c===o&&(c=e[u]),i?Ir(n,u,c):Nr(n,u,c)}return n}function ro(e,t){return function(n,r){var i=vs(n)?Gt:Ar,o=t?t():{};return i(n,e,jo(r,2),o)}}function io(e){return _i(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,s=i>2?n[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,s&&Go(n[0],n[1],s)&&(a=i<3?o:a,i=1),t=et(t);++r<i;){var u=n[r];u&&e(t,u,r,a)}return t})}function oo(e,t){return function(n,r){if(null==n)return n;if(!ys(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=et(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function ao(e){return function(t,n,r){for(var i=-1,o=et(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}function so(e){return function(t){var n=En(t=qs(t))?Rn(t):o,r=n?n[0]:t.charAt(0),i=n?Ki(n,1).join(""):t.slice(1);return r[e]()+i}}function uo(e){return function(t){return tn(ku(mu(t).replace(yt,"")),e,"")}}function co(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=dr(e.prototype),r=e.apply(n,t);return Cs(r)?r:n}}function lo(e){return function(t,n,r){var i=et(t);if(!ys(t)){var a=jo(n,3);t=ru(t),n=function(e){return a(i[e],e,i)}}var s=e(t,n,r);return s>-1?i[a?t[s]:s]:o}}function fo(e){return Ao(function(t){var n=t.length,r=n,i=mr.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new rt(u);if(i&&!s&&"wrapper"==Mo(a))var s=new mr([],!0)}for(r=s?r:n;++r<n;){var c=Mo(a=t[r]),l="wrapper"==c?Ro(a):o;s=l&&$o(l[0])&&l[1]==(S|w|_|E)&&!l[4].length&&1==l[9]?s[Mo(l[0])].apply(s,l[3]):1==a.length&&$o(a)?s[c]():s.thru(a)}return function(){var e=arguments,r=e[0];if(s&&1==e.length&&vs(r))return s.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}})}function ho(e,t,r,i,a,s,u,c,l,f){var h=t&S,d=t&g,p=t&y,m=t&(w|x),v=t&C,b=p?o:co(e);return function g(){for(var y=arguments.length,w=n(y),x=y;x--;)w[x]=arguments[x];if(m)var _=Do(g),k=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(w,_);if(i&&(w=Qi(w,i,a,m)),s&&(w=eo(w,s,u,m)),y-=k,m&&y<f){var S=On(w,_);return wo(e,t,ho,g.placeholder,r,w,S,c,l,f-y)}var E=d?r:this,C=p?E[e]:e;return y=w.length,c?w=function(e,t){for(var n=e.length,r=Hn(t.length,n),i=to(e);r--;){var a=t[r];e[r]=Ho(a,n)?i[a]:o}return e}(w,c):v&&y>1&&w.reverse(),h&&l<y&&(w.length=l),this&&this!==Mt&&this instanceof g&&(C=b||co(C)),C.apply(E,w)}}function po(e,t){return function(n,r){return function(e,t,n,r){return Gr(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function mo(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=ji(n),r=ji(r)):(n=Di(n),r=Di(r)),i=e(n,r)}return i}}function vo(e){return Ao(function(t){return t=Qt(t,gn(jo())),_i(function(n){var r=this;return e(t,function(e){return Ht(e,r,n)})})})}function go(e,t){var n=(t=t===o?" ":ji(t)).length;if(n<2)return n?xi(t,e):t;var r=xi(t,zn(e/In(t)));return En(t)?Ki(Rn(r),0,e).join(""):r.slice(0,e)}function yo(e){return function(t,r,i){return i&&"number"!=typeof i&&Go(t,r,i)&&(r=i=o),t=Bs(t),r===o?(r=t,t=0):r=Bs(r),function(e,t,r,i){for(var o=-1,a=qn(zn((t-e)/(r||1)),0),s=n(a);a--;)s[i?a:++o]=e,e+=r;return s}(t,r,i=i===o?t<r?1:-1:Bs(i),e)}}function bo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=Ws(t),n=Ws(n)),e(t,n)}}function wo(e,t,n,r,i,a,s,u,c,l){var f=t&w;t|=f?_:k,(t&=~(f?k:_))&b||(t&=~(g|y));var h=[e,t,i,f?a:o,f?s:o,f?o:a,f?o:s,u,c,l],d=n.apply(o,h);return $o(e)&&na(d,h),d.placeholder=r,oa(d,e,t)}function xo(e){var t=Qe[e];
vendor: 7,625 bytes, line 1
1return function(e,n){if(e=Ws(e),n=null==n?0:Hn(Fs(n),292)){var r=(qs(e)+"e").split("e");return+((r=(qs(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var _o=Qn&&1/An(new Qn([,-0]))[1]==M?function(e){return new Qn(e)}:Du;function ko(e){return function(t){var n=Uo(t);return n==Y?Cn(t):n==ne?Tn(t):function(e,t){return Qt(t,function(t){return[t,e[t]]})}(t,e(t))}}function So(e,t,r,i,a,s,c,l){var h=t&y;if(!h&&"function"!=typeof e)throw new rt(u);var d=i?i.length:0;if(d||(t&=~(_|k),i=a=o),c=c===o?c:qn(Fs(c),0),l=l===o?l:Fs(l),d-=a?a.length:0,t&k){var p=i,m=a;i=a=o}var v=h?o:Ro(e),C=[e,t,r,i,a,p,m,s,c,l];if(v&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<(g|y|S),a=r==S&&n==w||r==S&&n==E&&e[7].length<=t[8]||r==(S|E)&&t[7].length<=t[8]&&n==w;if(!o&&!a)return e;r&g&&(e[2]=t[2],i|=n&g?0:b);var s=t[3];if(s){var u=e[3];e[3]=u?Qi(u,s,t[4]):s,e[4]=u?On(e[3],f):t[4]}(s=t[5])&&(u=e[5],e[5]=u?eo(u,s,t[6]):s,e[6]=u?On(e[5],f):t[6]),(s=t[7])&&(e[7]=s),r&S&&(e[8]=null==e[8]?t[8]:Hn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(C,v),e=C[0],t=C[1],r=C[2],i=C[3],a=C[4],!(l=C[9]=C[9]===o?h?0:e.length:qn(C[9]-d,0))&&t&(w|x)&&(t&=~(w|x)),t&&t!=g)N=t==w||t==x?function(e,t,r){var i=co(e);return function a(){for(var s=arguments.length,u=n(s),c=s,l=Do(a);c--;)u[c]=arguments[c];var f=s<3&&u[0]!==l&&u[s-1]!==l?[]:On(u,l);return(s-=f.length)<r?wo(e,t,ho,a.placeholder,o,u,f,o,o,r-s):Ht(this&&this!==Mt&&this instanceof a?i:e,this,u)}}(e,t,l):t!=_&&t!=(g|_)||a.length?ho.apply(o,C):function(e,t,r,i){var o=t&g,a=co(e);return function t(){for(var s=-1,u=arguments.length,c=-1,l=i.length,f=n(l+u),h=this&&this!==Mt&&this instanceof t?a:e;++c<l;)f[c]=i[c];for(;u--;)f[c++]=arguments[++s];return Ht(h,o?r:this,f)}}(e,t,r,i);else var N=function(e,t,n){var r=t&g,i=co(e);return function t(){return(this&&this!==Mt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,r);return oa((v?Ci:na)(N,C),e,t)}function Eo(e,t,n,r){return e===o||hs(e,at[n])&&!ct.call(r,n)?t:e}function Co(e,t,n,r,i,a){return Cs(e)&&Cs(t)&&(a.set(t,e),pi(e,t,o,Co,a),a.delete(t)),e}function No(e){return Ts(e)?o:e}function Oo(e,t,n,r,i,a){var s=n&m,u=e.length,c=t.length;if(u!=c&&!(s&&c>u))return!1;var l=a.get(e);if(l&&a.get(t))return l==t;var f=-1,h=!0,d=n&v?new wr:o;for(a.set(e,t),a.set(t,e);++f<u;){var p=e[f],g=t[f];if(r)var y=s?r(g,p,f,t,e,a):r(p,g,f,e,t,a);if(y!==o){if(y)continue;h=!1;break}if(d){if(!rn(t,function(e,t){if(!bn(d,t)&&(p===e||i(p,e,n,r,a)))return d.push(t)})){h=!1;break}}else if(p!==g&&!i(p,g,n,r,a)){h=!1;break}}return a.delete(e),a.delete(t),h}function Ao(e){return ia(Qo(e,o,ga),e+"")}function To(e){return Yr(e,ru,Bo)}function Io(e){return Yr(e,iu,Fo)}var Ro=nr?function(e){return nr.get(e)}:Du;function Mo(e){for(var t=e.name+"",n=rr[t],r=ct.call(rr,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function Do(e){return(ct.call(hr,"placeholder")?hr:e).placeholder}function jo(){var e=hr.iteratee||Tu;return e=e===Tu?si:e,arguments.length?e(arguments[0],arguments[1]):e}function Po(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function zo(e){for(var t=ru(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Jo(i)]}return t}function Lo(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return ai(n)?n:o}var Bo=Bn?function(e){return null==e?[]:(e=et(e),Yt(Bn(e),function(t){return Rt.call(e,t)}))}:Uu,Fo=Bn?function(e){for(var t=[];e;)en(t,Bo(e)),e=Ot(e);return t}:Uu,Uo=Jr;function Wo(e,t,n){for(var r=-1,i=(t=Hi(t,e)).length,o=!1;++r<i;){var a=ca(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Es(i)&&Ho(a,i)&&(vs(e)||ms(e))}function Vo(e){return"function"!=typeof e.constructor||Yo(e)?{}:dr(Ot(e))}function qo(e){return vs(e)||ms(e)||!!(jt&&e&&e[jt])}function Ho(e,t){var n=typeof e;return!!(t=null==t?D:t)&&("number"==n||"symbol"!=n&&$e.test(e))&&e>-1&&e%1==0&&e<t}function Go(e,t,n){if(!Cs(n))return!1;var r=typeof t;return!!("number"==r?ys(n)&&Ho(t,n.length):"string"==r&&t in n)&&hs(n[t],e)}function Ko(e,t){if(vs(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ds(e))||Te.test(e)||!Ae.test(e)||null!=t&&e in et(t)}function $o(e){var t=Mo(e),n=hr[t];if("function"!=typeof n||!(t in vr.prototype))return!1;if(e===n)return!0;var r=Ro(n);return!!r&&e===r[0]}(Yn&&Uo(new Yn(new ArrayBuffer(1)))!=ce||Jn&&Uo(new Jn)!=Y||Zn&&"[object Promise]"!=Uo(Zn.resolve())||Qn&&Uo(new Qn)!=ne||er&&Uo(new er)!=ae)&&(Uo=function(e){var t=Jr(e),n=t==Q?e.constructor:o,r=n?la(n):"";if(r)switch(r){case ir:return ce;case or:return Y;case ar:return"[object Promise]";case sr:return ne;case ur:return ae}return t});var Xo=st?ks:Wu;function Yo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||at)}function Jo(e){return e===e&&!Cs(e)}function Zo(e,t){return function(n){return null!=n&&n[e]===t&&(t!==o||e in et(n))}}function Qo(e,t,r){return t=qn(t===o?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=qn(i.length-t,0),s=n(a);++o<a;)s[o]=i[t+o];o=-1;for(var u=n(t+1);++o<t;)u[o]=i[o];return u[t]=r(s),Ht(e,this,u)}}function ea(e,t){return t.length<2?e:Xr(e,Ai(t,0,-1))}function ta(e,t){if("__proto__"!=t)return e[t]}var na=aa(Ci),ra=Pn||function(e,t){return Mt.setTimeout(e,t)},ia=aa(Ni);function oa(e,t,n){var r=t+"";return ia(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ze,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Kt(F,function(n){var r="_."+n[0];t&n[1]&&!Jt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(Le);return t?t[1].split(Be):[]}(r),n)))}function aa(e){var t=0,n=0;return function(){var r=Gn(),i=T-(r-n);if(n=r,i>0){if(++t>=A)return arguments[0]}else t=0;return e.apply(o,arguments)}}function sa(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var a=wi(n,i),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var ua=function(e){var t=as(e,function(e){return n.size===l&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ie,function(e,n,r,i){t.push(r?i.replace(Ue,"$1"):n||e)}),t});function ca(e){if("string"==typeof e||Ds(e))return e;var t=e+"";return"0"==t&&1/e==-M?"-0":t}function la(e){if(null!=e){try{return ut.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function fa(e){if(e instanceof vr)return e.clone();var t=new mr(e.__wrapped__,e.__chain__);return t.__actions__=to(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var ha=_i(function(e,t){return bs(e)?zr(e,Vr(t,1,bs,!0)):[]}),da=_i(function(e,t){var n=_a(t);return bs(n)&&(n=o),bs(e)?zr(e,Vr(t,1,bs,!0),jo(n,2)):[]}),pa=_i(function(e,t){var n=_a(t);return bs(n)&&(n=o),bs(e)?zr(e,Vr(t,1,bs,!0),o,n):[]});function ma(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Fs(n);return i<0&&(i=qn(r+i,0)),sn(e,jo(t,3),i)}function va(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=Fs(n),i=n<0?qn(r+i,0):Hn(i,r-1)),sn(e,jo(t,3),i,!0)}function ga(e){return null!=e&&e.length?Vr(e,1):[]}function ya(e){return e&&e.length?e[0]:o}var ba=_i(function(e){var t=Qt(e,Vi);return t.length&&t[0]===e[0]?ti(t):[]}),wa=_i(function(e){var t=_a(e),n=Qt(e,Vi);return t===_a(n)?t=o:n.pop(),n.length&&n[0]===e[0]?ti(n,jo(t,2)):[]}),xa=_i(function(e){var t=_a(e),n=Qt(e,Vi);return(t="function"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?ti(n,o,t):[]});function _a(e){var t=null==e?0:e.length;return t?e[t-1]:o}var ka=_i(Sa);function Sa(e,t){return e&&e.length&&t&&t.length?yi(e,t):e}
vendor: 1,150 bytes, line 1
1var Ea=Ao(function(e,t){var n=null==e?0:e.length,r=Rr(e,t);return bi(e,Qt(t,function(e){return Ho(e,n)?+e:e}).sort(Zi)),r});function Ca(e){return null==e?e:Xn.call(e)}var Na=_i(function(e){return Pi(Vr(e,1,bs,!0))}),Oa=_i(function(e){var t=_a(e);return bs(t)&&(t=o),Pi(Vr(e,1,bs,!0),jo(t,2))}),Aa=_i(function(e){var t=_a(e);return t="function"==typeof t?t:o,Pi(Vr(e,1,bs,!0),o,t)});function Ta(e){if(!e||!e.length)return[];var t=0;return e=Yt(e,function(e){if(bs(e))return t=qn(e.length,t),!0}),vn(t,function(t){return Qt(e,hn(t))})}function Ia(e,t){if(!e||!e.length)return[];var n=Ta(e);return null==t?n:Qt(n,function(e){return Ht(t,o,e)})}var Ra=_i(function(e,t){return bs(e)?zr(e,t):[]}),Ma=_i(function(e){return Ui(Yt(e,bs))}),Da=_i(function(e){var t=_a(e);return bs(t)&&(t=o),Ui(Yt(e,bs),jo(t,2))}),ja=_i(function(e){var t=_a(e);return t="function"==typeof t?t:o,Ui(Yt(e,bs),o,t)}),Pa=_i(Ta);var za=_i(function(e){var t=e.length,n=t>1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,Ia(e,n)});function La(e){var t=hr(e);return t.__chain__=!0,t}function Ba(e,t){return t(e)}var Fa=Ao(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,
vendor: 10,707 bytes, line 1
1i=function(t){return Rr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof vr&&Ho(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:Ba,args:[i],thisArg:o}),new mr(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(o),e})):this.thru(i)});var Ua=ro(function(e,t,n){ct.call(e,n)?++e[n]:Ir(e,n,1)});var Wa=lo(ma),Va=lo(va);function qa(e,t){return(vs(e)?Kt:Lr)(e,jo(t,3))}function Ha(e,t){return(vs(e)?$t:Br)(e,jo(t,3))}var Ga=ro(function(e,t,n){ct.call(e,n)?e[n].push(t):Ir(e,n,[t])});var Ka=_i(function(e,t,r){var i=-1,o="function"==typeof t,a=ys(e)?n(e.length):[];return Lr(e,function(e){a[++i]=o?Ht(t,e,r):ni(e,t,r)}),a}),$a=ro(function(e,t,n){Ir(e,n,t)});function Xa(e,t){return(vs(e)?Qt:fi)(e,jo(t,3))}var Ya=ro(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var Ja=_i(function(e,t){if(null==e)return[];var n=t.length;return n>1&&Go(e,t[0],t[1])?t=[]:n>2&&Go(t[0],t[1],t[2])&&(t=[t[0]]),vi(e,Vr(t,1),[])}),Za=jn||function(){return Mt.Date.now()};function Qa(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,So(e,S,o,o,o,o,t)}function es(e,t){var n;if("function"!=typeof t)throw new rt(u);return e=Fs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var ts=_i(function(e,t,n){var r=g;if(n.length){var i=On(n,Do(ts));r|=_}return So(e,r,t,n,i)}),ns=_i(function(e,t,n){var r=g|y;if(n.length){var i=On(n,Do(ns));r|=_}return So(t,r,e,n,i)});function rs(e,t,n){var r,i,a,s,c,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new rt(u);function m(t){var n=r,a=i;return r=i=o,f=t,s=e.apply(a,n)}function v(e){var n=e-l;return l===o||n>=t||n<0||d&&e-f>=a}function g(){var e=Za();if(v(e))return y(e);c=ra(g,function(e){var n=t-(e-l);return d?Hn(n,a-(e-f)):n}(e))}function y(e){return c=o,p&&r?m(e):(r=i=o,s)}function b(){var e=Za(),n=v(e);if(r=arguments,i=this,l=e,n){if(c===o)return function(e){return f=e,c=ra(g,t),h?m(e):s}(l);if(d)return c=ra(g,t),m(l)}return c===o&&(c=ra(g,t)),s}return t=Ws(t)||0,Cs(n)&&(h=!!n.leading,a=(d="maxWait"in n)?qn(Ws(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){c!==o&&$i(c),f=0,r=l=i=c=o},b.flush=function(){return c===o?s:y(Za())},b}var is=_i(function(e,t){return Pr(e,1,t)}),os=_i(function(e,t,n){return Pr(e,Ws(t)||0,n)});function as(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new rt(u);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(as.Cache||br),n}function ss(e){if("function"!=typeof e)throw new rt(u);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}as.Cache=br;var us=Gi(function(e,t){var n=(t=1==t.length&&vs(t[0])?Qt(t[0],gn(jo())):Qt(Vr(t,1),gn(jo()))).length;return _i(function(r){for(var i=-1,o=Hn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ht(e,this,r)})}),cs=_i(function(e,t){var n=On(t,Do(cs));return So(e,_,o,t,n)}),ls=_i(function(e,t){var n=On(t,Do(ls));return So(e,k,o,t,n)}),fs=Ao(function(e,t){return So(e,E,o,o,o,t)});function hs(e,t){return e===t||e!==e&&t!==t}var ds=bo(Zr),ps=bo(function(e,t){return e>=t}),ms=ri(function(){return arguments}())?ri:function(e){return Ns(e)&&ct.call(e,"callee")&&!Rt.call(e,"callee")},vs=n.isArray,gs=Bt?gn(Bt):function(e){return Ns(e)&&Jr(e)==ue};function ys(e){return null!=e&&Es(e.length)&&!ks(e)}function bs(e){return Ns(e)&&ys(e)}var ws=Fn||Wu,xs=Ft?gn(Ft):function(e){return Ns(e)&&Jr(e)==H};function _s(e){if(!Ns(e))return!1;var t=Jr(e);return t==K||t==G||"string"==typeof e.message&&"string"==typeof e.name&&!Ts(e)}function ks(e){if(!Cs(e))return!1;var t=Jr(e);return t==$||t==X||t==V||t==ee}function Ss(e){return"number"==typeof e&&e==Fs(e)}function Es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=D}function Cs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ns(e){return null!=e&&"object"==typeof e}var Os=Ut?gn(Ut):function(e){return Ns(e)&&Uo(e)==Y};function As(e){return"number"==typeof e||Ns(e)&&Jr(e)==J}function Ts(e){if(!Ns(e)||Jr(e)!=Q)return!1;var t=Ot(e);if(null===t)return!0;var n=ct.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ut.call(n)==dt}var Is=Wt?gn(Wt):function(e){return Ns(e)&&Jr(e)==te};var Rs=Vt?gn(Vt):function(e){return Ns(e)&&Uo(e)==ne};function Ms(e){return"string"==typeof e||!vs(e)&&Ns(e)&&Jr(e)==re}function Ds(e){return"symbol"==typeof e||Ns(e)&&Jr(e)==ie}var js=qt?gn(qt):function(e){return Ns(e)&&Es(e.length)&&!!Ct[Jr(e)]};var Ps=bo(li),zs=bo(function(e,t){return e<=t});function Ls(e){if(!e)return[];if(ys(e))return Ms(e)?Rn(e):to(e);if(zt&&e[zt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[zt]());var t=Uo(e);return(t==Y?Cn:t==ne?An:hu)(e)}function Bs(e){return e?(e=Ws(e))===M||e===-M?(e<0?-1:1)*j:e===e?e:0:0===e?e:0}function Fs(e){var t=Bs(e),n=t%1;return t===t?n?t-n:t:0}function Us(e){return e?Mr(Fs(e),0,z):0}function Ws(e){if("number"==typeof e)return e;if(Ds(e))return P;if(Cs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Cs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(De,"");var n=He.test(e);return n||Ke.test(e)?Tt(e.slice(2),n?2:8):qe.test(e)?P:+e}function Vs(e){return no(e,iu(e))}function qs(e){return null==e?"":ji(e)}var Hs=io(function(e,t){if(Yo(t)||ys(t))no(t,ru(t),e);else for(var n in t)ct.call(t,n)&&Nr(e,n,t[n])}),Gs=io(function(e,t){no(t,iu(t),e)}),Ks=io(function(e,t,n,r){no(t,iu(t),e,r)}),$s=io(function(e,t,n,r){no(t,ru(t),e,r)}),Xs=Ao(Rr);var Ys=_i(function(e,t){e=et(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&Go(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],s=iu(a),u=-1,c=s.length;++u<c;){var l=s[u],f=e[l];(f===o||hs(f,at[l])&&!ct.call(e,l))&&(e[l]=a[l])}return e}),Js=_i(function(e){return e.push(o,Co),Ht(au,o,e)});function Zs(e,t,n){var r=null==e?o:Xr(e,t);return r===o?n:r}function Qs(e,t){return null!=e&&Wo(e,t,ei)}var eu=po(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=ht.call(t)),e[t]=n},Cu(Au)),tu=po(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=ht.call(t)),ct.call(e,t)?e[t].push(n):e[t]=[n]},jo),nu=_i(ni);function ru(e){return ys(e)?_r(e):ui(e)}function iu(e){return ys(e)?_r(e,!0):ci(e)}var ou=io(function(e,t,n){pi(e,t,n)}),au=io(function(e,t,n,r){pi(e,t,n,r)}),su=Ao(function(e,t){var n={};if(null==e)return n;var r=!1;t=Qt(t,function(t){return t=Hi(t,e),r||(r=t.length>1),t}),no(e,Io(e),n),r&&(n=Dr(n,h|d|p,No));for(var i=t.length;i--;)zi(n,t[i]);return n});var uu=Ao(function(e,t){return null==e?{}:function(e,t){return gi(e,t,function(t,n){return Qs(e,n)})}(e,t)});function cu(e,t){if(null==e)return{};var n=Qt(Io(e),function(e){return[e]});return t=jo(t),gi(e,n,function(e,n){return t(e,n[0])})}var lu=ko(ru),fu=ko(iu);function hu(e){return null==e?[]:yn(e,ru(e))}var du=uo(function(e,t,n){return t=t.toLowerCase(),e+(n?pu(t):t)});function pu(e){return _u(qs(e).toLowerCase())}function mu(e){return(e=qs(e))&&e.replace(Xe,_n).replace(bt,"")}var vu=uo(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),gu=uo(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),yu=so("toLowerCase");var bu=uo(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});var wu=uo(function(e,t,n){return e+(n?" ":"")+_u(t)});var xu=uo(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),_u=so("toUpperCase");function ku(e,t,n){return e=qs(e),(t=n?o:t)===o?function(e){return kt.test(e)}(e)?function(e){return e.match(xt)||[]}(e):function(e){return e.match(Fe)||[]}(e):e.match(t)||[]}var Su=_i(function(e,t){try{return Ht(e,o,t)}catch(n){return _s(n)?n:new i(n)}}),Eu=Ao(function(e,t){return Kt(t,function(t){t=ca(t),Ir(e,t,ts(e[t],e))}),e});function Cu(e){return function(){return e}}var Nu=fo(),Ou=fo(!0);function Au(e){return e}function Tu(e){return si("function"==typeof e?e:Dr(e,h))}var Iu=_i(function(e,t){return function(n){return ni(n,e,t)}}),Ru=_i(function(e,t){return function(n){return ni(e,n,t)}});function Mu(e,t,n){var r=ru(t),i=$r(t,r);null!=n||Cs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=$r(t,ru(t)));var o=!(Cs(n)&&"chain"in n)||!!n.chain,a=ks(e);return Kt(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=to(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,en([this.value()],arguments))})}),e}function Du(){}var ju=vo(Qt),Pu=vo(Xt),zu=vo(rn);function Lu(e){return Ko(e)?hn(ca(e)):function(e){return function(t){return Xr(t,e)}}(e)}var Bu=yo(),Fu=yo(!0);function Uu(){return[]}function Wu(){return!1}var Vu=mo(function(e,t){return e+t},0),qu=xo("ceil"),Hu=mo(function(e,t){return e/t},1),Gu=xo("floor");var Ku=mo(function(e,t){return e*t},1),$u=xo("round"),Xu=mo(function(e,t){return e-t},0);return hr.after=function(e,t){if("function"!=typeof t)throw new rt(u);return e=Fs(e),function(){if(--e<1)return t.apply(this,arguments)}},hr.ary=Qa,hr.assign=Hs,hr.assignIn=Gs,hr.assignInWith=Ks,hr.assignWith=$s,hr.at=Xs,hr.before=es,hr.bind=ts,hr.bindAll=Eu,hr.bindKey=ns,hr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return vs(e)?e:[e]},hr.chain=La,hr.chunk=function(e,t,r){t=(r?Go(e,t,r):t===o)?1:qn(Fs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,u=n(zn(i/t));a<i;)u[s++]=Ai(e,a,a+=t);return u},hr.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},hr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return en(vs(r)?to(r):[r],Vr(t,1))},hr.cond=function(e){var t=null==e?0:e.length,n=jo();return e=t?Qt(e,function(e){if("function"!=typeof e[1])throw new rt(u);return[n(e[0]),e[1]]}):[],_i(function(n){for(var r=-1;++r<t;){var i=e[r];if(Ht(i[0],this,n))return Ht(i[1],this,n)}})},hr.conforms=function(e){return function(e){var t=ru(e);return function(n){return jr(n,e,t)}}(Dr(e,h))},hr.constant=Cu,hr.countBy=Ua,hr.create=function(e,t){var n=dr(e);return null==t?n:Tr(n,t)},hr.curry=function e(t,n,r){var i=So(t,w,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},hr.curryRight=function e(t,n,r){var i=So(t,x,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},hr.debounce=rs,hr.defaults=Ys,hr.defaultsDeep=Js,hr.defer=is,hr.delay=os,hr.difference=ha,hr.differenceBy=da,hr.differenceWith=pa,hr.drop=function(e,t,n){var r=null==e?0:e.length;return r?Ai(e,(t=n||t===o?1:Fs(t))<0?0:t,r):[]},hr.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Ai(e,0,(t=r-(t=n||t===o?1:Fs(t)))<0?0:t):[]},hr.dropRightWhile=function(e,t){return e&&e.length?Bi(e,jo(t,3),!0,
vendor: 4,495 bytes, line 1
1!0):[]},hr.dropWhile=function(e,t){return e&&e.length?Bi(e,jo(t,3),!0):[]},hr.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&Go(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=Fs(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:Fs(r))<0&&(r+=i),r=n>r?0:Us(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},hr.filter=function(e,t){return(vs(e)?Yt:Wr)(e,jo(t,3))},hr.flatMap=function(e,t){return Vr(Xa(e,t),1)},hr.flatMapDeep=function(e,t){return Vr(Xa(e,t),M)},hr.flatMapDepth=function(e,t,n){return n=n===o?1:Fs(n),Vr(Xa(e,t),n)},hr.flatten=ga,hr.flattenDeep=function(e){return null!=e&&e.length?Vr(e,M):[]},hr.flattenDepth=function(e,t){return null!=e&&e.length?Vr(e,t=t===o?1:Fs(t)):[]},hr.flip=function(e){return So(e,C)},hr.flow=Nu,hr.flowRight=Ou,hr.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},hr.functions=function(e){return null==e?[]:$r(e,ru(e))},hr.functionsIn=function(e){return null==e?[]:$r(e,iu(e))},hr.groupBy=Ga,hr.initial=function(e){return null!=e&&e.length?Ai(e,0,-1):[]},hr.intersection=ba,hr.intersectionBy=wa,hr.intersectionWith=xa,hr.invert=eu,hr.invertBy=tu,hr.invokeMap=Ka,hr.iteratee=Tu,hr.keyBy=$a,hr.keys=ru,hr.keysIn=iu,hr.map=Xa,hr.mapKeys=function(e,t){var n={};return t=jo(t,3),Gr(e,function(e,r,i){Ir(n,t(e,r,i),e)}),n},hr.mapValues=function(e,t){var n={};return t=jo(t,3),Gr(e,function(e,r,i){Ir(n,r,t(e,r,i))}),n},hr.matches=function(e){return hi(Dr(e,h))},hr.matchesProperty=function(e,t){return di(e,Dr(t,h))},hr.memoize=as,hr.merge=ou,hr.mergeWith=au,hr.method=Iu,hr.methodOf=Ru,hr.mixin=Mu,hr.negate=ss,hr.nthArg=function(e){return e=Fs(e),_i(function(t){return mi(t,e)})},hr.omit=su,hr.omitBy=function(e,t){return cu(e,ss(jo(t)))},hr.once=function(e){return es(2,e)},hr.orderBy=function(e,t,n,r){return null==e?[]:(vs(t)||(t=null==t?[]:[t]),vs(n=r?o:n)||(n=null==n?[]:[n]),vi(e,t,n))},hr.over=ju,hr.overArgs=us,hr.overEvery=Pu,hr.overSome=zu,hr.partial=cs,hr.partialRight=ls,hr.partition=Ya,hr.pick=uu,hr.pickBy=cu,hr.property=Lu,hr.propertyOf=function(e){return function(t){return null==e?o:Xr(e,t)}},hr.pull=ka,hr.pullAll=Sa,hr.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?yi(e,t,jo(n,2)):e},hr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?yi(e,t,o,n):e},hr.pullAt=Ea,hr.range=Bu,hr.rangeRight=Fu,hr.rearg=fs,hr.reject=function(e,t){return(vs(e)?Yt:Wr)(e,ss(jo(t,3)))},hr.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=jo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return bi(e,i),n},hr.rest=function(e,t){if("function"!=typeof e)throw new rt(u);return _i(e,t=t===o?t:Fs(t))},hr.reverse=Ca,hr.sampleSize=function(e,t,n){return t=(n?Go(e,t,n):t===o)?1:Fs(t),(vs(e)?Sr:Si)(e,t)},hr.set=function(e,t,n){return null==e?e:Ei(e,t,n)},hr.setWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:Ei(e,t,n,r)},hr.shuffle=function(e){return(vs(e)?Er:Oi)(e)},hr.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&Go(e,t,n)?(t=0,n=r):(t=null==t?0:Fs(t),n=n===o?r:Fs(n)),Ai(e,t,n)):[]},hr.sortBy=Ja,hr.sortedUniq=function(e){return e&&e.length?Mi(e):[]},hr.sortedUniqBy=function(e,t){return e&&e.length?Mi(e,jo(t,2)):[]},hr.split=function(e,t,n){return n&&"number"!=typeof n&&Go(e,t,n)&&(t=n=o),(n=n===o?z:n>>>0)?(e=qs(e))&&("string"==typeof t||null!=t&&!Is(t))&&!(t=ji(t))&&En(e)?Ki(Rn(e),0,n):e.split(t,n):[]},hr.spread=function(e,t){if("function"!=typeof e)throw new rt(u);return t=null==t?0:qn(Fs(t),0),_i(function(n){var r=n[t],i=Ki(n,0,t);return r&&en(i,r),Ht(e,this,i)})},hr.tail=function(e){var t=null==e?0:e.length;return t?Ai(e,1,t):[]},hr.take=function(e,t,n){return e&&e.length?Ai(e,0,(t=n||t===o?1:Fs(t))<0?0:t):[]},hr.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Ai(e,(t=r-(t=n||t===o?1:Fs(t)))<0?0:t,r):[]},hr.takeRightWhile=function(e,t){return e&&e.length?Bi(e,jo(t,3),!1,!0):[]},hr.takeWhile=function(e,t){return e&&e.length?Bi(e,jo(t,3)):[]},hr.tap=function(e,t){return t(e),e},hr.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new rt(u);return Cs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),rs(e,t,{leading:r,maxWait:t,trailing:i})},hr.thru=Ba,hr.toArray=Ls,hr.toPairs=lu,hr.toPairsIn=fu,hr.toPath=function(e){return vs(e)?Qt(e,ca):Ds(e)?[e]:to(ua(qs(e)))},hr.toPlainObject=Vs,hr.transform=function(e,t,n){var r=vs(e),i=r||ws(e)||js(e);if(t=jo(t,4),null==n){var o=e&&e.constructor;
vendor: 8,429 bytes, line 1
1n=i?r?new o:[]:Cs(e)&&ks(o)?dr(Ot(e)):{}}return(i?Kt:Gr)(e,function(e,r,i){return t(n,e,r,i)}),n},hr.unary=function(e){return Qa(e,1)},hr.union=Na,hr.unionBy=Oa,hr.unionWith=Aa,hr.uniq=function(e){return e&&e.length?Pi(e):[]},hr.uniqBy=function(e,t){return e&&e.length?Pi(e,jo(t,2)):[]},hr.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?Pi(e,o,t):[]},hr.unset=function(e,t){return null==e||zi(e,t)},hr.unzip=Ta,hr.unzipWith=Ia,hr.update=function(e,t,n){return null==e?e:Li(e,t,qi(n))},hr.updateWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:Li(e,t,qi(n),r)},hr.values=hu,hr.valuesIn=function(e){return null==e?[]:yn(e,iu(e))},hr.without=Ra,hr.words=ku,hr.wrap=function(e,t){return cs(qi(t),e)},hr.xor=Ma,hr.xorBy=Da,hr.xorWith=ja,hr.zip=Pa,hr.zipObject=function(e,t){return Wi(e||[],t||[],Nr)},hr.zipObjectDeep=function(e,t){return Wi(e||[],t||[],Ei)},hr.zipWith=za,hr.entries=lu,hr.entriesIn=fu,hr.extend=Gs,hr.extendWith=Ks,Mu(hr,hr),hr.add=Vu,hr.attempt=Su,hr.camelCase=du,hr.capitalize=pu,hr.ceil=qu,hr.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=Ws(n))===n?n:0),t!==o&&(t=(t=Ws(t))===t?t:0),Mr(Ws(e),t,n)},hr.clone=function(e){return Dr(e,p)},hr.cloneDeep=function(e){return Dr(e,h|p)},hr.cloneDeepWith=function(e,t){return Dr(e,h|p,t="function"==typeof t?t:o)},hr.cloneWith=function(e,t){return Dr(e,p,t="function"==typeof t?t:o)},hr.conformsTo=function(e,t){return null==t||jr(e,t,ru(t))},hr.deburr=mu,hr.defaultTo=function(e,t){return null==e||e!==e?t:e},hr.divide=Hu,hr.endsWith=function(e,t,n){e=qs(e),t=ji(t);var r=e.length,i=n=n===o?r:Mr(Fs(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},hr.eq=hs,hr.escape=function(e){return(e=qs(e))&&Ee.test(e)?e.replace(ke,kn):e},hr.escapeRegExp=function(e){return(e=qs(e))&&Me.test(e)?e.replace(Re,"\\$&"):e},hr.every=function(e,t,n){var r=vs(e)?Xt:Fr;return n&&Go(e,t,n)&&(t=o),r(e,jo(t,3))},hr.find=Wa,hr.findIndex=ma,hr.findKey=function(e,t){return an(e,jo(t,3),Gr)},hr.findLast=Va,hr.findLastIndex=va,hr.findLastKey=function(e,t){return an(e,jo(t,3),Kr)},hr.floor=Gu,hr.forEach=qa,hr.forEachRight=Ha,hr.forIn=function(e,t){return null==e?e:qr(e,jo(t,3),iu)},hr.forInRight=function(e,t){return null==e?e:Hr(e,jo(t,3),iu)},hr.forOwn=function(e,t){return e&&Gr(e,jo(t,3))},hr.forOwnRight=function(e,t){return e&&Kr(e,jo(t,3))},hr.get=Zs,hr.gt=ds,hr.gte=ps,hr.has=function(e,t){return null!=e&&Wo(e,t,Qr)},hr.hasIn=Qs,hr.head=ya,hr.identity=Au,hr.includes=function(e,t,n,r){e=ys(e)?e:hu(e),n=n&&!r?Fs(n):0;var i=e.length;return n<0&&(n=qn(i+n,0)),Ms(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&un(e,t,n)>-1},hr.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Fs(n);return i<0&&(i=qn(r+i,0)),un(e,t,i)},hr.inRange=function(e,t,n){return t=Bs(t),n===o?(n=t,t=0):n=Bs(n),function(e,t,n){return e>=Hn(t,n)&&e<qn(t,n)}(e=Ws(e),t,n)},hr.invoke=nu,hr.isArguments=ms,hr.isArray=vs,hr.isArrayBuffer=gs,hr.isArrayLike=ys,hr.isArrayLikeObject=bs,hr.isBoolean=function(e){return!0===e||!1===e||Ns(e)&&Jr(e)==q},hr.isBuffer=ws,hr.isDate=xs,hr.isElement=function(e){return Ns(e)&&1===e.nodeType&&!Ts(e)},hr.isEmpty=function(e){if(null==e)return!0;if(ys(e)&&(vs(e)||"string"==typeof e||"function"==typeof e.splice||ws(e)||js(e)||ms(e)))return!e.length;var t=Uo(e);if(t==Y||t==ne)return!e.size;if(Yo(e))return!ui(e).length;for(var n in e)if(ct.call(e,n))return!1;return!0},hr.isEqual=function(e,t){return ii(e,t)},hr.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:o)?n(e,t):o;return r===o?ii(e,t,o,n):!!r},hr.isError=_s,hr.isFinite=function(e){return"number"==typeof e&&Un(e)},hr.isFunction=ks,hr.isInteger=Ss,hr.isLength=Es,hr.isMap=Os,hr.isMatch=function(e,t){return e===t||oi(e,t,zo(t))},hr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:o,oi(e,t,zo(t),n)},hr.isNaN=function(e){return As(e)&&e!=+e},hr.isNative=function(e){if(Xo(e))throw new i(s);return ai(e)},hr.isNil=function(e){return null==e},hr.isNull=function(e){return null===e},hr.isNumber=As,hr.isObject=Cs,hr.isObjectLike=Ns,hr.isPlainObject=Ts,hr.isRegExp=Is,hr.isSafeInteger=function(e){return Ss(e)&&e>=-D&&e<=D},hr.isSet=Rs,hr.isString=Ms,hr.isSymbol=Ds,hr.isTypedArray=js,hr.isUndefined=function(e){return e===o},hr.isWeakMap=function(e){return Ns(e)&&Uo(e)==ae},hr.isWeakSet=function(e){return Ns(e)&&Jr(e)==se},hr.join=function(e,t){return null==e?"":Wn.call(e,t)},hr.kebabCase=vu,hr.last=_a,hr.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=Fs(n))<0?qn(r+i,0):Hn(i,r-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):sn(e,ln,i,!0)},hr.lowerCase=gu,hr.lowerFirst=yu,hr.lt=Ps,hr.lte=zs,hr.max=function(e){return e&&e.length?Ur(e,Au,Zr):o},hr.maxBy=function(e,t){return e&&e.length?Ur(e,jo(t,2),Zr):o},hr.mean=function(e){return fn(e,Au)},hr.meanBy=function(e,t){return fn(e,jo(t,2))},hr.min=function(e){return e&&e.length?Ur(e,Au,li):o},hr.minBy=function(e,t){return e&&e.length?Ur(e,jo(t,2),li):o},hr.stubArray=Uu,hr.stubFalse=Wu,hr.stubObject=function(){return{}},hr.stubString=function(){return""},hr.stubTrue=function(){return!0},hr.multiply=Ku,hr.nth=function(e,t){return e&&e.length?mi(e,Fs(t)):o},hr.noConflict=function(){return Mt._===this&&(Mt._=pt),this},hr.noop=Du,hr.now=Za,hr.pad=function(e,t,n){e=qs(e);var r=(t=Fs(t))?In(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return go(Ln(i),n)+e+go(zn(i),n)},hr.padEnd=function(e,t,n){e=qs(e);var r=(t=Fs(t))?In(e):0;return t&&r<t?e+go(t-r,n):e},hr.padStart=function(e,t,n){e=qs(e);var r=(t=Fs(t))?In(e):0;return t&&r<t?go(t-r,n)+e:e},hr.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),Kn(qs(e).replace(je,""),t||0)},hr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&Go(e,t,n)&&(t=n=o),n===o&&("boolean"==typeof t?(n=t,t=o):"boolean"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=Bs(e),t===o?(t=e,e=0):t=Bs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=$n();return Hn(e+i*(t-e+At("1e-"+((i+"").length-1))),t)}return wi(e,t)},hr.reduce=function(e,t,n){var r=vs(e)?tn:pn,i=arguments.length<3;return r(e,jo(t,4),n,i,Lr)},hr.reduceRight=function(e,t,n){var r=vs(e)?nn:pn,i=arguments.length<3;return r(e,jo(t,4),n,i,Br)},hr.repeat=function(e,t,n){return t=(n?Go(e,t,n):t===o)?1:Fs(t),xi(qs(e),t)},hr.replace=function(){var e=arguments,t=qs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},hr.result=function(e,t,n){var r=-1,i=(t=Hi(t,e)).length;for(i||(i=1,e=o);++r<i;){var a=null==e?o:e[ca(t[r])];a===o&&(r=i,a=n),e=ks(a)?a.call(e):a}return e},hr.round=$u,hr.runInContext=e,hr.sample=function(e){return(vs(e)?kr:ki)(e)},hr.size=function(e){if(null==e)return 0;if(ys(e))return Ms(e)?In(e):e.length;var t=Uo(e);return t==Y||t==ne?e.size:ui(e).length},hr.snakeCase=bu,hr.some=function(e,t,n){var r=vs(e)?rn:Ti;return n&&Go(e,t,n)&&(t=o),r(e,jo(t,3))},hr.sortedIndex=function(e,t){return Ii(e,t)},hr.sortedIndexBy=function(e,t,n){return Ri(e,t,jo(n,2))},hr.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Ii(e,t);if(r<n&&hs(e[r],t))return r}return-1},hr.sortedLastIndex=function(e,t){return Ii(e,t,!0)},hr.sortedLastIndexBy=function(e,t,n){return Ri(e,t,jo(n,2),!0)},hr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Ii(e,t,!0)-1;if(hs(e[n],t))return n}return-1},hr.startCase=wu,hr.startsWith=function(e,t,n){return e=qs(e),n=null==n?0:Mr(Fs(n),0,e.length),t=ji(t),e.slice(n,n+t.length)==t},hr.subtract=Xu,hr.sum=function(e){return e&&e.length?mn(e,Au):0},hr.sumBy=function(e,t){return e&&e.length?mn(e,jo(t,2)):0},hr.template=function(e,t,n){var r=hr.templateSettings;n&&Go(e,t,n)&&(t=o),e=qs(e),t=Ks({},t,r,Eo);var i,a,s=Ks({},t.imports,r.imports,Eo),u=ru(s),c=yn(s,u),l=0,f=t.interpolate||Ye,h="__p += '",d=tt((t.escape||Ye).source+"|"+f.source+"|"+(f===Oe?We:Ye).source+"|"+(t.evaluate||Ye).source+"|$","g"),p="//# sourceURL="+("sourceURL"in t?t.sourceURL:"lodash.templateSources["+ ++Et+"]")+"\n";e.replace(d,function(t,n,r,o,s,u){return r||(r=o),h+=e.slice(l,u).replace(Je,Sn),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+t.length,t}),h+="';\n";var m=t.variable;m||(h="with (obj) {\n"+h+"\n}\n"),h=(a?h.replace(be,""):h).replace(we,"$1").replace(xe,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";
1\n")+h+"return __p\n}";var v=Su(function(){return Ze(u,p+"return "+h).apply(o,c)});if(v.source=h,_s(v))throw v;return v},hr.times=function(e,t){if((e=Fs(e))<1||e>D)return[];var n=z,r=Hn(e,z);t=jo(t),e-=z;for(var i=vn(r,t);++n<e;)t(n);return i},hr.toFinite=Bs,hr.toInteger=Fs,hr.toLength=Us,hr.toLower=function(e){return qs(e).toLowerCase()},hr.toNumber=Ws,hr.toSafeInteger=function(e){return e?Mr(Fs(e),-D,D):0===e?e:0},hr.toString=qs,hr.toUpper=function(e){return qs(e).toUpperCase()},hr.trim=function(e,t,n){if((e=qs(e))&&(n||t===o))return e.replace(De,"");if(!e||!(t=ji(t)))return e;var r=Rn(e),i=Rn(t);return Ki(r,wn(r,i),xn(r,i)+1).join("")},hr.trimEnd=function(e,t,n){if((e=qs(e))&&(n||t===o))return e.replace(Pe,"");if(!e||!(t=ji(t)))return e;var r=Rn(e);return Ki(r,0,xn(r,Rn(t))+1).join("")},hr.trimStart=function(e,t,n){if((e=qs(e))&&(n||t===o))return e.replace(je,"");if(!e||!(t=ji(t)))return e;var r=Rn(e);return Ki(r,wn(r,Rn(t))).join("")},hr.truncate=function(e,t){var n=N,r=O;if(Cs(t)){var i="separator"in t?t.separator:i;n="length"in t?Fs(t.length):n,r="omission"in t?ji(t.omission):r}var a=(e=qs(e)).length;if(En(e)){var s=Rn(e);a=s.length}if(n>=a)return e;var u=n-In(r);if(u<1)return r;var c=s?Ki(s,0,u).join(""):e.slice(0,u);if(i===o)return c+r;if(s&&(u+=c.length-u),Is(i)){if(e.slice(u).search(i)){var l,f=c;for(i.global||(i=tt(i.source,qs(Ve.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var h=l.index;c=c.slice(0,h===o?u:h)}}else if(e.indexOf(ji(i),u)!=u){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r},hr.unescape=function(e){return(e=qs(e))&&Se.test(e)?e.replace(_e,Mn):e},hr.uniqueId=function(e){var t=++lt;return qs(e)+t},hr.upperCase=xu,hr.upperFirst=_u,hr.each=qa,hr.eachRight=Ha,hr.first=ya,Mu(hr,function(){var e={};return Gr(hr,function(t,n){ct.call(hr.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),hr.VERSION="4.17.11",Kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){hr[e].placeholder=hr}),Kt(["drop","take"],function(e,t){vr.prototype[e]=function(n){n=n===o?1:qn(Fs(n),0);var r=this.__filtered__&&!t?new vr(this):this.clone();return r.__filtered__?r.__takeCount__=Hn(n,r.__takeCount__):r.__views__.push({size:Hn(n,z),type:e+(r.__dir__<0?"Right":"")}),r},vr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Kt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=n==I||3==n;vr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:jo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Kt(["head","last"],function(e,t){var n="take"+(t?"Right":"");vr.prototype[e]=function(){return this[n](1).value()[0]}}),Kt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");vr.prototype[e]=function(){return this.__filtered__?new vr(this):this[n](1)}}),vr.prototype.compact=function(){return this.filter(Au)},vr.prototype.find=function(e){return this.filter(e).head()},vr.prototype.findLast=function(e){return this.reverse().find(e)},vr.prototype.invokeMap=_i(function(e,t){return"function"==typeof e?new vr(this):this.map(function(n){return ni(n,e,t)})}),vr.prototype.reject=function(e){return this.filter(ss(jo(e)))},vr.prototype.slice=function(e,t){e=Fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new vr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=Fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},vr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},vr.prototype.toArray=function(){return this.take(z)},Gr(vr.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=hr[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);i&&(hr.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,u=t instanceof vr,c=s[0],l=u||vs(t),f=function(e){var t=i.apply(hr,en([e],s));return r&&h?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,m=u&&!d;if(!a&&l){t=m?t:new vr(this);var v=e.apply(t,s);return v.__actions__.push({func:Ba,args:[f],thisArg:o}),new mr(v,h)}return p&&m?e.apply(this,s):(v=this.thru(f),p?r?v.value()[0]:v.value():v)})}),Kt(["pop","push","shift","sort","splice","unshift"],function(e){var t=it[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);hr.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(vs(i)?i:[],e)}return this[n](function(n){return t.apply(vs(n)?n:[],e)})}}),Gr(vr.prototype,function(e,t){var n=hr[t];if(n){var r=n.name+"";(rr[r]||(rr[r]=[])).push({name:t,func:n})}}),rr[ho(o,y).name]=[{name:"wrapper",func:o}],vr.prototype.clone=function(){var e=new vr(this.__wrapped__);return e.__actions__=to(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=to(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=to(this.__views__),e},vr.prototype.reverse=function(){if(this.__filtered__){var e=new vr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},vr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=vs(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=Hn(t,e+a);break;case"takeRight":e=qn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,c=r?s:a-1,l=this.__iteratees__,f=l.length,h=0,d=Hn(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return Fi(e,this.__actions__);var p=[];e:for(;u--&&h<d;){for(var m=-1,v=e[c+=t];++m<f;){var g=l[m],y=g.iteratee,b=g.type,w=y(v);if(b==R)v=w;else if(!w){if(b==I)continue e;break e}}p[h++]=v}return p},hr.prototype.at=Fa,hr.prototype.chain=function(){return La(this)},hr.prototype.commit=function(){return new mr(this.value(),this.__chain__)},hr.prototype.next=function(){this.__values__===o&&(this.__values__=Ls(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},hr.prototype.plant=function(e){for(var t,n=this;n instanceof pr;){var r=fa(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},hr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof vr){var t=e;return this.__actions__.length&&(t=new vr(this)),(t=t.reverse()).__actions__.push({func:Ba,args:[Ca],thisArg:o}),new mr(t,this.__chain__)}return this.thru(Ca)},hr.prototype.toJSON=hr.prototype.valueOf=hr.prototype.value=function(){return Fi(this.__wrapped__,this.__actions__)},hr.prototype.first=hr.prototype.head,zt&&(hr.prototype[zt]=function(){return this}),hr}();Mt._=Dn,(i=function(){return Dn}.call(t,n,t,r))===o||(r.exports=i)}).call(this)}).call(this,n(17),n(78)(e))},function(e,t,n){var r=n(141);e.exports=d,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t))},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=h;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",l=t&&t.delimiter||"/";null!=(n=i.exec(e));){var f=n[0],h=n[1],d=n.index;if(s+=e.slice(a,d),a=d+f.length,h)s+=h[1];else{var p=e[a],m=n[2],v=n[3],g=n[4],y=n[5],b=n[6],w=n[7];s&&(r.push(s),s="");var x=null!=m&&null!=p&&p!==m,_="+"===b||"*"===b,k="?"===b||"*"===b,S=n[2]||l,E=g||y;
1r.push({name:v||o++,prefix:m||"",delimiter:S,optional:k,repeat:_,partial:x,asterisk:!!w,pattern:E?c(E):w?".*":"[^"+u(S)+"]+?"})}}return a<e.length&&(s+=e.substr(a)),s&&r.push(s),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function s(e){for(var t=new Array(e.length),n=0;n<e.length;n++)"object"===typeof e[n]&&(t[n]=new RegExp("^(?:"+e[n].pattern+")$"));return function(n,i){for(var o="",s=n||{},u=(i||{}).pretty?a:encodeURIComponent,c=0;c<e.length;c++){var l=e[c];if("string"!==typeof l){var f,h=s[l.name];if(null==h){if(l.optional){l.partial&&(o+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(r(h)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var d=0;d<h.length;d++){if(f=u(h[d]),!t[c].test(f))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(f)+"`");o+=(0===d?l.prefix:l.delimiter)+f}}else{if(f=l.asterisk?encodeURI(h).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}):u(h),!t[c].test(f))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+f+'"');o+=l.prefix+f}}else o+=l}return o}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function l(e,t){return e.keys=t,e}function f(e){return e.sensitive?"":"i"}function h(e,t,n){r(t)||(n=t||n,t=[]);for(var i=(n=n||{}).strict,o=!1!==n.end,a="",s=0;s<e.length;s++){var c=e[s];if("string"===typeof c)a+=u(c);else{var h=u(c.prefix),d="(?:"+c.pattern+")";t.push(c),c.repeat&&(d+="(?:"+h+d+")*"),a+=d=c.optional?c.partial?h+"("+d+")?":"(?:"+h+"("+d+"))?":h+"("+d+")"}}var p=u(n.delimiter||"/"),m=a.slice(-p.length)===p;return i||(a=(m?a.slice(0,-p.length):a)+"(?:"+p+"(?=$))?"),a+=o?"$":i&&m?"":"(?="+p+"|$)",l(new RegExp("^"+a,f(n)),t)}function d(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return l(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],i=0;i<e.length;i++)r.push(d(e[i],t,n).source);return l(new RegExp("(?:"+r.join("|")+")",f(n)),t)}(e,t,n):function(e,t,n){return h(o(e,n),t,n)}(e,t,n)}},function(e,t,n){"use strict";(function(e){for(var n="undefined"!==typeof window&&"undefined"!==typeof document,r=["Edge","Trident","Firefox"],i=0,o=0;o<r.length;o+=1)if(n&&navigator.userAgent.indexOf(r[o])>=0){i=1;break}var a=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},i))}};function s(e){return e&&"[object Function]"==={}.toString.call(e)}function u(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function c(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function l(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=u(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:l(c(e))}var f=n&&!(!window.MSInputMethodContext||!document.documentMode),h=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?f:10===e?h:f||h}function p(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===u(n,"position")?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function m(e){return null!==e.parentNode?m(e.parentNode):e}function v(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a=o.commonAncestorContainer;if(e!==a&&t!==a||r.contains(i))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||p(e.firstElementChild)===e)}(a)?a:p(a);var s=m(e);return s.host?v(s.host,t):v(e,m(t).host)}function g(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[t]}return e[t]}function y(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function b(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function w(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:b("Height",t,n,r),width:b("Width",t,n,r)}}var x=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},_=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}
vendor: 14,265 bytes, line 1
1(),k=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function E(e){return S({},e,{right:e.left+e.width,bottom:e.top+e.height})}function C(e){var t={};try{if(d(10)){t=e.getBoundingClientRect();var n=g(e,"top"),r=g(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(h){}var i={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?w(e.ownerDocument):{},a=o.width||e.clientWidth||i.right-i.left,s=o.height||e.clientHeight||i.bottom-i.top,c=e.offsetWidth-a,l=e.offsetHeight-s;if(c||l){var f=u(e);c-=y(f,"x"),l-=y(f,"y"),i.width-=c,i.height-=l}return E(i)}function N(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,o=C(e),a=C(t),s=l(e),c=u(t),f=parseFloat(c.borderTopWidth,10),h=parseFloat(c.borderLeftWidth,10);n&&i&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var p=E({top:o.top-a.top-f,left:o.left-a.left-h,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var m=parseFloat(c.marginTop,10),v=parseFloat(c.marginLeft,10);p.top-=f-m,p.bottom-=f-m,p.left-=h-v,p.right-=h-v,p.marginTop=m,p.marginLeft=v}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=g(t,"top"),i=g(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}(p,t)),p}function O(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===u(t,"transform");)t=t.parentElement;return t||document.documentElement}function A(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?O(e):v(e,t);if("viewport"===r)o=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=N(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:g(n),s=t?0:g(n,"left");return E({top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o})}(a,i);else{var s=void 0;"scrollParent"===r?"BODY"===(s=l(c(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var f=N(s,a,i);if("HTML"!==s.nodeName||function e(t){var n=t.nodeName;if("BODY"===n||"HTML"===n)return!1;if("fixed"===u(t,"position"))return!0;var r=c(t);return!!r&&e(r)}(a))o=f;else{var h=w(e.ownerDocument),d=h.height,p=h.width;o.top+=f.top-f.marginTop,o.bottom=d+f.top,o.left+=f.left-f.marginLeft,o.right=p+f.left}}var m="number"===typeof(n=n||0);return o.left+=m?n:n.left||0,o.top+=m?n:n.top||0,o.right-=m?n:n.right||0,o.bottom-=m?n:n.bottom||0,o}function T(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=A(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},u=Object.keys(s).map(function(e){return S({key:e},s[e],{area:(t=s[e],t.width*t.height)});var t}).sort(function(e,t){return t.area-e.area}),c=u.filter(function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight}),l=c.length>0?c[0].key:u[0].key,f=e.split("-")[1];return l+(f?"-"+f:"")}function I(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return N(n,r?O(t):v(t,n),r)}function R(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function M(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function D(e,t,n){n=n.split("-")[0];var r=R(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",u=o?"height":"width",c=o?"width":"height";return i[a]=t[a]+t[u]/2-r[u]/2,i[s]=n===s?t[s]-r[c]:t[M(s)],i}function j(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function P(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var r=j(e,function(e){return e[t]===n});return e.indexOf(r)}(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&s(n)&&(t.offsets.popper=E(t.offsets.popper),t.offsets.reference=E(t.offsets.reference),t=n(t,e))}),t}function z(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function L(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var i=t[r],o=i?""+i+n:e;if("undefined"!==typeof document.body.style[o])return o}return null}function B(e){var t=e.ownerDocument;return t?t.defaultView:window}function F(e,t,n,r){n.updateBound=r,B(e).addEventListener("resize",n.updateBound,{passive:!0});var i=l(e);return function e(t,n,r,i){var o="BODY"===t.nodeName,a=o?t.ownerDocument.defaultView:t;a.addEventListener(n,r,{passive:!0}),o||e(l(a.parentNode),n,r,i),i.push(a)}(i,"scroll",n.updateBound,n.scrollParents),n.scrollElement=i,n.eventsEnabled=!0,n}function U(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,B(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function W(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function V(e,t){Object.keys(t).forEach(function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&W(t[n])&&(r="px"),e.style[n]=t[n]+r})}var q=n&&/Firefox/i.test(navigator.userAgent);function H(e,t,n){var r=j(e,function(e){return e.name===t}),i=!!r&&e.some(function(e){return e.name===n&&e.enabled&&e.order<r.order});if(!i){var o="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return i}var G=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],K=G.slice(3);function $(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=K.indexOf(e),r=K.slice(n+1).concat(K.slice(0,n));return t?r.reverse():r}var X={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Y(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=a.indexOf(j(a,function(e){return-1!==e.search(/,|\s/)}));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,c=-1!==s?[a.slice(0,s).concat([a[s].split(u)[0]]),[a[s].split(u)[1]].concat(a.slice(s+1))]:[a];return(c=c.map(function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)},[]).map(function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return E(s)[t]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,i,t,n)})})).forEach(function(e,t){e.forEach(function(n,r){W(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))})}),i}var J={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),u=s?"left":"top",c=s?"width":"height",l={start:k({},u,o[u]),end:k({},u,o[u]+o[c]-a[c])};e.offsets.popper=S({},a,l[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],u=void 0;return u=W(+n)?[+n,0]:Y(n,o,a,s),"left"===s?(o.top+=u[0],o.left-=u[1]):"right"===s?(o.top+=u[0],o.left+=u[1]):"top"===s?(o.left+=u[0],o.top-=u[1]):"bottom"===s&&(o.left+=u[0],o.top+=u[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||p(e.instance.popper);e.instance.reference===n&&(n=p(n));var r=L("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var u=A(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=u;var c=t.priority,l=e.offsets.popper,f={primary:function(e){var n=l[e];return l[e]<u[e]&&!t.escapeWithReference&&(n=Math.max(l[e],u[e])),k({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=l[n];return l[e]>u[e]&&!t.escapeWithReference&&(r=Math.min(l[n],u[e]-("right"===e?l.width:l.height))),k({},n,r)}};return c.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";l=S({},l,f[t](e))}),e.offsets.popper=l,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",u=a?"left":"top",c=a?"width":"height";return n[s]<o(r[u])&&(e.offsets.popper[u]=o(r[u])-n[c]),n[u]>o(r[s])&&(e.offsets.popper[u]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!H(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,a=o.popper,s=o.reference,c=-1!==["left","right"].indexOf(i),l=c?"height":"width",f=c?"Top":"Left",h=f.toLowerCase(),d=c?"left":"top",p=c?"bottom":"right",m=R(r)[l];s[p]-m<a[h]&&(e.offsets.popper[h]-=a[h]-(s[p]-m)),s[h]+m>a[p]&&(e.offsets.popper[h]+=s[h]+m-a[p]),e.offsets.popper=E(e.offsets.popper);var v=s[h]+s[l]/2-m/2,g=u(e.instance.popper),y=parseFloat(g["margin"+f],10),b=parseFloat(g["border"+f+"Width"],10),w=v-e.offsets.popper[h]-y-b;return w=Math.max(Math.min(a[l]-m,w),0),e.arrowElement=r,e.offsets.arrow=(k(n={},h,Math.round(w)),k(n,d,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(z(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=A(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=M(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case X.FLIP:a=[r,i];break;case X.CLOCKWISE:a=$(r);break;case X.COUNTERCLOCKWISE:a=$(r,!0);break;default:a=t.behavior}return a.forEach(function(s,u){if(r!==s||a.length===u+1)return e;r=e.placement.split("-")[0],i=M(r);var c=e.offsets.popper,l=e.offsets.reference,f=Math.floor,h="left"===r&&f(c.right)>f(l.left)||"right"===r&&f(c.left)<f(l.right)||"top"===r&&f(c.bottom)>f(l.top)||"bottom"===r&&f(c.top)<f(l.bottom),d=f(c.left)<f(n.left),p=f(c.right)>f(n.right),m=f(c.top)<f(n.top),v=f(c.bottom)>f(n.bottom),g="left"===r&&d||"right"===r&&p||"top"===r&&m||"bottom"===r&&v,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===o&&d||y&&"end"===o&&p||!y&&"start"===o&&m||!y&&"end"===o&&v),w=!!t.flipVariationsByContent&&(y&&"start"===o&&p||y&&"end"===o&&d||!y&&"start"===o&&v||!y&&"end"===o&&m),x=b||w;(h||g||x)&&(e.flipped=!0,(h||g)&&(r=a[u+1]),x&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=S({},e.offsets.popper,D(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,"flip"))}),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=M(t),e.offsets.popper=E(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!H(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=j(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,i=e.offsets.popper,o=j(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==o?o:t.gpuAcceleration,s=p(e.instance.popper),u=C(s),c={position:i.position},l=function(e,t){var n=e.offsets,r=n.popper,i=n.reference,o=Math.round,a=Math.floor,s=function(e){return e},u=o(i.width),c=o(r.width),l=-1!==["left","right"].indexOf(e.placement),f=-1!==e.placement.indexOf("-"),h=t?l||f||u%2===c%2?o:a:s,d=t?o:s;return{left:h(u%2===1&&c%2===1&&!f&&t?r.left-1:r.left),top:d(r.top),bottom:d(r.bottom),right:h(r.right)}}(e,window.devicePixelRatio<2||!q),f="bottom"===n?"top":"bottom",h="right"===r?"left":"right",d=L("transform"),m=void 0,v=void 0;if(v="bottom"===f?"HTML"===s.nodeName?-s.clientHeight+l.bottom:-u.height+l.bottom:l.top,m="right"===h?"HTML"===s.nodeName?-s.clientWidth+l.right:-u.width+l.right:l.left,a&&d)c[d]="translate3d("+m+"px, "+v+"px, 0)",c[f]=0,c[h
1]=0,c.willChange="transform";else{var g="bottom"===f?-1:1,y="right"===h?-1:1;c[f]=v*g,c[h]=m*y,c.willChange=f+", "+h}var b={"x-placement":e.placement};return e.attributes=S({},b,e.attributes),e.styles=S({},c,e.styles),e.arrowStyles=S({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return V(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach(function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)}),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,i){var o=I(i,t,e,n.positionFixed),a=T(n.placement,o,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),V(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},Z=function(){function e(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};x(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=a(this.update.bind(this)),this.options=S({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(S({},e.Defaults.modifiers,i.modifiers)).forEach(function(t){r.options.modifiers[t]=S({},e.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return S({name:e},r.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&s(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return _(e,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=I(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=T(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=D(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,z(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[L("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return U.call(this)}}]),e}();Z.Utils=("undefined"!==typeof window?window:e).PopperUtils,Z.placements=G,Z.Defaults=J,t.a=Z}).call(this,n(17))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;
1if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u<arguments.length;u++){for(var c in n=Object(arguments[u]))i.call(n,c)&&(s[c]=n[c]);if(r){a=r(n);for(var l=0;l<a.length;l++)o.call(n,a[l])&&(s[a[l]]=n[a[l]])}}return s}},function(e,t,n){"use strict";e.exports=n(142)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(function(e){var r="undefined"!==typeof e&&e||"undefined"!==typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(146),t.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(17))},function(e,t,n){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=n(39),t.createHash=t.Hash=n(42),t.createHmac=t.Hmac=n(89);var r=n(161),i=Object.keys(r),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var a=n(92);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=n(163);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var u=n(180);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var c=n(185);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=n(222);var l=n(223);t.publicEncrypt=l.publicEncrypt,t.privateEncrypt=l.privateEncrypt,t.publicDecrypt=l.publicDecrypt,t.privateDecrypt=l.privateDecrypt;var f=n(226);t.randomFill=f.randomFill,t.randomFillSync=f.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(e,t,n){"use strict";var r=n(7).Buffer,i=n(59).Transform;function o(e){i.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}n(5)(o,i),o.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(i){r=i}n(r)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(n){t=n}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!r.isBuffer(e)&&"string"!==typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=r.from(e,t));for(var n=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)n[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)n[this._blockOffset++]=e[i++];for(var a=0,s=8*e.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,n){"use strict";(function(t,r){var i=n(50);e.exports=b;var o,a=n(79);b.ReadableState=y;n(60).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(84),c=n(7).Buffer,l=t.Uint8Array||function(){};var f=n(43);f.inherits=n(5);var h=n(147),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,m=n(148),v=n(85);f.inherits(b,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};
vendor: 5,658 bytes, line 1
1var r=t instanceof(o=o||n(37));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(63).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function b(e){if(o=o||n(37),!(this instanceof b))return new b(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,n,r,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,a)):(i||(o=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"===typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):C(e,a)):x(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function x(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),C(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"===typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=c.from(e,t),t=""),n=!0),w(this,e,t,!1,n)},b.prototype.unshift=function(e){return w(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return p||(p=n(63).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};var _=8388608;function k(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(E,e):E(e))}function E(e){d("emit readable"),e.emit("readable"),T(e)}function C(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(N,e,t))}function N(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function O(e){d("readable nexttick read 0"),e.read(0)}function A(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),T(e),t.flowing&&!t.reading&&e.read(0)}function T(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function I(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function R(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function D(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}b.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):S(this),null;if(0===(e=k(e,t))&&t.ended)return 0===t.length&&R(this),null;var r,i=t.needReadable;
vendor: 2,070 bytes, line 1
1return d("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",i=!0),t.ended||t.reading?d("reading or ended",i=!1):i&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=k(n,t))),null===(r=e>0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&R(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:b;function c(t,r){d("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",m),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){d("onend"),e.end()}o.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",c);var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,T(e))}}(n);e.on("drain",f);var h=!1;var p=!1;function m(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==D(o.pipes,e))&&!h&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function v(t){d("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){d("onfinish"),e.removeListener("close",g),b()}function b(){d("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"===typeof e.prependListener)return e.prepe
vendor: 6,000 bytes, line 1
1ndListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",n),o.flowing||(d("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var a=D(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},b.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&S(this):i.nextTick(O,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(A,e,t))}(this,e)),this},b.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(d("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){(d("wrapped data"),n.decoder&&(i=n.decoder.write(i)),!n.objectMode||null!==i&&void 0!==i)&&((n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause())))}),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<g.length;o++)e.on(g[o],this.emit.bind(this,g[o]));return this._read=function(t){d("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=I}).call(this,n(17),n(31))},function(e,t,n){e.exports=n(60).EventEmitter},function(e,t,n){"use strict";var r=n(50);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";e.exports=a;var r=n(37),i=n(43);function o(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"===typeof e.transform&&(this._transform=e.transform),"function"===typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"===typeof this._flush?this._flush(function(t,n){u(e,t,n)}):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=n(5),i.inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){var r=n(5),i=n(40),o=n(7).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
vendor: 3,062 bytes, line 1
1734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)n[g]=e.readInt32BE(4*g);for(;g<64;++g)n[g]=0|(((t=n[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[g-7]+d(n[g-15])+n[g-16];for(var y=0;y<64;++y){var b=v+h(u)+c(u,p,m)+a[y]+n[y]|0,w=f(r)+l(r,i,o)|0;v=m,m=p,p=u,u=s+b|0,s=o,o=i,i=r,r=b+w|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,n){var r=n(5),i=n(40),o=n(7).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
vendor: 4,772 bytes, line 1
11126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}r(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,y=0|this._gh,b=0|this._hh,w=0|this._al,x=0|this._bl,_=0|this._cl,k=0|this._dl,S=0|this._el,E=0|this._fl,C=0|this._gl,N=0|this._hl,O=0;O<32;O+=2)t[O]=e.readInt32BE(4*O),t[O+1]=e.readInt32BE(4*O+4);for(;O<160;O+=2){var A=t[O-30],T=t[O-30+1],I=d(A,T),R=p(T,A),M=m(A=t[O-4],T=t[O-4+1]),D=v(T,A),j=t[O-14],P=t[O-14+1],z=t[O-32],L=t[O-32+1],B=R+P|0,F=I+j+g(B,R)|0;F=(F=F+M+g(B=B+D|0,D)|0)+z+g(B=B+L|0,L)|0,t[O]=F,t[O+1]=B}for(var U=0;U<160;U+=2){F=t[U],B=t[U+1];var W=l(n,r,i),V=l(w,x,_),q=f(n,w),H=f(w,n),G=h(s,S),K=h(S,s),$=a[U],X=a[U+1],Y=c(s,u,y),J=c(S,E,C),Z=N+K|0,Q=b+G+g(Z,N)|0;Q=(Q=(Q=Q+Y+g(Z=Z+J|0,J)|0)+$+g(Z=Z+X|0,X)|0)+F+g(Z=Z+B|0,B)|0;var ee=H+V|0,te=q+W+g(ee,H)|0;b=y,N=C,y=u,C=E,u=s,E=S,s=o+Q+g(S=k+Z|0,k)|0,o=i,k=_,i=r,_=x,r=n,x=w,n=Q+te+g(w=Z+ee|0,Z)|0}this._al=this._al+w|0,this._bl=this._bl+x|0,this._cl=this._cl+_|0,this._dl=this._dl+k|0,this._el=this._el+S|0,this._fl=this._fl+E|0,this._gl=this._gl+C|0,this._hl=this._hl+N|0,this._ah=this._ah+n+g(this._al,w)|0,this._bh=this._bh+r+g(this._bl,x)|0,this._ch=this._ch+i+g(this._cl,_)|0,this._dh=this._dh+o+g(this._dl,k)|0,this._eh=this._eh+s+g(this._el,S)|0,this._fh=this._fh+u+g(this._fl,E)|0,this._gh=this._gh+y+g(this._gl,C)|0,this._hh=this._hh+b+g(this._hl,N)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,n){"use strict";var r=n(5),i=n(160),o=n(34),a=n(7).Buffer,s=n(90),u=n(64),c=n(65),l=a.alloc(128);function f(e,t){o.call(this,"digest"),"string"===typeof t&&(t=a.from(t));var n="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>n)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length<n&&(t=a.concat([t,l],n));for(var r=this._ipad=a.allocUnsafe(n),i=this._opad=a.allocUnsafe(n),s=0;s<n;s++)r[s]=54^t[s],i[s]=92^t[s];this._hash="rmd160"===e?new u:c(e),this._hash.update(r)}r(f,o),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new f("rmd160",t):"md5"===e?new i(s,t):new f(e,t)}},function(e,t,n){var r=n(58);e.exports=function(e){return(new r).update(e).digest()}},function(e){e.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""}
1,DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},function(e,t,n){t.pbkdf2=n(162),t.pbkdf2Sync=n(95)},function(e,t,n){(function(t){var n=Math.pow(2,30)-1;function r(e,n){if("string"!==typeof e&&!t.isBuffer(e))throw new TypeError(n+" must be a buffer or string")}e.exports=function(e,t,i,o){if(r(e,"Password"),r(t,"Salt"),"number"!==typeof i)throw new TypeError("Iterations not a number");if(i<0)throw new TypeError("Bad iterations");
vendor: 9,961 bytes, line 1
1if("number"!==typeof o)throw new TypeError("Key length not a number");if(o<0||o>n||o!==o)throw new TypeError("Bad key length")}}).call(this,n(15).Buffer)},function(e,t,n){(function(t){var n;t.browser?n="utf-8":n=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=n}).call(this,n(31))},function(e,t,n){var r=n(90),i=n(64),o=n(65),a=n(93),s=n(94),u=n(7).Buffer,c=u.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,n){var a=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?r:function(t){return o(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=a(t):t.length<s&&(t=u.concat([t,c],s));for(var f=u.allocUnsafe(s+l[e]),h=u.allocUnsafe(s+l[e]),d=0;d<s;d++)f[d]=54^t[d],h[d]=92^t[d];var p=u.allocUnsafe(s+n+4);f.copy(p,0,0,s),this.ipad1=p,this.ipad2=f,this.opad=h,this.alg=e,this.blocksize=s,this.hash=a,this.size=l[e]}f.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,n,r,i){a(e,t,n,r),u.isBuffer(e)||(e=u.from(e,s)),u.isBuffer(t)||(t=u.from(t,s));var o=new f(i=i||"sha1",e,t.length),c=u.allocUnsafe(r),h=u.allocUnsafe(t.length+4);t.copy(h,0,0,t.length);for(var d=0,p=l[i],m=Math.ceil(r/p),v=1;v<=m;v++){h.writeUInt32BE(v,t.length);for(var g=o.run(h,o.ipad1),y=g,b=1;b<n;b++){y=o.run(y,o.ipad2);for(var w=0;w<p;w++)g[w]^=y[w]}g.copy(c,d),d+=p}return c}},function(e,t,n){var r=n(44),i=n(7).Buffer,o=n(97);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var n=Math.ceil(t.length/16),o=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*n)]);for(var s=0;s<n;s++){var u=a(e),c=o+16*s;e._cache.writeUInt32BE(u[0],c+0),e._cache.writeUInt32BE(u[1],c+4),e._cache.writeUInt32BE(u[2],c+8),e._cache.writeUInt32BE(u[3],c+12)}var l=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),r(t,l)}},function(e,t){e.exports=function(e){for(var t,n=e.length;n--;){if(255!==(t=e.readUInt8(n))){t++,e.writeUInt8(t,n);break}e.writeUInt8(0,n)}}},function(e){e.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},function(e,t,n){var r=n(51),i=n(7).Buffer,o=n(34),a=n(5),s=n(177),u=n(44),c=n(97);function l(e,t,n,a){o.call(this);var u=i.alloc(4,0);this._cipher=new r.AES(t);var l=this._cipher.encryptBlock(u);this._ghash=new s(l),n=function(e,t,n){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var r=new s(n),o=t.length,a=o%16;r.update(t),a&&(a=16-a,r.update(i.alloc(a,0))),r.update(i.alloc(8,0));var u=8*o,l=i.alloc(8);l.writeUIntBE(u,0,8),r.update(l),e._finID=r.state;var f=i.from(e._finID);return c(f),f}(this,n,l),this._prev=i.from(n),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(l,o),l.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var n=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(n),this._len+=e.length,n},l.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var n=0;e.length!==t.length&&n++;for(var r=Math.min(e.length,t.length),i=0;i<r;++i)n+=e[i]^t[i];return n}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},l.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},l.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},l.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=l},function(e,t,n){var r=n(51),i=n(7).Buffer,o=n(34);function a(e,t,n,a){o.call(this),this._cipher=new r.AES(t),this._prev=i.from(n),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._mode=e}n(5)(a,o),a.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},e.exports=a},function(e,t,n){var r=n(39);e.exports=y,y.simpleSieve=v,y.fermatTest=g;var i=n(13),o=new i(24),a=new(n(102)),s=new i(1),u=new i(2),c=new i(5),l=(new i(16),new i(8),new i(10)),f=new i(3),h=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function m(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,n=3;n<1048576;n+=2){for(var r=Math.ceil(Math.sqrt(n)),i=0;i<t&&e[i]<=r&&n%e[i]!==0;i++);t!==i&&e[i]<=r||(e[t++]=n)}return p=e,e}function v(e){for(var t=m(),n=0;n<t.length;n++)if(0===e.modn(t[n]))return 0===e.cmpn(t[n]);return!0}function g(e){var t=i.mont(e);return 0===u.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function y(e,t){if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);var n,p;for(t=new i(t);;){for(n=new i(r(Math.ceil(e/8)));n.bitLength()>e;)n.ishrn(1);if(n.isEven()&&n.iadd(s),n.testn(1)||n.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;n.mod(l).cmp(f);)n.iadd(d)}else for(;n.mod(o).cmp(h);)n.iadd(d);if(v(p=n.shrn(1))&&v(n)&&g(p)&&g(n)&&a.test(p)&&a.test(n))return n}}},function(e,t,n){var r=n(13),i=n(103);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),n=Math.ceil(t/8);do{var i=new r(this.rand.generate(n))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},o.prototype.test=function(e,t,n){var i=e.bitLength(),o=r.mont(e),a=new r(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var c=e.shrn(u),l=s.toRed(o);t>0;t--){var f=this._randrange(new r(2),s);n&&n(f);var h=f.toRed(o).redPow(c);if(0!==h.cmp(a)&&0!==h.cmp(l)){for(var d=1;d<u;d++){if(0===(h=h.redSqr()).cmp(a))return!1;if(0===h.cmp(l))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(e,t){var n=e.bitLength(),i=r.mont(e),o=new r(1).toRed(i);t||(t=Math.max(1,n/48|0));for(var a=e.subn(1),s=0;!a.testn(s);s++);for(var u=e.shrn(s),c=a.toRed(i);t>0;t--){var l=this._randrange(new r(2),a),f=e.gcd(l);if(0!==f.cmpn(1))return f;var h=l.toRed(i).redPow(u);if(0!==h.cmp(o)&&0!==h.cmp(c)){for(var d=1;d<s;d++){if(0===(h=h.redSqr()).cmp(o))return h.fromRed().subn(1).gcd(e);if(0===h.cmp(c))break}if(d===s)return(h=h.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},function(e,t,n){var r;function i(e){this.rand=e}if(e.exports=function(e){return r||(r=new i(null)),r.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"object"===typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"===typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=n(182);if("function"!==typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(a){}},function(e,t,n){"use strict";var r=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",n=0;n<e.length;n++)t+=i(e[n].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"!==typeof e){for(var r=0;r<e.length;r++)n[r]=0|e[r];return n}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),r=0;r<e.length;r+=2)n.push(parseInt(e[r]+e[r+1],16));else for(r=0;r<e.length;r++){var i=e.charCodeAt(r),o=i>
vendor: 4,268 bytes, line 1
1>8,a=255&i;o?n.push(o,a):n.push(a)}return n},r.zero2=i,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,n){"use strict";var r=n(25).rotr32;function i(e,t,n){return e&t^~e&n}function o(e,t,n){return e&t^e&n^t&n}function a(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?i(t,n,r):1===e||3===e?a(t,n,r):2===e?o(t,n,r):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},function(e,t,n){"use strict";var r=n(25),i=n(45),o=n(105),a=n(20),s=r.sum32,u=r.sum32_4,c=r.sum32_5,l=o.ch32,f=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,v=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}r.inherits(y,v),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=u(m(n[r-2]),n[r-7],p(n[r-15]),n[r-16]);var i=this.h[0],o=this.h[1],v=this.h[2],g=this.h[3],y=this.h[4],b=this.h[5],w=this.h[6],x=this.h[7];for(a(this.k.length===n.length),r=0;r<n.length;r++){var _=c(x,d(y),l(y,b,w),this.k[r],n[r]),k=s(h(i),f(i,o,v));x=w,w=b,b=y,y=s(g,_),g=v,v=o,o=i,i=s(_,k)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],v),this.h[3]=s(this.h[3],g),this.h[4]=s(this.h[4],y),this.h[5]=s(this.h[5],b),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],x)},y.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},function(e,t,n){"use strict";var r=n(25),i=n(45),o=n(20),a=r.rotr64_hi,s=r.rotr64_lo,u=r.shr64_hi,c=r.shr64_lo,l=r.sum64,f=r.sum64_hi,h=r.sum64_lo,d=r.sum64_4_hi,p=r.sum64_4_lo,m=r.sum64_5_hi,v=r.sum64_5_lo,g=i.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
vendor: 10,764 bytes, line 1
11126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(e,t,n,r,i){var o=e&n^~e&i;return o<0&&(o+=4294967296),o}function x(e,t,n,r,i,o){var a=t&r^~t&o;return a<0&&(a+=4294967296),a}function _(e,t,n,r,i){var o=e&n^e&i^n&i;return o<0&&(o+=4294967296),o}function k(e,t,n,r,i,o){var a=t&r^t&o^r&o;return a<0&&(a+=4294967296),a}function S(e,t){var n=a(e,t,28)^a(t,e,2)^a(t,e,7);return n<0&&(n+=4294967296),n}function E(e,t){var n=s(e,t,28)^s(t,e,2)^s(t,e,7);return n<0&&(n+=4294967296),n}function C(e,t){var n=a(e,t,14)^a(e,t,18)^a(t,e,9);return n<0&&(n+=4294967296),n}function N(e,t){var n=s(e,t,14)^s(e,t,18)^s(t,e,9);return n<0&&(n+=4294967296),n}function O(e,t){var n=a(e,t,1)^a(e,t,8)^u(e,t,7);return n<0&&(n+=4294967296),n}function A(e,t){var n=s(e,t,1)^s(e,t,8)^c(e,t,7);return n<0&&(n+=4294967296),n}function T(e,t){var n=a(e,t,19)^a(t,e,29)^u(e,t,6);return n<0&&(n+=4294967296),n}function I(e,t){var n=s(e,t,19)^s(t,e,29)^c(e,t,6);return n<0&&(n+=4294967296),n}r.inherits(b,g),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var i=T(n[r-4],n[r-3]),o=I(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],u=O(n[r-30],n[r-29]),c=A(n[r-30],n[r-29]),l=n[r-32],f=n[r-31];n[r]=d(i,o,a,s,u,c,l,f),n[r+1]=p(i,o,a,s,u,c,l,f)}},b.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],d=this.h[6],p=this.h[7],g=this.h[8],y=this.h[9],b=this.h[10],O=this.h[11],A=this.h[12],T=this.h[13],I=this.h[14],R=this.h[15];o(this.k.length===n.length);for(var M=0;M<n.length;M+=2){var D=I,j=R,P=C(g,y),z=N(g,y),L=w(g,y,b,O,A),B=x(g,y,b,O,A,T),F=this.k[M],U=this.k[M+1],W=n[M],V=n[M+1],q=m(D,j,P,z,L,B,F,U,W,V),H=v(D,j,P,z,L,B,F,U,W,V);D=S(r,i),j=E(r,i),P=_(r,i,a,s,u),z=k(r,i,a,s,u,c);var G=f(D,j,P,z),K=h(D,j,P,z);I=A,R=T,A=b,T=O,b=g,O=y,g=f(d,p,q,H),y=h(p,p,q,H),d=u,p=c,u=a,c=s,a=r,s=i,r=f(q,H,G,K),i=h(q,H,G,K)}l(this.h,0,r,i),l(this.h,2,a,s),l(this.h,4,u,c),l(this.h,6,d,p),l(this.h,8,g,y),l(this.h,10,b,O),l(this.h,12,A,T),l(this.h,14,I,R)},b.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},function(e,t,n){var r=n(5),i=n(47).Reporter,o=n(15).Buffer;function a(e,t){i.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof s||(e=new s(e,t)),this.length+=e.length,e},this);else if("number"===typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"===typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}r(a,i),t.DecoderBuffer=a,a.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},a.prototype.restore=function(e){var t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var n=new a(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=s,s.prototype.join=function(e,t){return e||(e=new o(this.length)),t||(t=0),0===this.length?e:(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,t),t+=n.length}):("number"===typeof this.value?e[t]=this.value:"string"===typeof this.value?e.write(this.value,t):o.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)}},function(e,t,n){var r=t;r._reverse=function(e){var t={};return Object.keys(e).forEach(function(n){(0|n)==n&&(n|=0);var r=e[n];t[r]=n}),t},r.der=n(213)},function(e,t,n){var r=n(5),i=n(46),o=i.base,a=i.bignum,s=i.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){o.Node.call(this,"der",e)}function l(e,t){var n=e.readUInt8(t);if(e.isError(n))return n;var r=s.tagClass[n>>6],i=0===(32&n);if(31===(31&n)){var o=n;for(n=0;128===(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;n<<=7,n|=127&o}}else n&=31;return{cls:r,primitive:i,tag:n,tagStr:s.tag[n]}}function f(e,t,n){var r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0===(128&r))return r;var i=127&r;if(i>4)return e.error("length octect is too long");r=0;for(var o=0;o<i;o++){r<<=8;var a=e.readUInt8(n);if(e.isError(a))return a;r|=a}return r}e.exports=u,u.prototype.decode=function(e,t){return e instanceof o.DecoderBuffer||(e=new o.DecoderBuffer(e,t)),this.tree._decode(e,t)},r(c,o.Node),c.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;var r=e.save(),i=l(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(r),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||n)},c.prototype._decodeTag=function(e,t,n){var r=l(e,'Failed to decode tag of "'+t+'"');if(e.isError(r))return r;var i=f(e,r.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!n&&r.tag!==t&&r.tagStr!==t&&r.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(r.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');var o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){var n=l(e,t);if(e.isError(n))return n;var r,i=f(e,n.primitive,t);if(e.isError(i))return i;if(r=n.primitive||null!==i?e.skip(i):this._skipUntilEnd(e,t),e.isError(r))return r;if("end"===n.tagStr)break}},c.prototype._decodeList=function(e,t,n,r){for(var i=[];!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var a=n.decode(e,"der",r);if(e.isError(a)&&o)break;i.push(a)}return i},c.prototype._decodeStr=function(e,t){if("bitstr"===t){var n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}if("bmpstr"===t){var r=e.raw();if(r.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<r.length/2;o++)i+=String.fromCharCode(r.readUInt16BE(2*o));return i}if("numstr"===t){var a=e.raw().toString("ascii");return this._isNumstr(a)?a:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var s=e.raw().toString("ascii");return this._isPrintstr(s)?s:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,n){for(var r,i=[],o=0;!e.isEmpty();){var a=e.readUInt8();o<<=7,o|=127&a,0===(128&a)&&(i.push(o),o=0)}128&a&&i.push(o);var s=i[0]/40|0,u=i[0]%40;if(r=n?i:[s,u].concat(i.slice(1)),t){var c=t[r.join(" ")];void 0===c&&(c=t[r.join(".")]),void 0!==c&&(r=c)}return r},c.prototype._decodeTime=function(e,t){var n=e.raw().toString();if("gentime"===t)var r=0|n.slice(0,4),i=0|n.slice(4,6),o=0|n.slice(6,8),a=0|n.slice(8,10),s=0|n.slice(10,12),u=0|n.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");r=0|n.slice(0,2),i=0|n.slice(2,4),o=0|n.slice(4,6),a=0|n.slice(6,8),s=0|n.slice(8,10),u=0|n.slice(10,12);r=r<70?2e3+r:1900+r}return Date.UTC(r,i-1,o,a,s,u,0)},c.prototype._decodeNull=function(e){return null},c.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){var n=e.raw(),r=new a(n);return t&&(r=t[r.toString(10)]||r),r},c.prototype._use=function(e,t){return"function"===typeof e&&(e=e(t)),e._getDecoder("der").tree}},function(e,t,n){var r=n(5),i=n(15).Buffer,o=n(46),a=o.base,s=o.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){a.Node.call(this,"der",e)}function l(e){return e<10?"0"+e:e}e.exports=u,u.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},r(c,a.Node),c.prototype._encodeComposite=function(e,t,n,r){var o,a=function(e,t,n,r){var i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(s.tagByName.hasOwnProperty(e))i=s.tagByName[e];else{if("number"!==typeof e||(0|e)!==e)return r.error("Unknown tag: "+e);i=e}if(i>=31)return r.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[n||"universal"]<<6}(e,t,n,this.reporter);if(r.length<128)return(o=new i(2))[0]=a,o[1]=r.length,this._createEncoderBuffer([o,r]);for(var u=1,c=r.length;c>=256;c>>=8)u++;(o=new i(2+u))[0]=a,o[1]=128|u;c=1+u;for(var l=r.length;l>0;c--,l>>=8)o[c]=255&l;return this._createEncoderBuffer([o,r])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var n=new i(2*e.length),r=0;r<e.length;r++)n.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(n)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},c.prototype._encodeObjid=function(e,t,n){if("string"===typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var r=0;r<e.length;r++)e[r]|=0}else if(Array.isArray(e)){e=e.slice();for(r=0;r<e.length;r++)e[r]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));
1if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(r=0;r<e.length;r++){var a=e[r];for(o++;a>=128;a>>=7)o++}var s=new i(o),u=s.length-1;for(r=e.length-1;r>=0;r--){a=e[r];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},c.prototype._encodeTime=function(e,t){var n,r=new Date(e);return"gentime"===t?n=[l(r.getFullYear()),l(r.getUTCMonth()+1),l(r.getUTCDate()),l(r.getUTCHours()),l(r.getUTCMinutes()),l(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[l(r.getFullYear()%100),l(r.getUTCMonth()+1),l(r.getUTCDate()),l(r.getUTCHours()),l(r.getUTCMinutes()),l(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"===typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!==typeof e&&!i.isBuffer(e)){var n=e.toArray();!e.sign&&128&n[0]&&n.unshift(0),e=new i(n)}if(i.isBuffer(e)){var r=e.length;0===e.length&&r++;var o=new i(r);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);r=1;for(var a=e;a>=256;a>>=8)r++;for(a=(o=new Array(r)).length-1;a>=0;a--)o[a]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"===typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,n){var r,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(r=0;r<o.length;r++)if(o[r]!==i.defaultBuffer[r])return!1;return!0}},function(e){e.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},function(e,t,n){var r=n(42),i=n(7).Buffer;function o(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var n,a=i.alloc(0),s=0;a.length<t;)n=o(s++),a=i.concat([a,r("sha1").update(e).update(n).digest()]);return a.slice(0,t)}},function(e,t){e.exports=function(e,t){for(var n=e.length,r=-1;++r<n;)e[r]^=t[r];return e}},function(e,t,n){var r=n(13),i=n(7).Buffer;e.exports=function(e,t){return i.from(e.toRed(r.mont(t.modulus)).redPow(new r(t.publicExponent)).fromRed().toArray())}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(131)},function(e,t,n){"use strict";var r=n(77),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var c=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=d(n);i&&i!==p&&e(t,i,r)}var a=l(n);f&&(a=a.concat(f(n)));for(var s=u(t),m=u(n),v=0;v<a.length;++v){var g=a[v];if(!o[g]&&(!r||!r[g])&&(!m||!m[g])&&(!s||!s[g])){var y=h(n,g);try{c(t,g,y)}catch(b){}}}return t}return t}},function(e,t,n){var r;r=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})}
1,n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=u(o),s=u(n(0));function u(e){return e&&e.__esModule?e:{default:e}}var c=s.default.oneOfType([s.default.string,s.default.arrayOf(s.default.string),s.default.shape({exact:s.default.oneOfType([s.default.string,s.default.arrayOf(s.default.string)])}),s.default.shape({ideal:s.default.oneOfType([s.default.string,s.default.arrayOf(s.default.string)])})]),l=s.default.oneOfType([s.default.shape({exact:s.default.bool}),s.default.shape({ideal:s.default.bool})]),f=s.default.oneOfType([s.default.number,s.default.shape({exact:s.default.number,ideal:s.default.number,min:s.default.number,max:s.default.number})]),h=f,d=s.default.shape({deviceId:c,groupId:c,autoGainControl:l,channelCount:f,latency:h,noiseSuppression:l,sampleRate:f,sampleSize:f,volume:h}),p=s.default.shape({deviceId:c,groupId:c,aspectRatio:h,facingMode:c,frameRate:h,height:f,width:f}),m=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={hasUserMedia:!1},e}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.Component),i(t,[{key:"componentDidMount",value:function(){(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)&&(t.mountedInstances.push(this),this.state.hasUserMedia||t.userMediaRequested||this.requestUserMedia())}},{key:"componentDidUpdate",value:function(e){JSON.stringify(e.audioConstraints)===JSON.stringify(this.props.audioConstraints)&&JSON.stringify(e.videoConstraints)===JSON.stringify(this.props.videoConstraints)||this.requestUserMedia()}},{key:"componentWillUnmount",value:function(){var e=t.mountedInstances.indexOf(this);t.mountedInstances.splice(e,1),t.userMediaRequested=!1,0===t.mountedInstances.length&&this.state.hasUserMedia&&(this.stream.getVideoTracks&&this.stream.getAudioTracks?(this.stream.getVideoTracks().map(function(e){return e.stop()}),this.stream.getAudioTracks().map(function(e){return e.stop()})):this.stream.stop(),window.URL.revokeObjectURL(this.state.src))}},{key:"getScreenshot",value:function(){if(!this.state.hasUserMedia)return null;var e=this.getCanvas();return e&&e.toDataURL(this.props.screenshotFormat,this.props.screenshotQuality)}},{key:"getCanvas",value:function(){if(!this.state.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var e=document.createElement("canvas"),t=this.video.videoWidth/this.video.videoHeight,n=this.props.minScreenshotWidth||this.video.clientWidth,r=n/t;this.props.minScreenshotHeight&&r<this.props.minScreenshotHeight&&(n=(r=this.props.minScreenshotHeight)*t),e.width=n,e.height=r,this.canvas=e,this.ctx=e.getContext("2d")}var i=this.ctx,o=this.canvas;return i.imageSmoothingEnabled=this.props.imageSmoothing,i.drawImage(this.video,0,0,o.width,o.height),o}},{key:"requestUserMedia",value:function(){var e=this;navigator.getUserMedia=navigator.mediaDevices.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var n=function(n,r){var i={video:r||!0};e.props.audio&&(i.audio=n||!0),navigator.mediaDevices.getUserMedia(i).then(function(e){t.mountedInstances.forEac
1h(function(t){return t.handleUserMedia(null,e)})}).catch(function(e){t.mountedInstances.forEach(function(t){return t.handleUserMedia(e)})})};if("mediaDevices"in navigator)n(this.props.audioConstraints,this.props.videoConstraints);else{var i=function(e){return{optional:[{sourceId:e}]}},o=function(e){var t=(e||{}).deviceId;return"string"===typeof t?t:Array.isArray(t)&&t.length>0?t[0]:"object"===("undefined"===typeof t?"undefined":r(t))&&t.ideal?t.ideal:null};MediaStreamTrack.getSources(function(t){var r=null,a=null;t.forEach(function(e){"audio"===e.kind?r=e.id:"video"===e.kind&&(a=e.id)});var s=o(e.props.audioConstraints);s&&(r=s);var u=o(e.props.videoConstraints);u&&(a=u),n(i(r),i(a))})}t.userMediaRequested=!0}},{key:"handleUserMedia",value:function(e,t){if(e)return this.setState({hasUserMedia:!1}),void this.props.onUserMediaError(e);this.stream=t;try{this.video.srcObject=t,this.setState({hasUserMedia:!0})}catch(n){this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(t)})}this.props.onUserMedia()}},{key:"render",value:function(){var e=this;return a.default.createElement("video",{autoPlay:!0,width:this.props.width,height:this.props.height,src:this.state.src,muted:this.props.audio,className:this.props.className,playsInline:!0,style:this.props.style,ref:function(t){e.video=t}})}}]),t}();m.defaultProps={audio:!0,className:"",height:480,imageSmoothing:!0,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",width:640,screenshotQuality:.92},m.propTypes={audio:s.default.bool,onUserMedia:s.default.func,onUserMediaError:s.default.func,height:s.default.oneOfType([s.default.number,s.default.string]),width:s.default.oneOfType([s.default.number,s.default.string]),screenshotFormat:s.default.oneOf(["image/webp","image/png","image/jpeg"]),style:s.default.object,className:s.default.string,screenshotQuality:s.default.number,minScreenshotWidth:s.default.number,minScreenshotHeight:s.default.number,audioConstraints:d,videoConstraints:p,imageSmoothing:s.default.bool},m.mountedInstances=[],m.userMediaRequested=!1,t.default=m,e.exports=t.default}])},e.exports=r(n(1),n(2))},function(e,t,n){"use strict";n.r(t),n.d(t,"load",function(){return c}),n.d(t,"MobileNet",function(){return l});var r=n(9);function i(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function o(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var a
vendor: 27,569 bytes, line 1
1={0:"tench, Tinca tinca",1:"goldfish, Carassius auratus",2:"great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias",3:"tiger shark, Galeocerdo cuvieri",4:"hammerhead, hammerhead shark",5:"electric ray, crampfish, numbfish, torpedo",6:"stingray",7:"cock",8:"hen",9:"ostrich, Struthio camelus",10:"brambling, Fringilla montifringilla",11:"goldfinch, Carduelis carduelis",12:"house finch, linnet, Carpodacus mexicanus",13:"junco, snowbird",14:"indigo bunting, indigo finch, indigo bird, Passerina cyanea",15:"robin, American robin, Turdus migratorius",16:"bulbul",17:"jay",18:"magpie",19:"chickadee",20:"water ouzel, dipper",21:"kite",22:"bald eagle, American eagle, Haliaeetus leucocephalus",23:"vulture",24:"great grey owl, great gray owl, Strix nebulosa",25:"European fire salamander, Salamandra salamandra",26:"common newt, Triturus vulgaris",27:"eft",28:"spotted salamander, Ambystoma maculatum",29:"axolotl, mud puppy, Ambystoma mexicanum",30:"bullfrog, Rana catesbeiana",31:"tree frog, tree-frog",32:"tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui",33:"loggerhead, loggerhead turtle, Caretta caretta",34:"leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea",35:"mud turtle",36:"terrapin",37:"box turtle, box tortoise",38:"banded gecko",39:"common iguana, iguana, Iguana iguana",40:"American chameleon, anole, Anolis carolinensis",41:"whiptail, whiptail lizard",42:"agama",43:"frilled lizard, Chlamydosaurus kingi",44:"alligator lizard",45:"Gila monster, Heloderma suspectum",46:"green lizard, Lacerta viridis",47:"African chameleon, Chamaeleo chamaeleon",48:"Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis",49:"African crocodile, Nile crocodile, Crocodylus niloticus",50:"American alligator, Alligator mississipiensis",51:"triceratops",52:"thunder snake, worm snake, Carphophis amoenus",53:"ringneck snake, ring-necked snake, ring snake",54:"hognose snake, puff adder, sand viper",55:"green snake, grass snake",56:"king snake, kingsnake",57:"garter snake, grass snake",58:"water snake",59:"vine snake",60:"night snake, Hypsiglena torquata",61:"boa constrictor, Constrictor constrictor",62:"rock python, rock snake, Python sebae",63:"Indian cobra, Naja naja",64:"green mamba",65:"sea snake",66:"horned viper, cerastes, sand viper, horned asp, Cerastes cornutus",67:"diamondback, diamondback rattlesnake, Crotalus adamanteus",68:"sidewinder, horned rattlesnake, Crotalus cerastes",69:"trilobite",70:"harvestman, daddy longlegs, Phalangium opilio",71:"scorpion",72:"black and gold garden spider, Argiope aurantia",73:"barn spider, Araneus cavaticus",74:"garden spider, Aranea diademata",75:"black widow, Latrodectus mactans",76:"tarantula",77:"wolf spider, hunting spider",78:"tick",79:"centipede",80:"black grouse",81:"ptarmigan",82:"ruffed grouse, partridge, Bonasa umbellus",83:"prairie chicken, prairie grouse, prairie fowl",84:"peacock",85:"quail",86:"partridge",87:"African grey, African gray, Psittacus erithacus",88:"macaw",89:"sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita",90:"lorikeet",91:"coucal",92:"bee eater",93:"hornbill",94:"hummingbird",95:"jacamar",96:"toucan",97:"drake",98:"red-breasted merganser, Mergus serrator",99:"goose",100:"black swan, Cygnus atratus",101:"tusker",102:"echidna, spiny anteater, anteater",103:"platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus",104:"wallaby, brush kangaroo",105:"koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus",106:"wombat",107:"jelly fish",108:"sea anemone, anemone",109:"brain coral",110:"flatworm, platyhelminth",111:"nematode, nematode worm, roundworm",112:"conch",113:"snail",114:"slug",115:"sea slug, nudibranch",116:"chiton, coat-of-mail shell, sea cradle, polyplacophore",117:"chambered nautilus, pearly nautilus, nautilus",118:"Dungeness crab, Cancer magister",119:"rock crab, Cancer irroratus",120:"fiddler crab",121:"king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica",122:"American lobster, Northern lobster, Maine lobster, Homarus americanus",123:"spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish",124:"crayfish, crawfish, crawdad, crawdaddy",125:"hermit crab",126:"isopod",127:"white stork, Ciconia ciconia",128:"black stork, Ciconia nigra",129:"spoonbill",130:"flamingo",131:"little blue heron, Egretta caerulea",132:"American egret, great white heron, Egretta albus",133:"bittern",134:"crane",135:"limpkin, Aramus pictus",136:"European gallinule, Porphyrio porphyrio",137:"American coot, marsh hen, mud hen, water hen, Fulica americana",138:"bustard",139:"ruddy turnstone, Arenaria interpres",140:"red-backed sandpiper, dunlin, Erolia alpina",141:"redshank, Tringa totanus",142:"dowitcher",143:"oystercatcher, oyster catcher",144:"pelican",145:"king penguin, Aptenodytes patagonica",146:"albatross, mollymawk",147:"grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus",148:"killer whale, killer, orca, grampus, sea wolf, Orcinus orca",149:"dugong, Dugong dugon",150:"sea lion",151:"Chihuahua",152:"Japanese spaniel",153:"Maltese dog, Maltese terrier, Maltese",154:"Pekinese, Pekingese, Peke",155:"Shih-Tzu",156:"Blenheim spaniel",157:"papillon",158:"toy terrier",159:"Rhodesian ridgeback",160:"Afghan hound, Afghan",161:"basset, basset hound",162:"beagle",163:"bloodhound, sleuthhound",164:"bluetick",165:"black-and-tan coonhound",166:"Walker hound, Walker foxhound",167:"English foxhound",168:"redbone",169:"borzoi, Russian wolfhound",170:"Irish wolfhound",171:"Italian greyhound",172:"whippet",173:"Ibizan hound, Ibizan Podenco",174:"Norwegian elkhound, elkhound",175:"otterhound, otter hound",176:"Saluki, gazelle hound",177:"Scottish deerhound, deerhound",178:"Weimaraner",179:"Staffordshire bullterrier, Staffordshire bull terrier",180:"American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier",181:"Bedlington terrier",182:"Border terrier",183:"Kerry blue terrier",184:"Irish terrier",185:"Norfolk terrier",186:"Norwich terrier",187:"Yorkshire terrier",188:"wire-haired fox terrier",189:"Lakeland terrier",190:"Sealyham terrier, Sealyham",191:"Airedale, Airedale terrier",192:"cairn, cairn terrier",193:"Australian terrier",194:"Dandie Dinmont, Dandie Dinmont terrier",195:"Boston bull, Boston terrier",196:"miniature schnauzer",197:"giant schnauzer",198:"standard schnauzer",199:"Scotch terrier, Scottish terrier, Scottie",200:"Tibetan terrier, chrysanthemum dog",201:"silky terrier, Sydney silky",202:"soft-coated wheaten terrier",203:"West Highland white terrier",204:"Lhasa, Lhasa apso",205:"flat-coated retriever",206:"curly-coated retriever",207:"golden retriever",208:"Labrador retriever",209:"Chesapeake Bay retriever",210:"German short-haired pointer",211:"vizsla, Hungarian pointer",212:"English setter",213:"Irish setter, red setter",214:"Gordon setter",215:"Brittany spaniel",216:"clumber, clumber spaniel",217:"English springer, English springer spaniel",218:"Welsh springer spaniel",219:"cocker spaniel, English cocker spaniel, cocker",220:"Sussex spaniel",221:"Irish water spaniel",222:"kuvasz",223:"schipperke",224:"groenendael",225:"malinois",226:"briard",227:"kelpie",228:"komondor",229:"Old English sheepdog, bobtail",230:"Shetland sheepdog, Shetland sheep dog, Shetland",231:"collie",232:"Border collie",233:"Bouvier des Flandres, Bouviers des Flandres",234:"Rottweiler",235:"German shepherd, German shepherd dog, German police dog, alsatian",236:"Doberman, Doberman pinscher",237:"miniature pinscher",238:"Greater Swiss Mountain dog",239:"Bernese mountain dog",240:"Appenzeller",241:"EntleBucher",242:"boxer",243:"bull mastiff",244:"Tibetan mastiff",245:"French bulldog",246:"Great Dane",247:"Saint Bernard, St Bernard",248:"Eskimo dog, husky",249:"malamute, malemute, Alaskan malamute",250:"Siberian husky",251:"dalmatian, coach dog, carriage dog",252:"affenpinscher, monkey pinscher, monkey dog",253:"basenji",254:"pug, pug-dog",255:"Leonberg",256:"Newfoundland, Newfoundland dog",257:"Great Pyrenees",258:"Samoyed, Samoyede",259:"Pomeranian",260:"chow, chow chow",261:"keeshond",262:"Brabancon griffon",263:"Pembroke, Pembroke Welsh corgi",264:"Cardigan, Cardigan Welsh corgi",265:"toy poodle",266:"miniature poodle",267:"standard poodle",268:"Mexican hairless",269:"timber wolf, grey wolf, gray wolf, Canis lupus",270:"white wolf, Arctic wolf, Canis lupus tundrarum",271:"red wolf, maned wolf, Canis rufus, Canis niger",272:"coyote, prairie wolf, brush wolf, Canis latrans",273:"dingo, warrigal, warragal, Canis dingo",274:"dhole, Cuon alpinus",275:"African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus",276:"hyena, hyaena",277:"red fox, Vulpes vulpes",278:"kit fox, Vulpes macrotis",279:"Arctic fox, white fox, Alopex lagopus",280:"grey fox, gray fox, Urocyon cinereoargenteus",281:"tabby, tabby cat",282:"tiger cat",283:"Persian cat",284:"Siamese cat, Siamese",285:"Egyptian cat",286:"cougar, puma, catamount, mountain lion, painter, panther, Felis concolor",287:"lynx, catamount",288:"leopard, Panthera pardus",289:"snow leopard, ounce, Panthera uncia",290:"jaguar, panther, Panthera onca, Felis onca",291:"lion, king of beasts, Panthera leo",292:"tiger, Panthera tigris",293:"cheetah, chetah, Acinonyx jubatus",294:"brown bear, bruin, Ursus arctos",295:"American black bear, black bear, Ursus americanus, Euarctos americanus",296:"ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus",297:"sloth bear, Melursus ursinus, Ursus ursinus",298:"mongoose",299:"meerkat, mierkat",300:"tiger beetle",301:"ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle",302:"ground beetle, carabid beetle",303:"long-horned beetle, longicorn, longicorn beetle",304:"leaf beetle, chrysomelid",305:"dung beetle",306:"rhinoceros beetle",307:"weevil",308:"fly",309:"bee",310:"ant, emmet, pismire",311:"grasshopper, hopper",312:"cricket",313:"walking stick, walkingstick, stick insect",314:"cockroach, roach",315:"mantis, mantid",316:"cicada, cicala",317:"leafhopper",318:"lacewing, lacewing fly",319:"dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk",320:"damselfly",321:"admiral",322:"ringlet, ringlet butterfly",323:"monarch, monarch butterfly, milkweed butterfly, Danaus plexippus",324:"cabbage butterfly",325:"sulphur butterfly, sulfur butterfly",326:"lycaenid, lycaenid butterfly",327:"starfish, sea star",328:"sea urchin",329:"sea cucumber, holothurian",330:"wood rabbit, cottontail, cottontail rabbit",331:"hare",332:"Angora, Angora rabbit",333:"hamster",334:"porcupine, hedgehog",335:"fox squirrel, eastern fox squirrel, Sciurus niger",336:"marmot",337:"beaver",338:"guinea pig, Cavia cobaya",339:"sorrel",340:"zebra",341:"hog, pig, grunter, squealer, Sus scrofa",342:"wild boar, boar, Sus scrofa",343:"warthog",344:"hippopotamus, hippo, river horse, Hippopotamus amphibius",345:"ox",346:"water buffalo, water ox, Asiatic buffalo, Bubalus bubalis",347:"bison",348:"ram, tup",349:"bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis",350:"ibex, Capra ibex",351:"hartebeest",352:"impala, Aepyceros melampus",353:"gazelle",354:"Arabian camel, dromedary, Camelus dromedarius",355:"llama",356:"weasel",357:"mink",358:"polecat, fitch, foulmart, foumart, Mustela putorius",359:"black-footed ferret, ferret, Mustela nigripes",360:"otter",361:"skunk, polecat, wood pussy",362:"badger",363:"armadillo",364:"three-toed sloth, ai, Bradypus tridactylus",365:"orangutan, orang, orangutang, Pongo pygmaeus",366:"gorilla, Gorilla gorilla",367:"chimpanzee, chimp, Pan troglodytes",368:"gibbon, Hylobates lar",369:"siamang, Hylobates syndactylus, Symphalangus syndactylus",370:"guenon, guenon monkey",371:"patas, hussar monkey, Erythrocebus patas",372:"baboon",373:"macaque",374:"langur",375:"colobus, colobus monkey",376:"proboscis monkey, Nasalis larvatus",377:"marmoset",378:"capuchin, ringtail, Cebus capucinus",379:"howler monkey, howler",380:"titi, titi monkey",381:"spider monkey, Ateles geoffroyi",382:"squirrel monkey, Saimiri sciureus",383:"Madagascar cat, ring-tailed lemur, Lemur catta",384:"indri, indris, Indri indri, Indri brevicaudatus",385:"Indian elephant, Elephas maximus",386:"African elephant, Loxodonta africana",387:"lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens",388:"giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca",389:"barracouta, snoek",390:"eel",391:"coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch",392:"rock beauty, Holocanthus tricolor",393:"anemone fish",394:"sturgeon",395:"gar, garfish, garpike, billfish, Lepisosteus osseus",396:"lionfish",397:"puffer, pufferfish, blowfish, globefish",398:"abacus",399:"abaya",400:"academic gown, academic robe, judge's robe",401:"accordion, piano accordion, squeeze box",402:"acoustic guitar",403:"aircraft carrier, carrier, flattop, attack aircraft carrier",404:"airliner",405:"airship, dirigible",406:"altar",407:"ambulance",408:"amphibian, amphibious vehicle",409:"analog clock",410:"apiary, bee house",411:"apron",412:"ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin",413:"assault rifle, assault gun",414:"backpack, back pack, knapsack, packsack, rucksack, haversack",415:"bakery, bakeshop, bakehouse",416:"balance beam, beam",417:"balloon",418:"ballpoint, ballpoint pen, ballpen, Biro",419:"Band Aid",420:"banjo",421:"bannister, banister, balustrade, balusters, handrail",422:"barbell",423:"barber chair",424:"barbershop",425:"barn",426:"barometer",427:"barrel, cask",428:"barrow, garden cart, lawn cart, wheelbarrow",429:"baseball",430:"basketball",431:"bassinet",432:"bassoon",433:"bathing cap, swimming cap",434:"bath towel",435:"bathtub, bathing tub, bath, tub",436:"beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon",437:"beacon, lighthouse, beacon light, pharos",438:"beaker",439:"bearskin, busby, shako",440:"beer bottle",441:"beer glass",442:"bell cote, bell cot",443:"bib",444:"bicycle-built-for-two, tandem bicycle, tandem",445:"bikini, two-piece",446:"binder, ring-binder",447:"binoculars, field glasses, opera glasses",448:"birdhouse",449:"boathouse",450:"bobsled, bobsleigh, bob",451:"bolo tie, bolo, bola tie, bola",452:"bonnet, poke bonnet",453:"bookcase",454:"bookshop, bookstore, bookstall",455:"bottlecap",456:"bow",457:"bow tie, bow-tie, bowtie",458:"brass, memorial tablet, plaque",459:"brassiere, bra, bandeau",460:"breakwater, groin, groyne, mole, bulwark, seawall, jetty",461:"breastplate, aegis, egis",462:"broom",463:"bucket, pail",464:"buckle",465:"bulletproof vest",466:"bullet train, bullet",467:"butcher shop, meat market",468:"cab, hack, taxi, taxicab",469:"caldron, cauldron",470:"candle, taper, wax light",471:"cannon",472:"canoe",473:"can opener, tin opener",474:"cardigan",475:"car mirror",476:"carousel, carrousel, merry-go-round, roundabout, whirligig",477:"carpenter's kit, tool kit",478:"carton",479:"car wheel",480:"cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM",481:"cassette",482:"cassette player",483:"castle",484:"catamaran",485:"CD player",486:"cello, violoncello",487:"cellular telephone, cellular phone, cellphone, cell, mobile phone",488:"chain",489:"chainlink fence",490:"chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour",491:"chain saw, chainsaw",492:"chest",493:"chiffonier, commode",494:"chime, bell, gong",495:"china cabinet, china closet",496:"Christmas stocking",497:"church, church building",498:"cinema, movie theater, movie theatre, movie house, picture palace",499:"cleaver, meat cleaver, chopper",500:"cliff dwelling",501:"cloak",502:"clog, geta, patten, sabot",503:"cocktail shaker",504:"coffee mug",505:"coffeepot",506:"coil, spiral, volute, whorl, helix",507:"combination lock",508:"computer keyboard, keypad",509:"confectionery, confectionary, candy store",510:"container ship, containership, container vessel",511:"convertible",512:"corkscrew, bottle screw",513:"cornet, horn, trumpet, trump",514:"cowboy boot",515:"cowboy hat, ten-gallon hat",516:"cradle",517:"crane",518:"crash helmet",519:"crate",520:"crib, cot",521:"Crock Pot",522:"croquet ball",523:"crutch",524:"cuirass",525:"dam, dike, dyke",526:"desk",527:"desktop computer",528:"dial telephone, dial phone",529:"diaper, nappy, napkin",530:"digital clock",531:"digital watch",532:"dining table, board",533:"dishrag, dishcloth",534:"dishwasher, dish washer, dishwashing machine",535:"disk brake, disc brake",536:"dock, dockage, docking facility",537:"dogsled, dog sled, dog sleigh",538:"dome",539:"doormat, welcome mat",540:"drilling platform, offshore rig",541:"drum, membranophone, tympan",542:"drumstick",543:"dumbbell",544:"Dutch oven",545:"electric fan, blower",546:"electric guitar",547:"electric locomotive",548:"entertainment center",549:"envelope",550:"espresso maker",551:"face powder",552:"feather boa, boa",553:"file, file cabinet, filing cabinet",554:"fireboat",555:"fire engine, fire truck",556:"fire screen, fireguard",557:"flagpole, flagstaff",558:"flute, transverse flute",559:"folding chair",560:"football helmet",561:"forklift",562:"fountain",563:"fountain pen",564:"four-poster",565:"freight car",566:"French horn, horn",567:"frying pan, frypan, skillet",568:"fur coat",569:"garbage truck, dustcart",570:"gasmask, respirator, gas helmet",571:"gas pump, gasoline pump, petrol pump, island dispenser",572:"goblet",573:"go-kart",574:"golf ball",575:"golfcart, golf cart",576:"gondola",577:"gong, tam-tam",578:"gown",579:"grand piano, grand",580:"greenhouse, nursery, glasshouse",581:"grille, radiator grille",582:"grocery store, grocery, food market, market",583:"guillotine",584:"hair slide",585:"hair spray",586:"half track",587:"hammer",588:"hamper",589:"hand blower, blow dryer, blow drier, hair dryer, hair drier",590:"hand-held computer, hand-held microcomputer",591:"handkerchief, hankie, hanky, hankey",592:"hard disc, hard disk, fixed disk",593:"harmonica, mouth organ, harp, mouth harp",594:"harp",595:"harvester, reaper",596:"hatchet",597:"holster",598:"home theater, home theatre",599:"honeycomb",600:"hook, claw",601:"hoopskirt, crinoline",602:"horizontal bar, high bar",603:"horse cart, horse-cart",604:"hourglass",605:"iPod",606:"iron, smoothing iron",607:"jack-o'-lantern",608:"jean, blue jean, denim",609:"jeep, landrover",610:"jersey, T-shirt, tee shirt",611:"jigsaw puzzle",612:"jinrikisha, ricksha, rickshaw",613:"joystick",614:"kimono",615:"knee pad",616:"knot",617:"lab coat, laboratory coat",618:"ladle",619:"lampshade, lamp shade",620:"laptop, laptop computer",621:"lawn mower, mower",622:"lens cap, lens cover",623:"letter opener, paper knife, paperknife",624:"library",625:"lifeboat",626:"lighter, light, igniter, ignitor",627:"limousine, limo",628:"liner, ocean liner",629:"lipstick, lip rouge",630:"Loafer",631:"lotion",632:"loudspeaker, speaker, speaker unit, loudspeaker system, speaker system",633:"loupe, jeweler's loupe",634:"lumbermill, sawmill",635:"magnetic compass",636:"mailbag, postbag",637:"mailbox, letter box",638:"maillot",639:"maillot, tank suit",640:"manhole cover",641:"maraca",642:"marimba, xylophone",643:"mask",644:"matchstick",645:"maypole",646:"maze, labyrinth",647:"measuring cup",648:"medicine chest, medicine cabinet",649:"megalith, megalithic structure",650:"microphone, mike",651:"microwave, microwave oven",652:"military uniform",653:"milk can",654:"minibus",655:"miniskirt, mini",656:"minivan",657:"missile",658:"mitten",659:"mixing bowl",660:"mobile home, manufactured home",661:"Model T",662:"modem",663:"monastery",664:"monitor",665:"moped",666:"mortar",667:"mortarboard",668:"mosque",669:"mosquito net",670:"motor scooter, scooter",671:"mountain bike, all-terrain bike, off-roader",672:"mountain tent",673:"mouse, computer mouse",674:"mousetrap",675:"moving van",676:"muzzle",677:"nail",678:"neck brace",679:"necklace",680:"nipple",681:"notebook, notebook computer",682:"obelisk",683:"oboe, hautboy, hautbois",684:"ocarina, sweet potato",685:"odometer, hodometer, mileometer, milometer",686:"oil filter",687:"organ, pipe organ",688:"oscilloscope, scope, cathode-ray oscilloscope, CRO",689:"overskirt",690:"oxcart",691:"oxygen mask",692:"packet",693:"paddle, boat paddle",694:"paddlewheel, paddle wheel",695:"padlock",696:"paintbrush",697:"pajama, pyjama, pj's, jammies",698:"palace",699:"panpipe, pandean pipe, syrinx",700:"paper towel",701:"parachute, chute",702:"parallel bars, bars",703:"park bench",704:"parking meter",705:"passenger car, coach, carriage",706:"patio, terrace",707:"pay-phone, pay-station",708:"pedestal, plinth, footstall",709:"pencil box, pencil case",710:"pencil sharpener",711:"perfume, essence",712:"Petri dish",713:"photocopier",714:"pick, plectrum, plectron",715:"pickelhaube",716:"picket fence, paling",717:"pickup, pickup truck",718:"pier",719:"piggy bank, penny bank",720:"pill bottle",721:"pillow",722:"ping-pong ball",723:"pinwheel",724:"pirate, pirate ship",725:"pitcher, ewer",726:"plane, carpenter's plane, woodworking plane",727:"planetarium",728:"plastic bag",729:"plate rack",730:"plow, plough",731:"plunger, plumber's helper",732:"Polaroid camera, Polaroid Land camera",733:"pole",734:"police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria",735:"poncho",736:"pool table, billiard table, snooker table",737:"pop bottle, soda bottle",738:"pot, flowerpot",739:"potter's wheel",740:"power drill",741:"prayer rug, prayer mat",742:"printer",743:"prison, prison house",744:"projectile, missile",745:"projector",746:"puck, hockey puck",747:"punching bag, punch bag, punching ball, punchball",748:"purse",749:"quill, quill pen",750:"quilt, comforter, comfort, puff",751:"racer, race car, racing car",752:"racket, racquet",753:"radiator",754:"radio, wireless",755:"radio telescope, radio reflector",756:"rain barrel",757:"recreational vehicle, RV, R.V.",758:"reel",759:"reflex camera",760:"refrigerator, icebox",761:"remote control, remote",762:"restaurant, eating house, eating place, eatery",763:"revolver, six-gun, six-shooter",764:"rifle",765:"rocking chair, rocker",766:"rotisserie",767:"rubber eraser, rubber, pencil eraser",768:"rugby ball",769:"rule, ruler",770:"running shoe",771:"safe",772:"safety pin",773:"saltshaker, salt shaker",774:"sandal",775:"sarong",776:"sax, saxophone",777:"scabbard",778:"scale, weighing machine",779:"school bus",780:"schooner",781:"scoreboard",782:"screen, CRT screen",783:"screw",784:"screwdriver",785:"seat belt, seatbelt",786:"sewing machine",787:"shield, buckler",788:"shoe shop, shoe-shop, shoe store",789:"shoji",790:"shopping basket",791:"shopping cart",792:"shovel",793:"shower cap",794:"shower curtain",795:"ski",796:"ski mask",797:"sleeping bag",798:"slide rule, slipstick",799:"sliding door",800:"slot, one-armed bandit",801:"snorkel",802:"snowmobile",803:"snowplow, snowplough",804:"soap dispenser",805:"soccer ball",806:"sock",807:"solar dish, solar collector, solar furnace",808:"sombrero",809:"soup bowl",810:"space bar",811:"space heater",812:"space shuttle",813:"spatula",814:"speedboat",815:"spider web, spider's web",816:"spindle",817:"sports car, sport car",818:"spotlight, spot",819:"stage",820:"steam locomotive",821:"steel arch bridge",822:"steel drum",823:"stethoscope",824:"stole",825:"stone wall",826:"stopwatch, stop watch",827:"stove",828:"strainer",829:"streetcar, tram, tramcar, trolley, trolley car",830:"stretcher",831:"studio couch, day bed",832:"stupa, tope",833:"submarine, pigboat, sub, U-boat",834:"suit, suit of clothes",835:"sundial",836:"sunglass",837:"sunglasses, dark glasses, shades",838:"sunscreen, sunblock, sun blocker",839:"suspension bridge",840:"swab, swob, mop",841:"sweatshirt",842:"swimming trunks, bathing trunks",843:"swing",844:"switch, electric switch, electrical switch",845:"syringe",846:"table lamp",847:"tank, army tank, armored combat vehicle, armoured combat vehicle",848:"tape player",849:"teapot",850:"teddy, teddy bear",851:"television, television system",852:"tennis ball",853:"thatch, thatched roof",854:"theater curtain, theatre curtain",855:"thimble",856:"thresher, thrasher, threshing machine",857:"throne",858:"tile roof",859:"toaster",860:"tobacco shop, tobacconist shop, tobacconist",861:"toilet seat",862:"torch",863:"totem pole",864:"tow truck, tow car, wrecker",865:"toyshop",866:"tractor",867:"trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi",868:"tray",869:"trench coat",870:"tricycle, trike, velocipede",871:"trimaran",872:"tripod",873:"triumphal arch",874:"trolleybus, trolley coach, trackless trolley",875:"trombone",876:"tub, vat",877:"turnstile",878:"typewriter keyboard",879:"umbrella",880:"unicycle, monocycle",881:"upright, upright piano",882:"vacuum, vacuum cleaner",883:"vase",884:"vault",885:"velvet",886:"vending machine",887:"vestment",888:"viaduct",889:"violin, fiddle",890:"volleyball",891:"waffle iron",892:"wall clock",893:"wallet, billfold, notecase, pocketbook",894:"wardrobe, closet, press",895:"warplane, military plane",896:"washbasin, handbasin, washbowl, lavabo, wash-hand basin",897:"washer, automatic washer, washing machine",898:"water bottle",899:"water jug",900:"water tower",901:"whiskey jug",902:"whistle",903:"wig",904:"window screen",905:"window shade",906:"Windsor tie",907:"wine bottle",908:"wing",909:"wok",910:"wooden spoon",911:"wool, woolen, woollen",912:"worm fence, snake fence, snake-rail fence, Virginia fence",913:"wreck",914:"yawl",915:"yurt",916:"web site, website, internet site, site",917:"comic book",918:"crossword puzzle, crossword",919:"street sign",920:"traffic light, traffic signal, stoplight",921:"book jacket, dust cover, dust jacket, dust wrapper",922:"menu",923:"plate",924:"guacamole",925:"consomme",926:"hot pot, hotpot",927:"trifle",928:"ice cream, icecream",929:"ice lolly, lolly, lollipop, popsicle",930:"French loaf",931:"bagel, beigel",932:"pretzel",933:"cheeseburger",934:"hotdog, hot dog, red hot",935:"mashed potato",936:"head cabbage",937:"broccoli",938:"cauliflower",939:"zucchini, courgette",940:"spaghetti squash",941:"acorn squash",942:"butternut squash",943:"cucumber, cuke",944:"artichoke, globe artichoke",945:"bell pepper",946:"cardoon",947:"mushroom",948:"Granny Smith",949:"strawberry",950:"orange",951:"lemon",952:"fig",953:"pineapple, ananas",954:"banana",955:"jackfruit, jak, jack",956:"custard apple",957:"pomegranate",958:"hay",959:"carbonara",960:"chocolate sauce, chocolate syrup",961:"dough",962:"meat loaf, meatloaf",963:"pizza, pizza pie",964:"potpie",965:"burrito",966:"red wine",967:"espresso",968:"cup",969:"eggnog",970:"alp",971:"bubble",972:"cliff, drop, drop-off",973:"coral reef",974:"geyser",975:"lakeside, lakeshore",976:"promontory, headland, head, foreland",977:"sandbar, sand bar",978:"seashore, coast, seacoast, sea-coast",979:"valley, vale",980:"volcano",981:"ballplayer, baseball player",982:"groom, bridegroom",983:"scuba diver",984:"rapeseed",985:"daisy",986:"yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum",987:"corn",988:"acorn",989:"hip, rose hip, rosehip",990:"buckeye, horse chestnut, conker",991:"coral fungus",992:"agaric",993:"gyromitra",994:"stinkhorn, carrion fungus",995:"earthstar",996:"hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa",997:"bolete",998:"ear, spike, capitulum",999:"toilet tissue, toilet paper, bathroom tissue"},
1s={"1.00":"module_apply_default/MobilenetV1/Logits/global_pool","2.00":"module_apply_default/MobilenetV2/Logits/AvgPool"},u={"1.00":{.25:"https://tfhub.dev/google/imagenet/mobilenet_v1_025_224/classification/1","0.50":"https://tfhub.dev/google/imagenet/mobilenet_v1_050_224/classification/1",.75:"https://tfhub.dev/google/imagenet/mobilenet_v1_075_224/classification/1","1.00":"https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/classification/1"},"2.00":{"0.50":"https://tfhub.dev/google/imagenet/mobilenet_v2_050_224/classification/2",.75:"https://tfhub.dev/google/imagenet/mobilenet_v2_075_224/classification/2","1.00":"https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2"}};function c(e,t){return void 0===e&&(e=1),void 0===t&&(t=1),i(this,void 0,void 0,function(){var n,i,a;return o(this,function(o){switch(o.label){case 0:if(null==r)throw new Error("Cannot find TensorFlow.js. If you are using a <script> tag, please also include @tensorflow/tfjs on the page before using this model.");if(n=e.toFixed(2),i=t.toFixed(2),!(n in u))throw new Error("Invalid version of MobileNet. Valid versions are: "+Object.keys(u));if(!(i in u[n]))throw new Error("MobileNet constructed with invalid alpha "+t+". Valid multipliers for this version are: "+Object.keys(u[n])+".");return[4,(a=new l(n,i)).load()];case 1:return o.sent(),[2,a]}})})}var l=function(){function e(e,t){this.version=e,this.alpha=t,this.normalizationOffset=Object(r.scalar)(127.5)}return e.prototype.load=function(){return i(this,void 0,void 0,function(){var e,t,n,i=this;return o(this,function(o){switch(o.label){case 0:return e=u[this.version][this.alpha],t=this,[4,Object(r.loadGraphModel)(e,{fromTFHub:!0})];case 1:return t.model=o.sent(),[4,(n=Object(r.tidy)(function(){return i.model.predict(Object(r.zeros)([1,224,224,3]))})).data()];case 2:return o.sent(),n.dispose(),[2]}})})},e.prototype.infer=function(e,t){var n=this;return void 0===t&&(t=!1),Object(r.tidy)(function(){e instanceof r.Tensor||(e=r.browser.fromPixels(e));var i=e.toFloat().sub(n.normalizationOffset).div(n.normalizationOffset),o=i;224===e.shape[0]&&224===e.shape[1]||(o=r.image.resizeBilinear(i,[224,224],!0));var a,u=o.reshape([-1,224,224,3]);if(t){var c=s[n.version];a=n.model.execute(u,c).squeeze([1,2])}else a=n.model.predict(u).slice([0,1],[-1,1e3]);return a})},e.prototype.classify=function(e,t){return void 0===t&&(t=3),i(this,void 0,void 0,function(){var n,r;return o(this,function(i){switch(i.label){case 0:return[4,f(n=this.infer(e),t)];case 1:return r=i.sent(),n.dispose(),[2,r]}})})},e}();function f(e,t){return i(this,void 0,void 0,function(){var n,r,i,s,u,c,l;return o(this,function(o){switch(o.label){case 0:return[4,(n=e.softmax()).data()];case 1:for(r=o.sent(),n.dispose(),i=[],l=0;l<r.length;l++)i.push({value:r[l],index:l});for(i.sort(function(e,t){return t.value-e.value}),s=new Float32Array(t),u=new Int32Array(t),l=0;l<t;l++)s[l]=i[l].value,u[l]=i[l].index;for(c=[],l=0;l<u.length;l++)c.push({className:a[u[l]],probability:s[l]});return[2,c]}})})}},function(e,t,n){"use strict";n.r(t),n.d(t,"load",function(){return c}),n.d(t,"ObjectDetection",function(){return l}),n.d(t,"version",function(){return s});var r=n(9);function i(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function o(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var a={1:{name:"/m/01g317",id:1,displayName:"person"},2:{name:"/m/0199g",id:2,displayName:"bicycle"}
1,3:{name:"/m/0k4j",id:3,displayName:"car"},4:{name:"/m/04_sv",id:4,displayName:"motorcycle"},5:{name:"/m/05czz6l",id:5,displayName:"airplane"},6:{name:"/m/01bjv",id:6,displayName:"bus"},7:{name:"/m/07jdr",id:7,displayName:"train"},8:{name:"/m/07r04",id:8,displayName:"truck"},9:{name:"/m/019jd",id:9,displayName:"boat"},10:{name:"/m/015qff",id:10,displayName:"traffic light"},11:{name:"/m/01pns0",id:11,displayName:"fire hydrant"},13:{name:"/m/02pv19",id:13,displayName:"stop sign"},14:{name:"/m/015qbp",id:14,displayName:"parking meter"},15:{name:"/m/0cvnqh",id:15,displayName:"bench"},16:{name:"/m/015p6",id:16,displayName:"bird"},17:{name:"/m/01yrx",id:17,displayName:"cat"},18:{name:"/m/0bt9lr",id:18,displayName:"dog"},19:{name:"/m/03k3r",id:19,displayName:"horse"},20:{name:"/m/07bgp",id:20,displayName:"sheep"},21:{name:"/m/01xq0k1",id:21,displayName:"cow"},22:{name:"/m/0bwd_0j",id:22,displayName:"elephant"},23:{name:"/m/01dws",id:23,displayName:"bear"},24:{name:"/m/0898b",id:24,displayName:"zebra"},25:{name:"/m/03bk1",id:25,displayName:"giraffe"},27:{name:"/m/01940j",id:27,displayName:"backpack"},28:{name:"/m/0hnnb",id:28,displayName:"umbrella"},31:{name:"/m/080hkjn",id:31,displayName:"handbag"},32:{name:"/m/01rkbr",id:32,displayName:"tie"},33:{name:"/m/01s55n",id:33,displayName:"suitcase"},34:{name:"/m/02wmf",id:34,displayName:"frisbee"},35:{name:"/m/071p9",id:35,displayName:"skis"},36:{name:"/m/06__v",id:36,displayName:"snowboard"},37:{name:"/m/018xm",id:37,displayName:"sports ball"},38:{name:"/m/02zt3",id:38,displayName:"kite"},39:{name:"/m/03g8mr",id:39,displayName:"baseball bat"},40:{name:"/m/03grzl",id:40,displayName:"baseball glove"},41:{name:"/m/06_fw",id:41,displayName:"skateboard"},42:{name:"/m/019w40",id:42,displayName:"surfboard"},43:{name:"/m/0dv9c",id:43,displayName:"tennis racket"},44:{name:"/m/04dr76w",id:44,displayName:"bottle"},46:{name:"/m/09tvcd",id:46,displayName:"wine glass"},47:{name:"/m/08gqpm",id:47,displayName:"cup"},48:{name:"/m/0dt3t",id:48,displayName:"fork"},49:{name:"/m/04ctx",id:49,displayName:"knife"},50:{name:"/m/0cmx8",id:50,displayName:"spoon"},51:{name:"/m/04kkgm",id:51,displayName:"bowl"},52:{name:"/m/09qck",id:52,displayName:"banana"},53:{name:"/m/014j1m",id:53,displayName:"apple"},54:{name:"/m/0l515",id:54,displayName:"sandwich"},55:{name:"/m/0cyhj_",id:55,displayName:"orange"},56:{name:"/m/0hkxq",id:56,displayName:"broccoli"},57:{name:"/m/0fj52s",id:57,displayName:"carrot"},58:{name:"/m/01b9xk",id:58,displayName:"hot dog"},59:{name:"/m/0663v",id:59,displayName:"pizza"},60:{name:"/m/0jy4k",id:60,displayName:"donut"},61:{name:"/m/0fszt",id:61,displayName:"cake"},62:{name:"/m/01mzpv",id:62,displayName:"chair"}
1,63:{name:"/m/02crq1",id:63,displayName:"couch"},64:{name:"/m/03fp41",id:64,displayName:"potted plant"},65:{name:"/m/03ssj5",id:65,displayName:"bed"},67:{name:"/m/04bcr3",id:67,displayName:"dining table"},70:{name:"/m/09g1w",id:70,displayName:"toilet"},72:{name:"/m/07c52",id:72,displayName:"tv"},73:{name:"/m/01c648",id:73,displayName:"laptop"},74:{name:"/m/020lf",id:74,displayName:"mouse"},75:{name:"/m/0qjjc",id:75,displayName:"remote"},76:{name:"/m/01m2v",id:76,displayName:"keyboard"},77:{name:"/m/050k8",id:77,displayName:"cell phone"},78:{name:"/m/0fx9l",id:78,displayName:"microwave"},79:{name:"/m/029bxz",id:79,displayName:"oven"},80:{name:"/m/01k6s3",id:80,displayName:"toaster"},81:{name:"/m/0130jx",id:81,displayName:"sink"},82:{name:"/m/040b_t",id:82,displayName:"refrigerator"},84:{name:"/m/0bt_c3",id:84,displayName:"book"},85:{name:"/m/01x3z",id:85,displayName:"clock"},86:{name:"/m/02s195",id:86,displayName:"vase"},87:{name:"/m/01lsmm",id:87,displayName:"scissors"},88:{name:"/m/0kmg4",id:88,displayName:"teddy bear"},89:{name:"/m/03wvsk",id:89,displayName:"hair drier"},90:{name:"/m/012xff",id:90,displayName:"toothbrush"}},s="0.1.1",u="https://storage.googleapis.com/tfjs-models/savedmodel/";function c(e){return void 0===e&&(e="lite_mobilenet_v2"),i(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:if(null==r)throw new Error("Cannot find TensorFlow.js. If you are using a <script> tag, please also include @tensorflow/tfjs on the page before using this model.");if(-1===["mobilenet_v1","mobilenet_v2","lite_mobilenet_v2"].indexOf(e))throw new Error("ObjectDetection constructed with invalid base model "+e+". Valid names are 'mobilenet_v1', 'mobilenet_v2' and 'lite_mobilenet_v2'.");return[4,(t=new l(e)).load()];case 1:return n.sent(),[2,t]}})})}var l=function(){function e(e){this.modelPath=""+u+this.getPrefix(e)+"/model.json"}return e.prototype.getPrefix=function(e){return"lite_mobilenet_v2"===e?"ssd"+e:"ssd_"+e},e.prototype.load=function(){return i(this,void 0,void 0,function(){var e,t,n=this;return o(this,function(a){switch(a.label){case 0:return e=this,[4,Object(r.loadGraphModel)(this.modelPath)];case 1:return e.model=a.sent(),[4,this.model.executeAsync(Object(r.zeros)([1,300,300,3]))];case 2:return(t=a.sent()).map(function(e){return i(n,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,e.data()];case 1:return[2,t.sent()]}})})}),t.map(function(e){return i(n,void 0,void 0,function(){return o(this,function(t){return[2,e.dispose()]})})}),[2]}})})},e.prototype.infer=function(e,t){return i(this,void 0,void 0,function(){var n,i,a,s,u,c,l,f,h,d,p,m;return o(this,function(o){switch(o.label){case 0:return n=Object(r.tidy)(function(){return e instanceof r.Tensor||(e=r.browser.fromPixels(e)),e.expandDims(0)}),i=n.shape[1],a=n.shape[2],[4,this.model.executeAsync(n)];case 1:return s=o.sent(),u=s[0].dataSync(),c=s[1].dataSync(),n.dispose(),Object(r.dispose)(s),l=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(this.calculateMaxScores(u,s[0].shape[1],s[0].shape[2]),2),f=l[0],h=l[1],d=Object(r.getBackend)(),Object(r.setBackend)("cpu"),p=Object(r.tidy)(function(){var e=Object(r.tensor2d)(c,[s[1].shape[1],s[1].shape[3]]);return r.image.nonMaxSuppression(e,f,t,.5,.5)}),m=p.dataSync(),p.dispose(),Object(r.setBackend)(d),[2,this.buildDetectedObjects(a,i,c,f,m,h)]}})})},e.prototype.buildDetectedObjects=function(e,t,n,r,i,o){for(var s=i.length,u=[],c=0;c<s;c++){for(var l=[],f=0;f<4;f++)l[f]=n[4*i[c]+f];var h=l[0]*t,d=l[1]*e,p=l[2]*t,m=l[3]*e;l[0]=d,l[1]=h,l[2]=m-d,l[3]=p-h,u.push({bbox:l,class:a[o[i[c]]+1].displayName,score:r[i[c]]})}return u},e.prototype.calculateMaxScores=function(e,t,n){for(var r=[],i=[],o=0;o<t;o++){for(var a=Number.MIN_VALUE,s=-1,u=0;u<n;u++)e[o*n+u]>a&&(a=e[o*n+u],s=u);r[o]=a,i[o]=s}return[r,i]},e.prototype.detect=function(e,t){return void 0===t&&(t=20),i(this,void 0,void 0,function(){return o(this,function(n){return[2,this.infer(e,t)]})})},e.prototype.dispose=function(){this.model&&this.model.dispose()},e}()},function(e,t,n){var r;window,e.exports=(r=n(9),function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
vendor: 5,010 bytes, line 1
1),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=46)}([function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(32)("wks"),i=n(33),o=n(0).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(8),i=n(19);e.exports=n(10)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports={}},function(e,t,n){var r=n(0),i=n(2),o=n(7),a=n(4),s=n(13),u=function e(t,n,u){var c,l,f,h=t&e.F,d=t&e.G,p=t&e.S,m=t&e.P,v=t&e.B,g=t&e.W,y=d?i:i[n]||(i[n]={}),b=y.prototype,w=d?r:p?r[n]:(r[n]||{}).prototype;for(c in d&&(u=n),u)(l=!h&&w&&void 0!==w[c])&&s(y,c)||(f=l?w[c]:u[c],y[c]=d&&"function"!=typeof w[c]?u[c]:v&&l?o(f,r):g&&w[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):m&&"function"==typeof f?o(Function.call,f):f,m&&((y.virtual||(y.virtual={}))[c]=f,t&e.R&&b&&!b[c]&&a(b,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(12);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(3),i=n(54),o=n(55),a=Object.defineProperty;t.f=n(10)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(31)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";var r=n(53)(!0);n(30)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports=!0},function(e,t,n){var r=n(9),i=n(0).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(62),i=n(16);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(15),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(32)("keys"),i=n(33);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(8).f,i=n(13),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){n(66);for(var r=n(0),i=n(4),o=n(5),a=n(1)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<s.length;u++){var c=s[u],l=r[c],f=l&&l.prototype;f&&!f[a]&&i(f,a,c),o[c]=o.Array}},function(e,t,n){var r=n(14),i=n(1)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}
vendor: 4,511 bytes, line 1
1(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(25),i=n(1)("iterator"),o=n(5);e.exports=n(2).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(12);function i(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},function(e,t,n){e.exports=n(48)},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(50),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(e){return function(){var t=e.apply(this,arguments);return new o.default(function(e,n){return function r(i,a){try{var s=t[i](a),u=s.value}catch(e){return void n(e)}if(!s.done)return o.default.resolve(u).then(function(e){r("next",e)},function(e){r("throw",e)});e(u)}("next")})}}},function(e,t,n){"use strict";var r=n(17),i=n(6),o=n(56),a=n(4),s=n(5),u=n(57),c=n(23),l=n(65),f=n(1)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,p,m,v,g){u(n,t,p);var y,b,w,x=function(e){if(!h&&e in E)return E[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},_=t+" Iterator",k="values"==m,S=!1,E=e.prototype,C=E[f]||E["@@iterator"]||m&&E[m],N=C||x(m),O=m?k?x("entries"):N:void 0,A="Array"==t&&E.entries||C;if(A&&(w=l(A.call(new e)))!==Object.prototype&&w.next&&(c(w,_,!0),r||"function"==typeof w[f]||a(w,f,d)),k&&C&&"values"!==C.name&&(S=!0,N=function(){return C.call(this)}),r&&!g||!h&&!S&&E[f]||a(E,f,N),s[t]=N,s[_]=d,m)if(y={values:k?N:x("values"),keys:v?N:x("keys"),entries:O},g)for(b in y)b in E||o(E,b,y[b]);else i(i.P+i.F*(h||S),t,y);return y}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(2),i=n(0),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(17)?"pure":"global",copyright:"\xa9 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(0).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(16);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(3);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){var r=n(5),i=n(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(3),i=n(12),o=n(1)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[o])?t:i(n)}},function(e,t,n){var r,i,o,a=n(7),s=n(72),u=n(35),c=n(18),l=n(0),f=l.process,h=l.setImmediate,d=l.clearImmediate,p=l.MessageChannel,m=l.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};h&&d||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},d=function(e){delete g[e]},"process"==n(14)(f)?r=function(e){f.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:p?(o=(i=new p).port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:h,clear:d}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(3),i=n(9),o=n(27);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var r=n(1)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t){e.exports=r},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.v1_tiny_model="https://raw.githubusercontent.com/shaqian/tfjs-yolo-demo/master/dist/model/v1tiny/model.json",t.v2_tiny_model="https://raw.githubusercontent.com/shaqian/tfjs-yolo-demo/master/dist/model/v2tiny/model.json",t.v3_tiny_model="https://raw.githubusercontent.com/shaqian/tfjs-yolo-demo/master/dist/model/v3tiny/model.json",t.v3_model="https://raw.githubusercontent.com/shaqian/tfjs-yolo-demo/master/dist/model/v3/model.json",t.v1_tiny_anchors=[1.08,1.19,3.42,4.41,6.63,11.38,9.42,5.11,16.62,10.52],t.v2_tiny_anchors=[.57273,.677385,1.87446,2.06253,3.33843,5.47434,7.88282,3.52778,9.77052,9.16828],t.v3_anchors=[10,13,16,30,33,23,30,61,62,45,59,119,116,90,156,198,373,326],t.v3_tiny_anchors=[10,14,23,27,37,58,81,82,135,169,344,319],t.v3_masks={3:[[6,7,8],[3,4,5],[0,1,2]],2:[[3,4,5],[1,2,3]]}},function(e,t,n){e.exports=n(47)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,o,a,s,u,c=_(n(28)),l=_(n(29)),f=(r=(0,l.default)(c.default.mark(function e(t,n){return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=6;break}return e.next=3,g.loadGraphModel(n,t);case 3:return e.abrupt("return",e.sent);case 6:return e.next=8,g.loadLayersModel(t);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}},e,this)})),function(e,t){return r.apply(this,arguments)}),h=(i=(0,l.default)(c.default.mark(function e(t,n,r,i,o,a,s,u,l,f){var h,d;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return h=g.tidy(function(){var e=document.createElement("canvas");e.width=f,e.height=f,e.getContext("2d").drawImage(r,0,0,f,f);var t=g.browser.fromPixels(e,3);return t=t.expandDims(0).toFloat().div(g.scalar(255)),n.predict(t)}),e.next=3,(0,x.default)(t,h,u,s,l,"HTMLVideoElement"===r.constructor.name?[r.videoHeight,r.videoWidth]:[r.height,r.width],i,o,a);case 3:return d=e.sent,g.dispose(h),e.abrupt("return",d);case 6:case"end":return e.stop()}},e,this)})),function(e,t,n,r,o,a,s,u,c,l){return i.apply(this,arguments)}),d=(o=(0,l.default)(c.default.mark(function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.v1_tiny_model,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(n,r);case 2:return t=e.sent,e.abrupt("return",{predict:function(){var e=(0,l.default)(c.default.mark(function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.maxBoxes,o=void 0===i?k:i,a=r.scoreThreshold,s=void 0===a?E:a,u=r.iouThreshold,l=void 0===u?C:u,f=r.numClasses,d=void 0===f?b.default.length:f,p=r.anchors,m=void 0===p?w.v1_tiny_anchors:p,v=r.classNames,g=void 0===v?b.default:v,y=r.inputSize,x=void 0===y?S:y;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("v1tiny",t,n,o,s,l,d,m,g,x);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),dispose:function(){t.dispose(),t=null}});case 4:case"end":return e.stop()}},e,this)})),function(){return o.apply(this,arguments)}),p=(a=(0,l.default)(c.default.mark(function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.v2_tiny_model,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(n,r);case 2:return t=e.sent,e.abrupt("return",{predict:function(){var e=(0,l.default)(c.default.mark(function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.maxBoxes,o=void 0===i?k:i,a=r.scoreThreshold,s=void 0===a?E:a,u=r.iouThreshold,l=void 0===u?C:u,f=r.numClasses,d=void 0===f?y.default.length:f,p=r.anchors,m=void 0===p?w.v2_tiny_anchors:p,v=r.classNames,g=void 0===v?y.default:v,b=r.inputSize,x=void 0===b?S:b;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("v2tiny",t,n,o,s,l,d,m,g,x);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),dispose:function(){t.dispose(),t=null}});case 4:case"end":return e.stop()}},e,this)})),function(){return a.apply(this,arguments)}),m=(s=(0,l.default)(c.default.mark(function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.v3_tiny_model,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(n,r);case 2:return t=e.sent,e.abrupt("return",{predict:function(){var e=(0,l.default)(c.default.mark(function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.maxBoxes,o=void 0===i?k:i,a=r.scoreThreshold,s=void 0===a?E:a,u=r.iouThreshold,l=void 0===u?C:u,f=r.numClasses,d=void 0===f?y.default.length:f,p=r.anchors,m=void 0===p?w.v3_tiny_anchors:p,v=r.classNames,g=void 0===v?y.default:v,b=r.inputSize,x=void 0===b?S:b;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("v3tiny",t,n,o,s,l,d,m,g,x);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),dispose:function(){t.dispose(),t=null}});case 4:case"end":return e.stop()}},e,this)})),function(){return s.apply(this,arguments)}),v=(u=(0,l.default)(c.default.mark(function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.v3_model,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(n,r);case 2:return t=e.sent,e.abrupt("return",{predict:function(){var e=(0,l.default)(c.default.mark(function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.maxBoxes,o=void 0===i?k:i,a=r.scoreThreshold,s=void 0===a?E:a,u=r.iouThreshold,l=void 0===u?C:u,f=r.numClasses,d=void 0===f?y.default.length:f,p=r.anchors,m=void 0===p?w.v3_anchors:p,v=r.classNames,g=void 0===v?y.default:v,b=r.inputSize,x=void 0===b?S:b;return c.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("v3",t,n,o,s,l,d,m,g,x);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),dispose:function(){t.dispose(),t=null}});case 4:case"end":return e.stop()}},e,this)})),function(){return u.apply(this,arguments)}
1),g=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(44)),y=_(n(79)),b=_(n(80)),w=n(45),x=_(n(81));function _(e){return e&&e.__esModule?e:{default:e}}var k=20,S=416,E=.5,C=.3,N={v1tiny:d,v2tiny:p,v3tiny:m,v3:v};t.default=N},function(e,t,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(49),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=w;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",m={},v={};v[a]=function(){return this};var g=Object.getPrototypeOf,y=g&&g(g(I([])));y&&y!==r&&i.call(y,a)&&(v=y);var b=S.prototype=_.prototype=Object.create(v);k.prototype=b.constructor=S,S.constructor=k,S[u]=k.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===k||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},E(C.prototype),C.prototype[s]=function(){return this},l.AsyncIterator=C,l.async=function(e,t,n,r){var i=new C(w(e,t,n,r));return l.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},E(b),b[u]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},l.values=I,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;
vendor: 6,332 bytes, line 1
1function r(r,i){return s.type="throw",s.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),m}}}function w(e,t,n,r){var i=t&&t.prototype instanceof _?t:_,o=Object.create(i.prototype),a=new T(r||[]);return o._invoke=function(e,t,n){var r=f;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return R()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=N(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var u=x(e,t,n);if("normal"===u.type){if(r=n.done?p:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function _(){}function k(){}function S(){}function E(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function C(e){var t;this._invoke=function(n,r){function o(){return new Promise(function(t,o){!function t(n,r,o,a){var s=x(e[n],e,r);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&i.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):Promise.resolve(c).then(function(e){u.value=e,o(u)},a)}a(s.arg)}(n,r,t,o)})}return t=t?t.then(o,o):o()}}function N(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,N(e,t),"throw"===t.method))return m;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=x(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,m;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,m):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function I(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=n,t.done=!0,t};return o.next=o}}return{next:R}}function R(){return{value:n,done:!0}}}(function(){return this}()||Function("return this")())},function(e,t,n){e.exports={default:n(51),__esModule:!0}},function(e,t,n){n(52),n(11),n(24),n(69),n(77),n(78),e.exports=n(2).Promise},function(e,t){},function(e,t,n){var r=n(15),i=n(16);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},function(e,t,n){e.exports=!n(10)&&!n(31)(function(){return 7!=Object.defineProperty(n(18)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(4)},function(e,t,n){"use strict";var r=n(58),i=n(19),o=n(23),a={};n(4)(a,n(1)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(3),i=n(59),o=n(34),a=n(22)("IE_PROTO"),s=function(){},u=function(){var e,t=n(18)("iframe"),r=o.length;for(t.style.display="none",n(35).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(8),i=n(3),o=n(60);e.exports=n(10)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(61),i=n(34);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(13),i=n(20),o=n(63)(!1),a=n(22)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;
vendor: 5,903 bytes, line 1
1)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(14);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(20),i=n(21),o=n(64);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(15),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(13),i=n(36),o=n(22)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";var r=n(67),i=n(68),o=n(5),a=n(20);e.exports=n(30)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r,i,o,a,s=n(17),u=n(0),c=n(7),l=n(25),f=n(6),h=n(9),d=n(12),p=n(70),m=n(71),v=n(39),g=n(40).set,y=n(73)(),b=n(27),w=n(41),x=n(74),_=n(42),k=u.TypeError,S=u.process,E=S&&S.versions,C=E&&E.v8||"",N=u.Promise,O="process"==l(S),A=function(){},T=i=b.f,I=!!function(){try{var e=N.resolve(1),t=(e.constructor={})[n(1)("species")]=function(e){e(A,A)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(A)instanceof t&&0!==C.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(e){}}(),R=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,i=1==e._s,o=0,a=function(t){var n,o,a,s=i?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(i||(2==e._h&&P(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===t.promise?c(k("Promise-chain cycle")):(o=R(n))?o.call(n,u,c):u(n)):c(r)}catch(e){l&&!a&&l.exit(),c(e)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&D(e)})}},D=function(e){g.call(u,function(){var t,n,r,i=e._v,o=j(e);if(o&&(t=w(function(){O?S.emit("unhandledRejection",i,e):(n=u.onunhandledrejection)?n({promise:e,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=O||j(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},j=function(e){return 1!==e._h&&0===(e._a||e._c).length},P=function(e){g.call(u,function(){var t;O?S.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},z=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},L=function e(t){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw k("Promise can't be resolved itself");(n=R(t))?y(function(){var i={_w:r,_d:!1};try{n.call(t,c(e,i,1),c(z,i,1))}catch(t){z.call(i,t)}}):(r._v=t,r._s=1,M(r,!1))}catch(t){z.call({_w:r,_d:!1},t)}}};I||(N=function(e){p(this,N,"Promise","_h"),d(e),r.call(this);try{e(c(L,this,1),c(z,this,1))}catch(e){z.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(75)(N.prototype,{then:function(e,t){var n=T(v(this,N));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=c(L,e,1),this.reject=c(z,e,1)},b.f=T=function(e){return e===N||e===a?new o(e):i(e)}),f(f.G+f.W+f.F*!I,{Promise:N}),n(23)(N,"Promise"),n(76)("Promise"),a=n(2).Promise,f(f.S+f.F*!I,"Promise",{reject:function(e){var t=T(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(s||!I),"Promise",{resolve:function(e){return _(s&&this===a?N:this,e)}}),f(f.S+f.F*!(I&&n(43)(function(e){N.all(e).catch(A)})),"Promise",{all:function(e){var t=this,n=T(t),r=n.resolve,i=n.reject,o=w(function(){var n=[],o=0,a=1;m(e,!1,function(e){var s=o++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=T(t),r=n.reject,i=w(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(7),i=n(37),o=n(38),a=n(3),s=n(21),u=n(26),c={},l={};(t=e.exports=function(e,t,n,f,h){var d,p,m,v,g=h?function(){return e}:u(e),y=r(n,f,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(d=s(e.length);d>b;b++)if((v=t?y(a(p=e[b])[0],p[1]):y(e[b]))===c||v===l)return v}else for(m=g.call(e);!(p=m.next()).done;)if((v=i(m,y,p.value,t))===c||v===l)return v}).BREAK=c,t.RETURN=l},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(0),i=n(40).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(14)(a);e.exports=function(){var e,t,n,c=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(c)}}else n=function(){i.call(r,c)};else{var f=!0,h=document.createTextNode("");new o(c).observe(h,{characterData:!0}
1),n=function(){h.data=f=!f}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(0).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(4);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e,t,n){"use strict";var r=n(0),i=n(2),o=n(8),a=n(10),s=n(1)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(6),i=n(2),o=n(0),a=n(39),s=n(42);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(6),i=n(27),o=n(41);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=["person","bicycle","car","motorbike","aeroplane","bus","train","truck","boat","traffic light","fire hydrant","stop sign","parking meter","bench","bird","cat","dog","horse","sheep","cow","elephant","bear","zebra","giraffe","backpack","umbrella","handbag","tie","suitcase","frisbee","skis","snowboard","sports ball","kite","baseball bat","baseball glove","skateboard","surfboard","tennis racket","bottle","wine glass","cup","fork","knife","spoon","bowl","banana","apple","sandwich","orange","broccoli","carrot","hot dog","pizza","donut","cake","chair","sofa","pottedplant","bed","diningtable","toilet","tvmonitor","laptop","mouse","remote","keyboard","cell phone","microwave","oven","toaster","sink","refrigerator","book","clock","vase","scissors","teddy bear","hair drier","toothbrush"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=["aeroplane","bicycle","bird","boat","bottle","bus","car","cat","chair","cow","diningtable","dog","horse","motorbike","person","pottedplant","sheep","sofa","train","tvmonitor"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=f(n(82)),o=f(n(28)),a=f(n(87)),s=f(n(29)),u=(r=(0,s.default)(o.default.mark(function e(t,n,r,i,s,u,l,f,d){var p,m,v,g,y,b,w,x,_,k,S;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return p=t.indexOf("v3")>-1,m=h(p,n,r,i,u),v=(0,a.default)(m,2),g=v[0],y=v[1],b=[],w=[],x=[],_=c.argMax(y,-1),k=c.max(y,-1),e.next=9,c.image.nonMaxSuppressionAsync(g,k,l,d,f);case 9:return(S=e.sent).size&&c.tidy(function(){var e=c.gather(g,S),t=c.gather(k,S);e.split(S.size).map(function(e){b.push(e.dataSync())}),t.dataSync().map(function(e){w.push(e)}),x=_.gather(S).dataSync()}),k.dispose(),_.dispose(),S.dispose(),g.dispose(),y.dispose(),e.abrupt("return",b.map(function(e,t){var n=Math.max(0,e[0]),r=Math.max(0,e[1]),i=Math.min(u[0],e[2]),o=Math.min(u[1],e[3]);return{top:n,left:r,bottom:i,right:o,height:i-n,width:o-r,score:w[t],class:s[x[t]]}}));case 17:case"end":return e.stop()}},e,this)})),function(e,t,n,i,o,a,s,u,c){return r.apply(this,arguments)}),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(44)),l=n(45);function f(e){return e&&e.__esModule?e:{default:e}}function h(e,t,n,r,i){return c.tidy(function(){var o=1,s=void 0,u=void 0;e?(o=t.length,u=l.v3_masks[o],s=t[0].shape.slice(1,3).map(function(e){return 32*e})):s=t.shape.slice(1,3);for(var f=c.tensor1d(n).reshape([-1,2]),h=[],p=[],m=0;m<o;m++){var v=d(e,e?t[m]:t,e?f.gather(c.tensor1d(u[m],"int32")):f,r,s,i),g=(0,a.default)(v,2),y=g[0],b=g[1];h.push(y),p.push(b)}return[h=c.concat(h),p=c.concat(p)]})}function d(e,t,n,r,o,s){var u=function(e,t,n,r,i){var o=n.shape[0],s=c.reshape(n,[1,1,o,2]),u=t.shape.slice(1,3),l=c.tile(c.reshape(c.range(0,u[0]),[-1,1,1,1]),[1,u[1],1,1]),f=c.tile(c.reshape(c.range(0,u[1]),[1,-1,1,1]),[u[0],1,1,1]),h=c.concat([f,l],3).cast(t.dtype);t=t.reshape([u[0],u[1],o,r+5]);var d=c.split(t,[2,2,1,r],3),p=(0,a.default)(d,4),m=p[0],v=p[1],g=p[2],y=p[3],b=c.div(c.add(c.sigmoid(m),h),u.reverse()),w=c.div(c.mul(c.exp(v),s),i.reverse()),x=c.sigmoid(g),_=void 0;return _=e?c.sigmoid(y):c.softmax(y),[b,w,x,_]}(e,t,n,r,o),l=(0,a.default)(u,4),f=l[0],h=l[1],d=l[2],p=l[3],m=function(e,t,n){var r=c.concat(c.split(e,2,3).reverse(),3),o=c.concat(c.split(t,2,3).reverse(),3),a=c.mul(c.sub(r,c.div(o,2)),n),s=c.mul(c.add(r,c.div(o,2)),n);return c.concat([].concat((0,i.default)(c.split(a,2,3)),(0,i.default)(c.split(s,2,3))),3)}(f,h,s);m=m.reshape([-1,4]);var v=c.mul(d,p);return[m,v=c.reshape(v,[-1,r])]}t.default=u},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(83),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,o.default)(e)}},function(e,t,n){e.exports={default:n(84),__esModule:!0}},function(e,t,n){n(11),n(85),e.exports=n(2).Array.from},function(e,t,n){"use strict";var r=n(7),i=n(6),o=n(36),a=n(37),s=n(38),u=n(21),c=n(86),l=n(26);i(i.S+i.F*!n(43)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,i,f,h=o(e),d="function"==typeof this?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,v=void 0!==m,g=0,y=l(h);if(v&&(m=r(m,p>2?arguments[2]:void 0,2)),null==y||d==Array&&s(y))for(n=new d(t=u(h.length));t>g;g++)c(n,g,v?m(h[g],g):h[g]);else for(f=y.call(h),n=new d;!(i=f.next()).done;g++)c(n,g,v?a(f,m,[i.value,g],!0):i.value);return n.length=g,n}})},function(e,t,n){"use strict";var r=n(8),i=n(19);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){"use strict";t.__esModule=!0;var r=o(n(88)),i=o(n(91));
1function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if(Array.isArray(e))return e;if((0,r.default)(Object(e)))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var s,u=(0,i.default)(e);!(r=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){e.exports={default:n(89),__esModule:!0}},function(e,t,n){n(24),n(11),e.exports=n(90)},function(e,t,n){var r=n(25),i=n(1)("iterator"),o=n(5);e.exports=n(2).isIterable=function(e){var t=Object(e);return void 0!==t[i]||"@@iterator"in t||o.hasOwnProperty(r(t))}},function(e,t,n){e.exports={default:n(92),__esModule:!0}},function(e,t,n){n(24),n(11),e.exports=n(93)},function(e,t,n){var r=n(3),i=n(26);e.exports=n(2).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}}]))},function(e,t,n){(function(t){var n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Null]",a="[object Proxy]",s="[object Undefined]",u="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=u||c||Function("return this")(),f=Object.prototype,h=f.hasOwnProperty,d=f.toString,p=l.Symbol,m=p?p.toStringTag:void 0;function v(e){return null==e?void 0===e?s:o:m&&m in Object(e)?function(e){var t=h.call(e,m),n=e[m];try{e[m]=void 0;var r=!0}catch(o){}var i=d.call(e);r&&(t?e[m]=n:delete e[m]);return i}(e):function(e){return d.call(e)}(e)}e.exports=function(e){if(!function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}(e))return!1;var t=v(e);return t==r||t==i||t==n||t==a}}).call(this,n(17))},function(e,t){e.exports=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}},function(e,t,n){"use strict";t.__esModule=!0;var r=o(n(2)),i=o(n(232));function o(e){return e&&e.__esModule?e:{default:e}}t.default=r.default.createContext||i.default,e.exports=t.default},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.d(t,"a",function(){return r})},,,function(e,t,n){"use strict";var r=n(76),i="function"===typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,c=i?Symbol.for("react.profiler"):60114,l=i?Symbol.for("react.provider"):60109,f=i?Symbol.for("react.context"):60110,h=i?Symbol.for("react.concurrent_mode"):60111,d=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,m=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116,g="function"===typeof Symbol&&Symbol.iterator;function y(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);
vendor: 20,647 bytes, line 1
1!function(e,t,n,r,i,o,a,s){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,a,s],c=0;(e=Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w={};function x(e,t,n){this.props=e,this.context=t,this.refs=w,this.updater=n||b}function _(){}function k(e,t,n){this.props=e,this.context=t,this.refs=w,this.updater=n||b}x.prototype.isReactComponent={},x.prototype.setState=function(e,t){"object"!==typeof e&&"function"!==typeof e&&null!=e&&y("85"),this.updater.enqueueSetState(this,e,t,"setState")},x.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=x.prototype;var S=k.prototype=new _;S.constructor=k,r(S,x.prototype),S.isPureReactComponent=!0;var E={current:null},C={current:null},N=Object.prototype.hasOwnProperty,O={key:!0,ref:!0,__self:!0,__source:!0};function A(e,t,n){var r=void 0,i={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)N.call(t,r)&&!O.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];i.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===i[r]&&(i[r]=u[r]);return{$$typeof:o,type:e,key:a,ref:s,props:i,_owner:C.current}}function T(e){return"object"===typeof e&&null!==e&&e.$$typeof===o}var I=/\/+/g,R=[];function M(e,t,n,r){if(R.length){var i=R.pop();return i.result=e,i.keyPrefix=t,i.func=n,i.context=r,i.count=0,i}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function D(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>R.length&&R.push(e)}function j(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var u=!1;if(null===t)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case o:case a:u=!0}}if(u)return r(i,t,""===n?"."+P(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c<t.length;c++){var l=n+P(s=t[c],c);u+=e(s,l,r,i)}else if(l=null===t||"object"!==typeof t?null:"function"===typeof(l=g&&t[g]||t["@@iterator"])?l:null,"function"===typeof l)for(t=l.call(t),c=0;!(s=t.next()).done;)u+=e(s=s.value,l=n+P(s,c++),r,i);else"object"===s&&y("31","[object Object]"===(r=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":r,"");return u}(e,"",t,n)}function P(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function z(e,t){e.func.call(e.context,t,e.count++)}function L(e,t,n){var r=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?B(e,r,n,function(e){return e}):null!=e&&(T(e)&&(e=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,i+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(I,"$&/")+"/")+n)),r.push(e))}function B(e,t,n,r,i){var o="";null!=n&&(o=(""+n).replace(I,"$&/")+"/"),j(e,L,t=M(t,o,r,i)),D(t)}function F(){var e=E.current;return null===e&&y("321"),e}var U={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return B(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;j(e,z,t=M(null,null,t,n)),D(t)},count:function(e){return j(e,function(){return null},null)},toArray:function(e){var t=[];return B(e,t,null,function(e){return e}),t},only:function(e){return T(e)||y("143"),e}},createRef:function(){return{current:null}},Component:x,PureComponent:k,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:l,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:d,render:e}},lazy:function(e){return{$$typeof:v,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:m,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return F().useCallback(e,t)},useContext:function(e,t){return F().useContext(e,t)},useEffect:function(e,t){return F().useEffect(e,t)},useImperativeHandle:function(e,t,n){return F().useImperativeHandle(e,t,n)},useDebugValue:function(){},useLayoutEffect:function(e,t){return F().useLayoutEffect(e,t)},useMemo:function(e,t){return F().useMemo(e,t)},useReducer:function(e,t,n){return F().useReducer(e,t,n)},useRef:function(e){return F().useRef(e)},useState:function(e){return F().useState(e)},Fragment:s,StrictMode:u,Suspense:p,createElement:A,cloneElement:function(e,t,n){(null===e||void 0===e)&&y("267",e);var i=void 0,a=r({},e.props),s=e.key,u=e.ref,c=e._owner;if(null!=t){void 0!==t.ref&&(u=t.ref,c=C.current),void 0!==t.key&&(s=""+t.key);var l=void 0;for(i in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)N.call(t,i)&&!O.hasOwnProperty(i)&&(a[i]=void 0===t[i]&&void 0!==l?l[i]:t[i])}if(1===(i=arguments.length-2))a.children=n;else if(1<i){l=Array(i);for(var f=0;f<i;f++)l[f]=arguments[f+2];a.children=l}return{$$typeof:o,type:e.type,key:s,ref:u,props:a,_owner:c}},createFactory:function(e){var t=A.bind(null,e);return t.type=e,t},isValidElement:T,version:"16.8.6",unstable_ConcurrentMode:h,unstable_Profiler:c,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:E,ReactCurrentOwner:C,assign:r}},W={default:U},V=W&&U||W;e.exports=V.default||V},function(e,t,n){"use strict";var r=n(2),i=n(76),o=n(132);function a(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);!function(e,t,n,r,i,o,a,s){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,a,s],c=0;(e=Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}r||a("227");var s=!1,u=null,c=!1,l=null,f={onError:function(e){s=!0,u=e}};function h(e,t,n,r,i,o,a,c,l){s=!1,u=null,function(e,t,n,r,i,o,a,s,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(l){this.onError(l)}}.apply(f,arguments)}var d=null,p={};function m(){if(d)for(var e in p){var t=p[e],n=d.indexOf(e);if(-1<n||a("96",e),!g[n])for(var r in t.extractEvents||a("97",e),g[n]=t,n=t.eventTypes){var i=void 0,o=n[r],s=t,u=r;y.hasOwnProperty(u)&&a("99",u),y[u]=o;var c=o.phasedRegistrationNames;if(c){for(i in c)c.hasOwnProperty(i)&&v(c[i],s,u);i=!0}else o.registrationName?(v(o.registrationName,s,u),i=!0):i=!1;i||a("98",r,e)}}}function v(e,t,n){b[e]&&a("100",e),b[e]=t,w[e]=t.eventTypes[n].dependencies}var g=[],y={},b={},w={},x=null,_=null,k=null;function S(e,t,n){var r=e.type||"unknown-event";e.currentTarget=k(n),function(e,t,n,r,i,o,f,d,p){if(h.apply(this,arguments),s){if(s){var m=u;s=!1,u=null}else a("198"),m=void 0;c||(c=!0,l=m)}}(r,t,void 0,e),e.currentTarget=null}function E(e,t){return null==t&&a("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function C(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var N=null;function O(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)S(e,t[r],n[r]);else t&&S(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}var A={injectEventPluginOrder:function(e){d&&a("101"),d=Array.prototype.slice.call(e),m()},injectEventPluginsByName:function(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];p.hasOwnProperty(t)&&p[t]===r||(p[t]&&a("102",t),p[t]=r,n=!0)}n&&m()}};function T(e,t){var n=e.stateNode;if(!n)return null;var r=x(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}return e?null:(n&&"function"!==typeof n&&a("231",t,typeof n),n)}function I(e){if(null!==e&&(N=E(N,e)),e=N,N=null,e&&(C(e,O),N&&a("95"),c))throw e=l,c=!1,l=null,e}var R=Math.random().toString(36).slice(2),M="__reactInternalInstance$"+R,D="__reactEventHandlers$"+R;function j(e){if(e[M])return e[M];for(;!e[M];){if(!e.parentNode)return null;e=e.parentNode}return 5===(e=e[M]).tag||6===e.tag?e:null}function P(e){return!(e=e[M])||5!==e.tag&&6!==e.tag?null:e}function z(e){if(5===e.tag||6===e.tag)return e.stateNode;a("33")}function L(e){return e[D]||null}function B(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function F(e,t,n){(t=T(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=E(n._dispatchListeners,t),n._dispatchInstances=E(n._dispatchInstances,e))}function U(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=B(t);for(t=n.length;0<t--;)F(n[t],"captured",e);for(t=0;t<n.length;t++)F(n[t],"bubbled",e)}}function W(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=T(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=E(n._dispatchListeners,t),n._dispatchInstances=E(n._dispatchInstances,e))}function V(e){e&&e.dispatchConfig.registrationName&&W(e._targetInst,null,e)}function q(e){C(e,U)}var H=!("undefined"===typeof window||!window.document||!window.document.createElement);function G(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var K={animationend:G("Animation","AnimationEnd"),animationiteration:G("Animation","AnimationIteration"),animationstart:G("Animation","AnimationStart"),transitionend:G("Transition","TransitionEnd")},$={},X={};function Y(e){if($[e])return $[e];if(!K[e])return e;var t,n=K[e];for(t in n)if(n.hasOwnProperty(t)&&t in X)return $[e]=n[t];return e}H&&(X=document.createElement("div").style,"AnimationEvent"in window||(delete K.animationend.animation,delete K.animationiteration.animation,delete K.animationstart.animation),"TransitionEvent"in window||delete K.transitionend.transition);var J=Y("animationend"),Z=Y("animationiteration"),Q=Y("animationstart"),ee=Y("transitionend"),te="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ne=null,re=null,ie=null;function oe(){if(ie)return ie;var e,t,n=re,r=n.length,i="value"in ne?ne.value:ne.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return ie=i.slice(e,1<t?1-t:void 0)}function ae(){return!0}function se(){return!1}function ue(e,t,n,r){for(var i in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(i)&&((t=e[i])?this[i]=t(n):"target"===i?this.target=r:this[i]=n[i]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?ae:se,this.isPropagationStopped=se,this}function ce(e,t,n,r){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,e,t,n,r),i}return new this(e,t,n,r)}function le(e){e instanceof this||a("279"),e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function fe(e){e.eventPool=[],e.getPooled=ce,e.release=le}i(ue.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ae)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ae)},persist:function(){this.isPersistent=ae},isPersistent:se,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=se,this._dispatchInstances=this._dispatchListeners=null}}),ue.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},ue.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return i(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=i({},r.Interface,e),n.extend=r.extend,fe(n),n},fe(ue);var he=ue.extend({data:null}),de=ue.extend({data:null}),pe=[9,13,27,32],me=H&&"CompositionEvent"in window,ve=null;H&&"documentMode"in document&&(ve=document.documentMode);var ge=H&&"TextEvent"in window&&!ve,ye=H&&(!me||ve&&8<ve&&11>=ve),be=String.fromCharCode(32),we={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},xe=!1;function _e(e,t){switch(e){case"keyup":return-1!==pe.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function ke(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Se=!1;var Ee={eventTypes:we,extractEvents:function(e,t,n,r){var i=void 0,o=void 0;if(me)e:{switch(e){case"compositionstart":i=we.compositionStart;break e;case"compositionend":i=we.compositionEnd;break e;case"compositionupdate":i=we.compositionUpdate;break e}i=void 0}else Se?_e(e,n)&&(i=we.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=we.compositionStart);return i?(ye&&"ko"!==n.locale&&(Se||i!==we.compositionStart?i===we.compositionEnd&&Se&&(o=oe()):(re="value"in(ne=r)?ne.value:ne.textContent,Se=!0)),i=he.getPooled(i,t,n,r),o?i.data=o:null!==(o=ke(n))&&(i.data=o),q(i),o=i):o=null,(e=ge?function(e,t){switch(e){case"compositionend":return ke(t);case"keypress":return 32!==t.which?null:(xe=!0,be);case"textInput":return(e=t.data)===be&&xe?null:e;default:return null}}(e,n):function(e,t){if(Se)return"compositionend"===e||!me&&_e(e,t)?(e=oe(),ie=re=ne=null,Se=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ye&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=de.getPooled(we.beforeInput,t,n,r)).data=e,q(t)):t=null,null===o?t:null===t?o:[o,t]}},Ce=null,Ne=null,Oe=null;function Ae(e){if(e=_(e)){"function"!==typeof Ce&&a("280");var t=x(e.stateNode);Ce(e.stateNode,e.type,t)}}function Te(e){Ne?Oe?Oe.push(e):Oe=[e]:Ne=e}function Ie(){if(Ne){var e=Ne,t=Oe;if(Oe=Ne=null,Ae(e),t)for(e=0;e<t.length;e++)Ae(t[e])}}function Re(e,t){return e(t)}function Me(e,t,n){return e(t,n)}function De(){}var je=!1;function Pe(e,t){if(je)return e(t);je=!0;try{return Re(e,t)}finally{je=!1,(null!==Ne||null!==Oe)&&(De(),Ie())}}var ze={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Le(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ze[e.type]:"textarea"===t}function Be(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function Fe(e){if(!H)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"===typeof t[e]),t}function Ue(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function We(e){e._valueTracker||(e._valueTracker=function(e){var t=Ue(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Ve(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ue(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}var qe=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;qe.hasOwnProperty("ReactCurrentDispatcher")||(qe.ReactCurrentDispatcher={current:null});var He=/^(.*)[\\\/]/,Ge="function"===typeof Symbol&&Symbol.for,Ke=Ge?Symbol.for("react.element"):60103,$e=Ge?Symbol.for("react.portal"):60106,Xe=Ge?Symbol.for("react.fragment"):60107,Ye=Ge?Symbol.for("react.strict_mode"):60108,Je=Ge?Symbol.for("react.profiler"):60114,Ze=Ge?Symbol.for("react.provider"):60109,Qe=Ge?Symbol.for("react.context"):60110,et=Ge?Symbol.for("react.concurrent_mode"):60111,tt=Ge?Symbol.for("react.forward_ref"):60112,nt=Ge?Symbol.for("react.suspense"):60113,rt=Ge?Symbol.for("react.memo"):60115,it=Ge?Symbol.for("react.lazy"):60116,ot="function"===typeof Symbol&&Symbol.iterator;function at(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=ot&&e[ot]||e["@@iterator"])?e:null}function st(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case et:return"ConcurrentMode";case Xe:return"Fragment";case $e:return"Portal";case Je:return"Profiler";case Ye:return"StrictMode";case nt:return"Suspense"}if("object"===typeof e)switch(e.$$typeof){case Qe:return"Context.Consumer";case Ze:return"Context.Provider";case tt:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case rt:return st(e.type);case it:if(e=1===e._status?e._result:null)return st(e)}return null}function ut(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,i=e._debugSource,o=st(e.type);n=null,r&&(n=st(r.type)),r=o,o="",i?o=" (at "+i.fileName.replace(He,"")+":"+i.lineNumber+")":n&&(o=" (created by "+n+")"),n="\n in "+(r||"Unknown")+o}t+=n,e=e.return}while(e);return t}var ct=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,lt=Object.prototype.hasOwnProperty,ft={},ht={};function dt(e,t,n,r,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t}var pt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){pt[e]=new dt(e,0,!1,e,null)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];pt[t]=new dt(t,1,!1,e[1],null)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){pt[e]=new dt(e,2,!1,e.toLowerCase(),null)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){pt[e]=new dt(e,2,!1,e,null)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInl
1ine readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){pt[e]=new dt(e,3,!1,e.toLowerCase(),null)}),["checked","multiple","muted","selected"].forEach(function(e){pt[e]=new dt(e,3,!0,e,null)}),["capture","download"].forEach(function(e){pt[e]=new dt(e,4,!1,e,null)}),["cols","rows","size","span"].forEach(function(e){pt[e]=new dt(e,6,!1,e,null)}),["rowSpan","start"].forEach(function(e){pt[e]=new dt(e,5,!1,e.toLowerCase(),null)});var mt=/[\-:]([a-z])/g;function vt(e){return e[1].toUpperCase()}function gt(e,t,n,r){var i=pt.hasOwnProperty(t)?pt[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!lt.call(ht,e)||!lt.call(ft,e)&&(ct.test(e)?ht[e]=!0:(ft[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function yt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function bt(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function wt(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=yt(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function xt(e,t){null!=(t=t.checked)&>(e,"checked",t,!1)}function _t(e,t){xt(e,t);var n=yt(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?St(e,t.type,n):t.hasOwnProperty("defaultValue")&&St(e,t.type,yt(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function kt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function St(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(mt,vt);pt[t]=new dt(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(mt,vt);pt[t]=new dt(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(mt,vt);pt[t]=new dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),["tabIndex","crossOrigin"].forEach(function(e){pt[e]=new dt(e,1,!1,e.toLowerCase(),null)});
vendor: 6,438 bytes, line 1
1var Et={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Ct(e,t,n){return(e=ue.getPooled(Et.change,e,t,n)).type="change",Te(n),q(e),e}var Nt=null,Ot=null;function At(e){I(e)}function Tt(e){if(Ve(z(e)))return e}function It(e,t){if("change"===e)return t}var Rt=!1;function Mt(){Nt&&(Nt.detachEvent("onpropertychange",Dt),Ot=Nt=null)}function Dt(e){"value"===e.propertyName&&Tt(Ot)&&Pe(At,e=Ct(Ot,e,Be(e)))}function jt(e,t,n){"focus"===e?(Mt(),Ot=n,(Nt=t).attachEvent("onpropertychange",Dt)):"blur"===e&&Mt()}function Pt(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Tt(Ot)}function zt(e,t){if("click"===e)return Tt(t)}function Lt(e,t){if("input"===e||"change"===e)return Tt(t)}H&&(Rt=Fe("input")&&(!document.documentMode||9<document.documentMode));var Bt={eventTypes:Et,_isInputEventSupported:Rt,extractEvents:function(e,t,n,r){var i=t?z(t):window,o=void 0,a=void 0,s=i.nodeName&&i.nodeName.toLowerCase();if("select"===s||"input"===s&&"file"===i.type?o=It:Le(i)?Rt?o=Lt:(o=Pt,a=jt):(s=i.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(o=zt),o&&(o=o(e,t)))return Ct(o,n,r);a&&a(e,i,t),"blur"===e&&(e=i._wrapperState)&&e.controlled&&"number"===i.type&&St(i,"number",i.value)}},Ft=ue.extend({view:null,detail:null}),Ut={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wt(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Ut[e])&&!!t[e]}function Vt(){return Wt}var qt=0,Ht=0,Gt=!1,Kt=!1,$t=Ft.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Vt,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=qt;return qt=e.screenX,Gt?"mousemove"===e.type?e.screenX-t:0:(Gt=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Ht;return Ht=e.screenY,Kt?"mousemove"===e.type?e.screenY-t:0:(Kt=!0,0)}}),Xt=$t.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Yt={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Jt={eventTypes:Yt,extractEvents:function(e,t,n,r){var i="mouseover"===e||"pointerover"===e,o="mouseout"===e||"pointerout"===e;if(i&&(n.relatedTarget||n.fromElement)||!o&&!i)return null;if(i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window,o?(o=t,t=(t=n.relatedTarget||n.toElement)?j(t):null):o=null,o===t)return null;var a=void 0,s=void 0,u=void 0,c=void 0;"mouseout"===e||"mouseover"===e?(a=$t,s=Yt.mouseLeave,u=Yt.mouseEnter,c="mouse"):"pointerout"!==e&&"pointerover"!==e||(a=Xt,s=Yt.pointerLeave,u=Yt.pointerEnter,c="pointer");var l=null==o?i:z(o);if(i=null==t?i:z(t),(e=a.getPooled(s,o,n,r)).type=c+"leave",e.target=l,e.relatedTarget=i,(n=a.getPooled(u,t,n,r)).type=c+"enter",n.target=i,n.relatedTarget=l,r=t,o&&r)e:{for(i=r,c=0,a=t=o;a;a=B(a))c++;for(a=0,u=i;u;u=B(u))a++;for(;0<c-a;)t=B(t),c--;for(;0<a-c;)i=B(i),a--;for(;c--;){if(t===i||t===i.alternate)break e;t=B(t),i=B(i)}t=null}else t=null;for(i=t,t=[];o&&o!==i&&(null===(c=o.alternate)||c!==i);)t.push(o),o=B(o);for(o=[];r&&r!==i&&(null===(c=r.alternate)||c!==i);)o.push(r),r=B(r);for(r=0;r<t.length;r++)W(t[r],"bubbled",e);for(r=o.length;0<r--;)W(o[r],"captured",n);return[e,n]}};function Zt(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t}var Qt=Object.prototype.hasOwnProperty;function en(e,t){if(Zt(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Qt.call(t,n[r])||!Zt(e[n[r]],t[n[r]]))return!1;return!0}function tn(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!==(2&t.effectTag))return 1;for(;t.return;)if(0!==(2&(t=t.return).effectTag))return 1}return 3===t.tag?2:3}function nn(e){2!==tn(e)&&a("188")}function rn(e){if(!(e=function(e){var t=e.alternate;if(!t)return 3===(t=tn(e))&&a("188"),1===t?null:e;for(var n=e,r=t;;){var i=n.return,o=i?i.alternate:null;if(!i||!o)break;if(i.child===o.child){for(var s=i.child;s;){if(s===n)return nn(i),e;if(s===r)return nn(i),t;s=s.sibling}a("188")}if(n.return!==r.return)n=i,r=o;else{s=!1;for(var u=i.child;u;){if(u===n){s=!0,n=i,r=o;break}if(u===r){s=!0,r=i,n=o;break}u=u.sibling}if(!s){for(u=o.child;u;){if(u===n){s=!0,n=o,r=i;break}if(u===r){s=!0,r=o,n=i;break}u=u.sibling}s||a("189")}}n.alternate!==r&&a("190")}return 3!==n.tag&&a("188"),n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}var on=ue.extend({animationName:null,elapsedTime:null,pseudoElement:null}),an=ue.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sn=Ft.extend({relatedTarget:null});function un(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var cn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ln={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},fn=Ft.extend({key:function(e){if(e.key){var t=cn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=un(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"ke
1yup"===e.type?ln[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Vt,charCode:function(e){return"keypress"===e.type?un(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?un(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),hn=$t.extend({dataTransfer:null}),dn=Ft.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Vt}),pn=ue.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),mn=$t.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),vn=[["abort","abort"],[J,"animationEnd"],[Z,"animationIteration"],[Q,"animationStart"],["canplay","canPlay"],["canplaythrough","canPlayThrough"],["drag","drag"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["gotpointercapture","gotPointerCapture"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["loadstart","loadStart"],["lostpointercapture","lostPointerCapture"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["playing","playing"],["pointermove","pointerMove"],["pointerout","pointerOut"],["pointerover","pointerOver"],["progress","progress"],["scroll","scroll"],["seeking","seeking"],["stalled","stalled"],["suspend","suspend"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchmove","touchMove"],[ee,"transitionEnd"],["waiting","waiting"],["wheel","wheel"]],gn={},yn={};function bn(e,t){var n=e[0],r="on"+((e=e[1])[0].toUpperCase()+e.slice(1));
vendor: 59,821 bytes, line 1
1t={phasedRegistrationNames:{bubbled:r,captured:r+"Capture"},dependencies:[n],isInteractive:t},gn[e]=t,yn[n]=t}[["blur","blur"],["cancel","cancel"],["click","click"],["close","close"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["auxclick","auxClick"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragstart","dragStart"],["drop","drop"],["focus","focus"],["input","input"],["invalid","invalid"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["mousedown","mouseDown"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["pointercancel","pointerCancel"],["pointerdown","pointerDown"],["pointerup","pointerUp"],["ratechange","rateChange"],["reset","reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(e){bn(e,!0)}),vn.forEach(function(e){bn(e,!1)});var wn={eventTypes:gn,isInteractiveTopLevelEventType:function(e){return void 0!==(e=yn[e])&&!0===e.isInteractive},extractEvents:function(e,t,n,r){var i=yn[e];if(!i)return null;switch(e){case"keypress":if(0===un(n))return null;case"keydown":case"keyup":e=fn;break;case"blur":case"focus":e=sn;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=$t;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=hn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=dn;break;case J:case Z:case Q:e=on;break;case ee:e=pn;break;case"scroll":e=Ft;break;case"wheel":e=mn;break;case"copy":case"cut":case"paste":e=an;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Xt;break;default:e=ue}return q(t=e.getPooled(i,t,n,r)),t}},xn=wn.isInteractiveTopLevelEventType,_n=[];function kn(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r;for(r=n;r.return;)r=r.return;if(!(r=3!==r.tag?null:r.stateNode.containerInfo))break;e.ancestors.push(n),n=j(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var i=Be(e.nativeEvent);r=e.topLevelType;for(var o=e.nativeEvent,a=null,s=0;s<g.length;s++){var u=g[s];u&&(u=u.extractEvents(r,t,o,i))&&(a=E(a,u))}I(a)}}var Sn=!0;function En(e,t){if(!t)return null;var n=(xn(e)?Nn:On).bind(null,e);t.addEventListener(e,n,!1)}function Cn(e,t){if(!t)return null;var n=(xn(e)?Nn:On).bind(null,e);t.addEventListener(e,n,!0)}function Nn(e,t){Me(On,e,t)}function On(e,t){if(Sn){var n=Be(t);if(null===(n=j(n))||"number"!==typeof n.tag||2===tn(n)||(n=null),_n.length){var r=_n.pop();r.topLevelType=e,r.nativeEvent=t,r.targetInst=n,e=r}else e={topLevelType:e,nativeEvent:t,targetInst:n,ancestors:[]};try{Pe(kn,e)}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>_n.length&&_n.push(e)}}}var An={},Tn=0,In="_reactListenersID"+(""+Math.random()).slice(2);function Rn(e){return Object.prototype.hasOwnProperty.call(e,In)||(e[In]=Tn++,An[e[In]]={}),An[e[In]]}function Mn(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Dn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jn(e,t){var n,r=Dn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Dn(r)}}function Pn(){for(var e=window,t=Mn();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Mn((e=t.contentWindow).document)}return t}function zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function Ln(e){var t=Pn(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(n.ownerDocument.documentElement,n)){if(null!==r&&zn(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=jn(n,o);var a=jn(n,r);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Bn=H&&"documentMode"in document&&11>=document.documentMode,Fn={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Un=null,Wn=null,Vn=null,qn=!1;function Hn(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return qn||null==Un||Un!==Mn(n)?null:("selectionStart"in(n=Un)&&zn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Vn&&en(Vn,n)?null:(Vn=n,(e=ue.getPooled(Fn.select,Wn,e,t)).type="select",e.target=Un,q(e),e))}var Gn={eventTypes:Fn,extractEvents:function(e,t,n,r){var i,o=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(i=!o)){e:{o=Rn(o),i=w.onSelect;for(var a=0;a<i.length;a++){var s=i[a];if(!o.hasOwnProperty(s)||!o[s]){o=!1;break e}}o=!0}i=!o}if(i)return null;switch(o=t?z(t):window,e){case"focus":(Le(o)||"true"===o.contentEditable)&&(Un=o,Wn=t,Vn=null);break;case"blur":Vn=Wn=Un=null;break;case"mousedown":qn=!0;break;case"contextmenu":case"mouseup":case"dragend":return qn=!1,Hn(n,r);case"selectionchange":if(Bn)break;case"keydown":case"keyup":return Hn(n,r)}return null}};function Kn(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,function(e){null!=e&&(t+=e)}),t}(t.children))&&(e.children=t),e}function $n(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+yt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function Xn(e,t){return null!=t.dangerouslySetInnerHTML&&a("91"),i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Yn(e,t){var n=t.value;null==n&&(n=t.defaultValue,null!=(t=t.children)&&(null!=n&&a("92"),Array.isArray(t)&&(1>=t.length||a("93"),t=t[0]),n=t),null==n&&(n="")),e._wrapperState={initialValue:yt(n)}}function Jn(e,t){var n=yt(t.value),r=yt(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Zn(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}A.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),x=L,_=P,k=z,A.injectEventPluginsByName({SimpleEventPlugin:wn,EnterLeaveEventPlugin:Jt,ChangeEventPlugin:Bt,SelectEventPlugin:Gn,BeforeInputEventPlugin:Ee});var Qn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function er(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function tr(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?er(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var nr,rr=void 0,ir=(nr=function(e,t){if(e.namespaceURI!==Qn.svg||"innerHTML"in e)e.innerHTML=t;else{for((rr=rr||document.createElement("div")).innerHTML="<svg>"+t+"</svg>",t=rr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return nr(e,t)})}:nr);function or(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ar={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},sr=["Webkit","ms","Moz","O"];function ur(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||ar.hasOwnProperty(e)&&ar[e]?(""+t).trim():t+"px"}function cr(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=ur(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(ar).forEach(function(e){sr.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ar[t]=ar[e]})});var lr=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fr(e,t){t&&(lr[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&a("137",e,""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&a("60"),"object"===typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||a("61")),null!=t.style&&"object"!==typeof t.style&&a("62",""))}function hr(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function dr(e,t){var n=Rn(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=w[t];for(var r=0;r<t.length;r++){var i=t[r];if(!n.hasOwnProperty(i)||!n[i]){switch(i){case"scroll":Cn("scroll",e);break;case"focus":case"blur":Cn("focus",e),Cn("blur",e),n.blur=!0,n.focus=!0;break;case"cancel":case"close":Fe(i)&&Cn(i,e);break;case"invalid":case"submit":case"reset":break;default:-1===te.indexOf(i)&&En(i,e)}n[i]=!0}}}function pr(){}var mr=null,vr=null;function gr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function yr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var br="function"===typeof setTimeout?setTimeout:void 0,wr="function"===typeof clearTimeout?clearTimeout:void 0,xr=o.unstable_scheduleCallback,_r=o.unstable_cancelCallback;function kr(e){for(e=e.nextSibling;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}function Sr(e){for(e=e.firstChild;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}new Set;var Er=[],Cr=-1;function Nr(e){0>Cr||(e.current=Er[Cr],Er[Cr]=null,Cr--)}function Or(e,t){Er[++Cr]=e.current,e.current=t}var Ar={},Tr={current:Ar},Ir={current:!1},Rr=Ar;function Mr(e,t){var n=e.type.contextTypes;if(!n)return Ar;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Dr(e){return null!==(e=e.childContextTypes)&&void 0!==e}function jr(e){Nr(Ir),Nr(Tr)}function Pr(e){Nr(Ir),Nr(Tr)}function zr(e,t,n){Tr.current!==Ar&&a("168"),Or(Tr,t),Or(Ir,n)}function Lr(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())o in e||a("108",st(t)||"Unknown",o);return i({},n,r)}function Br(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Ar,Rr=Tr.current,Or(Tr,t),Or(Ir,Ir.current),!0}function Fr(e,t,n){var r=e.stateNode;r||a("169"),n?(t=Lr(e,t,Rr),r.__reactInternalMemoizedMergedChildContext=t,Nr(Ir),Nr(Tr),Or(Tr,t)):Nr(Ir),Or(Ir,n)}var Ur=null,Wr=null;function Vr(e){return function(t){try{return e(t)}catch(n){}}}function qr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Hr(e,t,n,r){return new qr(e,t,n,r)}function Gr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Kr(e,t){var n=e.alternate;return null===n?((n=Hr(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,n.contextDependencies=e.contextDependencies,n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $r(e,t,n,r,i,o){var s=2;if(r=e,"function"===typeof e)Gr(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case Xe:return Xr(n.children,i,o,t);case et:return Yr(n,3|i,o,t);case Ye:return Yr(n,2|i,o,t);case Je:return(e=Hr(12,n,t,4|i)).elementType=Je,e.type=Je,e.expirationTime=o,e;case nt:return(e=Hr(13,n,t,i)).elementType=nt,e.type=nt,e.expirationTime=o,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case Ze:s=10;break e;case Qe:s=9;break e;case tt:s=11;break e;case rt:s=14;break e;case it:s=16,r=null;break e}a("130",null==e?e:typeof e,"")}return(t=Hr(s,n,t,i)).elementType=e,t.type=r,t.expirationTime=o,t}function Xr(e,t,n,r){return(e=Hr(7,e,r,t)).expirationTime=n,e}function Yr(e,t,n,r){return e=Hr(8,e,r,t),t=0===(1&t)?Ye:et,e.elementType=t,e.type=t,e.expirationTime=n,e}function Jr(e,t,n){return(e=Hr(6,e,null,t)).expirationTime=n,e}function Zr(e,t,n){return(t=Hr(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qr(e,t){e.didError=!1;var n=e.earliestPendingTime;0===n?e.earliestPendingTime=e.latestPendingTime=t:n<t?e.earliestPendingTime=t:e.latestPendingTime>t&&(e.latestPendingTime=t),ni(t,e)}function ei(e,t){e.didError=!1,e.latestPingedTime>=t&&(e.latestPingedTime=0);var n=e.earliestPendingTime,r=e.latestPendingTime;n===t?e.earliestPendingTime=r===t?e.latestPendingTime=0:r:r===t&&(e.latestPendingTime=n),n=e.earliestSuspendedTime,r=e.latestSuspendedTime,0===n?e.earliestSuspendedTime=e.latestSuspendedTime=t:n<t?e.earliestSuspendedTime=t:r>t&&(e.latestSuspendedTime=t),ni(t,e)}function ti(e,t){var n=e.earliestPendingTime;return n>t&&(t=n),(e=e.earliestSuspendedTime)>t&&(t=e),t}function ni(e,t){var n=t.earliestSuspendedTime,r=t.latestSuspendedTime,i=t.earliestPendingTime,o=t.latestPingedTime;0===(i=0!==i?i:o)&&(0===e||r<e)&&(i=r),0!==(e=i)&&n>e&&(e=n),t.nextExpirationTimeToWorkOn=i,t.expirationTime=e}function ri(e,t){if(e&&e.defaultProps)for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var ii=(new r.Component).refs;function oi(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:i({},t,n),e.memoizedState=n,null!==(r=e.updateQueue)&&0===e.expirationTime&&(r.baseState=n)}var ai={isMounted:function(e){return!!(e=e._reactInternalFiber)&&2===tn(e)},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=_s(),i=Yo(r=Xa(r,e));i.payload=t,void 0!==n&&null!==n&&(i.callback=n),Va(),Zo(e,i),Za(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=_s(),i=Yo(r=Xa(r,e));i.tag=qo,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),Va(),Zo(e,i),Za(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=_s(),r=Yo(n=Xa(n,e));r.tag=Ho,void 0!==t&&null!==t&&(r.callback=t),Va(),Zo(e,r),Za(e,n)}};function si(e,t,n,r,i,o,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!en(n,r)||!en(i,o))}function ui(e,t,n){var r=!1,i=Ar,o=t.contextType;return"object"===typeof o&&null!==o?o=Wo(o):(i=Dr(t)?Rr:Tr.current,o=(r=null!==(r=t.contextTypes)&&void 0!==r)?Mr(e,i):Ar),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ai,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function ci(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ai.enqueueReplaceState(t,t.state,null)}function li(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=ii;var o=t.contextType;"object"===typeof o&&null!==o?i.context=Wo(o):(o=Dr(t)?Rr:Tr.current,i.context=Mr(e,o)),null!==(o=e.updateQueue)&&(na(e,o,n,i,r),i.state=e.memoizedState),"function"===typeof(o=t.getDerivedStateFromProps)&&(oi(e,t,o,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ai.enqueueReplaceState(i,i.state,null),null!==(o=e.updateQueue)&&(na(e,o,n,i,r),i.state=e.memoizedState)),"function"===typeof i.componentDidMount&&(e.effectTag|=4)}var fi=Array.isArray;function hi(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){n=n._owner;var r=void 0;n&&(1!==n.tag&&a("309"),r=n.stateNode),r||a("147",e);var i=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=r.refs;t===ii&&(t=r.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}"string"!==typeof e&&a("284"),n._owner||a("290",e)}return e}function di(e,t){"textarea"!==e.type&&a("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function pi(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t,n){return(e=Kr(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function s(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=Jr(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=hi(e,t,n),r.return=e,r):((r=$r(n.type,n.key,n.props,null,e.mode,r)).ref=hi(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Zr(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,o){return null===t||7!==t.tag?((t=Xr(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=Jr(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case Ke:return(n=$r(t.type,t.key,t.props,null,e.mode,n)).ref=hi(e,null,t),n.return=e,n;case $e:return(t=Zr(t,e.mode,n)).return=e,t}if(fi(t)||at(t))return(t=Xr(t,e.mode,n,null)).return=e,t;di(e,t)}return null}function d(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==i?null:u(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case Ke:return n.key===i?n.type===Xe?f(e,t,n.props.children,r,i):c(e,t,n,r):null;case $e:return n.key===i?l(e,t,n,r):null}if(fi(n)||at(n))return null!==i?null:f(e,t,n,r,null);di(e,n)}return null}function p(e,t,n,r,i){if("string"===typeof r||"number"===typeof r)return u(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case Ke:return e=e.get(null===r.key?n:r.key)||null,r.type===Xe?f(t,e,r.props.children,i,r.key):c(t,e,r,i);case $e:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(fi(r)||at(r))return f(t,e=e.get(n)||null,r,i,null);di(t,r)}return null}function m(i,a,s,u){for(var c=null,l=null,f=a,m=a=0,v=null;null!==f&&m<s.length;m++){f.index>m?(v=f,f=null):v=f.sibling;var g=d(i,f,s[m],u);if(null===g){null===f&&(f=v);break}e&&f&&null===g.alternate&&t(i,f),a=o(g,a,m),null===l?c=g:l.sibling=g,l=g,f=v}if(m===s.length)return n(i,f),c;if(null===f){for(;m<s.length;m++)(f=h(i,s[m],u))&&(a=o(f,a,m),null===l?c=f:l.sibling=f,l=f);return c}for(f=r(i,f);m<s.length;m++)(v=p(f,i,m,s[m],u))&&(e&&null!==v.alternate&&f.delete(null===v.key?m:v.key),a=o(v,a,m),null===l?c=v:l.sibling=v,l=v);return e&&f.forEach(function(e){return t(i,e)}),c}function v(i,s,u,c){var l=at(u);"function"!==typeof l&&a("150"),null==(u=l.call(u))&&a("151");for(var f=l=null,m=s,v=s=0,g=null,y=u.next();null!==m&&!y.done;v++,y=u.next()){m.index>v?(g=m,m=null):g=m.sibling;var b=d(i,m,y.value,c);if(null===b){m||(m=g);break}e&&m&&null===b.alternate&&t(i,m),s=o(b,s,v),null===f?l=b:f.sibling=b,f=b,m=g}if(y.done)return n(i,m),l;if(null===m){for(;!y.done;v++,y=u.next())null!==(y=h(i,y.value,c))&&(s=o(y,s,v),null===f?l=y:f.sibling=y,f=y);return l}for(m=r(i,m);!y.done;v++,y=u.next())null!==(y=p(m,i,v,y.value,c))&&(e&&null!==y.alternate&&m.delete(null===y.key?v:y.key),s=o(y,s,v),null===f?l=y:f.sibling=y,f=y);return e&&m.forEach(function(e){return t(i,e)}),l}return function(e,r,o,u){var c="object"===typeof o&&null!==o&&o.type===Xe&&null===o.key;c&&(o=o.props.children);var l="object"===typeof o&&null!==o;if(l)switch(o.$$typeof){case Ke:e:{for(l=o.key,c=r;null!==c;){if(c.key===l){if(7===c.tag?o.type===Xe:c.elementType===o.type){n(e,c.sibling),(r=i(c,o.type===Xe?o.props.children:o.props)).ref=hi(e,c,o),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}o.type===Xe?((r=Xr(o.props.children,e.mode,u,o.key)).return=e,e=r):((u=$r(o.type,o.key,o.props,null,e.mode,u)).ref=hi(e,r,o),u.return=e,e=u)}return s(e);case $e:e:{for(c=o.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Zr(o,e.mode,u)).return=e,e=r}return s(e)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Jr(o,e.mode,u)).return=e,e=r),s(e);if(fi(o))return m(e,r,o,u);if(at(o))return v(e,r,o,u);if(l&&di(e,o),"undefined"===typeof o&&!c)switch(e.tag){case 1:case 0:a("152",(u=e.type).displayName||u.name||"Component")}return n(e,r)}}var mi=pi(!0),vi=pi(!1),gi={},yi={current:gi},bi={current:gi},wi={current:gi};function xi(e){return e===gi&&a("174"),e}function _i(e,t){Or(wi,t),Or(bi,e),Or(yi,gi);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:tr(null,"");break;default:t=tr(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}Nr(yi),Or(yi,t)}function ki(e){Nr(yi),Nr(bi),Nr(wi)}function Si(e){xi(wi.current);var t=xi(yi.current),n=tr(t,e.type);t!==n&&(Or(bi,e),Or(yi,n))}function Ei(e){bi.current===e&&(Nr(yi),Nr(bi))}var Ci=0,Ni=2,Oi=4,Ai=8,Ti=16,Ii=32,Ri=64,Mi=128,Di=qe.ReactCurrentDispatcher,ji=0,Pi=null,zi=null,Li=null,Bi=null,Fi=null,Ui=null,Wi=0,Vi=null,qi=0,Hi=!1,Gi=null,Ki=0;function $i(){a("321")}function Xi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Zt(e[n],t[n]))return!1;return!0}function Yi(e,t,n,r,i,o){if(ji=o,Pi=t,Li=null!==e?e.memoizedState:null,Di.current=null===Li?co:lo,t=n(r,i),Hi){do{Hi=!1,Ki+=1,Li=null!==e?e.memoizedState:null,Ui=Bi,Vi=Fi=zi=null,Di.current=lo,t=n(r,i)}while(Hi);Gi=null,Ki=0}return Di.current=uo,(e=Pi).memoizedState=Bi,e.expirationTime=Wi,e.updateQueue=Vi,e.effectTag|=qi,e=null!==zi&&null!==zi.next,ji=0,Ui=Fi=Bi=Li=zi=Pi=null,Wi=0,Vi=null,qi=0,e&&a("300"),t}function Ji(){Di.current=uo,ji=0,Ui=Fi=Bi=Li=zi=Pi=null,Wi=0,Vi=null,qi=0,Hi=!1,Gi=null,Ki=0}function Zi(){var e={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};return null===Fi?Bi=Fi=e:Fi=Fi.next=e,Fi}function Qi(){if(null!==Ui)Ui=(Fi=Ui).next,Li=null!==(zi=Li)?zi.next:null;else{null===Li&&a("310");var e={memoizedState:(zi=Li).memoizedState,baseState:zi.baseState,queue:zi.queue,baseUpdate:zi.baseUpdate,next:null};Fi=null===Fi?Bi=e:Fi.next=e,Li=zi.next}return Fi}function eo(e,t){return"function"===typeof t?t(e):t}function to(e){var t=Qi(),n=t.queue;if(null===n&&a("311"),n.lastRenderedReducer=e,0<Ki){var r=n.dispatch;if(null!==Gi){var i=Gi.get(n);if(void 0!==i){Gi.delete(n);var o=t.memoizedState;do{o=e(o,i.action),i=i.next}while(null!==i);return Zt(o,t.memoizedState)||(_o=!0),t.memoizedState=o,t.baseUpdate===n.last&&(t.baseState=o),n.lastRenderedState=o,[o,r]}}return[t.memoizedState,r]}r=n.last;var s=t.baseUpdate;if(o=t.baseState,null!==s?(null!==r&&(r.next=null),r=s.next):r=null!==r?r.next:null,null!==r){var u=i=null,c=r,l=!1;do{var f=c.expirationTime;f<ji?(l||(l=!0,u=s,i=o),f>Wi&&(Wi=f)):o=c.eagerReducer===e?c.eagerState:e(o,c.action),s=c,c=c.next}while(null!==c&&c!==r);l||(u=s,i=o),Zt(o,t.memoizedState)||(_o=!0),t.memoizedState=o,t.baseUpdate=u,t.baseState=i,n.lastRenderedState=o}return[t.memoizedState,n.dispatch]}function no(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===Vi?(Vi={lastEffect:null}).lastEffect=e.next=e:null===(t=Vi.lastEffect)?Vi.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,Vi.lastEffect=e),e}function ro(e,t,n,r){var i=Zi();qi|=e,i.memoizedState=no(t,n,void 0,void 0===r?null:r)}function io(e,t,n,r){var i=Qi();r=void 0===r?null:r;var o=void 0;if(null!==zi){var a=zi.memoizedState;if(o=a.destroy,null!==r&&Xi(r,a.deps))return void no(Ci,n,o,r)}qi|=e,i.memoizedState=no(t,n,o,r)}function oo(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function ao(){}function so(e,t,n){25>Ki||a("301");var r=e.alternate;if(e===Pi||null!==r&&r===Pi)if(Hi=!0,e={expirationTime:ji,action:n,eagerReducer:null,eagerState:null,next:null},null===Gi&&(Gi=new Map),void 0===(n=Gi.get(t)))Gi.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}else{Va();var i=_s(),o={expirationTime:i=Xa(i,e),action:n,eagerReducer:null,eagerState:null,next:null},s=t.last;if(null===s)o.next=o;else{var u=s.next;null!==u&&(o.next=u),s.next=o}if(t.last=o,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var c=t.lastRenderedState,l=r(c,n);if(o.eagerReducer=r,o.eagerState=l,Zt(l,c))return}catch(f){}Za(e,i)}}var uo={readContext:Wo,useCallback:$i,useContext:$i,useEffect:$i,useImperativeHandle:$i,useLayoutEffect:$i,useMemo:$i,useReducer:$i,useRef:$i,useState:$i,useDebugValue:$i},co={readContext:Wo,useCallback:function(e,t){return Zi().memoizedState=[e,void 0===t?null:t],e},useContext:Wo,useEffect:function(e,t){return ro(516,Mi|Ri,e,t)},useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,ro(4,Oi|Ii,oo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4,Oi|Ii,e,t)},useMemo:function(e,t){var n=Zi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Zi();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=so.bind(null,Pi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Zi().memoizedState=e},useState:function(e){var t=Zi();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:eo,lastRenderedState:e}).dispatch=so.bind(null,Pi,e),[t.memoizedState,e]},useDebugValue:ao},lo={readContext:Wo,useCallback:function(e,t){var n=Qi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Xi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)},useContext:Wo,useEffect:function(e,t){return io(516,Mi|Ri,e,t)},useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,io(4,Oi|Ii,oo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return io(4,Oi|Ii,e,t)},useMemo:function(e,t){var n=Qi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Xi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:to,useRef:function(){return Qi().memoizedState},useState:function(e){return to(eo)},useDebugValue:ao},fo=null,ho=null,po=!1;function mo(e,t){var n=Hr(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function vo(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function go(e){if(po){var t=ho;if(t){var n=t;if(!vo(e,t)){if(!(t=kr(n))||!vo(e,t))return e.effectTag|=2,po=!1,void(fo=e);mo(fo,n)}fo=e,ho=Sr(t)}else e.effectTag|=2,po=!1,fo=e}}function yo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&18!==e.tag;)e=e.return;fo=e}function bo(e){if(e!==fo)return!1;if(!po)return yo(e),po=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!yr(t,e.memoizedProps))for(t=ho;t;)mo(e,t),t=kr(t);return yo(e),ho=fo?kr(e.stateNode):null,!0}function wo(){ho=fo=null,po=!1}var xo=qe.ReactCurrentOwner,_o=!1;function ko(e,t,n,r){t.child=null===e?vi(t,null,n,r):mi(t,e.child,n,r)}function So(e,t,n,r,i){n=n.render;var o=t.ref;return Uo(t,i),r=Yi(e,t,n,r,o,i),null===e||_o?(t.effectTag|=1,ko(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Mo(e,t,i))}function Eo(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!==typeof a||Gr(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=$r(n.type,null,r,null,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Co(e,t,a,r,i,o))}return a=e.child,i<o&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:en)(i,r)&&e.ref===t.ref)?Mo(e,t,o):(t.effectTag|=1,(e=Kr(a,r)).ref=t.ref,e.return=t,t.child=e)}function Co(e,t,n,r,i,o){return null!==e&&en(e.memoizedProps,r)&&e.ref===t.ref&&(_o=!1,i<o)?Mo(e,t,o):Oo(e,t,n,r,o)}function No(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Oo(e,t,n,r,i){var o=Dr(n)?Rr:Tr.current;return o=Mr(t,o),Uo(t,i),n=Yi(e,t,n,r,o,i),null===e||_o?(t.effectTag|=1,ko(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Mo(e,t,i))}function Ao(e,t,n,r,i){if(Dr(n)){var o=!0;Br(t)}else o=!1;if(Uo(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),ui(t,n,r),li(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var u=a.context,c=n.contextType;"object"===typeof c&&null!==c?c=Wo(c):c=Mr(t,c=Dr(n)?Rr:Tr.current);var l=n.getDerivedStateFromProps,f="function"===typeof l||"function"===typeof a.getSnapshotBeforeUpdate;f||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||u!==c)&&ci(t,a,r,c),Ko=!1;var h=t.memoizedState;u=a.state=h;var d=t.updateQueue;null!==d&&(na(t,d,r,a,i),u=t.memoizedState),s!==r||h!==u||Ir.current||Ko?("function"===typeof l&&(oi(t,n,l,r),u=t.memoizedState),(s=Ko||si(t,n,s,r,h,u,c))?(f||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.effectTag|=4)):("function"===typeof a.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=s):("function"===typeof a.componentDidMount&&(t.effectTag|=4),r=!1)}else a=t.stateNode,s=t.memoizedProps,a.props=t.type===t.elementType?s:ri(t.type,s),u=a.context,"object"===typeof(c=n.contextType)&&null!==c?c=Wo(c):c=Mr(t,c=Dr(n)?Rr:Tr.current),(f="function"===typeof(l=n.getDerivedStateFromProps)||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||u!==c)&&ci(t,a,r,c),Ko=!1,u=t.memoizedState,h=a.state=u,null!==(d=t.updateQueue)&&(na(t,d,r,a,i),h=t.memoizedState),s!==r||u!==h||Ir.current||Ko?("function"===typeof l&&(oi(t,n,l,r),h=t.memoizedState),(l=Ko||si(t,n,s,r,u,h,c))?(f||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,c),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,c)),"function"===typeof a.componentDidUpdate&&(t.effectTag|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=c,r=l):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),r=!1);return To(e,t,n,r,o,i)}function To(e,t,n,r,i,o){No(e,t);var a=0!==(64&t.effectTag);if(!r&&!a)return i&&Fr(t,n,!1),Mo(e,t,o);r=t.stateNode,xo.current=t;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&a?(t.child=mi(t,e.child,null,o),t.child=mi(t,null,s,o)):ko(e,t,s,o),t.memoizedState=r.state,i&&Fr(t,n,!0),t.child}function Io(e){var t=e.stateNode;t.pendingContext?zr(0,t.pendingContext,t.pendingContext!==t.context):t.context&&zr(0,t.context,!1),_i(e,t.containerInfo)}function Ro(e,t,n){var r=t.mode,i=t.pendingProps,o=t.memoizedState;if(0===(64&t.effectTag)){o=null;var a=!1}else o={timedOutAt:null!==o?o.timedOutAt:0},a=!0,t.effectTag&=-65;if(null===e)if(a){var s=i.fallback;e=Xr(null,r,0,null),0===(1&t.mode)&&(e.child=null!==t.memoizedState?t.child.child:t.child),r=Xr(s,r,n,null),e.sibling=r,(n=e).return=r.return=t}else n=r=vi(t,null,i.children,n);else null!==e.memoizedState?(s=(r=e.child).sibling,a?(n=i.fallback,i=Kr(r,r.pendingProps),0===(1&t.mode)&&((a=null!==t.memoizedState?t.child.child:t.child)!==r.child&&(i.child=a)),r=i.sibling=Kr(s,n,s.expirationTime),n=i,i.childExpirationTime=0,n.return=r.return=t):n=r=mi(t,r.child,i.children,n)):(s=e.child,a?(a=i.fallback,(i=Xr(null,r,0,null)).child=s,0===(1&t.mode)&&(i.child=null!==t.memoizedState?t.child.child:t.child),(r=i.sibling=Xr(a,r,n,null)).effectTag|=2,n=i,i.childExpirationTime=0,n.return=r.return=t):r=n=mi(t,s,i.children,n)),t.stateNode=e.stateNode;return t.memoizedState=o,t.child=n,r}function Mo(e,t,n){if(null!==e&&(t.contextDependencies=e.contextDependencies),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child&&a("153"),null!==t.child){for(n=Kr(e=t.child,e.pendingProps,e.expirationTime),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Kr(e,e.pendingProps,e.expirationTime)).return=t;n.sibling=null}return t.child}function Do(e,t,n){var r=t.expirationTime;if(null!==e){if(e.memoizedProps!==t.pendingProps||Ir.current)_o=!0;else if(r<n){switch(_o=!1,t.tag){case 3:Io(t),wo();break;case 5:Si(t);break;case 1:Dr(t.type)&&Br(t);break;case 4:_i(t,t.stateNode.containerInfo);break;case 10:Bo(t,t.memoizedProps.value);break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?Ro(e,t,n):null!==(t=Mo(e,t,n))?t.sibling:null}return Mo(e,t,n)}}else _o=!1;switch(t.expirationTime=0,t.tag){case 2:r=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps;var i=Mr(t,Tr.current);if(Uo(t,n),i=Yi(null,t,r,e,i,n),t.effectTag|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(t.tag=1,Ji(),Dr(r)){var o=!0;Br(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var s=r.getDerivedStateFromProps;"function"===typeof s&&oi(t,r,s,e),i.updater=ai,t.stateNode=i,i._reactInternalFiber=t,li(t,r,e,n),t=To(null,t,r,!0,o,n)}else t.tag=0,ko(null,t,i,n),t=t.child;return t;case 16:switch(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),o=t.pendingProps,e=function(e){var t=e._result;switch(e._status){case 1:return t;case 2:case 0:throw t;default:switch(e._status=0,(t=(t=e._ctor)()).then(function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)},function(t){0===e._status&&(e._status=2,e._result=t)}),e._status){case 1:return e._result;case 2:throw e._result}throw e._result=t,t}}(i),t.type=e,i=t.tag=function(e){if("function"===typeof e)return Gr(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===tt)return 11;if(e===rt)return 14}return 2}(e),o=ri(e,o),s=void 0,i){case 0:s=Oo(null,t,e,o,n);break;case 1:s=Ao(null,t,e,o,n);break;case 11:s=So(null,t,e,o,n);break;case 14:s=Eo(null,t,e,ri(e.type,o),r,n);break;default:a("306",e,"")}return s;case 0:return r=t.type,i=t.pendingProps,Oo(e,t,r,i=t.elementType===r?i:ri(r,i),n);case 1:return r=t.type,i=t.pendingProps,Ao(e,t,r,i=t.elementType===r?i:ri(r,i),n);case 3:return Io(t),null===(r=t.updateQueue)&&a("282"),i=null!==(i=t.memoizedState)?i.element:null,na(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===i?(wo(),t=Mo(e,t,n)):(i=t.stateNode,(i=(null===e||null===e.child)&&i.hydrate)&&(ho=Sr(t.stateNode.containerInfo),fo=t,i=po=!0),i?(t.effectTag|=2,t.child=vi(t,null,r,n)):(ko(e,t,r,n),wo()),t=t.child),t;case 5:return Si(t),null===e&&go(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,yr(r,i)?s=null:null!==o&&yr(r,o)&&(t.effectTag|=16),No(e,t),1!==n&&1&t.mode&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(ko(e,t,s,n),t=t.child),t;case 6:return null===e&&go(t),null;case 13:return Ro(e,t,n);case 4:return _i(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=mi(t,null,r,n):ko(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,So(e,t,r,i=t.elementType===r?i:ri(r,i),n);case 7:return ko(e,t,t.pendingProps,n),t.child;case 8:case 12:return ko(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,Bo(t,o=i.value),null!==s){var u=s.value;if(0===(o=Zt(u,o)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,o):1073741823))){if(s.children===i.children&&!Ir.current){t=Mo(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.contextDependencies;if(null!==c){s=u.child;for(var l=c.first;null!==l;){if(l.context===r&&0!==(l.observedBits&o)){1===u.tag&&((l=Yo(n)).tag=Ho,Zo(u,l)),u.expirationTime<n&&(u.expirationTime=n),null!==(l=u.alternate)&&l.expirationTime<n&&(l.expirationTime=n),l=n;for(var f=u.return;null!==f;){var h=f.alternate;if(f.childExpirationTime<l)f.childExpirationTime=l,null!==h&&h.childExpirationTime<l&&(h.childExpirationTime=l);else{if(!(null!==h&&h.childExpirationTime<l))break;h.childExpirationTime=l}f=f.return}c.expirationTime<n&&(c.expirationTime=n);break}l=l.next}}else s=10===u.tag&&u.type===t.type?null:u.child;if(null!==s)s.return=u;else for(s=u;null!==s;){if(s===t){s=null;break}if(null!==(u=s.sibling)){u.return=s.return,s=u;break}s=s.return}u=s}}ko(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(o=t.pendingProps).children,Uo(t,n),r=r(i=Wo(i,o.unstable_observedBits)),t.effectTag|=1,ko(e,t,r,n),t.child;case 14:return o=ri(i=t.type,t.pendingProps),Eo(e,t,i,o=ri(i.type,o),r,n);case 15:return Co(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,Dr(r)?(e=!0,Br(t)):e=!1,Uo(t,n),ui(t,r,i),li(t,r,i,n),To(null,t,r,!0,e,n)}a("156")}var jo={current:null},Po=null,zo=null,Lo=null;function Bo(e,t){var n=e.type._context;Or(jo,n._currentValue),n._currentValue=t}function Fo(e){var t=jo.current;Nr(jo),e.type._context._currentValue=t}function Uo(e,t){Po=e,Lo=zo=null;var n=e.contextDependencies;null!==n&&n.expirationTime>=t&&(_o=!0),e.contextDependencies=null}function Wo(e,t){return Lo!==e&&!1!==t&&0!==t&&("number"===typeof t&&1073741823!==t||(Lo=e,t=1073741823),t={context:e,observedBits:t,next:null},null===zo?(null===Po&&a("308"),zo=t,Po.contextDependencies={first:t,expirationTime:0}):zo=zo.next=t),e._currentValue}var Vo=0,qo=1,Ho=2,Go=3,Ko=!1;function $o(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Xo(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Yo(e){return{expirationTime:e,tag:Vo,payload:null,callback:null,next:null,nextEffect:null}}function Jo(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function Zo(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,i=null;null===r&&(r=e.updateQueue=$o(e.memoizedState))}else r=e.updateQueue,i=n.updateQueue,null===r?null===i?(r=e.updateQueue=$o(e.memoizedState),i=n.updateQueue=$o(n.memoizedState)):r=e.updateQueue=Xo(i):null===i&&(i=n.updateQueue=Xo(r));null===i||r===i?Jo(r,t):null===r.lastUpdate||null===i.lastUpdate?(Jo(r,t),Jo(i,t)):(Jo(r,t),i.lastUpdate=t)}function Qo(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=$o(e.memoizedState):ea(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function ea(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=Xo(t)),t}function ta(e,t,n,r,o,a){switch(n.tag){case qo:return"function"===typeof(e=n.payload)?e.call(a,r,o):e;case Go:e.effectTag=-2049&e.effectTag|64;case Vo:if(null===(o="function"===typeof(e=n.payload)?e.call(a,r,o):e)||void 0===o)break;return i({},r,o);case Ho:Ko=!0}return r}function na(e,t,n,r,i){Ko=!1;for(var o=(t=ea(e,t)).baseState,a=null,s=0,u=t.firstUpdate,c=o;null!==u;){var l=u.expirationTime;l<i?(null===a&&(a=u,o=c),s<l&&(s=l)):(c=ta(e,0,u,c,n,r),null!==u.callback&&(e.effectTag|=32,u.nextEffect=null,null===t.lastEffect?t.firstEffect=t.lastEffect=u:(t.lastEffect.nextEffect=u,t.lastEffect=u))),u=u.next}for(l=null,u=t.firstCapturedUpdate;null!==u;){var f=u.expirationTime;f<i?(null===l&&(l=u,null===a&&(o=c)),s<f&&(s=f)):(c=ta(e,0,u,c,n,r),null!==u.callback&&(e.effectTag|=32,u.nextEffect=null,null===t.lastCapturedEffect?t.firstCapturedEffect=t.lastCapturedEffect=u:(t.lastCapturedEffect.nextEffect=u,t.lastCapturedEffect=u))),u=u.next}null===a&&(t.lastUpdate=null),null===l?t.lastCapturedUpdate=null:e.effectTag|=32,null===a&&null===l&&(o=c),t.baseState=o,t.firstUpdate=a,t.firstCapturedUpdate=l,e.expirationTime=s,e.memoizedState=c}function ra(e,t,n){null!==t.firstCapturedUpdate&&(null!==t.lastUpdate&&(t.lastUpdate.next=t.firstCapturedUpdate,t.lastUpdate=t.lastCapturedUpdate),t.firstCapturedUpdate=t.lastCapturedUpdate=null),ia(t.firstEffect,n),t.firstEffect=t.lastEffect=null,ia(t.firstCapturedEffect,n),t.firstCapturedEffect=t.lastCapturedEffect=null}function ia(e,t){for(;null!==e;){var n=e.callback;if(null!==n){e.callback=null;var r=t;"function"!==typeof n&&a("191",n),n.call(r)}e=e.nextEffect}}function oa(e,t){return{value:e,source:t,stack:ut(t)}}function aa(e){e.effectTag|=4}var sa=void 0,ua=void 0,ca=void 0,la=void 0;sa=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ua=function(){},ca=function(e,t,n,r,o){var a=e.memoizedProps;if(a!==r){var s=t.stateNode;switch(xi(yi.current),e=null,n){case"input":a=bt(s,a),r=bt(s,r),e=[];break;case"option":a=Kn(s,a),r=Kn(s,r),e=[];break;case"select":a=i({},a,{value:void 0}),r=i({},r,{value:void 0}),e=[];break;case"textarea":a=Xn(s,a),r=Xn(s,r),e=[];break;default:"function"!==typeof a.onClick&&"function"===typeof r.onClick&&(s.onclick=pr)}fr(n,r),s=n=void 0;var u=null;for(n in a)if(!r.hasOwnProperty(n)&&a.hasOwnProperty(n)&&null!=a[n])if("style"===n){var c=a[n];for(s in c)c.hasOwnProperty(s)&&(u||(u={}),u[s]="")}else"dangerouslySetInnerHTML"!==n&&"children"!==n&&"suppressContentEditableWarning"!==n&&"suppressHydrationWarning"!==n&&"autoFocus"!==n&&(b.hasOwnProperty(n)?e||(e=[]):(e=e||[]).push(n,null));for(n in r){var l=r[n];if(c=null!=a?a[n]:void 0,r.hasOwnProperty(n)&&l!==c&&(null!=l||null!=c))if("style"===n)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(u||(u={}),u[s]="");for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(u||(u={}),u[s]=l[s])}else u||(e||(e=[]),e.push(n,u)),u=l;else"dangerouslySetInnerHTML"===n?(l=l?l.__html:void 0,c=c?c.__html:void 0,null!=l&&c!==l&&(e=e||[]).push(n,""+l)):"children"===n?c===l||"string"!==typeof l&&"number"!==typeof l||(e=e||[]).push(n,""+l):"suppressContentEditableWarning"!==n&&"suppressHydrationWarning"!==n&&(b.hasOwnProperty(n)?(null!=l&&dr(o,n),e||c===l||(e=[])):(e=e||[]).push(n,l))}u&&(e=e||[]).push("style",u),o=e,(t.updateQueue=o)&&aa(t)}},la=function(e,t,n,r){n!==r&&aa(t)};var fa="function"===typeof WeakSet?WeakSet:Set;function ha(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=ut(n)),null!==n&&st(n.type),t=t.value,null!==e&&1===e.tag&&st(e.type);try{console.error(t)}catch(i){setTimeout(function(){throw i})}}function da(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){$a(e,n)}else t.current=null}function pa(e,t,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var r=n=n.next;do{if((r.tag&e)!==Ci){var i=r.destroy;r.destroy=void 0,void 0!==i&&i()}(r.tag&t)!==Ci&&(i=r.create,r.destroy=i()),r=r.next}while(r!==n)}}function ma(e){switch("function"===typeof Wr&&Wr(e),e.tag){case 0:case 11:case 14:case 15:var t=e.updateQueue;if(null!==t&&null!==(t=t.lastEffect)){var n=t=t.next;do{var r=n.destroy;if(void 0!==r){var i=e;try{r()}catch(o){$a(i,o)}}n=n.next}while(n!==t)}break;case 1:if(da(e),"function"===typeof(t=e.stateNode).componentWillUnmount)try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(o){$a(e,o)}break;case 5:da(e);break;case 4:ya(e)}}function va(e){return 5===e.tag||3===e.tag||4===e.tag}function ga(e){e:{for(var t=e.return;null!==t;){if(va(t)){var n=t;break e}t=t.return}a("160"),n=void 0}var r=t=void 0;switch(n.tag){case 5:t=n.stateNode,r=!1;break;case 3:case 4:t=n.stateNode.containerInfo,r=!0;break;default:a("161")}16&n.effectTag&&(or(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||va(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var i=e;;){if(5===i.tag||6===i.tag)if(n)if(r){var o=t,s=i.stateNode,u=n;8===o.nodeType?o.parentNode.insertBefore(s,u):o.insertBefore(s,u)}else t.insertBefore(i.stateNode,n);else r?(s=t,u=i.stateNode,8===s.nodeType?(o=s.parentNode).insertBefore(u,s):(o=s).appendChild(u),null!==(s=s._reactRootContainer)&&void 0!==s||null!==o.onclick||(o.onclick=pr)):t.appendChild(i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;i=i.return}i.sibling.return=i.return,i=i.sibling}}function ya(e){for(var t=e,n=!1,r=void 0,i=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&a("160"),n.tag){case 5:r=n.stateNode,i=!1;break e;case 3:case 4:r=n.stateNode.containerInfo,i=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag){e:for(var o=t,s=o;;)if(ma(s),null!==s.child&&4!==s.tag)s.child.return=s,s=s.child;else{if(s===o)break;for(;null===s.sibling;){if(null===s.return||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}i?(o=r,s=t.stateNode,8===o.nodeType?o.parentNode.removeChild(s):o.removeChild(s)):r.removeChild(t.stateNode)}else if(4===t.tag){if(null!==t.child){r=t.stateNode.containerInfo,i=!0,t.child.return=t,t=t.child;continue}}else if(ma(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;4===(t=t.return).tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function ba(e,t){switch(t.tag){case 0:case 11:case 14:case 15:pa(Oi,Ai,t);break;case 1:break;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var i=t.type,o=t.updateQueue;t.updateQueue=null,null!==o&&function(e,t,n,r,i){e[D]=i,"input"===n&&"radio"===i.type&&null!=i.name&&xt(e,i),hr(n,r),r=hr(n,i);for(var o=0;o<t.length;o+=2){var a=t[o],s=t[o+1];"style"===a?cr(e,s):"dangerouslySetInnerHTML"===a?ir(e,s):"children"===a?or(e,s):gt(e,a,s,r)}switch(n){case"input":_t(e,i);break;case"textarea":Jn(e,i);break;case"select":t=e._wrapperState.wasMultiple,e._wrapperState.wasMultiple=!!i.multiple,null!=(n=i.value)?$n(e,!!i.multiple,n,!1):t!==!!i.multiple&&(null!=i.defaultValue?$n(e,!!i.multiple,i.defaultValue,!0):$n(e,!!i.multiple,i.multiple?[]:"",!1))}}(n,o,i,e,r)}break;case 6:null===t.stateNode&&a("162"),t.stateNode.nodeValue=t.memoizedProps;break;case 3:case 12:break;case 13:if(n=t.memoizedState,r=void 0,e=t,null===n?r=!1:(r=!0,e=t.child,0===n.timedOutAt&&(n.timedOutAt=_s())),null!==e&&function(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)r.style.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=void 0!==i&&null!==i&&i.hasOwnProperty("display")?i.display:null,r.style.display=ur("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else{if(13===n.tag&&null!==n.memoizedState){(r=n.child.sibling).return=n,n=r;continue}if(null!==n.child){n.child.return=n,n=n.child;continue}}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}(e,r),null!==(n=t.updateQueue)){t.updateQueue=null;var s=t.stateNode;null===s&&(s=t.stateNode=new fa),n.forEach(function(e){var n=function(e,t){var n=e.stateNode;null!==n&&n.delete(t),t=Xa(t=_s(),e),null!==(e=Ja(e,t))&&(Qr(e,t),0!==(t=e.expirationTime)&&ks(e,t))}.bind(null,t,e);s.has(e)||(s.add(e),e.then(n,n))})}break;case 17:break;default:a("163")}}var wa="function"===typeof WeakMap?WeakMap:Map;function xa(e,t,n){(n=Yo(n)).tag=Go,n.payload={element:null};var r=t.value;return n.callback=function(){Rs(r),ha(e,t)},n}function _a(e,t,n){(n=Yo(n)).tag=Go;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return r(i)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===La?La=new Set([this]):La.add(this));var n=t.value,i=t.stack;ha(e,t),this.componentDidCatch(n,{componentStack:null!==i?i:""})}),n}function ka(e){switch(e.tag){case 1:Dr(e.type)&&jr();var t=e.effectTag;return 2048&t?(e.effectTag=-2049&t|64,e):null;case 3:return ki(),Pr(),0!==(64&(t=e.effectTag))&&a("285"),e.effectTag=-2049&t|64,e;case 5:return Ei(e),null;case 13:return 2048&(t=e.effectTag)?(e.effectTag=-2049&t|64,e):null;case 18:return null;case 4:return ki(),null;case 10:return Fo(e),null;default:return null}}var Sa=qe.ReactCurrentDispatcher,Ea=qe.ReactCurrentOwner,Ca=1073741822,Na=!1,Oa=null,Aa=null,Ta=0,Ia=-1,Ra=!1,Ma=null,Da=!1,ja=null,Pa=null,za=null,La=null;function Ba(){if(null!==Oa)for(var e=Oa.return;null!==e;){var t=e;switch(t.tag){case 1:var n=t.type.childContextTypes;null!==n&&void 0!==n&&jr();break;case 3:ki(),Pr();break;case 5:Ei(t);break;case 4:ki();break;case 10:Fo(t)}e=e.return}Aa=null,Ta=0,Ia=-1,Ra=!1,Oa=null}function Fa(){for(;null!==Ma;){var e=Ma.effectTag;if(16&e&&or(Ma.stateNode,""),128&e){var t=Ma.alternate;null!==t&&(null!==(t=t.ref)&&("function"===typeof t?t(null):t.current=null))}switch(14&e){case 2:ga(Ma),Ma.effectTag&=-3;break;case 6:ga(Ma),Ma.effectTag&=-3,ba(Ma.alternate,Ma);break;case 4:ba(Ma.alternate,Ma);break;case 8:ya(e=Ma),e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,null!==(e=e.alternate)&&(e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null)}Ma=Ma.nextEffect}}function Ua(){for(;null!==Ma;){if(256&Ma.effectTag)e:{var e=Ma.alternate,t=Ma;switch(t.tag){case 0:case 11:case 15:pa(Ni,Ci,t);break e;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:ri(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}break e;case 3:case 5:case 6:case 4:case 17:break e;default:a("163")}}Ma=Ma.nextEffect}}function Wa(e,t){for(;null!==Ma;){var n=Ma.effectTag;if(36&n){var r=Ma.alternate,i=Ma,o=t;switch(i.tag){case 0:case 11:case 15:pa(Ti,Ii,i);break;case 1:var s=i.stateNode;if(4&i.effectTag)if(null===r)s.componentDidMount();else{var u=i.elementType===i.type?r.memoizedProps:ri(i.type,r.memoizedProps);s.componentDidUpdate(u,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}null!==(r=i.updateQueue)&&ra(0,r,s);break;case 3:if(null!==(r=i.updateQueue)){if(s=null,null!==i.child)switch(i.child.tag){case 5:s=i.child.stateNode;break;case 1:s=i.child.stateNode}ra(0,r,s)}break;case 5:o=i.stateNode,null===r&&4&i.effectTag&&gr(i.type,i.memoizedProps)&&o.focus();break;case 6:case 4:case 12:case 13:case 17:break;default:a("163")}}128&n&&(null!==(i=Ma.ref)&&(o=Ma.stateNode,"function"===typeof i?i(o):i.current=o)),512&n&&(ja=e),Ma=Ma.nextEffect}}function Va(){null!==Pa&&_r(Pa),null!==za&&za()}function qa(e,t){Da=Na=!0,e.current===t&&a("177");var n=e.pendingCommitExpirationTime;0===n&&a("261"),e.pendingCommitExpirationTime=0;var r=t.expirationTime,i=t.childExpirationTime;for(function(e,t){if(e.didError=!1,0===t)e.earliestPendingTime=0,e.latestPendingTime=0,e.earliestSuspendedTime=0,e.latestSuspendedTime=0,e.latestPingedTime=0;else{t<e.latestPingedTime&&(e.latestPingedTime=0);var n=e.latestPendingTime;0!==n&&(n>t?e.earliestPendingTime=e.latestPendingTime=0:e.earliestPendingTime>t&&(e.earliestPendingTime=e.latestPendingTime)),0===(n=e.earliestSuspendedTime)?Qr(e,t):t<e.latestSuspendedTime?(e.earliestSuspendedTime=0,e.latestSuspendedTime=0,e.latestPingedTime=0,Qr(e,t)):t>n&&Qr(e,t)}ni(0,e)}(e,i>r?i:r),Ea.current=null,r=void 0,1<t.effectTag?null!==t.lastEffect?(t.lastEffect.nextEffect=t,r=t.firstEffect):r=t:r=t.firstEffect,mr=Sn,vr=function(){var e=Pn();if(zn(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(t=(t=e.ownerDocument)&&t.defaultView||window).getSelection&&t.getSelection();if(n&&0!==n.rangeCount){t=n.anchorNode;var r=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{t.nodeType,i.nodeType}catch(d){t=null;break e}var o=0,a=-1,s=-1,u=0,c=0,l=e,f=null;t:for(;;){for(var h;l!==t||0!==r&&3!==l.nodeType||(a=o+r),l!==i||0!==n&&3!==l.nodeType||(s=o+n),3===l.nodeType&&(o+=l.nodeValue.length),null!==(h=l.firstChild);)f=l,l=h;for(;;){if(l===e)break t;if(f===t&&++u===r&&(a=o),f===i&&++c===n&&(s=o),null!==(h=l.nextSibling))break;f=(l=f).parentNode}l=h}t=-1===a||-1===s?null:{start:a,end:s}}else t=null}t=t||{start:0,end:0}}else t=null;return{focusedElem:e,selectionRange:t}}(),Sn=!1,Ma=r;null!==Ma;){i=!1;var s=void 0;try{Ua()}catch(c){i=!0,s=c}i&&(null===Ma&&a("178"),$a(Ma,s),null!==Ma&&(Ma=Ma.nextEffect))}for(Ma=r;null!==Ma;){i=!1,s=void 0;try{Fa()}catch(c){i=!0,s=c}i&&(null===Ma&&a("178"),$a(Ma,s),null!==Ma&&(Ma=Ma.nextEffect))}for(Ln(vr),vr=null,Sn=!!mr,mr=null,e.current=t,Ma=r;null!==Ma;){i=!1,s=void 0;try{Wa(e,n)}catch(c){i=!0,s=c}i&&(null===Ma&&a("178"),$a(Ma,s),null!==Ma&&(Ma=Ma.nextEffect))}if(null!==r&&null!==ja){var u=function(e,t){za=Pa=ja=null;var n=is;is=!0;do{if(512&t.effectTag){var r=!1,i=void 0;try{var o=t;pa(Mi,Ci,o),pa(Ci,Ri,o)}catch(u){r=!0,i=u}r&&$a(t,i)}t=t.nextEffect}while(null!==t);is=n,0!==(n=e.expirationTime)&&ks(e,n),ls||is||Os(1073741823,!1)}.bind(null,e,r);Pa=o.unstable_runWithPriority(o.unstable_NormalPriority,function(){return xr(u)}),za=u}Na=Da=!1,"function"===typeof Ur&&Ur(t.stateNode),n=t.expirationTime,0===(t=(t=t.childExpirationTime)>n?t:n)&&(La=null),function(e,t){e.expirationTime=t,e.finishedWork=null}(e,t)}function Ha(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0===(1024&e.effectTag)){Oa=e;e:{var o=t,s=Ta,u=(t=e).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:Dr(t.type)&&jr();break;case 3:ki(),Pr(),(u=t.stateNode).pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),null!==o&&null!==o.child||(bo(t),t.effectTag&=-3),ua(t);break;case 5:Ei(t);var c=xi(wi.current);if(s=t.type,null!==o&&null!=t.stateNode)ca(o,t,s,u,c),o.ref!==t.ref&&(t.effectTag|=128);else if(u){var l=xi(yi.current);if(bo(t)){o=(u=t).stateNode;var f=u.type,h=u.memoizedProps,d=c;switch(o[M]=u,o[D]=h,s=void 0,c=f){case"iframe":case"object":En("load",o);break;case"video":case"audio":for(f=0;f<te.length;f++)En(te[f],o);break;case"source":En("error",o);break;case"img":case"image":case"link":En("error",o),En("load",o);break;case"form":En("reset",o),En("submit",o);break;case"details":En("toggle",o);break;case"input":wt(o,h),En("invalid",o),dr(d,"onChange");break;case"select":o._wrapperState={wasMultiple:!!h.multiple},En("invalid",o),dr(d,"onChange");break;case"textarea":Yn(o,h),En("invalid",o),dr(d,"onChange")}for(s in fr(c,h),f=null,h)h.hasOwnProperty(s)&&(l=h[s],"children"===s?"string"===typeof l?o.textContent!==l&&(f=["children",l]):"number"===typeof l&&o.textContent!==""+l&&(f=["children",""+l]):b.hasOwnProperty(s)&&null!=l&&dr(d,s));switch(c){case"input":We(o),kt(o,h,!0);break;case"textarea":We(o),Zn(o);break;case"select":case"option":break;default:"function"===typeof h.onClick&&(o.onclick=pr)}s=f,u.updateQueue=s,(u=null!==s)&&aa(t)}else{h=t,d=s,o=u,f=9===c.nodeType?c:c.ownerDocument,l===Qn.html&&(l=er(d)),l===Qn.html?"script"===d?((o=f.createElement("div")).innerHTML="<script><\/script>
1",f=o.removeChild(o.firstChild)):"string"===typeof o.is?f=f.createElement(d,{is:o.is}):(f=f.createElement(d),"select"===d&&(d=f,o.multiple?d.multiple=!0:o.size&&(d.size=o.size))):f=f.createElementNS(l,d),(o=f)[M]=h,o[D]=u,sa(o,t,!1,!1),d=o;var p=c,m=hr(f=s,h=u);switch(f){case"iframe":case"object":En("load",d),c=h;break;case"video":case"audio":for(c=0;c<te.length;c++)En(te[c],d);c=h;break;case"source":En("error",d),c=h;break;case"img":case"image":case"link":En("error",d),En("load",d),c=h;break;case"form":En("reset",d),En("submit",d),c=h;break;case"details":En("toggle",d),c=h;break;case"input":wt(d,h),c=bt(d,h),En("invalid",d),dr(p,"onChange");break;case"option":c=Kn(d,h);break;case"select":d._wrapperState={wasMultiple:!!h.multiple},c=i({},h,{value:void 0}),En("invalid",d),dr(p,"onChange");break;case"textarea":Yn(d,h),c=Xn(d,h),En("invalid",d),dr(p,"onChange");break;default:c=h}fr(f,c),l=void 0;var v=f,g=d,y=c;for(l in y)if(y.hasOwnProperty(l)){var w=y[l];"style"===l?cr(g,w):"dangerouslySetInnerHTML"===l?null!=(w=w?w.__html:void 0)&&ir(g,w):"children"===l?"string"===typeof w?("textarea"!==v||""!==w)&&or(g,w):"number"===typeof w&&or(g,""+w):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(b.hasOwnProperty(l)?null!=w&&dr(p,l):null!=w&>(g,l,w,m))}switch(f){case"input":We(d),kt(d,h,!1);break;case"textarea":We(d),Zn(d);break;case"option":null!=h.value&&d.setAttribute("value",""+yt(h.value));break;case"select":(c=d).multiple=!!h.multiple,null!=(d=h.value)?$n(c,!!h.multiple,d,!1):null!=h.defaultValue&&$n(c,!!h.multiple,h.defaultValue,!0);break;default:"function"===typeof c.onClick&&(d.onclick=pr)}(u=gr(s,u))&&aa(t),t.stateNode=o}null!==t.ref&&(t.effectTag|=128)}else null===t.stateNode&&a("166");break;case 6:o&&null!=t.stateNode?la(o,t,o.memoizedProps,u):("string"!==typeof u&&(null===t.stateNode&&a("166")),o=xi(wi.current),xi(yi.current),bo(t)?(s=(u=t).stateNode,o=u.memoizedProps,s[M]=u,(u=s.nodeValue!==o)&&aa(t)):(s=t,(u=(9===o.nodeType?o:o.ownerDocument).createTextNode(u))[M]=t,s.stateNode=u));break;case 11:break;case 13:if(u=t.memoizedState,0!==(64&t.effectTag)){t.expirationTime=s,Oa=t;break e}u=null!==u,s=null!==o&&null!==o.memoizedState,null!==o&&!u&&s&&(null!==(o=o.child.sibling)&&(null!==(c=t.firstEffect)?(t.firstEffect=o,o.nextEffect=c):(t.firstEffect=t.lastEffect=o,o.nextEffect=null),o.effectTag=8)),(u||s)&&(t.effectTag|=4);break;case 7:case 8:case 12:break;case 4:ki(),ua(t);break;case 10:Fo(t);break;case 9:case 14:break;case 17:Dr(t.type)&&jr();break;case 18:break;default:a("156")}Oa=null}if(t=e,1===Ta||1!==t.childExpirationTime){for(u=0,s=t.child;null!==s;)(o=s.expirationTime)>u&&(u=o),(c=s.childExpirationTime)>u&&(u=c),s=s.sibling;t.childExpirationTime=u}if(null!==Oa)return Oa;null!==n&&0===(1024&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1<e.effectTag&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e))}else{if(null!==(e=ka(e)))return e.effectTag&=1023,e;null!==n&&(n.firstEffect=n.lastEffect=null,n.effectTag|=1024)}if(null!==r)return r;if(null===n)break;e=n}return null}function Ga(e){var t=Do(e.alternate,e,Ta);return e.memoizedProps=e.pendingProps,null===t&&(t=Ha(e)),Ea.current=null,t}function Ka(e,t){Na&&a("243"),Va(),Na=!0;var n=Sa.current;Sa.current=uo;var r=e.nextExpirationTimeToWorkOn;r===Ta&&e===Aa&&null!==Oa||(Ba(),Ta=r,Oa=Kr((Aa=e).current,null),e.pendingCommitExpirationTime=0);for(var i=!1;;){try{if(t)for(;null!==Oa&&!Cs();)Oa=Ga(Oa);else for(;null!==Oa;)Oa=Ga(Oa)}catch(g){if(Lo=zo=Po=null,Ji(),null===Oa)i=!0,Rs(g);else{null===Oa&&a("271");var o=Oa,s=o.return;if(null!==s){e:{var u=e,c=s,l=o,f=g;if(s=Ta,l.effectTag|=1024,l.firstEffect=l.lastEffect=null,null!==f&&"object"===typeof f&&"function"===typeof f.then){var h=f;f=c;var d=-1,p=-1;do{if(13===f.tag){var m=f.alternate;if(null!==m&&null!==(m=m.memoizedState)){p=10*(1073741822-m.timedOutAt);break}"number"===typeof(m=f.pendingProps.maxDuration)&&(0>=m?d=0:(-1===d||m<d)&&(d=m))}f=f.return}while(null!==f);f=c;do{if((m=13===f.tag)&&(m=void 0!==f.memoizedProps.fallback&&null===f.memoizedState),m){if(null===(c=f.updateQueue)?((c=new Set).add(h),f.updateQueue=c):c.add(h),0===(1&f.mode)){f.effectTag|=64,l.effectTag&=-1957,1===l.tag&&(null===l.alternate?l.tag=17:((s=Yo(1073741823)).tag=Ho,Zo(l,s))),l.expirationTime=1073741823;break e}c=s;var v=(l=u).pingCache;null===v?(v=l.pingCache=new wa,m=new Set,v.set(h,m)):void 0===(m=v.get(h))&&(m=new Set,v.set(h,m)),m.has(c)||(m.add(c),l=Ya.bind(null,l,h,c),h.then(l,l)),-1===d?u=1073741823:(-1===p&&(p=10*(1073741822-ti(u,s))-5e3),u=p+d),0<=u&&Ia<u&&(Ia=u),f.effectTag|=2048,f.expirationTime=s;break e}f=f.return}while(null!==f);f=Error((st(l.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ut(l))}Ra=!0,f=oa(f,l),u=c;do{switch(u.tag){case 3:u.effectTag|=2048,u.expirationTime=s,Qo(u,s=xa(u,f,s));break e;case 1:if(d=f,p=u.type,l=u.stateNode,0===(64&u.effectTag)&&("function"===typeof p.getDerivedStateFromError||null!==l&&"function"===typeof l.componentDidCatch&&(null===La||!La.has(l)))){u.effectTag|=2048,u.expirationTime=s,Qo(u,s=_a(u,d,s));break e}}u=u.return}while(null!==u)}Oa=Ha(o);continue}i=!0,Rs(g)}}break}if(Na=!1,Sa.current=n,Lo=zo=Po=null,Ji(),i)Aa=null,e.finishedWork=null;else if(null!==Oa)e.finishedWork=null;else{if(null===(n=e.current.alternate)&&a("281"),Aa=null,Ra){if(i=e.latestPendingTime,o=e.latestSuspendedTime,s=e.latestPingedTime,0!==i&&i<r||0!==o&&o<r||0!==s&&s<r)return ei(e,r),void xs(e,n,r,e.expirationTime,-1);if(!e.didError&&t)return e.didError=!0,r=e.nextExpirationTimeToWorkOn=r,t=e.expirationTime=1073741823,void xs(e,n,r,t,-1)}t&&-1!==Ia?(ei(e,r),(t=10*(1073741822-ti(e,r)))<Ia&&(Ia=t),t=10*(1073741822-_s()),t=Ia-t,xs(e,n,r,e.expirationTime,0>t?0:t)):(e.pendingCommitExpirationTime=r,e.finishedWork=n)}}function $a(e,t){for(var n=e.return;null!==n;){switch(n.tag){case 1:var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===La||!La.has(r)))return Zo(n,e=_a(n,e=oa(t,e),1073741823)),void Za(n,1073741823);break;case 3:return Zo(n,e=xa(n,e=oa(t,e),1073741823)),void Za(n,1073741823)}n=n.return}3===e.tag&&(Zo(e,n=xa(e,n=oa(t,e),1073741823)),Za(e,1073741823))}function Xa(e,t){var n=o.unstable_getCurrentPriorityLevel(),r=void 0;if(0===(1&t.mode))r=1073741823;else if(Na&&!Da)r=Ta;else{switch(n){case o.unstable_ImmediatePriority:r=1073741823;break;case o.unstable_UserBlockingPriority:r=1073741822-10*(1+((1073741822-e+15)/10|0));break;case o.unstable_NormalPriority:r=1073741822-25*(1+((1073741822-e+500)/25|0));break;case o.unstable_LowPriority:case o.unstable_IdlePriority:r=1;break;default:a("313")}null!==Aa&&r===Ta&&--r}return n===o.unstable_UserBlockingPriority&&(0===ss||r<ss)&&(ss=r),r}function Ya(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),null!==Aa&&Ta===n?Aa=null:(t=e.earliestSuspendedTime,r=e.latestSuspendedTime,0!==t&&n<=t&&n>=r&&(e.didError=!1,(0===(t=e.latestPingedTime)||t>n)&&(e.latestPingedTime=n),ni(n,e),0!==(n=e.expirationTime)&&ks(e,n)))}function Ja(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,i=null;if(null===r&&3===e.tag)i=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){i=r.stateNode;break}r=r.return}return i}function Za(e,t){null!==(e=Ja(e,t))&&(!Na&&0!==Ta&&t>Ta&&Ba(),Qr(e,t),Na&&!Da&&Aa===e||ks(e,e.expirationTime),gs>vs&&(gs=0,a("185")))}function Qa(e,t,n,r,i){return o.unstable_runWithPriority(o.unstable_ImmediatePriority,function(){return e(t,n,r,i)})}var es=null,ts=null,ns=0,rs=void 0,is=!1,os=null,as=0,ss=0,us=!1,cs=null,ls=!1,fs=!1,hs=null,ds=o.unstable_now(),ps=1073741822-(ds/10|0),ms=ps,vs=50,gs=0,ys=null;function bs(){ps=1073741822-((o.unstable_now()-ds)/10|0)}function ws(e,t){if(0!==ns){if(t<ns)return;null!==rs&&o.unstable_cancelCallback(rs)}ns=t,e=o.unstable_now()-ds,rs=o.unstable_scheduleCallback(Ns,{timeout:10*(1073741822-t)-e})}function xs(e,t,n,r,i){e.expirationTime=r,0!==i||Cs()?0<i&&(e.timeoutHandle=br(function(e,t,n){e.pendingCommitExpirationTime=n,e.finishedWork=t,bs(),ms=ps,As(e,n)}.bind(null,e,t,n),i)):(e.pendingCommitExpirationTime=n,e.finishedWork=t)}function _s(){return is?ms:(Ss(),0!==as&&1!==as||(bs(),ms=ps),ms)}function ks(e,t){null===e.nextScheduledRoot?(e.expirationTime=t,null===ts?(es=ts=e,e.nextScheduledRoot=e):(ts=ts.nextScheduledRoot=e).nextScheduledRoot=es):t>e.expirationTime&&(e.expirationTime=t),is||(ls?fs&&(os=e,as=1073741823,Ts(e,1073741823,!1)):1073741823===t?Os(1073741823,!1):ws(e,t))}function Ss(){var e=0,t=null;if(null!==ts)for(var n=ts,r=es;null!==r;){var i=r.expirationTime;if(0===i){if((null===n||null===ts)&&a("244"),r===r.nextScheduledRoot){es=ts=r.nextScheduledRoot=null;break}if(r===es)es=i=r.nextScheduledRoot,ts.nextScheduledRoot=i,r.nextScheduledRoot=null;else{if(r===ts){(ts=n).nextScheduledRoot=es,r.nextScheduledRoot=null;break}n.nextScheduledRoot=r.nextScheduledRoot,r.nextScheduledRoot=null}r=n.nextScheduledRoot}else{if(i>e&&(e=i,t=r),r===ts)break;if(1073741823===e)break;n=r,r=r.nextScheduledRoot}}os=t,as=e}var Es=!1;function Cs(){return!!Es||!!o.unstable_shouldYield()&&(Es=!0)}function Ns(){try{if(!Cs()&&null!==es){bs();var e=es;do{var t=e.expirationTime;0!==t&&ps<=t&&(e.nextExpirationTimeToWorkOn=ps),e=e.nextScheduledRoot}while(e!==es)}Os(0,!0)}finally{Es=!1}}function Os(e,t){if(Ss(),t)for(bs(),ms=ps;null!==os&&0!==as&&e<=as&&!(Es&&ps>as);)Ts(os,as,ps>as),Ss(),bs(),ms=ps;else for(;null!==os&&0!==as&&e<=as;)Ts(os,as,!1),Ss();if(t&&(ns=0,rs=null),0!==as&&ws(os,as),gs=0,ys=null,null!==hs)for(e=hs,hs=null,t=0;t<e.length;t++){var n=e[t];try{n._onComplete()}catch(r){us||(us=!0,cs=r)}}if(us)throw e=cs,cs=null,us=!1,e}function As(e,t){is&&a("253"),os=e,as=t,Ts(e,t,!1),Os(1073741823,!1)}
vendor: 8,706 bytes, line 1
1function Ts(e,t,n){if(is&&a("245"),is=!0,n){var r=e.finishedWork;null!==r?Is(e,r,t):(e.finishedWork=null,-1!==(r=e.timeoutHandle)&&(e.timeoutHandle=-1,wr(r)),Ka(e,n),null!==(r=e.finishedWork)&&(Cs()?e.finishedWork=r:Is(e,r,t)))}else null!==(r=e.finishedWork)?Is(e,r,t):(e.finishedWork=null,-1!==(r=e.timeoutHandle)&&(e.timeoutHandle=-1,wr(r)),Ka(e,n),null!==(r=e.finishedWork)&&Is(e,r,t));is=!1}function Is(e,t,n){var r=e.firstBatch;if(null!==r&&r._expirationTime>=n&&(null===hs?hs=[r]:hs.push(r),r._defer))return e.finishedWork=t,void(e.expirationTime=0);e.finishedWork=null,e===ys?gs++:(ys=e,gs=0),o.unstable_runWithPriority(o.unstable_ImmediatePriority,function(){qa(e,t)})}function Rs(e){null===os&&a("246"),os.expirationTime=0,us||(us=!0,cs=e)}function Ms(e,t){var n=ls;ls=!0;try{return e(t)}finally{(ls=n)||is||Os(1073741823,!1)}}function Ds(e,t){if(ls&&!fs){fs=!0;try{return e(t)}finally{fs=!1}}return e(t)}function js(e,t,n){ls||is||0===ss||(Os(ss,!1),ss=0);var r=ls;ls=!0;try{return o.unstable_runWithPriority(o.unstable_UserBlockingPriority,function(){return e(t,n)})}finally{(ls=r)||is||Os(1073741823,!1)}}function Ps(e,t,n,r,i){var o=t.current;e:if(n){t:{2===tn(n=n._reactInternalFiber)&&1===n.tag||a("170");var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(Dr(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);a("171"),s=void 0}if(1===n.tag){var u=n.type;if(Dr(u)){n=Lr(n,u,s);break e}}n=s}else n=Ar;return null===t.context?t.context=n:t.pendingContext=n,t=i,(i=Yo(r)).payload={element:e},null!==(t=void 0===t?null:t)&&(i.callback=t),Va(),Zo(o,i),Za(o,r),r}function zs(e,t,n,r){var i=t.current;return Ps(e,t,n,i=Xa(_s(),i),r)}function Ls(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Bs(e){var t=1073741822-25*(1+((1073741822-_s()+500)/25|0));t>=Ca&&(t=Ca-1),this._expirationTime=Ca=t,this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function Fs(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function Us(e,t,n){e={current:t=Hr(3,null,null,t?3:0),containerInfo:e,pendingChildren:null,pingCache:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:n,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null},this._internalRoot=t.stateNode=e}function Ws(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Vs(e,t,n,r,i){var o=n._reactRootContainer;if(o){if("function"===typeof i){var a=i;i=function(){var e=Ls(o._internalRoot);a.call(e)}}null!=e?o.legacy_renderSubtreeIntoContainer(e,t,i):o.render(t,i)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Us(e,!1,t)}(n,r),"function"===typeof i){var s=i;i=function(){var e=Ls(o._internalRoot);s.call(e)}}Ds(function(){null!=e?o.legacy_renderSubtreeIntoContainer(e,t,i):o.render(t,i)})}return Ls(o._internalRoot)}function qs(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return Ws(t)||a("200"),function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:$e,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Ce=function(e,t,n){switch(t){case"input":if(_t(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=L(r);i||a("90"),Ve(r),_t(r,i)}}}break;case"textarea":Jn(e,n);break;case"select":null!=(t=n.value)&&$n(e,!!n.multiple,t,!1)}},Bs.prototype.render=function(e){this._defer||a("250"),this._hasChildren=!0,this._children=e;var t=this._root._internalRoot,n=this._expirationTime,r=new Fs;return Ps(e,t,null,n,r._onCommit),r},Bs.prototype.then=function(e){if(this._didComplete)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},Bs.prototype.commit=function(){var e=this._root._internalRoot,t=e.firstBatch;if(this._defer&&null!==t||a("251"),this._hasChildren){var n=this._expirationTime;if(t!==this){this._hasChildren&&(n=this._expirationTime=t._expirationTime,this.render(this._children));for(var r=null,i=t;i!==this;)r=i,i=i._next;null===r&&a("251"),r._next=i._next,this._next=t,e.firstBatch=this}this._defer=!1,As(e,n),t=this._next,this._next=null,null!==(t=e.firstBatch=t)&&t._hasChildren&&t.render(t._children)}else this._next=null,this._defer=!1},Bs.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++)(0,e[t])()}},Fs.prototype.then=function(e){if(this._didCommit)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},Fs.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++){var n=e[t];"function"!==typeof n&&a("191",n),n()}}},Us.prototype.render=function(e,t){var n=this._internalRoot,r=new Fs;return null!==(t=void 0===t?null:t)&&r.then(t),zs(e,n,null,r._onCommit),r},Us.prototype.unmount=function(e){var t=this._internalRoot,n=new Fs;return null!==(e=void 0===e?null:e)&&n.then(e),zs(null,t,null,n._onCommit),n},Us.prototype.legacy_renderSubtreeIntoContainer=function(e,t,n){var r=this._internalRoot,i=new Fs;return null!==(n=void 0===n?null:n)&&i.then(n),zs(t,r,e,i._onCommit),i},Us.prototype.createBatch=function(){var e=new Bs(this),t=e._expirationTime,n=this._internalRoot,r=n.firstBatch;if(null===r)n.firstBatch=e,e._next=null;else{for(n=null;null!==r&&r._expirationTime>=t;)n=r,r=r._next;e._next=r,null!==n&&(n._next=e)}return e},Re=Ms,Me=js,De=function(){is||0===ss||(Os(ss,!1),ss=0)};var Hs={createPortal:qs,findDOMNode:function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;return void 0===t&&("function"===typeof e.render?a("188"):a("268",Object.keys(e))),e=null===(e=rn(t))?null:e.stateNode},hydrate:function(e,t,n){return Ws(t)||a("200"),Vs(null,e,t,!0,n)},render:function(e,t,n){return Ws(t)||a("200"),Vs(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,r){return Ws(n)||a("200"),(null==e||void 0===e._reactInternalFiber)&&a("38"),Vs(e,t,n,!1,r)},unmountComponentAtNode:function(e){return Ws(e)||a("40"),!!e._reactRootContainer&&(Ds(function(){Vs(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},unstable_createPortal:function(){return qs.apply(void 0,arguments)},unstable_batchedUpdates:Ms,unstable_interactiveUpdates:js,flushSync:function(e,t){is&&a("187");var n=ls;ls=!0;try{return Qa(e,t)}finally{ls=n,Os(1073741823,!1)}},unstable_createRoot:function(e,t){return Ws(e)||a("299","unstable_createRoot"),new Us(e,!0,null!=t&&!0===t.hydrate)},unstable_flushControlled:function(e){var t=ls;ls=!0;try{Qa(e)}finally{(ls=t)||is||Os(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[P,z,L,A.injectEventPluginsByName,y,q,function(e){C(e,V)},Te,Ie,On,I]}};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Ur=Vr(function(e){return t.onCommitFiberRoot(n,e)}),Wr=Vr(function(e){return t.onCommitFiberUnmount(n,e)})}catch(r){}})(i({},e,{overrideProps:null,currentDispatcherRef:qe.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=rn(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null}}))}({findFiberByHostInstance:j,bundleType:0,version:"16.8.6",rendererPackageName:"react-dom"});var Gs={default:Hs},Ks=Gs&&Hs||Gs;e.exports=Ks.default||Ks},function(e,t,n){"use strict";e.exports=n(133)},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=null,r=!1,i=3,o=-1,a=-1,s=!1,u=!1;function c(){if(!s){var e=n.expirationTime;u?k():u=!0,_(h,e)}}function l(){var e=n,t=n.next;if(n===t)n=null;else{var r=n.previous;n=r.next=t,t.previous=r}e.next=e.previous=null,r=e.callback,t=e.expirationTime,e=e.priorityLevel;var o=i,s=a;i=e,a=t;try{var u=r()}finally{i=o,a=s}if("function"===typeof u)if(u={callback:u,priorityLevel:e,expirationTime:t,next:null,previous:null},null===n)n=u.next=u.previous=u;else{r=null,e=n;
1do{if(e.expirationTime>=t){r=e;break}e=e.next}while(e!==n);null===r?r=n:r===n&&(n=u,c()),(t=r.previous).next=r.previous=u,u.next=r,u.previous=t}}function f(){if(-1===o&&null!==n&&1===n.priorityLevel){s=!0;try{do{l()}while(null!==n&&1===n.priorityLevel)}finally{s=!1,null!==n?c():u=!1}}}function h(e){s=!0;var i=r;r=e;try{if(e)for(;null!==n;){var o=t.unstable_now();if(!(n.expirationTime<=o))break;do{l()}while(null!==n&&n.expirationTime<=o)}else if(null!==n)do{l()}while(null!==n&&!S())}finally{s=!1,r=i,null!==n?c():u=!1,f()}}var d,p,m=Date,v="function"===typeof setTimeout?setTimeout:void 0,g="function"===typeof clearTimeout?clearTimeout:void 0,y="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,b="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function w(e){d=y(function(t){g(p),e(t)}),p=v(function(){b(d),e(t.unstable_now())},100)}if("object"===typeof performance&&"function"===typeof performance.now){var x=performance;t.unstable_now=function(){return x.now()}}else t.unstable_now=function(){return m.now()};var _,k,S,E=null;if("undefined"!==typeof window?E=window:"undefined"!==typeof e&&(E=e),E&&E._schedMock){var C=E._schedMock;_=C[0],k=C[1],S=C[2],t.unstable_now=C[3]}else if("undefined"===typeof window||"function"!==typeof MessageChannel){var N=null,O=function(e){if(null!==N)try{N(e)}finally{N=null}};_=function(e){null!==N?setTimeout(_,0,e):(N=e,setTimeout(O,0,!1))},k=function(){N=null},S=function(){return!1}}else{"undefined"!==typeof console&&("function"!==typeof y&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var A=null,T=!1,I=-1,R=!1,M=!1,D=0,j=33,P=33;S=function(){return D<=t.unstable_now()};var z=new MessageChannel,L=z.port2;z.port1.onmessage=function(){T=!1;var e=A,n=I;A=null,I=-1;var r=t.unstable_now(),i=!1;if(0>=D-r){if(!(-1!==n&&n<=r))return R||(R=!0,w(B)),A=e,void(I=n);i=!0}if(null!==e){M=!0;try{e(i)}finally{M=!1}}};var B=function e(t){if(null!==A){w(e);var n=t-D+P;n<P&&j<P?(8>n&&(n=8),P=n<j?j:n):j=n,D=t+P,T||(T=!0,L.postMessage(void 0))}else R=!1};_=function(e,t){A=e,I=t,M||0>t?L.postMessage(void 0):R||(R=!0,w(B))},k=function(){A=null,T=!1,I=-1}}t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=i,a=o;i=e,o=t.unstable_now();try{return n()}finally{i=r,o=a,f()}},t.unstable_next=function(e){switch(i){case 1:case 2:case 3:var n=3;break;default:n=i}var r=i,a=o;i=n,o=t.unstable_now();try{return e()}finally{i=r,o=a,f()}},t.unstable_scheduleCallback=function(e,r){var a=-1!==o?o:t.unstable_now();if("object"===typeof r&&null!==r&&"number"===typeof r.timeout)r=a+r.timeout;else switch(i){case 1:r=a+-1;break;case 2:r=a+250;break;case 5:r=a+1073741823;break;case 4:r=a+1e4;break;default:r=a+5e3}if(e={callback:e,priorityLevel:i,expirationTime:r,next:null,previous:null},null===n)n=e.next=e.previous=e,c();else{a=null;var s=n;do{if(s.expirationTime>r){a=s;break}s=s.next}while(s!==n);null===a?a=n:a===n&&(n=e,c()),(r=a.previous).next=a.previous=e,e.next=a,e.previous=r}return e},t.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)n=null;else{e===n&&(n=t);var r=e.previous;r.next=t,t.previous=r}e.next=e.previous=null}},t.unstable_wrapCallback=function(e){var n=i;return function(){var r=i,a=o;i=n,o=t.unstable_now();try{return e.apply(this,arguments)}finally{i=r,o=a,f()}}},t.unstable_getCurrentPriorityLevel=function(){return i},t.unstable_shouldYield=function(){return!r&&(null!==n&&n.expirationTime<a||S())},t.unstable_continueExecution=function(){null!==n&&c()},t.unstable_pauseExecution=function(){},t.unstable_getFirstCallbackNode=function(){return n}}).call(this,n(17))},function(e,t,n){},,function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),a=new N(r||[]);return o._invoke=function(e,t,n){var r=l;return function(i,o){if(r===h)throw new Error("Generator is already running");if(r===d){if("throw"===i)throw o;return A()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?d:f,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=d,n.method="throw",n.arg=u.arg)}}}(e,n,a),o}
vendor: 4,351 bytes, line 1
1function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}e.wrap=u;var l="suspendedStart",f="suspendedYield",h="executing",d="completed",p={};function m(){}function v(){}function g(){}var y={};y[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(O([])));w&&w!==n&&r.call(w,o)&&(y=w);var x=g.prototype=m.prototype=Object.create(y);function _(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function k(e){var t;this._invoke=function(n,i){function o(){return new Promise(function(t,o){!function t(n,i,o,a){var s=c(e[n],e,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"===typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):Promise.resolve(l).then(function(e){u.value=e,o(u)},function(e){return t("throw",e,o,a)})}a(s.arg)}(n,i,t,o)})}return t=t?t.then(o,o):o()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var n=e[o];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:A}}function A(){return{value:t,done:!0}}return v.prototype=x.constructor=g,g.constructor=v,g[s]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},_(k.prototype),k.prototype[a]=function(){return this},e.AsyncIterator=k,e.async=function(t,n,r,i){var o=new k(u(t,n,r,i));return e.isGeneratorFunction(n)?o:o.next().then(function(e){return e.done?e.value:o.next()})},_(x),x[s]="Generator",x[o]=function(){return this},x.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);
vendor: 1,577 bytes, line 1
1var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}},,,function(e,t,n){"use strict";var r=n(140);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i}
1;return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"===typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116;function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case h:case a:case u:case s:case p:return e;default:switch(e=e&&e.$$typeof){case l:case d:case c:return e;default:return t}}case v:case m:case o:return t}}}function y(e){return g(e)===h}t.typeOf=g,t.AsyncMode=f,t.ConcurrentMode=h,t.ContextConsumer=l,t.ContextProvider=c,t.Element=i,t.ForwardRef=d,t.Fragment=a,t.Lazy=v,t.Memo=m,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=p,t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===h||e===u||e===s||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d)},t.isAsyncMode=function(e){return y(e)||g(e)===f},t.isConcurrentMode=y,t.isContextConsumer=function(e){return g(e)===l},t.isContextProvider=function(e){return g(e)===c},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return g(e)===d},t.isFragment=function(e){return g(e)===a},t.isLazy=function(e){return g(e)===v},t.isMemo=function(e){return g(e)===m},t.isPortal=function(e){return g(e)===o},t.isProfiler=function(e){return g(e)===u},t.isStrictMode=function(e){return g(e)===s},t.isSuspense=function(e){return g(e)===p}},,function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=c(e),r=n[0],a=n[1],s=new o(function(e,t,n){return 3*(t+n)/4-n}(0,r,a)),u=0,l=a>0?r-4:r,f=0;f<l;f+=4)t=i[e.charCodeAt(f)]<<18|i[e.charCodeAt(f+1)]<<12|i[e.charCodeAt(f+2)]<<6|i[e.charCodeAt(f+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===a&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,s[u++]=255&t);1===a&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;a<s;a+=16383)o.push(l(e,a,a+16383>s?s:a+16383));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],i[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*m}},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i=1,o={},a=!1,s=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){l(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"===typeof n.data&&0===n.data.indexOf(t)&&l(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),r=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){l(e.data)},r=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;
vendor: 24,792 bytes, line 1
1r=function(t){var n=s.createElement("script");n.onreadystatechange=function(){l(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():r=function(e){setTimeout(l,0,e)},u.setImmediate=function(e){"function"!==typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return o[i]=a,r(i),i++},u.clearImmediate=c}function c(e){delete o[e]}function l(e){if(a)setTimeout(l,0,e);else{var t=o[e];if(t){a=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{c(e),a=!1}}}}}("undefined"===typeof self?"undefined"===typeof e?this:e:self)}).call(this,n(17),n(31))},,function(e,t,n){"use strict";var r=n(7).Buffer,i=n(149);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i,o=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=o,i=s,t.copy(n,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},,function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(r){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(17))},function(e,t,n){"use strict";e.exports=o;var r=n(86),i=n(43);function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}i.inherits=n(5),i.inherits(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(62)},function(e,t,n){e.exports=n(37)},function(e,t,n){e.exports=n(61).Transform},function(e,t,n){e.exports=n(61).PassThrough},function(e,t,n){var r=n(5),i=n(40),o=n(7).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<30|e>>>2}function l(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,f=0;f<16;++f)n[f]=e.readInt32BE(4*f);for(;f<80;++f)n[f]=n[f-3]^n[f-8]^n[f-14]^n[f-16];for(var h=0;h<80;++h){var d=~~(h/20),p=0|((t=r)<<5|t>>>27)+l(d,i,o,s)+u+n[h]+a[d];u=s,s=o,o=c(i),i=r,r=p}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(5),i=n(40),o=n(7).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,h=0;h<16;++h)n[h]=e.readInt32BE(4*h);for(;h<80;++h)n[h]=(t=n[h-3]^n[h-8]^n[h-14]^n[h-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=c(r)+f(p,i,o,s)+u+n[d]+a[p]|0;u=s,s=o,o=l(i),i=r,r=m}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(5),i=n(87),o=n(40),a=n(7).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}r(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,n){var r=n(5),i=n(88),o=n(40),a=n(7).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}r(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,n){"use strict";var r=n(5),i=n(7).Buffer,o=n(34),a=i.alloc(128),s=64;function u(e,t){o.call(this,"digest"),"string"===typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length<s&&(t=i.concat([t,a],s));for(var n=this._ipad=i.allocUnsafe(s),r=this._opad=i.allocUnsafe(s),u=0;u<s;u++)n[u]=54^t[u],r[u]=92^t[u];this._hash=[n]}r(u,o),u.prototype._update=function(e){this._hash.push(e)},u.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=u},function(e,t,n){e.exports=n(91)},function(e,t,n){(function(t,r){var i,o=n(93),a=n(94),s=n(95),u=n(7).Buffer,c=t.crypto&&t.crypto.subtle,l={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},f=[];function h(e,t,n,r,i){return c.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return c.deriveBits({name:"PBKDF2",salt:t,iterations:n,hash:{name:i}},e,r<<3)}).then(function(e){return u.from(e)})}e.exports=function(e,n,d,p,m,v){"function"===typeof m&&(v=m,m=void 0);var g=l[(m=m||"sha1").toLowerCase()];if(!g||"function"!==typeof t.Promise)return r.nextTick(function(){var t;try{t=s(e,n,d,p,m)}catch(r){return v(r)}v(null,t)});if(o(e,n,d,p),"function"!==typeof v)throw new Error("No callback provided to pbkdf2");u.isBuffer(e)||(e=u.from(e,a)),u.isBuffer(n)||(n=u.from(n,a)),function(e,t){e.then(function(e){r.nextTick(function(){t(null,e)})},function(e){r.nextTick(function(){t(e)})})}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!c||!c.importKey||!c.deriveBits)return Promise.resolve(!1);if(void 0!==f[e])return f[e];var n=h(i=i||u.alloc(8),i,10,128,e).then(function(){return!0}).catch(function(){return!1});return f[e]=n,n}(g).then(function(t){return t?h(e,n,d,p,g):s(e,n,d,p,m)}),v)}}).call(this,n(17),n(31))},function(e,t,n){var r=n(164),i=n(67),o=n(68),a=n(179),s=n(52);function u(e,t,n){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e});throw new TypeError("invalid suite type")}function c(e,t,n){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=s(t,!1,n,r);return u(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=s(t,!1,n,r);return c(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},function(e,t,n){var r=n(34),i=n(66),o=n(5),a=n(7).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(e){r.call(this);var t,n=e.mode.toLowerCase(),i=s[n];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==n&&"des-ede-cbc"!==n||(o=a.concat([o,o.slice(0,8)]));var u=e.iv;a.isBuffer(u)||(u=a.from(u)),this._des=i.create({key:o,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=u,o(u,r),u.prototype._update=function(e){return a.from(this._des.update(e))},u.prototype._final=function(){return a.from(this._des.final())}},function(e,t,n){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},t.ip=function(e,t,n,r){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}n[r+0]=i>>>0,n[r+1]=o>>>0},t.rip=function(e,t,n,r){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.pc1=function(e,t,n,r){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,i){for(var o=0,a=0,s=r.length>>>1,u=0;u<s;u++)o<<=1,o|=e>>>r[u]&1;for(u=s;u<r.length;u++)a<<=1,a|=t>>>r[u]&1;n[i+0]=o>>>0,n[i+1]=a>>>0},t.expand=function(e,t,n){var r=0,i=0;r=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)r<<=6,r|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[n+0]=r>>>0,t[n+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var n=0,r=0;r<4;r++){n<<=4,n|=i[64*r+(e>>>18-6*r&63)]}for(r=0;r<4;r++){n<<=4,n|=i[256+64*r+(t>>>18-6*r&63)]}return n>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,n=0;n<o.length;n++)t<<=1,t|=e>>>o[n]&1;return t>>>0},t.padSplit=function(e,t,n){for(var r=e.toString(2);r.length<t;)r="0"+r;for(var i=[],o=0;o<t;o+=n)i.push(r.slice(o,o+n));return i.join(" ")}},function(e,t,n){"use strict";var r=n(20);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),r=0;r<n;r++)this.buffer[this.bufferOff+r]=e[t+r];return this.bufferOff+=n,n},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,n=0,r=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(r*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(i,n)));for(var o=e.length-(e.length-t)%this.blockSize;t<o;t+=this.blockSize)this._update(e,t,i,n),n+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},i.prototype._updateDecrypt=function(e){for(var t=0,n=0,r=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(r*this.blockSize);r>0;r--)t+=this._buffer(e,t),n+=this._flushBuffer(i,n);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,n;return e&&(t=this.update(e)),n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(n):n},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){r.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},function(e,t,n){"use strict";var r=n(20),i=n(5),o=n(66),a=o.utils,s=o.Cipher;function u(){this.tmp=new Array(2),this.keys=null}function c(e){s.call(this,e);var t=new u;this._desState=t,this.deriveKeys(t,e.key)}i(c,s),e.exports=c,c.create=function(e){return new c(e)};var l=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];c.prototype.deriveKeys=function(e,t){e.keys=new Array(32),r.equal(t.length,this.blockSize,"Invalid key length");var n=a.readUInt32BE(t,0),i=a.readUInt32BE(t,4);a.pc1(n,i,e.tmp,0),n=e.tmp[0],i=e.tmp[1];for(var o=0;o<e.keys.length;o+=2){var s=l[o>>>1];n=a.r28shl(n,s),i=a.r28shl(i,s),a.pc2(n,i,e.keys,o)}},c.prototype._update=function(e,t,n,r){var i=this._desState,o=a.readUInt32BE(e,t),s=a.readUInt32BE(e,t+4);a.ip(o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,s,i.tmp,0):this._decrypt(i,o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],a.writeUInt32BE(n,o,r),a.writeUInt32BE(n,s,r+4)},c.prototype._pad=function(e,t){for(var n=e.length-t,r=t;r<e.length;r++)e[r]=n;return!0},c.prototype._unpad=function(e){for(var t=e[e.length-1],n=e.length-t;n<e.length;n++)r.equal(e[n],t);return e.slice(0,e.length-t)},c.prototype._encrypt=function(e,t,n,r,i){for(var o=t,s=n,u=0;u<e.keys.length;u+=2){var c=e.keys[u],l=e.keys[u+1];a.expand(s,e.tmp,0),c^=e.tmp[0],l^=e.tmp[1];var f=a.substitute(c,l),h=s;s=(o^a.permute(f))>>>0,o=h}a.rip(s,o,r,i)},c.prototype._decrypt=function(e,t,n,r,i){for(var o=n,s=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],l=e.keys[u+1];a.expand(o,e.tmp,0),c^=e.tmp[0],l^=e.tmp[1];var f=a.substitute(c,l),h=o;o=(s^a.permute(f))>>>0,s=h}a.rip(o,s,r,i)}},function(e,t,n){"use strict";var r=n(20),i=n(5),o={};function a(e){r.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var n=Object.keys(o),r=0;r<n.length;r++){var a=n[r];t.prototype[a]=o[a]}return t.create=function(e){return new t(e)},t},o._cbcInit=function(){var e=new a(this.options.iv);this._cbcState=e},o._update=function(e,t,n,r){var i=this._cbcState,o=this.constructor.super_.prototype,a=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=e[t+s];o._update.call(this,a,0,n,r);for(s=0;s<this.blockSize;s++)a[s]=n[r+s]}else{o._update.call(this,e,t,n,r);for(s=0;s<this.blockSize;s++)n[r+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=e[t+s]}}},function(e,t,n){"use strict";var r=n(20),i=n(5),o=n(66),a=o.Cipher,s=o.DES;function u(e,t){r.equal(t.length,24,"Invalid key length");var n=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:n})]}function c(e){a.call(this,e);var t=new u(this.type,this.options.key);this._edeState=t}i(c,a),e.exports=c,c.create=function(e){return new c(e)},c.prototype._update=function(e,t,n,r){var i=this._edeState;i.ciphers[0]._update(e,t,n,r),i.ciphers[1]._update(n,r,n,r),i.ciphers[2]._update(n,r,n,r)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},function(e,t,n){var r=n(68),i=n(99),o=n(7).Buffer,a=n(100),s=n(34),u=n(51),c=n(52);function l(e,t,n){s.call(this),this._cache=new h,this._cipher=new u.AES(t),this._prev=o.from(n),this._mode=e,this._autopadding=!0}n(5)(l,s),l.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get();)n=this._mode.encrypt(this,t),r.push(n);return o.concat(r)};var f=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function d(e,t,n){var s=r[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"===typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"===typeof n&&(n=o.from(n)),"GCM"!==s.mode&&n.length!==s.iv)throw new TypeError("invalid iv length "+n.length);return"stream"===s.type?new a(s.module,t,n):"auth"===s.type?new i(s.module,t,n):new l(s.module,t,n)}l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=o.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),n=-1;++n<e;)t.writeUInt8(e,n);return o.concat([this.cache,t])},t.createCipheriv=d,t.createCipher=function(e,t){var n=r[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var i=c(t,!1,n.key,n.iv);return d(e,i.key,i.iv)}},function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},function(e,t,n){var r=n(44);t.encrypt=function(e,t){var n=r(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},t.decrypt=function(e,t){var n=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return r(i,n)}},function(e,t,n){var r=n(7).Buffer,i=n(44);function o(e,t,n){var o=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(o),e._prev=r.concat([e._prev,n?t:a]),a}t.encrypt=function(e,t,n){for(var i,a=r.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=r.allocUnsafe(0)),!(e._cache.length<=t.length)){a=r.concat([a,o(e,t,n)]);break}i=e._cache.length,a=r.concat([a,o(e,t.slice(0,i),n)]),t=t.slice(i)}return a}},function(e,t,n){var r=n(7).Buffer;function i(e,t,n){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=r.concat([e._prev.slice(1),r.from([n?t:i])]),i}t.encrypt=function(e,t,n){for(var o=t.length,a=r.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],n);return a}},function(e,t,n){var r=n(7).Buffer;function i(e,t,n){for(var r,i,a=-1,s=0;++a<8;)r=t&1<<7-a?128:0,s+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^r))>>a%8,e._prev=o(e._prev,n?r:i);return s}function o(e,t){var n=e.length,i=-1,o=r.allocUnsafe(e.length);for(e=r.concat([e,r.from([t])]);++i<n;)o[i]=e[i]<<1|e[i+1]>>7;return o}t.encrypt=function(e,t,n){for(var o=t.length,a=r.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],n);return a}},function(e,t,n){(function(e){var r=n(44);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,n){for(;t._cache.length<n.length;)t._cache=e.concat([t._cache,i(t)]);var o=t._cache.slice(0,n.length);return t._cache=t._cache.slice(n.length),r(n,o)}}).call(this,n(15).Buffer)},function(e,t,n){var r=n(7).Buffer,i=r.alloc(16,0);function o(e){var t=r.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,n,r=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(0!==(this.state[~~(a/8)]&1<<7-a%8)&&(i[0]^=r[0],i[1]^=r[1],i[2]^=r[2],i[3]^=r[3]),n=0!==(1&r[3]),t=3;t>0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,n&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,n){var r=n(99),i=n(7).Buffer,o=n(68),a=n(100),s=n(34),u=n(51),c=n(52);function l(e,t,n){s.call(this),this._cache=new f,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(n),this._mode=e,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function h(e,t,n){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"===typeof n&&(n=i.from(n)),"GCM"!==s.mode&&n.length!==s.iv)throw new TypeError("invalid iv length "+n.length);if("string"===typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,n,!0):"auth"===s.type?new r(s.module,t,n,!0):new l(s.module,t,n)}n(5)(l,s),l.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,t),r.push(n);return i.concat(r)},l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var n=-1;for(;++n<t;)if(e[n+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=i.concat([this.cache,e])},f.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var n=o[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=c(t,!1,n.key,n.iv);return h(e,r.key,r.iv)},t.createDecipheriv=h},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,n){(function(e){var r=n(101),i=n(183),o=n(184);
1var a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var n=new e(i[t].prime,"hex"),r=new e(i[t].gen,"hex");return new o(n,r)},t.createDiffieHellman=t.DiffieHellman=function t(n,i,s,u){return e.isBuffer(i)||void 0===a[i]?t(n,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new e([2]),e.isBuffer(s)||(s=new e(s,u)),"number"===typeof n?new o(r(n,s),s,!0):(e.isBuffer(n)||(n=new e(n,i)),new o(n,s,!0)))}}).call(this,n(15).Buffer)},,,function(e){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd4
107b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},function(e,t,n){(function(t){var r=n(13),i=new(n(102)),o=new r(24),a=new r(11),s=new r(10),u=new r(3),c=new r(7),l=n(101),f=n(39);function h(e,n){return n=n||"utf8",t.isBuffer(e)||(e=new t(e,n)),this._pub=new r(e),this}function d(e,n){return n=n||"utf8",t.isBuffer(e)||(e=new t(e,n)),this._priv=new r(e),this}e.exports=m;var p={};function m(e,t,n){this.setGenerator(t),this.__prime=new r(e),this._prime=r.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,n?(this.setPublicKey=h,this.setPrivateKey=d):this._primeCode=8}function v(e,n){var r=new t(e.toArray());return n?r.toString(n):r}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!==typeof this._primeCode&&(this._primeCode=function(e,t){var n=t.toString("hex"),r=[n,e.toString(16)].join("_");if(r in p)return p[r];var f,h=0;if(e.isEven()||!l.simpleSieve||!l.fermatTest(e)||!i.test(e))return h+=1,h+="02"===n||"05"===n?8:4,p[r]=h,h;switch(i.test(e.shrn(1))||(h+=2),n){case"02":e.mod(o).cmp(a)&&(h+=8);break;case"05":(f=e.mod(s)).cmp(u)&&f.cmp(c)&&(h+=8);break;default:h+=4}return p[r]=h,h}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new r(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(e){var n=(e=(e=new r(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(n.toArray()),o=this.getPrime();if(i.length<o.length){var a=new t(o.length-i.length);a.fill(0),i=t.concat([a,i])}return i},m.prototype.getPublicKey=function(e){return v(this._pub,e)},m.prototype.getPrivateKey=function(e){return v(this._priv,e)},m.prototype.getPrime=function(e){return v(this.__prime,e)},m.prototype.getGenerator=function(e){return v(this._gen,e)},m.prototype.setGenerator=function(e,n){return n=n||"utf8",t.isBuffer(e)||(e=new t(e,n)),this.__gen=e,this._gen=new r(e),this}}).call(this,n(15).Buffer)},function(e,t,n){(function(t){var r=n(42),i=n(59),o=n(5),a=n(186),s=n(221),u=n(91);function c(e){i.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");
vendor: 21,185 bytes, line 1
1this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function l(e){i.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){return new c(e)}function h(e){return new l(e)}Object.keys(u).forEach(function(e){u[e].id=new t(u[e].id,"hex"),u[e.toLowerCase()]=u[e]}),o(c,i.Writable),c.prototype._write=function(e,t,n){this._hash.update(e),n()},c.prototype.update=function(e,n){return"string"===typeof e&&(e=new t(e,n)),this._hash.update(e),this},c.prototype.sign=function(e,t){this.end();var n=this._hash.digest(),r=a(n,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},o(l,i.Writable),l.prototype._write=function(e,t,n){this._hash.update(e),n()},l.prototype.update=function(e,n){return"string"===typeof e&&(e=new t(e,n)),this._hash.update(e),this},l.prototype.verify=function(e,n,r){"string"===typeof n&&(n=new t(n,r)),this.end();var i=this._hash.digest();return s(n,i,e,this._signType,this._tag)},e.exports={Sign:f,Verify:h,createSign:f,createVerify:h}}).call(this,n(15).Buffer)},function(e,t,n){(function(t){var r=n(89),i=n(69),o=n(18).ec,a=n(13),s=n(54),u=n(112);function c(e,n,i,o){if((e=new t(e.toArray())).length<n.byteLength()){var a=new t(n.byteLength()-e.length);a.fill(0),e=t.concat([a,e])}var s=i.length,u=function(e,n){e=(e=l(e,n)).mod(n);var r=new t(e.toArray());if(r.length<n.byteLength()){var i=new t(n.byteLength()-r.length);i.fill(0),r=t.concat([i,r])}return r}(i,n),c=new t(s);c.fill(1);var f=new t(s);return f.fill(0),f=r(o,f).update(c).update(new t([0])).update(e).update(u).digest(),c=r(o,f).update(c).digest(),{k:f=r(o,f).update(c).update(new t([1])).update(e).update(u).digest(),v:c=r(o,f).update(c).digest()}}function l(e,t){var n=new a(e),r=(e.length<<3)-t.bitLength();return r>0&&n.ishrn(r),n}function f(e,n,i){var o,a;do{for(o=new t(0);8*o.length<e.bitLength();)n.v=r(i,n.k).update(n.v).digest(),o=t.concat([o,n.v]);a=l(o,e),n.k=r(i,n.k).update(n.v).update(new t([0])).digest(),n.v=r(i,n.k).update(n.v).digest()}while(-1!==a.cmp(e));return a}function h(e,t,n,r){return e.toRed(a.mont(n)).redPow(t).fromRed().mod(r)}e.exports=function(e,n,r,d,p){var m=s(n);if(m.curve){if("ecdsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");return function(e,n){var r=u[n.curve.join(".")];if(!r)throw new Error("unknown curve "+n.curve.join("."));var i=new o(r).keyFromPrivate(n.privateKey).sign(e);return new t(i.toDER())}(e,m)}if("dsa"===m.type){if("dsa"!==d)throw new Error("wrong private key type");return function(e,n,r){for(var i,o=n.params.priv_key,s=n.params.p,u=n.params.q,d=n.params.g,p=new a(0),m=l(e,u).mod(u),v=!1,g=c(o,u,e,r);!1===v;)i=f(u,g,r),p=h(d,i,s,u),0===(v=i.invm(u).imul(m.add(o.mul(p))).mod(u)).cmpn(0)&&(v=!1,p=new a(0));return function(e,n){e=e.toArray(),n=n.toArray(),128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n));var r=[48,e.length+n.length+4,2,e.length];return r=r.concat(e,[2,n.length],n),new t(r)}(p,v)}(e,m,r)}if("rsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");e=t.concat([p,e]);for(var v=m.modulus.byteLength(),g=[0,1];e.length+g.length+1<v;)g.push(255);g.push(0);for(var y=-1;++y<e.length;)g.push(e[y]);return i(g,m)},e.exports.getKey=c,e.exports.makeKey=f}).call(this,n(15).Buffer)},function(e){e.exports={name:"elliptic",version:"6.4.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"[email protected]:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <[email protected]>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}},function(e,t,n){"use strict";var r=t,i=n(13),o=n(20),a=n(104);r.assert=o,r.toArray=a.toArray,r.zero2=a.zero2,r.toHex=a.toHex,r.encode=a.encode,r.getNAF=function(e,t){for(var n=[],r=1<<t+1,i=e.clone();i.cmpn(1)>=0;){var o;if(i.isOdd()){var a=i.andln(r-1);o=a>(r>>1)-1?(r>>1)-a:a,i.isubn(o)}else o=0;n.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(r-1)?t+1:1,u=1;u<s;u++)n.push(0);i.iushrn(s)}return n},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r=0,i=0;e.cmpn(-r)>0||t.cmpn(-i)>0;){var o,a,s,u=e.andln(3)+r&3,c=t.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),o=0===(1&u)?0:3!==(s=e.andln(7)+r&7)&&5!==s||2!==c?u:-u,n[0].push(o),a=0===(1&c)?0:3!==(s=t.andln(7)+i&7)&&5!==s||2!==u?c:-c,n[1].push(a),2*r===o+1&&(r=1-r),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n},r.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,n){"use strict";var r=n(13),i=n(18).utils,o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var n=e._getDoubles(),r=o(t,1),i=(1<<n.step+1)-(n.step%2===0?2:1);i/=3;for(var a=[],u=0;u<r.length;u+=n.step){var c=0;for(t=u+n.step-1;t>=u;t--)c=(c<<1)+r[t];a.push(c)}for(var l=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=i;h>0;h--){for(u=0;u<a.length;u++){(c=a[u])===h?f=f.mixedAdd(n.points[u]):c===-h&&(f=f.mixedAdd(n.points[u].neg()))}l=l.add(f)}return l.toP()},u.prototype._wnafMul=function(e,t){var n=4,r=e._getNAFPoints(n);n=r.wnd;for(var i=r.points,a=o(t,n),u=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(t=0;c>=0&&0===a[c];c--)t++;if(c>=0&&t++,u=u.dblp(t),c<0)break;var l=a[c];s(0!==l),u="affine"===e.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,n,r,i){for(var s=this._wnafT1,u=this._wnafT2,c=this._wnafT3,l=0,f=0;f<r;f++){var h=(E=t[f])._getNAFPoints(e);s[f]=h.wnd,u[f]=h.points}for(f=r-1;f>=1;f-=2){var d=f-1,p=f;if(1===s[d]&&1===s[p]){var m=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(m[1]=t[d].add(t[p]),m[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(m[1]=t[d].toJ().mixedAdd(t[p]),m[2]=t[d].add(t[p].neg())):(m[1]=t[d].toJ().mixedAdd(t[p]),m[2]=t[d].toJ().mixedAdd(t[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=a(n[d],n[p]);l=Math.max(g[0].length,l),c[d]=new Array(l),c[p]=new Array(l);for(var y=0;y<l;y++){var b=0|g[0][y],w=0|g[1][y];c[d][y]=v[3*(b+1)+(w+1)],c[p][y]=0,u[d]=m}}else c[d]=o(n[d],s[d]),c[p]=o(n[p],s[p]),l=Math.max(c[d].length,l),l=Math.max(c[p].length,l)}var x=this.jpoint(null,null,null),_=this._wnafT4;for(f=l;f>=0;f--){for(var k=0;f>=0;){var S=!0;for(y=0;y<r;y++)_[y]=0|c[y][f],0!==_[y]&&(S=!1);if(!S)break;k++,f--}if(f>=0&&k++,x=x.dblp(k),f<0)break;for(y=0;y<r;y++){var E,C=_[y];0!==C&&(C>0?E=u[y][C-1>>1]:C<0&&(E=u[y][-C-1>>1].neg()),x="affine"===E.type?x.mixedAdd(E):x.add(E))}}for(f=0;f<r;f++)u[f]=null;return i?x:x.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1===2*n)return 6===e[0]?s(e[e.length-1]%2===0):7===e[0]&&s(e[e.length-1]%2===1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)r=r.dbl();n.push(r)}return{step:e,points:n}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)t[i]=t[i-1].add(r);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t}},function(e,t,n){"use strict";var r=n(53),i=n(18),o=n(13),a=n(5),s=r.base,u=i.utils.assert;function c(e){s.call(this,"short",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(e,t,n,r){s.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(t,16),this.y=new o(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,n,r){s.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(t,16),this.y=new o(n,16),this.z=new o(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new o(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)n=new o(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?n=i[0]:(n=i[1],u(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:n,basis:e.basis?e.basis.map(function(e){return{a:new o(e.a,16),b:new o(e.b,16)}}):this._getEndoBasis(n)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:o.mont(e),n=new o(2).toRed(t).redInvm(),r=n.redNeg(),i=new o(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,n,r,i,a,s,u,c,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,d=this.n.clone(),p=new o(1),m=new o(0),v=new o(0),g=new o(1),y=0;0!==h.cmpn(0);){var b=d.div(h);c=d.sub(b.mul(h)),l=v.sub(b.mul(p));var w=g.sub(b.mul(m));if(!r&&c.cmp(f)<0)t=u.neg(),n=p,r=c.neg(),i=l;else if(r&&2===++y)break;u=c,d=h,h=c,v=p,p=l,g=m,m=w}a=c.neg(),s=l;var x=r.sqr().add(i.sqr());return a.sqr().add(s.sqr()).cmp(x)>=0&&(a=t,s=n),r.negative&&(r=r.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:r,b:i},{a:a,b:s}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),c=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},c.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),r[2*o]=s,r[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,r,i,2*o,n),l=0;l<2*o;l++)r[l]=null,i[l]=null;return c},a(l,s.BasePoint),c.prototype.point=function(e,t,n){return new l(this,e,t,n)},c.prototype.pointFromJSON=function(e,t){return l.fromJSON(this,e,t)},l.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},l.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},l.fromJSON=function(e,t,n){"string"===typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function i(t){return e.point(t[0],t[1],n)}var o=t[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(i))}},r},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},l.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return e=new o(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},l.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},l.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,s.BasePoint),c.prototype.jpoint=function(e,t,n){return new f(this,e,t,n)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=r.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=n.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(i.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,n=0;n<e;n++)t=t.dbl();return t}var r=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(n=0;n<e;n++){var l=o.redSqr(),f=c.redSqr(),h=f.redSqr(),d=l.redAdd(l).redIAdd(l).redIAdd(r.redMul(u)),p=o.redMul(f),m=d.redSqr().redISub(p.redAdd(p)),v=p.redISub(m),g=d.redMul(v);g=g.redIAdd(g).redISub(h);var y=c.redMul(s);n+1<e&&(u=u.redMul(h)),o=m,s=y,c=g}return this.curve.jpoint(o,c.redMul(i),s)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(l).redISub(h);d=d.redIAdd(d);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),v=h.redIAdd(h);v=(v=v.redIAdd(v)).redIAdd(v),e=m.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(v),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},f.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),d=this.x.redSub(l).redMul(this.x.redAdd(l));d=d.redAdd(d).redIAdd(d);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(m),n=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var v=f.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),t=d.redMul(p.redISub(e)).redISub(v)}return this.curve.jpoint(e,t,n)},f.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),o=t.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),l=s.redSqr().redISub(c.redAdd(c)),f=c.redISub(l),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=s.redMul(f).redISub(h),p=n.redAdd(n).redMul(r);return this.curve.jpoint(l,d,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
vendor: 5,242 bytes, line 1
1var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(s).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(f,h,d)},f.prototype.mul=function(e,t){return e=new o(e,t),this.curve._wnafMul(this,e)},f.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(0!==this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),i=n.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)},f.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(n))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,n){"use strict";var r=n(53),i=n(13),o=n(5),a=r.base,s=n(18).utils;function u(e){a.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,n){a.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),e.exports=u,u.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},o(c,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new c(this,e,t)},u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=i.redMul(r),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},c.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,n){"use strict";var r=n(53),i=n(18),o=n(13),a=n(5),s=r.base,u=i.utils.assert;function c(e){this.twisted=1!==(0|e.a),this.mOneA=this.twisted&&-1===(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|e.c)}function l(e,t,n,r,i){s.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(n,16),this.z=r?new o(r,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}
vendor: 9,859 bytes, line 1
1a(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},c.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=r.redMul(i.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},c.prototype.pointFromY=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=r.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},a(l,s.BasePoint),c.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},c.prototype.point=function(e,t,n,r){return new l(this,e,t,n,r)},l.fromJSON=function(e,t){return new l(e,t[0],t[1],t[2])},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=r.redAdd(t),a=o.redSub(n),s=r.redSub(t),u=i.redMul(a),c=o.redMul(s),l=i.redMul(s),f=a.redMul(o);return this.curve.point(u,c,f,l)},l.prototype._projDbl=function(){var e,t,n,r=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=r.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),n=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=r.redSub(i).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),n=a.redMul(u)}}else{var c=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(r.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(i.redISub(o)),n=c.redMul(u)}return this.curve.point(e,t,n)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=i.redSub(r),s=i.redAdd(r),u=n.redAdd(t),c=o.redMul(a),l=s.redMul(u),f=o.redMul(u),h=a.redMul(s);return this.curve.point(c,l,h,f)},l.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=r.redMul(u).redMul(l);return this.curve.twisted?(t=r.redMul(c).redMul(a.redSub(this.curve._mulA(o))),n=u.redMul(c)):(t=r.redMul(c).redMul(a.redSub(o)),n=this.curve._mulC(u).redMul(c)),this.curve.point(f,t,n)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},l.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},function(e,t,n){"use strict";var r,i=t,o=n(70),a=n(18),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var n=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:n}),n}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(200)}catch(l){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
vendor: 4,195 bytes, line 1
1,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(e,t,n){"use strict";t.sha1=n(195),t.sha224=n(196),t.sha256=n(106),t.sha384=n(197),t.sha512=n(107)},function(e,t,n){"use strict";var r=n(25),i=n(45),o=n(105),a=r.rotl32,s=r.sum32,u=r.sum32_5,c=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(h,l),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=a(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],h=this.h[3],d=this.h[4];for(r=0;r<n.length;r++){var p=~~(r/20),m=u(a(i,5),c(p,o,l,h),d,n[r],f[p]);d=h,h=l,l=a(o,30),o=i,i=m}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],l),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],d)},h.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},function(e,t,n){"use strict";var r=n(25),i=n(106);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}r.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}},function(e,t,n){"use strict";var r=n(25),i=n(107);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}r.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}},function(e,t,n){"use strict";var r=n(25),i=n(45),o=r.rotl32,a=r.sum32,s=r.sum32_3,u=r.sum32_4,c=i.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}r.inherits(l,c),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],i=this.h[2],c=this.h[3],l=this.h[4],y=n,b=r,w=i,x=c,_=l,k=0;k<80;k++){var S=a(o(u(n,f(k,r,i,c),e[p[k]+t],h(k)),v[k]),l);n=l,l=c,c=o(i,10),i=r,r=S,S=a(o(u(y,f(79-k,b,w,x),e[m[k]+t],d(k)),g[k]),_),y=_,_=x,x=o(w,10),w=b,b=S}S=s(this.h[1],i,x),this.h[1]=s(this.h[2],c,_),this.h[2]=s(this.h[3],l,y),this.h[3]=s(this.h[4],n,b),this.h[4]=s(this.h[0],r,w),this.h[0]=S},l.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"little"):r.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],v=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(e,t,n){"use strict";var r=n(25),i=n(20
vendor: 19,100 bytes, line 1
1);function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(t,n))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0
vendor: 7,734 bytes, line 1
1a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},
vendor: 35,010 bytes, line 1
1function(e,t,n){"use strict";var r=n(13),i=n(202),o=n(18),a=o.utils.assert,s=n(203),u=n(204);function c(e){if(!(this instanceof c))return new c(e);"string"===typeof e&&(a(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=c,c.prototype.keyPair=function(e){return new s(this,e)},c.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},c.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},c.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new r(2));;){var s=new r(t.generate(n));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},c.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},c.prototype.sign=function(e,t,n,o){"object"===typeof n&&(o=n,n=null),o||(o={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new r(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),c=e.toArray("be",a),l=new i({hash:this.hash,entropy:s,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new r(1)),h=0;;h++){var d=o.k?o.k(h):new r(l.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),v=m.umod(this.n);if(0!==v.cmpn(0)){var g=d.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(v)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new u({r:v,s:g,recoveryParam:y})}}}}}},c.prototype.verify=function(e,t,n,i){e=this._truncateToN(new r(e,16)),n=this.keyFromPublic(n,i);var o=(t=new u(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),l=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(l,n.getPublic(),f)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(l,n.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(e,t,n,i){a((3&n)===n,"The recovery param is more than two bits"),t=new u(t,i);var o=this.n,s=new r(e),c=t.r,l=t.s,f=1&n,h=n>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");c=h?this.curve.pointFromX(c.add(this.curve.n),f):this.curve.pointFromX(c,f);var d=t.r.invm(o),p=o.sub(s).mul(d).umod(o),m=l.mul(d).umod(o);return this.g.mulAdd(p,c,m)},c.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new u(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,n){"use strict";var r=n(70),i=n(104),o=n(20);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),n=i.toArray(e.nonce,e.nonceEnc||"hex"),r=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}e.exports=a,a.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,n,r){"string"!==typeof t&&(r=n,n=t,t=null),e=i.toArray(e,t),n=i.toArray(n,r),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},a.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=n,n=t,t=null),n&&(n=i.toArray(n,r||"hex"),this._update(n));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(n),this._reseed++,i.encode(a,t)}},function(e,t,n){"use strict";var r=n(13),i=n(18).utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,n){return t instanceof o?t:new o(e,{pub:t,pubEnc:n})},o.fromPrivate=function(e,t,n){return t instanceof o?t:new o(e,{priv:t,privEnc:n})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"===typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,n){"use strict";var r=n(13),i=n(18).utils,o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var n=e[t.place++];if(!(128&n))return n;for(var r=15&n,i=0,o=0,a=t.place;o<r;o++,a++)i<<=8,i|=e[a];return t.place=a,i}function c(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t<n;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var n=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var n=new s;if(48!==e[n.place++])return!1;if(u(e,n)+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var o=u(e,n),a=e.slice(n.place,o+n.place);if(n.place+=o,2!==e[n.place++])return!1;var c=u(e,n);if(e.length!==c+n.place)return!1;var l=e.slice(n.place,c+n.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===l[0]&&128&l[1]&&(l=l.slice(1)),this.r=new r(a),this.s=new r(l),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=c(t),n=c(n);!n[0]&&!(128&n[1]);)n=n.slice(1);var r=[2];l(r,t.length),(r=r.concat(t)).push(2),l(r,n.length);var o=r.concat(n),a=[48];return l(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,n){"use strict";var r=n(70),i=n(18),o=i.utils,a=o.assert,s=o.parseBytes,u=n(206),c=n(207);function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}e.exports=l,l.prototype.sign=function(e,t){e=s(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),i=this.g.mul(r),o=this.encodePoint(i),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),u=r.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},l.prototype.verify=function(e,t,n){e=s(e),t=this.makeSignature(t);var r=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),r.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(r.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),r=0!==(128&e[t]),i=o.intFromLE(n);return this.curve.pointFromY(i,r)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return o.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,n){"use strict";var r=n(18).utils,i=r.assert,o=r.parseBytes,a=r.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[n]&=127,r[n]|=64,r}),a(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),r.encode(this.secret(),e)},s.prototype.getPublic=function(e){return r.encode(this.pubBytes(),e)},e.exports=s},function(e,t,n){"use strict";var r=n(13),i=n(18).utils,o=i.assert,a=i.cachedProperty,s=i.parseBytes;function u(e,t){this.eddsa=e,"object"!==typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof r&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),a(u,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),a(u,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),a(u,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},function(e,t,n){"use strict";var r=n(46);t.certificate=n(218);var i=r.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});t.RSAPrivateKey=i;var o=r.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});t.RSAPublicKey=o;var a=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});t.PublicKey=a;var s=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=r.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});t.PrivateKey=u;var c=r.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});t.EncryptedPrivateKey=c;var l=r.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});t.DSAPrivateKey=l,t.DSAparam=r.define("DSAparam",function(){this.int()});var f=r.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});t.ECPrivateKey=f;var h=r.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});t.signature=r.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},function(e,t,n){var r=n(46),i=n(5);function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new o(e,t)},o.prototype._createNamed=function(e){var t;try{t=n(210).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(r){t=function(e){this._initNamed(e)}}return i(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},o.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r.decoders[e])),this.decoders[e]},o.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},o.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(r.encoders[e])),this.encoders[e]},o.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}},function(module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)t.push(n);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,n){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:n})}}catch(e){return function(e,t,n){e[t]=n}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var n=t.contentWindow,r=n.eval,i=n.execScript;!r&&i&&(i.call(n,"null"),r=n.eval),forEach(Object_keys(e),function(t){n[t]=e[t]}),forEach(globals,function(t){e[t]&&(n[t]=e[t])});var o=Object_keys(n),a=r.call(n,this.code);return forEach(Object_keys(n),function(t){(t in e||-1===indexOf(o,t))&&(e[t]=n[t])}),forEach(globals,function(t){t in e||defineProp(e,t,n[t])}),document.body.removeChild(t),a},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),n=this.runInContext(t);return e&&forEach(Object_keys(t),function(n){e[n]=t[n]}),n},forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var n=Script(t);return n[e].apply(n,[].slice.call(arguments,1))}}),exports.isContext=function(e){return e instanceof Context},exports.createScript=function(e){return exports.Script(e)},exports.createContext=Script.createContext=function(e){var t=new Context;return"object"===typeof e&&forEach(Object_keys(e),function(n){t[n]=e[n]}),t}},function(e,t,n){var r=n(5);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,n){var r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=n)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){var t=this._reporterState,n=t.obj;return t.obj=e,n},i.prototype.error=function(e){var t,n=this._reporterState,r=e instanceof o;if(t=r?e:new o(n.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},i.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},function(e,t,n){var r=n(47).Reporter,i=n(47).EncoderBuffer,o=n(47).DecoderBuffer,a=n(20),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function c(e,t){var n={};this._baseState=n,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=c;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){var e=this._baseState,t={};l.forEach(function(n){t[n]=e[n]});var n=new this.constructor(t.parent);return n._baseState=t,n},c.prototype._wrap=function(){var e=this._baseState;u.forEach(function(t){this[t]=function(){var n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}},this)},c.prototype._init=function(e){var t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),a.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){var t=this._baseState,n=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==n.length&&(a(null===t.children),t.children=n,n.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!==typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(n){n==(0|n)&&(n|=0);var r=e[n];t[r]=n}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){c.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),s.forEach(function(e){c.prototype[e]=function(){var t=this._baseState,n=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(n),this}}),c.prototype.use=function(e){a(e);var t=this._baseState;return a(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){var t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){var t=this._baseState;return a(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){var t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},c.prototype.contains=function(e){var t=this._baseState;return a(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){var n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));var r,i=n.default,a=!0,s=null;if(null!==n.key&&(s=e.enterKey(n.key)),n.optional){var u=null;if(null!==n.explicit?u=n.explicit:null!==n.implicit?u=n.implicit:null!==n.tag&&(u=n.tag),null!==u||n.any){if(a=this._peekTag(e,u,n.any),e.isError(a))return a}else{var c=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),a=!0}catch(p){a=!1}e.restore(c)}}if(n.obj&&a&&(r=e.enterObject()),a){if(null!==n.explicit){var l=this._decodeTag(e,n.explicit);if(e.isError(l))return l;e=l}var f=e.offset;if(null===n.use&&null===n.choice){if(n.any)c=e.save();var h=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(h))return h;n.any?i=e.raw(c):e=h}if(t&&t.track&&null!==n.tag&&t.track(e.path(),f,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),i=n.any?i:null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),e.isError(i))return i;if(n.any||null!==n.choice||null===n.children||n.children.forEach(function(n){n._decode(e,t)}),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){var d=new o(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(d,t)}}return n.obj&&a&&(i=e.leaveObject(r)),null===n.key||null===i&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,n.key,i),i},c.prototype._decodeGeneric=function(e,t,n){var r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){var n=this._baseState;return n.useDecoder=this._use(e,t),a(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},c.prototype._decodeChoice=function(e,t){var n=this._baseState,r=null,i=!1;return Object.keys(n.choice).some(function(o){var a=e.save(),s=n.choice[o];try{var u=s._decode(e,t);if(e.isError(u))return!1;r={type:o,value:u},i=!0}catch(c){return e.restore(a),!1}return!0},this),i?r:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},c.prototype._encode=function(e,t,n){var r=this._baseState;if(null===r.default||r.default!==e){var i=this._encodeValue(e,t,n);if(void 0!==i&&!this._skipDefault(i,t,n))return i}},c.prototype._encodeValue=function(e,t,n){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new r);var o=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}var a=null,s=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)a=this._getUse(i.contains,n)._encode(e,t),s=!0;else if(i.children)a=i.children.map(function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");var r=t.enterKey(n._baseState.key);if("object"!==typeof e)return t.error("Child expected, but input is not object");var i=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),i},this).filter(function(e){return e}),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,a=this._createEncoderBuffer(e.map(function(n){var r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)},u))}else null!==i.use?o=this._getUse(i.use,n)._encode(e,t):(a=this._encodePrimitive(i.tag,e),s=!0);if(!i.any&&null===i.choice){var c=null!==i.implicit?i.implicit:i.tag,l=null===i.implicit?"universal":"context";null===c?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(c,s,l,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(e,t){var n=this._baseState,r=n.choice[e.type];return r||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){var n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},function(e,t,n){var r=n(109);t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r._reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=r._reverse(t.tag)},function(e,t,n){var r=t;r.der=n(110),r.pem=n(215)},function(e,t,n){var r=n(5),i=n(15).Buffer,o=n(110);function a(e){o.call(this,e),this.enc="pem"}r(a,o),e.exports=a,a.prototype.decode=function(e,t){for(var n=e.toString().split(/[\r\n]+/g),r=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,u=-1,c=0;c<n.length;c++){var l=n[c].match(a);if(null!==l&&l[2]===r){if(-1!==s){if("END"!==l[1])break;u=c;break}if("BEGIN"!==l[1])break;s=c}}if(-1===s||-1===u)throw new Error("PEM section not found for: "+r);var f=n.slice(s+1,u).join("");f.replace(/[^a-z0-9\+\/=]+/gi,"");var h=new i(f,"base64");return o.prototype.decode.call(this,h,t)}},function(e,t,n){var r=t;r.der=n(111),r.pem=n(217)},function(e,t,n){var r=n(5),i=n(111);function o(e){i.call(this,e),this.enc="pem"}r(o,i),e.exports=o,o.prototype.encode=function(e,t){for(var n=i.prototype.encode.call(this,e).toString("base64"),r=["-----BEGIN "+t.label+"-----"],o=0;o<n.length;o+=64)r.push(n.slice(o,o+64));return r.push("-----END "+t.label+"-----"),r.join("\n")}},function(e,t,n){"use strict";var r=n(46),i=r.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=r.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=r.define("RelativeDistinguishedName",function(){this.setof(o)}),c=r.define("RDNSequence",function(){this.seqof(u)}),l=r.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),f=r.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),h=r.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=r.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(f),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=r.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});e.exports=p},function(e){e.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},function(e,t,n){var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,a=n(52),s=n(67),u=n(7).Buffer;e.exports=function(e,t){var n,c=e.toString(),l=c.match(r);if(l){var f="aes"+l[1],h=u.from(l[2],"hex"),d=u.from(l[3].replace(/[\r\n]/g,""),"base64"),p=a(t,h.slice(0,8),parseInt(l[1],10)).key,m=[],v=s.createDecipheriv(f,p,h);m.push(v.update(d)),m.push(v.final()),n=u.concat(m)}else{var g=c.match(o);n=new u(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:n}}},function(e,t,n){(function(t){var r=n(13),i=n(18).ec,o=n(54),a=n(112);function s(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,n,u,c,l){var f=o(u);if("ec"===f.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,n){var r=a[n.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var o=new i(r),s=n.data.subjectPrivateKey.data;return o.verify(t,e,s)}(e,n,f)}if("dsa"===f.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,n){var i=n.data.p,a=n.data.q,u=n.data.g,c=n.data.pub_key,l=o.signature.decode(e,"der"),f=l.s,h=l.r;s(f,a),s(h,a);var d=r.mont(i),p=f.invm(a);return 0===u.toRed(d).redPow(new r(t).mul(p).mod(a)).fromRed().mul(c.toRed(d).redPow(h.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(h)}(e,n,f)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");n=t.concat([l,n]);for(var h=f.modulus.byteLength(),d=[1],p=0;n.length+d.length+2<h;)d.push(255),p++;d.push(0);for(var m=-1;++m<n.length;)d.push(n[m]);d=new t(d);var v=r.mont(f.modulus);e=(e=new r(e).toRed(v)).redPow(new r(f.publicExponent)),e=new t(e.fromRed().toArray());var g=p<8?1:0;for(h=Math.min(e.length,d.length),e.length!==d.length&&(g=1),m=-1;++m<h;)g|=e[m]^d[m];return 0===g}}).call(this,n(15).Buffer)},function(e,t,n){(function(t){var r=n(18),i=n(13);e.exports=function(e){return new a(e)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(e){this.curveType=o[e],this.curveType||(this.curveType={name:e}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}function s(e,n,r){Array.isArray(e)||(e=e.toArray());var i=new t(e);if(r&&i.length<r){var o=new t(r-i.length);o.fill(0),i=t.concat([o,i])}return n?i.toString(n):i}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,a.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},a.prototype.computeSecret=function(e,n,r){return n=n||"utf8",t.isBuffer(e)||(e=new t(e,n)),s(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},a.prototype.getPublicKey=function(e,t){var n=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(n[n.length-1]%2?n[0]=7:n[0]=6),s(n,e)},a.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)},a.prototype.setPublicKey=function(e,n){return n=n||"utf8",t.isBuffer(e)||(e=new t(e,n)),this.keys._importPublic(e),this}
1,a.prototype.setPrivateKey=function(e,n){n=n||"utf8",t.isBuffer(e)||(e=new t(e,n));var r=new i(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}}).call(this,n(15).Buffer)},function(e,t,n){t.publicEncrypt=n(224),t.privateDecrypt=n(225),t.privateEncrypt=function(e,n){return t.publicEncrypt(e,n,!0)},t.publicDecrypt=function(e,n){return t.privateDecrypt(e,n,!0)}},function(e,t,n){var r=n(54),i=n(39),o=n(42),a=n(113),s=n(114),u=n(13),c=n(115),l=n(69),f=n(7).Buffer;e.exports=function(e,t,n){var h;h=e.padding?e.padding:n?1:4;var d,p=r(e);if(4===h)d=function(e,t){var n=e.modulus.byteLength(),r=t.length,c=o("sha1").update(f.alloc(0)).digest(),l=c.length,h=2*l;if(r>n-h-2)throw new Error("message too long");var d=f.alloc(n-r-h-2),p=n-l-1,m=i(l),v=s(f.concat([c,d,f.alloc(1,1),t],p),a(m,p)),g=s(m,a(v,l));return new u(f.concat([f.alloc(1),g,v],n))}(p,t);else if(1===h)d=function(e,t,n){var r,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");r=n?f.alloc(a-o-3,255):function(e){var t,n=f.allocUnsafe(e),r=0,o=i(2*e),a=0;for(;r<e;)a===o.length&&(o=i(2*e),a=0),(t=o[a++])&&(n[r++]=t);return n}(a-o-3);return new u(f.concat([f.from([0,n?1:2]),r,f.alloc(1),t],a))}(p,t,n);else{if(3!==h)throw new Error("unknown padding");if((d=new u(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return n?l(d,p):c(d,p)}},function(e,t,n){var r=n(54),i=n(113),o=n(114),a=n(13),s=n(69),u=n(42),c=n(115),l=n(7).Buffer;e.exports=function(e,t,n){var f;f=e.padding?e.padding:n?1:4;var h,d=r(e),p=d.modulus.byteLength();if(t.length>p||new a(t).cmp(d.modulus)>=0)throw new Error("decryption error");h=n?c(new a(t),d):s(t,d);var m=l.alloc(p-h.length);if(h=l.concat([m,h],p),4===f)return function(e,t){var n=e.modulus.byteLength(),r=u("sha1").update(l.alloc(0)).digest(),a=r.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),c=t.slice(a+1),f=o(s,i(c,a)),h=o(c,i(f,n-a-1));if(function(e,t){e=l.from(e),t=l.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));var i=-1;for(;++i<r;)n+=e[i]^t[i];return n}(r,h.slice(0,a)))throw new Error("decryption error");var d=a;for(;0===h[d];)d++;if(1!==h[d++])throw new Error("decryption error");return h.slice(d)}(d,h);if(1===f)return function(e,t,n){var r=t.slice(0,2),i=2,o=0;for(;0!==t[i++];)if(i>=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==r.toString("hex")&&!n||"0001"!==r.toString("hex")&&n)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,h,n);if(3===f)return h;throw new Error("unknown padding")}},function(e,t,n){"use strict";(function(e,r){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=n(7),a=n(39),s=o.Buffer,u=o.kMaxLength,c=e.crypto||e.msCrypto,l=Math.pow(2,32)-1;function f(e,t){if("number"!==typeof e||e!==e)throw new TypeError("offset must be a number");if(e>l||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function h(e,t,n){if("number"!==typeof e||e!==e)throw new TypeError("size must be a number");if(e>l||e<0)throw new TypeError("size must be a uint32");if(e+t>n||e>u)throw new RangeError("buffer too small")}function d(e,t,n,i){if(r.browser){var o=e.buffer,s=new Uint8Array(o,t,n);return c.getRandomValues(s),i?void r.nextTick(function(){i(null,e)}):e}if(!i)return a(n).copy(e,t),e;a(n,function(n,r){if(n)return i(n);r.copy(e,t),i(null,e)})}c&&c.getRandomValues||!r.browser?(t.randomFill=function(t,n,r,i){if(!s.isBuffer(t)&&!(t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof n)i=n,n=0,r=t.length;else if("function"===typeof r)i=r,r=t.length-n;else if("function"!==typeof i)throw new TypeError('"cb" argument must be a function');return f(n,t.length),h(r,n,t.length),d(t,n,r,i)},t.randomFillSync=function(t,n,r){"undefined"===typeof n&&(n=0);if(!s.isBuffer(t)&&!(t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');f(n,t.length),void 0===r&&(r=t.length-n);return h(r,n,t.length),d(t,n,r)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,n(17),n(31))},,,,,,function(e,t,n){"use strict";t.__esModule=!0;var r=n(2),i=(a(r),a(n(1))),o=a(n(71));a(n(233));
1function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function c(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=1073741823;t.default=function(e,t){var n,a,f="__create-react-context-"+(0,o.default)()+"__",h=function(e){function n(){var t,r;s(this,n);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r=u(this,e.call.apply(e,[this].concat(o))),r.emitter=function(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter(function(t){return t!==e})},get:function(){return e},set:function(n,r){e=n,t.forEach(function(t){return t(e,r)})}}}(r.props.value),u(r,t)}return c(n,e),n.prototype.getChildContext=function(){var e;return(e={})[f]=this.emitter,e},n.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n=this.props.value,r=e.value,i=void 0;((o=n)===(a=r)?0!==o||1/o===1/a:o!==o&&a!==a)?i=0:(i="function"===typeof t?t(n,r):l,0!==(i|=0)&&this.emitter.set(e.value,i))}var o,a},n.prototype.render=function(){return this.props.children},n}(r.Component);h.childContextTypes=((n={})[f]=i.default.object.isRequired,n);var d=function(t){function n(){var e,r;s(this,n);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return e=r=u(this,t.call.apply(t,[this].concat(o))),r.state={value:r.getValue()},r.onUpdate=function(e,t){0!==((0|r.observedBits)&t)&&r.setState({value:r.getValue()})},u(r,e)}return c(n,t),n.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=void 0===t||null===t?l:t},n.prototype.componentDidMount=function(){this.context[f]&&this.context[f].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=void 0===e||null===e?l:e},n.prototype.componentWillUnmount=function(){this.context[f]&&this.context[f].off(this.onUpdate)},n.prototype.getValue=function(){return this.context[f]?this.context[f].get():e},n.prototype.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(r.Component);return d.contextTypes=((a={})[f]=i.default.object,a),{Provider:h,Consumer:d}},e.exports=t.default},function(e,t,n){"use strict";var r=n(234);e.exports=r},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},,function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(2),a=n.n(o),s=n(1),u=n.n(s),c=n(10),l=n.n(c),f=n(3),h={children:u.a.node,row:u.a.bool,check:u.a.bool,inline:u.a.bool,disabled:u.a.bool,tag:f.d,className:u.a.string,cssModule:u.a.object},d=function(e){var t=e.className,n=e.cssModule,o=e.row,s=e.disabled,u=e.check,c=e.inline,h=e.tag,d=Object(i.a)(e,["className","cssModule","row","disabled","check","inline","tag"]),p=Object(f.b)(l()(t,!!o&&"row",u?"form-check":"form-group",!(!u||!c)&&"form-check-inline",!(!u||!s)&&"disabled"),n);return a.a.createElement(h,Object(r.a)({},d,{className:p}))};d.propTypes=h,d.defaultProps={tag:"div"},t.a=d},function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(2),a=n.n(o),s=n(1),u=n.n(s),c=n(10),l=n.n(c),f=n(123),h=n.n(f),d=n(3),p=u.a.oneOfType([u.a.number,u.a.string]),m=u.a.oneOfType([u.a.string,u.a.number,u.a.shape({size:p,order:p,offset:p})]),v={children:u.a.node,hidden:u.a.bool,check:u.a.bool,size:u.a.string,for:u.a.string,tag:d.d,className:u.a.string,cssModule:u.a.object,xs:m,sm:m,md:m,lg:m,xl:m,widths:u.a.array},g={tag:"label",widths:["xs","sm","md","lg","xl"]},y=function(e,t,n){return!0===n||""===n?e?"col":"col-"+t:"auto"===n?e?"col-auto":"col-"+t+"-auto":e?"col-"+n:"col-"+t+"-"+n},b=function(e){var t=e.className,n=e.cssModule,o=e.hidden,s=e.widths,u=e.tag,c=e.check,f=e.size,p=e.for,m=Object(i.a)(e,["className","cssModule","hidden","widths","tag","check","size","for"]),v=[];
1s.forEach(function(t,r){var i=e[t];if(delete m[t],i||""===i){var o,a=!r;if(h()(i)){var s,u=a?"-":"-"+t+"-";o=y(a,t,i.size),v.push(Object(d.b)(l()(((s={})[o]=i.size||""===i.size,s["order"+u+i.order]=i.order||0===i.order,s["offset"+u+i.offset]=i.offset||0===i.offset,s))),n)}else o=y(a,t,i),v.push(o)}});var g=Object(d.b)(l()(t,!!o&&"sr-only",!!c&&"form-check-label",!!f&&"col-form-label-"+f,v,!!v.length&&"col-form-label"),n);return a.a.createElement(u,Object(r.a)({htmlFor:p},m,{className:g}))};b.propTypes=v,b.defaultProps=g,t.a=b},function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(14),a=n(11),s=n(2),u=n.n(s),c=n(1),l=n.n(c),f=n(10),h=n.n(f),d=n(3),p={children:l.a.node,type:l.a.string,size:l.a.string,bsSize:l.a.string,valid:l.a.bool,invalid:l.a.bool,tag:d.d,innerRef:l.a.oneOfType([l.a.object,l.a.func,l.a.string]),plaintext:l.a.bool,addon:l.a.bool,className:l.a.string,cssModule:l.a.object},m=function(e){function t(t){var n;return(n=e.call(this,t)||this).getRef=n.getRef.bind(Object(o.a)(n)),n.focus=n.focus.bind(Object(o.a)(n)),n}Object(a.a)(t,e);var n=t.prototype;return n.getRef=function(e){this.props.innerRef&&this.props.innerRef(e),this.ref=e},n.focus=function(){this.ref&&this.ref.focus()},n.render=function(){var e=this.props,t=e.className,n=e.cssModule,o=e.type,a=e.bsSize,s=e.valid,c=e.invalid,l=e.tag,f=e.addon,p=e.plaintext,m=e.innerRef,v=Object(i.a)(e,["className","cssModule","type","bsSize","valid","invalid","tag","addon","plaintext","innerRef"]),g=["radio","checkbox"].indexOf(o)>-1,y=new RegExp("\\D","g"),b=l||("select"===o||"textarea"===o?o:"input"),w="form-control";p?(w+="-plaintext",b=l||"input"):"file"===o?w+="-file":g&&(w=f?null:"form-check-input"),v.size&&y.test(v.size)&&(Object(d.e)('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),a=v.size,delete v.size);var x=Object(d.b)(h()(t,c&&"is-invalid",s&&"is-valid",!!a&&"form-control-"+a,w),n);return("input"===b||l&&"function"===typeof l)&&(v.type=o),v.children&&!p&&"select"!==o&&"string"===typeof b&&"select"!==b&&(Object(d.e)('Input with a type of "'+o+'" cannot have children. Please use "value"/"defaultValue" instead.'),delete v.children),u.a.createElement(b,Object(r.a)({},v,{ref:m,className:x}))},t}(u.a.Component);m.propTypes=p,m.defaultProps={type:"text"},t.a=m},function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(2),a=n.n(o),s=n(1),u=n.n(s),c=n(10),l=n.n(c),f=n(3),h={light:u.a.bool,dark:u.a.bool,full:u.a.bool,fixed:u.a.string,
1sticky:u.a.string,color:u.a.string,role:u.a.string,tag:f.d,className:u.a.string,cssModule:u.a.object,expand:u.a.oneOfType([u.a.bool,u.a.string])},d=function(e){var t,n=e.expand,o=e.className,s=e.cssModule,u=e.light,c=e.dark,h=e.fixed,d=e.sticky,p=e.color,m=e.tag,v=Object(i.a)(e,["expand","className","cssModule","light","dark","fixed","sticky","color","tag"]),g=Object(f.b)(l()(o,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-"+e)}(n),((t={"navbar-light":u,"navbar-dark":c})["bg-"+p]=p,t["fixed-"+h]=h,t["sticky-"+d]=d,t)),s);return a.a.createElement(m,Object(r.a)({},v,{className:g}))};d.propTypes=h,d.defaultProps={tag:"nav",expand:!1},t.a=d},function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(2),a=n.n(o),s=n(1),u=n.n(s),c=n(10),l=n.n(c),f=n(3),h={tag:f.d,className:u.a.string,cssModule:u.a.object},d=function(e){var t=e.className,n=e.cssModule,o=e.tag,s=Object(i.a)(e,["className","cssModule","tag"]),u=Object(f.b)(l()(t,"navbar-brand"),n);return a.a.createElement(o,Object(r.a)({},s,{className:u}))};d.propTypes=h,d.defaultProps={tag:"a"},t.a=d},function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(2),a=n.n(o),s=n(1),u=n.n(s),c=n(10),l=n.n(c),f=n(3),h={tabs:u.a.bool,pills:u.a.bool,vertical:u.a.oneOfType([u.a.bool,u.a.string]),horizontal:u.a.string,justified:u.a.bool,fill:u.a.bool,navbar:u.a.bool,card:u.a.bool,tag:f.d,className:u.a.string,cssModule:u.a.object},d=function(e){var t=e.className,n=e.cssModule,o=e.tabs,s=e.pills,u=e.vertical,c=e.horizontal,h=e.justified,d=e.fill,p=e.navbar,m=e.card,v=e.tag,g=Object(i.a)(e,["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"]),y=Object(f.b)(l()(t,p?"navbar-nav":"nav",!!c&&"justify-content-"+c,function(e){return!1!==e&&(!0===e||"xs"===e?"flex-column":"flex-"+e+"-column")}(u),{"nav-tabs":o,"card-header-tabs":m&&o,"nav-pills":s,"card-header-pills":m&&s,"nav-justified":h,"nav-fill":d}),n);return a.a.createElement(v,Object(r.a)({},g,{className:y}))};d.propTypes=h,d.defaultProps={tag:"ul",vertical:!1},t.a=d},function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(2),a=n.n(o),s=n(1),u=n.n(s),c=n(10),l=n.n(c),f=n(3),h={tag:f.d,active:u.a.bool,className:u.a.string,cssModule:u.a.object},d=function(e){var t=e.className,n=e.cssModule,o=e.active,s=e.tag,u=Object(i.a)(e,["className","cssModule","active","tag"]),c=Object(f.b)(l()(t,"nav-item",!!o&&"active"),n);return a.a.createElement(s,Object(r.a)({},u,{className:c}))};d.propTypes=h,d.defaultProps={tag:"li"},t.a=d},function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(14),a=n(11),s=n(2),u=n.n(s),c=n(1),l=n.n(c),f=n(10),h=n.n(f),d=n(3),p={tag:d.d,innerRef:l.a.oneOfType([l.a.object,l.a.func,l.a.string]),disabled:l.a.bool,active:l.a.bool,className:l.a.string,cssModule:l.a.object,onClick:l.a.func,href:l.a.any},m=function(e){function t(t){var n;return(n=e.call(this,t)||this).onClick=n.onClick.bind(Object(o.a)(n)),n}Object(a.a)(t,e);var n=t.prototype;return n.onClick=function(e){this.props.disabled?e.preventDefault():("#"===this.props.href&&e.preventDefault(),this.props.onClick&&this.props.onClick(e))},n.render=function(){var e=this.props,t=e.className,n=e.cssModule,o=e.active,a=e.tag,s=e.innerRef,c=Object(i.a)(e,["className","cssModule","active","tag","innerRef"]),l=Object(d.b)(h()(t,"nav-link",{disabled:c.disabled,active:o}),n);return u.a.createElement(a,Object(r.a)({},c,{ref:s,onClick:this.onClick,className:l}))},t}(u.a.Component);m.propTypes=p,m.defaultProps={tag:"a"},t.a=m},function(e,t,n){"use strict";var r=n(4),i=n(56),o=n(8),a=n(11),s=n(2),u=n.n(s),c=n(1),l=n.n(c),f=n(10),h=n.n(f),d=n(41),p=n(35),m=n(3),v={tag:m.d,children:l.a.node.isRequired,right:l.a.bool,flip:l.a.bool,modifiers:l.a.object,className:l.a.string,cssModule:l.a.object,persist:l.a.bool},g={flip:{enabled:!1}},y={up:"top",left:"left",right:"right",down:"bottom"},b=function(e){function t(){return e.apply(this,arguments)||this}return Object(a.a)(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.className,a=t.cssModule,s=t.right,c=t.tag,l=t.flip,f=t.modifiers,p=t.persist,v=Object(o.a)(t,["className","cssModule","right","tag","flip","modifiers","persist"]),b=Object(m.b)(h()(n,"dropdown-menu",{"dropdown-menu-right":s,show:this.context.
1isOpen}),a),w=c;if(p||this.context.isOpen&&!this.context.inNavbar){var x=(y[this.context.direction]||"bottom")+"-"+(s?"end":"start"),_=l?f:Object(i.a)({},f,g);return u.a.createElement(d.b,{placement:x,modifiers:_},function(t){var n=t.ref,i=t.style,o=t.placement;return u.a.createElement(w,Object(r.a)({tabIndex:"-1",role:"menu",ref:n,style:i},v,{"aria-hidden":!e.context.isOpen,className:b,"x-placement":o}))})}return u.a.createElement(w,Object(r.a)({tabIndex:"-1",role:"menu"},v,{"aria-hidden":!this.context.isOpen,className:b,"x-placement":v.placement}))},t}(u.a.Component);b.propTypes=v,b.defaultProps={tag:"div",flip:!0},b.contextType=p.a,t.a=b},function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(14),a=n(11),s=n(2),u=n.n(s),c=n(1),l=n.n(c),f=n(10),h=n.n(f),d=n(35),p=n(3),m={children:l.a.node,active:l.a.bool,disabled:l.a.bool,divider:l.a.bool,tag:p.d,header:l.a.bool,onClick:l.a.func,className:l.a.string,cssModule:l.a.object,toggle:l.a.bool},v=function(e){function t(t){var n;return(n=e.call(this,t)||this).onClick=n.onClick.bind(Object(o.a)(n)),n.getTabIndex=n.getTabIndex.bind(Object(o.a)(n)),n}Object(a.a)(t,e);var n=t.prototype;return n.onClick=function(e){this.props.disabled||this.props.header||this.props.divider?e.preventDefault():(this.props.onClick&&this.props.onClick(e),this.props.toggle&&this.context.toggle(e))},n.getTabIndex=function(){return this.props.disabled||this.props.header||this.props.divider?"-1":"0"},n.render=function(){var e=this.getTabIndex(),t=e>-1?"menuitem":void 0,n=Object(p.c)(this.props,["toggle"]),o=n.className,a=n.cssModule,s=n.divider,c=n.tag,l=n.header,f=n.active,d=Object(i.a)(n,["className","cssModule","divider","tag","header","active"]),m=Object(p.b)(h()(o,{disabled:d.disabled,"dropdown-item":!s&&!l,active:f,"dropdown-header":l,"dropdown-divider":s}),a);return"button"===c&&(l?c="h6":s?c="div":d.href&&(c="a")),u.a.createElement(c,Object(r.a)({type:"button"===c&&(d.onClick||this.props.toggle)?"button":void 0},d,{tabIndex:e,role:t,className:m,onClick:this.onClick}))},t}(u.a.Component);v.propTypes=m,v.defaultProps={tag:"button",toggle:!0},v.contextType=d.a,t.a=v},function(e,t,n){"use strict";var r=n(4),i=n(8),o=n(14),a=n(11),s=n(2),u=n.n(s),c=n(1),l=n.n(c),f=n(10),h=n.n(f),d=n(41),p=n(35),m=n(3),v={active:l.a.bool,"aria-label":l.a.string,block:l.a.bool,color:l.a.string,disabled:l.a.bool,outline:l.a.bool,tag:m.d,innerRef:l.a.oneOfType([l.a.object,l.a.func,l.a.string]),onClick:l.a.func,size:l.a.string,children:l.a.node,className:l.a.string,cssModule:l.a.object,close:l.a.bool},g=function(e){function t(t){var n;return(n=e.call(this,t)||this).onClick=n.onClick.bind(Object(o.a)(n)),n}Object(a.a)(t,e);var n=t.prototype;return n.onClick=function(e){this.props.disabled?e.preventDefault():this.props.onClick&&this.props.onClick(e)},n.render=function(){var e=this.props,t=e.active,n=e["aria-label"],o=e.block,a=e.className,s=e.close,c=e.cssModule,l=e.color,f=e.outline,d=e.size,p=e.tag,v=e.innerRef,g=Object(i.a)(e,["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"]);s&&"undefined"===typeof g.children&&(g.children=u.a.createElement("span",{"aria-hidden":!0},"\xd7"));var y="btn"+(f?"-outline":"")+"-"+l,b=Object(m.b)(h()(a,{close:s},s||"btn",s||y,!!d&&"btn-"+d,!!o&&"btn-block",{active:t,disabled:this.props.disabled}),c);g.href&&"button"===p&&(p="a");var w=s?"Close":null;return u.a.createElement(p,Object(r.a)({type:"button"===p&&g.onClick?"button":void 0},g,{className:b,ref:v,onClick:this.onClick,"aria-label":n||w}))},t}(u.a.Component);g.propTypes=v,g.defaultProps={color:"secondary",tag:"button"};var y=g,b={caret:l.a.bool,color:l.a.string,children:l.a.node,className:l.a.string,cssModule:l.a.object,disabled:l.a.bool,onClick:l.a.func,"aria-haspopup":l.a.bool,split:l.a.bool,tag:m.d,nav:l.a.bool},w=function(e){function t(t){var n;return(n=e.call(this,t)||this).onClick=n.onClick.bind(Object(o.a)(n)),n}Object(a.a)(t,e);var n=t.prototype;return n.onClick=function(e){this.props.disabled?e.preventDefault():(this.props.nav&&!this.props.tag&&e.preventDefault(),this.props.onClick&&this.props.onClick(e),this.context.toggle(e))},n.render=function(){var e,t=this,n=this.props,o=n.className,a=n.color,s=n.
1cssModule,c=n.caret,l=n.split,f=n.nav,p=n.tag,v=Object(i.a)(n,["className","color","cssModule","caret","split","nav","tag"]),g=v["aria-label"]||"Toggle Dropdown",b=Object(m.b)(h()(o,{"dropdown-toggle":c||l,"dropdown-toggle-split":l,"nav-link":f}),s),w=v.children||u.a.createElement("span",{className:"sr-only"},g);return f&&!p?(e="a",v.href="#"):p?e=p:(e=y,v.color=a,v.cssModule=s),this.context.inNavbar?u.a.createElement(e,Object(r.a)({},v,{className:b,onClick:this.onClick,"aria-expanded":this.context.isOpen,children:w})):u.a.createElement(d.c,null,function(n){var i,o=n.ref;return u.a.createElement(e,Object(r.a)({},v,((i={})["string"===typeof e?"ref":"innerRef"]=o,i),{className:b,onClick:t.onClick,"aria-expanded":t.context.isOpen,children:w}))})},t}(u.a.Component);w.propTypes=b,w.defaultProps={"aria-haspopup":!0,color:"secondary"},w.contextType=p.a;t.a=w},function(e,t,n){"use strict";var r=n(56),i=n(4),o=n(14),a=n(11),s=n(2),u=n.n(s),c=n(1),l=n.n(c),f=n(8),h=n(41),d=n(10),p=n.n(d),m=n(35),v=n(3),g={disabled:l.a.bool,direction:l.a.oneOf(["up","down","left","right"]),group:l.a.bool,isOpen:l.a.bool,nav:l.a.bool,active:l.a.bool,addonType:l.a.oneOfType([l.a.bool,l.a.oneOf(["prepend","append"])]),size:l.a.string,tag:v.d,toggle:l.a.func,children:l.a.node,className:l.a.string,cssModule:l.a.object,inNavbar:l.a.bool,setActiveFromChild:l.a.bool},y=function(e){function t(t){var n;return(n=e.call(this,t)||this).addEvents=n.addEvents.bind(Object(o.a)(n)),n.handleDocumentClick=n.handleDocumentClick.bind(Object(o.a)(n)),n.handleKeyDown=n.handleKeyDown.bind(Object(o.a)(n)),n.removeEvents=n.removeEvents.bind(Object(o.a)(n)),n.toggle=n.toggle.bind(Object(o.a)(n)),n.containerRef=u.a.createRef(),n}Object(a.a)(t,e);var n=t.prototype;return n.getContextValue=function(){return{toggle:this.props.toggle,isOpen:this.props.isOpen,direction:"down"===this.props.direction&&this.props.dropup?"up":this.props.direction,inNavbar:this.props.inNavbar}},n.componentDidMount=function(){this.handleProps()},n.componentDidUpdate=function(e){this.props.isOpen!==e.isOpen&&this.handleProps()},n.componentWillUnmount=function(){this.removeEvents()},n.getContainer=function(){return this.containerRef.current},n.getMenuCtrl=function(){return this._$menuCtrl?this._$menuCtrl:(this._$menuCtrl=this.getContainer().querySelector("[aria-expanded]"),this._$menuCtrl)},n.getMenuItems=function(){return[].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'))},n.addEvents=function(){var e=this;["click","touchstart","keyup"].forEach(function(t){return document.addEventListener(t,e.handleDocumentClick,!0)})},n.removeEvents=function(){var e=this;["click","touchstart","keyup"].forEach(function(t){return document.removeEventListener(t,e.handleDocumentClick,!0)})},n.handleDocumentClick=function(e){if(!e||3!==e.which&&("keyup"!==e.type||e.which===v.a.tab)){var t=this.getContainer();(!t.contains(e.target)||t===e.target||"keyup"===e.type&&e.which!==v.a.tab)&&this.toggle(e)}},n.handleKeyDown=function(e){var t=this;if(!(/input|textarea/i.test(e.target.tagName)||v.a.tab===e.which&&"menuitem"!==e.target.getAttribute("role"))&&(e.preventDefault(),!this.props.disabled&&(this.getMenuCtrl()===e.target&&!this.props.isOpen&&[v.a.space,v.a.enter,v.a.up,v.a.down].indexOf(e.which)>-1&&(this.toggle(e),setTimeout(function(){return t.getMenuItems()[0].focus()})),this.props.isOpen&&"menuitem"===e.target.getAttribute("role"))))if([v.a.tab,v.a.esc].indexOf(e.which)>-1)this.toggle(e),this.getMenuCtrl().focus();else if([v.a.space,v.a.enter].indexOf(e.which)>-1)e.target.click(),this.getMenuCtrl().focus();else if([v.a.down,v.a.up].indexOf(e.which)>-1||[v.a.n,v.a.p].indexOf(e.which)>-1&&e.ctrlKey){var n=this.getMenuItems(),r=n.indexOf(e.target);v.a.up===e.which||v.a.p===e.which&&e.ctrlKey?r=0!==r?r-1:n.length-1:(v.a.down===e.which||v.a.n===e.which&&e.ctrlKey)&&(r=r===n.length-1?0:r+1),n[r].focus()}else if(v.a.end===e.which){var i=this.getMenuItems();i[i.length-1].focus()}else if(v.a.home===e.which){this.getMenuItems()[0].focus()}else if(e.which>=48&&e.which<=90)for(var o=this.getMenuItems(),a=String.fromCharCode(e.which).toLowerCase(),s=0;s<o.length;s+=1){if((o[s].textContent&&o[s].textContent[0].toLowerCase())===a){o[s].focus();break}}},n.handleProps=function(){this.props.isOpen?this.addEvents():this.removeEvents()},n.toggle=function(e){return this.props.disabled?e&&e.preventDefault():this.props.toggle(e)},n.render=function(){var e,t,n=Object(v.c)(this.props,["toggle","disabled","inNavbar"]),r=n.className,o=n.cssModule,a=n.direction,s=n.isOpen,c=n.group,l=n.size,d=n.nav,g=n.setActiveFromChild,y=n.active,b=n.addonType,w=n.tag,x=Object(f.a)(n,["className","cssModule","direction","isOpen","group","size","nav","setActiveFromChild","active","addonType","tag"]),_=w||(d?"li":"div"),k=!1;g&&u.a.Children.map(this.props.children[1].props.children,function(e){e&&e.props.active&&(k=!0)});var S=Object(v.b)(p()(r,"down"!==a&&"drop"+a,!(!d||!y)&&"active",!(!g||!k)&&"active",((e={})["input-group-"+b]=b,e["btn-group"]=c,e["btn-group-"+l]=!!l,e.dropdown=!c&&!b,e.show=s,e["nav-item"]=d,e)),o);return u.a.createElement(m.a.Provider,{value:this.getContextValue()},u.a.createElement(h.a,null,u.a.createElement(_,Object(i.a)({},x,((t={})["string"===typeof _?"ref":"innerRef"]=this.containerRef,t),{onKeyDown:this.handleKeyDown,className:S}))))},t}(u.a.Component);y.propTypes=g,y.defaultProps={isOpen:!1,direction:"down",nav:!1,active:!1,addonType:!1,inNavbar:!1,setActiveFromChild:!1};var b=y;n.d(t,"a",function(){return x});var w=["defaultOpen"],x=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={isOpen:t.defaultOpen||!1},n.toggle=n.toggle.bind(Object(o.a)(n)),n}Object(a.a)(t,e);var n=t.prototype;return n.toggle=function(){this.setState({isOpen:!this.state.isOpen})},n.render=function(){return u.a.createElement(b,Object(i.a)({isOpen:this.state.isOpen,toggle:this.toggle},Object(v.c)(this.props,w)))},t}(s.Component);x.propTypes=Object(r.a)({defaultOpen:l.a.bool}
1,b.propTypes)}]]); 2//# sourceMappingURL=2.bb000ca5.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.