2.e1845539.chunk.js 1.6 MB

123
  1. /*! For license information please see 2.e1845539.chunk.js.LICENSE.txt */
  2. (this["webpackJsonprvm-website"]=this["webpackJsonprvm-website"]||[]).push([[2],[function(e,t,n){"use strict";n.d(t,"dc",(function(){return it})),n.d(t,"bd",(function(){return ue.a})),n.d(t,"cd",(function(){return ue.b})),n.d(t,"jf",(function(){return ot.a})),n.d(t,"vf",(function(){return ot.b})),n.d(t,"md",(function(){return st.b})),n.d(t,"nd",(function(){return st.e})),n.d(t,"od",(function(){return st.g})),n.d(t,"pd",(function(){return st.h})),n.d(t,"qd",(function(){return st.i})),n.d(t,"rd",(function(){return st.p})),n.d(t,"sd",(function(){return st.q})),n.d(t,"vd",(function(){return st.t})),n.d(t,"wd",(function(){return st.u})),n.d(t,"xd",(function(){return st.v})),n.d(t,"zd",(function(){return st.A})),n.d(t,"Ad",(function(){return st.B})),n.d(t,"Bd",(function(){return st.D})),n.d(t,"Cd",(function(){return st.E})),n.d(t,"Dd",(function(){return st.G})),n.d(t,"Ed",(function(){return st.H})),n.d(t,"Fd",(function(){return st.I})),n.d(t,"Gd",(function(){return st.J})),n.d(t,"Hd",(function(){return st.K})),n.d(t,"Id",(function(){return st.L})),n.d(t,"Jd",(function(){return st.M})),n.d(t,"Kd",(function(){return st.N})),n.d(t,"Ld",(function(){return st.O})),n.d(t,"Md",(function(){return st.P})),n.d(t,"Nd",(function(){return st.W})),n.d(t,"Qd",(function(){return st.Z})),n.d(t,"Sd",(function(){return st.eb})),n.d(t,"Vd",(function(){return st.gb})),n.d(t,"Wd",(function(){return st.ib})),n.d(t,"Xd",(function(){return st.jb})),n.d(t,"Yd",(function(){return st.lb})),n.d(t,"Zd",(function(){return st.nb})),n.d(t,"ae",(function(){return st.ob})),n.d(t,"ce",(function(){return st.rb})),n.d(t,"de",(function(){return st.tb})),n.d(t,"ee",(function(){return st.ub})),n.d(t,"je",(function(){return st.Db})),n.d(t,"le",(function(){return st.Jb})),n.d(t,"me",(function(){return st.Kb})),n.d(t,"ne",(function(){return st.Mb})),n.d(t,"oe",(function(){return st.Ob})),n.d(t,"pe",(function(){return st.Tb})),n.d(t,"qe",(function(){return st.Ub})),n.d(t,"re",(function(){return st.Vb})),n.d(t,"se",(function(){return st.Wb})),n.d(t,"te",(function(){return st.Yb})),n.d(t,"ue",(function(){return st.Zb})),n.d(t,"we",(function(){return st.cc})),n.d(t,"xe",(function(){return st.fc})),n.d(t,"ye",(function(){return st.hc})),n.d(t,"ze",(function(){return st.kc})),n.d(t,"Be",(function(){return st.mc})),n.d(t,"Ce",(function(){return st.nc})),n.d(t,"De",(function(){return st.oc})),n.d(t,"Ee",(function(){return st.pc})),n.d(t,"Fe",(function(){return st.sc})),n.d(t,"Ge",(function(){return st.yc})),n.d(t,"He",(function(){return st.zc})),n.d(t,"Ie",(function(){return st.Ec})),n.d(t,"Je",(function(){return st.Fc})),n.d(t,"Me",(function(){return st.Jc})),n.d(t,"Ne",(function(){return st.Lc})),n.d(t,"Oe",(function(){return st.Mc})),n.d(t,"Pe",(function(){return st.Uc})),n.d(t,"Qe",(function(){return st.Wc})),n.d(t,"Re",(function(){return st.Xc})),n.d(t,"Ue",(function(){return st.Zc})),n.d(t,"Ve",(function(){return st.ed})),n.d(t,"We",(function(){return st.fd})),n.d(t,"Xe",(function(){return st.gd})),n.d(t,"Ye",(function(){return st.hd})),n.d(t,"Ze",(function(){return st.id})),n.d(t,"bf",(function(){return st.jd})),n.d(t,"cf",(function(){return st.kd})),n.d(t,"df",(function(){return st.pd})),n.d(t,"ef",(function(){return st.qd})),n.d(t,"ff",(function(){return st.td})),n.d(t,"gf",(function(){return st.ud})),n.d(t,"hf",(function(){return st.yd})),n.d(t,"if",(function(){return st.zd})),n.d(t,"kf",(function(){return st.Bd})),n.d(t,"lf",(function(){return st.Cd})),n.d(t,"mf",(function(){return st.Dd})),n.d(t,"nf",(function(){return st.Ed})),n.d(t,"qf",(function(){return st.Jd})),n.d(t,"tf",(function(){return st.Md})),n.d(t,"uf",(function(){return st.Pd})),n.d(t,"xf",(function(){return st.Qd})),n.d(t,"Af",(function(){return st.Rd})),n.d(t,"Bf",(function(){return st.Td})),n.d(t,"Cf",(function(){return st.Ud})),n.d(t,"sf",(function(){return st.Ld})),n.d(t,"Rd",(function(){return st.cb})),n.d(t,"fe",(function(){return st.xb})),n.d(t,"ke",(function(){return st.Gb})),n.d(t,"be",(function(){return st.qb})),n.d(t,"rf",(function(){return It})),n.d(t,"Td",(function(){return nt.c})),n.d(t,"ve",(function(){return nt.e})),n.d(t,"pf",(function(){return nt.h})),n.d(t,"Pd",(function(){return nt.b})),n.d(t,"he",(function(){return nt.d})),n.d(t,"Te",(function(){return nt.g})),n.d(t,"Ke",(function(){return nt.f})),n.d(t,"td",(function(){return nt.a})),n.d(t,"Le",(function(){return Me.e})),n.d(t,"yf",(function(){return rt.b})),n.d(t,"Ud",(function(){return f.b})),n.d(t,"zf",(function(){return Je})),n.d(t,"Ae",(function(){return Ct.a})),n.d(t,"yd",(function(){return a})),n.d(t,"ge",(function(){return r})),n.d(t,"Se",(function(){return i})),n.d(t,"wf",(function(){return Ze})),n.d(t,"ud",(function(){return s})),n.d(t,"of",(function(){return Qe})),n.d(t,"af",(function(){return Ke})),n.d(t,"Od",(function(){return wn})),n.d(t,"ie",(function(){return c})),n.d(t,"wb",(function(){return Nn.b})),n.d(t,"L",(function(){return Nn.a})),n.d(t,"a",(function(){return _e.a})),n.d(t,"b",(function(){return _e.b})),n.d(t,"c",(function(){return _e.c})),n.d(t,"d",(function(){return _e.d})),n.d(t,"e",(function(){return _e.e})),n.d(t,"f",(function(){return _e.f})),n.d(t,"g",(function(){return _e.g})),n.d(t,"h",(function(){return _e.h})),n.d(t,"i",(function(){return _e.i})),n.d(t,"j",(function(){return _e.j})),n.d(t,"k",(function(){return _e.k})),n.d(t,"l",(function(){return _e.l})),n.d(t,"n",(function(){return _e.n})),n.d(t,"m",(function(){return _e.m})),n.d(t,"o",(function(){return _e.o})),n.d(t,"r",(function(){return _e.r})),n.d(t,"p",(function(){return _e.p})),n.d(t,"q",(function(){return _e.q})),n.d(t,"s",(function(){return _e.s})),n.d(t,"t",(function(){return _e.t})),n.d(t,"u",(function(){return _e.u})),n.d(t,"v",(function(){return _e.w})),n.d(t,"w",(function(){return _e.x})),n.d(t,"x",(function(){return _e.y})),n.d(t,"y",(function(){return _e.z})),n.d(t,"z",(function(){return _e.A})),n.d(t,"A",(function(){return _e.B})),n.d(t,"B",(function(){return _e.C})),n.d(t,"C",(function(){return _e.D})),n.d(t,"D",(function(){return _e.E})),n.d(t,"E",(function(){return _e.F})),n.d(t,"F",(function(){return _e.G})),n.d(t,"G",(function(){return _e.H})),n.d(t,"H",(function(){return _e.I})),n.d(t,"I",(function(){return _e.J})),n.d(t,"K",(function(){return _e.L})),n.d(t,"J",(function(){return _e.K})),n.d(t,"M",(function(){return _e.M})),n.d(t,"N",(function(){return _e.N})),n.d(t,"O",(function(){return _e.O})),n.d(t,"P",(function(){return _e.P})),n.d(t,"Q",(function(){return _e.Q})),n.d(t,"R",(function(){return _e.R})),n.d(t,"S",(function(){return _e.S})),n.d(t,"U",(function(){return _e.U})),n.d(t,"T",(function(){return _e.T})),n.d(t,"lc",(function(){return _e.kc})),n.d(t,"V",(function(){return _e.V})),n.d(t,"W",(function(){return _e.W})),n.d(t,"X",(function(){return _e.X})),n.d(t,"Z",(function(){return _e.Z})),n.d(t,"Y",(function(){return _e.Y})),n.d(t,"ab",(function(){return _e.ab})),n.d(t,"bb",(function(){return _e.bb})),n.d(t,"cb",(function(){return _e.cb})),n.d(t,"db",(function(){return _e.db})),n.d(t,"eb",(function(){return _e.eb})),n.d(t,"fb",(function(){return _e.fb})),n.d(t,"gb",(function(){return _e.gb})),n.d(t,"hb",(function(){return _e.hb})),n.d(t,"jb",(function(){return _e.jb})),n.d(t,"nb",(function(){return _e.nb})),n.d(t,"mb",(function(){return _e.mb})),n.d(t,"ob",(function(){return _e.ob})),n.d(t,"pb",(function(){return _e.pb})),n.d(t,"rb",(function(){return _e.rb})),n.d(t,"qb",(function(){return _e.qb})),n.d(t,"sb",(function(){return _e.sb})),n.d(t,"tb",(function(){return _e.tb})),n.d(t,"ub",(function(){return _e.ub})),n.d(t,"vb",(function(){return _e.vb})),n.d(t,"zb",(function(){return _e.yb})),n.d(t,"Ab",(function(){return _e.zb})),n.d(t,"Bb",(function(){return _e.Ab})),n.d(t,"Cb",(function(){return _e.Bb})),n.d(t,"Db",(function(){return _e.Cb})),n.d(t,"Eb",(function(){return _e.Db})),n.d(t,"Fb",(function(){return _e.Fb})),n.d(t,"Gb",(function(){return _e.Gb})),n.d(t,"Hb",(function(){return _e.Hb})),n.d(t,"xb",(function(){return _e.wb})),n.d(t,"yb",(function(){return _e.xb})),n.d(t,"Ib",(function(){return _e.Ib})),n.d(t,"Ob",(function(){return _e.Ob})),n.d(t,"Jb",(function(){return _e.Jb})),n.d(t,"Mb",(function(){return _e.Mb})),n.d(t,"Kb",(function(){return _e.Kb})),n.d(t,"Lb",(function(){return _e.Lb})),n.d(t,"Nb",(function(){return _e.Nb})),n.d(t,"Pb",(function(){return _e.Pb})),n.d(t,"Qb",(function(){return _e.Qb})),n.d(t,"Rb",(function(){return _e.Rb})),n.d(t,"Sb",(function(){return _e.Sb})),n.d(t,"Tb",(function(){return _e.Tb})),n.d(t,"Ub",(function(){return _e.Ub})),n.d(t,"Vb",(function(){return _e.Vb})),n.d(t,"Wb",(function(){return _e.Wb})),n.d(t,"ac",(function(){return _e.ac})),n.d(t,"Xb",(function(){return _e.Xb})),n.d(t,"Yb",(function(){return _e.Yb})),n.d(t,"Zb",(function(){return _e.Zb})),n.d(t,"cc",(function(){return _e.cc})),n.d(t,"bc",(function(){return _e.bc})),n.d(t,"ec",(function(){return _e.dc})),n.d(t,"fc",(function(){return _e.ec})),n.d(t,"gc",(function(){return _e.fc})),n.d(t,"hc",(function(){return _e.gc})),n.d(t,"ic",(function(){return _e.hc})),n.d(t,"jc",(function(){return _e.ic})),n.d(t,"kc",(function(){return _e.jc})),n.d(t,"mc",(function(){return _e.lc})),n.d(t,"nc",(function(){return _e.mc})),n.d(t,"pc",(function(){return _e.oc})),n.d(t,"sc",(function(){return _e.rc})),n.d(t,"tc",(function(){return _e.sc})),n.d(t,"qc",(function(){return _e.pc})),n.d(t,"rc",(function(){return _e.qc})),n.d(t,"oc",(function(){return _e.nc})),n.d(t,"uc",(function(){return _e.tc})),n.d(t,"wc",(function(){return _e.vc})),n.d(t,"xc",(function(){return _e.wc})),n.d(t,"yc",(function(){return _e.xc})),n.d(t,"zc",(function(){return _e.yc})),n.d(t,"Ac",(function(){return _e.zc})),n.d(t,"Fc",(function(){return _e.Ec})),n.d(t,"Dc",(function(){return _e.Cc})),n.d(t,"Ec",(function(){return _e.Dc})),n.d(t,"Cc",(function(){return _e.Bc})),n.d(t,"Bc",(function(){return _e.Ac})),n.d(t,"Hc",(function(){return _e.Gc})),n.d(t,"Pc",(function(){return _e.Oc})),n.d(t,"Yc",(function(){return _e.Xc})),n.d(t,"Ic",(function(){return _e.Hc})),n.d(t,"Oc",(function(){return _e.Nc})),n.d(t,"Gc",(function(){return _e.Fc})),n.d(t,"Jc",(function(){return _e.Ic})),n.d(t,"Kc",(function(){return _e.Jc})),n.d(t,"Lc",(function(){return _e.Kc})),n.d(t,"Mc",(function(){return _e.Lc})),n.d(t,"Nc",(function(){return _e.Mc})),n.d(t,"Rc",(function(){return _e.Qc})),n.d(t,"Qc",(function(){return _e.Pc})),n.d(t,"Tc",(function(){return _e.Sc})),n.d(t,"Uc",(function(){return _e.Tc})),n.d(t,"Vc",(function(){return _e.Uc})),n.d(t,"Wc",(function(){return _e.Vc})),n.d(t,"Xc",(function(){return _e.Wc})),n.d(t,"Zc",(function(){return _e.Yc})),n.d(t,"ad",(function(){return _e.Zc})),n.d(t,"dd",(function(){return _e.ad})),n.d(t,"ed",(function(){return _e.bd})),n.d(t,"fd",(function(){return _e.cd})),n.d(t,"gd",(function(){return _e.dd})),n.d(t,"hd",(function(){return _e.ed})),n.d(t,"id",(function(){return _e.fd})),n.d(t,"jd",(function(){return _e.gd})),n.d(t,"kd",(function(){return _e.hd})),n.d(t,"Sc",(function(){return _e.Rc})),n.d(t,"ib",(function(){return _e.ib})),n.d(t,"vc",(function(){return _e.uc})),n.d(t,"ld",(function(){return _e.id})),n.d(t,"kb",(function(){return _e.kb})),n.d(t,"lb",(function(){return _e.lb}));var r={};n.r(r),n.d(r,"copyModel",(function(){return ee})),n.d(r,"listModels",(function(){return $})),n.d(r,"moveModel",(function(){return ne})),n.d(r,"removeModel",(function(){return Z})),n.d(r,"browserFiles",(function(){return be})),n.d(r,"browserHTTPRequest",(function(){return Te})),n.d(r,"concatenateArrayBuffers",(function(){return v.d})),n.d(r,"decodeWeights",(function(){return v.e})),n.d(r,"encodeWeights",(function(){return v.f})),n.d(r,"fromMemory",(function(){return Re})),n.d(r,"getLoadHandlers",(function(){return k})),n.d(r,"getModelArtifactsForJSON",(function(){return v.g})),n.d(r,"getModelArtifactsInfoForJSON",(function(){return v.h})),n.d(r,"getSaveHandlers",(function(){return x})),n.d(r,"http",(function(){return Ce})),n.d(r,"isHTTPScheme",(function(){return Ne})),n.d(r,"loadWeights",(function(){return xe})),n.d(r,"registerLoadRouter",(function(){return O})),n.d(r,"registerSaveRouter",(function(){return y})),n.d(r,"weightsLoaderFactory",(function(){return we})),n.d(r,"withSaveHandler",(function(){return Fe}));var a={};n.r(a),n.d(a,"fromPixelsAsync",(function(){return Ue})),n.d(a,"toPixels",(function(){return He})),n.d(a,"fromPixels",(function(){return qe}));var i={};n.r(i),n.d(i,"Serializable",(function(){return Xe})),n.d(i,"SerializationMap",(function(){return Ye})),n.d(i,"registerClass",(function(){return $e}));var o={};n.r(o),n.d(o,"segOpComputeOptimalWindowSize",(function(){return gn})),n.d(o,"computeOutShape",(function(){return yn})),n.d(o,"collectGatherOpShapeInfo",(function(){return On}));var s={};n.r(s),n.d(s,"axesAreInnerMostDims",(function(){return Tt.b})),n.d(s,"combineLocations",(function(){return Tt.c})),n.d(s,"computeOutAndReduceShapes",(function(){return Tt.d})),n.d(s,"expandShapeToKeepDim",(function(){return Tt.e})),n.d(s,"assertAxesAreInnerMostDims",(function(){return Tt.a})),n.d(s,"getAxesPermutation",(function(){return Tt.f})),n.d(s,"getUndoAxesPermutation",(function(){return Tt.h})),n.d(s,"getInnerMostAxes",(function(){return Tt.g})),n.d(s,"getBroadcastDims",(function(){return Et.b})),n.d(s,"getReductionAxes",(function(){return Et.c})),n.d(s,"assertAndGetBroadcastShape",(function(){return Et.a})),n.d(s,"assertParamsConsistent",(function(){return At})),n.d(s,"computeOutShape",(function(){return Rt})),n.d(s,"computeDilation2DInfo",(function(){return Ft.d})),n.d(s,"computePool2DInfo",(function(){return Ft.e})),n.d(s,"computePool3DInfo",(function(){return Ft.f})),n.d(s,"computeConv2DInfo",(function(){return Ft.a})),n.d(s,"computeConv3DInfo",(function(){return Ft.b})),n.d(s,"computeDefaultPad",(function(){return Ft.c})),n.d(s,"tupleValuesAreOne",(function(){return Ft.i})),n.d(s,"eitherStridesOrDilationsAreOne",(function(){return Ft.h})),n.d(s,"convertConv2DDataFormat",(function(){return Ft.g})),n.d(s,"getFusedDyActivation",(function(){return Dt.c})),n.d(s,"getFusedBiasGradient",(function(){return Dt.b})),n.d(s,"applyActivation",(function(){return Dt.a})),n.d(s,"shouldFuse",(function(){return Dt.d})),n.d(s,"PARALLELIZE_THRESHOLD",(function(){return _t})),n.d(s,"computeOptimalWindowSize",(function(){return Mt})),n.d(s,"slice_util",(function(){return Ke})),n.d(s,"upcastType",(function(){return ot.b})),n.d(s,"getImageCenter",(function(){return zt})),n.d(s,"getReshaped",(function(){return Lt})),n.d(s,"getPermuted",(function(){return Pt})),n.d(s,"getReshapedPermuted",(function(){return Bt})),n.d(s,"getSliceBeginCoords",(function(){return Wt})),n.d(s,"getSliceSize",(function(){return Ut})),n.d(s,"prepareAndValidate",(function(){return Vt})),n.d(s,"validateUpdateShape",(function(){return Ht.c})),n.d(s,"validateInput",(function(){return Ht.b})),n.d(s,"calculateShapes",(function(){return Ht.a})),n.d(s,"SELU_SCALEALPHA",(function(){return Gt.b})),n.d(s,"SELU_SCALE",(function(){return Gt.a})),n.d(s,"ERF_P",(function(){return qt})),n.d(s,"ERF_A1",(function(){return Kt})),n.d(s,"ERF_A2",(function(){return Xt})),n.d(s,"ERF_A3",(function(){return Yt})),n.d(s,"ERF_A4",(function(){return $t})),n.d(s,"ERF_A5",(function(){return Qt})),n.d(s,"warn",(function(){return Zt})),n.d(s,"log",(function(){return Jt})),n.d(s,"mergeRealAndImagArrays",(function(){return en})),n.d(s,"splitRealAndImagArrays",(function(){return tn})),n.d(s,"complexWithEvenIndex",(function(){return nn})),n.d(s,"complexWithOddIndex",(function(){return rn})),n.d(s,"getComplexWithIndex",(function(){return an})),n.d(s,"assignToTypedArray",(function(){return on})),n.d(s,"exponents",(function(){return sn})),n.d(s,"exponent",(function(){return cn})),n.d(s,"decodeEinsumEquation",(function(){return dn})),n.d(s,"getEinsumPermutation",(function(){return fn})),n.d(s,"checkEinsumDimSizes",(function(){return pn})),n.d(s,"getEinsumComputePath",(function(){return hn})),n.d(s,"isIdentityPermutation",(function(){return bn})),n.d(s,"prepareSplitSize",(function(){return vn})),n.d(s,"segment_util",(function(){return o})),n.d(s,"fromUint8ToStringArray",(function(){return xn})),n.d(s,"fromStringArrayToUint8",(function(){return kn}));var c={};n.r(c),n.d(c,"nonMaxSuppressionV3Impl",(function(){return jn.a})),n.d(c,"nonMaxSuppressionV4Impl",(function(){return jn.b})),n.d(c,"nonMaxSuppressionV5Impl",(function(){return jn.c})),n.d(c,"whereImpl",(function(){return Sn.a}));var u=n(9),l=(n(176),n(7)),d=n(11),f=n(38),p=n(20),h=n(5),b=n.n(h),m=n(12),v=n(52),g=function(){function e(){Object(l.a)(this,e),this.saveRouters=[],this.loadRouters=[]}return Object(d.a)(e,null,[{key:"getInstance",value:function(){return null==e.instance&&(e.instance=new e),e.instance}},{key:"registerSaveRouter",value:function(t){e.getInstance().saveRouters.push(t)}},{key:"registerLoadRouter",value:function(t){e.getInstance().loadRouters.push(t)}},{key:"getSaveHandlers",value:function(t){return e.getHandlers(t,"save")}},{key:"getLoadHandlers",value:function(t,n){return e.getHandlers(t,"load",n)}},{key:"getHandlers",value:function(t,n,r){var a=[];return("load"===n?e.getInstance().loadRouters:e.getInstance().saveRouters).forEach((function(e){var n=e(t,r);null!==n&&a.push(n)})),a}}]),e}(),y=function(e){return g.registerSaveRouter(e)},O=function(e){return g.registerLoadRouter(e)},x=function(e){return g.getSaveHandlers(e)},k=function(e,t){return g.getLoadHandlers(e,t)},w="tensorflowjs",j="models_store",S="model_info_store";function N(){if(!Object(f.b)().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");var e="undefined"===typeof window?self: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 I(e){var t=e.result;t.createObjectStore(j,{keyPath:"modelPath"}),t.createObjectStore(S,{keyPath:"modelPath"})}var C=function(){function e(t){if(Object(l.a)(this,e),this.indexedDB=N(),null==t||!t)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=t}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(m.a)(b.a.mark((function e(t){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.modelTopology instanceof ArrayBuffer)){e.next=2;break}throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");case 2:return e.abrupt("return",this.databaseAction(this.modelPath,t));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"load",value:function(){var e=Object(m.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.databaseAction(this.modelPath));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"databaseAction",value:function(e,t){var n=this;return new Promise((function(e,r){var a=n.indexedDB.open(w,1);a.onupgradeneeded=function(){return I(a)},a.onsuccess=function(){var i=a.result;if(null==t){var o=i.transaction(j,"readonly"),s=o.objectStore(j).get(n.modelPath);s.onsuccess=function(){if(null==s.result)return i.close(),r(new Error("Cannot find model with path '".concat(n.modelPath,"' ")+"in IndexedDB."));e(s.result.modelArtifacts)},s.onerror=function(e){return i.close(),r(s.error)},o.oncomplete=function(){return i.close()}}else{var c,u=Object(v.h)(t),l=i.transaction(S,"readwrite"),d=l.objectStore(S),f=d.put({modelPath:n.modelPath,modelArtifactsInfo:u});f.onsuccess=function(){var a=(c=i.transaction(j,"readwrite")).objectStore(j).put({modelPath:n.modelPath,modelArtifacts:t,modelArtifactsInfo:u});a.onsuccess=function(){return e({modelArtifactsInfo:u})},a.onerror=function(e){var t=(d=l.objectStore(S)).delete(n.modelPath);t.onsuccess=function(){return i.close(),r(a.error)},t.onerror=function(e){return i.close(),r(a.error)}}},f.onerror=function(e){return i.close(),r(f.error)},l.oncomplete=function(){null==c?i.close():c.oncomplete=function(){return i.close()}}}},a.onerror=function(e){return r(a.error)}}))}}]),e}();C.URL_SCHEME="indexeddb://";var T=function(e){return Object(f.b)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(C.URL_SCHEME)?(t=e.slice(C.URL_SCHEME.length),new C(t)):null;var t};g.registerSaveRouter(T),g.registerLoadRouter(T);var E=function(){function e(){Object(l.a)(this,e),this.indexedDB=N()}return Object(d.a)(e,[{key:"listModels",value:function(){var e=Object(m.a)(b.a.mark((function e(){var t=this;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.indexedDB.open(w,1);r.onupgradeneeded=function(){return I(r)},r.onsuccess=function(){var t=r.result,a=t.transaction(S,"readonly"),i=a.objectStore(S).getAll();i.onsuccess=function(){var t,n={},r=Object(p.a)(i.result);try{for(r.s();!(t=r.n()).done;){var a=t.value;n[a.modelPath]=a.modelArtifactsInfo}}catch(o){r.e(o)}finally{r.f()}e(n)},i.onerror=function(e){return t.close(),n(i.error)},a.oncomplete=function(){return t.close()}},r.onerror=function(e){return n(r.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"removeModel",value:function(){var e=Object(m.a)(b.a.mark((function e(t){var n=this;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(r=t).startsWith(C.URL_SCHEME)?r.slice(C.URL_SCHEME.length):r,e.abrupt("return",new Promise((function(e,r){var a=n.indexedDB.open(w,1);a.onupgradeneeded=function(){return I(a)},a.onsuccess=function(){var n,i=a.result,o=i.transaction(S,"readwrite"),s=o.objectStore(S),c=s.get(t);c.onsuccess=function(){if(null==c.result)return i.close(),r(new Error("Cannot find model with path '".concat(t,"' ")+"in IndexedDB."));var a=s.delete(t),o=function(){var a=(n=i.transaction(j,"readwrite")).objectStore(j).delete(t);a.onsuccess=function(){return e(c.result.modelArtifactsInfo)},a.onerror=function(e){return r(c.error)}};a.onsuccess=o,a.onerror=function(e){return o(),i.close(),r(c.error)}},c.onerror=function(e){return i.close(),r(c.error)},o.oncomplete=function(){null==n?i.close():n.oncomplete=function(){return i.close()}}},a.onerror=function(e){return r(a.error)}})));case 2:case"end":return e.stop()}var r}),e)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),A=n(15),R="/",F="tensorflowjs_models",D="info",_="model_topology",M="weight_specs",z="weight_data",L="model_metadata";function P(e){return{info:[F,e,D].join(R),topology:[F,e,_].join(R),weightSpecs:[F,e,M].join(R),weightData:[F,e,z].join(R),modelMetadata:[F,e,L].join(R)}}function B(e){for(var t=0,n=Object.values(e);t<n.length;t++){var r=n[t];window.localStorage.removeItem(r)}}function W(e){var t=e.split(R);if(t.length<3)throw new Error("Invalid key format: ".concat(e));return t.slice(1,t.length-1).join(R)}var U=function(){function e(t){if(Object(l.a)(this,e),!Object(f.b)().getBool("IS_BROWSER")||"undefined"===typeof window||"undefined"===typeof window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==t||!t)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=t,this.keys=P(this.modelPath)}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(m.a)(b.a.mark((function e(t){var n,r,a,i;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.modelTopology instanceof ArrayBuffer)){e.next=4;break}throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");case 4:return n=JSON.stringify(t.modelTopology),r=JSON.stringify(t.weightSpecs),a=Object(v.h)(t),e.prev=7,this.LS.setItem(this.keys.info,JSON.stringify(a)),this.LS.setItem(this.keys.topology,n),this.LS.setItem(this.keys.weightSpecs,r),this.LS.setItem(this.keys.weightData,Object(v.a)(t.weightData)),i={format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,signature:null!=t.signature?t.signature:void 0,userDefinedMetadata:null!=t.userDefinedMetadata?t.userDefinedMetadata:void 0,modelInitializer:null!=t.modelInitializer?t.modelInitializer:void 0,trainingConfig:null!=t.trainingConfig?t.trainingConfig:void 0},this.LS.setItem(this.keys.modelMetadata,JSON.stringify(i)),e.abrupt("return",{modelArtifactsInfo:a});case 17:throw e.prev=17,e.t0=e.catch(7),B(this.keys),new Error("Failed to save model '".concat(this.modelPath,"' to local storage: ")+"size quota being exceeded is a possible cause of this failure: "+"modelTopologyBytes=".concat(a.modelTopologyBytes,", ")+"weightSpecsBytes=".concat(a.weightSpecsBytes,", ")+"weightDataBytes=".concat(a.weightDataBytes,"."));case 21:case"end":return e.stop()}}),e,this,[[7,17]])})));return function(t){return e.apply(this,arguments)}}()},{key:"load",value:function(){var e=Object(m.a)(b.a.mark((function e(){var t,n,r,a,i,o,s;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(t=JSON.parse(this.LS.getItem(this.keys.info)))){e.next=3;break}throw new Error("In local storage, there is no model with name '".concat(this.modelPath,"'"));case 3:if("JSON"===t.modelTopologyType){e.next=5;break}throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");case 5:if(n={},null!=(r=JSON.parse(this.LS.getItem(this.keys.topology)))){e.next=9;break}throw new Error("In local storage, the topology of model '".concat(this.modelPath,"' ")+"is missing.");case 9:if(n.modelTopology=r,null!=(a=JSON.parse(this.LS.getItem(this.keys.weightSpecs)))){e.next=13;break}throw new Error("In local storage, the weight specs of model '".concat(this.modelPath,"' ")+"are missing.");case 13:if(n.weightSpecs=a,null!=(i=this.LS.getItem(this.keys.modelMetadata))&&(o=JSON.parse(i),n.format=o.format,n.generatedBy=o.generatedBy,n.convertedBy=o.convertedBy,null!=o.signature&&(n.signature=o.signature),null!=o.userDefinedMetadata&&(n.userDefinedMetadata=o.userDefinedMetadata),null!=o.modelInitializer&&(n.modelInitializer=o.modelInitializer),null!=o.trainingConfig&&(n.trainingConfig=o.trainingConfig)),null!=(s=this.LS.getItem(this.keys.weightData))){e.next=19;break}throw new Error("In local storage, the binary weight values of model "+"'".concat(this.modelPath,"' are missing."));case 19:return n.weightData=Object(v.b)(s),e.abrupt("return",n);case 21:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}();U.URL_SCHEME="localstorage://";var V=function(e){return Object(f.b)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(U.URL_SCHEME)?(t=e.slice(U.URL_SCHEME.length),new U(t)):null;var t};g.registerSaveRouter(V),g.registerLoadRouter(V);var H=function(){function e(){Object(l.a)(this,e),Object(A.b)(Object(f.b)().getBool("IS_BROWSER"),(function(){return"Current environment is not a web browser"})),Object(A.b)("undefined"===typeof window||"undefined"!==typeof window.localStorage,(function(){return"Current browser does not appear to support localStorage"})),this.LS=window.localStorage}return Object(d.a)(e,[{key:"listModels",value:function(){var e=Object(m.a)(b.a.mark((function e(){var t,n,r,a,i,o;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t={},n=F+R,r=R+D,a=0;a<this.LS.length;++a)(i=this.LS.key(a)).startsWith(n)&&i.endsWith(r)&&(o=W(i),t[o]=JSON.parse(this.LS.getItem(i)));return e.abrupt("return",t);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeModel",value:function(){var e=Object(m.a)(b.a.mark((function e(t){var n,r;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(a=t).startsWith(U.URL_SCHEME)?a.slice(U.URL_SCHEME.length):a,n=P(t),null!=this.LS.getItem(n.info)){e.next=4;break}throw new Error("Cannot find model at path '".concat(t,"'"));case 4:return r=JSON.parse(this.LS.getItem(n.info)),B(n),e.abrupt("return",r);case 7:case"end":return e.stop()}var a}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),G="://",q=function(){function e(){Object(l.a)(this,e),this.managers={}}return Object(d.a)(e,null,[{key:"getInstance",value:function(){return null==e.instance&&(e.instance=new e),e.instance}},{key:"registerManager",value:function(t,n){Object(A.b)(null!=t,(function(){return"scheme must not be undefined or null."})),t.endsWith(G)&&(t=t.slice(0,t.indexOf(G))),Object(A.b)(t.length>0,(function(){return"scheme must not be an empty string."}));var r=e.getInstance();Object(A.b)(null==r.managers[t],(function(){return"A model store manager is already registered for scheme '".concat(t,"'.")})),r.managers[t]=n}},{key:"getManager",value:function(e){var t=this.getInstance().managers[e];if(null==t)throw new Error("Cannot find model manager for scheme '".concat(e,"'"));return t}},{key:"getSchemes",value:function(){return Object.keys(this.getInstance().managers)}}]),e}();function K(e){if(-1===e.indexOf(G))throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+"".concat(q.getSchemes().join(",")));return{scheme:e.split(G)[0],path:e.split(G)[1]}}function X(e,t){return Y.apply(this,arguments)}function Y(){return(Y=Object(m.a)(b.a.mark((function e(t,n){var r,a,i,o,s,c,u,l,d,f,p=arguments;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.length>2&&void 0!==p[2]&&p[2],Object(A.b)(t!==n,(function(){return"Old path and new path are the same: '".concat(t,"'")})),a=g.getLoadHandlers(t),Object(A.b)(a.length>0,(function(){return"Copying failed because no load handler is found for source URL ".concat(t,".")})),Object(A.b)(a.length<2,(function(){return"Copying failed because more than one (".concat(a.length,") ")+"load handlers for source URL ".concat(t,".")})),i=a[0],o=g.getSaveHandlers(n),Object(A.b)(o.length>0,(function(){return"Copying failed because no save handler is found for destination "+"URL ".concat(n,".")})),Object(A.b)(o.length<2,(function(){return"Copying failed because more than one (".concat(a.length,") ")+"save handlers for destination URL ".concat(n,".")})),s=o[0],c=K(t).scheme,u=K(t).path,l=c===K(t).scheme,e.next=15,i.load();case 15:if(d=e.sent,!r||!l){e.next=19;break}return e.next=19,q.getManager(c).removeModel(u);case 19:return e.next=21,s.save(d);case 21:if(f=e.sent,!r||l){e.next=25;break}return e.next=25,q.getManager(c).removeModel(u);case 25:return e.abrupt("return",f.modelArtifactsInfo);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(){return Q.apply(this,arguments)}function Q(){return(Q=Object(m.a)(b.a.mark((function e(){var t,n,r,a,i,o,s;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=q.getSchemes(),n={},r=Object(p.a)(t),e.prev=3,r.s();case 5:if((a=r.n()).done){e.next=13;break}return i=a.value,e.next=9,q.getManager(i).listModels();case 9:for(s in o=e.sent)n[i+G+s]=o[s];case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3),r.e(e.t0);case 18:return e.prev=18,r.f(),e.finish(18);case 21:return e.abrupt("return",n);case 22:case"end":return e.stop()}}),e,null,[[3,15,18,21]])})))).apply(this,arguments)}function Z(e){return J.apply(this,arguments)}function J(){return(J=Object(m.a)(b.a.mark((function e(t){var n,r;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=K(t),r=q.getManager(n.scheme),e.abrupt("return",r.removeModel(n.path));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(e,t){return te.apply(this,arguments)}function te(){return(te=Object(m.a)(b.a.mark((function e(t,n){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!1,e.abrupt("return",X(t,n,false));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ne(e,t){return re.apply(this,arguments)}function re(){return(re=Object(m.a)(b.a.mark((function e(t,n){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!0,e.abrupt("return",X(t,n,true));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ae=function(){function e(){Object(l.a)(this,e)}return Object(d.a)(e,[{key:"fetch",value:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){return fetch(e,t)}))},{key:"now",value:function(){return performance.now()}},{key:"encode",value:function(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error("Browser's encoder only supports utf-8, but got ".concat(t));return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}},{key:"decode",value:function(e,t){return new TextDecoder(t).decode(e)}}]),e}();if(Object(f.b)().get("IS_BROWSER")){Object(f.b)().setPlatform("browser",new ae);try{q.registerManager(U.URL_SCHEME,new H)}catch(In){}try{q.registerManager(C.URL_SCHEME,new E)}catch(In){}}n(332);var ie=n(68),oe=n(24),se=n(92),ce=n(189),ue=n(10);Object(u.b)();var le={buffer:ie.a,cast:oe.a,clone:se.a,print:ce.a};Object(ue.f)(le);var de=n(21);function fe(e){return new Promise((function(e){return setTimeout(e)})).then(e)}var pe=function(){function e(t){if(Object(l.a)(this,e),!Object(f.b)().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="model"),this.modelJsonFileName=t+".json",this.weightDataFileName=t+".weights.bin"}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(m.a)(b.a.mark((function e(t){var n,r,a,i,o,s;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!==typeof document){e.next=2;break}throw new Error("Browser downloads are not supported in this environment since `document` is not present");case 2:if(n=window.URL.createObjectURL(new Blob([t.weightData],{type:"application/octet-stream"})),!(t.modelTopology instanceof ArrayBuffer)){e.next=7;break}throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");case 7:return r=[{paths:["./"+this.weightDataFileName],weights:t.weightSpecs}],a=Object(v.i)(t,r),i=window.URL.createObjectURL(new Blob([JSON.stringify(a)],{type:"application/json"})),(o=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor).download=this.modelJsonFileName,o.href=i,e.next=15,fe((function(){return o.dispatchEvent(new MouseEvent("click"))}));case 15:if(null==t.weightData){e.next=21;break}return(s=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor).download=this.weightDataFileName,s.href=n,e.next=21,fe((function(){return s.dispatchEvent(new MouseEvent("click"))}));case 21:return e.abrupt("return",{modelArtifactsInfo:Object(v.h)(t)});case 22:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();pe.URL_SCHEME="downloads://";var he=function(){function e(t){if(Object(l.a)(this,e),null==t||t.length<1)throw new Error("When calling browserFiles, at least 1 file is required, "+"but received ".concat(t));this.jsonFile=t[0],this.weightsFiles=t.slice(1)}return Object(d.a)(e,[{key:"load",value:function(){var e=Object(m.a)(b.a.mark((function e(){var t=this;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new FileReader;r.onload=function(r){var a=JSON.parse(r.target.result),i=a.modelTopology;if(null!=i)if(null!=a.weightsManifest)if(0!==t.weightsFiles.length){var o=Object(v.g)(a,(function(e){return t.loadWeights(e)}));e(o)}else e({modelTopology:i});else n(new Error("weightManifest field is missing from file ".concat(t.jsonFile.name)));else n(new Error("modelTopology field is missing from file ".concat(t.jsonFile.name)))},r.onerror=function(e){return n("Failed to read model topology and weights manifest JSON "+"from file '".concat(t.jsonFile.name,"'. BrowserFiles supports loading ")+"Keras-style tf.Model artifacts only.")},r.readAsText(t.jsonFile)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"loadWeights",value:function(e){var t,n=this,r=[],a=[],i=Object(p.a)(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;r.push.apply(r,Object(de.a)(o.weights)),a.push.apply(a,Object(de.a)(o.paths))}}catch(In){i.e(In)}finally{i.f()}var s=this.checkManifestAndWeightFiles(e),c=a.map((function(e){return n.loadWeightsFile(e,s[e])}));return Promise.all(c).then((function(e){return[r,Object(v.d)(e)]}))}},{key:"loadWeightsFile",value:function(e,t){return new Promise((function(n,r){var a=new FileReader;a.onload=function(e){var t=e.target.result;n(t)},a.onerror=function(t){return r("Failed to weights data from file of path '".concat(e,"'."))},a.readAsArrayBuffer(t)}))}},{key:"checkManifestAndWeightFiles",value:function(e){var t,n=this,r=[],a=this.weightsFiles.map((function(e){return Object(v.c)(e.name)})),i={},o=Object(p.a)(e);try{for(o.s();!(t=o.n()).done;){t.value.paths.forEach((function(e){var t=Object(v.c)(e);if(-1!==r.indexOf(t))throw new Error("Duplicate file basename found in weights manifest: "+"'".concat(t,"'"));if(r.push(t),-1===a.indexOf(t))throw new Error("Weight file with basename '".concat(t,"' is not provided."));i[e]=n.weightsFiles[a.indexOf(t)]}))}}catch(In){o.e(In)}finally{o.f()}if(r.length!==this.weightsFiles.length)throw new Error("Mismatch in the number of files in weights manifest "+"(".concat(r.length,") and the number of weight files provided ")+"(".concat(this.weightsFiles.length,")."));return i}}]),e}();function be(e){return new he(e)}g.registerSaveRouter((function(e){return Object(f.b)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(pe.URL_SCHEME)?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"model";return new pe(e)}(e.slice(pe.URL_SCHEME.length)):null}));var me=n(6);function ve(e,t,n,r){!function(e){Object(A.b)(null!=e&&Array.isArray(e)&&e.length>0,(function(){return"promises must be a none empty array"}))}(e),function(e,t){Object(A.b)(e>=0&&e<=1,(function(){return"Progress fraction must be in range [0, 1], but "+"got startFraction ".concat(e)})),Object(A.b)(t>=0&&t<=1,(function(){return"Progress fraction must be in range [0, 1], but "+"got endFraction ".concat(t)})),Object(A.b)(t>=e,(function(){return"startFraction must be no more than endFraction, but "+"got startFraction ".concat(e," and endFraction ")+"".concat(t)}))}(n=null==n?0:n,r=null==r?1:r);var a=0;return Promise.all(e.map((function(i){return i.then((function(i){var o=n+ ++a/e.length*(r-n);return t(o),i})),i})))}var ge=n(183);function ye(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=Object(m.a)(b.a.mark((function e(t,n){var r,a,i,o,s,c,u,l,d;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==n&&(n={}),r=null==n.fetchFunc?Object(f.b)().platform.fetch:n.fetchFunc,a=t.map((function(e){return r(e,n.requestInit,{isBinary:!0})})),i=0,o=.5,null!=n.onProgress){e.next=11;break}return e.next=8,Promise.all(a);case 8:e.t0=e.sent,e.next=14;break;case 11:return e.next=13,ve(a,n.onProgress,i,o);case 13:e.t0=e.sent;case 14:if(s=e.t0,c=s.map((function(e){return e.arrayBuffer()})),u=.5,l=1,null!=n.onProgress){e.next=24;break}return e.next=21,Promise.all(c);case 21:e.t1=e.sent,e.next=27;break;case 24:return e.next=26,ve(c,n.onProgress,u,l);case 26:e.t1=e.sent;case 27:return d=e.t1,e.abrupt("return",d);case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(e){return ke.apply(this,arguments)}function ke(){return(ke=Object(m.a)(b.a.mark((function e(t){var n,r,a,i,o=arguments;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:"",r=o.length>2?o[2]:void 0,a=o.length>3?o[3]:void 0,i=we((function(e){return ye(e,{requestInit:a})})),e.abrupt("return",i(t,n,r));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e){return function(){var t=Object(m.a)(b.a.mark((function t(n){var r,a,i,o,s,c,u,l,d,f,p,h,m=arguments;return b.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=m.length>1&&void 0!==m[1]?m[1]:"",a=m.length>2?m[2]:void 0,i=n.map((function(){return!1})),o={},s=null!=a?a.map((function(){return!1})):[],c=[],n.forEach((function(e,t){var n=0;e.weights.forEach((function(e){var r="quantization"in e?e.quantization.dtype:e.dtype,u=ge.a[r]*A.O(e.shape),l=function(){i[t]=!0,null==o[t]&&(o[t]=[]),o[t].push({manifestEntry:e,groupOffset:n,sizeBytes:u})};null!=a?a.forEach((function(t,n){t===e.name&&(l(),s[n]=!0)})):l(),c.push(e.name),n+=u}))})),s.every((function(e){return e}))){t.next=10;break}throw u=a.filter((function(e,t){return!s[t]})),new Error("Could not find weights in manifest with names: "+"".concat(u.join(", "),". \n")+"Manifest JSON has weights with names: "+"".concat(c.join(", "),"."));case 10:return l=i.reduce((function(e,t,n){return t&&e.push(n),e}),[]),d=[],l.forEach((function(e){n[e].paths.forEach((function(e){var t=r+(r.endsWith("/")?"":"/")+e;d.push(t)}))})),t.next=15,e(d);case 15:return f=t.sent,p={},h=0,l.forEach((function(e){for(var t=n[e].paths.length,r=0,a=0;a<t;a++)r+=f[h+a].byteLength;for(var i=new ArrayBuffer(r),s=new Uint8Array(i),c=0,u=0;u<t;u++){var l=new Uint8Array(f[h+u]);s.set(l,c),c+=l.byteLength}o[e].forEach((function(e){var t=i.slice(e.groupOffset,e.groupOffset+e.sizeBytes),n=Object(v.e)(t,[e.manifestEntry]);for(var r in n)p[r]=n[r]})),h+=t})),t.abrupt("return",p);case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}var je=function(){function e(t,n){if(Object(l.a)(this,e),this.DEFAULT_METHOD="POST",null==n&&(n={}),this.weightPathPrefix=n.weightPathPrefix,this.onProgress=n.onProgress,this.weightUrlConverter=n.weightUrlConverter,null!=n.fetchFunc?(Object(A.b)("function"===typeof n.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=n.fetchFunc):this.fetch=Object(f.b)().platform.fetch,Object(A.b)(null!=t&&t.length>0,(function(){return"URL path for http must not be null, undefined or empty."})),Array.isArray(t)&&Object(A.b)(2===t.length,(function(){return"URL paths for http must have a length of 2, "+"(actual length is ".concat(t.length,").")})),this.path=t,null!=n.requestInit&&null!=n.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=n.requestInit||{}}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(m.a)(b.a.mark((function e(t){var n,r,a,i;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.modelTopology instanceof ArrayBuffer)){e.next=2;break}throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");case 2:return(n=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,r=[{paths:["./model.weights.bin"],weights:t.weightSpecs}],a=Object(v.i)(t,r),n.body.append("model.json",new Blob([JSON.stringify(a)],{type:"application/json"}),"model.json"),null!=t.weightData&&n.body.append("model.weights.bin",new Blob([t.weightData],{type:"application/octet-stream"}),"model.weights.bin"),e.next=10,this.fetch(this.path,n);case 10:if(!(i=e.sent).ok){e.next=15;break}return e.abrupt("return",{modelArtifactsInfo:Object(v.h)(t),responses:[i]});case 15:throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+"".concat(i.status,"."));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"load",value:function(){var e=Object(m.a)(b.a.mark((function e(){var t,n,r,a,i,o=this;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch(this.path,this.requestInit);case 2:if((t=e.sent).ok){e.next=5;break}throw new Error("Request to ".concat(this.path," failed with status code ")+"".concat(t.status,". Please verify this URL points to ")+"the model JSON of the model to load.");case 5:return e.prev=5,e.next=8,t.json();case 8:n=e.sent,e.next=16;break;case 11:throw e.prev=11,e.t0=e.catch(5),r="Failed to parse model JSON of response from ".concat(this.path,"."),this.path.endsWith(".pb")?r+=" 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.":r+=" Please make sure the server is serving valid JSON for this request.",new Error(r);case 16:if(a=n.modelTopology,i=n.weightsManifest,null!=a||null!=i){e.next=20;break}throw new Error("The JSON from HTTP path ".concat(this.path," contains neither model ")+"topology or manifest for weights.");case 20:return e.abrupt("return",Object(v.g)(n,(function(e){return o.loadWeights(e)})));case 21:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(){return e.apply(this,arguments)}}()},{key:"loadWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(t){var n,r,a,i,o,s,c,u,l,d,f,h,m,g,y,O,x,k,w;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Array.isArray(this.path)?this.path[1]:this.path,r=Se(n),a=Object(me.a)(r,2),i=a[0],o=a[1],s=this.weightPathPrefix||i,c=[],u=Object(p.a)(t);try{for(u.s();!(l=u.n()).done;)d=l.value,c.push.apply(c,Object(de.a)(d.weights))}catch(In){u.e(In)}finally{u.f()}f=[],h=[],m=Object(p.a)(t);try{for(m.s();!(g=m.n()).done;){y=g.value,O=Object(p.a)(y.paths);try{for(O.s();!(x=O.n()).done;)k=x.value,null!=this.weightUrlConverter?h.push(this.weightUrlConverter(k)):f.push(s+k+o)}catch(In){O.e(In)}finally{O.f()}}}catch(In){m.e(In)}finally{m.f()}if(!this.weightUrlConverter){e.next=19;break}return e.t0=f.push,e.t1=f,e.t2=de.a,e.next=16,Promise.all(h);case 16:e.t3=e.sent,e.t4=(0,e.t2)(e.t3),e.t0.apply.call(e.t0,e.t1,e.t4);case 19:return e.next=21,ye(f,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});case 21:return w=e.sent,e.abrupt("return",[c,Object(v.d)(w)]);case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function Se(e){var t=e.lastIndexOf("/"),n=e.lastIndexOf("?");return[e.substring(0,t)+"/",n>t?e.substring(n):""]}function Ne(e){return null!=e.match(je.URL_SCHEME_REGEX)}je.URL_SCHEME_REGEX=/^https?:\/\//;var Ie=function(e,t){if("undefined"===typeof fetch&&(null==t||null==t.fetchFunc))return null;return(Array.isArray(e)?e.every((function(e){return Ne(e)})):Ne(e))?Ce(e,t):null};function Ce(e,t){return new je(e,t)}function Te(e,t){return Ce(e,t)}g.registerSaveRouter(Ie),g.registerLoadRouter(Ie);var Ee=function(){function e(t){Object(l.a)(this,e),this.modelArtifacts=t}return Object(d.a)(e,[{key:"load",value:function(){var e=Object(m.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.modelArtifacts);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),Ae=function(){function e(t){Object(l.a)(this,e),this.saveHandler=t}return Object(d.a)(e,[{key:"save",value:function(){var e=Object(m.a)(b.a.mark((function e(t){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.saveHandler(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function Re(e,t,n,r){if(1===arguments.length){var a=null!=e.modelTopology||null!=e.weightSpecs;return a?new Ee(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Ee({modelTopology:e}))}return console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Ee({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:r})}function Fe(e){return new Ae(e)}var De,_e=n(3),Me=n(85),ze=n(2),Le=n(8),Pe=n(220);function Be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");var n=!1,r=!1,a=!1,i=!1,o=!1,s=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!==typeof ImageData&&e instanceof ImageData)r=!0;else if("undefined"!==typeof HTMLVideoElement&&e instanceof HTMLVideoElement)a=!0;else if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement)i=!0;else if(null!=e.getContext)o=!0;else{if(!("undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap))throw new Error("pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, "+"but was ".concat(e.constructor.name));s=!0}if(a){var c=2;if(a&&e.readyState<c)throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.")}var l=Object(Me.b)(_e.ib,u.a.backendName);if(null!=l){var d={pixels:e},f={numChannels:t};return u.a.runKernel(_e.ib,d,f)}var p,h,b=a?[e.videoWidth,e.videoHeight]:[e.width,e.height],m=Object(me.a)(b,2),v=m[0],g=m[1];if(o?p=e.getContext("2d").getImageData(0,0,v,g).data:r||n?p=e.data:(i||a||s)&&(null==De&&(De=document.createElement("canvas").getContext("2d")),De.canvas.width=v,De.canvas.height=g,De.drawImage(e,0,0,v,g),p=De.getImageData(0,0,v,g).data),4===t)h=new Int32Array(p);else{var y=v*g;h=new Int32Array(y*t);for(var O=0;O<y;O++)for(var x=0;x<t;++x)h[O*t+x]=p[4*O+x]}var k=[g,v,t];return Object(Pe.a)(h,k,"int32")}function We(e){return"undefined"!==typeof window&&"undefined"!==typeof ImageBitmap&&window.hasOwnProperty("createImageBitmap")&&!(e instanceof ImageBitmap)&&function(e){return null!=e&&0!==e.width&&0!==e.height}(e)&&!function(e){return null!=e&&e.data instanceof Uint8Array}(e)}function Ue(e){return Ve.apply(this,arguments)}function Ve(){return(Ve=Object(m.a)(b.a.mark((function e(t){var n,r,a,i=arguments;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:3,r=null,!Object(f.b)().getBool("WRAP_TO_IMAGEBITMAP")||!We(t)){e.next=15;break}return e.prev=3,e.next=6,createImageBitmap(t,{premultiplyAlpha:"none"});case 6:a=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),a=null;case 12:r=null!=a&&a.width===t.width&&a.height===t.height?a:t,e.next=16;break;case 15:r=t;case 16:return e.abrupt("return",Be(r,n));case 17:case"end":return e.stop()}}),e,null,[[3,9]])})))).apply(this,arguments)}function He(e,t){return Ge.apply(this,arguments)}function Ge(){return(Ge=Object(m.a)(b.a.mark((function e(t,n){var r,a,i,o,s,c,u,l,d,f,p,h,m,v,g,y,O;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Object(ze.a)(t,"img","toPixels"),t instanceof ue.a||(a=r,r=Object(oe.a)(a,"int32"),a.dispose()),2===r.rank||3===r.rank){e.next=4;break}throw new Error("toPixels only supports rank 2 or 3 tensors, got rank ".concat(r.rank,"."));case 4:if(i=r.shape.slice(0,2),o=Object(me.a)(i,2),s=o[0],c=o[1],!((u=2===r.rank?1:r.shape[2])>4||2===u)){e.next=8;break}throw new Error("toPixels only supports depth of size "+"1, 3 or 4 but got ".concat(u));case 8:if("float32"===r.dtype||"int32"===r.dtype){e.next=10;break}throw new Error("Unsupported type for toPixels: ".concat(r.dtype,".")+" Please use float32 or int32 tensors.");case 10:return e.next=12,r.data();case 12:l=e.sent,d="float32"===r.dtype?255:1,f=new Uint8ClampedArray(c*s*4),p=0;case 16:if(!(p<s*c)){e.next=41;break}h=[0,0,0,255],m=0;case 19:if(!(m<u)){e.next=33;break}if(v=l[p*u+m],"float32"!==r.dtype){e.next=26;break}if(!(v<0||v>1)){e.next=24;break}throw new Error("Tensor values for a float32 Tensor must be in the "+"range [0 - 1] but encountered ".concat(v,"."));case 24:e.next=29;break;case 26:if("int32"!==r.dtype){e.next=29;break}if(!(v<0||v>255)){e.next=29;break}throw new Error("Tensor values for a int32 Tensor must be in the "+"range [0 - 255] but encountered ".concat(v,"."));case 29:1===u?(h[0]=v*d,h[1]=v*d,h[2]=v*d):h[m]=v*d;case 30:m++,e.next=19;break;case 33:f[(g=4*p)+0]=Math.round(h[0]),f[g+1]=Math.round(h[1]),f[g+2]=Math.round(h[2]),f[g+3]=Math.round(h[3]);case 38:++p,e.next=16;break;case 41:return null!=n&&(n.width=c,n.height=s,y=n.getContext("2d"),O=new ImageData(f,c,s),y.putImageData(O,0,0)),r!==t&&r.dispose(),e.abrupt("return",f);case 44:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qe=Object(Le.b)({fromPixels_:Be}),Ke=n(142),Xe=function(){function e(){Object(l.a)(this,e)}return Object(d.a)(e,[{key:"getClassName",value:function(){return this.constructor.className}}],[{key:"fromConfig",value:function(e,t){return new e(t)}}]),e}(),Ye=function(){function e(){Object(l.a)(this,e),this.classNameMap={}}return Object(d.a)(e,null,[{key:"getMap",value:function(){return null==e.instance&&(e.instance=new e),e.instance}},{key:"register",value:function(t){e.getMap().classNameMap[t.className]=[t,t.fromConfig]}}]),e}();function $e(e){Object(A.b)(null!=e.className,(function(){return"Class being registered does not have the static className property defined."})),Object(A.b)("string"===typeof e.className,(function(){return"className is required to be a string, but got type "+typeof e.className})),Object(A.b)(e.className.length>0,(function(){return"Class being registered has an empty-string as its className, which is disallowed."})),Ye.register(e)}var Qe=n(39),Ze=n(19),Je="3.8.0",et=n(16),tt=n(17),nt=n(44),rt=n(55),at=n(33),it=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(){return Object(l.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"minimize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.computeGradients(e,n),a=r.value,i=r.grads;if(null!=n){var o=n.map((function(e){return{name:e.name,tensor:i[e.name]}}));this.applyGradients(o)}else this.applyGradients(i);return Object(nt.b)(i),t?a:(a.dispose(),null)}},{key:"iterations",get:function(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}},{key:"incrementIterations",value:function(){this.iterations_=this.iterations+1}},{key:"computeGradients",value:function(e,t){return Object(rt.b)(e,t)}},{key:"dispose",value:function(){null!=this.iterations_&&Object(nt.b)(this.iterations_)}},{key:"saveIterations",value:function(){var e=Object(m.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==this.iterations_&&(this.iterations_=0),e.abrupt("return",{name:"iter",tensor:Object(at.a)(this.iterations_,"int32")});case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("getWeights() is not implemented for this optimizer yet.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(t){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("setWeights() is not implemented for this optimizer class "+"".concat(this.getClassName()));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"extractIterations",value:function(){var e=Object(m.a)(b.a.mark((function e(t){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t[0].tensor.data();case 2:return this.iterations_=e.sent[0],e.abrupt("return",t.slice(1));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Xe);Object.defineProperty(it,Symbol.hasInstance,{value:function(e){return null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients}});var ot=n(114),st=n(37),ct=n(27),ut=n(31),lt=n(18),dt=n(58),ft=n(40),pt=n(36),ht=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e,r){var a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object(l.a)(this,n),(a=t.call(this)).learningRate=e,a.rho=r,a.epsilon=i,a.accumulatedGrads=[],a.accumulatedUpdates=[],null==i&&(a.epsilon=u.a.backend.epsilon()),a}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e)).forEach((function(n,r){var a=u.a.registeredVariables[n];null==t.accumulatedGrads[r]&&(t.accumulatedGrads[r]={originalName:"".concat(n,"/accum_grad"),variable:Object(nt.h)((function(){return Object(pt.a)(a).variable(false)}))}),null==t.accumulatedUpdates[r]&&(t.accumulatedUpdates[r]={originalName:"".concat(n,"/accum_var"),variable:Object(nt.h)((function(){return Object(pt.a)(a).variable(false)}))});var i=Array.isArray(e)?e[r].tensor:e[n];if(null!=i){var o=t.accumulatedGrads[r].variable,s=t.accumulatedUpdates[r].variable;Object(nt.h)((function(){var e=Object(ct.a)(Object(lt.a)(o,t.rho),Object(lt.a)(Object(ft.a)(i),1-t.rho)),n=Object(lt.a)(Object(ut.a)(Object(dt.a)(Object(ct.a)(s,t.epsilon)),Object(dt.a)(Object(ct.a)(o,t.epsilon))),i),r=Object(ct.a)(Object(lt.a)(s,t.rho),Object(lt.a)(Object(ft.a)(n),1-t.rho));o.assign(e),s.assign(r);var c=Object(ct.a)(Object(lt.a)(n,-t.learningRate),a);a.assign(c)}))}})),this.incrementIterations()}},{key:"dispose",value:function(){null!=this.accumulatedUpdates&&(Object(nt.b)(this.accumulatedGrads.map((function(e){return e.variable}))),Object(nt.b)(this.accumulatedUpdates.map((function(e){return e.variable}))))}},{key:"getWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(){var t;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[].concat(Object(de.a)(this.accumulatedGrads),Object(de.a)(this.accumulatedUpdates)),e.next=3,this.saveIterations();case 3:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(t.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(t){var n;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,n=t.length/2,!1,this.accumulatedGrads=t.slice(0,n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(false)}})),this.accumulatedUpdates=t.slice(n,2*n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(false)}}));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}]),n}(it);ht.className="Adadelta",$e(ht);var bt=n(118),mt=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1;return Object(l.a)(this,n),(r=t.call(this)).learningRate=e,r.initialAccumulatorValue=a,r.accumulatedGrads=[],r}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e)).forEach((function(n,r){var a=u.a.registeredVariables[n];if(null==t.accumulatedGrads[r]){t.accumulatedGrads[r]={originalName:"".concat(n,"/accumulator"),variable:Object(nt.h)((function(){return Object(bt.a)(a.shape,t.initialAccumulatorValue).variable(false)}))}}var i=Array.isArray(e)?e[r].tensor:e[n];if(null!=i){var o=t.accumulatedGrads[r].variable;Object(nt.h)((function(){var e=Object(ct.a)(o,Object(ft.a)(i));o.assign(e);var n=Object(ct.a)(Object(lt.a)(Object(ut.a)(i,Object(dt.a)(Object(ct.a)(e,u.a.backend.epsilon()))),-t.learningRate),a);a.assign(n)}))}})),this.incrementIterations()}},{key:"dispose",value:function(){null!=this.accumulatedGrads&&Object(nt.b)(this.accumulatedGrads.map((function(e){return e.variable})))}},{key:"getWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.saveIterations();case 2:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(this.accumulatedGrads.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(t){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,!1,this.accumulatedGrads=t.map((function(e){return{originalName:e.name,variable:e.tensor.variable(false)}}));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}]),n}(it);mt.className="Adagrad",$e(mt);var vt=n(73),gt=n(29),yt=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e,r,a){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Object(l.a)(this,n),(i=t.call(this)).learningRate=e,i.beta1=r,i.beta2=a,i.epsilon=o,i.accumulatedFirstMoment=[],i.accumulatedSecondMoment=[],Object(nt.h)((function(){i.accBeta1=Object(at.a)(r).variable(),i.accBeta2=Object(at.a)(a).variable()})),null==o&&(i.epsilon=u.a.backend.epsilon()),i}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this,n=Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e);Object(nt.h)((function(){var r=Object(gt.a)(1,t.accBeta1),a=Object(gt.a)(1,t.accBeta2);n.forEach((function(n,i){var o=u.a.registeredVariables[n];null==t.accumulatedFirstMoment[i]&&(t.accumulatedFirstMoment[i]={originalName:"".concat(n,"/m"),variable:Object(nt.h)((function(){return Object(pt.a)(o).variable(false)}))}),null==t.accumulatedSecondMoment[i]&&(t.accumulatedSecondMoment[i]={originalName:"".concat(n,"/v"),variable:Object(nt.h)((function(){return Object(pt.a)(o).variable(false)}))});var s=Array.isArray(e)?e[i].tensor:e[n];if(null!=s){var c=t.accumulatedFirstMoment[i].variable,l=t.accumulatedSecondMoment[i].variable,d=Object(ct.a)(Object(lt.a)(c,t.beta1),Object(lt.a)(s,1-t.beta1)),f=Object(ct.a)(Object(lt.a)(l,t.beta2),Object(lt.a)(Object(ft.a)(s),1-t.beta2)),p=Object(ut.a)(d,r),h=Object(ut.a)(f,a);c.assign(d),l.assign(f);var b=Object(ct.a)(Object(lt.a)(Object(ut.a)(p,Object(ct.a)(Object(dt.a)(h),t.epsilon)),-t.learningRate),o);o.assign(b)}})),t.accBeta1.assign(Object(lt.a)(t.accBeta1,t.beta1)),t.accBeta2.assign(Object(lt.a)(t.accBeta2,t.beta2))})),this.incrementIterations()}},{key:"dispose",value:function(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Object(nt.b)(this.accumulatedFirstMoment.map((function(e){return e.variable}))),null!=this.accumulatedSecondMoment&&Object(nt.b)(this.accumulatedSecondMoment.map((function(e){return e.variable})))}},{key:"getWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(){var t;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[].concat(Object(de.a)(this.accumulatedFirstMoment),Object(de.a)(this.accumulatedSecondMoment)),e.next=3,this.saveIterations();case 3:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(t.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(t){var n,r=this;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,Object(nt.h)((function(){r.accBeta1.assign(Object(vt.a)(r.beta1,r.iterations_+1)),r.accBeta2.assign(Object(vt.a)(r.beta2,r.iterations_+1))})),n=t.length/2,!1,this.accumulatedFirstMoment=t.slice(0,n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(false)}})),this.accumulatedSecondMoment=t.slice(n,2*n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(false)}}));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}]),n}(it);yt.className="Adam",$e(yt);var Ot=n(65),xt=n(121),kt=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e,r,a){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return Object(l.a)(this,n),(i=t.call(this)).learningRate=e,i.beta1=r,i.beta2=a,i.epsilon=o,i.decay=s,i.accumulatedFirstMoment=[],i.accumulatedWeightedInfNorm=[],Object(nt.h)((function(){i.iteration=Object(at.a)(0).variable(),i.accBeta1=Object(at.a)(r).variable()})),null==o&&(i.epsilon=u.a.backend.epsilon()),i}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this,n=Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e);Object(nt.h)((function(){var r=Object(gt.a)(1,t.accBeta1),a=Object(ut.a)(-t.learningRate,Object(ct.a)(Object(lt.a)(t.iteration,t.decay),1));n.forEach((function(n,i){var o=u.a.registeredVariables[n];null==t.accumulatedFirstMoment[i]&&(t.accumulatedFirstMoment[i]={originalName:"".concat(n,"/m"),variable:Object(pt.a)(o).variable(false)}),null==t.accumulatedWeightedInfNorm[i]&&(t.accumulatedWeightedInfNorm[i]={originalName:"".concat(n,"/v"),variable:Object(pt.a)(o).variable(false)});var s=Array.isArray(e)?e[i].tensor:e[n];if(null!=s){var c=t.accumulatedFirstMoment[i].variable,l=t.accumulatedWeightedInfNorm[i].variable,d=Object(ct.a)(Object(lt.a)(c,t.beta1),Object(lt.a)(s,1-t.beta1)),f=Object(lt.a)(l,t.beta2),p=Object(Ot.a)(s),h=Object(xt.a)(f,p);c.assign(d),l.assign(h);var b=Object(ct.a)(Object(lt.a)(Object(ut.a)(a,r),Object(ut.a)(d,Object(ct.a)(h,t.epsilon))),o);o.assign(b)}})),t.iteration.assign(Object(ct.a)(t.iteration,1)),t.accBeta1.assign(Object(lt.a)(t.accBeta1,t.beta1))})),this.incrementIterations()}},{key:"dispose",value:function(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Object(nt.b)(this.accumulatedFirstMoment.map((function(e){return e.variable}))),null!=this.accumulatedWeightedInfNorm&&Object(nt.b)(this.accumulatedWeightedInfNorm.map((function(e){return e.variable})))}},{key:"getWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("getWeights() is not implemented for Adamax yet.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(t){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("setWeights() is not implemented for Adamax yet.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}]),n}(it);kt.className="Adamax",$e(kt);var wt=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var r;return Object(l.a)(this,n),(r=t.call(this)).learningRate=e,r.setLearningRate(e),r}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e)).forEach((function(n,r){var a=Array.isArray(e)?e[r].tensor:e[n];if(null!=a){var i=u.a.registeredVariables[n];Object(nt.h)((function(){var e=Object(ct.a)(Object(lt.a)(t.c,a),i);i.assign(e)}))}})),this.incrementIterations()}},{key:"setLearningRate",value:function(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=Object(nt.d)(Object(at.a)(-e))}},{key:"dispose",value:function(){this.c.dispose()}},{key:"getWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.saveIterations();case 2:return e.t0=e.sent,e.abrupt("return",[e.t0]);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(t){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:if(0===(t=e.sent).length){e.next=5;break}throw new Error("SGD optimizer does not have settable weights.");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate)}}]),n}(it);wt.className="SGD",$e(wt);var jt=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e,r){var a,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(l.a)(this,n),(a=t.call(this,e)).learningRate=e,a.momentum=r,a.useNesterov=i,a.accumulations=[],a.m=Object(at.a)(a.momentum),a}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e)).forEach((function(n,r){var a=u.a.registeredVariables[n];if(null==t.accumulations[r]){t.accumulations[r]={originalName:"".concat(n,"/momentum"),variable:Object(nt.h)((function(){return Object(pt.a)(a).variable(false)}))}}var i=t.accumulations[r].variable,o=Array.isArray(e)?e[r].tensor:e[n];null!=o&&Object(nt.h)((function(){var e,n=Object(ct.a)(Object(lt.a)(t.m,i),o);e=t.useNesterov?Object(ct.a)(Object(lt.a)(t.c,Object(ct.a)(o,Object(lt.a)(n,t.m))),a):Object(ct.a)(Object(lt.a)(t.c,n),a),i.assign(n),a.assign(e)}))})),this.incrementIterations()}},{key:"dispose",value:function(){this.m.dispose(),null!=this.accumulations&&Object(nt.b)(this.accumulations.map((function(e){return e.variable})))}},{key:"setMomentum",value:function(e){this.momentum=e}},{key:"getWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.saveIterations();case 2:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(this.accumulations.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(t){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,!1,this.accumulations=t.map((function(e){return{originalName:e.name,variable:e.tensor.variable(false)}}));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}]),n}(wt);jt.className="Momentum",$e(jt);var St=function(e){Object(et.a)(n,e);var t=Object(tt.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.9,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Object(l.a)(this,n),(r=t.call(this)).learningRate=e,r.decay=a,r.momentum=i,r.epsilon=o,r.accumulatedMeanSquares=[],r.accumulatedMoments=[],r.accumulatedMeanGrads=[],r.centered=s,null==o&&(r.epsilon=u.a.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.");return r}return Object(d.a)(n,[{key:"applyGradients",value:function(e){var t=this;(Array.isArray(e)?e.map((function(e){return e.name})):Object.keys(e)).forEach((function(n,r){var a=u.a.registeredVariables[n],i=!1;null==t.accumulatedMeanSquares[r]&&(t.accumulatedMeanSquares[r]={originalName:"".concat(n,"/rms"),variable:Object(nt.h)((function(){return Object(pt.a)(a).variable(i)}))}),null==t.accumulatedMoments[r]&&(t.accumulatedMoments[r]={originalName:"".concat(n,"/momentum"),variable:Object(nt.h)((function(){return Object(pt.a)(a).variable(i)}))}),null==t.accumulatedMeanGrads[r]&&t.centered&&(t.accumulatedMeanGrads[r]={originalName:"".concat(n,"/mg"),variable:Object(nt.h)((function(){return Object(pt.a)(a).variable(i)}))});var o=Array.isArray(e)?e[r].tensor:e[n];if(null!=o){var s=t.accumulatedMeanSquares[r].variable,c=t.accumulatedMoments[r].variable;Object(nt.h)((function(){var e=Object(ct.a)(Object(lt.a)(s,t.decay),Object(lt.a)(Object(ft.a)(o),1-t.decay));if(t.centered){var n=t.accumulatedMeanGrads[r].variable,i=Object(ct.a)(Object(lt.a)(n,t.decay),Object(lt.a)(o,1-t.decay)),u=Object(ut.a)(Object(lt.a)(o,t.learningRate),Object(dt.a)(Object(gt.a)(e,Object(ct.a)(Object(ft.a)(i),t.epsilon)))),l=Object(ct.a)(Object(lt.a)(c,t.momentum),u);s.assign(e),n.assign(i),c.assign(l);var d=Object(gt.a)(a,l);a.assign(d)}else{var f=Object(ct.a)(Object(lt.a)(s,t.decay),Object(lt.a)(Object(ft.a)(o),1-t.decay)),p=Object(ct.a)(Object(lt.a)(c,t.momentum),Object(ut.a)(Object(lt.a)(o,t.learningRate),Object(dt.a)(Object(ct.a)(f,t.epsilon))));s.assign(f),c.assign(p);var h=Object(gt.a)(a,p);a.assign(h)}}))}})),this.incrementIterations()}},{key:"dispose",value:function(){null!=this.accumulatedMeanSquares&&Object(nt.b)(this.accumulatedMeanSquares.map((function(e){return e.variable}))),null!=this.accumulatedMeanGrads&&this.centered&&Object(nt.b)(this.accumulatedMeanGrads.map((function(e){return e.variable}))),null!=this.accumulatedMoments&&Object(nt.b)(this.accumulatedMoments.map((function(e){return e.variable})))}},{key:"getWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(){var t;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[].concat(Object(de.a)(this.accumulatedMeanSquares),Object(de.a)(this.accumulatedMoments)),this.centered&&t.push.apply(t,Object(de.a)(this.accumulatedMeanGrads)),e.next=4,this.saveIterations();case 4:return e.t0=e.sent,e.abrupt("return",[e.t0].concat(t.map((function(e){return{name:e.originalName,tensor:e.variable}}))));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWeights",value:function(){var e=Object(m.a)(b.a.mark((function e(t){var n,r;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.extractIterations(t);case 2:t=e.sent,n=this.centered?t.length/3:t.length/2,r=!1,this.accumulatedMeanSquares=t.slice(0,n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(r)}})),this.accumulatedMoments=t.slice(n,2*n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(r)}})),this.centered&&(this.accumulatedMeanGrads=t.slice(2*n,3*n).map((function(e){return{originalName:e.name,variable:e.tensor.variable(r)}})));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConfig",value:function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}}],[{key:"fromConfig",value:function(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}]),n}(it);St.className="RMSProp",$e(St);var Nt=function(){function e(){Object(l.a)(this,e)}return Object(d.a)(e,null,[{key:"sgd",value:function(e){return new wt(e)}},{key:"momentum",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new jt(e,t,n)}},{key:"rmsprop",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new St(e,t,n,r,a)}},{key:"adam",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.001,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return new yt(e,t,n,r)}},{key:"adadelta",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.001,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.95,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new ht(e,t,n)}},{key:"adamax",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.002,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return new kt(e,t,n,r,a)}},{key:"adagrad",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1;return new mt(e,t)}}]),e}(),It={sgd:Nt.sgd,momentum:Nt.momentum,adadelta:Nt.adadelta,adagrad:Nt.adagrad,rmsprop:Nt.rmsprop,adamax:Nt.adamax,adam:Nt.adam},Ct=n(283),Tt=n(60),Et=n(34);function At(e,t){var n=e[0].length;e.forEach((function(e,t){A.b(e.length===n,(function(){return"Error in concat".concat(n,"D: rank of tensors[").concat(t,"] must be the same ")+"as the rank of the rest (".concat(n,")")}))})),A.b(t>=0&&t<n,(function(){return"Error in concat".concat(n,"D: axis must be between 0 and ").concat(n-1,".")}));var r=e[0];e.forEach((function(e,a){for(var i=0;i<n;i++)A.b(i===t||e[i]===r[i],(function(){return"Error in concat".concat(n,"D: Shape of tensors[").concat(a,"] (").concat(e,") ")+"does not match the shape of the rest (".concat(r,") ")+"along the non-concatenated axis ".concat(a,".")}))}))}function Rt(e,t){for(var n=e[0].slice(),r=1;r<e.length;r++)n[t]+=e[r][t];return n}var Ft=n(48),Dt=n(66),_t=30;function Mt(e){return e<=_t?e:Object(A.G)(e,Math.floor(Math.sqrt(e)))}function zt(e,t,n){return[n*("number"===typeof e?e:e[0]),t*("number"===typeof e?e:e[1])]}function Lt(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=[];if(r)(a=a.concat(t.slice(0))).push(e[0]/n),a=a.concat(e.slice(1));else{a=a.concat(e[0]);for(var i=t.length,o=0;o<i;++o)a=a.concat([e[o+1]/t[o],t[o]]);a=a.concat(e.slice(i+1))}return a}function Pt(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=[];if(n){r.push(t);for(var a=t+1;a<e;++a)a<=2*t?(r.push(a),r.push(a-(t+1))):r.push(a)}else{for(var i=[],o=[],s=1;s<e;++s)s>=2*t+1||s%2===1?o.push(s):i.push(s);r.push.apply(r,i),r.push(0),r.push.apply(r,o)}return r}function Bt(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=[];r?a.push(e[0]/n):a.push(e[0]*n);for(var i=1;i<e.length;++i)i<=t.length?r?a.push(t[i-1]*e[i]):a.push(e[i]/t[i-1]):a.push(e[i]);return a}function Wt(e,t){for(var n=[0],r=0;r<t;++r)n.push(e[r][0]);return n}function Ut(e,t,n){for(var r=e.slice(0,1),a=0;a<n;++a)r.push(e[a+1]-t[a][0]-t[a][1]);return r}function Vt(e,t){var n=e.shape.length,r=t.shape.length;if(n<1)throw new Error("tf.gatherND() expects the input to be rank 1 or higher,"+" but the rank was ".concat(n,"."));if(r<1)throw new Error("tf.gatherND() expects the indices to be rank 1 or higher,"+" but the rank was ".concat(r,"."));if("int32"!==t.dtype)throw new Error("tf.gatherND() expects the indices to be int32 type,"+" but the dtype was ".concat(t.dtype,"."));if(t.shape[r-1]>n)throw new Error("index innermost dimension length must be <= tensor rank; saw: "+"".concat(t.shape[r-1]," vs. ").concat(n));if(0===Object(A.O)(e.shape))throw new Error("Requested more than 0 entries, but input is empty."+" Input shape: ".concat(e.shape,"."));for(var a=t.shape,i=a[a.length-1],o=1,s=0;s<a.length-1;++s)o*=a[s];var c=e.shape,u=a.slice();u.pop();for(var l=1,d=i;d<n;++d)l*=c[d],u.push(c[d]);var f=[].concat(Object(de.a)(Object(A.j)(e.shape).map((function(e){return e/l}))),[1]).slice(0,i);return[u,o,l,f]}var Ht=n(141),Gt=n(180),qt=.3275911,Kt=.254829592,Xt=-.284496736,Yt=1.421413741,$t=-1.453152027,Qt=1.061405429;function Zt(){var e;Object(f.b)().getBool("IS_TEST")||(e=console).warn.apply(e,arguments)}function Jt(){var e;Object(f.b)().getBool("IS_TEST")||(e=console).log.apply(e,arguments)}function en(e,t){if(e.length!==t.length)throw new Error("Cannot merge real and imag arrays of different lengths. real:"+"".concat(e.length,", imag: ").concat(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 tn(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}}function nn(e){for(var t=Math.ceil(e.length/4),n=new Float32Array(t),r=new Float32Array(t),a=0;a<e.length;a+=4)n[Math.floor(a/4)]=e[a],r[Math.floor(a/4)]=e[a+1];return{real:n,imag:r}}function rn(e){for(var t=Math.floor(e.length/4),n=new Float32Array(t),r=new Float32Array(t),a=2;a<e.length;a+=4)n[Math.floor(a/4)]=e[a],r[Math.floor(a/4)]=e[a+1];return{real:n,imag:r}}function an(e,t){return{real:e[2*t],imag:e[2*t+1]}}function on(e,t,n,r){e[2*r]=t,e[2*r+1]=n}function sn(e,t){for(var n=new Float32Array(e/2),r=new Float32Array(e/2),a=0;a<Math.ceil(e/2);a++){var i=(t?2:-2)*Math.PI*(a/e);n[a]=Math.cos(i),r[a]=Math.sin(i)}return{real:n,imag:r}}function cn(e,t,n){var r=(n?2:-2)*Math.PI*(e/t);return{real:Math.cos(r),imag:Math.sin(r)}}var un="->",ln=/->/g;function dn(e,t){var n=((e=e.replace(/\s/g,"")).length-e.replace(ln,"").length)/un.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error('Equation must contain exactly one arrow ("'.concat(un,'").'));var r=e.split(un),a=Object(me.a)(r,2),i=a[0],o=a[1];Object(A.b)(-1===i.indexOf("..."),(function(){return'The ellipsis notation ("'.concat("...",'") is not supported yet.')}));var s=i.split(","),c=s.length;if(t!==c)throw new Error("Expected ".concat(c," input tensors, received ").concat(t));if(c>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");for(var u=[],l=function(e){var t=o[e];if(!s.some((function(e){return-1!==e.indexOf(t)})))throw new Error("Output subscripts contain the label ".concat(t," ")+"not present in the input subscripts.");-1===u.indexOf(t)&&u.push(t)},d=0;d<o.length;++d)l(d);for(var f=0;f<i.length;++f){var p=i[f];-1===u.indexOf(p)&&","!==p&&u.push(p)}for(var h=new Array(s.length),b=0;b<c;++b){if(new Set(s[b].split("")).size!==s[b].length)throw new Error("Found duplicate axes in input component ".concat(s[b],". ")+"Support for duplicate axes in input is not implemented yet.");h[b]=[];for(var m=0;m<s[b].length;++m)h[b].push(u.indexOf(s[b][m]))}for(var v=u.length,g=[],y=o.length;y<v;++y)g.push(y);return{allDims:u,summedDims:g,idDims:h}}function fn(e,t){var n=new Array(e);n.fill(-1);for(var r=0;r<t.length;++r)n[t[r]]=r;for(var a=[],i=0;i<e;++i)-1===n[i]&&a.push(i);return{permutationIndices:n=n.filter((function(e){return-1!==e})),expandDims:a}}function pn(e,t,n){for(var r=new Array(e),a=function(e){for(var a=n[e].shape,i=function(n){void 0===r[t[e][n]]?r[t[e][n]]=a[n]:Object(A.b)(r[t[e][n]]===a[n],(function(){return"Expected dimension ".concat(r[t[e][n]]," at axis ").concat(n," ")+"of input shaped ".concat(JSON.stringify(a),", ")+"but got dimension ".concat(a[n])}))},o=0;o<t[e].length;++o)i(o)},i=0;i<n.length;++i)a(i)}function hn(e,t){var n,r=e,a=[];0===e.length&&r.push(-1),n=e.length+1;for(var i=0;i<n;++i)a.push([]);for(var o=[],s=0;s<r.length;++s){var c,u=mn(t,r[s]),l=Object(p.a)(u);try{for(l.s();!(c=l.n()).done;){var d=c.value;-1===o.indexOf(d)&&(a[s].push(d),o.push(d))}}catch(In){l.e(In)}finally{l.f()}}return{path:r,steps:a}}function bn(e){return e.every((function(e,t){return e===t}))}function mn(e,t){for(var n=[],r=0;r<e.length;++r)0!==e[r].length&&-1===e[r].indexOf(t)&&-1!==t||n.push(r);return n}function vn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[];if("number"===typeof t)Object(A.b)(e.shape[n]%t===0,(function(){return"Number of splits must evenly divide the axis."})),r=new Array(t).fill(e.shape[n]/t);else{var a=t.reduce((function(e,t){return-1===t&&(e+=1),e}),0);Object(A.b)(a<=1,(function(){return"There should be only one negative value in split array."}));var i=t.indexOf(-1);if(-1!==i){var o=t.reduce((function(e,t){return t>0?e+t:e}));t[i]=e.shape[n]-o}Object(A.b)(e.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}return r}function gn(e,t){var n,r=!1;for(e<=_t?(n=e,r=!0):n=Object(A.G)(e,Math.floor(Math.sqrt(e)));!r;)n>t||n===e?r=!0:n=Object(A.G)(e,n+1);return n}function yn(e,t,n){for(var r=[],a=e.length,i=0;i<a;i++)i!==t?r.push(e[i]):r.push(n);return r}function On(e,t,n,r){var a=t.shape.length,i=e.shape.length;if(0!==r&&(r<-a||r>a))throw new Error("Expect batchDims in the range of [-".concat(a,", ").concat(a,"], but got ").concat(r));if(r<0&&(r+=a),r>i)throw new Error("batchDims (".concat(r,") must be less than rank(x) (\n ").concat(i,")."));if(n<r)throw new Error("batchDims (".concat(r,") must be less than or equal to axis (").concat(n,")."));for(var o=0;o<r;++o)if(e.shape[o]!==t.shape[o])throw new Error("x.shape[".concat(o,"]: ").concat(e.shape[o]," should be equal to indices.shape[").concat(o,"]: ").concat(t.shape[o],"."));for(var s=e.shape[n],c=[],u=1,l=1,d=1,f=0;f<r;++f)c.push(e.shape[f]),u*=e.shape[f];for(var p=r;p<n;p++)c.push(e.shape[p]),l*=e.shape[p];for(var h=r;h<a;h++)c.push(t.shape[h]);for(var b=n+1;b<i;b++)c.push(e.shape[b]),d*=e.shape[b];return{batchSize:u,sliceSize:d,outerSize:l,dimSize:s,outputShape:c}}function xn(e){try{return e.map((function(e){return Object(Ze.decodeString)(e)}))}catch(In){throw new Error("Failed to decode encoded string bytes into utf-8, error: ".concat(In))}}function kn(e){return e.map((function(e){return Object(Ze.encodeString)(e)}))}var wn=n(188),jn=n(99),Sn=n(224),Nn=n(178)},function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return o})),n.d(t,"f",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"g",(function(){return l})),n.d(t,"c",(function(){return d})),n.d(t,"a",(function(){return f}));var r=n(6),a=n(0);function i(e,t,n,r,i){var s=t.inputParams[e];if(s&&void 0!==s.inputIndexStart){var c=s.inputIndexStart,u=0===s.inputIndexEnd?void 0:void 0===s.inputIndexEnd?c+1:s.inputIndexEnd;if("tensor"===s.type)return o(t.inputNames[s.inputIndexStart],n,r,i);if("tensors"===s.type)return t.inputNames.slice(c,u).map((function(e){return o(e,n,r,i)}));var l=o(t.inputNames.slice(c)[0],n,r,i),d=l.dataSync();return"number"===s.type?d[0]:a.wf.toNestedArray(l.shape,d)}var f=t.attrParams[e];return f&&f.value}function o(e,t,n,a){var i=l(e),o=Object(r.a)(i,2),s=o[0],c=o[1];if(null!=a){var d=a.getHashTableHandleByName(s);if(null!=d)return d}var f=n.currentContextIds.find((function(e){return!!t[u(s,e)]}));return void 0!==f?t[u(s,f)][c]:void 0}function s(e,t,n){return t[u(e,n.currentContextId)]}function c(e,t){var n=l(e),a=Object(r.a)(n,3),i=a[0],o=a[1],s=a[2];return[u(i,t&&t.currentContextId),o,s]}function u(e,t){return t?"".concat(e,"-").concat(t):e}function l(e){var t=e.split(":");if(1===t.length)return[e,0,void 0];var n=t[0],r=3===t.length?t[1]:void 0;return[n,Number(t[t.length-1]),r]}function d(e,t,n){var r=i("pad",e,t,n);if("explicit"===r){r=i("explicitPaddings",e,t,n);for(var a=[[0,0],[0,0],[0,0],[0,0]],o=0;o<4;o++)a[o][0]=r[2*o],a[o][1]=r[2*o+1];return a}return r}function f(e){return e.kept?e:Object(a.Cd)(e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return f}));var r=n(9),a=n(38),i=n(10),o=n(15),s=n(19);function c(e,t){var n=e;if(Object(o.A)(e))return"string"===t?[]:[e.length];if(!Array.isArray(e))return[];for(var r=[];Array.isArray(n)||Object(o.A)(n)&&"string"!==t;)r.push(n.length),n=n[0];return Array.isArray(e)&&Object(a.b)().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&u(e,r,[]),r}function u(e,t,n){if(n=n||[],Array.isArray(e)||Object(o.A)(e)){Object(o.b)(t.length>0,(function(){return"Element arr[".concat(n.join("]["),"] should be a primitive, ")+"but is an array of ".concat(e.length," elements")})),Object(o.b)(e.length===t[0],(function(){return"Element arr[".concat(n.join("]["),"] should have ").concat(t[0]," ")+"elements, but has ".concat(e.length," elements")}));for(var r=t.slice(1),a=0;a<e.length;++a)u(e[a],r,n.concat(a))}else Object(o.b)(0===t.length,(function(){return"Element arr[".concat(n.join("]["),"] is a primitive, ")+"but should be an array/TypedArray of ".concat(t[0]," elements")}))}function l(e,t,n,r){if("string_or_numeric"!==e){if(null==e)throw new Error("Expected dtype cannot be null.");if("numeric"!==e&&e!==t||"numeric"===e&&"string"===t)throw new Error("Argument '".concat(n,"' passed to '").concat(r,"' must ")+"be ".concat(e," tensor, but got ").concat(t," tensor"))}}function d(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"numeric";if(e instanceof i.a)return l(a,e.dtype,t,n),e;var u=Object(o.r)(e);if("string"!==u&&["bool","int32","float32"].indexOf(a)>=0&&(u=a),l(a,u,t,n),null==e||!Object(o.A)(e)&&!Array.isArray(e)&&"number"!==typeof e&&"boolean"!==typeof e&&"string"!==typeof e){var d=null==e?"null":e.constructor.name;throw new Error("Argument '".concat(t,"' passed to '").concat(n,"' must be a ")+"Tensor or TensorLike, but got '".concat(d,"'"))}var f=c(e,u);Object(o.A)(e)||Array.isArray(e)||(e=[e]);var p=!0,h="string"!==u?Object(s.toTypedArray)(e,u):Object(o.m)(e,[],p);return r.a.makeTensor(h,f,u)}function f(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"numeric";if(!Array.isArray(e))throw new Error("Argument ".concat(t," passed to ").concat(n," must be a ")+"`Tensor[]` or `TensorLike[]`");var a=e;return a.map((function(e,a){return d(e,"".concat(t,"[").concat(a,"]"),n,r)}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return c})),n.d(t,"g",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return h})),n.d(t,"n",(function(){return b})),n.d(t,"m",(function(){return m})),n.d(t,"o",(function(){return v})),n.d(t,"r",(function(){return g})),n.d(t,"p",(function(){return y})),n.d(t,"q",(function(){return O})),n.d(t,"s",(function(){return x})),n.d(t,"t",(function(){return k})),n.d(t,"u",(function(){return w})),n.d(t,"v",(function(){return j})),n.d(t,"w",(function(){return S})),n.d(t,"x",(function(){return N})),n.d(t,"y",(function(){return I})),n.d(t,"z",(function(){return C})),n.d(t,"A",(function(){return T})),n.d(t,"B",(function(){return E})),n.d(t,"C",(function(){return A})),n.d(t,"D",(function(){return R})),n.d(t,"E",(function(){return F})),n.d(t,"F",(function(){return D})),n.d(t,"G",(function(){return _})),n.d(t,"H",(function(){return M})),n.d(t,"I",(function(){return z})),n.d(t,"J",(function(){return L})),n.d(t,"L",(function(){return P})),n.d(t,"K",(function(){return B})),n.d(t,"M",(function(){return W})),n.d(t,"N",(function(){return U})),n.d(t,"O",(function(){return V})),n.d(t,"P",(function(){return H})),n.d(t,"Q",(function(){return G})),n.d(t,"R",(function(){return q})),n.d(t,"S",(function(){return K})),n.d(t,"U",(function(){return X})),n.d(t,"T",(function(){return Y})),n.d(t,"kc",(function(){return $})),n.d(t,"V",(function(){return Q})),n.d(t,"W",(function(){return Z})),n.d(t,"X",(function(){return J})),n.d(t,"Z",(function(){return ee})),n.d(t,"Y",(function(){return te})),n.d(t,"ab",(function(){return ne})),n.d(t,"bb",(function(){return re})),n.d(t,"cb",(function(){return ae})),n.d(t,"db",(function(){return ie})),n.d(t,"eb",(function(){return oe})),n.d(t,"fb",(function(){return se})),n.d(t,"gb",(function(){return ce})),n.d(t,"hb",(function(){return ue})),n.d(t,"jb",(function(){return le})),n.d(t,"nb",(function(){return de})),n.d(t,"mb",(function(){return fe})),n.d(t,"ob",(function(){return pe})),n.d(t,"pb",(function(){return he})),n.d(t,"rb",(function(){return be})),n.d(t,"qb",(function(){return me})),n.d(t,"sb",(function(){return ve})),n.d(t,"tb",(function(){return ge})),n.d(t,"ub",(function(){return ye})),n.d(t,"vb",(function(){return Oe})),n.d(t,"yb",(function(){return xe})),n.d(t,"zb",(function(){return ke})),n.d(t,"Ab",(function(){return we})),n.d(t,"Bb",(function(){return je})),n.d(t,"Cb",(function(){return Se})),n.d(t,"Db",(function(){return Ne})),n.d(t,"Fb",(function(){return Ie})),n.d(t,"Gb",(function(){return Ce})),n.d(t,"Hb",(function(){return Te})),n.d(t,"Eb",(function(){return Ee})),n.d(t,"wb",(function(){return Ae})),n.d(t,"xb",(function(){return Re})),n.d(t,"Ib",(function(){return Fe})),n.d(t,"Ob",(function(){return De})),n.d(t,"Jb",(function(){return _e})),n.d(t,"Mb",(function(){return Me})),n.d(t,"Kb",(function(){return ze})),n.d(t,"Lb",(function(){return Le})),n.d(t,"Nb",(function(){return Pe})),n.d(t,"Pb",(function(){return Be})),n.d(t,"Qb",(function(){return We})),n.d(t,"Rb",(function(){return Ue})),n.d(t,"Sb",(function(){return Ve})),n.d(t,"Tb",(function(){return He})),n.d(t,"Ub",(function(){return Ge})),n.d(t,"Vb",(function(){return qe})),n.d(t,"Wb",(function(){return Ke})),n.d(t,"ac",(function(){return Xe})),n.d(t,"Xb",(function(){return Ye})),n.d(t,"Yb",(function(){return $e})),n.d(t,"Zb",(function(){return Qe})),n.d(t,"cc",(function(){return Ze})),n.d(t,"bc",(function(){return Je})),n.d(t,"dc",(function(){return et})),n.d(t,"ec",(function(){return tt})),n.d(t,"fc",(function(){return nt})),n.d(t,"gc",(function(){return rt})),n.d(t,"hc",(function(){return at})),n.d(t,"ic",(function(){return it})),n.d(t,"jc",(function(){return ot})),n.d(t,"lc",(function(){return st})),n.d(t,"mc",(function(){return ct})),n.d(t,"oc",(function(){return ut})),n.d(t,"rc",(function(){return lt})),n.d(t,"sc",(function(){return dt})),n.d(t,"pc",(function(){return ft})),n.d(t,"qc",(function(){return pt})),n.d(t,"nc",(function(){return ht})),n.d(t,"tc",(function(){return bt})),n.d(t,"vc",(function(){return mt})),n.d(t,"wc",(function(){return vt})),n.d(t,"xc",(function(){return gt})),n.d(t,"yc",(function(){return yt})),n.d(t,"zc",(function(){return Ot})),n.d(t,"Ec",(function(){return xt})),n.d(t,"Cc",(function(){return kt})),n.d(t,"Dc",(function(){return wt})),n.d(t,"Bc",(function(){return jt})),n.d(t,"Ac",(function(){return St})),n.d(t,"Gc",(function(){return Nt})),n.d(t,"Oc",(function(){return It})),n.d(t,"Xc",(function(){return Ct})),n.d(t,"Hc",(function(){return Tt})),n.d(t,"Nc",(function(){return Et})),n.d(t,"Fc",(function(){return At})),n.d(t,"Ic",(function(){return Rt})),n.d(t,"Jc",(function(){return Ft})),n.d(t,"Kc",(function(){return Dt})),n.d(t,"Lc",(function(){return _t})),n.d(t,"Mc",(function(){return Mt})),n.d(t,"Qc",(function(){return zt})),n.d(t,"Pc",(function(){return Lt})),n.d(t,"Sc",(function(){return Pt})),n.d(t,"Tc",(function(){return Bt})),n.d(t,"Uc",(function(){return Wt})),n.d(t,"Vc",(function(){return Ut})),n.d(t,"Wc",(function(){return Vt})),n.d(t,"Yc",(function(){return Ht})),n.d(t,"Zc",(function(){return Gt})),n.d(t,"ad",(function(){return qt})),n.d(t,"bd",(function(){return Kt})),n.d(t,"cd",(function(){return Xt})),n.d(t,"dd",(function(){return Yt})),n.d(t,"ed",(function(){return $t})),n.d(t,"fd",(function(){return Qt})),n.d(t,"gd",(function(){return Zt})),n.d(t,"hd",(function(){return Jt})),n.d(t,"Rc",(function(){return en})),n.d(t,"ib",(function(){return tn})),n.d(t,"uc",(function(){return nn})),n.d(t,"id",(function(){return rn})),n.d(t,"kb",(function(){return an})),n.d(t,"lb",(function(){return on}));var r="Abs",a="Acos",i="Acosh",o="Add",s="AddN",c="All",u="Any",l="ArgMax",d="ArgMin",f="Asin",p="Asinh",h="Atan",b="Atanh",m="Atan2",v="AvgPool",g="AvgPoolGrad",y="AvgPool3D",O="AvgPool3DGrad",x="BatchMatMul",k="BatchToSpaceND",w="Bincount",j="BroadcastTo",S="Cast",N="Ceil",I="ClipByValue",C="Complex",T="ComplexAbs",E="Concat",A="Conv2D",R="Conv2DBackpropFilter",F="Conv2DBackpropInput",D="Conv3D",_="Conv3DBackpropFilterV2",M="Conv3DBackpropInputV2",z="Cos",L="Cosh",P="Cumsum",B="CropAndResize",W="DenseBincount",U="DepthToSpace",V="DepthwiseConv2dNative",H="DepthwiseConv2dNativeBackpropFilter",G="DepthwiseConv2dNativeBackpropInput",q="Diag",K="Dilation2D",X="Dilation2DBackpropInput",Y="Dilation2DBackpropFilter",$="RealDiv",Q="Einsum",Z="Elu",J="EluGrad",ee="Erf",te="Equal",ne="Exp",re="ExpandDims",ae="Expm1",ie="FFT",oe="Fill",se="FlipLeftRight",ce="Floor",ue="FloorDiv",le="FusedBatchNorm",de="GatherV2",fe="GatherNd",pe="Greater",he="GreaterEqual",be="Identity",me="IFFT",ve="Imag",ge="IsFinite",ye="IsInf",Oe="IsNan",xe="LeakyRelu",ke="Less",we="LessEqual",je="LinSpace",Se="Log",Ne="Log1p",Ie="LogicalAnd",Ce="LogicalNot",Te="LogicalOr",Ee="LogSoftmax",Ae="LRN",Re="LRNGrad",Fe="Max",De="Maximum",_e="MaxPool",Me="MaxPoolGrad",ze="MaxPool3D",Le="MaxPool3DGrad",Pe="MaxPoolWithArgmax",Be="Mean",We="Min",Ue="Minimum",Ve="MirrorPad",He="Mod",Ge="Multinomial",qe="Multiply",Ke="Neg",Xe="NotEqual",Ye="NonMaxSuppressionV3",$e="NonMaxSuppressionV4",Qe="NonMaxSuppressionV5",Ze="OnesLike",Je="OneHot",et="Pack",tt="PadV2",nt="Pow",rt="Prelu",at="Prod",it="Range",ot="Real",st="Reciprocal",ct="Relu",ut="Reshape",lt="ResizeNearestNeighbor",dt="ResizeNearestNeighborGrad",ft="ResizeBilinear",pt="ResizeBilinearGrad",ht="Relu6",bt="Reverse",mt="Round",vt="Rsqrt",gt="ScatterNd",yt="Select",Ot="Selu",xt="Slice",kt="Sin",wt="Sinh",jt="Sign",St="Sigmoid",Nt="Softplus",It="Sqrt",Ct="Sum",Tt="SpaceToBatchND",Et="SplitV",At="Softmax",Rt="SparseFillEmptyRows",Ft="SparseReshape",Dt="SparseSegmentMean",_t="SparseSegmentSum",Mt="SparseToDense",zt="SquaredDifference",Lt="Square",Pt="StridedSlice",Bt="StringNGrams",Wt="StringSplit",Ut="StringToHashBucketFast",Vt="Sub",Ht="Tan",Gt="Tanh",qt="Tile",Kt="TopK",Xt="Transform",Yt="Transpose",$t="Unique",Qt="Unpack",Zt="UnsortedSegmentSum",Jt="ZerosLike",en="Step",tn="FromPixels",nn="RotateWithOffset",rn="_FusedMatMul",an="FusedConv2D",on="FusedDepthwiseConv2D"},function(e,t,n){"use strict";e.exports=n(324)},function(e,t,n){e.exports=n(328)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(225);var a=n(124),i=n(226);function o(e,t){return Object(r.a)(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){a=!0,i=c}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}}(e,t)||Object(a.a)(e,t)||Object(i.a)()}},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";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(9),a=n(15),i="__op";function o(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 "+"".concat(t.length," keys."));var n=t[0],o=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=i;var s=function(){r.a.startScope(n);try{var e=o.apply(void 0,arguments);return Object(a.x)(e)&&console.error("Cannot return a Promise inside of tidy."),r.a.endScope(e),e}catch(t){throw r.a.endScope(null),t}};return Object.defineProperty(s,"name",{value:n,configurable:!0}),s}},function(e,t,n){"use strict";n.d(t,"b",(function(){return I})),n.d(t,"a",(function(){return C}));var r=n(20),a=n(21),i=n(5),o=n.n(i),s=n(12),c=n(7),u=n(11),l=n(178),d=n(38),f=n(136),p=n(3),h=n(85),b=n(19),m=n(15),v=function(){function e(t,n){Object(c.a)(this,e),this.backendTimer=t,this.logger=n,null==n&&(this.logger=new g)}return Object(u.a)(e,[{key:"profileKernel",value:function(e,t,n){var a,i,o=function(){a=n()},s=b.now();if(this.backendTimer.timerAvailable())i=this.backendTimer.time(o);else{o();var c,u=Object(r.a)(a);try{for(u.s();!(c=u.n()).done;){c.value.dataSync()}}catch(p){u.e(p)}finally{u.f()}i=Promise.resolve({kernelMs:b.now()-s})}if(Object(d.b)().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(var l=function(t){var n=a[t];n.data().then((function(t){!function(e,t,n){if("float32"!==t)return!1;for(var r=0;r<e.length;r++){var a=e[r];if(isNaN(a)||!isFinite(a))return console.warn("Found ".concat(a," in the result of '").concat(n,"'")),!0}}(t,n.dtype,e)}))},f=0;f<a.length;f++)l(f);return{kernelName:e,outputs:a,inputs:t,timeMs:i.then((function(e){return e.kernelMs})),extraInfo:i.then((function(e){return null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""}))}}},{key:"logKernelProfile",value:function(e){var t=this,n=e.kernelName,r=e.outputs,a=e.timeMs,i=e.inputs,o=e.extraInfo;r.forEach((function(e){Promise.all([e.data(),a,o]).then((function(r){t.logger.logKernelProfile(n,e,r[0],r[1],i,r[2])}))}))}}]),e}();var g=function(){function e(){Object(c.a)(this,e)}return Object(u.a)(e,[{key:"logKernelProfile",value:function(e,t,n,r,a,i){var o="number"===typeof r?m.L("".concat(r,"ms"),9):r.error,s=m.L(e,25),c=t.rank,u=t.size,l=m.L(t.shape.toString(),14),d="";for(var f in a){var p=a[f];if(null!=p){var h=p.shape||t.shape,b=h.length;d+="".concat(f,": ").concat(b,"D ").concat(b>0?h:""," ")}}console.log("%c".concat(s,"\t%c").concat(o,"\t%c").concat(c,"D ").concat(l,"\t%c").concat(u,"\t%c").concat(d,"\t%c").concat(i),"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}]),e}();function y(e,t,n){for(var r={},a={},i=0;i<t.length;i++)r[t[i].id]=!0;for(var o=0;o<e.length;o++){var s=e[o],c=s.inputs;for(var u in c){for(var l=c[u],d=!1,f=0;f<t.length;f++)if(r[l.id]){s.outputs.forEach((function(e){return r[e.id]=!0})),d=!0,a[s.id]=!0;break}if(d)break}}var p={};p[n.id]=!0;for(var h={},b=e.length-1;b>=0;b--)for(var m=e[b],v=m.inputs,g=0;g<m.outputs.length;g++)if(p[m.outputs[g].id]){for(var y in v)p[v[y].id]=!0,h[m.id]=!0;break}for(var O=[],x=0;x<e.length;x++){var k=e[x];if(a[k.id]&&h[k.id]){var w={};for(var j in k.inputs){var S=k.inputs[j];r[S.id]&&(w[j]=S)}var N=Object.assign({},k);N.inputs=w,N.outputs=k.outputs,O.push(N)}}return O}function O(e,t,n,r){for(var a=function(a){var i=t[a],o=[];if(i.outputs.forEach((function(t){var n=e[t.id];null!=n?o.push(n):o.push(null)})),null==i.gradient)throw new Error("Cannot compute gradient: gradient function not found "+"for ".concat(i.kernelName,"."));var s=i.gradient(o),c=function(t){if(!(t in s))throw new Error("Cannot backprop through input ".concat(t,". ")+"Available gradients found: ".concat(Object.keys(s),"."));var a=n((function(){return s[t]()}));if("float32"!==a.dtype)throw new Error("Error in gradient for op ".concat(i.kernelName,". The gradient of input ")+"".concat(t," must have 'float32' dtype, but has '").concat(a.dtype,"'"));var o=i.inputs[t];if(!m.a(a.shape,o.shape))throw new Error("Error in gradient for op ".concat(i.kernelName,". The gradient of input ")+"'".concat(t,"' has shape '").concat(a.shape,"', which does not match ")+"the shape of the input '".concat(o.shape,"'"));if(null==e[o.id])e[o.id]=a;else{var c=e[o.id];e[o.id]=r(c,a),c.dispose()}};for(var u in i.inputs)c(u)},i=t.length-1;i>=0;i--)a(i)}var x=n(10),k=n(39);function w(e){return null!=e.kernelName}var j=function(){function e(){Object(c.a)(this,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.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((function(e){return e.name}))))}}}return Object(u.a)(e,[{key:"dispose",value:function(){for(var e in this.registeredVariables)this.registeredVariables[e].dispose()}}]),e}(),S=function(){function e(t){Object(c.a)(this,e),this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new j}return Object(u.a)(e,[{key:"ready",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t,n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.pendingBackendInit){e.next=2;break}return e.abrupt("return",this.pendingBackendInit.then((function(){})));case 2:if(null==this.backendInstance){e.next=4;break}return e.abrupt("return");case 4:t=this.getSortedBackends(),n=0;case 6:if(!(n<t.length)){e.next=18;break}return r=t[n],e.next=10,this.initializeBackend(r).success;case 10:if(!e.sent){e.next=15;break}return e.next=14,this.setBackend(r);case 14:return e.abrupt("return");case 15:n++,e.next=6;break;case 18:throw new Error("Could not initialize any backends, all backend initializations failed.");case 19:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"backend",get:function(){if(null!=this.pendingBackendInit)throw new Error("Backend '".concat(this.backendName,"' has not yet been initialized. Make ")+"sure to await tf.ready() or await tf.setBackend() 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 '".concat(t,"' has not yet been ")+"initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods");this.setBackend(t)}return this.backendInstance}},{key:"backendNames",value:function(){return Object.keys(this.registryFactory)}},{key:"findBackend",value: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]}},{key:"findBackendFactory",value:function(e){return e in this.registryFactory?this.registryFactory[e].factory:null}},{key:"registerBackend",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return e in this.registryFactory?(console.warn("".concat(e," backend was already registered. ")+"Reusing existing backend factory."),!1):(this.registryFactory[e]={factory:t,priority:n},!0)}},{key:"setBackend",value:function(){var e=Object(s.a)(o.a.mark((function e(t){var n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this.registryFactory[t]){e.next=2;break}throw new Error("Backend name '".concat(t,"' not found in registry"));case 2:if(this.backendName=t,null!=this.registry[t]){e.next=16;break}if(this.backendInstance=null,n=this.initializeBackend(t),r=n.success,!n.asyncInit){e.next=12;break}return e.next=9,r;case 9:e.t0=e.sent,e.next=13;break;case 12:e.t0=r;case 13:if(e.t0){e.next=16;break}return e.abrupt("return",!1);case 16:return this.backendInstance=this.registry[t],this.setupRegisteredKernels(),this.profiler=new v(this.backendInstance),e.abrupt("return",!0);case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupRegisteredKernels",value:function(){var e=this;Object(h.c)(this.backendName).forEach((function(t){null!=t.setupFunc&&t.setupFunc(e.backendInstance)}))}},{key:"disposeRegisteredKernels",value:function(e){var t=this;Object(h.c)(e).forEach((function(n){null!=n.disposeFunc&&n.disposeFunc(t.registry[e])}))}},{key:"initializeBackend",value:function(e){var t=this,n=this.registryFactory[e];if(null==n)throw new Error("Cannot initialize backend ".concat(e,", no registration found."));try{var r=n.factory();if(!r||r instanceof l.b||"function"!==typeof r.then)return this.registry[e]=r,{success:!0,asyncInit:!1};var a=++this.pendingBackendInitId,i=r.then((function(n){return!(a<t.pendingBackendInitId)&&(t.registry[e]=n,t.pendingBackendInit=null,!0)})).catch((function(n){return a<t.pendingBackendInitId||(t.pendingBackendInit=null,console.warn("Initialization of backend ".concat(e," failed")),console.warn(n.stack||n.message)),!1}));return this.pendingBackendInit=i,{success:i,asyncInit:!0}}catch(o){return console.warn("Initialization of backend ".concat(e," failed")),console.warn(o.stack||o.message),{success:!1,asyncInit:!1}}}},{key:"removeBackend",value:function(e){if(!(e in this.registryFactory))throw new Error("".concat(e," backend not found in registry"));this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}},{key:"getSortedBackends",value: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}))}},{key:"initializeBackendsAndReturnBest",value:function(){for(var e=this.getSortedBackends(),t=0;t<e.length;t++){var n=e[t],r=this.initializeBackend(n),a=r.success,i=r.asyncInit;if(i||a)return{name:n,asyncInit:i}}throw new Error("Could not initialize any backends, all backend initializations failed.")}},{key:"moveData",value:function(e,t){var n=this.state.tensorInfo.get(t),r=n.backend,a=this.readSync(t),i=r.refCount(t);r.disposeData(t,!0),n.backend=e,e.move(t,a,n.shape,n.dtype,i),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}},{key:"tidy",value:function(e,t){var n,r=this,a=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");a=e}return this.scopedRun((function(){return r.startScope(a)}),(function(){return r.endScope(n)}),(function(){return(n=t())instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n}))}},{key:"scopedRun",value:function(e,t,n){e();try{var r=n();return t(),r}catch(a){throw t(),a}}},{key:"nextTensorId",value:function(){return e.nextTensorId++}},{key:"nextVariableId",value:function(){return e.nextVariableId++}},{key:"clone",value:function(e){var t=C.runKernel(p.rb,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(function(e){return{x:function(){var t={x:e},n={dtype:"float32"};return C.runKernel(p.w,t,n)}}}),[],{}),t}},{key:"runKernel",value:function(e,t,n){if(null==this.backendName&&this.backend,!(null!=Object(h.b)(e,this.backendName)))throw new Error("Kernel '".concat(e,"' not registered for backend '").concat(this.backendName,"'"));return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}},{key:"shouldCheckForMemLeaks",value:function(){return this.ENV.getBool("IS_TEST")}},{key:"checkKernelForMemLeak",value:function(e,t,n){var r=this.backend.numDataIds(),a=0;n.forEach((function(e){a+="complex64"===e.dtype?3:1}));var i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=r-t-a-i;if(o>0)throw new Error("Backend '".concat(this.backendName,"' has an internal memory leak ")+"(".concat(o," data ids) after running '").concat(e,"'"))}},{key:"runKernelFunc",value:function(e){var t,n,r,a=this,i=[],o=this.isTapeOn(),s=this.state.numBytes,c=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;var u=w(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(w(e)){var l=e.kernelName,d=e.inputs,f=e.attrs;null==this.backendName&&this.backend;var p=Object(h.b)(l,this.backendName);m.b(null!=p,(function(){return"Cannot find registered kernel '".concat(l,"' for backend '").concat(a.backendName,"'")})),n=function(){var e=a.backend.numDataIds();r=p.kernelFunc({inputs:d,attrs:f,backend:a.backend});var t=Array.isArray(r)?r:[r];a.shouldCheckForMemLeaks()&&a.checkKernelForMemLeak(l,e,t);var n=t.map((function(e){if(null!=e.rank)return e;var t=e.dataId,n=e.shape,r=e.dtype;return a.makeTensorFromDataId(t,n,r)}));if(o){var s=a.getTensorsForGradient(l,d,n);i=a.saveTensorsForBackwardMode(s)}return n}}else{var b=e.forwardFunc,v=function(e){o&&(i=e.map((function(e){return a.keep(a.clone(e))})))};n=function(){var e=a.backend.numDataIds();r=a.tidy((function(){return b(a.backend,v)}));var t=Array.isArray(r)?r:[r];return a.shouldCheckForMemLeaks()&&a.checkKernelForMemLeak(u,e,t),t}}var g,y=e.inputs,O=e.attrs,x=w(e)?null:e.backwardsFunc;return this.scopedRun((function(){return a.state.kernelDepth++}),(function(){return a.state.kernelDepth--}),(function(){a.ENV.getBool("DEBUG")||a.state.profiling?(g=a.profiler.profileKernel(u,y,(function(){return n()})),a.ENV.getBool("DEBUG")&&a.profiler.logKernelProfile(g),t=g.outputs):t=n()})),o&&this.addTapeNode(u,y,t,x,i,O),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-s,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-c,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(y).map((function(e){return null!=y[e]?y[e].shape:null})),outputShapes:t.map((function(e){return e.shape})),kernelTimeMs:g.timeMs,extraInfo:g.extraInfo}),Array.isArray(r)?t:t[0]}},{key:"saveTensorsForBackwardMode",value:function(e){var t=this;return e.map((function(e){return t.keep(t.clone(e))}))}},{key:"getTensorsForGradient",value:function(e,t,n){var r=Object(h.a)(e);if(null!=r){var a,i=r.inputsToSave||[],o=r.outputsToSave||[];r.saveAllInputs?(m.b(Array.isArray(t),(function(){return"saveAllInputs is true, expected inputs to be an array."})),a=Object.keys(t).map((function(e){return t[e]}))):a=i.map((function(e){return t[e]}));var s=n.filter((function(e,t){return o[t]}));return a.concat(s)}return[]}},{key:"makeTensor",value:function(e,t,n,r){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;var a=e;"string"===n&&m.z(e[0])&&(a=e.map((function(e){return b.encodeString(e)})));var i=r.write(a,t,n),o=new x.a(t,n,i,this.nextTensorId());if(this.trackTensor(o,r),"string"===n){var s=this.state.tensorInfo.get(i),c=Object(m.f)(a);this.state.numBytes+=c-s.bytes,s.bytes=c}return o}},{key:"makeTensorFromDataId",value:function(e,t,n,r){n=n||"float32";var a=new x.a(t,n,e,this.nextTensorId());return this.trackTensor(a,r),a}},{key:"makeVariable",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;n=n||this.nextVariableId().toString(),null!=r&&r!==e.dtype&&(e=e.cast(r));var a=new x.c(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[a.name])throw new Error("Variable with name ".concat(a.name," was already registered"));return this.state.registeredVariables[a.name]=a,this.incRef(a,this.backend),a}},{key:"trackTensor",value:function(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;var n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*m.g(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof x.c||this.track(e)}},{key:"incRef",value:function(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}},{key:"removeDataId",value:function(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}},{key:"disposeTensor",value:function(e){if(this.state.tensorInfo.has(e.dataId)){var t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){var n=e.size*m.g(e.dtype);this.state.numBytes-=n}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}}},{key:"disposeVariables",value:function(){for(var e in this.state.registeredVariables){var t=this.state.registeredVariables[e];this.disposeVariable(t)}}},{key:"disposeVariable",value:function(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}},{key:"memory",value: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}},{key:"profile",value:function(){var e=Object(s.a)(o.a.mark((function e(t){var n,i,s,c,u;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.state.profiling=!0,n=this.state.numBytes,i=this.state.numTensors,this.state.activeProfile.kernels=[],e.next=6,t();case 6:this.state.activeProfile.result=e.sent,this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max.apply(Math,Object(a.a)(this.state.activeProfile.kernels.map((function(e){return e.totalBytesSnapshot})))),this.state.activeProfile.newBytes=this.state.numBytes-n,this.state.activeProfile.newTensors=this.state.numTensors-i,s=Object(r.a)(this.state.activeProfile.kernels),e.prev=12,s.s();case 14:if((c=s.n()).done){e.next=24;break}return u=c.value,e.next=18,u.kernelTimeMs;case 18:return u.kernelTimeMs=e.sent,e.next=21,u.extraInfo;case 21:u.extraInfo=e.sent;case 22:e.next=14;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(12),s.e(e.t0);case 29:return e.prev=29,s.f(),e.finish(29);case 32:return e.abrupt("return",this.state.activeProfile);case 33:case"end":return e.stop()}}),e,this,[[12,26,29,32]])})));return function(t){return e.apply(this,arguments)}}()},{key:"isTapeOn",value:function(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}},{key:"addTapeNode",value:function(e,t,n,r,a,i){var o=this,s={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:a},c=Object(h.a)(e);null!=c&&(r=c.gradFunc),null!=r&&(s.gradient=function(e){return e=e.map((function(e,t){if(null==e){var r=n[t],a=m.F(r.size,r.dtype);return o.makeTensor(a,r.shape,r.dtype)}return e})),r(e.length>1?e:e[0],a,i)}),this.state.activeTape.push(s)}},{key:"keep",value:function(e){return e.kept=!0,e}},{key:"startTape",value:function(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}},{key:"endTape",value:function(){this.state.gradientDepth--}},{key:"startScope",value: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}},{key:"endScope",value:function(e){for(var t=this,n=Object(k.getTensorsInContainer)(e),r=new Set(n.map((function(e){return e.id}))),a=0;a<this.state.activeScope.track.length;a++){var i=this.state.activeScope.track[a];i.kept||r.has(i.id)||i.dispose()}var o=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!==o.id||t.track(e)}))}},{key:"gradients",value:function(e,t,n){var a=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(m.b(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 '".concat(n.dtype,"'"));var o=this.scopedRun((function(){return a.startTape()}),(function(){return a.endTape()}),(function(){return a.tidy("forward",e)}));m.b(o instanceof x.a,(function(){return"The result y returned by f() must be a tensor."}));var s=y(this.state.activeTape,t,o);if(!i&&0===s.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={};e[o.id]=null==n?N(o.shape):n,O(e,s,(function(e){return a.tidy(e)}),T);var i=t.map((function(t){return e[t.id]}));return 0===a.state.gradientDepth&&(a.state.activeTape.forEach((function(e){var t,n=Object(r.a)(e.saved);try{for(n.s();!(t=n.n()).done;){t.value.dispose()}}catch(a){n.e(a)}finally{n.f()}})),a.state.activeTape=null),{value:o,grads:i}}))}},{key:"customGrad",value:function(e){var t=this;return m.b(m.u(e),(function(){return"The f passed in customGrad(f) must be a function."})),function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];var i;m.b(r.every((function(e){return e instanceof x.a})),(function(){return"The args passed in customGrad(f)(x1, x2,...) must all be tensors"}));var o={};r.forEach((function(e,t){o[t]=e}));var s=function(t,n){return i=e.apply(void 0,[].concat(r,[n])),m.b(i.value instanceof x.a,(function(){return"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"})),m.b(m.u(i.gradFunc),(function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."})),i.value},c=function(e,t){var n=i.gradFunc(e,t),a=Array.isArray(n)?n:[n];m.b(a.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(...)."})),m.b(a.every((function(e){return e instanceof x.a})),(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 o={};return a.forEach((function(e,t){o[t]=function(){return e}})),o};return t.runKernelFunc({forwardFunc:s,backwardsFunc:c,inputs:o})}}},{key:"readSync",value:function(e){return this.state.tensorInfo.get(e).backend.readSync(e)}},{key:"read",value:function(e){return this.state.tensorInfo.get(e).backend.read(e)}},{key:"time",value:function(){var e=Object(s.a)(o.a.mark((function e(t){var n,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(b.now)(),e.next=3,this.backend.time(t);case 3:return(r=e.sent).wallMs=Object(b.now)()-n,e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"track",value:function(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}},{key:"registeredVariables",get:function(){return this.state.registeredVariables}},{key:"reset",value:function(){for(var e in this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new j,this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}]),e}();function N(e){var t=Object(m.D)(Object(m.O)(e),"float32");return C.makeTensor(t,e,"float32")}function I(){var e=Object(f.b)();if(null==e._tfengine){var t=new d.a(e);e._tfengine=new S(t)}return Object(d.c)(e._tfengine.ENV),Object(x.g)((function(){return e._tfengine})),e._tfengine}S.nextTensorId=0,S.nextVariableId=0;var C=I();function T(e,t){var n={a:e,b:t};return C.runKernel(p.d,n)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"g",(function(){return k})),n.d(t,"f",(function(){return w})),n.d(t,"e",(function(){return j})),n.d(t,"a",(function(){return S})),n.d(t,"d",(function(){return N})),n.d(t,"c",(function(){return I}));var r=n(16),a=n(17),i=n(5),o=n.n(i),s=n(12),c=n(7),u=n(11),l=n(136),d=n(21),f=n(15);function p(e,t,n,r){var a=Object(f.j)(t),i=function(e,t,n,r){var a=Object(f.O)(t),i=r[r.length-1],o=new Array(i).fill(0),s=t.length,c="complex64"===n?v(e):e;if(s>1)for(var u=0;u<a/i;u++)for(var l=u*i,d=0;d<i;d++)o[d]=Math.max(o[d],h(c[l+d],0,n).length);return o}(e,t,n,a),o=t.length,s=m(e,t,n,a,i),c=["Tensor"];return r&&(c.push(" dtype: ".concat(n)),c.push(" rank: ".concat(o)),c.push(" shape: [".concat(t,"]")),c.push(" values:")),c.push(s.map((function(e){return" "+e})).join("\n")),c.join("\n")}function h(e,t,n){var r;return r=Array.isArray(e)?"".concat(parseFloat(e[0].toFixed(7))," + ")+"".concat(parseFloat(e[1].toFixed(7)),"j"):Object(f.z)(e)?"'".concat(e,"'"):"bool"===n?b(e):parseFloat(e.toFixed(7)).toString(),Object(f.L)(r,t)}function b(e){return 0===e?"false":"true"}function m(e,t,n,r,a){var i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o="complex64"===n?2:1,s=t[0],c=t.length;if(0===c){if("complex64"===n){var u=v(e);return[h(u[0],0,n)]}return"bool"===n?[b(e[0])]:[e[0].toString()]}if(1===c){if(s>20){var l=3*o,f=Array.from(e.slice(0,l)),p=Array.from(e.slice((s-3)*o,s*o));return"complex64"===n&&(f=v(f),p=v(p)),["["+f.map((function(e,t){return h(e,a[t],n)})).join(", ")+", ..., "+p.map((function(e,t){return h(e,a[s-3+t],n)})).join(", ")+"]"]}var g="complex64"===n?v(e):Array.from(e);return["["+g.map((function(e,t){return h(e,a[t],n)})).join(", ")+"]"]}var y=t.slice(1),O=r.slice(1),x=r[0]*o,k=[];if(s>20){for(var w=0;w<3;w++){var j=w*x,S=j+x;k.push.apply(k,Object(d.a)(m(e.slice(j,S),y,n,O,a,!1)))}k.push("...");for(var N=s-3;N<s;N++){var I=N*x,C=I+x;k.push.apply(k,Object(d.a)(m(e.slice(I,C),y,n,O,a,N===s-1)))}}else for(var T=0;T<s;T++){var E=T*x,A=E+x;k.push.apply(k,Object(d.a)(m(e.slice(E,A),y,n,O,a,T===s-1)))}var R=2===c?",":"";k[0]="["+k[0]+R;for(var F=1;F<k.length-1;F++)k[F]=" "+k[F]+R;for(var D=",\n",_=2;_<c;_++)D+="\n";return k[k.length-1]=" "+k[k.length-1]+"]"+(i?"":D),k}function v(e){for(var t=[],n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}var g=n(19),y=function(){function e(t,n,r){var a=this;if(Object(c.a)(this,e),this.dtype=n,this.shape=t.slice(),this.size=f.O(t),null!=r){var i=r.length;f.b(i===this.size,(function(){return"Length of values '".concat(i,"' does not match the size ")+"inferred by the shape '".concat(a.size,"'.")}))}if("complex64"===n)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=r||f.n(n,this.size),this.strides=Object(f.j)(t)}return Object(u.a)(e,[{key:"set",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];0===r.length&&(r=[0]),f.b(r.length===this.rank,(function(){return"The number of provided coordinates (".concat(r.length,") must ")+"match the rank (".concat(t.rank,")")}));var i=this.locToIndex(r);this.values[i]=e}},{key:"get",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];0===t.length&&(t=[0]);for(var r=0,a=0,i=t;a<i.length;a++){var o=i[a];if(o<0||o>=this.shape[r]){var s="Requested out of range element at ".concat(t,". ")+" Buffer shape=".concat(this.shape);throw new Error(s)}r++}for(var c=t[t.length-1],u=0;u<t.length-1;++u)c+=this.strides[u]*t[u];return this.values[c]}},{key:"locToIndex",value: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}},{key:"indexToLoc",value: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}},{key:"rank",get:function(){return this.shape.length}},{key:"toTensor",value:function(){return O().makeTensor(this.values,this.shape,this.dtype)}}]),e}(),O=null,x=null;function k(e){O=e}function w(e){x=e}function j(e){e}var S=function(){function e(t,n,r,a){Object(c.a)(this,e),this.kept=!1,this.isDisposedInternal=!1,this.shape=t.slice(),this.dtype=n||"float32",this.size=f.O(t),this.strides=Object(f.j)(t),this.dataId=r,this.id=a,this.rankType=this.rank<5?this.rank.toString():"higher"}return Object(u.a)(e,[{key:"rank",get:function(){return this.shape.length}},{key:"buffer",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data();case 2:return t=e.sent,e.abrupt("return",x.buffer(this.shape,this.dtype,t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"bufferSync",value:function(){return x.buffer(this.shape,this.dtype,this.dataSync())}},{key:"array",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data();case 2:return t=e.sent,e.abrupt("return",Object(f.U)(this.shape,t,"complex64"===this.dtype));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"arraySync",value:function(){return Object(f.U)(this.shape,this.dataSync(),"complex64"===this.dtype)}},{key:"data",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.throwIfDisposed(),t=O().read(this.dataId),"string"!==this.dtype){e.next=13;break}return e.next=5,t;case 5:return n=e.sent,e.prev=6,e.abrupt("return",n.map((function(e){return g.decodeString(e)})));case 10:throw e.prev=10,e.t0=e.catch(6),new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().");case 13:return e.abrupt("return",t);case 14:case"end":return e.stop()}}),e,this,[[6,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"dataSync",value:function(){this.throwIfDisposed();var e=O().readSync(this.dataId);if("string"===this.dtype)try{return e.map((function(e){return g.decodeString(e)}))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}},{key:"bytes",value:function(){var e=Object(s.a)(o.a.mark((function e(){var t;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.throwIfDisposed(),e.next=3,O().read(this.dataId);case 3:if(t=e.sent,"string"!==this.dtype){e.next=8;break}return e.abrupt("return",t);case 8:return e.abrupt("return",new Uint8Array(t.buffer));case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"dispose",value:function(){this.isDisposed||(O().disposeTensor(this),this.isDisposedInternal=!0)}},{key:"isDisposed",get:function(){return this.isDisposedInternal}},{key:"throwIfDisposed",value:function(){if(this.isDisposed)throw new Error("Tensor is disposed.")}},{key:"print",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return x.print(this,e)}},{key:"clone",value:function(){return this.throwIfDisposed(),x.clone(this)}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.dataSync();return p(t,this.shape,this.dtype,e)}},{key:"cast",value:function(e){return this.throwIfDisposed(),x.cast(this,e)}},{key:"variable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return this.throwIfDisposed(),O().makeVariable(this,e,t,n)}}]),e}();function N(){return Object(l.a)("Tensor",(function(){return S}))}Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}}),N();var I=function(e){Object(r.a)(n,e);var t=Object(a.a)(n);function n(e,r,a,i){var o;return Object(c.a)(this,n),(o=t.call(this,e.shape,e.dtype,e.dataId,i)).trainable=r,o.name=a,o}return Object(u.a)(n,[{key:"assign",value:function(e){if(e.dtype!==this.dtype)throw new Error("dtype of the new value (".concat(e.dtype,") and ")+"previous value (".concat(this.dtype,") must match"));if(!f.a(e.shape,this.shape))throw new Error("shape of the new value (".concat(e.shape,") and ")+"previous value (".concat(this.shape,") must match"));O().disposeTensor(this),this.dataId=e.dataId,O().incRef(this,null)}},{key:"dispose",value:function(){O().disposeVariable(this),this.isDisposedInternal=!0}}]),n}(S);Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return e instanceof S&&null!=e.assign&&e.assign instanceof Function}})},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 a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";function r(e,t,n,r,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,i){var o=e.apply(t,n);function s(e){r(o,a,i,s,c,"next",e)}function c(e){r(o,a,i,s,c,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({reshape_:function(e,t){var n={x:Object(i.a)(e,"x","reshape","string_or_numeric")},o={shape:t};return r.a.runKernel(a.oc,n,o)}})},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,n){"use strict";function r(e){for(var t=e.length,n=0;t>0;)n=Math.random()*t|0,s(e,--t,n)}function a(e,t){if(e.length!==t.length)throw new Error("Array sizes must match to be shuffled together "+"First array length was ".concat(e.length)+"Second array length was ".concat(t.length));for(var n=e.length,r=0;n>0;)r=Math.random()*n|0,s(e,--n,r),s(t,n,r)}function i(e,t,n){return Math.max(e,Math.min(t,n))}function o(e){return e%2===0?e:e+1}function s(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function c(e){for(var t=0,n=0;n<e.length;n++)t+=e[n];return t}function u(e,t){var n=Math.random();return t*n+(1-n)*e}function l(e,t){for(var n=0,r=0;r<e.length;r++){var a=Number(e[r])-Number(t[r]);n+=a*a}return n}function d(e,t){if(!e)throw new Error("string"===typeof t?t:t())}function f(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";d(v(e,t),(function(){return n+" Shapes ".concat(e," and ").concat(t," must match")}))}function p(e){d(null!=e,(function(){return"The input to the tensor constructor must be a non-null value."}))}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==t&&(t=[]),Array.isArray(e)||R(e)&&!n)for(var r=0;r<e.length;++r)h(e[r],t,n);else t.push(e);return t}function b(e){if(0===e.length)return 1;for(var t=e[0],n=1;n<e.length;n++)t*=e[n];return t}function m(e){return 0===e.length}function v(e,t){if(e===t)return!0;if(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 g(e){return e%1===0}function y(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 x(e){for(var t=new Uint32Array(e),n=0;n<e;++n)t[n]=n;return r(t),t}function k(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return 0},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(r,a){var i=0;!function o(){if(e())r();else{i++;var s=t(i);null!=n&&i>=n?a():setTimeout(o,s)}}()}))}function j(e,t){for(var n=1,r=-1,a=0;a<e.length;++a)if(e[a]>=0)n*=e[a];else if(-1===e[a]){if(-1!==r)throw Error("Shapes can only have 1 implicit size. "+"Found -1 at dim ".concat(r," and dim ").concat(a));r=a}else if(e[a]<0)throw Error("Shapes can not be < 0. Found ".concat(e[a]," at dim ").concat(a));if(-1===r){if(t>0&&t!==n)throw Error("Size(".concat(t,") must match the product of shape ").concat(e));return e}if(0===n)throw Error("Cannot infer the missing size in [".concat(e,"] when ")+"there are 0 elements");if(t%n!==0)throw Error("The implicit shape can't be a fractional number. "+"Got ".concat(t," / ").concat(n));var i=e.slice();return i[r]=t/n,i}function S(e,t){var n=t.length;return d((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 [-".concat(n,", ").concat(n,") but ")+"got axis ".concat(e)})),d(e.every((function(e){return g(e)})),(function(){return"All values in axis param must be integers but "+"got axis ".concat(e)})),e.map((function(e){return e<0?n+e:e}))}function N(e,t){for(var n=[],r=[],a=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||a?null:S(t,e).sort(),o=0,s=0;s<e.length;++s){if(null!=i){if(i[o]===s&&1!==e[s])throw new Error("Can't squeeze axis ".concat(s," since its dim '").concat(e[s],"' is not 1"));(null==i[o]||i[o]>s)&&1===e[s]&&(n.push(e[s]),r.push(s)),i[o]<=s&&o++}1!==e[s]&&(n.push(e[s]),r.push(s))}return{newShape:n,keptDims:r}}function I(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 ".concat(e));n=new Uint8Array(t)}return n}function C(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 ".concat(e));n=new Array(t)}return n}function T(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 ".concat(t," being uploaded contains ").concat(r,"."))}}function E(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}function A(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function R(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array}function F(e){if("float32"===e||"int32"===e)return 4;if("complex64"===e)return 8;if("bool"===e)return 1;throw new Error("Unknown dtype ".concat(e))}function D(e){if(null==e)return 0;var t=0;return e.forEach((function(e){return t+=e.length})),t}function _(e){return"string"===typeof e||e instanceof String}function M(e){return"boolean"===typeof e}function z(e){return"number"===typeof e}function L(e){return Array.isArray(e)?L(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":z(e)?"float32":_(e)?"string":M(e)?"bool":"float32"}function P(e){return!!(e&&e.constructor&&e.call&&e.apply)}function B(e,t){for(var n=t;n<e;++n)if(e%n===0)return n;return e}function W(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 U(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=new Array;if(1===t.length)for(var i=t[0]*(r?2:1),o=0;o<i;o++)a[o]=n[e+o];else for(var s=t[0],c=t.slice(1),u=c.reduce((function(e,t){return e*t}))*(r?2:1),l=0;l<s;l++)a[l]=U(e+l*u,c,n,r);return a}function V(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0===e.length)return t[0];var r=e.reduce((function(e,t){return e*t}))*(n?2:1);if(0===r)return[];if(r!==t.length)throw new Error("[".concat(e,"] does not match the input size ").concat(t.length).concat(n?" for a complex tensor":"","."));return U(0,e,t,n)}function H(e,t){for(var n=G(e,t),r=0;r<n.length;r++)n[r]=1;return n}function G(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 ".concat(t))}function q(e,t){var n=e.reduce((function(e,t){return e*t}),1);if(null==t||"float32"===t)return V(e,new Float32Array(n));if("int32"===t)return V(e,new Int32Array(n));if("bool"===t)return V(e,new Uint8Array(n));throw new Error("Unknown data type ".concat(t))}function K(e){e.forEach((function(t){d(Number.isInteger(t)&&t>=0,(function(){return"Tensor must have a shape comprised of positive integers but got "+"shape [".concat(e,"].")}))}))}function X(e,t,n){if(0===t)return 0;if(1===t)return e[0];for(var r=e[e.length-1],a=0;a<e.length-1;++a)r+=n[a]*e[a];return r}function Y(e,t,n){if(0===t)return[];if(1===t)return[e];for(var r=new Array(t),a=0;a<r.length-1;++a)r[a]=Math.floor(e/n[a]),e-=r[a]*n[a];return r[r.length-1]=e,r}function $(e){return e&&e.then&&"function"===typeof e.then}n.d(t,"M",(function(){return r})),n.d(t,"N",(function(){return a})),n.d(t,"i",(function(){return i})),n.d(t,"H",(function(){return o})),n.d(t,"S",(function(){return s})),n.d(t,"R",(function(){return c})),n.d(t,"J",(function(){return u})),n.d(t,"l",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"e",(function(){return f})),n.d(t,"d",(function(){return p})),n.d(t,"m",(function(){return h})),n.d(t,"O",(function(){return b})),n.d(t,"y",(function(){return m})),n.d(t,"a",(function(){return v})),n.d(t,"v",(function(){return g})),n.d(t,"T",(function(){return y})),n.d(t,"P",(function(){return O})),n.d(t,"k",(function(){return x})),n.d(t,"L",(function(){return k})),n.d(t,"K",(function(){return w})),n.d(t,"s",(function(){return j})),n.d(t,"I",(function(){return S})),n.d(t,"Q",(function(){return N})),n.d(t,"o",(function(){return I})),n.d(t,"n",(function(){return C})),n.d(t,"h",(function(){return T})),n.d(t,"B",(function(){return E})),n.d(t,"p",(function(){return A})),n.d(t,"A",(function(){return R})),n.d(t,"g",(function(){return F})),n.d(t,"f",(function(){return D})),n.d(t,"z",(function(){return _})),n.d(t,"t",(function(){return M})),n.d(t,"w",(function(){return z})),n.d(t,"r",(function(){return L})),n.d(t,"u",(function(){return P})),n.d(t,"G",(function(){return B})),n.d(t,"j",(function(){return W})),n.d(t,"U",(function(){return V})),n.d(t,"D",(function(){return H})),n.d(t,"F",(function(){return G})),n.d(t,"E",(function(){return q})),n.d(t,"c",(function(){return K})),n.d(t,"C",(function(){return X})),n.d(t,"q",(function(){return Y})),n.d(t,"x",(function(){return $}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(164);function a(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&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(26),a=n(228);function i(e){return(i="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)}var o=n(62);function s(e,t){return!t||"object"!==i(t)&&"function"!==typeof t?Object(o.a)(e):t}function c(e){var t=Object(a.a)();return function(){var n,a=Object(r.a)(e);if(t){var i=Object(r.a)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return s(this,n)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(8);var u=Object(c.b)({mul_:function(e,t){var n=Object(s.a)(e,"a","mul"),c=Object(s.a)(t,"b","mul"),u=Object(o.makeTypesMatch)(n,c),l=Object(r.a)(u,2),d={a:n=l[0],b:c=l[1]};return a.a.runKernel(i.Vb,d)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"shuffle",(function(){return a.M})),n.d(t,"shuffleCombo",(function(){return a.N})),n.d(t,"clamp",(function(){return a.i})),n.d(t,"nearestLargerEven",(function(){return a.H})),n.d(t,"swap",(function(){return a.S})),n.d(t,"sum",(function(){return a.R})),n.d(t,"randUniform",(function(){return a.J})),n.d(t,"distSquared",(function(){return a.l})),n.d(t,"assert",(function(){return a.b})),n.d(t,"assertShapesMatch",(function(){return a.e})),n.d(t,"assertNonNull",(function(){return a.d})),n.d(t,"flatten",(function(){return a.m})),n.d(t,"sizeFromShape",(function(){return a.O})),n.d(t,"isScalarShape",(function(){return a.y})),n.d(t,"arraysEqual",(function(){return a.a})),n.d(t,"isInt",(function(){return a.v})),n.d(t,"tanh",(function(){return a.T})),n.d(t,"sizeToSquarishShape",(function(){return a.P})),n.d(t,"createShuffledIndices",(function(){return a.k})),n.d(t,"rightPad",(function(){return a.L})),n.d(t,"repeatedTry",(function(){return a.K})),n.d(t,"inferFromImplicitShape",(function(){return a.s})),n.d(t,"parseAxisParam",(function(){return a.I})),n.d(t,"squeezeShape",(function(){return a.Q})),n.d(t,"getTypedArrayFromDType",(function(){return a.o})),n.d(t,"getArrayFromDType",(function(){return a.n})),n.d(t,"checkConversionForErrors",(function(){return a.h})),n.d(t,"isValidDtype",(function(){return a.B})),n.d(t,"hasEncodingLoss",(function(){return a.p})),n.d(t,"isTypedArray",(function(){return a.A})),n.d(t,"bytesPerElement",(function(){return a.g})),n.d(t,"bytesFromStringArray",(function(){return a.f})),n.d(t,"isString",(function(){return a.z})),n.d(t,"isBoolean",(function(){return a.t})),n.d(t,"isNumber",(function(){return a.w})),n.d(t,"inferDtype",(function(){return a.r})),n.d(t,"isFunction",(function(){return a.u})),n.d(t,"nearestDivisor",(function(){return a.G})),n.d(t,"computeStrides",(function(){return a.j})),n.d(t,"toNestedArray",(function(){return a.U})),n.d(t,"makeOnesTypedArray",(function(){return a.D})),n.d(t,"makeZerosTypedArray",(function(){return a.F})),n.d(t,"makeZerosNestedTypedArray",(function(){return a.E})),n.d(t,"assertNonNegativeIntegerDimensions",(function(){return a.c})),n.d(t,"locToIndex",(function(){return a.C})),n.d(t,"indexToLoc",(function(){return a.q})),n.d(t,"isPromise",(function(){return a.x})),n.d(t,"hexToLong",(function(){return s})),n.d(t,"fingerPrint64",(function(){return x})),n.d(t,"createScalarValue",(function(){return k})),n.d(t,"toTypedArray",(function(){return w})),n.d(t,"now",(function(){return j})),n.d(t,"fetch",(function(){return S})),n.d(t,"encodeString",(function(){return N})),n.d(t,"decodeString",(function(){return I}));var r=n(38),a=n(15),i=n(240),o=n.n(i).a||i;function s(e){return o.fromString(e,!0,16)}var c=s("c3a5c85c97cb3127"),u=s("b492b66fbe98f273"),l=s("9ae16a3b2f90404f");function d(e){return e.xor(e.shru(47))}function f(e,t,n){var r=e.slice(t,t+n);return o.fromBytes(Array.from(r),!0,!0)}function p(e,t){return f(e,t,8)}function h(e,t){return f(e,t,4)}function b(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s("9ddfea08eb382d69"),r=e.xor(t).mul(n);r=r.xor(r.shru(47));var a=t.xor(r).mul(n);return a=(a=a.xor(a.shru(47))).mul(n)}function v(e,t,n,r){return function(e,t,n,r,a,i){a=a.add(e),i=b(i.add(a).add(r),21);var o=a;return a=(a=a.add(t)).add(n),i=i.add(b(a,44)),[a.add(r),i.add(o)]}(p(e,t),p(e,t+8),p(e,t+16),p(e,t+24),n,r)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;if(t>=8){var n=l.add(2*t),r=p(e,0).add(l),a=p(e,t-8),i=b(a,37).mul(n).add(r),o=b(r,25).add(a).mul(n);return m(i,o,n)}if(t>=4){var s=l.add(2*t),u=h(e,0);return m(u.shl(3).add(t),h(e,t-4),s)}if(t>0){var f=e[0],v=e[t>>1],g=e[t-1],y=f+(v<<8),O=t+(g<<2);return d(l.mul(y).xor(c.mul(O))).mul(l)}return l}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length,n=l.add(2*t),r=p(e,0).mul(u),a=p(e,8),i=p(e,t-8).mul(n),o=p(e,t-16).mul(l);return m(b(r.add(a),43).add(b(i,30)).add(o),r.add(b(a.add(l),18)).add(i),n)}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length,n=l.add(2*t),r=p(e,0).mul(l),a=p(e,8),i=p(e,t-8).mul(n),o=p(e,t-16).mul(l),s=b(r.add(a),43).add(b(i,30)).add(o),c=m(s,r.add(b(a.add(l),18)).add(i),n),u=p(e,16).mul(n),d=p(e,24),f=s.add(p(e,t-32)).mul(n),h=c.add(p(e,t-24)).mul(n);return m(b(u.add(d),43).add(b(f,30)).add(h),u.add(b(d.add(r),18)).add(f),n)}function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length,n=o.fromNumber(81,!0);if(t<=32)return t<=16?g(e,t):y(e,t);if(t<=64)return O(e,t);var r=n,a=n.mul(u).add(113),i=d(a.mul(l).add(113)).mul(l),s=[o.UZERO,o.UZERO],f=[o.UZERO,o.UZERO];r=r.mul(l).add(p(e,0));var h=0,x=64*(t-1>>6),k=x+(t-1&63)-63;do{r=b(r.add(a).add(s[0]).add(p(e,h+8)),37).mul(u),a=b(a.add(s[1]).add(p(e,h+48)),42).mul(u),r=r.xor(f[1]),a=a.add(s[0]).add(p(e,h+40)),i=b(i.add(f[0]),33).mul(u),s=v(e,h,s[1].mul(u),r.add(f[0])),f=v(e,h+32,i.add(f[1]),a.add(p(e,h+16)));var w=[r,i];i=w[0],r=w[1],h+=64}while(h!==x);var j=u.add(i.and(255).shl(1));h=k,f[0]=f[0].add(t-1&63),s[0]=s[0].add(f[0]),f[0]=f[0].add(s[0]),r=b(r.add(a).add(s[0]).add(p(e,h+8)),37).mul(j),a=b(a.add(s[1]).add(p(e,h+48)),42).mul(j),r=r.xor(f[1].mul(9)),a=a.add(s[0].mul(9).add(p(e,h+40))),i=b(i.add(f[0]),33).mul(j),s=v(e,h,s[1].mul(j),r.add(f[0])),f=v(e,h+32,i.add(f[1]),a.add(p(e,h+16)));var S=[r,i];return i=S[0],r=S[1],m(m(s[0],f[0],j).add(d(a).mul(c)).add(i),m(s[1],f[1],j).add(r),j)}function k(e,t){return"string"===t?N(e):w([e],t)}function w(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=a.m(e)),Object(r.b)().getBool("DEBUG")&&a.h(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);if("bool"===t){for(var n=new Uint8Array(e.length),i=0;i<n.length;++i)0!==Math.round(e[i])&&(n[i]=1);return n}throw new Error("Unknown data type ".concat(t))}function j(){return Object(r.b)().platform.now()}function S(e,t){return Object(r.b)().platform.fetch(e,t)}function N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8";return t=t||"utf-8",Object(r.b)().platform.encode(e,t)}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8";return t=t||"utf-8",Object(r.b)().platform.decode(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(124);function a(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Object(r.a)(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(182);var a=n(227),i=n(124);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(a.a)(e)||Object(i.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";e.exports=n(349)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(75);function a(e,t){if(null==e)return{};var n,a,i=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({cast_:function(e,t){var n=Object(i.a)(e,"x","cast");if(!o.B(t))throw new Error("Failed to cast to unknown dtype ".concat(t));if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");var s={x:n},c={dtype:t};return r.a.runKernel(a.w,s,c)}})},function(e,t,n){"use strict";function r(e){var t,n,a="";if("string"===typeof e||"number"===typeof e)a+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}t.a=function(){for(var e,t,n=0,a="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}},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";n.d(t,"a",(function(){return u}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(8);var u=Object(c.b)({add_:function(e,t){var n=Object(s.a)(e,"a","add"),c=Object(s.a)(t,"b","add"),u=Object(o.makeTypesMatch)(n,c),l=Object(r.a)(u,2),d={a:n=l[0],b:c=l[1]};return a.a.runKernel(i.d,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(26);function a(e,t,n){return(a="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var a=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(a){var i=Object.getOwnPropertyDescriptor(a,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(8);var u=Object(c.b)({sub_:function(e,t){var n=Object(s.a)(e,"a","sub"),c=Object(s.a)(t,"b","sub"),u=Object(o.makeTypesMatch)(n,c),l=Object(r.a)(u,2),d={a:n=l[0],b:c=l[1]};return a.a.runKernel(i.Wc,d)}})},function(e,t,n){e.exports=n(347)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(146),u=n(8);var l=Object(u.b)({div_:function(e,t){var n=Object(s.a)(e,"a","div"),u=Object(s.a)(t,"b","div"),l=Object(o.makeTypesMatch)(n,u),d=Object(r.a)(l,2);if(n=d[0],u=d[1],"int32"===n.dtype&&"int32"===u.dtype)return Object(c.a)(n,u);var f={a:n,b:u};return a.a.runKernel(i.kc,f,{})}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(24),s=n(8);var c=Object(s.b)({sum_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=Object(i.a)(e,"x","sum");"bool"===s.dtype&&(s=Object(o.a)(s,"int32"));var c={x:s},u={axis:t,keepDims:n};return r.a.runKernel(a.Xc,c,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(15),a=n(71);function i(e,t){if((Object(r.A)(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&Object(r.A)(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Object(a.a)(e,[],[],t)}},function(e,t,n){"use strict";function r(e,t){for(var n=e.length,r=[],a=0;a<n;a++){var i=n-1-a,o=e[i]||1;(t[t.length-1-a]||1)>1&&1===o&&r.unshift(i)}return r}function a(e,t){for(var n=[],r=0;r<t.length;r++){var a=e[e.length-r-1],i=t.length-r-1,o=t[i];(null==a||1===a&&o>1)&&n.unshift(i)}return n}function i(e,t){for(var n=[],r=Math.max(e.length,t.length),a=0;a<r;a++){var i=e[e.length-a-1];null==i&&(i=1);var o=t[t.length-a-1];if(null==o&&(o=1),1===i)n.unshift(o);else if(1===o)n.unshift(i);else{if(i!==o){var s="Operands could not be broadcast together with shapes "+"".concat(e," and ").concat(t,".");throw Error(s)}n.unshift(i)}}return n}n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";var r=n(14),a=n(23),i=n(4),o=n.n(i),s=(n(30),n(168)),c=n.n(s),u=n(355),l=n(383),d=n(356),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var i=t.defaultTheme,s=t.withTheme,f=void 0!==s&&s,p=t.name,h=Object(a.a)(t,["defaultTheme","withTheme","name"]);var b=p,m=Object(u.a)(e,Object(r.a)({defaultTheme:i,Component:n,name:p||n.displayName,classNamePrefix:b},h)),v=o.a.forwardRef((function(e,t){e.classes;var s,c=e.innerRef,u=Object(a.a)(e,["classes","innerRef"]),h=m(Object(r.a)({},n.defaultProps,e)),b=u;return("string"===typeof p||f)&&(s=Object(d.a)()||i,p&&(b=Object(l.a)({theme:s,name:p,props:u})),f&&!b.theme&&(b.theme=s)),o.a.createElement(n,Object(r.a)({ref:c||t,classes:h},b))}));return c()(v,n),v}},p=n(129);t.a=function(e,t){return f(e,Object(r.a)({defaultTheme:p.a},t))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({zerosLike_:function(e){var t={x:Object(i.a)(e,"x","zerosLike")};return r.a.runKernel(a.hd,t)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return a.a})),n.d(t,"c",(function(){return i.a})),n.d(t,"d",(function(){return o.a})),n.d(t,"e",(function(){return s.a})),n.d(t,"f",(function(){return c.a})),n.d(t,"g",(function(){return u.a})),n.d(t,"h",(function(){return l.a})),n.d(t,"i",(function(){return d.a})),n.d(t,"j",(function(){return f.a})),n.d(t,"k",(function(){return p.a})),n.d(t,"l",(function(){return h.a})),n.d(t,"m",(function(){return b.a})),n.d(t,"n",(function(){return m.a})),n.d(t,"o",(function(){return v.a})),n.d(t,"p",(function(){return g.a})),n.d(t,"q",(function(){return y.a})),n.d(t,"r",(function(){return C})),n.d(t,"w",(function(){return T.a})),n.d(t,"s",(function(){return E.a})),n.d(t,"t",(function(){return R})),n.d(t,"u",(function(){return F})),n.d(t,"v",(function(){return D})),n.d(t,"x",(function(){return _.a})),n.d(t,"z",(function(){return M.a})),n.d(t,"A",(function(){return z.a})),n.d(t,"B",(function(){return L.a})),n.d(t,"C",(function(){return P.a})),n.d(t,"D",(function(){return B.a})),n.d(t,"E",(function(){return W.a})),n.d(t,"F",(function(){return U.a})),n.d(t,"G",(function(){return x.a})),n.d(t,"H",(function(){return V})),n.d(t,"I",(function(){return H})),n.d(t,"J",(function(){return G})),n.d(t,"K",(function(){return q})),n.d(t,"L",(function(){return K.a})),n.d(t,"M",(function(){return X.a})),n.d(t,"N",(function(){return Y.a})),n.d(t,"O",(function(){return $.a})),n.d(t,"P",(function(){return Z})),n.d(t,"Q",(function(){return J.a})),n.d(t,"R",(function(){return ee.a})),n.d(t,"T",(function(){return te.a})),n.d(t,"U",(function(){return ne.a})),n.d(t,"V",(function(){return re.a})),n.d(t,"W",(function(){return ae.a})),n.d(t,"X",(function(){return se})),n.d(t,"Y",(function(){return ce.a})),n.d(t,"Z",(function(){return ue.a})),n.d(t,"ab",(function(){return le.a})),n.d(t,"bb",(function(){return de.a})),n.d(t,"db",(function(){return fe.a})),n.d(t,"eb",(function(){return pe.a})),n.d(t,"gb",(function(){return he.a})),n.d(t,"hb",(function(){return be.a})),n.d(t,"ib",(function(){return me.a})),n.d(t,"jb",(function(){return ve.a})),n.d(t,"kb",(function(){return ge.a})),n.d(t,"lb",(function(){return xe})),n.d(t,"nb",(function(){return ke.a})),n.d(t,"ob",(function(){return we.a})),n.d(t,"pb",(function(){return je.a})),n.d(t,"rb",(function(){return Se.a})),n.d(t,"tb",(function(){return Ne.a})),n.d(t,"ub",(function(){return Ie.a})),n.d(t,"wb",(function(){return Ce.a})),n.d(t,"Ab",(function(){return Te.a})),n.d(t,"Bb",(function(){return Ee.a})),n.d(t,"Cb",(function(){return Ae.a})),n.d(t,"Db",(function(){return Re.a})),n.d(t,"Eb",(function(){return Fe.a})),n.d(t,"Fb",(function(){return De.a})),n.d(t,"Hb",(function(){return _e.a})),n.d(t,"Ib",(function(){return Me.a})),n.d(t,"Jb",(function(){return ze.a})),n.d(t,"Kb",(function(){return Le.a})),n.d(t,"Lb",(function(){return Pe.a})),n.d(t,"Mb",(function(){return Be.a})),n.d(t,"Nb",(function(){return We.a})),n.d(t,"Ob",(function(){return Ue.a})),n.d(t,"Pb",(function(){return Ve.a})),n.d(t,"Qb",(function(){return He.a})),n.d(t,"Rb",(function(){return Ge.a})),n.d(t,"Tb",(function(){return k.a})),n.d(t,"Ub",(function(){return qe.a})),n.d(t,"Vb",(function(){return Ke.a})),n.d(t,"Wb",(function(){return Xe.a})),n.d(t,"Xb",(function(){return Ye.a})),n.d(t,"Yb",(function(){return $e.a})),n.d(t,"Zb",(function(){return Qe.a})),n.d(t,"ac",(function(){return et})),n.d(t,"bc",(function(){return tt.a})),n.d(t,"cc",(function(){return nt.a})),n.d(t,"dc",(function(){return rt.a})),n.d(t,"ec",(function(){return at.a})),n.d(t,"fc",(function(){return ct})),n.d(t,"hc",(function(){return w.a})),n.d(t,"ic",(function(){return ut})),n.d(t,"jc",(function(){return lt.a})),n.d(t,"kc",(function(){return dt.a})),n.d(t,"mc",(function(){return ft.a})),n.d(t,"nc",(function(){return pt.a})),n.d(t,"oc",(function(){return Ze.a})),n.d(t,"pc",(function(){return ht.a})),n.d(t,"rc",(function(){return bt})),n.d(t,"sc",(function(){return mt.a})),n.d(t,"tc",(function(){return vt})),n.d(t,"uc",(function(){return gt})),n.d(t,"vc",(function(){return yt})),n.d(t,"wc",(function(){return Ot})),n.d(t,"xc",(function(){return xt.a})),n.d(t,"yc",(function(){return kt.a})),n.d(t,"zc",(function(){return wt.a})),n.d(t,"Ac",(function(){return jt.a})),n.d(t,"Bc",(function(){return St.a})),n.d(t,"Cc",(function(){return Nt})),n.d(t,"Dc",(function(){return Ct})),n.d(t,"Ec",(function(){return Tt})),n.d(t,"Fc",(function(){return Et.a})),n.d(t,"Gc",(function(){return At.a})),n.d(t,"Hc",(function(){return Rt.a})),n.d(t,"Ic",(function(){return Ft.a})),n.d(t,"Jc",(function(){return Dt.a})),n.d(t,"Kc",(function(){return _t.a})),n.d(t,"Lc",(function(){return ye.a})),n.d(t,"Mc",(function(){return Mt.a})),n.d(t,"Nc",(function(){return zt})),n.d(t,"Oc",(function(){return Lt})),n.d(t,"Pc",(function(){return Pt})),n.d(t,"Qc",(function(){return Bt})),n.d(t,"Sc",(function(){return Wt.a})),n.d(t,"Tc",(function(){return Ut.a})),n.d(t,"Uc",(function(){return Vt.a})),n.d(t,"Wc",(function(){return Ht.a})),n.d(t,"Xc",(function(){return Gt.a})),n.d(t,"Yc",(function(){return qt.a})),n.d(t,"Zc",(function(){return S.a})),n.d(t,"ad",(function(){return Kt.a})),n.d(t,"cd",(function(){return Xt.a})),n.d(t,"dd",(function(){return Yt.a})),n.d(t,"ed",(function(){return N.a})),n.d(t,"fd",(function(){return $t})),n.d(t,"gd",(function(){return Qt})),n.d(t,"hd",(function(){return Zt})),n.d(t,"id",(function(){return Jt})),n.d(t,"jd",(function(){return en.a})),n.d(t,"kd",(function(){return tn.a})),n.d(t,"ld",(function(){return nn.a})),n.d(t,"mb",(function(){return rn.a})),n.d(t,"vb",(function(){return an.a})),n.d(t,"zb",(function(){return on.a})),n.d(t,"Rc",(function(){return sn.a})),n.d(t,"pd",(function(){return cn.a})),n.d(t,"qd",(function(){return un.a})),n.d(t,"rd",(function(){return ot.a})),n.d(t,"sd",(function(){return ln.a})),n.d(t,"td",(function(){return dn.a})),n.d(t,"ud",(function(){return fn.a})),n.d(t,"vd",(function(){return pn.a})),n.d(t,"wd",(function(){return hn.a})),n.d(t,"yd",(function(){return st.a})),n.d(t,"zd",(function(){return bn.a})),n.d(t,"Ad",(function(){return mn.a})),n.d(t,"Bd",(function(){return I.a})),n.d(t,"Cd",(function(){return vn.a})),n.d(t,"Dd",(function(){return gn.a})),n.d(t,"Ed",(function(){return On})),n.d(t,"Fd",(function(){return xn.a})),n.d(t,"Gd",(function(){return kn})),n.d(t,"Hd",(function(){return wn})),n.d(t,"Id",(function(){return jn})),n.d(t,"Jd",(function(){return Oe.a})),n.d(t,"Kd",(function(){return Sn.a})),n.d(t,"Md",(function(){return Nn.a})),n.d(t,"Nd",(function(){return In.a})),n.d(t,"Od",(function(){return Cn.a})),n.d(t,"Pd",(function(){return Tn.a})),n.d(t,"Qd",(function(){return En})),n.d(t,"Rd",(function(){return An.a})),n.d(t,"Sd",(function(){return Rn.a})),n.d(t,"Td",(function(){return Fn.a})),n.d(t,"Ud",(function(){return Dn.a})),n.d(t,"y",(function(){return Pn})),n.d(t,"Ld",(function(){return Bn.a})),n.d(t,"lc",(function(){return Wn.a})),n.d(t,"gc",(function(){return Vn})),n.d(t,"Vc",(function(){return Hn.a})),n.d(t,"nd",(function(){return Gn.a})),n.d(t,"sb",(function(){return qn.a})),n.d(t,"cb",(function(){return Kn})),n.d(t,"fb",(function(){return Xn})),n.d(t,"S",(function(){return Yn})),n.d(t,"yb",(function(){return Qn})),n.d(t,"qc",(function(){return j.b})),n.d(t,"a",(function(){return j.a})),n.d(t,"xb",(function(){return ia})),n.d(t,"Gb",(function(){return oa})),n.d(t,"Sb",(function(){return sa})),n.d(t,"od",(function(){return ra})),n.d(t,"qb",(function(){return r})),n.d(t,"bd",(function(){return aa})),n.d(t,"md",(function(){return ca})),n.d(t,"xd",(function(){return ua}));var r={};n.r(r),n.d(r,"conv2d",(function(){return ir})),n.d(r,"depthwiseConv2d",(function(){return cr})),n.d(r,"matMul",(function(){return ur}));var a=n(65),i=n(249),o=n(250),s=n(27),c=n(251),u=n(190),l=n(191),d=n(192),f=n(193),p=n(252),h=n(253),b=n(254),m=n(194),v=n(255),g=n(143),y=n(256),O=n(2),x=n(49),k=n(41),w=n(18),j=n(8),S=n(93),N=n(43),I=n(179);var C=Object(j.b)({basicLSTMCell_:function(e,t,n,r,a,i){var o=Object(O.a)(e,"forgetBias","basicLSTMCell"),c=Object(O.a)(t,"lstmKernel","basicLSTMCell"),u=Object(O.a)(n,"lstmBias","basicLSTMCell"),l=Object(O.a)(r,"data","basicLSTMCell"),d=Object(O.a)(a,"c","basicLSTMCell"),f=Object(O.a)(i,"h","basicLSTMCell"),p=Object(x.a)([l,f],1),h=Object(k.a)(p,c),b=Object(s.a)(h,u),m=b.shape[0],v=b.shape[1]/4,g=[m,v],y=Object(N.a)(b,[0,0],g),j=Object(N.a)(b,[0,v],g),C=Object(N.a)(b,[0,2*v],g),T=Object(N.a)(b,[0,3*v],g),E=Object(s.a)(Object(w.a)(Object(S.a)(y),Object(I.a)(j)),Object(w.a)(d,Object(S.a)(Object(s.a)(o,C))));return[E,Object(w.a)(Object(I.a)(E),Object(S.a)(T))]}}),T=n(115),E=n(104),A=n(15);var R=Object(j.b)({batchNorm2d_:function(e,t,n,r,a,i){var o,s,c=Object(O.a)(e,"x","batchNorm"),u=Object(O.a)(t,"mean","batchNorm"),l=Object(O.a)(n,"variance","batchNorm");return null!=a&&(o=Object(O.a)(a,"scale","batchNorm")),null!=r&&(s=Object(O.a)(r,"offset","batchNorm")),A.b(2===c.rank,(function(){return"Error in batchNorm2D: x must be rank 2 but got rank "+"".concat(c.rank,".")})),A.b(2===u.rank||1===u.rank,(function(){return"Error in batchNorm2D: mean must be rank 2 or rank 1 but "+"got rank ".concat(u.rank,".")})),A.b(2===l.rank||1===l.rank,(function(){return"Error in batchNorm2D: variance must be rank 2 or rank 1 "+"but got rank ".concat(l.rank,".")})),null!=o&&A.b(2===o.rank||1===o.rank,(function(){return"Error in batchNorm2D: scale must be rank 2 or rank 1 "+"but got rank ".concat(o.rank,".")})),null!=s&&A.b(2===s.rank||1===s.rank,(function(){return"Error in batchNorm2D: offset must be rank 2 or rank 1 "+"but got rank ".concat(s.rank,".")})),Object(E.a)(c,u,l,s,o,i)}});var F=Object(j.b)({batchNorm3d_:function(e,t,n,r,a,i){var o,s,c=Object(O.a)(e,"x","batchNorm"),u=Object(O.a)(t,"mean","batchNorm"),l=Object(O.a)(n,"variance","batchNorm");return null!=a&&(o=Object(O.a)(a,"scale","batchNorm")),null!=r&&(s=Object(O.a)(r,"offset","batchNorm")),A.b(3===c.rank,(function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+"".concat(c.rank,".")})),A.b(3===u.rank||1===u.rank,(function(){return"Error in batchNorm3D: mean must be rank 3 or rank 1 but "+"got rank ".concat(u.rank,".")})),A.b(3===l.rank||1===l.rank,(function(){return"Error in batchNorm3D: variance must be rank 3 or rank 1 "+"but got rank ".concat(l.rank,".")})),null!=o&&A.b(3===o.rank||1===o.rank,(function(){return"Error in batchNorm3D: scale must be rank 3 or rank 1 "+"but got rank ".concat(o.rank,".")})),null!=s&&A.b(3===s.rank||1===s.rank,(function(){return"Error in batchNorm3D: offset must be rank 3 or rank 1 "+"but got rank ".concat(s.rank,".")})),Object(E.a)(c,u,l,s,o,i)}});var D=Object(j.b)({batchNorm4d_:function(e,t,n,r,a,i){var o,s,c=Object(O.a)(e,"x","batchNorm"),u=Object(O.a)(t,"mean","batchNorm"),l=Object(O.a)(n,"variance","batchNorm");return null!=a&&(o=Object(O.a)(a,"scale","batchNorm")),null!=r&&(s=Object(O.a)(r,"offset","batchNorm")),A.b(4===c.rank,(function(){return"Error in batchNorm4D: x must be rank 4 but got rank "+"".concat(c.rank,".")})),A.b(4===u.rank||1===u.rank,(function(){return"Error in batchNorm4D: mean must be rank 4 or rank 1 but "+"got rank ".concat(u.rank,".")})),A.b(4===l.rank||1===l.rank,(function(){return"Error in batchNorm4D: variance must be rank 4 or rank 1 "+"but got rank ".concat(l.rank,".")})),null!=o&&A.b(4===o.rank||1===o.rank,(function(){return"Error in batchNorm4D: scale must be rank 4 or rank 1 "+"but got rank ".concat(o.rank,".")})),null!=s&&A.b(4===s.rank||1===s.rank,(function(){return"Error in batchNorm4D: offset must be rank 4 or rank 1 "+"but got rank ".concat(s.rank,".")})),Object(E.a)(c,u,l,s,o,i)}}),_=n(195),M=n(125),z=n(68),L=n(24),P=n(257),B=n(258),W=n(92),U=n(81);var V=Object(j.b)({concat1d_:function(e){return Object(x.a)(e,0)}});var H=Object(j.b)({concat2d_:function(e,t){return Object(x.a)(e,t)}});var G=Object(j.b)({concat3d_:function(e,t){return Object(x.a)(e,t)}});var q=Object(j.b)({concat4d_:function(e,t){return Object(x.a)(e,t)}}),K=n(196),X=n(90),Y=n(197),$=n(259),Q=n(229);var Z=Object(j.b)({conv3dTranspose_:function(e,t,n,r,a){var i=Object(O.a)(e,"x","conv3dTranspose"),o=Object(O.a)(t,"filter","conv3dTranspose");return Object(Q.a)(n,i,o,r,a)}}),J=n(144),ee=n(198),te=n(145),ne=n(260),re=n(199),ae=n(116),ie=n(9),oe=n(3);var se=Object(j.b)({diag_:function(e){var t={x:Object(O.a)(e,"x","diag")};return ie.a.runKernel(oe.R,t)}}),ce=n(200),ue=n(31),le=n(201),de=n(202),fe=n(261),pe=n(147),he=n(117),be=n(262),me=n(61),ve=n(86),ge=n(263),ye=n(13),Oe=n(106);var xe=Object(j.b)({eye_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"float32";null==t&&(t=e);for(var a=Object(z.a)([e,t],r),i=e<=t?e:t,o=0;o<i;++o)a.set(1,o,o);var s=Object(ye.a)(a.toTensor(),[e,t]);if(null==n)return s;if(1===n.length)return Object(Oe.a)(Object(ve.a)(s,0),[n[0],1,1]);if(2===n.length)return Object(Oe.a)(Object(ve.a)(Object(ve.a)(s,0),0),[n[0],n[1],1,1]);if(3===n.length)return Object(Oe.a)(Object(ve.a)(Object(ve.a)(Object(ve.a)(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 ".concat(n.length,"D."))}}),ke=n(118),we=n(148),je=n(146),Se=n(119),Ne=n(64),Ie=n(91),Ce=n(149),Te=n(264),Ee=n(265),Ae=n(266),Re=n(150),Fe=n(151),De=n(76),_e=n(267),Me=n(203),ze=n(97),Le=n(204),Pe=n(268),Be=n(269),We=n(152),Ue=n(82),Ve=n(120),He=n(153),Ge=n(206),qe=n(94),Ke=n(154),Xe=n(270),Ye=n(271),$e=n(121),Qe=n(112),Ze=n(74),Je=n(10);function et(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.indexing,a=void 0===r?"xy":r;if("xy"!==a&&"ij"!==a)throw new TypeError("".concat(a," is not a valid third argument to meshgrid"));if(void 0===e)return[];var i=Object(O.a)(e,"x","meshgrid",e instanceof Je.a?e.dtype:"float32");if(void 0===t)return[i];var o=Object(O.a)(t,"y","meshgrid",t instanceof Je.a?t.dtype:"float32"),s=Object(A.O)(i.shape),c=Object(A.O)(o.shape);return"xy"===a?(i=Object(ye.a)(i,[1,-1]),o=Object(ye.a)(o,[-1,1]),[Object(k.a)(Object(Ze.a)([c,1],i.dtype),i),Object(k.a)(o,Object(Ze.a)([1,s],o.dtype))]):(i=Object(ye.a)(i,[-1,1]),o=Object(ye.a)(o,[1,-1]),[Object(k.a)(i,Object(Ze.a)([1,c],i.dtype)),Object(k.a)(Object(Ze.a)([s,1],o.dtype),o)])}var tt=n(132),nt=n(155),rt=n(207),at=n(208),it=n(60),ot=n(40),st=n(29);var ct=Object(j.b)({moments_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e=Object(O.a)(e,"x","moments");var r=Object(A.I)(t,e.shape),a=Object(Qe.a)(e,r,n),i=a.shape;n||(i=Object(it.e)(a.shape,r));var o=Object(ot.a)(Object(st.a)(Object(L.a)(e,"float32"),Object(ye.a)(a,i))),s=Object(Qe.a)(o,r,n);return{mean:a,variance:s}}});var ut=Object(j.b)({multiRNNCell_:function(e,t,n,r){for(var a=Object(O.a)(t,"data","multiRNNCell"),i=Object(O.b)(n,"c","multiRNNCell"),o=Object(O.b)(r,"h","multiRNNCell"),s=a,c=[],u=0;u<e.length;u++){var l=e[u](s,i[u],o[u]);c.push(l[0]),c.push(l[1]),s=l[1]}for(var d=[],f=[],p=0;p<c.length;p+=2)d.push(c[p]),f.push(c[p+1]);return[d,f]}}),lt=n(272),dt=n(45),ft=n(156),pt=n(209),ht=n(273);var bt=Object(j.b)({outerProduct_:function(e,t){var n=Object(O.a)(e,"v1","outerProduct"),r=Object(O.a)(t,"v2","outerProduct");A.b(1===n.rank&&1===r.rank,(function(){return"Error in outerProduct: inputs must be rank 1, but got ranks "+"".concat(n.rank," and ").concat(r.rank,".")}));var a=Object(ye.a)(n,[-1,1]),i=Object(ye.a)(r,[1,-1]);return Object(k.a)(a,i)}}),mt=n(77);var vt=Object(j.b)({pad1d_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.b)(2===t.length,(function(){return"Invalid number of paddings. Must be length of 2."})),Object(mt.a)(e,[t],n)}});var gt=Object(j.b)({pad2d_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.b)(2===t.length&&2===t[0].length&&2===t[1].length,(function(){return"Invalid number of paddings. Must be length of 2 each."})),Object(mt.a)(e,t,n)}});var yt=Object(j.b)({pad3d_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.b)(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."})),Object(mt.a)(e,t,n)}});var Ot=Object(j.b)({pad4d_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(A.b)(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."})),Object(mt.a)(e,t,n)}}),xt=n(210),kt=n(73),wt=n(157),jt=n(189),St=n(211);var Nt=Object(j.b)({rand_:function(e,t,n){var r=Object(A.O)(e),a=null;if(null==n||"float32"===n)a=new Float32Array(r);else if("int32"===n)a=new Int32Array(r);else{if("bool"!==n)throw new Error("Unknown data type ".concat(n));a=new Uint8Array(r)}for(var i=0;i<r;i++)a[i]=t();return ie.a.makeTensor(a,e,n)}}),It=n(126);var Ct=Object(j.b)({randomGamma_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"float32",a=arguments.length>4?arguments[4]:void 0;if(null==n&&(n=1),null==r&&(r="float32"),"float32"!==r&&"int32"!==r)throw new Error("Unsupported data type ".concat(r));for(var i=new It.b(t,n,r,a),o=Object(z.a)(e,r),s=0;s<o.values.length;s++)o.values[s]=i.nextValue();return o.toTensor()}});var Tt=Object(j.b)({randomNormal_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(null!=r&&"bool"===r)throw new Error("Unsupported data type ".concat(r));for(var i=new It.a(t,n,r,!1,a),o=Object(z.a)(e,r),s=0;s<o.values.length;s++)o.values[s]=i.nextValue();return o.toTensor()}}),Et=n(212),At=n(127),Rt=n(133),Ft=n(274),Dt=n(101),_t=n(158),Mt=n(69);var zt=Object(j.b)({reverse1d_:function(e){var t=Object(O.a)(e,"x","reverse");return A.b(1===t.rank,(function(){return"Error in reverse1D: x must be rank 1 but got rank ".concat(t.rank,".")})),Object(Mt.a)(t,0)}});var Lt=Object(j.b)({reverse2d_:function(e,t){var n=Object(O.a)(e,"x","reverse");return A.b(2===n.rank,(function(){return"Error in reverse2D: x must be rank 2 but got rank ".concat(n.rank,".")})),Object(Mt.a)(n,t)}});var Pt=Object(j.b)({reverse3d_:function(e,t){var n=Object(O.a)(e,"x","reverse");return A.b(3===n.rank,(function(){return"Error in reverse3D: x must be rank 3 but got rank ".concat(n.rank,".")})),Object(Mt.a)(n,t)}});var Bt=Object(j.b)({reverse4d_:function(e,t){var n=Object(O.a)(e,"x","reverse");return A.b(4===n.rank,(function(){return"Error in reverse4D: x must be rank 4 but got rank ".concat(n.rank,".")})),Object(Mt.a)(n,t)}}),Wt=n(213),Ut=n(214),Vt=n(33),Ht=n(215),Gt=n(216),qt=n(275),Kt=n(276),Xt=n(217),Yt=n(218);var $t=Object(j.b)({slice1d_:function(e,t,n){var r=Object(O.a)(e,"x","slice1d");return A.b(1===r.rank,(function(){return"slice1d expects a rank-1 tensor, but got a rank-".concat(r.rank," tensor")})),Object(N.a)(r,[t],[n])}});var Qt=Object(j.b)({slice2d_:function(e,t,n){var r=Object(O.a)(e,"x","slice2d");return A.b(2===r.rank,(function(){return"slice2d expects a rank-2 tensor, but got a rank-".concat(r.rank," tensor")})),Object(N.a)(r,t,n)}});var Zt=Object(j.b)({slice3d_:function(e,t,n){var r=Object(O.a)(e,"x","slice3d");return A.b(3===r.rank,(function(){return"slice3d expects a rank-3 tensor, but got a rank-".concat(r.rank," tensor")})),Object(N.a)(r,t,n)}});var Jt=Object(j.b)({slice4d_:function(e,t,n){var r=Object(O.a)(e,"x","slice4d");return A.b(4===r.rank,(function(){return"slice4d expects a rank-4 tensor, but got a rank-".concat(r.rank," tensor")})),Object(N.a)(r,t,n)}}),en=n(277),tn=n(205),nn=n(122),rn=n(159),an=n(134),on=n(219),sn=n(160),cn=n(83),un=n(58),ln=n(161),dn=n(123),fn=n(84),pn=n(102),hn=n(278),bn=n(32),mn=n(279),vn=n(105),gn=n(70),yn=n(71);function On(e,t,n){if(Object(A.d)(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");var r=Object(O.c)(e,n);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 Object(yn.a)(e,t,r,n)}var xn=n(220);function kn(e,t,n){if(Object(A.d)(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");var r=Object(O.c)(e,n);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 Object(yn.a)(e,t,r,n)}function wn(e,t,n){if(Object(A.d)(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");var r=Object(O.c)(e,n);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 Object(yn.a)(e,t,r,n)}function jn(e,t,n){if(Object(A.d)(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");var r=Object(O.c)(e,n);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 t=t||r,Object(yn.a)(e,t,r,n)}var Sn=n(221),Nn=n(280),In=n(222),Cn=n(162),Tn=n(103);function En(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return ie.a.makeVariable(e,t,n,r)}var An=n(51),Rn=n(223),Fn=n(100),Dn=n(36),_n=n(5),Mn=n.n(_n),zn=n(12);function Ln(){return(Ln=Object(zn.a)(Mn.a.mark((function e(t,n,r){var a,i,o,s,c,u,l,d,f,p,h,b,m;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a=Object(O.a)(t,"tensor","boolMask"),i=Object(O.a)(n,"mask","boolMask","bool"),o=null==r?0:r,s=i.rank,c=a.shape,A.b(s>0,(function(){return"mask cannot be scalar"})),A.e(c.slice(o,o+s),i.shape,"mask's shape must match the first K dimensions of tensor's shape,"),u=1,l=o;l<o+s;l++)u*=c[l];return d=c.slice(0,o).concat([u],c.slice(o+s)),f=Object(ye.a)(a,d),p=Object(ye.a)(i,[-1]),e.next=14,Object(Rn.a)(p);case 14:return h=e.sent,b=Object(dn.a)(h,[1]),m=Object(Se.a)(f,b,o),t!==a&&a.dispose(),n!==i&&i.dispose(),b.dispose(),f.dispose(),p.dispose(),h.dispose(),e.abrupt("return",m);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Pn=function(e,t,n){return Ln.apply(this,arguments)},Bn=n(78),Wn=n(163),Un=n(39);var Vn=Object(j.b)({movingAverage_:function(e,t,n,r){var a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=Object(O.a)(e,"v","movingAverage"),o=Object(O.a)(t,"x","movingAverage"),c=Object(O.a)(n,"decay","movingAverage");Object(Un.assertTypesMatch)(i,o),A.b(A.a(i.shape,o.shape),(function(){return"Shape mismatch in v and x"}));var u=Object(Vt.a)(1),l=Object(st.a)(u,c),d=Object(w.a)(Object(st.a)(o,i),l);if(a){A.b(null!=r,(function(){return"When using zeroDebias: true, step is required."}));var f=Object(O.a)(r,"step","movingAverage");d=Object(ue.a)(d,Object(st.a)(u,Object(kt.a)(c,f)))}return Object(s.a)(i,d)}}),Hn=n(281),Gn=n(284),qn=n(282);var Kn=Object(j.b)({dropout_:function(e,t,n,r){var a=Object(O.a)(e,"x","dropout");if(A.b("float32"===a.dtype,(function(){return"x has to be a floating point tensor since it's going to be "+"scaled, but got a ".concat(a.dtype," tensor instead.")})),A.b(t>=0&&t<1,(function(){return"rate must be a float in the range [0, 1), but got ".concat(t,".")})),0===t)return e instanceof Je.a?a.clone():a;var i=function(e,t){if(null==t)return e.shape.slice();if(A.a(e.shape,t))return t;if(e.shape.length===t.length){for(var n=[],r=0;r<e.shape.length;r++)null==t[r]&&null!=e.shape[r]?n.push(e.shape[r]):n.push(t[r]);return n}return t}(a,n),o=1-t,c=Object(ue.a)(Object(we.a)(Object(s.a)(Object(Et.a)(i,0,1,"float32",r),o)),o);return Object(w.a)(a,c)}});function Xn(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function Yn(e,t,n){for(var r=1-e%2,a=new Float32Array(e),i=0;i<e;++i){var o=2*Math.PI*i/(e+r-1);a[i]=t-n*Math.cos(o)}return Object(gn.a)(a,"float32")}function $n(){return($n=Object(zn.a)(Mn.a.mark((function e(t,n){var r,a,i,o,s,c,u,l,d,f,p,h,b,m,v,g=arguments;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=g.length>2&&void 0!==g[2]?g[2]:1,a=Object(O.a)(t,"predictions","inTopK"),i=Object(O.a)(n,"targets","inTopK"),Object(A.b)(a.rank>1,(function(){return"inTopK() expects the predictions to be of rank 2 or higher, "+"but got ".concat(a.rank)})),Object(A.b)(a.rank-1===i.rank,(function(){return"predictions rank should be 1 larger than targets rank, but got predictions rank "+"".concat(a.rank," and targets rank ").concat(i.rank)})),Object(A.e)(a.shape.slice(0,a.shape.length-1),i.shape,"predictions's shape should be align with the targets' shape, except the last dimension."),o=a.shape[a.shape.length-1],Object(A.b)(r>0&&r<=o,(function(){return"'k' passed to inTopK() must be > 0 && <= the predictions last "+"dimension (".concat(o,"), but got ").concat(r)})),e.next=10,a.data();case 10:return s=e.sent,e.next=13,i.data();case 13:c=e.sent,u=s.length/o,l=o,d=Object(A.o)("bool",u),f=0;case 17:if(!(f<u)){e.next=35;break}for(p=f*l,h=s.subarray(p,p+l),b=[],m=0;m<h.length;m++)b.push({value:h[m],index:m});b.sort((function(e,t){return t.value-e.value})),d[f]=0,v=0;case 25:if(!(v<r)){e.next=32;break}if(b[v].index!==c[f]){e.next=29;break}return d[f]=1,e.abrupt("break",32);case 29:v++,e.next=25;break;case 32:f++,e.next=17;break;case 35:return t!==a&&a.dispose(),n!==i&&i.dispose(),e.abrupt("return",Object(vn.a)(d,i.shape,"bool"));case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Qn=function(e,t){return $n.apply(this,arguments)},Zn=n(6),Jn=n(55),er=n(34),tr=n(167),nr=n(165),rr=n(48),ar=n(66);var ir=Object(j.b)({fusedConv2d_:function(e){var t=e.x,n=e.filter,r=e.strides,a=e.pad,i=e.dataFormat,o=void 0===i?"NHWC":i,c=e.dilations,u=void 0===c?[1,1]:c,l=e.dimRoundingMode,d=e.bias,f=e.activation,p=void 0===f?"linear":f,h=e.preluActivationWeights,b=e.leakyreluAlpha;if(p=p||"linear",!1===Object(ar.d)(ie.a.state.gradientDepth,p)){var m=Object(X.a)(t,n,r,a,o,u,l);return null!=d&&(m=Object(s.a)(m,d)),Object(ar.a)(m,p,h,b)}var v=Object(O.a)(t,"x","conv2d"),g=Object(O.a)(n,"filter","conv2d"),y=v,x=!1;3===v.rank&&(x=!0,y=Object(ye.a)(v,[1,v.shape[0],v.shape[1],v.shape[2]])),A.b(4===y.rank,(function(){return"Error in fused conv2d: input must be rank 4, but got rank "+"".concat(y.rank,".")})),A.b(4===g.rank,(function(){return"Error in fused conv2d: filter must be rank 4, but got rank "+"".concat(g.rank,".")})),null!=l&&A.b(A.v(a),(function(){return"Error in fused conv2d: pad must be an integer when using, "+"dimRoundingMode ".concat(l," but got pad ").concat(a,".")})),A.b(y.shape[3]===g.shape[2],(function(){return"Error in conv2d: depth of input (".concat(y.shape[3],") must match ")+"input depth for filter ".concat(g.shape[2],".")})),A.b(rr.h(r,u),(function(){return"Error in conv2D: Either strides or dilations must be 1. "+"Got strides ".concat(r," and dilations '").concat(u,"'")})),A.b("NHWC"===o,(function(){return"Error in conv2d: got dataFormat of ".concat(o," but only NHWC is currently supported.")}));var k,w,j=rr.a(y.shape,g.shape,r,u,a,l);if(null!=d){k=Object(O.a)(d,"bias","fused conv2d");var S=Object(Un.makeTypesMatch)(k,v);k=Object(Zn.a)(S,1)[0],er.a(j.outShape,k.shape)}null!=h&&(w=Object(O.a)(h,"prelu weights","fused conv2d"));var N=function(e,t){var n=Object(Zn.a)(t,4),i=n[0],o=n[1],s=n[2],c=n[3],l=Object(ar.c)(e,s,p);A.b(rr.i(u),(function(){return"Error in gradient of fused conv2D: dilation rates greater than 1 "+"are not yet supported in gradients. Got dilations '".concat(u,"'")}));var d=[Object(nr.a)(o.shape,l,i,r,a),Object(tr.a)(o,l,i.shape,r,a)];if(null!=c){var f=Object(ar.b)(c,l);d.push(f)}return d},I={x:y,filter:g,bias:k,preluActivationWeights:w},C={strides:r,pad:a,dataFormat:o,dilations:u,dimRoundingMode:l,activation:p,leakyreluAlpha:b};return null==d?Object(Jn.a)((function(e,t,n){var r=ie.a.runKernel(oe.kb,I,C);return n([t,e,r]),x&&(r=Object(ye.a)(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:N}}))(y,g):Object(Jn.a)((function(e,t,n,r){var a=ie.a.runKernel(oe.kb,I,C);return r([t,e,a,n]),x&&(a=Object(ye.a)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:N}}))(y,g,k)}}),or=n(234),sr=n(233);var cr=Object(j.b)({fusedDepthwiseConv2d_:function(e){var t=e.x,n=e.filter,r=e.strides,a=e.pad,i=e.dataFormat,o=void 0===i?"NHWC":i,c=e.dilations,u=void 0===c?[1,1]:c,l=e.dimRoundingMode,d=e.bias,f=e.activation,p=void 0===f?"linear":f,h=e.preluActivationWeights,b=e.leakyreluAlpha;if(!1===Object(ar.d)(ie.a.state.gradientDepth,p)){var m=Object(ae.a)(t,n,r,a,o,u,l);return null!=d&&(m=Object(s.a)(m,d)),Object(ar.a)(m,p,h,b)}var v=Object(O.a)(t,"x","depthwiseConv2d"),g=Object(O.a)(n,"filter","depthwiseConv2d"),y=v,x=!1;3===v.rank&&(x=!0,y=Object(ye.a)(v,[1,v.shape[0],v.shape[1],v.shape[2]])),A.b(4===y.rank,(function(){return"Error in fused depthwiseConv2d: input must be rank 4, but got "+"rank ".concat(y.rank,".")})),A.b(4===g.rank,(function(){return"Error in fused depthwiseConv2d: filter must be rank 4, "+"but got rank ".concat(g.rank,".")})),A.b(y.shape[3]===g.shape[2],(function(){return"Error in fused depthwiseConv2d: number of input channels "+"(".concat(y.shape[3],") must match the inChannels dimension in ")+"filter ".concat(g.shape[2],".")})),null==u&&(u=[1,1]),A.b(rr.h(r,u),(function(){return"Error in fused depthwiseConv2d: Either strides or dilations must "+"be 1. Got strides ".concat(r," and dilations '").concat(u,"'")})),null!=l&&A.b(A.v(a),(function(){return"Error in fused depthwiseConv2d: pad must be an integer when "+"using dimRoundingMode ".concat(l," but got pad ").concat(a,".")}));var k,w,j=rr.a(y.shape,g.shape,r,u,a,l,!0);if(null!=d){k=Object(O.a)(d,"bias","fused conv2d");var S=Object(Un.makeTypesMatch)(k,v),N=Object(Zn.a)(S,1);k=N[0],er.a(j.outShape,k.shape)}null!=h&&(w=Object(O.a)(h,"prelu weights","fused depthwiseConv2d"));var I=function(e,t){A.b(rr.i(u),(function(){return"Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations "+"'".concat(u,"'")}));var n=Object(Zn.a)(t,4),i=n[0],o=n[1],s=n[2],c=n[3],d=Object(ar.c)(e,s,p),f=Object(sr.a)(o.shape,d,i,r,a,u,l),h=Object(or.a)(o,d,i.shape,r,a,u,l);return null!=c?[f,h,Object(ar.b)(k,d)]:[f,h]},C={x:y,filter:g,bias:k,preluActivationWeights:w},T={strides:r,pad:a,dataFormat:o,dilations:u,dimRoundingMode:l,activation:p,leakyreluAlpha:b};return null==d?Object(Jn.a)((function(e,t,n){var r=ie.a.runKernel(oe.lb,C,T);return n([t,e,r]),x&&(r=Object(ye.a)(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:I}}))(y,g):Object(Jn.a)((function(e,t,n,r){var a=ie.a.runKernel(oe.lb,C,T);return r([t,e,a,n]),x&&(a=Object(ye.a)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:I}}))(y,g,k)}});var ur=Object(j.b)({fusedMatMul_:function(e){var t=e.a,n=e.b,r=e.transposeA,a=void 0!==r&&r,i=e.transposeB,o=void 0!==i&&i,c=e.bias,u=e.activation,l=void 0===u?"linear":u,d=e.preluActivationWeights,f=e.leakyreluAlpha;if(!1===Object(ar.d)(ie.a.state.gradientDepth,l)){var p=Object(k.a)(t,n,a,o);return null!=c&&(p=Object(s.a)(p,c)),Object(ar.a)(p,l,d,f)}var h=Object(O.a)(t,"a","fused matMul"),b=Object(O.a)(n,"b","fused matMul"),m=Object(Un.makeTypesMatch)(h,b),v=Object(Zn.a)(m,2);h=v[0],b=v[1];var g=a?h.shape[h.rank-2]:h.shape[h.rank-1],y=o?b.shape[b.rank-1]:b.shape[b.rank-2],x=a?h.shape[h.rank-1]:h.shape[h.rank-2],w=o?b.shape[b.rank-2]:b.shape[b.rank-1],j=h.shape.slice(0,-2),S=b.shape.slice(0,-2),N=A.O(j),I=A.O(S);A.b(h.rank>=2&&b.rank>=2&&h.rank===b.rank,(function(){return"Error in fused matMul: inputs must have the same rank of at "+"least 2, got ranks ".concat(h.rank," and ").concat(b.rank,".")})),A.b(A.a(j,S),(function(){return"Error in fused matMul: outer dimensions (".concat(j,") and (")+"".concat(S,") of Tensors with shapes ").concat(h.shape," and ")+"".concat(b.shape," must match.")})),A.b(g===y,(function(){return"Error in fused matMul: inner shapes (".concat(g,") and (")+"".concat(y,") of Tensors with shapes ").concat(h.shape," and ")+"".concat(b.shape," and transposeA=").concat(a)+" and transposeB=".concat(o," must match.")}));var C,T,E=h.shape.slice(0,-2).concat([x,w]),R=a?Object(ye.a)(h,[N,g,x]):Object(ye.a)(h,[N,x,g]),F=o?Object(ye.a)(b,[I,w,y]):Object(ye.a)(b,[I,y,w]);if(null!=c){C=Object(O.a)(c,"bias","fused matMul");var D=Object(Un.makeTypesMatch)(C,h);C=Object(Zn.a)(D,1)[0],er.a(E,C.shape)}null!=d&&(T=Object(O.a)(d,"prelu weights","fused matMul"));var _=function(e,t){var n,r,i=Object(Zn.a)(t,4),s=i[0],u=i[1],d=i[2],f=i[3],p=Object(ar.c)(Object(ye.a)(e,d.shape),d,l);return a||o?!a&&o?(n=Object(k.a)(p,u,!1,!1),r=Object(k.a)(p,s,!0,!1)):a&&!o?(n=Object(k.a)(u,p,!1,!0),r=Object(k.a)(s,p,!1,!1)):(n=Object(k.a)(u,p,!0,!0),r=Object(k.a)(p,s,!0,!0)):(n=Object(k.a)(p,u,!1,!0),r=Object(k.a)(s,p,!0,!1)),null!=c?[n,r,Object(ar.b)(f,p)]:[n,r]},M={a:R,b:F,bias:C,preluActivationWeights:T},z={transposeA:a,transposeB:o,activation:l,leakyreluAlpha:f};return null==c?Object(Jn.a)((function(e,t,n){var r=ie.a.runKernel(oe.id,M,z);return n([e,t,r]),{value:Object(ye.a)(r,E),gradFunc:_}}))(R,F):Object(Jn.a)((function(e,t,n,r){var a=ie.a.runKernel(oe.id,M,z);return r([e,t,a,n]),{value:Object(ye.a)(a,E),gradFunc:_}}))(R,F,C)}});var lr=Object(j.b)({hammingWindow_:function(e){return Yn(e,.54,.46)}});var dr=Object(j.b)({hannWindow_:function(e){return Yn(e,.5,.5)}});var fr=Object(j.b)({frame_:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=0,o=[];i+t<=e.size;)o.push(Object(N.a)(e,i,t)),i+=n;if(r)for(;i<e.size;){var s=i+t-e.size,c=Object(x.a)([Object(N.a)(e,i,t-s),Object(ke.a)([s],a)]);o.push(c),i+=n}return 0===o.length?On([],[0,t]):Object(ye.a)(Object(x.a)(o),[o.length,t])}});var pr=Object(j.b)({stft_:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:dr;null==r&&(r=Xn(t));var i=fr(e,t,n),o=Object(w.a)(i,a(t));return Object(sn.a)(o,r)}});var hr=Object(j.b)({cropAndResize_:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"bilinear",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=Object(O.a)(e,"image","cropAndResize"),s=Object(O.a)(t,"boxes","cropAndResize","float32"),c=Object(O.a)(n,"boxInd","cropAndResize","int32"),u=s.shape[0];A.b(4===o.rank,(function(){return"Error in cropAndResize: image must be rank 4,"+"but got rank ".concat(o.rank,".")})),A.b(2===s.rank&&4===s.shape[1],(function(){return"Error in cropAndResize: boxes must be have size [".concat(u,",4] ")+"but had shape ".concat(s.shape,".")})),A.b(1===c.rank&&c.shape[0]===u,(function(){return"Error in cropAndResize: boxInd must be have size [".concat(u,"] ")+"but had shape ".concat(s.shape,".")})),A.b(2===r.length,(function(){return"Error in cropAndResize: cropSize must be of length 2, but got "+"length ".concat(r.length,".")})),A.b(r[0]>=1&&r[1]>=1,(function(){return"cropSize must be atleast [1,1], but was ".concat(r)})),A.b("bilinear"===a||"nearest"===a,(function(){return"method must be bilinear or nearest, but was ".concat(a)}));var l={image:o,boxes:s,boxInd:c},d={method:a,extrapolationValue:i,cropSize:r},f=ie.a.runKernel(oe.K,l,d);return f}});var br=Object(j.b)({flipLeftRight_:function(e){var t=Object(O.a)(e,"image","flipLeftRight","float32");A.b(4===t.rank,(function(){return"Error in flipLeftRight: image must be rank 4,"+"but got rank ".concat(t.rank,".")}));var n={image:t};return ie.a.runKernel(oe.fb,n,{})}});var mr=Object(j.b)({rotateWithOffset_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=Object(O.a)(e,"image","rotateWithOffset","float32");A.b(4===a.rank,(function(){return"Error in rotateWithOffset: image must be rank 4,"+"but got rank ".concat(a.rank,".")}));var i={image:a},o={radians:t,fillValue:n,center:r},s=ie.a.runKernel(oe.uc,i,o);return s}});function vr(e,t,n,r,a,i){null==r&&(r=.5),null==a&&(a=Number.NEGATIVE_INFINITY),null==i&&(i=0);var o=e.shape[0];return n=Math.min(n,o),A.b(0<=r&&r<=1,(function(){return"iouThreshold must be in [0, 1], but was '".concat(r,"'")})),A.b(2===e.rank,(function(){return"boxes must be a 2D tensor, but was of rank '".concat(e.rank,"'")})),A.b(4===e.shape[1],(function(){return"boxes must have 4 columns, but 2nd dimension was ".concat(e.shape[1])})),A.b(1===t.rank,(function(){return"scores must be a 1D tensor"})),A.b(t.shape[0]===o,(function(){return"scores has incompatible shape with boxes. Expected ".concat(o,", ")+"but was ".concat(t.shape[0])})),A.b(0<=i&&i<=1,(function(){return"softNmsSigma must be in [0, 1], but was '".concat(i,"'")})),{maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:i}}var gr=Object(j.b)({nonMaxSuppression_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Number.NEGATIVE_INFINITY,i=Object(O.a)(e,"boxes","nonMaxSuppression"),o=Object(O.a)(t,"scores","nonMaxSuppression"),s=vr(i,o,n,r,a),c={maxOutputSize:n=s.maxOutputSize,iouThreshold:r=s.iouThreshold,scoreThreshold:a=s.scoreThreshold};return ie.a.runKernel(oe.Xb,{boxes:i,scores:o},c)}}),yr=n(99);function Or(){return(Or=Object(zn.a)(Mn.a.mark((function e(t,n,r){var a,i,o,s,c,u,l,d,f,p,h=arguments;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=h.length>3&&void 0!==h[3]?h[3]:.5,i=h.length>4&&void 0!==h[4]?h[4]:Number.NEGATIVE_INFINITY,o=Object(O.a)(t,"boxes","nonMaxSuppressionAsync"),s=Object(O.a)(n,"scores","nonMaxSuppressionAsync"),c=vr(o,s,r,a,i),r=c.maxOutputSize,a=c.iouThreshold,i=c.scoreThreshold,e.next=10,Promise.all([o.data(),s.data()]);case 10:return u=e.sent,l=u[0],d=u[1],f=Object(yr.a)(l,d,r,a,i),p=f.selectedIndices,o!==t&&o.dispose(),s!==n&&s.dispose(),e.abrupt("return",Object(gn.a)(p,"int32"));case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xr=function(e,t,n){return Or.apply(this,arguments)};var kr=Object(j.b)({nonMaxSuppressionWithScore_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Number.NEGATIVE_INFINITY,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=Object(O.a)(e,"boxes","nonMaxSuppression"),s=Object(O.a)(t,"scores","nonMaxSuppression"),c=vr(o,s,n,r,a,i),u={boxes:o,scores:s},l={maxOutputSize:n=c.maxOutputSize,iouThreshold:r=c.iouThreshold,scoreThreshold:a=c.scoreThreshold,softNmsSigma:i=c.softNmsSigma},d=ie.a.runKernel(oe.Zb,u,l);return{selectedIndices:d[0],selectedScores:d[1]}}});function wr(){return(wr=Object(zn.a)(Mn.a.mark((function e(t,n,r){var a,i,o,s,c,u,l,d,f,p,h,b,m=arguments;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=m.length>3&&void 0!==m[3]?m[3]:.5,i=m.length>4&&void 0!==m[4]?m[4]:Number.NEGATIVE_INFINITY,o=m.length>5&&void 0!==m[5]?m[5]:0,s=Object(O.a)(t,"boxes","nonMaxSuppressionAsync"),c=Object(O.a)(n,"scores","nonMaxSuppressionAsync"),u=vr(s,c,r,a,i,o),r=u.maxOutputSize,a=u.iouThreshold,i=u.scoreThreshold,o=u.softNmsSigma,e.next=12,Promise.all([s.data(),c.data()]);case 12:return l=e.sent,d=l[0],f=l[1],p=Object(yr.c)(d,f,r,a,i,o),h=p.selectedIndices,b=p.selectedScores,s!==t&&s.dispose(),c!==n&&c.dispose(),e.abrupt("return",{selectedIndices:Object(gn.a)(h,"int32"),selectedScores:Object(gn.a)(b)});case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jr=function(e,t,n){return wr.apply(this,arguments)};var Sr=Object(j.b)({nonMaxSuppressionPadded_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Number.NEGATIVE_INFINITY,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=Object(O.a)(e,"boxes","nonMaxSuppression"),s=Object(O.a)(t,"scores","nonMaxSuppression"),c=vr(o,s,n,r,a,null),u=c.maxOutputSize,l=c.iouThreshold,d=c.scoreThreshold,f={boxes:o,scores:s},p={maxOutputSize:u,iouThreshold:l,scoreThreshold:d,padToMaxOutputSize:i},h=ie.a.runKernel(oe.Yb,f,p);return{selectedIndices:h[0],validOutputs:h[1]}}});function Nr(){return(Nr=Object(zn.a)(Mn.a.mark((function e(t,n,r){var a,i,o,s,c,u,l,d,f,p,h,b,m,v,g,y,x=arguments;return Mn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=x.length>3&&void 0!==x[3]?x[3]:.5,i=x.length>4&&void 0!==x[4]?x[4]:Number.NEGATIVE_INFINITY,o=x.length>5&&void 0!==x[5]&&x[5],s=Object(O.a)(t,"boxes","nonMaxSuppressionAsync"),c=Object(O.a)(n,"scores","nonMaxSuppressionAsync"),u=vr(s,c,r,a,i,null),l=u.maxOutputSize,d=u.iouThreshold,f=u.scoreThreshold,e.next=11,Promise.all([s.data(),c.data()]);case 11:return p=e.sent,h=Object(Zn.a)(p,2),b=h[0],m=h[1],v=Object(yr.b)(b,m,l,d,f,o),g=v.selectedIndices,y=v.validOutputs,s!==t&&s.dispose(),c!==n&&c.dispose(),e.abrupt("return",{selectedIndices:Object(gn.a)(g,"int32"),validOutputs:Object(Vt.a)(y,"int32")});case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ir=function(e,t,n){return Nr.apply(this,arguments)},Cr=n(232),Tr=n(230);function Er(e,t){for(var n,r,a,i,o,c,u=Object(gn.a)([-1]),l=Object(gn.a)([0]),d=Object(gn.a)([0]),f=0;f<e.size-1;f++){n=Object(N.a)(e,0,f+1),r=Object(N.a)(e,f+1),o=Object(ue.a)(Object(bn.a)(n),t),c=Object(ue.a)(Object(bn.a)(r),t);var p=Object(bn.a)(Object(w.a)(n,Object(At.a)(0,n.size)));a=Object(ue.a)(p,Object(bn.a)(n));var h=Object(ke.a)(r.shape,n.size),b=Object(s.a)(Object(At.a)(0,r.size),h),m=Object(w.a)(r,b);i=Object(ue.a)(Object(bn.a)(m),Object(bn.a)(r));var v=Object(st.a)(a,i),g=Object(st.a)(a,i),y=Object(w.a)(o,c);d=Object(w.a)(Object(w.a)(y,v),g);var O=Object(Ne.a)(d,l);l=Object(An.a)(O,d,l),u=Object(An.a)(O,Object(gn.a)([f]),u)}return u}var Ar=Object(j.b)({threshold_:function(e){var t,n,r,a,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"binary",o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,u=Object(O.a)(e,"image","threshold"),l=.2989,d=.587,f=.114,p=u.shape[0]*u.shape[1],h=Object(w.a)(Object(gn.a)([c]),255);if(A.b(3===u.rank,(function(){return"Error in threshold: image must be rank 3,"+"but got rank ".concat(u.rank,".")})),A.b(3===u.shape[2]||1===u.shape[2],(function(){return"Error in threshold: image color channel must be equal to 3 or 1"+"but got ".concat(u.shape[2],".")})),A.b("int32"===u.dtype||"float32"===u.dtype,(function(){return"Error in dtype: image dtype must be int32 or float32,"+"but got dtype ".concat(u.dtype,".")})),A.b("otsu"===i||"binary"===i,(function(){return"Method must be binary or otsu, but was ".concat(i)})),3===u.shape[2]){var b=Object(cn.a)(u,[1,1,1],-1),m=Object(Zn.a)(b,3);t=m[0],n=m[1],r=m[2];var v=Object(w.a)(t,l),g=Object(w.a)(n,d),y=Object(w.a)(r,f);a=Object(s.a)(Object(s.a)(v,g),y)}else a=e;if("otsu"===i){var x=Object(_.a)(Object(L.a)(Object(Wt.a)(a),"int32"),Object(vn.a)([]),256);h=Er(x,p)}var k=o?Object(De.a)(a,h):Object(Ne.a)(a,h),j=Object(L.a)(Object(w.a)(k,255),"int32");return j}});var Rr=Object(j.b)({transform_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"nearest",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"constant",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5?arguments[5]:void 0,o=Object(O.a)(e,"image","transform","float32"),s=Object(O.a)(t,"transforms","transform","float32");A.b(4===o.rank,(function(){return"Error in transform: image must be rank 4,"+"but got rank ".concat(o.rank,".")})),A.b(2===s.rank&&(s.shape[0]===o.shape[0]||1===s.shape[0])&&8===s.shape[1],(function(){return"Error in transform: Input transform should be batch x 8 or 1 x 8"})),A.b(null==i||2===i.length,(function(){return"Error in transform: outputShape must be [height, width] or null, "+"but got ".concat(i,".")}));var c={image:o,transforms:s},u={interpolation:n,fillMode:r,fillValue:a,outputShape:i};return ie.a.runKernel(oe.cd,c,u)}});var Fr=Object(j.b)({bandPart_:function(e,t,n){Object(A.b)(t%1===0,(function(){return"bandPart(): numLower must be an integer, got ".concat(t,".")})),Object(A.b)(n%1===0,(function(){return"bandPart(): numUpper must be an integer, got ".concat(n,".")}));var r=Object(O.a)(e,"a","bandPart");Object(A.b)(r.rank>=2,(function(){return"bandPart(): Rank must be at least 2, got ".concat(r.rank,".")}));var a=r.shape,i=r.shape.slice(-2),o=Object(Zn.a)(i,2),s=o[0],c=o[1];if(!(t<=s))throw new Error("bandPart(): numLower (".concat(t,")")+" must not be greater than the number of rows (".concat(s,")."));if(!(n<=c))throw new Error("bandPart(): numUpper (".concat(n,")")+" must not be greater than the number of columns (".concat(c,")."));t<0&&(t=s),n<0&&(n=c);var u=Object(ye.a)(Object(At.a)(0,s,1,"int32"),[-1,1]),l=Object(At.a)(0,c,1,"int32"),d=Object(st.a)(u,l),f=Object(Ue.a)(Object(De.a)(d,Object(Vt.a)(+t,"int32")),Object(Ie.a)(d,Object(Vt.a)(-n,"int32"))),p=Object(Fn.a)([s,c],r.dtype);return Object(ye.a)(Object(fn.a)(Object(Tn.a)(Object(ye.a)(r,[-1,s,c])).map((function(e){return Object(An.a)(f,e,p)}))),a)}});var Dr=Object(j.b)({gramSchmidt_:function(e){var t;Array.isArray(e)?function(){t=!1,Object(A.b)(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){Object(A.b)(e[t].shape[0]===n,(function(){return"Gram-Schmidt: Non-unique lengths found in the input vectors: "+"(".concat(e[t].shape[0]," vs. ").concat(n,")")}))},a=1;a<e.length;++a)r(a)}():(t=!0,e=Object(cn.a)(e,e.shape[0],0).map((function(e){return Object(dn.a)(e,[0])}))),Object(A.b)(e.length<=e[0].shape[0],(function(){return"Gram-Schmidt: Number of vectors (".concat(e.length,") exceeds ")+"number of dimensions (".concat(e[0].shape[0],").")}));for(var n=[],r=e,a=function(e){n.push(ie.a.tidy((function(){var t=r[e];if(e>0)for(var a=0;a<e;++a){var i=Object(w.a)(Object(bn.a)(Object(w.a)(n[a],t)),n[a]);t=Object(st.a)(t,i)}return Object(ue.a)(t,Object(Wn.a)(t,"euclidean"))})))},i=0;i<e.length;++i)a(i);return t?Object(fn.a)(n,0):n}}),_r=n(44);function Mr(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ie.a.tidy((function(){Object(A.b)(2===e.shape.length,(function(){return"qr2d() requires a 2D Tensor, but got a ".concat(e.shape.length,"D Tensor.")}));for(var n=e.shape[0],r=e.shape[1],a=xe(n),i=Object(W.a)(e),o=On([[1]],[1,1]),s=Object(W.a)(o),c=n>=r?r:n,u=function(e){var t=i,c=s,u=a,l=ie.a.tidy((function(){var t=Object(N.a)(i,[e,e],[n-e,1]),c=Object(Wn.a)(t),u=Object(N.a)(i,[e,e],[1,1]),l=Object(An.a)(Object(Ne.a)(u,0),On([[-1]]),On([[1]])),d=Object(st.a)(u,Object(w.a)(l,c)),f=Object(ue.a)(t,d);s=1===f.shape[0]?Object(W.a)(o):Object(x.a)([o,Object(N.a)(f,[1,0],[f.shape[0]-1,f.shape[1]])],0);var p=Object(dt.a)(Object(ue.a)(Object(k.a)(l,d),c)),h=Object(N.a)(i,[e,0],[n-e,r]),b=Object(w.a)(p,s),m=Object(Bn.a)(s);if(0===e)i=Object(st.a)(h,Object(k.a)(b,Object(k.a)(m,h)));else{var v=Object(st.a)(h,Object(k.a)(b,Object(k.a)(m,h)));i=Object(x.a)([Object(N.a)(i,[0,0],[e,r]),v],0)}var g=Object(Bn.a)(b),y=Object(N.a)(a,[0,e],[n,a.shape[1]-e]);if(0===e)a=Object(st.a)(y,Object(k.a)(Object(k.a)(y,s),g));else{var O=Object(st.a)(y,Object(k.a)(Object(k.a)(y,s),g));a=Object(x.a)([Object(N.a)(a,[0,0],[n,e]),O],1)}return[s,i,a]})),d=Object(Zn.a)(l,3);s=d[0],i=d[1],a=d[2],Object(_r.b)([t,c,u])},l=0;l<c;++l)u(l);return!t&&n>r&&(a=Object(N.a)(a,[0,0],[n,r]),i=Object(N.a)(i,[0,0],[r,r])),[a,i]}))}var zr=Object(j.b)({qr_:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object(A.b)(e.rank>=2,(function(){return"qr() requires input tensor to have a rank >= 2, but got rank ".concat(e.rank)})),2===e.rank)return Mr(e,t);var n=e.shape.slice(0,e.shape.length-2).reduce((function(e,t){return e*t})),r=Object(Tn.a)(Object(ye.a)(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),a=[],i=[];r.forEach((function(e){var n=Mr(e,t),r=Object(Zn.a)(n,2),o=r[0],s=r[1];a.push(o),i.push(s)}));var o=Object(ye.a)(Object(fn.a)(a,0),e.shape),s=Object(ye.a)(Object(fn.a)(i,0),e.shape);return[o,s]}}),Lr=n(56);var Pr=Object(j.b)({computeWeightedLoss_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Lr.a.SUM_BY_NONZERO_WEIGHTS,r=Object(O.a)(e,"losses","computeWeightedLoss"),a=null;null!=t&&(a=Object(O.a)(t,"weights","computeWeightedLoss"));var i=null==a?r:Object(w.a)(r,a);if(n===Lr.a.NONE)return i;if(n===Lr.a.SUM)return Object(bn.a)(i);if(n===Lr.a.MEAN){if(null==a)return Object(Qe.a)(i);var o=r.size/a.size,s=Object(ue.a)(Object(bn.a)(i),Object(bn.a)(a));return o>1?Object(ue.a)(s,Object(Vt.a)(o)):s}if(n===Lr.a.SUM_BY_NONZERO_WEIGHTS){if(null==a)return Object(ue.a)(Object(bn.a)(i),Object(Vt.a)(r.size));var c=Object(w.a)(a,Object(Ze.a)(r.shape)),u=Object(L.a)(Object(bn.a)(Object(ft.a)(c,Object(Vt.a)(0))),"float32");return Object(ue.a)(Object(bn.a)(i),u)}throw Error("Unknown reduction: ".concat(n))}});var Br=Object(j.b)({absoluteDifference_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(O.a)(e,"labels","absoluteDifference"),o=Object(O.a)(t,"predictions","absoluteDifference"),s=null;null!=n&&(s=Object(O.a)(n,"weights","absoluteDifference")),Object(A.e)(i.shape,o.shape,"Error in absoluteDifference: ");var c=Object(a.a)(Object(st.a)(i,o));return Pr(c,s,r)}});var Wr=Object(j.b)({cosineDistance_:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Lr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(O.a)(e,"labels","cosineDistance"),o=Object(O.a)(t,"predictions","cosineDistance"),s=null;null!=r&&(s=Object(O.a)(r,"weights","cosineDistance")),Object(A.e)(i.shape,o.shape,"Error in cosineDistance: ");var c=Object(Vt.a)(1),u=Object(st.a)(c,Object(bn.a)(Object(w.a)(i,o),n,!0));return Pr(u,s,a)}});var Ur=Object(j.b)({hingeLoss_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lr.a.SUM_BY_NONZERO_WEIGHTS,a=Object(O.a)(e,"labels","hingeLoss"),i=Object(O.a)(t,"predictions","hingeLoss"),o=null;null!=n&&(o=Object(O.a)(n,"weights","hingeLoss")),Object(A.e)(a.shape,i.shape,"Error in hingeLoss: ");var s=Object(Vt.a)(1);a=Object(st.a)(Object(w.a)(Object(Vt.a)(2),a),s);var c=Object(Dt.a)(Object(st.a)(s,Object(w.a)(a,i)));return Pr(c,o,r)}});var Vr=Object(j.b)({huberLoss_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Lr.a.SUM_BY_NONZERO_WEIGHTS,o=Object(O.a)(e,"labels","huberLoss"),c=Object(O.a)(t,"predictions","huberLoss"),u=null;null!=n&&(u=Object(O.a)(n,"weights","huberLoss")),Object(A.e)(o.shape,c.shape,"Error in huberLoss: ");var l=Object(Vt.a)(r),d=Object(a.a)(Object(st.a)(c,o)),f=Object(nt.a)(d,l),p=Object(st.a)(d,f),h=Object(s.a)(Object(w.a)(Object(Vt.a)(.5),Object(ot.a)(f)),Object(w.a)(l,p));return Pr(h,u,i)}});var Hr=Object(j.b)({logLoss_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-7,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Lr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(O.a)(e,"labels","logLoss"),o=Object(O.a)(t,"predictions","logLoss"),c=null;null!=n&&(c=Object(O.a)(n,"weights","logLoss")),Object(A.e)(i.shape,o.shape,"Error in logLoss: ");var u=Object(Vt.a)(1),l=Object(Vt.a)(r),d=Object(dt.a)(Object(w.a)(i,Object(ze.a)(Object(s.a)(o,l)))),f=Object(w.a)(Object(st.a)(u,i),Object(ze.a)(Object(s.a)(Object(st.a)(u,o),l))),p=Object(st.a)(d,f);return Pr(p,c,a)}});var Gr=Object(j.b)({meanSquaredError_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lr.a.SUM_BY_NONZERO_WEIGHTS,a=Object(O.a)(e,"labels","meanSquaredError"),i=Object(O.a)(t,"predictions","meanSquaredError"),o=null;null!=n&&(o=Object(O.a)(n,"weights","meanSquaredError")),Object(A.e)(a.shape,i.shape,"Error in meanSquaredError: ");var s=Object(ln.a)(a,i);return Pr(s,o,r)}});function qr(e,t){var n=Object(O.a)(e,"labels","sigmoidCrossEntropyWithLogits"),r=Object(O.a)(t,"logits","sigmoidCrossEntropyWithLogits");Object(A.e)(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");var i=Object(Dt.a)(r),o=Object(w.a)(r,n),c=Object(Le.a)(Object(me.a)(Object(dt.a)(Object(a.a)(r))));return Object(s.a)(Object(st.a)(i,o),c)}var Kr=Object(j.b)({sigmoidCrossEntropy_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Lr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(O.a)(e,"multiClassLabels","sigmoidCrossEntropy"),o=Object(O.a)(t,"logits","sigmoidCrossEntropy"),c=null;if(null!=n&&(c=Object(O.a)(n,"weights","sigmoidCrossEntropy")),Object(A.e)(i.shape,o.shape,"Error in sigmoidCrossEntropy: "),r>0){var u=Object(Vt.a)(r),l=Object(Vt.a)(1),d=Object(Vt.a)(.5);i=Object(s.a)(Object(w.a)(i,Object(st.a)(l,u)),Object(w.a)(d,u))}var f=qr(i,o);return Pr(f,c,a)}});function Xr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-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 ".concat(t.rank," ")+"and dim was ".concat(n));var r=Object(Jn.a)((function(e,t,r){var a=Object(We.a)(t,[n],!0),i=Object(st.a)(Object(L.a)(t,"float32"),a);r([e,i]);var o=Object(dt.a)(Object(w.a)(i,e));return{value:Object(bn.a)(o,[n]),gradFunc:function(e,t){var r=Object(Zn.a)(t,2),a=r[0],i=r[1],o=Object(it.e)(e.shape,[n]);return[Object(w.a)(Object(ye.a)(e,o),Object(st.a)(Object(L.a)(a,"float32"),Object(me.a)(i))),Object(w.a)(Object(ye.a)(e,o),Object(st.a)(Object(me.a)(i),Object(L.a)(a,"float32")))]}}}));return r(e,t)}var Yr=Object(j.b)({softmaxCrossEntropy_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Lr.a.SUM_BY_NONZERO_WEIGHTS,i=Object(O.a)(e,"onehotLabels","softmaxCrossEntropy"),o=Object(O.a)(t,"logits","softmaxCrossEntropy"),c=null;if(null!=n&&(c=Object(O.a)(n,"weights","softmaxCrossEntropy")),Object(A.e)(i.shape,o.shape,"Error in softmaxCrossEntropy: "),r>0){var u=Object(Vt.a)(r),l=Object(Vt.a)(1),d=Object(Vt.a)(i.shape[1]);i=Object(s.a)(Object(w.a)(i,Object(st.a)(l,u)),Object(ue.a)(u,d))}var f=Xr(i,o);return Pr(f,c,a)}});var $r=Object(j.b)({sparseFillEmptyRows_:function(e,t,n,r){var a=Object(O.a)(e,"indices","sparseFillEmptyRows"),i=Object(O.a)(t,"values","sparseFillEmptyRows"),o=Object(O.a)(n,"denseShape","sparseFillEmptyRows"),s=Object(O.a)(r,"defaultValue","sparseFillEmptyRows",i.dtype);if(2!==a.rank)throw new Error("Indices should be Tensor2D but received shape\n ".concat(a.shape));if(1!==i.rank)throw new Error("Values should be Tensor1D but received shape ".concat(i.shape));if(1!==o.rank)throw new Error("Dense shape should be Tensor1D but received shape ".concat(o.shape));if(0!==s.rank)throw new Error("Default value should be a scalar but received shape ".concat(s.shape));var c={indices:a,values:i,denseShape:o,defaultValue:s},u=ie.a.runKernel(oe.Ic,c);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}});var Qr=Object(j.b)({sparseReshape_:function(e,t,n){var r=Object(O.a)(e,"inputIndices","sparseReshape"),a=Object(O.a)(t,"inputShape","sparseReshape"),i=Object(O.a)(n,"newShape","sparseReshape");if(2!==r.rank)throw new Error("Input indices should be Tensor2D but received shape\n ".concat(r.shape));if(1!==a.rank)throw new Error("Input shape should be Tensor1D but received shape ".concat(a.shape));if(1!==i.rank)throw new Error("New shape should be Tensor1D but received shape ".concat(i.shape));var o={inputIndices:r,inputShape:a,newShape:i},s=ie.a.runKernel(oe.Jc,o);return{outputIndices:s[0],outputShape:s[1]}}});var Zr=Object(j.b)({sparseSegmentMean_:function(e,t,n){var r=Object(O.a)(e,"data","sparseSegmentMean"),a=Object(O.a)(t,"indices","sparseSegmentMean"),i=Object(O.a)(n,"segmentIds","sparseSegmentMean");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error("Indices should be Tensor1D but received shape\n ".concat(a.shape));if(1!==i.rank)throw new Error("Segment ids should be Tensor1D but received shape\n ".concat(i.shape));var o={data:r,indices:a,segmentIds:i};return ie.a.runKernel(oe.Kc,o)}});var Jr=Object(j.b)({sparseSegmentSum_:function(e,t,n){var r=Object(O.a)(e,"data","sparseSegmentSum"),a=Object(O.a)(t,"indices","sparseSegmentSum"),i=Object(O.a)(n,"segmentIds","sparseSegmentSum");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error("Indices should be Tensor1D but received shape\n ".concat(a.shape));if(1!==i.rank)throw new Error("Segment ids should be Tensor1D but received shape\n ".concat(i.shape));var o={data:r,indices:a,segmentIds:i};return ie.a.runKernel(oe.Lc,o)}});var ea=Object(j.b)({stringNGrams_:function(e,t,n,r,a,i,o,s){var c=Object(O.a)(e,"data","stringNGrams","string");if("string"!==c.dtype)throw new Error("Data must be of datatype string");if(1!==c.shape.length)throw new Error("Data must be a vector, saw: ".concat(c.shape));var u=Object(O.a)(t,"dataSplits","stringNGrams");if("int32"!==u.dtype)throw new Error("Data splits must be of datatype int32");var l={separator:n,nGramWidths:r,leftPad:a,rightPad:i,padWidth:o,preserveShortSequences:s},d={data:c,dataSplits:u},f=ie.a.runKernel(oe.Tc,d,l);return{nGrams:f[0],nGramsSplits:f[1]}}});var ta=Object(j.b)({stringSplit_:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Object(O.a)(e,"input","stringSplit","string"),a=Object(O.a)(t,"delimiter","stringSplit","string");if(1!==r.rank)throw new Error("Input should be Tensor1D but received shape ".concat(r.shape));if(0!==a.rank)throw new Error("Delimiter should be a scalar but received shape ".concat(a.shape));var i={skipEmpty:n},o={input:r,delimiter:a},s=ie.a.runKernel(oe.Uc,o,i);return{indices:s[0],values:s[1],shape:s[2]}}});var na=Object(j.b)({stringToHashBucketFast_:function(e,t){var n=Object(O.a)(e,"input","stringToHashBucketFast","string"),r={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");var a={input:n};return ie.a.runKernel(oe.Vc,a,r)}}),ra={fft:rn.a,ifft:an.a,rfft:sn.a,irfft:on.a},aa={hammingWindow:lr,hannWindow:dr,frame:fr,stft:pr},ia={flipLeftRight:br,resizeNearestNeighbor:Tr.a,resizeBilinear:Cr.a,rotateWithOffset:mr,cropAndResize:hr,nonMaxSuppression:gr,nonMaxSuppressionAsync:xr,nonMaxSuppressionWithScore:kr,nonMaxSuppressionWithScoreAsync:jr,nonMaxSuppressionPadded:Sr,nonMaxSuppressionPaddedAsync:Ir,threshold:Ar,transform:Rr},oa={bandPart:Fr,gramSchmidt:Dr,qr:zr},sa={absoluteDifference:Br,computeWeightedLoss:Pr,cosineDistance:Wr,hingeLoss:Ur,huberLoss:Vr,logLoss:Hr,meanSquaredError:Gr,sigmoidCrossEntropy:Kr,softmaxCrossEntropy:Yr},ca={sparseFillEmptyRows:$r,sparseReshape:Qr,sparseSegmentMean:Zr,sparseSegmentSum:Jr},ua={stringNGrams:ea,stringSplit:ta,stringToHashBucketFast:na}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return m}));var r=n(6),a=n(5),i=n.n(a),o=n(12),s=n(7),c=n(11),u=n(15),l="tfjsflags",d=function(){function e(t){Object(s.a)(this,e),this.global=t,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=f,this.populateURLFlags()}return Object(c.a)(e,[{key:"setPlatform",value:function(e,t){null!=this.platform&&console.warn("Platform ".concat(this.platformName," has already been set. ")+"Overwriting the platform with ".concat(t,".")),this.platformName=e,this.platform=t}},{key:"registerFlag",value: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 ".concat(e,": ").concat(r,".")),this.set(e,r)}}},{key:"getAsync",value:function(){var e=Object(o.a)(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t in this.flags)){e.next=2;break}return e.abrupt("return",this.flags[t]);case 2:return e.next=4,this.evaluateFlag(t);case 4:return this.flags[t]=e.sent,e.abrupt("return",this.flags[t]);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"get",value:function(e){if(e in this.flags)return this.flags[e];var t=this.evaluateFlag(e);if(Object(u.x)(t))throw new Error("Flag ".concat(e," cannot be synchronously evaluated. ")+"Please use getAsync() instead.");return this.flags[e]=t,this.flags[e]}},{key:"getNumber",value:function(e){return this.get(e)}},{key:"getBool",value:function(e){return this.get(e)}},{key:"getFlags",value:function(){return this.flags}},{key:"features",get:function(){return this.flags}},{key:"set",value:function(e,t){if(null==this.flagRegistry[e])throw new Error("Cannot set flag ".concat(e," as it has not been registered."));this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}},{key:"evaluateFlag",value:function(e){if(null==this.flagRegistry[e])throw new Error("Cannot evaluate flag '".concat(e,"': no evaluation function found."));return this.flagRegistry[e].evaluationFn()}},{key:"setFlags",value:function(e){this.flags=Object.assign({},e)}},{key:"reset",value:function(){this.flags={},this.urlFlags={},this.populateURLFlags()}},{key:"populateURLFlags",value:function(){var e=this;if("undefined"!==typeof this.global&&"undefined"!==typeof this.global.location&&"undefined"!==typeof this.global.location.search){var t=this.getQueryParams(this.global.location.search);if(l in t)t.tfjsflags.split(",").forEach((function(t){var n=t.split(":"),a=Object(r.a)(n,2),i=a[0],o=a[1];e.urlFlags[i]=function(e,t){if("true"===(t=t.toLowerCase())||"false"===t)return"true"===t;if("".concat(+t)===t)return+t;throw new Error("Could not parse value flag value ".concat(t," for flag ").concat(e,"."))}(i,o)}))}}}]),e}();function f(e){var t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return p(t,r[0],r[1]),r.join("=")})),t}function p(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}function h(){return b}var b=null;function m(e){b=e}},function(e,t,n){"use strict";n.r(t),n.d(t,"makeTypesMatch",(function(){return o})),n.d(t,"assertTypesMatch",(function(){return s})),n.d(t,"isTensorInList",(function(){return c})),n.d(t,"getTensorsInContainer",(function(){return u}));var r=n(10),a=n(114),i=n(15);function o(e,t){if(e.dtype===t.dtype)return[e,t];var n=Object(a.b)(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function s(e,t){Object(i.b)(e.dtype===t.dtype,(function(){return"The dtypes of the first(".concat(e.dtype,") and")+" second(".concat(t.dtype,") input must match")}))}function c(e,t){return t.some((function(t){return t.id===e.id}))}function u(e){var t=[];return l(e,t,new Set),t}function l(e,t,n){if(null!=e)if(e instanceof r.a)t.push(e);else if(a=e,Array.isArray(a)||"object"===typeof a){var a,i=e;for(var o in i){var s=i[o];n.has(s)||(n.add(s),l(s,t,n))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(9),a=n(2),i=n(8);var o=Object(i.b)({square_:function(e){var t=Object(a.a)(e,"x","square");return r.a.runKernel("Square",{x:t},{})}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(8);var u=Object(c.b)({matMul_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=Object(s.a)(e,"a","matMul"),l=Object(s.a)(t,"b","matMul"),d=Object(o.makeTypesMatch)(u,l),f=Object(r.a)(d,2),p={a:u=f[0],b:l=f[1]},h={transposeA:n,transposeB:c};return a.a.runKernel(i.s,p,h)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(312);function a(e){if("string"!==typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({slice_:function(e,t,n){var o=Object(i.a)(e,"x","slice","string_or_numeric");if(0===o.rank)throw new Error("Slicing scalar is not possible");var s={x:o},c={begin:t,size:n};return r.a.runKernel(a.Ec,s,c)}})},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"h",(function(){return u})),n.d(t,"b",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"g",(function(){return f})),n.d(t,"f",(function(){return p})),n.d(t,"a",(function(){return h}));var r=n(9),a=n(38),i=n(10),o=n(39);function s(){return r.a}function c(){return r.a.memory()}function u(e,t){return r.a.tidy(e,t)}function l(e){Object(o.getTensorsInContainer)(e).forEach((function(e){return e.dispose()}))}function d(e){return r.a.keep(e)}function f(e){return r.a.setBackend(e)}function p(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return r.a.registerBackend(e,t,n)}function h(){return r.a.backend}Object(i.e)((function(e){Object(a.b)().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({neg_:function(e){var t={x:Object(i.a)(e,"x","neg")};return r.a.runKernel(a.Wb,t)}})},,function(e,t,n){"use strict";n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return d})),n.d(t,"e",(function(){return f}));var r=n(312);function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var a=e.substring(t+1,e.length-1).split(",");return{type:n,values:a=a.map((function(e){return parseFloat(e)}))}}function o(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=c(e),r=c(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function c(e){var t="hsl"===(e=i(e)).type?i(function(e){var t=(e=i(e)).values,n=t[0],r=t[1]/100,a=t[2]/100,s=r*Math.min(a,1-a),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return a-s*Math.max(Math.min(t-3,9-t,1),-1)},u="rgb",l=[Math.round(255*c(0)),Math.round(255*c(8)),Math.round(255*c(4))];return"hsla"===e.type&&(u+="a",l.push(t[3])),o({type:u,values:l})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return c(e)>.5?d(e,t):f(e,t)}function l(e,t){return e=i(e),t=a(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,o(e)}function d(e,t){if(e=i(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return o(e)}function f(e,t){if(e=i(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return o(e)}},function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return o})),n.d(t,"f",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"i",(function(){return v})),n.d(t,"h",(function(){return g})),n.d(t,"g",(function(){return y}));var r=n(6),a=n(21);function i(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NHWC",o=arguments.length>5?arguments[5]:void 0,s=e[3],u=[].concat(Object(a.a)(t),[s]),l=y(i);return c(e,u,n,o,r,null,null,l)}function o(e,t,n,a,i,o){var s,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"channelsLast",l=d(t),f=Object(r.a)(l,2),p=f[0],h=f[1];if("channelsLast"===u)s=[p,h,e[3],e[3]];else{if("channelsFirst"!==u)throw new Error("Unknown dataFormat ".concat(u));s=[p,h,e[1],e[1]]}return c(e,s,n,a,i,o,!1,u)}function s(e,t,n,a,i,o){var s,c,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"NDHWC",d=f(t),p=Object(r.a)(d,3),h=p[0],b=p[1],m=p[2];if("NDHWC"===l)c="channelsLast",s=[h,b,m,e[4],e[4]];else{if("NCDHW"!==l)throw new Error("Unknown dataFormat ".concat(l));c="channelsFirst",s=[h,b,m,e[1],e[1]]}return u(e,s,n,a,i,!1,c,o)}function c(e,t,n,a,i,o){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"channelsLast",u=-1,l=-1,f=-1,b=-1;if("channelsLast"===c){var m=Object(r.a)(e,4);u=m[0],l=m[1],f=m[2],b=m[3]}else{if("channelsFirst"!==c)throw new Error("Unknown dataFormat ".concat(c));var v=Object(r.a)(e,4);u=v[0],b=v[1],l=v[2],f=v[3]}var g,y=Object(r.a)(t,4),O=y[0],x=y[1],k=y[3],w=d(n),j=Object(r.a)(w,2),S=j[0],N=j[1],I=d(a),C=Object(r.a)(I,2),T=C[0],E=C[1],A=p(O,T),R=p(x,E),F=h(i,l,f,S,N,A,R,o,c),D=F.padInfo,_=F.outHeight,M=F.outWidth,z=s?k*b:k;return"channelsFirst"===c?g=[u,z,_,M]:"channelsLast"===c&&(g=[u,_,M,z]),{batchSize:u,dataFormat:c,inHeight:l,inWidth:f,inChannels:b,outHeight:_,outWidth:M,outChannels:z,padInfo:D,strideHeight:S,strideWidth:N,filterHeight:O,filterWidth:x,effectiveFilterHeight:A,effectiveFilterWidth:R,dilationHeight:T,dilationWidth:E,inShape:e,outShape:g,filterShape:t}}function u(e,t,n,a,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"channelsLast",c=arguments.length>7?arguments[7]:void 0,u=-1,l=-1,d=-1,h=-1,m=-1;if("channelsLast"===s){var v=Object(r.a)(e,5);u=v[0],l=v[1],d=v[2],h=v[3],m=v[4]}else{if("channelsFirst"!==s)throw new Error("Unknown dataFormat ".concat(s));var g=Object(r.a)(e,5);u=g[0],m=g[1],l=g[2],d=g[3],h=g[4]}var y,O=Object(r.a)(t,5),x=O[0],k=O[1],w=O[2],j=O[4],S=f(n),N=Object(r.a)(S,3),I=N[0],C=N[1],T=N[2],E=f(a),A=Object(r.a)(E,3),R=A[0],F=A[1],D=A[2],_=p(x,R),M=p(k,F),z=p(w,D),L=b(i,l,d,h,I,C,T,_,M,z,c),P=L.padInfo,B=L.outDepth,W=L.outHeight,U=L.outWidth,V=o?j*m:j;return"channelsFirst"===s?y=[u,V,B,W,U]:"channelsLast"===s&&(y=[u,B,W,U,V]),{batchSize:u,dataFormat:s,inDepth:l,inHeight:d,inWidth:h,inChannels:m,outDepth:B,outHeight:W,outWidth:U,outChannels:V,padInfo:P,strideDepth:I,strideHeight:C,strideWidth:T,filterDepth:x,filterHeight:k,filterWidth:w,effectiveFilterDepth:_,effectiveFilterHeight:M,effectiveFilterWidth:z,dilationDepth:R,dilationHeight:F,dilationWidth:D,inShape:e,outShape:y,filterShape:t}}function l(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=p(t,r);return Math.floor((e[0]*(n-1)-n+a)/2)}function d(e){return"number"===typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function f(e){return"number"===typeof e?[e,e,e]:e}function p(e,t){return t<=1?e:e+(e-1)*(t-1)}function h(e,t,n,r,a,i,o,s,c){var u,d,f;if("number"===typeof e){u={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};var p=function(e,t,n,r,a){null==r&&(r=l(e,t,n));var i=e[0],o=e[1];return[m((i-t+2*r)/n+1,a),m((o-t+2*r)/n+1,a)]}([t,n],i,r,e,s);d=p[0],f=p[1]}else if("same"===e){d=Math.ceil(t/r),f=Math.ceil(n/a);var h=Math.max(0,(d-1)*r+i-t),b=Math.max(0,(f-1)*a+o-n),v=Math.floor(h/2),g=h-v,y=Math.floor(b/2);u={top:v,bottom:g,left:y,right:b-y,type:"SAME"}}else if("valid"===e)u={top:0,bottom:0,left:0,right:0,type:"VALID"},d=Math.ceil((t-i+1)/r),f=Math.ceil((n-o+1)/a);else{if("object"!==typeof e)throw Error("Unknown padding parameter: ".concat(e));var O="channelsLast"===c?e[1][0]:e[2][0],x="channelsLast"===c?e[1][1]:e[2][1],k="channelsLast"===c?e[2][0]:e[3][0],w="channelsLast"===c?e[2][1]:e[3][1];u={top:O,bottom:x,left:k,right:w,type:0===O&&0===x&&0===k&&0===w?"VALID":"EXPLICIT"},d=m((t-i+O+x)/r+1,s),f=m((n-o+k+w)/a+1,s)}return{padInfo:u,outHeight:d,outWidth:f}}function b(e,t,n,r,a,i,o,s,c,u,d){var f,p,h,b;if("number"===typeof e){f={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};var v=function(e,t,n,r,a,i){null==a&&(a=l(e,t,r));var o=e[0],s=e[1],c=e[2];return[m((o-t+2*a)/r+1,i),m((s-t+2*a)/r+1,i),m((c-t+2*a)/r+1,i),n]}([t,n,r,1],s,1,a,e,d);p=v[0],h=v[1],b=v[2]}else if("same"===e){var g=((p=Math.ceil(t/a))-1)*a+s-t,y=((h=Math.ceil(n/i))-1)*i+c-n,O=((b=Math.ceil(r/o))-1)*o+u-r,x=Math.floor(g/2),k=g-x,w=Math.floor(y/2),j=y-w,S=Math.floor(O/2);f={top:w,bottom:j,left:S,right:O-S,front:x,back:k,type:"SAME"}}else{if("valid"!==e)throw Error("Unknown padding parameter: ".concat(e));f={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},p=Math.ceil((t-s+1)/a),h=Math.ceil((n-c+1)/i),b=Math.ceil((r-u+1)/o)}return{padInfo:f,outDepth:p,outHeight:h,outWidth:b}}function m(e,t){if(!t)return Math.trunc(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 ".concat(t))}}function v(e){var t=d(e),n=Object(r.a)(t,3),a=n[0],i=n[1],o=n[2];return 1===a&&1===i&&1===o}function g(e,t){return v(e)||v(t)}function y(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error("Unknown dataFormat ".concat(e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(92),c=n(8);var u=Object(c.b)({concat_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(o.b)(e.length>=1,(function(){return"Pass at least one tensor to concat"}));var n=Object(i.b)(e,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((function(e){if("complex64"!==e.dtype)throw new Error("Cannot concatenate complex64 tensors with a tensor\n with dtype ".concat(e.dtype,". "))})),1===n.length)return Object(s.a)(n[0]);var c=n,u={axis:t};return r.a.runKernel(a.B,c,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(4),a=n(130);function i(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(a.a)(e,n),Object(a.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),a=n(3),i=n(2),o=n(125),s=n(34),c=n(8);var u=Object(c.b)({where_:function(e,t,n){var c=Object(i.a)(t,"a","where"),u=Object(i.a)(n,"b","where"),l=Object(i.a)(e,"condition","where","bool"),d=Object(s.a)(Object(s.a)(l.shape,c.shape),u.shape),f={condition:Object(o.a)(l,d),t:Object(o.a)(c,d),e:Object(o.a)(u,d)};return r.a.runKernel(a.yc,f)}})},function(e,t,n){"use strict";(function(e){n.d(t,"f",(function(){return f})),n.d(t,"e",(function(){return h})),n.d(t,"a",(function(){return g})),n.d(t,"b",(function(){return y})),n.d(t,"d",(function(){return O})),n.d(t,"c",(function(){return x})),n.d(t,"i",(function(){return k})),n.d(t,"g",(function(){return w})),n.d(t,"h",(function(){return S}));var r=n(6),a=n(5),i=n.n(a),o=n(20),s=n(12),c=n(81),u=n(105),l=n(15),d=n(183);function f(e,t){return p.apply(this,arguments)}function p(){return(p=Object(s.a)(i.a.mark((function e(t,n){var r,a,o,c,u,l;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=[],a=[],o=Array.isArray(t)?t.map((function(e){return e.name})):Object.keys(t),c=function(e){var c=o[e],u=Array.isArray(t)?t[e].tensor:t[c];if("float32"!==u.dtype&&"int32"!==u.dtype&&"bool"!==u.dtype&&"string"!==u.dtype&&"complex64"!==u.dtype)throw new Error("Unsupported dtype in weight '".concat(c,"': ").concat(u.dtype));var l={name:c,shape:u.shape,dtype:u.dtype};if("string"===u.dtype){var d=new Promise(function(){var e=Object(s.a)(i.a.mark((function e(t){var n,r,a,o,s,c,l;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.bytes();case 2:for(n=e.sent,r=n.reduce((function(e,t){return e+t.length}),0)+4*n.length,a=new Uint8Array(r),o=0,s=0;s<n.length;s++)c=n[s],l=new Uint8Array(new Uint32Array([c.length]).buffer),a.set(l,o),o+=4,a.set(c,o),o+=c.length;t(a);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());a.push(d)}else a.push(u.data());null!=n&&(l.group=n),r.push(l)},u=0;u<o.length;++u)c(u);return e.next=7,Promise.all(a);case 7:return l=e.sent,e.abrupt("return",{data:b(l),specs:r});case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e,t){var n,r,a={},i=0,s=Object(o.a)(t);try{for(s.s();!(r=s.n()).done;){var f=r.value,p=f.name,h=f.dtype,b=f.shape,m=Object(l.O)(b),v=void 0;if("quantization"in f){var g=f.quantization;if("uint8"===g.dtype||"uint16"===g.dtype){if(!("min"in g)||!("scale"in g))throw new Error("Weight ".concat(f.name," with quantization ").concat(g.dtype," ")+"doesn't have corresponding metadata min and scale.")}else{if("float16"!==g.dtype)throw new Error("Weight ".concat(f.name," has unknown ")+"quantization dtype ".concat(g.dtype,". ")+"Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.");if("float32"!==h)throw new Error("Weight ".concat(f.name," is quantized with ").concat(g.dtype," ")+"which only supports weights of type float32 not ".concat(h,"."))}var y=d.a[g.dtype],O=e.slice(i,i+m*y),x="uint8"===g.dtype?new Uint8Array(O):new Uint16Array(O);if("float32"===h)if("uint8"===g.dtype||"uint16"===g.dtype){v=new Float32Array(x.length);for(var k=0;k<x.length;k++){var w=x[k];v[k]=w*g.scale+g.min}}else{if("float16"!==g.dtype)throw new Error("Unsupported quantization type ".concat(g.dtype," ")+"for weight type float32.");void 0===n&&(n=N()),v=n(x)}else{if("int32"!==h)throw new Error("Unsupported dtype in weight '".concat(p,"': ").concat(h));if("uint8"!==g.dtype&&"uint16"!==g.dtype)throw new Error("Unsupported quantization type ".concat(g.dtype," ")+"for weight type int32.");v=new Int32Array(x.length);for(var j=0;j<x.length;j++){var S=x[j];v[j]=Math.round(S*g.scale+g.min)}}i+=m*y}else if("string"===h){var I=Object(l.O)(f.shape);v=[];for(var C=0;C<I;C++){var T=new Uint32Array(e.slice(i,i+4))[0];i+=4;var E=new Uint8Array(e.slice(i,i+T));v.push(E),i+=T}}else{var A=d.a[h],R=e.slice(i,i+m*A);if("float32"===h)v=new Float32Array(R);else if("int32"===h)v=new Int32Array(R);else if("bool"===h)v=new Uint8Array(R);else{if("complex64"!==h)throw new Error("Unsupported dtype in weight '".concat(p,"': ").concat(h));v=new Float32Array(R);for(var F=new Float32Array(v.length/2),D=new Float32Array(v.length/2),_=0;_<F.length;_++)F[_]=v[2*_],D[_]=v[2*_+1];var M=Object(u.a)(F,b,"float32"),z=Object(u.a)(D,b,"float32");a[p]=Object(c.a)(M,z),M.dispose(),z.dispose()}i+=m*A}"complex64"!==h&&(a[p]=Object(u.a)(v,b,h))}}catch(L){s.e(L)}finally{s.f()}return a}function b(e){if(null===e)throw new Error("Invalid input value: ".concat(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: ".concat(e.constructor.name))}));var r=new Uint8Array(t),a=0;return n.forEach((function(e){r.set(new Uint8Array(e.buffer),a),a+=e.byteLength})),r.buffer}var m="undefined"!==typeof e&&("undefined"===typeof Blob||"undefined"===typeof atob||"undefined"===typeof btoa);function v(t){return m?e.byteLength(t):new Blob([t]).size}function g(t){if(m)return e.from(t).toString("base64");for(var n=new Uint8Array(t),r="",a=0,i=n.length;a<i;a++)r+=String.fromCharCode(n[a]);return btoa(r)}function y(t){if(m){var n=e.from(t,"base64");return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}for(var r=atob(t),a=new Uint8Array(r.length),i=0;i<r.length;++i)a.set([r.charCodeAt(i)],i);return a.buffer}function O(e){if(1===e.length)return e[0];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 x(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);var t=e.split("/");return t[t.length-1]}function k(e,t){var n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}function w(e,t){return j.apply(this,arguments)}function j(){return(j=Object(s.a)(i.a.mark((function e(t,n){var a,o,s,c,u;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy},null!=t.trainingConfig&&(a.trainingConfig=t.trainingConfig),null==t.weightsManifest){e.next=11;break}return e.next=5,n(t.weightsManifest);case 5:o=e.sent,s=Object(r.a)(o,2),c=s[0],u=s[1],a.weightSpecs=c,a.weightData=u;case 11:return null!=t.signature&&(a.signature=t.signature),null!=t.userDefinedMetadata&&(a.userDefinedMetadata=t.userDefinedMetadata),null!=t.modelInitializer&&(a.modelInitializer=t.modelInitializer),e.abrupt("return",a);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(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:v(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:v(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:e.weightData.byteLength}}function N(){var e=function(){var e=function(e){for(var t=e<<13,n=0;0===(8388608&t);)n-=8388608,t<<=1;return(t&=-8388609)|n+947912704},t=new Uint32Array(2048);t[0]=0;for(var n=1;n<1024;n++)t[n]=e(n);for(var r=1024;r<2048;r++)t[r]=939524096+(r-1024<<13);return t}(),t=function(){var e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(var t=1;t<31;t++)e[t]=t<<23;for(var n=33;n<63;n++)e[n]=2147483648+(n-32<<23);return e}(),n=function(){for(var e=new Uint32Array(64),t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return function(r){for(var a=new ArrayBuffer(4*r.length),i=new Uint32Array(a),o=0;o<r.length;o++){var s=r[o],c=e[n[s>>10]+(1023&s)]+t[s>>10];i[o]=c}return new Float32Array(a)}}}).call(this,n(239).Buffer)},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(325)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i.Dd})),n.d(t,"d",(function(){return i.Zd})),n.d(t,"f",(function(){return i.lf})),n.d(t,"g",(function(){return i.pf})),n.d(t,"c",(function(){return i.Pd})),n.d(t,"e",(function(){return pd})),n.d(t,"b",(function(){return a}));var r={};n.r(r),n.d(r,"abs",(function(){return Cl.b})),n.d(r,"acos",(function(){return Cl.c})),n.d(r,"acosh",(function(){return Cl.d})),n.d(r,"add",(function(){return Cl.e})),n.d(r,"addN",(function(){return Cl.f})),n.d(r,"all",(function(){return Cl.g})),n.d(r,"any",(function(){return Cl.h})),n.d(r,"argMax",(function(){return Cl.i})),n.d(r,"argMin",(function(){return Cl.j})),n.d(r,"asin",(function(){return Cl.k})),n.d(r,"asinh",(function(){return Cl.l})),n.d(r,"atan",(function(){return Cl.m})),n.d(r,"atan2",(function(){return Cl.n})),n.d(r,"atanh",(function(){return Cl.o})),n.d(r,"avgPool",(function(){return Cl.p})),n.d(r,"avgPool3d",(function(){return Cl.q})),n.d(r,"basicLSTMCell",(function(){return Cl.r})),n.d(r,"batchToSpaceND",(function(){return Cl.w})),n.d(r,"batchNorm",(function(){return Cl.s})),n.d(r,"batchNorm2d",(function(){return Cl.t})),n.d(r,"batchNorm3d",(function(){return Cl.u})),n.d(r,"batchNorm4d",(function(){return Cl.v})),n.d(r,"bincount",(function(){return Cl.x})),n.d(r,"broadcastTo",(function(){return Cl.z})),n.d(r,"buffer",(function(){return Cl.A})),n.d(r,"cast",(function(){return Cl.B})),n.d(r,"ceil",(function(){return Cl.C})),n.d(r,"clipByValue",(function(){return Cl.D})),n.d(r,"clone",(function(){return Cl.E})),n.d(r,"complex",(function(){return Cl.F})),n.d(r,"concat",(function(){return Cl.G})),n.d(r,"concat1d",(function(){return Cl.H})),n.d(r,"concat2d",(function(){return Cl.I})),n.d(r,"concat3d",(function(){return Cl.J})),n.d(r,"concat4d",(function(){return Cl.K})),n.d(r,"conv1d",(function(){return Cl.L})),n.d(r,"conv2d",(function(){return Cl.M})),n.d(r,"conv2dTranspose",(function(){return Cl.N})),n.d(r,"conv3d",(function(){return Cl.O})),n.d(r,"conv3dTranspose",(function(){return Cl.P})),n.d(r,"cos",(function(){return Cl.Q})),n.d(r,"cosh",(function(){return Cl.R})),n.d(r,"cumsum",(function(){return Cl.T})),n.d(r,"denseBincount",(function(){return Cl.U})),n.d(r,"depthToSpace",(function(){return Cl.V})),n.d(r,"depthwiseConv2d",(function(){return Cl.W})),n.d(r,"diag",(function(){return Cl.X})),n.d(r,"dilation2d",(function(){return Cl.Y})),n.d(r,"div",(function(){return Cl.Z})),n.d(r,"divNoNan",(function(){return Cl.ab})),n.d(r,"dot",(function(){return Cl.bb})),n.d(r,"einsum",(function(){return Cl.db})),n.d(r,"elu",(function(){return Cl.eb})),n.d(r,"equal",(function(){return Cl.gb})),n.d(r,"erf",(function(){return Cl.hb})),n.d(r,"exp",(function(){return Cl.ib})),n.d(r,"expandDims",(function(){return Cl.jb})),n.d(r,"expm1",(function(){return Cl.kb})),n.d(r,"eye",(function(){return Cl.lb})),n.d(r,"fill",(function(){return Cl.nb})),n.d(r,"floor",(function(){return Cl.ob})),n.d(r,"floorDiv",(function(){return Cl.pb})),n.d(r,"gather",(function(){return Cl.rb})),n.d(r,"greater",(function(){return Cl.tb})),n.d(r,"greaterEqual",(function(){return Cl.ub})),n.d(r,"imag",(function(){return Cl.wb})),n.d(r,"isFinite",(function(){return Cl.Ab})),n.d(r,"isInf",(function(){return Cl.Bb})),n.d(r,"isNaN",(function(){return Cl.Cb})),n.d(r,"leakyRelu",(function(){return Cl.Db})),n.d(r,"less",(function(){return Cl.Eb})),n.d(r,"lessEqual",(function(){return Cl.Fb})),n.d(r,"linspace",(function(){return Cl.Hb})),n.d(r,"localResponseNormalization",(function(){return Cl.Ib})),n.d(r,"log",(function(){return Cl.Jb})),n.d(r,"log1p",(function(){return Cl.Kb})),n.d(r,"logSigmoid",(function(){return Cl.Lb})),n.d(r,"logSoftmax",(function(){return Cl.Mb})),n.d(r,"logSumExp",(function(){return Cl.Nb})),n.d(r,"logicalAnd",(function(){return Cl.Ob})),n.d(r,"logicalNot",(function(){return Cl.Pb})),n.d(r,"logicalOr",(function(){return Cl.Qb})),n.d(r,"logicalXor",(function(){return Cl.Rb})),n.d(r,"matMul",(function(){return Cl.Tb})),n.d(r,"max",(function(){return Cl.Ub})),n.d(r,"maxPool",(function(){return Cl.Vb})),n.d(r,"maxPool3d",(function(){return Cl.Wb})),n.d(r,"maxPoolWithArgmax",(function(){return Cl.Xb})),n.d(r,"maximum",(function(){return Cl.Yb})),n.d(r,"mean",(function(){return Cl.Zb})),n.d(r,"meshgrid",(function(){return Cl.ac})),n.d(r,"min",(function(){return Cl.bc})),n.d(r,"minimum",(function(){return Cl.cc})),n.d(r,"mirrorPad",(function(){return Cl.dc})),n.d(r,"mod",(function(){return Cl.ec})),n.d(r,"moments",(function(){return Cl.fc})),n.d(r,"mul",(function(){return Cl.hc})),n.d(r,"multiRNNCell",(function(){return Cl.ic})),n.d(r,"multinomial",(function(){return Cl.jc})),n.d(r,"neg",(function(){return Cl.kc})),n.d(r,"notEqual",(function(){return Cl.mc})),n.d(r,"oneHot",(function(){return Cl.nc})),n.d(r,"ones",(function(){return Cl.oc})),n.d(r,"onesLike",(function(){return Cl.pc})),n.d(r,"outerProduct",(function(){return Cl.rc})),n.d(r,"pad",(function(){return Cl.sc})),n.d(r,"pad1d",(function(){return Cl.tc})),n.d(r,"pad2d",(function(){return Cl.uc})),n.d(r,"pad3d",(function(){return Cl.vc})),n.d(r,"pad4d",(function(){return Cl.wc})),n.d(r,"pool",(function(){return Cl.xc})),n.d(r,"pow",(function(){return Cl.yc})),n.d(r,"prelu",(function(){return Cl.zc})),n.d(r,"print",(function(){return Cl.Ac})),n.d(r,"prod",(function(){return Cl.Bc})),n.d(r,"rand",(function(){return Cl.Cc})),n.d(r,"randomGamma",(function(){return Cl.Dc})),n.d(r,"randomNormal",(function(){return Cl.Ec})),n.d(r,"randomUniform",(function(){return Cl.Fc})),n.d(r,"range",(function(){return Cl.Gc})),n.d(r,"real",(function(){return Cl.Hc})),n.d(r,"reciprocal",(function(){return Cl.Ic})),n.d(r,"relu",(function(){return Cl.Jc})),n.d(r,"relu6",(function(){return Cl.Kc})),n.d(r,"reshape",(function(){return Cl.Lc})),n.d(r,"reverse",(function(){return Cl.Mc})),n.d(r,"reverse1d",(function(){return Cl.Nc})),n.d(r,"reverse2d",(function(){return Cl.Oc})),n.d(r,"reverse3d",(function(){return Cl.Pc})),n.d(r,"reverse4d",(function(){return Cl.Qc})),n.d(r,"round",(function(){return Cl.Sc})),n.d(r,"rsqrt",(function(){return Cl.Tc})),n.d(r,"scalar",(function(){return Cl.Uc})),n.d(r,"selu",(function(){return Cl.Wc})),n.d(r,"separableConv2d",(function(){return Cl.Xc})),n.d(r,"setdiff1dAsync",(function(){return Cl.Yc})),n.d(r,"sigmoid",(function(){return Cl.Zc})),n.d(r,"sign",(function(){return Cl.ad})),n.d(r,"sin",(function(){return Cl.cd})),n.d(r,"sinh",(function(){return Cl.dd})),n.d(r,"slice",(function(){return Cl.ed})),n.d(r,"slice1d",(function(){return Cl.fd})),n.d(r,"slice2d",(function(){return Cl.gd})),n.d(r,"slice3d",(function(){return Cl.hd})),n.d(r,"slice4d",(function(){return Cl.id})),n.d(r,"softmax",(function(){return Cl.jd})),n.d(r,"softplus",(function(){return Cl.kd})),n.d(r,"spaceToBatchND",(function(){return Cl.ld})),n.d(r,"fft",(function(){return Cl.mb})),n.d(r,"ifft",(function(){return Cl.vb})),n.d(r,"irfft",(function(){return Cl.zb})),n.d(r,"rfft",(function(){return Cl.Rc})),n.d(r,"split",(function(){return Cl.pd})),n.d(r,"sqrt",(function(){return Cl.qd})),n.d(r,"square",(function(){return Cl.rd})),n.d(r,"squaredDifference",(function(){return Cl.sd})),n.d(r,"squeeze",(function(){return Cl.td})),n.d(r,"stack",(function(){return Cl.ud})),n.d(r,"step",(function(){return Cl.vd})),n.d(r,"stridedSlice",(function(){return Cl.wd})),n.d(r,"sub",(function(){return Cl.yd})),n.d(r,"sum",(function(){return Cl.zd})),n.d(r,"tan",(function(){return Cl.Ad})),n.d(r,"tanh",(function(){return Cl.Bd})),n.d(r,"tensor",(function(){return Cl.Cd})),n.d(r,"tensor1d",(function(){return Cl.Dd})),n.d(r,"tensor2d",(function(){return Cl.Ed})),n.d(r,"tensor3d",(function(){return Cl.Fd})),n.d(r,"tensor4d",(function(){return Cl.Gd})),n.d(r,"tensor5d",(function(){return Cl.Hd})),n.d(r,"tensor6d",(function(){return Cl.Id})),n.d(r,"tile",(function(){return Cl.Jd})),n.d(r,"topk",(function(){return Cl.Kd})),n.d(r,"truncatedNormal",(function(){return Cl.Md})),n.d(r,"unique",(function(){return Cl.Nd})),n.d(r,"unsortedSegmentSum",(function(){return Cl.Od})),n.d(r,"unstack",(function(){return Cl.Pd})),n.d(r,"variable",(function(){return Cl.Qd})),n.d(r,"where",(function(){return Cl.Rd})),n.d(r,"whereAsync",(function(){return Cl.Sd})),n.d(r,"zeros",(function(){return Cl.Td})),n.d(r,"zerosLike",(function(){return Cl.Ud})),n.d(r,"booleanMaskAsync",(function(){return Cl.y})),n.d(r,"transpose",(function(){return Cl.Ld})),n.d(r,"norm",(function(){return Cl.lc})),n.d(r,"movingAverage",(function(){return Cl.gc})),n.d(r,"scatterND",(function(){return Cl.Vc})),n.d(r,"sparseToDense",(function(){return Cl.nd})),n.d(r,"gatherND",(function(){return Cl.sb})),n.d(r,"dropout",(function(){return Cl.cb})),n.d(r,"enclosingPowerOfTwo",(function(){return Cl.fb})),n.d(r,"cosineWindow",(function(){return Cl.S})),n.d(r,"inTopKAsync",(function(){return Cl.yb})),n.d(r,"op",(function(){return Cl.qc})),n.d(r,"OP_SCOPE_SUFFIX",(function(){return Cl.a})),n.d(r,"image",(function(){return Cl.xb})),n.d(r,"linalg",(function(){return Cl.Gb})),n.d(r,"losses",(function(){return Cl.Sb})),n.d(r,"spectral",(function(){return Cl.od})),n.d(r,"fused",(function(){return Cl.qb})),n.d(r,"signal",(function(){return Cl.bd})),n.d(r,"sparse",(function(){return Cl.md})),n.d(r,"string",(function(){return Cl.xd}));var a={};n.r(a),n.d(a,"array",(function(){return Od})),n.d(a,"Dataset",(function(){return gd})),n.d(a,"zip",(function(){return xd})),n.d(a,"CSVDataset",(function(){return Ed})),n.d(a,"TextLineDataset",(function(){return wd})),n.d(a,"csv",(function(){return Wd})),n.d(a,"func",(function(){return Ud})),n.d(a,"generator",(function(){return Vd})),n.d(a,"microphone",(function(){return qd})),n.d(a,"webcam",(function(){return Hd})),n.d(a,"FileDataSource",(function(){return Pd})),n.d(a,"URLDataSource",(function(){return Bd})),n.d(a,"version_data",(function(){return Xd}));var i=n(0),o=n(6),s=n(3),c=n(24),u=n(18),l=n(102),d={kernelName:s.a,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(e,Object(l.a)(Object(c.a)(n,"float32"),-1))}}}},f=n(31),p=n(45),h=n(33),b=n(58),m=n(40),v=n(29),g={kernelName:s.b,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){var t=Object(m.a)(Object(c.a)(n,"float32")),r=Object(b.a)(Object(v.a)(Object(h.a)(1),t));return Object(p.a)(Object(f.a)(e,r))}}}},y={kernelName:s.c,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){var t=Object(b.a)(Object(v.a)(Object(m.a)(Object(c.a)(n,"float32")),1));return Object(f.a)(e,t)}}}},O=n(34),x=n(13),k=n(32),w={kernelName:s.d,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1],i=O.a(r.shape,a.shape);return{a:function(){var t=e,n=O.c(r.shape,i);return n.length>0&&(t=Object(k.a)(t,n)),Object(x.a)(t,r.shape)},b:function(){var t=e,n=O.c(a.shape,i);return n.length>0&&(t=Object(k.a)(t,n)),Object(x.a)(t,a.shape)}}}},j={kernelName:s.e,saveAllInputs:!0,gradFunc:function(e,t){var n={};return t.forEach((function(t,r){n[r]=function(){return e.clone()}})),n}},S=n(36),N={kernelName:s.h,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(S.a)(n)}}}},I={kernelName:s.i,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(S.a)(n)}}}},C={kernelName:s.j,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(f.a)(e,Object(b.a)(Object(v.a)(Object(h.a)(1),Object(m.a)(Object(c.a)(n,"float32")))))}}}},T=n(27),E={kernelName:s.k,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){var t=Object(b.a)(Object(T.a)(Object(h.a)(1),Object(m.a)(Object(c.a)(n,"float32"))));return Object(f.a)(e,t)}}}},A={kernelName:s.m,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1],i=Object(O.a)(r.shape,a.shape);return{a:function(){var t=Object(T.a)(Object(m.a)(r),Object(m.a)(a)),n=Object(u.a)(e,Object(f.a)(a,t)),o=Object(O.c)(r.shape,i);return o.length>0&&(n=Object(k.a)(n,o)),Object(x.a)(n,r.shape)},b:function(){var t=Object(T.a)(Object(m.a)(r),Object(m.a)(a)),n=Object(p.a)(Object(u.a)(e,Object(f.a)(r,t))),o=Object(O.c)(a.shape,i);return o.length>0&&(n=Object(k.a)(n,o)),Object(x.a)(n,a.shape)}}}},R={kernelName:s.l,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(f.a)(e,Object(T.a)(Object(m.a)(Object(c.a)(n,"float32")),1))}}}},F={kernelName:s.n,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(f.a)(e,Object(v.a)(Object(h.a)(1),Object(m.a)(Object(c.a)(n,"float32"))))}}}},D=n(9),_=n(2),M=n(15),z=n(8);var L=Object(z.b)({avgPool3dGrad_:function(e,t,n,r,a,i){var o=Object(_.a)(e,"dy","avgPool3dGrad"),c=Object(_.a)(t,"input","avgPool3dGrad"),u=o,l=c,d=!1;4===c.rank&&(d=!0,u=Object(x.a)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),l=Object(x.a)(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]])),M.b(5===u.rank,(function(){return"Error in avgPool3dGrad: dy must be rank 5 but got rank "+"".concat(u.rank,".")})),M.b(5===l.rank,(function(){return"Error in avgPool3dGrad: input must be rank 5 but got rank "+"".concat(l.rank,".")})),null!=i&&M.b(M.v(a),(function(){return"Error in avgPool3dGrad: pad must be an integer when "+"using, dimRoundingMode ".concat(i," but got pad ").concat(a,".")}));var f={dy:u,input:l},p={filterSize:n,strides:r,pad:a,dimRoundingMode:i},h=D.a.runKernel(s.q,f,p);return d?Object(x.a)(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}}),P={kernelName:s.p,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=n.filterSize,i=n.strides,s=n.pad,c=n.dimRoundingMode;return{x:function(){return L(e,r,a,i,s,c)}}}};var B=Object(z.b)({avgPoolGrad_:function(e,t,n,r,a){var i=Object(_.a)(e,"dy","avgPoolGrad"),o=Object(_.a)(t,"input","avgPoolGrad");M.b(o.rank===i.rank,(function(){return"Rank of input (".concat(o.rank,") does not match rank of dy (").concat(i.rank,")")}));var c=o,u=i,l=!1;3===o.rank&&(l=!0,c=Object(x.a)(o,[1,o.shape[0],o.shape[1],o.shape[2]]),u=Object(x.a)(i,[1,i.shape[0],i.shape[1],i.shape[2]])),M.b(4===u.rank,(function(){return"Error in avgPoolGrad: dy must be rank 4 but got rank "+"".concat(u.rank,".")})),M.b(4===c.rank,(function(){return"Error in avgPoolGrad: input must be rank 4 but got rank "+"".concat(c.rank,".")}));var d={dy:u,input:c},f={filterSize:n,strides:r,pad:a},p=D.a.runKernel(s.r,d,f);return l?Object(x.a)(p,[p.shape[1],p.shape[2],p.shape[3]]):p}}),W={kernelName:s.o,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=n.filterSize,i=n.strides,s=n.pad;return{x:function(){return B(e,r,a,i,s)}}}},U=n(41),V={kernelName:s.s,inputsToSave:["a","b"],gradFunc:function(e,t,n){var r=Object(o.a)(t,2),a=r[0],i=r[1],s=n.transposeA,c=n.transposeB;return s||c?!s&&c?{a:function(){return Object(U.a)(e,i,!1,!1)},b:function(){return Object(U.a)(e,a,!0,!1)}}:s&&!c?{a:function(){return Object(U.a)(i,e,!1,!0)},b:function(){return Object(U.a)(a,e,!1,!1)}}:{a:function(){return Object(U.a)(i,e,!0,!0)},b:function(){return Object(U.a)(e,a,!0,!0)}}:{a:function(){return Object(U.a)(e,i,!1,!0)},b:function(){return Object(U.a)(a,e,!0,!1)}}}},H=n(122),G={kernelName:s.t,gradFunc:function(e,t,n){var r=n.blockShape,a=n.crops;return{x:function(){return Object(H.a)(e,r,a)}}}},q={kernelName:s.v,gradFunc:function(e,t,n){for(var r=n,a=r.inputShape,i=r.shape,o=Array.from(i),s=a.length-1;s>=0;s--)if(a[s]===i[s])o[s]=1;else if(1!==a[s])throw new Error("broadcastTo(): [".concat(a,"] cannot be broadcast to [").concat(i,"]."));for(var c=[],u=0;u<o.length;u++)o[u]>1&&c.push(u);return{x:function(){return Object(k.a)(e,c,!0)}}}},K={kernelName:s.w,gradFunc:function(e){return{x:function(){return e.clone()}}}},X={kernelName:s.x,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},Y=n(91),$=n(76),Q=n(82),Z=n(51),J={kernelName:s.y,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=n.clipValueMin,i=n.clipValueMax;return{x:function(){return Object(Z.a)(Object(Q.a)(Object(Y.a)(r,a),Object($.a)(r,i)),e,Object(S.a)(e))}}}},ee={kernelName:s.A,inputsToSave:["x"],gradFunc:d.gradFunc},te=n(83),ne={kernelName:s.B,saveAllInputs:!0,gradFunc:function(e,t,n){var r=t.map((function(e){return e.shape})),a=n.axis,i=Object(M.I)(a,t[0].shape)[0],o=r.map((function(e){return e[i]}));return Object(te.a)(e,o,i).map((function(e){return function(){return e}}))}},re=n(167),ae=n(165),ie=n(48),oe={kernelName:s.C,inputsToSave:["x","filter"],gradFunc:function(e,t,n){var r=Object(o.a)(t,2),a=r[0],i=r[1],s=n.dilations,c=n.strides,u=n.pad,l=n.dataFormat;return M.b(ie.i(s),(function(){return"Error in gradient of conv2D: dilation rates greater than 1 "+"are not yet supported in gradients. Got dilations '".concat(s,"'")})),{x:function(){return Object(ae.a)(a.shape,e,i,c,u,l)},filter:function(){return Object(re.a)(a,e,i.shape,c,u,l)}}}},se=n(90),ce={kernelName:s.E,inputsToSave:["dy","filter"],gradFunc:function(e,t,n){var r=Object(o.a)(t,2),a=r[0],i=r[1],s=n.strides,c=n.pad,u=n.dataFormat,l=n.dimRoundingMode;return{dy:function(){return Object(se.a)(e,i,s,c,u,1,l)},filter:function(){return Object(re.a)(e,a,i.shape,s,c,u,l)}}}};var ue=Object(z.b)({conv3DBackpropFilter_:function(e,t,n,r,a){var i=e;4===e.rank&&(i=Object(x.a)(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));var o=t;4===o.rank&&(o=Object(x.a)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),M.b(5===i.rank,(function(){return"Error in conv3dDerFilter: input must be rank 5, but got shape "+"".concat(i.shape,".")})),M.b(5===o.rank,(function(){return"Error in conv3dDerFilter: dy must be rank 5, but got shape "+"".concat(o.shape,".")})),M.b(5===n.length,(function(){return"Error in conv3dDerFilter: filterShape must be length 5, but got "+"".concat(n,".")})),M.b(i.shape[4]===n[3],(function(){return"Error in conv3dDerFilter: depth of input ".concat(i.shape[4],") must ")+"match input depth in filter (".concat(n[3],".")})),M.b(o.shape[4]===n[4],(function(){return"Error in conv3dDerFilter: depth of dy (".concat(o.shape[4],") must ")+"match output depth for filter (".concat(n[4],").")}));var c={x:i,dy:o},u={strides:r,pad:a,filterShape:n};return D.a.runKernel(s.G,c,u)}}),le=n(229),de={kernelName:s.F,inputsToSave:["x","filter"],gradFunc:function(e,t,n){var r=n.dilations,a=n.strides,i=n.pad;M.b(Object(ie.i)(r),(function(){return"Error in gradient of conv3D: dilation rates greater than 1 are "+"not yet supported in gradients. Got dilations '".concat(r,"'")}));var s=Object(o.a)(t,2),c=s[0],u=s[1];return{x:function(){return Object(le.a)(c.shape,e,u,a,i)},filter:function(){return ue(c,e,u.shape,a,i)}}}},fe=n(217),pe={kernelName:s.I,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(Object(p.a)(Object(fe.a)(Object(c.a)(n,"float32"))),e)}}}},he=n(218),be={kernelName:s.J,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(Object(he.a)(Object(c.a)(n,"float32")),e)}}}},me=n(60),ve=n(145),ge=n(78),ye={kernelName:s.L,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=n.axis,i=n.exclusive,s=n.reverse;return{x:function(){var t=Object(me.f)([a],r.rank),n=Object(ve.a)(e,a,i,!s);return null!=t&&(n=Object(ge.a)(n,t)),n}}}},Oe=n(234),xe=n(233),ke={kernelName:s.O,inputsToSave:["x","filter"],gradFunc:function(e,t,n){var r=n.dilations,a=n.strides,i=n.pad,s=n.dimRoundingMode,c=null==r?[1,1]:r;M.b(ie.i(c),(function(){return"Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations "+"'".concat(c,"'")}));var u=Object(o.a)(t,2),l=u[0],d=u[1];return M.b(4===l.rank,(function(){return"Error in gradient of depthwiseConv2dNative: input must be "+"rank 4, but got rank ".concat(l.rank,".")})),M.b(4===d.rank,(function(){return"Error in gradient of depthwiseConv2dNative: filter must be "+"rank 4, but got rank ".concat(d.rank,".")})),M.b(l.shape[3]===d.shape[2],(function(){return"Error in gradient of depthwiseConv2d: number of input "+"channels (".concat(l.shape[3],") must match the inChannels dimension ")+"in filter ".concat(d.shape[2],".")})),M.b(ie.h(a,c),(function(){return"Error in gradient of depthwiseConv2d: Either strides or "+"dilations must be 1. Got strides ".concat(a," and dilations ")+"'".concat(c,"'.")})),null!=s&&M.b(M.v(i),(function(){return"Error in depthwiseConv2d: pad must be an integer when using, "+"dimRoundingMode ".concat(s," but got pad ").concat(i,".")})),{x:function(){return Object(xe.a)(l.shape,e,d,a,i,r,s)},filter:function(){return Object(Oe.a)(l,e,d.shape,a,i,r,s)}}}},we={kernelName:s.S,inputsToSave:["x","filter"],gradFunc:function(e,t,n){var r=Object(o.a)(t,2),a=r[0],i=r[1],c={x:a,filter:i,dy:e},u={x:a,filter:i,dy:e};return{x:function(){return D.a.runKernel(s.U,c,n)},filter:function(){return D.a.runKernel(s.T,u,n)}}}},je={kernelName:s.W,outputsToSave:[!0],gradFunc:function(e,t){var n={dy:e,y:Object(o.a)(t,1)[0]};return{x:function(){return D.a.runKernel(s.X,n)}}}},Se=n(61),Ne={kernelName:s.Z,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0],r=Object(u.a)(Object(Se.a)(Object(p.a)(Object(m.a)(n))),2/Math.sqrt(Math.PI));return{x:function(){return Object(u.a)(e,r)}}}},Ie={kernelName:s.ab,outputsToSave:[!0],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(e,n)}}}},Ce={kernelName:s.bb,inputsToSave:["input"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{input:function(){return Object(x.a)(e,n.shape)}}}},Te={kernelName:s.cb,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(e,Object(Se.a)(n))}}}},Ee={kernelName:s.gb,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},Ae={kernelName:s.hb,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1],i=Object(O.a)(r.shape,a.shape);return{a:function(){var t=Object(f.a)(e,Object(c.a)(a,"float32")),n=Object(O.c)(r.shape,i);return n.length>0?Object(x.a)(Object(k.a)(t,n),r.shape):t},b:function(){var t=Object(u.a)(e,Object(c.a)(r,"float32")),n=Object(O.c)(a.shape,i);n.length>0&&(t=Object(x.a)(Object(k.a)(t,n),a.shape));var o=Object(m.a)(a);return Object(p.a)(Object(f.a)(t,Object(c.a)(o,"float32")))}}}},Re=n(214),Fe=n(106),De={kernelName:s.jb,inputsToSave:["x","mean","variance","scale"],gradFunc:function(e,t,n){var r=n.varianceEpsilon,a=Object(o.a)(t,4),i=a[0],s=a[1],c=a[2],l=a[3],d=null==l?Object(h.a)(1):l,f=Object(O.c)(s.shape,i.shape),p=[];if(1===s.rank){for(var b=0;b<i.shape.length-1;++b)p.push(i.shape[b]);p.push(1)}var m=Object(v.a)(i,s),g=Object(u.a)(e,d),y=Object(Re.a)(Object(T.a)(c,Object(h.a)(r))),w=Object(u.a)(Object(u.a)(Object(u.a)(y,y),y),Object(h.a)(-.5));return{x:function(){return 1===s.rank?Object(x.a)(Object(u.a)(Object(u.a)(e,Object(Fe.a)(Object(x.a)(y,[1,1,1,s.shape[0]]),p)),d),i.shape):Object(x.a)(Object(u.a)(Object(u.a)(e,y),d),i.shape)},mean:function(){var e=Object(u.a)(Object(u.a)(y,Object(h.a)(-1)),g);return 1===s.rank&&(e=Object(k.a)(e,f)),Object(x.a)(e,s.shape)},variance:function(){var e=Object(u.a)(Object(u.a)(w,m),g);return 1===s.rank&&(e=Object(k.a)(e,f)),Object(x.a)(e,s.shape)},scale:function(){var t=Object(u.a)(m,y),n=Object(u.a)(e,t);return 1===s.rank&&(n=Object(k.a)(n,f)),Object(x.a)(n,s.shape)},offset:function(){var t=e;return 1===s.rank&&(t=Object(k.a)(t,f)),Object(x.a)(t,s.shape)}}}},_e=n(162),Me={kernelName:s.nb,inputsToSave:["x","indices"],gradFunc:function(e,t,n){var r=Object(o.a)(t,2),a=r[0],i=r[1],s=n.axis,c=Object(M.I)(s,a.shape)[0];return{x:function(){var t=a.shape,n=i.size,r=t.slice(0,c),o=r.length,u=t.slice(s,t.length).slice(1),l=u.length,d=ze(0,o),f=ze(o+1,o+1+l),p=Le([r,[n],u]),h=Object(x.a)(e,p),b=Object(x.a)(i,[n]),m=Le([[o],d,f]),v=Object(ge.a)(h,m),g=Object(_e.a)(v,b,a.shape[c]),y=Object(me.h)(m);return g=Object(ge.a)(g,y)},indices:function(){return i}}}};function ze(e,t){for(var n=[],r=e;r<t;++r)n.push(r);return n}function Le(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 Pe={kernelName:s.pb,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1];return{a:function(){return Object(S.a)(r)},b:function(){return Object(S.a)(a)}}}},Be={kernelName:s.rb,gradFunc:function(e){return{x:function(){return Object(c.a)(e,"float32")}}}},We={kernelName:s.tb,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},Ue={kernelName:s.ub,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},Ve={kernelName:s.vb,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},He=n(64),Ge={kernelName:s.yb,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=n.alpha,i=Object(He.a)(r,0);return{x:function(){return Object(Z.a)(i,e,Object(u.a)(e,a))}}}},qe={kernelName:s.Db,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(f.a)(e,Object(T.a)(n,1))}}}},Ke={kernelName:s.Cb,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(f.a)(e,Object(c.a)(n,"float32"))}}}},Xe={kernelName:s.Eb,inputsToSave:[],outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=n.axis;return{logits:function(){var t=Object(Se.a)(r);return Object(v.a)(e,Object(u.a)(Object(k.a)(e,a,!0),t))}}}};var Ye=Object(z.b)({localResponseNormalizationBackprop_:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:.5,c={x:e,y:t,dy:n},u={depthRadius:r,bias:a,alpha:i,beta:o};return D.a.runKernel(s.xb,c,u)}}),$e={kernelName:s.wb,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(o.a)(t,2),a=r[0],i=r[1],s=n.depthRadius,c=n.bias,u=n.alpha,l=n.beta;return{x:function(){return Ye(a,i,e,s,c,u,l)}}}},Qe=n(117);function Ze(e,t,n,r){return t.rank<n.rank&&(t=Object(x.a)(t,me.e(t.shape,r))),e.rank<n.rank&&(e=Object(x.a)(e,me.e(e.shape,r))),{x:function(){return Object(u.a)(e,Object(c.a)(Object(Qe.a)(n,t),e.dtype))}}}var Je={kernelName:s.Ib,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=n.reductionIndices,a=t[0],i=Ze(e,t[1],a,M.I(r,a.shape));return{x:function(){return i.x()}}}},et=n(151),tt={kernelName:s.Ob,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1];return{a:function(){return Object(u.a)(e,Object(c.a)(Object(Y.a)(r,a),"float32"))},b:function(){return Object(u.a)(e,Object(c.a)(Object(et.a)(r,a),"float32"))}}}};var nt=Object(z.b)({maxPool3dGrad_:function(e,t,n,r,a,i,o){var c=Object(_.a)(e,"dy","maxPool3dGrad"),u=Object(_.a)(t,"input","maxPool3dGrad"),l=Object(_.a)(n,"output","maxPool3dGrad"),d=c,f=u,p=l,h=!1;4===u.rank&&(h=!0,d=Object(x.a)(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]]),f=Object(x.a)(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]]),p=Object(x.a)(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]])),M.b(5===d.rank,(function(){return"Error in maxPool3dGrad: dy must be rank 5 but got rank "+"".concat(d.rank,".")})),M.b(5===f.rank,(function(){return"Error in maxPool3dGrad: input must be rank 5 but got rank "+"".concat(f.rank,".")})),M.b(5===p.rank,(function(){return"Error in maxPool3dGrad: output must be rank 5 but got rank "+"".concat(p.rank,".")})),null!=o&&M.b(M.v(i),(function(){return"Error in maxPool3dGrad: pad must be an integer when "+"using, dimRoundingMode ".concat(o," but got pad ").concat(i,".")}));var b={dy:d,input:f,output:p},m={filterSize:r,strides:a,pad:i,dimRoundingMode:o},v=D.a.runKernel(s.Lb,b,m);return h?Object(x.a)(v,[v.shape[1],v.shape[2],v.shape[3],v.shape[4]]):v}}),rt={kernelName:s.Kb,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(o.a)(t,2),a=r[0],i=r[1],s=n.filterSize,c=n.strides,u=n.pad,l=n.dimRoundingMode;return{x:function(){return nt(e,a,i,s,c,u,l)}}}};var at=Object(z.b)({maxPoolGrad_:function(e,t,n,r,a,i,o){var c=Object(_.a)(e,"dy","maxPoolGrad"),u=Object(_.a)(t,"input","maxPoolGrad"),l=Object(_.a)(n,"output","maxPoolGrad");M.b(u.rank===c.rank,(function(){return"Rank of input (".concat(u.rank,") does not match rank of dy ")+"(".concat(c.rank,")")})),M.b(4===c.rank,(function(){return"Error in maxPoolGrad: dy must be rank 4 but got rank "+"".concat(c.rank,".")})),M.b(4===u.rank,(function(){return"Error in maxPoolGrad: input must be rank 4 but got rank "+"".concat(u.rank,".")})),null!=o&&M.b(M.v(i),(function(){return"Error in maxPoolGrad: pad must be an integer when using, "+"dimRoundingMode ".concat(o," but got pad ").concat(i,".")}));var d={dy:c,input:u,output:l},f={filterSize:r,strides:a,pad:i,dimRoundingMode:o};return D.a.runKernel(s.Mb,d,f)}}),it={kernelName:s.Jb,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(o.a)(t,2),a=r[0],i=r[1],s=n.filterSize,c=n.strides,u=n.pad;return{x:function(){return at(e,a,i,s,c,u)}}}},ot=n(74),st={kernelName:s.Pb,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=n.axis,i=M.I(a,r.shape),s=Object(me.d)(r.shape,i)[1],c=M.O(s);return{x:function(){var t=r.shape.slice();i.forEach((function(e){t[e]=1}));var n=Object(x.a)(e,t);return Object(f.a)(Object(u.a)(n,Object(ot.a)(r.shape,"float32")),c)}}}},ct={kernelName:s.Qb,inputsToSave:["x"],outputsToSave:[!0],gradFunc:function(e,t,n){var r=n.axis,a=Object(o.a)(t,2),i=a[0],s=Ze(e,a[1],i,M.I(r,i.shape));return{x:function(){return s.x()}}}},ut={kernelName:s.Rb,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1];return{a:function(){return Object(u.a)(e,Object(c.a)(Object($.a)(r,a),"float32"))},b:function(){return Object(u.a)(e,Object(c.a)(Object(He.a)(r,a),"float32"))}}}},lt=n(43),dt={kernelName:s.Sb,inputsToSave:["x"],gradFunc:function(e,t,n){var r=t[0],a=n.paddings.map((function(e){return e[0]}));return{x:function(){return Object(lt.a)(e,a,r.shape)}}}},ft=n(148),pt={kernelName:s.Tb,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1],i=Object(O.a)(r.shape,a.shape);return{a:function(){var t=Object(O.c)(r.shape,i);return t.length>0?Object(x.a)(Object(k.a)(e,t),r.shape):e},b:function(){var t=Object(u.a)(e,Object(p.a)(Object(ft.a)(Object(f.a)(r,a)))),n=Object(O.c)(a.shape,i);return n.length>0?Object(x.a)(Object(k.a)(t,n),a.shape):t}}}},ht={kernelName:s.Vb,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1],i=Object(O.a)(r.shape,a.shape);return{a:function(){var t=Object(u.a)(e,Object(c.a)(a,"float32")),n=Object(O.c)(r.shape,i);return n.length>0?Object(x.a)(Object(k.a)(t,n),r.shape):t},b:function(){var t=Object(u.a)(e,Object(c.a)(r,"float32")),n=Object(O.c)(a.shape,i);return n.length>0?Object(x.a)(Object(k.a)(t,n),a.shape):t}}}},bt={kernelName:s.Wb,gradFunc:function(e){return{x:function(){return Object(p.a)(e)}}}},mt=n(100),vt={kernelName:s.bc,inputsToSave:["indices"],gradFunc:function(e,t){var n=t[0];return{indices:function(){return Object(mt.a)(n.shape,"float32")}}}},gt={kernelName:s.cc,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},yt=n(103),Ot={kernelName:s.dc,saveAllInputs:!0,gradFunc:function(e,t,n){var r=n.axis;return Object(yt.a)(e,r).map((function(e){return function(){return e}}))}},xt={kernelName:s.ec,inputsToSave:["x"],gradFunc:function(e,t,n){var r=t[0],a=n.paddings.map((function(e){return e[0]}));return{x:function(){return Object(lt.a)(e,a,r.shape)}}}},kt=n(97),wt=n(73),jt={kernelName:s.fc,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:function(e,t){var n=Object(o.a)(t,3),r=n[0],a=n[1],i=n[2],s=r,l=a,d=O.a(s.shape,l.shape);return{a:function(){var t=Object(c.a)(l,"float32"),n=Object(u.a)(e,Object(u.a)(t,Object(wt.a)(s,Object(v.a)(t,Object(h.a)(1))))),r=O.c(s.shape,d);return r.length>0&&(n=Object(k.a)(n,r)),Object(x.a)(n,s.shape)},b:function(){var t=Object(He.a)(s,0),n=Object(Z.a)(t,Object(kt.a)(s),Object(S.a)(s)),r=Object(u.a)(e,Object(u.a)(i,n)),a=O.c(l.shape,d);return a.length>0&&(r=Object(k.a)(r,a)),Object(x.a)(r,l.shape)}}}},St={kernelName:s.gc,inputsToSave:["x","alpha"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1],i=Object(He.a)(r,0);return{x:function(){return Object(Z.a)(i,e,Object(u.a)(e,a))},alpha:function(){var t=Object(Z.a)(i,Object(S.a)(e),Object(u.a)(e,r)),n=Object(O.c)(a.shape,e.shape);return n.length>0&&(t=Object(k.a)(t,n)),Object(x.a)(t,a.shape)}}}},Nt={kernelName:s.kc,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1],i=O.a(r.shape,a.shape);return{a:function(){var t=Object(f.a)(e,Object(c.a)(a,"float32")),n=O.c(r.shape,i);return n.length>0?Object(x.a)(Object(k.a)(t,n),r.shape):t},b:function(){var t=Object(u.a)(e,Object(c.a)(r,"float32")),n=O.c(a.shape,i);n.length>0&&(t=Object(x.a)(Object(k.a)(t,n),a.shape));var o=Object(m.a)(a);return Object(p.a)(Object(f.a)(t,Object(c.a)(o,"float32")))}}}},It={kernelName:s.lc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(f.a)(e,Object(p.a)(Object(m.a)(n)))}}}},Ct={kernelName:s.nc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0],r=Object(u.a)(Object($.a)(n,6),Object(l.a)(n));return{x:function(){return Object(u.a)(e,Object(c.a)(r,"float32"))}}}},Tt={kernelName:s.mc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(e,Object(c.a)(Object(l.a)(n),"float32"))}}}},Et={kernelName:s.oc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(x.a)(e,n.shape)}}}},At={kernelName:s.pc,inputsToSave:["images"],gradFunc:function(e,t,n){var r={dy:e,images:Object(o.a)(t,1)[0]};return{images:function(){return D.a.runKernel(s.qc,r,n)}}}},Rt={kernelName:s.rc,inputsToSave:["images"],gradFunc:function(e,t,n){var r={dy:e,images:Object(o.a)(t,1)[0]};return{images:function(){return D.a.runKernel(s.sc,r,n)}}}},Ft=n(69),Dt={kernelName:s.tc,gradFunc:function(e,t,n){var r=n.dims,a=Object(M.I)(r,e.shape);return{x:function(){return Object(Ft.a)(e,a)}}}},_t={kernelName:s.vc,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},Mt={kernelName:s.wc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(p.a)(Object(f.a)(e,Object(u.a)(Object(wt.a)(n,1.5),2)))}}}},zt=n(120),Lt={kernelName:s.yc,inputsToSave:["condition"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{condition:function(){return Object(c.a)(Object(S.a)(n),"float32")},t:function(){return Object(u.a)(e,Object(c.a)(n,e.dtype))},e:function(){return Object(u.a)(e,Object(c.a)(Object(zt.a)(n),e.dtype))}}}},Pt=n(180),Bt={kernelName:s.zc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){var t=Object(He.a)(n,Object(h.a)(0)),r=Object(h.a)(Pt.b),a=Object(h.a)(Pt.a),i=Object(u.a)(e,a),o=Object(u.a)(Object(u.a)(e,r),Object(Se.a)(Object(c.a)(n,"float32")));return Object(Z.a)(t,i,o)}}}},Wt={kernelName:s.Ac,outputsToSave:[!0],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(e,Object(u.a)(n,Object(v.a)(Object(h.a)(1),n)))}}}},Ut={kernelName:s.Bc,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},Vt=n(144),Ht={kernelName:s.Cc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(Object(Vt.a)(Object(c.a)(n,"float32")),e)}}}},Gt=n(198),qt={kernelName:s.Dc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(Object(Gt.a)(Object(c.a)(n,"float32")),e)}}}},Kt=n(77),Xt=n(142),Yt={kernelName:s.Ec,inputsToSave:["x"],gradFunc:function(e,t,n){for(var r=Object(o.a)(t,1)[0],a=n.begin,i=n.size,s=r.shape,c=Object(Xt.parseSliceParams)(r,a,i),u=Object(o.a)(c,2),l=u[0],d=u[1],f=[],p=0;p<e.rank;p++)f.push([l[p],s[p]-l[p]-d[p]]);return{x:function(){return Object(Kt.a)(e,f)}}}},$t={kernelName:s.Fc,outputsToSave:[!0],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=n.dim,i=Object(u.a)(e,r);return{logits:function(){return Object(v.a)(i,Object(u.a)(Object(k.a)(i,[a],true),r))}}}},Qt=n(93),Zt={kernelName:s.Gc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(e,Object(Qt.a)(n))}}}},Jt=n(115),en={kernelName:s.Hc,gradFunc:function(e,t,n){var r=n.blockShape,a=n.paddings;return{x:function(){return Object(Jt.a)(e,r,a)}}}},tn=n(49),nn={kernelName:s.Nc,gradFunc:function(e,t,n){var r=n.axis;return{x:function(){return Object(tn.a)(e,r)}}}},rn={kernelName:s.Oc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(f.a)(e,Object(u.a)(Object(b.a)(Object(c.a)(n,"float32")),2))}}}},an={kernelName:s.Pc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(e,Object(u.a)(Object(c.a)(n,"float32"),2))}}}},on={kernelName:s.Qc,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1],i=Object(h.a)(2);return{a:function(){return Object(u.a)(e,Object(u.a)(i,Object(v.a)(r,a)))},b:function(){return Object(u.a)(e,Object(u.a)(i,Object(v.a)(a,r)))}}}},sn={kernelName:s.Rc,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},cn={kernelName:s.Wc,inputsToSave:["a","b"],gradFunc:function(e,t){var n=Object(o.a)(t,2),r=n[0],a=n[1],i=O.a(r.shape,a.shape);return{a:function(){var t=e,n=O.c(r.shape,i);return n.length>0&&(t=Object(k.a)(t,n)),Object(x.a)(t,r.shape)},b:function(){var t=e,n=O.c(a.shape,i);return n.length>0&&(t=Object(k.a)(t,n)),Object(x.a)(Object(p.a)(t),a.shape)}}}},un={kernelName:s.Xc,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=r.shape.slice(),i=n.axis;Object(M.I)(i,r.shape).forEach((function(e){a[e]=1}));var s=Object(x.a)(e,a),c=Object(u.a)(s,Object(ot.a)(r.shape,"float32"));return{x:function(){return c}}}},ln={kernelName:s.Yc,inputsToSave:["x"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(f.a)(e,Object(m.a)(Object(Vt.a)(n)))}}}},dn={kernelName:s.Zc,outputsToSave:[!0],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return Object(u.a)(Object(v.a)(Object(h.a)(1),Object(m.a)(n)),e)}}}},fn={kernelName:s.ad,inputsToSave:["x"],gradFunc:function(e,t,n){var r=Object(o.a)(t,1)[0],a=n.reps;return{x:function(){var t=Object(S.a)(r);if(1===r.rank)for(var n=0;n<a[0];++n)t=Object(T.a)(t,Object(lt.a)(e,[n*r.shape[0]],[r.shape[0]]));else if(2===r.rank)for(var i=0;i<a[0];++i)for(var o=0;o<a[1];++o)t=Object(T.a)(t,Object(lt.a)(e,[i*r.shape[0],o*r.shape[1]],[r.shape[0],r.shape[1]]));else if(3===r.rank)for(var s=0;s<a[0];++s)for(var c=0;c<a[1];++c)for(var u=0;u<a[2];++u)t=Object(T.a)(t,Object(lt.a)(e,[s*r.shape[0],c*r.shape[1],u*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-"+"".concat(r.rank," tensors yet."));for(var l=0;l<a[0];++l)for(var d=0;d<a[1];++d)for(var f=0;f<a[2];++f)for(var p=0;p<a[3];++p)t=Object(T.a)(t,Object(lt.a)(e,[l*r.shape[0],d*r.shape[1],f*r.shape[2],p*r.shape[3]],[r.shape[0],r.shape[1],r.shape[2],r.shape[3]]))}return t}}}},pn={kernelName:s.dd,gradFunc:function(e,t,n){var r=n.perm,a=me.h(r);return{x:function(){return Object(ge.a)(e,a)}}}},hn=n(84),bn={kernelName:s.fd,gradFunc:function(e,t,n){var r=n.axis;return{value:function(){return Object(hn.a)(e,r)}}}},mn=n(86),vn=n(119),gn=n(121),yn={kernelName:s.gd,inputsToSave:["segmentIds"],gradFunc:function(e,t){var n=Object(o.a)(t,1)[0];return{x:function(){return function(e,t){for(var n=Object(gn.a)(t,Object(S.a)(t)),r=Object(vn.a)(e,n),a=Object(Y.a)(t,Object(h.a)(0,"int32")),i=r.rank-a.rank,o=0;o<i;++o)a=Object(mn.a)(a,o+1);a=Object(Q.a)(a,Object(ot.a)(r.shape,"bool"));var s=Object(S.a)(r);return Object(Z.a)(a,r,s)}(e,n)}}}};for(var On={kernelName:s.hd,gradFunc:function(e){return{x:function(){return Object(S.a)(e)}}}},xn=n(85),kn=0,wn=[d,g,y,w,j,N,I,C,E,A,R,F,P,W,V,G,q,K,X,J,ee,ne,ce,oe,de,pe,be,ye,ke,we,Nt,je,Ne,Ie,Ce,Te,Ae,Ee,De,Me,Pe,Be,We,Ue,Ve,Ge,qe,Ke,Xe,$e,Je,Je,tt,rt,it,st,ct,ut,dt,pt,ht,bt,vt,gt,Ot,xt,xt,jt,St,It,Ct,Tt,Et,At,Rt,Dt,_t,Mt,Lt,Bt,Wt,Ut,Ht,qt,Yt,$t,Zt,en,en,nn,nn,rn,on,an,sn,cn,un,ln,dn,fn,pn,bn,yn,On];kn<wn.length;kn++){var jn=wn[kn];Object(xn.d)(jn)}var Sn=n(65),Nn=n(10);Object(Nn.d)().prototype.abs=function(){return this.throwIfDisposed(),Object(Sn.a)(this)};var In=n(249);Object(Nn.d)().prototype.acos=function(){return this.throwIfDisposed(),Object(In.a)(this)};var Cn=n(250);Object(Nn.d)().prototype.acosh=function(){return this.throwIfDisposed(),Object(Cn.a)(this)},Object(Nn.d)().prototype.add=function(e){return this.throwIfDisposed(),Object(T.a)(this,e)};var Tn=n(190);Object(Nn.d)().prototype.all=function(e,t){return this.throwIfDisposed(),Object(Tn.a)(this,e,t)};var En=n(191);Object(Nn.d)().prototype.any=function(e,t){return this.throwIfDisposed(),Object(En.a)(this,e,t)};var An=n(192);Object(Nn.d)().prototype.argMax=function(e){return this.throwIfDisposed(),Object(An.a)(this,e)};var Rn=n(193);Object(Nn.d)().prototype.argMin=function(e){return this.throwIfDisposed(),Object(Rn.a)(this,e)},Object(Nn.d)().prototype.asScalar=function(){return this.throwIfDisposed(),Object(M.b)(1===this.size,(function(){return"The array must have only 1 element."})),Object(x.a)(this,[])},Object(Nn.d)().prototype.asType=function(e){return this.throwIfDisposed(),Object(c.a)(this,e)},Object(Nn.d)().prototype.as1D=function(){return this.throwIfDisposed(),Object(x.a)(this,[this.size])},Object(Nn.d)().prototype.as2D=function(e,t){return this.throwIfDisposed(),Object(x.a)(this,[e,t])},Object(Nn.d)().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),Object(x.a)(this,[e,t,n])},Object(Nn.d)().prototype.as4D=function(e,t,n,r){return this.throwIfDisposed(),Object(x.a)(this,[e,t,n,r])},Object(Nn.d)().prototype.as5D=function(e,t,n,r,a){return this.throwIfDisposed(),Object(x.a)(this,[e,t,n,r,a])};var Fn=n(252);Object(Nn.d)().prototype.asin=function(){return this.throwIfDisposed(),Object(Fn.a)(this)};var Dn=n(253);Object(Nn.d)().prototype.asinh=function(){return this.throwIfDisposed(),Object(Dn.a)(this)};var _n=n(254);Object(Nn.d)().prototype.atan=function(){return this.throwIfDisposed(),Object(_n.a)(this)};var Mn=n(194);Object(Nn.d)().prototype.atan2=function(e){return this.throwIfDisposed(),Object(Mn.a)(this,e)};var zn=n(255);Object(Nn.d)().prototype.atanh=function(){return this.throwIfDisposed(),Object(zn.a)(this)};var Ln=n(143);Object(Nn.d)().prototype.avgPool=function(e,t,n,r){return this.throwIfDisposed(),Object(Ln.a)(this,e,t,n,r)},Object(Nn.d)().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),Object(Jt.a)(this,e,t)};var Pn=n(104);Object(Nn.d)().prototype.batchNorm=function(e,t,n,r,a){return this.throwIfDisposed(),Object(Pn.a)(this,e,t,n,r,a)};var Bn=n(125);Object(Nn.d)().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Object(Bn.a)(this,e)},Object(Nn.d)().prototype.cast=function(e){return this.throwIfDisposed(),Object(c.a)(this,e)};var Wn=n(257);Object(Nn.d)().prototype.ceil=function(){return this.throwIfDisposed(),Object(Wn.a)(this)};var Un=n(258);Object(Nn.d)().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),Object(Un.a)(this,e,t)};var Vn=n(21);Object(Nn.d)().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Nn.a&&(e=[e]),Object(tn.a)([this].concat(Object(Vn.a)(e)),t)};var Hn=n(196);Object(Nn.d)().prototype.conv1d=function(e,t,n,r,a,i){return this.throwIfDisposed(),Object(Hn.a)(this,e,t,n,r,a,i)};var Gn=n(197);Object(Nn.d)().prototype.conv2dTranspose=function(e,t,n,r,a){return this.throwIfDisposed(),Object(Gn.a)(this,e,t,n,r,a)},Object(Nn.d)().prototype.conv2d=function(e,t,n,r,a,i){return this.throwIfDisposed(),Object(se.a)(this,e,t,n,r,a,i)},Object(Nn.d)().prototype.cos=function(){return this.throwIfDisposed(),Object(Vt.a)(this)},Object(Nn.d)().prototype.cosh=function(){return this.throwIfDisposed(),Object(Gt.a)(this)},Object(Nn.d)().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),Object(ve.a)(this,e,t,n)};var qn=n(199);Object(Nn.d)().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),Object(qn.a)(this,e,t)};var Kn=n(116);Object(Nn.d)().prototype.depthwiseConv2d=function(e,t,n,r,a,i){return this.throwIfDisposed(),Object(Kn.a)(this,e,t,n,r,a,i)};var Xn=n(200);Object(Nn.d)().prototype.dilation2d=function(e,t,n,r,a){return this.throwIfDisposed(),Object(Xn.a)(this,e,t,n,r,a)};var Yn=n(201);Object(Nn.d)().prototype.divNoNan=function(e){return this.throwIfDisposed(),Object(Yn.a)(this,e)},Object(Nn.d)().prototype.div=function(e){return this.throwIfDisposed(),Object(f.a)(this,e)};var $n=n(202);Object(Nn.d)().prototype.dot=function(e){return this.throwIfDisposed(),Object($n.a)(this,e)};var Qn=n(147);Object(Nn.d)().prototype.elu=function(){return this.throwIfDisposed(),Object(Qn.a)(this)},Object(Nn.d)().prototype.equal=function(e){return this.throwIfDisposed(),Object(Qe.a)(this,e)};var Zn=n(262);Object(Nn.d)().prototype.erf=function(){return this.throwIfDisposed(),Object(Zn.a)(this)},Object(Nn.d)().prototype.exp=function(){return this.throwIfDisposed(),Object(Se.a)(this)},Object(Nn.d)().prototype.expandDims=function(e){return this.throwIfDisposed(),Object(mn.a)(this,e)};var Jn=n(263);Object(Nn.d)().prototype.expm1=function(){return this.throwIfDisposed(),Object(Jn.a)(this)};var er=n(159);Object(Nn.d)().prototype.fft=function(){return this.throwIfDisposed(),Object(er.a)(this)},Object(Nn.d)().prototype.flatten=function(){return this.throwIfDisposed(),Object(x.a)(this,[this.size])},Object(Nn.d)().prototype.floor=function(){return this.throwIfDisposed(),Object(ft.a)(this)};var tr=n(146);Object(Nn.d)().prototype.floorDiv=function(e){return this.throwIfDisposed(),Object(tr.a)(this,e)},Object(Nn.d)().prototype.gather=function(e,t){return this.throwIfDisposed(),Object(vn.a)(this,e,t)},Object(Nn.d)().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Object(Y.a)(this,e)},Object(Nn.d)().prototype.greater=function(e){return this.throwIfDisposed(),Object(He.a)(this,e)};var nr=n(134);Object(Nn.d)().prototype.ifft=function(){return this.throwIfDisposed(),Object(nr.a)(this)};var rr=n(219);Object(Nn.d)().prototype.irfft=function(){return this.throwIfDisposed(),Object(rr.a)(this)};var ar=n(264);Object(Nn.d)().prototype.isFinite=function(){return this.throwIfDisposed(),Object(ar.a)(this)};var ir=n(265);Object(Nn.d)().prototype.isInf=function(){return this.throwIfDisposed(),Object(ir.a)(this)};var or=n(266);Object(Nn.d)().prototype.isNaN=function(){return this.throwIfDisposed(),Object(or.a)(this)};var sr=n(150);Object(Nn.d)().prototype.leakyRelu=function(e){return this.throwIfDisposed(),Object(sr.a)(this,e)},Object(Nn.d)().prototype.lessEqual=function(e){return this.throwIfDisposed(),Object($.a)(this,e)},Object(Nn.d)().prototype.less=function(e){return this.throwIfDisposed(),Object(et.a)(this,e)};var cr=n(203);Object(Nn.d)().prototype.localResponseNormalization=function(e,t,n,r){return this.throwIfDisposed(),Object(cr.a)(this,e,t,n,r)};var ur=n(268);Object(Nn.d)().prototype.logSigmoid=function(){return this.throwIfDisposed(),Object(ur.a)(this)};var lr=n(269);Object(Nn.d)().prototype.logSoftmax=function(e){return this.throwIfDisposed(),Object(lr.a)(this,e)};var dr=n(152);Object(Nn.d)().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),Object(dr.a)(this,e,t)},Object(Nn.d)().prototype.log=function(){return this.throwIfDisposed(),Object(kt.a)(this)};var fr=n(204);Object(Nn.d)().prototype.log1p=function(){return this.throwIfDisposed(),Object(fr.a)(this)},Object(Nn.d)().prototype.logicalAnd=function(e){return this.throwIfDisposed(),Object(Q.a)(this,e)},Object(Nn.d)().prototype.logicalNot=function(){return this.throwIfDisposed(),Object(zt.a)(this)};var pr=n(153);Object(Nn.d)().prototype.logicalOr=function(e){return this.throwIfDisposed(),Object(pr.a)(this,e)};var hr=n(206);Object(Nn.d)().prototype.logicalXor=function(e){return this.throwIfDisposed(),Object(hr.a)(this,e)},Object(Nn.d)().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Object(U.a)(this,e,t,n)};var br=n(154);Object(Nn.d)().prototype.maxPool=function(e,t,n,r){return this.throwIfDisposed(),Object(br.a)(this,e,t,n,r)};var mr=n(94);Object(Nn.d)().prototype.max=function(e,t){return this.throwIfDisposed(),Object(mr.a)(this,e,t)},Object(Nn.d)().prototype.maximum=function(e){return this.throwIfDisposed(),Object(gn.a)(this,e)};var vr=n(112);Object(Nn.d)().prototype.mean=function(e,t){return this.throwIfDisposed(),Object(vr.a)(this,e,t)};var gr=n(132);Object(Nn.d)().prototype.min=function(e,t){return this.throwIfDisposed(),Object(gr.a)(this,e,t)};var yr=n(155);Object(Nn.d)().prototype.minimum=function(e){return this.throwIfDisposed(),Object(yr.a)(this,e)};var Or=n(207);Object(Nn.d)().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),Object(Or.a)(this,e,t)};var xr=n(208);Object(Nn.d)().prototype.mod=function(e){return this.throwIfDisposed(),Object(xr.a)(this,e)},Object(Nn.d)().prototype.mul=function(e){return this.throwIfDisposed(),Object(u.a)(this,e)},Object(Nn.d)().prototype.neg=function(){return this.throwIfDisposed(),Object(p.a)(this)};var kr=n(163);Object(Nn.d)().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Object(kr.a)(this,e,t,n)};var wr=n(156);Object(Nn.d)().prototype.notEqual=function(e){return this.throwIfDisposed(),Object(wr.a)(this,e)};var jr=n(209);Object(Nn.d)().prototype.oneHot=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.throwIfDisposed(),Object(jr.a)(this,e,t,n)};var Sr=n(273);Object(Nn.d)().prototype.onesLike=function(){return this.throwIfDisposed(),Object(Sr.a)(this)},Object(Nn.d)().prototype.pad=function(e,t){return this.throwIfDisposed(),Object(Kt.a)(this,e,t)};var Nr=n(210);Object(Nn.d)().prototype.pool=function(e,t,n,r,a){return this.throwIfDisposed(),Object(Nr.a)(this,e,t,n,r,a)},Object(Nn.d)().prototype.pow=function(e){return this.throwIfDisposed(),Object(wt.a)(this,e)};var Ir=n(157);Object(Nn.d)().prototype.prelu=function(e){return this.throwIfDisposed(),Object(Ir.a)(this,e)};var Cr=n(211);Object(Nn.d)().prototype.prod=function(e,t){return this.throwIfDisposed(),Object(Cr.a)(this,e,t)};var Tr=n(274);Object(Nn.d)().prototype.reciprocal=function(){return this.throwIfDisposed(),Object(Tr.a)(this)};var Er=n(101);Object(Nn.d)().prototype.relu=function(){return this.throwIfDisposed(),Object(Er.a)(this)};var Ar=n(158);Object(Nn.d)().prototype.relu6=function(){return this.throwIfDisposed(),Object(Ar.a)(this)},Object(Nn.d)().prototype.reshapeAs=function(e){return this.throwIfDisposed(),Object(x.a)(this,e.shape)},Object(Nn.d)().prototype.reshape=function(e){return this.throwIfDisposed(),Object(x.a)(this,e)};var Rr=n(232);Object(Nn.d)().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),Object(Rr.a)(this,e,t,n)};var Fr=n(230);Object(Nn.d)().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),Object(Fr.a)(this,e,t,n)},Object(Nn.d)().prototype.reverse=function(e){return this.throwIfDisposed(),Object(Ft.a)(this,e)};var Dr=n(160);Object(Nn.d)().prototype.rfft=function(){return this.throwIfDisposed(),Object(Dr.a)(this)};var _r=n(213);Object(Nn.d)().prototype.round=function(){return this.throwIfDisposed(),Object(_r.a)(this)},Object(Nn.d)().prototype.rsqrt=function(){return this.throwIfDisposed(),Object(Re.a)(this)};var Mr=n(215);Object(Nn.d)().prototype.selu=function(){return this.throwIfDisposed(),Object(Mr.a)(this)};var zr=n(216);Object(Nn.d)().prototype.separableConv2d=function(e,t,n,r,a,i){return this.throwIfDisposed(),Object(zr.a)(this,e,t,n,r,a,i)},Object(Nn.d)().prototype.sigmoid=function(){return this.throwIfDisposed(),Object(Qt.a)(this)};var Lr=n(276);Object(Nn.d)().prototype.sign=function(){return this.throwIfDisposed(),Object(Lr.a)(this)},Object(Nn.d)().prototype.sin=function(){return this.throwIfDisposed(),Object(fe.a)(this)},Object(Nn.d)().prototype.sinh=function(){return this.throwIfDisposed(),Object(he.a)(this)},Object(Nn.d)().prototype.slice=function(e,t){return this.throwIfDisposed(),Object(lt.a)(this,e,t)};var Pr=n(277);Object(Nn.d)().prototype.softmax=function(e){return this.throwIfDisposed(),Object(Pr.a)(this,e)};var Br=n(205);Object(Nn.d)().prototype.softplus=function(){return this.throwIfDisposed(),Object(Br.a)(this)},Object(Nn.d)().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Object(H.a)(this,e,t)},Object(Nn.d)().prototype.split=function(e,t){return this.throwIfDisposed(),Object(te.a)(this,e,t)},Object(Nn.d)().prototype.sqrt=function(){return this.throwIfDisposed(),Object(b.a)(this)},Object(Nn.d)().prototype.square=function(){return this.throwIfDisposed(),Object(m.a)(this)};var Wr=n(161);Object(Nn.d)().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Object(Wr.a)(this,e)};var Ur=n(123);Object(Nn.d)().prototype.squeeze=function(e){return this.throwIfDisposed(),Object(Ur.a)(this,e)},Object(Nn.d)().prototype.stack=function(e,t){this.throwIfDisposed();var n=e instanceof Nn.a?[this,e]:[this].concat(Object(Vn.a)(e));return Object(hn.a)(n,t)},Object(Nn.d)().prototype.step=function(e){return this.throwIfDisposed(),Object(l.a)(this,e)};var Vr=n(278);Object(Nn.d)().prototype.stridedSlice=function(e,t,n,r,a,i,o,s){return this.throwIfDisposed(),Object(Vr.a)(this,e,t,n,r,a,i,o,s)},Object(Nn.d)().prototype.sub=function(e){return this.throwIfDisposed(),Object(v.a)(this,e)},Object(Nn.d)().prototype.sum=function(e,t){return this.throwIfDisposed(),Object(k.a)(this,e,t)};var Hr=n(279);Object(Nn.d)().prototype.tan=function(){return this.throwIfDisposed(),Object(Hr.a)(this)};var Gr=n(179);Object(Nn.d)().prototype.tanh=function(){return this.throwIfDisposed(),Object(Gr.a)(this)},Object(Nn.d)().prototype.tile=function(e){return this.throwIfDisposed(),Object(Fe.a)(this,e)},Object(Nn.d)().prototype.toBool=function(){return this.throwIfDisposed(),Object(c.a)(this,"bool")},Object(Nn.d)().prototype.toFloat=function(){return this.throwIfDisposed(),Object(c.a)(this,"float32")},Object(Nn.d)().prototype.toInt=function(){return this.throwIfDisposed(),Object(c.a)(this,"int32")};var qr=n(221);Object(Nn.d)().prototype.topk=function(e,t){return this.throwIfDisposed(),Object(qr.a)(this,e,t)},Object(Nn.d)().prototype.transpose=function(e){return this.throwIfDisposed(),Object(ge.a)(this,e)};var Kr=n(222);Object(Nn.d)().prototype.unique=function(e){return this.throwIfDisposed(),Object(Kr.a)(this,e)},Object(Nn.d)().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Object(_e.a)(this,e,t)},Object(Nn.d)().prototype.unstack=function(e){return this.throwIfDisposed(),Object(yt.a)(this,e)},Object(Nn.d)().prototype.where=function(e,t){return this.throwIfDisposed(),Object(Z.a)(e,this,t)},Object(Nn.d)().prototype.zerosLike=function(){return this.throwIfDisposed(),Object(S.a)(this)};var Xr,Yr=n(7),$r=n(11),Qr=n(16),Zr=n(17);function Jr(){return null==Xr&&(Xr=Object(i.td)().epsilon()),Xr}var ea=n(20),ta=n(62),na=n(26),ra=n(164);var aa=n(228);function ia(e,t,n){return(ia=Object(aa.a)()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Object(ra.a)(a,n.prototype),a}).apply(null,arguments)}function oa(e){var t="function"===typeof Map?new Map:void 0;return(oa=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ia(e,arguments,Object(na.a)(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Object(ra.a)(r,e)})(e)}var sa=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(ta.a)(r),n.prototype),r}return n}(oa(Error)),ca=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(ta.a)(r),n.prototype),r}return n}(oa(Error)),ua=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(ta.a)(r),n.prototype),r}return n}(oa(Error)),la=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(ta.a)(r),n.prototype),r}return n}(oa(Error)),da=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this,e),Object.setPrototypeOf(Object(ta.a)(r),n.prototype),r}return n}(oa(Error));Error;function fa(e,t){if(Array.isArray(e)){for(var n=[],r=0;r<t;r++)n=n.concat(e);return n}var a=new Array(t);return a.fill(e),a}function pa(e,t){if(!e)throw new da(t)}function ha(e,t){var n,r=0,a=Object(ea.a)(e);try{for(a.s();!(n=a.n()).done;){n.value===t&&r++}}catch(i){a.e(i)}finally{a.f()}return r}function ba(e){return 1===e.length?e[0]:e}function ma(e){return Array.isArray(e)?e:[e]}function va(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 ga(e){return e.length<=1||-1===e.indexOf("_")?e:e.replace(/[_]+(\w|$)/g,(function(e,t){return t.toUpperCase()}))}var ya={};function Oa(e){if(null===e||void 0===e)return null;var t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function xa(e){if(null!=e&&"object"===typeof e)if(Array.isArray(e))e.forEach((function(e){return xa(e)}));else for(var t=0,n=Object.keys(e);t<n.length;t++){var r=n[t],a=e[r];null!=a&&"object"===typeof a&&(Array.isArray(a)||"ndarray"!==a.type||"number"!==typeof a.value?xa(a):e[r]=a.value)}}function ka(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"object",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if("string"===typeof e){var i,s=e;if(s in n)i=n[s];else if(s in ya)i=ya[s];else if(null==(i=t[s]))throw new ua("Unknown ".concat(r,": ").concat(e,". ")+"This may be due to one of the following reasons:\n"+"1. The ".concat(r," is defined in Python, in which ")+"case it needs to be ported to TensorFlow.js or your JavaScript code.\n"+"2. The custom ".concat(r," is defined in JavaScript, ")+"but is not registered properly with tf.serialization.registerClass().");return i}var c=e;if(null==c.className||null==c.config)throw new ua("".concat(r,": Improper config format: ")+"".concat(JSON.stringify(c),".\n")+"'className' and 'config' must set.");var u,l,d=c.className;if(d in n){var f=Object(o.a)(n[d],2);u=f[0],l=f[1]}else if(d in ya){var p=Object(o.a)(ya.className,2);u=p[0],l=p[1]}else if(d in t){var h=Object(o.a)(t[d],2);u=h[0],l=h[1]}if(null==u)throw new ua("Unknown ".concat(r,": ").concat(d,". ")+"This may be due to one of the following reasons:\n"+"1. The ".concat(r," is defined in Python, in which ")+"case it needs to be ported to TensorFlow.js or your JavaScript code.\n"+"2. The custom ".concat(r," is defined in JavaScript, ")+"but is not registered properly with tf.serialization.registerClass().");if(null!=l){for(var b={},m=0,v=Object.keys(ya);m<v.length;m++){var g=v[m];b[g]=ya[g]}for(var y=0,O=Object.keys(n);y<O.length;y++){var x=O[y];b[x]=n[x]}var k=c.config;k.customObjects=b;for(var w=Object.assign({},ya),j=0,S=Object.keys(n);j<S.length;j++){var N=S[j];ya[N]=n[N]}xa(c.config);var I=l(u,c.config,n,a);return ya=Object.assign({},w),I}for(var C=Object.assign({},ya),T=0,E=Object.keys(n);T<E.length;T++){var A=E[T];ya[A]=n[A]}var R=new u(c.config);return ya=Object.assign({},C),R}function wa(e,t){return-1*function(e,t){return e<t?-1:e>t?1:0}(e,t)}function ja(e){if(null==e)return e;var t,n=[],r=Object(ea.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;-1===n.indexOf(a)&&n.push(a)}}catch(i){r.e(i)}finally{r.f()}return n}function Sa(e){if(null==e)throw new ua("Invalid value in obj: ".concat(JSON.stringify(e)));for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function Na(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new ua("".concat(n," is not a valid ").concat(t,". Valid values are ").concat(e," or null/undefined."))}function Ia(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;return pa(n>=0),pa(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every((function(e){return typeof e===t}))}function Ca(e,t){Array.isArray(e)?(i.wf.assert(e.length>0,(function(){return"".concat(t," is unexpectedly an empty array.")})),e.forEach((function(e,n){return Ca(e,"element ".concat(n+1," of ").concat(t))}))):i.wf.assert(Number.isInteger(e)&&e>0,(function(){return"Expected ".concat(t," to be a positive integer, but got ")+"".concat(Ta(e),".")}))}function Ta(e){return null===e?"null":Array.isArray(e)?"["+e.map((function(e){return Ta(e)})).join(",")+"]":"string"===typeof e?'"'.concat(e,'"'):"".concat(e)}function Ea(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}function Aa(e,t){return Object(i.pf)((function(){return i.ef(i.if(i.ye(e,e),t,!0))}))}var Ra=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"getConfig",value:function(){return{}}}]),n}(i.Se.Serializable),Fa=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this)).defaultMaxValue=2,r.defaultAxis=0,r.maxValue=null!=e.maxValue?e.maxValue:r.defaultMaxValue,r.axis=null!=e.axis?e.axis:r.defaultAxis,r}return Object($r.a)(n,[{key:"apply",value:function(e){var t=this;return Object(i.pf)((function(){var n=Aa(e,t.axis),r=i.Bd(n,0,t.maxValue);return i.ye(e,i.Qd(r,i.nd(Jr(),n)))}))}},{key:"getConfig",value:function(){return{maxValue:this.maxValue,axis:this.axis}}}]),n}(Ra);Fa.className="MaxNorm",i.Se.registerClass(Fa);var Da=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this)).defaultAxis=0,r.axis=null!=e.axis?e.axis:r.defaultAxis,r}return Object($r.a)(n,[{key:"apply",value:function(e){var t=this;return Object(i.pf)((function(){return i.Qd(e,i.nd(Jr(),Aa(e,t.axis)))}))}},{key:"getConfig",value:function(){return{axis:this.axis}}}]),n}(Ra);Da.className="UnitNorm",i.Se.registerClass(Da);var _a=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return i.Me(e)}}]),n}(Ra);_a.className="NonNeg",i.Se.registerClass(_a);var Ma=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this)).defaultMinValue=0,r.defaultMaxValue=1,r.defaultRate=1,r.defaultAxis=0,r.minValue=null!=e.minValue?e.minValue:r.defaultMinValue,r.maxValue=null!=e.maxValue?e.maxValue:r.defaultMaxValue,r.rate=null!=e.rate?e.rate:r.defaultRate,r.axis=null!=e.axis?e.axis:r.defaultAxis,r}return Object($r.a)(n,[{key:"apply",value:function(e){var t=this;return Object(i.pf)((function(){var n=Aa(e,t.axis),r=i.nd(i.ye(t.rate,i.Bd(n,t.minValue,t.maxValue)),i.ye(1-t.rate,n));return i.ye(e,i.Qd(r,i.nd(Jr(),n)))}))}},{key:"getConfig",value:function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}]),n}(Ra);Ma.className="MinMaxNorm",i.Se.registerClass(Ma);var za={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function La(e){return Oa(e)}function Pa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ka(e,i.Se.SerializationMap.getMap().classNameMap,t,"constraint")}function Ba(e){return null==e?null:"string"===typeof e?Pa({className:e in za?za[e]:e,config:{}}):e instanceof Ra?e:Pa(e)}var Wa=["channelsFirst","channelsLast"],Ua=["nearest","bilinear"],Va=["valid","same","causal"],Ha=["max","avg"],Ga=["sum","mul","concat","ave"],qa=new Map;function Ka(e){Na(Wa,"DataFormat",e)}function Xa(e){Na(Va,"PaddingMode",e)}function Ya(e){Na(Ha,"PoolMode",e)}var $a=[];function Qa(e,t){$a.push(e);try{var n=t();return $a.pop(),n}catch(r){throw $a.pop(),r}}function Za(e){if(!ti(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===$a.length?"":$a.join("/")+"/")+e}function Ja(e){if(!ti(e))throw new Error("Not a valid tensor name: '"+e+"'");qa.has(e)||qa.set(e,0);var t=qa.get(e);if(qa.set(e,qa.get(e)+1),t>0){var n="".concat(e,"_").concat(t);return qa.set(n,1),n}return e}var ei=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function ti(e){return!!e.match(ei)}function ni(e,t,n){null==t&&(t=0),null==n&&(n=e.length);for(var r=1,a=t;a<n;++a)r*=e[a];return r}function ri(e){if(0===e.length)return Number.NaN;for(var t=Number.POSITIVE_INFINITY,n=0;n<e.length;n++){var r=e[n];r<t&&(t=r)}return t}function ai(e){if(0===e.length)return Number.NaN;for(var t=Number.NEGATIVE_INFINITY,n=0;n<e.length;n++){var r=e[n];r>t&&(t=r)}return t}function ii(e,t){if(t<e)throw new ua("end (".concat(t,") < begin (").concat(e,") is forbidden."));for(var n=[],r=e;r<t;++r)n.push(r);return n}function oi(e,t){return i.Ad(e,t)}function si(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=e.shape.slice();return t<0&&(t=n.length+t+1),n.splice(t,0,1),i.Ne(e,n)}function ci(e){var t=[ni(e.shape)];return i.Ne(e,t)}function ui(e,t,n){return Object(i.pf)((function(){switch(e.rank){case 1:return i.We(e,t,n);case 2:return i.Xe(e,[t,0],[n,e.shape[1]]);case 3:return i.Ye(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return i.Ze(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return i.Ve(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return i.Ve(e,[t,0,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4],e.shape[5]]);default:throw new ua("sliceAlongFirstAxis() received an unsupported tensor rank: "+"".concat(e.rank))}}))}function li(e,t,n){return Object(i.pf)((function(){switch(e.rank){case 1:return i.We(e,t,n);case 2:return i.Xe(e,[0,t],[e.shape[0],n]);case 3:return i.Ye(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return i.Ze(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new ua("sliceAlongLastAxis() received an unsupported tensor rank: "+"".concat(e.rank))}}))}function di(e,t,n,r){return Object(i.pf)((function(){switch(e.rank){case 1:return i.We(e,t,n);case 2:switch(r){case 1:return ui(e,t,n);case 2:return li(e,t,n);default:throw new ua("The axis is not within the rank of the tensor "+"".concat(r))}case 3:switch(r){case 1:return ui(e,t,n);case 2:return i.Ye(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return li(e,t,n);default:throw new ua("The axis is not within the rank of the tensor "+"".concat(r))}case 4:switch(r){case 1:return ui(e,t,n);case 2:return i.Ze(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return i.Ze(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return li(e,t,n);default:throw new ua("The axis is not within the rank of the tensor "+"".concat(r))}default:throw new ua("sliceAlongLastAxis() received an unsupported tensor rank: "+"".concat(e.rank))}}))}function fi(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return n<0&&(n=0!==(t=e[0].rank)?t:0),n===e[0].rank&&(n=-1),i.Dd(e,n)}function pi(e,t){switch(e.rank){case 1:return i.Ed([e,t]);case 2:return i.Fd([e,t],0);case 3:return i.Gd([e,t],0);case 4:return i.Hd([e,t],0);default:throw new ua("concatAlongFirstAxis() received an unsupported "+"tensor rank: ".concat(e.rank))}}function hi(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new ua("The length of input n (".concat(t.length,") does not match ")+"the number of dimensions in input x (".concat(e.rank,")"));return i.qf(e,t)}function bi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return i.Ie(e,t,n,r,a)}function mi(e,t,n,r){if(e.rank<2||t.rank<2)throw new la("dot requires both inputs to be rank >= 2"+" but got x shape = ".concat(e.shape," and y shape = ").concat(t.shape));if(t.rank>=3&&e.shape.slice(-1)[0]!==t.shape.slice(-2)[0])throw new la("If rank y >= 3, then the second last dim"+" of y must equal the last dim of x but got x shape = ".concat(e.shape," and ")+" y shape = ".concat(t.shape));if(2===e.rank&&2===t.rank){return i.be.matMul({a:e,b:t,transposeA:!1,transposeB:!1,bias:r?yi(e.rank,r,"channelsLast"):null,activation:n})}var a=e.shape.slice(),o=a.pop();e=i.Ne(e,[-1,o]);var s=t.shape.slice(),c=s.pop(),u=s.pop(),l=[].concat(Object(Vn.a)(s),[c]),d=Array.from({length:t.rank},(function(e,n){return 0===n?t.rank-2:n<=t.rank-2?n-1:n}));t=i.Ne(i.sf(t,d),[u,-1]);var f=[].concat(Object(Vn.a)(a),Object(Vn.a)(l));return i.Ne(i.be.matMul({a:e,b:t,transposeA:!1,transposeB:!1,bias:r?yi(e.rank,r,"channelsLast"):null,activation:n}),f)}function vi(e,t,n){return Object(i.pf)((function(){return t=Array.isArray(t)?Object(i.mf)(t,"int32"):i.Ad(t,"int32"),i.ce(e,t,n)}))}function gi(e){return i.ye(e,e)}function yi(e,t,n){var r=t.shape;if(1!==t.rank&&t.rank!==e)throw new ua("Unexpected bias dimensions: ".concat(t.rank)+"; expected it to be 1 or ".concat(e));if(5===e){if("channelsFirst"===n)return 1===r.length?i.Ne(t,[1,r[0],1,1,1]):i.Ne(t,[1,r[3],r[0],r[1],r[2]]);if("channelsLast"===n)return 1===r.length?i.Ne(t,[1,1,1,1,r[0]]):i.Ne(t,[1].concat(r))}else if(4===e){if("channelsFirst"===n)return 1===r.length?i.Ne(t,[1,r[0],1,1]):i.Ne(t,[1,r[2],r[0],r[1]]);if("channelsLast"===n)return 1===r.length?i.Ne(t,[1,1,1,r[0]]):i.Ne(t,[1].concat(r))}else if(3===e){if("channelsFirst"===n)return 1===r.length?i.Ne(t,[1,r[0],1]):i.Ne(t,[1,r[1],r[0]]);if("channelsLast"===n)return 1===r.length?i.Ne(t,[1,1,r[0]]):i.Ne(t,[1].concat(r))}else if(e<3)return t;throw new ua("Unsupported input rank by biasAdd: ".concat(t.rank))}function Oi(e,t,n){return Object(i.pf)((function(){return null==n&&(n="channelsLast"),Ka(n),i.nd(e,yi(e.rank,t,n))}))}function xi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(1!==t)throw new la("Support for alpha values other than 1 (".concat(t,") is not implemented ")+"yet.");return i.Sd(e)}function ki(e,t,n,r){return Object(i.pf)((function(){return i.Rd(e,t,n,r)}))}function wi(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n?e():t()}var ji=["fanIn","fanOut","fanAvg"],Si=["normal","uniform","truncatedNormal"];var Ni=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"fromConfigUsesCustomObjects",value:function(){return!1}},{key:"getConfig",value:function(){return{}}}]),n}(i.Se.Serializable),Ii=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e,t){return Object(i.Bf)(e,t)}}]),n}(Ni);Ii.className="Zeros",i.Se.registerClass(Ii);var Ci=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e,t){return Object(i.De)(e,t)}}]),n}(Ni);Ci.className="Ones",i.Se.registerClass(Ci);var Ti=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),r=t.call(this),"object"!==typeof e)throw new ua("Expected argument of type ConstantConfig but got ".concat(e));if(void 0===e.value)throw new ua("config must have value set but got ".concat(e));return r.value=e.value,r}return Object($r.a)(n,[{key:"apply",value:function(e,t){var n=this;return Object(i.pf)((function(){return Object(i.ye)(Object(i.Pe)(n.value),Object(i.De)(e,t))}))}},{key:"getConfig",value:function(){return{value:this.value}}}]),n}(Ni);Ti.className="Constant",i.Se.registerClass(Ti);var Ei=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this)).DEFAULT_MINVAL=-.05,r.DEFAULT_MAXVAL=.05,r.minval=e.minval||r.DEFAULT_MINVAL,r.maxval=e.maxval||r.DEFAULT_MAXVAL,r.seed=e.seed,r}return Object($r.a)(n,[{key:"apply",value:function(e,t){return Object(i.Je)(e,this.minval,this.maxval,t)}},{key:"getConfig",value:function(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}]),n}(Ni);Ei.className="RandomUniform",i.Se.registerClass(Ei);var Ai=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this)).DEFAULT_MEAN=0,r.DEFAULT_STDDEV=.05,r.mean=e.mean||r.DEFAULT_MEAN,r.stddev=e.stddev||r.DEFAULT_STDDEV,r.seed=e.seed,r}return Object($r.a)(n,[{key:"apply",value:function(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new la("randomNormal does not support dType ".concat(t,"."));return bi(e,this.mean,this.stddev,t,this.seed)}},{key:"getConfig",value:function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}]),n}(Ni);Ai.className="RandomNormal",i.Se.registerClass(Ai);var Ri=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this)).DEFAULT_MEAN=0,r.DEFAULT_STDDEV=.05,r.mean=e.mean||r.DEFAULT_MEAN,r.stddev=e.stddev||r.DEFAULT_STDDEV,r.seed=e.seed,r}return Object($r.a)(n,[{key:"apply",value:function(e,t){if("float32"!==(t=t||"float32")&&"int32"!==t)throw new la("truncatedNormal does not support dType ".concat(t,"."));return Object(i.tf)(e,this.mean,this.stddev,t,this.seed)}},{key:"getConfig",value:function(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}]),n}(Ni);Ri.className="TruncatedNormal",i.Se.registerClass(Ri);var Fi=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this)).gain=null!=e.gain?e.gain:1,r}return Object($r.a)(n,[{key:"apply",value:function(e,t){var n=this;return Object(i.pf)((function(){if(2!==e.length||e[0]!==e[1])throw new ua("Identity matrix initializer can only be used for 2D square matrices.");return Object(i.ye)(n.gain,Object(i.Yd)(e[0]))}))}},{key:"getConfig",value:function(){return{gain:this.gain}}}]),n}(Ni);Fi.className="Identity",i.Se.registerClass(Fi);var Di=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r,a;if(Object(Yr.a)(this,n),r=t.call(this),e.scale<0)throw new ua("scale must be a positive float. Got: ".concat(e.scale));return r.scale=null==e.scale?1:e.scale,r.mode=null==e.mode?"fanIn":e.mode,a=r.mode,Na(ji,"FanMode",a),r.distribution=null==e.distribution?"normal":e.distribution,function(e){Na(Si,"Distribution",e)}(r.distribution),r.seed=e.seed,r}return Object($r.a)(n,[{key:"apply",value:function(e,t){var n=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"channelsLast";if(Ka(r),2===e.length)t=e[0],n=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===r){var a=ni(e,2);t=e[1]*a,n=e[0]*a}else if("channelsLast"===r){var i=ni(e,0,e.length-2);t=e[e.length-2]*i,n=e[e.length-1]*i}}else{var o=ni(e);t=Math.sqrt(o),n=Math.sqrt(o)}return[t,n]}(e),r=n[0],a=n[1],o=this.scale;if("fanIn"===this.mode?o/=Math.max(1,r):"fanOut"===this.mode?o/=Math.max(1,a):o/=Math.max(1,(r+a)/2),"normal"===this.distribution){var s=Math.sqrt(o);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new la("".concat(this.getClassName()," does not support dType ").concat(t,"."));return Object(i.tf)(e,0,s,t,this.seed)}var c=Math.sqrt(3*o);return Object(i.Je)(e,-c,c,t)}},{key:"getConfig",value:function(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}]),n}(Ni);Di.className="VarianceScaling",i.Se.registerClass(Di);var _i=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,{scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}return Object($r.a)(n,[{key:"getClassName",value:function(){return Di.className}}]),n}(Di);_i.className="GlorotUniform",i.Se.registerClass(_i);var Mi=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,{scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}return Object($r.a)(n,[{key:"getClassName",value:function(){return Di.className}}]),n}(Di);Mi.className="GlorotNormal",i.Se.registerClass(Mi);var zi=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,{scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}return Object($r.a)(n,[{key:"getClassName",value:function(){return Di.className}}]),n}(Di);zi.className="HeNormal",i.Se.registerClass(zi);var Li=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,{scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}return Object($r.a)(n,[{key:"getClassName",value:function(){return Di.className}}]),n}(Di);Li.className="HeUniform",i.Se.registerClass(Li);var Pi=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,{scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}return Object($r.a)(n,[{key:"getClassName",value:function(){return Di.className}}]),n}(Di);Pi.className="LeCunNormal",i.Se.registerClass(Pi);var Bi=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,{scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}return Object($r.a)(n,[{key:"getClassName",value:function(){return Di.className}}]),n}(Di);Bi.className="LeCunNormal",i.Se.registerClass(Bi);var Wi=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),(r=t.call(this)).DEFAULT_GAIN=1,r.gain=null==e.gain?r.DEFAULT_GAIN:e.gain,r.seed=e.seed,null!=r.seed)throw new la("Random seed is not implemented for Orthogonal Initializer yet.");return r}return Object($r.a)(n,[{key:"apply",value:function(e,t){var n=this;return Object(i.pf)((function(){if(e.length<2)throw new la("Shape must be at least 2D.");e[0]*e[1]>2e3&&console.warn("Orthogonal initializer is being called on a matrix with more "+"than 2000 (".concat(e[0]*e[1],") elements: ")+"Slowness may result.");var t=bi(e[0]>e[1]?[e[1],e[0]]:e,0,1,"float32"),r=i.ke.gramSchmidt(t);return e[0]>e[1]&&(r=Object(i.sf)(r)),Object(i.ye)(n.gain,r)}))}},{key:"getConfig",value:function(){return{gain:this.gain,seed:this.seed}}}]),n}(Ni);Wi.className="Orthogonal",i.Se.registerClass(Wi);var Ui={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function Vi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ka(e,i.Se.SerializationMap.getMap().classNameMap,t,"initializer")}function Hi(e){return Oa(e)}function Gi(e){if("string"===typeof e){var t=e in Ui?Ui[e]:e;if("GlorotNormal"===t)return new Mi;if("GlorotUniform"===t)return new _i;if("HeNormal"===t)return new zi;if("HeUniform"===t)return new Li;if("LeCunNormal"===t)return new Pi;if("LeCunUniform"===t)return new Bi;var n={};return n.className=t,n.config={},Vi(n)}return e instanceof Ni?e:Vi(e)}var qi=0;function Ki(){return qi++}var Xi={};function Yi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e in Xi||(Xi[e]=0),Xi[e]+=1,e+Xi[e].toString()}function $i(e){return Array.isArray(e)&&Array.isArray(e[0])}function Qi(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function Zi(e){var t;if(Array.isArray(e)){if(1!==e.length)throw new ua("Expected Tensor length to be 1; got ".concat(e.length));t=e[0]}else t=e;return t}function Ji(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return(e=e)[0];throw new ua("Expected exactly 1 Shape; got ".concat(e.length))}return e}function eo(e){var t,n=0,r=Object(ea.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;0===a.shape.length?n+=1:n+=a.shape.reduce((function(e,t){return e*t}))}}catch(i){r.e(i)}finally{r.f()}return n}var to="Variable",no=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"float32",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:to,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;Object(Yr.a)(this,e),this.dtype=null==n?"float32":n,this.shape=t.shape,this.id=Ki(),r=null==r?to:r,this.originalName=Za(r),this.name=Ja(this.originalName),this.trainable_=a,this.constraint=o,this.val=i.xf(t,this.trainable_,this.name,this.dtype)}return Object($r.a)(e,[{key:"read",value:function(){return this.assertNotDisposed(),this.val}},{key:"write",value: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}},{key:"dispose",value:function(){this.assertNotDisposed(),this.val.dispose()}},{key:"assertNotDisposed",value:function(){if(this.val.isDisposed)throw new Error("LayersVariable ".concat(this.name," is already disposed."))}},{key:"trainable",get:function(){return this.trainable_},set:function(e){this.trainable_=e,this.val.trainable=e}}]),e}();function ro(e){return e.map((function(e){return e.read()}))}function ao(e){e.forEach((function(e){e[0].write(e[1])}))}var io=function e(t){Object(Yr.a)(this,e),this.dtype=t.dtype,this.shape=t.shape,null!=t.shape?this.ndim=t.shape.length:this.ndim=t.ndim,this.maxNDim=t.maxNDim,this.minNDim=t.minNDim,this.axes=t.axes||{}},oo=function e(t,n,r,a,i,o,s){Object(Yr.a)(this,e),this.dtype=t,this.shape=n,this.sourceLayer=r,this.inputs=a,this.callArgs=i,this.outputTensorIndex=s,this.id=Ki(),null!=o&&(this.originalName=Za(o),this.name=Ja(this.originalName)),this.rank=n.length},so=0,co=function(){function e(t,n){Object(Yr.a)(this,e),this.callArgs=n,this.id=so++,this.outboundLayer=t.outboundLayer,this.inboundLayers=t.inboundLayers,this.nodeIndices=t.nodeIndices,this.tensorIndices=t.tensorIndices,this.inputTensors=t.inputTensors,this.outputTensors=t.outputTensors,this.inputMasks=t.inputMasks,this.outputMasks=t.outputMasks,this.inputShapes=t.inputShapes,this.outputShapes=t.outputShapes;var r,a=Object(ea.a)(t.inboundLayers);try{for(a.s();!(r=a.n()).done;){var i=r.value;null!=i&&i.outboundNodes.push(this)}}catch(o){a.e(o)}finally{a.f()}t.outboundLayer.inboundNodes.push(this)}return Object($r.a)(e,[{key:"getConfig",value:function(){var e,t=[],n=Object(ea.a)(this.inboundLayers);try{for(n.s();!(e=n.n()).done;){var r=e.value;null!=r?t.push(r.name):t.push(null)}}catch(a){n.e(a)}finally{n.f()}return{outboundLayer:this.outboundLayer?this.outboundLayer.name:null,inboundLayers:t,nodeIndices:this.nodeIndices,tensorIndices:this.tensorIndices}}}]),e}(),uo=0,lo=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(Yr.a)(this,n),(e=t.call(this))._callHook=null,e._addedWeightNames=[],e._stateful=!1,e.id=uo++,e.activityRegularizer=null,e.inputSpec=null,e.supportsMasking=!1,e._trainableWeights=[],e._nonTrainableWeights=[],e._losses=[],e._updates=[],e._built=!1,e.inboundNodes=[],e.outboundNodes=[];var a=r.name;if(!a){var i=e.getClassName();a=va(i)+"_"+Yi(i)}if(e.name=a,e.trainable_=null==r.trainable||r.trainable,null!=r.inputShape||null!=r.batchInputShape){var o;if(null!=r.batchInputShape)o=r.batchInputShape;else if(null!=r.inputShape){var s=null;null!=r.batchSize&&(s=r.batchSize),o=[s].concat(r.inputShape)}e.batchInputShape=o;var c=r.dtype;null==c&&(c=r.inputDType),null==c&&(c="float32"),e.dtype=c}return null!=r.weights?e.initialWeights=r.weights:e.initialWeights=null,e._refCount=null,e.fastWeightInitDuringBuild=!1,e}return Object($r.a)(n,[{key:"getNodeAtIndex",value:function(e,t){if(0===this.inboundNodes.length)throw new ca("The layer has never been called "+"and thus has no defined ".concat(t,"."));if(this.inboundNodes.length<=e)throw new ua("Asked to get ".concat(t," at node ").concat(e,", ")+"but the layer has only ".concat(this.inboundNodes.length," inbound nodes."));return this.inboundNodes[e]}},{key:"getInputAt",value:function(e){return ba(this.getNodeAtIndex(e,"input").inputTensors)}},{key:"getOutputAt",value:function(e){return ba(this.getNodeAtIndex(e,"output").outputTensors)}},{key:"input",get:function(){if(this.inboundNodes.length>1)throw new sa("Layer ".concat(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 sa("Layer ".concat(this.name)+" is not connected, no input to return.");return ba(this.getNodeAtIndex(0,"input").inputTensors)}},{key:"output",get:function(){if(0===this.inboundNodes.length)throw new sa("Layer ".concat(this.name)+" has no inbound nodes.");if(this.inboundNodes.length>1)throw new sa("Layer ".concat(this.name)+' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return ba(this.getNodeAtIndex(0,"output").outputTensors)}},{key:"losses",get:function(){return this._losses}},{key:"calculateLosses",value:function(){return this.losses.map((function(e){return e()}))}},{key:"updates",get:function(){return this._updates}},{key:"built",get:function(){return this._built},set:function(e){this._built=e}},{key:"trainable",get:function(){return this.trainable_},set:function(e){this._trainableWeights.forEach((function(t){return t.trainable=e})),this.trainable_=e}},{key:"trainableWeights",get:function(){return this.trainable_?this._trainableWeights.filter((function(e){return e.trainable})):[]},set:function(e){this._trainableWeights=e}},{key:"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}},{key:"weights",get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)}},{key:"stateful",get:function(){return this._stateful}},{key:"resetStates",value:function(){if(!this.stateful)throw new Error("Cannot call the resetStates() method of a non-stateful Layer object.")}},{key:"assertInputCompatibility",value:function(e){if(e=ma(e),null!=this.inputSpec&&0!==this.inputSpec.length){var t=ma(this.inputSpec);if(e.length!==t.length)throw new ua("Layer ".concat(this.name," expects ").concat(t.length," inputs, ")+"but it received ".concat(e.length," input tensors. ")+"Input received: ".concat(e));for(var n=0;n<e.length;n++){var r=e[n],a=t[n];if(null!=a){var i=r.rank;if(null!=a.ndim&&i!==a.ndim)throw new ua("Input ".concat(n," is incompatible with layer ").concat(this.name,": ")+"expected ndim=".concat(a.ndim,", found ndim=").concat(i));if(null!=a.maxNDim&&i>a.maxNDim)throw new ua("Input ".concat(n," is incompatible with layer ").concat(this.name)+": expected max_ndim=".concat(a.maxNDim,", found ndim=").concat(i));if(null!=a.minNDim&&i<a.minNDim)throw new ua("Input ".concat(n," is incompatible with layer ").concat(this.name)+": expected min_ndim=".concat(a.minNDim,", found ndim=").concat(i,"."));if(null!=a.dtype&&r.dtype!==a.dtype)throw new ua("Input ".concat(n," is incompatible with layer ").concat(this.name," ")+": expected dtype=".concat(a.dtype,", found dtype=").concat(r.dtype,"."));if(a.axes){var o=r.shape;for(var s in a.axes){var c=Number(s),u=a.axes[s],l=c>=0?o[c]:o[o.length+c];if(null!=u&&-1===[u,null].indexOf(l))throw new ua("Input ".concat(n," is incompatible with layer ")+"".concat(this.name,": expected axis ").concat(c," of input shape to ")+"have value ".concat(u," but got shape ").concat(o,"."))}}if(null!=a.shape)for(var d=0;d<a.shape.length;++d){var f=a.shape[d],p=r.shape[d];if(null!=f&&null!=p&&f!==p)throw new ua("Input ".concat(n," is incompatible with layer ")+"".concat(this.name,": expected shape=").concat(a.shape,", ")+"found shape=".concat(r.shape,"."))}}}}}},{key:"call",value:function(e,t){return e}},{key:"invokeCallHook",value:function(e,t){null!=this._callHook&&this._callHook(e,t)}},{key:"setCallHook",value:function(e){this._callHook=e}},{key:"clearCallHook",value:function(){this._callHook=null}},{key:"apply",value:function(e,t){var n=this;t=t||{},this.assertNotDisposed();var r,a=ma(e),i=!0,o=Object(ea.a)(a);try{for(o.s();!(r=o.n()).done;){if(!(r.value instanceof oo)){i=!1;break}}}catch(l){o.e(l)}finally{o.f()}var s,c=!0,u=Object(ea.a)(a);try{for(u.s();!(s=u.n()).done;){if(s.value instanceof oo){c=!1;break}}}catch(l){u.e(l)}finally{u.f()}if(i===c)throw new ua("Arguments to apply() must be all SymbolicTensors or all Tensors");return Qa(this.name,(function(){if(!n.built){n.assertInputCompatibility(e);var r,i=[],o=Object(ea.a)(ma(e));try{for(o.s();!(r=o.n()).done;){var s=r.value;i.push(s.shape)}}catch(l){o.e(l)}finally{o.f()}n.build(ba(i)),n.built=!0,n.initialWeights&&n.setWeights(n.initialWeights),null===n._refCount&&c&&(n._refCount=1)}if(n.assertInputCompatibility(e),c){var u,d=n.call(e,t),f=ma(d),p=[],h=Object(ea.a)(f);try{for(h.s();!(u=h.n()).done;){var b=u.value;-1!==a.indexOf(b)&&(b=b.clone()),p.push(b)}}catch(l){h.e(l)}finally{h.f()}if(d=ba(p),null!=n.activityRegularizer)throw new la("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return d}var m,v=function(e){e=ma(e);var t,n=[],r=Object(ea.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;n.push(a.shape)}}catch(l){r.e(l)}finally{r.f()}return ba(n)}(e),g=n.computeOutputShape(v),y="float32";if(n.warnOnIncompatibleInputShape(Array.isArray(e)?v[0]:v),m=null!=g&&g.length>0&&Array.isArray(g[0])?g.map((function(r,a){return new oo(y,r,n,ma(e),t,n.name,a)})):new oo(y,g,n,ma(e),t,n.name),n.addInboundNode(e,m,null,null,v,g,t),n._refCount++,null!=n.activityRegularizer)throw new la("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return m}))}},{key:"warnOnIncompatibleInputShape",value:function(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn("The rank of the input tensor provided (shape: "+"".concat(JSON.stringify(e),") does not match that of the ")+"batchInputShape (".concat(JSON.stringify(this.batchInputShape),") ")+"of the layer ".concat(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 "+"(".concat(JSON.stringify(e),") does not ")+"match the expectation of layer ".concat(this.name,": ")+"".concat(JSON.stringify(this.batchInputShape)))}}},{key:"outputShape",get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new sa("The layer ".concat(this.name," has never been called and thus has no ")+"defined output shape.");var e,t=[],n=Object(ea.a)(this.inboundNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value,a=JSON.stringify(r.outputShapes);-1===t.indexOf(a)&&t.push(a)}}catch(o){n.e(o)}finally{n.f()}if(1===t.length){var i=this.inboundNodes[0].outputShapes;return Array.isArray(i)&&Array.isArray(i[0])&&1===i.length?i[0]:i}throw new sa("The layer ".concat(this.name," has multiple inbound nodes with different ")+'output shapes. Hence the notion of "output shape" is ill-defined for the layer.')}},{key:"countParams",value:function(){if(!this.built)throw new ca("You tried to call countParams() on ".concat(this.name,", ")+"but the layer is not built yet. Build it first by calling build(batchInputShape).");return eo(this.weights)}},{key:"build",value:function(e){this.built=!0}},{key:"getWeights",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ro(e?this.trainableWeights:this.weights)}},{key:"setWeights",value:function(e){var t=this;Object(i.pf)((function(){var n=t.weights;if(n.length!==e.length)throw new ua('You called setWeights(weights) on layer "'.concat(t.name,'" ')+"with a weight list of length ".concat(e.length,", ")+"but the layer was expecting ".concat(n.length," weights. ")+"Provided weights: ".concat(e,"..."));if(0!==n.length){for(var r=[],a=ro(n),o=0;o<a.length;++o){var s=a[o],c=n[o],u=e[o];if(!i.wf.arraysEqual(s.shape,u.shape))throw new ua("Layer weight shape ".concat(s.shape," ")+"not compatible with provided weight shape ".concat(u.shape));r.push([c,u])}ao(r)}}))}},{key:"addWeight",value:function(e,t,n,r,a,i,o){if(-1!==this._addedWeightNames.indexOf(e))throw new ua("Duplicate weight name ".concat(e," for layer ").concat(this.name));this._addedWeightNames.push(e),null==n&&(n="float32"),this.fastWeightInitDuringBuild&&(r=Gi("zeros"));var s=r.apply(t,n),c=new no(s,n,e,i,o);return s.dispose(),null!=a&&this.addLoss((function(){return a.apply(c.read())})),null==i&&(i=!0),i?this._trainableWeights.push(c):this._nonTrainableWeights.push(c),c}},{key:"setFastWeightInitDuringBuild",value:function(e){this.fastWeightInitDuringBuild=e}},{key:"addLoss",value:function(e){var t;null==e||Array.isArray(e)&&0===e.length||(e=ma(e),void 0!==this._losses&&null!==this._losses&&(t=this.losses).push.apply(t,Object(Vn.a)(e)))}},{key:"computeOutputShape",value:function(e){return e}},{key:"computeMask",value:function(e,t){var n=this;if(!this.supportsMasking){if(null!=t){if(!Array.isArray(t))throw new TypeError("Layer ".concat(this.name," does not support masking, ")+"but was passed an inputMask.");t.forEach((function(e){if(null!=e)throw new TypeError("Layer ".concat(n.name," does not support masking, ")+"but was passed an inputMask.")}))}return null}return t}},{key:"addInboundNode",value:function(e,t,n,r,a,i){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=ma(e);t=ma(t),n=ma(n),r=ma(r),a=Qi(a),i=Qi(i);var c,u=[],l=[],d=[],f=Object(ea.a)(s);try{for(f.s();!(c=f.n()).done;){var p=c.value;u.push(p.sourceLayer),l.push(p.nodeIndex),d.push(p.tensorIndex)}}catch(b){f.e(b)}finally{f.f()}new co({outboundLayer:this,inboundLayers:u,nodeIndices:l,tensorIndices:d,inputTensors:s,outputTensors:t,inputMasks:n,outputMasks:r,inputShapes:a,outputShapes:i},o);for(var h=0;h<t.length;h++)t[h].sourceLayer=this,t[h].nodeIndex=this.inboundNodes.length-1,t[h].tensorIndex=h}},{key:"getConfig",value: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}},{key:"disposeWeights",value:function(){return this.weights.forEach((function(e){return e.dispose()})),this.weights.length}},{key:"assertNotDisposed",value:function(){if(0===this._refCount)throw new Error("Layer '".concat(this.name,"' is already disposed."))}},{key:"dispose",value:function(){if(!this.built)throw new Error("Cannot dispose Layer ".concat(this.name," because it has not been ")+"built yet.");if(null===this._refCount)throw new Error("Cannot dispose Layer ".concat(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}}}],[{key:"nodeKey",value:function(e,t){return e.name+"_ib-"+t.toString()}}]),n}(i.Se.Serializable);function fo(e,t,n){if((null==t||null!=n&&n>0)&&(t=e.sourceLayer,n=e.nodeIndex),0===t.inboundNodes.length)return[e];var r=t.inboundNodes[n];if(0===r.inboundLayers.length)return r.inputTensors;for(var a=[],i=0;i<r.inboundLayers.length;i++){var o,s=fo(r.inputTensors[i],r.inboundLayers[i],r.nodeIndices[i]),c=Object(ea.a)(s);try{for(c.s();!(o=c.n()).done;){var u=o.value;-1===a.indexOf(u)&&a.push(u)}}catch(l){c.e(l)}finally{c.f()}}return a}var po=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),r=t.call(this,{dtype:e.dtype,name:null!=e.name?e.name:Yi("input").toString()}),null==e.batchSize&&(e.batchSize=null),null==e.sparse&&(e.sparse=!1),r.trainable=!1,r.built=!0,r.sparse=e.sparse,null!=e.inputShape&&null!=e.batchInputShape)throw new ua("Only provide the inputShape OR batchInputShape argument to inputLayer, not both at the same time.");var a=e.batchInputShape;if(null==a){if(null==e.inputShape)throw new ua("An InputLayer should be passed either a `batchInputShape` or an `inputShape`.");a=[e.batchSize].concat(e.inputShape)}else if(null!=e.batchSize)throw new ua("Cannot specify batchSize if batchInputShape is specified when creating an InputLayer.");var i=e.dtype||"float32";r.batchInputShape=a,r.dtype=i,r.inputSpec=[{shape:a}];var o=new oo(r.dtype,r.batchInputShape,Object(ta.a)(r),[],{},r.name);return o.nodeIndex=0,o.tensorIndex=0,new co({outboundLayer:Object(ta.a)(r),inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:[o],outputTensors:[o],inputMasks:[null],outputMasks:[null],inputShapes:[a],outputShapes:[a]}),r}return Object($r.a)(n,[{key:"apply",value:function(e,t){throw new ua("Cannot pass any input to an "+"InputLayer's apply() method. InputLayer name: ".concat(this.name))}},{key:"dispose",value:function(){return{refCountAfterDispose:this._refCount,numDisposedVariables:0}}},{key:"getConfig",value:function(){return{batchInputShape:this.batchInputShape,dtype:this.dtype,sparse:this.sparse,name:this.name}}}]),n}(lo);function ho(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.");if(null!=e.batchShape&&null!=e.shape)throw new ua("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 po({batchInputShape:t,name:e.name,dtype:n,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}po.className="InputLayer",i.Se.registerClass(po);var bo,mo=n(5),vo=n.n(mo),go=n(12);function yo(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=Object(go.a)(vo.a.mark((function e(t){var n,r,a,o,s,c,u,l;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return");case 2:for(o in n=[],r=[],a=[],t)"number"!==typeof(s=t[o])&&(c=s,n.push(c.data()),r.push(o),a.push(c));if(!(n.length>0)){e.next=12;break}return e.next=9,Promise.all(n);case 9:for(u=e.sent,l=0;l<u.length;++l)t[r[l]]=u[l][0];Object(i.Pd)(a);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xo(e){if(null!=e)for(var t in e){var n=e[t];"number"!==typeof n&&n.dispose()}}!function(e){e[e.SILENT=0]="SILENT",e[e.VERBOSE=1]="VERBOSE"}(bo||(bo={}));var ko=function(){function e(){Object(Yr.a)(this,e),this.validationData=null}return Object($r.a)(e,[{key:"setParams",value:function(e){this.params=e}},{key:"onEpochBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onTrainBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"onTrainEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"setModel",value:function(e){}}]),e}(),wo=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;Object(Yr.a)(this,e),null==t&&(t=[]),this.callbacks=t,this.queueLength=n}return Object($r.a)(e,[{key:"append",value:function(e){this.callbacks.push(e)}},{key:"setParams",value:function(e){var t,n=Object(ea.a)(this.callbacks);try{for(n.s();!(t=n.n()).done;){t.value.setParams(e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"setModel",value:function(e){var t,n=Object(ea.a)(this.callbacks);try{for(n.s();!(t=n.n()).done;){t.value.setModel(e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"onEpochBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a,i;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==n&&(n={}),r=Object(ea.a)(this.callbacks),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=10;break}return i=a.value,e.next=8,i.onEpochBegin(t,n);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),r.e(e.t0);case 15:return e.prev=15,r.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a,i;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==n&&(n={}),r=Object(ea.a)(this.callbacks),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=10;break}return i=a.value,e.next=8,i.onEpochEnd(t,n);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),r.e(e.t0);case 15:return e.prev=15,r.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a,i;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==n&&(n={}),r=Object(ea.a)(this.callbacks),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=10;break}return i=a.value,e.next=8,i.onBatchBegin(t,n);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),r.e(e.t0);case 15:return e.prev=15,r.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a,i;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==n&&(n={}),r=Object(ea.a)(this.callbacks),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=10;break}return i=a.value,e.next=8,i.onBatchEnd(t,n);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),r.e(e.t0);case 15:return e.prev=15,r.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onTrainBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){var n,r,a;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==t&&(t={}),n=Object(ea.a)(this.callbacks),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=10;break}return a=r.value,e.next=8,a.onTrainBegin(t);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t){return e.apply(this,arguments)}}()},{key:"onTrainEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){var n,r,a;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==t&&(t={}),n=Object(ea.a)(this.callbacks),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=10;break}return a=r.value,e.next=8,a.onTrainEnd(t);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])})));return function(t){return e.apply(this,arguments)}}()}]),e}(),jo=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.call(this)}return Object($r.a)(n,[{key:"onEpochBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.seen=0,this.totals={};case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onBatchEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a,o,s=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(o in null==n&&(n={}),r=null==n.size?0:n.size,this.seen+=r,a=function(e){var t=n[e];if("number"===typeof t)s.totals.hasOwnProperty(e)||(s.totals[e]=0),s.totals[e]=s.totals[e]+t*r;else{var a;e in s.totals?a=s.totals[e]:s.totals[e]=0;var o=Object(i.pf)((function(){return Object(i.nd)(s.totals[e],Object(i.ye)(t,r))}));s.totals[e]=o,null!=a&&a.dispose()}},n)a(o);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a,o,s=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==n){e.next=19;break}r=Object(ea.a)(this.params.metrics),e.prev=2,o=function(){var e=a.value;if(null==s.totals[e])return"continue";"number"===typeof s.totals[e]?n[e]=s.totals[e]/s.seen:Object(i.pf)((function(){var t=Object(i.ye)(Object(i.Qd)(1,s.seen),s.totals[e]);n[e]=t,s.totals[e].dispose(),Object(i.he)(n[e])}))},r.s();case 5:if((a=r.n()).done){e.next=11;break}if("continue"!==o()){e.next=9;break}return e.abrupt("continue",9);case 9:e.next=5;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(2),r.e(e.t0);case 16:return e.prev=16,r.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[2,13,16,19]])})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(ko),So=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"onTrainBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.epoch=[],this.history={};case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r in null==n&&(n={}),this.epoch.push(t),n)null==this.history[r]&&(this.history[r]=[]),this.history[r].push(n[r]);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"syncData",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,n,r,a,i,o,s,c,u;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a in t=[],n=[],r=[],this.history)for(i=this.history[a],o=0;o<i.length;++o)"number"!==typeof i[o]&&(s=i[o],t.push(s.data()),n.push(a),r.push(o));return e.next=6,Promise.all(t);case 6:for(c=e.sent,u=0;u<c.length;++u)this.history[n[u]][r[u]].dispose(),this.history[n[u]][r[u]]=c[u][0];case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(ko),No=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e,r){var a;if(Object(Yr.a)(this,n),(a=t.call(this)).currentEpoch=0,a.yieldEvery=r||"auto","auto"===a.yieldEvery&&(a.yieldEvery=125),"never"===a.yieldEvery&&null!=e.onYield)throw new Error("yieldEvery is `never` but you provided an `onYield` callback. Either change `yieldEvery` or remove the callback");return i.wf.isNumber(a.yieldEvery)&&(a.maybeWait=function(e,t){var n,r=i.wf.now();return function(){var a=i.wf.now();return a-r<t?n:(r=a,n=e.apply(void 0,arguments))}}(a.maybeWait.bind(Object(ta.a)(a)),a.yieldEvery)),a.trainBegin=e.onTrainBegin,a.trainEnd=e.onTrainEnd,a.epochBegin=e.onEpochBegin,a.epochEnd=e.onEpochEnd,a.batchBegin=e.onBatchBegin,a.batchEnd=e.onBatchEnd,a.yield=e.onYield,a}return Object($r.a)(n,[{key:"maybeWait",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n,r){var a;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=[],null==this.yield){e.next=5;break}return e.next=4,yo(r);case 4:a.push(this.yield(t,n,r));case 5:return a.push(Object(i.Ae)()),e.next=8,Promise.all(a);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"onEpochBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.currentEpoch=t,null==this.epochBegin){e.next=6;break}return e.next=4,yo(n);case 4:return e.next=6,this.epochBegin(t,n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onEpochEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=[],null==this.epochEnd){e.next=5;break}return e.next=4,yo(n);case 4:r.push(this.epochEnd(t,n));case 5:return"epoch"===this.yieldEvery&&r.push(Object(i.Ae)()),e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.batchBegin){e.next=5;break}return e.next=3,yo(n);case 3:return e.next=5,this.batchBegin(t,n);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onBatchEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=[],null==this.batchEnd){e.next=5;break}return e.next=4,yo(n);case 4:r.push(this.batchEnd(t,n));case 5:return"batch"===this.yieldEvery?r.push(Object(i.Ae)()):i.wf.isNumber(this.yieldEvery)&&r.push(this.maybeWait(this.currentEpoch,t,n)),e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"onTrainBegin",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.trainBegin){e.next=5;break}return e.next=3,yo(t);case 3:return e.next=5,this.trainBegin(t);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onTrainEnd",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.trainEnd){e.next=5;break}return e.next=3,yo(t);case 3:return e.next=5,this.trainEnd(t);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(ko);function Io(e,t){return null==e&&(e={}),e instanceof ko?[e]:Array.isArray(e)&&e[0]instanceof ko?e:ma(e).map((function(e){return new No(e,t)}))}var Co=function(){function e(){Object(Yr.a)(this,e)}return Object($r.a)(e,null,[{key:"registerCallbackConstructor",value:function(t,n){i.wf.assert(t>=0&&Number.isInteger(t),(function(){return"Verbosity level is expected to be an integer >= 0, "+"but got ".concat(t)})),e.checkForDuplicate(n),null==e.constructors[t]&&(e.constructors[t]=[]),e.constructors[t].push(n)}},{key:"checkForDuplicate",value:function(t){for(var n in e.constructors){e.constructors[+n].forEach((function(e){if(e===t)throw new ua("Duplicate callback constructor.")}))}}},{key:"clear",value:function(){e.constructors={}}},{key:"createCallbacks",value:function(t){var n=[];for(var r in e.constructors){var a=+r;t>=a&&n.push.apply(n,Object(Vn.a)(e.constructors[a]))}return n.map((function(e){return new e}))}}]),e}();function To(e,t,n,r,a,i,o,s,c){var u=new So,l=[new jo].concat(Object(Vn.a)(Co.createCallbacks(t)));null!=e&&l.push.apply(l,Object(Vn.a)(e)),l.push(u);var d=new wo(l);return d.setParams({epochs:n,initialEpoch:r,samples:a,steps:i,batchSize:o,verbose:t,doValidation:s,metrics:c}),{callbackList:d,history:u}}Co.constructors={};var Eo=n(28);function Ao(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return ka(e,i.Se.SerializationMap.getMap().classNameMap,t,"layer",n)}function Ro(e,t){return Object(i.pf)((function(){"float32"!==e.dtype&&(e=i.Ad(e,"float32"));var n=i.if(gi(e),t,!0),r=i.Zd(n.shape,Jr()),a=i.ef(i.te(n,r));return i.Qd(e,a)}))}function Fo(e,t){return Object(i.pf)((function(){return i.ue(gi(i.hf(t,e)),-1)}))}function Do(e,t){return Object(i.pf)((function(){return i.ue(i.md(i.hf(t,e)),-1)}))}function _o(e,t){return Object(i.pf)((function(){var n=i.hf(e,t),r=i.Bd(i.md(e),Jr(),Number.MAX_VALUE),a=i.md(i.Qd(n,r));return i.ye(100,i.ue(a,-1))}))}function Mo(e,t){return Object(i.pf)((function(){var n=i.Bd(t,Jr(),Number.MAX_VALUE),r=i.le(i.nd(1,n)),a=i.Bd(e,Jr(),Number.MAX_VALUE),o=i.le(i.nd(1,a));return i.ue(gi(i.hf(r,o)),-1)}))}function zo(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(i.pf)((function(){if(n)t=i.bf(t);else{var r=i.if(t,t.shape.length-1,!0);t=i.Qd(t,r)}return t=i.Bd(t,Jr(),1-Jr()),i.ze(i.if(i.ye(i.Ad(e,"float32"),i.le(t)),t.shape.length-1))}))}function Lo(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(i.pf)((function(){var r=i.Ad(i.ae(ci(e)),"int32"),a=(t=i.Bd(t,Jr(),1-Jr())).shape;return zo(i.Ne(i.Ce(r,a[a.length-1]),a),t,n)}))}function Po(e,t){return Object(i.pf)((function(){var n;return n=i.Bd(t,Jr(),1-Jr()),n=i.le(i.Qd(n,i.hf(1,n))),i.ue(function(e,t){if(!i.wf.arraysEqual(e.shape,t.shape))throw new ua("logits and labels must have the same shape, but got shapes "+"".concat(JSON.stringify(e.shape)," and ").concat(JSON.stringify(t.shape)));return Object(i.pf)((function(){var n=i.Me(t),r=i.ze(i.md(t));return i.nd(i.hf(n,i.ye(t,e)),i.me(i.Wd(r)))}))}(e,n),-1)}))}function Bo(e,t){return Object(i.pf)((function(){var n=i.Bd(e,Jr(),1),r=i.Bd(t,Jr(),1);return i.if(i.ye(e,i.le(i.Qd(n,r))),-1)}))}function Wo(e,t){return Object(i.pf)((function(){var n=Ro(e,-1),r=Ro(t,-1),a=i.ye(n,r);return i.ze(i.if(a,-1))}))}var Uo={meanSquaredError:Fo,meanAbsoluteError:Do,meanAbsolutePercentageError:_o,meanSquaredLogarithmicError:Mo,squaredHinge:function(e,t){return Object(i.pf)((function(){var n=i.te(0,i.hf(1,i.ye(e,t)));return i.ue(gi(n),-1)}))},hinge:function(e,t){return Object(i.pf)((function(){var n=i.te(0,i.hf(1,i.ye(e,t)));return i.ue(n,-1)}))},categoricalHinge:function(e,t){return Object(i.pf)((function(){var n=i.if(i.ye(e,t),-1),r=i.qe(i.ye(i.hf(1,e),t),-1);return i.te(0,i.nd(1,i.hf(r,n)))}))},logcosh:function(e,t){return Object(i.pf)((function(){var n=Math.log(2),r=i.hf(t,e),a=i.hf(i.nd(r,i.cf(i.ye(-2,r))),n);return i.ue(a,-1)}))},categoricalCrossentropy:zo,sparseCategoricalCrossentropy:Lo,binaryCrossentropy:Po,kullbackLeiblerDivergence:Bo,poisson:function(e,t){return Object(i.pf)((function(){var n=i.le(i.nd(Jr(),t));return i.ue(i.hf(t,i.ye(e,n)),-1)}))},cosineProximity:Wo};function Vo(e){if("string"===typeof e){if(e in Uo)return Uo[e];var t="Unknown loss ".concat(e);throw e.toLowerCase().includes("softmaxcrossentropy")&&(t="Unknown loss ".concat(e,". ")+'Use "categoricalCrossentropy" as the string name for tf.losses.softmaxCrossEntropy'),new ua(t)}return e}function Ho(e,t){return Object(i.pf)((function(){var n=i.ye(.5,i.Ee(t)),r=oi(i.de(t,n),e.dtype);return i.ue(i.Vd(e,r),-1)}))}function Go(e,t){return Object(i.pf)((function(){return oi(i.Vd(i.qd(e,-1),i.qd(t,-1)),"float32")}))}function qo(e,t){return Object(i.pf)((function(){return i.Ad(i.if(i.oe(i.Vd(e,1),i.Vd(t,1))),"float32")}))}function Ko(e,t){return Object(i.pf)((function(){var n=qo(e,t),r=function(e,t){return Object(i.pf)((function(){return i.Ad(i.if(i.oe(i.Vd(e,0),i.Vd(t,1))),"float32")}))}(e,t),a=i.nd(n,r);return i.Ad(i.Af(i.de(a,0),i.Qd(n,a),0),"float32")}))}function Xo(e,t){return Po(e,t)}function Yo(e,t){return e.rank===t.rank&&(e=i.ff(e,[e.rank-1])),(t=i.qd(t,-1)).dtype!==e.dtype&&(t=i.Ad(t,e.dtype)),i.Ad(i.Vd(e,t),"float32")}var $o=zo,Qo=Lo,Zo={binaryAccuracy:Ho,categoricalAccuracy:Go,precision:Ko,categoricalCrossentropy:$o,sparseCategoricalCrossentropy:Qo,mse:Fo,MSE:Fo,mae:Do,MAE:Do,mape:_o,MAPE:_o,cosine:Wo};function Jo(e){if("string"===typeof e&&e in Zo)return Zo[e];if("string"!==typeof e&&null!=e)return e;throw new ua("Unknown metric ".concat(e))}function es(e){if(pa(null!==e,"Unknown LossOrMetricFn ".concat(e)),"string"===typeof e)return e;for(var t,n=0,r=Object.keys(Uo);n<r.length;n++){var a=r[n];if(Uo[a]===e){t=a;break}}if(void 0!==t)return t;for(var i=0,o=Object.keys(Zo);i<o.length;i++){var s=o[i];if(Zo[s]===e){t=s;break}}return void 0!==t?t:e.name}var ts=1048576;function ns(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||"object"!==typeof e||Object.getPrototypeOf(e)!==Object.prototype||!rs(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){var r=JSON.stringify(e);r.length>ts&&console.warn('User-defined metadata of model "'.concat(t,'" is too large in ')+"size (length=".concat(r.length," when serialized). It is not ")+"recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= "+"".concat(ts,"."))}}function rs(e){if(null===e)return!0;if("object"===typeof e){if(Object.getPrototypeOf(e)===Object.prototype){for(var t=0,n=Object.keys(e);t<n.length;t++){var r=n[t];if("string"!==typeof r)return!1;if(!rs(e[r]))return!1}return!0}if(Array.isArray(e)){var a,i=Object(ea.a)(e);try{for(i.s();!(a=i.n()).done;){if(!rs(a.value))return!1}}catch(s){i.e(s)}finally{i.f()}return!0}return!1}var o=typeof e;return"string"===o||"number"===o||"boolean"===o}function as(e,t,n){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:console.log,i=os(e),o=["Layer (type)","Output shape","Param #"];if(i?(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)}))),!i)for(var s in o.push("Receives inputs"),r=[],e.nodesByDepth){var c;(c=r).push.apply(c,Object(Vn.a)(e.nodesByDepth[s]))}a("_".repeat(t)),ss(o,n,a),a("=".repeat(t));for(var u=e.layers,l=0;l<u.length;++l)i?cs(u[l],n,a):us(u[l],n,r,a),a((l===u.length-1?"=":"_").repeat(t));e.checkTrainableWeightsConsistency();var d=is(e),f=eo(e.nonTrainableWeights);a("Total params: ".concat(d+f)),a("Trainable params: ".concat(d)),a("Non-trainable params: ".concat(f)),a("_".repeat(t))}function is(e){return null!=e.collectedTrainableWeights?eo(e.collectedTrainableWeights):eo(e.trainableWeights)}function os(e){var t=!0,n=[],r=[];for(var a in e.nodesByDepth)n.push(e.nodesByDepth[a]);for(var i=0,o=n;i<o.length;i++){var s=o[i];if(s.length>1||1===s.length&&s[0].inboundLayers.length>1){t=!1;break}r.push.apply(r,Object(Vn.a)(s))}if(t){var c,u=Object(ea.a)(e.layers);try{for(u.s();!(c=u.n()).done;){var l,d=c.value,f=!1,p=Object(ea.a)(d.inboundNodes);try{for(p.s();!(l=p.n()).done;){var h=l.value;if(-1!==r.indexOf(h)){if(f){t=!1;break}f=!0}}}catch(b){p.e(b)}finally{p.f()}if(!t)break}}catch(b){u.e(b)}finally{u.f()}}return t}function ss(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:console.log,r="",a=0;a<e.length;++a)a>0&&(r=r.slice(0,r.length-1)+" "),r=(r+=e[a]).slice(0,t[a]),r+=" ".repeat(t[a]-r.length);n(r)}function cs(e,t,n){var r;try{r=JSON.stringify(e.outputShape)}catch(o){r="multiple"}var a=e.name,i=e.getClassName();ss(["".concat(a," (").concat(i,")"),r,e.countParams().toString()],t,n)}function us(e,t,n,r){var a;try{a=JSON.stringify(e.outputShape)}catch(v){a="multiple"}var i,o=[],s=Object(ea.a)(e.inboundNodes);try{for(s.s();!(i=s.n()).done;){var c=i.value;if(!(null!=n&&n.length>0&&-1===n.indexOf(c)))for(var u=0;u<c.inboundLayers.length;++u){var l=c.inboundLayers[u].name,d=c.nodeIndices[u],f=c.tensorIndices[u];o.push("".concat(l,"[").concat(d,"][").concat(f,"]"))}}}catch(v){s.e(v)}finally{s.f()}var p=e.name,h=e.getClassName(),b=0===o.length?"":o[0];ss(["".concat(p," (").concat(h,")"),a,e.countParams().toString(),b],t,r);for(var m=1;m<o.length;++m)ss(["","","",o[m]],t,r)}function ls(e,t,n){return("inboundNodes"===e||"outputLayers"===e||"inputLayers"===e)&&0===t&&"string"===typeof n}function ds(e,t){if(null===e)return null;if("string"===typeof e)return ga(e);if("number"===typeof e||"boolean"===typeof e)return e;if(e instanceof Array){for(var n=[],r=e.length,a=0;a<r;++a){var i=e[a];ls(t,a,i)?n.push(i):n.push(ds(i,t))}return n}for(var o={},s=0,c=Object.keys(e);s<c.length;s++){var u=c[s],l=e[u];if("name"===u&&"string"===typeof l)o[u]=l;else{var d=ga(u);o[d]=ds(l,d)}}return o}function fs(e,t){if(null===e||void 0===e)return null;if("string"===typeof e)return va(e);if("number"===typeof e||"boolean"===typeof e)return e;if(e instanceof Array){for(var n=[],r=e.length,a=0;a<r;++a){var i=e[a];ls(t,a,i)?n.push(i):n.push(fs(i,t))}return n}for(var o={},s=0,c=Object.keys(e);s<c.length;s++){var u=c[s],l=e[u],d=va(u);o[d]="name"!==u&&"className"!==u||"string"!==typeof l?fs(l,u):l}return o}var ps="3.8.0";var hs=function(){function e(t){if(Object(Yr.a)(this,e),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;var r,a=Object(ea.a)(t);try{for(a.s();!(r=a.n()).done;){var i=r.value;this.add(i.key,i.value)}}catch(o){a.e(o)}finally{a.f()}}}return Object($r.a)(e,[{key:"add",value:function(e,t,n){if(null!=this.id2Value[e.id])throw new ua("Duplicate key: name=".concat(e.name,", id=").concat(e.id));return this.id2Value[e.id]=function(e,t){if(null==e.dtype||e.dtype===t.dtype)return t;try{return Object(i.Ad)(t,e.dtype)}catch(n){throw new ua("The dtype of the feed (".concat(t.dtype,") can not be cast to the dtype ")+"of the key '".concat(e.name,"' (").concat(e.dtype,")."))}}(e,t),this.name2Id[e.name]=e.id,null!=n&&(this.id2Mask[e.id]=n),this}},{key:"addFeed",value:function(e){this.add(e.key,e.value)}},{key:"hasKey",value:function(e){return null!=this.id2Value[e.id]}},{key:"names",value:function(){return Object.keys(this.name2Id)}},{key:"getValue",value:function(e){if(e instanceof oo){if(null==this.id2Value[e.id])throw new ua("Nonexistent key: ".concat(e.name));return this.id2Value[e.id]}var t=this.name2Id[e];if(null==t)throw new ua("Feed dict has no SymbolicTensor name: ".concat(e));return this.id2Value[t]}},{key:"getMask",value:function(e){if(e instanceof oo){if(null==this.id2Value[e.id])throw new ua("Nonexistent key: ".concat(e.name));return this.id2Mask[e.id]}var t=this.name2Id[e];if(null==t)throw new ua("Feed dict has no SymbolicTensor name: ".concat(e));return this.id2Mask[t]}},{key:"disposeMasks",value:function(){null!=this.id2Mask&&Object(i.Pd)(this.id2Mask)}}]),e}(),bs={},ms={};function vs(e,t,n,r){var a,o=null!=n&&n.training,s=Array.isArray(e),c=s?e:[e],u=c.map((function(e){return e.name})),l=[],d=t.names(),f=Object(ea.a)(u);try{for(f.s();!(a=f.n()).done;){var p=a.value;-1!==d.indexOf(p)?l.push(t.getValue(p)):l.push(null)}}catch(L){f.e(L)}finally{f.f()}null!=r&&(r.maxNumTensors=-1/0,r.minNumTensors=1/0);var h,b,m=u.join(",")+"|"+t.names().join(",");if(null==bs[m]){var v=function(e,t){i.wf.assert(null!=e&&e.length>0,(function(){return"Expected at least one fetch, got none"}));var n=[],r={};if(1===e.length){var a=ys(e[0],t);n=a.sorted,r=a.recipientMap}else{var o,s=new Set,c=Object(ea.a)(e);try{for(c.s();!(o=c.n()).done;){var u,l=ys(o.value,t),d=l.sorted,f=l.recipientMap,p=Object(ea.a)(d);try{for(p.s();!(u=p.n()).done;){var h=u.value;s.has(h.name)||(n.push(h),s.add(h.name))}}catch(L){p.e(L)}finally{p.f()}var b=function(e){null==r[e]&&(r[e]=new Set),f[e].forEach((function(t){return r[e].add(t)}))};for(var m in f)b(m)}}catch(L){c.e(L)}finally{c.f()}}return{sorted:n,recipientCounts:gs(r)}}(c,t);h=v.sorted,b=v.recipientCounts,bs[m]=h,ms[m]=b}h=bs[m],b={},o||Object.assign(b,ms[m]);for(var g=new hs(t),y=0;y<h.length;++y){if(null!=r){var O=Object(i.ve)().numTensors;O>r.maxNumTensors&&(r.maxNumTensors=O),O<r.minNumTensors&&(r.minNumTensors=O)}var x=h[y],k=x.sourceLayer;if(!(k instanceof po)){var w,j=[],S=[],N=[],I=!1,C=Object(ea.a)(x.inputs);try{for(C.s();!(w=C.n()).done;){var T=w.value,E=g.getValue(T),A=g.getMask(T);j.push(E),S.push(A),null!=A&&(I=!0),o||(b[T.name]--,0!==b[T.name]||t.hasKey(T)||-1!==u.indexOf(T.name)||E.isDisposed||!0===T.sourceLayer.stateful||N.push(E))}}catch(L){C.e(L)}finally{C.f()}I&&((n=n||{}).mask=S[0]);var R=ma(k.apply(j,n)),F=null;k.supportsMasking&&(F=k.computeMask(j,S));for(var D=Os(x),_=Array.isArray(D)?D:[D],M=0;M<_.length;++M){g.hasKey(_[M])||g.add(_[M],R[M],Array.isArray(F)?F[0]:F);var z=u.indexOf(_[M].name);-1!==z&&(l[z]=R[M])}o||Object(i.Pd)(N)}}return g.disposeMasks(),s?l:l[0]}function gs(e){var t={};for(var n in e)t[n]=e[n].size;return t}function ys(e,t){var n,r=new Set,a=[],i={},o=Object(ea.a)(t.names());try{for(o.s();!(n=o.n()).done;){var s=n.value;r.add(s)}}catch(b){o.e(b)}finally{o.f()}var c=[],u=[];for(c.push(e);c.length>0;){var l=c[c.length-1];if(r.has(l.name))c.pop();else{var d=u[u.length-1]===c.length-1;if(0===l.inputs.length||d)c.pop(),a.push(l),r.add(l.name),d&&u.pop();else{u.push(c.length-1);var f,p=Object(ea.a)(l.inputs);try{for(p.s();!(f=p.n()).done;){var h=f.value;null==i[h.name]&&(i[h.name]=new Set),i[h.name].add(l.name),r.has(h.name)||c.push(h)}}catch(b){p.e(b)}finally{p.f()}}}}return{sorted:a,recipientMap:i}}function Os(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){var a,i=Object(ea.a)(e.sourceLayer.inboundNodes[r].outputTensors);try{for(i.s();!(a=i.n()).done;){if(a.value.id===e.id){n=r;break}}}catch(o){i.e(o)}finally{i.f()}}t=e.sourceLayer.getOutputAt(n)}return t}function xs(e,t,n){var r=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map((function(e){return null}));if(1===r)return Array.isArray(e)&&1===e.length?e:"object"===typeof e&&t[0]in e?[e[t[0]]]:[e];if(Array.isArray(e)){if(e.length!==r)throw new Error("Provided ".concat(n," is an array of ").concat(e.length," ")+"element(s), but the model has ".concat(r," outputs. ")+"Make sure a set of weights is provided for each model output.");return e}if("object"===typeof e&&Object.keys(e).length>0&&"object"===typeof e[Object.keys(e)[0]]){var a=[];return t.forEach((function(t){t in e?a.push(e[t]):a.push(null)})),a}throw new Error("The model has multiple (".concat(r,") outputs, ")+"so ".concat(n," must be either an array with ")+"".concat(r," elements or an object with ").concat(t," keys. ")+"Provided ".concat(n," not understood: ").concat(JSON.stringify(e)))}function ks(e,t){return xs(e,t,"classWeight")}function ws(e,t,n,r){return js.apply(this,arguments)}function js(){return(js=Object(go.a)(vo.a.mark((function e(t,n,r,a){var o,s,c;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==n&&null==a){e.next=2;break}throw new Error("Support sampleWeight is not implemented yet");case 2:if(null==r){e.next=15;break}return o=Object(i.pf)((function(){if(1===t.shape.length)return Object(i.Cd)(t);if(2===t.shape.length){if(t.shape[1]>1){return Object(i.qd)(t,1)}if(1===t.shape[1])return Object(i.Ne)(t,[t.shape[0]]);throw new Error("Encountered unexpected last-dimension size (".concat(t.shape[1],") ")+"during handling of class weights. The size is expected to be >= 1.")}throw new Error("Unexpected rank of target (y) tensor (".concat(t.rank,") during ")+"handling of class weights. The rank is expected to be 1 or 2.")})),e.t0=Array,e.next=7,o.data();case 7:return e.t1=e.sent,s=e.t0.from.call(e.t0,e.t1),Object(i.Pd)(o),c=[],s.forEach((function(e){if(null==r[e])throw new Error("classWeight must contain all classes in the training data. "+"The class ".concat(e," exists in the data but not in ")+"classWeight");c.push(r[e])})),e.abrupt("return",Object(i.mf)(c,"float32"));case 15:return e.abrupt("return",null);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ss(e,t){return Object(i.ye)(e,t)}function Ns(e,t){var n,r,a=t;n=a.xs,r=a.ys,i.wf.assert(null!=n&&null!=r,(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 "+"".concat(t)}));var o=Is("input",e.inputNames,n),s=Is("output",e.outputNames,r),c=o[0].shape[0];i.wf.assert(o.length===e.inputs.length,(function(){return"LayersModel has ".concat(e.inputs.length," inputs, but the dataset ")+"provides ".concat(o.length," inputs. (Expected input keys: ")+"".concat(JSON.stringify(e.inputNames),")")})),i.wf.assert(s.length===e.outputs.length,(function(){return"LayersModel has ".concat(e.outputs.length," outputs, but the dataset ")+"provides ".concat(s.length," outputs. (Expected output keys: ")+"".concat(JSON.stringify(e.outputNames),")")}));for(var u=function(t){i.wf.assert(o[t].shape[0]===c,(function(){return"Batch size mismatch: input "+"".concat(e.inputNames[t]," has ").concat(o[t].shape[0],"; ")+"expected ".concat(c," based on input ").concat(e.inputNames[0],".")}))},l=0;l<o.length;l++)u(l);for(var d=function(t){i.wf.assert(s[t].shape[0]===c,(function(){return"Batch size mismatch: output "+"".concat(e.outputNames[t]," has ").concat(s[t].shape[0],"; ")+"expected ".concat(c," based on input ").concat(e.inputNames[0],".")}))},f=0;f<s.length;f++)d(f);return{xs:o,ys:s}}function Is(e,t,n){if(n instanceof i.bd)return[n];if(Array.isArray(n))return i.wf.assert(n.length===t.length,(function(){return"Received an array of ".concat(n.length," Tensors, but expected ").concat(t.length," to match the ").concat(e," keys ").concat(t,".")})),n;var r,a=[],o=Object(ea.a)(t);try{for(o.s();!(r=o.n()).done;){var s=r.value;if(null==n[s])throw new ua("The feature data generated by the dataset lacks the required "+"".concat(e," key '").concat(s,"'."));a.push(n[s])}}catch(c){o.e(c)}finally{o.f()}return a}function Cs(e){if(3===e.length)throw new la("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}function Ts(e,t,n){return Es.apply(this,arguments)}function Es(){return(Es=Object(go.a)(vo.a.mark((function e(t,n,r){var a,o,s,c,u,l,d,f,p,h,b,m,v,g,y,O,x,k,w,j,S,N,I,C,T,E,A,R,F,D,_,M,z;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null!=r.batchesPerEpoch,i.wf.assert(null!=t.optimizer,(function(){return"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."})),i.wf.assert(null!=r,(function(){return"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."})),i.wf.assert(null!=r.epochs&&r.epochs>0&&Number.isInteger(r.epochs),(function(){return"For fitDataset(), config.epochs is expected to be a positive "+"integer, but got ".concat(r.epochs)})),i.wf.assert(!a||r.batchesPerEpoch>0&&Number.isInteger(r.batchesPerEpoch),(function(){return"For fitDataset(), config.batchesPerEpoch is expected to be a "+"positive integer if specified, but got ".concat(r.batchesPerEpoch)})),i.wf.assert(null==r.validationSplit,(function(){return"`validationSplit` is not supported by `fitDataset()`. Use validationData instead."})),!t.isTraining){e.next=8;break}throw new Error("Cannot start training because another fit() call is ongoing.");case 8:return t.isTraining=!0,e.prev=9,(o=null!=r.validationData)&&(Rs(r.validationData)?i.wf.assert(null==r.validationBatches||r.validationBatches>0&&Number.isInteger(r.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 ".concat(r.validationBatches)})):(u=Cs(r.validationData),s=u.xs,c=u.ys)),l=t.makeTrainFunction(),d=t.getDedupedMetricsNames(),f=o?d.slice().concat(d.map((function(e){return"val_"+e}))):d.slice(),p=Io(r.callbacks,r.yieldEvery),h=null==r.verbose?1:r.verbose,b=To(p,h,r.epochs,null,null,As(n,r),null,o,f),m=b.callbackList,v=b.history,m.setModel(t),t.history=v,e.next=22,m.onTrainBegin();case 22:return t.stopTraining_=!1,g=null==r.initialEpoch?0:r.initialEpoch,e.next=26,n.iterator();case 26:y=e.sent;case 27:if(!(g<r.epochs)){e.next=98;break}return O={},e.next=31,m.onEpochBegin(g);case 31:if(x=0,k=0,a){e.next=37;break}return e.next=36,n.iterator();case 36:y=e.sent;case 37:if(a&&!(x<r.batchesPerEpoch)){e.next=91;break}return e.next=40,y.next();case 40:if(w=e.sent,!a||!w.done){e.next=44;break}return console.warn("You provided `batchesPerEpoch` as "+"".concat(r.batchesPerEpoch,", ")+"but your dataset iterator ran out of data after "+"".concat(x," batches; ")+"interrupting training. Make sure that your dataset can generate at least `batchesPerEpoch * epochs` batches (in this case, "+"".concat(r.batchesPerEpoch*r.epochs," batches). ")+"You may need to use the repeat() function when building your dataset."),e.abrupt("break",91);case 44:if(null==w.value){e.next=73;break}return j=Ns(t,w.value),S=j.xs,N=j.ys,(I={}).batch=k,I.size=S[0].shape[0],e.next=51,m.onBatchBegin(k,I);case 51:if(C=[],null==r.classWeight){e.next=64;break}T=ks(r.classWeight,t.outputNames),E=0;case 55:if(!(E<T.length)){e.next=64;break}return e.t0=C,e.next=59,ws(N[E],null,T[E]);case 59:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 61:++E,e.next=55;break;case 64:for(A=S.concat(N).concat(C),R=l(A),i.Pd(A),F=0;F<d.length;++F)D=d[F],_=R[F],I[D]=_,i.he(_);return e.next=70,m.onBatchEnd(k,I);case 70:xo(I),k++,x++;case 73:if(!(a?x>=r.batchesPerEpoch:w.done)){e.next=87;break}if(!o){e.next=86;break}if(M=void 0,!Rs(r.validationData)){e.next=84;break}return e.t2=ma,e.next=80,t.evaluateDataset(r.validationData,{batches:r.validationBatches});case 80:e.t3=e.sent,M=(0,e.t2)(e.t3),e.next=85;break;case 84:M=ma(t.evaluate(s,c,{batchSize:null==r.validationBatchSize?32:r.validationBatchSize,verbose:0}));case 85:for(z=0;z<t.metricsNames.length;++z)O["val_".concat(t.metricsNames[z])]=M[z];case 86:return e.abrupt("break",91);case 87:if(!t.stopTraining_){e.next=89;break}return e.abrupt("break",91);case 89:e.next=37;break;case 91:return e.next=93,m.onEpochEnd(g,O);case 93:if(g++,!t.stopTraining_){e.next=96;break}return e.abrupt("break",98);case 96:e.next=27;break;case 98:return e.next=100,m.onTrainEnd();case 100:return e.next=102,t.history.syncData();case 102:return e.abrupt("return",t.history);case 103:return e.prev=103,t.isTraining=!1,e.finish(103);case 106:case"end":return e.stop()}}),e,null,[[9,,103,106]])})))).apply(this,arguments)}function As(e,t){var n=null;return null!=t.batchesPerEpoch?n=t.batchesPerEpoch:Number.isFinite(e.size)&&(n=e.size),n}function Rs(e){return"function"===typeof e.iterator}function Fs(e){return"function"===typeof e.next}function Ds(e,t,n){return _s.apply(this,arguments)}function _s(){return(_s=Object(go.a)(vo.a.mark((function e(t,n,r){var a,o,s,c,u,l,d,f,p;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null!=(r=r||{}).batches,o=t.testFunction,s=[],!(r.verbose>0)){e.next=6;break}throw new la("Verbose mode is not implemented yet.");case 6:if(i.wf.assert(!a||r.batches>0&&Number.isInteger(r.batches),(function(){return"Test loop expects `batches` to be a positive integer, but "+"received ".concat(JSON.stringify(r.batches))})),!Fs(n)){e.next=11;break}e.t0=n,e.next=14;break;case 11:return e.next=13,n.iterator();case 13:e.t0=e.sent;case 14:c=e.t0,u=0,l=0,d=vo.a.mark((function e(){var n;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.next();case 2:if(n=e.sent,s=i.pf((function(){return n.value&&function(){var e=Ns(t,n.value),r=e.xs,a=e.ys,c=r.concat(a),d=i.pf((function(){return o(c)}));if(i.Pd(c),0===l)for(var f=0;f<d.length;++f)s.push(Object(i.Pe)(0));for(var p=c[0].shape[0],h=function(e){var t=d[e],n=s[e];s[e]=i.pf((function(){return i.nd(s[e],i.ye(p,t))})),l>0&&i.Pd(n)},b=0;b<d.length;++b)h(b);i.Pd(d),u+=p,++l}(),s})),!n.done){e.next=7;break}return a&&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, ".concat(r.batches," batches). ")+"You may need to use the repeat() function when building your dataset."),e.abrupt("return","break");case 7:case"end":return e.stop()}}),e)}));case 18:if(a&&!(l<r.batches)){e.next=25;break}return e.delegateYield(d(),"t1",20);case 20:if("break"!==e.t1){e.next=23;break}return e.abrupt("break",25);case 23:e.next=18;break;case 25:for(f=0;f<s.length;++f)p=s[f],s[f]=i.Qd(s[f],u),i.Pd(p);return e.abrupt("return",ba(s));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ms(e){i.wf.assert(e>0&&Number.isInteger(e),(function(){return"batchSize is required to be a positive integer, but got ".concat(e)}))}function zs(e,t,n){return null==e?[null]:Array.isArray(e)?e.map((function(e){return ui(e,t,n-t)})):ui(e,t,n-t)}function Ls(e,t){return i.pf((function(){return null==e?null:Array.isArray(e)?e.map((function(e){return Ls(e,t)})):vi(e,"int32"===t.dtype?t:i.Ad(t,"int32"))}))}function Ps(e,t){for(var n=[],r=0,a=null;r<e;)(a=r+t)>=e&&(a=e),n.push([r,a]),r=a;return n}function Bs(e,t,n,r,a,i,o,s,c,u,l,d,f,p,h){return Ws.apply(this,arguments)}function Ws(){return(Ws=Object(go.a)(vo.a.mark((function e(t,n,r,a,o,s,c,u,l,d,f,p,h,b,m){var v,g,y,O,x,k,w,j;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==o&&(o=32),null==s&&(s=1),null==f&&(f=!0),null==h&&(h=0),v=!1,null!=l&&null!=d&&(v=!0),null==m){e.next=10;break}if(v=!0,null!=b){e.next=10;break}throw new ua("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");case 10:return null!=(g=t.checkNumSamples(r,o,b,"steps_per_epoch"))&&(y=ii(0,g)),null==c&&(c=1),O=To(u,c,s,h,g,b,o,v,p),x=O.callbackList,k=O.history,x.setModel(t),t.history=k,e.next=18,x.onTrainBegin();case 18:t.stopTraining_=!1,w=vo.a.mark((function e(s){var c;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x.onEpochBegin(s);case 2:if(c={},null==b){e.next=7;break}throw new la("stepsPerEpoch mode is not implemented yet.");case 7:return e.delegateYield(vo.a.mark((function e(){var s,u,p,h;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("batch"!==f){e.next=4;break}throw new la("batch shuffling is not implemneted yet");case 4:f&&i.wf.shuffle(y);case 5:s=Object(i.mf)(y),u=Ps(g,o),p=vo.a.mark((function e(f){var p;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p={},e.next=3,x.onBatchBegin(f,p);case 3:return i.pf((function(){var e=u[f][0],h=u[f][1],b=ui(s,e,h-e);p.batch=f,p.size=h-e;for(var m=Ls(r,b),g=n(m),y=0;y<a.length;++y){var O=a[y],x=g[y];p[O]=x,i.he(x)}if(f===u.length-1&&v)for(var k=t.testLoop(l,d,o),w=0;w<a.length;++w){var j=a[w],S=k[w];i.he(S),c["val_"+j]=S}})),e.next=6,x.onBatchEnd(f,p);case 6:if(xo(p),!t.stopTraining_){e.next=9;break}return e.abrupt("return","break");case 9:case"end":return e.stop()}}),e)})),h=0;case 9:if(!(h<u.length)){e.next=17;break}return e.delegateYield(p(h),"t0",11);case 11:if("break"!==e.t0){e.next=14;break}return e.abrupt("break",17);case 14:++h,e.next=9;break;case 17:s.dispose();case 18:case"end":return e.stop()}}),e)}))(),"t0",8);case 8:return e.next=10,x.onEpochEnd(s,c);case 10:if(!t.stopTraining_){e.next=12;break}return e.abrupt("return","break");case 12:case"end":return e.stop()}}),e)})),j=h;case 21:if(!(j<s)){e.next=29;break}return e.delegateYield(w(j),"t0",23);case 23:if("break"!==e.t0){e.next=26;break}return e.abrupt("break",29);case 26:++j,e.next=21;break;case 29:return e.next=31,x.onTrainEnd();case 31:return e.next=33,t.history.syncData();case 33:return e.abrupt("return",t.history);case 34:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Us(e,t,n){return Vs.apply(this,arguments)}function Vs(){return(Vs=Object(go.a)(vo.a.mark((function e(t,n,r){var a,o,s,c,u,l,d,f,p,h,b,m,v,g,y,O,x,k,w,j,S,N,I,C,T=arguments;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=T.length>3&&void 0!==T[3]?T[3]:{},!t.isTraining){e.next=3;break}throw new Error("Cannot start training because another fit() call is ongoing.");case 3:return t.isTraining=!0,e.prev=4,Ms(p=null==a.batchSize?32:a.batchSize),h=!1,e.next=10,t.standardizeUserData(n,r,a.sampleWeight,a.classWeight,h,p);case 10:if(b=e.sent,o=b[0],s=b[1],f=b[2],m=!1,!(null!=a.validationData&&a.validationData.length>0)){e.next=36;break}if(m=!0,2!==a.validationData.length){e.next=22;break}c=a.validationData[0],u=a.validationData[1],e.next=27;break;case 22:if(3!==a.validationData.length){e.next=26;break}throw new la("validationData including sample weights is not supported yet.");case 26:throw new ua("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; "+"".concat(a.validationData," is invalid."));case 27:return g=!0,e.next=30,t.standardizeUserData(c,u,null,null,g,p);case 30:y=e.sent,l=y[0],d=y[1],v=l.concat(d),e.next=37;break;case 36:null!=a.validationSplit&&a.validationSplit>0&&a.validationSplit<1?(m=!0,O=Math.floor(o[0].shape[0]*(1-a.validationSplit)),x=o[0].shape[0],l=zs(o,O,x),o=zs(o,0,O),d=zs(s,O,x),s=zs(s,0,O),v=l.concat(d)):null!=a.validationSteps&&(m=!0);case 37:return k=o.concat(s).concat(f),t.checkTrainableWeightsConsistency(),w=t.makeTrainFunction(),j=t.getDedupedMetricsNames(),m?(t.makeTestFunction(),S=t.testFunction,N=j.slice().concat(j.map((function(e){return"val_"+e})))):(S=null,v=[],N=j.slice()),I=Io(a.callbacks,a.yieldEvery),e.next=45,Bs(t,w,k,j,p,a.epochs,a.verbose,I,S,v,a.shuffle,N,a.initialEpoch,null,null);case 45:return C=e.sent,e.abrupt("return",C);case 47:return e.prev=47,t.isTraining=!1,Gs(o,n),Gs(s,r),Gs(l,c),Gs(d,u),null!=f&&i.Pd(f),e.finish(47);case 55:case"end":return e.stop()}}),e,null,[[4,,47,55]])})))).apply(this,arguments)}function Hs(e){var t=[];e instanceof i.bd&&(e=[e]);for(var n=0;n<e.length;++n){var r=e[n];if(1===r.rank)t.push(si(r,1));else{if(0===r.rank)throw new Error("Expected tensor to be at least 1D, but received a 0D tensor (scalar).");t.push(r)}}return t}function Gs(e,t){if(null!=e){var n=[];if(t instanceof i.bd)n.push(t.id);else if(Array.isArray(t))t.forEach((function(e){return n.push(e.id)}));else if(null!=t)for(var r in t){var a=t[r];n.push(a.id)}var o=[];if(e instanceof i.bd)-1===n.indexOf(e.id)&&o.push(e);else if(Array.isArray(e))e.forEach((function(e){-1===n.indexOf(e.id)&&o.push(e)}));else if(null!=e)for(var s in e){var c=e[s];-1===n.indexOf(c.id)&&o.push(c)}o.forEach((function(e){e.isDisposed||e.dispose()}))}}function qs(e){return Array.isArray(e)}function Ks(e){return!function(e){return e instanceof i.bd}(e)&&!qs(e)}function Xs(e,t,n){var r,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(null==t||0===t.length){if(null!=e){var o=!1;if(qs(e)&&e.length>0)o=!0;else if(Ks(e)){for(var s in e)if(e.hasOwnProperty(s)){o=!0;break}}else o=!0;if(o)throw new ua("Error when checking model ".concat(i," expected no data, ")+"but got ".concat(e))}return[]}if(null==e)return t.map((function(e){return null}));if(Ks(e)){e=e,r=[];var c,u=Object(ea.a)(t);try{for(u.s();!(c=u.n()).done;){var l=c.value;if(null==e[l])throw new ua('No data provided for "'.concat(l,'". Need data for each key in: ')+"".concat(t));r.push(e[l])}}catch(m){u.e(m)}finally{u.f()}}else if(qs(e)){if((e=e).length!==t.length)throw new ua("Error when checking model ".concat(i,": the Array of ")+"Tensors that you are passing to your model is not the size the "+"model expected. Expected to see ".concat(t.length," Tensor(s), but ")+"instead got the following list of Tensor(s): ".concat(e));r=e}else{if(e=e,t.length>1)throw new ua("The model ".concat(i," expects ").concat(t.length," Tensor(s), ")+"but only received one Tensor. Found: Tensor with shape ".concat(e.shape));r=[e]}if(r=Hs(r),null!=n)for(var d=0;d<t.length;++d)if(null!=n[d]){var f=r[d];if(f.shape.length!==n[d].length)throw new ua("Error when checking ".concat(i,": expected ").concat(t[d]," ")+"to have ".concat(n[d].length," dimension(s). but got array with ")+"shape ".concat(f.shape));for(var p=0;p<n[d].length;++p)if(0!==p||a){var h=f.shape[p],b=n[d][p];if(null!=b&&b>=0&&h!==b)throw new ua("Error when checking ".concat(i,": expected ").concat(t[d]," ")+"to have shape [".concat(n[d],"], but got array with shape ")+"[".concat(f.shape,"]."))}}return r}function Ys(e,t,n){var r=ja(e.map((function(e){return e.shape[0]})));r.sort();var a=ja(t.map((function(e){return e.shape[0]})));if(a.sort(),r.length>1)throw new ua("All input Tensors (x) should have the same number of samples. Got array shapes: "+"".concat(JSON.stringify(e.map((function(e){return e.shape})))));if(a.length>1)throw new ua("All target Tensors (y) should have the same number of samples. Got array shapes: "+"".concat(JSON.stringify(t.map((function(e){return e.shape})))));if(r.length>0&&a.length>0&&!i.wf.arraysEqual(r,a))throw new ua("Input Tensors should have the same number of samples as target "+"Tensors. Found ".concat(r[0]," input sample(s) and ").concat(a[0]," target ")+"sample(s).")}function $s(e,t,n){for(var r=[Fo,Po,zo],a=0;a<e.length;++a){var i=e[a],o=t[a],s=n[a];if(null!=o){if(o===zo&&1===i.shape[i.shape.length-1])throw new ua("You are passing a target array of shape ".concat(i.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(o))for(var c=i.shape.slice(1),u=s.slice(1),l=0;l<c.length;++l){var d=c[l],f=u[l];if(null!=f&&d!==f)throw new ua("A target Tensor with shape ".concat(i.shape," was passed for an ")+"output of shape ".concat(s,", while using a loss function that ")+"expects targets to have the same shape as the output.")}}}}function Qs(e,t,n){var r,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(Array.isArray(e)){if(e.length!==t.length)throw new ua("Error when checking model ".concat(i,": the Array of ")+"Tensors that you are passing to your model is not the size the "+"the model expected. Expected to see ".concat(t.length," Tensor(s),")+" but instead got ".concat(e.length," Tensors(s)."));r=e}else{if(t.length>1)throw new ua("The model expects ".concat(t.length," ").concat(i," Tensors, ")+"but only received one Tensor. Found: array with shape "+"".concat(JSON.stringify(e.shape),"."));r=[e]}if(null!=n)for(var o=0;o<t.length;++o)if(null!=n[o]){var s=r[o];if(s.shape.length!==n[o].length)throw new ua("Error when checking ".concat(i,": expected ").concat(t[o]," ")+"to have ".concat(n[o].length," dimension(s), but got array with ")+"shape ".concat(JSON.stringify(s.shape)));for(var c=0;c<n[o].length;++c)if(0!==c||a){var u=s.shape[c],l=n[o][c];if(null!=l&&l!==u)throw new ua("Error when checking ".concat(i,": expected ")+"".concat(t[o]," to have shape ").concat(JSON.stringify(n[o])," but ")+"got array with shape ".concat(JSON.stringify(s.shape),"."))}}}var Zs=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).isTraining=!1,r}return Object($r.a)(n,[{key:"summary",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:console.log;if(!this.built)throw new ua("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).");as(this,e,t,n)}},{key:"compile",value: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 i.rf.adagrad(.01)},Adadelta:function(){return i.rf.adadelta(1,.95,Jr())},Adam:function(){return i.rf.adam(.001,.9,.999,Jr())},Adamax:function(){return i.rf.adamax(.002,.9,.999,Jr(),0)},RMSProp:function(){return i.rf.rmsprop(.001,.9,0,Jr())},SGD:function(){return i.rf.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 ua("Unknown Optimizer ".concat(e))}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof i.dc))throw new ua("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 ua("When passing an Array as loss, it should have one entry per "+"model output. The model has ".concat(this.outputs.length," output(s), ")+"but you passed loss=".concat(e.loss,"."));var r=e.loss;n=r.map((function(e){return Vo(e)}))}else{var a=Vo(e.loss);this.outputs.forEach((function(e){n.push(a)}))}else{for(var o in e.loss=e.loss,e.loss)if(-1===this.outputNames.indexOf(o))throw new ua('Unknown entry in loss dictionary: "'.concat(o,'". ')+"Only expected the following keys: ".concat(this.outputNames));var s,c=Object(ea.a)(this.outputNames);try{for(c.s();!(s=c.n()).done;){var u=s.value;null==e.loss[u]&&console.warn('Output "'.concat(u,'" is missing from loss dictionary. We assume ')+"this was done on purpose, and we will not be expecting data "+"to be passed to ".concat(u," during training")),n.push(Vo(e.loss[u]))}}catch(m){c.e(m)}finally{c.f()}}this.lossFunctions=n,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(var l=0;l<this.outputs.length;++l){var d=this.internalOutputShapes[l],f=this.outputNames[l];this.feedOutputNames.push(f),this.feedOutputShapes.push(d),this.feedLossFns.push(this.lossFunctions[l])}var p=[];this.metrics=e.metrics,this.metricsNames=["loss"],this.metricsTensors=[],Qa("loss",(function(){for(var e=0;e<t.outputs.length;++e)if(-1===p.indexOf(e)){var n=t.lossFunctions[e];t.outputs.length>1&&(t.metricsTensors.push([n,e]),t.metricsNames.push(t.outputNames[e]+"_loss"))}}));var h=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map((function(e){return[]}));var n;if("string"===typeof e||"function"===typeof e)n=[e];else{if(!Array.isArray(e)&&"object"!==typeof e)throw new TypeError("Type of metrics argument not understood. Expected an string,"+"function, Array, or Object, found: ".concat(e));n=e}if(Array.isArray(n))return t.map((function(e){return n}));var r,a=[],i=Object(ea.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,s=n.hasOwnProperty(o)?n[o]:[];Array.isArray(s)||(s=[s]),a.push(s)}}catch(m){i.e(m)}finally{i.f()}return a}(e.metrics,this.outputNames),b=function(e,n,r){t.outputNames.length>1&&(n=t.outputNames[e]+"_"+n),t.metricsNames.push(n),t.metricsTensors.push([r,e])};Qa("metric",(function(){for(var e=function(e){if(-1!==p.indexOf(e))return"continue";!function(n){var r,a,i,o,s=Object(ea.a)(n);try{for(s.s();!(o=s.n()).done;){var c=o.value;if("string"===typeof c&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(c)){var u=t.internalOutputShapes[e];1===u[u.length-1]||t.lossFunctions[e]===Po?-1!==["accuracy","acc"].indexOf(c)?a=Ho:-1!==["crossentropy","ce"].indexOf(c)&&(a=Xo):t.lossFunctions[e]===Lo?-1!==["accuracy","acc"].indexOf(c)?a=Yo:-1!==["crossentropy","ce"].indexOf(c)&&(a=Qo):-1!==["accuracy","acc"].indexOf(c)?a=Go:-1!==["crossentropy","ce"].indexOf(c)&&(a=$o);var l=void 0;-1!==["accuracy","acc"].indexOf(c)?l="acc":-1!==["crossentropy","ce"].indexOf(c)&&(l="ce"),i=a,r=""+l}else{var d=Jo(c);i=d,r=""+es(c)}var f=void 0;Qa(r,(function(){f=i})),b(e,r,f)}}catch(m){s.e(m)}finally{s.f()}}(h[e])},n=0;n<t.outputs.length;++n)e(n)})),this.collectedTrainableWeights=this.trainableWeights}},{key:"checkTrainableWeightsConsistency",value: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?")}},{key:"evaluate",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null==n.batchSize?32:n.batchSize;Ms(r);var a=!0,i=this.standardizeUserDataXY(e,t,a,r);try{var o=i[0].concat(i[1]);this.makeTestFunction();var s=this.testFunction,c=this.testLoop(s,o,r,n.verbose,n.steps);return ba(c)}finally{Gs(i[0],e),Gs(i[1],t)}}},{key:"evaluateDataset",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.makeTestFunction(),e.abrupt("return",Ds(this,t,n));case 2:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"checkNumSamples",value:function(e,t,n){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"steps";if(null!=n){if(r=null,null!=t)throw new ua("If ".concat(a," is set, batchSize must be null or undefined.")+"Got batchSize = ".concat(t))}else{if(null==e)throw new ua("Either the input data should have a defined shape, or "+"".concat(a," shoud be specified."));r=Array.isArray(e)?e[0].shape[0]:e.shape[0]}return r}},{key:"execute",value:function(e,t){if(Array.isArray(t)&&0===t.length)throw new ua("`outputs` is an empty Array, which is not allowed.");var n=Array.isArray(t),r=n?t:[t],a=this.retrieveSymbolicTensors(r),o=new hs;if(e instanceof i.bd&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new ua("The number of inputs provided (".concat(e.length,") ")+"does not match the number of inputs of this model "+"(".concat(this.inputs.length,")."));for(var s=0;s<this.inputs.length;++s)o.add(this.inputs[s],e[s])}else{var c,u=Object(ea.a)(this.inputs);try{for(u.s();!(c=u.n()).done;){var l=c.value,d=e[l.name];if(null==d)throw new ua("No value is provided for the model's input ".concat(l.name));o.add(l,d)}}catch(p){u.e(p)}finally{u.f()}}var f=vs(a,o);return n?f:f[0]}},{key:"retrieveSymbolicTensors",value:function(e){var t,n=fa(null,e.length),r=e.length,a=Object(ea.a)(this.layers);try{for(a.s();!(t=a.n()).done;){for(var i=t.value,o=Array.isArray(i.output)?i.output:[i.output],s=o.map((function(e){return e.name})),c=0;c<e.length;++c){var u=s.indexOf(e[c]);if(-1!==u&&(n[c]=o[u],r--),0===r)break}if(0===r)break}}catch(d){a.e(d)}finally{a.f()}if(r>0){var l=[];throw n.forEach((function(t,n){null==t&&l.push(e[n])})),new ua("Cannot find SymbolicTensors for output name(s): "+"".concat(JSON.stringify(l)))}return n}},{key:"predictLoop",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.pf((function(){var a=t.checkNumSamples(e);if(r)throw new la("Verbose predictLoop() is not implemented yet.");for(var o=Ps(a,n),s=t.outputs.map((function(e){return[]})),c=function(n){i.pf((function(){var r=o[n][0],a=o[n][1],i=zs(e,r,a),s=[];if(Array.isArray(i))for(var c=0;c<i.length;++c)s.push({key:t.inputs[c],value:i[c]});else s.push({key:t.inputs[0],value:i});var u=new hs(s);return vs(t.outputs,u)})).forEach((function(e,t){return s[t].push(e)}))},u=0;u<o.length;++u)c(u);return ba(s.map((function(e){return i.Dd(e,0)})))}))}},{key:"predict",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Hs(e);Qs(n,this.inputNames,this.feedInputShapes,!1);try{var r=null==t.batchSize?32:t.batchSize;return Ms(r),this.predictLoop(n,r)}finally{Gs(n,e)}}},{key:"predictOnBatch",value:function(e){Qs(e,this.inputNames,this.feedInputShapes,!0);var t=(Array.isArray(e)?e[0]:e).shape[0];return this.predictLoop(e,t)}},{key:"standardizeUserDataXY",value:function(e,t){var n=arguments.length>3?arguments[3]:void 0;if(null==this.optimizer_)throw new ca("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");for(var r=[],a=0;a<this.feedOutputShapes.length;++a){var i=this.feedOutputShapes[a],o=this.feedLossFns[a];o===Lo?r.push(i.slice(0,i.length-1).concat([1])):r.push(i)}if(Ys(e=Xs(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=Xs(t,this.feedOutputNames,r,!1,"target")),$s(t,this.feedLossFns,this.feedOutputShapes),this.stateful&&null!=n&&n>0&&e[0].shape[0]%n!==0)throw new ua("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size "+"".concat(n,". Found: ").concat(e[0].shape[0]," sample(s)."));return[e,t]}},{key:"standardizeUserData",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n,r,a){var i,s,c,u,l,d,f,p,h,b=arguments;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!(b.length>4&&void 0!==b[4])||b[4],s=b.length>5?b[5]:void 0,c=this.standardizeUserDataXY(t,n,i,s),u=Object(o.a)(c,2),l=u[0],d=u[1],null==r){e.next=5;break}throw new Error("sample weight is not supported yet.");case 5:if(f=null,null==a){e.next=19;break}p=ks(a,this.outputNames),f=[],h=0;case 10:if(!(h<p.length)){e.next=19;break}return e.t0=f,e.next=14,ws(d[h],null,p[h]);case 14:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 16:++h,e.next=10;break;case 19:return e.abrupt("return",[l,d,f]);case 20:case"end":return e.stop()}}),e,this)})));return function(t,n,r,a){return e.apply(this,arguments)}}()},{key:"testLoop",value:function(e,t,n){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0;return i.pf((function(){var s=r.checkNumSamples(t,n,o,"steps"),c=[];if(a>0)throw new la("Verbose mode is not implemented yet.");if(null!=o)throw new la("steps mode in testLoop() is not implemented yet");for(var u=Ps(s,n),l=Object(i.mf)(ii(0,s)),d=0;d<u.length;++d){var f=u[d][0],p=u[d][1],h=ui(l,f,p-f),b=Ls(t,h),m=e(b);if(0===d)for(var v=0;v<m.length;++v)c.push(Object(i.Pe)(0));for(var g=0;g<m.length;++g){var y=m[g];c[g]=i.nd(c[g],i.ye(p-f,y))}}for(var O=0;O<c.length;++O)c[O]=i.Qd(c[O],s);return c}))}},{key:"getDedupedMetricsNames",value:function(){for(var e=this.metricsNames,t=[],n=0;n<e.length;++n){var r=e[n],a=r;if(ha(e,r)>1){var i=ha(e.slice(0,n),r);a+="_".concat(i)}t.push(a)}return t}},{key:"makeTrainFunction",value:function(){var e=this;return function(t){var n=[],r=t.slice(0,e.inputs.length),a=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),o=t.slice(e.inputs.length+e.outputs.length,e.inputs.length+2*e.outputs.length),s=[],c=e.collectedTrainableWeights.map((function(e){return e.read()}));return[e.optimizer_.minimize((function(){for(var t=[],c=0;c<e.inputs.length;++c)t.push({key:e.inputs[c],value:r[c]});for(var u,l=new hs(t),d=vs(e.outputs,l,{training:!0}),f=0;f<e.lossFunctions.length;++f){var p=(0,e.lossFunctions[f])(a[f],d[f]);null!=o[f]&&(p=Ss(p,o[f]));var h=i.ue(p);n.push(h),u=0===f?p:i.nd(u,p)}for(var b=0;b<e.metricsTensors.length;++b){var m=void 0;if(e.outputs.length>1&&b<e.outputs.length)m=n[b];else{var v=e.metricsTensors[b][0],g=e.metricsTensors[b][1];m=i.ue(v(a[g],d[g]))}i.he(m),s.push(m)}return u=i.ue(u),e.calculateLosses().forEach((function(e){u=i.nd(u,e)})),u}),!0,c)].concat(s)}}},{key:"makeTestFunction",value:function(){var e=this;this.testFunction=function(t){return i.pf((function(){for(var n,r=[],a=t.slice(0,e.inputs.length),o=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),s=[],c=0;c<e.inputs.length;++c)s.push({key:e.inputs[c],value:a[c]});for(var u=new hs(s),l=vs(e.outputs,u),d=0;d<e.lossFunctions.length;++d){var f=e.lossFunctions[d],p=i.ue(f(o[d],l[d]));n=0===d?p:i.nd(n,p),r.push(n)}for(var h=0;h<e.metricsTensors.length;++h){var b=e.metricsTensors[h][0],m=e.metricsTensors[h][1],v=i.ue(b(o[m],l[m]));r.push(v)}return r}))}}},{key:"fit",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a=arguments;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",Us(this,t,n,r));case 2:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fitDataset",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ts(this,t,n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"trainOnBatch",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a,o,s,c,u,l,d,f,p;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.standardizeUserData(t,n);case 2:r=e.sent,a=r[0],o=r[1],s=this.makeTrainFunction(),c=s(a.concat(o)),u=[],l=Object(ea.a)(c),e.prev=9,l.s();case 11:if((d=l.n()).done){e.next=19;break}return f=d.value,e.next=15,f.data();case 15:p=e.sent,u.push(p[0]);case 17:e.next=11;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(9),l.e(e.t0);case 24:return e.prev=24,l.f(),e.finish(24);case 27:return i.Pd(c),e.abrupt("return",ba(u));case 29:case"end":return e.stop()}}),e,this,[[9,21,24,27]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getNamedWeights",value:function(e){for(var t=[],n=null!=e&&e.trainableOnly,r=n?this.trainableWeights:this.weights,a=this.getWeights(n),i=0;i<r.length;++i)n&&!r[i].trainable||t.push({name:r[i].originalName,tensor:a[i]});return t}},{key:"stopTraining",get:function(){return this.stopTraining_},set:function(e){this.stopTraining_=e}},{key:"optimizer",get:function(){return this.optimizer_},set:function(e){this.optimizer_!==e&&(this.optimizer_=e,this.isOptimizerOwned=!1)}},{key:"dispose",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"dispose",this).call(this);if(0===e.refCountAfterDispose&&null!=this.optimizer&&this.isOptimizerOwned){var t=i.ve().numTensors;this.optimizer_.dispose(),e.numDisposedVariables+=t-i.ve().numTensors}return e}},{key:"getLossIdentifiers",value:function(){var e;if("string"===typeof this.loss)e=va(this.loss);else if(Array.isArray(this.loss)){var t,n=Object(ea.a)(this.loss);try{for(n.s();!(t=n.n()).done;){if("string"!==typeof t.value)throw new Error("Serialization of non-string loss is not supported.")}}catch(c){n.e(c)}finally{n.f()}e=this.loss.map((function(e){return va(e)}))}else{var r=Object.keys(this.loss);e={};for(var a=this.loss,i=0,o=r;i<o.length;i++){var s=o[i];if("string"!==typeof a[s])throw new Error("Serialization of non-string loss is not supported.");e[s]=va(a[s])}}return e}},{key:"getMetricIdentifiers",value:function(){if("string"===typeof this.metrics||"function"===typeof this.metrics)return[va(es(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((function(e){return va(es(e))}));var e={};for(var t in this.metrics)e[t]=va(es(this.metrics[t]));return e}},{key:"getTrainingConfig",value:function(){return{loss:this.getLossIdentifiers(),metrics:this.getMetricIdentifiers(),optimizer_config:{class_name:this.optimizer.getClassName(),config:this.optimizer.getConfig()}}}},{key:"loadTrainingConfig",value:function(e){if(null!=e.weighted_metrics)throw new Error("Loading weight_metrics is not supported yet.");if(null!=e.loss_weights)throw new Error("Loading loss_weights is not supported yet.");if(null!=e.sample_weight_mode)throw new Error("Loading sample_weight_mode is not supported yet.");var t,n,r=Ao(ds(e.optimizer_config));if("string"===typeof e.loss)t=ga(e.loss);else if(Array.isArray(e.loss))t=e.loss.map((function(e){return ga(e)}));else if(null!=e.loss)for(var a in t={},e.loss)t[a]=ga(e.loss[a]);if(Array.isArray(e.metrics))n=e.metrics.map((function(e){return ga(e)}));else if(null!=e.metrics)for(var i in n={},e.metrics)n[i]=ga(e.metrics[i]);this.compile({loss:t,metrics:n,optimizer:r})}},{key:"save",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a,o,s,c,u,l,d,f;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!==typeof t){e.next=9;break}if(0!==(r=i.ge.getSaveHandlers(t)).length){e.next=6;break}throw new ua("Cannot find any save handlers for URL '".concat(t,"'"));case 6:if(!(r.length>1)){e.next=8;break}throw new ua("Found more than one (".concat(r.length,") save handlers for ")+"URL '".concat(t,"'"));case 8:t=r[0];case 9:if(null!=t.save){e.next=11;break}throw new ua("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");case 11:return e.next=13,i.ge.encodeWeights(this.getNamedWeights(n));case 13:if(a=e.sent,!1,null,o=this.toJSON(null,false),s={modelTopology:o,format:"layers-model",generatedBy:"TensorFlow.js tfjs-layers v".concat(ps),convertedBy:null},!(null!=n&&n.includeOptimizer)||null==this.optimizer){e.next=34;break}return s.trainingConfig=this.getTrainingConfig(),u="optimizer",e.t0=i.ge,e.next=25,this.optimizer.getWeights();case 25:return e.t1=e.sent,e.t2=u,e.next=29,e.t0.encodeWeights.call(e.t0,e.t1,e.t2);case 29:l=e.sent,d=l.data,f=l.specs,(c=a.specs).push.apply(c,Object(Vn.a)(f)),a.data=i.ge.concatenateArrayBuffers([a.data,d]);case 34:return null!=this.userDefinedMetadata&&(!0,ns(this.userDefinedMetadata,this.name,true),s.userDefinedMetadata=this.userDefinedMetadata),s.weightData=a.data,s.weightSpecs=a.specs,e.abrupt("return",t.save(s));case 38:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setUserDefinedMetadata",value:function(e){ns(e,this.name),this.userDefinedMetadata=e}},{key:"getUserDefinedMetadata",value:function(){return this.userDefinedMetadata}}]),n}(function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),(r=t.call(this,{})).containerNodes=new Set,r.name=e.name,null==r.name){var a=r.getClassName().toLowerCase();r.name=Yi(a)}if(r.supportsMasking=!1,r.trainable_=!0,Array.isArray(e.inputs)?r.inputs=e.inputs.slice():r.inputs=[e.inputs],Array.isArray(e.outputs)?r.outputs=e.outputs.slice():r.outputs=[e.outputs],ja(r.inputs).length!==r.inputs.length)throw new ua("The list of inputs passed to the model is redundant. All inputs should only appear once. Found: "+"".concat(r.inputs.map((function(e){return e.name}))));ja(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: "+"".concat(r.outputs.map((function(e){return e.name})))),r.inputLayers=[],r.inputLayersNodeIndices=[],r.inputLayersTensorIndices=[],r.outputLayers=[],r.outputLayersNodeIndices=[],r.outputLayersTensorIndices=[],r.layers=[],r.internalContainerRefs=[];var i,o=Object(ea.a)(r.outputs);try{for(o.s();!(i=o.n()).done;){var s=i.value,c=s.sourceLayer,u=s.nodeIndex,l=s.tensorIndex;r.outputLayers.push(c),r.outputLayersNodeIndices.push(u),r.outputLayersTensorIndices.push(l)}}catch(ke){o.e(ke)}finally{o.f()}var d,f=Object(ea.a)(r.inputs);try{for(f.s();!(d=f.n()).done;){var p=d.value,h=p.sourceLayer,b=p.nodeIndex,m=p.tensorIndex;pa(0===b,"input layer has >1 nodes"),pa(0===m,"input layer has >1 tensors"),r.inputLayers.push(h),r.inputLayersNodeIndices.push(b),r.inputLayersTensorIndices.push(m)}}catch(ke){f.e(ke)}finally{f.f()}r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var v=0;v<r.inputLayers.length;v++){var g=r.inputLayers[v];if(!(g instanceof po))throw new TypeError("Input layers to a LayersModel must be InputLayer objects. "+"Received inputs: ".concat(e.inputs,". ")+"Input ".concat(v," (0-based) originates ")+"from layer type ".concat(g.getClassName(),"."));r.inputNames.push(g.name),r.feedInputShapes.push(g.batchInputShape),r.feedInputNames.push(g.name)}var y,O=Object(ea.a)(r.outputLayers);try{for(O.s();!(y=O.n()).done;){var x=y.value;r.outputNames.push(x.name)}}catch(ke){O.e(ke)}finally{O.f()}r.internalInputShapes=r.inputs.map((function(e){return e.shape})),r.internalOutputShapes=r.outputs.map((function(e){return e.shape}));var k,w={},j={},S={},N={},I={},C=[],T=function e(t,a,i,o,s,c){null!=o&&null!=s&&null!=c||(o=t.sourceLayer,s=t.nodeIndex,c=t.tensorIndex);var u=o.inboundNodes[s];if(-1!==i.indexOf(u))throw new ca("The tensor ".concat(t.name,' at layer "').concat(o.name,'" ')+"is part of a cycle.");if(-1===a.indexOf(u)){r.containerNodes.add(n.nodeKey(o,s)),o.id in I||(I[o.id]=Object.keys(I).length),-1===i.indexOf(u)&&i.push(u);for(var l=u.inboundLayers.length,d=0;d<l;d++){e(u.inputTensors[d],a,i,u.inboundLayers[d],u.nodeIndices[d],u.tensorIndices[d])}for(a.push(u);i.indexOf(u)>=0;)i.splice(i.indexOf(u),1);C.push(u)}},E=[],A=[],R=Object(ea.a)(r.outputs);try{for(R.s();!(k=R.n()).done;){T(k.value,E,A)}}catch(ke){R.e(ke)}finally{R.f()}var F,D=C.slice().reverse(),_=Object(ea.a)(D);try{for(_.s();!(F=_.n()).done;){var M=F.value;j[M.id]=M,M.id in w||(w[M.id]=0);var z=w[M.id],L=null==S[M.outboundLayer.id]?0:S[M.outboundLayer.id];z=Math.max(z,L),S[M.outboundLayer.id]=z,N[M.outboundLayer.id]=M.outboundLayer,w[M.id]=z;for(var P=0;P<M.inboundLayers.length;P++){var B=M.inboundLayers[P],W=M.nodeIndices[P],U=B.inboundNodes[W],V=null==w[U.id]?0:w[U.id];w[U.id]=Math.max(z+1,V),j[U.id]=U}}}catch(ke){_.e(ke)}finally{_.f()}var H={};for(var G in w){var q=w[G];q in H||(H[q]=[]),H[q].push(j[G])}var K={};for(var X in S){var Y=S[X];Y in K||(K[Y]=[]),K[Y].push(N[X])}var $=Object.keys(K).map((function(e){return parseInt(e,10)})).sort(wa);r.layers=[];var Q,Z=Object(ea.a)($);try{for(Z.s();!(Q=Z.n()).done;){var J=K[Q.value];J.sort((function(e,t){var n=I[e.id],r=I[t.id];return n<r?-1:n>r?1:0}));var ee,te=Object(ea.a)(J);try{for(te.s();!(ee=te.n()).done;){var ne=ee.value;ne instanceof n&&r.internalContainerRefs.push(ne),r.layers.push(ne)}}catch(ke){te.e(ke)}finally{te.f()}}}catch(ke){Z.e(ke)}finally{Z.f()}r.layersByDepth=K,$=Object.keys(H).map((function(e){return parseInt(e,10)})).sort(wa);var re,ae=r.inputs.slice(),ie=[],oe=Object(ea.a)($);try{for(oe.s();!(re=oe.n()).done;){var se,ce=re.value,ue=Object(ea.a)(H[ce]);try{for(ue.s();!(se=ue.n()).done;){var le=se.value,de=le.outboundLayer;if(null!=de){var fe,pe=Object(ea.a)(le.inputTensors);try{for(pe.s();!(fe=pe.n()).done;){var he=fe.value;if(-1===ae.indexOf(he))throw new ca("Graph disconnected: cannot obtain value for tensor ".concat(he)+' at layer "'.concat(de.name,'". ')+"The following previous layers were accessed without "+"issue: ".concat(ie))}}catch(ke){pe.e(ke)}finally{pe.f()}var be,me=Object(ea.a)(le.outputTensors);try{for(me.s();!(be=me.n()).done;){var ve=be.value;ae.push(ve)}}catch(ke){me.e(ke)}finally{me.f()}ie.push(de.name)}}}catch(ke){ue.e(ke)}finally{ue.f()}}}catch(ke){oe.e(ke)}finally{oe.f()}r.nodesByDepth=H;var ge,ye=r.layers.map((function(e){return e.name})),Oe=Object(ea.a)(ye);try{var xe=function(){var e=ge.value,t=ye.filter((function(t){return t===e})).length;if(1!==t)throw new ca('The name "'.concat(e,'" is used ').concat(t," times ")+"in the model. All layer names should be unique. Layer names: "+JSON.stringify(ye))};for(Oe.s();!(ge=Oe.n()).done;)xe()}catch(ke){Oe.e(ke)}finally{Oe.f()}return r.outboundNodes=[],r.inboundNodes=[],new co({outboundLayer:Object(ta.a)(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 Object($r.a)(n,[{key:"assertNotDisposed",value:function(){if(0===this._refCount)throw new Error("Container '".concat(this.name,"' is already disposed."))}},{key:"dispose",value:function(){this.assertNotDisposed();var e={refCountAfterDispose:null,numDisposedVariables:0};if(0===--this._refCount){var t,n=Object(ea.a)(this.layers);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.numDisposedVariables+=r.dispose().numDisposedVariables}}catch(s){n.e(s)}finally{n.f()}var a,i=Object(ea.a)(this.internalContainerRefs);try{for(i.s();!(a=i.n()).done;){var o=a.value;e.numDisposedVariables+=o.dispose().numDisposedVariables}}catch(s){i.e(s)}finally{i.f()}}return e.refCountAfterDispose=this._refCount,e}},{key:"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}},{key:"trainableWeights",get:function(){if(this._trainableWeights.length>0)throw new ua("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[];var e,t=[],n=Object(ea.a)(this.layers);try{for(n.s();!(e=n.n()).done;){var r=e.value;t=t.concat(r.trainableWeights)}}catch(a){n.e(a)}finally{n.f()}return t}},{key:"nonTrainableWeights",get:function(){var e,t=[],n=Object(ea.a)(this.layers);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,Object(Vn.a)(r.nonTrainableWeights))}}catch(c){n.e(c)}finally{n.f()}if(!this.trainable){var a,i=[],o=Object(ea.a)(this.layers);try{for(o.s();!(a=o.n()).done;){var s=a.value;i.push.apply(i,Object(Vn.a)(s.trainableWeights))}}catch(c){o.e(c)}finally{o.f()}return i.concat(t)}return t}},{key:"weights",get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)}},{key:"loadWeights",value:function(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={},a=0,i=Object(ea.a)(this.layers);try{for(i.s();!(t=i.n()).done;){var o,s=t.value,c=Object(ea.a)(s.weights);try{for(c.s();!(o=c.n()).done;){var u=o.value;if(null!=r[u.originalName])throw new ua("Duplicate weight name: ".concat(u.originalName));r[u.originalName]=u,a++}}catch(v){c.e(v)}finally{c.f()}}}catch(v){i.e(v)}finally{i.f()}var l=[];for(var d in e){var f=d;if(null==r[d]){var p=d.split("/"),h=p.slice(0,-2).concat([p[p.length-1]]);f=h.join("/")}if(null!=r[f])l.push([r[f],e[d]]);else if(n)throw new ua("Provided weight data has no target variable: ".concat(d));delete r[f]}if(n){var b=[];for(var m in r)b.push(m);if(b.length>0)throw new ua("".concat(b.length," of ").concat(a," weights are not set: ")+"".concat(b))}ao(l)}},{key:"updatedConfig",value:function(){var e=this.getConfig(),t={};return t.className=this.getClassName(),t.config=e,t.kerasVersion="tfjs-layers ".concat(ps),t.backend="TensorFlow.js",t}},{key:"toJSON",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=fs(this.updatedConfig());return t?JSON.stringify(n):n}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){e=ma(e);for(var r=new hs,a=0;a<n.inputs.length;++a)r.add(n.inputs[a],e[a]);return vs(n.outputs,r,t)}))}},{key:"computeMask",value:function(e,t){var n=this;return Object(i.pf)((function(){var r;return e=ma(e),r=null==t?fa(null,e.length):ma(t),n.runInternalGraph(e,r)[1]}))}},{key:"computeOutputShape",value:function(e){var t=Qi(e);if(t.length!==this.inputLayers.length)throw new ua("Invalid inputShape argument ".concat(e,": ")+"model has ".concat(this.inputLayers.length," tensor inputs."));for(var n={},r=0;r<t.length;r++){var a=this.inputLayers[r],i=t[r];n[a.name+"_0_0"]=i}var o=Object.keys(this.nodesByDepth).map((function(e){return parseInt(e,10)})).sort(wa);if(o.length>1){var s,c=Object(ea.a)(o);try{for(c.s();!(s=c.n()).done;){var u,l=s.value,d=this.nodesByDepth[l],f=Object(ea.a)(d);try{for(f.s();!(u=f.n()).done;){var p=u.value,h=p.outboundLayer;if(-1===this.inputLayers.map((function(e){return e.id})).indexOf(h.id)){for(var b=[],m=0;m<p.inboundLayers.length;m++){var v=p.inboundLayers[m],g=p.nodeIndices[m],y=p.tensorIndices[m],O=n["".concat(v.name,"_").concat(g,"_").concat(y)];b.push(O)}for(var x=Qi(h.computeOutputShape(ba(b))),k=h.inboundNodes.indexOf(p),w=0;w<x.length;w++){n["".concat(h.name,"_").concat(k,"_").concat(w)]=x[w]}}}}catch(F){f.e(F)}finally{f.f()}}}catch(F){c.e(F)}finally{c.f()}}for(var j=[],S=[],N=0;N<this.outputLayers.length;N++){var I=this.outputLayers[N],C=this.outputLayersNodeIndices[N],T=this.outputLayersTensorIndices[N],E="".concat(I.name,"_").concat(C,"_").concat(T);S.push(E)}for(var A=0;A<S.length;A++){var R=S[A];pa(R in n),j.push(n[R])}return ba(j)}},{key:"runInternalGraph",value:function(e,t){null==t&&(t=fa(null,e.length));for(var n={},r=0;r<this.inputs.length;++r){var a=this.inputs[r],i=e[r],s=t[r];n[a.id]=[i,s]}var c,u=Object.keys(this.nodesByDepth).map((function(e){return parseInt(e,10)})).sort(wa),l=Object(ea.a)(u);try{for(l.s();!(c=l.n()).done;){var d,f=c.value,p=this.nodesByDepth[f],h=Object(ea.a)(p);try{for(h.s();!(d=h.n()).done;){var b,m=d.value,v=m.outboundLayer,g=m.inputTensors,y=m.outputTensors,O=new Array,x=Object(ea.a)(g);try{for(x.s();!(b=x.n()).done;){var k=b.value;k.id in n&&O.push(n[k.id])}}catch(H){x.e(H)}finally{x.f()}if(O.length===g.length){var w={},j=void 0,S=void 0,N=void 0,I=void 0;if(null!=m.callArgs&&(w=m.callArgs),1===O.length){var C=Object(o.a)(O[0],2),T=C[0],E=C[1];null==w.mask&&(w.mask=E),N=ma(v.call(T,w)),I=ma(v.computeMask(T,E)),j=[T],S=[E]}else j=O.map((function(e){return e[0]})),S=O.map((function(e){return e[1]})),null==w.mask&&(w.mask=S),N=ma(v.call(j,w)),I=ma(v.computeMask(j,S));if(v.activityRegularizer)throw new la("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(var A=0;A<y.length;++A){var R=y[A],F=N[A],D=I[A];n[R.id]=[F,D]}}}}catch(H){h.e(H)}finally{h.f()}}}catch(H){l.e(H)}finally{l.f()}var _,M=[],z=[],L=[],P=Object(ea.a)(this.outputs);try{for(P.s();!(_=P.n()).done;){var B=_.value;pa(B.id in n,"Could not compute output ".concat(B.name," : ").concat(B.id));var W=Object(o.a)(n[B.id],2),U=W[0],V=W[1];L.push(U.shape),M.push(U),z.push(V)}}catch(H){P.e(H)}finally{P.f()}return[M,z,L]}},{key:"buildNodeConversionMap",value:function(e){var t,r,a={},i=Object(ea.a)(this.layers);try{for(i.s();!(r=i.n()).done;){var o=r.value;t=o instanceof n?1:0;for(var s=0;s<o.inboundNodes.length;s++){var c=n.nodeKey(o,s);this.containerNodes.has(c)&&(a[c]=t,t+=1)}}}catch(u){i.e(u)}finally{i.f()}return a}},{key:"getLayer",value:function(e,t){if(null!=t){if(this.layers.length<=t)throw new ua("Was asked to retrieve layer at index ".concat(t,", but model only ")+"has ".concat(this.layers.length," layer(s)."));return this.layers[t]}if(null==e)throw new ua("Provide either a layer name or layer index");var n,r=Object(ea.a)(this.layers);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a.name===e)return a}}catch(i){r.e(i)}finally{r.f()}throw new ua("No such layer: ".concat(e))}},{key:"calculateLosses",value:function(){var e=this;return Object(i.pf)((function(){var t,r=[],a=Object(ea.a)(e.layers);try{for(a.s();!(t=a.n()).done;)for(var i=t.value,o=0;o<i.inboundNodes.length;++o){var s=n.nodeKey(i,o);e.containerNodes.has(s)&&r.push.apply(r,Object(Vn.a)(i.calculateLosses()))}}catch(c){a.e(c)}finally{a.f()}return r}))}},{key:"getConfig",value:function(){var e,t={name:this.name},r=this.buildNodeConversionMap(this.layers),a=[],i=Object(ea.a)(this.layers);try{for(i.s();!(e=i.n()).done;){for(var o=e.value,s=o.getClassName(),c=o.getConfig(),u=[],l=0;l<o.inboundNodes.length;l++){var d=o.inboundNodes[l],f=n.nodeKey(o,l),p={};if(this.containerNodes.has(f)){if(d.callArgs)try{JSON.stringify(d.callArgs),p=d.callArgs}catch(_){console.warn("Layer ".concat(o.name," was passed ")+"non-serializable keyword arguments: "+"".concat(d.callArgs,". They will not be included ")+"in the serialized model (and thus will be missing at deserialization time)."),p={}}if(d.inboundLayers.length>0){for(var h=[],b=0;b<d.inboundLayers.length;b++){var m=d.inboundLayers[b],v=d.nodeIndices[b],g=d.tensorIndices[b],y=r[n.nodeKey(m,v)];null==y&&(y=0),h.push([m.name,y,g,p])}u.push(h)}}}var O={};O.name=o.name,O.className=s,O.config=c,O.inboundNodes=u,a.push(O)}}catch(_){i.e(_)}finally{i.f()}t.layers=a;for(var x=[],k=0;k<this.inputLayers.length;k++){var w=this.inputLayers[k],j=this.inputLayersNodeIndices[k],S=n.nodeKey(w,j);if(this.containerNodes.has(S)){var N=r[S];null!==N&&void 0!==N||(N=0);var I=this.inputLayersTensorIndices[k];x.push([w.name,N,I])}}t.inputLayers=x;for(var C=[],T=0;T<this.outputLayers.length;T++){var E=this.outputLayers[T],A=this.outputLayersNodeIndices[T],R=n.nodeKey(E,A);if(this.containerNodes.has(R)){var F=r[R];null!==F&&void 0!==F||(F=0);var D=this.outputLayersTensorIndices[T];C.push([E.name,F,D])}}return t.outputLayers=C,t}},{key:"stateful",get:function(){if(this._stateful)throw new ua("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.");var e,t=Object(ea.a)(this.layers);try{for(t.s();!(e=t.n()).done;){if(e.value.stateful)return!0}}catch(n){t.e(n)}finally{t.f()}return!1}},{key:"resetStates",value:function(){var e=this;Object(i.pf)((function(){e.layers.forEach((function(e){e.stateful&&e.resetStates()}))}))}}],[{key:"fromConfig",value:function(e,t){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r={},a={};function i(e,t){e.name in a?a[e.name].push(t):a[e.name]=[t]}function o(e,t){var n,a,o=[],s=Object(ea.a)(t);try{for(s.s();!(a=s.n()).done;){var c=a.value,u=c[0],l=c[1],d=c[2];if(n=null==c[3]?{}:c[3],!(u in r))return void i(e,t);var f=r[u];if(f.inboundNodes.length<=l)return void i(e,t);var p=f.inboundNodes[l];o.push(p.outputTensors[d])}}catch(h){s.e(h)}finally{s.f()}o.length>0&&e.apply(ba(o),n)}function s(e){var a=e.name,o=Ao(e,null!=t.customObjects?t.customObjects:{});o.setFastWeightInitDuringBuild(n),r[a]=o,e.inboundNodes.forEach((function(e){if(!(e instanceof Array))throw new ua("Corrupted configuration, expected array for nodeData: ".concat(e));i(o,e)}))}var c,u=t.name,l=t.layers,d=Object(ea.a)(l);try{for(d.s();!(c=d.n()).done;){var f=c.value;s(f)}}catch(W){d.e(W)}finally{d.f()}for(;!Sa(a);){var p,h=Object(ea.a)(l);try{for(h.s();!(p=h.n()).done;){var b=p.value,m=r[b.name];if(m.name in a){var v=a[m.name];delete a[m.name];var g,y=Object(ea.a)(v);try{for(y.s();!(g=y.n()).done;){var O=g.value;o(m,O)}}catch(W){y.e(W)}finally{y.f()}}}}catch(W){h.e(W)}finally{h.f()}}var x,k=[],w=[],j=t.inputLayers,S=Object(ea.a)(j);try{for(S.s();!(x=S.n()).done;){var N=x.value,I=N[0],C=N[1],T=N[2];pa(I in r);var E=r[I],A=E.inboundNodes[C].outputTensors;k.push(A[T])}}catch(W){S.e(W)}finally{S.f()}var R,F=t.outputLayers,D=Object(ea.a)(F);try{for(D.s();!(R=D.n()).done;){var _=R.value,M=_[0],z=_[1],L=_[2];pa(M in r);var P=r[M],B=P.inboundNodes[z].outputTensors;w.push(B[L])}}catch(W){D.e(W)}finally{D.f()}return new e({inputs:k,outputs:w,name:u})}}]),n}(lo));Zs.className="Model",i.Se.registerClass(Zs);var Js=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return n}(Zs);Js.className="Functional",i.Se.registerClass(Js);var ec=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),e=e||{},(r=t.call(this,{inputs:[],outputs:[]})).trainable=!0,r.built=!1,r.name=null!=e.name?e.name:Yi("sequential_"),null!=e.layers){var a,i=Object(ea.a)(e.layers);try{for(i.s();!(a=i.n()).done;){var o=a.value;r.add(o)}}catch(s){i.e(s)}finally{i.f()}}return r}return Object($r.a)(n,[{key:"checkShape",value:function(e){if(e.inboundNodes[0].outputTensors[0].shape.some((function(e){return e<0})))throw new ua("Negative dimension size caused by adding layer "+"".concat(e.name," with input shape [")+"".concat(e.inboundNodes[0].inputTensors[0].shape,"]"))}},{key:"add",value:function(e){var t,r=e instanceof n||e instanceof Zs;if(r){if(1!==(t=e).outputs.length)throw new ua("All layers in a Sequential model should have a single output tensor. For multi-output layers, use the functional API.");if(1!==t.inputs.length)throw new ua("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 ua("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");var a=ho({batchShape:e.batchInputShape,dtype:e.dtype,name:e.name+"_input"});e.apply(a)}if(r)this.outputs=t.outputs,this.inputs=t.inputs;else{if(1!==e.inboundNodes.length)throw new ua("A layer added to a Sequential model must not already be "+"connected somewhere else. LayersModel received layer ".concat(e.name," ")+"which has ".concat(e.inboundNodes.length," pre-existing inbound ")+"connections.");if(1!==e.inboundNodes[0].outputTensors.length)throw new ua("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=fo(this.outputs[0])}this.inboundNodes=[],new co({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:fa(null,this.inputs.length),outputMasks:[null],inputShapes:this.inputs.map((function(e){return e.shape})),outputShapes:this.outputs[0].shape})}else{var i=e.apply(this.outputs[0]);if(Array.isArray(i))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=[i],this.inboundNodes[0].outputTensors=this.outputs,this.inboundNodes[0].outputShapes=[this.outputs[0].shape]}this.layers.push(e),this.built=!1}},{key:"pop",value: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]}}},{key:"call",value:function(e,t){return null==this.model&&this.build(),this.model.call(e,t)}},{key:"build",value:function(e){if(Ji(e),0===this.inputs.length||0===this.outputs.length)throw new TypeError("Sequential model cannot be built: model is empty. Add some layers first.");this.model=new Zs({inputs:this.inputs,outputs:this.outputs[0],name:this.name+"_model"}),this.model.trainable=this.trainable,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}},{key:"countParams",value:function(){return this.built||this.build(),Object(Eo.a)(Object(na.a)(n.prototype),"countParams",this).call(this)}},{key:"summary",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:console.log;this.built||this.build(),Object(Eo.a)(Object(na.a)(n.prototype),"summary",this).call(this,e,t,r)}},{key:"setWeights",value:function(e){null==this.model&&this.build(),this.model.setWeights(e)}},{key:"evaluate",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.built)throw new ca("The model needs to be compiled before being used.");return this.model.evaluate(e,t,n)}},{key:"evaluateDataset",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.built){e.next=2;break}throw new ca("The model needs to be compiled before being used.");case 2:return e.abrupt("return",this.model.evaluateDataset(t,n));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"predict",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==this.model&&this.build(),this.model.predict(e,t)}},{key:"predictOnBatch",value:function(e){return null==this.model&&this.build(),this.model.predictOnBatch(e)}},{key:"compile",value: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}},{key:"optimizer",get:function(){return null==this.model?void 0:this.model.optimizer},set:function(e){this.model.optimizer=e}},{key:"fit",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a=arguments;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.length>2&&void 0!==a[2]?a[2]:{},this.built){e.next=3;break}throw new ca("The model needs to be compiled before being used.");case 3:return e.abrupt("return",this.model.fit(t,n,r));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fitDataset",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.built){e.next=2;break}throw new ca("The model needs to be compiled before being used.");case 2:return e.abrupt("return",this.model.fitDataset(t,n));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"trainOnBatch",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.model.trainOnBatch(t,n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"stopTraining",get:function(){if(null==this.model)throw new ua("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 ua("Cannot set the stopTraining property of a sequential model before it is compiled.");this.model.stopTraining=e}},{key:"getConfig",value:function(){var e,t=[],n=Object(ea.a)(this.layers);try{for(n.s();!(e=n.n()).done;){var r=e.value,a={};a.className=r.getClassName(),a.config=r.getConfig(),t.push(a)}}catch(i){n.e(i)}finally{n.f()}return{name:this.name,layers:t}}}],[{key:"fromConfig",value:function(e,t){var r,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new ua("Legacy serialization format not supported yet.");r=t}else i.wf.assert(null!=t.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."})),r=t.layers,delete t.layers,o=t;var s=new e(o);if(!(s instanceof n))throw new la("Sequential.fromConfig called on non-Sequential input: ".concat(s));var c,u=Object(ea.a)(r);try{for(u.s();!(c=u.n()).done;){var l=c.value,d=void 0,f=Ao(l,d,a);a&&f.setFastWeightInitDuringBuild(!0),s.add(f)}}catch(p){u.e(p)}finally{u.f()}return s}}]),n}(Zs);ec.className="Sequential",i.Se.registerClass(ec);var tc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"getConfig",value:function(){return{}}}]),n}(i.Se.Serializable),nc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return xi(e,t)}}]),n}(tc);nc.className="elu",i.Se.registerClass(nc);var rc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return i.Qe(e)}}]),n}(tc);rc.className="selu",i.Se.registerClass(rc);var ac=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return i.Me(e)}}]),n}(tc);ac.className="relu",i.Se.registerClass(ac);var ic=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return Object(i.pf)((function(){return i.we(6,i.Me(e))}))}}]),n}(tc);ic.className="relu6",i.Se.registerClass(ic);var oc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return e}}]),n}(tc);oc.className="linear",i.Se.registerClass(oc);var sc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return i.Ue(e)}}]),n}(tc);sc.className="sigmoid",i.Se.registerClass(sc);var cc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return function(e){return Object(i.pf)((function(){var t=i.nd(.5,i.ye(.2,e));return i.Bd(t,0,1)}))}(e)}}]),n}(tc);cc.className="hardSigmoid",i.Se.registerClass(cc);var uc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return i.cf(e)}}]),n}(tc);uc.className="softplus",i.Se.registerClass(uc);var lc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return function(e){return Object(i.pf)((function(){return i.Qd(e,i.nd(i.md(e),1))}))}(e)}}]),n}(tc);lc.className="softsign",i.Se.registerClass(lc);var dc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return i.kf(e)}}]),n}(tc);dc.className="tanh",i.Se.registerClass(dc);var fc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return i.bf(e,t)}}]),n}(tc);fc.className="softmax",i.Se.registerClass(fc);var pc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return i.ne(e,t)}}]),n}(tc);pc.className="logSoftmax",i.Se.registerClass(pc);var hc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Object(i.pf)((function(){return i.ye(i.Ue(i.ye(e,t)),e)}))}}]),n}(tc);hc.className="swish",i.Se.registerClass(hc);var bc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e){return Object(i.pf)((function(){return i.ye(e,i.kf(i.cf(e)))}))}}]),n}(tc);function mc(e){return e.getClassName()}function vc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ka(e,i.Se.SerializationMap.getMap().classNameMap,t,"activation")}function gc(e){if(null==e){var t={className:"linear",config:{}};return vc(t)}if("string"===typeof e){var n={};return n.className=e,n.config={},vc(n)}return e instanceof tc?e:vc(e)}function yc(e){if(null!=e&&"object"!==typeof e)throw new Error("Argument to L1L2 regularizer's constructor is expected to be an "+"object, but received: ".concat(e))}bc.className="mish",i.Se.registerClass(bc);var Oc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return n}(i.Se.Serializable),xc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this),yc(e),r.l1=null==e||null==e.l1?.01:e.l1,r.l2=null==e||null==e.l2?.01:e.l2,r.hasL1=0!==r.l1,r.hasL2=0!==r.l2,r}return Object($r.a)(n,[{key:"apply",value:function(e){var t=this;return Object(i.pf)((function(){var n=Object(i.Bf)([1]);return t.hasL1&&(n=Object(i.nd)(n,Object(i.if)(i.ye(t.l1,Object(i.md)(e))))),t.hasL2&&(n=Object(i.nd)(n,Object(i.if)(i.ye(t.l2,gi(e))))),i.Ne(n,[])}))}},{key:"getConfig",value:function(){return{l1:this.l1,l2:this.l2}}}],[{key:"fromConfig",value:function(e,t){return new e({l1:t.l1,l2:t.l2})}}]),n}(Oc);xc.className="L1L2",i.Se.registerClass(xc);var kc={l1l2:"L1L2"};function wc(e){return Oa(e)}function jc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ka(e,i.Se.SerializationMap.getMap().classNameMap,t,"regularizer")}function Sc(e){return null==e?null:"string"===typeof e?jc({className:e in kc?kc[e]:e,config:{}}):e instanceof Oc?e:jc(e)}var Nc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,null==e?{}:e)).supportsMasking=!0,null!=e&&(r.maxValue=e.maxValue),r}return Object($r.a)(n,[{key:"call",value:function(e,t){e=Zi(e);var n=Object(i.Me)(e);return null!=this.maxValue&&(n=Object(i.Bd)(n,0,this.maxValue)),n}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={maxValue:this.maxValue},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Nc.className="ReLU",i.Se.registerClass(Nc);var Ic=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_ALPHA=.3,null==e&&(e={}),r.alpha=null==e.alpha?r.DEFAULT_ALPHA:e.alpha,r}return Object($r.a)(n,[{key:"call",value:function(e,t){var n=Zi(e);return Object(i.je)(n,this.alpha)}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={alpha:this.alpha},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Ic.className="LeakyReLU",i.Se.registerClass(Ic);var Cc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),r.supportsMasking=!0,r.alphaInitializer=Gi(e.alphaInitializer||r.DEFAULT_ALPHA_INITIALIZER),r.alphaRegularizer=Sc(e.alphaRegularizer),r.alphaConstraint=Ba(e.alphaConstraint),null==e.sharedAxes)r.sharedAxes=null;else if(Array.isArray(e.sharedAxes))r.sharedAxes=e.sharedAxes;else{if("number"!==typeof e.sharedAxes)throw new ua("Expected sharedAxes to be a number or an array of numbers, "+"but got ".concat(e.sharedAxes));r.sharedAxes=[e.sharedAxes]}return r}return Object($r.a)(n,[{key:"build",value:function(e){var t=(e=Ji(e)).slice(1);if(null!=this.sharedAxes){var n,r=Object(ea.a)(this.sharedAxes);try{for(r.s();!(n=r.n()).done;){t[n.value-1]=1}}catch(o){r.e(o)}finally{r.f()}}this.alpha=this.addWeight("alpha",t,"float32",this.alphaInitializer,this.alphaRegularizer,!0,this.alphaConstraint);var a={};if(null!=this.sharedAxes)for(var i=1;i<e.length;++i)a[i]=e[i];this.inputSpec=[new io({ndim:e.length,axes:a})],this.built=!0}},{key:"call",value:function(e,t){return e=Zi(e),Object(i.He)(e,this.alpha.read())}},{key:"getConfig",value:function(){var e={alphaInitializer:Hi(this.alphaInitializer),alphaRegularizer:wc(this.alphaRegularizer),alphaConstraint:La(this.alphaConstraint),sharedAxes:this.sharedAxes},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Cc.className="PReLU",i.Se.registerClass(Cc);var Tc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_ALPHA=1,null==e&&(e={}),null!=e.alpha&&e.alpha!==r.DEFAULT_ALPHA)throw new la("Non-default alpha value (".concat(e.alpha,") is not supported by the ")+"ELU layer yet.");return r.alpha=null==e.alpha?r.DEFAULT_ALPHA:e.alpha,r}return Object($r.a)(n,[{key:"call",value:function(e,t){var n=Zi(e);return Object(i.Sd)(n)}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={alpha:this.alpha},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Tc.className="ELU",i.Se.registerClass(Tc);var Ec=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_THETA=1,null==e&&(e={}),r.theta=null==e.theta?r.DEFAULT_THETA:e.theta,r}return Object($r.a)(n,[{key:"call",value:function(e,t){var n=Zi(e);return Object(i.ye)(n,Object(i.Ad)(Object(i.de)(n,this.theta),"float32"))}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={theta:this.theta},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Ec.className="ThresholdedReLU",i.Se.registerClass(Ec);var Ac=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,null==e?{}:e)).DEFAULT_AXIS=1,null==e&&(e={}),r.softmax=(new fc).apply,r.axis=null==e.axis?r.DEFAULT_AXIS:e.axis,r}return Object($r.a)(n,[{key:"call",value:function(e,t){var n=Zi(e);return this.softmax(n,this.axis)}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e={axis:this.axis},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Ac.className="Softmax",i.Se.registerClass(Ac);var Rc=n(98);function Fc(e,t,n){if("number"===typeof e)return fa(e,t);if(e.length!==t)throw new ua("The ".concat(n," argument must be an integer or tuple of ").concat(t," integers.")+" Received: ".concat(e.length," elements."));for(var r=0;r<t;++r){var a=e[r];if((i=a)!==parseInt(i.toString(),10))throw new ua("The ".concat(n," argument must be an integer or tuple of ").concat(t)+" integers. Received: ".concat(JSON.stringify(e)," including a")+" non-integer number ".concat(a))}return e;var i}function Dc(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(null==e)return e;var i,o=t+(t-1)*(a-1);return i="same"===n?e:e-o+1,Math.floor((i+r-1)/r)}function _c(e,t,n,r){if(null==e)return null;if("valid"===r)e=e*t+ai([n-t,0]);else{if("same"!==r)throw new ua("Unsupport padding mode: ".concat(r,"."));e*=t}return e}function Mc(e,t){return Object(i.pf)((function(){return Ka(t),"channelsFirst"===t?i.sf(e,[0,2,3,1]):e}))}function zc(e,t){return Object(i.pf)((function(){return Ka(t),"channelsFirst"===t?i.sf(e,[0,2,3,4,1]):e}))}function Lc(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"valid",o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;return Object(i.pf)((function(){if(null==o&&(o="channelsLast"),Ka(o),3!==e.shape.length)throw new ua("The input of a conv1dWithBias operation should be 3, but is "+"".concat(e.shape.length," instead."));if(3!==t.shape.length)throw new ua("The kernel for a conv1dWithBias operation should be 3, but is "+"".concat(t.shape.length," instead"));if(null!=n&&1!==n.shape.length)throw new ua("The bias for a conv1dWithBias operation should be 1, but is "+"".concat(t.shape.length," instead"));if("channelsFirst"===o&&(e=i.sf(e,[0,2,1])),"causal"===a)throw new la("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");var c=i.Id(e,t,r,"same"===a?"same":"valid","NWC",s);return null!=n&&(c=Oi(c,n)),c}))}function Pc(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"valid",o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;return Object(i.pf)((function(){if(null==o&&(o="channelsLast"),Ka(o),3!==e.rank&&4!==e.rank)throw new ua("conv2dWithBiasActivation expects input to be of rank 3 or 4, "+"but received ".concat(e.rank,"."));if(3!==t.rank&&4!==t.rank)throw new ua("conv2dWithBiasActivation expects kernel to be of rank 3 or 4, "+"but received ".concat(e.rank,"."));var u=Mc(e,o);if("causal"===a)throw new la("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return u=i.be.conv2d({x:u,filter:t,strides:r,pad:"same"===a?"same":"valid",dilations:s,dataFormat:"NHWC",bias:n,activation:c}),"channelsFirst"===o&&(u=i.sf(u,[0,3,1,2])),u}))}function Bc(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1,1,1],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"valid",o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;return Object(i.pf)((function(){if(null==o&&(o="channelsLast"),Ka(o),4!==e.rank&&5!==e.rank)throw new ua("conv3dWithBias expects input to be of rank 4 or 5, but received "+"".concat(e.rank,"."));if(4!==t.rank&&5!==t.rank)throw new ua("conv3dWithBias expects kernel to be of rank 4 or 5, but received "+"".concat(e.rank,"."));var c=zc(e,o);if("causal"===a)throw new la("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return c=i.Ld(c,t,r,"same"===a?"same":"valid","NDHWC",s),null!=n&&(c=Oi(c,n)),"channelsFirst"===o&&(c=i.sf(c,[0,4,1,2,3])),c}))}var Wc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e,r){var a;if(Object(Yr.a)(this,n),(a=t.call(this,r)).bias=null,a.DEFAULT_KERNEL_INITIALIZER="glorotNormal",a.DEFAULT_BIAS_INITIALIZER="zeros",n.verifyArgs(r),a.rank=e,Ca(a.rank,"rank"),1!==a.rank&&2!==a.rank&&3!==a.rank)throw new la("Convolution layer for rank other than 1, 2, or 3 (".concat(a.rank,") is ")+"not implemented yet.");if(a.kernelSize=Fc(r.kernelSize,e,"kernelSize"),a.strides=Fc(null==r.strides?1:r.strides,e,"strides"),a.padding=null==r.padding?"valid":r.padding,Xa(a.padding),a.dataFormat=null==r.dataFormat?"channelsLast":r.dataFormat,Ka(a.dataFormat),a.activation=gc(r.activation),a.useBias=null==r.useBias||r.useBias,a.biasInitializer=Gi(r.biasInitializer||a.DEFAULT_BIAS_INITIALIZER),a.biasConstraint=Ba(r.biasConstraint),a.biasRegularizer=Sc(r.biasRegularizer),a.activityRegularizer=Sc(r.activityRegularizer),a.dilationRate=Fc(null==r.dilationRate?1:r.dilationRate,e,"dilationRate"),1===a.rank&&Array.isArray(a.dilationRate)&&1!==a.dilationRate.length)throw new ua("dilationRate must be a number or an array of a single number for 1D convolution, but received "+"".concat(JSON.stringify(a.dilationRate)));if(2===a.rank){if("number"===typeof a.dilationRate)a.dilationRate=[a.dilationRate,a.dilationRate];else if(2!==a.dilationRate.length)throw new ua("dilationRate must be a number or array of two numbers for 2D "+"convolution, but received ".concat(JSON.stringify(a.dilationRate)))}else if(3===a.rank)if("number"===typeof a.dilationRate)a.dilationRate=[a.dilationRate,a.dilationRate,a.dilationRate];else if(3!==a.dilationRate.length)throw new ua("dilationRate must be a number or array of three numbers for 3D "+"convolution, but received ".concat(JSON.stringify(a.dilationRate)));return a}return Object($r.a)(n,[{key:"getConfig",value:function(){var e={kernelSize:this.kernelSize,strides:this.strides,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,activation:mc(this.activation),useBias:this.useBias,biasInitializer:Hi(this.biasInitializer),biasRegularizer:wc(this.biasRegularizer),activityRegularizer:wc(this.activityRegularizer),biasConstraint:La(this.biasConstraint)},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}],[{key:"verifyArgs",value:function(e){if(pa("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!==typeof e.kernelSize&&!Ia(e.kernelSize,"number",1,3))throw new ua("BaseConv expects config.kernelSize to be number or number[] with "+"length 1, 2, or 3, but received ".concat(JSON.stringify(e.kernelSize),"."))}}]),n}(lo),Uc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e,r){var a;return Object(Yr.a)(this,n),(a=t.call(this,e,r)).kernel=null,n.verifyArgs(r),a.filters=r.filters,Ca(a.filters,"filters"),a.kernelInitializer=Gi(r.kernelInitializer||a.DEFAULT_KERNEL_INITIALIZER),a.kernelConstraint=Ba(r.kernelConstraint),a.kernelRegularizer=Sc(r.kernelRegularizer),a}return Object($r.a)(n,[{key:"build",value:function(e){e=Ji(e);var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ua("The channel dimension of the input should be defined. "+"Found ".concat(e[t]));var n=e[t],r=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",r,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:Object(Rc.a)({},t,n)}],this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var t;e=Zi(e);var r=null==n.bias?null:n.bias.read(),a=Ea(n.activation.getClassName());if(null!=a&&2===n.rank)t=Pc(e,n.kernel.read(),r,n.strides,n.padding,n.dataFormat,n.dilationRate,a);else{if(1===n.rank)t=Lc(e,n.kernel.read(),r,n.strides[0],n.padding,n.dataFormat,n.dilationRate[0]);else if(2===n.rank)t=Pc(e,n.kernel.read(),r,n.strides,n.padding,n.dataFormat,n.dilationRate);else{if(3!==n.rank)throw new la("convolutions greater than 3D are not implemented yet.");t=Bc(e,n.kernel.read(),r,n.strides,n.padding,n.dataFormat,n.dilationRate)}null!=n.activation&&(t=n.activation.apply(t))}return t}))}},{key:"computeOutputShape",value:function(e){e=Ji(e);for(var t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2),r=0;r<n.length;++r){var a=Dc(n[r],this.kernelSize[r],this.padding,this.strides[r],"number"===typeof this.dilationRate?this.dilationRate:this.dilationRate[r]);t.push(a)}var i=[e[0]];return"channelsLast"===this.dataFormat?(i=i.concat(t)).push(this.filters):(i.push(this.filters),i=i.concat(t)),i}},{key:"getConfig",value:function(){var e={filters:this.filters,kernelInitializer:Hi(this.kernelInitializer),kernelRegularizer:wc(this.kernelRegularizer),kernelConstraint:La(this.kernelConstraint)},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}],[{key:"verifyArgs",value:function(e){if(!("filters"in e)||"number"!==typeof e.filters||e.filters<1)throw new ua("Convolution layer expected config.filters to be a 'number' > 0 "+"but got ".concat(JSON.stringify(e.filters)))}}]),n}(Wc),Vc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this,2,e),n.verifyArgs(e),r}return Object($r.a)(n,[{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return delete e.rank,e}}],[{key:"verifyArgs",value:function(e){if("number"!==typeof e.kernelSize&&!Ia(e.kernelSize,"number",1,2))throw new ua("Conv2D expects config.kernelSize to be number or number[] with "+"length 1 or 2, but received ".concat(JSON.stringify(e.kernelSize),"."))}}]),n}(Uc);Vc.className="Conv2D",i.Se.registerClass(Vc);var Hc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this,3,e),n.verifyArgs(e),r}return Object($r.a)(n,[{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return delete e.rank,e}}],[{key:"verifyArgs",value:function(e){if("number"!==typeof e.kernelSize&&(!Array.isArray(e.kernelSize)||1!==e.kernelSize.length&&3!==e.kernelSize.length))throw new ua("Conv3D expects config.kernelSize to be number or"+" [number, number, number], but received ".concat(JSON.stringify(e.kernelSize),"."))}}]),n}(Uc);Hc.className="Conv3D",i.Se.registerClass(Hc);var Gc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),(r=t.call(this,e)).inputSpec=[new io({ndim:4})],"same"!==r.padding&&"valid"!==r.padding)throw new ua("Conv2DTranspose currently supports only padding modes 'same' "+"and 'valid', but received padding mode ".concat(r.padding));return r}return Object($r.a)(n,[{key:"build",value:function(e){if(4!==(e=Ji(e)).length)throw new ua("Input should have rank 4; Received input shape: "+JSON.stringify(e));var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ua("The channel dimension of the inputs should be defined. Found `None`.");var n=e[t],r=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",r,"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 io({ndim:4,axes:Object(Rc.a)({},t,n)})],this.built=!0}},{key:"call",value:function(e,t){var n=this;return i.pf((function(){var t=Zi(e);if(4!==t.shape.length)throw new ua("Conv2DTranspose.call() expects input tensor to be rank-4, but "+"received a tensor of rank-".concat(t.shape.length));var r,a,o=t.shape,s=o[0];"channelsFirst"===n.dataFormat?(r=2,a=3):(r=1,a=2);var c=o[r],u=o[a],l=n.kernelSize[0],d=n.kernelSize[1],f=n.strides[0],p=n.strides[1],h=[s,_c(c,f,l,n.padding),_c(u,p,d,n.padding),n.filters];"channelsLast"!==n.dataFormat&&(t=i.sf(t,[0,2,3,1]));var b=i.Kd(t,n.kernel.read(),h,n.strides,n.padding);return"channelsLast"!==n.dataFormat&&(b=i.sf(b,[0,3,1,2])),null!=n.bias&&(b=Oi(b,n.bias.read(),n.dataFormat)),null!=n.activation&&(b=n.activation.apply(b)),b}))}},{key:"computeOutputShape",value:function(e){var t,n,r,a=(e=Ji(e)).slice();"channelsFirst"===this.dataFormat?(t=1,n=2,r=3):(t=3,n=1,r=2);var i=this.kernelSize[0],o=this.kernelSize[1],s=this.strides[0],c=this.strides[1];return a[t]=this.filters,a[n]=_c(a[n],s,i,this.padding),a[r]=_c(a[r],c,o,this.padding),a}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return delete e.dilationRate,e}}]),n}(Vc);Gc.className="Conv2DTranspose",i.Se.registerClass(Gc);var qc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),(r=t.call(this,e)).inputSpec=[new io({ndim:5})],"same"!==r.padding&&"valid"!==r.padding)throw new ua("Conv3DTranspose currently supports only padding modes 'same' "+"and 'valid', but received padding mode ".concat(r.padding));return r}return Object($r.a)(n,[{key:"build",value:function(e){if(5!==(e=Ji(e)).length)throw new ua("Input should have rank 5; Received input shape: "+JSON.stringify(e));var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new ua("The channel dimension of the inputs should be defined. Found `None`.");var n=e[t],r=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",r,"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 io({ndim:5,axes:Object(Rc.a)({},t,n)})],this.built=!0}},{key:"call",value:function(e,t){var n=this;return i.pf((function(){var t=Zi(e);if(5!==t.shape.length)throw new ua("Conv3DTranspose.call() expects input tensor to be rank-4, but "+"received a tensor of rank-".concat(t.shape.length));var r,a,o,s=t.shape,c=s[0];"channelsFirst"===n.dataFormat?(o=2,r=3,a=4):(o=1,r=2,a=3);var u=s[o],l=s[r],d=s[a],f=n.kernelSize[0],p=n.kernelSize[1],h=n.kernelSize[2],b=n.strides[0],m=n.strides[1],v=n.strides[2],g=[c,_c(u,b,f,n.padding),_c(l,m,p,n.padding),_c(d,v,h,n.padding),n.filters];"channelsLast"!==n.dataFormat&&(t=i.sf(t,[0,2,3,4,1]));var y=i.Md(t,n.kernel.read(),g,n.strides,n.padding);return"channelsLast"!==n.dataFormat&&(y=i.sf(y,[0,4,1,2,3])),null!==n.bias&&(y=Oi(y,n.bias.read(),n.dataFormat)),null!==n.activation&&(y=n.activation.apply(y)),y}))}},{key:"computeOutputShape",value:function(e){var t,n,r,a,i=(e=Ji(e)).slice();"channelsFirst"===this.dataFormat?(t=1,n=2,r=3,a=4):(t=4,n=1,r=2,a=3);var o=this.kernelSize[0],s=this.kernelSize[1],c=this.kernelSize[2],u=this.strides[0],l=this.strides[1],d=this.strides[2];return i[t]=this.filters,i[n]=_c(i[n],u,o,this.padding),i[r]=_c(i[r],l,s,this.padding),i[a]=_c(i[a],d,c,this.padding),i}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return delete e.dilationRate,e}}]),n}(Hc);qc.className="Conv3DTranspose",i.Se.registerClass(qc);var Kc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e,r){var a;if(Object(Yr.a)(this,n),(a=t.call(this,e,r)).DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",a.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",a.depthwiseKernel=null,a.pointwiseKernel=null,null==r.filters)throw new ua("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=r.kernelInitializer||null!=r.kernelRegularizer||null!=r.kernelConstraint)throw new ua("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=r.padding&&"same"!==r.padding&&"valid"!==r.padding)throw new ua("SeparableConv".concat(a.rank,"D supports only padding modes: ")+"'same' and 'valid', but received ".concat(JSON.stringify(r.padding)));return a.depthMultiplier=null==r.depthMultiplier?1:r.depthMultiplier,a.depthwiseInitializer=Gi(r.depthwiseInitializer||a.DEFAULT_DEPTHWISE_INITIALIZER),a.depthwiseRegularizer=Sc(r.depthwiseRegularizer),a.depthwiseConstraint=Ba(r.depthwiseConstraint),a.pointwiseInitializer=Gi(r.depthwiseInitializer||a.DEFAULT_POINTWISE_INITIALIZER),a.pointwiseRegularizer=Sc(r.pointwiseRegularizer),a.pointwiseConstraint=Ba(r.pointwiseConstraint),a}return Object($r.a)(n,[{key:"build",value:function(e){if((e=Ji(e)).length<this.rank+2)throw new ua("Inputs to SeparableConv".concat(this.rank,"D should have rank ")+"".concat(this.rank+2,", but received input shape: ")+"".concat(JSON.stringify(e)));var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t]||e[t]<0)throw new ua("The channel dimension of the inputs should be defined, "+"but found ".concat(JSON.stringify(e[t])));for(var n=e[t],r=this.kernelSize.concat([n,this.depthMultiplier]),a=[],i=0;i<this.rank;++i)a.push(1);a.push(n*this.depthMultiplier,this.filters);var o=!0;this.depthwiseKernel=this.addWeight("depthwise_kernel",r,"float32",this.depthwiseInitializer,this.depthwiseRegularizer,o,this.depthwiseConstraint),this.pointwiseKernel=this.addWeight("pointwise_kernel",a,"float32",this.pointwiseInitializer,this.pointwiseRegularizer,o,this.pointwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,o,this.biasConstraint):this.bias=null,this.inputSpec=[new io({ndim:this.rank+2,axes:Object(Rc.a)({},t,n)})],this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var t;if(e=Zi(e),1===n.rank)throw new la("1D separable convolution is not implemented yet.");return 2===n.rank&&("channelsFirst"===n.dataFormat&&(e=i.sf(e,[0,2,3,1])),t=i.Re(e,n.depthwiseKernel.read(),n.pointwiseKernel.read(),n.strides,n.padding,n.dilationRate,"NHWC")),n.useBias&&(t=Oi(t,n.bias.read(),n.dataFormat)),null!=n.activation&&(t=n.activation.apply(t)),"channelsFirst"===n.dataFormat&&(t=i.sf(t,[0,3,1,2])),t}))}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return delete e.rank,delete e.kernelInitializer,delete e.kernelRegularizer,delete e.kernelConstraint,e.depthwiseInitializer=Hi(this.depthwiseInitializer),e.pointwiseInitializer=Hi(this.pointwiseInitializer),e.depthwiseRegularizer=wc(this.depthwiseRegularizer),e.pointwiseRegularizer=wc(this.pointwiseRegularizer),e.depthwiseConstraint=La(this.depthwiseConstraint),e.pointwiseConstraint=La(this.pointwiseConstraint),e}}]),n}(Uc);Kc.className="SeparableConv";var Xc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,2,e)}return n}(Kc);Xc.className="SeparableConv2D",i.Se.registerClass(Xc);var Yc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this,1,e),n.verifyArgs(e),r.inputSpec=[{ndim:3}],r}return Object($r.a)(n,[{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return delete e.rank,delete e.dataFormat,e}}],[{key:"verifyArgs",value:function(e){if("number"!==typeof e.kernelSize&&!Ia(e.kernelSize,"number",1,1))throw new ua("Conv1D expects config.kernelSize to be number or number[] with "+"length 1, but received ".concat(JSON.stringify(e.kernelSize),"."))}}]),n}(Uc);Yc.className="Conv1D",i.Se.registerClass(Yc);var $c=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),r=t.call(this,e),"number"===typeof e.cropping?r.cropping=[[e.cropping,e.cropping],[e.cropping,e.cropping]]:"number"===typeof e.cropping[0]?r.cropping=[[e.cropping[0],e.cropping[0]],[e.cropping[1],e.cropping[1]]]:r.cropping=e.cropping,r.dataFormat=void 0===e.dataFormat?"channelsLast":e.dataFormat,r.inputSpec=[{ndim:4}],r}return Object($r.a)(n,[{key:"computeOutputShape",value: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]]}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){if(e=Zi(e),"channelsLast"===n.dataFormat){var t=di(e,n.cropping[0][0],e.shape[1]-n.cropping[0][0]-n.cropping[0][1],2);return di(t,n.cropping[1][0],e.shape[2]-n.cropping[1][1]-n.cropping[1][0],3)}var r=di(e,n.cropping[0][0],e.shape[2]-n.cropping[0][0]-n.cropping[0][1],3);return di(r,n.cropping[1][0],e.shape[3]-n.cropping[1][1]-n.cropping[1][0],4)}))}},{key:"getConfig",value:function(){var e={cropping:this.cropping,dataFormat:this.dataFormat},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);$c.className="Cropping2D",i.Se.registerClass($c);var Qc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r,a;return Object(Yr.a)(this,n),(r=t.call(this,e)).DEFAULT_SIZE=[2,2],r.inputSpec=[{ndim:4}],r.size=null==e.size?r.DEFAULT_SIZE:e.size,r.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ka(r.dataFormat),r.interpolation=null==e.interpolation?"nearest":e.interpolation,a=r.interpolation,Na(Ua,"InterpolationFormat",a),r}return Object($r.a)(n,[{key:"computeOutputShape",value: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]}var r=null==e[1]?null:this.size[0]*e[1],a=null==e[2]?null:this.size[1]*e[2];return[e[0],r,a,e[3]]}},{key:"call",value:function(e,t){var n=this;return i.pf((function(){var t=Zi(e),r=t.shape;if("channelsFirst"===n.dataFormat){t=i.sf(t,[0,2,3,1]);var a=n.size[0]*r[2],o=n.size[1]*r[3],s="nearest"===n.interpolation?i.fe.resizeNearestNeighbor(t,[a,o]):i.fe.resizeBilinear(t,[a,o]);return i.sf(s,[0,3,1,2])}var c=n.size[0]*r[1],u=n.size[1]*r[2];return"nearest"===n.interpolation?i.fe.resizeNearestNeighbor(t,[c,u]):i.fe.resizeBilinear(t,[c,u])}))}},{key:"getConfig",value:function(){var e={size:this.size,dataFormat:this.dataFormat},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Qc.className="UpSampling2D",i.Se.registerClass(Qc);var Zc=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,2,e)).depthwiseKernel=null,r.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,r.depthwiseInitializer=Gi(e.depthwiseInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.depthwiseConstraint=Ba(e.depthwiseConstraint),r.depthwiseRegularizer=Sc(e.depthwiseRegularizer),r}return Object($r.a)(n,[{key:"build",value:function(e){if((e=Ji(e)).length<4)throw new ua("Inputs to DepthwiseConv2D should have rank 4. "+"Received input shape: ".concat(JSON.stringify(e),"."));var t="channelsFirst"===this.dataFormat?1:3;if(null==e[t]||e[t]<0)throw new ua("The channel dimension of the inputs to DepthwiseConv2D should "+"be defined, but is not (".concat(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}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var t=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[1,1],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"valid",a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;return Object(i.pf)((function(){null==a&&(a="channelsLast"),Ka(a);var s=Mc(e,a);if(4!==e.rank)throw new ua("Input for depthwiseConv2d is required to be 4-D, but is instead "+"".concat(e.rank,"-D"));if(4!==t.rank)throw new ua("depthwiseKernel is required to be 4-D, but is instead "+"".concat(t.rank,"-D"));return s=i.Nd(s,t,n,"same"===r?"same":"valid","NHWC",o),"channelsFirst"===a&&(s=i.sf(s,[0,3,1,2])),s}))}(e=Zi(e),n.depthwiseKernel.read(),n.strides,n.padding,n.dataFormat,null);return n.useBias&&(t=Oi(t,n.bias.read(),n.dataFormat)),null!=n.activation&&(t=n.activation.apply(t)),t}))}},{key:"computeOutputShape",value:function(e){e=Ji(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,a=Dc(t,this.kernelSize[0],this.padding,this.strides[0]),i=Dc(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],r,a,i]:[e[0],a,i,r]}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=Hi(this.depthwiseInitializer),e.depthwiseRegularizer=wc(this.depthwiseRegularizer),e.depthwiseConstraint=La(this.depthwiseRegularizer),e}}]),n}(Wc);function Jc(e,t,n,r){if(Array.isArray(e)){if(null!=t||null!=n)throw new ua("When inputs 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 a(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=a(t),constants:n=a(n)}}function eu(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]&&arguments[7];return i.pf((function(){var u=t.shape.length;if(u<3)throw new ua("Input should be at least 3D, but is ".concat(u,"D."));var l=[1,0].concat(ii(2,u));if(t=i.sf(t,l),null!=o)throw new la("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!=a&&((a=i.Ad(i.Ad(a,"bool"),"float32")).rank===u-1&&(a=i.Xd(a,-1)),a=i.sf(a,l)),r&&(t=i.Oe(t,0),null!=a&&(a=i.Oe(a,0)));var d,f,p=[],h=n,b=t.shape[0],m=i.uf(t);null!=a&&(f=i.uf(a));for(var v,g=function(t){var n=m[t],r=i.pf((function(){return e(n,h)}));if(null==a)d=r[0],h=r[1];else{var o=i.pf((function(){var e=f[t],n=i.hf(i.Ee(e),e);return{output:i.nd(i.ye(r[0],e),i.ye(h[0],n)),newStates:h.map((function(t,a){return i.nd(i.ye(r[1][a],e),i.ye(t,n))}))}}));d=o.output,h=o.newStates}c&&p.push(d)},y=0;y<b;++y)g(y);if(c){v=i.gf(p,1)}return[d,v,h]}))}Zc.className="DepthwiseConv2D",i.Se.registerClass(Zc);var tu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r,a;if(Object(Yr.a)(this,n),r=t.call(this,e),null==e.cell)throw new ua("cell property is missing for the constructor of RNN.");if(null==(a=Array.isArray(e.cell)?new uu({cells:e.cell}):e.cell).stateSize)throw new ua("The RNN cell should have an attribute `stateSize` (tuple of integers, one integer per RNN state).");return r.cell=a,r.returnSequences=null!=e.returnSequences&&e.returnSequences,r.returnState=null!=e.returnState&&e.returnState,r.goBackwards=null!=e.goBackwards&&e.goBackwards,r._stateful=null!=e.stateful&&e.stateful,r.unroll=null!=e.unroll&&e.unroll,r.supportsMasking=!0,r.inputSpec=[new io({ndim:3})],r.stateSpec=null,r.states_=null,r.numConstants=null,r.keptStates=[],r}return Object($r.a)(n,[{key:"getStates",value:function(){return null==this.states_?ii(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((function(e){return null})):this.states_}},{key:"setStates",value:function(e){this.states_=e}},{key:"computeOutputShape",value:function(e){$i(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){var a,i=[],o=Object(ea.a)(t);try{for(o.s();!(a=o.n()).done;){var s=a.value;i.push([e[0],s])}}catch(c){o.e(c)}finally{o.f()}return[n].concat(i)}return n}},{key:"computeMask",value:function(e,t){var n=this;return i.pf((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}))}},{key:"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}},{key:"build",value:function(e){if(null!=this.numConstants)throw new la("Constants support is not implemented in RNN yet.");$i(e)&&(e=e[0]),e=e;var t=this.stateful?e[0]:null,n=e.slice(2);this.inputSpec[0]=new io({shape:[t,null].concat(Object(Vn.a)(n))});var r,a=[e[0]].concat(e.slice(2));if(this.cell.build(a),r=Array.isArray(this.cell.stateSize)?this.cell.stateSize:[this.cell.stateSize],null!=this.stateSpec){if(!i.wf.arraysEqual(this.stateSpec.map((function(e){return e.shape[e.shape.length-1]})),r))throw new ua("An initialState was passed that is not compatible with "+"cell.stateSize. Received stateSpec=".concat(this.stateSpec,"; ")+"However cell.stateSize is ".concat(this.cell.stateSize))}else this.stateSpec=r.map((function(e){return new io({shape:[null,e]})}));this.stateful&&this.resetStates()}},{key:"resetStates",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(i.pf)((function(){if(!t.stateful)throw new sa("Cannot call resetStates() on an RNN Layer that is not stateful.");var r=t.inputSpec[0].shape[0];if(null==r)throw new ua("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==t.states_)Array.isArray(t.cell.stateSize)?t.states_=t.cell.stateSize.map((function(e){return i.Bf([r,e])})):t.states_=[i.Bf([r,t.cell.stateSize])];else if(null==e)i.Pd(t.states_),null!=t.keptStates&&(i.Pd(t.keptStates),t.keptStates=[]),Array.isArray(t.cell.stateSize)?t.states_=t.cell.stateSize.map((function(e){return i.Bf([r,e])})):t.states_[0]=i.Bf([r,t.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==t.states_.length)throw new ua("Layer ".concat(t.name," expects ").concat(t.states_.length," state(s), ")+"but it received ".concat(e.length," state value(s). Input ")+"received: ".concat(e));!0===n?t.keptStates.push(t.states_.slice()):i.Pd(t.states_);for(var a=0;a<t.states_.length;++a){var o=e[a],s=Array.isArray(t.cell.stateSize)?t.cell.stateSize[a]:t.cell.stateSize,c=[r,s];if(!i.wf.arraysEqual(o.shape,c))throw new ua("State ".concat(a," is incompatible with layer ").concat(t.name,": ")+"expected shape=".concat(c,", received shape=").concat(o.shape));t.states_[a]=o}}t.states_=t.states_.map((function(e){return i.he(e.clone())}))}))}},{key:"apply",value:function(e,t){var r=null==t?null:t.initialState,a=null==t?null:t.constants;null==t&&(t={});var i=Jc(e,r,a,this.numConstants);e=i.inputs,r=i.initialState,a=i.constants;var o=[],s=[];if(null!=r){t.initialState=r,o=o.concat(r),this.stateSpec=[];var c,u=Object(ea.a)(r);try{for(u.s();!(c=u.n()).done;){var l=c.value;this.stateSpec.push(new io({shape:l.shape}))}}catch(b){u.e(b)}finally{u.f()}s=s.concat(this.stateSpec)}if(null!=a&&(t.constants=a,o=o.concat(a),this.numConstants=a.length),o[0]instanceof oo){var d=[e].concat(o),f=this.inputSpec.concat(s),p=this.inputSpec;this.inputSpec=f;var h=Object(Eo.a)(Object(na.a)(n.prototype),"apply",this).call(this,d,t);return this.inputSpec=p,h}return Object(Eo.a)(Object(na.a)(n.prototype),"apply",this).call(this,e,t)}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var r=null==t?null:t.mask,a=null==t?null:t.training,i=null==t?null:t.initialState;e=Zi(e),null==i&&(i=n.stateful?n.states_:n.getInitialState(e));var o=Array.isArray(n.cell.stateSize)?n.cell.stateSize.length:1;if(i.length!==o)throw new ua("RNN Layer has ".concat(o," state(s) but was passed ")+"".concat(i.length," initial state(s)."));n.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");var s={training:a},c=eu((function(e,t){var r=n.cell.call([e].concat(t),s);return[r[0],r.slice(1)]}),e,i,n.goBackwards,r,null,n.unroll,n.returnSequences),u=c[0],l=c[1],d=c[2];n.stateful&&n.resetStates(d,a);var f=n.returnSequences?l:u;return n.returnState?[f].concat(d):f}))}},{key:"getInitialState",value:function(e){var t=this;return Object(i.pf)((function(){var n=i.Bf(e.shape);return n=si(n=i.if(n,[1,2])),Array.isArray(t.cell.stateSize)?t.cell.stateSize.map((function(e){return e>1?hi(n,[1,e]):n})):t.cell.stateSize>1?[hi(n,[1,t.cell.stateSize])]:[n]}))}},{key:"trainableWeights",get:function(){return this.trainable?this.cell.trainableWeights:[]}},{key:"nonTrainableWeights",get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights}},{key:"setFastWeightInitDuringBuild",value:function(e){Object(Eo.a)(Object(na.a)(n.prototype),"setFastWeightInitDuringBuild",this).call(this,e),null!=this.cell&&this.cell.setFastWeightInitDuringBuild(e)}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);var r=this.cell.getConfig();return this.getClassName()===n.className&&(t.cell={className:this.cell.getClassName(),config:r}),Object.assign({},r,e,t)}}],[{key:"fromConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.cell,a=Ao(r,n);return new e(Object.assign(t,{cell:a}))}}]),n}(lo);tu.className="RNN",i.Se.registerClass(tu);var nu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return n}(lo),ru=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).DEFAULT_ACTIVATION="tanh",r.DEFAULT_KERNEL_INITIALIZER="glorotNormal",r.DEFAULT_RECURRENT_INITIALIZER="orthogonal",r.DEFAULT_BIAS_INITIALIZER="zeros",r.units=e.units,Ca(r.units,"units"),r.activation=gc(null==e.activation?r.DEFAULT_ACTIVATION:e.activation),r.useBias=null==e.useBias||e.useBias,r.kernelInitializer=Gi(e.kernelInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.recurrentInitializer=Gi(e.recurrentInitializer||r.DEFAULT_RECURRENT_INITIALIZER),r.biasInitializer=Gi(e.biasInitializer||r.DEFAULT_BIAS_INITIALIZER),r.kernelRegularizer=Sc(e.kernelRegularizer),r.recurrentRegularizer=Sc(e.recurrentRegularizer),r.biasRegularizer=Sc(e.biasRegularizer),r.kernelConstraint=Ba(e.kernelConstraint),r.recurrentConstraint=Ba(e.recurrentConstraint),r.biasConstraint=Ba(e.biasConstraint),r.dropout=ri([1,ai([0,null==e.dropout?0:e.dropout])]),r.recurrentDropout=ri([1,ai([0,null==e.recurrentDropout?0:e.recurrentDropout])]),r.stateSize=r.units,r.dropoutMask=null,r.recurrentDropoutMask=null,r}return Object($r.a)(n,[{key:"build",value:function(e){e=Ji(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}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){if(2!==(e=e).length)throw new ua("SimpleRNNCell expects 2 input Tensors, got ".concat(e.length,"."));var r=e[1];e=e[0];var a,o=null!=t.training&&t.training;0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=lu({ones:function(){return i.Ee(e)},rate:n.dropout,training:o})),0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=lu({ones:function(){return i.Ee(r)},rate:n.recurrentDropout,training:o}));var s=n.dropoutMask,c=n.recurrentDropoutMask;a=mi(null!=s?i.ye(e,s):e,n.kernel.read()),null!=n.bias&&(a=Oi(a,n.bias.read())),null!=c&&(r=i.ye(r,c));var u=i.nd(a,mi(r,n.recurrentKernel.read()));return null!=n.activation&&(u=n.activation.apply(u)),[u,u]}))}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t={units:this.units,activation:mc(this.activation),useBias:this.useBias,kernelInitializer:Hi(this.kernelInitializer),recurrentInitializer:Hi(this.recurrentInitializer),biasInitializer:Hi(this.biasInitializer),kernelRegularizer:wc(this.kernelRegularizer),recurrentRegularizer:wc(this.recurrentRegularizer),biasRegularizer:wc(this.biasRegularizer),activityRegularizer:wc(this.activityRegularizer),kernelConstraint:La(this.kernelConstraint),recurrentConstraint:La(this.recurrentConstraint),biasConstraint:La(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign({},e,t)}}]),n}(nu);ru.className="SimpleRNNCell",i.Se.registerClass(ru);var au=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),e.cell=new ru(e),t.call(this,e)}return Object($r.a)(n,[{key:"call",value:function(e,t){var r=this;return Object(i.pf)((function(){null!=r.cell.dropoutMask&&(i.Pd(r.cell.dropoutMask),r.cell.dropoutMask=null),null!=r.cell.recurrentDropoutMask&&(i.Pd(r.cell.recurrentDropoutMask),r.cell.recurrentDropoutMask=null);var a=null==t?null:t.mask,o=null==t?null:t.training,s=null==t?null:t.initialState;return Object(Eo.a)(Object(na.a)(n.prototype),"call",r).call(r,e,{mask:a,training:o,initialState:s})}))}}],[{key:"fromConfig",value:function(e,t){return new e(t)}}]),n}(tu);au.className="SimpleRNN",i.Se.registerClass(au);var iu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),(r=t.call(this,e)).DEFAULT_ACTIVATION="tanh",r.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",r.DEFAULT_KERNEL_INITIALIZER="glorotNormal",r.DEFAULT_RECURRENT_INITIALIZER="orthogonal",r.DEFAULT_BIAS_INITIALIZER="zeros",e.resetAfter)throw new ua("GRUCell does not support reset_after parameter set to true.");return r.units=e.units,Ca(r.units,"units"),r.activation=gc(void 0===e.activation?r.DEFAULT_ACTIVATION:e.activation),r.recurrentActivation=gc(void 0===e.recurrentActivation?r.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),r.useBias=null==e.useBias||e.useBias,r.kernelInitializer=Gi(e.kernelInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.recurrentInitializer=Gi(e.recurrentInitializer||r.DEFAULT_RECURRENT_INITIALIZER),r.biasInitializer=Gi(e.biasInitializer||r.DEFAULT_BIAS_INITIALIZER),r.kernelRegularizer=Sc(e.kernelRegularizer),r.recurrentRegularizer=Sc(e.recurrentRegularizer),r.biasRegularizer=Sc(e.biasRegularizer),r.kernelConstraint=Ba(e.kernelConstraint),r.recurrentConstraint=Ba(e.recurrentConstraint),r.biasConstraint=Ba(e.biasConstraint),r.dropout=ri([1,ai([0,null==e.dropout?0:e.dropout])]),r.recurrentDropout=ri([1,ai([0,null==e.recurrentDropout?0:e.recurrentDropout])]),r.implementation=e.implementation,r.stateSize=r.units,r.dropoutMask=null,r.recurrentDropoutMask=null,r}return Object($r.a)(n,[{key:"build",value:function(e){var t=(e=Ji(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}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){if(2!==(e=e).length)throw new ua("GRUCell expects 2 input Tensors (inputs, h, c), got "+"".concat(e.length,"."));var r=null!=t.training&&t.training,a=e[1];e=e[0],0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=lu({ones:function(){return i.Ee(e)},rate:n.dropout,training:r,count:3})),0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=lu({ones:function(){return i.Ee(a)},rate:n.recurrentDropout,training:r,count:3}));var s,c,u,l=n.dropoutMask,d=n.recurrentDropoutMask;0<n.dropout&&n.dropout<1&&(e=i.ye(e,l[0]));var f=mi(e,n.kernel.read());n.useBias&&(f=Oi(f,n.bias.read())),0<n.recurrentDropout&&n.recurrentDropout<1&&(a=i.ye(a,d[0]));var p=n.recurrentKernel.read(),h=i.df(p,[2*n.units,n.units],p.rank-1),b=Object(o.a)(h,2),m=b[0],v=b[1],g=mi(a,m),y=i.df(f,3,f.rank-1),O=Object(o.a)(y,3),x=O[0],k=O[1],w=O[2],j=i.df(g,2,g.rank-1),S=Object(o.a)(j,2),N=S[0],I=S[1];s=n.recurrentActivation.apply(i.nd(x,N)),c=n.recurrentActivation.apply(i.nd(k,I));var C=mi(i.ye(c,a),v);u=n.activation.apply(i.nd(w,C));var T=i.nd(i.ye(s,a),i.ye(i.nd(1,i.ze(s)),u));return[T,T]}))}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t={units:this.units,activation:mc(this.activation),recurrentActivation:mc(this.recurrentActivation),useBias:this.useBias,kernelInitializer:Hi(this.kernelInitializer),recurrentInitializer:Hi(this.recurrentInitializer),biasInitializer:Hi(this.biasInitializer),kernelRegularizer:wc(this.kernelRegularizer),recurrentRegularizer:wc(this.recurrentRegularizer),biasRegularizer:wc(this.biasRegularizer),activityRegularizer:wc(this.activityRegularizer),kernelConstraint:La(this.kernelConstraint),recurrentConstraint:La(this.recurrentConstraint),biasConstraint:La(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation,resetAfter:!1};return Object.assign({},e,t)}}]),n}(nu);iu.className="GRUCell",i.Se.registerClass(iu);var ou=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new iu(e),t.call(this,e)}return Object($r.a)(n,[{key:"call",value:function(e,t){var r=this;return Object(i.pf)((function(){null!=r.cell.dropoutMask&&(i.Pd(r.cell.dropoutMask),r.cell.dropoutMask=null),null!=r.cell.recurrentDropoutMask&&(i.Pd(r.cell.recurrentDropoutMask),r.cell.recurrentDropoutMask=null);var a=null==t?null:t.mask,o=null==t?null:t.training,s=null==t?null:t.initialState;return Object(Eo.a)(Object(na.a)(n.prototype),"call",r).call(r,e,{mask:a,training:o,initialState:s})}))}}],[{key:"fromConfig",value:function(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}]),n}(tu);ou.className="GRU",i.Se.registerClass(ou);var su=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).DEFAULT_ACTIVATION="tanh",r.DEFAULT_RECURRENT_ACTIVATION="hardSigmoid",r.DEFAULT_KERNEL_INITIALIZER="glorotNormal",r.DEFAULT_RECURRENT_INITIALIZER="orthogonal",r.DEFAULT_BIAS_INITIALIZER="zeros",r.units=e.units,Ca(r.units,"units"),r.activation=gc(void 0===e.activation?r.DEFAULT_ACTIVATION:e.activation),r.recurrentActivation=gc(void 0===e.recurrentActivation?r.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),r.useBias=null==e.useBias||e.useBias,r.kernelInitializer=Gi(e.kernelInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.recurrentInitializer=Gi(e.recurrentInitializer||r.DEFAULT_RECURRENT_INITIALIZER),r.biasInitializer=Gi(e.biasInitializer||r.DEFAULT_BIAS_INITIALIZER),r.unitForgetBias=e.unitForgetBias,r.kernelRegularizer=Sc(e.kernelRegularizer),r.recurrentRegularizer=Sc(e.recurrentRegularizer),r.biasRegularizer=Sc(e.biasRegularizer),r.kernelConstraint=Ba(e.kernelConstraint),r.recurrentConstraint=Ba(e.recurrentConstraint),r.biasConstraint=Ba(e.biasConstraint),r.dropout=ri([1,ai([0,null==e.dropout?0:e.dropout])]),r.recurrentDropout=ri([1,ai([0,null==e.recurrentDropout?0:e.recurrentDropout])]),r.implementation=e.implementation,r.stateSize=[r.units,r.units],r.dropoutMask=null,r.recurrentDropoutMask=null,r}return Object($r.a)(n,[{key:"build",value:function(e){var t,n,r=(e=Ji(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 a=this.biasInitializer,i=this.units;n=new((t=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e,t){var n=a.apply([i]),r=(new Ci).apply([i]),o=a.apply([2*i]);return pi(pi(n,r),o)}}]),n}(Ni)).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}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var r=null!=t.training&&t.training;if(3!==(e=e).length)throw new ua("LSTMCell expects 3 input Tensors (inputs, h, c), got "+"".concat(e.length,"."));var a=e[1],s=e[2];e=e[0],0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=lu({ones:function(){return i.Ee(e)},rate:n.dropout,training:r,count:4})),0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=lu({ones:function(){return i.Ee(a)},rate:n.recurrentDropout,training:r,count:4}));var c,u,l,d,f=n.dropoutMask,p=n.recurrentDropoutMask;0<n.dropout&&n.dropout<1&&(e=i.ye(e,f[0]));var h=mi(e,n.kernel.read());0<n.recurrentDropout&&n.recurrentDropout<1&&(a=i.ye(a,p[0])),h=i.nd(h,mi(a,n.recurrentKernel.read())),n.useBias&&(h=Oi(h,n.bias.read()));var b=i.df(h,4,h.rank-1),m=Object(o.a)(b,4),v=m[0],g=m[1],y=m[2],O=m[3];c=n.recurrentActivation.apply(v),u=n.recurrentActivation.apply(g),l=i.nd(i.ye(u,s),i.ye(c,n.activation.apply(y))),d=n.recurrentActivation.apply(O);var x=i.ye(d,n.activation.apply(l));return[x,x,l]}))}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t={units:this.units,activation:mc(this.activation),recurrentActivation:mc(this.recurrentActivation),useBias:this.useBias,kernelInitializer:Hi(this.kernelInitializer),recurrentInitializer:Hi(this.recurrentInitializer),biasInitializer:Hi(this.biasInitializer),unitForgetBias:this.unitForgetBias,kernelRegularizer:wc(this.kernelRegularizer),recurrentRegularizer:wc(this.recurrentRegularizer),biasRegularizer:wc(this.biasRegularizer),activityRegularizer:wc(this.activityRegularizer),kernelConstraint:La(this.kernelConstraint),recurrentConstraint:La(this.recurrentConstraint),biasConstraint:La(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation};return Object.assign({},e,t)}}]),n}(nu);su.className="LSTMCell",i.Se.registerClass(su);var cu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new su(e),t.call(this,e)}return Object($r.a)(n,[{key:"call",value:function(e,t){var r=this;return Object(i.pf)((function(){null!=r.cell.dropoutMask&&(i.Pd(r.cell.dropoutMask),r.cell.dropoutMask=null),null!=r.cell.recurrentDropoutMask&&(i.Pd(r.cell.recurrentDropoutMask),r.cell.recurrentDropoutMask=null);var a=null==t?null:t.mask,o=null==t?null:t.training,s=null==t?null:t.initialState;return Object(Eo.a)(Object(na.a)(n.prototype),"call",r).call(r,e,{mask:a,training:o,initialState:s})}))}}],[{key:"fromConfig",value:function(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}]),n}(tu);cu.className="LSTM",i.Se.registerClass(cu);var uu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).cells=e.cells,r}return Object($r.a)(n,[{key:"stateSize",get:function(){var e,t=[],n=Object(ea.a)(this.cells.slice().reverse());try{for(n.s();!(e=n.n()).done;){var r=e.value;Array.isArray(r.stateSize)?t.push.apply(t,Object(Vn.a)(r.stateSize)):t.push(r.stateSize)}}catch(a){n.e(a)}finally{n.f()}return t}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var r,a=(e=e).slice(1),i=[],o=Object(ea.a)(n.cells.slice().reverse());try{for(o.s();!(r=o.n()).done;){var s=r.value;Array.isArray(s.stateSize)?i.push(a.splice(0,s.stateSize.length)):i.push(a.splice(0,1))}}catch(m){o.e(m)}finally{o.f()}i.reverse();for(var c,u=[],l=0;l<n.cells.length;++l){var d=n.cells[l];a=i[l],c=0===l?[e[0]].concat(a):[c[0]].concat(a),c=d.call(c,t),u.push(c.slice(1))}a=[];var f,p=Object(ea.a)(u.slice().reverse());try{for(p.s();!(f=p.n()).done;){var h,b=f.value;(h=a).push.apply(h,Object(Vn.a)(b))}}catch(m){p.e(m)}finally{p.f()}return[c[0]].concat(a)}))}},{key:"build",value:function(e){var t;$i(e)&&(e=e[0]),e=e,this.cells.forEach((function(n,r){Qa("RNNCell_".concat(r),(function(){n.build(e),t=Array.isArray(n.stateSize)?n.stateSize[0]:n.stateSize,e=[e[0],t]}))})),this.built=!0}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t={cells:this.cells.map((function(e){return{className:e.getClassName(),config:e.getConfig()}}))};return Object.assign({},e,t)}},{key:"trainableWeights",get:function(){if(!this.trainable)return[];var e,t=[],n=Object(ea.a)(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,Object(Vn.a)(r.trainableWeights))}}catch(a){n.e(a)}finally{n.f()}return t}},{key:"nonTrainableWeights",get:function(){var e,t=[],n=Object(ea.a)(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,Object(Vn.a)(r.nonTrainableWeights))}}catch(c){n.e(c)}finally{n.f()}if(!this.trainable){var a,i=[],o=Object(ea.a)(this.cells);try{for(o.s();!(a=o.n()).done;){var s=a.value;i.push.apply(i,Object(Vn.a)(s.trainableWeights))}}catch(c){o.e(c)}finally{o.f()}return i.concat(t)}return t}},{key:"getWeights",value:function(){var e,t=[],n=Object(ea.a)(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,Object(Vn.a)(r.weights))}}catch(a){n.e(a)}finally{n.f()}return ro(t)}},{key:"setWeights",value:function(e){var t,n=[],r=Object(ea.a)(this.cells);try{for(r.s();!(t=r.n()).done;)for(var a=t.value,i=a.weights.length,o=e.splice(i),s=0;s<a.weights.length;++s)n.push([a.weights[s],o[s]])}catch(c){r.e(c)}finally{r.f()}ao(n)}}],[{key:"fromConfig",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[],i=Object(ea.a)(t.cells);try{for(i.s();!(n=i.n()).done;){var o=n.value;a.push(Ao(o,r))}}catch(s){i.e(s)}finally{i.f()}return new e({cells:a})}}]),n}(nu);function lu(e){var t=e.ones,n=e.rate,r=e.training,a=void 0!==r&&r,o=e.count,s=void 0===o?1:o,c=function(){return ki(t(),n)},u=function(){return wi(c,t,a)};return!s||s<=1?i.he(u().clone()):Array(s).fill(void 0).map(u).map((function(e){return i.he(e.clone())}))}uu.className="StackedRNNCells",i.Se.registerClass(uu);var du=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},fu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),e.unroll)throw new la("Unrolling is not possible with convolutional RNNs.");if(Array.isArray(e.cell))throw new la("It is not possible at the moment to stack convolutional cells.");return(r=t.call(this,e)).inputSpec=[new io({ndim:5})],r}return Object($r.a)(n,[{key:"call",value:function(e,t){var r=this;return i.pf((function(){if(null!=r.cell.dropoutMask&&(i.Pd(r.cell.dropoutMask),r.cell.dropoutMask=null),null!=r.cell.recurrentDropoutMask&&(i.Pd(r.cell.recurrentDropoutMask),r.cell.recurrentDropoutMask=null),t&&t.constants)throw new ua("ConvRNN2D cell does not support constants");var a=null==t?null:t.mask,o=null==t?null:t.training,s=null==t?null:t.initialState;return Object(Eo.a)(Object(na.a)(n.prototype),"call",r).call(r,e,{mask:a,training:o,initialState:s})}))}},{key:"computeOutputShape",value:function(e){var t=this.computeSingleOutputShape(e);return this.returnSequences||(t=[t[0]].concat(Object(Vn.a)(t.slice(2)))),this.returnState&&(t=[t].concat(Object(Vn.a)(Array(2).fill([e[0]].concat(Object(Vn.a)(t.slice(-3))))))),t}},{key:"getInitialState",value:function(e){var t=this;return i.pf((function(){var n=t.cell.stateSize,r=e.shape,a=t.computeSingleOutputShape(r),o=[a[0]].concat(Object(Vn.a)(a.slice(2))),s=i.Bf(o);return Array.isArray(n)?Array(n.length).fill(s):[s]}))}},{key:"resetStates",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i.pf((function(){if(!t.stateful)throw new sa("Cannot call resetStates() on an RNN Layer that is not stateful.");var r=t.inputSpec[0].shape,a=t.computeSingleOutputShape(r),o=[a[0]].concat(Object(Vn.a)(a.slice(2)));if(null==r[0])throw new ua("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==t.getStates())Array.isArray(t.cell.stateSize)?t.states_=t.cell.stateSize.map((function(){return i.Bf(o)})):t.states_=[i.Bf(o)];else if(null==e)i.Pd(t.states_),null!=t.keptStates&&(i.Pd(t.keptStates),t.keptStates=[]),Array.isArray(t.cell.stateSize)?t.states_=t.cell.stateSize.map((function(){return i.Bf(o)})):t.states_[0]=i.Bf(o);else{if(Array.isArray(e)||(e=[e]),e.length!==t.states_.length)throw new ua("Layer ".concat(t.name," expects ").concat(t.states_.length," state(s), ")+"but it received ".concat(e.length," state value(s). Input ")+"received: ".concat(e));n?t.keptStates.push(t.states_.slice()):i.Pd(t.states_);for(var s=0;s<t.states_.length;++s){var c=e[s],u=o;if(!i.wf.arraysEqual(c.shape,u))throw new ua("State ".concat(s," is incompatible with layer ").concat(t.name,": ")+"expected shape=".concat(u,", received shape=").concat(c.shape));t.states_[s]=c}}t.states_=t.states_.map((function(e){return i.he(e.clone())}))}))}},{key:"computeSingleOutputShape",value:function(e){var t=this.cell,n=t.dataFormat,r=t.filters,a=t.kernelSize,i=t.padding,o=t.strides,s=t.dilationRate,c="channelsFirst"===n,u=e[c?3:2],l=e[c?4:3],d=Dc(u,a[0],i,o[0],s[0]),f=Dc(l,a[1],i,o[1],s[1]);return[].concat(Object(Vn.a)(e.slice(0,2)),Object(Vn.a)(c?[r,d,f]:[d,f,r]))}}]),n}(tu);fu.className="ConvRNN2D";var pu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;Object(Yr.a)(this,n);var a=e.filters,i=e.kernelSize,o=e.strides,s=e.padding,c=e.dataFormat,u=e.dilationRate;return(r=t.call(this,Object.assign({},e,{units:a}))).filters=a,Ca(r.filters,"filters"),r.kernelSize=Fc(i,2,"kernelSize"),r.kernelSize.forEach((function(e){return Ca(e,"kernelSize")})),r.strides=Fc(o||1,2,"strides"),r.strides.forEach((function(e){return Ca(e,"strides")})),r.padding=s||"valid",Xa(r.padding),r.dataFormat=c||"channelsLast",Ka(r.dataFormat),r.dilationRate=Fc(u||1,2,"dilationRate"),r.dilationRate.forEach((function(e){return Ca(e,"dilationRate")})),r}return Object($r.a)(n,[{key:"build",value:function(e){var t;e=Ji(e);var n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new ua("The channel dimension of the input should be defined. "+"Found ".concat(e[n]));var r=e[n],a=this.kernelSize.concat([r,4*this.filters]);this.kernel=this.addWeight("kernel",a,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);var o=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",o,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){var s;if(this.unitForgetBias){var c=this.biasInitializer,u=this.filters;s=new((t=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"apply",value:function(e,t){return fi([c.apply([u]),i.De([u]),c.apply([2*u])])}}]),n}(Ni)).className="CustomInit",t)}else s=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.filters],null,s,this.biasRegularizer,!0,this.biasConstraint)}this.built=!0}},{key:"call",value:function(e,t){var n=this;return i.pf((function(){if(3!==e.length)throw new ua("ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got "+"".concat(e.length,"."));var r=t.training||!1,a=e[0],s=e[1],c=e[2];0<n.dropout&&n.dropout<1&&null==n.dropoutMask&&(n.dropoutMask=lu({ones:function(){return i.Ee(a)},rate:n.dropout,training:r,count:4}));var u=n.dropoutMask,l=function(e,t,n){return t&&t[n]?i.ye(t[n],e):e},d=l(a,u,0),f=l(a,u,1),p=l(a,u,2),h=l(a,u,3);0<n.recurrentDropout&&n.recurrentDropout<1&&null==n.recurrentDropoutMask&&(n.recurrentDropoutMask=lu({ones:function(){return i.Ee(s)},rate:n.recurrentDropout,training:r,count:4}));var b=n.recurrentDropoutMask,m=l(s,b,0),v=l(s,b,1),g=l(s,b,2),y=l(s,b,3),O=i.df(n.kernel.read(),4,3),x=Object(o.a)(O,4),k=x[0],w=x[1],j=x[2],S=x[3],N=n.useBias?i.df(n.bias.read(),4):[null,null,null,null],I=Object(o.a)(N,4),C=I[0],T=I[1],E=I[2],A=I[3];d=n.inputConv(d,k,C,n.padding),f=n.inputConv(f,w,T,n.padding),p=n.inputConv(p,j,E,n.padding),h=n.inputConv(h,S,A,n.padding);var R=i.df(n.recurrentKernel.read(),4,3),F=Object(o.a)(R,4),D=F[0],_=F[1],M=F[2],z=F[3];m=n.recurrentConv(m,D),v=n.recurrentConv(v,_),g=n.recurrentConv(g,M),y=n.recurrentConv(y,z);var L=n.recurrentActivation.apply(i.nd(d,m)),P=n.recurrentActivation.apply(i.nd(f,v)),B=i.nd(i.ye(P,c),i.ye(L,n.activation.apply(i.nd(p,g)))),W=i.ye(n.recurrentActivation.apply(i.nd(h,y)),n.activation.apply(B));return[W,W,B]}))}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t=(e.units,du(e,["units"])),r={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign({},t,r)}},{key:"inputConv",value:function(e,t,n,r){var a=i.Jd(e,t,this.strides,r||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?Oi(a,n,this.dataFormat):a}},{key:"recurrentConv",value:function(e,t){return i.Jd(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}]),n}(su);pu.className="ConvLSTM2DCell",i.Se.registerClass(pu);var hu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){Object(Yr.a)(this,n);var r=new pu(e);return t.call(this,Object.assign({},e,{cell:r}))}return Object($r.a)(n,null,[{key:"fromConfig",value:function(e,t){return new e(t)}}]),n}(fu);hu.className="ConvLSTM2D",i.Se.registerClass(hu);var bu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).rate=Math.max(Math.min(e.rate,1),0),r.noiseShape=e.noiseShape,r.seed=e.seed,r.supportsMasking=!0,r}return Object($r.a)(n,[{key:"getNoiseShape",value: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}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t);var r=Zi(e);if(0<n.rate&&n.rate<1){var a=null!=t.training&&t.training,i=n.getNoiseShape(r);return wi((function(){return ki(r,n.rate,i,n.seed)}),(function(){return r}),a)}return e}))}},{key:"getConfig",value:function(){var e={rate:this.rate,noiseShape:this.noiseShape,seed:this.seed},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}},{key:"dispose",value:function(){return Object(Eo.a)(Object(na.a)(n.prototype),"dispose",this).call(this)}}]),n}(lo);bu.className="Dropout",i.Se.registerClass(bu);var mu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).inputSpec=[{ndim:3}],r}return Object($r.a)(n,[{key:"getNoiseShape",value:function(e){var t=e.shape;return[t[0],1,t[2]]}}]),n}(bu);mu.className="SpatialDropout1D",i.Se.registerClass(mu);var vu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),(r=t.call(this,e)).activation=null,r.useBias=!0,r.kernel=null,r.bias=null,r.DEFAULT_KERNEL_INITIALIZER="glorotNormal",r.DEFAULT_BIAS_INITIALIZER="zeros",null==e.batchInputShape&&null==e.inputShape&&null!=e.inputDim){var a=null;null!=e.batchSize&&(a=e.batchSize),r.batchInputShape=[a,e.inputDim]}return r.units=e.units,Ca(r.units,"units"),r.activation=gc(e.activation),null!=e.useBias&&(r.useBias=e.useBias),r.kernelInitializer=Gi(e.kernelInitializer||r.DEFAULT_KERNEL_INITIALIZER),r.biasInitializer=Gi(e.biasInitializer||r.DEFAULT_BIAS_INITIALIZER),r.kernelConstraint=Ba(e.kernelConstraint),r.biasConstraint=Ba(e.biasConstraint),r.kernelRegularizer=Sc(e.kernelRegularizer),r.biasRegularizer=Sc(e.biasRegularizer),r.activityRegularizer=Sc(e.activityRegularizer),r.supportsMasking=!0,r.inputSpec=[{minNDim:2}],r}return Object($r.a)(n,[{key:"build",value:function(e){var t=(e=Ji(e))[e.length-1];null==this.kernel&&(this.kernel=this.addWeight("kernel",[t,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:Object(Rc.a)({},-1,t)}],this.built=!0}},{key:"computeOutputShape",value:function(e){var t=(e=Ji(e)).slice();return t[t.length-1]=this.units,t}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t);var r,a=Zi(e),i=Ea(n.activation.getClassName());return null!=i?r=mi(a,n.kernel.read(),i,n.bias?n.bias.read():null):(r=mi(a,n.kernel.read()),null!=n.bias&&(r=Oi(r,n.bias.read())),null!=n.activation&&(r=n.activation.apply(r))),r}))}},{key:"getConfig",value:function(){var e={units:this.units,activation:mc(this.activation),useBias:this.useBias,kernelInitializer:Hi(this.kernelInitializer),biasInitializer:Hi(this.biasInitializer),kernelRegularizer:wc(this.kernelRegularizer),biasRegularizer:wc(this.biasRegularizer),activityRegularizer:wc(this.activityRegularizer),kernelConstraint:La(this.kernelConstraint),biasConstraint:La(this.biasConstraint)},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);vu.className="Dense",i.Se.registerClass(vu);var gu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),e=e||{},(r=t.call(this,e)).inputSpec=[{minNDim:3}],r.dataFormat=e.dataFormat,r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){e=Ji(e);var t,n=Object(ea.a)(e.slice(1));try{for(n.s();!(t=n.n()).done;){if(null==t.value)throw new ua('The shape of the input to "Flatten" is not fully defined '+"(got ".concat(e.slice(1),"). Make sure to pass a complete ")+'"input_shape" or "batch_input_shape" argument to the first layer in your model.')}}catch(r){n.e(r)}finally{n.f()}return[e[0],ni(e,1)]}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t);var r=Zi(e);if("channelsFirst"===n.dataFormat&&r.rank>1){for(var a=[0],o=2;o<r.rank;++o)a.push(o);a.push(1),r=Object(i.sf)(r,a)}return function(e){if(e.rank<=1)throw new ua("batchFlatten requires a minimum rank of 2. Got rank: ".concat(e.rank,"."));var t=[e.shape[0],ni(e.shape,1)];return i.Ne(e,t)}(r)}))}},{key:"getConfig",value:function(){var e={};null!=this.dataFormat&&(e.dataFormat=this.dataFormat);var t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);gu.className="Flatten",i.Se.registerClass(gu);var yu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r.activation=gc(e.activation),r}return Object($r.a)(n,[{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t);var r=Zi(e);return n.activation.apply(r)}))}},{key:"getConfig",value:function(){var e={activation:mc(this.activation)},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);yu.className="Activation",i.Se.registerClass(yu);var Ou=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).n=e.n,r.inputSpec=[{ndim:2}],r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){return[e[0],this.n,e[1]]}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){return e=Zi(e),t=e,r=n.n,Object(i.pf)((function(){if(2!==t.shape.length)throw new ua("repeat() expects a rank-2 tensor, but received a "+"rank-".concat(t.shape.length," tensor."));return hi(si(t,1),[1,r,1])}));var t,r}))}},{key:"getConfig",value:function(){var e={n:this.n},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Ou.className="RepeatVector",i.Se.registerClass(Ou);var xu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;Object(Yr.a)(this,n),(r=t.call(this,e)).targetShape=e.targetShape;for(var a=0;a<r.targetShape.length;++a)r.isUnknown(r.targetShape[a])&&(r.targetShape[a]=null);return r}return Object($r.a)(n,[{key:"isUnknown",value:function(e){return e<0||null==e}},{key:"fixUnknownDimension",value:function(e,t){for(var n="Total size of new array must be unchanged.",r=t.slice(),a=1,i=null,o=0;o<r.length;++o){var s=r[o];if(this.isUnknown(s)){if(null!==i)throw new ua("Can only specifiy one unknown dimension.");i=o}else a*=s}var c=ni(e);if(null!==i){if(0===a||c%a!==0)throw new ua(n);r[i]=c/a}else if(c!==a)throw new ua(n);return r}},{key:"computeOutputShape",value: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))}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t);var r=Zi(e),a=r.shape,o=a.slice(0,1).concat(n.fixUnknownDimension(a.slice(1),n.targetShape));return Object(i.Ne)(r,o)}))}},{key:"getConfig",value:function(){var e={targetShape:this.targetShape},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);xu.className="Reshape",i.Se.registerClass(xu);var ku=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),r=t.call(this,e),null==e.dims)throw new Error("Required configuration field `dims` is missing during Permute constructor call.");if(!Array.isArray(e.dims))throw new Error("Permute constructor requires `dims` to be an Array, but received "+"".concat(e.dims," instead."));var a=ii(1,e.dims.length+1);if(!i.wf.arraysEqual(e.dims.slice().sort(),a))throw new Error("Invalid permutation `dims`: "+JSON.stringify(e.dims)+" `dims` must contain consecutive integers starting from 1.");return r.dims=e.dims,r.dimsIncludingBatch=[0].concat(r.dims),r.inputSpec=[new io({ndim:r.dims.length+1})],r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){var t=(e=Ji(e)).slice();return this.dims.forEach((function(n,r){t[r+1]=e[n]})),t}},{key:"call",value:function(e,t){return Object(i.sf)(Zi(e),this.dimsIncludingBatch)}},{key:"getConfig",value:function(){var e={dims:this.dims},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);ku.className="Permute",i.Se.registerClass(ku);var wu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,null==e?{}:e)).supportsMasking=!0,r.maskValue=null!=e?null==e.maskValue?0:e.maskValue:0,r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t={maskValue:this.maskValue};return Object.assign(t,e),t}},{key:"computeMask",value:function(e,t){var n=Zi(e);return Object(i.pd)(Object(i.Be)(n,this.maskValue),-1)}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t);var r=Zi(e),a=Object(i.pd)(Object(i.Be)(r,n.maskValue),-1,!0);return Object(i.ye)(r,Object(i.Ad)(a,r.dtype))}))}}]),n}(lo);wu.className="Masking",i.Se.registerClass(wu);var ju=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),(r=t.call(this,e)).embeddings=null,r.DEFAULT_EMBEDDINGS_INITIALIZER="randomUniform",null==e.batchInputShape&&null==e.inputShape){var a=null;null!=e.batchSize&&(a=e.batchSize),null==e.inputLength?r.batchInputShape=[a,null]:r.batchInputShape=[a].concat(ma(e.inputLength))}return r.inputDim=e.inputDim,Ca(r.inputDim,"inputDim"),r.outputDim=e.outputDim,Ca(r.outputDim,"outputDim"),r.embeddingsInitializer=Gi(e.embeddingsInitializer||r.DEFAULT_EMBEDDINGS_INITIALIZER),r.embeddingsRegularizer=Sc(e.embeddingsRegularizer),r.activityRegularizer=Sc(e.activityRegularizer),r.embeddingsConstraint=Ba(e.embeddingsConstraint),r.maskZero=e.maskZero,r.supportsMasking=e.maskZero,r.inputLength=e.inputLength,r}return Object($r.a)(n,[{key:"build",value:function(e){this.embeddings=this.addWeight("embeddings",[this.inputDim,this.outputDim],this.dtype,this.embeddingsInitializer,this.embeddingsRegularizer,!0,this.embeddingsConstraint),this.built=!0}},{key:"warnOnIncompatibleInputShape",value:function(e){}},{key:"computeMask",value:function(e,t){var n=this;return Object(i.pf)((function(){return n.maskZero?(e=Zi(e),Object(i.Be)(e,Object(i.Cf)(e))):null}))}},{key:"computeOutputShape",value:function(e){if(e=Ji(e),null==this.inputLength)return[].concat(Object(Vn.a)(e),[this.outputDim]);var t=ma(this.inputLength);if(t.length!==e.length-1)throw new ua('"inputLength" is '.concat(this.inputLength,", but received ")+"input shape has shape ".concat(e));for(var n=0,r=0;r<t.length;++r){var a=t[r],i=e[r+1];if(null!=a&&null!=i&&a!==i)throw new ua('"inputLength" is '.concat(this.inputLength,", but received ")+"input shape has shape ".concat(e));null==a&&(t[n]=i),n++}return[e[0]].concat(Object(Vn.a)(t),[this.outputDim])}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t);var r=Zi(e);"int32"!==r.dtype&&(r=oi(r,"int32"));var a=vi(n.embeddings.read(),Object(i.Ne)(r,[r.size]));return Object(i.Ne)(a,Ji(n.computeOutputShape(r.shape)))}))}},{key:"getConfig",value:function(){var e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:Hi(this.embeddingsInitializer),embeddingsRegularizer:wc(this.embeddingsRegularizer),activityRegularizer:wc(this.activityRegularizer),embeddingsConstraint:La(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);ju.className="Embedding",i.Se.registerClass(ju);var Su=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e||{})).supportsMasking=!0,r}return Object($r.a)(n,[{key:"mergeFunction",value:function(e){throw new la}},{key:"computeElementwiseOpOutputShape",value: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 a=e[e.length-t.length+r],i=t[r];if(null==a||null==i||a<0||i<0)n.push(null);else if(1===a)n.push(i);else if(1===i)n.push(a);else{if(a!==i)throw new ua("Operands could not be broadcast together with shapes "+JSON.stringify(e)+" "+JSON.stringify(t));n.push(a)}}return n}},{key:"build",value:function(e){if(Array.isArray(e)&&!Array.isArray(e[0])&&(e=[Ji(e)]),(e=e).length<2)throw new ua("A merge layer should be called on an Array of at least 2 inputs."+" Got ".concat(e.length," input(s)."));var t,n=[],r=Object(ea.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;null!=a&&null!==a[0]&&n.push(a[0])}}catch(u){r.e(u)}finally{r.f()}if((n=ja(n)).length>1)throw new ua("Can not merge tensors with different batch sizes. "+"Got tensors with shapes: ".concat(JSON.stringify(e),"."));for(var i=null==e[0]?null:e[0].slice(1),o=1;o<e.length;++o){var s=null==e[o]?null:e[o].slice(1);i=this.computeElementwiseOpOutputShape(i,s)}var c=e.map((function(e){return e.length}));-1===e.indexOf(null)&&1===ja(c).length?this.reshapeRequired=!1:this.reshapeRequired=!0}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){if(e=e,n.reshapeRequired){var t=[],r=e.map((function(e){return e.rank}));if(-1===r.indexOf(null)){var a,o=ai(r),s=Object(ea.a)(e);try{for(s.s();!(a=s.n()).done;){for(var c=a.value,u=c.rank,l=0;l<o-u;++l)c=si(c,1);t.push(c)}}catch(I){s.e(I)}finally{s.f()}return n.mergeFunction(t)}var d,f=!1,p=Object(ea.a)(e);try{for(p.s();!(d=p.n()).done;){var h=d.value,b=h.rank;if(null==b){var m=h.shape,v=m[0],g=m.slice(1).concat([v]),y=i.Ne(h,[v].concat(ni(m.slice(1))));y=i.sf(y,[1,0]),y=i.Ne(y,g),t.push(y),f=!0}else if(b>1){var O=ii(1,b).concat([0]);t.push(i.sf(h,O)),f=!0}else t.push(h)}}catch(I){p.e(I)}finally{p.f()}var x=n.mergeFunction(t),k=x.rank;if(f)if(null==k){var w=x.shape,j=w[w.length-1],S=[j].concat(w.slice(0,w.length-1));x=i.Ne(i.sf(i.Ne(x,[-1,j]),[1,0]),S)}else if(k>1){var N=[k-1].concat(ii(0,k-1));x=i.sf(x,N)}return x}return n.mergeFunction(e)}))}},{key:"computeOutputShape",value: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)}var a,i=[],o=Object(ea.a)(e);try{for(o.s();!(a=o.n()).done;){var s=a.value;null!=s&&null!==s[0]&&i.push(s[0])}}catch(c){o.e(c)}finally{o.f()}return t=1===(i=ja(i)).length?i.concat(t):[null].concat(t)}},{key:"computeMask",value:function(e,t){return i.pf((function(){if(null==t)return null;if(!Array.isArray(t))throw new ua("`mask` should be an Array");if(!Array.isArray(e))throw new ua("`inputs` should be an Array");if(t.length!==e.length)throw new ua("The Array 'inputs' and 'mask' are expected to have the same length, but have different lengths "+"(".concat(e.length," vs ").concat(t.length,")"));if(t.every((function(e){return null==e})))return null;for(var n=(t=t.map((function(e){return null==e?e:i.Xd(e,0)})))[0],r=1;r<t.length-1;++r)n=i.oe(n,t[r]);return n}))}}]),n}(lo),Nu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"mergeFunction",value:function(e){return Object(i.pf)((function(){for(var t=e[0].clone(),n=1;n<e.length;++n)t=i.nd(t,e[n]);return t}))}}]),n}(Su);Nu.className="Add",i.Se.registerClass(Nu);var Iu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"mergeFunction",value:function(e){return Object(i.pf)((function(){for(var t=e[0].clone(),n=1;n<e.length;++n)t=i.ye(t,e[n]);return t}))}}]),n}(Su);Iu.className="Multiply",i.Se.registerClass(Iu);var Cu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"mergeFunction",value:function(e){return Object(i.pf)((function(){for(var t=e[0].clone(),n=1;n<e.length;++n)t=i.nd(t,e[n]);return i.ye(1/e.length,t)}))}}]),n}(Su);Cu.className="Average",i.Se.registerClass(Cu);var Tu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"mergeFunction",value:function(e){return Object(i.pf)((function(){for(var t=e[0],n=1;n<e.length;++n)t=i.te(t,e[n]);return t}))}}]),n}(Su);Tu.className="Maximum",i.Se.registerClass(Tu);var Eu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"mergeFunction",value:function(e){return Object(i.pf)((function(){for(var t=e[0],n=1;n<e.length;++n)t=i.we(t,e[n]);return t}))}}]),n}(Su);Eu.className="Minimum",i.Se.registerClass(Eu);var Au=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).DEFAULT_AXIS=-1,null==e&&(e={}),r.axis=null==e.axis?r.DEFAULT_AXIS:e.axis,r.supportsMasking=!0,r.reshapeRequired=!1,r}return Object($r.a)(n,[{key:"build",value:function(e){if(!Array.isArray(e)||!Array.isArray(e[0])||1===e.length)throw new ua("A `Concatenate` layer should be called on a list of at least 2 inputs");e=e;var t,n=!0,r=Object(ea.a)(e);try{for(r.s();!(t=r.n()).done;){if(null!=t.value){n=!1;break}}}catch(f){r.e(f)}finally{r.f()}if(!n){for(var a=[],o=0;o<e.length;++o){var s=e[o].slice();s.splice(this.axis,1);var c,u=!1,l=Object(ea.a)(a);try{for(l.s();!(c=l.n()).done;){var d=c.value;if(i.wf.arraysEqual(d,s)){u=!0;break}}}catch(f){l.e(f)}finally{l.f()}u||a.push(s)}if(a.length>1)throw new ua("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}}},{key:"mergeFunction",value:function(e){var t=this;return Object(i.pf)((function(){return fi(e,t.axis)}))}},{key:"computeOutputShape",value:function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new ua("A `Concatenate` layer should be called on a list of inputs.");var t,n=e,r=n[0].slice(),a=this.axis<0?r.length+this.axis:this.axis,i=Object(ea.a)(n.slice(1));try{for(i.s();!(t=i.n()).done;){var o=t.value;if(null==r[a]||null==o[a]){r[a]=null;break}r[a]+=o[a]}}catch(s){i.e(s)}finally{i.f()}return r}},{key:"computeMask",value:function(e,t){var n=this;if(null==t)return null;if(!Array.isArray(t))throw new ua("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new ua("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new ua("Mismatch in the length of mask (".concat(t.length,") ")+"and the legnth of inputs (".concat(e.length,")"));return i.pf((function(){var r=!0;if(t.forEach((function(e){null==e||(r=!1)})),r)return null;for(var a=[],o=0;o<e.length;++o)null==t[o]?a.push(i.Ad(i.Ee(e[o]),"bool")):t[o].rank<e[o].rank?a.push(i.Xd(t[o],-1)):a.push(t[o]);var s=i.Dd(a,n.axis);return i.od(s,-1,!1)}))}},{key:"getConfig",value:function(){var e={axis:this.axis},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(Su);function Ru(e,t){for(;e<0;)e+=t;return e}Au.className="Concatenate",i.Se.registerClass(Au);var Fu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).axes=e.axes,r.normalize=null!=e.normalize&&e.normalize,r.supportsMasking=!0,r.reshapeRequired=!1,r}return Object($r.a)(n,[{key:"build",value:function(e){i.wf.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 la("Dot layer does not support tensors of 4D or higher rank yet.");var r=this.interpretAxes(t,n);if(t[r[0]]!==n[r[1]])throw new ua("Dimension incompatibility: "+"".concat(t[r[0]]," !== ").concat(n[r[1]]))}},{key:"mergeFunction",value:function(e){if(2!==e.length)throw new ua("A `Dot` layer must be called on exactly 2 inputs, "+"but received ".concat(e.length," input(s)."));var t,n=e[0],r=e[1];return t=Array.isArray(this.axes)?this.axes.map((function(t,n){return Ru(t,e[n].shape.length)})):[Ru(this.axes,n.shape.length),Ru(this.axes,r.shape.length)],this.normalize&&(n=Ro(n,t[0]),r=Ro(r,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new la("batchDot is not implemented for tensors of 4D or higher rank yet");if(i.wf.assert(e.shape.length>=2,(function(){return"batchDot requires the rank of x to be >= 2, "+"but got ".concat(e.shape.length)})),i.wf.assert(e.shape.length>=2,(function(){return"batchDot requires the rank of y to be >= 2, "+"but got ".concat(t.shape.length)})),"number"===typeof n&&(n=[n,n]),"complex64"===e.dtype||"complex64"===t.dtype)throw new la("batchDot is not implemented for complex64-type Tensors yet.");var r=e.shape.length,a=t.shape.length;null==n&&(n=[r-1,a-2]);var o=n;return i.pf((function(){var n,s;if(r>a){n=r-a;for(var c=[],u=0;u<n;++u)c.push(1);t=i.Ne(t,t.shape.concat(c))}else if(a>r){n=a-r;for(var l=[],d=0;d<n;++d)l.push(1);e=i.Ne(e,e.shape.concat(l))}else n=0;if(2===e.shape.length&&2===t.shape.length)s=o[0]===o[1]?i.if(i.ye(e,t),o[0]):i.if(i.ye(i.sf(e,[1,0]),t),o[1]);else{var f=o[0]!==e.shape.length-1,p=o[1]===t.shape.length-1;s=i.pe(e,t,f,p)}if(n>0){for(var h,b=[],m=h=r>a?r+a-3:r-1;m<h+n;++m)b.push(m);s=i.ff(s,b)}return 1===s.shape.length&&(s=i.Xd(s,1)),s}))}(n,r,t)}},{key:"interpretAxes",value:function(e,t){return Array.isArray(this.axes)?this.axes:[Ru(this.axes,e.length),Ru(this.axes,t.length)]}},{key:"computeOutputShape",value:function(e){i.wf.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 la("Dot layer does not support tensors of 4D or higher rank yet.");var r=this.interpretAxes(t,n);t.splice(r[0],1),n.splice(r[1],1),n.splice(0,1);var a=t.concat(n);return 1===a.length&&a.push(1),a}},{key:"computeMask",value:function(e,t){return null}},{key:"getConfig",value:function(){var e={axes:this.axes,normalize:this.normalize},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(Su);Fu.className="Dot",i.Se.registerClass(Fu);var Du=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r.stddev=e.stddev,r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t={stddev:this.stddev};return Object.assign(t,e),t}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t);var r=Zi(e);return wi((function(){return Object(i.nd)(bi(r.shape,0,n.stddev),r)}),(function(){return r}),t.training||!1)}))}}]),n}(lo);Du.className="GaussianNoise",i.Se.registerClass(Du);var _u=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r.rate=e.rate,r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t={rate:this.rate};return Object.assign(t,e),t}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t);var r=Zi(e);if(n.rate>0&&n.rate<1){return wi((function(){var e=Math.sqrt(n.rate/(1-n.rate));return Object(i.ye)(r,bi(r.shape,1,e))}),(function(){return r}),t.training||!1)}return r}))}}]),n}(lo);_u.className="GaussianDropout",i.Se.registerClass(_u);var Mu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r.rate=e.rate,r.noiseShape=e.noiseShape,r}return Object($r.a)(n,[{key:"_getNoiseShape",value:function(e){return this.noiseShape||Zi(e).shape}},{key:"computeOutputShape",value:function(e){return e}},{key:"getConfig",value:function(){var e=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this),t={rate:this.rate};return Object.assign(t,e),t}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){if(n.rate<1&&n.rate>0){var r=n._getNoiseShape(e);return wi((function(){var t=Zi(e),a=-1.7580993408473766,o=Object(i.ee)(Object(i.Je)(r),n.rate);o=oi(o,"float32");var s=Math.pow((1-n.rate)*(1+n.rate*Math.pow(a,2)),-.5),c=-s*a*n.rate,u=Object(i.nd)(Object(i.ye)(t,o),Object(i.ye)(Object(i.nd)(o,-1),a));return Object(i.nd)(Object(i.ye)(u,s),c)}),(function(){return Zi(e)}),t.training||!1)}return e}))}}]),n}(lo);function zu(e,t,n,r,a){var o,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.001;if(2===e.rank)o=i.vd(e,t,n,r,a,s);else if(3===e.rank)o=i.wd(e,t,n,r,a,s);else{if(4!==e.rank)throw new la("batchNormalization is not implemented for array of rank ".concat(e.rank," ")+"yet");o=i.xd(e,t,n,r,a,s)}return o}function Lu(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.001;return Object(i.pf)((function(){var o=i.xe(e,r),s=o.mean,c=o.variance;return[zu(e,s,c,n,t,a),s,c]}))}function Pu(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.001;return Object(i.pf)((function(){var o,s=i.xe(e,r),c=s.mean,u=s.variance,l=[],d=Object(ea.a)(ii(0,e.rank));try{for(d.s();!(o=d.n()).done;){var f=o.value;-1!==r.indexOf(f)?l.push(1):l.push(e.shape[f])}}catch(v){d.e(v)}finally{d.f()}var p=Object(i.Ne)(c,l),h=Object(i.Ne)(u,l),b=null==t?null:Object(i.Ne)(t,l),m=null==n?null:Object(i.Ne)(n,l);return[zu(e,p,h,m,b,a),c,u]}))}Mu.className="AlphaDropout",i.Se.registerClass(Mu);var Bu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),null==e&&(e={}),(r=t.call(this,e)).supportsMasking=!0,r.axis=null==e.axis?-1:e.axis,r.momentum=null==e.momentum?.99:e.momentum,r.epsilon=null==e.epsilon?.001:e.epsilon,r.center=null==e.center||e.center,r.scale=null==e.scale||e.scale,r.betaInitializer=Gi(e.betaInitializer||"zeros"),r.gammaInitializer=Gi(e.gammaInitializer||"ones"),r.movingMeanInitializer=Gi(e.movingMeanInitializer||"zeros"),r.movingVarianceInitializer=Gi(e.movingVarianceInitializer||"ones"),r.betaConstraint=Ba(e.betaConstraint),r.gammaConstraint=Ba(e.gammaConstraint),r.betaRegularizer=Sc(e.betaRegularizer),r.gammaRegularizer=Sc(e.gammaRegularizer),r}return Object($r.a)(n,[{key:"build",value:function(e){e=Ji(e);var t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new ua("Axis ".concat(t," of input tensor should have a defined dimension but ")+"the layer received an input with shape "+"".concat(JSON.stringify(e),"."));this.inputSpec=[new io({ndim:e.length,axes:Object(Rc.a)({},t,n)})];var r=[n];this.scale&&(this.gamma=this.addWeight("gamma",r,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",r,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",r,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",r,null,this.movingVarianceInitializer,null,!1),this.built=!0}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var r=null!=t.training&&t.training,a=Zi(e),s=a.shape,c=s.length,u=ii(0,c),l=n.axis>=0?n.axis:n.axis+c;u.splice(l,1);var d=fa(1,c);d[l]=s[l];var f=u.slice();f.sort();var p=!i.wf.arraysEqual(f,ii(0,c).slice(0,c-1));if(!r)return function(){if(p){var e=Object(i.Ne)(n.movingMean.read(),d),t=Object(i.Ne)(n.movingVariance.read(),d),r=n.center?Object(i.Ne)(n.beta.read(),d):null,o=n.scale?Object(i.Ne)(n.gamma.read(),d):null;return zu(a,e,t,r,o,n.epsilon)}return zu(a,n.movingMean.read(),n.movingVariance.read(),null==n.beta?null:n.beta.read(),null==n.gamma?null:n.gamma.read(),n.epsilon)}();var h=function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.001;return i.wf.arraysEqual(r.slice().sort(),ii(0,e.rank-1))?Lu(e,t,n,r,a):Pu(e,t,n,r,a)}(a,n.gamma.read(),n.beta.read(),u,n.epsilon),b=Object(o.a)(h,3),m=b[0],v=b[1],g=b[2],y=function(e,t,n){i.pf((function(){var r=1-n,a=e.read(),o=i.ye(i.hf(a,t),r);e.write(i.hf(a,o))}))};return y(n.movingMean,v,n.momentum),y(n.movingVariance,g,n.momentum),m}))}},{key:"getConfig",value:function(){var e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Hi(this.betaInitializer),gammaInitializer:Hi(this.gammaInitializer),movingMeanInitializer:Hi(this.movingMeanInitializer),movingVarianceInitializer:Hi(this.movingVarianceInitializer),betaRegularizer:wc(this.betaRegularizer),gammaRegularizer:wc(this.gammaRegularizer),betaConstraint:La(this.betaConstraint),gammaConstraint:La(this.gammaConstraint)},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Bu.className="BatchNormalization",i.Se.registerClass(Bu);var Wu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),null==e&&(e={}),(r=t.call(this,e)).axis=null==e.axis?-1:e.axis,"number"===typeof r.axis){if(!Number.isInteger(r.axis))throw new Error("Expected axis to be an integer, but received ".concat(r.axis))}else{if(!Array.isArray(r.axis))throw new Error("Expected axis to be an integer or an array of integers, "+"but received ".concat(JSON.stringify(r.axis)));var a,i=Object(ea.a)(r.axis);try{for(i.s();!(a=i.n()).done;){var o=a.value;if(!Number.isInteger(o))throw new Error("Expected axis to be an array of integers, "+"but received ".concat(JSON.stringify(r.axis)))}}catch(s){i.e(s)}finally{i.f()}}return r.epsilon=null==e.epsilon?.001:e.epsilon,r.center=null==e.center||e.center,r.scale=null==e.scale||e.scale,r.betaInitializer=Gi(e.betaInitializer||"zeros"),r.gammaInitializer=Gi(e.gammaInitializer||"ones"),r.betaRegularizer=Sc(e.betaRegularizer),r.gammaRegularizer=Sc(e.gammaRegularizer),r.supportsMasking=!0,r}return Object($r.a)(n,[{key:"build",value:function(e){var t=(e=Ji(e)).length;"number"===typeof this.axis&&(this.axis=[this.axis]);for(var n=0;n<this.axis.length;++n)this.axis[n]<0&&(this.axis[n]+=t);var r,a=Object(ea.a)(this.axis);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(i<0||i>=t)throw new Error("Invalid axis: ".concat(i))}}catch(s){a.e(s)}finally{a.f()}if(this.axis.length!==ja(this.axis).length)throw new Error("Found duplicate axes in: ".concat(this.axis));var o=this.axis.map((function(t){return e[t]}));this.scale?this.gamma=this.addWeight("gamma",o,"float32",this.gammaInitializer,this.gammaRegularizer,true):this.gamma=null,this.center?this.beta=this.addWeight("beta",o,"float32",this.betaInitializer,this.betaRegularizer,true):this.beta=null,this.built=!0}},{key:"call",value:function(e,t){var n=this,r=Zi(e),a=r.shape,o=a.length;return Object(i.pf)((function(){var e,t=Object(i.xe)(r,n.axis,!0),s=t.mean,c=t.variance,u=fa(1,o),l=Object(ea.a)(n.axis);try{for(l.s();!(e=l.n()).done;){var d=e.value;u[d]=a[d]}}catch(g){l.e(g)}finally{l.f()}for(var f=function(e){return null!=e&&e.shape.length!==o&&n.axis!==[o-1]?i.Ne(e,u):e},p=f(n.gamma.read()),h=f(n.beta.read()),b=[],m=[],v=0;v<o;++v)-1!==n.axis.indexOf(v)?(b.push(a[v]),m.push(1)):(b.push(1),m.push(a[v]));return s=i.qf(s,b),c=i.qf(c,b),p=i.qf(p,m),h=i.qf(h,m),zu(r,s,c,h,p,n.epsilon)}))}},{key:"getConfig",value:function(){var e={axis:this.axis,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:Hi(this.betaInitializer),gammaInitializer:Hi(this.gammaInitializer),betaRegularizer:wc(this.betaRegularizer),gammaRegularizer:wc(this.gammaRegularizer)},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);Wu.className="LayerNormalization",i.Se.registerClass(Wu);var Uu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),null==e&&(e={}),(r=t.call(this,e)).dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,null==e.padding)r.padding=[[1,1],[1,1]];else if("number"===typeof e.padding)r.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,2!==e.padding.length)throw new ua("ZeroPadding2D expects padding to be a length-2 array, but "+"received a length-".concat(e.padding.length," array."));var a,i;if("number"===typeof e.padding[0])a=[e.padding[0],e.padding[0]],i=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,2!==e.padding[0].length)throw new ua("ZeroPadding2D expects height padding to be a length-2 array, "+"but received a length-".concat(e.padding[0].length," array."));if(a=e.padding[0],2!==e.padding[1].length)throw new ua("ZeroPadding2D expects width padding to be a length-2 array, "+"but received a length-".concat(e.padding[1].length," array."));i=e.padding[1]}r.padding=[a,i]}return r.inputSpec=[new io({ndim:4})],r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){var t,n;return e=Ji(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]])}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){return t=Zi(e),r=n.padding,a=n.dataFormat,Object(i.pf)((function(){if(4!==t.rank)throw new ua("temporalPadding expects input tensor to be 4-D, but received a "+"".concat(t.rank,"-D tensor."));if(null==r&&(r=[[1,1],[1,1]]),2!==r.length||2!==r[0].length||2!==r[1].length)throw new ua("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==a&&(a="channelsLast"),"channelsLast"!==a&&"channelsFirst"!==a)throw new ua("Unknown data format: ".concat(a,". ")+"Supported data formats are 'channelsLast' and 'channelsFirst.");var e;return e="channelsFirst"===a?[[0,0],[0,0],r[0],r[1]]:[[0,0],r[0],r[1],[0,0]],i.Fe(t,e)}));var t,r,a}))}},{key:"getConfig",value:function(){var e={padding:this.padding,dataFormat:this.dataFormat},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo);function Vu(e,t,n,r,a,o){return Object(i.pf)((function(){var s;Ka(a),Ya(o),Xa(r),null==n&&(n=[1,1]),null==r&&(r="valid"),null==a&&(a="channelsLast"),null==o&&(o="max"),e=Mc(e,a);var c="same"===r?"same":"valid";return s="max"===o?i.re(e,t,n,c):i.rd(e,t,n,c),"channelsFirst"===a&&(s=i.sf(s,[0,3,1,2])),s}))}function Hu(e,t,n,r,a,o){return Object(i.pf)((function(){var s;Ka(a),Ya(o),Xa(r),null==n&&(n=[1,1,1]),null==r&&(r="valid"),null==a&&(a="channelsLast"),null==o&&(o="max"),e=zc(e,a);var c="same"===r?"same":"valid";return s="max"===o?i.se(e,t,n,c):i.sd(e,t,n,c),"channelsFirst"===a&&(s=i.sf(s,[0,4,1,2,3])),s}))}Uu.className="ZeroPadding2D",i.Se.registerClass(Uu);var Gu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),null==e.poolSize&&(e.poolSize=2),r=t.call(this,e),"number"===typeof e.poolSize)r.poolSize=[e.poolSize];else{if(!Array.isArray(e.poolSize)||1!==e.poolSize.length||"number"!==typeof e.poolSize[0])throw new ua("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received "+"".concat(JSON.stringify(e.poolSize)));r.poolSize=e.poolSize}if(Ca(r.poolSize,"poolSize"),null==e.strides)r.strides=r.poolSize;else if("number"===typeof e.strides)r.strides=[e.strides];else{if(!Array.isArray(e.strides)||1!==e.strides.length||"number"!==typeof e.strides[0])throw new ua("strides for 1D convolutional layer must be a number or an Array of a single number, but received "+"".concat(JSON.stringify(e.strides)));r.strides=e.strides}return Ca(r.strides,"strides"),r.padding=null==e.padding?"valid":e.padding,Xa(r.padding),r.inputSpec=[new io({ndim:3})],r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){var t=Dc((e=Ji(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){n.invokeCallHook(e,t),e=si(Zi(e),2);var r=n.poolingFunction(Zi(e),[n.poolSize[0],1],[n.strides[0],1],n.padding,"channelsLast");return i.ff(r,[2])}))}},{key:"getConfig",value:function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo),qu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return Ka(a),Xa(r),Vu(e,t,n,r,a,"max")}}]),n}(Gu);qu.className="MaxPooling1D",i.Se.registerClass(qu);var Ku=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return Ka(a),Xa(r),Vu(e,t,n,r,a,"avg")}}]),n}(Gu);Ku.className="AveragePooling1D",i.Se.registerClass(Ku);var Xu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),null==e.poolSize&&(e.poolSize=[2,2]),(r=t.call(this,e)).poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize],null==e.strides)r.strides=r.poolSize;else if(Array.isArray(e.strides)){if(2!==e.strides.length)throw new ua("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length "+"".concat(e.strides.length,"."));r.strides=e.strides}else r.strides=[e.strides,e.strides];return Ca(r.poolSize,"poolSize"),Ca(r.strides,"strides"),r.padding=null==e.padding?"valid":e.padding,r.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ka(r.dataFormat),Xa(r.padding),r.inputSpec=[new io({ndim:4})],r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){e=Ji(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=Dc(t,this.poolSize[0],this.padding,this.strides[0]),n=Dc(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){return n.invokeCallHook(e,t),n.poolingFunction(Zi(e),n.poolSize,n.strides,n.padding,n.dataFormat)}))}},{key:"getConfig",value:function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo),Yu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return Ka(a),Xa(r),Vu(e,t,n,r,a,"max")}}]),n}(Xu);Yu.className="MaxPooling2D",i.Se.registerClass(Yu);var $u=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return Ka(a),Xa(r),Vu(e,t,n,r,a,"avg")}}]),n}(Xu);$u.className="AveragePooling2D",i.Se.registerClass($u);var Qu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;if(Object(Yr.a)(this,n),null==e.poolSize&&(e.poolSize=[2,2,2]),(r=t.call(this,e)).poolSize=Array.isArray(e.poolSize)?e.poolSize:[e.poolSize,e.poolSize,e.poolSize],null==e.strides)r.strides=r.poolSize;else if(Array.isArray(e.strides)){if(3!==e.strides.length)throw new ua("If the strides property of a 3D pooling layer is an Array, it is expected to have a length of 3, but received length "+"".concat(e.strides.length,"."));r.strides=e.strides}else r.strides=[e.strides,e.strides,e.strides];return Ca(r.poolSize,"poolSize"),Ca(r.strides,"strides"),r.padding=null==e.padding?"valid":e.padding,r.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ka(r.dataFormat),Xa(r.padding),r.inputSpec=[new io({ndim:5})],r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){e=Ji(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],r="channelsFirst"===this.dataFormat?e[4]:e[3];return t=Dc(t,this.poolSize[0],this.padding,this.strides[0]),n=Dc(n,this.poolSize[1],this.padding,this.strides[1]),r=Dc(r,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,r]:[e[0],t,n,r,e[4]]}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){return n.invokeCallHook(e,t),n.poolingFunction(Zi(e),n.poolSize,n.strides,n.padding,n.dataFormat)}))}},{key:"getConfig",value:function(){var e={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo),Zu=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return Ka(a),Xa(r),Hu(e,t,n,r,a,"max")}}]),n}(Qu);Zu.className="MaxPooling3D",i.Se.registerClass(Zu);var Ju=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e)}return Object($r.a)(n,[{key:"poolingFunction",value:function(e,t,n,r,a){return Ka(a),Xa(r),Hu(e,t,n,r,a,"avg")}}]),n}(Qu);Ju.className="AveragePooling3D",i.Se.registerClass(Ju);var el=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).inputSpec=[new io({ndim:3})],r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){return[e[0],e[2]]}},{key:"call",value:function(e,t){throw new la}}]),n}(lo),tl=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e||{})}return Object($r.a)(n,[{key:"call",value:function(e,t){return Object(i.pf)((function(){var t=Zi(e);return i.ue(t,1)}))}}]),n}(el);tl.className="GlobalAveragePooling1D",i.Se.registerClass(tl);var nl=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){return Object(Yr.a)(this,n),t.call(this,e||{})}return Object($r.a)(n,[{key:"call",value:function(e,t){return Object(i.pf)((function(){var t=Zi(e);return i.qe(t,1)}))}}]),n}(el);nl.className="GlobalMaxPooling1D",i.Se.registerClass(nl);var rl=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Ka(r.dataFormat),r.inputSpec=[new io({ndim:4})],r}return Object($r.a)(n,[{key:"computeOutputShape",value:function(e){return e=e,"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}},{key:"call",value:function(e,t){throw new la}},{key:"getConfig",value:function(){var e={dataFormat:this.dataFormat},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}]),n}(lo),al=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var t=Zi(e);return"channelsLast"===n.dataFormat?i.ue(t,[1,2]):i.ue(t,[2,3])}))}}]),n}(rl);al.className="GlobalAveragePooling2D",i.Se.registerClass(al);var il=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){return Object(Yr.a)(this,n),t.apply(this,arguments)}return Object($r.a)(n,[{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var t=Zi(e);return"channelsLast"===n.dataFormat?i.qe(t,[1,2]):i.qe(t,[2,3])}))}}]),n}(rl);il.className="GlobalMaxPooling2D",i.Se.registerClass(il);var ol=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).layer=e.layer,r}return Object($r.a)(n,[{key:"build",value:function(e){this.built=!0}},{key:"trainable",get:function(){return null!=this.layer&&this.layer.trainable},set:function(e){null!=this.layer&&(this.layer.trainable=e)}},{key:"trainableWeights",get:function(){return this.layer.trainableWeights}},{key:"nonTrainableWeights",get:function(){return this.layer.nonTrainableWeights}},{key:"updates",get:function(){return this.layer._updates}},{key:"losses",get:function(){return this.layer.losses}},{key:"getWeights",value:function(){return this.layer.getWeights()}},{key:"setWeights",value:function(e){this.layer.setWeights(e)}},{key:"getConfig",value:function(){var e={layer:{className:this.layer.getClassName(),config:this.layer.getConfig()}},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}},{key:"setFastWeightInitDuringBuild",value:function(e){Object(Eo.a)(Object(na.a)(n.prototype),"setFastWeightInitDuringBuild",this).call(this,e),null!=this.layer&&this.layer.setFastWeightInitDuringBuild(e)}}],[{key:"fromConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.layer,a=Ao(r,n);delete t.layer;var i={layer:a};return Object.assign(i,t),new e(i)}}]),n}(lo),sl=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this,e)).supportsMasking=!0,r}return Object($r.a)(n,[{key:"build",value:function(e){if((e=Ji(e)).length<3)throw new ua("TimeDistributed layer expects an input shape >= 3D, but received "+"input shape ".concat(JSON.stringify(e)));this.inputSpec=[{shape:e}];var t=[e[0]].concat(e.slice(2));this.layer.built||(this.layer.build(t),this.layer.built=!0),Object(Eo.a)(Object(na.a)(n.prototype),"build",this).call(this,e)}},{key:"computeOutputShape",value:function(e){var t=[(e=Ji(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){return eu((function(e,r){return[Zi(n.layer.call(e,t)),[]]}),e=Zi(e),[],!1,null,null,!1,!0)[1]}))}}]),n}(ol);sl.className="TimeDistributed",i.Se.registerClass(sl);var cl=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;Object(Yr.a)(this,n),r=t.call(this,e);var a=e.layer.getConfig(),i={};i.className=e.layer.getClassName(),i.config=a,r.forwardLayer=Ao(i),a.goBackwards=!0!==a.goBackwards;var o,s={};if(s.className=e.layer.getClassName(),s.config=a,r.backwardLayer=Ao(s),r.forwardLayer.name="forward_"+r.forwardLayer.name,r.backwardLayer.name="backward_"+r.backwardLayer.name,r.mergeMode=void 0===e.mergeMode?"concat":e.mergeMode,o=r.mergeMode,Na(Ga,"BidirectionalMergeMode",o),e.weights)throw new la("weights support is not implemented for Bidirectional layer yet.");return r._stateful=e.layer.stateful,r.returnSequences=e.layer.returnSequences,r.returnState=e.layer.returnState,r.supportsMasking=!0,r._trainable=!0,r.inputSpec=e.layer.inputSpec,r.numConstants=null,r}return Object($r.a)(n,[{key:"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)}},{key:"getWeights",value:function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())}},{key:"setWeights",value:function(e){var t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))}},{key:"computeOutputShape",value:function(e){var t,n,r,a=this.forwardLayer.computeOutputShape(e);return Array.isArray(a)&&Array.isArray(a[0])||(a=[a]),a=a,this.returnState?(r=a.slice(1),t=a[0]):t=a[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()):ba(n)}},{key:"apply",value:function(e,t){var r=null==t?null:t.initialState,a=null==t?null:t.constants;null==t&&(t={});var i=Jc(e,r,a,this.numConstants);if(e=i.inputs,r=i.initialState,a=i.constants,Array.isArray(e)&&(r=e.slice(1),e=e[0]),(null==r||0===r.length)&&null==a)return Object(Eo.a)(Object(na.a)(n.prototype),"apply",this).call(this,e,t);var o=[],s=[];if(null!=r){var c=r.length;if(c%2>0)throw new ua("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=r,o.push.apply(o,Object(Vn.a)(r));var u=r.map((function(e){return new io({shape:e.shape})}));this.forwardLayer.stateSpec=u.slice(0,c/2),this.backwardLayer.stateSpec=u.slice(c/2),s.push.apply(s,Object(Vn.a)(u))}if(null!=a)throw new la("Support for constants in Bidirectional layers is not implemented yet.");for(var l=o[0]instanceof oo,d=0,f=o;d<f.length;d++){if(f[d]instanceof oo!==l)throw new ua("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors")}if(l){var p=[e].concat(o),h=this.inputSpec.concat(s),b=this.inputSpec;this.inputSpec=h;var m=Object(Eo.a)(Object(na.a)(n.prototype),"apply",this).call(this,p,t);return this.inputSpec=b,m}return Object(Eo.a)(Object(na.a)(n.prototype),"apply",this).call(this,e,t)}},{key:"call",value:function(e,t){var n=this;return Object(i.pf)((function(){var r,a,o,s,c=t.initialState;if(null==c)r=n.forwardLayer.call(e,t),a=n.backwardLayer.call(e,t);else{var u=c.slice(0,c.length/2),l=c.slice(c.length/2);r=n.forwardLayer.call(e,Object.assign(t,{initialState:u})),a=n.backwardLayer.call(e,Object.assign(t,{initialState:l}))}return n.returnState&&(Array.isArray(r)&&(o=r.slice(1).concat(a.slice(1))),r=r[0],a=a[0]),n.returnSequences&&(a=i.Oe(a,1)),"concat"===n.mergeMode?s=fi([r,a]):"sum"===n.mergeMode?s=i.nd(r,a):"ave"===n.mergeMode?s=i.ye(.5,i.nd(r,a)):"mul"===n.mergeMode?s=i.ye(r,a):null==n.mergeMode&&(s=[r,a]),n.returnState?null==n.mergeMode?s.concat(o):[s].concat(o):s}))}},{key:"resetStates",value:function(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}},{key:"build",value:function(e){var t=this;Qa(this.forwardLayer.name,(function(){t.forwardLayer.build(e)})),Qa(this.backwardLayer.name,(function(){t.backwardLayer.build(e)})),this.built=!0}},{key:"computeMask",value:function(e,t){var n;if(Array.isArray(t)&&(t=t[0]),n=this.returnSequences?null==this.mergeMode?[t,t]:t:null==this.mergeMode?[null,null]:null,this.returnState){var r=this.forwardLayer.states.map((function(e){return null}));return Array.isArray(n)?n.concat(r).concat(r):[n].concat(r).concat(r)}return n}},{key:"trainableWeights",get:function(){return this.forwardLayer.trainableWeights.concat(this.backwardLayer.trainableWeights)}},{key:"nonTrainableWeights",get:function(){return this.forwardLayer.nonTrainableWeights.concat(this.backwardLayer.nonTrainableWeights)}},{key:"setFastWeightInitDuringBuild",value:function(e){Object(Eo.a)(Object(na.a)(n.prototype),"setFastWeightInitDuringBuild",this).call(this,e),null!=this.forwardLayer&&this.forwardLayer.setFastWeightInitDuringBuild(e),null!=this.backwardLayer&&this.backwardLayer.setFastWeightInitDuringBuild(e)}},{key:"getConfig",value:function(){var e={mergeMode:this.mergeMode},t=Object(Eo.a)(Object(na.a)(n.prototype),"getConfig",this).call(this);return Object.assign(e,t),e}}],[{key:"fromConfig",value:function(e,t){var n=Ao(t.layer);if(delete t.layer,null!=t.numConstants)throw new la("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");var r=t;return r.layer=n,new e(r)}}]),n}(ol);cl.className="Bidirectional",i.Se.registerClass(cl);var ul=n(80),ll=n(1),dl=function(){function e(t,n,r){var a=this;Object(Yr.a)(this,e),this.node=t,this.tensorMap=n,this.context=r,this.inputs=[],this.attrs={},this.inputs=t.inputNames.map((function(e){return a.getInput(e)})),null!=t.rawAttrs&&(this.attrs=Object.keys(t.rawAttrs).reduce((function(e,t){return e[t]=a.getAttr(t),e}),{}))}return Object($r.a)(e,[{key:"getInput",value:function(e){return Object(ll.e)(e,this.tensorMap,this.context)}},{key:"getAttr",value:function(e,t){var n=this.node.rawAttrs[e];if(null!=n.tensor)return Object(ll.e)(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return Object(ul.f)(this.node.rawAttrs,e,t);if(null!=n.s)return Object(ul.i)(this.node.rawAttrs,e,t);if(null!=n.b)return Object(ul.c)(this.node.rawAttrs,e,t);if(null!=n.shape)return Object(ul.k)(this.node.rawAttrs,e,t);if(null!=n.type)return Object(ul.e)(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return Object(ul.g)(this.node.rawAttrs,e,t);if(null!=n.list.s)return Object(ul.h)(this.node.rawAttrs,e,t);if(null!=n.list.shape)return Object(ul.j)(this.node.rawAttrs,e,t);if(null!=n.list.b)return Object(ul.b)(this.node.rawAttrs,e,t);if(null!=n.list.type)return Object(ul.d)(this.node.rawAttrs,e,t)}return t}}]),e}(),fl=n(131),pl=n(251),hl=n(81),bl=n(149),ml=n(133);function vl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("number"!==typeof e&&"number"!==typeof t){i.wf.assert(e.length===t.length,(function(){return n+" Shapes ".concat(e," and ").concat(t," must match")}));for(var r=0;r<e.length;r++){var a=e[r],o=t[r];i.wf.assert(a<0||o<0||a===o,(function(){return n+" Shapes ".concat(e," and ").concat(t," must match")}))}}}function gl(e){return"number"!==typeof e&&!e.some((function(e){return e<0}))}function yl(e,t,n){var r=Ol(e,n),a=!gl(r);if(a&&0===t.length)throw new Error("Tried to calculate elements of an empty list"+" with non-fully-defined elementShape: ".concat(r));if(a&&t.forEach((function(e){r=Ol(e.shape,r)})),!gl(r))throw new Error("Non-fully-defined elementShape: ".concat(r));return r}function Ol(e,t){if("number"===typeof e)return t;if("number"===typeof t)return e;if(e.length!==t.length)throw new Error("Incompatible ranks during merge: ".concat(e," vs. ").concat(t));for(var n=[],r=0;r<e.length;++r){var a=e[r],i=t[r];if(a>=0&&i>=0&&a!==i)throw new Error("Incompatible shape during merge: ".concat(e," vs. ").concat(t));n[r]=a>=0?a:i}return n}var xl=function(){function e(t,n,r,a,o,s,c){Object(Yr.a)(this,e),this.name=t,this.dtype=n,this.maxSize=r,this.elementShape=a,this.identicalElementShapes=o,this.dynamicSize=s,this.clearAfterRead=c,this.tensors=[],this.closed_=!1,this.idTensor=Object(i.Pe)(0),Object(i.he)(this.idTensor)}return Object($r.a)(e,[{key:"id",get:function(){return this.idTensor.id}},{key:"closed",get:function(){return this.closed_}},{key:"clearAndClose",value:function(e){this.tensors.forEach((function(t){null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}},{key:"size",value:function(){return this.tensors.length}},{key:"read",value:function(e){if(this.closed_)throw new Error("TensorArray ".concat(this.name," has already been closed."));if(e<0||e>=this.size())throw new Error("Tried to read from index ".concat(e,", but array size is: ").concat(this.size()));var t=this.tensors[e];if(t.cleared)throw new Error("TensorArray ".concat(this.name,": Could not read index ").concat(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}},{key:"readMany",value:function(e){var t=this;return e.map((function(e){return t.read(e)}))}},{key:"write",value:function(e,t){if(this.closed_)throw new Error("TensorArray ".concat(this.name," has already been closed."));if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error("Tried to write to index ".concat(e,", but array is not resizeable and size is: ").concat(this.maxSize));var n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error("TensorArray ".concat(this.name,": Could not write to TensorArray index ").concat(e,",\n because the value dtype is ").concat(t.dtype,", but TensorArray dtype is ").concat(this.dtype,"."));if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),vl(this.elementShape,t.shape,"TensorArray ".concat(this.name,": Could not write to TensorArray index ").concat(e,".")),n.read)throw new Error("TensorArray ".concat(this.name,": Could not write to TensorArray index ").concat(e,", because it has already been read."));if(n.written)throw new Error("TensorArray ".concat(this.name,": Could not write to TensorArray index ").concat(e,", because it has already been written."));n.tensor=t,Object(i.he)(t),n.written=!0,this.tensors[e]=n}},{key:"writeMany",value:function(e,t){var n=this;if(e.length!==t.length)throw new Error("TensorArray ".concat(this.name,": could not write multiple tensors,")+"because the index size: ".concat(e.length," is not the same as tensors size: ").concat(t.length,"."));e.forEach((function(e,r){return n.write(e,t[r])}))}},{key:"gather",value:function(e,t){if(t&&t!==this.dtype)throw new Error("TensorArray dtype is ".concat(this.dtype," but gather requested dtype ").concat(t));if(e)e=e.slice(0,this.size());else{e=[];for(var n=0;n<this.size();n++)e.push(n)}if(0===e.length)return Object(i.lf)([],[0].concat(this.elementShape));var r=this.readMany(e);return vl(this.elementShape,r[0].shape,"TensorArray shape mismatch: "),Object(i.gf)(r,0)}},{key:"concat",value:function(e){if(e&&e!==this.dtype)throw new Error("TensorArray dtype is ".concat(this.dtype," but concat requested dtype ").concat(e));if(0===this.size())return Object(i.lf)([],[0].concat(this.elementShape));for(var t=[],n=0;n<this.size();n++)t.push(n);var r=this.readMany(t);return vl(this.elementShape,r[0].shape,"TensorArray shape mismatch: tensor array shape (".concat(this.elementShape,") vs first tensor shape (").concat(r[0].shape,")")),Object(i.Dd)(r,0)}},{key:"scatter",value:function(e,t){if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is ".concat(this.dtype," but tensor has dtype ").concat(t.dtype));if(e.length!==t.shape[0])throw new Error("Expected len(indices) == tensor.shape[0], but saw: ".concat(e.length," vs. ").concat(t.shape[0]));var n=Math.max.apply(Math,Object(Vn.a)(e));if(!this.dynamicSize&&n>=this.maxSize)throw new Error("Max index must be < array size (".concat(n," vs. ").concat(this.maxSize,")"));this.writeMany(e,Object(i.uf)(t,0))}},{key:"split",value:function(e,t){var n=this;if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is ".concat(this.dtype," but tensor has dtype ").concat(t.dtype));var r=0,a=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 ".concat(r,", and tensor's shape is: ").concat(t.shape));if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error("TensorArray's size is not equal to the size of lengths (".concat(this.maxSize," vs. ").concat(e.length,"), ")+"and the TensorArray is not marked as dynamically resizeable");var o=0===r?0:t.size/r,s=[];Object(i.pf)((function(){t=Object(i.Ne)(t,[1,r,o]);for(var c=0;c<e.length;++c){var u=[0,0===c?0:a[c-1],0],l=[1,e[c],o];s[c]=Object(i.Ne)(Object(i.Ve)(t,u,l),n.elementShape)}return s}));for(var c=[],u=0;u<e.length;u++)c[u]=u;this.writeMany(c,s)}}]),e}(),kl=function(){function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;Object(Yr.a)(this,e),this.tensors=t,this.elementShape=n,this.elementDtype=r,null!=t&&t.forEach((function(e){if(r!==e.dtype)throw new Error("Invalid data types; op elements ".concat(r,", but list elements ").concat(e.dtype));vl(n,e.shape,"TensorList shape mismatch: "),Object(i.he)(e)})),this.idTensor=Object(i.Pe)(0),this.maxNumElements=a,Object(i.he)(this.idTensor)}return Object($r.a)(e,[{key:"id",get:function(){return this.idTensor.id}},{key:"copy",value:function(){return new e(Object(Vn.a)(this.tensors),this.elementShape,this.elementDtype)}},{key:"clearAndClose",value:function(e){this.tensors.forEach((function(t){null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}},{key:"size",value:function(){return this.tensors.length}},{key:"stack",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(t!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(t,", but list elements ").concat(this.elementDtype));if(-1!==r&&this.tensors.length!==r)throw new Error("Operation expected a list with ".concat(r," elements but got a list with ").concat(this.tensors.length," elements."));vl(e,this.elementShape,"TensorList shape mismatch: ");var a=yl(this.elementShape,this.tensors,e);return Object(i.pf)((function(){var e=n.tensors.map((function(e){return Object(i.Ne)(e,a)}));return Object(i.gf)(e,0)}))}},{key:"popBack",value:function(e,t){if(t!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(t,", but list elements ").concat(this.elementDtype));if(0===this.size())throw new Error("Trying to pop from an empty list.");var n=yl(this.elementShape,this.tensors,e),r=this.tensors.pop();return vl(r.shape,e,"TensorList shape mismatch: "),Object(i.Ne)(r,n)}},{key:"pushBack",value:function(e){if(e.dtype!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(e.dtype,", but list elements ").concat(this.elementDtype));if(vl(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Object(i.he)(e),this.tensors.push(e)}},{key:"resize",value:function(e){if(e<0)throw new Error("TensorListResize expects size to be non-negative. Got: ".concat(e));if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error("TensorListResize input size ".concat(e," is greater maxNumElement ").concat(this.maxNumElements,"."));this.tensors.length=e}},{key:"getItem",value:function(e,t,n){if(n!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(n,", but list elements ").concat(this.elementDtype));if(e<0||e>this.tensors.length)throw new Error("Trying to access element ".concat(e," in a list with ").concat(this.tensors.length," elements."));if(null==this.tensors[e])throw new Error("element at index ".concat(e," is null."));vl(this.tensors[e].shape,t,"TensorList shape mismatch: ");var r=yl(this.elementShape,this.tensors,t);return Object(i.Ne)(this.tensors[e],r)}},{key:"setItem",value:function(e,t){if(t.dtype!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(t.dtype,", but list elements ").concat(this.elementDtype));if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error("Trying to set element ".concat(e," in a list with max ").concat(this.maxNumElements," elements."));vl(this.elementShape,t.shape,"TensorList shape mismatch: "),Object(i.he)(t),this.tensors[e]=t}},{key:"gather",value:function(e,t,n){var r=this;if(t!==this.elementDtype)throw new Error("Invalid data types; op elements ".concat(t,", but list elements ").concat(this.elementDtype));vl(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());var a=yl(this.elementShape,this.tensors,n);return 0===e.length?Object(i.lf)([],[0].concat(a)):Object(i.pf)((function(){var t=e.map((function(e){return Object(i.Ne)(r.tensors[e],a)}));return Object(i.gf)(t,0)}))}},{key:"concat",value:function(e,t){var n=this;if(e&&e!==this.elementDtype)throw new Error("TensorList dtype is ".concat(this.elementDtype," but concat requested dtype ").concat(e));vl(this.elementShape,t,"TensorList shape mismatch: ");var r=yl(this.elementShape,this.tensors,t);return 0===this.size()?Object(i.lf)([],[0].concat(r)):Object(i.pf)((function(){var e=n.tensors.map((function(e){return Object(i.Ne)(e,r)}));return Object(i.Dd)(e,0)}))}}]),e}();function wl(e,t,n){var r=e.dtype;if(e.shape.length<1)throw new Error("Tensor must be at least a vector, but saw shape: ".concat(e.shape));if(e.dtype!==n)throw new Error("Invalid data types; op elements ".concat(e.dtype,", but list elements ").concat(n));vl(e.shape.slice(1),t,"TensorList shape mismatch: ");var a=Object(i.uf)(e);return new kl(a,t,r)}function jl(e,t,n){return new kl([],e,t,n)}function Sl(e,t,n,r){if(t.length!==e.shape[0])throw new Error("Expected len(indices) == tensor.shape[0], but saw: ".concat(t.length," vs. ").concat(e.shape[0]));var a=Math.max.apply(Math,Object(Vn.a)(t));if(null!=r&&-1!==r&&a>=r)throw new Error("Max index must be < array size (".concat(a," vs. ").concat(r,")"));var o=new kl([],n,e.dtype,r),s=Object(i.uf)(e,0);return t.forEach((function(e,t){o.setItem(e,s[t])})),o}function Nl(e,t,n){var r=0,a=t.map((function(e){return r+=e}));if(r!==e.shape[0])throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ".concat(r,", and tensor's shape is: ").concat(e.shape));for(var o=Ol(e.shape.slice(1),n),s=0===r?0:e.size/r,c=Object(i.pf)((function(){var n=[];e=Object(i.Ne)(e,[1,r,s]);for(var c=0;c<t.length;++c){var u=[0,0===c?0:a[c-1],0],l=[1,t[c],s];n[c]=Object(i.Ne)(Object(i.Ve)(e,u,l),o)}return e.dispose(),n})),u=new kl([],n,e.dtype,t.length),l=0;l<c.length;l++)u.setItem(l,c[l]);return u}var Il=function(){var e=Object(go.a)(vo.a.mark((function e(t,n,r){var a,o,s,c,u,l,d,f,p,h,b,m,v,g,y,O,x,k,w,j,S,N,I,C,T,E,A,R,F,D,_,M,z,L,P,B,W,U,V,H,G,q,K,X,Y,$,Q,Z,J,ee,te,ne,re,ae,ie,oe,se,ce,ue,le,de,fe,pe,he,be,me,ve,ge,ye,Oe,xe,ke,we,je,Se,Ne,Ie,Ce,Te,Ee,Ae,Re,Fe,De,_e,Me,ze,Le,Pe,Be,We,Ue,Ve,He,Ge,qe;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.op,e.next="If"===e.t0||"StatelessIf"===e.t0?3:"While"===e.t0||"StatelessWhile"===e.t0?15:"LoopCond"===e.t0?19:"Switch"===e.t0?21:"Merge"===e.t0?32:"Enter"===e.t0?37:"Exit"===e.t0?41:"NextIteration"===e.t0?44:"TensorArrayV3"===e.t0?47:"TensorArrayWriteV3"===e.t0?57:"TensorArrayReadV3"===e.t0?63:"TensorArrayGatherV3"===e.t0?67:"TensorArrayScatterV3"===e.t0?72:"TensorArrayConcatV3"===e.t0?78:"TensorArraySplitV3"===e.t0?82:"TensorArraySizeV3"===e.t0?88:"TensorArrayCloseV3"===e.t0?91:"TensorListSetItem"===e.t0?95:"TensorListGetItem"===e.t0?101:"TensorListScatterV2"===e.t0||"TensorListScatter"===e.t0?107:"TensorListReserve"===e.t0||"EmptyTensorList"===e.t0?114:"TensorListGather"===e.t0?121:"TensorListStack"===e.t0?127:"TensorListFromTensor"===e.t0?133:"TensorListConcat"===e.t0?139:"TensorListPushBack"===e.t0?144:"TensorListPopBack"===e.t0?149:"TensorListSplit"===e.t0?154:160;break;case 3:return a=Object(ll.d)("thenBranch",t,n,r),o=Object(ll.d)("elseBranch",t,n,r),s=Object(ll.d)("cond",t,n,r),c=Object(ll.d)("args",t,n,r),e.next=9,s.data();case 9:if(!e.sent[0]){e.next=14;break}return e.abrupt("return",r.functionMap[a].executeFunctionAsync(c,r.tensorArrayMap,r.tensorListMap));case 14:return e.abrupt("return",r.functionMap[o].executeFunctionAsync(c,r.tensorArrayMap,r.tensorListMap));case 15:return e.delegateYield(vo.a.mark((function e(){var a,i,o,s,c,u,l,d;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Object(ll.d)("body",t,n,r),i=Object(ll.d)("cond",t,n,r),o=Object(ll.d)("args",t,n,r),e.next=5,r.functionMap[i].executeFunctionAsync(o,r.tensorArrayMap,r.tensorListMap);case 5:return s=e.sent,c=o.map((function(e){return e.id})),e.next=9,s[0].data();case 9:u=e.sent,s.forEach((function(e){e.kept||-1!==c.indexOf(e.id)||e.dispose()})),l=o,d=vo.a.mark((function e(){var t,n,o;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l,e.next=3,r.functionMap[a].executeFunctionAsync(l,r.tensorArrayMap,r.tensorListMap);case 3:return l=e.sent,n=l.map((function(e){return e.id})),t.forEach((function(e){e.kept||-1!==c.indexOf(e.id)||-1!==n.indexOf(e.id)||e.dispose()})),e.next=8,r.functionMap[i].executeFunctionAsync(l,r.tensorArrayMap,r.tensorListMap);case 8:return o=e.sent,e.next=11,o[0].data();case 11:u=e.sent,o.forEach((function(e){e.kept||-1!==c.indexOf(e.id)||-1!==n.indexOf(e.id)||e.dispose()}));case 13:case"end":return e.stop()}}),e)}));case 13:if(!u[0]){e.next=17;break}return e.delegateYield(d(),"t0",15);case 15:e.next=13;break;case 17:return e.abrupt("return",{v:l});case 18:case"end":return e.stop()}}),e)}))(),"t1",16);case 16:if("object"!==typeof(u=e.t1)){e.next=19;break}return e.abrupt("return",u.v);case 19:return l=Object(ll.d)("pred",t,n,r),e.abrupt("return",[Object(ll.a)(l)]);case 21:return d=Object(ll.d)("pred",t,n,r),(f=Object(ll.d)("data",t,n,r)).kept||(f=Object(ll.a)(f)),e.next=26,d.data();case 26:if(!e.sent[0]){e.next=30;break}e.t2=[void 0,f],e.next=31;break;case 30:e.t2=[f,void 0];case 31:return e.abrupt("return",e.t2);case 32:if(!(p=t.inputNames.find((function(e){return void 0!==Object(ll.e)(e,n,r)})))){e.next=36;break}return h=Object(ll.e)(p,n,r),e.abrupt("return",[Object(ll.a)(h)]);case 36:return e.abrupt("return",void 0);case 37:return b=Object(ll.d)("frameName",t,n,r),m=Object(ll.d)("tensor",t,n,r),r.enterFrame(b),e.abrupt("return",[Object(ll.a)(m)]);case 41:return v=Object(ll.d)("tensor",t,n,r),r.exitFrame(),e.abrupt("return",[Object(ll.a)(v)]);case 44:return g=Object(ll.d)("tensor",t,n,r),r.nextIteration(),e.abrupt("return",[Object(ll.a)(g)]);case 47:return y=Object(ll.d)("size",t,n,r),O=Object(ll.d)("dtype",t,n,r),x=Object(ll.d)("elementShape",t,n,r),k=Object(ll.d)("dynamicSize",t,n,r),w=Object(ll.d)("clearAfterRead",t,n,r),j=Object(ll.d)("identicalElementShapes",t,n,r),S=Object(ll.d)("name",t,n,r),N=new xl(S,O,y,x,j,k,w),r.addTensorArray(N),e.abrupt("return",[N.idTensor,Object(i.Pe)(1)]);case 57:return I=Object(ll.d)("tensorArrayId",t,n,r),C=Object(ll.d)("index",t,n,r),T=Object(ll.d)("tensor",t,n,r),(E=r.getTensorArray(I.id)).write(C,T),e.abrupt("return",[E.idTensor]);case 63:return A=Object(ll.d)("tensorArrayId",t,n,r),R=Object(ll.d)("index",t,n,r),F=r.getTensorArray(A.id),e.abrupt("return",[F.read(R)]);case 67:return D=Object(ll.d)("tensorArrayId",t,n,r),_=Object(ll.d)("indices",t,n,r),M=Object(ll.d)("dtype",t,n,r),z=r.getTensorArray(D.id),e.abrupt("return",[z.gather(_,M)]);case 72:return L=Object(ll.d)("tensorArrayId",t,n,r),P=Object(ll.d)("indices",t,n,r),B=Object(ll.d)("tensor",t,n,r),(W=r.getTensorArray(L.id)).scatter(P,B),e.abrupt("return",[W.idTensor]);case 78:return U=Object(ll.d)("tensorArrayId",t,n,r),V=r.getTensorArray(U.id),H=Object(ll.d)("dtype",t,n,r),e.abrupt("return",[V.concat(H)]);case 82:return G=Object(ll.d)("tensorArrayId",t,n,r),q=Object(ll.d)("tensor",t,n,r),K=Object(ll.d)("lengths",t,n,r),(X=r.getTensorArray(G.id)).split(K,q),e.abrupt("return",[X.idTensor]);case 88:return Y=Object(ll.d)("tensorArrayId",t,n,r),$=r.getTensorArray(Y.id),e.abrupt("return",[Object(i.Pe)($.size(),"int32")]);case 91:return Q=Object(ll.d)("tensorArrayId",t,n,r),(Z=r.getTensorArray(Q.id)).clearAndClose(),e.abrupt("return",[Z.idTensor]);case 95:return J=Object(ll.d)("tensorListId",t,n,r),ee=Object(ll.d)("index",t,n,r),te=Object(ll.d)("tensor",t,n,r),(ne=r.getTensorList(J.id)).setItem(ee,te),e.abrupt("return",[ne.idTensor]);case 101:return re=Object(ll.d)("tensorListId",t,n,r),ae=Object(ll.d)("index",t,n,r),ie=Object(ll.d)("elementShape",t,n,r),oe=Object(ll.d)("elementDType",t,n,r),se=r.getTensorList(re.id),e.abrupt("return",[se.getItem(ae,ie,oe)]);case 107:return ce=Object(ll.d)("indices",t,n,r),ue=Object(ll.d)("tensor",t,n,r),le=Object(ll.d)("elementShape",t,n,r),de=Object(ll.d)("numElements",t,n,r),fe=Sl(ue,ce,le,de),r.addTensorList(fe),e.abrupt("return",[fe.idTensor]);case 114:return pe=Object(ll.d)("elementShape",t,n,r),he=Object(ll.d)("elementDType",t,n,r),be="TensorListReserve"===t.op?"numElements":"maxNumElements",me=Object(ll.d)(be,t,n,r),ve=jl(pe,he,me),r.addTensorList(ve),e.abrupt("return",[ve.idTensor]);case 121:return ge=Object(ll.d)("tensorListId",t,n,r),ye=Object(ll.d)("indices",t,n,r),Oe=Object(ll.d)("elementShape",t,n,r),xe=Object(ll.d)("elementDType",t,n,r),ke=r.getTensorList(ge.id),e.abrupt("return",[ke.gather(ye,xe,Oe)]);case 127:return we=Object(ll.d)("tensorListId",t,n,r),je=Object(ll.d)("elementShape",t,n,r),Se=Object(ll.d)("elementDType",t,n,r),Ne=Object(ll.d)("numElements",t,n,r),Ie=r.getTensorList(we.id),e.abrupt("return",[Ie.stack(je,Se,Ne)]);case 133:return Ce=Object(ll.d)("tensor",t,n,r),Te=Object(ll.d)("elementShape",t,n,r),Ee=Object(ll.d)("elementDType",t,n,r),Ae=wl(Ce,Te,Ee),r.addTensorList(Ae),e.abrupt("return",[Ae.idTensor]);case 139:return Re=Object(ll.d)("tensorListId",t,n,r),Fe=r.getTensorList(Re.id),De=Object(ll.d)("dtype",t,n,r),_e=Object(ll.d)("elementShape",t,n,r),e.abrupt("return",[Fe.concat(De,_e)]);case 144:return Me=Object(ll.d)("tensorListId",t,n,r),ze=Object(ll.d)("tensor",t,n,r),(Le=r.getTensorList(Me.id)).pushBack(ze),e.abrupt("return",[Le.idTensor]);case 149:return Pe=Object(ll.d)("tensorListId",t,n,r),Be=Object(ll.d)("elementShape",t,n,r),We=Object(ll.d)("elementDType",t,n,r),Ue=r.getTensorList(Pe.id),e.abrupt("return",[Ue.popBack(Be,We)]);case 154:return Ve=Object(ll.d)("tensor",t,n,r),He=Object(ll.d)("elementShape",t,n,r),Ge=Object(ll.d)("lengths",t,n,r),qe=Nl(Ve,Ge,He),r.addTensorList(qe),e.abrupt("return",[qe.idTensor]);case 160:throw TypeError("Node type ".concat(t.op," is not implemented"));case 161:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Cl=n(37),Tl=n(259),El=n(271),Al=n(256),Rl=n(270);function Fl(e,t,n){var r=Object(ll.d)("fusedOps",e,t,n),a=Object(o.a)(r,2),i=a[0],s=a[1],c="biasadd"===i,u=!c,l="prelu"===s,d="fusedbatchnorm"===i,f=Object(ll.d)("numArgs",e,t,n);if(c){if(l&&2!==f)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!l&&c&&1!==f)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(d)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");var p=Object(ll.d)("strides",e,t,n),h=Object(ll.c)(e,t,n),b=Object(ll.d)("dataFormat",e,t,n).toUpperCase(),m=Object(ll.d)("dilations",e,t,n),v=Object(ll.d)("args",e,t,n),g=Object(o.a)(v,2),y=g[0],O=g[1];return u&&(O=y,y=void 0),{stride:p,pad:h,dataFormat:b,dilations:m,biasArg:y,preluArg:O,activationFunc:s,leakyreluAlpha:Object(ll.d)("leakyreluAlpha",e,t,n)}}var Dl=n(118),_l=n(267),Ml=n(272),zl=n(212),Ll=n(127),Pl=n(280),Bl=n(223),Wl=n(275);function Ul(e,t,n){return{boxes:Object(ll.d)("boxes",e,t,n),scores:Object(ll.d)("scores",e,t,n),maxOutputSize:Object(ll.d)("maxOutputSize",e,t,n),iouThreshold:Object(ll.d)("iouThreshold",e,t,n),scoreThreshold:Object(ll.d)("scoreThreshold",e,t,n),softNmsSigma:Object(ll.d)("softNmsSigma",e,t,n)}}var Vl=function(){var e=Object(go.a)(vo.a.mark((function e(t,n,r){var a,i,o,s,u,l,d,f,p,h,b,m,v,g,y,O,x,k,w,j,S,N,I,C;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.op,e.next="NonMaxSuppressionV5"===e.t0?3:"NonMaxSuppressionV4"===e.t0?8:"NonMaxSuppressionV3"===e.t0||"NonMaxSuppressionV2"===e.t0?14:"Where"===e.t0?19:"ListDiff"===e.t0?26:27;break;case 3:return a=Ul(t,n,r),i=a.boxes,o=a.scores,s=a.maxOutputSize,u=a.iouThreshold,l=a.scoreThreshold,d=a.softNmsSigma,e.next=6,Cl.xb.nonMaxSuppressionWithScoreAsync(i,o,s,u,l,d);case 6:return f=e.sent,e.abrupt("return",[f.selectedIndices,f.selectedScores]);case 8:return p=Ul(t,n,r),h=p.boxes,b=p.scores,m=p.maxOutputSize,v=p.iouThreshold,g=p.scoreThreshold,y=Object(ll.d)("padToMaxOutputSize",t,n,r),e.next=12,Cl.xb.nonMaxSuppressionPaddedAsync(h,b,m,v,g,y);case 12:return O=e.sent,e.abrupt("return",[O.selectedIndices,O.validOutputs]);case 14:return x=Ul(t,n,r),k=x.boxes,w=x.scores,j=x.maxOutputSize,S=x.iouThreshold,N=x.scoreThreshold,e.next=17,Cl.xb.nonMaxSuppressionAsync(k,w,j,S,N);case 17:return e.t1=e.sent,e.abrupt("return",[e.t1]);case 19:return I=c.a(Object(ll.d)("condition",t,n,r),"bool"),e.next=22,Bl.a(I);case 22:return e.t2=e.sent,C=[e.t2],I.dispose(),e.abrupt("return",C);case 26:return e.abrupt("return",Wl.a(Object(ll.d)("x",t,n,r),Object(ll.d)("y",t,n,r)));case 27:throw TypeError("Node type ".concat(t.op," is not implemented"));case 28:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Hl=n(70),Gl=function(){function e(t,n){Object(Yr.a)(this,e),this.keyDType=t,this.valueDType=n,this.handle=Object(i.Pe)(0),this.tensorMap=new Map,Object(i.he)(this.handle)}return Object($r.a)(e,[{key:"id",get:function(){return this.handle.id}},{key:"clearAndClose",value:function(){this.tensorMap.forEach((function(e){return e.dispose()})),this.tensorMap.clear(),this.handle.dispose()}},{key:"size",value:function(){return this.tensorMap.size}},{key:"tensorSize",value:function(){return h.a(this.size(),"int32")}},{key:"import",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.checkKeyAndValueTensor(t,n),e.next=3,t.data();case 3:return r=e.sent,this.tensorMap.forEach((function(e){return e.dispose()})),this.tensorMap.clear(),e.abrupt("return",Object(i.pf)((function(){var e=Object(i.uf)(n),t=r.length,o=e.length;i.wf.assert(t===o,(function(){return"The number of elements doesn't match, keys has "+"".concat(t," elements, the values has ").concat(o," ")+"elements."}));for(var s=0;s<t;s++){var c=r[s],u=e[s];Object(i.he)(u),a.tensorMap.set(c,u)}return a.handle})));case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"find",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.checkKeyAndValueTensor(t,n),e.next=3,t.data();case 3:return r=e.sent,e.abrupt("return",Object(i.pf)((function(){for(var e=[],t=0;t<r.length;t++){var o=r[t],s=a.findWithDefault(o,n);e.push(s)}return Object(i.gf)(e)})));case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"findWithDefault",value:function(e,t){var n=this.tensorMap.get(e);return null!=n?n:t}},{key:"checkKeyAndValueTensor",value:function(e,t){if(e.dtype!==this.keyDType)throw new Error("Expect key dtype ".concat(this.keyDType,", but got ")+"".concat(e.dtype));if(t.dtype!==this.valueDType)throw new Error("Expect value dtype ".concat(this.valueDType,", but got ")+"".concat(t.dtype))}}]),e}(),ql=function(){var e=Object(go.a)(vo.a.mark((function e(t,n,r,a){var i,o,s,c,u,l,d,f,p,h,b,m,v;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.op,e.next="HashTable"===e.t0||"HashTableV2"===e.t0?3:"LookupTableImport"===e.t0||"LookupTableImportV2"===e.t0?8:"LookupTableFind"===e.t0||"LookupTableFindV2"===e.t0?16:"LookupTableSize"===e.t0||"LookupTableSizeV2"===e.t0?24:27;break;case 3:return i=Object(ll.d)("keyDType",t,n,r),o=Object(ll.d)("valueDType",t,n,r),s=new Gl(i,o),a.addHashTable(t.name,s),e.abrupt("return",[s.handle]);case 8:return c=Object(ll.d)("tableHandle",t,n,r,a),u=Object(ll.d)("keys",t,n,r),l=Object(ll.d)("values",t,n,r),d=a.getHashTableById(c.id),e.next=14,d.import(u,l);case 14:return e.t1=e.sent,e.abrupt("return",[e.t1]);case 16:return f=Object(ll.d)("tableHandle",t,n,r,a),p=Object(ll.d)("keys",t,n,r),h=Object(ll.d)("defaultValue",t,n,r),b=a.getHashTableById(f.id),e.next=22,b.find(p,h);case 22:return e.t2=e.sent,e.abrupt("return",[e.t2]);case 24:return m=Object(ll.d)("tableHandle",t,n,r,a),v=a.getHashTableById(m.id),e.abrupt("return",[v.tensorSize()]);case 27:throw TypeError("Node type ".concat(t.op," is not implemented"));case 28:case"end":return e.stop()}}),e)})));return function(t,n,r,a){return e.apply(this,arguments)}}(),Kl=n(261),Xl=n(284),Yl=n(195),$l=n(260),Ql=n(281),Zl=n(282);function Jl(e,t,n,a){var s=function(e,t,n){switch(e.category){case"arithmetic":return i.pf((function(){return function(e,t,n){switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[T.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"AddN":return[pl.a(Object(ll.d)("tensors",e,t,n))];case"FloorMod":case"Mod":return[xr.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"Mul":return[u.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"RealDiv":case"Div":return[f.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"DivNoNan":return[Yn.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"FloorDiv":return[tr.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"Sub":return[v.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"Minimum":return[yr.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"Maximum":return[gn.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"Pow":return[wt.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"SquaredDifference":return[Wr.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"basic_math":return i.pf((function(){return function(e,t,n){switch(e.op){case"Abs":case"ComplexAbs":return[Sn.a(Object(ll.d)("x",e,t,n))];case"Acos":return[In.a(Object(ll.d)("x",e,t,n))];case"Acosh":return[Cn.a(Object(ll.d)("x",e,t,n))];case"Asin":return[Fn.a(Object(ll.d)("x",e,t,n))];case"Asinh":return[Dn.a(Object(ll.d)("x",e,t,n))];case"Atan":return[_n.a(Object(ll.d)("x",e,t,n))];case"Atan2":return[Mn.a(Object(ll.d)("x",e,t,n),Object(ll.d)("y",e,t,n))];case"Atanh":return[zn.a(Object(ll.d)("x",e,t,n))];case"Ceil":return[Wn.a(Object(ll.d)("x",e,t,n))];case"Complex":return[hl.a(Object(ll.d)("real",e,t,n),Object(ll.d)("imag",e,t,n))];case"Cos":return[Vt.a(Object(ll.d)("x",e,t,n))];case"Cosh":return[Gt.a(Object(ll.d)("x",e,t,n))];case"Elu":return[Qn.a(Object(ll.d)("x",e,t,n))];case"Erf":return[Zn.a(Object(ll.d)("x",e,t,n))];case"Exp":return[Se.a(Object(ll.d)("x",e,t,n))];case"Expm1":return[Jn.a(Object(ll.d)("x",e,t,n))];case"Floor":return[ft.a(Object(ll.d)("x",e,t,n))];case"Log":return[kt.a(Object(ll.d)("x",e,t,n))];case"Log1p":return[fr.a(Object(ll.d)("x",e,t,n))];case"Imag":return[bl.a(Object(ll.d)("x",e,t,n))];case"Neg":return[p.a(Object(ll.d)("x",e,t,n))];case"Reciprocal":return[Tr.a(Object(ll.d)("x",e,t,n))];case"Real":return[ml.a(Object(ll.d)("x",e,t,n))];case"Relu":return[Er.a(Object(ll.d)("x",e,t,n))];case"Round":return[_r.a(Object(ll.d)("x",e,t,n))];case"Selu":return[Mr.a(Object(ll.d)("x",e,t,n))];case"Sigmoid":return[Qt.a(Object(ll.d)("x",e,t,n))];case"Sin":return[fe.a(Object(ll.d)("x",e,t,n))];case"Sign":return[Lr.a(Object(ll.d)("x",e,t,n))];case"Sinh":return[he.a(Object(ll.d)("x",e,t,n))];case"Softplus":return[Br.a(Object(ll.d)("x",e,t,n))];case"Sqrt":return[b.a(Object(ll.d)("x",e,t,n))];case"Square":return[m.a(Object(ll.d)("x",e,t,n))];case"Tanh":return[Gr.a(Object(ll.d)("x",e,t,n))];case"Tan":return[Hr.a(Object(ll.d)("x",e,t,n))];case"ClipByValue":return[Un.a(Object(ll.d)("x",e,t,n),Object(ll.d)("clipValueMin",e,t,n),Object(ll.d)("clipValueMax",e,t,n))];case"Relu6":return[Ar.a(Object(ll.d)("x",e,t,n))];case"Rsqrt":return[Re.a(Object(ll.e)(e.inputNames[0],t,n))];case"Prod":return[Cr.a(Object(ll.d)("x",e,t,n),Object(ll.d)("axes",e,t,n))];case"LeakyRelu":return[sr.a(Object(ll.d)("x",e,t,n),Object(ll.d)("alpha",e,t,n))];case"Prelu":return[Ir.a(Object(ll.d)("x",e,t,n),Object(ll.d)("alpha",e,t,n))];case"IsNan":return[or.a(Object(ll.e)(e.inputNames[0],t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"control":return Il(e,t,n);case"convolution":return i.pf((function(){return function(e,t,n){switch(e.op){case"Conv1D":var r=Object(ll.d)("stride",e,t,n),a=Object(ll.d)("pad",e,t,n),i=Object(ll.d)("dataFormat",e,t,n).toUpperCase(),o=Object(ll.d)("dilation",e,t,n);return[Hn.a(Object(ll.d)("x",e,t,n),Object(ll.d)("filter",e,t,n),r,a,i,o)];case"Conv2D":var s=Object(ll.d)("strides",e,t,n),c=Object(ll.c)(e,t,n),u=Object(ll.d)("dataFormat",e,t,n).toUpperCase(),l=Object(ll.d)("dilations",e,t,n);return[se.a(Object(ll.d)("x",e,t,n),Object(ll.d)("filter",e,t,n),[s[1],s[2]],c,u,[l[1],l[2]])];case"_FusedConv2D":var d=Fl(e,t,n),f=d.stride,p=d.pad,h=d.dataFormat,b=d.dilations,m=d.biasArg,v=d.preluArg,g=d.activationFunc,y=d.leakyreluAlpha;return[Cl.qb.conv2d({x:Object(ll.d)("x",e,t,n),filter:Object(ll.d)("filter",e,t,n),strides:[f[1],f[2]],pad:p,dataFormat:h,dilations:[b[1],b[2]],bias:m,activation:g,preluActivationWeights:v,leakyreluAlpha:y})];case"FusedDepthwiseConv2dNative":var O=Fl(e,t,n),x=O.stride,k=O.pad,w=O.dataFormat,j=O.dilations,S=O.biasArg,N=O.preluArg,I=O.activationFunc,C=O.leakyreluAlpha;return[Cl.qb.depthwiseConv2d({x:Object(ll.d)("x",e,t,n),filter:Object(ll.d)("filter",e,t,n),strides:[x[1],x[2]],pad:k,dataFormat:w,dilations:[j[1],j[2]],bias:S,activation:I,preluActivationWeights:N,leakyreluAlpha:C})];case"Conv2DBackpropInput":case"Conv2dTranspose":var T=Object(ll.d)("outputShape",e,t,n),E=Object(ll.d)("strides",e,t,n),A=Object(ll.c)(e,t,n);return[Gn.a(Object(ll.d)("x",e,t,n),Object(ll.d)("filter",e,t,n),T,[E[1],E[2]],A)];case"DepthwiseConv2dNative":case"DepthwiseConv2d":var R=Object(ll.d)("strides",e,t,n),F=Object(ll.c)(e,t,n),D=Object(ll.d)("dilations",e,t,n),_=Object(ll.d)("dataFormat",e,t,n).toUpperCase();return[Kn.a(Object(ll.d)("input",e,t,n),Object(ll.d)("filter",e,t,n),[R[1],R[2]],F,_,[D[1],D[2]])];case"Conv3D":var M=Object(ll.d)("strides",e,t,n),z=Object(ll.d)("pad",e,t,n),L=Object(ll.d)("dataFormat",e,t,n).toUpperCase(),P=Object(ll.d)("dilations",e,t,n);return[Tl.a(Object(ll.d)("x",e,t,n),Object(ll.d)("filter",e,t,n),[M[1],M[2],M[3]],z,L,[P[1],P[2],P[3]])];case"AvgPool":var B=Object(ll.d)("strides",e,t,n),W=Object(ll.d)("pad",e,t,n),U=Object(ll.d)("kernelSize",e,t,n);return[Ln.a(Object(ll.d)("x",e,t,n),[U[1],U[2]],[B[1],B[2]],W)];case"MaxPool":var V=Object(ll.d)("strides",e,t,n),H=Object(ll.d)("pad",e,t,n),G=Object(ll.d)("kernelSize",e,t,n);return[br.a(Object(ll.d)("x",e,t,n),[G[1],G[2]],[V[1],V[2]],H)];case"MaxPoolWithArgmax":var q=Object(ll.d)("strides",e,t,n),K=Object(ll.d)("pad",e,t,n),X=Object(ll.d)("kernelSize",e,t,n),Y=Object(ll.d)("includeBatchInIndex",e,t,n),$=El.a(Object(ll.d)("x",e,t,n),[X[1],X[2]],[q[1],q[2]],K,Y);return[$.result,$.indexes];case"AvgPool3D":var Q=Object(ll.d)("strides",e,t,n),Z=Object(ll.d)("pad",e,t,n),J=Object(ll.d)("kernelSize",e,t,n);return[Al.a(Object(ll.d)("x",e,t,n),[J[1],J[2],J[3]],[Q[1],Q[2],Q[3]],Z)];case"MaxPool3D":var ee=Object(ll.d)("strides",e,t,n),te=Object(ll.d)("pad",e,t,n),ne=Object(ll.d)("kernelSize",e,t,n);return[Rl.a(Object(ll.d)("x",e,t,n),[ne[1],ne[2],ne[3]],[ee[1],ee[2],ee[3]],te)];case"Dilation2D":var re=Object(ll.d)("strides",e,t,n),ae=Object(ll.d)("pad",e,t,n),ie=Object(ll.d)("dilations",e,t,n),oe=re[1],ce=re[2],ue=ie[1],le=ie[2];return[Xn.a(Object(ll.d)("x",e,t,n),Object(ll.d)("filter",e,t,n),[oe,ce],ae,[ue,le],"NHWC")];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"creation":return i.pf((function(){return function(e,t,n){switch(e.op){case"Fill":var r=Object(ll.d)("shape",e,t,n),a=Object(ll.d)("dtype",e,t,n),i=Object(ll.d)("value",e,t,n);return[Dl.a(r,i,a)];case"LinSpace":var o=Object(ll.d)("start",e,t,n),s=Object(ll.d)("stop",e,t,n),c=Object(ll.d)("num",e,t,n);return[_l.a(o,s,c)];case"Multinomial":var u=Object(ll.d)("logits",e,t,n),l=Object(ll.d)("numSamples",e,t,n),d=Object(ll.d)("seed",e,t,n);return[Ml.a(u,l,d)];case"OneHot":var f=Object(ll.d)("indices",e,t,n),p=Object(ll.d)("depth",e,t,n),h=Object(ll.d)("onValue",e,t,n),b=Object(ll.d)("offValue",e,t,n);return[jr.a(f,p,h,b)];case"Ones":return[ot.a(Object(ll.d)("shape",e,t,n),Object(ll.d)("dtype",e,t,n))];case"OnesLike":return[Sr.a(Object(ll.d)("x",e,t,n))];case"RandomUniform":return[zl.a(Object(ll.d)("shape",e,t,n),Object(ll.d)("minval",e,t,n),Object(ll.d)("maxval",e,t,n),Object(ll.d)("dtype",e,t,n))];case"Range":var m=Object(ll.d)("start",e,t,n),v=Object(ll.d)("stop",e,t,n),g=Object(ll.d)("step",e,t,n);return[Ll.a(m,v,g,Object(ll.d)("dtype",e,t,n))];case"TruncatedNormal":var y=Object(ll.d)("shape",e,t,n),O=Object(ll.d)("mean",e,t,n),x=Object(ll.d)("stdDev",e,t,n),k=Object(ll.d)("seed",e,t,n);return[Pl.a(y,O,x,Object(ll.d)("dtype",e,t,n),k)];case"Zeros":return[mt.a(Object(ll.d)("shape",e,t,n),Object(ll.d)("dtype",e,t,n))];case"ZerosLike":return[S.a(Object(ll.d)("x",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"dynamic":return Vl(e,t,n);case"evaluation":return i.pf((function(){return function(e,t,n){switch(e.op){case"TopKV2":var r=Object(ll.d)("x",e,t,n),a=Object(ll.d)("k",e,t,n),i=Object(ll.d)("sorted",e,t,n),o=qr.a(r,a,i);return[o.values,o.indices];case"Unique":var s=Object(ll.d)("x",e,t,n),c=Kr.a(s);return[c.values,c.indices];case"UniqueV2":var u=Object(ll.d)("x",e,t,n),l=Object(ll.d)("axis",e,t,n),d=Kr.a(u,l);return[d.values,d.indices];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"image":return i.pf((function(){return function(e,t,n){switch(e.op){case"ResizeBilinear":var r=Object(ll.d)("images",e,t,n),a=Object(ll.d)("size",e,t,n),i=Object(ll.d)("alignCorners",e,t,n),o=Object(ll.d)("halfPixelCenters",e,t,n);return[Cl.xb.resizeBilinear(r,[a[0],a[1]],i,o)];case"ResizeNearestNeighbor":var s=Object(ll.d)("images",e,t,n),c=Object(ll.d)("size",e,t,n),u=Object(ll.d)("alignCorners",e,t,n),l=Object(ll.d)("halfPixelCenters",e,t,n);return[Cl.xb.resizeNearestNeighbor(s,[c[0],c[1]],u,l)];case"CropAndResize":var d=Object(ll.d)("image",e,t,n),f=Object(ll.d)("boxes",e,t,n),p=Object(ll.d)("boxInd",e,t,n),h=Object(ll.d)("cropSize",e,t,n),b=Object(ll.d)("method",e,t,n),m=Object(ll.d)("extrapolationValue",e,t,n);return[Cl.xb.cropAndResize(d,f,p,h,b,m)];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"graph":return i.pf((function(){return function(e,t,n){switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":var r=Object(ll.d)("default",e,t,n);return[Object(ll.e)(e.name,t,n)||r];case"Placeholder":return[Object(ll.e)(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":var a=Object(ll.d)("x",e,t,n);return[Object(ll.a)(a)];case"IdentityN":return Object(ll.d)("x",e,t,n).map((function(e){return Object(ll.a)(e)}));case"Snapshot":var i=Object(ll.d)("x",e,t,n);return[Object(ll.a)(i)];case"Shape":return[Hl.a(Object(ll.d)("x",e,t,n).shape,"int32")];case"ShapeN":return Object(ll.d)("x",e,t,n).map((function(e){return Hl.a(e.shape)}));case"Size":return[h.a(Object(ll.d)("x",e,t,n).size,"int32")];case"Rank":return[h.a(Object(ll.d)("x",e,t,n).rank,"int32")];case"NoOp":return[h.a(1)];case"Print":var o=Object(ll.d)("x",e,t,n),s=Object(ll.d)("data",e,t,n),c=Object(ll.d)("message",e,t,n),u=Object(ll.d)("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(c);for(var l=0;l<s.length;l++)console.log(Array.prototype.slice.call(s[l].dataSync()).slice(0,u));return[o];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"logical":return i.pf((function(){return function(e,t,n){switch(e.op){case"Equal":return[Qe.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"NotEqual":return[wr.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"Greater":return[He.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"GreaterEqual":return[Y.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"Less":return[et.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"LessEqual":return[$.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"LogicalAnd":return[Q.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"LogicalNot":return[zt.a(Object(ll.d)("a",e,t,n))];case"LogicalOr":return[pr.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];case"Select":case"SelectV2":return[Z.a(Object(ll.d)("condition",e,t,n),Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"matrices":return i.pf((function(){return function(e,t,n){switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[U.a(Object(ll.d)("a",e,t,n),Object(ll.d)("b",e,t,n),Object(ll.d)("transposeA",e,t,n),Object(ll.d)("transposeB",e,t,n))];case"Einsum":return[Kl.a.apply(r,[Object(ll.d)("equation",e,t,n)].concat(Object(Vn.a)(Object(ll.d)("tensors",e,t,n))))];case"Transpose":return[ge.a(Object(ll.d)("x",e,t,n),Object(ll.d)("perm",e,t,n))];case"_FusedMatMul":var a=Object(ll.d)("fusedOps",e,t,n),i=Object(o.a)(a,2),s=i[0],c=i[1],u="biasadd"===s,l="prelu"===c,d=Object(ll.d)("numArgs",e,t,n),f=Object(ll.d)("leakyreluAlpha",e,t,n);if(u){if(l&&2!==d)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!l&&1!==d)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}var p=Object(ll.d)("args",e,t,n),h=Object(o.a)(p,2),b=h[0],m=h[1];return[Cl.qb.matMul({a:Object(ll.d)("a",e,t,n),b:Object(ll.d)("b",e,t,n),transposeA:Object(ll.d)("transposeA",e,t,n),transposeB:Object(ll.d)("transposeB",e,t,n),bias:b,activation:c,preluActivationWeights:m,leakyreluAlpha:f})];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"normalization":return i.pf((function(){return function(e,t,n){switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[Pn.a(Object(ll.d)("x",e,t,n),Object(ll.d)("mean",e,t,n),Object(ll.d)("variance",e,t,n),Object(ll.d)("offset",e,t,n),Object(ll.d)("scale",e,t,n),Object(ll.d)("epsilon",e,t,n))];case"LRN":return[cr.a(Object(ll.d)("x",e,t,n),Object(ll.d)("radius",e,t,n),Object(ll.d)("bias",e,t,n),Object(ll.d)("alpha",e,t,n),Object(ll.d)("beta",e,t,n))];case"Softmax":return[Pr.a(Object(ll.d)("x",e,t,n))];case"LogSoftmax":return[lr.a(Object(ll.d)("x",e,t,n))];case"SparseToDense":return[Xl.a(Object(ll.d)("sparseIndices",e,t,n),Object(ll.d)("outputShape",e,t,n),Object(ll.d)("sparseValues",e,t,n),Object(ll.d)("defaultValue",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"reduction":return i.pf((function(){return function(e,t,n){switch(e.op){case"Max":var r=Object(ll.d)("axis",e,t,n),a=Object(ll.d)("keepDims",e,t,n);return[mr.a(Object(ll.d)("x",e,t,n),r,a)];case"Mean":var i=Object(ll.d)("axis",e,t,n),o=Object(ll.d)("keepDims",e,t,n);return[vr.a(Object(ll.d)("x",e,t,n),i,o)];case"Min":var s=Object(ll.d)("axis",e,t,n),c=Object(ll.d)("keepDims",e,t,n);return[gr.a(Object(ll.d)("x",e,t,n),s,c)];case"Sum":var u=Object(ll.d)("axis",e,t,n),l=Object(ll.d)("keepDims",e,t,n);return[k.a(Object(ll.d)("x",e,t,n),u,l)];case"All":var d=Object(ll.d)("axis",e,t,n),f=Object(ll.d)("keepDims",e,t,n);return[Tn.a(Object(ll.d)("x",e,t,n),d,f)];case"Any":var p=Object(ll.d)("axis",e,t,n),h=Object(ll.d)("keepDims",e,t,n);return[En.a(Object(ll.d)("x",e,t,n),p,h)];case"ArgMax":var b=Object(ll.d)("axis",e,t,n);return[An.a(Object(ll.d)("x",e,t,n),b)];case"ArgMin":var m=Object(ll.d)("axis",e,t,n);return[Rn.a(Object(ll.d)("x",e,t,n),m)];case"Prod":var v=Object(ll.d)("axis",e,t,n),g=Object(ll.d)("keepDims",e,t,n);return[Cr.a(Object(ll.d)("x",e,t,n),v,g)];case"Cumsum":var y=Object(ll.d)("axis",e,t,n),O=Object(ll.d)("exclusive",e,t,n),x=Object(ll.d)("reverse",e,t,n);return[ve.a(Object(ll.d)("x",e,t,n),y,O,x)];case"Bincount":var w=Object(ll.d)("x",e,t,n),j=Object(ll.d)("weights",e,t,n),S=Object(ll.d)("size",e,t,n);return[Yl.a(w,j,S)];case"DenseBincount":var N=Object(ll.d)("x",e,t,n),I=Object(ll.d)("weights",e,t,n),C=Object(ll.d)("size",e,t,n),T=Object(ll.d)("binaryOutput",e,t,n);return[$l.a(N,I,C,T)];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"slice_join":return i.pf((function(){return function(e,t,n){switch(e.op){case"ConcatV2":case"Concat":var r=Object(ll.d)("n",e,t,n),a=Object(ll.d)("axis",e,t,n),o=Object(ll.d)("tensors",e,t,n);return o=o.slice(0,r),[tn.a(o,a)];case"Gather":var s=Object(ll.d)("x",e,t,n),u=Object(ll.d)("indices",e,t,n);return[vn.a(s,c.a(u,"int32"),0)];case"GatherV2":var l=Object(ll.d)("axis",e,t,n),d=Object(ll.d)("batchDims",e,t,n),f=Object(ll.d)("x",e,t,n),p=Object(ll.d)("indices",e,t,n);return[vn.a(f,c.a(p,"int32"),l,d)];case"Reverse":for(var h=Object(ll.d)("dims",e,t,n),b=[],m=0;m<h.length;m++)h[m]&&b.push(m);var v=Object(ll.d)("x",e,t,n);return[Ft.a(v,b)];case"ReverseV2":var g=Object(ll.d)("axis",e,t,n),y=Object(ll.d)("x",e,t,n);return[Ft.a(y,g)];case"Slice":var O=Object(ll.d)("begin",e,t,n),k=Object(ll.d)("size",e,t,n);return[lt.a(Object(ll.d)("x",e,t,n),O,k)];case"StridedSlice":var w=Object(ll.d)("begin",e,t,n),j=Object(ll.d)("end",e,t,n),S=Object(ll.d)("strides",e,t,n),N=Object(ll.d)("beginMask",e,t,n),I=Object(ll.d)("endMask",e,t,n),C=Object(ll.d)("ellipsisMask",e,t,n),T=Object(ll.d)("newAxisMask",e,t,n),E=Object(ll.d)("shrinkAxisMask",e,t,n),A=Object(ll.d)("x",e,t,n);return[Vr.a(A,w,j,S,N,I,C,T,E)];case"Pack":return Object(i.pf)((function(){var r=Object(ll.d)("axis",e,t,n),a=Object(ll.d)("tensors",e,t,n),o=a[0].shape,s=Ur.a(a[0]).shape,c=a.map((function(e){var t=i.wf.arraysEqual(e.shape,o);if(!t&&!i.wf.arraysEqual(Ur.a(e).shape,s))throw new Error("the input tensors shape does not match");return t?e:x.a(e,o)}));return[hn.a(c,r)]}));case"Unpack":var R=Object(ll.d)("axis",e,t,n),F=Object(ll.d)("tensor",e,t,n);return yt.a(F,R);case"Tile":var D=Object(ll.d)("reps",e,t,n);return[Fe.a(Object(ll.d)("x",e,t,n),D)];case"Split":case"SplitV":var _=Object(ll.d)("axis",e,t,n),M=Object(ll.d)("numOrSizeSplits",e,t,n),z=Object(ll.d)("x",e,t,n);return te.a(z,M,_);case"ScatterNd":var L=Object(ll.d)("indices",e,t,n),P=Object(ll.d)("values",e,t,n),B=Object(ll.d)("shape",e,t,n);return[Ql.a(L,P,B)];case"GatherNd":var W=Object(ll.d)("x",e,t,n),U=Object(ll.d)("indices",e,t,n);return[Zl.a(W,U)];case"SparseToDense":var V=Object(ll.d)("sparseIndices",e,t,n),H=Object(ll.d)("outputShape",e,t,n),G=Object(ll.d)("sparseValues",e,t,n),q=Object(ll.d)("defaultValue",e,t,n);return[Xl.a(V,G,H,G.dtype===q.dtype?q:c.a(q,G.dtype))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"sparse":return i.pf((function(){return function(e,t,n){switch(e.op){case"SparseFillEmptyRows":var r=Cl.md.sparseFillEmptyRows(Object(ll.d)("indices",e,t,n),Object(ll.d)("values",e,t,n),Object(ll.d)("denseShape",e,t,n),Object(ll.d)("defaultValue",e,t,n));return[r.outputIndices,r.outputValues,r.emptyRowIndicator,r.reverseIndexMap];case"SparseReshape":var a=Cl.md.sparseReshape(Object(ll.d)("inputIndices",e,t,n),Object(ll.d)("inputShape",e,t,n),Object(ll.d)("newShape",e,t,n));return[a.outputIndices,a.outputShape];case"SparseSegmentMean":return[Cl.md.sparseSegmentMean(Object(ll.d)("data",e,t,n),Object(ll.d)("indices",e,t,n),Object(ll.d)("segmentIds",e,t,n))];case"SparseSegmentSum":return[Cl.md.sparseSegmentSum(Object(ll.d)("data",e,t,n),Object(ll.d)("indices",e,t,n),Object(ll.d)("segmentIds",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"spectral":return i.pf((function(){return function(e,t,n){switch(e.op){case"FFT":return[er.a(Object(ll.d)("x",e,t,n))];case"IFFT":return[nr.a(Object(ll.d)("x",e,t,n))];case"RFFT":return[Dr.a(Object(ll.d)("x",e,t,n))];case"IRFFT":return[rr.a(Object(ll.d)("x",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"string":return i.pf((function(){return function(e,t,n){switch(e.op){case"StringNGrams":var r=Cl.xd.stringNGrams(Object(ll.d)("data",e,t,n),Object(ll.d)("dataSplits",e,t,n),Object(ll.d)("separator",e,t,n),Object(ll.d)("nGramWidths",e,t,n),Object(ll.d)("leftPad",e,t,n),Object(ll.d)("rightPad",e,t,n),Object(ll.d)("padWidth",e,t,n),Object(ll.d)("preserveShortSequences",e,t,n));return[r.nGrams,r.nGramsSplits];case"StringSplit":var a=Cl.xd.stringSplit(Object(ll.d)("input",e,t,n),Object(ll.d)("delimiter",e,t,n),Object(ll.d)("skipEmpty",e,t,n));return[a.indices,a.values,a.shape];case"StringToHashBucketFast":return[Cl.xd.stringToHashBucketFast(Object(ll.d)("input",e,t,n),Object(ll.d)("numBuckets",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"transformation":return i.pf((function(){return function(e,t,n){switch(e.op){case"Cast":return[c.a(Object(ll.d)("x",e,t,n),Object(ll.d)("dtype",e,t,n))];case"ExpandDims":var r=Object(ll.d)("axis",e,t,n);return[mn.a(Object(ll.d)("x",e,t,n),r)];case"Squeeze":var a=Object(ll.d)("axis",e,t,n);return[Ur.a(Object(ll.d)("x",e,t,n),a)];case"Reshape":return[x.a(Object(ll.d)("x",e,t,n),Object(ll.d)("shape",e,t,n))];case"MirrorPad":return[Or.a(Object(ll.d)("x",e,t,n),Object(ll.d)("padding",e,t,n),Object(ll.d)("mode",e,t,n))];case"PadV2":case"Pad":return[Kt.a(Object(ll.d)("x",e,t,n),Object(ll.d)("padding",e,t,n),Object(ll.d)("constantValue",e,t,n))];case"SpaceToBatchND":var i=Object(ll.d)("blockShape",e,t,n),o=Object(ll.d)("paddings",e,t,n);return[H.a(Object(ll.d)("x",e,t,n),i,o)];case"BatchToSpaceND":var s=Object(ll.d)("blockShape",e,t,n),u=Object(ll.d)("crops",e,t,n);return[Jt.a(Object(ll.d)("x",e,t,n),s,u)];case"DepthToSpace":var l=Object(ll.d)("blockSize",e,t,n),d=Object(ll.d)("dataFormat",e,t,n).toUpperCase();return[qn.a(Object(ll.d)("x",e,t,n),l,d)];case"BroadcastTo":return[Bn.a(Object(ll.d)("x",e,t,n),Object(ll.d)("shape",e,t,n))];default:throw TypeError("Node type ".concat(e.op," is not implemented"))}}(e,t,n)}));case"hash_table":return ql(e,t,n,a);case"custom":var s=Object(fl.a)(e.op);if(s&&s.customExecutor)return s.customExecutor(new dl(e,t,n));throw TypeError("Custom op ".concat(e.op," is not registered."));default:throw TypeError("Unknown op '".concat(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 i.wf.isPromise(s)?s.then((function(e){return[].concat(e)})):[].concat(s)}var ed=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Object(Yr.a)(this,e),this.weightMap=t,this.tensorArrayMap=n,this.tensorListMap=r,this.functionMap=a,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}return Object($r.a)(e,[{key:"newFrame",value:function(e,t){return{id:e,frameName:t,iterationId:0}}},{key:"currentContext",get:function(){return this.contexts},set:function(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}},{key:"currentContextId",get:function(){return this._currentContextIds[0]}},{key:"currentContextIds",get:function(){return this._currentContextIds}},{key:"generateCurrentContextIds",value: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}},{key:"contextIdforContexts",value:function(e){return e?e.map((function(e){return 0===e.id&&0===e.iterationId?"":"".concat(e.frameName,"-").concat(e.iterationId)})).join("/"):""}},{key:"enterFrame",value: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)))}},{key:"exitFrame",value: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()}},{key:"nextIteration",value: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))}},{key:"getWeight",value:function(e){return this.weightMap[e]}},{key:"addTensorArray",value:function(e){this.tensorArrayMap[e.id]=e}},{key:"getTensorArray",value:function(e){return this.tensorArrayMap[e]}},{key:"addTensorList",value:function(e){this.tensorListMap[e.id]=e}},{key:"getTensorList",value:function(e){return this.tensorListMap[e]}},{key:"dispose",value:function(e){for(var t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(var n in this.tensorListMap)this.tensorListMap[n].clearAndClose(e)}}]),e}();function td(e,t,n,r){var a=new Set,i=[],o=null,s=null,c=new Set,u=Object.keys(e).map((function(e){return Object(ll.g)(e)[0]})),l=[];null!=r&&(l=r.map((function(e){return Object(ll.g)(e.name)[0]})));for(var d=Object(Vn.a)(t);d.length>0;){var f=d.pop();(id(f)||od(f)||sd(f))&&null==o&&(s=(o=f).children.map((function(e){return e.name})).filter((function(e){return a.has(e)}))),a.add(f.name),null==n[f.name]&&(-1===u.indexOf(f.name)&&-1===l.indexOf(f.name)&&(0!==f.inputs.length?f.inputs.forEach((function(e){c.has(e.name)||(c.add(e.name),d.push(e))})):i.push(f.name)))}return{inputs:e,outputs:t,usedNodes:a,missingInputs:i,dynamicNode:o,syncInputs:s}}var nd=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],rd=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],ad=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function id(e){return nd.indexOf(e.op)>=0}function od(e){return rd.indexOf(e.op)>=0}function sd(e){return ad.indexOf(e.op)>=0}var cd=function(){function e(t,n){var r=this;Object(Yr.a)(this,e),this.graph=t,this.parent=n,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this._outputs=t.outputs,this._inputs=t.inputs,this._initNodes=t.initNodes,this._signature=t.signature,this._functions=t.functions,null!=t.functions&&Object.keys(t.functions).forEach((function(n){r._functionExecutorMap[n]=new e(t.functions[n],r)}))}return Object($r.a)(e,[{key:"weightIds",get:function(){return this.parent?this.parent.weightIds:this._weightIds}},{key:"functionExecutorMap",get:function(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}},{key:"weightMap",get:function(){return this.parent?this.parent.weightMap:this._weightMap},set:function(e){var t,n=Object.keys(e).map((function(t){return e[t].map((function(e){return e.id}))}));this._weightIds=(t=[]).concat.apply(t,Object(Vn.a)(n)),this._weightMap=e}},{key:"resourceManager",set:function(e){this._resourceManager=e}},{key:"inputs",get:function(){return this._inputs.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}}))}},{key:"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}}))}},{key:"inputNodes",get:function(){return this._inputs.map((function(e){return e.signatureKey||e.name}))}},{key:"outputNodes",get:function(){return this._outputs.map((function(e){var t=e.signatureKey||e.name;return e.defaultOutput?"".concat(t,":").concat(e.defaultOutput):t}))}},{key:"functions",get:function(){var e=this;return Object.keys(this._functions).reduce((function(t,n){return t[n]=e._functions[n].signature,t}),{})}},{key:"getCompilationKey",value: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)}},{key:"compile",value:function(e,t){var n=td(e,t,this.weightMap,this._initNodes),r=n.missingInputs,a=n.dynamicNode,i=n.syncInputs;if(null!=a)throw new Error("This execution contains the node '".concat(a.name,"', which has ")+"the dynamic op '".concat(a.op,"'. Please use ")+"model.executeAsync() instead. Alternatively, to avoid the "+"dynamic ops, specify the inputs [".concat(i,"]"));if(r.length>0){var o=t.map((function(e){return e.name})),s=Object.keys(e);throw new Error("Cannot compute the outputs [".concat(o,"] from the provided inputs ")+"[".concat(s,"]. Missing the following inputs: [").concat(r,"]"))}return function(e,t,n){var r=n.usedNodes,a=n.inputs,i=[],o=Object.keys(a).map((function(e){return Object(ll.g)(e)[0]})).map((function(t){return e.nodes[t]})),s=e.initNodes;o.forEach((function(e){r.has(e.name)&&i.push(e)})),e.weights.forEach((function(e){r.has(e.name)&&i.push(e)})),null!=s&&s.forEach((function(e){r.has(e.name)&&i.push(e)}));for(var c=new Set,u=[];i.length>0;){var l=i.pop();c.add(l.name),t[l.name]||u.push(l),l.children.forEach((function(e){!c.has(e.name)&&r.has(e.name)&&e.inputs.every((function(e){return c.has(e.name)}))&&i.push(e)}))}return u}(this.graph,this.weightMap,n)}},{key:"execute",value:function(e,t){var n=this;e=this.mapInputs(e);var r=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);var a=r.map((function(e){return n.graph.nodes[Object(ll.g)(e)[0]]})),s=t.map((function(e){return Object(ll.g)(e)[0]})),c=s.map((function(e){return n.graph.nodes[e]}));0===c.length&&(c=this._outputs);var u=this.getCompilationKey(a,c),l=this.compiledMap.get(u);null==l&&(l=this.compile(e,c),this.compiledMap.set(u,l));var d={},f={};return Object(i.pf)((function(){var r=new ed(n.weightMap,d,f,n.functionExecutorMap),a=Object.assign({},n.weightMap);Object.keys(e).forEach((function(t){var n=Object(ll.g)(t),r=Object(o.a)(n,2),i=r[0],s=[];s[r[1]]=e[t],a[i]=s}));for(var c=n.getFrozenTensorIds(a),u={},p=0;p<l.length;p++){var h=l[p];if(!a[h.name]){var b=Jl(h,a,r,n._resourceManager);if(i.wf.isPromise(b))throw new Error("The execution of the op '".concat(h.op,"' returned a promise. ")+"Please use model.executeAsync() instead.");a[h.name]=b,n.checkTensorForDisposal(h.name,h,a,r,c,s,u)}}return null==n.parent&&r.dispose(c),t.map((function(e){return Object(ll.e)(e,a,r)}))}))}},{key:"getFrozenTensorIds",value: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)}},{key:"checkTensorForDisposal",value:function(e,t,n,r,a,i,o){"control"!==t.category&&-1===i.indexOf(e)&&(n[e].forEach((function(e){null!=e&&(o[e.id]=(o[e.id]||0)+t.children.length)})),t.inputs.forEach((function(e){if("control"!==e.category){var t=Object(ll.f)(e.name,n,r);null!=t&&t.forEach((function(e){if(e&&!e.kept&&!a.has(e.id)){var t=o[e.id];1===t?(e.dispose(),delete o[e.id]):null!=t&&o[e.id]--}}))}})))}},{key:"executeAsync",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._executeAsync(t,n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_executeAsync",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r,a,i,o,s,c,u,l,d,f=arguments;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=f.length>2&&void 0!==f[2]&&f[2],a=f.length>3&&void 0!==f[3]?f[3]:{},i=f.length>4&&void 0!==f[4]?f[4]:{},r||(t=this.mapInputs(t),this.checkInputs(t),this.checkInputShapeAndType(t),n=this.mapOutputs(n),this.checkOutputs(n)),o=new ed(this.weightMap,a,i,this.functionExecutorMap),e.next=7,this.executeWithControlFlow(t,o,n,r);case 7:return s=e.sent,c=n.map((function(e){return Object(ll.e)(e,s,o)})),u=c.map((function(e){return e.id})),l=Object.keys(t).map((function(e){return t[e].id})),d=new Set([].concat(Object(Vn.a)(u),Object(Vn.a)(l),Object(Vn.a)(this.weightIds))),Object.keys(s).forEach((function(e){s[e].forEach((function(e){!e||e.kept||e.isDisposed||d.has(e.id)||e.dispose()}))})),null==this.parent&&o.dispose(d),e.abrupt("return",c);case 15:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"executeFunctionAsync",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n,r){var a,i=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.reduce((function(e,t,n){return e[i.inputs[n].name]=t,e}),{}),e.abrupt("return",this._executeAsync(a,this.outputNodes,!0,n,r));case 2:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"executeWithControlFlow",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n,r,a){var i,s,c,u,l,d,f,p,h,b,m,v,g,y,O,x,k,w=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Object.keys(t),s=i.map((function(e){return w.graph.nodes[Object(ll.g)(e)[0]]})),c=r.map((function(e){return Object(ll.g)(e)[0]})),0===(u=c.map((function(e){return w.graph.nodes[e]}))).length&&(u=this._outputs),l=td(t,u,this.weightMap,this._initNodes),d=l.usedNodes,f=l.missingInputs,p=l.dynamicNode,h=l.syncInputs,b=[].concat(Object(Vn.a)(s),Object(Vn.a)(this.graph.weights),Object(Vn.a)(this._initNodes||[])).map((function(e){return{node:e,contexts:n.currentContext}})),m=Object.assign({},this.weightMap),Object.keys(t).forEach((function(e){var n=Object(ll.g)(e),r=Object(o.a)(n,2),a=r[0],i=[];i[r[1]]=t[e],m[a]=i})),v={},g=this.getFrozenTensorIds(m),y={};case 12:if(!(b.length>0)){e.next=18;break}return O=this.processStack(s,b,n,m,y,g,c,v,d),e.next=16,Promise.all(O);case 16:e.next=12;break;case 18:if(null!=p||a||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead."),!((x=u.filter((function(e){return!id(e)&&!Object(ll.e)(e.name,m,n)})).map((function(e){return e.name}))).length>0)){e.next=24;break}throw k="",null!=p&&(k="Alternatively, to avoid the dynamic ops, use model.execute() "+"and specify the inputs [".concat(h,"]")),new Error("Cannot compute the outputs [".concat(x,"] from the provided ")+"inputs [".concat(i,"]. Consider providing the following inputs: ")+"[".concat(f,"]. ").concat(k));case 24:return e.abrupt("return",m);case 25:case"end":return e.stop()}}),e,this)})));return function(t,n,r,a){return e.apply(this,arguments)}}()},{key:"processStack",value:function(e,t,n,r,a,s,c,u,l){for(var d=this,f=[],p=function(){var e=t.pop();n.currentContext=e.contexts;var p="";if("Enter"===e.node.op&&Object(ll.d)("isConstant",e.node,r,n)){var h=Object(ll.b)(e.node.name,n),b=Object(o.a)(h,1);p=b[0]}if(null==r[e.node.name]){var m=Jl(e.node,r,n,d._resourceManager);if(!p){var v=Object(ll.b)(e.node.name,n),g=Object(o.a)(v,1);p=g[0]}var y=n.currentContext;i.wf.isPromise(m)?f.push(m.then((function(i){return r[p]=i,n.currentContext=y,d.checkTensorForDisposal(p,e.node,r,n,s,c,u),d.processChildNodes(e.node,t,n,r,a,l),i}))):(r[p]=m,d.checkTensorForDisposal(p,e.node,r,n,s,c,u),d.processChildNodes(e.node,t,n,r,a,l))}else d.processChildNodes(e.node,t,n,r,a,l)};t.length>0;)p();return f}},{key:"processChildNodes",value:function(e,t,n,r,a,i){e.children.forEach((function(e){var s=Object(ll.b)(e.name,n),c=Object(o.a)(s,1)[0];!a[c]&&i.has(e.name)&&("Merge"===e.op?e.inputNames.some((function(e){return!!Object(ll.e)(e,r,n)}))&&(a[c]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((function(e){return!!Object(ll.e)(e,r,n)}))&&(a[c]=!0,t.push({contexts:n.currentContext,node:e})))}))}},{key:"dispose",value:function(){var e=this;Object.keys(this.weightMap).forEach((function(t){return e.weightMap[t].forEach((function(e){return e.dispose()}))}))}},{key:"checkInputShapeAndType",value:function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],a=Object(ll.g)(n),s=Object(o.a)(a,1)[0],c=t.graph.nodes[s];if(c.attrParams.shape&&c.attrParams.shape.value){var u=c.attrParams.shape.value,l=u.length===r.shape.length&&r.shape.every((function(e,t){return-1===u[t]||u[t]===e}));i.wf.assert(l,(function(){return"The shape of dict['".concat(c.name,"'] provided in ")+"model.execute(dict) must be [".concat(u,"], but was ")+"[".concat(r.shape,"]")}))}c.attrParams.dtype&&c.attrParams.dtype.value&&i.wf.assert(r.dtype===c.attrParams.dtype.value,(function(){return"The dtype of dict['".concat(c.name,"'] provided in ")+"model.execute(dict) must be "+"".concat(c.attrParams.dtype.value,", but was ").concat(r.dtype)}))}))}},{key:"mapInputs",value:function(e){var t={};for(var n in e){if(null!=this._signature&&null!=this._signature.inputs&&null!=this._signature.inputs[n])t[this._signature.inputs[n].name]=e[n];else t[n]=e[n]}return t}},{key:"checkInputs",value:function(e){var t=this,n=Object.keys(e).filter((function(e){var n=Object(ll.g)(e),r=Object(o.a)(n,1)[0];return null==t.graph.nodes[r]}));if(n.length>0)throw new Error("The dict provided in model.execute(dict) has "+"keys: [".concat(n,"] that are not part of graph"))}},{key:"mapOutputs",value:function(e){var t=this;return e.map((function(e){return null!=t._signature&&null!=t._signature.outputs&&null!=t._signature.outputs[e]?t._signature.outputs[e].name:e}),{})}},{key:"checkOutputs",value:function(e){var t=this;e.forEach((function(e){var n=Object(ll.g)(e),r=Object(o.a)(n,1)[0];if(!t.graph.nodes[r])throw new Error("The output '".concat(e,"' is not found in the graph"))}))}}]),e}(),ud=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(Yr.a)(this,e),this.hashTableNameToHandle=t,this.hashTableMap=n}return Object($r.a)(e,[{key:"addHashTable",value:function(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}},{key:"getHashTableHandleByName",value:function(e){return this.hashTableNameToHandle[e]}},{key:"getHashTableById",value:function(e){return this.hashTableMap[e]}},{key:"dispose",value:function(){for(var e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(var t in this.hashTableNameToHandle)this.hashTableNameToHandle[t].dispose(),delete this.hashTableNameToHandle[t]}}]),e}(),ld="?tfjs-format=file",dd="model.json",fd=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(Yr.a)(this,e),this.modelUrl=t,this.loadOptions=n,this.version="n/a",null==n&&(this.loadOptions={}),this.resourceManager=new ud}return Object($r.a)(e,[{key:"modelVersion",get:function(){return this.version}},{key:"inputNodes",get:function(){return this.executor.inputNodes}},{key:"outputNodes",get:function(){return this.executor.outputNodes}},{key:"inputs",get:function(){return this.executor.inputs}},{key:"outputs",get:function(){return this.executor.outputs}},{key:"weights",get:function(){return this.executor.weightMap}},{key:"metadata",get:function(){return this.artifacts.userDefinedMetadata}},{key:"modelSignature",get:function(){return this.signature}},{key:"findIOHandler",value:function(){var e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=i.ge.browserHTTPRequest(e,this.loadOptions);else{var t=i.ge.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(i.ge.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error("Found more than one (".concat(t.length,") load handlers for ")+"URL '".concat([e],"'"));this.handler=t[0]}}},{key:"load",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.findIOHandler(),null!=this.handler.load){e.next=3;break}throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");case 3:return e.next=5,this.handler.load();case 5:return t=e.sent,e.abrupt("return",this.loadSync(t));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"loadSync",value:function(e){this.artifacts=e;var t,n=this.artifacts.modelTopology;t=null!=this.artifacts.userDefinedMetadata&&null!=this.artifacts.userDefinedMetadata.signature?this.artifacts.userDefinedMetadata.signature:this.artifacts.signature,this.signature=t,this.version="".concat(n.versions.producer,".").concat(n.versions.minConsumer);var r=i.ge.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new cd(ul.a.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){var a=ul.a.Instance.transformGraph(e.modelInitializer);this.initializer=new cd(a),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}},{key:"save",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!==typeof t){e.next=9;break}if(0!==(r=i.ge.getSaveHandlers(t)).length){e.next=6;break}throw new Error("Cannot find any save handlers for URL '".concat(t,"'"));case 6:if(!(r.length>1)){e.next=8;break}throw new Error("Found more than one (".concat(r.length,") save handlers for ")+"URL '".concat(t,"'"));case 8:t=r[0];case 9:if(null!=t.save){e.next=11;break}throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");case 11:return e.abrupt("return",t.save(this.artifacts));case 12:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"predict",value:function(e,t){return this.execute(e,this.outputNodes)}},{key:"normalizeInputs",value:function(e){if(!(e instanceof i.bd)&&!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 ".concat(this.inputNodes.length," placeholders, ")+"while there are ".concat(e.length," input tensors."));return this.inputNodes.reduce((function(t,n,r){return t[n]=e[r],t}),{})}},{key:"normalizeOutputs",value:function(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}},{key:"execute",value: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]}},{key:"executeAsync",value:function(){var e=Object(go.a)(vo.a.mark((function e(t,n){var r;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.normalizeInputs(t),n=this.normalizeOutputs(n),e.next=4,this.executor.executeAsync(t,n);case 4:return r=e.sent,e.abrupt("return",r.length>1?r:r[0]);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"convertTensorMapToTensorsMap",value:function(e){return Object.keys(e).reduce((function(t,n){return t[n]=[e[n]],t}),{})}},{key:"dispose",value:function(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}}]),e}();function pd(e){return hd.apply(this,arguments)}function hd(){return(hd=Object(go.a)(vo.a.mark((function e(t){var n,r,a=arguments;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]?a[1]:{},null!=t){e.next=3;break}throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");case 3:return null==n&&(n={}),n.fromTFHub&&null==t.load&&(t.endsWith("/")||(t+="/"),t="".concat(t).concat(dd).concat(ld)),r=new fd(t,n),e.next=8,r.load();case 8:return e.abrupt("return",r);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var bd=n(109),md=n(67),vd=n(95),gd=function(){function e(){Object(Yr.a)(this,e),this.size=null}return Object($r.a)(e,[{key:"batch",value:function(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this;return i.wf.assert(e>0,(function(){return"batchSize needs to be positive, but it is\n ".concat(e)})),t=this.size===1/0||null==this.size?this.size:n?Math.ceil(this.size/e):Math.floor(this.size/e),yd(Object(go.a)(vo.a.mark((function t(){return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.iterator();case 2:return t.abrupt("return",t.sent.columnMajorBatch(e,n,kd));case 3:case"end":return t.stop()}}),t)}))),t)}},{key:"concatenate",value:function(e){var t,n=this;return t=this.size===1/0||e.size===1/0?1/0:null!=this.size&&null!=e.size?this.size+e.size:null,yd(Object(go.a)(vo.a.mark((function t(){return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.iterator();case 2:return t.t0=t.sent,t.next=5,e.iterator();case 5:return t.t1=t.sent,t.abrupt("return",t.t0.concatenate.call(t.t0,t.t1));case 7:case"end":return t.stop()}}),t)}))),t)}},{key:"filter",value:function(e){var t,n=this;return t=this.size===1/0?1/0:null,yd(Object(go.a)(vo.a.mark((function t(){return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.iterator();case 2:return t.abrupt("return",t.sent.filter((function(t){return i.pf((function(){return e(t)}))})));case 3:case"end":return t.stop()}}),t)}))),t)}},{key:"forEachAsync",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.iterator();case 2:return e.abrupt("return",e.sent.forEachAsync(t));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"map",value:function(e){var t=this;return yd(Object(go.a)(vo.a.mark((function n(){return vo.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.iterator();case 2:return n.abrupt("return",n.sent.map((function(t){return i.pf((function(){return e(t)}))})));case 3:case"end":return n.stop()}}),n)}))),this.size)}},{key:"mapAsync",value:function(e){var t=this;return yd(Object(go.a)(vo.a.mark((function n(){return vo.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.iterator();case 2:return n.abrupt("return",n.sent.mapAsync(e));case 3:case"end":return n.stop()}}),n)}))),this.size)}},{key:"prefetch",value:function(e){if(null==e)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");var t=this;return yd(Object(go.a)(vo.a.mark((function n(){return vo.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.iterator();case 2:return n.abrupt("return",n.sent.prefetch(e));case 3:case"end":return n.stop()}}),n)}))),this.size)}},{key:"repeat",value:function(e){var t,n=this;return t=null!=this.size&&e>0?this.size*e:0===e?0:null!=this.size&&(void 0===e||e<0)?1/0:null,yd(Object(go.a)(vo.a.mark((function t(){var r;return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Object(md.e)(Object(go.a)(vo.a.mark((function e(){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.iterator();case 2:return e.t0=e.sent,e.abrupt("return",{value:e.t0,done:!1});case 4:case"end":return e.stop()}}),e)})))),t.abrupt("return",Object(md.d)(r.take(e)));case 2:case"end":return t.stop()}}),t)}))),t)}},{key:"skip",value:function(e){var t,n=this;return t=null!=this.size&&e>=0&&this.size>=e?this.size-e:null!=this.size&&(this.size<e||void 0===e||e<0)?0:null,yd(Object(go.a)(vo.a.mark((function t(){return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.iterator();case 2:return t.abrupt("return",t.sent.skip(e));case 3:case"end":return t.stop()}}),t)}))),t)}},{key:"shuffle",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(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 (".concat(this.size," elements)"));var r=this,a=bd.alea(t||i.wf.now().toString());return yd(Object(go.a)(vo.a.mark((function t(){var i;return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=a.int32(),n&&(i+=a.int32()),t.next=4,r.iterator();case 4:return t.abrupt("return",t.sent.shuffle(e,i.toString()));case 5:case"end":return t.stop()}}),t)}))),this.size)}},{key:"take",value:function(e){var t,n=this;return t=null!=this.size&&this.size>e?e:null!=this.size&&this.size<=e?this.size:null,yd(Object(go.a)(vo.a.mark((function t(){return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.iterator();case 2:return t.abrupt("return",t.sent.take(e));case 3:case"end":return t.stop()}}),t)}))),t)}},{key:"toArray",value:function(){var e=Object(go.a)(vo.a.mark((function e(){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.size!==1/0){e.next=2;break}throw new Error("Can not convert infinite data stream to array.");case 2:return e.next=4,this.iterator();case 4:return e.abrupt("return",e.sent.toArray());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toArrayForTest",value:function(){var e=Object(go.a)(vo.a.mark((function e(){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.size!==1/0){e.next=2;break}throw new Error("Can not convert infinite data stream to array.");case 2:return e.next=4,this.iterator();case 4:return e.abrupt("return",e.sent.toArrayForTest());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}();function yd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new(function(n){Object(Qr.a)(a,n);var r=Object(Zr.a)(a);function a(){var e;return Object(Yr.a)(this,a),(e=r.apply(this,arguments)).size=t,e}return Object($r.a)(a,[{key:"iterator",value:function(){var t=Object(go.a)(vo.a.mark((function t(){return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e());case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}]),a}(gd))}function Od(e){return yd(Object(go.a)(vo.a.mark((function t(){return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(md.f)(e));case 1:case"end":return t.stop()}}),t)}))),e.length)}function xd(e){if(!Object(vd.e)(e))throw new Error("The argument to zip() must be an object or array.");var t;if(Array.isArray(e))for(var n=0;n<e.length;n++)t=null==t?e[n].size:Math.min(t,e[n].size);else if(e instanceof Object)for(var r in e)t=null==t?e[r].size:Math.min(t,e[r].size);return yd(Object(go.a)(vo.a.mark((function t(){var n;return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(vd.c)(e,(function(e){if(e instanceof gd)return{value:e.iterator(),recurse:!1};if(Object(vd.e)(e))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")}));case 2:return n=t.sent,t.abrupt("return",Object(md.g)(n,md.c.SHORTEST));case 4:case"end":return t.stop()}}),t)}))),t)}function kd(e){if(null===e)return null;var t=e[0];return Object(vd.a)(t)?{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof i.bd?i.gf(e):i.lf(e)}(e),recurse:!1}:{value:null,recurse:!0}}gd.MAX_BUFFER_SIZE=1e4;var wd=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;return Object(Yr.a)(this,n),(r=t.call(this)).input=e,r}return Object($r.a)(n,[{key:"iterator",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,n,r;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.input.iterator();case 2:return t=e.sent,n=t.decodeUTF8(),r=n.split("\n").map((function(e){return e.endsWith("\r")&&(e=e.slice(0,-1)),e})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(gd),jd='"',Sd=Symbol("out"),Nd=Symbol("field"),Id=Symbol("quote"),Cd=Symbol("quoteafterquote"),Td=Symbol("quoteinquote"),Ed=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e,r){var a;return Object(Yr.a)(this,n),(a=t.call(this)).input=e,a.hasHeader=!0,a.fullColumnNames=null,a.columnNamesValidated=!1,a.columnConfigs=null,a.configuredColumnsOnly=!1,a.delimiter=",",a.delimWhitespace=!1,a.base=new wd(e),r||(r={}),a.hasHeader=!1!==r.hasHeader,a.fullColumnNames=r.columnNames,a.columnConfigs=r.columnConfigs,a.configuredColumnsOnly=r.configuredColumnsOnly,r.delimWhitespace?(i.wf.assert(null==r.delimiter,(function(){return"Delimiter should not be provided when delimWhitespace is true."})),a.delimWhitespace=!0,a.delimiter=" "):a.delimiter=r.delimiter?r.delimiter:",",a}return Object($r.a)(n,[{key:"columnNames",value:function(){var e=Object(go.a)(vo.a.mark((function e(){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.columnNamesValidated){e.next=3;break}return e.next=3,this.setColumnNames();case 3:return e.abrupt("return",this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setColumnNames",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,n,r,a,o,s,c=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.maybeReadHeaderLine();case 2:if(t=e.sent,this.fullColumnNames||t){e.next=7;break}throw new Error("Column names must be provided if there is no header line.");case 7:this.fullColumnNames&&t&&i.wf.assert(t.length===this.fullColumnNames.length,(function(){return"The length of provided columnNames ("+c.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+t.length.toString()+")."}));case 8:if(this.fullColumnNames||(this.fullColumnNames=t),n=this.fullColumnNames.reduce((function(e,t){return e[t]=e[t]+1||1,e}),{}),r=Object.keys(n).filter((function(e){return n[e]>1})),i.wf.assert(0===r.length,(function(){return"Duplicate column names found: "+r.toString()})),!this.columnConfigs){e.next=22;break}a=0,o=Object.keys(this.columnConfigs);case 14:if(!(a<o.length)){e.next=22;break}if(s=o[a],-1!==this.fullColumnNames.indexOf(s)){e.next=19;break}throw new Error('The key "'+s+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").");case 19:a++,e.next=14;break;case 22:this.columnNamesValidated=!0;case 23:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"maybeReadHeaderLine",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,n,r,a;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.hasHeader){e.next=14;break}return e.next=3,this.base.iterator();case 3:return t=e.sent,e.next=6,t.next();case 6:if(!(n=e.sent).done){e.next=9;break}throw new Error("No data was found for CSV parsing.");case 9:return r=n.value,a=this.parseRow(r,!1),e.abrupt("return",a);case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"iterator",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,n=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.columnNamesValidated){e.next=3;break}return e.next=3,this.setColumnNames();case 3:return e.next=5,this.base.iterator();case 5:return t=e.sent,this.hasHeader&&(t=t.skip(1)),e.abrupt("return",t.map((function(e){return n.makeDataElement(e)})));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"makeDataElement",value:function(e){for(var t=this.parseRow(e),n={},r={},a=0;a<this.fullColumnNames.length;a++){var i=this.fullColumnNames[a],o=this.columnConfigs?this.columnConfigs[i]:null;if(!this.configuredColumnsOnly||o){var s=t[a],c=null;if(""===s)if(o&&void 0!==o.default)c=o.default;else{if(o&&(o.required||o.isLabel))throw new Error("Required column ".concat(i," is empty in this line: ").concat(e));c=void 0}else{var u=Number(s);if(isNaN(u))c=o&&"bool"===o.dtype?this.getBoolean(s):s;else if(o&&o.dtype)switch(o.dtype){case"float32":c=u;break;case"int32":c=Math.floor(u);break;case"bool":c=this.getBoolean(s);break;default:c=u}else c=u}o&&o.isLabel?r[i]=c:n[i]=c}}return 0===Object.keys(r).length?n:{xs:n,ys:r}}},{key:"getBoolean",value:function(e){return"1"===e||"true"===e.toLowerCase()?1:0}},{key:"parseRow",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[],r=0,a=e.length,i=Sd,o=0;o<a;o++)switch(i){case Sd:switch(e.charAt(o)){case jd:r=o+1,i=Id;break;case this.delimiter:if(r=o+1," "===this.delimiter&&this.delimWhitespace)break;n.push(""),i=Sd;break;default:i=Nd,r=o}break;case Nd:switch(e.charAt(o)){case this.delimiter:n.push(e.substring(r,o)),i=Sd,r=o+1}break;case Id:switch(e.charAt(o)){case jd:i=Cd}break;case Cd:switch(e.charAt(o)){case this.delimiter:n.push(e.substring(r,o-1)),i=Sd,r=o+1;break;case jd:i=Id;break;default:i=Td}break;case Td:switch(e.charAt(o)){case jd:i=Id}}if(i===Cd?n.push(e.substring(r,a-1)):n.push(e.substring(r)),t&&n.length!==this.fullColumnNames.length)throw new Error("Invalid row in csv file. Should have ".concat(this.fullColumnNames.length," elements in a row, but got ").concat(n));return n}}]),n}(gd),Ad=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r;Object(Yr.a)(this,n),(r=t.call(this)).microphoneConfig=e,r.isClosed=!1,r.fftSize=e.fftSize||1024;var a=Math.log2(r.fftSize);if(r.fftSize<0||a<4||a>14||!Number.isInteger(a))throw new Error("Invalid fftSize: it must be a power of 2 between "+"2 to 4 and 2 to 14, but got ".concat(r.fftSize));if(r.numFrames=e.numFramesPerSpectrogram||43,r.sampleRateHz=e.sampleRateHz,r.columnTruncateLength=e.columnTruncateLength||r.fftSize,r.audioTrackConstraints=e.audioTrackConstraints,r.smoothingTimeConstant=e.smoothingTimeConstant||0,r.includeSpectrogram=!1!==e.includeSpectrogram,r.includeWaveform=!0===e.includeWaveform,!r.includeSpectrogram&&!r.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.");return r}return Object($r.a)(n,[{key:"summary",value:function(){return"microphone"}},{key:"start",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,n;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.mediaDevices.getUserMedia({audio:null==this.audioTrackConstraints||this.audioTrackConstraints,video:!1});case 3:this.stream=e.sent,e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(0),new Error("Error thrown while initializing video stream: ".concat(e.t0.message));case 9:if(this.stream){e.next=11;break}throw new Error("Could not obtain audio from microphone.");case 11:if(t=window.AudioContext||window.webkitAudioContext,this.audioContext=new t,this.sampleRateHz){e.next=17;break}this.sampleRateHz=this.audioContext.sampleRate,e.next=19;break;case 17:if(this.audioContext.sampleRate===this.sampleRateHz){e.next=19;break}throw new Error("Mismatch in sampling rate: "+"Expected: ".concat(this.sampleRateHz,"; ")+"Actual: ".concat(this.audioContext.sampleRate));case 19:return n=this.audioContext.createMediaStreamSource(this.stream),this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2*this.fftSize,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,n.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize),e.abrupt("return");case 27:case"end":return e.stop()}}),e,this,[[0,6]])})));return function(){return e.apply(this,arguments)}}()},{key:"next",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,n,r,a,i;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isClosed){e.next=2;break}return e.abrupt("return",{value:null,done:!0});case 2:return e.next=4,this.getAudioData();case 4:return r=e.sent,this.includeSpectrogram&&(a=this.flattenQueue(r.freqDataQueue),t=this.getTensorFromAudioDataArray(a,[this.numFrames,this.columnTruncateLength,1])),this.includeWaveform&&(i=this.flattenQueue(r.timeDataQueue),n=this.getTensorFromAudioDataArray(i,[this.numFrames*this.fftSize,1])),e.abrupt("return",{value:{spectrogram:t,waveform:n},done:!1});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"capture",value:function(){var e=Object(go.a)(vo.a.mark((function e(){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.next();case 2:return e.abrupt("return",e.sent.value);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAudioData",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,n,r,a=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],n=[],r=0,e.abrupt("return",new Promise((function(e){var i=setInterval((function(){a.includeSpectrogram&&(a.analyser.getFloatFrequencyData(a.freqData),a.freqData[0]===-1/0&&e({freqDataQueue:t,timeDataQueue:n}),t.push(a.freqData.slice(0,a.columnTruncateLength))),a.includeWaveform&&(a.analyser.getFloatTimeDomainData(a.timeData),n.push(a.timeData.slice())),++r===a.numFrames&&(clearInterval(i),e({freqDataQueue:t,timeDataQueue:n}))}),a.fftSize/a.sampleRateHz*1e3)})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"stop",value:function(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),null!=this.stream&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}},{key:"toArray",value:function(){throw new Error("Can not convert infinite audio stream to array.")}},{key:"getSampleRate",value:function(){return this.sampleRateHz}},{key:"flattenQueue",value:function(e){var t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((function(e,r){return n.set(e,r*t)})),n}},{key:"getTensorFromAudioDataArray",value:function(e,t){var n=new Float32Array(i.wf.sizeFromShape(t));return n.set(e,n.length-e.length),Object(i.lf)(n,t)}}],[{key:"create",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,r,a=arguments;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]?a[0]:{},!Object(i.Ud)().get("IS_NODE")){e.next=3;break}throw new Error("microphone API is only supported in browser environment.");case 3:return r=new n(t),e.next=6,r.start();case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]),n}(md.a),Rd=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e,r){var a;if(Object(Yr.a)(this,n),(a=t.call(this)).webcamVideoElement=e,a.webcamConfig=r,a.isClosed=!0,a.resize=!1,a.needToResize())if(a.resize=!0,a.cropSize=[a.webcamConfig.resizeHeight,a.webcamConfig.resizeWidth],a.cropBoxInd=Object(i.mf)([0],"int32"),a.webcamConfig.centerCrop){var o=1*a.webcamConfig.resizeWidth/a.webcamVideoElement.width,s=1*a.webcamConfig.resizeHeight/a.webcamVideoElement.height,c=(1-o)/2,u=(1-s)/2,l=c+o,d=s+u;a.cropBox=Object(i.nf)([u,c,d,l],[1,4])}else a.cropBox=Object(i.nf)([0,0,1,1],[1,4]);return a}return Object($r.a)(n,[{key:"summary",value:function(){return"webcam"}},{key:"start",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.webcamConfig.facingMode&&i.wf.assert("user"===this.webcamConfig.facingMode||"environment"===this.webcamConfig.facingMode,(function(){return"Invalid webcam facing mode: ".concat(t.webcamConfig.facingMode,". ")+"Please provide 'user' or 'environment'"})),e.prev=1,e.next=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 4:this.stream=e.sent,e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(1),e.t0.message="Error thrown while initializing video stream: ".concat(e.t0.message),e.t0;case 11:if(this.stream){e.next=13;break}throw new Error("Could not obtain video from webcam.");case 13:try{this.webcamVideoElement.srcObject=this.stream}catch(n){console.log(n),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,e.abrupt("return",new Promise((function(e){t.webcamVideoElement.onloadedmetadata=function(){e()}})));case 17:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(){return e.apply(this,arguments)}}()},{key:"next",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isClosed){e.next=2;break}return e.abrupt("return",{value:null,done:!0});case 2:e.prev=2,t=i.yd.fromPixels(this.webcamVideoElement),e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(2),new Error("Error thrown converting video to pixels: ".concat(JSON.stringify(e.t0)));case 9:if(!this.resize){e.next=22;break}return e.prev=10,e.abrupt("return",{value:this.cropAndResizeFrame(t),done:!1});case 14:throw e.prev=14,e.t1=e.catch(10),new Error("Error thrown cropping the video: ".concat(e.t1.message));case 17:return e.prev=17,t.dispose(),e.finish(17);case 20:e.next=23;break;case 22:return e.abrupt("return",{value:t,done:!1});case 23:case"end":return e.stop()}}),e,this,[[2,6],[10,14,17,20]])})));return function(){return e.apply(this,arguments)}}()},{key:"needToResize",value:function(){return!(!this.webcamConfig.resizeWidth||!this.webcamConfig.resizeHeight||this.webcamVideoElement.width===this.webcamConfig.resizeWidth&&this.webcamVideoElement.height===this.webcamConfig.resizeHeight)}},{key:"cropAndResizeFrame",value:function(e){var t=this;return Object(i.pf)((function(){var n,r=Object(i.Xd)(Object(i.Ad)(e,"float32"),0),a=(n=i.fe.cropAndResize(r,t.cropBox,t.cropBoxInd,t.cropSize,"bilinear")).shape;return Object(i.Ne)(n,a.slice(1))}))}},{key:"capture",value:function(){var e=Object(go.a)(vo.a.mark((function e(){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.next();case 2:return e.abrupt("return",e.sent.value);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"stop",value: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}},{key:"toArray",value:function(){throw new Error("Can not convert infinite video stream to array.")}}],[{key:"create",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){var r,a,o=arguments;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:{},!Object(i.Ud)().get("IS_NODE")){e.next=3;break}throw new Error("tf.data.webcam is only supported in browser environment.");case 3:if(t){e.next=9;break}if(t=document.createElement("video"),r.resizeWidth&&r.resizeHeight){e.next=7;break}throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");case 7:t.width=r.resizeWidth,t.height=r.resizeHeight;case 9:return a=new n(t,r),e.next=12,a.start();case 12:return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(md.a),Fd=function e(){Object(Yr.a)(this,e)},Dd=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(Yr.a)(this,n),(r=t.call(this)).file=e,r.options=a,i.wf.assert(e instanceof Uint8Array||!!Object(i.Ud)().get("IS_BROWSER")&&(e instanceof File||e instanceof Blob),(function(){return"FileChunkIterator only supports File, Blob and Uint8Array right now."})),r.offset=a.offset||0,r.chunkSize=a.chunkSize||1048576,r}return Object($r.a)(n,[{key:"summary",value:function(){return"FileChunks ".concat(this.file)}},{key:"next",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t,n=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size))){e.next=2;break}return e.abrupt("return",{value:null,done:!0});case 2:return t=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 a=new FileReader;a.onload=function(n){var r=a.result;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),!(r instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(r)},a.onabort=function(e){return t(new Error("Aborted"))},a.onerror=function(e){return t(new Error(e.type))};var i=n.file.slice(n.offset,r);a.readAsArrayBuffer(i)}n.offset=r})),e.next=5,t;case 5:return e.t0=e.sent,e.abrupt("return",{value:e.t0,done:!1});case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(n(304).a);function _d(e){return Md.apply(this,arguments)}function Md(){return(Md=Object(go.a)(vo.a.mark((function e(t){var n,r,a,o,s,c=arguments;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:{},"string"===typeof t?r=t:(r=t.url,a=zd(t)),e.next=4,i.wf.fetch(r,a);case 4:if(!(o=e.sent).ok){e.next=14;break}return e.t0=Uint8Array,e.next=9,o.arrayBuffer();case 9:return e.t1=e.sent,s=new e.t0(e.t1),e.abrupt("return",new Dd(s,n));case 14:throw new Error(o.statusText);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var zd=function(e){return{method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity}};function Ld(e){return"string"===typeof e&&"file://"===e.substr(0,7)}var Pd=function(e){Object(Qr.a)(r,e);var t=Object(Zr.a)(r);function r(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(Yr.a)(this,r),(n=t.call(this)).input=e,n.options=a,n}return Object($r.a)(r,[{key:"iterator",value:function(){var e=Object(go.a)(vo.a.mark((function e(){var t;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ld(this.input)&&Object(i.Ud)().get("IS_NODE")&&(t=n(346),this.input=t.readFileSync(this.input.substr(7))),e.abrupt("return",new Dd(this.input,this.options));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),r}(Fd),Bd=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(Yr.a)(this,n),(r=t.call(this)).url=e,r.fileOptions=a,r}return Object($r.a)(n,[{key:"iterator",value:function(){var e=Object(go.a)(vo.a.mark((function e(){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Ld(this.url)){e.next=4;break}return e.abrupt("return",new Pd(this.url,this.fileOptions).iterator());case 4:return e.abrupt("return",_d(this.url,this.fileOptions));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(Fd);function Wd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Ed(new Bd(e),t)}function Ud(e){var t=Object(md.e)(e);return yd(Object(go.a)(vo.a.mark((function e(){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}}),e)}))))}function Vd(e){return yd(Object(go.a)(vo.a.mark((function t(){var n;return vo.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e();case 2:return n=t.sent,t.abrupt("return",Object(md.e)((function(){return n.next()})));case 4:case"end":return t.stop()}}),t)}))))}function Hd(e,t){return Gd.apply(this,arguments)}function Gd(){return(Gd=Object(go.a)(vo.a.mark((function e(t,n){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Rd.create(t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qd(e){return Kd.apply(this,arguments)}function Kd(){return(Kd=Object(go.a)(vo.a.mark((function e(t){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ad.create(t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Xd="3.8.0";function Yd(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){null!=e&&i.wf.assert("complex64"!==e.dtype,(function(){return"".concat(t," does not support complex64 tensors in the CPU backend.")}))}))}var $d=i.ie.whereImpl,Qd=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(){var e;return Object(Yr.a)(this,n),(e=t.call(this)).blockSize=48,e.firstUse=!0,e.data=new i.L(Object(ta.a)(e),Object(i.Td)()),e}return Object($r.a)(n,[{key:"nextDataId",value:function(){return n.nextDataId++}},{key:"write",value:function(e,t,n){this.firstUse&&(this.firstUse=!1,Object(i.Ud)().get("IS_NODE")&&i.ud.warn("\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============================"));var r={id:this.nextDataId()};return this.data.set(r,{values:e,dtype:n,refCount:1}),r}},{key:"makeTensorInfo",value:function(e,t,n){var r;if("string"===t&&null!=n&&n.length>0&&i.wf.isString(n[0])){var a=n.map((function(e){return i.wf.encodeString(e)}));r=this.write(a,e,t)}else r=this.write(n,e,t);return{dataId:r,shape:e,dtype:t}}},{key:"refCount",value:function(e){return this.data.has(e)?this.data.get(e).refCount:0}},{key:"incRef",value:function(e){this.data.get(e).refCount++}},{key:"decRef",value:function(e){this.data.has(e)&&this.data.get(e).refCount--}},{key:"move",value:function(e,t,n,r,a){this.data.set(e,{values:t,dtype:r,refCount:a})}},{key:"numDataIds",value:function(){return this.data.numDataIds()}},{key:"read",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.readSync(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"readSync",value:function(e){var t=this.data.get(e),n=t.dtype,r=t.complexTensorInfos;if("complex64"===n){var a=this.readSync(r.real.dataId),o=this.readSync(r.imag.dataId);return i.ud.mergeRealAndImagArrays(a,o)}return this.data.get(e).values}},{key:"bufferSync",value:function(e){var t=this.readSync(e.dataId),n=t;if("string"===e.dtype)try{n=t.map((function(e){return i.wf.decodeString(e)}))}catch(r){throw new Error("Failed to decode encoded string bytes into utf-8")}return Object(i.zd)(e.shape,e.dtype,n)}},{key:"makeOutput",value:function(e,t,n){var r=this.write(e,t,n);return Object(i.Td)().makeTensorFromDataId(r,t,n,this)}},{key:"disposeData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;var n=this.data.get(e),r=n.complexTensorInfos;null!=r&&(this.disposeData(r.real.dataId,!0),this.disposeData(r.imag.dataId,!0)),this.data.delete(e)}return!0}},{key:"disposeIntermediateTensorInfo",value:function(e){this.disposeData(e.dataId)}},{key:"time",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){var n,r;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.wf.now(),t(),r=i.wf.now()-n,e.abrupt("return",{kernelMs:r});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"memory",value:function(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}},{key:"where",value:function(e){Yd([e],"where");var t=this.readSync(e.dataId);return $d(e.shape,t)}},{key:"dispose",value:function(){}},{key:"floatPrecision",value:function(){return 32}},{key:"epsilon",value:function(){return Object(Eo.a)(Object(na.a)(n.prototype),"epsilon",this).call(this)}}]),n}(i.wb);Qd.nextDataId=0;function Zd(e,t,n){return function(r){var a=r.inputs,o=r.attrs,s=r.backend,c=a.x;if(Yd(c,e),"string"===c.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");for(var u=s,l=u.data.get(c.dataId).values,d=i.wf.sizeFromShape(c.shape),f=n||c.dtype,p=i.wf.getArrayFromDType(f,d),h=0;h<d;++h)p[h]=t(l[h],o);return u.makeTensorInfo(c.shape,f,p)}}function Jd(e,t,n){return function(r){var a=r.inputs,i=r.attrs,o=r.backend,s=a.x;if(Yd(s,e),"string"===s.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");var c=o,u=c.data.get(s.dataId).values,l=n||s.dtype,d=t(u,l,i);return c.makeTensorInfo(s.shape,l,d)}}Object(i.Ke)("cpu",(function(){return new Qd}),1);var ef=Zd(i.W,(function(e){return e>=0?e:Math.exp(e)-1})),tf={kernelName:i.W,backendName:"cpu",kernelFunc:ef};function nf(e){var t=e.inputs,n=e.backend,r=t.x;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}var rf={kernelName:i.rb,backendName:"cpu",kernelFunc:nf};function af(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.alpha;Yd([a],"leakyRelu");for(var s=i.wf.sizeFromShape(a.shape),c=n.data.get(a.dataId).values,u=i.wf.getTypedArrayFromDType("float32",s),l=0;l<c.length;l++)u[l]=c[l]<0?o*c[l]:c[l];return n.makeTensorInfo(a.shape,"float32",u)}var of={kernelName:i.zb,backendName:"cpu",kernelFunc:af};function sf(e){return function(t,n,r,a,o){var s=i.ud.assertAndGetBroadcastShape(t,n),c=s.length,u=i.wf.computeStrides(s),l=i.wf.sizeFromShape(s),d=i.wf.getTypedArrayFromDType(o,l),f=t.length,p=n.length,h=i.wf.computeStrides(t),b=i.wf.computeStrides(n),m=i.ud.getBroadcastDims(t,s),v=i.ud.getBroadcastDims(n,s);if(m.length+v.length===0)for(var g=0;g<d.length;++g)d[g]=e(r[g%r.length],a[g%a.length]);else for(var y=function(t){var n=i.wf.indexToLoc(t,c,u),o=n.slice(-f);m.forEach((function(e){return o[e]=0}));var s=i.wf.locToIndex(o,f,h),l=n.slice(-p);v.forEach((function(e){return l[e]=0}));var g=i.wf.locToIndex(l,p,b);d[t]=e(r[s],a[g])},O=0;O<d.length;++O)y(O);return[d,s]}}var cf=sf((function(e,t){return e<0?t*e:e}));function uf(e){var t=e.inputs,n=e.backend,r=t.x,a=t.alpha;Yd([r,a],"prelu");var i=n.data.get(r.dataId).values,s=n.data.get(a.dataId).values,c=cf(r.shape,a.shape,i,s,r.dtype),u=Object(o.a)(c,2),l=u[0],d=u[1];return n.makeTensorInfo(d,r.dtype,l)}var lf={kernelName:i.hc,backendName:"cpu",kernelFunc:uf},df=Zd(i.nc,(function(e){return Math.max(0,e)})),ff={kernelName:i.nc,backendName:"cpu",kernelFunc:df},pf=Zd(i.oc,(function(e){return Math.min(Math.max(0,e),6)})),hf={kernelName:i.oc,backendName:"cpu",kernelFunc:pf},bf=Zd(i.Bc,(function(e){return 1/(1+Math.exp(-e))})),mf={kernelName:i.Bc,backendName:"cpu",kernelFunc:bf};function vf(e,t,n,r,a){if("linear"===n)return nf({inputs:{x:t},backend:e});if("relu"===n)return df({inputs:{x:t},backend:e});if("elu"===n)return ef({inputs:{x:t},backend:e});if("relu6"===n)return pf({inputs:{x:t},backend:e});if("prelu"===n)return uf({inputs:{x:t,alpha:r},backend:e});if("leakyrelu"===n)return af({inputs:{x:t},backend:e,attrs:{alpha:a}});if("sigmoid"===n)return bf({inputs:{x:t},backend:e});throw new Error("Activation ".concat(n," has not been implemented for the CPU backend."))}function gf(e){var t=e.inputs,n=e.backend,r=t.real,a=t.imag,i=n.data.get(r.dataId).values,o=n.data.get(a.dataId).values,s=n.makeTensorInfo(r.shape,"complex64");return n.data.get(s.dataId).complexTensorInfos={real:n.makeTensorInfo(r.shape,"float32",i),imag:n.makeTensorInfo(a.shape,"float32",o)},s}var yf={kernelName:i.y,backendName:"cpu",kernelFunc:gf};function Of(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"float32";if("complex64"===n){var r=Of(e,t,"float32"),a=Of(e,t,"float32");return gf({inputs:{real:r,imag:a},backend:e})}var o=i.wf.makeZerosTypedArray(i.wf.sizeFromShape(t),n);return e.makeTensorInfo(t,n,o)}function xf(e){var t=e.inputs,n=e.backend,r=t.input,a=n.data.get(r.dataId).complexTensorInfos.real,i=n.data.get(a.dataId).values;return n.makeTensorInfo(a.shape,a.dtype,i)}var kf={kernelName:i.kc,backendName:"cpu",kernelFunc:xf};function wf(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.dtype;if("complex64"===s){if("complex64"===a.dtype)return nf({inputs:{x:a},backend:n});var c=Of(n,a.shape,a.dtype),u=wf({inputs:{x:a},backend:n,attrs:{dtype:"float32"}}),l=gf({inputs:{real:u,imag:c},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(u),l}if("complex64"===a.dtype){var d=xf({inputs:{input:a},backend:n}),f=wf({inputs:{x:d},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(d),f}if(!i.wf.hasEncodingLoss(a.dtype,s)){var p=nf({inputs:{x:a},backend:n});return{dataId:p.dataId,shape:p.shape,dtype:s}}if("int32"===s){var h=n.data.get(a.dataId).values,b=Int32Array.from(h);return n.makeTensorInfo(a.shape,"int32",b)}if("bool"===s){var m=n.data.get(a.dataId).values,v=i.wf.toTypedArray([0],a.dtype),g=sf((function(e,t){return e!==t?1:0}))(a.shape,[],m,v,"bool"),y=Object(o.a)(g,2),O=y[0],x=y[1];return n.makeTensorInfo(x,"bool",O)}throw new Error("Error in Cast: failed to cast ".concat(a.dtype," to ").concat(s))}var jf={kernelName:i.v,backendName:"cpu",kernelFunc:wf};function Sf(e,t,n,r){return null==n?function(n){var a=n.inputs,s=n.backend,c=a.a,u=a.b,l=s;Yd([c,u],e);var d=l.data.get(c.dataId).values,f=l.data.get(u.dataId).values,p="string"===c.dtype?i.ud.fromUint8ToStringArray(d):d,h="string"===c.dtype?i.ud.fromUint8ToStringArray(f):f,b=r||c.dtype,m=t(c.shape,u.shape,p,h,b),v=Object(o.a)(m,2),g=v[0],y=v[1];return l.makeTensorInfo(y,b,g)}:function(e){var a=e.inputs,i=e.backend,s=a.a,c=a.b,u=i;if("complex64"===s.dtype||"complex64"===c.dtype){var l=wf({inputs:{x:s},backend:u,attrs:{dtype:"complex64"}}),d=u.data.get(l.dataId),f=d.complexTensorInfos.real,p=d.complexTensorInfos.imag,h=u.data.get(f.dataId).values,b=u.data.get(p.dataId).values,m=wf({inputs:{x:c},backend:u,attrs:{dtype:"complex64"}}),v=u.data.get(m.dataId),g=v.complexTensorInfos.real,y=v.complexTensorInfos.imag,O=u.data.get(g.dataId).values,x=u.data.get(y.dataId).values,k=n(s.shape,c.shape,h,b,O,x),w=Object(o.a)(k,3),j=w[0],S=w[1],N=w[2],I=u.makeTensorInfo(N,"float32",j),C=u.makeTensorInfo(N,"float32",S),T=gf({inputs:{real:I,imag:C},backend:u});return u.disposeIntermediateTensorInfo(l),u.disposeIntermediateTensorInfo(m),u.disposeIntermediateTensorInfo(I),u.disposeIntermediateTensorInfo(C),T}var E=u.data.get(s.dataId).values,A=u.data.get(c.dataId).values,R=r||s.dtype,F=t(s.shape,c.shape,E,A,R),D=Object(o.a)(F,2),_=D[0],M=D[1];return u.makeTensorInfo(M,R,_)}}function Nf(e){return function(t,n,r,a,o,s){var c=i.ud.assertAndGetBroadcastShape(t,n),u=i.wf.sizeFromShape(c),l=c.length,d=i.wf.computeStrides(c),f=i.wf.getTypedArrayFromDType("float32",u),p=i.wf.getTypedArrayFromDType("float32",u),h=i.ud.getBroadcastDims(t,c),b=i.ud.getBroadcastDims(n,c),m=i.ud.mergeRealAndImagArrays(r,a),v=i.ud.mergeRealAndImagArrays(o,s),g=t.length,y=i.wf.computeStrides(t),O=n.length,x=i.wf.computeStrides(n);if(h.length+b.length===0)for(var k=0;k<f.length;k++){var w=k%m.length,j=k%v.length,S=e(m[2*w],m[2*w+1],v[2*j],v[2*j+1]);f[k]=S.real,p[k]=S.imag}else for(var N=function(t){var n=i.wf.indexToLoc(t,l,d),r=n.slice(-g);h.forEach((function(e){return r[e]=0}));var a=i.wf.locToIndex(r,g,y),o=n.slice(-O);b.forEach((function(e){return o[e]=0}));var s=i.wf.locToIndex(o,O,x),c=e(m[2*a],m[2*a+1],v[2*s],v[2*s+1]);f[t]=c.real,p[t]=c.imag},I=0;I<f.length;I++)N(I);return[f,p,c]}}var If=sf((function(e,t){return e+t})),Cf=Nf((function(e,t,n,r){return{real:e+n,imag:t+r}})),Tf=Sf(i.d,If,Cf),Ef={kernelName:i.d,backendName:"cpu",kernelFunc:Tf};function Af(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.shape,s=i.wf.sizeFromShape(a.shape),c=i.wf.inferFromImplicitShape(o,s),u=i.wf.sizeFromShape(c);i.wf.assert(s===u,(function(){return"The new shape (".concat(c,") has ").concat(u," elements and the old ")+"shape (".concat(a.shape,") has ").concat(s," elements. The new shape and old ")+"shape must have the same number of elements."})),n.incRef(a.dataId);var l=n.data.get(a.dataId);if(null!=l.complexTensorInfos){var d=l.complexTensorInfos.real,f=l.complexTensorInfos.imag;d.shape=c,f.shape=c}return{dataId:a.dataId,shape:c,dtype:a.dtype}}var Rf={kernelName:i.pc,backendName:"cpu",kernelFunc:Af};function Ff(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.a,s=t.b,c=r.transposeA,u=r.transposeB;Yd([a,s],"matMul");var l=a.shape.length,d=s.shape.length,f=c?a.shape[l-2]:a.shape[l-1],p=u?s.shape[d-1]:s.shape[d-2],h=c?a.shape[l-1]:a.shape[l-2],b=u?s.shape[d-2]:s.shape[d-1],m=a.shape.slice(0,-2),v=s.shape.slice(0,-2),g=i.wf.sizeFromShape(m),y=i.wf.sizeFromShape(v),O=g===y||1===g||1===y;i.wf.assert(l>=2&&d>=2&&O,(function(){return"Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input "+"batch dimensions of (".concat(m,") and (").concat(v,").")}));var x=(g>y?a.shape.slice(0,-2):s.shape.slice(0,-2)).concat([h,b]);i.wf.assert(f===p,(function(){return"Error in matMul: inner shapes (".concat(f,") and (")+"".concat(p,") of Tensors with shapes ").concat(a.shape," and ")+"".concat(s.shape," and transposeA=").concat(c)+" and transposeB=".concat(u," must match.")}));for(var k=u?[y,b,p]:[y,p,b],w=Af({inputs:{x:a},backend:n,attrs:{shape:c?[g,f,h]:[g,h,f]}}),j=Af({inputs:{x:s},backend:n,attrs:{shape:k}}),S=c?w.shape[1]:w.shape[2],N=c?w.shape[2]:w.shape[1],I=u?j.shape[1]:j.shape[2],C=Math.max(g,y),T=n.data.get(w.dataId).values,E=n.data.get(j.dataId).values,A=i.wf.computeStrides(w.shape),R=i.wf.computeStrides(j.shape),F=c?[A[0],1,A[1]]:[A[0],A[1],1],D=Object(o.a)(F,3),_=D[0],M=D[1],z=D[2],L=u?[1,R[1],R[0]]:[R[1],1,R[0]],P=Object(o.a)(L,3),B=P[0],W=P[1],U=P[2],V=N*I,H=Object(i.zd)([C,N,I],w.dtype),G=H.values,q=n.blockSize,K=0;K<C;K++)for(var X=0;X<N;X+=q)for(var Y=0;Y<I;Y+=q)for(var $=0;$<S;$+=q)for(var Q=Math.min(X+q,N),Z=Math.min(Y+q,I),J=Math.min($+q,S),ee=X;ee<Q;ee++)for(var te=Y;te<Z;te++){for(var ne=0,re=$;re<J;re++){var ae=Math.min(K,g-1)*_,ie=Math.min(K,y-1)*U;ne+=T[ae+ee*M+re*z]*E[re*B+te*W+ie]}G[K*V+(ee*I+te)]+=ne}return n.disposeIntermediateTensorInfo(w),n.disposeIntermediateTensorInfo(j),n.makeTensorInfo(x,H.dtype,H.values)}var Df={kernelName:i.s,backendName:"cpu",kernelFunc:Ff};var _f={kernelName:i.ld,backendName:"cpu",kernelFunc:function(e){var t,n,r,a=e.inputs,i=e.backend,o=e.attrs,s=a.a,c=a.b,u=a.bias,l=a.preluActivationWeights,d=o.transposeA,f=o.transposeB,p=o.activation,h=o.leakyreluAlpha,b=[];t=Ff({inputs:{a:s,b:c},attrs:{transposeA:d,transposeB:f},backend:i}),u&&(n=Tf({inputs:{a:t,b:u},backend:i}),b.push(t),t=n),p&&(r=vf(i,t,p,l,h),b.push(t),t=r);for(var m=0,v=b;m<v.length;m++){var g=v[m];i.disposeIntermediateTensorInfo(g)}return t}};function Mf(e){for(var t=new Float32Array(e.length),n=0;n<e.length;++n)t[n]=Math.abs(e[n]);return t}var zf={kernelName:i.a,backendName:"cpu",kernelFunc:function(e){var t=e.inputs.x,n=e.backend;Yd(t,"abs");var r=new Float32Array(i.wf.sizeFromShape(t.shape));return r=Mf(n.data.get(t.dataId).values),n.makeOutput(r,t.shape,"float32")}},Lf=Zd(i.b,(function(e){return Math.acos(e)})),Pf={kernelName:i.b,backendName:"cpu",kernelFunc:Lf},Bf=Zd(i.c,(function(e){return Math.acosh(e)})),Wf={kernelName:i.c,backendName:"cpu",kernelFunc:Bf};var Uf={kernelName:i.e,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t;Yd(t,"addN");for(var a=r.map((function(e){return n.data.get(e.dataId).values})),o=Object(i.zd)(r[0].shape,r[0].dtype),s=o.values,c=0;c<r.length;c++)for(var u=a[c],l=0;l<s.length;l++)s[l]+=u[l];return n.makeTensorInfo(o.shape,o.dtype,o.values)}};function Vf(e,t,n,r,a){for(var o=t.length,s=i.wf.sizeFromShape(t),c=i.wf.computeStrides(t),u=i.wf.computeStrides(a),l=i.wf.getTypedArrayFromDType(n,i.wf.sizeFromShape(a)),d=0;d<s;++d){for(var f=i.wf.indexToLoc(d,o,c),p=new Array(f.length),h=0;h<p.length;h++)p[h]=f[r[h]];l[i.wf.locToIndex(p,o,u)]=e[d]}return l}function Hf(e){var t=e.inputs,n=e.attrs,r=e.backend,a=t.x,i=n.perm;Yd(a,"transpose");for(var o=a.shape.length,s=new Array(o),c=0;c<s.length;c++)s[c]=a.shape[i[c]];var u=Vf(r.data.get(a.dataId).values,a.shape,a.dtype,i,s);return{dataId:r.write(u,s,a.dtype),shape:s,dtype:a.dtype}}var Gf={kernelName:i.gd,backendName:"cpu",kernelFunc:Hf};var qf={kernelName:i.f,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.axis,c=r.keepDims;Yd(a,"all");var u=i.wf.parseAxisParam(s,a.shape),l=u,d=i.ud.getAxesPermutation(l,a.shape.length),f=a;null!=d&&(f=Hf({inputs:{x:a},backend:n,attrs:{perm:d}}),l=i.ud.getInnerMostAxes(l.length,a.shape.length)),i.ud.assertAxesAreInnerMostDims("all",l,f.shape.length);for(var p=i.ud.computeOutAndReduceShapes(f.shape,l),h=Object(o.a)(p,2),b=h[0],m=h[1],v=i.wf.sizeFromShape(m),g=i.wf.makeZerosTypedArray(i.wf.sizeFromShape(b),f.dtype),y=n.data.get(f.dataId).values,O=0;O<g.length;++O){for(var x=O*v,k=y[x],w=0;w<v;++w){var j=y[x+w];k=k&&j}g[O]=k}null!=d&&n.disposeIntermediateTensorInfo(f);var S=n.makeTensorInfo(b,f.dtype,g);if(c){var N=Af({inputs:{x:S},backend:n,attrs:{shape:i.ud.expandShapeToKeepDim(b,u)}});return n.disposeIntermediateTensorInfo(S),N}return S}};var Kf={kernelName:i.g,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.axis,c=r.keepDims;Yd(a,"any");var u=i.wf.parseAxisParam(s,a.shape),l=u,d=i.ud.getAxesPermutation(l,a.shape.length),f=a;null!=d&&(f=Hf({inputs:{x:a},backend:n,attrs:{perm:d}}),l=i.ud.getInnerMostAxes(l.length,a.shape.length)),i.ud.assertAxesAreInnerMostDims("any",l,f.shape.length);for(var p=i.ud.computeOutAndReduceShapes(f.shape,l),h=Object(o.a)(p,2),b=h[0],m=h[1],v=i.wf.sizeFromShape(m),g=i.wf.makeZerosTypedArray(i.wf.sizeFromShape(b),f.dtype),y=n.data.get(f.dataId).values,O=0;O<g.length;++O){for(var x=O*v,k=y[x],w=0;w<v;++w){var j=y[x+w];k=k||j}g[O]=k}null!=d&&n.disposeIntermediateTensorInfo(f);var S=n.makeTensorInfo(b,f.dtype,g);if(c){var N=Af({inputs:{x:S},backend:n,attrs:{shape:i.ud.expandShapeToKeepDim(b,u)}});return n.disposeIntermediateTensorInfo(S),N}return S}};var Xf={kernelName:i.h,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.axis;Yd(a,"argMax");var c=i.wf.parseAxisParam(s,a.shape),u=i.ud.getAxesPermutation(c,a.shape.length),l=a,d=[];null!=u&&(l=Hf({inputs:{x:a},backend:n,attrs:{perm:u}}),d.push(l),c=i.ud.getInnerMostAxes(c.length,l.shape.length)),c=[c[0]],i.ud.assertAxesAreInnerMostDims("argMax",c,l.shape.length);for(var f=i.ud.computeOutAndReduceShapes(l.shape,c),p=Object(o.a)(f,2),h=p[0],b=p[1],m=i.wf.sizeFromShape(h),v=i.wf.makeZerosTypedArray(m,"int32"),g=i.wf.sizeFromShape(b),y=n.data.get(l.dataId).values,O=0;O<v.length;++O){for(var x=O*g,k=y[x],w=0,j=0;j<g;++j){var S=y[x+j];S>k&&(k=S,w=j)}v[O]=w}return d.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),n.makeTensorInfo(h,"int32",v)}};var Yf={kernelName:i.i,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.axis;Yd(a,"argMin");var c=i.wf.parseAxisParam(s,a.shape),u=i.ud.getAxesPermutation(c,a.shape.length),l=a,d=[];null!=u&&(l=Hf({inputs:{x:a},backend:n,attrs:{perm:u}}),d.push(l),c=i.ud.getInnerMostAxes(c.length,l.shape.length)),c=[c[0]],i.ud.assertAxesAreInnerMostDims("argMin",c,l.shape.length);for(var f=i.ud.computeOutAndReduceShapes(l.shape,c),p=Object(o.a)(f,2),h=p[0],b=p[1],m=i.wf.sizeFromShape(h),v=i.wf.makeZerosTypedArray(m,"int32"),g=i.wf.sizeFromShape(b),y=n.data.get(l.dataId).values,O=0;O<v.length;++O){for(var x=O*g,k=y[x],w=0,j=0;j<g;++j){var S=y[x+j];S<k&&(k=S,w=j)}v[O]=w}return d.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),n.makeTensorInfo(h,"int32",v)}},$f=Zd(i.j,(function(e){return Math.asin(e)})),Qf={kernelName:i.j,backendName:"cpu",kernelFunc:$f},Zf=Zd(i.k,(function(e){return Math.asinh(e)})),Jf={kernelName:i.k,backendName:"cpu",kernelFunc:Zf},ep=Zd(i.l,(function(e){return Math.atan(e)})),tp={kernelName:i.l,backendName:"cpu",kernelFunc:ep},np=sf((function(e,t){return Math.atan2(e,t)})),rp=Sf(i.m,np),ap={kernelName:i.m,backendName:"cpu",kernelFunc:rp},ip=Zd(i.n,(function(e){return Math.atanh(e)})),op={kernelName:i.n,backendName:"cpu",kernelFunc:ip};function sp(e,t,n,r,a,o){for(var s=a.strideHeight,c=a.strideWidth,u=a.dilationHeight,l=a.dilationWidth,d=a.effectiveFilterHeight,f=a.effectiveFilterWidth,p=a.padInfo.top,h=a.padInfo.left,b="max"===o?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=Object(i.zd)(a.outShape,n),v=m.values,g=a.outShape[1]*a.outShape[2]*a.outShape[3],y=a.outShape[2]*a.outShape[3],O=a.outShape[3],x=0;x<a.batchSize;++x)for(var k=x*g,w=x*r[0],j=0;j<a.inChannels;++j)for(var S=0;S<a.outHeight;++S)for(var N=S*s-p,I=Math.max(0,N),C=Math.min(a.inHeight,d+N),T=k+S*y,E=0;E<a.outWidth;++E){for(var A=E*c-h,R=Math.max(0,A),F=Math.min(a.inWidth,f+A),D=b,_=0,M=0,z=I;z<C;z+=u){for(var L=w+z*r[1],P=R;P<F;P+=l){var B=e[L+P*r[2]+j];"max"===o&&B>D?D=B:"avg"===o&&(_+=B,M++)}if(isNaN(D))break}v[T+E*O+j]="avg"===o?_/M:D}return m}function cp(e,t,n,r){for(var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=Object(i.zd)(r.outShape,"int32"),c=r.strideHeight,u=r.strideWidth,l=r.dilationHeight,d=r.dilationWidth,f=r.effectiveFilterHeight,p=r.effectiveFilterWidth,h=r.padInfo.top,b=r.padInfo.left,m=Object(i.zd)(t,n,e),v=0;v<r.batchSize;++v)for(var g=0;g<r.inChannels;++g)for(var y=0;y<r.outHeight;++y){for(var O=y*c-h,x=O;x<0;)x+=l;for(var k=Math.min(r.inHeight,f+O),w=0;w<r.outWidth;++w){for(var j=w*u-b,S=j;S<0;)S+=d;for(var N=Math.min(r.inWidth,p+j),I=Number.NEGATIVE_INFINITY,C=-1,T=x;T<k;T+=l)for(var E=T-O,A=S;A<N;A+=d){var R=A-j,F=m.get(v,T,A,g);F>I&&(I=F,C=a?o?((v*r.inHeight+T)*r.inWidth+A)*r.inChannels+g:(T*r.inWidth+A)*r.inChannels+g:E*p+R)}s.set(C,v,y,w,g)}}return s}function up(e,t,n,r,a,o){for(var s=a.strideDepth,c=a.strideHeight,u=a.strideWidth,l=a.dilationDepth,d=a.dilationHeight,f=a.dilationWidth,p=a.effectiveFilterDepth,h=a.effectiveFilterHeight,b=a.effectiveFilterWidth,m=a.padInfo.front,v=a.padInfo.top,g=a.padInfo.left,y="max"===o?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,O=Object(i.zd)(a.outShape,n),x=O.values,k=a.outShape[1]*a.outShape[2]*a.outShape[3]*a.outShape[4],w=a.outShape[2]*a.outShape[3]*a.outShape[4],j=a.outShape[3]*a.outShape[4],S=a.outShape[4],N=0;N<a.batchSize;++N)for(var I=N*k,C=N*r[0],T=0;T<a.inChannels;++T)for(var E=0;E<a.outDepth;++E){for(var A=E*s-m,R=A;R<0;)R+=l;for(var F=Math.min(a.inDepth,p+A),D=I+E*w,_=0;_<a.outHeight;++_){for(var M=_*c-v,z=M;z<0;)z+=d;for(var L=Math.min(a.inHeight,h+M),P=D+_*j,B=0;B<a.outWidth;++B){for(var W=B*u-g,U=W;U<0;)U+=f;for(var V=Math.min(a.inWidth,b+W),H=P+B*S,G=y,q=0,K=0,X=R;X<F;X+=l){for(var Y=C+X*r[1],$=z;$<L;$+=d){for(var Q=Y+$*r[2],Z=U;Z<V;Z+=f){var J=e[Q+Z*r[3]+T];if("max"===o&&J>G?G=J:"avg"===o&&(q+=J,K++),isNaN(G))break}if(isNaN(G))break}if(isNaN(G))break}x[H+T]="avg"===o?q/K:G}}}return O}var lp={kernelName:i.o,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x;Yd(a,"avgPool");var o=r.filterSize,s=r.strides,c=r.pad,u=r.dimRoundingMode;i.wf.assert(i.ud.eitherStridesOrDilationsAreOne(s,1),(function(){return"Error in avgPool: Either strides or dilations must be 1. "+"Got strides ".concat(s," and dilations '").concat(1,"'")}));var l,d=i.ud.computePool2DInfo(a.shape,o,s,1,c,u);if(1===d.filterWidth&&1===d.filterHeight&&i.wf.arraysEqual(d.inShape,d.outShape))l=nf({inputs:{x:a},backend:n});else{var f=n.data.get(a.dataId).values,p=i.wf.computeStrides(a.shape),h=sp(f,a.shape,a.dtype,p,d,"avg");l=n.makeTensorInfo(d.outShape,a.dtype,h.values)}return l}};var dp={kernelName:i.p,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.filterSize,s=r.strides,c=r.pad,u=r.dimRoundingMode,l=r.dataFormat;Yd(a,"avgPool3d");var d=i.ud.computePool3DInfo(a.shape,o,s,1,c,u,l),f=up(n.data.get(a.dataId).values,a.shape,a.dtype,i.wf.computeStrides(a.shape),d,"avg");return n.makeTensorInfo(f.shape,"float32",f.values)}};var fp={kernelName:i.q,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.input,s=r.filterSize,c=r.strides,u=r.pad,l=r.dimRoundingMode;Yd([a,o],"avgPool3DGrad");for(var d=i.ud.computePool3DInfo(o.shape,s,c,1,u,l),f=d.strideDepth,p=d.strideHeight,h=d.strideWidth,b=d.filterDepth,m=d.filterHeight,v=d.filterWidth,g=d.dilationDepth,y=d.dilationHeight,O=d.dilationWidth,x=d.effectiveFilterDepth,k=d.effectiveFilterHeight,w=d.effectiveFilterWidth,j=x-1-d.padInfo.front,S=w-1-d.padInfo.left,N=k-1-d.padInfo.top,I=Object(i.zd)(o.shape,"float32"),C=1/(b*m*v),T=n.bufferSync(a),E=0;E<d.batchSize;++E)for(var A=0;A<d.inChannels;++A)for(var R=0;R<d.inDepth;++R)for(var F=0;F<d.inHeight;++F)for(var D=0;D<d.inWidth;++D){for(var _=R-j,M=F-N,z=D-S,L=0,P=0;P<x;P+=g){var B=(_+P)/f;if(!(B<0||B>=d.outDepth||Math.floor(B)!==B))for(var W=0;W<k;W+=y){var U=(M+W)/p;if(!(U<0||U>=d.outHeight||Math.floor(U)!==U))for(var V=0;V<w;V+=O){var H=(z+V)/h;if(!(H<0||H>=d.outWidth||Math.floor(H)!==H))L+=T.get(E,B,U,H,A)}}}I.set(L*C,E,R,F,D,A)}return n.makeTensorInfo(I.shape,I.dtype,I.values)}};var pp={kernelName:i.r,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.input,s=o;Yd([a,o],"avgPoolGrad");for(var c=r.filterSize,u=r.strides,l=r.pad,d=i.ud.computePool2DInfo(s.shape,c,u,1,l),f=d.strideHeight,p=d.strideWidth,h=d.filterHeight,b=d.filterWidth,m=d.dilationHeight,v=d.dilationWidth,g=d.effectiveFilterHeight,y=d.effectiveFilterWidth,O=y-1-d.padInfo.left,x=g-1-d.padInfo.top,k=Object(i.zd)(s.shape,"float32"),w=1/(h*b),j=n.data.get(a.dataId).values,S=Object(i.zd)(a.shape,"float32",j),N=0;N<d.batchSize;++N)for(var I=0;I<d.inChannels;++I)for(var C=0;C<d.inHeight;++C)for(var T=0;T<d.inWidth;++T){for(var E=C-x,A=T-O,R=0,F=0;F<g;F+=m){var D=(E+F)/f;if(!(D<0||D>=d.outHeight||Math.floor(D)!==D))for(var _=0;_<y;_+=v){var M=(A+_)/p;if(!(M<0||M>=d.outWidth||Math.floor(M)!==M))R+=S.get(N,D,M,I)}}k.set(R*w,N,C,T,I)}return n.makeTensorInfo(k.shape,k.dtype,k.values)}};var hp={kernelName:i.jb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.scale,s=t.offset,c=t.mean,u=t.variance;i.wf.assert(c.shape.length===u.shape.length,(function(){return"Batch normalization gradient requires mean and variance to have equal ranks."})),i.wf.assert(null==s||c.shape.length===s.shape.length,(function(){return"Batch normalization gradient requires mean and offset to have equal ranks."})),i.wf.assert(null==o||c.shape.length===o.shape.length,(function(){return"Batch normalization gradient requires mean and scale to have equal ranks."})),Yd([a,c,u,o,s],"batchNorm");var l=r.varianceEpsilon;null==l&&(l=.001);for(var d=n.data.get(a.dataId).values,f=n.data.get(c.dataId).values,p=n.data.get(u.dataId).values,h=o?n.data.get(o.dataId).values:new Float32Array([1]),b=s?n.data.get(s.dataId).values:new Float32Array([0]),m=new Float32Array(d.length),v=b.length,g=h.length,y=p.length,O=f.length,x=0,k=0,w=0,j=0,S=0;S<d.length;++S)m[S]=b[x++]+(d[S]-f[k++])*h[w++]/Math.sqrt(p[j++]+l),x>=v&&(x=0),k>=O&&(k=0),w>=g&&(w=0),j>=y&&(j=0);return n.makeTensorInfo(a.shape,a.dtype,m)}};function bp(e,t,n,r,a){var o=i.af.isSliceContinous(r,t,n),s=i.wf.sizeFromShape(n),c=i.wf.computeStrides(r);if(o){var u=i.af.computeFlatOffset(t,c);return"string"===a?e.slice(u,u+s):e.subarray(u,u+s)}for(var l="string"===a?i.ud.fromUint8ToStringArray(e):e,d=Object(i.zd)(r,a,l),f=Object(i.zd)(n,a),p=0;p<f.size;++p){var h=f.indexToLoc(p),b=h.map((function(e,n){return e+t[n]}));f.set.apply(f,[d.get.apply(d,Object(Vn.a)(b))].concat(Object(Vn.a)(h)))}return"string"===a?i.ud.fromStringArrayToUint8(f.values):f.values}function mp(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.begin,c=r.size;Yd(a,"slice");var u=i.af.parseSliceParams(a,s,c),l=Object(o.a)(u,2),d=l[0],f=l[1];i.af.assertParamsValid(a,d,f);var p=bp(n.data.get(a.dataId).values,d,f,a.shape,a.dtype);return n.makeTensorInfo(f,a.dtype,p)}var vp={kernelName:i.Fc,backendName:"cpu",kernelFunc:mp};var gp={kernelName:i.t,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.blockShape,s=r.crops;Yd([a],"batchToSpaceND");var c=o.reduce((function(e,t){return e*t})),u=i.ud.getReshaped(a.shape,o,c),l=i.ud.getPermuted(u.length,o.length),d=i.ud.getReshapedPermuted(a.shape,o,c),f=i.ud.getSliceBeginCoords(s,o.length),p=i.ud.getSliceSize(d,s,o.length),h=Af({inputs:{x:a},backend:n,attrs:{shape:u}}),b=Hf({inputs:{x:h},backend:n,attrs:{perm:l}}),m=Af({inputs:{x:b},backend:n,attrs:{shape:d}}),v=mp({inputs:{x:m},backend:n,attrs:{begin:f,size:p}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(m),v}};function yp(e,t,n,r,a){for(var o=i.wf.sizeFromShape(r),s=i.wf.makeZerosTypedArray(a,n),c=0;c<e.length;c++){var u=e[c];if(u<0)throw new Error("Input x must be non-negative!");u>=a||(s[u]+=o>0?t[c]:1)}return s}function Op(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.shape[0],o=e.shape[1],s=Object(i.zd)([a,n],t.dtype),c=0;c<a;c++)for(var u=0;u<o;u++){var l=e.get(c,u);if(l<0)throw new Error("Input x must be non-negative!");l>=n||(r?s.set(1,c,l):t.size>0?s.set(s.get(c,l)+t.get(c,u),c,l):s.set(s.get(c,l)+1,c,l))}return s}var xp={kernelName:i.u,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=t.weights,o=r.size,s=yp(n.data.get(a.dataId).values,n.data.get(i.dataId).values,i.dtype,i.shape,o);return n.makeTensorInfo([o],i.dtype,s)}};function kp(e){return function(t,n,r){for(var a=i.wf.getTypedArrayFromDType(n,t.length),o=0;o<t.length;++o)a[o]=e(t[o],r);return a}}var wp=kp((function(e){return Math.ceil(e)})),jp=Jd(i.w,wp),Sp={kernelName:i.w,backendName:"cpu",kernelFunc:jp},Np=Zd(i.x,(function(e,t){var n=t;return e>n.clipValueMax?n.clipValueMax:e<n.clipValueMin?n.clipValueMin:e})),Ip={kernelName:i.x,backendName:"cpu",kernelFunc:Np},Cp={kernelName:i.z,backendName:"cpu",kernelFunc:function(e){for(var t=e.inputs.x,n=e.backend,r=new Float32Array(i.wf.sizeFromShape(t.shape)),a=n.data.get(t.dataId),o=a.complexTensorInfos.real,s=a.complexTensorInfos.imag,c=n.data.get(o.dataId).values,u=n.data.get(s.dataId).values,l=0;l<c.length;l++){var d=c[l],f=u[l];r[l]=Math.hypot(d,f)}return n.makeOutput(r,t.shape,"float32")}};function Tp(e,t,n,r){var a=i.wf.getArrayFromDType(n,i.wf.sizeFromShape(t));if(r&&"string"!==n){var o=0;e.forEach((function(e){var t=i.wf.sizeFromShape(e.shape);a.set(e.vals,o),o+=t}))}else{var s=0;e.forEach((function(e){for(var r="string"===n?i.ud.fromUint8ToStringArray(e.vals):e.vals,o=0,c=0;c<e.shape[0];++c)for(var u=c*t[1]+s,l=0;l<e.shape[1];++l)a[u+l]=r[o++];s+=e.shape[1]}))}return a}function Ep(e){var t=e.inputs,n=e.backend,r=t.input,a=n.data.get(r.dataId).complexTensorInfos.imag,i=n.data.get(a.dataId).values;return n.makeTensorInfo(a.shape,a.dtype,i)}var Ap={kernelName:i.sb,backendName:"cpu",kernelFunc:Ep};function Rp(e){var t=e.inputs,n=e.backend,r=e.attrs.axis,a=i.wf.parseAxisParam(r,t[0].shape)[0],o=i.ud.computeOutShape(t.map((function(e){return e.shape})),a);if(0===i.wf.sizeFromShape(o))return n.makeTensorInfo(o,t[0].dtype,[]);var s=t.filter((function(e){return i.wf.sizeFromShape(e.shape)>0}));if(1===s.length)return nf({inputs:{x:s[0]},backend:n});var c=s.map((function(e){return e.shape}));if(i.ud.assertParamsConsistent(c,a),"complex64"===s[0].dtype){var u=s.map((function(e){return xf({inputs:{input:e},backend:n})})),l=s.map((function(e){return Ep({inputs:{input:e},backend:n})})),d=Rp({inputs:u,backend:n,attrs:{axis:a}}),f=Rp({inputs:l,backend:n,attrs:{axis:a}}),p=gf({inputs:{real:d,imag:f},backend:n});return u.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),l.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(f),p}var h=s.map((function(e){var t=i.wf.sizeFromShape(e.shape.slice(a));return Af({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})})),b=h.map((function(e){return{vals:n.data.get(e.dataId).values,shape:e.shape}}));o=i.ud.computeOutShape(h.map((function(e){return e.shape})),1);var m=1===h[0].shape[0],v=Tp(b,o,t[0].dtype,m),g=i.ud.computeOutShape(s.map((function(e){return e.shape})),a),y=n.makeTensorInfo(g,t[0].dtype,v);return h.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),y}var Fp={kernelName:i.A,backendName:"cpu",kernelFunc:Rp};function Dp(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.filter,s=r.strides,c=r.pad,u=r.dataFormat,l=r.dilations,d=r.dimRoundingMode;Yd([a,o],"conv2d");for(var f=i.ud.convertConv2DDataFormat(u),p=i.ud.computeConv2DInfo(a.shape,o.shape,s,l,c,d,!1,f),h=p.filterHeight,b=p.filterWidth,m=p.dilationHeight,v=p.dilationWidth,g=p.padInfo.left,y=p.padInfo.top,O="channelsLast"===p.dataFormat,x=new i.cd(p.outShape,a.dtype),k=i.wf.computeStrides(a.shape),w=i.wf.computeStrides(o.shape),j=k[0],S=O?k[1]:k[2],N=O?k[2]:1,I=O?1:k[1],C=x.strides[0],T=O?x.strides[1]:x.strides[2],E=O?x.strides[2]:1,A=O?1:x.strides[1],R=n.data.get(a.dataId).values,F=n.data.get(o.dataId).values,D=x.values,_=0;_<p.batchSize;++_)for(var M=_*j,z=_*C,L=0;L<p.outHeight;++L)for(var P=z+L*T,B=L*p.strideHeight-y,W=0;W<h;++W){var U=B+W*m;if(!(U<0||U>=p.inHeight))for(var V=W*w[0],H=M+U*S,G=0;G<p.outWidth;++G)for(var q=P+G*E,K=G*p.strideWidth-g,X=0;X<b;++X){var Y=K+X*v;if(!(Y<0||Y>=p.inWidth))for(var $=H+Y*N,Q=V+X*w[1],Z=0;Z<p.inChannels;++Z){for(var J=R[$+Z*I],ee=0;ee<p.outChannels;++ee)D[q+ee*A]+=J*F[Q+ee];Q+=p.outChannels}}}return n.makeTensorInfo(x.shape,x.dtype,D)}var _p={kernelName:i.B,backendName:"cpu",kernelFunc:Dp};var Mp={kernelName:i.C,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.dy,s=r.strides,c=r.pad,u=r.dataFormat,l=r.dimRoundingMode,d=r.filterShape;Yd([a,o],"conv2dBackpropFilter");for(var f=i.ud.convertConv2DDataFormat(u),p=i.ud.computeConv2DInfo(a.shape,d,s,1,c,l,!1,f),h=p.strideHeight,b=p.strideWidth,m=p.filterHeight,v=p.filterWidth,g="channelsLast"===p.dataFormat,y=new i.cd(p.filterShape,"float32"),O=p.padInfo.left,x=p.padInfo.top,k=n.data.get(a.dataId).values,w=n.data.get(o.dataId).values,j=new i.cd(a.shape,a.dtype,k),S=new i.cd(o.shape,o.dtype,w),N=0;N<m;++N)for(var I=Math.max(0,Math.ceil((x-N)/h)),C=Math.min(p.outHeight,(p.inHeight+x-N)/h),T=0;T<v;++T)for(var E=Math.max(0,Math.ceil((O-T)/b)),A=Math.min(p.outWidth,(p.inWidth+O-T)/b),R=0;R<p.inChannels;++R)for(var F=0;F<p.outChannels;++F){for(var D=0,_=0;_<p.batchSize;++_)for(var M=I;M<C;++M)for(var z=N+M*h-x,L=E;L<A;++L){var P=T+L*b-O;D+=g?j.get(_,z,P,R)*S.get(_,M,L,F):j.get(_,R,z,P)*S.get(_,F,M,L)}y.set(D,N,T,R,F)}return n.makeTensorInfo(y.shape,y.dtype,y.values)}};var zp={kernelName:i.D,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,s=t.filter,c=r.inputShape,u=r.strides,l=r.pad,d=r.dataFormat,f=r.dimRoundingMode;Yd([a,s],"conv2dBackpropInput");var p=i.wf.computeStrides(s.shape),h=i.wf.computeStrides(a.shape),b=i.ud.convertConv2DDataFormat(d),m=i.ud.computeConv2DInfo(c,s.shape,u,1,l,f,!1,b),v=new i.cd(m.inShape,"float32"),g=v.values,y=n.data.get(a.dataId).values,O=n.data.get(s.dataId).values,x=Object(o.a)(p,3),k=x[0],w=x[1],j=x[2],S=m.batchSize,N=m.filterHeight,I=m.filterWidth,C=m.inChannels,T=m.inHeight,E=m.inWidth,A=m.outChannels,R=m.outHeight,F=m.outWidth,D=m.strideHeight,_=m.strideWidth;b=m.dataFormat;for(var M=N-1-m.padInfo.top,z=I-1-m.padInfo.left,L="channelsLast"===b,P=v.strides[0],B=L?v.strides[1]:v.strides[2],W=L?v.strides[2]:1,U=L?1:v.strides[1],V=h[0],H=L?h[1]:h[2],G=L?h[2]:1,q=L?1:h[1],K=0;K<S;++K)for(var X=0;X<C;++X)for(var Y=0;Y<T;++Y)for(var $=Y-M,Q=Math.max(0,Math.ceil($/D)),Z=Math.min(R,(N+$)/D),J=0;J<E;++J){for(var ee=J-z,te=Math.max(0,Math.ceil(ee/_)),ne=Math.min(F,(I+ee)/_),re=0,ae=Q;ae<Z;++ae)for(var ie=ae*D-$,oe=te;oe<ne;++oe)for(var se=V*K+H*ae+G*oe,ce=k*(N-1-ie)+w*(I-1-(oe*_-ee))+j*X,ue=0;ue<A;++ue){re+=y[se+q*ue]*O[ce+ue]}g[P*K+B*Y+W*J+U*X]=re}return n.makeTensorInfo(v.shape,v.dtype,v.values)}};var Lp={kernelName:i.E,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.filter,s=r.strides,c=r.pad,u=r.dilations;Yd([a,o],"conv3d");for(var l=i.ud.computeConv3DInfo(a.shape,o.shape,s,u,c),d=l.filterDepth,f=l.filterHeight,p=l.filterWidth,h=l.dilationDepth,b=l.dilationHeight,m=l.dilationWidth,v=l.padInfo,g=v.front,y=v.left,O=v.top,x=new i.cd(l.outShape,a.dtype),k=n.data.get(a.dataId).values,w=n.data.get(o.dataId).values,j=x.values,S=i.wf.computeStrides(a.shape),N=i.wf.computeStrides(o.shape),I=0;I<l.batchSize;++I)for(var C=I*S[0],T=I*x.strides[0],E=0;E<l.outDepth;++E)for(var A=T+E*x.strides[1],R=E*l.strideDepth-g,F=0;F<d;++F){var D=R+F*h;if(!(D<0||D>=l.inDepth))for(var _=F*N[0],M=C+D*S[1],z=0;z<l.outHeight;++z)for(var L=A+z*x.strides[2],P=z*l.strideHeight-O,B=0;B<f;++B){var W=P+B*b;if(!(W<0||W>=l.inHeight))for(var U=_+B*N[1],V=M+W*S[2],H=0;H<l.outWidth;++H)for(var G=L+H*l.outChannels,q=H*l.strideWidth-y,K=0;K<p;++K){var X=q+K*m;if(!(X<0||X>=l.inWidth))for(var Y=U+K*N[2],$=V+X*l.inChannels,Q=Y,Z=0;Z<l.inChannels;++Z){for(var J=k[$+Z],ee=0;ee<l.outChannels;++ee)j[G+ee]+=J*w[Q+ee];Q+=l.outChannels}}}}return n.makeTensorInfo(x.shape,x.dtype,x.values)}};var Pp={kernelName:i.F,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=t.dy,c=r.strides,u=r.pad,l=r.filterShape;Yd([a,s],"conv3dBackpropFilterV2");for(var d=i.wf.computeStrides(a.shape),f=i.wf.computeStrides(s.shape),p=i.ud.computeConv3DInfo(a.shape,l,c,1,u),h=p.strideDepth,b=p.strideHeight,m=p.strideWidth,v=p.filterDepth,g=p.filterHeight,y=p.filterWidth,O=new i.cd(p.filterShape,"float32"),x=O.values,k=Object(o.a)(O.strides,4),w=k[0],j=k[1],S=k[2],N=k[3],I=n.data.get(s.dataId).values,C=Object(o.a)(f,4),T=C[0],E=C[1],A=C[2],R=C[3],F=n.data.get(a.dataId).values,D=Object(o.a)(d,4),_=D[0],M=D[1],z=D[2],L=D[3],P=p.padInfo.front,B=p.padInfo.left,W=p.padInfo.top,U=0;U<v;++U)for(var V=Math.max(0,Math.ceil((P-U)/h)),H=Math.min(p.outDepth,(p.inDepth+P-U)/h),G=U*w,q=0;q<g;++q)for(var K=Math.max(0,Math.ceil((W-q)/b)),X=Math.min(p.outHeight,(p.inHeight+W-q)/b),Y=q*j+G,$=0;$<y;++$)for(var Q=Math.max(0,Math.ceil((B-$)/m)),Z=Math.min(p.outWidth,(p.inWidth+B-$)/m),J=$*S+Y,ee=0;ee<p.inChannels;++ee)for(var te=ee*N+J,ne=0;ne<p.outChannels;++ne){for(var re=0,ae=0;ae<p.batchSize;++ae)for(var ie=ae*_,oe=ae*T,se=V;se<H;++se)for(var ce=(U+se*h-P)*M+ie,ue=se*E+oe,le=K;le<X;++le)for(var de=(q+le*b-W)*z+ce,fe=le*A+ue,pe=Q;pe<Z;++pe){var he=pe*R+fe;re+=F[($+pe*m-B)*L+de+ee]*I[he+ne]}x[te+ne]=re}return n.makeTensorInfo(O.shape,O.dtype,O.values)}};var Bp={kernelName:i.G,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,s=t.filter,c=r.pad,u=r.strides,l=r.inputShape;Yd([a],"conv3dBackpropInputV2");for(var d=i.wf.computeStrides(a.shape),f=i.wf.computeStrides(s.shape),p=i.ud.computeConv3DInfo(l,s.shape,u,1,c),h=new i.cd(p.inShape,"float32"),b=h.values,m=Object(o.a)(h.strides,4),v=m[0],g=m[1],y=m[2],O=m[3],x=n.data.get(a.dataId).values,k=Object(o.a)(d,4),w=k[0],j=k[1],S=k[2],N=k[3],I=n.data.get(s.dataId).values,C=Object(o.a)(f,4),T=C[0],E=C[1],A=C[2],R=C[3],F=p.batchSize,D=p.filterDepth,_=p.filterHeight,M=p.filterWidth,z=p.inChannels,L=p.inDepth,P=p.inHeight,B=p.inWidth,W=p.outChannels,U=p.outDepth,V=p.outHeight,H=p.outWidth,G=p.strideDepth,q=p.strideHeight,K=p.strideWidth,X=D-1-p.padInfo.front,Y=_-1-p.padInfo.top,$=M-1-p.padInfo.left,Q=0;Q<F;++Q)for(var Z=0;Z<z;++Z)for(var J=0;J<L;++J)for(var ee=J-X,te=Math.max(0,Math.ceil(ee/G)),ne=Math.min(U,(D+ee)/G),re=0;re<P;++re)for(var ae=re-Y,ie=Math.max(0,Math.ceil(ae/q)),oe=Math.min(V,(_+ae)/q),se=0;se<B;++se){for(var ce=se-$,ue=Math.max(0,Math.ceil(ce/K)),le=Math.min(H,(M+ce)/K),de=0,fe=te;fe<ne;++fe)for(var pe=fe*G-ee,he=ie;he<oe;++he)for(var be=he*q-ae,me=ue;me<le;++me)for(var ve=w*Q+j*fe+S*he+N*me,ge=T*(D-1-pe)+E*(_-1-be)+A*(M-1-(me*K-ce))+R*Z,ye=0;ye<W;++ye){de+=x[ve+ye]*I[ge+ye]}b[v*Q+g*J+y*re+O*se+Z]=de}return n.makeTensorInfo(h.shape,h.dtype,h.values)}},Wp=Zd(i.H,(function(e){return Math.cos(e)})),Up={kernelName:i.H,backendName:"cpu",kernelFunc:Wp},Vp=Zd(i.I,(function(e){return Math.cosh(e)})),Hp={kernelName:i.I,backendName:"cpu",kernelFunc:Vp};var Gp={kernelName:i.J,backendName:"cpu",kernelFunc:function(e){for(var t=e.inputs,n=e.backend,r=e.attrs,a=t.image,s=t.boxes,c=t.boxInd,u=r.cropSize,l=r.method,d=r.extrapolationValue,f=Object(o.a)(a.shape,4),p=f[0],h=f[1],b=f[2],m=f[3],v=s.shape[0],g=Object(o.a)(u,2),y=g[0],O=g[1],x=Object(i.zd)([v,y,O,m],"float32"),k=n.data.get(s.dataId).values,w=n.data.get(c.dataId).values,j=n.data.get(a.dataId).values,S=i.wf.computeStrides(a.shape),N=i.wf.computeStrides(x.shape),I=0;I<v;I++){var C=4*I,T=k[C],E=k[C+1],A=k[C+2],R=k[C+3],F=w[I];if(!(F>=p))for(var D=y>1?(A-T)*(h-1)/(y-1):0,_=O>1?(R-E)*(b-1)/(O-1):0,M=0;M<y;M++){var z=y>1?T*(h-1)+M*D:.5*(T+A)*(h-1);if(z<0||z>h-1)for(var L=0;L<O;L++)for(var P=0;P<m;P++){var B=P+L*N[2]+M*N[1]+I*N[0];x.values[B]=d}else if("bilinear"===l)for(var W=Math.floor(z),U=Math.ceil(z),V=z-W,H=0;H<O;H++){var G=O>1?E*(b-1)+H*_:.5*(E+R)*(b-1);if(G<0||G>b-1)for(var q=0;q<m;q++){var K=q+H*N[2]+M*N[1]+I*N[0];x.values[K]=d}else for(var X=Math.floor(G),Y=Math.ceil(G),$=G-X,Q=0;Q<m;Q++){var Z=Q+X*S[2]+W*S[1]+F*S[0],J=j[Z],ee=j[Z=Q+Y*S[2]+W*S[1]+F*S[0]],te=j[Z=Q+X*S[2]+U*S[1]+F*S[0]],ne=J+(ee-J)*$,re=te+(j[Z=Q+Y*S[2]+U*S[1]+F*S[0]]-te)*$;Z=Q+H*N[2]+M*N[1]+I*N[0],x.values[Z]=ne+(re-ne)*V}}else for(var ae=0;ae<O;++ae){var ie=O>1?E*(b-1)+ae*_:.5*(E+R)*(b-1);if(ie<0||ie>b-1)for(var oe=0;oe<m;oe++){var se=oe+ae*N[2]+M*N[1]+I*N[0];x.values[se]=d}else for(var ce=Math.round(ie),ue=Math.round(z),le=0;le<m;le++){var de=le+ce*S[2]+ue*S[1]+F*S[0],fe=le+ae*N[2]+M*N[1]+I*N[0];x.values[fe]=j[de]}}}}return n.makeTensorInfo(x.shape,x.dtype,x.values)}};var qp={kernelName:i.K,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.axis,s=r.exclusive,c=r.reverse;Yd(a,"cumsum");var u=i.ud.getAxesPermutation([o],a.shape.length),l=a;null!=u&&(l=Hf({inputs:{x:a},backend:n,attrs:{perm:u}}));var d=i.ud.getInnerMostAxes(1,a.shape.length)[0];if(d!==l.shape.length-1)throw new Error("backend.cumsum in CPU expects an inner-most "+"axis=".concat(l.shape.length-1," but got axis=").concat(d));for(var f=Object(i.vf)(l.dtype,"int32"),p=i.wf.makeZerosTypedArray(i.wf.sizeFromShape(l.shape),f),h=n.data.get(l.dataId).values,b=l.shape[l.shape.length-1],m=c?function(e,t){return e+b-t-1}:function(e,t){return e+t},v=0;v<h.length;v+=b)for(var g=0;g<b;g++){var y=m(v,g);if(0===g)p[y]=s?0:h[y];else{var O=m(v,g-1);p[y]=s?h[O]+p[O]:h[y]+p[O]}}var x=n.makeTensorInfo(l.shape,f,p);if(null!=u){var k=Hf({inputs:{x:x},backend:n,attrs:{perm:i.ud.getUndoAxesPermutation(u)}});return n.disposeIntermediateTensorInfo(x),n.disposeIntermediateTensorInfo(l),k}return x}};var Kp={kernelName:i.M,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=t.weights,o=r.size,s=r.binaryOutput;if(1===a.shape.length){var c=yp(n.data.get(a.dataId).values,n.data.get(i.dataId).values,i.dtype,i.shape,o);return n.makeTensorInfo([o],i.dtype,c)}if(2===a.shape.length){var u=Op(n.bufferSync(a),n.bufferSync(i),o,s);return n.makeTensorInfo(u.shape,i.dtype,u.values)}throw new Error("Error in denseBincount: input must be at most rank 2, but got rank"+"".concat(a.shape.length,"."))}};var Xp={kernelName:i.N,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.blockSize,s=r.dataFormat;i.wf.assert("NHWC"===s,(function(){return"Only NHWC dataFormat supported on CPU for depthToSpace. Got ".concat(s)})),i.wf.assert(o>1,(function(){return"blockSize should be > 1 for depthToSpace, but was: ".concat(o)}));for(var c=a.shape[0],u=a.shape[1],l=a.shape[2],d=a.shape[3],f=u*o,p=l*o,h=d/(o*o),b=n.data.get(a.dataId).values,m=new Float32Array(c*f*p*h),v=0,g=0;g<c;++g)for(var y=0;y<f;++y)for(var O=Math.floor(y/o),x=y%o,k=0;k<p;++k)for(var w=Math.floor(k/o),j=(x*o+k%o)*h,S=0;S<h;++S){var N=S+j+d*(w+l*(O+u*g));m[v++]=b[N]}return n.makeTensorInfo([c,f,p,h],a.dtype,m)}};function Yp(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.filter,s=r.strides,c=r.pad,u=r.dilations,l=r.dimRoundingMode;Yd([a,o],"depthwiseConv2DNative");var d=i.wf.computeStrides(a.shape),f=i.wf.computeStrides(o.shape),p=u;null==p&&(p=[1,1]),i.wf.assert(i.ud.eitherStridesOrDilationsAreOne(s,p),(function(){return"Error in depthwiseConv2d: Either strides or dilations must be "+"1. Got strides ".concat(s," and dilations '").concat(p,"'")}));for(var h=i.ud.computeConv2DInfo(a.shape,o.shape,s,p,c,l,!0),b=h.filterHeight,m=h.filterWidth,v=h.dilationHeight,g=h.dilationWidth,y=h.padInfo,O=y.left,x=y.top,k=h.outChannels/h.inChannels,w=new i.cd(h.outShape,a.dtype),j=n.data.get(a.dataId).values,S=n.data.get(o.dataId).values,N=w.values,I=0;I<h.batchSize;++I)for(var C=I*d[0],T=I*w.strides[0],E=0;E<h.outHeight;++E)for(var A=T+E*w.strides[1],R=E*h.strideHeight-x,F=0;F<b;++F){var D=R+F*v;if(!(D<0||D>=h.inHeight))for(var _=F*f[0],M=C+D*d[1],z=0;z<h.outWidth;++z)for(var L=A+z*w.strides[2],P=z*h.strideWidth-O,B=0;B<m;++B){var W=P+B*g;if(!(W<0||W>=h.inWidth))for(var U=_+B*f[1],V=M+W*h.inChannels,H=L,G=U,q=0;q<h.inChannels;++q){for(var K=j[V+q],X=0;X<k;++X)N[H+X]+=K*S[G+X];H+=k,G+=k}}}return n.makeTensorInfo(w.shape,w.dtype,w.values)}var $p={kernelName:i.O,backendName:"cpu",kernelFunc:Yp};var Qp={kernelName:i.P,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.dy,s=r.strides,c=r.dilations,u=r.pad,l=r.dimRoundingMode,d=r.filterShape;Yd([a,o],"depthwiseConv2dNativeBackpropFilter");for(var f=i.ud.computeConv2DInfo(a.shape,d,s,c,u,l,!0),p=f.strideHeight,h=f.strideWidth,b=f.filterHeight,m=f.filterWidth,v=new i.cd(f.filterShape,"float32"),g=f.padInfo.left,y=f.padInfo.top,O=f.outChannels/f.inChannels,x=n.data.get(a.dataId).values,k=new i.cd(a.shape,a.dtype,x),w=n.data.get(o.dataId).values,j=new i.cd(o.shape,o.dtype,w),S=0;S<b;++S)for(var N=Math.max(0,Math.ceil((y-S)/p)),I=Math.min(f.outHeight,(f.inHeight+y-S)/p),C=0;C<m;++C)for(var T=Math.max(0,Math.ceil((g-C)/h)),E=Math.min(f.outWidth,(f.inWidth+g-C)/h),A=0;A<f.outChannels;++A){for(var R=Math.trunc(A/O),F=A%O,D=0,_=0;_<f.batchSize;++_)for(var M=N;M<I;++M)for(var z=S+M*p-y,L=T;L<E;++L){var P=C+L*h-g;D+=k.get(_,z,P,R)*j.get(_,M,L,A)}v.set(D,S,C,R,F)}return n.makeTensorInfo(v.shape,v.dtype,v.values)}};var Zp={kernelName:i.Q,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,s=t.filter,c=r.strides,u=r.dilations,l=r.pad,d=r.dimRoundingMode,f=r.inputShape;Yd([a,s],"depthwiseConv2DNativeBackpropInput");for(var p=i.wf.computeStrides(a.shape),h=i.wf.computeStrides(s.shape),b=i.ud.computeConv2DInfo(f,s.shape,c,u,l,d,!0),m=new i.cd(b.inShape,"float32"),v=m.values,g=Object(o.a)(m.strides,3),y=g[0],O=g[1],x=g[2],k=n.data.get(a.dataId).values,w=Object(o.a)(p,3),j=w[0],S=w[1],N=w[2],I=n.data.get(s.dataId).values,C=Object(o.a)(h,3),T=C[0],E=C[1],A=C[2],R=b.batchSize,F=b.filterHeight,D=b.filterWidth,_=b.inChannels,M=b.inHeight,z=b.inWidth,L=b.outChannels,P=b.outHeight,B=b.outWidth,W=b.strideHeight,U=b.strideWidth,V=F-1-b.padInfo.top,H=D-1-b.padInfo.left,G=L/_,q=0;q<R;++q)for(var K=0;K<_;++K)for(var X=0;X<M;++X)for(var Y=X-V,$=Math.max(0,Math.ceil(Y/W)),Q=Math.min(P,(F+Y)/W),Z=0;Z<z;++Z){for(var J=Z-H,ee=Math.max(0,Math.ceil(J/U)),te=Math.min(B,(D+J)/U),ne=0,re=$;re<Q;++re)for(var ae=re*W-Y,ie=ee;ie<te;++ie)for(var oe=j*q+S*re+N*ie,se=T*(F-1-ae)+E*(D-1-(ie*U-J))+A*K,ce=0;ce<G;++ce){ne+=k[oe+(K*G+ce)]*I[se+ce]}v[y*q+O*X+x*Z+K]=ne}return n.makeTensorInfo(m.shape,m.dtype,m.values)}};var Jp={kernelName:i.R,backendName:"cpu",kernelFunc:function(e){for(var t=e.inputs,n=e.backend,r=t.x,a=i.wf.sizeFromShape(r.shape),o=n.data.get(r.dataId).values,s=Object(i.zd)([a,a],r.dtype),c=s.values,u=0;u<o.length;u++)c[u*a+u]=o[u];var l=[].concat(Object(Vn.a)(r.shape),Object(Vn.a)(r.shape));return n.makeTensorInfo(l,s.dtype,s.values)}},eh={kernelName:i.S,backendName:"cpu",kernelFunc:function(e){for(var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.filter,s=r.strides,c=r.pad,u=r.dilations,l=n,d=l.data.get(a.dataId).values,f=a.shape.length,p=l.data.get(o.dataId).values,h=o.shape.length,b=i.ud.computeDilation2DInfo(a.shape,o.shape,s,c,"NHWC",u),m=b.batchSize,v=b.inHeight,g=b.inWidth,y=b.inChannels,O=b.outHeight,x=b.outWidth,k=b.padInfo,w=b.strideHeight,j=b.strideWidth,S=b.filterHeight,N=b.filterWidth,I=b.dilationHeight,C=b.dilationWidth,T=b.outShape,E=i.wf.sizeFromShape(T),A=T.length,R=i.wf.getArrayFromDType(a.dtype,E),F=0;F<m;++F)for(var D=0;D<O;++D)for(var _=D*w-k.top,M=0;M<x;++M)for(var z=M*j-k.left,L=0;L<y;++L){for(var P=Number.MIN_SAFE_INTEGER,B=0;B<S;++B){var W=_+B*I;if(W>=0&&W<v)for(var U=0;U<N;++U){var V=z+U*C;if(V>=0&&V<g){var H=i.wf.locToIndex([F,W,V,L],f,i.wf.computeStrides(a.shape)),G=i.wf.locToIndex([B,U,L],h,i.wf.computeStrides(o.shape)),q=d[H]+p[G];q>P&&(P=q)}}}R[i.wf.locToIndex([F,D,M,L],A,i.wf.computeStrides(T))]=P}return{dataId:l.write(i.wf.toTypedArray(R,a.dtype),T,a.dtype),shape:T,dtype:a.dtype}}},th={kernelName:i.T,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.filter,s=t.dy,c=r.strides,u=r.pad,l=r.dilations,d=n,f=i.wf.toNestedArray(a.shape,d.data.get(a.dataId).values),p=i.wf.toNestedArray(o.shape,d.data.get(o.dataId).values),h=i.ud.computeDilation2DInfo(a.shape,o.shape,c,u,"NHWC",l),b=h.batchSize,m=h.inHeight,v=h.inWidth,g=h.inChannels,y=h.outHeight,O=h.outWidth,x=h.padInfo,k=h.strideHeight,w=h.strideWidth,j=h.filterHeight,S=h.filterWidth,N=h.dilationHeight,I=h.dilationWidth,C=h.outShape;i.wf.assert(s.rank===C.length,(function(){return"Error in ".concat(i.T,", dy ")+"must have the same rank as output ".concat(C.length,", but got ")+"".concat(s.rank)}));for(var T=i.wf.toNestedArray(C,d.data.get(s.dataId).values),E=i.wf.makeZerosNestedTypedArray(o.shape,o.dtype),A=0;A<b;++A)for(var R=0;R<y;++R)for(var F=R*k-x.top,D=0;D<O;++D)for(var _=D*w-x.left,M=0;M<g;++M){for(var z=Number.MIN_SAFE_INTEGER,L=0,P=0,B=0;B<j;++B){var W=F+B*N;if(W>=0&&W<m)for(var U=0;U<S;++U){var V=_+U*I;if(V>=0&&V<v){var H=f[A][W][V][M]+p[B][U][M];H>z&&(z=H,L=B,P=U)}}}E[L][P][M]+=T[A][R][D][M]}return{dataId:d.write(i.wf.toTypedArray(E,a.dtype),o.shape,o.dtype),shape:o.shape,dtype:o.dtype}}},nh={kernelName:i.U,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.filter,s=t.dy,c=r.strides,u=r.pad,l=r.dilations,d=n,f=i.wf.toNestedArray(a.shape,d.data.get(a.dataId).values),p=i.wf.toNestedArray(o.shape,d.data.get(o.dataId).values),h=i.ud.computeDilation2DInfo(a.shape,o.shape,c,u,"NHWC",l),b=h.batchSize,m=h.inHeight,v=h.inWidth,g=h.inChannels,y=h.outHeight,O=h.outWidth,x=h.padInfo,k=h.strideHeight,w=h.strideWidth,j=h.filterHeight,S=h.filterWidth,N=h.dilationHeight,I=h.dilationWidth,C=h.outShape;i.wf.assert(s.rank===C.length,(function(){return"Error in ".concat(i.U,", dy ")+"must have the same rank as output ".concat(C.length,", but got ")+"".concat(s.rank)}));for(var T=i.wf.toNestedArray(C,d.data.get(s.dataId).values),E=i.wf.makeZerosNestedTypedArray(a.shape,a.dtype),A=0;A<b;++A)for(var R=0;R<y;++R)for(var F=R*k-x.top,D=0;D<O;++D)for(var _=D*w-x.left,M=0;M<g;++M){for(var z=Number.MIN_SAFE_INTEGER,L=F<0?0:F,P=_<0?0:_,B=0;B<j;++B){var W=F+B*N;if(W>=0&&W<m)for(var U=0;U<S;++U){var V=_+U*I;if(V>=0&&V<v){var H=f[A][W][V][M]+p[B][U][M];H>z&&(z=H,L=W,P=V)}}}E[A][L][P][M]+=T[A][R][D][M]}return{dataId:d.write(i.wf.toTypedArray(E,a.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}},rh=sf((function(e,t){return e*t})),ah=Nf((function(e,t,n,r){return{real:e*n-t*r,imag:e*r+t*n}})),ih=Sf(i.Vb,rh,ah),oh={kernelName:i.Vb,backendName:"cpu",kernelFunc:ih};function sh(e){var t,n=e.inputs,r=e.backend,a=e.attrs,s=n.x,c=a.axis,u=a.keepDims;Yd(s,"sum");var l=(t="bool"===s.dtype?wf({inputs:{x:s},backend:r,attrs:{dtype:"int32"}}):nf({inputs:{x:s},backend:r})).shape.length,d=i.wf.parseAxisParam(c,t.shape),f=i.ud.getAxesPermutation(d,l),p=d,h=t;null!=f&&(h=Hf({inputs:{x:t},backend:r,attrs:{perm:f}}),p=i.ud.getInnerMostAxes(p.length,l)),i.ud.assertAxesAreInnerMostDims("sum",p,h.shape.length);for(var b=i.ud.computeOutAndReduceShapes(h.shape,p),m=Object(o.a)(b,2),v=m[0],g=m[1],y=Of(r,v,i.ud.upcastType(h.dtype,"int32")),O=i.wf.sizeFromShape(g),x=r.data.get(y.dataId).values,k=r.data.get(h.dataId).values,w=0;w<x.length;++w){for(var j=w*O,S=0,N=0;N<O;++N)S+=k[j+N];x[w]=S}if(u){var I=y;y=Af({inputs:{x:y},backend:r,attrs:{shape:i.ud.expandShapeToKeepDim(y.shape,d)}}),r.disposeIntermediateTensorInfo(I)}return r.disposeIntermediateTensorInfo(t),null!=f&&r.disposeIntermediateTensorInfo(h),y}var ch={kernelName:i.Yc,backendName:"cpu",kernelFunc:sh};var uh={kernelName:i.V,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs.equation,a=t,o=i.ud.decodeEinsumEquation(r,a.length),s=o.allDims,c=o.summedDims,u=o.idDims;i.ud.checkEinsumDimSizes(s.length,u,a);for(var l=i.ud.getEinsumComputePath(c,u),d=l.path,f=l.steps,p=f.length,h=null,b=s.length,m=[],v=0;v<p;++v){var g,y=Object(ea.a)(f[v]);try{for(y.s();!(g=y.n()).done;){var O=g.value,x=i.ud.getEinsumPermutation(b,u[O]),k=x.permutationIndices,w=x.expandDims,j=void 0;i.ud.isIdentityPermutation(k)?j=a[O]:(j=Hf({inputs:{x:a[O]},backend:n,attrs:{perm:k}}),m.push(j));for(var S=j.shape.slice(),N=0;N<w.length;++N)S.splice(w[N],0,1);i.wf.arraysEqual(j.shape,S)||(j=Af({inputs:{x:j},backend:n,attrs:{shape:S}}),m.push(j)),null===h?h=j:(h=ih({inputs:{a:j,b:h},backend:n}),m.push(h))}}catch(E){y.e(E)}finally{y.f()}v<p-1&&(d[v]>=0&&(h=sh({inputs:{x:h},backend:n,attrs:{axis:d[v]-(s.length-b),keepDims:!1}}),m.push(h)),b--)}for(var I=0,C=m;I<C.length;I++){var T=C[I];T!==h&&n.disposeIntermediateTensorInfo(T)}return h}};var lh={kernelName:i.X,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.dy,a=t.y;Yd([r,a],"eluGrad");for(var o=new Float32Array(i.wf.sizeFromShape(a.shape)),s=n.data.get(a.dataId).values,c=n.data.get(r.dataId).values,u=0;u<s.length;++u){var l=s[u];o[u]=l>=1?c[u]:c[u]*(l+1)}return n.makeTensorInfo(a.shape,"float32",o)}},dh=sf((function(e,t){return e===t?1:0})),fh=Sf(i.Y,dh,null,"bool"),ph={kernelName:i.Y,backendName:"cpu",kernelFunc:fh},hh=i.ud.ERF_P,bh=i.ud.ERF_A1,mh=i.ud.ERF_A2,vh=i.ud.ERF_A3,gh=i.ud.ERF_A4,yh=i.ud.ERF_A5,Oh=Zd(i.Z,(function(e){var t=Math.sign(e),n=Math.abs(e),r=1/(1+hh*n);return t*(1-((((yh*r+gh)*r+vh)*r+mh)*r+bh)*r*Math.exp(-n*n))})),xh={kernelName:i.Z,backendName:"cpu",kernelFunc:Oh},kh=kp((function(e){return Math.exp(e)})),wh=Jd(i.ab,kh),jh={kernelName:i.ab,backendName:"cpu",kernelFunc:wh};function Sh(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.input,o=r.dim,s=a.shape.length,c=a.shape.slice(),u=o;return o<0&&(i.wf.assert(-(s+1)<=o,(function(){return"Axis must be in the interval [".concat(-(s+1),", ").concat(s,"]")})),u=s+o+1),c.splice(u,0,1),Af({inputs:{x:a},backend:n,attrs:{shape:c}})}var Nh={kernelName:i.bb,backendName:"cpu",kernelFunc:Sh},Ih=kp((function(e){return Math.expm1(e)})),Ch=Jd(i.cb,Ih),Th={kernelName:i.cb,backendName:"cpu",kernelFunc:Ch},Eh=sf((function(e,t){return e/t})),Ah=Sf(i.lc,Eh),Rh={kernelName:i.lc,backendName:"cpu",kernelFunc:Ah},Fh=sf((function(e,t){return e-t})),Dh=Nf((function(e,t,n,r){return{real:e-n,imag:t-r}})),_h=Sf(i.Xc,Fh,Dh),Mh={kernelName:i.Xc,backendName:"cpu",kernelFunc:_h};function zh(e,t,n){for(var r=e.shape,a=r[0],o=r[1],s=n.data.get(e.dataId),c=s.complexTensorInfos.real,u=s.complexTensorInfos.imag,l=[a,o],d=i.wf.sizeFromShape(l),f=i.wf.getTypedArrayFromDType("float32",d),p=i.wf.getTypedArrayFromDType("float32",d),h=0;h<a;h++){for(var b=mp({inputs:{x:c},backend:n,attrs:{begin:[h,0],size:[1,o]}}),m=mp({inputs:{x:u},backend:n,attrs:{begin:[h,0],size:[1,o]}}),v=gf({inputs:{real:b,imag:m},backend:n}),g=Lh(v,t,n),y=g.real,O=g.imag,x=i.ud.mergeRealAndImagArrays(y,O),k=0;k<o;k++){var w=i.ud.getComplexWithIndex(x,k);f[h*o+k]=w.real,p[h*o+k]=w.imag}n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(v)}var j=n.makeTensorInfo(l,"float32",f),S=n.makeTensorInfo(l,"float32",p),N=gf({inputs:{real:j,imag:S},backend:n});return n.disposeIntermediateTensorInfo(j),n.disposeIntermediateTensorInfo(S),N}function Lh(e,t,n){var r=i.wf.sizeFromShape(e.shape),a=n.data.get(e.dataId),o=n.data.get(a.complexTensorInfos.real.dataId).values,s=n.data.get(a.complexTensorInfos.imag.dataId).values;if(0===((g=r)&g-1)){var c=Ph(o,s,r,t,n),u=[e.shape[0],e.shape[1]];if(t){var l=n.makeTensorInfo(u,"float32",c.real),d=n.makeTensorInfo(u,"float32",c.imag),f=n.makeTensorInfo([],"float32",i.wf.createScalarValue(r,"float32")),p=nf({inputs:{x:f},backend:n}),h=Rh.kernelFunc({inputs:{a:l,b:f},backend:n}),b=Rh.kernelFunc({inputs:{a:d,b:p},backend:n}),m=n.data.get(h.dataId).values,v=n.data.get(b.dataId).values;return n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(b),{real:m,imag:v}}return c}var g,y=function(e,t,n){for(var r=new Float32Array(2*t),a=0;a<t;a++){for(var o=0,s=0,c=0;c<t;c++){var u=i.ud.exponent(a*c,t,n),l=i.ud.getComplexWithIndex(e,c);o+=l.real*u.real-l.imag*u.imag,s+=l.real*u.imag+l.imag*u.real}n&&(o/=t,s/=t),i.ud.assignToTypedArray(r,o,s,a)}return r}(i.ud.mergeRealAndImagArrays(o,s),r,t);return i.ud.splitRealAndImagArrays(y)}function Ph(e,t,n,r,a){if(1===n)return{real:e,imag:t};var o=i.ud.mergeRealAndImagArrays(e,t),s=n/2,c=i.ud.complexWithEvenIndex(o),u=c.real,l=c.imag,d=[u.length],f=a.makeTensorInfo(d,"float32",u),p=a.makeTensorInfo(d,"float32",l),h=gf({inputs:{real:f,imag:p},backend:a}),b=i.ud.complexWithOddIndex(o),m=b.real,v=b.imag,g=[m.length],y=a.makeTensorInfo(g,"float32",m),O=a.makeTensorInfo(g,"float32",v),x=gf({inputs:{real:y,imag:O},backend:a}),k=Ph(u,l,s,r,a),w=k.real,j=k.imag,S=[w.length],N=a.makeTensorInfo(S,"float32",w),I=a.makeTensorInfo(S,"float32",j),C=gf({inputs:{real:N,imag:I},backend:a}),T=Ph(m,v,s,r,a),E=T.real,A=T.imag,R=[E.length],F=a.makeTensorInfo(R,"float32",E),D=a.makeTensorInfo(R,"float32",A),_=gf({inputs:{real:F,imag:D},backend:a}),M=i.ud.exponents(n,r),z=[M.real.length],L=a.makeTensorInfo(z,"float32",M.real),P=a.makeTensorInfo(z,"float32",M.imag),B=gf({inputs:{real:L,imag:P},backend:a}),W=ih({inputs:{a:B,b:_},backend:a}),U=Tf({inputs:{a:C,b:W},backend:a}),V=_h({inputs:{a:C,b:W},backend:a}),H=xf({inputs:{input:U},backend:a}),G=xf({inputs:{input:V},backend:a}),q=Ep({inputs:{input:U},backend:a}),K=Ep({inputs:{input:V},backend:a}),X=Rp({inputs:[H,G],backend:a,attrs:{axis:0}}),Y=Rp({inputs:[q,K],backend:a,attrs:{axis:0}}),$=a.data.get(X.dataId).values,Q=a.data.get(Y.dataId).values;return a.disposeIntermediateTensorInfo(f),a.disposeIntermediateTensorInfo(p),a.disposeIntermediateTensorInfo(h),a.disposeIntermediateTensorInfo(y),a.disposeIntermediateTensorInfo(O),a.disposeIntermediateTensorInfo(x),a.disposeIntermediateTensorInfo(N),a.disposeIntermediateTensorInfo(I),a.disposeIntermediateTensorInfo(C),a.disposeIntermediateTensorInfo(F),a.disposeIntermediateTensorInfo(D),a.disposeIntermediateTensorInfo(_),a.disposeIntermediateTensorInfo(L),a.disposeIntermediateTensorInfo(P),a.disposeIntermediateTensorInfo(B),a.disposeIntermediateTensorInfo(W),a.disposeIntermediateTensorInfo(U),a.disposeIntermediateTensorInfo(V),a.disposeIntermediateTensorInfo(H),a.disposeIntermediateTensorInfo(q),a.disposeIntermediateTensorInfo(G),a.disposeIntermediateTensorInfo(K),a.disposeIntermediateTensorInfo(X),a.disposeIntermediateTensorInfo(Y),{real:$,imag:Q}}var Bh={kernelName:i.db,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.input,a=i.wf.sizeFromShape(r.shape),o=r.shape[r.shape.length-1],s=Af({inputs:{x:r},backend:n,attrs:{shape:[a/o,o]}}),c=zh(s,!1,n),u=Af({inputs:{x:c},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(c),u}};function Wh(e){var t=e.backend,n=e.attrs,r=n.shape,a=n.value,o=n.dtype||i.wf.inferDtype(a),s=i.wf.getArrayFromDType(o,i.wf.sizeFromShape(r));return function(e,t,n){e.fill(t)}(s,a),t.makeTensorInfo(r,o,s)}var Uh={kernelName:i.eb,backendName:"cpu",kernelFunc:Wh};var Vh={kernelName:i.fb,backendName:"cpu",kernelFunc:function(e){for(var t=e.inputs,n=(e.attrs,e.backend),r=t.image,a=n,s=i.wf.getTypedArrayFromDType(r.dtype,i.wf.sizeFromShape(r.shape)),c=Object(o.a)(r.shape,4),u=c[0],l=c[1],d=c[2],f=c[3],p=a.data.get(r.dataId).values,h=0;h<u;h++)for(var b=h*d*l*f,m=0;m<l;m++)for(var v=m*(d*f),g=0;g<d;g++)for(var y=g*f,O=0;O<f;O++){var x=Math.round(d-g-1),k=b+v+y+O,w=p[k];if(x>=0&&x<d)w=p[b+v+x*f+O];s[k]=w}return{dataId:a.write(s,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},Hh=kp((function(e){return Math.floor(e)})),Gh=Jd(i.gb,Hh),qh={kernelName:i.gb,backendName:"cpu",kernelFunc:Gh},Kh=sf((function(e,t){return Math.floor(e/t)})),Xh=Sf(i.hb,Kh,null,"int32"),Yh={kernelName:i.hb,backendName:"cpu",kernelFunc:Xh};var $h={kernelName:i.kb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=t.filter,o=t.bias,s=t.preluActivationWeights,c=r.strides,u=r.pad,l=r.dataFormat,d=r.dilations,f=r.dimRoundingMode,p=r.activation,h=r.leakyreluAlpha,b=Dp({inputs:{x:a,filter:i},backend:n,attrs:{strides:c,pad:u,dataFormat:l,dilations:d,dimRoundingMode:f}});if(o){var m=b;b=Tf({inputs:{a:b,b:o},backend:n}),n.disposeIntermediateTensorInfo(m)}if(p){var v=b;b=vf(n,b,p,s,h),n.disposeIntermediateTensorInfo(v)}return b}};var Qh={kernelName:i.lb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=t.filter,o=t.bias,s=t.preluActivationWeights,c=r.strides,u=r.pad,l=r.dataFormat,d=r.dilations,f=r.dimRoundingMode,p=r.activation,h=r.leakyreluAlpha,b=Yp({inputs:{x:a,filter:i},backend:n,attrs:{strides:c,pad:u,dataFormat:l,dilations:d,dimRoundingMode:f}});if(o){var m=b;b=Tf({inputs:{a:b,b:o},backend:n}),n.disposeIntermediateTensorInfo(m)}if(p){var v=b;b=vf(n,b,p,s,h),n.disposeIntermediateTensorInfo(v)}return b}};function Zh(e,t,n,r,a,o,s,c,u){for(var l=Object(i.zd)([r,o],n),d=0;d<r;d++){for(var f=[],p=0,h=0;h<a;h++){var b=e[d*a+h];p+=b*s[h],f.push(b)}if(p<0||p>=u/o)throw new Error("Invalid indices: ".concat(f," does not index into ").concat(c));for(var m=0;m<o;m++)l.values[d*o+m]=t.get.apply(t,Object(Vn.a)(t.indexToLoc(p*o+m)))}return l}var Jh={kernelName:i.mb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.params,a=t.indices,s=i.wf.sizeFromShape(r.shape),c=a.shape,u=c[c.length-1],l=i.ud.prepareAndValidate(r,a),d=Object(o.a)(l,4),f=d[0],p=d[1],h=d[2],b=d[3];if(0===p)return n.makeTensorInfo(f,r.dtype,[]);var m=Zh(n.data.get(a.dataId).values,n.bufferSync(r),r.dtype,p,u,h,b,r.shape,s);return n.makeTensorInfo(f,r.dtype,m.values)}};function eb(e,t,n){for(var r=Object(i.zd)(n,e.dtype),a=0;a<r.size;++a){var o=r.indexToLoc(a).slice(),s=o[0],c=o[2],u=t.locToIndex([s,c]);o[2]=t.values[u];var l=e.locToIndex(o);r.values[a]=e.values[l]}return r}var tb={kernelName:i.nb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.indices,s=r.axis,c=r.batchDims;Yd([a,o],"gatherV2");var u=c;null==c&&(u=0);var l=i.wf.sizeFromShape(o.shape),d=i.wf.parseAxisParam(s,a.shape)[0],f=i.ud.segment_util.collectGatherOpShapeInfo(a,o,d,u),p=Af({inputs:{x:a},backend:n,attrs:{shape:[f.batchSize,f.outerSize,f.dimSize,f.sliceSize]}}),h=Af({inputs:{x:o},backend:n,attrs:{shape:[f.batchSize,l/f.batchSize]}}),b=[f.batchSize,f.outerSize,l/f.batchSize,f.sliceSize],m=n.bufferSync(h),v=eb(n.bufferSync(p),m,b);return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(h),n.makeTensorInfo(f.outputShape,v.dtype,v.values)}},nb=sf((function(e,t){return e>t?1:0})),rb=Sf(i.ob,nb,null,"bool"),ab={kernelName:i.ob,backendName:"cpu",kernelFunc:rb},ib=sf((function(e,t){return e>=t?1:0})),ob=Sf(i.pb,ib,null,"bool"),sb={kernelName:i.pb,backendName:"cpu",kernelFunc:ob};var cb={kernelName:i.qb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.input,a=i.wf.sizeFromShape(r.shape),o=r.shape[r.shape.length-1],s=Af({inputs:{x:r},backend:n,attrs:{shape:[a/o,o]}}),c=zh(s,!0,n),u=Af({inputs:{x:c},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(c),u}},ub=Zd(i.tb,(function(e){return Number.isFinite(e)?1:0}),"bool"),lb={kernelName:i.tb,backendName:"cpu",kernelFunc:ub},db=Zd(i.ub,(function(e){return Math.abs(e)===1/0?1:0}),"bool"),fb={kernelName:i.ub,backendName:"cpu",kernelFunc:db},pb=Zd(i.vb,(function(e){return Number.isNaN(e)?1:0}),"bool"),hb={kernelName:i.vb,backendName:"cpu",kernelFunc:pb},bb=sf((function(e,t){return e<t?1:0})),mb=Sf(i.Ab,bb,null,"bool"),vb={kernelName:i.Ab,backendName:"cpu",kernelFunc:mb},gb=sf((function(e,t){return e<=t?1:0})),yb=Sf(i.Bb,gb,null,"bool"),Ob={kernelName:i.Bb,backendName:"cpu",kernelFunc:yb};function xb(e,t,n){var r=(t-e)/(n-1),a=i.wf.makeZerosTypedArray(n,"float32");a[0]=e;for(var o=1;o<a.length;o++)a[o]=a[o-1]+r;return a}var kb={kernelName:i.Cb,backendName:"cpu",kernelFunc:function(e){var t=e.backend,n=e.attrs,r=xb(n.start,n.stop,n.num);return t.makeTensorInfo([r.length],"float32",r)}},wb=kp((function(e){return Math.log(e)})),jb=Jd(i.Db,wb),Sb={kernelName:i.Db,backendName:"cpu",kernelFunc:jb},Nb=Zd(i.Eb,(function(e){return Math.log1p(e)})),Ib={kernelName:i.Eb,backendName:"cpu",kernelFunc:Nb},Cb=sf((function(e,t){return e&&t})),Tb=Sf(i.Fb,Cb,null,"bool"),Eb={kernelName:i.Fb,backendName:"cpu",kernelFunc:Tb},Ab=Zd(i.Gb,(function(e){return e?0:1}),"bool"),Rb={kernelName:i.Gb,backendName:"cpu",kernelFunc:Ab},Fb=sf((function(e,t){return e||t})),Db=Sf(i.Hb,Fb,null,"bool"),_b={kernelName:i.Hb,backendName:"cpu",kernelFunc:Db};var Mb={kernelName:i.xb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.depthRadius,s=r.bias,c=r.alpha,u=r.beta;Yd(a,"LRN");var l=a.shape[3],d=l-1,f=n.data.get(a.dataId).values,p=i.wf.sizeFromShape(a.shape),h=new Float32Array(p);function b(e){for(var t=e%l,n=e-t+Math.max(0,t-o),r=e-t+Math.min(t+o,d),a=0;n<=r;n++){var i=f[n];a+=i*i}return a}for(var m=0;m<p;m++){var v=b(m),g=f[m]*Math.pow(s+c*v,-u);h[m]=g}return n.makeTensorInfo(a.shape,a.dtype,h)}};var zb={kernelName:i.yb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.y,s=t.dy,c=r.depthRadius,u=r.bias,l=r.alpha,d=r.beta;Yd(s,"LRNGrad");for(var f=i.wf.sizeFromShape(s.shape),p=s.shape[3],h=n.data.get(s.dataId).values,b=n.data.get(a.dataId).values,m=n.data.get(o.dataId).values,v=new Float32Array(f),g=f,y=0;y<g;y++){for(var O=y%p,x=y-O+Math.max(0,O-c),k=y-O+Math.min(p,O+c+1),w=0,j=x;j<k;j++)w+=Math.pow(b[j],2);w=l*w+u;for(var S=x;S<k;S++){var N=-2*l*d*b[S]*m[y]/w;y===S&&(N+=Math.pow(w,-d)),N*=h[y],v[S]+=N}}return n.makeTensorInfo(s.shape,a.dtype,v)}};function Lb(e,t,n,r){for(var a=i.wf.getTypedArrayFromDType(r,i.wf.sizeFromShape(n)),o=0;o<a.length;++o){for(var s=o*t,c=e[s],u=0;u<t;++u){var l=e[s+u];(Number.isNaN(l)||l>c)&&(c=l)}a[o]=c}return a}function Pb(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.reductionIndices,c=r.keepDims,u=n,l=a.shape,d=l.length,f=i.wf.parseAxisParam(s,l),p=f,h=i.ud.getAxesPermutation(p,d),b=u.data.get(a.dataId).values;if(null!=h){for(var m=new Array(d),v=0;v<m.length;v++)m[v]=l[h[v]];b=Vf(b,l,a.dtype,h,m),p=i.ud.getInnerMostAxes(p.length,d),l=m}Yd(a,"max"),i.ud.assertAxesAreInnerMostDims("max",p,d);var g=i.ud.computeOutAndReduceShapes(l,p),y=Object(o.a)(g,2),O=y[0],x=y[1],k=Lb(b,i.wf.sizeFromShape(x),O,a.dtype),w=u.write(k,O,a.dtype),j=O;c&&(j=i.ud.expandShapeToKeepDim(O,f));return{dataId:w,shape:j,dtype:a.dtype}}var Bb={kernelName:i.Ib,backendName:"cpu",kernelFunc:Pb},Wb=sf((function(e,t){return Math.max(e,t)})),Ub=Sf(i.Ob,Wb),Vb={kernelName:i.Ob,backendName:"cpu",kernelFunc:Ub};var Hb={kernelName:i.Jb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x;Yd(a,"maxPool");var o=r.filterSize,s=r.strides,c=r.pad,u=r.dimRoundingMode;i.wf.assert(i.ud.eitherStridesOrDilationsAreOne(s,1),(function(){return"Error in maxPool: Either strides or dilations must be 1. "+"Got strides ".concat(s," and dilations '").concat(1,"'")}));var l,d=i.ud.computePool2DInfo(a.shape,o,s,1,c,u);if(1===d.filterWidth&&1===d.filterHeight&&i.wf.arraysEqual(d.inShape,d.outShape))l=nf({inputs:{x:a},backend:n});else{var f=n.data.get(a.dataId).values,p=i.wf.computeStrides(a.shape),h=sp(f,a.shape,a.dtype,p,d,"max");l=n.makeTensorInfo(d.outShape,a.dtype,h.values)}return l}};var Gb={kernelName:i.Kb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.filterSize,s=r.strides,c=r.pad,u=r.dimRoundingMode,l=r.dataFormat;Yd(a,"maxPool3d");var d=i.ud.computePool3DInfo(a.shape,o,s,1,c,u,l),f=up(n.data.get(a.dataId).values,a.shape,a.dtype,i.wf.computeStrides(a.shape),d,"max");return n.makeTensorInfo(f.shape,"float32",f.values)}};var qb={kernelName:i.Lb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.input,s=r.filterSize,c=r.strides,u=r.pad,l=r.dimRoundingMode;Yd([a,o],"maxPool3DGrad");for(var d=i.ud.computePool3DInfo(o.shape,s,c,1,u,l),f=function(e,t){for(var n=Object(i.zd)(t.outShape,"int32"),r=t.strideDepth,a=t.strideHeight,o=t.strideWidth,s=t.dilationDepth,c=t.dilationHeight,u=t.dilationWidth,l=t.effectiveFilterDepth,d=t.effectiveFilterHeight,f=t.effectiveFilterWidth,p=t.padInfo.front,h=t.padInfo.top,b=t.padInfo.left,m=0;m<t.batchSize;++m)for(var v=0;v<t.inChannels;++v)for(var g=0;g<t.outDepth;++g){for(var y=g*r-p,O=y;O<0;)O+=s;for(var x=Math.min(t.inDepth,l+y),k=0;k<t.outHeight;++k){for(var w=k*a-h,j=w;j<0;)j+=c;for(var S=Math.min(t.inHeight,d+w),N=0;N<t.outWidth;++N){for(var I=N*o-b,C=I;C<0;)C+=u;for(var T=Math.min(t.inWidth,f+I),E=Number.NEGATIVE_INFINITY,A=-1,R=O;R<x;R+=s)for(var F=R-y,D=j;D<S;D+=c)for(var _=D-w,M=C;M<T;M+=u){var z=M-I,L=e.get(m,R,D,M,v);L>=E&&(E=L,A=F*d*f+_*d+z)}n.set(A,m,g,k,N,v)}}}return n}(n.bufferSync(o),d),p=d.strideDepth,h=d.strideHeight,b=d.strideWidth,m=d.dilationDepth,v=d.dilationHeight,g=d.dilationWidth,y=d.effectiveFilterDepth,O=d.effectiveFilterHeight,x=d.effectiveFilterWidth,k=y-1-d.padInfo.front,w=x-1-d.padInfo.left,j=O-1-d.padInfo.top,S=Object(i.zd)(o.shape,"float32"),N=n.bufferSync(a),I=0;I<d.batchSize;++I)for(var C=0;C<d.inChannels;++C)for(var T=0;T<d.inDepth;++T)for(var E=0;E<d.inHeight;++E)for(var A=0;A<d.inWidth;++A){for(var R=T-k,F=E-j,D=A-w,_=0,M=0;M<y;M+=m){var z=(R+M)/p;if(!(z<0||z>=d.outDepth||Math.floor(z)!==z))for(var L=0;L<O;L+=v){var P=(F+L)/h;if(!(P<0||P>=d.outHeight||Math.floor(P)!==P))for(var B=0;B<x;B+=g){var W=(D+B)/b;if(!(W<0||W>=d.outWidth||Math.floor(W)!==W)){var U=y*O*x-1-f.get(I,z,P,W,C)===M*O*x+L*x+B?1:0;if(0!==U)_+=N.get(I,z,P,W,C)*U}}}}S.set(_,I,T,E,A,C)}return n.makeTensorInfo(S.shape,S.dtype,S.values)}};var Kb={kernelName:i.Mb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.input,s=o;Yd([o,t.output],"maxPoolGrad");for(var c=r.filterSize,u=r.strides,l=r.pad,d=r.dimRoundingMode,f=i.ud.computePool2DInfo(s.shape,c,u,1,l,d),p=n.data.get(s.dataId).values,h=Object(i.zd)(f.outShape,s.dtype,cp(p,s.shape,s.dtype,f).values),b=f.strideHeight,m=f.strideWidth,v=f.dilationHeight,g=f.dilationWidth,y=f.effectiveFilterHeight,O=f.effectiveFilterWidth,x=O-1-f.padInfo.left,k=y-1-f.padInfo.top,w=Object(i.zd)(s.shape,"float32"),j=n.data.get(a.dataId).values,S=Object(i.zd)(a.shape,"float32",j),N=0;N<f.batchSize;++N)for(var I=0;I<f.inChannels;++I)for(var C=0;C<f.inHeight;++C)for(var T=0;T<f.inWidth;++T){for(var E=C-k,A=T-x,R=0,F=0;F<y;F+=v){var D=(E+F)/b;if(!(D<0||D>=f.outHeight||Math.floor(D)!==D))for(var _=0;_<O;_+=g){var M=(A+_)/m;if(!(M<0||M>=f.outWidth||Math.floor(M)!==M)){var z=y*O-1-h.get(N,D,M,I)===F*O+_?1:0;if(0!==z)R+=S.get(N,D,M,I)*z}}}w.set(R,N,C,T,I)}return n.makeTensorInfo(w.shape,w.dtype,w.values)}};var Xb={kernelName:i.Nb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,a=t.x,s=n.filterSize,c=n.strides,u=n.pad,l=n.includeBatchInIndex,d=r;Yd(a,"MaxPoolWithArgmax");var f=d.data.get(a.dataId).values,p=i.ud.computePool2DInfo(a.shape,s,c,[1,1],u),h=function(e,t,n,r,a){var o=sp(e,0,n,i.wf.computeStrides(t),a,"max"),s=cp(e,t,n,a,!0,r);return[o.values,s.values]}(f,a.shape,a.dtype,l,p),b=Object(o.a)(h,2),m=b[0],v=b[1],g=d.write(m,p.outShape,a.dtype),y=d.write(v,p.outShape,a.dtype);return[{dataId:g,shape:p.outShape,dtype:a.dtype},{dataId:y,shape:p.outShape,dtype:"int32"}]}};var Yb={kernelName:i.Pb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.axis,s=r.keepDims,c=i.wf.parseAxisParam(o,a.shape),u=i.ud.computeOutAndReduceShapes(a.shape,c)[1],l=i.wf.sizeFromShape(u),d=[],f=n.makeTensorInfo([],"float32",new Float32Array([l]));d.push(f);var p=wf({inputs:{x:a},backend:n,attrs:{dtype:"float32"}});d.push(p);var h=Ah({inputs:{a:p,b:f},backend:n});d.push(h);var b=sh({inputs:{x:h},backend:n,attrs:{axis:o,keepDims:s}});return d.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),b}};var $b={kernelName:i.Qb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.axis,c=r.keepDims;Yd(a,"min");var u=i.wf.parseAxisParam(s,a.shape),l=u,d=i.ud.getAxesPermutation(l,a.shape.length),f=a;null!=d&&(f=Hf({inputs:{x:a},backend:n,attrs:{perm:d}}),l=i.ud.getInnerMostAxes(l.length,a.shape.length)),i.ud.assertAxesAreInnerMostDims("min",l,f.shape.length);for(var p=i.ud.computeOutAndReduceShapes(f.shape,l),h=Object(o.a)(p,2),b=h[0],m=h[1],v=i.wf.sizeFromShape(m),g=i.wf.makeZerosTypedArray(i.wf.sizeFromShape(b),f.dtype),y=n.data.get(f.dataId).values,O=0;O<g.length;++O){for(var x=O*v,k=y[x],w=0;w<v;++w){var j=y[x+w];(Number.isNaN(j)||j<k)&&(k=j)}g[O]=k}null!=d&&n.disposeIntermediateTensorInfo(f);var S=n.makeTensorInfo(b,f.dtype,g);if(c){var N=Af({inputs:{x:S},backend:n,attrs:{shape:i.ud.expandShapeToKeepDim(b,u)}});return n.disposeIntermediateTensorInfo(S),N}return S}},Qb=sf((function(e,t){return Math.min(e,t)})),Zb=Sf(i.Rb,Qb),Jb={kernelName:i.Rb,backendName:"cpu",kernelFunc:Zb};var em={kernelName:i.Sb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.paddings,s=r.mode;Yd(a,"mirrorPad");for(var c=o.map((function(e,t){return e[0]+a.shape[t]+e[1]})),u=o.map((function(e){return e[0]})),l=o.map((function(e,t){return e[0]+a.shape[t]})),d="reflect"===s?0:1,f=n.data.get(a.dataId).values,p=a.shape.length,h=i.wf.computeStrides(a.shape),b=i.wf.sizeFromShape(c),m=c.length,v=i.wf.computeStrides(c),g=i.wf.getTypedArrayFromDType(a.dtype,b),y=0;y<b;y++){for(var O=i.wf.indexToLoc(y,m,v),x=0;x<m;x++)O[x]<u[x]?O[x]=2*u[x]-O[x]-d:O[x]>=l[x]&&(O[x]=2*(l[x]-1)-O[x]+d);O=O.map((function(e,t){return e-u[t]}));var k=i.wf.locToIndex(O,p,h);g[y]=f[k]}return{dataId:n.write(g,c,a.dtype),shape:c,dtype:a.dtype}}},tm=sf((function(e,t){var n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})),nm=Sf(i.Tb,tm),rm={kernelName:i.Tb,backendName:"cpu",kernelFunc:nm};function am(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.logits,o=r.dim,s=a.shape.length,c=o;if(-1===c&&(c=s-1),c!==s-1)throw Error("Softmax along a non-last dimension is not yet supported. "+"Logits was rank ".concat(s," and dim was ").concat(c));var u=i.wf.parseAxisParam([c],a.shape),l=Pb({inputs:{x:a},backend:n,attrs:{reductionIndices:u,keepDims:!1}}),d=i.ud.expandShapeToKeepDim(l.shape,u),f=Af({inputs:{x:l},backend:n,attrs:{shape:d}}),p=_h({inputs:{a:a,b:f},backend:n}),h=wh({inputs:{x:p},backend:n}),b=sh({inputs:{x:h},backend:n,attrs:{axis:u,keepDims:!1}}),m=Af({inputs:{x:b},backend:n,attrs:{shape:d}}),v=Ah({inputs:{a:h,b:m},backend:n});return n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(m),v}var im={kernelName:i.Gc,backendName:"cpu",kernelFunc:am};var om={kernelName:i.Ub,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.logits,o=r.numSamples,s=r.seed,c=r.normalized;Yd(a,"multinomial");for(var u=c?a:am({inputs:{logits:a},backend:n,attrs:{dim:-1}}),l=u.shape[0],d=u.shape[1],f=n.data.get(u.dataId).values,p=[l,o],h=i.wf.makeZerosTypedArray(i.wf.sizeFromShape(p),"int32"),b=0;b<l;++b){var m=b*d,v=new Float32Array(d-1);v[0]=f[m];for(var g=1;g<v.length;++g)v[g]=v[g-1]+f[m+g];for(var y=bd.alea(s.toString()),O=b*o,x=0;x<o;++x){var k=y();h[O+x]=v.length;for(var w=0;w<v.length;w++)if(k<v[w]){h[O+x]=w;break}}}return c||n.disposeIntermediateTensorInfo(u),n.makeTensorInfo(p,"int32",h)}};function sm(e,t,n){var r=i.wf.createScalarValue(-1,n);return rh([],t,r,e,n)}var cm={kernelName:i.Wb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x;Yd(r,"neg");var a=sm(n.data.get(r.dataId).values,r.shape,r.dtype),i=Object(o.a)(a,2),s=i[0],c=i[1];return n.makeTensorInfo(c,r.dtype,s)}},um=i.ie.nonMaxSuppressionV3Impl;var lm={kernelName:i.Xb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.boxes,i=t.scores,o=r.maxOutputSize,s=r.iouThreshold,c=r.scoreThreshold;Yd(a,"NonMaxSuppression");var u=n.data.get(a.dataId).values,l=n.data.get(i.dataId).values,d=um(u,l,o,s,c).selectedIndices;return n.makeTensorInfo([d.length],"int32",new Int32Array(d))}},dm=i.ie.nonMaxSuppressionV4Impl;var fm={kernelName:i.Yb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.boxes,i=t.scores,o=r.maxOutputSize,s=r.iouThreshold,c=r.scoreThreshold,u=r.padToMaxOutputSize;Yd(a,"NonMaxSuppressionPadded");var l=n.data.get(a.dataId).values,d=n.data.get(i.dataId).values,f=dm(l,d,o,s,c,u),p=f.selectedIndices,h=f.validOutputs;return[n.makeTensorInfo([p.length],"int32",new Int32Array(p)),n.makeTensorInfo([],"int32",new Int32Array([h]))]}},pm=i.ie.nonMaxSuppressionV5Impl;var hm={kernelName:i.Zb,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.boxes,i=t.scores,o=r.maxOutputSize,s=r.iouThreshold,c=r.scoreThreshold,u=r.softNmsSigma;Yd(a,"NonMaxSuppressionWithScore");var l=n.data.get(a.dataId).values,d=n.data.get(i.dataId).values,f=pm(l,d,o,s,c,u),p=f.selectedIndices,h=f.selectedScores;return[n.makeTensorInfo([p.length],"int32",new Int32Array(p)),n.makeTensorInfo([h.length],"float32",new Float32Array(h))]}},bm=sf((function(e,t){return e!==t?1:0})),mm=Sf(i.ac,bm,null,"bool"),vm={kernelName:i.ac,backendName:"cpu",kernelFunc:mm};var gm={kernelName:i.bc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.indices,o=r.depth,s=r.onValue,c=r.offValue;Yd(a,"oneHot");var u=i.wf.sizeFromShape(a.shape),l=new Float32Array(u*o);l.fill(c);for(var d=n.data.get(a.dataId).values,f=0;f<u;++f)d[f]>=0&&d[f]<o&&(l[f*o+d[f]]=s);return n.makeTensorInfo([].concat(Object(Vn.a)(a.shape),[o]),"int32",l)}};function ym(e){var t=e.inputs,n=e.backend,r=t.x;if("string"===r.dtype)throw new Error("zerosLike is not supported for string tensors");if("complex64"===r.dtype){var a=xf({inputs:{input:r},backend:n}),i=ym({inputs:{x:a},backend:n}),o=Ep({inputs:{input:r},backend:n}),s=ym({inputs:{x:o},backend:n}),c=gf({inputs:{real:i,imag:s},backend:n});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(s),c}return Wh({backend:n,attrs:{shape:r.shape,value:0,dtype:r.dtype}})}var Om={kernelName:i.kd,backendName:"cpu",kernelFunc:ym};var xm={kernelName:i.cc,backendName:"cpu",kernelFunc:function e(t){var n=t.inputs,r=t.backend,a=n.x;if("string"===a.dtype)throw new Error("onesLike is not supported for string tensors");if("complex64"===a.dtype){var i=xf({inputs:{input:a},backend:r}),o=e({inputs:{x:i},backend:r}),s=Ep({inputs:{input:a},backend:r}),c=ym({inputs:{x:s},backend:r}),u=gf({inputs:{real:o,imag:c},backend:r});return r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(s),r.disposeIntermediateTensorInfo(c),u}return Wh({backend:r,attrs:{shape:a.shape,value:1,dtype:a.dtype}})}};function km(e){var t=e.inputs,n=e.backend,r=e.attrs.axis;if(1===t.length)return Sh({inputs:{input:t[0]},backend:n,attrs:{dim:r}});var a=t[0].shape,o=t[0].dtype;t.forEach((function(e){i.wf.assertShapesMatch(a,e.shape,"All tensors passed to stack must have matching shapes"),i.wf.assert(o===e.dtype,(function(){return"All tensors passed to stack must have matching dtypes"}))}));var s=[],c=Rp({inputs:t.map((function(e){var t=Sh({inputs:{input:e},backend:n,attrs:{dim:r}});return s.push(t),t})),backend:n,attrs:{axis:r}});return s.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),c}var wm={kernelName:i.ec,backendName:"cpu",kernelFunc:km};var jm={kernelName:i.fc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.paddings,s=r.constantValue;Yd(a,"pad");var c=o.map((function(e,t){return e[0]+a.shape[t]+e[1]})),u=o.map((function(e){return e[0]})),l=n.data.get(a.dataId).values,d=i.wf.sizeFromShape(a.shape),f=a.shape.length,p=i.wf.computeStrides(a.shape),h=i.wf.sizeFromShape(c),b=c.length,m=i.wf.computeStrides(c),v=i.wf.getTypedArrayFromDType(a.dtype,h);0!==s&&v.fill(s);for(var g=0;g<d;g++){var y=i.wf.indexToLoc(g,f,p).map((function(e,t){return e+u[t]}));v[i.wf.locToIndex(y,b,m)]=l[g]}return{dataId:n.write(v,c,a.dtype),shape:c,dtype:a.dtype}}},Sm=sf((function(e,t){return Math.pow(e,t)})),Nm=Sf(i.gc,Sm),Im={kernelName:i.gc,backendName:"cpu",kernelFunc:Nm};function Cm(e,t,n,r){for(var a=i.ud.computeOutAndReduceShapes(e,r),s=Object(o.a)(a,2),c=s[0],u=s[1],l=Object(i.vf)(t,"int32"),d=i.wf.makeZerosTypedArray(i.wf.sizeFromShape(c),l),f=i.wf.sizeFromShape(u),p=0;p<d.length;++p){for(var h=p*f,b=1,m=0;m<f;++m)b*=n[h+m];d[p]=b}return{outVals:d,outShape:c,outDtype:l}}var Tm={kernelName:i.ic,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.axis,s=r.keepDims;Yd(a,"prod");var c=a.shape.length,u=i.wf.parseAxisParam(o,a.shape),l=i.ud.getAxesPermutation(u,c),d=u,f=a,p=[];null!=l&&(f=Hf({inputs:{x:a},backend:n,attrs:{perm:l}}),p.push(f),d=i.ud.getInnerMostAxes(d.length,c));var h=n.data.get(f.dataId).values,b=Cm(f.shape,f.dtype,h,d),m=b.outVals,v=b.outShape,g=b.outDtype,y=v;return s&&(y=i.ud.expandShapeToKeepDim(v,u)),p.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),n.makeTensorInfo(y,g,m)}};function Em(e,t,n,r){if(e===t||e<t&&n<0||t<e&&n>1)return i.wf.makeZerosTypedArray(0,r);var a=Math.abs(Math.ceil((t-e)/n)),o=i.wf.makeZerosTypedArray(a,r);t<e&&1===n&&(n=-1),o[0]=e;for(var s=1;s<o.length;s++)o[s]=o[s-1]+n;return o}var Am={kernelName:i.jc,backendName:"cpu",kernelFunc:function(e){var t=e.backend,n=e.attrs,r=n.start,a=n.stop,i=n.dtype,o=Em(r,a,n.step,i);return t.makeTensorInfo([o.length],i,o)}},Rm=Zd(i.mc,(function(e){return 1/e})),Fm={kernelName:i.mc,backendName:"cpu",kernelFunc:Rm};var Dm={kernelName:i.qc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.images,s=r.alignCorners,c=r.halfPixelCenters,u=r.size;Yd(a,"resizeBilinear");for(var l=i.wf.computeStrides(a.shape),d=Object(o.a)(u,2),f=d[0],p=d[1],h=Object(o.a)(a.shape,4),b=h[0],m=h[1],v=h[2],g=h[3],y=n.data.get(a.dataId).values,O=new Float32Array(i.wf.sizeFromShape([b,f,p,g])),x=[s&&f>1?m-1:m,s&&p>1?v-1:v],k=[s&&f>1?f-1:f,s&&p>1?p-1:p],w=0,j=x[0]/k[0],S=x[1]/k[1],N=0;N<b;N++)for(var I=0;I<f;I++){var C=void 0;C=c?j*(I+.5)-.5:j*I;for(var T=Math.max(0,Math.floor(C)),E=C-T,A=Math.min(m-1,Math.ceil(C)),R=N*l[0]+T*l[1],F=N*l[0]+A*l[1],D=0;D<p;D++){var _=void 0;_=c?S*(D+.5)-.5:S*D;for(var M=Math.max(0,Math.floor(_)),z=_-M,L=Math.min(v-1,Math.ceil(_)),P=R+M*l[2],B=F+M*l[2],W=R+L*l[2],U=F+L*l[2],V=0;V<g;V++){var H=y[P+V],G=y[B+V],q=H+(y[W+V]-H)*z,K=q+(G+(y[U+V]-G)*z-q)*E;O[w++]=K}}}return n.makeTensorInfo([b,f,p,g],"float32",O)}};var _m={kernelName:i.rc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.images,s=t.dy,c=r.alignCorners;Yd([s,a],"resizeBilinearGrad");for(var u=i.wf.computeStrides(a.shape),l=Object(o.a)(a.shape,4),d=l[0],f=l[1],p=l[2],h=l[3],b=Object(o.a)(s.shape,3),m=b[1],v=b[2],g=new Float32Array(d*f*p*h),y=[c&&m>1?f-1:f,c&&v>1?p-1:p],O=[c&&m>1?m-1:m,c&&v>1?v-1:v],x=y[0]/O[0],k=y[1]/O[1],w=n.data.get(s.dataId).values,j=0,S=0;S<d;S++)for(var N=S*u[0],I=0;I<m;I++)for(var C=I*x,T=Math.floor(C),E=Math.min(Math.ceil(C),f-1),A=N+T*u[1],R=N+E*u[1],F=C-T,D=1-F,_=0;_<v;_++)for(var M=_*k,z=Math.floor(M),L=Math.min(Math.ceil(M),p-1),P=M-z,B=1-P,W=A+z*u[2],U=A+L*u[2],V=R+z*u[2],H=R+L*u[2],G=D*B,q=D*P,K=F*B,X=F*P,Y=0;Y<h;Y++){var $=w[j++];g[W+Y]+=$*G,g[U+Y]+=$*q,g[V+Y]+=$*K,g[H+Y]+=$*X}return n.makeTensorInfo([d,p,f,h],"float32",g)}};var Mm={kernelName:i.sc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.images,s=r.alignCorners,c=r.halfPixelCenters,u=r.size;Yd(a,"resizeNearestNeighbor");for(var l=i.wf.computeStrides(a.shape),d=Object(o.a)(u,2),f=d[0],p=d[1],h=Object(o.a)(a.shape,4),b=h[0],m=h[1],v=h[2],g=h[3],y=n.data.get(a.dataId).values,O=new Float32Array(b*f*p*g),x=[s&&f>1?m-1:m,s&&p>1?v-1:v],k=[s&&f>1?f-1:f,s&&p>1?p-1:p],w=x[0]/k[0],j=x[1]/k[1],S=0,N=0;N<b;N++)for(var I=N*l[0],C=0;C<f;C++){var T=c?w*(C+.5):w*C,E=Math.min(m-1,s?Math.round(T):Math.floor(T));c&&(E=Math.max(0,E));for(var A=I+E*l[1],R=0;R<p;R++){var F=c?j*(R+.5):j*R,D=Math.min(v-1,s?Math.round(F):Math.floor(F));c&&(D=Math.max(0,D));for(var _=A+D*l[2],M=0;M<g;M++){var z=y[_+M];O[S++]=z}}}return n.makeTensorInfo([b,f,p,g],a.dtype,O)}};var zm={kernelName:i.tc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.images,s=t.dy,c=r.alignCorners;Yd([s,a],"resizeNearestNeighborGrad");for(var u=i.wf.computeStrides(a.shape),l=i.wf.computeStrides(s.shape),d=Object(o.a)(a.shape,4),f=d[0],p=d[1],h=d[2],b=d[3],m=Object(o.a)(s.shape,3),v=m[1],g=m[2],y=new Float32Array(f*p*h*b),O=n.data.get(s.dataId).values,x=[c&&v>1?p-1:p,c&&g>1?h-1:h],k=[c&&v>1?v-1:v,c&&g>1?g-1:g],w=x[0]/k[0],j=x[1]/k[1],S=1/w,N=1/j,I=2*Math.ceil(S)+2,C=2*Math.ceil(N)+2,T=0;T<f;T++)for(var E=T*u[0],A=0;A<p;A++)for(var R=E+A*u[1],F=Math.floor(A*S),D=Math.floor(F-I/2),_=0;_<h;_++)for(var M=R+_*u[2],z=Math.floor(_*N),L=Math.floor(z-C/2),P=0;P<b;P++){for(var B=0,W=0;W<I;W++){var U=W+D;if(!(U<0||U>=v)){var V=E+U*l[1],H=U*w;if(A===Math.min(p-1,c?Math.round(H):Math.floor(H)))for(var G=0;G<C;G++){var q=G+L;if(!(q<0||q>=g)){var K=V+q*l[2],X=q*j;_===Math.min(h-1,c?Math.round(X):Math.floor(X))&&(B+=O[K+P])}}}}y[M+P]=B}return n.makeTensorInfo(a.shape,a.dtype,y)}};var Lm={kernelName:i.uc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.dims;Yd(a,"reverse");var s=a.shape.length,c=i.wf.parseAxisParam(o,a.shape);if(0===s)return nf({inputs:{x:a},backend:n});for(var u=new i.cd(a.shape,a.dtype),l=n.bufferSync(a),d=function(e){var t=u.indexToLoc(e),n=t.slice();c.forEach((function(e){return n[e]=a.shape[e]-1-n[e]})),u.set.apply(u,[l.get.apply(l,Object(Vn.a)(n))].concat(Object(Vn.a)(t)))},f=0;f<u.size;f++)d(f);return n.makeTensorInfo(u.shape,u.dtype,u.values)}},Pm={kernelName:i.vc,backendName:"cpu",kernelFunc:function(e){for(var t=e.inputs,n=e.attrs,r=e.backend,a=t.image,s=n.radians,c=n.fillValue,u=n.center,l=r,d=i.wf.getTypedArrayFromDType(a.dtype,i.wf.sizeFromShape(a.shape)),f=Object(o.a)(a.shape,4),p=f[0],h=f[1],b=f[2],m=f[3],v=i.ud.getImageCenter(u,h,b),g=Object(o.a)(v,2),y=g[0],O=g[1],x=Math.sin(s),k=Math.cos(s),w=l.data.get(a.dataId).values,j=0;j<p;j++)for(var S=j*b*h*m,N=0;N<h;N++)for(var I=N*(b*m),C=0;C<b;C++)for(var T=C*m,E=0;E<m;E++){var A=[p,N,C,E],R=A[2],F=A[1],D=(R-y)*k-(F-O)*x,_=(R-y)*x+(F-O)*k;D=Math.round(D+y),_=Math.round(_+O);var M=c;if("number"!==typeof c&&(M=3===E?255:c[E]),D>=0&&D<b&&_>=0&&_<h)M=w[S+_*(b*m)+D*m+E];d[S+I+T+E]=M}return{dataId:l.write(d,a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}},Bm=Zd(i.wc,(function(e){var t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2===0?t:t+1})),Wm={kernelName:i.wc,backendName:"cpu",kernelFunc:Bm},Um=kp((function(e){return 1/Math.sqrt(e)})),Vm=Jd(i.xc,Um),Hm={kernelName:i.xc,backendName:"cpu",kernelFunc:Vm};function Gm(e,t,n,r,a,o,s,c,u,l){var d=[r/a,a],f=e.values,p=t.values;if(0===r)return Object(i.zd)(n,t.dtype);var h=Object(i.zd)(d,t.dtype);h.values.fill(u);for(var b=0;b<o;b++){for(var m=[],v=0,g=0;g<s;g++){var y=f[b*s+g];m.push(y),v+=y*c[g]}if(v<0||v>=r/a)throw new Error("Invalid indices: ".concat(m," does not index into ").concat(n));for(var O=0;O<a;O++)l?h.values[v*a+O]+=p[b*a+O]:h.values[v*a+O]=0===t.rank?p[0]:p[b*a+O]}return h}var qm={kernelName:i.yc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.indices,o=t.updates,s=r.shape,c=i.ud.calculateShapes(o,a,s),u=c.sliceRank,l=c.numUpdates,d=c.sliceSize,f=c.strides,p=c.outputSize,h=Gm(n.bufferSync(a),n.bufferSync(o),s,p,d,l,u,f,0,!0);return n.makeTensorInfo(s,h.dtype,h.values)}};var Km={kernelName:i.zc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.condition,a=t.t,o=t.e;Yd([r,a,o],"select");for(var s=r.shape.length,c=n.data.get(r.dataId).values,u=n.data.get(a.dataId).values,l=n.data.get(o.dataId).values,d=Object(i.vf)(a.dtype,o.dtype),f=i.wf.makeZerosTypedArray(i.wf.sizeFromShape(a.shape),d),p=0,h=0===s||s>1||1===a.shape.length?1:i.wf.sizeFromShape(a.shape.slice(1)),b=0;b<c.length;b++)for(var m=0;m<h;m++)1===c[b]?f[p++]=u[b]:f[p++]=l[b];return n.makeTensorInfo(a.shape,d,f)}},Xm=i.ud.SELU_SCALEALPHA,Ym=i.ud.SELU_SCALE,$m=Zd(i.Ac,(function(e){return e>=0?Ym*e:Xm*(Math.exp(e)-1)})),Qm={kernelName:i.Ac,backendName:"cpu",kernelFunc:$m},Zm=Zd(i.Cc,(function(e){return e<0?-1:e>0?1:0})),Jm={kernelName:i.Cc,backendName:"cpu",kernelFunc:Zm},ev=Zd(i.Dc,(function(e){return Math.sin(e)})),tv={kernelName:i.Dc,backendName:"cpu",kernelFunc:ev},nv=Zd(i.Ec,(function(e){return Math.sinh(e)})),rv={kernelName:i.Ec,backendName:"cpu",kernelFunc:nv},av=Math.log(1.1920928955078125e-7)+2,iv=Zd(i.Hc,(function(e){var t=e>-av,n=e<av,r=Math.exp(e);return n?r:t?e:Math.log(1+r)})),ov={kernelName:i.Hc,backendName:"cpu",kernelFunc:iv};var sv={kernelName:i.Ic,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.blockShape,s=r.paddings;Yd([a],"spaceToBatchND");var c=i.wf.sizeFromShape(o),u=[[0,0]];u.push.apply(u,Object(Vn.a)(s));for(var l=1+o.length;l<a.shape.length;++l)u.push([0,0]);var d=jm.kernelFunc({inputs:{x:a},backend:n,attrs:{paddings:u,constantValue:0}}),f=i.ud.getReshaped(d.shape,o,c,!1),p=i.ud.getPermuted(f.length,o.length,!1),h=i.ud.getReshapedPermuted(d.shape,o,c,!1),b=Af({inputs:{x:d},backend:n,attrs:{shape:f}}),m=Hf({inputs:{x:b},backend:n,attrs:{perm:p}}),v=Af({inputs:{x:m},backend:n,attrs:{shape:h}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(m),v}};function cv(e,t,n,r,a,o,s){var c=t[0],u=o[0],l=new Array(u),d=new Array(c),f=t[1];if(0===u){if(0!==c)throw new Error("Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ".concat(c));return[i.wf.getArrayFromDType(n,0),[0,f],i.wf.getArrayFromDType(a,0),l,d]}for(var p=!0,h=0,b=new Array(u).fill(0),m=0;m<c;++m){var v=e[m*f];if(v<0)throw new Error("indices(".concat(m,", 0) is invalid: ").concat(v," < 0"));if(v>=u)throw new Error("indices(".concat(m,", 0) is invalid: ").concat(v," >= ").concat(u));++b[v],p=p&&v>=h,h=v}for(var g=!0,y=0;y<u;++y){var O=0===b[y];l[y]=O,g=g&&!O,b[y]=Math.max(b[y],1),y>0&&(b[y]+=b[y-1])}if(g&&p){for(var x=e,k=r,w=0;w<c;++w)d[w]=w;return[x,[c,f],k,l,d]}for(var j=b[u-1],S=i.wf.getArrayFromDType(n,j*f),N=i.wf.getArrayFromDType(a,j),I=new Array(u).fill(0),C=0;C<c;++C){var T=e[C*f],E=I[T],A=(0===T?0:b[T-1])+E;I[T]++;for(var R=0;R<f;++R)S[A*f+R]=e[C*f+R];N[A]=r[C],d[C]=A}for(var F=0;F<u;++F){if(0===I[F]){var D=0===F?0:b[F-1];S[D*f+0]=F;for(var _=1;_<f;++_)S[D*f+_]=0;N[D]=s}}return[S,[j,f],N,l,d]}var uv={kernelName:i.Jc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.indices,a=t.values,i=t.denseShape,s=t.defaultValue;if(1!==i.shape.length)throw new Error("Dense shape must be a vector, saw:\n ".concat(i.shape));if(2!==r.shape.length)throw new Error("Indices must be a matrix, saw:\n ".concat(r.shape));if(1!==a.shape.length)throw new Error("Values must be a vector, saw:\n ".concat(a.shape));if(0!==s.shape.length)throw new Error("Default value must be a scalar, saw:\n ".concat(s.shape));var c=n.data.get(r.dataId).values,u=n.data.get(a.dataId).values,l=n.data.get(i.dataId).values,d=n.data.get(s.dataId).values[0],f=cv(c,r.shape,r.dtype,u,a.dtype,l,d),p=Object(o.a)(f,5),h=p[0],b=p[1],m=p[2],v=p[3],g=p[4];return[n.makeTensorInfo(b,r.dtype,h),n.makeTensorInfo([b[0]],a.dtype,m),n.makeTensorInfo([v.length],"bool",new Uint8Array(v.map((function(e){return Number(e)})))),n.makeTensorInfo([g.length],r.dtype,new Int32Array(g))]}};function lv(e,t,n,r,a){for(var o=i.wf.sizeFromShape(r),s=t[0],c=a.length,u=[],l=1,d=-1,f=0;f<c;++f){var p=a[f];if(-1===p){if(-1!==d)throw new Error("only one output dimension may be -1, not both ".concat(d," and ").concat(f));d=f,u.push(1)}else{if(p<0)throw new Error("size ".concat(f," must be non-negative, not ").concat(p));l*=p,u.push(p)}}if(-1!==d){if(l<=0)throw new Error("reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero");var h=Math.trunc(o/l);if(l*h!==o)throw new Error("Input to reshape is a SparseTensor with ".concat(o,"\n dense values, but the requested shape requires a multiple of ").concat(l,". inputShape=").concat(r," outputShape= ").concat(u));u[d]=h}var b=i.wf.sizeFromShape(u);if(b!==o)throw new Error("Input to reshape is a tensor with ".concat(o," dense values, but the requested shape has ").concat(b,". inputShape=").concat(r," outputShape=").concat(u));var m=r.length,v=[];if(m>0){v[m-1]=1;for(var g=m-2;g>=0;--g)v[g]=v[g+1]*r[g+1]}var y=[];if(c>0){y[c-1]=1;for(var O=c-2;O>=0;--O)y[O]=y[O+1]*u[O+1]}for(var x=i.wf.getArrayFromDType(n,s*c),k=0;k<s;++k){for(var w=0,j=0;j<m;++j)w+=e[k*m+j]*v[j];for(var S=0;S<c;++S)x[k*c+S]=Math.trunc(w/y[S]),w%=y[S]}return[x,[s,c],u]}var dv={kernelName:i.Kc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.inputIndices,a=t.inputShape,i=t.newShape;if(2!==r.shape.length)throw new Error("Input indices should be a matrix but received shape\n ".concat(r.shape));if(1!==a.shape.length)throw new Error("Input shape should be a vector but received shape\n ".concat(a.shape));if(1!==i.shape.length)throw new Error("Target shape should be a vector but received shape ".concat(i.shape));var s=Array.from(n.data.get(a.dataId).values),c=n.data.get(r.dataId).values,u=Array.from(n.data.get(i.dataId).values),l=lv(c,r.shape,r.dtype,s,u),d=Object(o.a)(l,3),f=d[0],p=d[1],h=d[2];return[n.makeTensorInfo(p,r.dtype,f),n.makeTensorInfo([h.length],i.dtype,new Int32Array(h))]}};function fv(e,t,n,r,a){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=r.length;if(c!==a.length)throw new Error("segmentIds and indices should have same size.");var u=[t[0],e.length/t[0]],l=u[1],d=c>0?a[c-1]+1:0,f=d;if(f<0)throw new Error("segment ids must be >= 0");var p=t.slice();p[0]=f;var h=p.reduce((function(e,t){return e*t}),1),b=i.wf.getArrayFromDType(n,h);if(0===c)return f>0&&b.fill(s),[b,p];if(f<=0)throw new Error("segment ids must be >= 0");for(var m=0,v=1,g=0,y=a[m];;){var O=0;if(v<c){if(y===(O=a[v])){++v;continue}if(y>=O)throw new Error("segment ids are not increasing")}if(y<0||y>=f)throw new Error("Segment id ".concat(y," out of range [0, ").concat(f,"), possibly because segmentIds input is not sorted."));y>g&&b.fill(s,g*l,y*l);for(var x=m;x<v;++x){var k=r[x];if(k<0||k>=u[0])throw new Error("Bad: indices[".concat(x,"] == ").concat(r[x]," out of range [0, ").concat(u[0],")"));for(var w=0;w<l;w++)b[y*l+w]+=e[k*l+w]}if(o)for(var j=0;j<l;j++)b[y*l+j]/=v-m;if(m=v,g=y+1,y=O,++v>c)break}return g<f&&b.fill(s,g*l,f*l),[b,p]}var pv={kernelName:i.Lc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.data,a=t.indices,i=t.segmentIds;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error("Indices should be a vector but received shape\n ".concat(a.shape));if(1!==i.shape.length)throw new Error("Segment ids should be a vector but received shape\n ".concat(i.shape));var s=n.data.get(r.dataId).values,c=n.data.get(a.dataId).values,u=n.data.get(i.dataId).values,l=fv(s,r.shape,r.dtype,c,u,!0),d=Object(o.a)(l,2),f=d[0],p=d[1];return n.makeTensorInfo(p,r.dtype,f)}};var hv={kernelName:i.Mc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.data,a=t.indices,i=t.segmentIds;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error("Indices should be a vector but received shape\n ".concat(a.shape));if(1!==i.shape.length)throw new Error("Segment ids should be a vector but received shape\n ".concat(i.shape));var s=n.data.get(r.dataId).values,c=n.data.get(a.dataId).values,u=n.data.get(i.dataId).values,l=fv(s,r.shape,r.dtype,c,u),d=Object(o.a)(l,2),f=d[0],p=d[1];return n.makeTensorInfo(p,r.dtype,f)}};var bv={kernelName:i.Nc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.sparseIndices,o=t.sparseValues,s=t.defaultValue,c=r.outputShape,u=i.ud.calculateShapes(o,a,c),l=u.sliceRank,d=u.numUpdates,f=u.sliceSize,p=u.strides,h=u.outputSize,b=Gm(n.bufferSync(a),n.bufferSync(o),c,h,f,d,l,p,n.data.get(s.dataId).values[0],!1);return n.makeTensorInfo(c,b.dtype,b.values)}};var mv={kernelName:i.Oc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.numOrSizeSplits,s=r.axis,c=i.wf.parseAxisParam(s,a.shape)[0],u=i.ud.prepareSplitSize(a,o,c),l=new Array(a.shape.length).fill(0),d=a.shape.slice();return u.map((function(e){var t=Object(Vn.a)(d);t[c]=e;var r=mp({inputs:{x:a},backend:n,attrs:{begin:l,size:t}});return l[c]+=e,r}))}},vv=Zd(i.Pc,(function(e){return Math.sqrt(e)})),gv={kernelName:i.Pc,backendName:"cpu",kernelFunc:vv},yv={kernelName:i.Qc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x,a=n;Yd(r,"square");for(var i=a.data.get(r.dataId).values,o=new Float32Array(i.length),s=0;s<i.length;++s){var c=i[s];o[s]=c*c}return{dataId:a.write(o,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},Ov=sf((function(e,t){var n=e-t;return n*n})),xv=Sf(i.Rc,Ov),kv={kernelName:i.Rc,backendName:"cpu",kernelFunc:xv},wv=Zd(i.Sc,(function(e,t){var n=t;return isNaN(e)?NaN:e>0?1:n.alpha})),jv={kernelName:i.Sc,backendName:"cpu",kernelFunc:wv};function Sv(e,t,n,r){for(var a=Object(i.zd)(e,t.dtype),o=0;o<a.size;o++){for(var s=a.indexToLoc(o),c=new Array(s.length),u=0;u<c.length;u++)c[u]=s[u]*n[u]+r[u];a.set.apply(a,[t.get.apply(t,c)].concat(Object(Vn.a)(s)))}return a}var Nv={kernelName:i.Tc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.begin,s=r.end,c=r.strides,u=r.beginMask,l=r.endMask,d=r.ellipsisMask,f=r.newAxisMask,p=r.shrinkAxisMask;Yd(a,"stridedSlice");var h,b=i.af.sliceInfo(a.shape,o,s,c,u,l,d,f,p),m=b.nonStrided,v=b.$begin,g=b.$strides,y=b.size,O=b.newShape,x=b.outShape,k=Af({inputs:{x:a},backend:n,attrs:{shape:O}});if(m){var w=mp({inputs:{x:k},backend:n,attrs:{begin:v,size:y}});h=Af({inputs:{x:w},backend:n,attrs:{shape:x}}),n.disposeIntermediateTensorInfo(w)}else if(x.some((function(e){return 0===e})))h=n.makeTensorInfo(x,a.dtype,[]);else{var j=Sv(x,n.bufferSync(k),g,v);h=n.makeTensorInfo(j.shape,j.dtype,j.values)}var S=Af({inputs:{x:h},backend:n,attrs:{shape:x}});return n.disposeIntermediateTensorInfo(k),n.disposeIntermediateTensorInfo(h),S}},Iv=function(){function e(t,n,r,a,o,s){Object(Yr.a)(this,e),this.separator=i.wf.encodeString(t),this.nGramWidths=n,this.leftPad=i.wf.encodeString(r),this.rightPad=i.wf.encodeString(a),this.padWidth=o,this.preserveShort=s}return Object($r.a)(e,[{key:"getPadWidth",value:function(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}},{key:"getNumNGrams",value:function(e,t){var n=this.getPadWidth(t);return Math.max(0,e+2*n-t+1)}},{key:"createNGrams",value:function(e,t,n,r,a,i){for(var o=this,s=function(s){var c=o.getPadWidth(i),u=Math.max(0,c-s),l=Math.max(0,c-(a-(s+1))),d=i-(u+l),f=t+(u>0?0:s-c),p=0;p+=u*o.leftPad.length;for(var h=0;h<d;++h)p+=e[f+h].length;p+=l*o.rightPad.length,p+=(u+l+d-1)*o.separator.length,n[r+s]=new Uint8Array(p);for(var b=n[r+s],m=0,v=function(e){return e.forEach((function(e){return b[m++]=e}))},g=0;g<u;++g)v(o.leftPad),v(o.separator);for(var y=0;y<d-1;++y)v(e[f+y]),v(o.separator);if(d>0){v(e[f+d-1]);for(var O=0;O<l;++O)v(o.separator),v(o.rightPad)}else{for(var x=0;x<l-1;++x)v(o.rightPad),v(o.separator);v(o.rightPad)}},c=0;c<a;++c)s(c)}},{key:"compute",value:function(e,t){var n=this,r=e.length,a=t.length;if(a>0){var o=t[0];if(0!==o)throw new Error("First split value must be 0, got ".concat(o));for(var s=1;s<a;++s){var c=t[s]>=o;if(!(c=c&&t[s]<=r))throw new Error("Invalid split value ".concat(t[s],", must be in [").concat(o,", ").concat(r,"]"));o=t[s]}if(o!==r)throw new Error("Last split value must be data size. Expected ".concat(r,", got ").concat(o))}var u=a-1,l=i.wf.getArrayFromDType("int32",a);if(0===r||0===a){for(var d=new Array(r),f=0;f<=u;++f)l[f]=0;return[d,l]}l[0]=0;for(var p=function(e){var r=t[e]-t[e-1],a=0;n.nGramWidths.forEach((function(e){a+=n.getNumNGrams(r,e)})),n.preserveShort&&r>0&&0===a&&(a=1),l[e]=l[e-1]+a},h=1;h<=u;++h)p(h);for(var b=new Array(l[u]),m=function(r){var a=t[r],i=l[r];if(n.nGramWidths.forEach((function(o){var s=t[r+1]-t[r],c=n.getNumNGrams(s,o);n.createNGrams(e,a,b,i,c,o),i+=c})),n.preserveShort&&i===l[r]){var o=t[r+1]-t[r];if(0===o)return"continue";var s=o+2*n.padWidth;n.createNGrams(e,a,b,i,1,s)}},v=0;v<u;++v)m(v);return[b,l]}}]),e}();function Cv(e,t,n,r,a,i,o,s){return new Iv(n,r,a,i,o,s).compute(e,t)}var Tv={kernelName:i.Uc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=r.separator,i=r.nGramWidths,s=r.leftPad,c=r.rightPad,u=r.padWidth,l=r.preserveShortSequences,d=t.data,f=t.dataSplits,p=Cv(n.data.get(d.dataId).values,n.data.get(f.dataId).values,a,i,s,c,u,l),h=Object(o.a)(p,2),b=h[0],m=h[1];return[n.makeTensorInfo([b.length],"string",b),n.makeTensorInfo(f.shape,"int32",m)]}};function Ev(e,t,n){if(!e.length)return[];if(0===t.length){for(var r=new Array(e.length),a=0;a<e.length;++a)r[a]=e.subarray(a,a+1);return r}if(1===t.length){for(var i=t[0],o=[],s=e.indexOf(i);-1!==s;){var c=e.subarray(0,s);n&&0===c.length||o.push(c),s=(e=e.subarray(s+1)).indexOf(i)}return n&&0===e.length||o.push(e),o}for(var u=[],l=0,d=0;d<e.length+1;d++)if(d===e.length||-1!==t.indexOf(e[d])){var f=e.subarray(l,d);n&&0===f.length||u.push(f),l=d+1}return u}function Av(e,t,n){for(var r=e.length,a=[],o=0,s=0,c=new Array(r),u=0;u<r;++u){var l=Ev(e[u],t,n),d=l.length;c[u]=d,o+=d,s=Math.max(s,d),a.push.apply(a,Object(Vn.a)(l))}for(var f=i.wf.getArrayFromDType("int32",2*o),p=new Array(o),h=[r,s],b=0,m=0;m<r;++m)for(var v=0;v<c[m];++v)f[2*b]=m,f[2*b+1]=v,p[b]=a[b],++b;return[f,p,h]}var Rv={kernelName:i.Vc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs.skipEmpty,a=t.input,i=t.delimiter;if("string"!==a.dtype)throw new Error("Input must be of datatype string");if(1!==a.shape.length)throw new Error("Input must be a vector, got shape: ".concat(a.shape));if(0!==i.shape.length)throw new Error("Delimiter must be a scalar, got shape: ".concat(i.shape));var s=Av(n.data.get(a.dataId).values,n.data.get(i.dataId).values[0],r),c=Object(o.a)(s,3),u=c[0],l=c[1],d=c[2],f=l.length;return[n.makeTensorInfo([f,2],"int32",u),n.makeTensorInfo([f],"string",l),n.makeTensorInfo([2],"int32",new Int32Array(d))]}};function Fv(e,t){for(var n=i.wf.getArrayFromDType("int32",e.length),r=0;r<e.length;++r)n[r]=i.wf.fingerPrint64(e[r]).modulo(t).getLowBitsUnsigned();return n}var Dv={kernelName:i.Wc,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs.numBuckets,a=t.input;if("string"!==a.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");var i=Fv(n.data.get(a.dataId).values,r);return n.makeTensorInfo(a.shape,"int32",i)}},_v=Zd(i.Zc,(function(e){return Math.tan(e)})),Mv={kernelName:i.Zc,backendName:"cpu",kernelFunc:_v},zv=Zd(i.ad,(function(e){return Math.tanh(e)})),Lv={kernelName:i.ad,backendName:"cpu",kernelFunc:zv};function Pv(e,t){for(var n=new Array(e.rank),r=0;r<n.length;r++)n[r]=e.shape[r]*t[r];for(var a=Object(i.zd)(n,e.dtype),o=0;o<a.values.length;++o){for(var s=a.indexToLoc(o),c=new Array(e.rank),u=0;u<c.length;u++)c[u]=s[u]%e.shape[u];var l=e.locToIndex(c);a.values[o]=e.values[l]}return a}var Bv={kernelName:i.dd,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=r.reps;Yd(a,"tile");var o=Pv(n.bufferSync(a),i);return n.makeTensorInfo(o.shape,o.dtype,o.values)}},Wv=function(e,t){var n=t.value-e.value;return 0===n?e.index-t.index:n};function Uv(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length-1;r>n;){if(r-n>600){var a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(a-c)/a)*Math.sign(o-a/2),l=Math.max(n,Math.floor(t-o*c/a+u)),d=Math.min(r,Math.floor(t+(a-o)*c/a+u));Uv(e,t,l,d)}var f=e[t],p=n,h=r;for(i.wf.swap(e,n,t),Wv(e[r],f)>0&&i.wf.swap(e,n,r);p<h;){for(i.wf.swap(e,p,h),p++,h--;Wv(e[p],f)<0;)p+=1;for(;Wv(e[h],f)>0;)h-=1}0===Wv(e[n],f)?i.wf.swap(e,n,h):(h+=1,i.wf.swap(e,h,r)),h<=t&&(n=h+1),t<=h&&(r=h-1)}}function Vv(e,t,n,r,a){for(var o=t[t.length-1],s=e.length/o,c=o,u=i.wf.getTypedArrayFromDType(n,s*r),l=i.wf.getTypedArrayFromDType("int32",s*r),d=function(t){var n=t*c,i=e.subarray(n,n+c),o=new Array(i.length);i.forEach((function(e,t){return o[t]={value:e,index:t}})),r<o.length&&(Uv(o,r),o=o.slice(0,r)),a&&o.sort(Wv);for(var s=t*r,d=u.subarray(s,s+r),f=l.subarray(s,s+r),p=0;p<r;p++)d[p]=o[p].value,f[p]=o[p].index},f=0;f<s;f++)d(f);var p=t.slice();return p[p.length-1]=r,[Object(i.zd)(p,n,u),Object(i.zd)(p,"int32",l)]}var Hv={kernelName:i.ed,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=r.k,s=r.sorted;Yd(a,"topk");var c=Vv(n.data.get(a.dataId).values,a.shape,a.dtype,i,s),u=Object(o.a)(c,2),l=u[0],d=u[1];return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(d.shape,d.dtype,d.values)]}};var Gv={kernelName:i.fd,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,a=t.image,s=t.transforms,c=n.interpolation,u=n.fillMode,l=n.fillValue,d=n.outputShape,f=Object(o.a)(a.shape,4),p=f[0],h=f[1],b=f[2],m=f[3],v=null!=d?d:[h,b],g=Object(o.a)(v,2),y=g[0],O=g[1],x=[p,y,O,m],k=i.wf.computeStrides(a.shape),w=k[0],j=k[1],S=k[2],N=i.wf.getTypedArrayFromDType(a.dtype,i.wf.sizeFromShape(x));N.fill(l);for(var I=r.data.get(a.dataId).values,C=r.data.get(s.dataId).values,T=0;T<p;++T){for(var E=1===s.shape[0]?C:C.subarray(8*T,8*T+8),A=0;A<y;++A)for(var R=0;R<O;++R)for(var F=0;F<m;++F){var D=void 0,_=E[6]*R+E[7]*A+1;if(0!==_){var M=(E[0]*R+E[1]*A+E[2])/_,z=(E[3]*R+E[4]*A+E[5])/_,L=qv(M,b,u),P=qv(z,h,u);switch(c){case"nearest":D=Xv(I,h,b,w,j,S,T,P,L,F,l);break;case"bilinear":D=Yv(I,h,b,w,j,S,T,P,L,F,l);break;default:throw new Error("Error in Transform: Expect 'nearest' or "+"'bilinear', but got ".concat(c))}N[T*w+A*j+R*S+F]=D}}return r.makeTensorInfo(x,a.dtype,N)}return{dataId:r.write(N,x,a.dtype),shape:a.shape,dtype:a.dtype}}};function qv(e,t,n){switch(n){case"reflect":return function(e,t){var n=e;if(n<0)if(t<=1)n=0;else{var r=2*t;n<r&&(n=r*Math.trunc(-n/r)+n),n=n<-t?n+r:-n-1}else if(n>t-1)if(t<=1)n=0;else{var a=2*t;(n-=a*Math.trunc(n/a))>=t&&(n=a-n-1)}return i.wf.clamp(0,n,t-1)}(e,t);case"wrap":return function(e,t){var n=e;if(n<0)if(t<=1)n=0;else{var r=t-1;n+=t*(Math.trunc(-n/r)+1)}else if(n>t-1)if(t<=1)n=0;else{var a=t-1;n-=t*Math.trunc(n/a)}return i.wf.clamp(0,n,t-1)}(e,t);case"nearest":return function(e,t){return i.wf.clamp(0,e,t-1)}(e,t);case"constant":default:return function(e,t){return e}(e)}}function Kv(e,t,n,r,a,i,o,s,c,u,l){return 0<=s&&s<t&&0<=c&&c<n?e[o*r+s*a+c*i+u]:l}function Xv(e,t,n,r,a,i,o,s,c,u,l){return Kv(e,t,n,r,a,i,o,Math.round(s),Math.round(c),u,l)}function Yv(e,t,n,r,a,i,o,s,c,u,l){var d=Math.floor(s),f=Math.floor(c),p=d+1,h=f+1;return(p-s)*((h-c)*Kv(e,t,n,r,a,i,o,d,f,u,l)+(c-f)*Kv(e,t,n,r,a,i,o,d,h,u,l))+(s-d)*((h-c)*Kv(e,t,n,r,a,i,o,p,f,u,l)+(c-f)*Kv(e,t,n,r,a,i,o,p,h,u,l))}function $v(e,t,n,r){for(var a=i.wf.parseAxisParam(t,n)[0],o=[1,n[0],1],s=0;s<a;s++)o[0]*=n[s];o[1]=n[a];for(var c=a+1;c<n.length;c++)o[2]*=n[c];for(var u={},l=new Int32Array(n[a]),d=new i.cd(o,r,e),f=[],p=1===o[0]&&1===o[2],h=0;h<n[a];h++){var b=void 0;if(p)b=e[h].toString();else{for(var m=[],v=0;v<o[0];v++)for(var g=0;g<o[2];g++)m.push(d.get(v,h,g));b=m.join(",")}if(void 0!==u[b])l[h]=u[b];else{var y=Object.keys(u).length;u[b]=y,l[h]=y,f.push(h)}}var O=o.slice();O[1]=Object.keys(u).length;var x=new i.cd(O,r);f.forEach((function(e,t){for(var n=0;n<o[0];n++)for(var r=0;r<o[2];r++)x.set(d.get(n,e,r),n,t,r)}));var k=n.slice();return k[a]=O[1],{outputValues:x.values,outputShape:k,indices:l}}var Qv={kernelName:i.hd,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,a=n.axis,i=t.x;Yd(i,"unique");var o=$v(r.data.get(i.dataId).values,a,i.shape,i.dtype),s=o.outputValues,c=o.outputShape,u=o.indices;return[r.makeTensorInfo(c,i.dtype,s),r.makeTensorInfo([u.length],"int32",u)]}};var Zv={kernelName:i.id,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.value,i=r.axis;i<0&&(i+=a.shape.length);for(var o=a.shape.length,s=a.shape[i],c=new Array(o-1),u=0,l=0;l<o;l++)l!==i&&(c[u++]=a.shape[l]);var d=new Array(o).fill(0),f=a.shape.slice();f[i]=1;for(var p=new Array(s),h=0;h<p.length;h++){d[i]=h;var b=mp({inputs:{x:a},backend:n,attrs:{begin:d,size:f}});p[h]=Af({inputs:{x:b},backend:n,attrs:{shape:c}}),n.disposeIntermediateTensorInfo(b)}return p}};for(var Jv={kernelName:i.jd,backendName:"cpu",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.segmentIds,s=r.numSegments;Yd(a,"unsortedSegmentSum");for(var c=[],u=[],l=a.shape.length-o.shape.length,d=o,f=0;f<l;++f){var p=Sh({inputs:{input:d},backend:n,attrs:{dim:f+1}});d=p,u.push(p)}for(var h=0;h<s;++h){var b=i.wf.createScalarValue(h,"int32"),m=n.makeTensorInfo([],"int32",b),v=fh({inputs:{a:m,b:d},backend:n}),g=wf({inputs:{x:v},backend:n,attrs:{dtype:"float32"}}),y=ih({inputs:{a:g,b:a},backend:n}),O=sh({inputs:{x:y},backend:n,attrs:{axis:0,keepDims:!1}});c.push(O),u.push(m),u.push(v),u.push(g),u.push(y),u.push(O)}var x=km({inputs:c,backend:n,attrs:{axis:0}});return u.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),x}},eg=0,tg=[_f,zf,Pf,Wf,Ef,Uf,qf,Kf,Xf,Yf,Qf,Jf,tp,ap,op,lp,dp,fp,pp,Df,hp,gp,xp,jf,Sp,Ip,yf,Cp,Fp,Mp,zp,_p,Pp,Bp,Lp,Up,Hp,Gp,qp,Kp,Xp,$p,Qp,Zp,Jp,eh,nh,th,Rh,uh,tf,lh,ph,xh,jh,Nh,Th,Bh,Uh,Vh,qh,Yh,$h,Qh,Jh,tb,ab,sb,rf,cb,Ap,lb,fb,hb,of,vb,Ob,kb,Sb,Ib,Eb,Rb,_b,Mb,zb,Vb,Hb,Gb,qb,Kb,Xb,Bb,Yb,$b,Jb,em,rm,om,oh,cm,lm,fm,hm,vm,gm,xm,wm,jm,Im,lf,Tm,Am,kf,Fm,ff,hf,Rf,Dm,_m,Mm,zm,Lm,Pm,Wm,Hm,qm,Km,Qm,mf,Jm,tv,rv,vp,im,ov,sv,uv,dv,pv,hv,bv,mv,gv,yv,kv,jv,Nv,Tv,Rv,Dv,Mh,ch,Mv,Lv,Bv,Hv,Gf,Gv,Qv,Zv,Jv,Om];eg<tg.length;eg++){var ng=tg[eg];Object(i.Le)(ng)}var rg,ag,ig,og={},sg={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function cg(e){if(!(e in og)){var t=function(e){if(1!==e&&2!==e)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");var t=function(e){if("undefined"!==typeof OffscreenCanvas&&2===e)return new OffscreenCanvas(300,150);if("undefined"!==typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}(e);if(t.addEventListener("webglcontextlost",(function(t){t.preventDefault(),delete og[e]}),!1),1===e)return t.getContext("webgl",sg)||t.getContext("experimental-webgl",sg);return t.getContext("webgl2",sg)}(e);if(null===t)return console.log("Could not get context for WebGL version",e),null;og[e]=t}var n=og[e];return n.isContextLost()?(delete og[e],cg(e)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),og[e])}function ug(e,t){return[t,e]}function lg(e){var t=i.wf.sizeFromShape(e),n=Math.ceil(t/4);return i.wf.sizeToSquarishShape(n)}function dg(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function fg(e,t){var n,r,a,o,s,c,u,l,d,f=e;return 2===Object(i.Ud)().getNumber("WEBGL_VERSION")?(n=f.R32F,r=f.R16F,a=f.RGBA16F,o=f.RGBA32F,s=f.RED,c=4,u=1,l=f.HALF_FLOAT,d=f.FLOAT):(n=e.RGBA,r=e.RGBA,a=e.RGBA,o=f.RGBA,s=e.RGBA,c=4,u=4,l=null!=t?t.HALF_FLOAT_OES:null,d=e.FLOAT),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:a,internalFormatPackedFloat:o,textureFormatFloat:s,downloadTextureFormat:e.RGBA,downloadUnpackNumChannels:c,defaultNumChannels:u,textureTypeHalfFloat:l,textureTypeFloat:d}}function pg(e,t){var n=t();return Object(i.Ud)().getBool("DEBUG")&&function(e){var t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+function(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 ".concat(t)}}(e,t))}(e),n}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(rg||(rg={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(ag||(ag={})),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"}(ig||(ig={}));function hg(e){return!!(Object(i.Ud)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8<Math.abs(e)&&Math.abs(e)<65504)}function bg(e,t){return Cg(e,(function(){return e.getExtension(t)}),'Extension "'+t+'" not supported on this browser.')}function mg(e,t){var n=Cg(e,(function(){return e.createShader(e.FRAGMENT_SHADER)}),"Unable to create fragment WebGLShader.");if(pg(e,(function(){return e.shaderSource(n,t)})),pg(e,(function(){return e.compileShader(n)})),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw function(e,t){var n=yg.exec(t);if(null==n)return console.log("Couldn't parse line number in error: ".concat(t)),void console.log(e);for(var r=+n[1],a=e.split("\n"),o=a.length.toString().length+2,s=a.map((function(e,t){return i.wf.rightPad((t+1).toString(),o)+e})),c=0,u=0;u<s.length;u++)c=Math.max(s[u].length,c);var l=s.slice(0,r-1),d=s.slice(r-1,r),f=s.slice(r);console.log(l.join("\n")),console.log(t.split("\n")[0]),console.log("%c ".concat(i.wf.rightPad(d[0],c)),"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(f.join("\n"))}(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}var vg,gg,yg=/ERROR: [0-9]+:([0-9]+):/g;function Og(e,t){if(pg(e,(function(){return e.validateProgram(t)})),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function xg(e,t,n,r,a,i,o){var s=e.getAttribLocation(t,n);return-1!==s&&(pg(e,(function(){return e.bindBuffer(e.ARRAY_BUFFER,r)})),pg(e,(function(){return e.vertexAttribPointer(s,a,e.FLOAT,!1,i,o)})),pg(e,(function(){return e.enableVertexAttribArray(s)})),!0)}function kg(e,t,n){return Cg(e,(function(){return e.getUniformLocation(t,n)}),'uniform "'+n+'" not present in program.')}function wg(e,t,n){return e.getUniformLocation(t,n)}function jg(e,t,n,r){pg(e,(function(){return function(e,t,n){Tg(e,n),pg(e,(function(){return e.activeTexture(e.TEXTURE0+n)})),pg(e,(function(){return e.bindTexture(e.TEXTURE_2D,t)}))}(e,t,r)})),pg(e,(function(){return e.uniform1i(n,r)}))}function Sg(e,t,n){pg(e,(function(){return e.bindFramebuffer(e.FRAMEBUFFER,n)})),pg(e,(function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}))}function Ng(e,t){pg(e,(function(){return e.bindFramebuffer(e.FRAMEBUFFER,t)})),pg(e,(function(){return e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)}))}function Ig(e){var t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+function(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 ".concat(t)}}(e,t))}function Cg(e,t,n){var r=pg(e,(function(){return t()}));if(null==r)throw new Error(n);return r}function Tg(e,t){var n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=t+e.TEXTURE0;if(r<e.TEXTURE0||r>n){var a="[gl.TEXTURE0, gl.TEXTURE".concat(n,"]");throw new Error("textureUnit must be in ".concat(a,"."))}}function Eg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return i.wf.sizeFromShape(e.slice(0,e.length-t))}function Ag(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 Rg(e){var t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[Eg(e)].concat(Object(Vn.a)(Ag(e)))),t}function Fg(e){return e%2===0}function Dg(e,t){if(e=e.slice(-2),t=t.slice(-2),i.wf.arraysEqual(e,t))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(Fg(n)&&Fg(r)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&Fg(e[0])&&Fg(t[0])}function _g(e,t){return null!=e.getExtension(t)}function Mg(e){try{if(null!=cg(e))return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function zg(e){if(0===e)return!1;var t=cg(e);if(1!==e){if(_g(t,"EXT_color_buffer_float"))return Lg(t);var n="EXT_color_buffer_half_float";if(_g(t,n)){var r=t.getExtension(n);return function(e,t){var n=fg(e,t),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);var a=1,i=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,a,i,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);var o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);var s=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(r),e.deleteFramebuffer(o),s}(t,r)}return!1}return!!_g(t,"OES_texture_float")&&(!!_g(t,"WEBGL_color_buffer_float")&&Lg(t))}function Lg(e){var t=fg(e),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);var r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);var a=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(r),a}function Pg(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){null!=e&&i.wf.assert("complex64"!==e.dtype,(function(){return"".concat(t," does not support complex64 tensors ")+"in the WebGL backend."}))}))}var Bg=Object(i.Ud)();function Wg(){var e,t,n,r,a,o,s,c,u,l;return 2===Object(i.Ud)().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",r="in",a="texture",o="outputColor",s="out vec4 outputColor;",c="\n bool isnan_custom(float val) {\n return (val > 0.0 || val < 0.0) ? false : val != 0.0;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ",u="",l="\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",a="texture2D",o="gl_FragColor",s="",c="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\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 ",l="\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:a,output:o,defineOutput:s,defineSpecialNaN:c,defineSpecialInf:u,defineRound:l}}function Ug(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"index",r=i.wf.computeStrides(t);return r.map((function(t,a){var i="int ".concat(e[a]," = ").concat(n," / ").concat(t),o=a===r.length-1?"int ".concat(e[a+1]," = ").concat(n," - ").concat(e[a]," * ").concat(t):"index -= ".concat(e[a]," * ").concat(t);return"".concat(i,"; ").concat(o,";")})).join("")}function Vg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"index",r=i.wf.computeStrides(t);return r.map((function(t,a){var i="int ".concat(e[a]," = ").concat(n," / outShapeStrides[").concat(a,"]"),o=a===r.length-1?"int ".concat(e[a+1]," = ").concat(n," - ").concat(e[a]," * outShapeStrides[").concat(a,"]"):"index -= ".concat(e[a]," * outShapeStrides[").concat(a,"]");return"".concat(i,"; ").concat(o,";")})).join("")}function Hg(e){var t=i.wf.computeStrides(e).map((function(e){return e.toString()}));return"\n int getFlatIndex(ivec3 coords) {\n return coords.x * ".concat(t[0]," + coords.y * ").concat(t[1]," + coords.z;\n }\n")}Bg.registerFlag("HAS_WEBGL",(function(){return Bg.getNumber("WEBGL_VERSION")>0})),Bg.registerFlag("WEBGL_VERSION",(function(){return Mg(2)?2:Mg(1)?1:0})),Bg.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",(function(){return!1})),Bg.registerFlag("WEBGL_BUFFER_SUPPORTED",(function(){return 2===Bg.get("WEBGL_VERSION")})),Bg.registerFlag("WEBGL_CPU_FORWARD",(function(){return!0})),Bg.registerFlag("WEBGL_FORCE_F16_TEXTURES",(function(){return!1})),Bg.registerFlag("WEBGL_PACK",(function(){return Bg.getBool("HAS_WEBGL")})),Bg.registerFlag("WEBGL_PACK_NORMALIZATION",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_PACK_CLIP",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_PACK_DEPTHWISECONV",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_PACK_REDUCE",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_LAZILY_UNPACK",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_CONV_IM2COL",(function(){return Bg.getBool("WEBGL_PACK")})),Bg.registerFlag("WEBGL_MAX_TEXTURE_SIZE",(function(){return function(e){if(null==vg){var t=cg(e);vg=t.getParameter(t.MAX_TEXTURE_SIZE)}return vg}(Bg.getNumber("WEBGL_VERSION"))})),Bg.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",(function(){return function(e){if(null==gg){var t=cg(e);gg=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,gg)}(Bg.getNumber("WEBGL_VERSION"))})),Bg.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",(function(){var e=Bg.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;var t=cg(e);return _g(t,"EXT_disjoint_timer_query_webgl2")&&2===e?2:_g(t,"EXT_disjoint_timer_query")?1:0}(e)})),Bg.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",(function(){return Bg.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!i.Od.isMobile()})),Bg.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",(function(){return function(e){if(0===e)return!1;var t=cg(e);if(1===e){if(!_g(t,"OES_texture_float"))return!1}else if(!_g(t,"EXT_color_buffer_float"))return!1;return Lg(t)}(Bg.getNumber("WEBGL_VERSION"))})),Bg.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",(function(){return!Bg.getBool("WEBGL_FORCE_F16_TEXTURES")&&Bg.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")})),Bg.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",(function(){return zg(Bg.getNumber("WEBGL_VERSION"))})),Bg.registerFlag("WEBGL_FENCE_API_ENABLED",(function(){return 2===(e=Bg.getNumber("WEBGL_VERSION"))&&null!=cg(e).fenceSync;var e})),Bg.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",(function(){return Bg.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0})),Bg.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",(function(){return-1}),(function(e){if(e<0&&-1!==e)throw new Error("WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never "+"delete) or at least 0, but got ".concat(e,"."))})),Bg.registerFlag("WEBGL_FLUSH_THRESHOLD",(function(){return i.Od.isMobile()&&Bg.getBool("IS_CHROME")?1:-1}),(function(e){if(e<0&&-1!==e)throw new Error("WEBGL_FLUSH_THRESHOLD must be -1 (indicating never "+"manual flush) or at least 0, but got ".concat(e,"."))})),Bg.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",(function(){return 128})),Bg.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",(function(){return!1})),Bg.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",(function(){return 1e5})),Bg.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",(function(){return 128}));var Gg="\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",qg=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=rg.DENSE;var n=lg(t),r=Wg();this.outputShape=t,this.userCode="\n ivec3 outCoordsFromFlatIndex(int index) {\n ".concat(Ug(["r","c","d"],t),"\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(").concat(n[0],", ").concat(n[1],"));\n int index = 4 * (resTexRC.x * ").concat(n[1]," + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ").concat(r.output," = result;\n }\n ")},Kg=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=rg.DENSE;var n=lg(t),r=Wg();this.outputShape=t,this.userCode="\n ivec3 outCoordsFromFlatIndex(int index) {\n ".concat(Ug(["r","c","d"],t),"\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(").concat(n[0],", ").concat(n[1],"));\n int index = 4 * (resTexRC.x * ").concat(n[1]," + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ").concat(r.output," = result;\n }\n ")},Xg=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"],this.outTexUsage=ag.DOWNLOAD;var n=Wg();this.outputShape=t,this.userCode="\n ".concat(Gg,"\n\n void main() {\n float x = getAAtOutCoords();\n ").concat(n.output," = encode_float(x);\n }\n ")},Yg=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=ag.DOWNLOAD;var n=Wg();this.outputShape=t,this.userCode="\n ".concat(Gg,"\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ").concat(n.output," = encode_float(x);\n }\n ")},$g=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object(Yr.a)(this,e),this.variableNames=["A"];var a=Wg(),i=Object(o.a)(n,2),s=i[0],c=i[1];this.outputShape=t;var u="result";r&&(u="floor(result * 255. + 0.5)"),this.userCode="\n ".concat(Hg(t),"\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n int flatIndex = getFlatIndex(coords);\n int offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n\n int r = flatIndex / ").concat(c,";\n int c = imod(flatIndex, ").concat(c,");\n vec2 uv = (vec2(c, r) + halfCR) / vec2(").concat(c,".0, ").concat(s,".0);\n vec4 values = ").concat(a.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 ").concat(a.output," = vec4(").concat(u,", 0., 0., 0.);\n }\n ")},Qg=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var a=Wg(),i=Object(o.a)(n,2),s=i[0],c=i[1];this.outputShape=t;var u="",l="result";r&&(l="floor(result * 255. + 0.5)");for(var d=0;d<=1;d++)for(var f=0;f<=1;f++){var p=2*d+f;u+="\n localCoords = coords;\n if(localCoords[2] + ".concat(f," < ").concat(t[2],") {\n localCoords[2] += ").concat(f,";\n if(localCoords[1] + ").concat(d," < ").concat(t[1],") {\n localCoords[1] += ").concat(d,";\n\n flatIndex = getFlatIndex(localCoords);\n offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n\n r = flatIndex / ").concat(c,";\n c = imod(flatIndex, ").concat(c,");\n uv = (vec2(c, r) + halfCR) / vec2(").concat(c,".0, ").concat(s,".0);\n values = ").concat(a.texture2D,"(A, uv);\n\n if(offset == 0) {\n result[").concat(p,"] = values[0];\n } else if(offset == 1) {\n result[").concat(p,"] = values[1];\n } else if(offset == 2) {\n result[").concat(p,"] = values[2];\n } else {\n result[").concat(p,"] = values[3];\n }\n }\n }\n ")}this.userCode="\n ".concat(Hg(t),"\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 ").concat(u,"\n\n ").concat(a.output," = ").concat(l,";\n }\n ")};function Zg(e){var t=Wg();return function(e,t){var n=Cg(e,(function(){return e.createShader(e.VERTEX_SHADER)}),"Unable to create vertex WebGLShader.");if(pg(e,(function(){return e.shaderSource(n,t)})),pg(e,(function(){return e.compileShader(n)})),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}(e,"".concat(t.version,"\n precision highp float;\n ").concat(t.attribute," vec3 clipSpacePos;\n ").concat(t.attribute," vec2 uv;\n ").concat(t.varyingVs," vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }"))}function Jg(e){return function(e,t){var n=Cg(e,(function(){return e.createBuffer()}),"Unable to create WebGLBuffer");return pg(e,(function(){return e.bindBuffer(e.ARRAY_BUFFER,n)})),pg(e,(function(){return e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)})),n}(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function ey(e){return function(e,t){var n=Cg(e,(function(){return e.createBuffer()}),"Unable to create WebGLBuffer");return pg(e,(function(){return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)})),pg(e,(function(){return e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)})),n}(e,new Uint16Array([0,1,2,2,1,3]))}function ty(e,t,n,r,a,o){!function(e,t){var n=Object(i.Ud)().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){var r="[".concat(e,"x").concat(t,"]");throw new Error("Requested texture size "+r+" is invalid.")}if(e>n||t>n){var a="[".concat(e,"x").concat(t,"]"),o="[".concat(n,"x").concat(n,"]");throw new Error("Requested texture size "+a+" greater than WebGL maximum on this browser / GPU "+o+".")}}(t,n);var s=function(e){return Cg(e,(function(){return e.createTexture()}),"Unable to create WebGLTexture.")}(e),c=e.TEXTURE_2D;return pg(e,(function(){return e.bindTexture(c,s)})),pg(e,(function(){return e.texParameteri(c,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)})),pg(e,(function(){return e.texParameteri(c,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)})),pg(e,(function(){return e.texParameteri(c,e.TEXTURE_MIN_FILTER,e.NEAREST)})),pg(e,(function(){return e.texParameteri(c,e.TEXTURE_MAG_FILTER,e.NEAREST)})),pg(e,(function(){return e.texImage2D(c,0,r,t,n,0,a,o,null)})),pg(e,(function(){return e.bindTexture(e.TEXTURE_2D,null)})),s}function ny(e){return e.internalFormatFloat}function ry(e){return e.internalFormatHalfFloat}function ay(e){return e.downloadTextureFormat}function iy(e){return e.internalFormatPackedFloat}function oy(e){return e.internalFormatPackedHalfFloat}function sy(e,t,n,r,a,i,s,c){var u=e,l=new Float32Array(function(e,t){var n=dg(e,t),r=Object(o.a)(n,2);return r[0]*r[1]*4}(i,s));return u.bindBuffer(u.PIXEL_PACK_BUFFER,t),u.getBufferSubData(u.PIXEL_PACK_BUFFER,0,l),u.bindBuffer(u.PIXEL_PACK_BUFFER,null),l}var cy=function(){function e(t){Object(Yr.a)(this,e),this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];var n=Object(i.Ud)().getNumber("WEBGL_VERSION");null!=t?(this.gl=t,function(e,t){og[e]=t}(n,t)):this.gl=cg(n);var r="WEBGL_color_buffer_float",a="EXT_color_buffer_half_float";if(1===Object(i.Ud)().getNumber("WEBGL_VERSION")){var o="OES_texture_half_float";if(this.textureFloatExtension=bg(this.gl,"OES_texture_float"),_g(this.gl,o))this.textureHalfFloatExtension=bg(this.gl,o);else if(Object(i.Ud)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(r),_g(this.gl,a))this.colorBufferHalfFloatExtension=bg(this.gl,a);else if(Object(i.Ud)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(r="EXT_color_buffer_float",_g(this.gl,r))this.colorBufferFloatExtension=this.gl.getExtension(r);else{if(!_g(this.gl,a))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(a)}this.vertexBuffer=Jg(this.gl),this.indexBuffer=ey(this.gl),this.framebuffer=function(e){return Cg(e,(function(){return e.createFramebuffer()}),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=fg(this.gl,this.textureHalfFloatExtension)}return Object($r.a)(e,[{key:"debug",get:function(){return Object(i.Ud)().getBool("DEBUG")}},{key:"dispose",value: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;pg(t,(function(){return t.finish()})),pg(t,(function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)})),pg(t,(function(){return t.deleteFramebuffer(e.framebuffer)})),pg(t,(function(){return t.bindBuffer(t.ARRAY_BUFFER,null)})),pg(t,(function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)})),pg(t,(function(){return t.deleteBuffer(e.indexBuffer)})),this.disposed=!0}}},{key:"createFloat32MatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=ug(t,n),i=Object(o.a)(a,2);return ty(e,i[0],i[1],ny(r),r.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}},{key:"createFloat16MatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=ug(t,n),i=Object(o.a)(a,2);return ty(e,i[0],i[1],ry(r),r.textureFormatFloat,r.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}},{key:"createUnsignedBytesMatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=ug(t,n),i=Object(o.a)(a,2);return ty(e,i[0],i[1],ay(r),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}},{key:"uploadPixelDataToTexture",value:function(e,t){this.throwIfDisposed(),function(e,t,n){pg(e,(function(){return e.bindTexture(e.TEXTURE_2D,t)})),n.data instanceof Uint8Array?pg(e,(function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)})):pg(e,(function(){return e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)})),pg(e,(function(){return e.bindTexture(e.TEXTURE_2D,null)}))}(this.gl,e,t)}},{key:"uploadDenseMatrixToTexture",value:function(e,t,n,r){this.throwIfDisposed(),function(e,t,n,r,a,i){var o,s,c;pg(e,(function(){return e.bindTexture(e.TEXTURE_2D,t)})),a instanceof Uint8Array?(o=new Uint8Array(n*r*4),s=e.UNSIGNED_BYTE,c=e.RGBA):(o=new Float32Array(n*r*4),s=e.FLOAT,c=i.internalFormatPackedFloat),o.set(a),pg(e,(function(){return e.texImage2D(e.TEXTURE_2D,0,c,n,r,0,e.RGBA,s,o)})),pg(e,(function(){return e.bindTexture(e.TEXTURE_2D,null)}))}(this.gl,e,t,n,r,this.textureConfig)}},{key:"createFloat16PackedMatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=dg(t,n),i=Object(o.a)(a,2);return ty(e,i[0],i[1],oy(r),e.RGBA,r.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}},{key:"createPackedMatrixTexture",value:function(e,t){return this.throwIfDisposed(),function(e,t,n,r){var a=dg(t,n),i=Object(o.a)(a,2);return ty(e,i[0],i[1],iy(r),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}},{key:"deleteMatrixTexture",value:function(e){var t=this;this.throwIfDisposed(),this.outputTexture===e&&(Ng(this.gl,this.framebuffer),this.outputTexture=null),pg(this.gl,(function(){return t.gl.deleteTexture(e)}))}},{key:"downloadByteEncodedFloatMatrixFromOutputTexture",value:function(e,t,n){var r=this;return this.downloadMatrixDriver(e,(function(){return function(e,t,n,r){var a=ug(t,n),i=Object(o.a)(a,2),s=i[0],c=i[1],u=new Uint8Array(t*n*4);return pg(e,(function(){return e.readPixels(0,0,s,c,r.downloadTextureFormat,e.UNSIGNED_BYTE,u)})),new Float32Array(u.buffer)}(r.gl,t,n,r.textureConfig)}))}},{key:"downloadPackedMatrixFromBuffer",value:function(e,t,n,r,a,i){return sy(this.gl,e,0,0,0,a,i,this.textureConfig)}},{key:"downloadFloat32MatrixFromBuffer",value:function(e,t){return function(e,t,n){var r=e,a=new Float32Array(n);return r.bindBuffer(r.PIXEL_PACK_BUFFER,t),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,a),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),a}(this.gl,e,t)}},{key:"createBufferFromTexture",value:function(e,t,n){this.bindTextureToFrameBuffer(e);var r=function(e,t,n,r){var a=e.createBuffer();pg(e,(function(){return e.bindBuffer(e.PIXEL_PACK_BUFFER,a)}));var i=16*t*n;return pg(e,(function(){return e.bufferData(e.PIXEL_PACK_BUFFER,i,e.STREAM_READ)})),pg(e,(function(){return e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)})),pg(e,(function(){return e.bindBuffer(e.PIXEL_PACK_BUFFER,null)})),a}(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r}},{key:"createAndWaitForFence",value:function(){var e=this.createFence(this.gl);return this.pollFence(e)}},{key:"createFence",value:function(e){var t,n,r=this;if(Object(i.Ud)().getBool("WEBGL_FENCE_API_ENABLED")){var a=e,o=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=function(){var e=a.clientWaitSync(o,0,0);return e===a.ALREADY_SIGNALED||e===a.CONDITION_SATISFIED},t=o}else Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=function(){return r.isQueryAvailable(t,Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}):n=function(){return!0};return{query:t,isFencePassed:n}}},{key:"downloadMatrixFromPackedTexture",value:function(e,t,n){var r=this;return this.downloadMatrixDriver(e,(function(){return function(e,t,n){var r=new Float32Array(t*n*4);return pg(e,(function(){return e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,r)})),r}(r.gl,t,n)}))}},{key:"createProgram",value:function(e){var t=this;this.throwIfDisposed();var n=this.gl,r=mg(n,e);null==this.vertexShader&&(this.vertexShader=Zg(n));var a=function(e){return Cg(e,(function(){return e.createProgram()}),"Unable to create WebGLProgram.")}(n);return pg(n,(function(){return n.attachShader(a,t.vertexShader)})),pg(n,(function(){return n.attachShader(a,r)})),function(e,t){if(pg(e,(function(){return e.linkProgram(t)})),!1===e.getProgramParameter(t,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}(n,a),this.debug&&Og(n,a),this.vertexAttrsAreBound||(this.setProgram(a),this.vertexAttrsAreBound=function(e,t,n){return pg(e,(function(){return e.bindBuffer(e.ARRAY_BUFFER,n)})),xg(e,t,"clipSpacePos",n,3,20,0)&&xg(e,t,"uv",n,2,20,12)}(n,this.program,this.vertexBuffer)),a}},{key:"deleteProgram",value:function(e){var t=this;this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&pg(this.gl,(function(){return t.gl.deleteProgram(e)}))}},{key:"setProgram",value:function(e){var t=this;this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&Og(this.gl,this.program),pg(this.gl,(function(){return t.gl.useProgram(e)}))}},{key:"getUniformLocation",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.throwIfDisposed(),n?kg(this.gl,e,t):wg(this.gl,e,t)}},{key:"getAttributeLocation",value:function(e,t){var n=this;return this.throwIfDisposed(),pg(this.gl,(function(){return n.gl.getAttribLocation(e,t)}))}},{key:"getUniformLocationNoThrow",value:function(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}},{key:"setInputMatrixTexture",value:function(e,t,n){this.throwIfDisposed(),this.throwIfNoProgram(),jg(this.gl,e,t,n)}},{key:"setOutputMatrixTexture",value:function(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}},{key:"setOutputPackedMatrixTexture",value:function(e,t,n){this.throwIfDisposed();var r=dg(t,n),a=Object(o.a)(r,2),i=a[0],s=a[1];this.setOutputMatrixTextureDriver(e,i,s)}},{key:"setOutputMatrixWriteRegion",value:function(e,t,n,r){this.setOutputMatrixWriteRegionDriver(n,e,r,t)}},{key:"setOutputPackedMatrixWriteRegion",value:function(e,t,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}},{key:"debugValidate",value:function(){null!=this.program&&Og(this.gl,this.program),Ig(this.gl)}},{key:"executeProgram",value:function(){this.throwIfDisposed(),this.throwIfNoProgram();var e=this.gl;this.debug&&this.debugValidate(),pg(e,(function(){return e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)}))}},{key:"blockUntilAllProgramsCompleted",value:function(){var e=this;this.throwIfDisposed(),pg(this.gl,(function(){return e.gl.finish()}))}},{key:"getQueryTimerExtension",value:function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=bg(this.gl,2===Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}},{key:"getQueryTimerExtensionWebGL2",value:function(){return this.getQueryTimerExtension()}},{key:"getQueryTimerExtensionWebGL1",value:function(){return this.getQueryTimerExtension()}},{key:"beginQuery",value:function(){if(2===Object(i.Ud)().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(),a=r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT,a),a}},{key:"endQuery",value:function(){if(2!==Object(i.Ud)().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)}}},{key:"waitForQueryAndGetTime",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){var n=this;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.wf.repeatedTry((function(){return n.disposed||n.isQueryAvailable(t,Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}));case 2:return e.abrupt("return",this.getQueryTime(t,Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getQueryTime",value:function(e,t){if(0===t)return null;if(2===t){var n=this.gl;return n.getQueryParameter(e,n.QUERY_RESULT)/1e6}var r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(e,r.QUERY_RESULT_EXT)/1e6}},{key:"isQueryAvailable",value:function(e,t){if(0===t)return!0;if(2===t){var n=this.gl,r=this.getQueryTimerExtensionWebGL2(),a=n.getQueryParameter(e,n.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),a&&!this.disjoint}var i=this.getQueryTimerExtensionWebGL1(),o=i.getQueryObjectEXT(e,i.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(i.GPU_DISJOINT_EXT)),o&&!this.disjoint}},{key:"pollFence",value:function(e){var t=this;return new Promise((function(n){t.addItemToPoll((function(){return e.isFencePassed()}),(function(){return n()}))}))}},{key:"pollItems",value: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)}},{key:"addItemToPoll",value:function(e,t){var n=this;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||i.wf.repeatedTry((function(){return n.pollItems(),0===n.itemsToPoll.length}))}},{key:"bindTextureToFrameBuffer",value:function(e){this.throwIfDisposed(),Sg(this.gl,e,this.framebuffer),this.debug&&Ig(this.gl)}},{key:"unbindTextureToFrameBuffer",value:function(){null!=this.outputTexture?(Sg(this.gl,this.outputTexture,this.framebuffer),this.debug&&Ig(this.gl)):Ng(this.gl,this.framebuffer)}},{key:"downloadMatrixDriver",value:function(e,t){this.bindTextureToFrameBuffer(e);var n=t();return this.unbindTextureToFrameBuffer(),n}},{key:"setOutputMatrixTextureDriver",value:function(e,t,n){this.throwIfDisposed();var r=this.gl;Sg(r,e,this.framebuffer),this.debug&&Ig(r),this.outputTexture=e,pg(r,(function(){return r.viewport(0,0,t,n)})),pg(r,(function(){return r.scissor(0,0,t,n)}))}},{key:"setOutputMatrixWriteRegionDriver",value:function(e,t,n,r){var a=this;this.throwIfDisposed(),pg(this.gl,(function(){return a.gl.scissor(e,t,n,r)}))}},{key:"throwIfDisposed",value:function(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}},{key:"throwIfNoProgram",value:function(){if(null==this.program)throw new Error("No GPU program is currently set.")}}]),e}();var uy=i.ud.getBroadcastDims;function ly(e,t,n){var r=[];if(e.forEach((function(e){var t=i.wf.sizeFromShape(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?r.push("uniform float ".concat(e.name).concat(t>1?"[".concat(t,"]"):"",";")):(r.push("uniform sampler2D ".concat(e.name,";")),r.push("uniform int offset".concat(e.name,";"))),n.enableShapeUniforms){switch(Ty(n.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape).uniformShape.length){case 1:r.push("uniform int ".concat(e.name,"Shape;"));break;case 2:r.push("uniform ivec2 ".concat(e.name,"Shape;"));break;case 3:r.push("uniform ivec3 ".concat(e.name,"Shape;"));break;case 4:r.push("uniform ivec4 ".concat(e.name,"Shape;"))}r.push("uniform ivec2 ".concat(e.name,"TexShape;"))}})),n.enableShapeUniforms){switch(t.logicalShape.length){case 1:r.push("uniform int outShape;");break;case 2:r.push("uniform ivec2 outShape;"),r.push("uniform int outShapeStrides;");break;case 3:r.push("uniform ivec3 outShape;"),r.push("uniform ivec2 outShapeStrides;");break;case 4:r.push("uniform ivec4 outShape;"),r.push("uniform ivec3 outShapeStrides;")}r.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach((function(e){r.push("uniform ".concat(e.type," ").concat(e.name).concat(e.arrayIndex?"[".concat(e.arrayIndex,"]"):"",";"))}));var a,o,s=r.join("\n"),c=e.map((function(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,a="";a+=n?fy(e,r):dy(e,r);var i=e.shapeInfo.logicalShape,o=t.logicalShape;i.length<=o.length&&(a+=n?Ny(e,t):Iy(e,t));return a}(e,t,n.packedInputs,n.enableShapeUniforms)})).join("\n"),u=t.texShape,l=Wg(),d=function(e){return"\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ".concat(e.texture2D,"(textureSampler, uv).r;\n }\n ")}(l),f=function(e){return"".concat(e.version,"\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ").concat(e.varyingFs," vec2 resultUV;\n ").concat(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 ").concat(e.defineSpecialNaN,"\n ").concat(e.defineSpecialInf,"\n ").concat(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 ").concat(py,"\n ").concat(hy,"\n ").concat(by,"\n ")}(l);return t.isPacked?(a=function(e,t,n){switch(e.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(e,t,n){var r=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(1===r[0])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n ":"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ".concat(r[1],".0);\n }\n ");if(1===r[1])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n ":"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ".concat(r[0],".0);\n }\n ");if(n)return"\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n ";return"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(r[0],", ").concat(r[1],"));\n return 2 * (resTexRC.x * ").concat(r[1]," + resTexRC.y);\n }\n ")}(0,t,n);case 2:return function(e,t,n){var r=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(i.wf.arraysEqual(e,t))return n?"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n }\n ":"\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2(".concat(r[0],", ").concat(r[1],"));\n }\n ");var a=Math.ceil(e[1]/2);if(n)return"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec2(r, c);\n }\n ";return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(r[0],", ").concat(r[1],"));\n\n int index = resTexRC.x * ").concat(r[1]," + resTexRC.y;\n int r = 2 * (index / ").concat(a,");\n int c = imod(index, ").concat(a,") * 2;\n\n return ivec2(r, c);\n }\n ")}(e,t,n);case 3:return function(e,t,n){if(n)return"\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n ";var r=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],a=Math.ceil(e[2]/2),i=a*Math.ceil(e[1]/2);return"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(r[0],", ").concat(r[1],"));\n int index = resTexRC.x * ").concat(r[1]," + resTexRC.y;\n\n int b = index / ").concat(i,";\n index -= b * ").concat(i,";\n\n int r = 2 * (index / ").concat(a,");\n int c = imod(index, ").concat(a,") * 2;\n\n return ivec3(b, r, c);\n }\n ")}(e,t,n);default:return function(e,t,n){if(n)return"\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n ";for(var r=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],a=Math.ceil(e[e.length-1]/2),i=a*Math.ceil(e[e.length-2]/2),o=i,s="",c="b, r, c",u=2;u<e.length-1;u++)o*=e[e.length-u-1],s="\n int b".concat(u," = index / ").concat(o,";\n index -= b").concat(u," * ").concat(o,";\n ")+s,c="b".concat(u,", ")+c;return"\n ivec".concat(e.length," getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(").concat(r[0],", ").concat(r[1],"));\n int index = resTexRC.x * ").concat(r[1]," + resTexRC.y;\n\n ").concat(s,"\n\n int b = index / ").concat(i,";\n index -= b * ").concat(i,";\n\n int r = 2 * (index / ").concat(a,");\n int c = imod(index, ").concat(a,") * 2;\n\n return ivec").concat(e.length,"(").concat(c,");\n }\n ")}(e,t,n)}}(t.logicalShape,u,n.enableShapeUniforms),o=function(e){return"\n void setOutput(vec4 val) {\n ".concat(e.output," = val;\n }\n ")}(l)):(a=function(e,t,n){switch(e.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(e,t,n){if(1===t[0])return n?"\n int getOutputCoords() {\n return int(resultUV.x * float(outTexShape[1]));\n }\n ":"\n int getOutputCoords() {\n return int(resultUV.x * ".concat(t[1],".0);\n }\n ");if(1===t[1])return n?"\n int getOutputCoords() {\n return int(resultUV.y * float(outTexShape[0]));\n }\n ":"\n int getOutputCoords() {\n return int(resultUV.y * ".concat(t[0],".0);\n }\n ");if(n)return"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n return resTexRC.x * outTexShape[1] + resTexRC.y;\n }\n ";return"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n return resTexRC.x * ").concat(t[1]," + resTexRC.y;\n }\n ")}(0,t,n);case 2:return function(e,t,n){if(i.wf.arraysEqual(e,t))return n?"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1]));\n }\n ":"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(".concat(t[0],", ").concat(t[1],"));\n }\n ");if(1===e[1])return n?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n return ivec2(index, 0);\n }\n ":"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n return ivec2(index, 0);\n }\n ");if(1===e[0])return n?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n return ivec2(0, index);\n }\n ":"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n return ivec2(0, index);\n }\n ");if(n)return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n int r = index / outShape[1];\n int c = index - r * outShape[1];\n return ivec2(r, c);\n }\n ";return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n int r = index / ").concat(e[1],";\n int c = index - r * ").concat(e[1],";\n return ivec2(r, c);\n }\n ")}(e,t,n);case 3:return function(e,t,n){if(n){var r=Vg(["r","c","d"],e);return"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n ".concat(r,"\n return ivec3(r, c, d);\n }\n")}var a=Ug(["r","c","d"],e);return"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n ").concat(a,"\n return ivec3(r, c, d);\n }\n ")}(e,t,n);case 4:return function(e,t,n){if(n){var r=Vg(["r","c","d","d2"],e);return"\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n ".concat(r,"\n return ivec4(r, c, d, d2);\n }\n ")}var a=Ug(["r","c","d","d2"],e);return"\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n ").concat(a,"\n return ivec4(r, c, d, d2);\n }\n ")}(e,t,n);case 5:return function(e,t){var n=Ug(["r","c","d","d2","d3"],e);return"\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(".concat(t[0],",\n ").concat(t[1],"));\n\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n\n ").concat(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=Ug(["r","c","d","d2","d3","d4"],e);return"\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(".concat(t[0],", ").concat(t[1],"));\n int index = resTexRC.x * ").concat(t[1]," + resTexRC.y;\n\n ").concat(n,"\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n ")}(e,t);default:throw new Error("".concat(e.length,"-D output sampling is not yet supported"))}}(t.logicalShape,u,n.enableShapeUniforms),o=function(e){return"\n void setOutput(float val) {\n ".concat(e.output," = vec4(val, 0, 0, 0);\n }\n ")}(l)),n.packedInputs&&(f+=my),[f,d,o,s,a,c,n.userCode].join("\n")}function dy(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.shapeInfo.logicalShape;switch(n.length){case 0:return gy(e,t);case 1:return yy(e,t);case 2:return Oy(e,t);case 3:return xy(e,t);case 4:return ky(e,t);case 5:return wy(e);case 6:return jy(e);default:throw new Error("".concat(n.length,"-D input sampling")+" is not yet supported")}}function fy(e,t){switch(e.shapeInfo.logicalShape.length){case 0:return function(e){var t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1),r=Wg();return"\n vec4 ".concat(n,"() {\n return ").concat(r.texture2D,"(").concat(t,", halfCR);\n }\n ")}(e);case 1:return function(e,t){var n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),a=e.shapeInfo.texShape,i=Wg();if(t)return"\n vec4 ".concat(r,"(int index) {\n ivec2 packedTexShape = ivec2(ceil(float(").concat(n,"TexShape[0]) / 2.0), ceil(float(").concat(n,"TexShape[1]) / 2.0));\n vec2 uv = packedUVfrom1D(\n packedTexShape[0], packedTexShape[1], index);\n return ").concat(i.texture2D,"(").concat(n,", uv);\n }\n ");var o=[Math.ceil(a[0]/2),Math.ceil(a[1]/2)];return"\n vec4 ".concat(r,"(int index) {\n vec2 uv = packedUVfrom1D(\n ").concat(o[0],", ").concat(o[1],", index);\n return ").concat(i.texture2D,"(").concat(n,", uv);\n }\n ")}(e,t);case 2:return function(e,t){var n=e.shapeInfo.logicalShape,r=e.name,a="get"+r.charAt(0).toUpperCase()+r.slice(1),o=e.shapeInfo.texShape,s=o[0],c=o[1],u=Wg();if(null!=o&&i.wf.arraysEqual(n,o))return t?"\n vec4 ".concat(a,"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(").concat(r,"TexShape[1], ").concat(r,"TexShape[0]);\n\n return ").concat(u.texture2D,"(").concat(r,", uv);\n }\n "):"\n vec4 ".concat(a,"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(").concat(c,".0, ").concat(s,".0);\n\n return ").concat(u.texture2D,"(").concat(r,", uv);\n }\n ");if(t)return"\n vec4 ".concat(a,"(int row, int col) {\n ivec2 packedTexShape = ivec2(ceil(float(").concat(r,"TexShape[0]) / 2.0), ceil(float(").concat(r,"TexShape[1]) / 2.0));\n int valuesPerRow = int(ceil(float(").concat(r,"Shape[1]) / 2.0));\n vec2 uv = packedUVfrom2D(valuesPerRow, packedTexShape[0], packedTexShape[1], row, col);\n return ").concat(u.texture2D,"(").concat(r,", uv);\n }\n ");var l=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)],d=Math.ceil(n[1]/2);return"\n vec4 ".concat(a,"(int row, int col) {\n vec2 uv = packedUVfrom2D(").concat(d,", ").concat(l[0],", ").concat(l[1],", row, col);\n return ").concat(u.texture2D,"(").concat(r,", uv);\n }\n ")}(e,t);case 3:return function(e,t){var n=e.shapeInfo.logicalShape,r=e.name,a="get"+r.charAt(0).toUpperCase()+r.slice(1),i=e.shapeInfo.texShape,o=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];if(1===n[0]){var s=[1,2],c=Ey(e,n.slice(1)),u=["b","row","col"];return"\n ".concat(fy(c,t),"\n vec4 ").concat(a,"(int b, int row, int col) {\n return ").concat(a,"(").concat(Ay(u,s),");\n }\n ")}var l=Wg();if(t)return"\n vec4 ".concat(a,"(int b, int row, int col) {\n ivec2 packedTexShape = ivec2(ceil(float(").concat(r,"TexShape[0]) / 2.0), ceil(float(").concat(r,"TexShape[1]) / 2.0));\n int valuesPerRow = int(ceil(float(").concat(r,"Shape[2]) / 2.0));\n int texelsInBatch = valuesPerRow * int(ceil(float(").concat(r,"Shape[1]) / 2.0));\n vec2 uv = packedUVfrom3D(\n packedTexShape[0], packedTexShape[1], texelsInBatch, valuesPerRow, b, row, col);\n return ").concat(l.texture2D,"(").concat(r,", uv);\n }\n ");var d=o[0],f=o[1],p=Math.ceil(n[2]/2),h=p*Math.ceil(n[1]/2);return"\n vec4 ".concat(a,"(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ").concat(d,", ").concat(f,", ").concat(h,", ").concat(p,", b, row, col);\n return ").concat(l.texture2D,"(").concat(r,", uv);\n }\n ")}(e,t);default:return function(e,t){var n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),a=Wg();if(t)return"\n vec4 ".concat(r,"(int b2, int b, int row, int col) {\n int valuesPerRow = int(ceil(float(").concat(n,"Shape[3]) / 2.0));\n int texelsInBatch = valuesPerRow * int(ceil(float(").concat(n,"Shape[2]) / 2.0));\n int index = b * texelsInBatch + (row / 2) * valuesPerRow + (col / 2);\n texelsInBatch *= ").concat(n,"Shape[1];\n index = b2 * texelsInBatch + index;\n ivec2 packedTexShape = ivec2(ceil(float(").concat(n,"TexShape[0]) / 2.0), ceil(float(").concat(n,"TexShape[1]) / 2.0));\n int texR = index / packedTexShape[1];\n int texC = index - texR * packedTexShape[1];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(packedTexShape[1], packedTexShape[0]); return ").concat(a.texture2D,"(").concat(n,", uv);\n }\n ");for(var i=e.shapeInfo.logicalShape,o=i.length,s=e.shapeInfo.texShape,c=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)],u=c[0],l=c[1],d=Math.ceil(i[o-1]/2),f=d*Math.ceil(i[o-2]/2),p="int b, int row, int col",h="b * ".concat(f," + (row / 2) * ").concat(d," + (col / 2)"),b=2;b<o-1;b++)p="int b".concat(b,", ")+p,f*=i[o-b-1],h="b".concat(b," * ").concat(f," + ")+h;return"\n vec4 ".concat(r,"(").concat(p,") {\n int index = ").concat(h,";\n int texR = index / ").concat(l,";\n int texC = index - texR * ").concat(l,";\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(").concat(l,", ").concat(u,");\n return ").concat(a.texture2D,"(").concat(n,", uv);\n }\n ")}(e,t)}}var py="\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",hy="\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",by="\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",my="\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 vy(e){return"offset".concat(e)}function gy(e,t){var n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1);if(e.shapeInfo.isUniform)return"float ".concat(r,"() {return ").concat(n,";}");var a=Object(o.a)(e.shapeInfo.texShape,2),i=a[0],s=a[1];if(1===i&&1===s)return"\n float ".concat(r,"() {\n return sampleTexture(").concat(n,", halfCR);\n }\n ");var c=vy(n);if(t)return"\n float ".concat(r,"() {\n vec2 uv = uvFromFlat(").concat(n,"TexShape[0], ").concat(n,"TexShape[1], ").concat(c,");\n return sampleTexture(").concat(n,", uv);\n }\n ");var u=Object(o.a)(e.shapeInfo.texShape,2),l=u[0],d=u[1];return"\n float ".concat(r,"() {\n vec2 uv = uvFromFlat(").concat(l,", ").concat(d,", ").concat(c,");\n return sampleTexture(").concat(n,", uv);\n }\n ")}function yy(e,t){var n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1);if(e.shapeInfo.isUniform)return"\n float ".concat(r,"(int index) {\n ").concat(Sy(e),"\n }\n ");var a=e.shapeInfo.texShape,i=a[0],o=a[1];if(1===o&&1===i)return"\n float ".concat(r,"(int index) {\n return sampleTexture(").concat(n,", halfCR);\n }\n ");var s=vy(n);return 1===o?t?"\n float ".concat(r,"(int index) {\n vec2 uv = vec2(0.5, (float(index + ").concat(s,") + 0.5) / float(").concat(n,"TexShape[0]));\n return sampleTexture(").concat(n,", uv);\n }\n "):"\n float ".concat(r,"(int index) {\n vec2 uv = vec2(0.5, (float(index + ").concat(s,") + 0.5) / ").concat(i,".0);\n return sampleTexture(").concat(n,", uv);\n }\n "):1===i?t?"\n float ".concat(r,"(int index) {\n vec2 uv = vec2((float(index + ").concat(s,") + 0.5) / float(").concat(n,"TexShape[1]), 0.5);\n return sampleTexture(").concat(n,", uv);\n }\n "):"\n float ".concat(r,"(int index) {\n vec2 uv = vec2((float(index + ").concat(s,") + 0.5) / ").concat(o,".0, 0.5);\n return sampleTexture(").concat(n,", uv);\n }\n "):t?"\n float ".concat(r,"(int index) {\n vec2 uv = uvFromFlat(").concat(n,"TexShape[0], ").concat(n,"TexShape[1], index + ").concat(s,");\n return sampleTexture(").concat(n,", uv);\n }\n "):"\n float ".concat(r,"(int index) {\n vec2 uv = uvFromFlat(").concat(i,", ").concat(o,", index + ").concat(s,");\n return sampleTexture(").concat(n,", uv);\n }\n ")}function Oy(e,t){var n=e.shapeInfo.logicalShape,r=e.name,a="get"+r.charAt(0).toUpperCase()+r.slice(1),o=e.shapeInfo.texShape;if(null!=o&&i.wf.arraysEqual(n,o)){if(t)return"\n float ".concat(a,"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(").concat(r,"TexShape[1], ").concat(r,"TexShape[0]);\n return sampleTexture(").concat(r,", uv);\n }\n ");var s=o[0],c=o[1];return"\n float ".concat(a,"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(").concat(c,".0, ").concat(s,".0);\n return sampleTexture(").concat(r,", uv);\n }\n ")}var u=i.wf.squeezeShape(n),l=u.newShape,d=u.keptDims,f=l;if(f.length<n.length){var p=Ey(e,f);return"\n ".concat(dy(p,t),"\n float ").concat(a,"(int row, int col) {\n return ").concat(a,"(").concat(Ay(["row","col"],d),");\n }\n ")}if(e.shapeInfo.isUniform)return"\n float ".concat(a,"(int row, int col) {\n int index = round(dot(vec2(row, col), vec2(").concat(n[1],", 1)));\n ").concat(Sy(e),"\n }\n ");var h=o[0],b=o[1],m=vy(r);return 1===b?t?"\n float ".concat(a,"(int row, int col) {\n float index = dot(vec3(row, col, ").concat(m,"), vec3(").concat(r,"Shape[1], 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / float(").concat(r,"TexShape[0]));\n return sampleTexture(").concat(r,", uv);\n }\n "):"\n float ".concat(a,"(int row, int col) {\n float index = dot(vec3(row, col, ").concat(m,"), vec3(").concat(n[1],", 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ").concat(h,".0);\n return sampleTexture(").concat(r,", uv);\n }\n "):1===h?t?"\n float ".concat(a,"(int row, int col) {\n float index = dot(vec3(row, col, ").concat(m,"), vec3(").concat(r,"Shape[1], 1, 1));\n vec2 uv = vec2((index + 0.5) / float(").concat(r,"TexShape[1]), 0.5);\n return sampleTexture(").concat(r,", uv);\n }\n "):"\n float ".concat(a,"(int row, int col) {\n float index = dot(vec3(row, col, ").concat(m,"), vec3(").concat(n[1],", 1, 1));\n vec2 uv = vec2((index + 0.5) / ").concat(b,".0, 0.5);\n return sampleTexture(").concat(r,", uv);\n }\n "):t?"\n float ".concat(a,"(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ").concat(r,"Shape[1] + col + ").concat(m,";\n vec2 uv = uvFromFlat(").concat(r,"TexShape[0], ").concat(r,"TexShape[1], index);\n return sampleTexture(").concat(r,", uv);\n }\n "):"\n float ".concat(a,"(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ").concat(n[1]," + col + ").concat(m,";\n vec2 uv = uvFromFlat(").concat(h,", ").concat(b,", index);\n return sampleTexture(").concat(r,", uv);\n }\n")}function xy(e,t){var n=e.shapeInfo.logicalShape,r=e.name,a="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[1]*n[2],s=n[2],c=i.wf.squeezeShape(n),u=c.newShape,l=c.keptDims,d=u;if(d.length<n.length){var f=Ey(e,d);return"\n ".concat(dy(f,t),"\n float ").concat(a,"(int row, int col, int depth) {\n return ").concat(a,"(").concat(Ay(["row","col","depth"],l),");\n }\n ")}if(e.shapeInfo.isUniform)return"\n float ".concat(a,"(int row, int col, int depth) {\n int index = round(dot(vec3(row, col, depth),\n vec3(").concat(o,", ").concat(s,", 1)));\n ").concat(Sy(e),"\n }\n ");var p=e.shapeInfo.texShape,h=p[0],b=p[1],m=e.shapeInfo.flatOffset;if(b===o&&null==m)return t?"\n float ".concat(a,"(int row, int col, int depth) {\n int stride1 = ").concat(r,"Shape[2];\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2(stride1, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(r,"TexShape[1], ").concat(r,"TexShape[0]);\n return sampleTexture(").concat(r,", uv);\n }\n "):"\n float ".concat(a,"(int row, int col, int depth) {\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2(").concat(s,", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(b,".0, ").concat(h,".0);\n return sampleTexture(").concat(r,", uv);\n }\n ");if(b===s&&null==m)return t?"\n float ".concat(a,"(int row, int col, int depth) {\n float texR = dot(vec2(row, col), vec2(").concat(r,"Shape[1], 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(").concat(r,"TexShape[1], ").concat(r,"TexShape[0]);\n return sampleTexture(").concat(r,", uv);\n }\n "):"\n float ".concat(a,"(int row, int col, int depth) {\n float texR = dot(vec2(row, col), vec2(").concat(n[1],", 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(").concat(b,".0, ").concat(h,".0);\n return sampleTexture(").concat(r,", uv);\n }\n ");var v=vy(r);return t?"\n float ".concat(a,"(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int stride0 = ").concat(r,"Shape[1] * ").concat(r,"Shape[2];\n int stride1 = ").concat(r,"Shape[2];\n int index = row * ").concat(o," + col * ").concat(s," + depth + ").concat(v,";\n vec2 uv = uvFromFlat(").concat(r,"TexShape[0], ").concat(r,"TexShape[1], index);\n return sampleTexture(").concat(r,", uv);\n }\n "):"\n float ".concat(a,"(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ").concat(o," + col * ").concat(s," + depth + ").concat(v,";\n vec2 uv = uvFromFlat(").concat(h,", ").concat(b,", index);\n return sampleTexture(").concat(r,", uv);\n }\n ")}function ky(e,t){var n=e.shapeInfo.logicalShape,r=e.name,a="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[3],s=n[2]*o,c=n[1]*s,u=i.wf.squeezeShape(n),l=u.newShape,d=u.keptDims;if(l.length<n.length){var f=Ey(e,l);return"\n ".concat(dy(f,t),"\n float ").concat(a,"(int row, int col, int depth, int depth2) {\n return ").concat(a,"(").concat(Ay(["row","col","depth","depth2"],d),");\n }\n ")}if(e.shapeInfo.isUniform)return"\n float ".concat(a,"(int row, int col, int depth, int depth2) {\n int index = round(dot(vec4(row, col, depth, depth2),\n vec4(").concat(c,", ").concat(s,", ").concat(o,", 1)));\n ").concat(Sy(e),"\n }\n ");var p=e.shapeInfo.flatOffset,h=e.shapeInfo.texShape,b=h[0],m=h[1],v="int stride2 = ".concat(r,"Shape[3];"),g="int stride1 = ".concat(r,"Shape[2] * stride2;"),y="int stride0 = ".concat(r,"Shape[1] * stride1;");if(m===c&&null==p)return t?"\n float ".concat(a,"(int row, int col, int depth, int depth2) {\n ").concat(v,"\n ").concat(g,"\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3(stride1, stride2, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(r,"TexShape[1], ").concat(r,"TexShape[0]);\n return sampleTexture(").concat(r,", uv);\n }\n "):"\n float ".concat(a,"(int row, int col, int depth, int depth2) {\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3(").concat(s,", ").concat(o,", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(m,".0, ").concat(b,".0);\n return sampleTexture(").concat(r,", uv);\n }\n ");if(m===o&&null==p)return t?"\n float ".concat(a,"(int row, int col, int depth, int depth2) {\n float texR = dot(vec3(row, col, depth),\n vec3(").concat(r,"Shape[1] * ").concat(r,"Shape[2], ").concat(r,"Shape[2], 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(r,"TexShape[1], ").concat(r,"TexShape[0]);\n return sampleTexture(").concat(r,", uv);\n }\n "):"\n float ".concat(a,"(int row, int col, int depth, int depth2) {\n float texR = dot(vec3(row, col, depth),\n vec3(").concat(n[1]*n[2],", ").concat(n[2],", 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(m,".0, ").concat(b,".0);\n return sampleTexture(").concat(r,", uv);\n }\n ");var O=vy(r);return t?"\n float ".concat(a,"(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n ").concat(v,"\n ").concat(g,"\n ").concat(y,"\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2;\n vec2 uv = uvFromFlat(").concat(r,"TexShape[0], ").concat(r,"TexShape[1], index + ").concat(O,");\n return sampleTexture(").concat(r,", uv);\n }\n "):"\n float ".concat(a,"(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ").concat(c," + col * ").concat(s," +\n depth * ").concat(o," + depth2;\n vec2 uv = uvFromFlat(").concat(b,", ").concat(m,", index + ").concat(O,");\n return sampleTexture(").concat(r,", uv);\n }\n ")}function wy(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),a=t[4],o=t[3]*a,s=t[2]*o,c=t[1]*s,u=i.wf.squeezeShape(t),l=u.newShape,d=u.keptDims;if(l.length<t.length){var f=Ey(e,l);return"\n ".concat(dy(f),"\n float ").concat(r,"(int row, int col, int depth, int depth2, int depth3) {\n return ").concat(r,"(").concat(Ay(["row","col","depth","depth2","depth3"],d),");\n }\n ")}if(e.shapeInfo.isUniform)return"\n float ".concat(r,"(int row, int col, int depth, int depth2, int depth3) {\n float index = dot(\n vec4(row, col, depth, depth2),\n vec4(").concat(c,", ").concat(s,", ").concat(o,", ").concat(a,")) +\n depth3;\n ").concat(Sy(e),"\n }\n ");var p=e.shapeInfo.flatOffset,h=e.shapeInfo.texShape,b=h[0],m=h[1];if(m===c&&null==p)return"\n float ".concat(r,"(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(").concat(s,", ").concat(o,", ").concat(a,", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(m,".0, ").concat(b,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");if(m===a&&null==p)return"\n float ".concat(r,"(int row, int col, int depth, int depth2, int depth3) {\n float texR = dot(\n vec4(row, col, depth, depth2),\n vec4(").concat(t[1]*t[2]*t[3],",\n ").concat(t[2]*t[3],", ").concat(t[3],", 1));\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(m,".0, ").concat(b,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");var v=vy(n);return"\n float ".concat(r,"(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 * ").concat(c," + col * ").concat(s," + depth * ").concat(o," +\n depth2 * ").concat(a," + depth3 + ").concat(v,";\n vec2 uv = uvFromFlat(").concat(b,", ").concat(m,", index);\n return sampleTexture(").concat(n,", uv);\n }\n ")}function jy(e){var t=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),a=i.wf.squeezeShape(t),o=a.newShape,s=a.keptDims;if(o.length<t.length){var c=Ey(e,o);return"\n ".concat(dy(c),"\n float ").concat(r,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ").concat(r,"(").concat(Ay(["row","col","depth","depth2","depth3","depth4"],s),");\n }\n ")}var u=t[5],l=t[4]*u,d=t[3]*l,f=t[2]*d,p=t[1]*f;if(e.shapeInfo.isUniform)return"\n float ".concat(r,"(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(").concat(p,", ").concat(f,", ").concat(d,", ").concat(l,")) +\n dot(\n vec2(depth3, depth4),\n vec2(").concat(u,", 1)));\n ").concat(Sy(e),"\n }\n ");var h=e.shapeInfo.flatOffset,b=e.shapeInfo.texShape,m=b[0],v=b[1];if(v===p&&null==h)return"\n float ".concat(r,"(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(").concat(f,", ").concat(d,", ").concat(l,", ").concat(u,")) +\n float(depth4);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(v,".0, ").concat(m,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");if(v===u&&null==h)return"\n float ".concat(r,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n float texR = dot(vec4(row, col, depth, depth2),\n vec4(").concat(t[1]*t[2]*t[3]*t[4],",\n ").concat(t[2]*t[3]*t[4],",\n ").concat(t[3]*t[4],",\n ").concat(t[4],")) + float(depth3);\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(").concat(v,".0, ").concat(m,".0);\n return sampleTexture(").concat(n,", uv);\n }\n ");var g=vy(n);return"\n float ".concat(r,"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ").concat(p," + col * ").concat(f," + depth * ").concat(d," +\n depth2 * ").concat(l," + depth3 * ").concat(u," + depth4 + ").concat(g,";\n vec2 uv = uvFromFlat(").concat(m,", ").concat(v,", index);\n return sampleTexture(").concat(n,", uv);\n }\n ")}function Sy(e){var t=e.name,n=i.wf.sizeFromShape(e.shapeInfo.logicalShape);return n<2?"return ".concat(t,";"):"\n for (int i = 0; i < ".concat(n,"; i++) {\n if (i == index) {\n return ").concat(t,"[i];\n }\n }\n ")}function Ny(e,t){var n,r=e.name,a=r.charAt(0).toUpperCase()+r.slice(1),o="get"+a+"AtOutCoords",s=e.shapeInfo.logicalShape.length,c=t.logicalShape.length,u=uy(e.shapeInfo.logicalShape,t.logicalShape),l=Cy(c),d=c-s,f=["x","y","z","w","u","v"];n=0===s?"":c<2&&u.length>=1?"coords = 0;":u.map((function(e){return"coords.".concat(f[e+d]," = 0;")})).join("\n");var p="";p=c<2&&s>0?"coords":e.shapeInfo.logicalShape.map((function(e,t){return"coords.".concat(f[t+d])})).join(", ");var h="return outputValue;",b=1===i.wf.sizeFromShape(e.shapeInfo.logicalShape),m=1===i.wf.sizeFromShape(t.logicalShape);if(1!==s||b||m){if(b&&!m)h=1===c?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(u.length){var v=s-2,g=s-1;u.indexOf(v)>-1&&u.indexOf(g)>-1?h="return vec4(outputValue.x);":u.indexOf(v)>-1?h="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":u.indexOf(g)>-1&&(h="return vec4(outputValue.xx, outputValue.zz);")}}else h="\n return vec4(outputValue.xy, outputValue.xy);\n ";return"\n vec4 ".concat(o,"() {\n ").concat(l," coords = getOutputCoords();\n ").concat(n,"\n vec4 outputValue = get").concat(a,"(").concat(p,");\n ").concat(h,"\n }\n ")}function Iy(e,t){var n=e.name,r=n.charAt(0).toUpperCase()+n.slice(1),a="get"+r+"AtOutCoords",o=t.texShape,s=e.shapeInfo.texShape,c=e.shapeInfo.logicalShape.length,u=t.logicalShape.length;if(!e.shapeInfo.isUniform&&c===u&&null==e.shapeInfo.flatOffset&&i.wf.arraysEqual(s,o))return"\n float ".concat(a,"() {\n return sampleTexture(").concat(n,", resultUV);\n }\n ");var l,d=Cy(u),f=uy(e.shapeInfo.logicalShape,t.logicalShape),p=u-c,h=["x","y","z","w","u","v"];l=0===c?"":u<2&&f.length>=1?"coords = 0;":f.map((function(e){return"coords.".concat(h[e+p]," = 0;")})).join("\n");var b="";return b=u<2&&c>0?"coords":e.shapeInfo.logicalShape.map((function(e,t){return"coords.".concat(h[t+p])})).join(", "),"\n float ".concat(a,"() {\n ").concat(d," coords = getOutputCoords();\n ").concat(l,"\n return get").concat(r,"(").concat(b,");\n }\n ")}function Cy(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 ".concat(e," is not yet supported"))}function Ty(e,t,n){var r=i.wf.squeezeShape(t).newShape,a=t.length,o=e&&3===a&&1===t[0],s=o?t.slice(1):r,c=!e&&a>1&&!i.wf.arraysEqual(t,n)&&r.length<a||o;return{useSqueezeShape:c,uniformShape:c?s:t}}function Ey(e,t){var n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function Ay(e,t){return t.map((function(t){return e[t]})).join(", ")}function Ry(e,t,n,r){var a=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}})),o=a.map((function(e){return e.shapeInfo})),s={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},c=ly(a,s,t),u=e.createProgram(c),l=null,d=e.getUniformLocation(u,"NAN",!1);1===Object(i.Ud)().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(u,"INFINITY",!1));for(var f,p,h,b=!1,m={},v={},g={},y=0;y<t.variableNames.length;y++){var O=t.variableNames[y];m[O]=e.getUniformLocation(u,O,b),m["offset".concat(O)]=e.getUniformLocation(u,"offset".concat(O),b),t.enableShapeUniforms&&(v["".concat(O,"Shape")]=e.getUniformLocation(u,"".concat(O,"Shape"),b),g["".concat(O,"TexShape")]=e.getUniformLocation(u,"".concat(O,"TexShape"),b))}t.enableShapeUniforms&&(f=e.getUniformLocation(u,"outShape",b),h=e.getUniformLocation(u,"outShapeStrides",b),p=e.getUniformLocation(u,"outTexShape",b));var x=[];return t.customUniforms&&t.customUniforms.forEach((function(t,n){x[n]=e.getUniformLocation(u,t.name,b)})),{program:t,source:c,webGLProgram:u,uniformLocations:m,customUniformLocations:x,inShapeInfos:o,outShapeInfo:s,infLoc:l,nanLoc:d,inShapesLocations:v,inTexShapesLocations:g,outShapeLocation:f,outShapeStridesLocation:h,outTexShapeLocation:p}}function Fy(e,t){if(e.length!==t.length)throw Error("Binary was compiled with ".concat(e.length," inputs, but ")+"was executed with ".concat(t.length," inputs"));e.forEach((function(e,n){var r=e.logicalShape,a=t[n],o=a.shape;if(!i.wf.arraysEqual(r,o))throw Error("Binary was compiled with different shapes than "+"the current args. Shapes ".concat(r," and ").concat(o," must match"));if(!e.isUniform||!a.isUniform){var s=e.texShape,c=a.isUniform?null:a.texData.texShape;if(!i.wf.arraysEqual(s,c))throw Error("Binary was compiled with different texture shapes than the"+" current args. Shape ".concat(s," and ").concat(c," must match"))}}))}function Dy(e,t,n,r,a){t.program.enableShapeUniforms||(Fy(t.inShapeInfos,n),Fy([t.outShapeInfo],[r]));var o=r.texData.texture,s=r.texData.texShape;r.texData.isPacked?e.setOutputPackedMatrixTexture(o,s[0],s[1]):e.setOutputMatrixTexture(o,s[0],s[1]),e.setProgram(t.webGLProgram),1===Object(i.Ud)().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 a=t.program.variableNames[r],o=t.uniformLocations[a],s=t.uniformLocations["offset".concat(a)],c=t.inShapesLocations["".concat(a,"Shape")],u=t.inTexShapesLocations["".concat(a,"TexShape")];if(c){var l=Ty(t.program.packedInputs,n.shape,n.texData.texShape).uniformShape;switch(l.length){case 1:e.gl.uniform1iv(c,new Int32Array(l));break;case 2:e.gl.uniform2iv(c,new Int32Array(l));break;case 3:e.gl.uniform3iv(c,new Int32Array(l));break;case 4:e.gl.uniform4iv(c,new Int32Array(l))}}if(u&&e.gl.uniform2i(u,n.texData.texShape[0],n.texData.texShape[1]),null!=o)if(n.isUniform)if(i.wf.sizeFromShape(n.shape)<2)e.gl.uniform1f(o,n.uniformValues[0]);else{var d=n.uniformValues;d instanceof Float32Array||(d=new Float32Array(d)),e.gl.uniform1fv(o,d)}else null!=n.texData.slice&&null!=s&&e.gl.uniform1i(s,n.texData.slice.flatOffset),e.setInputMatrixTexture(n.texData.texture,o,r)}));var c=t.outShapeLocation;if(c)switch(r.shape.length){case 1:e.gl.uniform1iv(c,new Int32Array(r.shape));break;case 2:e.gl.uniform2iv(c,new Int32Array(r.shape));break;case 3:e.gl.uniform3iv(c,new Int32Array(r.shape));break;case 4:e.gl.uniform4iv(c,new Int32Array(r.shape))}if(t.outShapeStridesLocation){var u=i.wf.computeStrides(r.shape);switch(r.shape.length){case 2:e.gl.uniform1iv(t.outShapeStridesLocation,new Int32Array(u));break;case 3:e.gl.uniform2iv(t.outShapeStridesLocation,new Int32Array(u));break;case 4:e.gl.uniform3iv(t.outShapeStridesLocation,new Int32Array(u))}}t.outTexShapeLocation&&e.gl.uniform2i(t.outTexShapeLocation,r.texData.texShape[0],r.texData.texShape[1]),t.program.customUniforms&&a&&t.program.customUniforms.forEach((function(n,r){var i=t.customUniformLocations[r],o=a[r];if("float"===n.type)e.gl.uniform1fv(i,o);else if("vec2"===n.type)e.gl.uniform2fv(i,o);else if("vec3"===n.type)e.gl.uniform3fv(i,o);else if("vec4"===n.type)e.gl.uniform4fv(i,o);else if("int"===n.type)e.gl.uniform1iv(i,o);else if("ivec2"===n.type)e.gl.uniform2iv(i,o);else if("ivec3"===n.type)e.gl.uniform3iv(i,o);else{if("ivec4"!==n.type)throw Error("uniform type ".concat(n.type," is not supported yet."));e.gl.uniform4iv(i,o)}})),e.executeProgram()}function _y(e,t,n){var r="";t.concat(n).forEach((function(t){var a=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){var o=t.texData.texShape,s=Ty(e.packedInputs,t.shape,o),c=s.useSqueezeShape,u=s.uniformShape,l="",d="",f="";if(1===u.length&&e.packedInputs){var p=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)];l="".concat(p[0]>1,"_").concat(p[1]>1)}else if(2!==u.length||e.packedInputs){if(u.length>2&&!e.packedInputs){var h=i.wf.computeStrides(u);f="".concat(h[0]===o[1],"_").concat(h[h.length-1]===o[1])}}else d="".concat(u[0]>1,"_").concat(u[1]>1);var b=t.shape.length,m=2===b&&i.wf.arraysEqual(t.shape,o),v=1===i.wf.sizeFromShape(t.shape),g=i.ud.getBroadcastDims(t.shape,n.shape),y=!e.packedInputs&&b===n.shape.length&&i.wf.arraysEqual(o,n.texData.texShape),O=e.packedInputs||b>2?"":"".concat(o[0]>1,"_").concat(o[1]>1);r+="".concat(b,"_").concat(y,"_").concat(c,"_").concat(u.length,"_").concat(v,"_").concat(g,"_").concat(m,"_").concat(l,"_").concat(d,"_").concat(f,"_").concat(O,"_").concat(a)}else{var x=t.isUniform?"uniform":t.texData.texShape;r+="".concat(t.shape,"_").concat(x,"_").concat(a)}}));var a=e.userCode,o=e.constructor.name;return o+="_"+r+"_"+a+"".concat(Object(i.Ud)().getNumber("WEBGL_VERSION"))}function My(e){return Object(i.Ud)().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}var zy=If,Ly=yp,Py=Op,By=wp,Wy=Tp,Uy=dh,Vy=kh,Hy=Ih,Gy=Hh,qy=Zh,Ky=eb,Xy=nb,Yy=ib,$y=bb,Qy=gb,Zy=xb,Jy=wb,eO=Lb,tO=Wb,nO=Qb,rO=rh,aO=sm,iO=bm,oO=Cm,sO=Em,cO=Um,uO=Mf,lO=bp,dO=cv,fO=lv,pO=fv,hO=Sv,bO=Cv,mO=Av,vO=Fv,gO=Fh,yO=Pv,OO=Vv,xO=Vf,kO=$v;function wO(e,t){return["x","y","z","w","u","v"].slice(0,t).map((function(t){return"".concat(e,".").concat(t)}))}function jO(e,t){return 1===t?[e]:wO(e,t)}var SO=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=t;var n=t.length;if(0===n)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{var r=jO("rc",n),a=Cy(n),i=function(e,t,n){if(1===e)return"rc > ".concat(t[0]);for(var r="",a=e-2;a<e;a++)r+="".concat(n[a]," >= ").concat(t[a]),a<e-1&&(r+="||");return r}(n,t,r),o=function(e,t,n,r){if(1===e)return"";var a=r.slice(-2);return"\n int r = ".concat(a[0],";\n int c = ").concat(a[1],";\n int rp1 = r + 1;\n int cp1 = c + 1;\n\n bool cEdge = cp1 >= ").concat(t,";\n bool rEdge = rp1 >= ").concat(n,";\n ")}(n,t[t.length-1],t[t.length-2],r),s=function(e,t){var n=e.length,r=function(e,t){for(var n=[],r=0;r<=1;r++)for(var a=0;a<=1;a++){for(var i="".concat(0===r?"r":"rp1",", ").concat(0===a?"c":"cp1"),o=2;o<e;o++)i="".concat(t[t.length-1-o],",")+i;n.push(i)}return n}(n,t);if(1===n)return"getA(rc),\n rc + 1 >= ".concat(e[0]," ? 0. : getA(rc + 1),\n 0, 0");return"getA(".concat(r[0],"),\n cEdge ? 0. : getA(").concat(r[1],"),\n rEdge ? 0. : getA(").concat(r[2],"),\n rEdge || cEdge ? 0. : getA(").concat(r[3],")")}(t,r);this.userCode="\n void main() {\n ".concat(a," rc = getOutputCoords();\n\n if(").concat(i,") {\n setOutput(vec4(0));\n } else {\n ").concat(o,"\n\n setOutput(vec4(").concat(s,"));\n }\n }\n ")}};var NO=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t;for(var r="",a=0;a<4;a++){var i="thisRC = rc;";a%2===1&&(i+="thisRC.z += 1;"),a>1&&(i+="thisRC.y += 1;"),r+="\n ".concat(i,"\n ").concat(a>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[").concat(a,"] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ").concat(a>0?"}":"","\n ")}this.userCode="\n ".concat(function(e){var t=Ug(["r","c","d"],e);return"\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ".concat(t,"\n return ivec3(r, c, d);\n }\n ")}(n),"\n ").concat(Hg(t),"\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ").concat(t[1],";\n int cols = ").concat(t[2],";\n\n ").concat(r,"\n\n setOutput(result);\n }\n ")};var IO=function(){function e(t){Object(Yr.a)(this,e),this.gpgpu=t,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return Object($r.a)(e,[{key:"acquireTexture",value:function(e,t,n){var r=TO(t,n),a=EO(e,r,n);a in this.freeTextures||(this.freeTextures[a]=[]),a in this.usedTextures||(this.usedTextures[a]=[]);var i,o=CO(e,r,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[a].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=o,this.log();var s=this.freeTextures[a].shift();return this.usedTextures[a].push(s),s}return r===ig.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):r===ig.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):r===ig.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):r===ig.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):r===ig.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[a].push(i),this.numUsedTextures++,this._numBytesAllocated+=o,this.log(),i}},{key:"releaseTexture",value:function(e,t,n,r){if(null!=this.freeTextures){var a=TO(n,r),o=EO(t,a,r);o in this.freeTextures||(this.freeTextures[o]=[]);var s=CO(t,a,this.gpgpu.gl,this.gpgpu.textureConfig,r),c=Object(i.Ud)().get("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==c&&this._numBytesAllocated>c?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=s):(this.freeTextures[o].push(e),this.numFreeTextures++,this._numBytesFree+=s),this.numUsedTextures--;var u=this.usedTextures[o],l=u.indexOf(e);if(l<0)throw new Error("Cannot release a texture that was never provided by this texture manager");u.splice(l,1),this.log()}}},{key:"log",value:function(){if(this.logEnabled){var e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used","".concat(this.numFreeTextures," / ").concat(this.numUsedTextures),"(".concat(e,")"));var t=this._numBytesFree/this._numBytesAllocated;console.log("Bytes allocated: ".concat(this._numBytesAllocated)),console.log("Bytes unused: ".concat(this._numBytesFree," (").concat(Math.round(100*t),"%)"))}}},{key:"numBytesAllocated",get:function(){return this._numBytesAllocated}},{key:"numBytesFree",get:function(){return this._numBytesFree}},{key:"getNumUsedTextures",value:function(){return this.numUsedTextures}},{key:"getNumFreeTextures",value:function(){return this.numFreeTextures}},{key:"dispose",value: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 n in this.usedTextures)this.usedTextures[n].forEach((function(t){e.gpgpu.deleteMatrixTexture(t)}));this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}]),e}();function CO(e,t,n,r,a){var i,s=function(e,t){switch(e){case ig.PACKED_2X2_FLOAT32:return iy(t);case ig.PACKED_2X2_FLOAT16:return oy(t);case ig.UNPACKED_FLOAT32:return ny(t);case ig.UNPACKED_FLOAT16:return ry(t);case ig.PACKED_4X1_UNSIGNED_BYTE:return ay(t);default:throw new Error("Unknown physical texture type ".concat(e))}}(t,r);if(a){var c=dg(e[0],e[1]),u=Object(o.a)(c,2);i=u[0]*u[1]}else{var l=ug(e[0],e[1]),d=Object(o.a)(l,2);i=d[0]*d[1]}return i*function(e,t){var n=e;if(t===n.R32F)return 4;if(t===n.R16F)return 2;if(t===n.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===n.RGBA16F)return 8;throw new Error("Unknown internal format ".concat(t))}(n,s)}function TO(e,t){if(e===ag.UPLOAD)return ig.PACKED_2X2_FLOAT32;if(e===ag.RENDER||null==e)return function(e){return Object(i.Ud)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?ig.PACKED_2X2_FLOAT32:ig.UNPACKED_FLOAT32:e?ig.PACKED_2X2_FLOAT16:ig.UNPACKED_FLOAT16}(t);if(e===ag.DOWNLOAD||e===ag.PIXELS)return ig.PACKED_4X1_UNSIGNED_BYTE;throw new Error("Unknown logical texture type ".concat(e))}function EO(e,t,n){return"".concat(e[0],"_").concat(e[1],"_").concat(t,"_").concat(n)}var AO=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["A"],this.outputShape=t,this.enableShapeUniforms=My(this.outputShape.length),this.userCode="\n float unaryOperation(float x) {\n ".concat(n,"\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n ")},RO="if (isnan(x)) return x;",FO="return x;",DO="return abs(x);";var _O="return (x >= 0.0) ? x : (exp(x) - 1.0);",MO=RO+"\n return (x < 0.0) ? 0.0 : x;\n",zO=RO+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",LO="return x;",PO="return 1.0 / (1.0 + exp(-1.0 * x));",BO="return x;",WO="\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n",UO="\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",VO="\n vec4 result = min(x, vec4(6.)) * 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",HO="return 1.0 / (1.0 + exp(-1.0 * x));",GO=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.enableShapeUniforms=My(this.outputShape.length),this.userCode="\n vec4 unaryOperation(vec4 x) {\n ".concat(n,"\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n ")},qO=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=t;var n=t.length,r=jO("rc",n),a=Cy(n),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}(n,r),o=r.slice(-2),s=n<=1?"rc":"vec2(".concat(o.join(","),")");this.userCode="\n void main() {\n ".concat(a," rc = getOutputCoords();\n vec4 packedInput = getA(").concat(i,");\n\n setOutput(getChannel(packedInput, ").concat(s,"));\n }\n ")},KO=i.ie.whereImpl,XO={};var YO=Object(i.Ud)().getNumber("CPU_HANDOFF_SIZE_THRESHOLD");var $O=function(e){Object(Qr.a)(n,e);var t=Object(Zr.a)(n);function n(e){var r,a;if(Object(Yr.a)(this,n),(r=t.call(this)).pendingRead=new WeakMap,r.pendingDisposal=new WeakSet,r.dataRefCount=new WeakMap,r.numBytesInGPU=0,r.uploadWaitMs=0,r.downloadWaitMs=0,r.lastGlFlushTime=0,r.warnedAboutMemory=!1,r.pendingDeletes=0,r.disposed=!1,!Object(i.Ud)().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(null==e){var o=cg(Object(i.Ud)().getNumber("WEBGL_VERSION"));r.binaryCache=((a=Object(i.Ud)().getNumber("WEBGL_VERSION"))in XO||(XO[a]={}),XO[a]),r.gpgpu=new cy(o),r.canvas=o.canvas,r.gpgpuCreatedLocally=!0}else r.gpgpu=e,r.binaryCache={},r.gpgpuCreatedLocally=!1,r.canvas=e.gl.canvas;return r.textureManager=new IO(r.gpgpu),r.numMBBeforeWarning=null==Object(i.Ud)().global.screen?1024:Object(i.Ud)().global.screen.height*Object(i.Ud)().global.screen.width*window.devicePixelRatio*600/1024/1024,r.texData=new i.L(Object(ta.a)(r),Object(i.Td)()),r}return Object($r.a)(n,[{key:"nextDataId",value:function(){return n.nextDataId++}},{key:"numDataIds",value:function(){return this.texData.numDataIds()-this.pendingDeletes}},{key:"write",value:function(e,t,n){if((Object(i.Ud)().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||Object(i.Ud)().getBool("DEBUG"))&&this.checkNumericalProblems(e),"complex64"===n&&null!=e)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");var r={id:this.nextDataId()};return this.texData.set(r,{shape:t,dtype:n,values:e,usage:ag.UPLOAD,refCount:1}),r}},{key:"refCount",value:function(e){return this.texData.has(e)?this.texData.get(e).refCount:0}},{key:"incRef",value:function(e){this.texData.get(e).refCount++}},{key:"decRef",value:function(e){this.texData.has(e)&&this.texData.get(e).refCount--}},{key:"move",value:function(e,t,n,r,a){if(Object(i.Ud)().getBool("DEBUG")&&this.checkNumericalProblems(t),"complex64"===r)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:r,values:t,usage:ag.UPLOAD,refCount:a})}},{key:"disposeIntermediateTensorInfo",value:function(e){this.disposeData(e.dataId)}},{key:"readSync",value:function(e){var t=this.texData.get(e),n=t.values,r=t.dtype,a=t.complexTensorInfos,o=t.slice,s=t.shape,c=t.isPacked;if(null!=o){var u;u=c?new GO(s,LO):new AO(s,LO);var l=this.runWebGLProgram(u,[{dataId:e,shape:s,dtype:r}],r),d=this.readSync(l.dataId);return this.disposeIntermediateTensorInfo(l),d}if(null!=n)return this.convertAndCacheOnCPU(e);if("string"===r)return n;var f,p,h=null!=this.activeTimers;if(h&&(f=i.wf.now()),"complex64"===r){var b=this.readSync(a.real.dataId),m=this.readSync(a.imag.dataId);p=i.ud.mergeRealAndImagArrays(b,m)}else p=this.getValuesFromTexture(e);return h&&(this.downloadWaitMs+=i.wf.now()-f),this.convertAndCacheOnCPU(e,p)}},{key:"read",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){var n,r,a,o,s,c,u,l,d,f,p,h,b,m,v,g,y,O,x,k,w,j,S;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.pendingRead.has(t)){e.next=3;break}return n=this.pendingRead.get(t),e.abrupt("return",new Promise((function(e){return n.push(e)})));case 3:if(r=this.texData.get(t),a=r.values,o=r.shape,s=r.slice,c=r.dtype,u=r.complexTensorInfos,l=r.isPacked,null==s){e.next=11;break}return d=l?new GO(o,LO):new AO(o,LO),f=this.runWebGLProgram(d,[{dataId:t,shape:o,dtype:c}],c),p=this.read(f.dataId),this.disposeIntermediateTensorInfo(f),e.abrupt("return",p);case 11:if(null==a){e.next=13;break}return e.abrupt("return",this.convertAndCacheOnCPU(t));case 13:if(Object(i.Ud)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")||2!==Object(i.Ud)().getNumber("WEBGL_VERSION")){e.next=15;break}throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");case 15:if(h=null,"complex64"!==c&&Object(i.Ud)().get("WEBGL_BUFFER_SUPPORTED")&&(b=this.decode(t),v=this.texData.get(b.dataId),h=(m=this.gpgpu).createBufferFromTexture.apply(m,[v.texture].concat(Object(Vn.a)(lg(o))))),this.pendingRead.set(t,[]),"complex64"===c){e.next=21;break}return e.next=21,this.gpgpu.createAndWaitForFence();case 21:if("complex64"!==c){e.next=30;break}return e.next=24,Promise.all([this.read(u.real.dataId),this.read(u.imag.dataId)]);case 24:y=e.sent,O=y[0],x=y[1],g=i.ud.mergeRealAndImagArrays(O,x),e.next=31;break;case 30:null==h?g=this.getValuesFromTexture(t):(k=i.wf.sizeFromShape(o),g=this.gpgpu.downloadFloat32MatrixFromBuffer(h,k));case 31:return null!=b&&this.disposeIntermediateTensorInfo(b),null!=h&&pg(w=this.gpgpu.gl,(function(){return w.deleteBuffer(h)})),j=this.convertAndCacheOnCPU(t,g),S=this.pendingRead.get(t),this.pendingRead.delete(t),S.forEach((function(e){return e(j)})),this.pendingDisposal.has(t)&&(this.pendingDisposal.delete(t),this.disposeData(t)&&Object(i.Td)().removeDataId(t,this),this.pendingDeletes--),e.abrupt("return",j);case 39:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"bufferSync",value:function(e){var t=this.readSync(e.dataId),n=t;if("string"===e.dtype)try{n=t.map((function(e){return i.wf.decodeString(e)}))}catch(r){throw new Error("Failed to decode encoded string bytes into utf-8")}return Object(i.zd)(e.shape,e.dtype,n)}},{key:"checkNumericalProblems",value:function(e){if(null!=e)for(var t=0;t<e.length;t++){var n=e[t];if(!hg(n)){if(Object(i.Ud)().getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))throw Error("The value ".concat(n," cannot be represented with your ")+"current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'");throw Error("The value ".concat(n," cannot be represented on this device."))}}}},{key:"getValuesFromTexture",value:function(e){var t=this.texData.get(e),n=t.shape,r=t.dtype,a=t.isPacked,o=i.wf.sizeFromShape(n);if(Object(i.Ud)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){var s,c=this.decode(e),u=this.texData.get(c.dataId),l=(s=this.gpgpu).downloadMatrixFromPackedTexture.apply(s,[u.texture].concat(Object(Vn.a)(lg(n)))).subarray(0,o);return this.disposeIntermediateTensorInfo(c),l}var d=Object(i.Ud)().getBool("WEBGL_PACK")&&!0===a,f=d?Rg(n):n,p=d?new Yg(f):new Xg(f),h=this.runWebGLProgram(p,[{shape:f,dtype:r,dataId:e}],"float32"),b=this.texData.get(h.dataId),m=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(b.texture,b.texShape[0],b.texShape[1]).subarray(0,o);return this.disposeIntermediateTensorInfo(h),m}},{key:"timerAvailable",value:function(){return Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0}},{key:"time",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){var n,r,a,o,s,c,u;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.activeTimers,r=[],a=!1,null==this.programTimersStack?(this.programTimersStack=r,a=!0):this.activeTimers.push(r),this.activeTimers=r,t(),o=i.wf.flatten(this.activeTimers.map((function(e){return e.query}))).filter((function(e){return null!=e})),s=i.wf.flatten(this.activeTimers.map((function(e){return e.name}))).filter((function(e){return null!=e})),this.activeTimers=n,a&&(this.programTimersStack=null),c={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},!(Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)){e.next=19;break}return e.next=14,Promise.all(o);case 14:u=e.sent,c.kernelMs=i.wf.sum(u),c.getExtraProfileInfo=function(){return u.map((function(e,t){return{name:s[t],ms:e}})).map((function(e){return"".concat(e.name,": ").concat(e.ms)})).join(", ")},e.next=20;break;case 19:c.kernelMs={error:"WebGL query timers are not supported in this environment."};case 20:return this.uploadWaitMs=0,this.downloadWaitMs=0,e.abrupt("return",c);case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"memory",value:function(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}},{key:"startTimer",value:function(){return Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:i.wf.now(),endMs:null}}},{key:"endTimer",value:function(e){return Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=i.wf.now(),e)}},{key:"getQueryTime",value:function(){var e=Object(go.a)(vo.a.mark((function e(t){var n;return vo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(Object(i.Ud)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)){e.next=2;break}return e.abrupt("return",this.gpgpu.waitForQueryAndGetTime(t));case 2:return n=t,e.abrupt("return",n.endMs-n.startMs);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disposeData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.pendingDisposal.has(e))return!1;if(!this.texData.has(e))return!0;if(t?this.texData.get(e).refCount=0:this.texData.get(e).refCount--,!t&&this.texData.get(e).refCount>0)return!1;if(this.pendingRead.has(e))return this.pendingDisposal.add(e),this.pendingDeletes++,!1;this.releaseGPUData(e);var n=this.texData.get(e),r=n.complexTensorInfos;return null!=r&&(this.disposeData(r.real.dataId,t),this.disposeData(r.imag.dataId,t)),this.texData.delete(e),!0}},{key:"releaseGPUData",value:function(e){var t=this.texData.get(e),n=t.texture,r=t.dtype,a=t.texShape,i=t.usage,o=t.isPacked,s=t.slice,c=s&&s.origDataId||e,u=this.dataRefCount.get(c);u>1?this.dataRefCount.set(c,u-1):(this.dataRefCount.delete(c),null!=n&&(this.numBytesInGPU-=this.computeBytes(a,r),this.textureManager.releaseTexture(n,a,i,o)));var l=this.texData.get(e);l.texture=null,l.texShape=null,l.isPacked=!1,l.slice=null}},{key:"getTexture",value:function(e){return this.uploadToGPU(e),this.texData.get(e).texture}},{key:"getDataInfo",value:function(e){return this.texData.get(e)}},{key:"shouldExecuteOnCPU",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:YO;return Object(i.Ud)().getBool("WEBGL_CPU_FORWARD")&&e.every((function(e){return null==t.texData.get(e.dataId).texture&&i.wf.sizeFromShape(e.shape)<n}))}},{key:"getGPGPUContext",value:function(){return this.gpgpu}},{key:"where",value:function(e){i.ud.warn("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");var t=e.dataSync();return KO(e.shape,t)}},{key:"packedUnaryOp",value:function(e,t,n){var r=new GO(e.shape,t),a=this.compileAndRun(r,[e],n);return Object(i.Td)().makeTensorFromDataId(a.dataId,a.shape,a.dtype)}},{key:"abs",value:function(e){if(this.shouldExecuteOnCPU([e])&&"complex64"!==e.dtype){var t=uO(this.texData.get(e.dataId).values);return this.makeOutput(e.shape,e.dtype,t)}if(Object(i.Ud)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,DO,e.dtype);var n=new AO(e.shape,DO),r=this.compileAndRun(n,[e]);return Object(i.Td)().makeTensorFromDataId(r.dataId,r.shape,r.dtype)}},{key:"makeTensorInfo",value:function(e,t,n){var r;if("string"===t&&null!=n&&n.length>0&&i.wf.isString(n[0])){var a=n.map((function(e){return i.wf.encodeString(e)}));r=this.write(a,e,t)}else r=this.write(n,e,t);return this.texData.get(r).usage=null,{dataId:r,shape:e,dtype:t}}},{key:"makeOutput",value:function(e,t,n){var r=this.makeTensorInfo(e,t,n).dataId;return Object(i.Td)().makeTensorFromDataId(r,e,t,this)}},{key:"unpackTensor",value:function(e){var t=new qO(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}},{key:"packTensor",value:function(e){var t=new SO(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}},{key:"packedReshape",value:function(e,t){var n=[Eg(e.shape)].concat(Object(Vn.a)(Ag(e.shape))),r={dtype:e.dtype,shape:n,dataId:e.dataId},a=[Eg(t)].concat(Object(Vn.a)(Ag(t))),i=new NO(a,n),o=this.runWebGLProgram(i,[r],e.dtype,null,!0);return{dataId:o.dataId,shape:t,dtype:o.dtype}}},{key:"decode",value:function(e){var t,n=this.texData.get(e),r=n.isPacked,a=n.shape,i=n.dtype,o=Rg(a);t=r?new Kg(o):new qg(o);return{dtype:i,shape:a,dataId:this.runWebGLProgram(t,[{shape:o,dtype:i,dataId:e}],i,null,!0).dataId}}},{key:"runWebGLProgram",value:function(e,t,n,r){var a=this,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=this.makeTensorInfo(e.outputShape,n),c=this.texData.get(s.dataId);if(e.packedOutput&&(c.isPacked=!0),e.outPackingScheme===rg.DENSE){var u=lg(e.outputShape);c.texShape=u.map((function(e){return 2*e}))}if(null!=e.outTexUsage&&(c.usage=e.outTexUsage),0===i.wf.sizeFromShape(s.shape))return c.values=i.wf.getTypedArrayFromDType(s.dtype,0),s;var l=[],d=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=a.texData.get(t.dataId);if(null==n.texture){if(!e.packedInputs&&i.wf.sizeFromShape(t.shape)<=Object(i.Ud)().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:n.values};e.packedInputs&&(n.isPacked=!0,n.shape=t.shape)}else if(!!n.isPacked!==!!e.packedInputs)t=n.isPacked?a.unpackTensor(t):a.packTensor(t),l.push(t),n=a.texData.get(t.dataId);else if(n.isPacked&&!Dg(n.shape,t.shape)){var r=t,o=t.shape;t.shape=n.shape,t=a.packedReshape(t,o),l.push(t),n=a.texData.get(t.dataId),r.shape=o}return a.uploadToGPU(t.dataId),{shape:t.shape,texData:n,isUniform:!1}}));this.uploadToGPU(s.dataId);var f,p={shape:s.shape,texData:c,isUniform:!1},h=_y(e,d,p),b=this.getAndSaveBinary(h,(function(){return Ry(a.gpgpu,e,d,p)})),m=null!=this.activeTimers;m&&(f=this.startTimer()),Dy(this.gpgpu,b,d,p,r),l.forEach((function(e){return a.disposeIntermediateTensorInfo(e)})),m&&(f=this.endTimer(f),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(f)}));var v=Object(i.Ud)().get("WEBGL_FLUSH_THRESHOLD");if(v>0){var g=i.wf.now();g-this.lastGlFlushTime>v&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=g)}if(!Object(i.Ud)().getBool("WEBGL_LAZILY_UNPACK")&&c.isPacked&&!1===o){var y=this.unpackTensor(s);return this.disposeIntermediateTensorInfo(s),y}return s}},{key:"compileAndRun",value:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n=n||t[0].dtype;var i=this.runWebGLProgram(e,t,n,r,a);return i}},{key:"getAndSaveBinary",value:function(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}},{key:"getTextureManager",value:function(){return this.textureManager}},{key:"dispose",value:function(){var e=this;if(!this.disposed){if(!Object(i.Ud)().getBool("IS_TEST"))Object.keys(this.binaryCache).forEach((function(t){e.gpgpu.deleteProgram(e.binaryCache[t].webGLProgram),delete e.binaryCache[t]}));this.textureManager.dispose(),null!=this.canvas&&"undefined"!==typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0}}},{key:"floatPrecision",value:function(){var e=this;return null==this.floatPrecisionValue&&(this.floatPrecisionValue=Object(i.pf)((function(){if(!Object(i.Ud)().get("WEBGL_RENDER_FLOAT32_ENABLED")){var t=Object(i.Ud)().getBool("DEBUG");Object(i.Ud)().set("DEBUG",!1);var n=e.abs(Object(i.Pe)(1e-8)).dataSync()[0];if(Object(i.Ud)().set("DEBUG",t),n>0)return 32}return 16}))),this.floatPrecisionValue}},{key:"epsilon",value:function(){return 32===this.floatPrecision()?1e-7:1e-4}},{key:"uploadToGPU",value:function(e){var t=this.texData.get(e),n=t.shape,r=t.dtype,a=t.values,s=t.texture,c=t.usage,u=t.isPacked;if(null==s){var l,d=null!=this.activeTimers;d&&(l=i.wf.now());var f=t.texShape;if(null==f&&(f=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Object(i.Ud)().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(t&&(n*=2,1===(e=e.map((function(t,n){return n>=e.length-2?i.wf.nearestLargerEven(e[n]):e[n]}))).length&&(e=[2,e[0]])),2!==e.length){var r=i.wf.squeezeShape(e);e=r.newShape}var a=i.wf.sizeFromShape(e);if(e.length<=1&&a<=n)return[1,a];if(2===e.length&&e[0]<=n&&e[1]<=n)return e;if(3===e.length&&e[0]*e[1]<=n&&e[2]<=n)return[e[0]*e[1],e[2]];if(3===e.length&&e[0]<=n&&e[1]*e[2]<=n)return[e[0],e[1]*e[2]];if(4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n)return[e[0]*e[1]*e[2],e[3]];if(4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n)return[e[0],e[1]*e[2]*e[3]];if(t){var s=Eg(e),c=2,u=2;if(e.length){var l=Ag(e),d=Object(o.a)(l,2);c=d[0],u=d[1]}return a=s*(c/2)*(u/2),i.wf.sizeToSquarishShape(a).map((function(e){return 2*e}))}return i.wf.sizeToSquarishShape(a)}(n,u),t.texShape=f),null!=a){var p,h=Rg(n),b=f[1],m=f[0],v=a instanceof Uint8Array;if(u){var g=dg(f[0],f[1]),y=Object(o.a)(g,2);b=y[0],m=y[1],p=new Qg(h,[m,b],v)}else p=new $g(h,[m,b],v);var O=this.makeTensorInfo([m,b],r);this.texData.get(O.dataId).usage=v?ag.PIXELS:ag.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(O.dataId),b,m,a);var x=this.runWebGLProgram(p,[O],r,null,!0),k=this.texData.get(x.dataId);t.texture=k.texture,t.texShape=k.texShape,t.isPacked=k.isPacked,t.usage=k.usage,this.disposeIntermediateTensorInfo(O),this.texData.delete(x.dataId),t.values=null,d&&(this.uploadWaitMs+=i.wf.now()-l)}else{var w=this.acquireTexture(f,c,r,u);t.texture=w}}}},{key:"convertAndCacheOnCPU",value: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 ".concat(t))}(t,r)),n.values}},{key:"acquireTexture",value:function(e,t,n,r){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){var a=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn("High memory usage in GPU: ".concat(a," MB, ")+"most likely due to a memory leak")}return this.textureManager.acquireTexture(e,t,r)}},{key:"computeBytes",value:function(e,t){return e[0]*e[1]*i.wf.bytesPerElement(t)}}]),n}(i.wb);$O.nextDataId=0;i.Od.isBrowser()&&Object(i.Ke)("webgl",(function(){return new $O}),2);var QO=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["A","B"],this.outputShape=i.ud.assertAndGetBroadcastShape(n,r),this.enableShapeUniforms=My(this.outputShape.length),this.userCode="\n float binaryOperation(float a, float b) {\n ".concat(t,"\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n ")},ZO=function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object(Yr.a)(this,e),this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=i.ud.assertAndGetBroadcastShape(n,r);var o=this.outputShape.length;this.enableShapeUniforms=My(o);var s="";if(a)if(0===o||1===i.wf.sizeFromShape(this.outputShape))s="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{var c=Cy(o);if(s="\n ".concat(c," coords = getOutputCoords();\n "),1===o)this.enableShapeUniforms?s+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":s+="\n result.y = (coords + 1) >= ".concat(this.outputShape[0]," ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ");else{var u=jO("coords",o);this.enableShapeUniforms?s+="\n bool nextRowOutOfBounds =\n (".concat(u[o-2]," + 1) >= outShape[").concat(o," - 2];\n bool nextColOutOfBounds =\n (").concat(u[o-1]," + 1) >= outShape[").concat(o," - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n "):s+="\n bool nextRowOutOfBounds =\n (".concat(u[o-2]," + 1) >= ").concat(this.outputShape[o-2],";\n bool nextColOutOfBounds =\n (").concat(u[o-1]," + 1) >= ").concat(this.outputShape[o-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 ".concat(t,"\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ").concat(s,"\n\n setOutput(result);\n }\n ")};function JO(e){var t=e.inputs,n=e.backend,r=t.x;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}var ex={kernelName:i.rb,backendName:"webgl",kernelFunc:JO};function tx(e){var t=e.inputs,n=e.backend,r=t.real,a=t.imag,i=n.makeTensorInfo(r.shape,"complex64"),o=n.texData.get(i.dataId),s=JO({inputs:{x:r},backend:n}),c=JO({inputs:{x:a},backend:n});return o.complexTensorInfos={real:s,imag:c},i}var nx={kernelName:i.y,backendName:"webgl",kernelFunc:tx},rx="return (a < 0.) ? b * a : a;",ax="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";var ix={kernelName:i.zb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.alpha,s=n.makeTensorInfo([],"float32",i.wf.createScalarValue(o,"float32")),c=Object(i.Ud)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ZO(ax,a.shape,s.shape):new QO(rx,a.shape,s.shape),u=n.runWebGLProgram(c,[a,s],a.dtype);return n.disposeIntermediateTensorInfo(s),u}},ox="return (a < 0.) ? b * a : a;",sx="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";var cx={kernelName:i.hc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x,a=t.alpha,o=Object(i.Ud)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ZO(sx,r.shape,a.shape):new QO(ox,r.shape,a.shape);return n.runWebGLProgram(o,[r,a],r.dtype)}};function ux(e){var t=e.opSnippet,n=e.packedOpSnippet,r=e.cpuKernelImpl,a=e.dtype;return function(e){var o,s=e.inputs,c=e.backend,u=s.x,l=c,d=a||u.dtype;if(l.shouldExecuteOnCPU([u])&&null!=r){var f=l.texData.get(u.dataId),p=r(f.values,d);return l.makeTensorInfo(u.shape,d,p)}return o=Object(i.Ud)().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=n?new GO(u.shape,n):new AO(u.shape,t),l.runWebGLProgram(o,[u],d)}}function lx(e){var t=e.opSnippet,n=e.packedOpSnippet,r=e.checkOutOfBounds,a=void 0!==r&&r,s=e.supportsComplex,c=void 0!==s&&s,u=e.cpuKernelImpl,l=e.dtype;return function(e){var r=e.inputs,s=e.backend,d=r.a,f=r.b,p=s;if(c&&"complex64"===d.dtype){var h=p.texData.get(d.dataId),b=p.texData.get(f.dataId),m=[[h.complexTensorInfos.real,b.complexTensorInfos.real],[h.complexTensorInfos.imag,b.complexTensorInfos.imag]].map((function(e){var n=Object(o.a)(e,2),r=n[0],a=n[1],s={dataId:r.dataId,dtype:r.dtype,shape:d.shape},c={dataId:a.dataId,dtype:a.dtype,shape:f.shape},u=new QO(t,d.shape,f.shape);return p.runWebGLProgram(u,[s,c],Object(i.vf)(r.dtype,a.dtype))})),v=Object(o.a)(m,2),g=v[0],y=v[1],O=tx({inputs:{real:g,imag:y},backend:p});return p.disposeIntermediateTensorInfo(g),p.disposeIntermediateTensorInfo(y),O}var x,k=l||Object(i.vf)(d.dtype,f.dtype);if(("string"===d.dtype||"string"===f.dtype||p.shouldExecuteOnCPU([d,f]))&&null!=u){var w=p.texData.get(d.dataId).values,j=p.texData.get(f.dataId).values,S="string"===d.dtype?i.ud.fromUint8ToStringArray(w):w,N="string"===d.dtype?i.ud.fromUint8ToStringArray(j):j,I=u(d.shape,f.shape,S,N,k),C=Object(o.a)(I,2),T=C[0],E=C[1],A=p.makeTensorInfo(E,k);return p.texData.get(A.dataId).values=T,A}return x=Object(i.Ud)().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=n?new ZO(n,d.shape,f.shape,a):new QO(t,d.shape,f.shape),p.runWebGLProgram(x,[d,f],k)}}function dx(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("linear"===e)return t?BO:FO;if("relu"===e)return t?UO:MO;if("elu"===e)return t?WO:_O;if("relu6"===e)return t?VO:zO;if("prelu"===e)return t?sx:ox;if("leakyrelu"===e)return t?ax:rx;if("sigmoid"===e)return t?HO:PO;throw new Error("Activation ".concat(e," has not been implemented for the WebGL backend."))}var fx=function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,c=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Object(Yr.a)(this,e),this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=r;var l=a?t[1]:t[2],d=Math.ceil(l/2),f=a?"i * 2, rc.y":"rc.y, i * 2",p=i?"rc.z, i * 2":"i * 2, rc.z",h=a?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],b=i?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],m="",v="";s&&(m=c?"vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ".concat(s,"\n }"):u?"vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ".concat(s,"\n }"):"vec4 activation(vec4 x) {\n ".concat(s,"\n }"),v="result = activation(result);");var g=o?"result += getBiasAtOutCoords();":"";o&&this.variableNames.push("bias"),c&&this.variableNames.push("preluActivationWeights"),u&&this.variableNames.push("leakyreluAlpha");var y="rc.x",O="rc.x";t[0]<n[0]?y="int(min(float(rc.x), ".concat(t[0]-1,".))"):n[0]<t[0]&&(O="int(min(float(rc.x), ".concat(n[0]-1,".))")),this.userCode="\n ".concat(m,"\n\n const float sharedDimension = ").concat(d,".0;\n\n vec4 dot2x2ARowBCol(ivec3 rc) {\n vec4 result = vec4(0);\n for (int i = 0; i < ").concat(d,"; i++) {\n int batchA = ").concat(y,";\n int batchB = ").concat(O,";\n vec4 a = getMatrixA(batchA, ").concat(f,");\n vec4 b = getMatrixB(batchB, ").concat(p,");\n\n // These swizzled products need to be separately added.\n // See: https://github.com/tensorflow/tfjs/issues/1735\n result += (").concat(h[0]," * ").concat(b[0],");\n result += (").concat(h[1]," * ").concat(b[1],");\n }\n return result;\n }\n\n void main() {\n ivec3 rc = getOutputCoords();\n vec4 result = dot2x2ARowBCol(rc);\n\n ").concat(g,"\n\n ").concat(v,"\n\n setOutput(result);\n }\n ")},px="return areal * breal - aimag * bimag;",hx="return areal * bimag + aimag * breal;",bx=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=i.ud.assertAndGetBroadcastShape(n,r),this.userCode="\n float binaryOpComplex(\n float areal, float aimag, float breal, float bimag) {\n ".concat(t,"\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 ")},mx="return a * b;";function vx(e){var t,n=e.inputs,r=e.backend,a=n.a,s=n.b,c=i.ud.upcastType(a.dtype,s.dtype);if("complex64"===a.dtype){var u=r.texData.get(a.dataId),l=r.texData.get(s.dataId),d=new bx(px,a.shape,s.shape),f=new bx(hx,a.shape,s.shape),p=[{dataId:u.complexTensorInfos.real.dataId,dtype:u.complexTensorInfos.real.dtype,shape:a.shape},{dataId:u.complexTensorInfos.imag.dataId,dtype:u.complexTensorInfos.imag.dtype,shape:a.shape},{dataId:l.complexTensorInfos.real.dataId,dtype:l.complexTensorInfos.real.dtype,shape:s.shape},{dataId:l.complexTensorInfos.imag.dataId,dtype:l.complexTensorInfos.imag.dtype,shape:s.shape}],h=r.runWebGLProgram(d,p,"float32"),b=r.runWebGLProgram(f,p,"float32"),m=tx({inputs:{real:h,imag:b},backend:r});return r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(b),m}if(r.shouldExecuteOnCPU([a,s])){var v=r.texData.get(a.dataId),g=r.texData.get(s.dataId),y=rO(a.shape,s.shape,v.values,g.values,c),O=Object(o.a)(y,2),x=O[0],k=O[1],w=r.makeTensorInfo(k,c);return r.texData.get(w.dataId).values=x,w}return t=Object(i.Ud)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ZO(mx,a.shape,s.shape):new QO(mx,a.shape,s.shape),r.runWebGLProgram(t,[a,s],c)}var gx={kernelName:i.Vb,backendName:"webgl",kernelFunc:vx};function yx(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.shape,s=n,c=i.wf.sizeFromShape(a.shape),u=i.wf.inferFromImplicitShape(o,c),l=i.wf.sizeFromShape(u);i.wf.assert(c===l,(function(){return"The new shape (".concat(u,") has ").concat(l," elements and the old ")+"shape (".concat(a.shape,") has ").concat(c," elements. The new shape and old ")+"shape must have the same number of elements."}));var d=s.texData.get(a.dataId);return!d.isPacked||Dg(a.shape,u)||null!==d.texture&&Dg(d.shape,u)?(s.incRef(a.dataId),{dataId:a.dataId,shape:u,dtype:a.dtype}):function(e,t,n){var r=[Eg(e.shape)].concat(Object(Vn.a)(Ag(e.shape))),a={dtype:e.dtype,shape:r,dataId:e.dataId},i=[Eg(t)].concat(Object(Vn.a)(Ag(t))),o=new NO(i,r),s=n.runWebGLProgram(o,[a],e.dtype,null,!0);return{dataId:s.dataId,shape:t,dtype:s.dtype}}(a,u,s)}var Ox={kernelName:i.pc,backendName:"webgl",kernelFunc:yx},xx=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["x"];var r=t.windowSize,a=t.batchSize,o=t.inSize,s=t.outSize;this.outputShape=[a,s];var c=4*Math.floor(r/4),u=r%4,l="sumValue += dot(values, ones);";if(null!=n){var d=1/n;l="sumValue += dot(values * ".concat(i.wf.isInt(d)?d.toPrecision(2):d,", ones);")}var f="";o%r>0&&(f="\n if (inIdx < 0 || inIdx >= ".concat(o,") {\n return 0.0;\n }\n ")),this.userCode="\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ".concat(f,"\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 * ").concat(r,";\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ").concat(c,"; 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 ").concat(l,"\n }\n\n int inIdx = inOffset + ").concat(c,";\n if (").concat(1===u,") {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ").concat(l,"\n } else if (").concat(2===u,") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ").concat(l,"\n } else if (").concat(3===u,") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ").concat(l,"\n }\n setOutput(sumValue);\n }\n ")},kx=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["x"];var r=t.windowSize,a=t.batchSize,i=t.inSize,o=t.outSize;this.outputShape=[a,o];var s="0.0",c="";"prod"===n?s="1.0":"min"===n?(s="1.0 / 1e-20",c="min"):"max"===n&&(s="-1.0 / 1e-20",c="max");var u="".concat(n,"(").concat(n,"(").concat(n,"(")+"minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum"===n?u="sumValue":"prod"===n?u="prodValue":"all"===n?u="allValue":"any"===n&&(u="anyValue");var l=4*Math.floor(r/4),d=r%4,f="\n if (".concat("sum"===n,") {\n sumValue += dot(values, ones);\n } else if (").concat("prod"===n,") {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ").concat(c,"(values, minMaxValue);\n if (").concat("min"===n," || ").concat("max"===n,") {\n minMaxValue = ").concat(c,"(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n "),p="vec4";"all"===n?(s="1.0",f="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",p="bvec4"):"any"===n&&(s="0.0",f="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",p="bvec4");var h="";i%r>0&&(h="\n if (inIdx < 0 || inIdx >= ".concat(i,") {\n return initializationValue;\n }\n ")),this.userCode="\n const float initializationValue = ".concat(s,";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ").concat(h,"\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 * ").concat(r,";\n\n vec4 minMaxValue = vec4(").concat(s,");\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 < ").concat(l,"; i += 4) {\n int inIdx = inOffset + i;\n ").concat(p," values = ").concat(p,"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ").concat(f,"\n }\n\n int inIdx = inOffset + ").concat(l,";\n if (").concat(1===d,") {\n ").concat(p," values = ").concat(p,"(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ").concat(f,"\n } else if (").concat(2===d,") {\n ").concat(p," values = ").concat(p,"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ").concat(f,"\n } else if (").concat(3===d,") {\n ").concat(p," values = ").concat(p,"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ").concat(f,"\n }\n setOutput(").concat(u,");\n }\n ")};function wx(e,t,n,r){for(var a=function(e){for(var t=[];0===t.length||1!==t[t.length-1].outSize;){var n=t.length?t[t.length-1].outSize:e[1],r=i.ud.computeOptimalWindowSize(n);t.push({inSize:n,windowSize:r,outSize:Math.ceil(n/r)})}return t}(e.shape),o=e,s=0;s<a.length;s++){var c,u=a[s],l=u.inSize,d=u.windowSize,f=u.outSize,p=void 0;p="mean"===n?0===s?new xx({windowSize:d,inSize:l,batchSize:e.shape[0],outSize:f},l):new xx({windowSize:d,inSize:l,batchSize:e.shape[0],outSize:f}):new kx({windowSize:d,inSize:l,batchSize:e.shape[0],outSize:f},n),c=o,o=r.runWebGLProgram(p,[o],t),c.dataId!==e.dataId&&r.disposeIntermediateTensorInfo(c)}return o}var jx=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["A"];for(var r=new Array(t.length),a=0;a<r.length;a++)r[a]=t[n[a]];this.outputShape=r,this.rank=r.length;var i=Cy(this.rank),o=function(e){var t=e.length;if(t>6)throw Error("Transpose for rank ".concat(t," is not yet supported"));for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(t),a=0;a<e.length;a++)r[e[a]]=n[a];return r.join()}(n);this.userCode="\n void main() {\n ".concat(i," resRC = getOutputCoords();\n setOutput(getA(").concat(o,"));\n }\n ")};var Sx=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;for(var r=new Array(t.length),a=0;a<r.length;a++)r[a]=t[n[a]];if(this.outputShape=r,this.rank=r.length,this.rank>6)throw Error("Packed transpose for rank ".concat(this.rank," is not yet supported."));for(var i=Cy(this.rank),o=wO("rc",this.rank),s=new Array(this.rank),c=0;c<n.length;c++)s[n[c]]=o[c];var u="vec2(".concat(s.slice(-2).join(),")"),l="++".concat(o[this.rank-1]," < ").concat(r[this.rank-1]),d="getChannel(getA(".concat(s.join(),"), ").concat(u,")");this.userCode="\n void main() {\n ".concat(i," rc = getOutputCoords();\n vec4 result = vec4(0.);\n result[0] = ").concat(d,";\n if(").concat(l,") {\n result[1] = ").concat(d,";\n }\n --").concat(o[this.rank-1],";\n if(++").concat(o[this.rank-2]," < ").concat(r[this.rank-2],") {\n result[2] = ").concat(d,";\n if(").concat(l,") {\n result[3] = ").concat(d,";\n }\n }\n setOutput(result);\n }\n ")};function Nx(e,t,n){var r=Object(i.Ud)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Sx(e.shape,t):new jx(e.shape,t);return n.runWebGLProgram(r,[e],e.dtype)}function Ix(e){var t=e.inputs,n=e.backend,r=e.attrs;return function(e,t,n,r){var a=t,s=e.shape.length,c=i.wf.parseAxisParam(a,e.shape),u=c,l=i.ud.getAxesPermutation(u,s),d=null!=l,f=e;d&&(f=Nx(e,l,r),u=i.ud.getInnerMostAxes(u.length,s)),i.ud.assertAxesAreInnerMostDims("sum",u,s);var p=i.ud.computeOutAndReduceShapes(f.shape,u),h=Object(o.a)(p,2),b=h[0],m=h[1],v=b;n&&(v=i.ud.expandShapeToKeepDim(b,c));var g=i.wf.sizeFromShape(m),y=yx({inputs:{x:f},attrs:{shape:[i.wf.sizeFromShape(e.shape)/g,g]},backend:r}),O=wx(y,Object(i.jf)(e.dtype),"sum",r),x=yx({inputs:{x:O},attrs:{shape:v},backend:r});return r.disposeIntermediateTensorInfo(y),r.disposeIntermediateTensorInfo(O),d&&r.disposeIntermediateTensorInfo(f),x}(t.x,r.axis,r.keepDims,n)}var Cx={kernelName:i.Yc,backendName:"webgl",kernelFunc:Ix};function Tx(e){for(var t,n=e.inputs,r=e.backend,a=e.attrs,i=n.x,o=a.perm,s=r,c=i.shape.length,u=new Array(c),l=0;l<u.length;l++)u[l]=i.shape[o[l]];if(s.shouldExecuteOnCPU([i])){var d=s.texData.get(i.dataId).values,f=xO(d,i.shape,i.dtype,o,u);t=s.makeTensorInfo(u,i.dtype),s.texData.get(t.dataId).values=f}else t=Nx(i,o,s);return t}var Ex={kernelName:i.gd,backendName:"webgl",kernelFunc:Tx};function Ax(e){var t=e.a,n=e.b,r=e.transposeA,a=e.transposeB,o=e.backend,s=e.bias,c=void 0===s?null:s,u=e.preluActivationWeights,l=void 0===u?null:u,d=e.leakyreluAlpha,f=void 0===d?0:d,p=e.activation,h=void 0===p?null:p,b=t.shape.length,m=n.shape.length,v=r?t.shape[b-2]:t.shape[b-1],g=a?n.shape[m-1]:n.shape[m-2],y=r?t.shape[b-1]:t.shape[b-2],O=a?n.shape[m-2]:n.shape[m-1],x=t.shape.slice(0,-2),k=n.shape.slice(0,-2),w=i.wf.sizeFromShape(x),j=i.wf.sizeFromShape(k),S=w===j||1===w||1===j;i.wf.assert(b>=2&&m>=2&&S,(function(){return"Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input "+"batch dimensions of (".concat(x,") and (").concat(k,").")}));var N=(w>j?t.shape.slice(0,-2):n.shape.slice(0,-2)).concat([y,O]);i.wf.assert(v===g,(function(){return"Error in matMul: inner shapes (".concat(v,") and (")+"".concat(g,") of Tensors with shapes ").concat(t.shape," and ")+"".concat(n.shape," and transposeA=").concat(r)+" and transposeB=".concat(a," must match.")}));var I,C=r?[w,v,y]:[w,y,v],T=a?[j,O,g]:[j,g,O],E=yx({inputs:{x:t},backend:o,attrs:{shape:C}}),A=yx({inputs:{x:n},backend:o,attrs:{shape:T}}),R=[E,A],F=Math.max(w,j),D=r?E.shape[1]:E.shape[2],_=null!=c,M=null!=l,z="leakyrelu"===h,L=null!=h?dx(h,!0):null;if((1===y||1===O)&&D>1e3&&!1===(_||M||z||null!=L)){var P=E,B=A;r&&(P=Tx({inputs:{x:E},backend:o,attrs:{perm:[0,2,1]}}),R.push(P)),a&&(B=Tx({inputs:{x:A},backend:o,attrs:{perm:[0,2,1]}}),R.push(B));var W=1===O,U=P;1!==O&&(U=yx({inputs:{x:P},backend:o,attrs:{shape:[F,D,1]}}),R.push(U));var V=1===O?2:1,H=B;W&&(H=yx({inputs:{x:B},backend:o,attrs:{shape:[F,1,D]}}),R.push(H));var G=vx({inputs:{a:U,b:H},backend:o});I=Ix({inputs:{x:G},backend:o,attrs:{axis:V,keepDims:!0}}),R.push(G)}else{var q=Object(i.vf)(t.dtype,n.dtype),K=new fx(C,T,[F,y,O],r,a,_,L,M,z),X=[E,A];if(null!=c&&X.push(c),M&&X.push(l),z){var Y=o.makeTensorInfo([],"float32",i.wf.createScalarValue(f,"float32"));X.push(Y),R.push(Y)}I=o.runWebGLProgram(K,X,q)}var $=yx({inputs:{x:I},backend:o,attrs:{shape:N}});R.push(I);for(var Q=0,Z=R;Q<Z.length;Q++){var J=Z[Q];o.disposeIntermediateTensorInfo(J)}return $}var Rx={kernelName:i.ld,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.a,i=t.b,o=t.bias,s=t.preluActivationWeights,c=r.transposeA,u=r.transposeB,l=r.activation;return Ax({a:a,b:i,transposeA:c,transposeB:u,backend:n,bias:o,preluActivationWeights:s,leakyreluAlpha:r.leakyreluAlpha,activation:l})}},Fx="return abs(x);";var Dx={kernelName:i.a,backendName:"webgl",kernelFunc:function(e){var t,n=e.inputs,r=e.backend,a=n.x;if(r.shouldExecuteOnCPU([a])&&"complex64"!==a.dtype){var o=r.texData.get(a.dataId),s=uO(o.values);return r.makeTensorInfo(a.shape,a.dtype,s)}return t=Object(i.Ud)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new GO(a.shape,Fx):new AO(a.shape,Fx),r.runWebGLProgram(t,[a],a.dtype)}},_x=ux({opSnippet:"if (isnan(x)) return x;\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),Mx={kernelName:i.b,backendName:"webgl",kernelFunc:_x},zx=ux({opSnippet:"if (isnan(x)) return x;\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),Lx={kernelName:i.c,backendName:"webgl",kernelFunc:zx},Px="return a + b;",Bx=lx({opSnippet:Px,packedOpSnippet:Px,supportsComplex:!0,cpuKernelImpl:zy}),Wx={kernelName:i.d,backendName:"webgl",kernelFunc:Bx},Ux=function e(t,n){Object(Yr.a)(this,e),this.outputShape=[],this.outputShape=t,this.variableNames=n.map((function(e,t){return"T".concat(t)}));var r=[];this.variableNames.forEach((function(e){r.push("float v".concat(e," = get").concat(e,"AtOutCoords();"))}));var a=this.variableNames.map((function(e){return"v".concat(e)})).join(" + ");this.userCode="\n void main() {\n ".concat(r.join("\n "),"\n\n float result = ").concat(a,";\n setOutput(result);\n }\n ")},Vx=function e(t,n){Object(Yr.a)(this,e),this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.variableNames=n.map((function(e,t){return"T".concat(t)}));var r=[];this.variableNames.forEach((function(e){r.push("vec4 v".concat(e," = get").concat(e,"AtOutCoords();"))}));var a=this.variableNames.map((function(e){return"v".concat(e)})).join(" + ");this.userCode="\n void main() {\n ".concat(r.join("\n "),"\n\n vec4 result = ").concat(a,";\n setOutput(result);\n }\n ")};var Hx={kernelName:i.e,backendName:"webgl",kernelFunc:function e(t){var n=t.inputs,r=t.backend,a=n;if(1===a.length)return JO({inputs:{x:a[0]},backend:r});if(a.length>Object(i.Ud)().get("WEBGL_MAX_TEXTURES_IN_SHADER")){var o=Math.floor(a.length/2),s=e({inputs:a.slice(0,o),backend:r}),c=e({inputs:a.slice(o),backend:r});return e({inputs:[s,c],backend:r})}var u=a.map((function(e){return e.dtype})).reduce((function(e,t){return Object(i.vf)(e,t)})),l=a.map((function(e){return e.shape})),d=Object(i.Ud)().getBool("WEBGL_PACK")?new Vx(a[0].shape,l):new Ux(a[0].shape,l);return r.runWebGLProgram(d,a,u)}};var Gx={kernelName:i.f,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.axis,c=r.keepDims,u=a.shape.length,l=i.wf.parseAxisParam(s,a.shape),d=l,f=i.ud.getAxesPermutation(d,u),p=a;null!=f&&(p=Tx({inputs:{x:a},backend:n,attrs:{perm:f}}),d=i.ud.getInnerMostAxes(d.length,u)),i.ud.assertAxesAreInnerMostDims("all",d,u);var h,b=i.ud.computeOutAndReduceShapes(p.shape,d),m=Object(o.a)(b,2),v=m[0],g=m[1],y=yx({inputs:{x:p},backend:n,attrs:{shape:[-1,i.wf.sizeFromShape(g)]}}),O=wx(y,y.dtype,"all",n);return h=yx(c?{inputs:{x:O},backend:n,attrs:{shape:i.ud.expandShapeToKeepDim(v,l)}}:{inputs:{x:O},backend:n,attrs:{shape:v}}),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(O),null!=f&&n.disposeIntermediateTensorInfo(p),h}};var qx={kernelName:i.g,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.axis,c=r.keepDims,u=a.shape.length,l=i.wf.parseAxisParam(s,a.shape),d=l,f=i.ud.getAxesPermutation(d,u),p=a;null!=f&&(p=Tx({inputs:{x:a},backend:n,attrs:{perm:f}}),d=i.ud.getInnerMostAxes(d.length,u)),i.ud.assertAxesAreInnerMostDims("any",d,u);var h,b=i.ud.computeOutAndReduceShapes(p.shape,d),m=Object(o.a)(b,2),v=m[0],g=m[1],y=yx({inputs:{x:p},backend:n,attrs:{shape:[-1,i.wf.sizeFromShape(g)]}}),O=wx(y,y.dtype,"any",n);return h=yx(c?{inputs:{x:O},backend:n,attrs:{shape:i.ud.expandShapeToKeepDim(v,l)}}:{inputs:{x:O},backend:n,attrs:{shape:v}}),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(O),null!=f&&n.disposeIntermediateTensorInfo(p),h}},Kx=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["A"];var a=t.windowSize,i=t.batchSize,o=t.outSize;r||this.variableNames.push("bestIndicesA"),this.outputShape=[i,o];var s="max"===n?">":"<",c=r?"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 * ".concat(a,";\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ").concat(a,"; i++) {\n int inIdx = ").concat(c,";\n float candidate = getA(batch, inIdx);\n if (candidate ").concat(s," bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n ")},Xx=function e(t,n,r,a){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,i.wf.assert(t.length>2,(function(){return"Packed arg".concat(r.charAt(0).toUpperCase()+r.slice(1)," supports only inputs with rank above 2.")}));var o=t[t.length-1],s=Math.ceil(o/n);this.outputShape=t.slice(0,-1),s>1&&this.outputShape.push(s),a||this.variableNames.push("bestIndicesA");var c,u,l=this.outputShape,d=l.length,f=Cy(d),p=jO("coords",d);if(1===s){var h=Cy(u=d+1);c="\n ".concat(h," sourceLocR = ").concat(h,"(").concat(p.join(),", 0);\n ++").concat(p[d-1],";\n ").concat(h," sourceLocG = ").concat(h,"(").concat(p.join(),", 0);\n ++").concat(p[d-2],";\n ").concat(h," sourceLocA = ").concat(h,"(").concat(p.join(),", 0);\n --").concat(p[d-1],";\n ").concat(h," sourceLocB = ").concat(h,"(").concat(p.join(),", 0);\n --").concat(p[d-2],";")}else u=d,c="\n ".concat(f," sourceLocR = coords;\n ++").concat(p[d-1],";\n ").concat(f," sourceLocG = coords;\n ++").concat(p[d-2],";\n ").concat(f," sourceLocA = coords;\n --").concat(p[d-1],";\n ").concat(f," sourceLocB = coords;\n --").concat(p[d-2],";");var b=["x","y","z","w","u","v"].slice(0,u),m="."+b[u-1],v=b.map((function(e){return"int "+e})),g=jO("sourceLocR",u-1).concat("inIdx.r"),y=jO("sourceLocG",u-1).concat("inIdx.g"),O=jO("sourceLocB",u-1).concat("inIdx.b"),x=jO("sourceLocA",u-1).concat("inIdx.a"),k="max"===r?"greaterThan":"lessThan",w=a?"":"\n inIdx = round(vec4(getBestIndicesAChannel(".concat(g.join(),"),\n getBestIndicesAChannel(").concat(y.join(),"),\n getBestIndicesAChannel(").concat(O.join(),"),\n getBestIndicesAChannel(").concat(x.join(),")));"),j="vec4(\n getAChannel(".concat(g.join(),"),\n hasNextCol ? getAChannel(").concat(y.join(),") : 0.,\n hasNextRow ? getAChannel(").concat(O.join(),") : 0.,\n hasNextRow && hasNextCol ? getAChannel(").concat(x.join(),") : 0.)"),S=a?"":"\n float getBestIndicesAChannel(".concat(v.join(),") {\n return getChannel(getBestIndicesA(").concat(b.join(),"),\n vec2(").concat(b.slice(-2).join(),"));\n }");this.userCode="\n float getAChannel(".concat(v.join(),") {\n return getChannel(getA(").concat(b.join(),"),\n vec2(").concat(b.slice(-2).join(),"));\n }\n ").concat(S,"\n void main() {\n ").concat(f," coords = getOutputCoords();\n bool hasNextCol = ").concat(p[d-1]," < ").concat(l[d-1]-1,";\n bool hasNextRow = ").concat(p[d-2]," < ").concat(l[d-2]-1,";\n ").concat(c,"\n ivec4 srcIdx = ivec4(sourceLocR").concat(m,", sourceLocG").concat(m,",\n sourceLocB").concat(m,", sourceLocA").concat(m,") * ").concat(n,";\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ").concat(j,";\n\n for (int i = 0; i < ").concat(n,"; i++) {\n inIdx = srcIdx;\n ").concat(w,"\n vec4 candidate = ").concat(j,";\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(").concat(k,"(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 ")};function Yx(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=t.shape[0],o=t.shape[1];null!=r&&(a=r.shape[0],o=r.shape[1]);var s=i.ud.computeOptimalWindowSize(o),c={windowSize:s,inSize:o,batchSize:a,outSize:Math.ceil(o/s)},u=new Kx(c,n,null==r),l=[t];null!=r&&l.push(r);var d=e.runWebGLProgram(u,l,"int32");if(1===d.shape[1])return d;var f=Yx(e,t,n,d);return e.disposeIntermediateTensorInfo(d),f}function $x(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=null!=r?r.shape:t.shape,o=a[a.length-1],s=i.ud.computeOptimalWindowSize(o),c=new Xx(a,s,n,null==r),u=null==r?[t]:[t,r],l=e.runWebGLProgram(c,u,"int32");if(l.shape.length===t.shape.length){var d=$x(e,t,n,l);return e.disposeIntermediateTensorInfo(l),d}return l}function Qx(e,t,n,r){var a=[n];if(i.ud.assertAxesAreInnerMostDims("arg"+r.charAt(0).toUpperCase()+r.slice(1),a,t.shape.length),!Object(i.Ud)().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){var s=[],c=i.ud.computeOutAndReduceShapes(t.shape,a),u=Object(o.a)(c,2),l=u[0],d=u[1],f=i.wf.sizeFromShape(d),p=yx({inputs:{x:t},backend:e,attrs:{shape:[-1,f]}});s.push(p);var h=Yx(e,p,r);s.push(h);var b=yx({inputs:{x:h},backend:e,attrs:{shape:l}});return s.forEach((function(t){return e.disposeIntermediateTensorInfo(t)})),b}return $x(e,t,r)}var Zx={kernelName:i.h,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.axis,s=i.wf.parseAxisParam(o,a.shape),c=i.ud.getAxesPermutation(s,a.shape.length),u=a,l=[];null!=c&&(u=Tx({inputs:{x:a},backend:n,attrs:{perm:c}}),l.push(u),s=i.ud.getInnerMostAxes(s.length,u.shape.length)),i.ud.assertAxesAreInnerMostDims("argMax",[s[0]],u.shape.length);var d=Qx(n,u,s[0],"max");return l.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),d}};var Jx={kernelName:i.i,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.axis,s=i.wf.parseAxisParam(o,a.shape),c=i.ud.getAxesPermutation(s,a.shape.length),u=a,l=[];null!=c&&(u=Tx({inputs:{x:a},backend:n,attrs:{perm:c}}),l.push(u),s=i.ud.getInnerMostAxes(s.length,u.shape.length)),i.ud.assertAxesAreInnerMostDims("argMin",[s[0]],u.shape.length);var d=Qx(n,u,s[0],"min");return l.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),d}},ek=ux({opSnippet:"if (isnan(x)) return x;\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),tk={kernelName:i.j,backendName:"webgl",kernelFunc:ek},nk=ux({opSnippet:"if (isnan(x)) return x;return log(x + sqrt(x * x + 1.0));"}),rk={kernelName:i.k,backendName:"webgl",kernelFunc:nk},ak=ux({opSnippet:"if (isnan(x)) return x;\n return atan(x);\n"}),ik={kernelName:i.l,backendName:"webgl",kernelFunc:ak},ok=lx({opSnippet:"\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return atan(a, b);\n",packedOpSnippet:"\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"}),sk={kernelName:i.m,backendName:"webgl",kernelFunc:ok},ck=ux({opSnippet:"if (isnan(x)) return x;\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),uk={kernelName:i.n,backendName:"webgl",kernelFunc:ck},lk=function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Object(Yr.a)(this,e),this.variableNames=["x"],"avg"===n&&r)throw new Error("Cannot compute positions for average pool.");var o=t.filterWidth,s=t.strideHeight,c=t.strideWidth,u=t.dilationHeight,l=t.dilationWidth,d=t.effectiveFilterHeight,f=t.effectiveFilterWidth,p=t.padInfo.top,h=t.padInfo.left;this.outputShape=t.outShape;var b="avg"===n,m="((batch * ".concat(t.inHeight," + xR) * ").concat(t.inWidth," + xC) * ").concat(t.inChannels," + d"),v="(xR * ".concat(t.inWidth," + xC) * ").concat(t.inChannels," + d"),g="0.0";if(b||(g="-1.0 / 1e-20"),r){var y=">=";this.userCode="\n const ivec2 strides = ivec2(".concat(s,", ").concat(c,");\n const ivec2 pads = ivec2(").concat(p,", ").concat(h,");\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 < ").concat(d,";\n wR += ").concat(u,") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(f,";\n wC += ").concat(l,") {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ").concat(t.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 ").concat(y," currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ").concat(a?i?m:v:"wR * ".concat(f," + wC"),";\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ")}else{var O="max",x="".concat(n,"(").concat(n,"(").concat(n,"(")+"minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===n&&(x="avgValue / count");var k=4*Math.floor(o/4),w=o%4,j="\n if (".concat(b,") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ").concat(O,"(values, minMaxValue);\n }\n ");this.userCode="\n const ivec2 strides = ivec2(".concat(s,", ").concat(c,");\n const ivec2 pads = ivec2(").concat(p,", ").concat(h,");\n const float initializationValue = ").concat(g,";\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 >= ").concat(t.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(").concat(g,");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ").concat(d,";\n wR += ").concat(u,") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(k,"; wC += 4) {\n int xC = xCCorner + wC * ").concat(l,";\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ").concat(l,", d),\n getValue(batch, xR, xC + 2 * ").concat(l,", d),\n getValue(batch, xR, xC + 3 * ").concat(l,", d)\n );\n\n ").concat(j,"\n }\n\n int xC = xCCorner + ").concat(k,";\n if (").concat(1===w,") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ").concat(j,"\n } else if (").concat(2===w,") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ").concat(l,", d),\n initializationValue,\n initializationValue\n );\n\n ").concat(j,"\n } else if (").concat(3===w,") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ").concat(l,", d),\n getValue(batch, xR, xC + 2 * ").concat(l,", d),\n initializationValue\n );\n\n ").concat(j,"\n }\n }\n setOutput(").concat(x,");\n }\n ")}},dk=function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Object(Yr.a)(this,e),this.variableNames=["x"],"avg"===n&&r)throw new Error("Cannot compute positions for average pool.");var o=t.filterWidth,s=t.strideDepth,c=t.strideHeight,u=t.strideWidth,l=t.dilationDepth,d=t.dilationHeight,f=t.dilationWidth,p=t.effectiveFilterDepth,h=t.effectiveFilterHeight,b=t.effectiveFilterWidth,m=t.padInfo.front,v=t.padInfo.top,g=t.padInfo.left;this.outputShape=t.outShape;var y="avg"===n,O="0.0";if(y||(O="-1.0 / 1e-20"),r){var x=">=";this.userCode="\n const ivec3 strides =\n ivec3(".concat(s,", ").concat(c,", ").concat(u,");\n const ivec3 pads = ivec3(").concat(m,", ").concat(v,", ").concat(g,");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ").concat(p,";\n wD += ").concat(l,") {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ").concat(t.inDepth,") {\n continue;\n }\n\n for (int wR = 0; wR < ").concat(h,";\n wR += ").concat(d,") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(b,";\n wC += ").concat(f,") {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\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 ").concat(x," currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ").concat(a?i?"(((batch * ".concat(t.inDepth," + xD) * ").concat(t.inHeight," + xR) * ").concat(t.inWidth," + xC) * ").concat(t.inChannels," + ch"):"((xD * ".concat(t.inHeight," + xR) * ").concat(t.inWidth," + xC) * ").concat(t.inChannels," + ch"):"wD * ".concat(h," * ").concat(b," +\n wR * ").concat(b," + wC"),";\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ")}else{var k="max",w="".concat(n,"(").concat(n,"(").concat(n,"(")+"minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===n&&(w="avgValue / count");var j=4*Math.floor(o/4),S=o%4,N="\n if (".concat(y,") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ").concat(k,"(values, minMaxValue);\n }\n ");this.userCode="\n const ivec3 strides =\n ivec3(".concat(s,", ").concat(c,", ").concat(u,");\n const ivec3 pads = ivec3(").concat(m,", ").concat(v,", ").concat(g,");\n const float initializationValue = ").concat(O,";\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 xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(").concat(O,");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ").concat(p,";\n wD += ").concat(l,") {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ").concat(t.inDepth,") {\n continue;\n }\n\n for (int wR = 0; wR < ").concat(h,";\n wR += ").concat(d,") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(j,"; wC += 4) {\n int xC = xCCorner + wC * ").concat(f,";\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ").concat(f,", ch),\n getValue(batch, xD, xR, xC + 2 * ").concat(f,", ch),\n getValue(batch, xD, xR, xC + 3 * ").concat(f,", ch)\n );\n\n ").concat(N,"\n }\n\n int xC = xCCorner + ").concat(j,";\n if (").concat(1===S,") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ").concat(N,"\n } else if (").concat(2===S,") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ").concat(f,", ch),\n initializationValue,\n initializationValue\n );\n\n ").concat(N,"\n } else if (").concat(3===S,") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ").concat(f,", ch),\n getValue(batch, xD, xR, xC + 2 * ").concat(f,", ch),\n initializationValue\n );\n\n ").concat(N,"\n }\n }\n setOutput(").concat(w,");\n }\n }\n ")}};var fk={kernelName:i.o,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x;Pg(a,"avgPool");var o=r.filterSize,s=r.strides,c=r.pad,u=r.dimRoundingMode;i.wf.assert(i.ud.eitherStridesOrDilationsAreOne(s,1),(function(){return"Error in avgPool: Either strides or dilations must be 1. "+"Got strides ".concat(s," and dilations '").concat(1,"'")}));var l=i.ud.computePool2DInfo(a.shape,o,s,1,c,u);if(1===l.filterWidth&&1===l.filterHeight&&i.wf.arraysEqual(l.inShape,l.outShape))return JO({inputs:{x:a},backend:n});var d=new lk(l,"avg",!1);return n.runWebGLProgram(d,[a],"float32")}};var pk={kernelName:i.p,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.filterSize,s=r.strides,c=r.pad,u=r.dimRoundingMode,l=r.dataFormat,d=i.ud.computePool3DInfo(a.shape,o,s,[1,1,1],c,u,l),f=new dk(d,"avg",!1);return n.runWebGLProgram(f,[a],"float32")}},hk=function e(t){Object(Yr.a)(this,e),this.variableNames=["dy"],this.outputShape=t.inShape;var n=t.filterHeight,r=t.filterWidth,a=t.strideHeight,i=t.strideWidth,o=t.dilationHeight,s=t.dilationWidth,c=t.effectiveFilterHeight,u=t.effectiveFilterWidth,l=c-1-t.padInfo.top,d=u-1-t.padInfo.left,f=1/(n*r);this.userCode="\n const ivec2 pads = ivec2(".concat(l,", ").concat(d,");\n const float avgMultiplier = float(").concat(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 < ").concat(c,";\n wR += ").concat(o,") {\n float dyR = float(dyRCorner + wR) / ").concat(a,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ").concat(u,";\n wC+= ").concat(s,") {\n float dyC = float(dyCCorner + wC) / ").concat(i,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.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 ")},bk=function e(t){Object(Yr.a)(this,e),this.variableNames=["dy"],this.outputShape=t.inShape;var n=t.filterDepth,r=t.filterHeight,a=t.filterWidth,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,c=t.dilationDepth,u=t.dilationHeight,l=t.dilationWidth,d=t.effectiveFilterDepth,f=t.effectiveFilterHeight,p=t.effectiveFilterWidth,h=d-1-t.padInfo.front,b=f-1-t.padInfo.top,m=p-1-t.padInfo.left,v=1/(n*r*a);this.userCode="\n const ivec3 pads = ivec3(".concat(h,", ").concat(b,", ").concat(m,");\n const float avgMultiplier = float(").concat(v,");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ").concat(d,";\n wD += ").concat(c,") {\n float dyD = float(dyDCorner + wD) / ").concat(i,".0;\n\n if (dyD < 0.0 || dyD >= ").concat(t.outDepth,".0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ").concat(f,";\n wR += ").concat(u,") {\n float dyR = float(dyRCorner + wR) / ").concat(o,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ").concat(p,";\n wC += ").concat(l,") {\n float dyC = float(dyCCorner + wC) / ").concat(s,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n ")};var mk={kernelName:i.q,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.input,s=r.filterSize,c=r.strides,u=r.pad,l=r.dimRoundingMode,d=i.ud.computePool3DInfo(o.shape,s,c,[1,1,1],u,l),f=new bk(d);return n.runWebGLProgram(f,[a],o.dtype)}};var vk={kernelName:i.r,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.input,s=o;Pg([a,o],"avgPoolGrad");var c=r.filterSize,u=r.strides,l=r.pad,d=i.ud.computePool2DInfo(s.shape,c,u,1,l),f=new hk(d);return n.runWebGLProgram(f,[a],s.dtype)}};var gk={kernelName:i.s,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs;return Ax({a:t.a,b:t.b,transposeA:r.transposeA,transposeB:r.transposeB,backend:n})}},yk=function e(t,n,r,a,o,s){Object(Yr.a)(this,e),this.outputShape=[],this.variableNames=["x","mean","variance"],i.ud.assertAndGetBroadcastShape(t,n),i.ud.assertAndGetBroadcastShape(t,r);var c="0.0";null!=a&&(i.ud.assertAndGetBroadcastShape(t,a),this.variableNames.push("offset"),c="getOffsetAtOutCoords()");var u="1.0";null!=o&&(i.ud.assertAndGetBroadcastShape(t,o),this.variableNames.push("scale"),u="getScaleAtOutCoords()"),this.outputShape=t,this.userCode="\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ".concat(c,";\n float scale = ").concat(u,";\n float inv = scale * inversesqrt(variance + float(").concat(s,"));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n ")},Ok=function e(t,n,r,a,o,s){Object(Yr.a)(this,e),this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],i.ud.assertAndGetBroadcastShape(t,n),i.ud.assertAndGetBroadcastShape(t,r);var c="vec4(0.0)";null!=a&&(i.ud.assertAndGetBroadcastShape(t,a),this.variableNames.push("offset"),c="getOffsetAtOutCoords()");var u="vec4(1.0)";null!=o&&(i.ud.assertAndGetBroadcastShape(t,o),this.variableNames.push("scale"),u="getScaleAtOutCoords()"),this.outputShape=t,this.userCode="\n void main() {\n vec4 offset = ".concat(c,";\n vec4 scale = ").concat(u,";\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(").concat(s,"));\n\n setOutput((x - mean) * inv + offset);\n }\n ")},xk={kernelName:i.jb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.mean,s=t.variance,c=t.offset,u=t.scale;i.wf.assert(o.shape.length===s.shape.length,(function(){return"Batch normalization gradient requires mean and variance to have equal ranks."})),i.wf.assert(null==c||o.shape.length===c.shape.length,(function(){return"Batch normalization gradient requires mean and offset to have equal ranks."})),i.wf.assert(null==u||o.shape.length===u.shape.length,(function(){return"Batch normalization gradient requires mean and scale to have equal ranks."}));var l=r.varianceEpsilon;null==l&&(l=.001);var d=[a,o,s],f=null;null!=c&&(f=c.shape,d.push(c));var p=null;null!=u&&(p=u.shape,d.push(u));var h=Object(i.Ud)().getBool("WEBGL_PACK_NORMALIZATION")?new Ok(a.shape,o.shape,s.shape,f,p,l):new yk(a.shape,o.shape,s.shape,f,p,l);return n.runWebGLProgram(h,d,d[0].dtype)}},kk=function e(t){Object(Yr.a)(this,e),this.variableNames=["source"],this.outputShape=t,this.rank=t.length;var n=Cy(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];var r,a=function(e){if(1===e)return"sourceLoc";if(e<=6)return wk.slice(0,e).map((function(e){return"sourceLoc."+e})).join(",");throw Error("Slicing for rank ".concat(e," is not yet supported"))}(this.rank),i=t.map((function(e,t){return"sourceLoc.".concat(wk[t]," = start[").concat(t,"] + coords.").concat(wk[t],";")}));r="\n ".concat(n," sourceLoc;\n ").concat(n," coords = getOutputCoords();\n ").concat(i.join("\n"),"\n "),this.userCode="\n void main() {\n ".concat(r,"\n setOutput(getSource(").concat(a,"));\n }\n ")},wk=["x","y","z","w","u","v"];var jk=function e(t){Object(Yr.a)(this,e),this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.rank=t.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];var n=Cy(this.rank),r=jO("coords",this.rank),a=jO("sourceLoc",this.rank),i=1===this.rank?"sourceLoc":"vec2(".concat(a.slice(-2).join(),")"),o="getChannel(getSource(".concat(a.join(),"), ").concat(i,")"),s="\n result.x = ".concat(o,";\n if (++").concat(r[this.rank-1]," < ").concat(t[this.rank-1],") {\n ++").concat(a[this.rank-1],";\n result.y = ").concat(o,";\n --").concat(a[this.rank-1],";\n }\n "),c=1===this.rank?"":"\n --".concat(r[this.rank-1],";\n if (++").concat(r[this.rank-2]," < ").concat(t[this.rank-2],") {\n ++").concat(a[this.rank-2],";\n result.z = ").concat(o,";\n if (++").concat(r[this.rank-1]," < ").concat(t[this.rank-1],") {\n ++").concat(a[this.rank-1],";\n result.w = ").concat(o,";\n }\n }\n "),u=this.rank<=4?"sourceLoc = coords +\n ".concat(n,"(").concat(t.map((function(e,t){return"start[".concat(t,"]")})).join(),");"):t.map((function(e,t){return"".concat(a[t]," = ").concat(r[t]," + start[").concat(t,"];")})).join("\n");this.userCode="\n void main() {\n ".concat(n," coords = getOutputCoords();\n ").concat(n," sourceLoc;\n ").concat(u,"\n vec4 result = vec4(0.);\n ").concat(s,"\n ").concat(c,"\n setOutput(result);\n }\n ")};function Sk(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.begin,c=r.size,u=i.af.parseSliceParams(a,s,c),l=Object(o.a)(u,2),d=l[0],f=l[1];if(i.af.assertParamsValid(a,d,f),0===i.wf.sizeFromShape(f))return n.makeTensorInfo(f,a.dtype,[]);if(n.shouldExecuteOnCPU([a])||"string"===a.dtype){var p=n.texData.get(a.dataId),h=lO(p.values,d,f,a.shape,a.dtype);return n.makeTensorInfo(f,a.dtype,h)}var b=n.texData.get(a.dataId).isPacked,m=i.af.isSliceContinous(a.shape,d,f);if(b||!m){var v=Object(i.Ud)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new jk(f):new kk(f),g=[d];return n.runWebGLProgram(v,[a],a.dtype,g)}return n.uploadToGPU(a.dataId),function(e,t,n,r){var a=r.texData.get(e.dataId),o=r.makeTensorInfo(n,e.dtype),s=r.texData.get(o.dataId);Object.assign(s,a),s.refCount=1,s.shape=n,s.dtype=e.dtype;var c=i.af.computeFlatOffset(t,i.wf.computeStrides(e.shape));a.slice&&(c+=a.slice.flatOffset),s.slice={flatOffset:c,origDataId:a.slice&&a.slice.origDataId||e.dataId};var u=r.dataRefCount.get(s.slice.origDataId)||1;return r.dataRefCount.set(s.slice.origDataId,u+1),o}(a,d,f,n)}var Nk={kernelName:i.Fc,backendName:"webgl",kernelFunc:Sk},Ik={kernelName:i.t,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.blockShape,s=r.crops;i.wf.assert(a.shape.length<=4,(function(){return"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"}));var c=o.reduce((function(e,t){return e*t})),u=i.ud.getReshaped(a.shape,o,c),l=i.ud.getPermuted(u.length,o.length),d=i.ud.getReshapedPermuted(a.shape,o,c),f=i.ud.getSliceBeginCoords(s,o.length),p=i.ud.getSliceSize(d,s,o.length),h=[],b=yx({inputs:{x:a},backend:n,attrs:{shape:u}}),m=Tx({inputs:{x:b},backend:n,attrs:{perm:l}}),v=yx({inputs:{x:m},backend:n,attrs:{shape:d}}),g=Sk({inputs:{x:v},backend:n,attrs:{begin:f,size:p}});return h.push(b),h.push(m),h.push(v),h.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),g}};var Ck={kernelName:i.u,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=t.weights,o=r.size,s=n.readSync(a.dataId),c=n.readSync(i.dataId),u=Ly(s,c,i.dtype,i.shape,o);return n.makeTensorInfo([o],i.dtype,u)}},Tk=lx({opSnippet:"return float(a != b);",cpuKernelImpl:iO,dtype:"bool"}),Ek={kernelName:i.ac,backendName:"webgl",kernelFunc:Tk};function Ak(e){var t=e.inputs,n=e.backend,r=t.input;return JO({inputs:{x:n.texData.get(r.dataId).complexTensorInfos.real},backend:n})}var Rk={kernelName:i.kc,backendName:"webgl",kernelFunc:Ak};var Fk={kernelName:i.v,backendName:"webgl",kernelFunc:function e(t){var n=t.inputs,r=t.backend,a=t.attrs,o=n.x,s=a.dtype;if("complex64"===s){if("complex64"===o.dtype)return JO({inputs:{x:o},backend:r});var c=i.Bf(o.shape),u=e({inputs:{x:o},backend:r,attrs:{dtype:"float32"}}),l=tx({inputs:{real:u,imag:c},backend:r});return c.dispose(),r.disposeIntermediateTensorInfo(u),l}if("complex64"===o.dtype){var d=Ak({inputs:{input:o},backend:r}),f=e({inputs:{x:d},backend:r,attrs:{dtype:s}});return r.disposeIntermediateTensorInfo(d),f}if(!i.wf.hasEncodingLoss(o.dtype,s)){var p=JO({inputs:{x:o},backend:r});return{dataId:p.dataId,shape:p.shape,dtype:s}}if("int32"===s)return function(e,t){var n=new AO(e.shape,"return float(int(x));"),r=t.runWebGLProgram(n,[e],"int32");return{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}(o,r);if("bool"===s){var h=r.makeTensorInfo([],"bool",i.wf.getTypedArrayFromDType("bool",1)),b=Tk({inputs:{a:o,b:h},backend:r});return r.disposeIntermediateTensorInfo(h),b}throw new Error("Error in Cast: failed to cast ".concat(o.dtype," to ").concat(s))}},Dk="return ceil(x);",_k=ux({opSnippet:Dk,packedOpSnippet:Dk,cpuKernelImpl:By}),Mk={kernelName:i.w,backendName:"webgl",kernelFunc:_k},zk=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=t,this.userCode="\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "},Lk=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=t,this.userCode="\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(minVal), vec4(maxVal)));\n }\n "};var Pk={kernelName:i.x,backendName:"webgl",kernelFunc:function(e){var t,n=e.inputs,r=e.backend,a=e.attrs,o=n.x,s=a.clipValueMin,c=a.clipValueMax;t=Object(i.Ud)().getBool("WEBGL_PACK_CLIP")?new Lk(o.shape):new zk(o.shape);var u=[[s],[c]];return r.runWebGLProgram(t,[o],o.dtype,u)}},Bk=function e(t){Object(Yr.a)(this,e),this.variableNames=["real","imag"],this.outputShape=t,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 "};function Wk(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}var Uk={kernelName:i.z,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x,a=n.texData.get(r.dataId),i=new Bk(r.shape),o=[Wk(r,a.complexTensorInfos.real),Wk(r,a.complexTensorInfos.imag)];return n.runWebGLProgram(i,o,o[0].dtype)}},Vk=function e(t){Object(Yr.a)(this,e),this.outputShape=[],this.outputShape=i.ud.computeOutShape(t,1),this.variableNames=t.map((function(e,t){return"T".concat(t)}));var n=new Array(t.length-1);n[0]=t[0][1];for(var r=1;r<n.length;r++)n[r]=n[r-1]+t[r][1];for(var a=["if (yC < ".concat(n[0],") setOutput(getT0(yR, yC));")],o=1;o<n.length;o++){var s=n[o-1];a.push("else if (yC < ".concat(n[o],") ")+"setOutput(getT".concat(o,"(yR, yC-").concat(s,"));"))}var c=n.length,u=n[n.length-1];a.push("else setOutput(getT".concat(c,"(yR, yC-").concat(u,"));")),this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n ".concat(a.join("\n "),"\n }\n ")},Hk=function e(t,n){Object(Yr.a)(this,e),this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=i.ud.computeOutShape(t,n);var r=this.outputShape,a=r.length,o=Cy(a),s=jO("coords",a),c=["x","y","z","w","u","v"].slice(0,a);this.variableNames=t.map((function(e,t){return"T".concat(t)}));var u=new Array(t.length-1);u[0]=t[0][n];for(var l=1;l<u.length;l++)u[l]=u[l-1]+t[l][n];for(var d=c[n],f=c.slice(-2),p=c.join(),h="if (".concat(d," < ").concat(u[0],") {\n return getChannel(\n getT0(").concat(p,"), vec2(").concat(f.join(),"));\n }"),b=1;b<u.length;b++){var m=u[b-1];h+="\n if (".concat(d," < ").concat(u[b]," && ").concat(d," >= ").concat(u[b-1],") {\n return getChannel(\n getT").concat(b,"(").concat(Gk(c,d,m),"),\n vec2(").concat(Gk(f,d,m),"));\n }")}var v=u.length,g=u[u.length-1];h+="\n return getChannel(\n getT".concat(v,"(").concat(Gk(c,d,g),"),\n vec2(").concat(Gk(f,d,g),"));"),this.userCode="\n float getValue(".concat(c.map((function(e){return"int "+e})),") {\n ").concat(h,"\n }\n\n void main() {\n ").concat(o," coords = getOutputCoords();\n vec4 result = vec4(getValue(").concat(s,"), 0., 0., 0.);\n\n ").concat(s[a-1]," = ").concat(s[a-1]," + 1;\n if (").concat(s[a-1]," < ").concat(r[a-1],") {\n result.g = getValue(").concat(s,");\n }\n\n ").concat(s[a-2]," = ").concat(s[a-2]," + 1;\n if (").concat(s[a-2]," < ").concat(r[a-2],") {\n result.a = getValue(").concat(s,");\n }\n\n ").concat(s[a-1]," = ").concat(s[a-1]," - 1;\n if (").concat(s[a-2]," < ").concat(r[a-2]," &&\n ").concat(s[a-1]," < ").concat(r[a-1],") {\n result.b = getValue(").concat(s,");\n }\n setOutput(result);\n }\n ")};function Gk(e,t,n){var r=e.indexOf(t);return e.map((function(e,t){return t===r?"".concat(e," - ").concat(n):e})).join()}function qk(e){var t=e.inputs,n=e.backend,r=t.input;return JO({inputs:{x:n.texData.get(r.dataId).complexTensorInfos.imag},backend:n})}var Kk={kernelName:i.sb,backendName:"webgl",kernelFunc:qk};function Xk(e,t,n){var r=e[0].dtype;if("complex64"===r){var a=e.map((function(e){return Ak({inputs:{input:e},backend:n})})),o=e.map((function(e){return qk({inputs:{input:e},backend:n})})),s=Xk(a,t,n),c=Xk(o,t,n),u=tx({inputs:{real:s,imag:c},backend:n});return a.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),o.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(c),u}var l=n.shouldExecuteOnCPU(e);if("string"===r&&(l=!0),l){var d=e.map((function(e){var r=i.wf.sizeFromShape(e.shape.slice(t));return yx({inputs:{x:e},backend:n,attrs:{shape:[-1,r]}})})),f=d.map((function(e){return{vals:n.readSync(e.dataId),shape:e.shape}})),p=i.ud.computeOutShape(d.map((function(e){return e.shape})),1),h=1===d[0].shape[0],b=Wy(f,p,r,h),m=i.ud.computeOutShape(e.map((function(e){return e.shape})),t),v=n.makeTensorInfo(m,r,b);return d.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),v}if(e.length>Object(i.Ud)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){var g=Math.floor(e.length/2),y=Xk(e.slice(0,g),t,n),O=Xk(e.slice(g),t,n),x=Xk([y,O],t,n);return n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(O),x}if(Object(i.Ud)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&e[0].shape.length>1){var k=new Hk(e.map((function(e){return e.shape})),t);return n.runWebGLProgram(k,e,r)}var w=function(e,t,n){var r=i.ud.computeOutShape(e.map((function(e){return e.shape})),t);return{tensors2D:e.map((function(e){return yx({inputs:{x:e},attrs:{shape:[-1,i.wf.sizeFromShape(e.shape.slice(t))]},backend:n})})),outShape:r}}(e,t,n),j=w.tensors2D,S=w.outShape,N=new Vk(j.map((function(e){return e.shape}))),I=n.runWebGLProgram(N,j,r);j.forEach((function(e){return n.disposeIntermediateTensorInfo(e)}));var C=yx({inputs:{x:I},attrs:{shape:S},backend:n});return n.disposeIntermediateTensorInfo(I),C}function Yk(e){var t=e.inputs,n=e.backend,r=e.attrs.axis,a=i.wf.parseAxisParam(r,t[0].shape)[0],o=i.ud.computeOutShape(t.map((function(e){return e.shape})),a);if(0===i.wf.sizeFromShape(o))return n.makeTensorInfo(o,t[0].dtype,[]);var s=t.filter((function(e){return i.wf.sizeFromShape(e.shape)>0}));if(1===s.length)return JO({inputs:{x:s[0]},backend:n});var c=s.map((function(e){return e.shape}));return i.ud.assertParamsConsistent(c,a),Xk(s,a,n)}var $k={kernelName:i.A,backendName:"webgl",kernelFunc:Yk},Qk=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Object(Yr.a)(this,e),this.variableNames=["x","W"],this.outputShape=t.outShape;var o=t.padInfo.top,s=t.padInfo.left,c=t.strideHeight,u=t.strideWidth,l=t.dilationHeight,d=t.dilationWidth,f=t.filterHeight,p=t.filterWidth,h=4*Math.floor(t.inChannels/4),b=t.inChannels%4,m="channelsLast"===t.dataFormat,v=m?1:2,g=m?2:3,y=m?3:1,O="",x="";r&&(O=a?"float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ".concat(r,"\n }"):i?"float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ".concat(r,"\n }"):"\n float activation(float x) {\n ".concat(r,"\n }\n "),x="result = activation(result);");var k=n?"result += getBiasAtOutCoords();":"";n&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),i&&this.variableNames.push("leakyreluAlpha"),this.userCode="\n ".concat(O,"\n\n const ivec2 strides = ivec2(").concat(c,", ").concat(u,");\n const ivec2 pads = ivec2(").concat(o,", ").concat(s,");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[").concat(y,"];\n\n ivec2 xRCCorner =\n ivec2(coords[").concat(v,"], coords[").concat(g,"]) * 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 < ").concat(f,"; wR++) {\n int xR = xRCorner + wR * ").concat(l,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(p,"; wC++) {\n int xC = xCCorner + wC * ").concat(d,";\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n for (int d1 = 0; d1 < ").concat(h,"; d1 += 4) {\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 if (").concat(m,") {\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 dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (").concat(1===b,") {\n\n if (").concat(m,") {\n dotProd +=\n getX(batch, xR, xC, ").concat(h,") *\n getW(wR, wC, ").concat(h,", d2);\n } else {\n dotProd +=\n getX(batch, ").concat(h,", xR, xC) *\n getW(wR, wC, ").concat(h,", d2);\n }\n\n } else if (").concat(2===b,") {\n vec2 wValues = vec2(\n getW(wR, wC, ").concat(h,", d2),\n getW(wR, wC, ").concat(h," + 1, d2)\n );\n\n if (").concat(m,") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ").concat(h,"),\n getX(batch, xR, xC, ").concat(h," + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ").concat(h,", xR, xC),\n getX(batch, ").concat(h," + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (").concat(3===b,") {\n vec3 wValues = vec3(\n getW(wR, wC, ").concat(h,", d2),\n getW(wR, wC, ").concat(h," + 1, d2),\n getW(wR, wC, ").concat(h," + 2, d2)\n );\n\n if (").concat(m,") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ").concat(h,"),\n getX(batch, xR, xC, ").concat(h," + 1),\n getX(batch, xR, xC, ").concat(h," + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ").concat(h,", xR, xC),\n getX(batch, ").concat(h," + 1, xR, xC),\n getX(batch, ").concat(h," + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ").concat(k,"\n ").concat(x,"\n setOutput(result);\n }\n ")},Zk=function e(t){Object(Yr.a)(this,e),this.variableNames=["x","W"],this.outputShape=t.outShape;var n=t.padInfo.front,r=t.padInfo.top,a=t.padInfo.left,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,c=t.dilationDepth,u=t.dilationHeight,l=t.dilationWidth,d=t.filterDepth,f=t.filterHeight,p=t.filterWidth,h=4*Math.floor(t.inChannels/4),b=t.inChannels%4;this.userCode="\n const ivec3 strides = ivec3(".concat(i,", ").concat(o,", ").concat(s,");\n const ivec3 pads = ivec3(").concat(n,", ").concat(r,", ").concat(a,");\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 < ").concat(d,"; wF++) {\n int xF = xFCorner + wF * ").concat(c,";\n\n if (xF < 0 || xF >= ").concat(t.inDepth,") {\n continue;\n }\n\n for (int wR = 0; wR < ").concat(f,"; wR++) {\n int xR = xRCorner + wR * ").concat(u,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(p,"; wC++) {\n int xC = xCCorner + wC * ").concat(l,";\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n for (int d1 = 0; d1 < ").concat(h,"; 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 (").concat(1===b,") {\n dotProd +=\n getX(batch, xF, xR, xC, ").concat(h,") *\n getW(wF, wR, wC, ").concat(h,", d2);\n } else if (").concat(2===b,") {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ").concat(h,"),\n getX(batch, xF, xR, xC, ").concat(h," + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ").concat(h,", d2),\n getW(wF, wR, wC, ").concat(h," + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (").concat(3===b,") {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ").concat(h,"),\n getX(batch, xF, xR, xC, ").concat(h," + 1),\n getX(batch, xF, xR, xC, ").concat(h," + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ").concat(h,", d2),\n getW(wF, wR, wC, ").concat(h," + 1, d2),\n getW(wF, wR, wC, ").concat(h," + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n ")},Jk=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t;for(var a=r.filterWidth,i=r.inChannels,o=r.strideWidth,s=r.strideHeight,c=r.padInfo,u=r.outWidth,l=r.dilationWidth,d=r.dilationHeight,f=r.dataFormat,p=c.left,h=c.top,b=i*a,m=Wg(),v="channelsLast"===f,g=v?0:1,y=v?1:2,O="",x=0;x<=1;x++)for(var k=0;k<=1;k++)O+="\n blockIndex = rc.y + ".concat(k,";\n pos = rc.x + ").concat(x,";\n\n if(blockIndex < ").concat(t[1]," && pos < ").concat(t[0],") {\n offsetY = int(blockIndex / (").concat(u,")) * ").concat(s," - ").concat(h,";\n d0 = offsetY + ").concat(d," * (pos / ").concat(b,");\n\n if(d0 < ").concat(n[g]," && d0 >= 0) {\n\n offsetX = int(mod(float(blockIndex), ").concat(u,".) * ").concat(o,". - ").concat(p,".);\n d1 = offsetX + ").concat(l," * (int(mod(float(pos), ").concat(b,".) / ").concat(i,".));\n\n if(d1 < ").concat(n[y]," && d1 >= 0) {\n\n ch = int(mod(float(pos), ").concat(i,".));\n\n if (").concat(v,") {\n innerDims = vec2(d1, ch);\n result[").concat(2*x+k,"] = getChannel(\n getA(d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[").concat(2*x+k,"] = getChannel(\n getA(ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n ");this.userCode="\n void main() {\n ivec2 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ".concat(O,"\n\n ").concat(m.output," = result;\n }\n ")};function ew(e){var t,n=e.x,r=e.filter,a=e.convInfo,o=e.backend,s=e.bias,c=void 0===s?null:s,u=e.preluActivationWeights,l=void 0===u?null:u,d=e.leakyreluAlpha,f=void 0===d?0:d,p=e.activation,h=void 0===p?null:p,b=n.shape,m=o.texData.get(n.dataId),v=a.inChannels,g=b[0]*b[1]*b[2],y=a.outChannels,O="channelsLast"===a.dataFormat,x=[],k=(1===g||1===y)&&v>1e3,w=b[2]%2!==0&&!!m.isPacked;if(!k&&Object(i.Ud)().getBool("WEBGL_LAZILY_UNPACK")&&Object(i.Ud)().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&w){var j=O?b[0]*b[1]*(b[2]+1):b[0]*b[2]*(b[3]+1),S={dataId:n.dataId,shape:[1,j,a.inChannels],dtype:n.dtype},N=m.shape;m.shape=m.shape.slice(),m.shape[m.shape.length-2]++,i.wf.assert(Dg(m.shape,S.shape),(function(){return"packed reshape ".concat(m.shape," to ").concat(S.shape," isn't free")}));var I=yx({inputs:{x:r},backend:o,attrs:{shape:[1,a.inChannels,a.outChannels]}});x.push(I);var C=Ax({a:S,b:I,backend:o,transposeA:false,transposeB:false,bias:c,activation:h,preluActivationWeights:l,leakyreluAlpha:f}),T=o.texData.get(C.dataId);i.wf.assert(T.isPacked,(function(){return"batchMatMul result is expected to be packed"})),m.shape=N,T.shape=a.outShape,(t=JO({inputs:{x:C},backend:o})).shape=a.outShape,x.push(C)}else{var E=yx({inputs:{x:n},backend:o,attrs:{shape:[1,O?b[0]*b[1]*b[2]:b[0]*b[2]*b[3],a.inChannels]}}),A=yx({inputs:{x:r},backend:o,attrs:{shape:[1,a.inChannels,a.outChannels]}}),R=Ax({a:E,b:A,transposeA:false,transposeB:false,backend:o,bias:c,activation:h,preluActivationWeights:l,leakyreluAlpha:f});t=yx({inputs:{x:R},backend:o,attrs:{shape:a.outShape}}),x.push(E),x.push(A),x.push(R)}for(var F=0,D=x;F<D.length;F++){var _=D[F];o.disposeIntermediateTensorInfo(_)}return t}function tw(e){var t=e.x,n=e.filter,r=e.convInfo,a=e.backend,o=e.bias,s=void 0===o?null:o,c=e.preluActivationWeights,u=void 0===c?null:c,l=e.leakyreluAlpha,d=void 0===l?0:l,f=e.activation,p=void 0===f?null:f,h=r.filterWidth,b=r.filterHeight,m=r.inChannels,v=r.outWidth,g=r.outHeight,y="channelsLast"===r.dataFormat,O=h*b*m,x=g*v,k=[O,x],w=[],j=yx({inputs:{x:t},backend:a,attrs:{shape:t.shape.slice(1)}}),S=yx({inputs:{x:n},backend:a,attrs:{shape:[1,O,i.wf.sizeFromShape(n.shape)/O]}});w.push(j),w.push(S);var N=new Jk(k,j.shape,r),I=a.runWebGLProgram(N,[j],"float32"),C=yx({inputs:{x:I},backend:a,attrs:{shape:[1,k[0],k[1]]}});w.push(I),w.push(C);var T=null!=s,E=null!=u,A="leakyrelu"===p,R=p?dx(p,!0):null,F=new fx(C.shape,S.shape,[1,x,r.outChannels],!0,!1,T,R,E,A),D=[C,S];if(s&&D.push(s),E&&D.push(u),A){var _=a.makeTensorInfo([],"float32",i.wf.createScalarValue(d,"float32"));D.push(_),w.push(_)}var M=a.runWebGLProgram(F,D,"float32"),z=yx({inputs:{x:M},backend:a,attrs:{shape:y?[1,g,v,r.outChannels]:[1,r.outChannels,g,v]}});w.push(M);for(var L=0,P=w;L<P.length;L++){var B=P[L];a.disposeIntermediateTensorInfo(B)}return z}var nw={kernelName:i.B,backendName:"webgl",kernelFunc:function(e){var t,n=e.inputs,r=e.backend,a=e.attrs,o=n.x,s=n.filter,c=a.strides,u=a.pad,l=a.dataFormat,d=a.dilations,f=a.dimRoundingMode,p=i.ud.convertConv2DDataFormat(l),h=i.ud.computeConv2DInfo(o.shape,s.shape,c,d,u,f,!1,p);if(1!==h.filterHeight||1!==h.filterWidth||1!==h.dilationHeight||1!==h.dilationWidth||1!==h.strideHeight||1!==h.strideWidth||"SAME"!==h.padInfo.type&&"VALID"!==h.padInfo.type)if(Object(i.Ud)().getBool("WEBGL_CONV_IM2COL")&&1===o.shape[0])t=tw({x:o,filter:s,convInfo:h,backend:r});else{var b=new Qk(h);t=r.runWebGLProgram(b,[o,s],"float32")}else t=ew({x:o,filter:s,convInfo:h,backend:r});var m=yx({inputs:{x:t},backend:r,attrs:{shape:h.outShape}});return r.disposeIntermediateTensorInfo(t),m}},rw=function e(t){Object(Yr.a)(this,e),this.variableNames=["x","dy"],this.outputShape=t.filterShape;var n=t.strideHeight,r=t.strideWidth,a=t.padInfo.top,i=t.padInfo.left,o="channelsLast"===t.dataFormat;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 < ".concat(t.batchSize,"; b++) {\n for (int yR = 0; yR < ").concat(t.outHeight,"; yR++) {\n int xR = wR + yR * ").concat(n," - ").concat(a,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int yC = 0; yC < ").concat(t.outWidth,"; yC++) {\n int xC = wC + yC * ").concat(r," - ").concat(i,";\n\n if (xC < 0 || xC >= ").concat(t.inWidth,") {\n continue;\n }\n\n if (").concat(o,") {\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n } else {\n float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n ")},aw=function e(t){Object(Yr.a)(this,e),this.variableNames=["dy","W"],this.outputShape=t.inShape;var n=t.filterHeight,r=t.filterWidth,a=t.strideHeight,i=t.strideWidth,o="channelsLast"===t.dataFormat,s=n-1-t.padInfo.top,c=r-1-t.padInfo.left,u=o?1:2,l=o?2:3,d=o?3:1;this.userCode="\n const ivec2 pads = ivec2(".concat(s,", ").concat(c,");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[").concat(d,"];\n\n ivec2 dyCorner = ivec2(coords[").concat(u,"], coords[").concat(l,"]) - 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 < ").concat(n,"; wR++) {\n float dyR = float(dyRCorner + wR) / ").concat(a,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ").concat(n," - 1 - wR;\n\n for (int wC = 0; wC < ").concat(r,"; wC++) {\n float dyC = float(dyCCorner + wC) / ").concat(i,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ").concat(r," - 1 - wC;\n\n for (int d2 = 0; d2 < ").concat(t.outChannels,"; d2++) {\n\n if (").concat(o,") {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n ")},iw=function e(t){Object(Yr.a)(this,e),this.variableNames=["x","dy"],this.outputShape=t.filterShape;var n=t.strideDepth,r=t.strideHeight,a=t.strideWidth,i=t.padInfo.front,o=t.padInfo.top,s=t.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 < ".concat(t.batchSize,"; b++) {\n for (int yF = 0; yF < ").concat(t.outDepth,"; yF++) {\n int xF = wF + yF * ").concat(n," - ").concat(i,";\n\n if (xF < 0 || xF >= ").concat(t.inDepth,") {\n continue;\n }\n\n for (int yR = 0; yR < ").concat(t.outHeight,"; yR++) {\n int xR = wR + yR * ").concat(r," - ").concat(o,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int yC = 0; yC < ").concat(t.outWidth,"; yC++) {\n int xC = wC + yC * ").concat(a," - ").concat(s,";\n\n if (xC < 0 || xC >= ").concat(t.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 ")},ow=function e(t){Object(Yr.a)(this,e),this.variableNames=["dy","W"],this.outputShape=t.inShape;var n=t.filterDepth,r=t.filterHeight,a=t.filterWidth,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,c=n-1-t.padInfo.front,u=r-1-t.padInfo.top,l=a-1-t.padInfo.left;this.userCode="\n const ivec3 pads = ivec3(".concat(c,", ").concat(u,", ").concat(l,");\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 < ").concat(n,"; wF++) {\n float dyF = float(dyFCorner + wF) / ").concat(i,".0;\n\n if (dyF < 0.0 || dyF >= ").concat(t.outDepth,".0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ").concat(n," - 1 - wF;\n\n for (int wR = 0; wR < ").concat(r,"; wR++) {\n float dyR = float(dyRCorner + wR) / ").concat(o,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ").concat(r," - 1 - wR;\n\n for (int wC = 0; wC < ").concat(a,"; wC++) {\n float dyC = float(dyCCorner + wC) / ").concat(s,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ").concat(a," - 1 - wC;\n\n for (int d2 = 0; d2 < ").concat(t.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 ")};var sw={kernelName:i.C,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.dy,s=r.strides,c=r.pad,u=r.dataFormat,l=r.dimRoundingMode,d=r.filterShape,f=i.ud.convertConv2DDataFormat(u),p=i.ud.computeConv2DInfo(a.shape,d,s,1,c,l,!1,f),h=new rw(p);return n.runWebGLProgram(h,[a,o],"float32")}};var cw={kernelName:i.D,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.filter,s=r.inputShape,c=r.strides,u=r.pad,l=r.dataFormat,d=r.dimRoundingMode,f=i.ud.convertConv2DDataFormat(l),p=i.ud.computeConv2DInfo(s,o.shape,c,1,u,d,!1,f),h=new aw(p);return n.runWebGLProgram(h,[a,o],"float32")}};var uw={kernelName:i.E,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.filter,s=r.strides,c=r.pad,u=r.dilations,l=i.ud.computeConv3DInfo(a.shape,o.shape,s,u,c),d=new Zk(l);return n.runWebGLProgram(d,[a,o],"float32")}};var lw={kernelName:i.F,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.dy,s=r.strides,c=r.pad,u=r.filterShape,l=i.ud.computeConv3DInfo(a.shape,u,s,1,c),d=new iw(l);return n.runWebGLProgram(d,[a,o],"float32")}};var dw={kernelName:i.G,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.filter,s=r.pad,c=r.strides,u=r.inputShape,l=i.ud.computeConv3DInfo(u,o.shape,c,1,s),d=new ow(l);return n.runWebGLProgram(d,[a,o],"float32")}},fw=ux({opSnippet:"if (isnan(x)) return x;\n return cos(x);\n"}),pw={kernelName:i.H,backendName:"webgl",kernelFunc:fw},hw=ux({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),bw={kernelName:i.I,backendName:"webgl",kernelFunc:hw},mw=function e(t,n,r,a,i){Object(Yr.a)(this,e),this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];var s=Object(o.a)(t,4),c=s[0],u=s[1],l=s[2],d=s[3],f=Object(o.a)(n,1)[0],p=Object(o.a)(r,2),h=p[0],b=p[1];this.outputShape=[f,h,b,d];var m="bilinear"===a?1:0,v="".concat(u-1,".0"),g="".concat(l-1,".0"),y=h>1?["".concat((u-1)/(h-1)),"(y2-y1) * height_ratio","y1*".concat(v," + float(y)*(height_scale)")]:["0.0","0.0","0.5 * (y1+y2) * ".concat(v)],O=Object(o.a)(y,3),x=O[0],k=O[1],w=O[2],j=b>1?["".concat((l-1)/(b-1)),"(x2-x1) * width_ratio","x1*".concat(g," + float(x)*(width_scale)")]:["0.0","0.0","0.5 * (x1+x2) * ".concat(g)],S=Object(o.a)(j,3),N=S[0],I=S[1],C=S[2];this.userCode="\n const float height_ratio = float(".concat(x,");\n const float width_ratio = float(").concat(N,");\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 >= ").concat(c,") {\n return;\n }\n\n float height_scale = ").concat(k,";\n float width_scale = ").concat(I,";\n\n float in_y = ").concat(w,";\n if( in_y < 0.0 || in_y > ").concat(v," ) {\n setOutput(float(").concat(i,"));\n return;\n }\n float in_x = ").concat(C,";\n if( in_x < 0.0 || in_x > ").concat(g," ) {\n setOutput(float(").concat(i,"));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(").concat(m," == 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 ")},vw={kernelName:i.J,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.image,i=t.boxes,o=t.boxInd,s=r.cropSize,c=r.method,u=r.extrapolationValue,l=new mw(a.shape,i.shape,s,c,u);return n.runWebGLProgram(l,[a,i,o],"float32")}},gw=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}],this.outputShape=t;var a=t.length,i=n?"0.0":"getX(".concat(yw(a,"coords"),")"),o=t[t.length-1],s="",c="";n?(s=r?"end != ".concat(o-1):"end != 0",c=r?"end + 1":"end - 1"):(s=r?"end + pow2 < ".concat(o):"end >= pow2",c=r?"end + pow2":"end - pow2"),this.userCode="\n void main() {\n ".concat(Cy(a)," coords = getOutputCoords();\n int end = ").concat(Ow(a,"coords"),";\n float val = ").concat(i,";\n int pow2 = int(pow(2.0, index));\n if (").concat(s,") {\n int idx = ").concat(c,";\n ").concat(Ow(a,"coords")," = idx;\n val += getX(").concat(yw(a,"coords"),");\n }\n setOutput(val);\n }\n ")};function yw(e,t){if(1===e)return"".concat(t);if(2===e)return"".concat(t,".x, ").concat(t,".y");if(3===e)return"".concat(t,".x, ").concat(t,".y, ").concat(t,".z");if(4===e)return"".concat(t,".x, ").concat(t,".y, ").concat(t,".z, ").concat(t,".w");throw Error("Cumulative sum for rank ".concat(e," is not yet supported"))}function Ow(e,t){if(1===e)return"".concat(t);if(2===e)return"".concat(t,".y");if(3===e)return"".concat(t,".z");if(4===e)return"".concat(t,".w");throw Error("Cumulative sum for rank ".concat(e," is not yet supported"))}var xw={kernelName:i.K,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.axis,s=r.exclusive,c=r.reverse,u=a.shape.length,l=i.ud.getAxesPermutation([o],u),d=a;null!=l&&(d=Tx({inputs:{x:a},backend:n,attrs:{perm:l}}));var f=i.ud.getInnerMostAxes(1,u)[0];if(f!==u-1)throw new Error("WebGL cumsum shader expects an inner-most axis=".concat(a.shape.length-1," ")+"but got axis=".concat(o));for(var p=d.shape[f],h=JO({inputs:{x:d},backend:n}),b=0;b<=Math.ceil(Math.log2(p))-1;b++){var m=new gw(d.shape,!1,c),v=[[b]],g=h;h=n.runWebGLProgram(m,[h],h.dtype,v),n.disposeIntermediateTensorInfo(g)}if(s){var y=new gw(d.shape,s,c),O=h;h=n.runWebGLProgram(y,[h],h.dtype),n.disposeIntermediateTensorInfo(O)}if(null!=l){var x=Tx({inputs:{x:h},backend:n,attrs:{perm:i.ud.getUndoAxesPermutation(l)}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),x}return h}};var kw={kernelName:i.M,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=t.weights,o=r.size,s=r.binaryOutput;if(1===a.shape.length){var c=n.readSync(a.dataId),u=n.readSync(i.dataId),l=Ly(c,u,i.dtype,i.shape,o);return n.makeTensorInfo([o],i.dtype,l)}if(2===a.shape.length){var d=n.bufferSync(a),f=n.bufferSync(i),p=Py(d,f,o,s);return n.makeTensorInfo(p.shape,i.dtype,p.values)}throw new Error("Error in denseBincount: input must be at most rank 2, but got rank"+"".concat(a.shape.length,"."))}},ww=function(){function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["x"],this.outputShape=[],this.outputShape=t,this.blockSize=n,this.dataFormat=r,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ".concat(this.getHeightCoordString(),";\n int w = ").concat(this.getWidthCoordString(),";\n int d = ").concat(this.getDepthCoordString(),";\n\n int in_h = h / ").concat(n,";\n int offset_h = imod(h, ").concat(n,");\n int in_w = w / ").concat(n,";\n int offset_w = imod(w, ").concat(n,");\n int offset_d = (offset_h * ").concat(n," + offset_w) *\n ").concat(this.getOutputDepthSize(),";\n int in_d = d + offset_d;\n\n float result = ").concat(this.getInputSamplingString(),";\n setOutput(result);\n }\n ")}return Object($r.a)(e,[{key:"getHeightCoordString",value:function(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}},{key:"getWidthCoordString",value:function(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}},{key:"getDepthCoordString",value:function(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}},{key:"getOutputDepthSize",value:function(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}},{key:"getInputSamplingString",value:function(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}]),e}();var jw={kernelName:i.N,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.blockSize,s=r.dataFormat;i.wf.assert(o>1,(function(){return"blockSize should be > 1 for depthToSpace, but was: ".concat(o)}));var c=a.shape[0],u="NHWC"===s?a.shape[1]:a.shape[2],l="NHWC"===s?a.shape[2]:a.shape[3],d="NHWC"===s?a.shape[3]:a.shape[1],f=u*o,p=l*o,h=d/(o*o),b=new ww("NHWC"===s?[c,f,p,h]:[c,h,f,p],o,s);return n.runWebGLProgram(b,[a],a.dtype)}},Sw=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Object(Yr.a)(this,e),this.variableNames=["x","W"],this.outputShape=t.outShape;var o=t.inHeight,s=t.inWidth,c=t.padInfo.top,u=t.padInfo.left,l=t.strideHeight,d=t.strideWidth,f=t.dilationHeight,p=t.dilationWidth,h=t.filterHeight,b=t.filterWidth,m=t.outChannels/t.inChannels,v="",g="";r&&(v=a?"float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ".concat(r,"\n }"):i?"float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ".concat(r,"\n }"):"\n float activation(float x) {\n ".concat(r,"\n }\n "),g="result = activation(result);");var y=n?"result += getBiasAtOutCoords();":"";n&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),i&&this.variableNames.push("leakyreluAlpha"),this.userCode="\n ".concat(v,"\n\n const ivec2 strides = ivec2(").concat(l,", ").concat(d,");\n const ivec2 pads = ivec2(").concat(c,", ").concat(u,");\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 / ").concat(m,";\n int q = d2 - d1 * ").concat(m,";\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 // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ").concat(h,"; wR++) {\n int xR = xRCorner + wR * ").concat(f,";\n\n if (xR < 0 || xR >= ").concat(o,") {\n continue;\n }\n\n for (int wC = 0; wC < ").concat(b,"; wC++) {\n int xC = xCCorner + wC * ").concat(p,";\n\n if (xC < 0 || xC >= ").concat(s,") {\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\n float result = dotProd;\n ").concat(y,"\n ").concat(g,"\n setOutput(result);\n }\n ")},Nw=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Object(Yr.a)(this,e),this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.outShape;for(var s=t.outChannels/t.inChannels,c=t.inHeight,u=t.inWidth,l=t.padInfo.top,d=t.padInfo.left,f=t.strideHeight,p=t.strideWidth,h=t.dilationHeight,b=t.dilationWidth,m=t.filterHeight,v=t.filterWidth,g=v,y="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;",O=0;O<v;O++)y+="\n vec4 xTexelC".concat(2*O,";\n int xTexelC").concat(2*O,"Ready;\n vec4 xTexelC").concat(2*O+1,";\n int xTexelC").concat(2*O+1,"Ready;\n vec4 xC").concat(O,";");for(var x=0;x<m;x++){for(var k=0;k<v;k++)y+="\n xTexelC".concat(2*k," = vec4(0.0);\n xTexelC").concat(2*k,"Ready = 0;\n xTexelC").concat(2*k+1," = vec4(0.0);\n xTexelC").concat(2*k+1,"Ready = 0;\n xC").concat(k," = vec4(0.0);");y+="\n xR = xRCorner + ".concat(x*h,";\n if (xR >=0 && xR < ").concat(c,") {\n ");for(var w=0;w<(g+1)/2;w++){var j=2*w,S=j*b;if(y+="\n xC = xCCorner + ".concat(S,";\n "),1===p){if(j<v&&(d%2===1?(y+="\n xCOffset = xC + 1;\n if (xCOffset >= 0 && xCOffset < ".concat(u," && xTexelC").concat(j,"Ready == 0) {\n xTexelC").concat(j," = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= ").concat(u,") {\n xTexelC").concat(j,".zw = vec2(0.0);\n }\n xTexelC").concat(j,"Ready = 1;\n }\n "),y+=1===b&&S>0?"\n xC".concat(j," = vec4(xTexelC").concat(j-2,".zw, xTexelC").concat(j,".xy);\n "):"\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < ".concat(u,") {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= ").concat(u,") {\n previous.zw = vec2(0.0);\n }\n\n xC").concat(j," = vec4(previous.zw, xTexelC").concat(j,".xy);\n } else {\n xC").concat(j," = vec4(0.0, 0.0, xTexelC").concat(j,".xy);\n }\n ")):y+="\n if (xC >= 0 && xC < ".concat(u," && xTexelC").concat(j,"Ready == 0) {\n xTexelC").concat(j," = getX(batch, xR, xC, d1);\n if (xC + 1 >= ").concat(u,") {\n xTexelC").concat(j,".zw = vec2(0.0);\n }\n xTexelC").concat(j,"Ready = 1;\n }\n\n xC").concat(j," = xTexelC").concat(j,";\n "),S+1<v)){var N=d%2===0?i.wf.nearestLargerEven(b):b;b%2===0&&d%2===1||b%2!==0&&d%2!==1?(y+="\n xCOffset = xC + ".concat(d%2," + ").concat(N,";\n\n if (xCOffset >= 0 && xCOffset < ").concat(u," && xTexelC").concat(j+1,"Ready == 0) {\n xTexelC").concat(j+1," = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= ").concat(u,") {\n xTexelC").concat(j+1,".zw = vec2(0.0);\n }\n xTexelC").concat(j+1,"Ready = 1;\n }\n "),b>1&&(y+="\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < ".concat(u," && xTexelC").concat(j,"Ready == 0) {\n xTexelC").concat(j," = getX(batch, xR, xCOffset, d1);\n xTexelC").concat(j,"Ready = 1;\n }\n ")),y+="\n xC".concat(j+1," = vec4(xTexelC").concat(j,".zw, xTexelC").concat(j+1,".xy);\n ")):y+=1===N?"\n xC".concat(j+1," = xTexelC").concat(j,";\n "):"\n xCOffset = xC + ".concat(N,";\n\n if (xCOffset >= 0 && xCOffset < ").concat(u," && xTexelC").concat(j+1,"Ready == 0) {\n xTexelC").concat(j+1," = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= ").concat(u,") {\n xTexelC").concat(j+1,".zw = vec2(0.0);\n }\n xTexelC").concat(j+1,"Ready = 1;\n }\n\n xC").concat(j+1," = xTexelC").concat(j+1,";\n ")}}else S<v&&(d%2===1?(y+="\n xCOffset = xC + 1 - ".concat(p,";\n if(xCOffset >= 0 && xCOffset < ").concat(u," && xTexelC").concat(j,"Ready == 0) {\n xTexelC").concat(j," = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= ").concat(u,") {\n xTexelC").concat(j,".zw = vec2(0.0);\n }\n xTexelC").concat(j,"Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < ").concat(u," && xTexelC").concat(j+1,"Ready == 0) {\n xTexelC").concat(j+1," = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= ").concat(u,") {\n xTexelC").concat(j+1,".zw = vec2(0.0);\n }\n xTexelC").concat(j+1,"Ready = 1;\n }\n\n xC").concat(j," = vec4(xTexelC").concat(j,".zw, xTexelC").concat(j+1,".zw);\n "),S+1<v&&(y+="\n final = vec4(0.0);\n xCOffset = xC + 1 + ".concat(p,";\n if(xCOffset >= 0 && xCOffset < ").concat(u,") {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC").concat(j+1," = vec4(xTexelC").concat(j+1,".xy, final.xy);\n "))):(y+="\n if(xC >= 0 && xC < ".concat(u," && xTexelC").concat(j,"Ready == 0) {\n xTexelC").concat(j," = getX(batch, xR, xC, d1);\n if (xC + 1 >= ").concat(u,") {\n xTexelC").concat(j,".zw = vec2(0.0);\n }\n xTexelC").concat(j,"Ready = 1;\n }\n\n xCOffset = xC + ").concat(p,";\n if(xCOffset >= 0 && xCOffset < ").concat(u," && xTexelC").concat(j+1,"Ready == 0) {\n xTexelC").concat(j+1," = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= ").concat(u,") {\n xTexelC").concat(j+1,".zw = vec2(0.);\n }\n xTexelC").concat(j+1,"Ready = 1;\n }\n\n xC").concat(j," = vec4(\n xTexelC").concat(j,".xy, xTexelC").concat(j+1,".xy);\n "),S+1<v&&(y+="\n xC".concat(j+1," = vec4(xTexelC").concat(j,".zw, xTexelC").concat(j+1,".zw);\n "))));j<v&&(y+="\n wTexel = getW(".concat(x,", ").concat(S,", d1, q);\n dotProd += xC").concat(j," * vec4(wTexel.xz, wTexel.xz);\n "),S+1<v&&(y+="\n wTexel = getW(".concat(x,", ").concat(S+1,", d1, q);\n dotProd += xC").concat(j+1," * vec4(wTexel.xz, wTexel.xz);\n ")))}y+="\n }\n "}var I="",C="";r&&(I=a?"vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ".concat(r,"\n }"):o?"vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ".concat(r,"\n }"):"vec4 activation(vec4 x) {\n ".concat(r,"\n }"),C="result = activation(result);");var T=n?"result += getBiasAtOutCoords();":"";n&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),o&&this.variableNames.push("leakyreluAlpha"),this.userCode="\n ".concat(I,"\n\n const ivec2 strides = ivec2(").concat(f,", ").concat(p,");\n const ivec2 pads = ivec2(").concat(l,", ").concat(d,");\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 / ").concat(s,";\n int q = d2 - d1 * ").concat(s,";\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n //intialize dotProd with a small epsilon seems to reduce GPU accuracy loss.\n vec4 dotProd = vec4(0.000000000000001);\n\n ").concat(y,"\n\n vec4 result = dotProd - vec4(0.000000000000001);\n ").concat(T,"\n ").concat(C,"\n setOutput(result);\n }\n ")};var Iw={kernelName:i.O,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.filter,s=r.strides,c=r.pad,u=r.dilations,l=r.dimRoundingMode,d=u;null==d&&(d=[1,1]),i.wf.assert(i.ud.eitherStridesOrDilationsAreOne(s,d),(function(){return"Error in depthwiseConv2d: Either strides or dilations must be "+"1. Got strides ".concat(s," and dilations '").concat(d,"'")}));var f,p=i.ud.computeConv2DInfo(a.shape,o.shape,s,d,c,l,!0);return f=Object(i.Ud)().getBool("WEBGL_PACK_DEPTHWISECONV")&&p.strideWidth<=2&&p.outChannels/p.inChannels===1?new Nw(p):new Sw(p),n.runWebGLProgram(f,[a,o],"float32")}},Cw=function e(t){Object(Yr.a)(this,e),this.variableNames=["x","dy"],this.outputShape=t.filterShape;var n=t.strideHeight,r=t.strideWidth,a=t.padInfo.top,i=t.padInfo.left,o=t.outChannels/t.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 * ".concat(o," + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ").concat(t.batchSize,"; b++) {\n for (int yR = 0; yR < ").concat(t.outHeight,"; yR++) {\n int xR = wR + yR * ").concat(n," - ").concat(a,";\n\n if (xR < 0 || xR >= ").concat(t.inHeight,") {\n continue;\n }\n\n for (int yC = 0; yC < ").concat(t.outWidth,"; yC++) {\n int xC = wC + yC * ").concat(r," - ").concat(i,";\n\n if (xC < 0 || xC >= ").concat(t.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 ")},Tw=function e(t){Object(Yr.a)(this,e),this.variableNames=["dy","W"],this.outputShape=t.inShape;var n=t.filterHeight,r=t.filterWidth,a=t.strideHeight,i=t.strideWidth,o=n-1-t.padInfo.top,s=r-1-t.padInfo.left,c=t.outChannels/t.inChannels;this.userCode="\n const ivec2 pads = ivec2(".concat(o,", ").concat(s,");\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 < ").concat(n,"; wR++) {\n float dyR = float(dyRCorner + wR) / ").concat(a,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ").concat(n," - 1 - wR;\n\n for (int wC = 0; wC < ").concat(r,"; wC++) {\n float dyC = float(dyCCorner + wC) / ").concat(i,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ").concat(r," - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ").concat(c,"; dm++) {\n int d2 = d1 * ").concat(c," + 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 ")};var Ew={kernelName:i.P,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.dy,s=r.strides,c=r.dilations,u=r.pad,l=r.dimRoundingMode,d=r.filterShape,f=i.ud.computeConv2DInfo(a.shape,d,s,c,u,l,!0),p=new Cw(f);return n.runWebGLProgram(p,[a,o],"float32")}};var Aw={kernelName:i.Q,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.filter,s=r.strides,c=r.dilations,u=r.pad,l=r.dimRoundingMode,d=r.inputShape,f=i.ud.computeConv2DInfo(d,o.shape,s,c,u,l,!0),p=new Tw(f);return n.runWebGLProgram(p,[a,o],"float32")}},Rw=function e(t){Object(Yr.a)(this,e),this.variableNames=["X"],this.outputShape=[t,t],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "};var Fw={kernelName:i.R,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.x,a=[].concat(Object(Vn.a)(r.shape),Object(Vn.a)(r.shape)),o=i.wf.sizeFromShape(r.shape),s=yx({inputs:{x:r},backend:n,attrs:{shape:[o]}}),c=new Rw(o),u=n.runWebGLProgram(c,[s],s.dtype),l=yx({inputs:{x:u},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(u),l}},Dw=function e(t){Object(Yr.a)(this,e),this.variableNames=["x","W"],this.outputShape=t.outShape;var n=t.inHeight,r=t.inWidth,a=t.padInfo,i=t.strideHeight,o=t.strideWidth,s=t.filterHeight,c=t.filterWidth,u=t.dilationHeight,l=t.dilationWidth,d=a.top,f=a.left;this.userCode="\n const ivec2 strides = ivec2(".concat(i,", ").concat(o,");\n const ivec2 pads = ivec2(").concat(d,", ").concat(f,");\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ").concat(s,"; h++) {\n int hIn = hBeg + h * ").concat(u,";\n\n if (hIn >= 0 && hIn < ").concat(n,") {\n for (int w = 0; w < ").concat(c,"; w++) {\n int wIn = wBeg + w * ").concat(l,";\n\n if (wIn >= 0 && wIn < ").concat(r,") {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n ")};var _w={kernelName:i.S,backendName:"webgl",kernelFunc:function(e){var t,n=e.inputs,r=e.backend,a=e.attrs,o=n.x,s=n.filter,c=a.strides,u=a.pad,l=a.dilations,d=i.ud.computeDilation2DInfo(o.shape,s.shape,c,u,"NHWC",l),f=new Dw(d),p=yx({inputs:{x:t=r.runWebGLProgram(f,[o,s],"float32")},backend:r,attrs:{shape:d.outShape}});return r.disposeIntermediateTensorInfo(t),p}};var Mw={kernelName:i.V,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs.equation,a=t,o=i.ud.decodeEinsumEquation(r,a.length),s=o.allDims,c=o.summedDims,u=o.idDims;i.ud.checkEinsumDimSizes(s.length,u,a);for(var l=i.ud.getEinsumComputePath(c,u),d=l.path,f=l.steps,p=f.length,h=null,b=s.length,m=[],v=0;v<p;++v){var g,y=Object(ea.a)(f[v]);try{for(y.s();!(g=y.n()).done;){var O=g.value,x=i.ud.getEinsumPermutation(b,u[O]),k=x.permutationIndices,w=x.expandDims,j=void 0;i.ud.isIdentityPermutation(k)?j=a[O]:(j=Tx({inputs:{x:a[O]},backend:n,attrs:{perm:k}}),m.push(j));for(var S=j.shape.slice(),N=0;N<w.length;++N)S.splice(w[N],0,1);i.wf.arraysEqual(j.shape,S)||(j=yx({inputs:{x:j},backend:n,attrs:{shape:S}}),m.push(j)),null===h?h=j:(h=vx({inputs:{a:j,b:h},backend:n}),m.push(h))}}catch(E){y.e(E)}finally{y.f()}v<p-1&&(d[v]>=0&&(h=Ix({inputs:{x:h},backend:n,attrs:{axis:d[v]-(s.length-b),keepDims:!1}}),m.push(h)),b--)}for(var I=0,C=m;I<C.length;I++){var T=C[I];T!==h&&n.disposeIntermediateTensorInfo(T)}return h}},zw=ux({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n"}),Lw={kernelName:i.W,backendName:"webgl",kernelFunc:zw},Pw={kernelName:i.X,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.dy,a=t.y,o=Object(i.Ud)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new ZO("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",r.shape,a.shape):new QO("return (b >= 1.0) ? a : a * (b + 1.0);",r.shape,a.shape);return n.runWebGLProgram(o,[r,a],r.dtype)}},Bw=lx({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:Uy}),Ww={kernelName:i.Y,backendName:"webgl",kernelFunc:Bw},Uw=ux({opSnippet:'\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 = '.concat(i.ud.ERF_P,";\n float a1 = ").concat(i.ud.ERF_A1,";\n float a2 = ").concat(i.ud.ERF_A2,";\n float a3 = ").concat(i.ud.ERF_A3,";\n float a4 = ").concat(i.ud.ERF_A4,";\n float a5 = ").concat(i.ud.ERF_A5,";\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n")}),Vw={kernelName:i.Z,backendName:"webgl",kernelFunc:Uw},Hw="return exp(x);",Gw=ux({opSnippet:Hw,packedOpSnippet:Hw,cpuKernelImpl:Vy}),qw={kernelName:i.ab,backendName:"webgl",kernelFunc:Gw};function Kw(e){var t=e.inputs,n=e.attrs,r=e.backend,a=n.dim,o=t.input,s=o.shape.length,c=o.shape.slice(),u=a;return a<0&&(i.wf.assert(-(s+1)<=a,(function(){return"Axis must be in the interval [".concat(-(s+1),", ").concat(s,"]")})),u=s+a+1),c.splice(u,0,1),yx({inputs:{x:o},backend:r,attrs:{shape:c}})}var Xw={kernelName:i.bb,backendName:"webgl",kernelFunc:Kw},Yw="return exp(x) - 1.0;",$w=ux({opSnippet:Yw,packedOpSnippet:Yw,cpuKernelImpl:Hy}),Qw={kernelName:i.cb,backendName:"webgl",kernelFunc:$w},Zw=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["real","imag"];var a=n[1];this.outputShape=n;var i,o=r?"2.0 * ".concat(Math.PI):"-2.0 * ".concat(Math.PI),s=r?"".concat(a,".0"):"1.0";if("real"===t)i="return real * expR - imag * expI;";else{if("imag"!==t)throw new Error('FFT component must be either "real" or "imag", got '.concat(t,"."));i="return real * expI + imag * expR;"}this.userCode="\n const float exponentMultiplier = ".concat(o,";\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ").concat(i,"\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(").concat(a,");\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ").concat(a,"; 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) / ").concat(s,";\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n ")};function Jw(e,t,n){var r=n.texData.get(e.dataId),a=i.wf.sizeFromShape(e.shape),o=e.shape[e.shape.length-1],s=yx({inputs:{x:e},backend:n,attrs:{shape:[a/o,o]}}),c=s.shape,u=new Zw("real",c,t),l=new Zw("imag",c,t),d=[{dataId:r.complexTensorInfos.real.dataId,dtype:r.complexTensorInfos.real.dtype,shape:c},{dataId:r.complexTensorInfos.imag.dataId,dtype:r.complexTensorInfos.imag.dtype,shape:c}],f=n.runWebGLProgram(u,d,"float32"),p=n.runWebGLProgram(l,d,"float32"),h=tx({inputs:{real:f,imag:p},backend:n});n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(p);var b=yx({inputs:{x:h},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(h),b}var ej={kernelName:i.db,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend;return Jw(t.input,!1,n)}},tj=function e(t,n){Object(Yr.a)(this,e),this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=t,this.userCode="\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "};function nj(e){var t=e.backend,n=e.attrs,r=n.shape,a=n.value,o=n.dtype;if("string"===(o=o||i.wf.inferDtype(a))){var s=i.wf.getArrayFromDType(o,i.wf.sizeFromShape(r));return s.fill(a),t.makeTensorInfo(r,o,s)}var c=new tj(r,a),u=[[a]];return t.runWebGLProgram(c,[],o,u)}var rj,aj={kernelName:i.eb,backendName:"webgl",kernelFunc:nj},ij=function e(t){Object(Yr.a)(this,e),this.variableNames=["Image"],this.outputShape=[];var n=t[2];this.outputShape=t,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ".concat(n," - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ").concat(n,") {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n ")},oj={kernelName:i.fb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.image,a=n,i=new ij(r.shape);return a.runWebGLProgram(i,[r],r.dtype)}},sj="return floor(x);",cj=ux({opSnippet:sj,packedOpSnippet:sj,cpuKernelImpl:Gy}),uj={kernelName:i.gb,backendName:"webgl",kernelFunc:cj},lj=lx({opSnippet:"\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",packedOpSnippet:"\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",dtype:"int32"}),dj={kernelName:i.hb,backendName:"webgl",kernelFunc:lj},fj=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"];var n=Wg(),r=Object(o.a)(t,2),a=r[0],i=r[1];this.outputShape=t,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(".concat(i,".0, ").concat(a,".0);\n\n vec4 values = ").concat(n.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 ")},pj=function e(t){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var n=Wg(),r=Object(o.a)(t,2),a=r[0],i=r[1];this.outputShape=t,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) /\n vec2(".concat(i,".0, ").concat(a,".0);\n vec4 values = ").concat(n.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 ").concat(n.output," = result;\n }\n ")},hj={kernelName:i.ib,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.pixels,s=r.numChannels,c="undefined"!==typeof HTMLVideoElement&&a instanceof HTMLVideoElement,u="undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement,l=c?[a.videoWidth,a.videoHeight]:[a.width,a.height],d=Object(o.a)(l,2),f=d[0],p=d[1],h=[p,f],b=[p,f,s];(u||c)&&(null==rj&&(rj=document.createElement("canvas").getContext("2d")),rj.canvas.width=f,rj.canvas.height=p,rj.drawImage(a,0,0,f,p),a=rj.canvas);var m=n.makeTensorInfo(h,"int32");n.texData.get(m.dataId).usage=ag.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(m.dataId),a);var v=Object(i.Ud)().getBool("WEBGL_PACK")?new pj(b):new fj(b),g=n.runWebGLProgram(v,[m],"int32");return n.disposeData(m.dataId),g}};var bj={kernelName:i.kb,backendName:"webgl",kernelFunc:function(e){var t,n=e.inputs,r=e.backend,a=e.attrs,o=n.x,s=n.filter,c=n.bias,u=n.preluActivationWeights,l=a.strides,d=a.pad,f=a.dataFormat,p=a.dilations,h=a.dimRoundingMode,b=a.activation,m=a.leakyreluAlpha,v=i.ud.convertConv2DDataFormat(f),g=i.ud.computeConv2DInfo(o.shape,s.shape,l,p,d,h,!1,v),y=[];if(1!==g.filterHeight||1!==g.filterWidth||1!==g.dilationHeight||1!==g.dilationWidth||1!==g.strideHeight||1!==g.strideWidth||"SAME"!==g.padInfo.type&&"VALID"!==g.padInfo.type)if(Object(i.Ud)().getBool("WEBGL_CONV_IM2COL")&&1===o.shape[0])t=tw({x:o,filter:s,convInfo:g,backend:r,bias:c,activation:b,preluActivationWeights:u,leakyreluAlpha:m});else{var O=null!=c,x=null!=u,k="leakyrelu"===b,w=b?dx(b,!1):null,j=new Qk(g,O,w,x,k),S=[o,s];if(c&&S.push(c),u&&S.push(u),k){var N=r.makeTensorInfo([],"float32",i.wf.createScalarValue(m,"float32"));S.push(N),y.push(N)}t=r.runWebGLProgram(j,S,"float32")}else t=ew({x:o,filter:s,convInfo:g,backend:r,bias:c,activation:b,preluActivationWeights:u,leakyreluAlpha:m});var I=yx({inputs:{x:t},backend:r,attrs:{shape:g.outShape}});return y.push(t),y.forEach((function(e){return r.disposeIntermediateTensorInfo(e)})),I}};var mj={kernelName:i.lb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.filter,s=t.bias,c=t.preluActivationWeights,u=r.strides,l=r.pad,d=r.dilations,f=r.dimRoundingMode,p=r.activation,h=r.leakyreluAlpha,b=[],m=d;null==m&&(m=[1,1]),i.wf.assert(i.ud.eitherStridesOrDilationsAreOne(u,m),(function(){return"Error in depthwiseConv2d: Either strides or dilations must be "+"1. Got strides ".concat(u," and dilations '").concat(m,"'")}));var v,g=i.ud.computeConv2DInfo(a.shape,o.shape,u,m,l,f,!0),y=Object(i.Ud)().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,O=p?dx(p,y):null,x=[a,o],k=null!=s,w=null!=c,j="leakyrelu"===p;if(k&&x.push(s),w&&x.push(c),j){var S=n.makeTensorInfo([],"float32",i.wf.createScalarValue(h,"float32"));x.push(S),b.push(S)}v=y?new Nw(g,k,O,w,j):new Sw(g,k,O,w,j);var N=n.runWebGLProgram(v,x,"float32");return b.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),N}},vj=function e(t,n,r){Object(Yr.a)(this,e),this.sliceDim=t,this.strides=n,this.variableNames=["x","indices"],this.outputShape=r;var a=Cy(n.length),i=Cy(r.length),o=this.sliceDim>1?"strides[j]":"strides";this.userCode="\n ".concat(a," strides = ").concat(a,"(").concat(this.strides,");\n void main() {\n ").concat(i," coords = getOutputCoords();\n int flattenIndex = 0;\n for (int j = 0; j < ").concat(this.sliceDim,"; j++) {\n int index = round(getIndices(coords[0], j));\n flattenIndex += index * ").concat(o,";\n }\n setOutput(getX(flattenIndex, coords[1]));\n }\n ")};var gj={kernelName:i.mb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.params,a=t.indices,s=a.shape,c=s[s.length-1],u=i.wf.sizeFromShape(r.shape),l=i.ud.prepareAndValidate(r,a),d=Object(o.a)(l,4),f=d[0],p=d[1],h=d[2],b=d[3],m=yx({inputs:{x:a},backend:n,attrs:{shape:[p,c]}}),v=yx({inputs:{x:r},backend:n,attrs:{shape:[i.wf.sizeFromShape(r.shape)/h,h]}});if(n.shouldExecuteOnCPU([r,a])||"string"===r.dtype){var g=n.readSync(a.dataId),y=n.bufferSync(r),O=qy(g,y,r.dtype,p,c,h,b,r.shape,u);return n.makeTensorInfo(f,r.dtype,O.values)}var x=new vj(c,b,[p,h]),k=n.runWebGLProgram(x,[v,m],v.dtype),w=yx({inputs:{x:k},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(v),n.disposeIntermediateTensorInfo(k),w}},yj=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["A","indices"],this.outputShape=n,this.rank=n.length;var r=Cy(this.rank),a=function(e,t){for(var n=["resRC.x","resRC.y","resRC.z","resRC.w"],r=[],a=0;a<e.length;a++)2===a?r.push("int(getIndices(resRC.x, resRC.z))"):r.push("".concat(n[a]));return r.join()}(t);this.userCode="\n void main() {\n ".concat(r," resRC = getOutputCoords();\n setOutput(getA(").concat(a,"));\n }\n ")};function Oj(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.indices,s=r.axis,c=r.batchDims,u=i.wf.parseAxisParam(s,a.shape)[0],l=i.ud.segment_util.collectGatherOpShapeInfo(a,o,u,c),d=i.wf.sizeFromShape(o.shape),f=[],p=yx({inputs:{x:a},backend:n,attrs:{shape:[l.batchSize,l.outerSize,l.dimSize,l.sliceSize]}}),h=yx({inputs:{x:o},backend:n,attrs:{shape:[l.batchSize,d/l.batchSize]}});f.push(p),f.push(h);var b=[l.batchSize,l.outerSize,d/l.batchSize,l.sliceSize];if(n.shouldExecuteOnCPU([a,o])||"string"===a.dtype){var m=n.bufferSync(h),v=n.bufferSync(p),g=Ky(v,m,b);return f.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),n.makeTensorInfo(l.outputShape,g.dtype,g.values)}var y=new yj(p.shape,b),O=n.runWebGLProgram(y,[p,h],p.dtype);f.push(O);var x=yx({inputs:{x:O},backend:n,attrs:{shape:l.outputShape}});return f.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),x}var xj={kernelName:i.nb,backendName:"webgl",kernelFunc:Oj},kj=lx({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:Xy,dtype:"bool"}),wj={kernelName:i.ob,backendName:"webgl",kernelFunc:kj},jj=lx({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:Yy}),Sj={kernelName:i.pb,backendName:"webgl",kernelFunc:jj};var Nj={kernelName:i.qb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend;return Jw(t.input,!0,n)}},Ij=ux({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),Cj={kernelName:i.tb,backendName:"webgl",kernelFunc:Ij},Tj=ux({opSnippet:"return float(isinf(x));",dtype:"bool"}),Ej={kernelName:i.ub,backendName:"webgl",kernelFunc:Tj},Aj=ux({opSnippet:"return float(isnan(x));",dtype:"bool"}),Rj={kernelName:i.vb,backendName:"webgl",kernelFunc:Aj},Fj=lx({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:$y,dtype:"bool"}),Dj={kernelName:i.Ab,backendName:"webgl",kernelFunc:Fj},_j=lx({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:Qy,dtype:"bool"}),Mj={kernelName:i.Bb,backendName:"webgl",kernelFunc:_j};var zj={kernelName:i.Cb,backendName:"webgl",kernelFunc:function(e){var t=e.backend,n=e.attrs,r=n.start,a=n.stop,i=n.num,o=Zy(r,a,i);return t.makeTensorInfo([o.length],"float32",o)}},Lj=ux({opSnippet:"if (x < 0.0) return NAN;\n return log(x);",packedOpSnippet:"\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",cpuKernelImpl:Jy}),Pj={kernelName:i.Db,backendName:"webgl",kernelFunc:Lj},Bj=ux({opSnippet:"return log(1.0 + x);"}),Wj={kernelName:i.Eb,backendName:"webgl",kernelFunc:Bj},Uj=lx({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),Vj={kernelName:i.Fb,backendName:"webgl",kernelFunc:Uj},Hj=ux({opSnippet:"return float(!(x >= 1.0));"}),Gj={kernelName:i.Gb,backendName:"webgl",kernelFunc:Hj},qj=lx({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n",dtype:"bool"}),Kj={kernelName:i.Hb,backendName:"webgl",kernelFunc:qj},Xj=function e(t,n,r,a,i){Object(Yr.a)(this,e),this.variableNames=["x"],this.outputShape=[];var o,s=n,c=t[3]-1;this.outputShape=t;var u="float(".concat(r,") + float(").concat(a,") * sum");o=.5===i?"inversesqrt(".concat(u,")"):1===i?"1.0/(".concat(u,")"):"exp(log(".concat(u,") * float(-").concat(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;\n for (int j = -".concat(s,"; j <= ").concat(s,"; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ").concat(c,") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ").concat(o,";\n setOutput(val);\n }\n ")},Yj=function e(t,n,r,a,i){Object(Yr.a)(this,e),this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;var o,s=n,c=t[3]-1;this.outputShape=t;var u="float(".concat(r,") + float(").concat(a,") * sum");o=.5===i?"inversesqrt(".concat(u,")"):1===i?"1.0/(".concat(u,")"):"exp(log(".concat(u,") * float(-").concat(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 < ".concat(this.outputShape[3],";\n bool hasNextRow = c < ").concat(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 - ").concat(s,";\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 = - ").concat(s,"; j <= ").concat(s,"; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(").concat(c,"));\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 * ").concat(o,";\n setOutput(result);\n }\n ")},$j={kernelName:i.xb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.depthRadius,s=r.bias,c=r.alpha,u=r.beta,l=Object(i.Ud)().getBool("WEBGL_PACK_NORMALIZATION")?new Yj(a.shape,o,s,c,u):new Xj(a.shape,o,s,c,u);return n.runWebGLProgram(l,[a],a.dtype)}},Qj=function e(t,n,r,a,i){Object(Yr.a)(this,e),this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=t,this.depth=t[3],this.depthRadius=n,this.bias=r,this.alpha=a,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 < ".concat(this.depth,"; ++d) {\n int depthBegin = int(max(0.0, float(d - ").concat(n,")));\n int depthEnd = int(min(float(").concat(this.depth,"),\n float(d + ").concat(n," + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ").concat(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(").concat(a,") * norm + float(").concat(r,");\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(").concat(a,")\n * float(").concat(i,")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ").concat(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 ")},Zj={kernelName:i.yb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,i=t.y,o=t.dy,s=r.depthRadius,c=r.bias,u=r.alpha,l=r.beta,d=new Qj(a.shape,s,c,u,l);return n.runWebGLProgram(d,[a,i,o],a.dtype)}};function Jj(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.reductionIndices,c=r.keepDims,u=a.shape.length,l=i.wf.parseAxisParam(s,a.shape),d=l,f=i.ud.getAxesPermutation(d,u),p=null!=f,h=n.shouldExecuteOnCPU([a]),b=a;if(p){if(h){for(var m=n.texData.get(b.dataId).values,v=new Array(u),g=0;g<v.length;g++)v[g]=a.shape[f[g]];var y=xO(m,a.shape,a.dtype,f,v);b=n.makeTensorInfo(v,a.dtype),n.texData.get(b.dataId).values=y}else b=Nx(a,f,n);d=i.ud.getInnerMostAxes(d.length,u)}i.ud.assertAxesAreInnerMostDims("max",d,u);var O,x=i.ud.computeOutAndReduceShapes(b.shape,d),k=Object(o.a)(x,2),w=k[0],j=k[1],S=w;if(c&&(S=i.ud.expandShapeToKeepDim(w,l)),h){var N=n.texData.get(b.dataId).values,I=eO(N,i.wf.sizeFromShape(j),S,a.dtype);O=n.makeTensorInfo(S,a.dtype),n.texData.get(O.dataId).values=I}else O=function(e,t,n,r){var a=i.wf.sizeFromShape(t),o=yx({inputs:{x:e},attrs:{shape:[i.wf.sizeFromShape(e.shape)/a,a]},backend:r}),s=wx(o,e.dtype,"max",r),c=yx({inputs:{x:s},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(s),c}(b,j,S,n);return p&&n.disposeIntermediateTensorInfo(b),O}var eS={kernelName:i.Ib,backendName:"webgl",kernelFunc:Jj},tS=lx({opSnippet:"\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return max(a, b);\n",packedOpSnippet:"\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",cpuKernelImpl:tO}),nS={kernelName:i.Ob,backendName:"webgl",kernelFunc:tS};var rS={kernelName:i.Jb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x;Pg(a,"maxPool");var o=r.filterSize,s=r.strides,c=r.pad,u=r.dimRoundingMode;i.wf.assert(i.ud.eitherStridesOrDilationsAreOne(s,1),(function(){return"Error in maxPool: Either strides or dilations must be 1. "+"Got strides ".concat(s," and dilations '").concat(1,"'")}));var l=i.ud.computePool2DInfo(a.shape,o,s,1,c,u);if(1===l.filterWidth&&1===l.filterHeight&&i.wf.arraysEqual(l.inShape,l.outShape))return JO({inputs:{x:a},backend:n});var d=new lk(l,"max",!1);return n.runWebGLProgram(d,[a],a.dtype)}};var aS={kernelName:i.Kb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.filterSize,s=r.strides,c=r.pad,u=r.dataFormat,l=r.dimRoundingMode,d=i.ud.computePool3DInfo(a.shape,o,s,[1,1,1],c,l,u),f=new dk(d,"max",!1);return n.runWebGLProgram(f,[a],a.dtype)}},iS=function e(t){Object(Yr.a)(this,e),this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;var n=t.strideHeight,r=t.strideWidth,a=t.dilationHeight,i=t.effectiveFilterHeight,o=t.effectiveFilterWidth,s=i-1-t.padInfo.top,c=o-1-t.padInfo.left,u=i*o-1;this.userCode="\n const ivec2 pads = ivec2(".concat(s,", ").concat(c,");\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 < ").concat(i,";\n wR += ").concat(a,") {\n float dyR = float(dyRCorner + wR) / ").concat(n,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ").concat(o,"; wC++) {\n float dyC = float(dyCCorner + wC) / ").concat(r,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.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 = ").concat(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 * ").concat(o," + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n ")},oS=function e(t){Object(Yr.a)(this,e),this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;var n=t.strideDepth,r=t.strideHeight,a=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,s=t.dilationWidth,c=t.effectiveFilterDepth,u=t.effectiveFilterHeight,l=t.effectiveFilterWidth,d=c-1-t.padInfo.front,f=u-1-t.padInfo.top,p=l-1-t.padInfo.left,h=c*u*l-1;this.userCode="\n const ivec3 pads = ivec3(".concat(d,", ").concat(f,", ").concat(p,");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ").concat(c,";\n wD += ").concat(i,") {\n float dyD = float(dyDCorner + wD) / ").concat(n,".0;\n\n if (dyD < 0.0 || dyD >= ").concat(t.outDepth,".0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ").concat(u,";\n wR += ").concat(o,") {\n float dyR = float(dyRCorner + wR) / ").concat(r,".0;\n\n if (dyR < 0.0 || dyR >= ").concat(t.outHeight,".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ").concat(l,";\n wC += ").concat(s,") {\n float dyC = float(dyCCorner + wC) / ").concat(a,".0;\n\n if (dyC < 0.0 || dyC >= ").concat(t.outWidth,".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ").concat(h," -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ").concat(u," * ").concat(l," +\n wR * ").concat(l," + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n ")};var sS={kernelName:i.Lb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.input,s=r.filterSize,c=r.strides,u=r.pad,l=r.dimRoundingMode,d=i.ud.computePool3DInfo(o.shape,s,c,[1,1,1],u,l),f=new dk(d,"max",!0),p=n.runWebGLProgram(f,[o],o.dtype),h=new oS(d),b=n.runWebGLProgram(h,[a,p],o.dtype);return n.disposeIntermediateTensorInfo(p),b}};var cS={kernelName:i.Mb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.dy,o=t.input,s=o;Pg([o,t.output],"maxPoolGrad");var c=r.filterSize,u=r.strides,l=r.pad,d=r.dimRoundingMode,f=i.ud.computePool2DInfo(s.shape,c,u,1,l,d),p=new lk(f,"max",!0),h=n.runWebGLProgram(p,[s],s.dtype),b=new iS(f),m=n.runWebGLProgram(b,[a,h],s.dtype);return n.disposeIntermediateTensorInfo(h),m}};var uS={kernelName:i.Nb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,a=t.x,s=n.filterSize,c=n.strides,u=n.pad,l=n.includeBatchInIndex,d=r;i.wf.assert(4===a.shape.length,(function(){return"Error in maxPool: input must be rank 4 but got rank ".concat(a.shape.length,".")}));var f=[1,1];i.wf.assert(i.ud.eitherStridesOrDilationsAreOne(c,f),(function(){return"Error in maxPool: Either strides or dilations must be 1. "+"Got strides ".concat(c," and dilations '").concat(f,"'")}));var p=i.ud.computePool2DInfo(a.shape,s,c,f,u),h=function(e,t,n,r){var a=new lk(n,"max",!1),i=r.runWebGLProgram(a,[e],"float32");return a=new lk(n,"max",!0,!0,t),[i,r.runWebGLProgram(a,[e],"float32")]}(a,l,p,d),b=Object(o.a)(h,2);return[b[0],b[1]]}};var lS={kernelName:i.Pb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,a=t.x,s=n.keepDims,c=n.axis,u=r,l=a.shape.length,d=i.wf.parseAxisParam(c,a.shape),f=d,p=i.ud.getAxesPermutation(f,l),h=null!=p,b=u.shouldExecuteOnCPU([a]),m=[],v=a;if(h){if(b){for(var g=u.texData.get(v.dataId).values,y=new Array(l),O=0;O<y.length;O++)y[O]=a.shape[p[O]];var x=xO(g,a.shape,a.dtype,p,y);v=u.makeTensorInfo(y,a.dtype),u.texData.get(v.dataId).values=x}else v=Nx(a,p,u);m.push(v),f=i.ud.getInnerMostAxes(f.length,l)}i.ud.assertAxesAreInnerMostDims("sum",f,l);var k=i.ud.computeOutAndReduceShapes(v.shape,f),w=Object(o.a)(k,2),j=w[0],S=w[1],N=j;s&&(N=i.ud.expandShapeToKeepDim(j,d));for(var I=function(e,t,n,r){var a=i.wf.sizeFromShape(t),o=yx({inputs:{x:e},attrs:{shape:[i.wf.sizeFromShape(e.shape)/a,a]},backend:r}),s=wx(o,"float32","mean",r),c=yx({inputs:{x:s},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(s),c}(v,S,N,u),C=0,T=m;C<T.length;C++){var E=T[C];u.disposeIntermediateTensorInfo(E)}return I}};var dS={kernelName:i.Qb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.axis,c=r.keepDims,u=a.shape.length,l=i.wf.parseAxisParam(s,a.shape),d=l,f=i.ud.getAxesPermutation(d,u),p=a;null!=f&&(p=Tx({inputs:{x:a},backend:n,attrs:{perm:f}}),d=i.ud.getInnerMostAxes(d.length,a.shape.length)),i.ud.assertAxesAreInnerMostDims("min",d,u);var h,b=i.ud.computeOutAndReduceShapes(p.shape,d),m=Object(o.a)(b,2),v=m[0],g=m[1],y=yx({inputs:{x:p},backend:n,attrs:{shape:[-1,i.wf.sizeFromShape(g)]}}),O=wx(y,y.dtype,"min",n);return h=yx(c?{inputs:{x:O},backend:n,attrs:{shape:i.ud.expandShapeToKeepDim(v,l)}}:{inputs:{x:O},backend:n,attrs:{shape:v}}),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(O),null!=f&&n.disposeIntermediateTensorInfo(p),h}},fS=lx({opSnippet:"\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return min(a, b);\n",packedOpSnippet:"\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",cpuKernelImpl:nO}),pS={kernelName:i.Rb,backendName:"webgl",kernelFunc:fS},hS=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["x"],this.outputShape=n.map((function(e,n){return e[0]+t[n]+e[1]}));var a=t.length,i=Cy(a),o=n.map((function(e){return e[0]})).join(","),s=n.map((function(e,n){return e[0]+t[n]})).join(","),c=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a),u="reflect"===r?0:1;this.userCode=1!==a?"\n ".concat(i," start = ").concat(i,"(").concat(o,");\n ").concat(i," end = ").concat(i,"(").concat(s,");\n\n void main() {\n ").concat(i," outC = getOutputCoords();\n for (int i = 0; i < ").concat(a,"; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ").concat(u,";\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ").concat(u,";\n }\n }\n ").concat(i," coords = outC - start;\n setOutput(getX(").concat(c,"));\n }\n "):"\n int start = ".concat(o,";\n int end = ").concat(s,";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ").concat(u,";\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ").concat(u,";\n }\n setOutput(getX(outC - start));\n }\n ")},bS=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n.map((function(e,n){return e[0]+t[n]+e[1]}));var a=t.length,i=Cy(a),o=n.map((function(e){return e[0]})).join(","),s=n.map((function(e,n){return e[0]+t[n]})).join(","),c=jO("rc",a),u=jO("source",a),l="".concat(c[a-1]," < ").concat(this.outputShape[a-1]),d=1===a?"source":"vec2(".concat(u.slice(-2).join(),")"),f="reflect"===r?0:1,p="";if(1===a){var h="\n ".concat(i," source = rc;\n if (source < start) {\n source = start * 2 - source - ").concat(f,";\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ").concat(f,";\n }\n source -= start;\n ");p="\n ".concat(i," rc = outputLoc;\n ").concat(h,"\n result[0] = getChannel(getX(").concat(u.join(),"), ").concat(d,");\n ").concat(c[a-1]," += 1;\n if(").concat(l,") {\n ").concat(h,"\n result[1] = getChannel(getX(").concat(u.join(),"), ").concat(d,");\n }\n ")}else{var b="\n ".concat(i," source = rc;\n ").concat(i," lt = ").concat(i,"(lessThan(source, start));\n ").concat(i," gte = ").concat(i,"(greaterThanEqual(source, end));\n ").concat(i," orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ").concat(f,") +\n gte * ((end - 1) * 2 - source + ").concat(f,");\n source -= start;\n ");p="\n ".concat(i," rc = outputLoc;\n ").concat(b,"\n result[0] = getChannel(getX(").concat(u.join(),"), ").concat(d,");\n ").concat(c[a-1]," += 1;\n if(").concat(l,") {\n ").concat(b,"\n result[1] = getChannel(getX(").concat(u.join(),"), ").concat(d,");\n }\n rc = outputLoc;\n ").concat(c[a-2]," += 1;\n if(").concat(c[a-2]," < ").concat(this.outputShape[a-2],") {\n ").concat(b,"\n result[2] = getChannel(getX(").concat(u.join(),"), ").concat(d,");\n ").concat(c[a-1]," += 1;\n if(").concat(l,") {\n ").concat(b,"\n result[3] = getChannel(getX(").concat(u.join(),"), ").concat(d,");\n }\n }\n ")}this.userCode="\n const ".concat(i," start = ").concat(i,"(").concat(o,");\n const ").concat(i," end = ").concat(i,"(").concat(s,");\n\n void main() {\n ").concat(i," outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ").concat(p,"\n setOutput(result);\n }\n ")},mS={kernelName:i.Sb,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.paddings,s=r.mode,c=Object(i.Ud)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new bS(a.shape,o,s):new hS(a.shape,o,s);return n.runWebGLProgram(c,[a],a.dtype)}},vS=lx({opSnippet:"if (b == 0.0) return NAN;\n return mod(a, b);",packedOpSnippet:"\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"}),gS={kernelName:i.Tb,backendName:"webgl",kernelFunc:vS},yS=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[t,r],this.userCode="\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 < ".concat(n-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(").concat(n-1,"));\n }\n ")},OS=lx({opSnippet:"\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n",checkOutOfBounds:!0}),xS={kernelName:i.lc,backendName:"webgl",kernelFunc:OS},kS="return a - b;",wS=lx({opSnippet:kS,packedOpSnippet:kS,supportsComplex:!0,cpuKernelImpl:gO}),jS={kernelName:i.Xc,backendName:"webgl",kernelFunc:wS};function SS(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.logits,o=r.dim,s=i.wf.parseAxisParam([o],a.shape),c=Jj({inputs:{x:a},backend:n,attrs:{reductionIndices:s,keepDims:!1}}),u=i.ud.expandShapeToKeepDim(c.shape,s),l=yx({inputs:{x:c},backend:n,attrs:{shape:u}}),d=wS({inputs:{a:a,b:l},backend:n}),f=Gw({inputs:{x:d},backend:n}),p=Ix({inputs:{x:f},backend:n,attrs:{axis:s,keepDims:!1}}),h=yx({inputs:{x:p},backend:n,attrs:{shape:u}}),b=OS({inputs:{a:f,b:h},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(h),b}var NS={kernelName:i.Gc,backendName:"webgl",kernelFunc:SS};var IS={kernelName:i.Ub,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.logits,i=r.numSamples,o=r.seed,s=r.normalized,c=s?a:SS({inputs:{logits:a},backend:n,attrs:{dim:a.shape.length-1}}),u=c.shape[0],l=c.shape[1],d=new yS(u,l,i),f=[[o]],p=n.runWebGLProgram(d,[c],"int32",f);return s||n.disposeIntermediateTensorInfo(c),p}},CS="return -x;";var TS={kernelName:i.Wb,backendName:"webgl",kernelFunc:function(e){var t,n=e.inputs,r=e.backend,a=n.x;if(r.shouldExecuteOnCPU([a])){var s=r.texData.get(a.dataId),c=aO(s.values,a.shape,a.dtype),u=Object(o.a)(c,2),l=u[0],d=u[1];return r.makeTensorInfo(d,a.dtype,l)}return t=Object(i.Ud)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new GO(a.shape,CS):new AO(a.shape,CS),r.runWebGLProgram(t,[a],a.dtype)}},ES=i.ie.nonMaxSuppressionV3Impl;var AS={kernelName:i.Xb,backendName:"webgl",kernelFunc:function(e){i.ud.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");var t=e.inputs,n=e.backend,r=e.attrs,a=t.boxes,o=t.scores,s=r.maxOutputSize,c=r.iouThreshold,u=r.scoreThreshold,l=n.readSync(a.dataId),d=n.readSync(o.dataId),f=ES(l,d,s,c,u).selectedIndices;return n.makeTensorInfo([f.length],"int32",new Int32Array(f))}},RS=i.ie.nonMaxSuppressionV4Impl;var FS={kernelName:i.Yb,backendName:"webgl",kernelFunc:function(e){i.ud.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");var t=e.inputs,n=e.backend,r=e.attrs,a=t.boxes,o=t.scores,s=r.maxOutputSize,c=r.iouThreshold,u=r.scoreThreshold,l=r.padToMaxOutputSize,d=n.readSync(a.dataId),f=n.readSync(o.dataId),p=RS(d,f,s,c,u,l),h=p.selectedIndices,b=p.validOutputs;return[n.makeTensorInfo([h.length],"int32",new Int32Array(h)),n.makeTensorInfo([],"int32",new Int32Array([b]))]}},DS=i.ie.nonMaxSuppressionV5Impl;var _S={kernelName:i.Zb,backendName:"webgl",kernelFunc:function(e){i.ud.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");var t=e.inputs,n=e.backend,r=e.attrs,a=t.boxes,o=t.scores,s=r.maxOutputSize,c=r.iouThreshold,u=r.scoreThreshold,l=r.softNmsSigma,d=n.readSync(a.dataId),f=n.readSync(o.dataId),p=DS(d,f,s,c,u,l),h=p.selectedIndices,b=p.selectedScores;return[n.makeTensorInfo([h.length],"int32",new Int32Array(h)),n.makeTensorInfo([b.length],"float32",new Float32Array(b))]}},MS=function e(t,n,r,a){Object(Yr.a)(this,e),this.variableNames=["indices"],this.outputShape=[t,n],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(".concat(a,"), float(").concat(r,"),\n float(index == coords.y)));\n }\n ")},zS={kernelName:i.bc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.indices,o=r.depth,s=r.onValue,c=r.offValue,u=i.wf.sizeFromShape(a.shape),l=new MS(u,o,s,c),d=yx({inputs:{x:a},backend:n,attrs:{shape:[u]}}),f=n.runWebGLProgram(l,[d],a.dtype);n.disposeIntermediateTensorInfo(d);var p=yx({inputs:{x:f},backend:n,attrs:{shape:[].concat(Object(Vn.a)(a.shape),[o])}});return n.disposeIntermediateTensorInfo(f),p}};function LS(e){var t=e.inputs,n=e.backend,r=t.x;if("complex64"===r.dtype){var a=Ak({inputs:{input:r},backend:n}),i=LS({inputs:{x:a},backend:n}),o=qk({inputs:{input:r},backend:n}),s=LS({inputs:{x:o},backend:n}),c=tx({inputs:{real:i,imag:s},backend:n});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(s),c}return nj({attrs:{shape:r.shape,dtype:r.dtype,value:"string"===r.dtype?"":0},backend:n})}var PS={kernelName:i.kd,backendName:"webgl",kernelFunc:LS};var BS={kernelName:i.cc,backendName:"webgl",kernelFunc:function e(t){var n=t.inputs,r=t.backend,a=n.x;if("string"===a.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===a.dtype){var i=Ak({inputs:{input:a},backend:r}),o=e({inputs:{x:i},backend:r}),s=qk({inputs:{input:a},backend:r}),c=LS({inputs:{x:s},backend:r}),u=tx({inputs:{real:o,imag:c},backend:r});return r.disposeIntermediateTensorInfo(i),r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(s),r.disposeIntermediateTensorInfo(c),u}return nj({attrs:{shape:a.shape,dtype:a.dtype,value:1},backend:r})}};var WS={kernelName:i.ec,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs.axis;if(1===t.length)return Kw({inputs:{input:t[0]},backend:n,attrs:{dim:r}});var a=t[0].shape,o=t[0].dtype;t.forEach((function(e){i.wf.assertShapesMatch(a,e.shape,"All tensors passed to stack must have matching shapes"),i.wf.assert(o===e.dtype,(function(){return"All tensors passed to stack must have matching dtypes"}))}));var s=[],c=Yk({inputs:t.map((function(e){var t=Kw({inputs:{input:e},backend:n,attrs:{dim:r}});return s.push(t),t})),backend:n,attrs:{axis:r}});return s.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),c}},US=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=n.map((function(e,n){return e[0]+t[n]+e[1]}));var a=t.length,i=Cy(a),o=n.map((function(e){return e[0]})).join(","),s=n.map((function(e,n){return e[0]+t[n]})).join(","),c=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a);this.userCode=1!==a?"\n ".concat(i," start = ").concat(i,"(").concat(o,");\n ").concat(i," end = ").concat(i,"(").concat(s,");\n\n void main() {\n ").concat(i," outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ").concat(i," coords = outC - start;\n setOutput(getX(").concat(c,"));\n }\n }\n "):"\n int start = ".concat(o,";\n int end = ").concat(s,";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n ")},VS=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=n.map((function(e,n){return e[0]+t[n]+e[1]}));for(var a=t.length,i=Cy(a),o=n.map((function(e){return e[0]})).join(","),s=n.map((function(e,n){return e[0]+t[n]})).join(","),c=jO("rc",a),u=jO("source",a),l="".concat(c[a-1]," < ").concat(this.outputShape[a-1]),d=1===a?"source":"vec2(".concat(u.slice(-2).join(),")"),f=["".concat(i," rc = outputLoc;"),"".concat(c[a-1]," += 1;\n if(").concat(l,") {\n "),1===a?"":"}\n rc = outputLoc;\n ".concat(c[a-2]," += 1;\n if(").concat(c[a-2]," < ").concat(this.outputShape[a-2],") {"),1===a?"":" ".concat(c[a-1]," += 1;\n if(").concat(l,") {")],p=1===a?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",h="",b=0,m=1===a?2:4;b<m;b++)h+="\n ".concat(f[b],"\n if (").concat(p,") {\n result[").concat(b,"] = float(value);\n } else {\n ").concat(i," source = rc - start;\n result[").concat(b,"] = getChannel(getX(").concat(u.join(),"), ").concat(d,");\n }\n ");h+=1===a?"} ":"}}",this.userCode="\n const ".concat(i," start = ").concat(i,"(").concat(o,");\n const ").concat(i," end = ").concat(i,"(").concat(s,");\n\n void main() {\n ").concat(i," outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ").concat(h,"\n setOutput(result);\n }\n ")},HS=function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.paddings,s=r.constantValue,c=Object(i.Ud)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new VS(a.shape,o,s):new US(a.shape,o,s),u=[[s]];return n.runWebGLProgram(c,[a],a.dtype,u)},GS={kernelName:i.fc,backendName:"webgl",kernelFunc:HS},qS=lx({opSnippet:"\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\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 // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\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"}),KS={kernelName:i.gc,backendName:"webgl",kernelFunc:qS};var XS={kernelName:i.ic,backendName:"webgl",kernelFunc:function(e){var t,n=e.inputs,r=e.backend,a=e.attrs,s=n.x,c=a.axis,u=a.keepDims,l=s.shape.length,d=[],f=i.wf.parseAxisParam(c,s.shape),p=f,h=i.ud.getAxesPermutation(p,l),b=s;if(null!=h&&(b=Tx({inputs:{x:s},backend:r,attrs:{perm:h}}),p=i.ud.getInnerMostAxes(p.length,l),d.push(b)),i.ud.assertAxesAreInnerMostDims("prod",p,l),r.shouldExecuteOnCPU([b])){var m=r.texData.get(b.dataId).values,v=oO(b.shape,b.dtype,m,p),g=v.outVals,y=v.outShape,O=v.outDtype;t=r.makeTensorInfo(y,O,g)}else{var x=i.ud.computeOutAndReduceShapes(b.shape,p),k=Object(o.a)(x,2),w=k[0],j=k[1],S=i.wf.sizeFromShape(j),N=yx({inputs:{x:b},backend:r,attrs:{shape:[-1,S]}}),I=wx(N,Object(i.jf)(s.dtype),"prod",r);t=yx({inputs:{x:I},backend:r,attrs:{shape:w}}),d.push(N),d.push(I)}if(u){d.push(t);var C=i.ud.expandShapeToKeepDim(t.shape,f);t=yx({inputs:{x:t},backend:r,attrs:{shape:C}})}return d.forEach((function(e){return r.disposeIntermediateTensorInfo(e)})),t}},YS=function(e){var t=e.backend,n=e.attrs,r=n.start,a=n.stop,i=n.step,o=n.dtype,s=sO(r,a,i,o);return t.makeTensorInfo([s.length],o,s)},$S={kernelName:i.jc,backendName:"webgl",kernelFunc:YS},QS=ux({opSnippet:"return 1.0 / x;"}),ZS={kernelName:i.mc,backendName:"webgl",kernelFunc:QS},JS=ux({opSnippet:"if (isnan(x)) return x;\n return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\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"}),eN={kernelName:i.nc,backendName:"webgl",kernelFunc:JS},tN=ux({opSnippet:"if (isnan(x)) return x;\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n vec4 result = min(x, vec4(6.)) * 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"}),nN={kernelName:i.oc,backendName:"webgl",kernelFunc:tN},rN=function e(t,n,r,a,i){Object(Yr.a)(this,e),this.variableNames=["A"],this.outputShape=[];var s=Object(o.a)(t,4),c=s[0],u=s[1],l=s[2],d=s[3];this.outputShape=[c,n,r,d];var f,p=[a&&n>1?u-1:u,a&&r>1?l-1:l],h=[a&&n>1?n-1:n,a&&r>1?r-1:r];f=i?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ".concat(p[0]/h[0],",\n ").concat(p[1]/h[1],");\n const vec2 inputShapeRC = vec2(").concat(u,".0, ").concat(l,".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 = ").concat(f,";\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\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 ")},aN=function e(t,n,r,a,i){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];var s=Object(o.a)(t,4),c=s[0],u=s[1],l=s[2],d=s[3];this.outputShape=[c,n,r,d];var f,p=[a&&n>1?u-1:u,a&&r>1?l-1:l],h=[a&&n>1?n-1:n,a&&r>1?r-1:r];f=i?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode="\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ".concat(p[0]/h[0],",\n ").concat(p[1]/h[1],",\n ").concat(p[1]/h[1],");\n const vec3 inputShapeRC = vec3(").concat(u,".0, ").concat(l,".0,\n ").concat(l,".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 = ").concat(f,";\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\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 < ").concat(d-1,";\n bool hasNextRow = coords.z < ").concat(r-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 ")};var iN={kernelName:i.qc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.images,s=r.alignCorners,c=r.halfPixelCenters,u=r.size,l=Object(o.a)(u,2),d=l[0],f=l[1],p=Object(i.Ud)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new aN(a.shape,d,f,s,c):new rN(a.shape,d,f,s,c);return n.runWebGLProgram(p,[a],"float32")}},oN=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["dy"],this.outputShape=[],this.outputShape=n;var a=Object(o.a)(n,3),i=a[1],s=a[2],c=Object(o.a)(t,3),u=c[1],l=c[2],d=[r&&u>1?i-1:i,r&&l>1?s-1:s],f=[r&&u>1?u-1:u,r&&l>1?l-1:l],p=d[0]/f[0],h=d[1]/f[1],b=1/p,m=1/h,v=2*Math.ceil(b)+2,g=2*Math.ceil(m)+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(".concat(p,");\n const float widthScale = float(").concat(h,");\n\n const float invHeightScale = float(").concat(b,");\n const float invWidthScale = float(").concat(m,");\n\n const int winHeight = int(").concat(v,");\n const int winWidth = int(").concat(g,");\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 >= ").concat(u,") {\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 >= ").concat(l,") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ").concat(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), ").concat(s-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 ")};var sN={kernelName:i.rc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.images,i=t.dy,o=r.alignCorners,s=new oN(i.shape,a.shape,o);return n.runWebGLProgram(s,[i],i.dtype)}},cN=function e(t,n,r,a,i){Object(Yr.a)(this,e),this.variableNames=["A"],this.outputShape=[];var s=Object(o.a)(t,4),c=s[0],u=s[1],l=s[2],d=s[3];this.outputShape=[c,n,r,d];var f,p=[a&&n>1?u-1:u,a&&r>1?l-1:l],h=[a&&n>1?n-1:n,a&&r>1?r-1:r],b=a?"0.5":"0.0";f=i?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ".concat(p[0]/h[0],",\n ").concat(p[1]/h[1],");\n const vec2 inputShapeRC = vec2(").concat(u,".0, ").concat(l,".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 = ").concat(f,";\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ").concat(b,")));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n ")},uN=function e(t,n,r,a,i){Object(Yr.a)(this,e),this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];var s=Object(o.a)(t,4),c=s[0],u=s[1],l=s[2],d=s[3];this.outputShape=[c,n,r,d];var f,p=[a&&n>1?u-1:u,a&&r>1?l-1:l],h=[a&&n>1?n-1:n,a&&r>1?r-1:r],b=a?"0.5":"0.0";f=i?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode="\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ".concat(p[0]/h[0],",\n ").concat(p[1]/h[1],",\n ").concat(p[1]/h[1],");\n const vec3 inputShapeRC = vec3(").concat(u,".0, ").concat(l,".0,\n ").concat(l,".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 = ").concat(f,";\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ").concat(b,")));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ").concat(d-1,";\n bool hasNextRow = coords.z < ").concat(r-1,";\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n ")};var lN={kernelName:i.sc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.images,s=r.alignCorners,c=r.halfPixelCenters,u=r.size,l=Object(o.a)(u,2),d=l[0],f=l[1],p=Object(i.Ud)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new uN(a.shape,d,f,s,c):new cN(a.shape,d,f,s,c);return n.runWebGLProgram(p,[a],a.dtype)}},dN=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["dy"],this.outputShape=[],this.outputShape=n;var a=Object(o.a)(n,3),i=a[1],s=a[2],c=Object(o.a)(t,3),u=c[1],l=c[2],d=[r&&u>1?i-1:i,r&&l>1?s-1:s],f=[r&&u>1?u-1:u,r&&l>1?l-1:l],p=d[0]/f[0],h=d[1]/f[1],b=1/p,m=1/h,v=2*Math.ceil(b)+2,g=2*Math.ceil(m)+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(".concat(p,");\n const float widthScale = float(").concat(h,");\n\n const float invHeightScale = float(").concat(b,");\n const float invWidthScale = float(").concat(m,");\n\n const int winHeight = int(").concat(v,");\n const int winWidth = int(").concat(g,");\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 >= ").concat(u,") {\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 >= ").concat(l,") {\n continue;\n }\n\n float sourceFracRow =\n float(").concat(d[0],") *\n (float(dyR) / float(").concat(f[0],"));\n\n float sourceFracCol =\n float(").concat(d[1],") *\n (float(dyC) / float(").concat(f[1],"));\n\n int sourceNearestRow = int(min(\n float(int(").concat(i,") - 1),\n ").concat(r," ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(").concat(s,") - 1),\n ").concat(r," ? 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 ")};var fN={kernelName:i.tc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.images,i=t.dy,o=r.alignCorners,s=new dN(i.shape,a.shape,o);return n.runWebGLProgram(s,[i],i.dtype)}},pN=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["x"];var r=t.length;if(r>4)throw new Error("WebGL backend: Reverse of rank-".concat(r," tensor is not yet supported"));if(this.outputShape=t,1!==r){var a=t.map((function(e,r){return function(e){return-1!==n.indexOf(e)&&1!==t[e]?"".concat(t[e]," - coords[").concat(e,"] - 1"):"coords[".concat(e,"]")}(r)})).join(","),i=Cy(r);this.userCode="\n void main() {\n ".concat(i," coords = getOutputCoords();\n setOutput(getX(").concat(a,"));\n }\n ")}else this.userCode="\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(".concat(t[0]," - coord - 1));\n }\n ")},hN=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;var r=t.length;if(r>4)throw new Error("WebGL backend: Reverse of rank-".concat(r," tensor is not yet supported"));this.outputShape=t;var a=jO("rc",r),i="".concat(a[r-1]," + 1 < ").concat(this.outputShape[r-1]),o="".concat(a[r-2]," + 1 < ").concat(this.outputShape[r-2]),s=Cy(r);function c(e){var r=t.map((function(r,a){return function(e,r){return-1!==n.indexOf(e)&&1!==t[e]?"".concat(t[e]," - ").concat(r[e]," - 1"):"".concat(r[e])}(a,e)})),a=r.join(","),i=r.slice(-2).join(",");return"getChannel(getX(".concat(a,"), vec2(").concat(i,"))")}this.userCode=1===r?"\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(".concat(t[0]," - rc - 1),\n ").concat(t[0]," - rc - 1);\n if(").concat(i,"){\n result.g = getChannel(getX(").concat(t[0]," - (rc + 1) - 1),\n ").concat(t[0]," - (rc + 1) - 1);\n }\n setOutput(result);\n }\n "):"\n void main() {\n ".concat(s," rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ").concat(function(e){return c(e)}(a.slice()),";\n if(").concat(i,"){\n result.g = ").concat(function(e){return e[r-1]="("+e[r-1]+" + 1)",c(e)}(a.slice()),";\n }\n if(").concat(o,") {\n result.b = ").concat(function(e){return e[r-2]="("+e[r-2]+" + 1)",c(e)}(a.slice()),";\n if(").concat(i,") {\n result.a = ").concat(function(e){return e[r-1]="("+e[r-1]+" + 1)",e[r-2]="("+e[r-2]+" + 1)",c(e)}(a.slice()),";\n }\n }\n setOutput(result);\n }\n ")};var bN={kernelName:i.uc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.dims,s=a.shape.length,c=i.wf.parseAxisParam(o,a.shape);if(0===s)return JO({inputs:{x:a},backend:n});var u=Object(i.Ud)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new hN(a.shape,c):new pN(a.shape,c);return n.runWebGLProgram(u,[a],a.dtype)}},mN=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];var r=t[1],a=t[2];this.outputShape=t;var i="";i="number"===typeof n?"float outputValue = ".concat(n.toFixed(2),";"):"\n vec3 fill = vec3(".concat(n.join(","),");\n float outputValue = fill[coords[3]];"),this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ".concat(i,"\n if(coordX >= 0 && coordX < ").concat(a," && coordY >= 0 && coordY < ").concat(r,") {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n ")},vN={kernelName:i.vc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,a=t.image,s=n.radians,c=n.fillValue,u=n.center,l=r,d=new mN(a.shape,c),f=i.ud.getImageCenter(u,a.shape[1],a.shape[2]),p=Object(o.a)(f,2),h=[[p[0],p[1],Math.sin(s),Math.cos(s)]];return l.runWebGLProgram(d,[a],a.dtype,h)}},gN=ux({opSnippet:"\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"}),yN={kernelName:i.wc,backendName:"webgl",kernelFunc:gN},ON=ux({opSnippet:"return inversesqrt(x);",cpuKernelImpl:cO}),xN={kernelName:i.xc,backendName:"webgl",kernelFunc:ON},kN=function e(t,n,r,a,i,o){Object(Yr.a)(this,e),this.variableNames=["updates","indices","defaultValue"],this.outputShape=o;var s=Cy(i.length),c=Cy(o.length),u="";1===r?u="i":2===r&&(u="i, j");var l="getIndices(".concat(u,")"),d="";1===a?d="i":2===a&&(d="i, coords[1]");var f="getUpdates(".concat(d,")"),p=n>1?"strides[j]":"strides";this.userCode="\n ".concat(s," strides = ").concat(s,"(").concat(i,");\n\n void main() {\n ").concat(c," coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ").concat(t,"; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ").concat(n,"; j++) {\n int index = round(").concat(l,");\n flattenedIndex += index * ").concat(p,";\n }\n if (flattenedIndex == coords[0]) {\n sum += ").concat(f,";\n found = true;\n }\n }\n setOutput(mix(getDefaultValue(), sum, float(found)));\n }\n ")};var wN={kernelName:i.yc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.indices,o=t.updates,s=r.shape,c=i.ud.calculateShapes(o,a,s),u=c.sliceRank,l=c.numUpdates,d=c.sliceSize,f=c.strides,p=c.outputSize,h=[p/d,d];if(0===p)return n.makeTensorInfo(s,a.dtype);var b=yx({inputs:{x:a},backend:n,attrs:{shape:[l,u]}}),m=yx({inputs:{x:o},backend:n,attrs:{shape:[l,d]}}),v=n.makeTensorInfo([],"float32",new Float32Array([0])),g=new kN(l,u,b.shape.length,m.shape.length,f,h),y=n.runWebGLProgram(g,[m,b,v],m.dtype),O=yx({inputs:{x:y},backend:n,attrs:{shape:s}});return n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(v),O}},jN=function e(t,n,r){var a,i;if(Object(Yr.a)(this,e),this.variableNames=["c","a","b"],this.outputShape=n,r>4)throw Error("Where for rank ".concat(r," is not yet supported"));if(1===r)i="resRC",a="resRC";else{for(var o=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[],c=[],u=0;u<n.length;u++)c.push("".concat(o[u])),u<t&&s.push("".concat(o[u]));a=s.join(),i=c.join()}var l=Cy(r);this.userCode="\n void main() {\n ".concat(l," resRC = getOutputCoords();\n float cVal = getC(").concat(a,");\n if (cVal >= 1.0) {\n setOutput(getA(").concat(i,"));\n } else {\n setOutput(getB(").concat(i,"));\n }\n }\n ")};var SN={kernelName:i.zc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.condition,a=t.t,o=t.e,s=new jN(r.shape.length,a.shape,a.shape.length);return n.runWebGLProgram(s,[r,a,o],Object(i.vf)(a.dtype,o.dtype))}},NN=ux({opSnippet:"\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ".concat(i.ud.SELU_SCALEALPHA,";\n float scale = ").concat(i.ud.SELU_SCALE,";\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n")}),IN={kernelName:i.Ac,backendName:"webgl",kernelFunc:NN},CN=ux({opSnippet:"return 1.0 / (1.0 + exp(-1.0 * x));"}),TN={kernelName:i.Bc,backendName:"webgl",kernelFunc:CN},EN=ux({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),AN={kernelName:i.Cc,backendName:"webgl",kernelFunc:EN},RN=ux({opSnippet:"if (isnan(x)) return x;\n return sin(x);\n"}),FN={kernelName:i.Dc,backendName:"webgl",kernelFunc:RN},DN=ux({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),_N={kernelName:i.Ec,backendName:"webgl",kernelFunc:DN},MN=ux({opSnippet:"\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"}),zN={kernelName:i.Hc,backendName:"webgl",kernelFunc:MN},LN={kernelName:i.Ic,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.blockShape,s=r.paddings;i.wf.assert(a.shape.length<=4,(function(){return"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"}));var c=o.reduce((function(e,t){return e*t})),u=[[0,0]];u.push.apply(u,Object(Vn.a)(s));for(var l=1+o.length;l<a.shape.length;++l)u.push([0,0]);var d=[],f=HS({inputs:{x:a},backend:n,attrs:{paddings:u,constantValue:0}}),p=i.ud.getReshaped(f.shape,o,c,!1),h=i.ud.getPermuted(p.length,o.length,!1),b=i.ud.getReshapedPermuted(f.shape,o,c,!1),m=yx({inputs:{x:f},backend:n,attrs:{shape:p}}),v=Tx({inputs:{x:m},backend:n,attrs:{perm:h}}),g=yx({inputs:{x:v},backend:n,attrs:{shape:b}});return d.push(f),d.push(m),d.push(v),d.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),g}};var PN={kernelName:i.Jc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.indices,a=t.values,i=t.denseShape,s=t.defaultValue;if(1!==i.shape.length)throw new Error("Dense shape must be a vector, saw:\n ".concat(i.shape));if(2!==r.shape.length)throw new Error("Indices must be a matrix, saw:\n ".concat(r.shape));if(1!==a.shape.length)throw new Error("Values must be a vector, saw:\n ".concat(a.shape));if(0!==s.shape.length)throw new Error("Default value must be a scalar, saw:\n ".concat(s.shape));var c=n.readSync(r.dataId),u=n.readSync(a.dataId),l=n.readSync(i.dataId),d=n.readSync(s.dataId)[0],f=dO(c,r.shape,r.dtype,u,a.dtype,l,d),p=Object(o.a)(f,5),h=p[0],b=p[1],m=p[2],v=p[3],g=p[4];return[n.makeTensorInfo(b,r.dtype,h),n.makeTensorInfo([b[0]],a.dtype,m),n.makeTensorInfo([v.length],"bool",new Uint8Array(v.map((function(e){return Number(e)})))),n.makeTensorInfo([g.length],r.dtype,new Int32Array(g))]}};var BN={kernelName:i.Kc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.inputIndices,a=t.inputShape,i=t.newShape;if(2!==r.shape.length)throw new Error("Input indices should be a matrix but received shape ".concat(r.shape));if(1!==a.shape.length)throw new Error("Input shape should be a vector but received shape ".concat(a.shape));if(1!==i.shape.length)throw new Error("Target shape should be a vector but received shape ".concat(i.shape));var s=Array.from(n.readSync(a.dataId)),c=n.readSync(r.dataId),u=Array.from(n.readSync(i.dataId)),l=fO(c,r.shape,r.dtype,s,u),d=Object(o.a)(l,3),f=d[0],p=d[1],h=d[2];return[n.makeTensorInfo(p,r.dtype,f),n.makeTensorInfo([h.length],i.dtype,new Int32Array(h))]}};var WN={kernelName:i.Lc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.data,a=t.indices,i=t.segmentIds;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error("Indices should be a vector but received shape\n ".concat(a.shape));if(1!==i.shape.length)throw new Error("Segment ids should be a vector but received shape\n ".concat(i.shape));var s=n.readSync(r.dataId),c=n.readSync(a.dataId),u=n.readSync(i.dataId),l=pO(s,r.shape,r.dtype,c,u,!0),d=Object(o.a)(l,2),f=d[0],p=d[1];return n.makeTensorInfo(p,r.dtype,f)}};var UN={kernelName:i.Mc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=t.data,a=t.indices,i=t.segmentIds;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error("Indices should be a vector but received shape\n ".concat(a.shape));if(1!==i.shape.length)throw new Error("Segment ids should be a vector but received shape\n ".concat(i.shape));var s=n.readSync(r.dataId),c=n.readSync(a.dataId),u=n.readSync(i.dataId),l=pO(s,r.shape,r.dtype,c,u),d=Object(o.a)(l,2),f=d[0],p=d[1];return n.makeTensorInfo(p,r.dtype,f)}};var VN={kernelName:i.Nc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.sparseIndices,o=t.sparseValues,s=t.defaultValue,c=r.outputShape,u=i.ud.calculateShapes(o,a,c),l=u.sliceRank,d=u.numUpdates,f=u.strides,p=u.outputSize,h=new kN(d,l,a.shape.length,o.shape.length,f,[p,1],!1),b=n.runWebGLProgram(h,[o,a,s],o.dtype),m=yx({inputs:{x:b},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(b),m}};var HN={kernelName:i.Oc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.numOrSizeSplits,s=r.axis,c=i.wf.parseAxisParam(s,a.shape)[0],u=i.ud.prepareSplitSize(a,o,c),l=a.shape.length,d=new Array(l).fill(0),f=a.shape.slice();return u.map((function(e){var t=Object(Vn.a)(f);t[c]=e;var r=Sk({inputs:{x:a},backend:n,attrs:{begin:d,size:t}});return d[c]+=e,r}))}},GN=ux({opSnippet:"return sqrt(x);"}),qN={kernelName:i.Pc,backendName:"webgl",kernelFunc:GN},KN=ux({opSnippet:"return x * x;"}),XN={kernelName:i.Qc,backendName:"webgl",kernelFunc:KN},YN="return (a - b) * (a - b);",$N=lx({opSnippet:YN,packedOpSnippet:YN}),QN={kernelName:i.Rc,backendName:"webgl",kernelFunc:$N};var ZN={kernelName:i.Sc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,a=t.x,i=RO+"\n return x > 0.0 ? 1.0 : float(".concat(n.alpha,");\n "),o=new AO(a.shape,i);return r.runWebGLProgram(o,[a],a.dtype)}},JN=function e(t,n,r){Object(Yr.a)(this,e),this.variableNames=["x"],this.outputShape=r;var a=r.length,i=Cy(r.length),o=Cy(r.length),s="";if(1===a)s="coords * strides + begin";else{var c=0;s=r.map((function(e,t){return c++,1===r.length?"coords * strides[".concat(t,"] + begin[").concat(t,"]"):"coords[".concat(c-1,"] * strides[").concat(t,"] + begin[").concat(t,"]")})).join(",")}this.userCode="\n ".concat(i," begin = ").concat(i,"(").concat(t,");\n ").concat(i," strides = ").concat(i,"(").concat(n,");\n\n void main() {\n ").concat(o," coords = getOutputCoords();\n setOutput(getX(").concat(s,"));\n }\n ")};var eI={kernelName:i.Tc,backendName:"webgl",kernelFunc:function(e){var t,n=e.inputs,r=e.backend,a=e.attrs,o=n.x,s=a.begin,c=a.end,u=a.strides,l=a.beginMask,d=a.endMask,f=a.ellipsisMask,p=a.newAxisMask,h=a.shrinkAxisMask,b=i.af.sliceInfo(o.shape,s,c,u,l,d,f,p,h),m=b.nonStrided,v=b.$begin,g=b.$strides,y=b.size,O=b.newShape,x=b.outShape,k=yx({inputs:{x:o},backend:r,attrs:{shape:O}});if(m){var w=Sk({inputs:{x:k},backend:r,attrs:{begin:v,size:y}});t=yx({inputs:{x:w},backend:r,attrs:{shape:x}}),r.disposeIntermediateTensorInfo(w)}else if(x.some((function(e){return 0===e})))t=r.makeTensorInfo(x,o.dtype,[]);else{if(r.shouldExecuteOnCPU([k])){var j=r.texData.get(k.dataId).values,S=Object(i.zd)(k.shape,k.dtype,j),N=hO(x,S,g,v);t=r.makeTensorInfo(x,k.dtype,N.values)}else{var I=new JN(v,g,x);t=r.runWebGLProgram(I,[k],k.dtype)}}var C=yx({inputs:{x:t},backend:r,attrs:{shape:x}});return r.disposeIntermediateTensorInfo(k),r.disposeIntermediateTensorInfo(t),C}};var tI={kernelName:i.Uc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=r.separator,i=r.nGramWidths,s=r.leftPad,c=r.rightPad,u=r.padWidth,l=r.preserveShortSequences,d=t.data,f=t.dataSplits,p=n.readSync(d.dataId),h=n.readSync(f.dataId),b=bO(p,h,a,i,s,c,u,l),m=Object(o.a)(b,2),v=m[0],g=m[1];return[n.makeTensorInfo([v.length],"string",v),n.makeTensorInfo(f.shape,"int32",g)]}};var nI={kernelName:i.Vc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs.skipEmpty,a=t.input,i=t.delimiter;if("string"!==a.dtype)throw new Error("Input must be of datatype string");if(1!==a.shape.length)throw new Error("Input must be a vector, got shape: ".concat(a.shape));if(0!==i.shape.length)throw new Error("Delimiter must be a scalar, got shape: ".concat(i.shape));var s=n.readSync(a.dataId),c=n.readSync(i.dataId)[0],u=mO(s,c,r),l=Object(o.a)(u,3),d=l[0],f=l[1],p=l[2],h=f.length;return[n.makeTensorInfo([h,2],"int32",d),n.makeTensorInfo([h],"string",f),n.makeTensorInfo([2],"int32",new Int32Array(p))]}};var rI={kernelName:i.Wc,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs.numBuckets,a=t.input;if("string"!==a.dtype)throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");var i=n.readSync(a.dataId),o=vO(i,r);return n.makeTensorInfo(a.shape,"int32",o)}},aI=ux({opSnippet:"return tan(x);"}),iI={kernelName:i.Zc,backendName:"webgl",kernelFunc:aI},oI=ux({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),sI={kernelName:i.ad,backendName:"webgl",kernelFunc:oI},cI=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["A"];for(var r=new Array(t.length),a=0;a<r.length;a++)r[a]=t[a]*n[a];this.outputShape=r,this.rank=r.length;var i=Cy(this.rank),o=function(e){var t=e.length;if(t>5)throw Error("Tile for rank ".concat(t," is not yet supported"));if(1===t)return"imod(resRC, ".concat(e[0],")");for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[],a=0;a<e.length;a++)r.push("imod(".concat(n[a],", ").concat(e[a],")"));return r.join()}(t);this.userCode="\n void main() {\n ".concat(i," resRC = getOutputCoords();\n setOutput(getA(").concat(o,"));\n }\n ")};function uI(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=r.reps;if("string"===a.dtype||a.shape.length>5){var s=n.readSync(a.dataId),c="string"===a.dtype?s.map((function(e){return i.wf.decodeString(e)})):s,u=Object(i.zd)(a.shape,a.dtype,c),l=yO(u,o);return n.makeTensorInfo(l.shape,l.dtype,l.values)}var d=new cI(a.shape,o);return n.runWebGLProgram(d,[a],a.dtype)}var lI={kernelName:i.dd,backendName:"webgl",kernelFunc:uI},dI=function e(t){Object(Yr.a)(this,e),this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=t,this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n "},fI=function e(t){Object(Yr.a)(this,e),this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=t,this.userCode="\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n "};function pI(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function hI(e){for(var t=1;t<e;)t*=2;return t}var bI={kernelName:i.ed,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,s=r.k,c=r.sorted,u=Object(i.Ud)().getNumber("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD"),l=Object(i.Ud)().getNumber("TOPK_K_CPU_HANDOFF_THRESHOLD"),d=a.shape,f=d[d.length-1];if(n.shouldExecuteOnCPU([a])||f<u||s>l){var p=n.readSync(a.dataId),h=OO(p,d,a.dtype,s,c),b=Object(o.a)(h,2),m=b[0],v=b[1];return[n.makeTensorInfo(m.shape,m.dtype,m.values),n.makeTensorInfo(v.shape,v.dtype,v.values)]}if(0===s)return d[d.length-1]=0,[n.makeTensorInfo(d,a.dtype,[]),n.makeTensorInfo(d,"int32",[])];if(1===f)return[a,nj({attrs:{shape:d,dtype:"int32",value:0},backend:n})];var g=n.texData.get(a.dataId),y=null!==g&&g.isPacked,O=y?n.unpackTensor(a):a,x=i.wf.sizeFromShape(d)/f,k=yx({inputs:{x:O},attrs:{shape:[x,f]},backend:n});y&&pI(n,O);for(var w=hI(s),j=hI(f),S=null,N=function(){return null===S?[k,k]:[k,S]},I=function(e,t,r){var a=N(),i=new dI(r),o=[[f],[null===S?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],s=S;S=n.runWebGLProgram(i,a,"int32",o),pI(n,s)},C=1;C<w;C*=2)for(var T=2*C,E=C;E>=1;E/=2)I(T,E,[x,j]);for(var A=j;A>w;A/=2){var R=N(),F=new fI([x,A/2]),D=[[f],[null===S?1:0],[w]],_=S;S=n.runWebGLProgram(F,R,"int32",D),pI(n,_);for(var M=w/2,z=2*M,L=M;L>=1;L/=2)I(z,L,S.shape)}var P=S;S=Sk({inputs:{x:S},backend:n,attrs:{begin:0,size:[x,s]}}),pI(n,P);var B=Oj({inputs:{x:k,indices:S},backend:n,attrs:{axis:1,batchDims:1}});pI(n,k);var W=d.slice(0,-1);W.push(s),P=S,S=yx({inputs:{x:S},attrs:{shape:W},backend:n}),pI(n,P);var U=B;return B=yx({inputs:{x:B},attrs:{shape:W},backend:n}),pI(n,U),[B,S]}},mI=function e(t,n,r,a,i,o){Object(Yr.a)(this,e),this.variableNames=["Image","Transforms"],this.outputShape=o;var s,c="nearest"===r?1:2;switch(a){case"constant":s=1;break;case"reflect":s=2;break;case"wrap":s=3;break;case"nearest":s=4;break;default:s=1}this.userCode="\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(".concat(s," == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (").concat(s," == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (").concat(s," == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ").concat(t," && 0 <= coordX && coordX < ").concat(n,") {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(").concat(i,");\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(").concat(i,");\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(").concat(n,"));\n float mapY = mapCoord(inY, float(").concat(t,"));\n\n if (").concat(c," == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n ")};var vI={kernelName:i.fd,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.image,i=t.transforms,s=r.interpolation,c=r.fillMode,u=r.fillValue,l=r.outputShape,d=Object(o.a)(a.shape,4),f=d[0],p=d[1],h=d[2],b=d[3],m=null!=l?l:[p,h],v=Object(o.a)(m,2),g=v[0],y=v[1],O=new mI(p,h,s,c,u,[f,g,y,b]);return n.runWebGLProgram(O,[a,i],"float32")}};var gI={kernelName:i.hd,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.attrs,r=e.backend,a=n.axis,i=t.x;Pg(i,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");var o=r.readSync(i.dataId),s=kO(o,a,i.shape,i.dtype),c=s.outputValues,u=s.outputShape,l=s.indices;return[r.makeTensorInfo(u,i.dtype,c),r.makeTensorInfo([l.length],"int32",l)]}};var yI={kernelName:i.id,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.value,i=r.axis;i<0&&(i+=a.shape.length);for(var o=a,s=o.shape.length,c=a.shape[i],u=new Array(s-1),l=0,d=0;d<s;d++)d!==i&&(u[l++]=o.shape[d]);var f=[],p=new Array(s).fill(0),h=o.shape.slice();h[i]=1;for(var b=new Array(c),m=0;m<b.length;m++){p[i]=m;var v=Sk({inputs:{x:o},backend:n,attrs:{begin:p,size:h}}),g=yx({inputs:{x:v},backend:n,attrs:{shape:u}});b[m]=g,f.push(v)}return f.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),b}},OI=function e(t,n){Object(Yr.a)(this,e),this.variableNames=["x","segmentIds"];var r=t.windowSize,a=t.batchSize,i=t.inSize,o=t.numSegments,s=o*Math.ceil(i/r);this.outputShape=[a,s];var c=4*Math.floor(r/4),u=r%4,l="\n sumValue += dot(values, segFilter);\n ",d="";i%r>0&&(d="\n if (inIdx < 0 || inIdx >= ".concat(i,") {\n return initializationValue;\n }\n "));var f="";i%r>0&&(f="\n if (inIdx < 0 || inIdx >= ".concat(i,") {\n return -1.0;\n }\n ")),this.userCode="\n const float initializationValue = ".concat("0.0",";\n\n float getValue(int batch, int inIdx) {\n ").concat(d,"\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ").concat(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 ").concat(o,")) * float(").concat(r,"));\n int currentSeg = int(mod(float(outIdx), float(").concat(o,")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ").concat(c,"; 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 ").concat(l,"\n }\n\n int inIdx = inOffset + ").concat(c,";\n if (").concat(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 ").concat(l,"\n } else if (").concat(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 ").concat(l,"\n } else if (").concat(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 ").concat(l,"\n }\n setOutput(").concat("sumValue",");\n }\n ")};for(var xI=0,kI=[$j,Zj,Rx,Dx,Mx,Lx,Wx,Hx,Gx,qx,Zx,Jx,tk,rk,sk,ik,uk,pk,fk,mk,vk,gk,xk,Ik,Ck,Fk,Mk,Pk,Uk,nx,$k,sw,cw,nw,lw,dw,uw,pw,bw,vw,xw,kw,jw,Ew,Aw,Iw,Fw,_w,Mw,Lw,Pw,Ww,Vw,qw,Xw,Qw,ej,aj,oj,uj,dj,hj,bj,mj,gj,xj,wj,Sj,ex,Nj,Kk,Cj,Ej,Rj,ix,Dj,Mj,zj,Wj,Pj,Vj,Gj,Kj,eS,aS,rS,sS,cS,uS,nS,lS,dS,pS,mS,gS,IS,gx,TS,AS,FS,_S,Ek,zS,BS,WS,GS,KS,cx,XS,$S,Rk,xS,ZS,nN,eN,Ox,iN,sN,lN,fN,bN,vN,yN,xN,wN,SN,IN,TN,AN,FN,_N,Nk,NS,zN,LN,PN,BN,WN,UN,VN,HN,qN,XN,QN,ZN,eI,tI,nI,rI,jS,Cx,iI,sI,lI,bI,vI,Ex,gI,yI,{kernelName:i.jd,backendName:"webgl",kernelFunc:function(e){var t=e.inputs,n=e.backend,r=e.attrs,a=t.x,o=t.segmentIds,s=r.numSegments,c=a.shape.length,u=[],l=0,d=i.ud.getAxesPermutation([l],c),f=a;null!=d&&(f=Tx({inputs:{x:a},backend:n,attrs:{perm:d}}),u.push(f),l=i.ud.getInnerMostAxes(1,c)[0]);var p=i.ud.segment_util.computeOutShape(f.shape,l,s),h=i.wf.sizeFromShape([f.shape[l]]),b=yx({inputs:{x:f},backend:n,attrs:{shape:[-1,h]}});u.push(b);var m=yx({inputs:{x:function e(t,r,a,o,s){var c=t.shape[0],l=t.shape[1],d=i.ud.segment_util.segOpComputeOptimalWindowSize(l,s),f=new OI({windowSize:d,inSize:l,batchSize:c,numSegments:s},r),p=n.compileAndRun(f,[t,a],o);if(u.push(p),p.shape[1]===s)return p;var h=YS({backend:n,attrs:{start:0,stop:s,step:1,dtype:"float32"}}),b=uI({inputs:{x:h},backend:n,attrs:{reps:[l/d]}});return u.push(h),u.push(b),e(p,r,b,o,s)}(b,"unsortedSegmentSum",o,Object(i.jf)(a.dtype),s)},backend:n,attrs:{shape:p}}),v=m;if(null!=d){u.push(m);var g=i.ud.getUndoAxesPermutation(d);v=Tx({inputs:{x:v},backend:n,attrs:{perm:g}})}return u.forEach((function(e){return n.disposeIntermediateTensorInfo(e)})),v}},PS];xI<kI.length;xI++){var wI=kI[xI];Object(i.Le)(wI)}i.zf},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return o}));n(21);var r=n(9),a=n(10),i=(n(2),n(15));function o(e,t){i.b(i.u(e),(function(){return"The f passed in variableGrads(f) must be a function"})),i.b(null==t||Array.isArray(t)&&t.every((function(e){return e instanceof a.c})),(function(){return"The varList passed in variableGrads(f, varList) must be an array of variables"}));var n=null!=t;if(!n)for(var o in t=[],r.a.registeredVariables)t.push(r.a.registeredVariables[o]);var s=n?t.filter((function(e){return!e.trainable})):null,c=t.length;t=t.filter((function(e){return e.trainable})),i.b(t.length>0,(function(){return"variableGrads() expects at least one of the input variables to "+"be trainable, but none of the ".concat(c," variables is ")+"trainable."}));var u=r.a.gradients(e,t,null,!0),l=u.value,d=u.grads;i.b(d.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()."})),i.b(0===l.rank,(function(){return"The f passed in variableGrads(f) must return a scalar, but it "+"returned a rank-".concat(l.rank," tensor")}));var f={};return t.forEach((function(e,t){null!=d[t]&&(f[e.name]=d[t])})),null!=s&&s.forEach((function(e){return f[e.name]=null})),{value:l,grads:f}}function s(e){return r.a.customGrad(e)}},function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),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"}(r||(r={}))},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}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({sqrt_:function(e){var t={x:Object(i.a)(e,"x","sqrt")};return r.a.runKernel(a.Oc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return O})),n.d(t,"b",(function(){return j})),n.d(t,"c",(function(){return b})),n.d(t,"d",(function(){return E})),n.d(t,"e",(function(){return h})),n.d(t,"f",(function(){return w})),n.d(t,"g",(function(){return R})),n.d(t,"h",(function(){return F}));var r=n(63),a=n(4),i=n.n(a),o=(n(30),n(96)),s=n(242),c=n(88),u=n(14),l=n(243),d=n.n(l),f=(n(140),n(75)),p=(n(168),function(e){var t=Object(s.a)();return t.displayName=e,t}("Router-History")),h=function(e){var t=Object(s.a)();return t.displayName=e,t}("Router"),b=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(r.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(h.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.a.createElement(p.Provider,{children:this.props.children||null,value:this.props.history}))},t}(i.a.Component);i.a.Component;var m=function(e){function t(){return e.apply(this,arguments)||this}Object(r.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(i.a.Component);var v={},g=0;function y(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(v[e])return v[e];var t=d.a.compile(e);return g<1e4&&(v[e]=t,g++),t}(e)(t,{pretty:!0})}function O(e){var t=e.computedMatch,n=e.to,r=e.push,a=void 0!==r&&r;return i.a.createElement(h.Consumer,null,(function(e){e||Object(c.a)(!1);var r=e.history,s=e.staticContext,l=a?r.push:r.replace,d=Object(o.c)(t?"string"===typeof n?y(n,t.params):Object(u.a)({},n,{pathname:y(n.pathname,t.params)}):n);return s?(l(d),null):i.a.createElement(m,{onMount:function(){l(d)},onUpdate:function(e,t){var n=Object(o.c)(t.to);Object(o.f)(n,Object(u.a)({},d,{key:n.key}))||l(d)},to:n})}))}var x={},k=0;function w(e,t){void 0===t&&(t={}),("string"===typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,i=void 0!==a&&a,o=n.strict,s=void 0!==o&&o,c=n.sensitive,u=void 0!==c&&c;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=x[n]||(x[n]={});if(r[e])return r[e];var a=[],i={regexp:d()(e,a,t),keys:a};return k<1e4&&(r[e]=i,k++),i}(n,{end:i,strict:s,sensitive:u}),a=r.regexp,o=r.keys,c=a.exec(e);if(!c)return null;var l=c[0],f=c.slice(1),p=e===l;return i&&!p?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:p,params:o.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var j=function(e){function t(){return e.apply(this,arguments)||this}return Object(r.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(h.Consumer,null,(function(t){t||Object(c.a)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?w(n.pathname,e.props):t.match,a=Object(u.a)({},t,{location:n,match:r}),o=e.props,s=o.children,l=o.component,d=o.render;return Array.isArray(s)&&0===s.length&&(s=null),i.a.createElement(h.Provider,{value:a},a.match?s?"function"===typeof s?s(a):s:l?i.a.createElement(l,a):d?d(a):null:"function"===typeof s?s(a):null)}))},t}(i.a.Component);function S(e){return"/"===e.charAt(0)?e:"/"+e}function N(e,t){if(!e)return t;var n=S(e);return 0!==t.pathname.indexOf(n)?t:Object(u.a)({},t,{pathname:t.pathname.substr(n.length)})}function I(e){return"string"===typeof e?e:Object(o.e)(e)}function C(e){return function(){Object(c.a)(!1)}}function T(){}i.a.Component;var E=function(e){function t(){return e.apply(this,arguments)||this}return Object(r.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(h.Consumer,null,(function(t){t||Object(c.a)(!1);var n,r,a=e.props.location||t.location;return i.a.Children.forEach(e.props.children,(function(e){if(null==r&&i.a.isValidElement(e)){n=e;var o=e.props.path||e.props.from;r=o?w(a.pathname,Object(u.a)({},e.props,{path:o})):t.match}})),r?i.a.cloneElement(n,{location:a,computedMatch:r}):null}))},t}(i.a.Component);var A=i.a.useContext;function R(){return A(p)}function F(){return A(h).location}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"f",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"g",(function(){return d}));var r=n(15);function a(e,t){for(var n=0;n<e.length;++n)if(e[e.length-n-1]!==t-1-n)return!1;return!0}function i(e,t,n){for(var r=e.length+t.length,a=[],i=0,o=0,s=0;s<r;s++)-1===n.indexOf(s)?a.push(e[i++]):a.push(t[o++]);return a}function o(e,t){for(var n=[],r=e.length,a=0;a<r;a++)-1===t.indexOf(a)&&n.push(e[a]);return[n,t.map((function(t){return e[t]}))]}function s(e,t){return i(e,t.map((function(e){return 1})),t)}function c(e,t,n){r.b(a(t,n),(function(){return"".concat(e," supports only inner-most axes for now. ")+"Got axes ".concat(t," and rank-").concat(n," input.")}))}function u(e,t){if(a(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 l(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 d(e,t){for(var n=[],r=t-e;r<t;++r)n.push(r);return n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({exp_:function(e){var t={x:Object(i.a)(e,"x","exp")};return r.a.runKernel(a.ab,t)}})},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.d(t,"a",(function(){return a}));var r=n(311);function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(34),u=n(8);var l=Object(u.b)({greater_:function(e,t){var n=Object(s.a)(e,"a","greater","string_or_numeric"),u=Object(s.a)(t,"b","greater","string_or_numeric"),l=Object(o.makeTypesMatch)(n,u),d=Object(r.a)(l,2);n=d[0],u=d[1],Object(c.a)(n.shape,u.shape);var f={a:n,b:u};return a.a.runKernel(i.ob,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({abs_:function(e){var t=Object(i.a)(e,"x","abs");if("complex64"===t.dtype){var n={x:t};return r.a.runKernel(a.A,n)}var o={x:t};return r.a.runKernel(a.a,o)}})},function(e,t,n){"use strict";n.d(t,"c",(function(){return h})),n.d(t,"b",(function(){return b})),n.d(t,"a",(function(){return m})),n.d(t,"d",(function(){return v}));var r=n(34),a=n(147),i=n(150),o=n(18),s=n(157),c=n(101),u=n(158),l=n(13),d=n(93),f=n(102),p=n(32);function h(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Object(o.a)(e,Object(f.a)(t));throw new Error("Cannot compute gradient for fused activation ".concat(n,"."))}function b(e,t){var n=t,a=r.c(e.shape,t.shape);return a.length>0&&(n=Object(p.a)(n,a)),Object(l.a)(n,e.shape)}function m(e,t,n,r){if("linear"===t)return e;if("relu"===t)return Object(c.a)(e);if("elu"===t)return Object(a.a)(e);if("relu6"===t)return Object(u.a)(e);if("prelu"===t)return Object(s.a)(e,n);if("leakyrelu"===t)return Object(i.a)(e,r);if("sigmoid"===t)return Object(d.a)(e);throw new Error("Unknown fused activation ".concat(t,"."))}var v=function(e,t){return!(e>0)||"linear"===t}},function(e,t,n){"use strict";n.d(t,"f",(function(){return y})),n.d(t,"e",(function(){return O})),n.d(t,"d",(function(){return x})),n.d(t,"g",(function(){return k})),n.d(t,"a",(function(){return j})),n.d(t,"b",(function(){return _})),n.d(t,"c",(function(){return w}));var r=n(20),a=n(16),i=n(17),o=n(5),s=n.n(o),c=n(12),u=n(7),l=n(11),d=n(0),f=n(109),p=n(95);function h(e){return e instanceof d.bd?{value:e.clone(),recurse:!1}:Object(p.e)(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}var b=n(28),m=n(26),v=function(){function e(t){if(Object(u.a)(this,e),this.capacity=t,this.begin=0,this.end=0,null==t)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(t<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(t),this.doubledCapacity=2*t}return Object(l.a)(e,[{key:"wrap",value:function(e){for(;e<0;)e+=this.doubledCapacity;return e%this.doubledCapacity}},{key:"get",value:function(e){if(e<0)throw new RangeError("Can't get item at a negative index.");return this.data[e%this.capacity]}},{key:"set",value:function(e,t){if(e<0)throw new RangeError("Can't set item at a negative index.");this.data[e%this.capacity]=t}},{key:"length",value:function(){var e=this.end-this.begin;return e<0&&(e=this.doubledCapacity+e),e}},{key:"isFull",value:function(){return this.length()===this.capacity}},{key:"isEmpty",value:function(){return 0===this.length()}},{key:"push",value:function(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,e),this.end=this.wrap(this.end+1)}},{key:"pushAll",value:function(e){var t,n=Object(r.a)(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;this.push(a)}}catch(i){n.e(i)}finally{n.f()}}},{key:"pop",value: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}},{key:"unshift",value:function(e){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,e)}},{key:"shift",value: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}},{key:"shuffleExcise",value: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}(),g=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(){return Object(u.a)(this,n),t.call(this,n.INITIAL_CAPACITY)}return Object(l.a)(n,[{key:"isFull",value:function(){return!1}},{key:"push",value:function(e){Object(b.a)(Object(m.a)(n.prototype),"isFull",this).call(this)&&this.expand(),Object(b.a)(Object(m.a)(n.prototype),"push",this).call(this,e)}},{key:"unshift",value:function(e){Object(b.a)(Object(m.a)(n.prototype),"isFull",this).call(this)&&this.expand(),Object(b.a)(Object(m.a)(n.prototype),"unshift",this).call(this,e)}},{key:"expand",value: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}}]),n}(v);function y(e){return new S(e)}function O(e){return new N(e)}function x(e,t){return new z(e,t)}function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w.FAIL;return new L(e,t)}g.INITIAL_CAPACITY=32;var w,j=function(){function e(){Object(u.a)(this,e)}return Object(l.a)(e,[{key:"toArray",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],e.next=3,this.next();case 3:n=e.sent;case 4:if(n.done){e.next=11;break}return t.push(n.value),e.next=8,this.next();case 8:n=e.sent,e.next=4;break;case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toArrayForTest",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t,n,r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.prefetch(100),n=[],e.next=4,t.next();case 4:r=e.sent;case 5:if(r.done){e.next=12;break}return n.push(r.value),e.next=9,t.next();case 9:r=e.sent,e.next=5;break;case 12:return e.abrupt("return",n);case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resolveFully",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.next();case 2:t=e.sent;case 3:if(t.done){e.next=9;break}return e.next=6,this.next();case 6:t=e.sent,e.next=3;break;case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resolveWhile",value:function(){var e=Object(c.a)(s.a.mark((function e(t){var n,r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.next();case 2:n=e.sent,r=t(n.value);case 4:if(n.done||!r){e.next=11;break}return e.next=7,this.next();case 7:n=e.sent,r=t(n.value),e.next=4;break;case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"handleErrors",value:function(e){return new F(this,e)}},{key:"filter",value:function(e){return new A(this,e)}},{key:"map",value:function(e){return new R(this,e)}},{key:"mapAsync",value:function(e){return new D(this,e)}},{key:"serialMapAsync",value:function(e){return new D(this,e).serial()}},{key:"flatmap",value:function(e){return new M(this,e)}},{key:"forEachAsync",value:function(){var e=Object(c.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.map(t).resolveFully());case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"serialForEach",value:function(){var e=Object(c.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialMapAsync(t).resolveWhile((function(e){return!0===e})));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rowMajorBatch",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new E(this,e,t)}},{key:"columnMajorBatch",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.f,r=this.rowMajorBatch(e,t);return r.map((function(e){return Object(p.d)(e,n)}))}},{key:"concatenate",value:function(e,t){return new z(y([this,e]),t)}},{key:"take",value:function(e){return e<0||null==e?this:new T(this,e)}},{key:"skip",value:function(e){return e<0||null==e?this:new C(this,e)}},{key:"prefetch",value:function(e){return new P(this,e)}},{key:"shuffle",value:function(e,t){return new B(this,e,t)}},{key:"serial",value:function(){return new I(this)}}]),e}(),S=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e){var r;return Object(u.a)(this,n),(r=t.call(this)).items=e,r.trav=0,r}return Object(l.a)(n,[{key:"summary",value:function(){return"Array of ".concat(this.items.length," items")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.trav>=this.items.length)){e.next=2;break}return e.abrupt("return",{value:null,done:!0});case 2:return t=this.items[this.trav],this.trav++,e.abrupt("return",{value:(n=t,Object(p.b)(n,h)),done:!1});case 5:case"end":return e.stop()}var n}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),N=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e){var r;return Object(u.a)(this,n),(r=t.call(this)).nextFn=e,r}return Object(l.a)(n,[{key:"summary",value:function(){return"Function call"}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",this.nextFn());case 4:throw e.prev=4,e.t0=e.catch(0),e.t0.message="Error thrown while iterating through a dataset: ".concat(e.t0.message),e.t0;case 8:case"end":return e.stop()}}),e,this,[[0,4]])})));return function(){return e.apply(this,arguments)}}()}]),n}(j),I=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e){var r;return Object(u.a)(this,n),(r=t.call(this)).upstream=e,r.lastRead=Promise.resolve({value:null,done:!1}),r}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Serial")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(c.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.upstream.next());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),C=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this)).upstream=e,a.maxCount=r,a.count=0,a.lastRead=Promise.resolve({value:null,done:!1}),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Skip")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.count++<this.maxCount)){e.next=9;break}return e.next=3,this.upstream.next();case 3:if(!(t=e.sent).done){e.next=6;break}return e.abrupt("return",t);case 6:d.Pd(t.value),e.next=0;break;case 9:return e.abrupt("return",this.upstream.next());case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),T=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this)).upstream=e,a.maxCount=r,a.count=0,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Take")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.count++>=this.maxCount)){e.next=2;break}return e.abrupt("return",{value:null,done:!0});case 2:return e.abrupt("return",this.upstream.next());case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),E=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Object(u.a)(this,n),(a=t.call(this)).upstream=e,a.batchSize=r,a.enableSmallLastBatch=i,a.lastRead=Promise.resolve({value:null,done:!1}),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> RowMajorBatch")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[];case 1:if(!(t.length<this.batchSize)){e.next=12;break}return e.next=4,this.upstream.next();case 4:if(!(n=e.sent).done){e.next=9;break}if(!(this.enableSmallLastBatch&&t.length>0)){e.next=8;break}return e.abrupt("return",{value:t,done:!1});case 8:return e.abrupt("return",{value:null,done:!0});case 9:t.push(n.value),e.next=1;break;case 12:return e.abrupt("return",{value:t,done:!1});case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),A=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this)).upstream=e,a.predicate=r,a.lastRead=Promise.resolve({value:null,done:!1}),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Filter")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,this.upstream.next();case 3:if(!(t=e.sent).done&&!this.predicate(t.value)){e.next=6;break}return e.abrupt("return",t);case 6:d.Pd(t.value),e.next=0;break;case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),R=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this)).upstream=e,a.transform=r,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Map")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t,n,a,i,o,c,u;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.upstream.next();case 2:if(!(t=e.sent).done){e.next=5;break}return e.abrupt("return",{value:null,done:!0});case 5:n=d.of.getTensorsInContainer(t.value),a=this.transform(t.value),i=d.of.getTensorsInContainer(a),o=Object(r.a)(n);try{for(o.s();!(c=o.n()).done;)u=c.value,d.of.isTensorInList(u,i)||u.dispose()}catch(s){o.e(s)}finally{o.f()}return e.abrupt("return",{value:a,done:!1});case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),F=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this)).upstream=e,a.handler=r,a.count=0,a.lastRead=Promise.resolve({value:null,done:!1}),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> handleErrors")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(c.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=1,e.next=4,this.upstream.next();case 4:return e.abrupt("return",e.sent);case 7:if(e.prev=7,e.t0=e.catch(1),this.handler(e.t0)){e.next=11;break}return e.abrupt("return",{value:null,done:!0});case 11:e.next=0;break;case 13:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(){return e.apply(this,arguments)}}()}]),n}(j),D=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this)).upstream=e,a.transform=r,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> AsyncMap")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t,n,a,i,o,c,u;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.upstream.next();case 2:if(!(t=e.sent).done){e.next=5;break}return e.abrupt("return",{value:null,done:!0});case 5:return n=d.of.getTensorsInContainer(t.value),e.next=8,this.transform(t.value);case 8:a=e.sent,i=d.of.getTensorsInContainer(a),o=Object(r.a)(n);try{for(o.s();!(c=o.n()).done;)u=c.value,d.of.isTensorInList(u,i)||u.dispose()}catch(s){o.e(s)}finally{o.f()}return e.abrupt("return",{value:a,done:!1});case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),_=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(){var e;return Object(u.a)(this,n),(e=t.call(this)).outputQueue=new g,e.lastRead=Promise.resolve({value:null,done:!1}),e}return Object(l.a)(n,[{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"serialNext",value:function(){var e=Object(c.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.outputQueue.length()){e.next=7;break}return e.next=3,this.pump();case 3:if(e.sent){e.next=5;break}return e.abrupt("return",{value:null,done:!0});case 5:e.next=0;break;case 7:return e.abrupt("return",{value:this.outputQueue.shift(),done:!1});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),M=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this)).upstream=e,a.transform=r,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Flatmap")}},{key:"pump",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t,n,a,i,o,c,u;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.upstream.next();case 2:if(!(t=e.sent).done){e.next=5;break}return e.abrupt("return",!1);case 5:n=d.of.getTensorsInContainer(t.value),a=this.transform(t.value),i=d.of.getTensorsInContainer(a),this.outputQueue.pushAll(a),o=Object(r.a)(n);try{for(o.s();!(c=o.n()).done;)u=c.value,d.of.isTensorInList(u,i)||u.dispose()}catch(s){o.e(s)}finally{o.f()}return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(_),z=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this)).baseErrorHandler=r,a.lastRead=null,a.iterator=null,a.moreIterators=e,a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat("TODO: fill in upstream of chained summaries"," -> Chained")}},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.readFromChain(this.lastRead),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"readFromChain",value:function(){var e=Object(c.a)(s.a.mark((function e(t){var n,r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(null!=this.iterator){e.next=10;break}return e.next=5,this.moreIterators.next();case 5:if(!(n=e.sent).done){e.next=8;break}return e.abrupt("return",{value:null,done:!0});case 8:this.iterator=n.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler));case 10:return e.next=12,this.iterator.next();case 12:if(!(r=e.sent).done){e.next=16;break}return this.iterator=null,e.abrupt("return",this.readFromChain(t));case 16:return e.abrupt("return",r);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(j);!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(w||(w={}));var L=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w.FAIL;return Object(u.a)(this,n),(r=t.call(this)).iterators=e,r.mismatchMode=a,r.count=0,r.currentPromise=null,r}return Object(l.a)(n,[{key:"summary",value:function(){return"{".concat("TODO: fill in upstream of zip summaries","} -> Zip")}},{key:"nextState",value:function(){var e=Object(c.a)(s.a.mark((function e(t){var n,r,a,i;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=function(e){return e instanceof j?{value:e.next().then((function(e){return n++,e.done&&r++,e.value})),recurse:!1}:{value:null,recurse:!0}},e.next=3,t;case 3:return n=0,r=0,e.next=7,Object(p.c)(this.iterators,a);case 7:if(i=e.sent,n!==r){e.next=10;break}return e.abrupt("return",{value:null,done:!0});case 10:if(!(r>0)){e.next=16;break}e.t0=this.mismatchMode,e.next=e.t0===w.FAIL?14:e.t0===w.SHORTEST?15:(e.t0,w.LONGEST,16);break;case 14:throw new Error("Zipped streams should have the same length. "+"Mismatched at element ".concat(this.count,"."));case 15:return e.abrupt("return",{value:null,done:!0});case 16:return this.count++,e.abrupt("return",{value:i,done:!1});case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.currentPromise=this.nextState(this.currentPromise),e.abrupt("return",this.currentPromise);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(j),P=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r){var a;return Object(u.a)(this,n),(a=t.call(this)).upstream=e,a.bufferSize=r,a.buffer=new v(r),a}return Object(l.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Prefetch")}},{key:"refill",value:function(){for(;!this.buffer.isFull();){var e=this.upstream.next();this.buffer.push(e)}}},{key:"next",value:function(){return this.refill(),this.buffer.shift()}}]),n}(j),B=function(e){Object(a.a)(n,e);var t=Object(i.a)(n);function n(e,r,a){var i;return Object(u.a)(this,n),(i=t.call(this,e,r)).upstream=e,i.windowSize=r,i.upstreamExhausted=!1,i.random=f.alea(a||d.wf.now().toString()),i.lastRead=Promise.resolve({value:null,done:!1}),i}return Object(l.a)(n,[{key:"next",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),e.abrupt("return",this.lastRead);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"randomInt",value:function(e){return Math.floor(this.random()*e)}},{key:"chooseIndex",value:function(){return this.randomInt(this.buffer.length())}},{key:"serialNext",value:function(){var e=Object(c.a)(s.a.mark((function e(){var t,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.upstreamExhausted||this.refill();case 1:if(this.buffer.isEmpty()){e.next=14;break}return t=this.chooseIndex(),e.next=5,this.buffer.shuffleExcise(t);case 5:if(!(n=e.sent).done){e.next=10;break}this.upstreamExhausted=!0,e.next=12;break;case 10:return this.refill(),e.abrupt("return",n);case 12:e.next=1;break;case 14:return e.abrupt("return",{value:null,done:!0});case 15:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(P)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(10),a=n(15);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"float32",n=arguments.length>2?arguments[2]:void 0;return t=t||"float32",a.c(e),new r.b(e,t,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({reverse_:function(e,t){var n={x:Object(i.a)(e,"x","reverse")},o={dims:t};return r.a.runKernel(a.tc,n,o)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),a=n(15),i=n(71);function o(e,t){Object(a.d)(e);var n=Object(r.c)(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Object(i.a)(e,null,n,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(9),a=n(15),i=n(19);function o(e,t,n,o){if(null==o&&(o=Object(a.r)(e)),"complex64"===o)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!Object(a.A)(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");if(null!=t){Object(a.c)(t);var s=Object(a.O)(t),c=Object(a.O)(n);Object(a.b)(s===c,(function(){return"Based on the provided shape, [".concat(t,"], the tensor should have ")+"".concat(s," values but has ").concat(c)}));for(var u=0;u<n.length;++u){var l=n[u],d=u!==n.length-1||l!==Object(a.O)(t.slice(u));Object(a.b)(n[u]===t[u]||!d,(function(){return"Error creating a new Tensor. Inferred shape "+"(".concat(n,") does not match the provided ")+"shape (".concat(t,"). ")}))}}return Object(a.A)(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==o?Object(i.toTypedArray)(e,o):Object(a.m)(e,[],!0),r.a.makeTensor(e,t,o)}},function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(8);var u=Object(c.b)({pow_:function(e,t){var n=Object(s.a)(e,"base","pow"),c=Object(s.a)(t,"exp","pow"),u=Object(o.makeTypesMatch)(n,c),l=Object(r.a)(u,2),d={a:n=l[0],b:c=l[1]};return a.a.runKernel(i.fc,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(15),i=n(81),o=n(100);function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"float32";if("complex64"===t){var n=s(e,"float32"),c=Object(o.a)(e,"float32");return Object(i.a)(n,c)}var u=Object(a.D)(Object(a.O)(e),t);return r.a.makeTensor(u,e,t)}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(34),u=n(8);var l=Object(u.b)({lessEqual_:function(e,t){var n=Object(s.a)(e,"a","lessEqual","string_or_numeric"),u=Object(s.a)(t,"b","lessEqual","string_or_numeric"),l=Object(o.makeTypesMatch)(n,u),d=Object(r.a)(l,2);n=d[0],u=d[1],Object(c.a)(n.shape,u.shape);var f={a:n,b:u};return a.a.runKernel(i.Ab,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({pad_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=Object(i.a)(e,"x","pad");if(0===o.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");var s={paddings:t,constantValue:n},c={x:o};return r.a.runKernel(a.ec,c,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({transpose_:function(e,t){var n=Object(i.a)(e,"x","transpose");if(null==t&&(t=n.shape.map((function(e,t){return t})).reverse()),o.b(n.rank===t.length,(function(){return"Error in transpose: rank of input ".concat(n.rank," ")+"must match length of perm ".concat(t,".")})),t.forEach((function(e){o.b(e>=0&&e<n.rank,(function(){return"All entries in 'perm' must be between 0 and ".concat(n.rank-1)+" but got ".concat(t)}))})),n.rank<=1)return n.clone();var s={x:n},c={perm:t};return r.a.runKernel(a.dd,s,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(4),a="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function i(e){var t=r.useRef(e);return a((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return E})),n.d(t,"i",(function(){return R})),n.d(t,"c",(function(){return F})),n.d(t,"f",(function(){return D})),n.d(t,"e",(function(){return z})),n.d(t,"d",(function(){return L})),n.d(t,"k",(function(){return B})),n.d(t,"g",(function(){return W})),n.d(t,"h",(function(){return U})),n.d(t,"j",(function(){return V})),n.d(t,"b",(function(){return H}));var r=n(6),a=n(21),i=n(7),o=n(11),s=n(0),c=n(110),u=n(131),l=n(1),d=n(285),f=n(286),p=n(287),h=n(288),b=n(289),m=n(290),v=n(291),g=n(292),y=n(293),O=n(294),x=n(295),k=n(296),w=n(297),j=n(298),S=n(299),N=n(300),I=n(301),C=n(302),T=n(303),E=function(){function e(){var t;Object(i.a)(this,e);var n=[d,f,p,h,b,m,v,g,y,O,x,k,w,j,S,N,I,C,T],r=(t=[]).concat.apply(t,Object(a.a)(n.map((function(e){return e.json}))));this.opMappers=r.reduce((function(e,t){return e[t.tfOpName]=t,e}),{})}return Object(o.a)(e,[{key:"transformGraph",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e.node,i=[],o=[],s=[],c=a.reduce((function(e,n){return e[n.name]=t.mapNode(n),n.op.startsWith("Placeholder")?i.push(e[n.name]):"Const"===n.op?o.push(e[n.name]):null!=n.input&&0!==n.input.length||s.push(e[n.name]),e}),{}),u=[],d=[],f={},p={};null!=n&&(f=this.mapSignatureEntries(n.inputs),p=this.mapSignatureEntries(n.outputs));var h=Object.keys(c);h.forEach((function(e){var t=c[e];t.inputNames.forEach((function(e,n){var a=Object(l.b)(e),i=Object(r.a)(a,3),o=i[0],s=i[2],u=c[o];if(null!=u.outputs){var d=u.outputs.indexOf(s);if(-1!==d){var f="".concat(o,":").concat(d);t.inputNames[n]=f}}t.inputs.push(u),u.children.push(t)}))})),0===Object.keys(p).length?h.forEach((function(e){var t=c[e];0===t.children.length&&d.push(t)})):Object.keys(p).forEach((function(e){var t=Object(l.b)(e),n=Object(r.a)(t,1)[0],a=c[n];null!=a&&(a.signatureKey=p[e],d.push(a))})),Object.keys(f).length>0?Object.keys(f).forEach((function(e){var t=Object(l.b)(e),n=Object(r.a)(t,1)[0],a=c[n];a&&(a.signatureKey=f[e],u.push(a))})):u=i;var b={};null!=e.library&&null!=e.library.function&&(b=e.library.function.reduce((function(e,n){return e[n.signature.name]=t.mapFunction(n),e}),{}));var m={nodes:c,inputs:u,outputs:d,weights:o,placeholders:i,signature:n,functions:b};return s.length>0&&(m.initNodes=s),m}},{key:"mapSignatureEntries",value:function(e){return Object.keys(e||{}).reduce((function(t,n){return t[e[n].name]=n,t}),{})}},{key:"mapNode",value:function(e){var t=Object(u.a)(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,outputs:t.outputs};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,a=void 0;switch(n.type){case"string":void 0===(a=R(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=R(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":void 0===(a=U(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=U(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":void 0===(a=D(e.attr,n.tfName,n.defaultValue||0))&&n.tfDeprecatedName&&(a=D(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":void 0===(a=W(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=W(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":void 0===(a=F(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=F(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":void 0===(a=H(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=H(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":void 0===(a=B(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=B(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":void 0===(a=V(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=V(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":void 0===(a=z(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=z(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":void 0===(a=L(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=L(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":void 0===(a=M(e.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(a=M(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error("Unsupported param type: ".concat(n.type," for op: ").concat(e.op))}return t[n.name]={value:a,type:r},t}),{})),n}},{key:"mapFunction",value:function(e){var t=this,n=e.nodeDef,a=[],i={};null!=n&&(i=n.reduce((function(e,n){return e[n.name]=t.mapNode(n),"Const"===n.op&&a.push(e[n.name]),e}),{}));var o=[],s=[];e.signature.inputArg.forEach((function(e){var t=Object(l.b)(e.name),n=Object(r.a)(t,1)[0],a={name:n,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:_(e.type),type:"dtype"}},children:[]};a.signatureKey=e.name,o.push(a),i[n]=a})),Object.keys(i).forEach((function(e){var t=i[e];t.inputNames.forEach((function(e,n){var a=Object(l.b)(e),o=Object(r.a)(a,3),s=o[0],c=o[2],u=i[s];if(null!=u.outputs){var d=u.outputs.indexOf(c);if(-1!==d){var f="".concat(s,":").concat(d);t.inputNames[n]=f}}t.inputs.push(u),u.children.push(t)}))}));var c=e.ret;e.signature.outputArg.forEach((function(e){var t=Object(l.b)(c[e.name]),n=Object(r.a)(t,2),a=n[0],o=n[1],u=i[a];null!=u&&(u.defaultOutput=o,s.push(u))}));var u=this.mapArgsToSignature(e);return{nodes:i,inputs:o,outputs:s,weights:a,placeholders:[],signature:u}}},{key:"mapArgsToSignature",value:function(e){var t=this;return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((function(e,n){return e[n.name]=t.mapArgToTensorInfo(n),e}),{}),outputs:e.signature.outputArg.reduce((function(n,r){return n[r.name]=t.mapArgToTensorInfo(r,e.ret),n}),{})}}},{key:"mapArgToTensorInfo",value:function(e,t){var n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}],[{key:"Instance",get:function(){return this._instance||(this._instance=new this)}}]),e}();function A(t,n){var r=Array.isArray(t)?String.fromCharCode.apply(null,t):function(t){var n=Object(s.Ud)().global;if("undefined"!==typeof 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 R(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e[t];return null!=a?A(a.s,r):n}function F(e,t,n){var r=e[t];return r?r.b:n}function D(e,t,n){var r=e[t]||{},a=null!=r.i?r.i:null!=r.f?r.f:n;return"number"===typeof a?a:parseInt(a,10)}function _(e){switch("string"===typeof e&&(e=c.a[e]),e){case c.a.DT_FLOAT:return"float32";case c.a.DT_INT32:case c.a.DT_INT64:case c.a.DT_INT8:case c.a.DT_UINT8:return"int32";case c.a.DT_BOOL:return"bool";case c.a.DT_DOUBLE:return"float32";case c.a.DT_STRING:return"string";default:return null}}function M(e,t,n){var r=e[t];return r&&r.func?r.func.name:n}function z(e,t,n){var r=e[t];return r&&r.type?_(r.type):n}function L(e,t,n){var r=e[t];return r&&r.list&&r.list.type?r.list.type.map((function(e){return _(e)})):n}function P(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 B(e,t,n){var r=e[t];return r&&r.shape?P(r.shape):n}function W(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 U(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e[t];return a&&a.list&&a.list.s?a.list.s.map((function(e){return A(e,r)})):n}function V(e,t,n){var r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map((function(e){return P(e)})):n}function H(e,t,n){var r=e[t];return r&&r.list&&r.list.b?r.list.b:n}}).call(this,n(239).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({complex_:function(e,t){var n=Object(i.a)(e,"real","complex"),s=Object(i.a)(t,"imag","complex");o.e(n.shape,s.shape,"real and imag shapes, ".concat(n.shape," and ").concat(s.shape,", ")+"must match in call to tf.complex().");var c={real:n,imag:s};return r.a.runKernel(a.z,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(34),s=n(8);var c=Object(s.b)({logicalAnd_:function(e,t){var n=Object(i.a)(e,"a","logicalAnd","bool"),s=Object(i.a)(t,"b","logicalAnd","bool");Object(o.a)(n.shape,s.shape);var c={a:n,b:s};return r.a.runKernel(a.Fb,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({split_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=Object(i.a)(e,"x","split"),s={x:o},c={numOrSizeSplits:t,axis:n};return r.a.runKernel(a.Nc,s,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({stack_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.b)(e,"tensors","stack","string_or_numeric");o.b(n.length>=1,(function(){return"Pass at least one tensor to tf.stack"})),n.length>0&&o.b(t<=n[0].rank,(function(){return"Axis must be <= rank of the tensor"}));var s=n,c={axis:t};return r.a.runKernel(a.dc,s,c)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"d",(function(){return f}));var r=n(6),a=n(38),i=n(136),o=Object(i.a)("kernelRegistry",(function(){return new Map})),s=Object(i.a)("gradRegistry",(function(){return new Map}));function c(e,t){var n=p(e,t);return o.get(n)}function u(e){return s.get(e)}function l(e){for(var t=o.entries(),n=[];;){var a=t.next(),i=a.done,s=a.value;if(i)break;var c=Object(r.a)(s,2),u=c[0],l=c[1],d=u.split("_");Object(r.a)(d,1)[0]===e&&n.push(l)}return n}function d(e){var t=e.kernelName,n=e.backendName,r=p(t,n);o.has(r)&&console.warn("The kernel '".concat(t,"' for backend ")+"'".concat(n,"' is already registered")),o.set(r,e)}function f(e){var t=e.kernelName;s.has(t)&&Object(a.b)().getBool("DEBUG")&&console.warn("Overriding the gradient for '".concat(t,"'")),s.set(t,e)}function p(e,t){return"".concat(t,"_").concat(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({expandDims_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.a)(e,"x","expandDims","string_or_numeric");o.b(t<=n.rank,(function(){return"Axis must be <= rank of the tensor"}));var s={input:n},c={dim:t};return r.a.runKernel(a.bb,s,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(14),a=n(4),i=n.n(a),o=n(23),s=(n(30),n(25)),c=n(35),u=n(42),l=a.forwardRef((function(e,t){var n=e.children,i=e.classes,c=e.className,l=e.color,d=void 0===l?"inherit":l,f=e.component,p=void 0===f?"svg":f,h=e.fontSize,b=void 0===h?"default":h,m=e.htmlColor,v=e.titleAccess,g=e.viewBox,y=void 0===g?"0 0 24 24":g,O=Object(o.a)(e,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return a.createElement(p,Object(r.a)({className:Object(s.a)(i.root,c,"inherit"!==d&&i["color".concat(Object(u.a)(d))],"default"!==b&&i["fontSize".concat(Object(u.a)(b))]),focusable:"false",viewBox:y,color:m,"aria-hidden":!v||void 0,role:v?"img":void 0,ref:t},O),n,v?a.createElement("title",null,v):null)}));l.muiName="SvgIcon";var d=Object(c.a)((function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}}),{name:"MuiSvgIcon"})(l);function f(e,t){var n=function(t,n){return i.a.createElement(d,Object(r.a)({ref:n},t),e)};return n.muiName=d.muiName,i.a.memo(i.a.forwardRef(n))}},function(e,t,n){"use strict";var r="Invariant failed";t.a=function(e,t){if(!e)throw new Error(r)}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(48),c=n(8),u=n(13);var l=Object(c.b)({conv2d_:function(e,t,n,c){var l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NHWC",d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1],f=arguments.length>6?arguments[6]:void 0,p=Object(i.a)(e,"x","conv2d"),h=Object(i.a)(t,"filter","conv2d"),b=p,m=!1;3===p.rank&&(m=!0,b=Object(u.a)(p,[1,p.shape[0],p.shape[1],p.shape[2]])),o.b(4===b.rank,(function(){return"Error in conv2d: input must be rank 4, but got rank ".concat(b.rank,".")})),o.b(4===h.rank,(function(){return"Error in conv2d: filter must be rank 4, but got rank "+"".concat(h.rank,".")})),null!=f&&o.b(o.v(c),(function(){return"Error in conv2d: pad must be an integer when using, "+"dimRoundingMode ".concat(f," but got pad ").concat(c,".")}));var v="NHWC"===l?b.shape[3]:b.shape[1];o.b(v===h.shape[2],(function(){return"Error in conv2d: depth of input (".concat(v,") must match ")+"input depth for filter ".concat(h.shape[2],".")})),o.b(s.h(n,d),(function(){return"Error in conv2D: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(d,"'")}));var g={x:b,filter:h},y={strides:n,pad:c,dataFormat:l,dilations:d,dimRoundingMode:f},O=r.a.runKernel(a.C,g,y);return m?Object(u.a)(O,[O.shape[1],O.shape[2],O.shape[3]]):O}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(34),u=n(8);var l=Object(u.b)({greaterEqual_:function(e,t){var n=Object(s.a)(e,"a","greaterEqual","string_or_numeric"),u=Object(s.a)(t,"b","greaterEqual","string_or_numeric"),l=Object(o.makeTypesMatch)(n,u),d=Object(r.a)(l,2);n=d[0],u=d[1],Object(c.a)(n.shape,u.shape);var f={a:n,b:u};return a.a.runKernel(i.pb,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({clone_:function(e){var t={x:Object(i.a)(e,"x","clone","string_or_numeric")};return r.a.runKernel(a.rb,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({sigmoid_:function(e){var t={x:Object(i.a)(e,"x","sigmoid")};return r.a.runKernel(a.Ac,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({max_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=Object(i.a)(e,"x","max"),s={x:o},c={reductionIndices:t,keepDims:n};return r.a.runKernel(a.Ib,s,c)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return h})),n.d(t,"a",(function(){return b}));var r=n(5),a=n.n(r),i=n(12),o=n(0);function s(e,t){return c(e,t)}function c(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Set;if(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 a=t(e);if(a.recurse&&null!==a.value)throw new Error("A deep map function may not return both a value and recurse=true.");if(a.recurse){if(h(e)){var i=Array.isArray(e)?[]:{};for(var o in r.add(e),e){var s=e[o],u=c(s,t,n,r);i[o]=u}return r.delete(e),i}throw new Error("Can't recurse into non-iterable type: ".concat(e))}return n.set(e,a.value),a.value}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;return l(e,t)}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,r=e[0];if(n.has(r))throw new Error("Circular references are not supported.");var a=t(e);if(a.recurse&&null!==a.value)throw new Error("A deep zip function may not return both a value and recurse=true.");if(a.recurse){if(h(r)){var i=Array.isArray(r)?[]:{};n.add(r);var o=function(r){var a=l(e.map((function(e){return e[r]})),t,n);i[r]=a};for(var s in r)o(s);return n.delete(r),i}throw new Error("Can't recurse into non-iterable type: ".concat(r))}return a.value}function d(e){return null===e?null:h(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function f(e,t){return p.apply(this,arguments)}function p(){return(p=Object(i.a)(a.a.mark((function e(t,n){var r,i,s,u,l,d,f;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Map,c(t,n,r),i=0,s=Array.from(r.keys());case 3:if(!(i<s.length)){e.next=14;break}if(u=s[i],l=r.get(u),!o.wf.isPromise(l)){e.next=11;break}return e.next=9,l;case 9:d=e.sent,r.set(u,d);case 11:i++,e.next=3;break;case 14:return f=c(t,n,r),e.abrupt("return",f);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e){return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"===typeof e&&!(e instanceof o.bd))}function b(e){return null==e||(null===(t=e)||"object"!==typeof t&&"function"!==typeof t)||Array.isArray(e)||"object"===typeof e&&e instanceof o.bd||o.wf.isTypedArray(e);var t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return T})),n.d(t,"d",(function(){return A})),n.d(t,"c",(function(){return b})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return h}));var r=n(14);function a(e){return"/"===e.charAt(0)}function i(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}var o=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],s=e&&a(e),c=t&&a(t),u=s||c;if(e&&a(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var l=o[o.length-1];n="."===l||".."===l||""===l}else n=!1;for(var d=0,f=o.length;f>=0;f--){var p=o[f];"."===p?i(o,f):".."===p?(i(o,f),d++):d&&(i(o,f),d--)}if(!u)for(;d--;d)o.unshift("..");!u||""===o[0]||o[0]&&a(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var c=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])}));if("object"===typeof t||"object"===typeof n){var r=s(t),a=s(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},u=n(88);function l(e){return"/"===e.charAt(0)?e:"/"+e}function d(e){return"/"===e.charAt(0)?e.substr(1):e}function f(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function h(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function b(e,t,n,a){var i;"string"===typeof e?(i=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(i=Object(r.a)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(i.key=n),a?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=o(i.pathname,a.pathname)):i.pathname=a.pathname:i.pathname||(i.pathname="/"),i}function m(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&c(e.state,t.state)}function v(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var i="function"===typeof e?e(t,n):e;"string"===typeof i?"function"===typeof r?r(i,a):a(!0):a(!1!==i)}else a(!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)}))}}}var g=!("undefined"===typeof window||!window.document||!window.document.createElement);function y(e,t){t(window.confirm(e))}var O="popstate",x="hashchange";function k(){try{return window.history.state||{}}catch(e){return{}}}function w(e){void 0===e&&(e={}),g||Object(u.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}(),a=!(-1===window.navigator.userAgent.indexOf("Trident")),i=e,o=i.forceRefresh,s=void 0!==o&&o,c=i.getUserConfirmation,d=void 0===c?y:c,m=i.keyLength,w=void 0===m?6:m,j=e.basename?p(l(e.basename)):"";function S(e){var t=e||{},n=t.key,r=t.state,a=window.location,i=a.pathname+a.search+a.hash;return j&&(i=f(i,j)),b(i,r,n)}function N(){return Math.random().toString(36).substr(2,w)}var I=v();function C(e){Object(r.a)(B,e),B.length=t.length,I.notifyListeners(B.location,B.action)}function T(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||R(S(e.state))}function E(){R(S(k()))}var A=!1;function R(e){if(A)A=!1,C();else{I.confirmTransitionTo(e,"POP",d,(function(t){t?C({action:"POP",location:e}):function(e){var t=B.location,n=D.indexOf(t.key);-1===n&&(n=0);var r=D.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(A=!0,M(a))}(e)}))}}var F=S(k()),D=[F.key];function _(e){return j+h(e)}function M(e){t.go(e)}var z=0;function L(e){1===(z+=e)&&1===e?(window.addEventListener(O,T),a&&window.addEventListener(x,E)):0===z&&(window.removeEventListener(O,T),a&&window.removeEventListener(x,E))}var P=!1;var B={length:t.length,action:"POP",location:F,createHref:_,push:function(e,r){var a="PUSH",i=b(e,r,N(),B.location);I.confirmTransitionTo(i,a,d,(function(e){if(e){var r=_(i),o=i.key,c=i.state;if(n)if(t.pushState({key:o,state:c},null,r),s)window.location.href=r;else{var u=D.indexOf(B.location.key),l=D.slice(0,u+1);l.push(i.key),D=l,C({action:a,location:i})}else window.location.href=r}}))},replace:function(e,r){var a="REPLACE",i=b(e,r,N(),B.location);I.confirmTransitionTo(i,a,d,(function(e){if(e){var r=_(i),o=i.key,c=i.state;if(n)if(t.replaceState({key:o,state:c},null,r),s)window.location.replace(r);else{var u=D.indexOf(B.location.key);-1!==u&&(D[u]=i.key),C({action:a,location:i})}else window.location.replace(r)}}))},go:M,goBack:function(){M(-1)},goForward:function(){M(1)},block:function(e){void 0===e&&(e=!1);var t=I.setPrompt(e);return P||(L(1),P=!0),function(){return P&&(P=!1,L(-1)),t()}},listen:function(e){var t=I.appendListener(e);return L(1),function(){L(-1),t()}}};return B}var j="hashchange",S={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+d(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:d,decodePath:l},slash:{encodePath:l,decodePath:l}};function N(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function I(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function C(e){window.location.replace(N(window.location.href)+"#"+e)}function T(e){void 0===e&&(e={}),g||Object(u.a)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),a=n.getUserConfirmation,i=void 0===a?y:a,o=n.hashType,s=void 0===o?"slash":o,c=e.basename?p(l(e.basename)):"",d=S[s],m=d.encodePath,O=d.decodePath;function x(){var e=O(I());return c&&(e=f(e,c)),b(e)}var k=v();function w(e){Object(r.a)(B,e),B.length=t.length,k.notifyListeners(B.location,B.action)}var T=!1,E=null;function A(){var e,t,n=I(),r=m(n);if(n!==r)C(r);else{var a=x(),o=B.location;if(!T&&(t=a,(e=o).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(E===h(a))return;E=null,function(e){if(T)T=!1,w();else{var t="POP";k.confirmTransitionTo(e,t,i,(function(n){n?w({action:t,location:e}):function(e){var t=B.location,n=_.lastIndexOf(h(t));-1===n&&(n=0);var r=_.lastIndexOf(h(e));-1===r&&(r=0);var a=n-r;a&&(T=!0,M(a))}(e)}))}}(a)}}var R=I(),F=m(R);R!==F&&C(F);var D=x(),_=[h(D)];function M(e){t.go(e)}var z=0;function L(e){1===(z+=e)&&1===e?window.addEventListener(j,A):0===z&&window.removeEventListener(j,A)}var P=!1;var B={length:t.length,action:"POP",location:D,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=N(window.location.href)),n+"#"+m(c+h(e))},push:function(e,t){var n="PUSH",r=b(e,void 0,void 0,B.location);k.confirmTransitionTo(r,n,i,(function(e){if(e){var t=h(r),a=m(c+t);if(I()!==a){E=t,function(e){window.location.hash=e}(a);var i=_.lastIndexOf(h(B.location)),o=_.slice(0,i+1);o.push(t),_=o,w({action:n,location:r})}else w()}}))},replace:function(e,t){var n="REPLACE",r=b(e,void 0,void 0,B.location);k.confirmTransitionTo(r,n,i,(function(e){if(e){var t=h(r),a=m(c+t);I()!==a&&(E=t,C(a));var i=_.indexOf(h(B.location));-1!==i&&(_[i]=t),w({action:n,location:r})}}))},go:M,goBack:function(){M(-1)},goForward:function(){M(1)},block:function(e){void 0===e&&(e=!1);var t=k.setPrompt(e);return P||(L(1),P=!0),function(){return P&&(P=!1,L(-1)),t()}},listen:function(e){var t=k.appendListener(e);return L(1),function(){L(-1),t()}}};return B}function E(e,t,n){return Math.min(Math.max(e,t),n)}function A(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,a=t.initialEntries,i=void 0===a?["/"]:a,o=t.initialIndex,s=void 0===o?0:o,c=t.keyLength,u=void 0===c?6:c,l=v();function d(e){Object(r.a)(O,e),O.length=O.entries.length,l.notifyListeners(O.location,O.action)}function f(){return Math.random().toString(36).substr(2,u)}var p=E(s,0,i.length-1),m=i.map((function(e){return b(e,void 0,"string"===typeof e?f():e.key||f())})),g=h;function y(e){var t=E(O.index+e,0,O.entries.length-1),r=O.entries[t];l.confirmTransitionTo(r,"POP",n,(function(e){e?d({action:"POP",location:r,index:t}):d()}))}var O={length:m.length,action:"POP",location:m[p],index:p,entries:m,createHref:g,push:function(e,t){var r="PUSH",a=b(e,t,f(),O.location);l.confirmTransitionTo(a,r,n,(function(e){if(e){var t=O.index+1,n=O.entries.slice(0);n.length>t?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=b(e,t,f(),O.location);l.confirmTransitionTo(a,r,n,(function(e){e&&(O.entries[O.index]=a,d({action:r,location:a}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=O.index+e;return t>=0&&t<O.entries.length},block:function(e){return void 0===e&&(e=!1),l.setPrompt(e)},listen:function(e){return l.appendListener(e)}};return O}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({log_:function(e){var t={x:Object(i.a)(e,"x","log")};return r.a.runKernel(a.Cb,t)}})},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}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return c}));var r=n(21);function a(e,t,n){var r=function(e,t,n){return function(e,t,n){var r=0,a=e.length,i=0,o=!1;for(;r<a;){var s=n(t,e[i=r+(a-r>>>1)]);s>0?r=i+1:(a=i,o=!s)}return o?r:-r-1}(e,t,n||i)}(e,t,n),a=r<0?-(r+1):r;e.splice(a,0,t)}function i(e,t){return e>t?1:e<t?-1:0}function o(e,t,n,r,a){return u(e,t,n,r,a,0)}function s(e,t,n,r,a,i){return u(e,t,n,r,a,0,!1,i,!0)}function c(e,t,n,r,a,i){return u(e,t,n,r,a,i,!0)}function u(e,t,n,i,o,s){for(var c=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],p=arguments.length>8&&void 0!==arguments[8]&&arguments[8],h=[],b=0;b<t.length;b++)t[b]>o&&h.push({score:t[b],boxIndex:b,suppressBeginIndex:0});h.sort(f);for(var m=s>0?-.5/s:0,v=[],g=[];v.length<n&&h.length>0;){var y=h.pop(),O=y.score,x=y.boxIndex,k=y.suppressBeginIndex;if(O<o)break;for(var w=!1,j=v.length-1;j>=k;--j){var S=l(e,x,v[j]);if(S>=i){w=!0;break}if(y.score=y.score*d(i,m,S),y.score<=o)break}y.suppressBeginIndex=v.length,w||(y.score===O?(v.push(x),g.push(y.score)):y.score>o&&a(h,y,f))}var N=v.length,I=n-N;u&&I>0&&(v.push.apply(v,Object(r.a)(new Array(I).fill(0))),g.push.apply(g,Object(r.a)(new Array(I).fill(0))));var C={selectedIndices:v};return c&&(C.selectedScores=g),p&&(C.validOutputs=N),C}function l(e,t,n){var r=e.subarray(4*t,4*t+4),a=e.subarray(4*n,4*n+4),i=Math.min(r[0],r[2]),o=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),c=Math.max(r[1],r[3]),u=Math.min(a[0],a[2]),l=Math.min(a[1],a[3]),d=Math.max(a[0],a[2]),f=Math.max(a[1],a[3]),p=(s-i)*(c-o),h=(d-u)*(f-l);if(p<=0||h<=0)return 0;var b=Math.max(i,u),m=Math.max(o,l),v=Math.min(s,d),g=Math.min(c,f),y=Math.max(v-b,0)*Math.max(g-m,0);return y/(p+h-y)}function d(e,t,n){var r=Math.exp(t*n*n);return n<=e?r:0}function f(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(9),a=n(15),i=n(81);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"float32";if("complex64"===t){var n=o(e,"float32"),s=o(e,"float32");return Object(i.a)(n,s)}var c=Object(a.F)(Object(a.O)(e),t);return r.a.makeTensor(c,e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({relu_:function(e){var t={x:Object(i.a)(e,"x","relu")};return r.a.runKernel(a.mc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({step_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.a)(e,"x","step"),o={x:n},s={alpha:t};return r.a.runKernel(a.Rc,o,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({unstack_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.a)(e,"x","unstack","string_or_numeric");o.b(t>=-n.shape.length&&t<n.shape.length,(function(){return"Axis = ".concat(t," is not in [-").concat(n.shape.length,", ").concat(n.shape.length,")")}));var s={value:n},c={axis:t};return r.a.runKernel(a.fd,s,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(13);var c=n(8);var u=Object(c.b)({batchNorm_:function(e,t,n,c,u,l){null==l&&(l=.001);var d,f,p=Object(i.a)(e,"x","batchNorm"),h=Object(i.a)(t,"mean","batchNorm"),b=Object(i.a)(n,"variance","batchNorm");null!=u&&(d=Object(i.a)(u,"scale","batchNorm")),null!=c&&(f=Object(i.a)(c,"offset","batchNorm")),o.b(h.rank===b.rank,(function(){return"Batch normalization gradient requires mean and variance to have equal ranks."})),o.b(null==f||h.rank===f.rank,(function(){return"Batch normalization gradient requires mean and offset to have equal ranks."})),o.b(null==d||h.rank===d.rank,(function(){return"Batch normalization gradient requires mean and scale to have equal ranks."}));var m={x:function(e){return 0===e.rank||1===e.rank?Object(s.a)(e,[1,1,1,e.size]):2===e.rank?Object(s.a)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Object(s.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e}(p),scale:d,offset:f,mean:h,variance:b},v={varianceEpsilon:l},g=r.a.runKernel(a.jb,m,v);return Object(s.a)(g,p.shape)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(2),a=n(71);function i(e,t,n){var i=Object(r.c)(e,n);return Object(a.a)(e,t,i,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({tile_:function(e,t){var n=Object(i.a)(e,"x","tile","string_or_numeric");o.b(n.rank===t.length,(function(){return"Error in transpose: rank of input ".concat(n.rank," ")+"must match length of reps ".concat(t,".")}));var s={x:n},c={reps:t};return r.a.runKernel(a.ad,s,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(356),a=(n(4),n(129));function i(){return Object(r.a)()||a.a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(184);var a=n(308),i=n(236);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(a.a)(e)||Object(i.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){var r=n(335),a=n(336),i=n(337),o=n(338),s=n(339),c=n(340),u=n(341);u.alea=r,u.xor128=a,u.xorwow=i,u.xorshift7=o,u.xor4096=s,u.tychei=c,e.exports=u},function(e,t,n){"use strict";var r,a;n.d(t,"a",(function(){return r})),function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"}(r||(r={})),function(e){!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(a||(a={}))},function(e,t,n){"use strict";t.a=function(e,t){}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({mean_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=Object(i.a)(e,"x","mean"),s={x:o},c={axis:t,keepDims:n};return r.a.runKernel(a.Pb,s,c)}})},function(e,t,n){"use strict";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var o=this,s=function(){e.apply(o,a)};clearTimeout(t),t=setTimeout(s,n)}return r.clear=function(){clearTimeout(t)},r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r,a,i,o,s;n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return l})),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(r||(r={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(a||(a={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(i||(i={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(o||(o={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(s||(s={}));var c={float32:o,int32:a,bool:i,complex64:s};function u(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error("Can not upcast ".concat(e," with ").concat(t))}return c[e][t]}function l(e){return u(e,"int32")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({batchToSpaceND_:function(e,t,n){var s=Object(i.a)(e,"x","batchToSpaceND"),c=t.reduce((function(e,t){return e*t}));o.b(s.rank>=1+t.length,(function(){return"input rank is ".concat(s.rank," but should be > than blockShape.length ").concat(t.length)})),o.b(n.length===t.length,(function(){return"crops.length is ".concat(n.length," but should be equal to blockShape.length ").concat(t.length)})),o.b(s.shape[0]%c===0,(function(){return"input tensor batch is ".concat(s.shape[0]," but is not divisible by the product of ")+"the elements of blockShape ".concat(t.join(" * ")," === ").concat(c)}));var u={x:s},l={blockShape:t,crops:n};return r.a.runKernel(a.t,u,l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8),c=n(13);var u=Object(s.b)({depthwiseConv2d_:function(e,t,n,s){var u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NHWC",l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1],d=arguments.length>6?arguments[6]:void 0,f=Object(i.a)(e,"x","depthwiseConv2d"),p=Object(i.a)(t,"filter","depthwiseConv2d"),h=f,b=!1;3===f.rank&&(b=!0,h=Object(c.a)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),o.b(4===h.rank,(function(){return"Error in depthwiseConv2d: input must be rank 4, but got "+"rank ".concat(h.rank,".")})),o.b(4===p.rank,(function(){return"Error in depthwiseConv2d: filter must be rank 4, but got rank "+"".concat(p.rank,".")})),o.b(h.shape[3]===p.shape[2],(function(){return"Error in depthwiseConv2d: number of input channels "+"(".concat(h.shape[3],") must match the inChannels dimension in ")+"filter ".concat(p.shape[2],".")})),null!=d&&o.b(o.v(s),(function(){return"Error in depthwiseConv2d: pad must be an integer when using, "+"dimRoundingMode ".concat(d," but got pad ").concat(s,".")}));var m={x:h,filter:p},v={strides:n,pad:s,dataFormat:u,dilations:l,dimRoundingMode:d},g=r.a.runKernel(a.O,m,v);return b?Object(c.a)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(34),u=n(8);var l=Object(u.b)({equal_:function(e,t){var n=Object(s.a)(e,"a","equal","string_or_numeric"),u=Object(s.a)(t,"b","equal","string_or_numeric"),l=Object(o.makeTypesMatch)(n,u),d=Object(r.a)(l,2);n=d[0],u=d[1],Object(c.a)(n.shape,u.shape);var f={a:n,b:u};return a.a.runKernel(i.Y,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(9),a=n(3);function i(e,t,n){var i={shape:e,value:t,dtype:n};return r.a.runKernel(a.eb,{},i)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({gather_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=Object(i.a)(e,"x","gather"),c=Object(i.a)(t,"indices","gather","int32"),u={x:s,indices:c},l={axis:n,batchDims:o};return r.a.runKernel(a.nb,u,l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({logicalNot_:function(e){var t={x:Object(i.a)(e,"x","logicalNot","bool")};return r.a.runKernel(a.Gb,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(34),u=n(24),l=n(8);var d=Object(l.b)({maximum_:function(e,t){var n=Object(s.a)(e,"a","maximum"),l=Object(s.a)(t,"b","maximum"),d=Object(o.makeTypesMatch)(n,l),f=Object(r.a)(d,2);n=f[0],l=f[1],"bool"===n.dtype&&(n=Object(u.a)(n,"int32"),l=Object(u.a)(l,"int32")),Object(c.a)(n.shape,l.shape);var p={a:n,b:l};return a.a.runKernel(i.Ob,p)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({spaceToBatchND_:function(e,t,n){var s=Object(i.a)(e,"x","spaceToBatchND");o.b(s.rank>=1+t.length,(function(){return"input rank ".concat(s.rank," should be > than [blockShape] ").concat(t.length)})),o.b(n.length===t.length,(function(){return"paddings.shape[0] ".concat(n.length," must be equal to [blockShape] ").concat(t.length)})),o.b(s.shape.reduce((function(e,r,a){return a>0&&a<=t.length?e&&(r+n[a-1][0]+n[a-1][1])%t[a-1]===0:e}),!0),(function(){return"input spatial dimensions ".concat(s.shape.slice(1)," with paddings ").concat(n.toString()," must be divisible by blockShapes ").concat(t.toString())}));var c={x:s},u={blockShape:t,paddings:n};return r.a.runKernel(a.Hc,c,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(2),a=n(15),i=n(8),o=n(13);var s=Object(i.b)({squeeze_:function(e,t){var n=Object(r.a)(e,"x","squeeze");return Object(o.a)(n,Object(a.Q)(n.shape,t).newShape)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(182);function a(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),a=n(3),i=n(2),o=n(92),s=n(8),c=n(13);var u=Object(s.b)({broadcastTo_:function(e,t){var n=Object(i.a)(e,"broadcastTo","x"),s=n.shape;if(t.some((function(e){return!(e>0)||e%1!==0})))throw new Error("broadcastTo(): Invalid broadcast shape [".concat(t,"]."));if(t.length<n.rank)throw new Error("broadcastTo(): shape.length=".concat(t.length," < input.rank=").concat(n.rank,"."));if(t.length>n.rank){for(var u=n.shape.slice();u.length<t.length;)u.unshift(1);n=Object(c.a)(n,u)}for(var l=n.shape,d=Array.from(t),f=t.length-1;f>=0;f--)if(l[f]===t[f])d[f]=1;else if(1!==n.shape[f])throw new Error("broadcastTo(): [".concat(s,"] cannot be broadcast to [").concat(t,"]."));if(0===d.map((function(e,t){return e>1?t:-1})).filter((function(e){return e>=0})).length)return Object(o.a)(n);var p={x:n},h={reps:d};return r.a.runKernel(a.ad,p,h)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return c}));var r=n(7),a=n(11),i=n(109),o=(n(166),function(){function e(t,n,a,o,s){Object(r.a)(this,e),this.mean=t,this.stdDev=n,this.dtype=a,this.nextVal=NaN,this.truncated=o,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);var c=s||Math.random();this.random=i.alea(c.toString())}return Object(a.a)(e,[{key:"nextValue",value:function(){if(!isNaN(this.nextVal)){var e=this.nextVal;return this.nextVal=NaN,e}for(var t,n,r=!1;!r;){var a=void 0,i=void 0,o=void 0;do{o=(a=2*this.random()-1)*a+(i=2*this.random()-1)*i}while(o>=1||0===o);var s=Math.sqrt(-2*Math.log(o)/o);t=this.mean+this.stdDev*a*s,n=this.mean+this.stdDev*i*s,this.truncated&&!this.isValidTruncated(t)||(r=!0)}return this.truncated&&!this.isValidTruncated(n)||(this.nextVal=this.convertValue(n)),this.convertValue(t)}},{key:"convertValue",value:function(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}},{key:"isValidTruncated",value:function(e){return e<=this.upper&&e>=this.lower}}]),e}()),s=function(){function e(t,n,a,s){Object(r.a)(this,e),this.alpha=t,this.beta=1/n,this.dtype=a;var c=s||Math.random();this.randu=i.alea(c.toString()),this.randn=new o(0,1,a,!1,this.randu()),this.d=t<1?t+2/3:t-1/3,this.c=1/Math.sqrt(9*this.d)}return Object(a.a)(e,[{key:"nextValue",value:function(){for(var e,t,n,r,a,i;;){do{r=this.randn.nextValue(),i=1+this.c*r}while(i<=0);if(i*=i*i,t=1-.331*(e=r*r)*e,n=.5*e+this.d*(1-i+Math.log(i)),(a=this.randu())<t||Math.log(a)<n)break}return i=1/this.beta*this.d*i,this.alpha<1&&(i*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(i)}},{key:"convertValue",value:function(e){return"float32"===this.dtype?e:Math.round(e)}}]),e}(),c=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;if(Object(r.a)(this,e),this.canReturnFloat=function(){return null==t.dtype||"float32"===t.dtype},this.min=n,this.range=a-n,this.dtype=o,null==s&&(s=Math.random()),"number"===typeof s&&(s=s.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error("The difference between ".concat(n," - ").concat(a," <= 1 and dtype is not float"));this.random=i.alea(s)}return Object(a.a)(e,[{key:"convertValue",value:function(e){return this.canReturnFloat()?e:Math.round(e)}},{key:"nextValue",value:function(){return this.convertValue(this.min+this.range*this.random())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(9),a=n(3);function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"float32";if(0===n)throw new Error("Cannot have a step of zero");var o={start:e,stop:t,step:n,dtype:i};return r.a.runKernel(a.ic,{},o)}},function(e,t,n){"use strict";var r=n(353);t.a=function(e,t){return t?Object(r.a)(e,t,{clone:!1}):e}},function(e,t,n){"use strict";var r=n(57),a=n(23),i=n(353),o=n(14),s=["xs","sm","md","lg","xl"];function c(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,i=void 0===r?"px":r,c=e.step,u=void 0===c?5:c,l=Object(a.a)(e,["values","unit","step"]);function d(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function f(e,t){var r=s.indexOf(t);return r===s.length-1?d(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(i,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-u/100).concat(i,")")}return Object(o.a)({keys:s,values:n,up:d,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?d("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-u/100).concat(i,")")},between:f,only:function(e){return f(e,e)},width:function(e){return n[e]}},l)}function u(e,t,n){var a;return Object(o.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(o.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(o.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(a={minHeight:56},Object(r.a)(a,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(a,e.up("sm"),{minHeight:64}),a)},n)}var l=n(312),d={black:"#000",white:"#fff"},f={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},p={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},h={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},b={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},v={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},g={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=n(47),O={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:d.white,default:f[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},x={text:{primary:d.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:f[800],default:"#303030"},action:{active:d.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function k(e,t,n,r){var a=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(y.e)(e.main,a):"dark"===t&&(e.dark=Object(y.a)(e.main,i)))}function w(e){var t=e.primary,n=void 0===t?{light:p[300],main:p[500],dark:p[700]}:t,r=e.secondary,s=void 0===r?{light:h.A200,main:h.A400,dark:h.A700}:r,c=e.error,u=void 0===c?{light:b[300],main:b[500],dark:b[700]}:c,w=e.warning,j=void 0===w?{light:m[300],main:m[500],dark:m[700]}:w,S=e.info,N=void 0===S?{light:v[300],main:v[500],dark:v[700]}:S,I=e.success,C=void 0===I?{light:g[300],main:g[500],dark:g[700]}:I,T=e.type,E=void 0===T?"light":T,A=e.contrastThreshold,R=void 0===A?3:A,F=e.tonalOffset,D=void 0===F?.2:F,_=Object(a.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function M(e){return Object(y.d)(e,x.text.primary)>=R?x.text.primary:O.text.primary}var z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(o.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(l.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(l.a)(5,JSON.stringify(e.main)));return k(e,"light",n,D),k(e,"dark",r,D),e.contrastText||(e.contrastText=M(e.main)),e},L={dark:x,light:O};return Object(i.a)(Object(o.a)({common:d,type:E,primary:z(n),secondary:z(s,"A400","A200","A700"),error:z(u),warning:z(j),info:z(N),success:z(C),grey:f,contrastThreshold:R,getContrastText:M,augmentColor:z,tonalOffset:D},L[E]),_)}function j(e){return Math.round(1e5*e)/1e5}var S={textTransform:"uppercase"},N='"Roboto", "Helvetica", "Arial", sans-serif';function I(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?N:r,c=n.fontSize,u=void 0===c?14:c,l=n.fontWeightLight,d=void 0===l?300:l,f=n.fontWeightRegular,p=void 0===f?400:f,h=n.fontWeightMedium,b=void 0===h?500:h,m=n.fontWeightBold,v=void 0===m?700:m,g=n.htmlFontSize,y=void 0===g?16:g,O=n.allVariants,x=n.pxToRem,k=Object(a.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var w=u/14,I=x||function(e){return"".concat(e/y*w,"rem")},C=function(e,t,n,r,a){return Object(o.a)({fontFamily:s,fontWeight:e,fontSize:I(t),lineHeight:n},s===N?{letterSpacing:"".concat(j(r/t),"em")}:{},a,O)},T={h1:C(d,96,1.167,-1.5),h2:C(d,60,1.2,-.5),h3:C(p,48,1.167,0),h4:C(p,34,1.235,.25),h5:C(p,24,1.334,0),h6:C(b,20,1.6,.15),subtitle1:C(p,16,1.75,.15),subtitle2:C(b,14,1.57,.1),body1:C(p,16,1.5,.15),body2:C(p,14,1.43,.15),button:C(b,14,1.75,.4,S),caption:C(p,12,1.66,.4),overline:C(p,12,2.66,1,S)};return Object(i.a)(Object(o.a)({htmlFontSize:y,pxToRem:I,round:j,fontFamily:s,fontSize:u,fontWeightLight:d,fontWeightRegular:p,fontWeightMedium:b,fontWeightBold:v},T),k,{clone:!1})}function C(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var T=["none",C(0,2,1,-1,0,1,1,0,0,1,3,0),C(0,3,1,-2,0,2,2,0,0,1,5,0),C(0,3,3,-2,0,3,4,0,0,1,8,0),C(0,2,4,-1,0,4,5,0,0,1,10,0),C(0,3,5,-1,0,5,8,0,0,1,14,0),C(0,3,5,-1,0,6,10,0,0,1,18,0),C(0,4,5,-2,0,7,10,1,0,2,16,1),C(0,5,5,-3,0,8,10,1,0,3,14,2),C(0,5,6,-3,0,9,12,1,0,3,16,2),C(0,6,6,-3,0,10,14,1,0,4,18,3),C(0,6,7,-4,0,11,15,1,0,4,20,3),C(0,7,8,-4,0,12,17,2,0,5,22,4),C(0,7,8,-4,0,13,19,2,0,5,24,4),C(0,7,9,-4,0,14,21,2,0,5,26,4),C(0,8,9,-5,0,15,22,2,0,6,28,5),C(0,8,10,-5,0,16,24,2,0,6,30,5),C(0,8,11,-5,0,17,26,2,0,6,32,5),C(0,9,11,-5,0,18,28,2,0,7,34,6),C(0,9,12,-6,0,19,29,2,0,7,36,6),C(0,10,13,-6,0,20,31,3,0,8,38,7),C(0,10,13,-6,0,21,33,3,0,8,40,7),C(0,10,14,-6,0,22,35,3,0,8,42,7),C(0,11,14,-7,0,23,36,3,0,9,44,8),C(0,11,15,-7,0,24,38,3,0,9,46,8)],E={borderRadius:4},A=n(400);function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Object(A.a)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===n.length?t(1):1===n.length?t(n[0]):n.map((function(e){if("string"===typeof e)return e;var n=t(e);return"number"===typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return e}}),n.mui=!0,n}var F={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},D={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function _(e){return"".concat(Math.round(e),"ms")}var M={easing:F,duration:D,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?D.standard:n,i=t.easing,o=void 0===i?F.easeInOut:i,s=t.delay,c=void 0===s?0:s;Object(a.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof r?r:_(r)," ").concat(o," ").concat("string"===typeof c?c:_(c))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},z=n(238);var L=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,o=void 0===r?{}:r,s=e.palette,l=void 0===s?{}:s,d=e.spacing,f=e.typography,p=void 0===f?{}:f,h=Object(a.a)(e,["breakpoints","mixins","palette","spacing","typography"]),b=w(l),m=c(n),v=R(d),g=Object(i.a)({breakpoints:m,direction:"ltr",mixins:u(m,v,o),overrides:{},palette:b,props:{},shadows:T,typography:I(b,p),spacing:v,shape:E,transitions:M,zIndex:z.a},h),y=arguments.length,O=new Array(y>1?y-1:0),x=1;x<y;x++)O[x-1]=arguments[x];return g=O.reduce((function(e,t){return Object(i.a)(e,t)}),g)}();t.a=L},function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r={};function a(e){return r[e]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({min_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=Object(i.a)(e,"x","min"),s={x:o},c={axis:t,keepDims:n};return r.a.runKernel(a.Qb,s,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({real_:function(e){var t={input:Object(i.a)(e,"input","real")};return r.a.runKernel(a.jc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(15),o=n(8);var s=Object(o.b)({ifft_:function(e){Object(i.b)("complex64"===e.dtype,(function(){return"The dtype for tf.spectral.ifft() must be complex64 "+"but got ".concat(e.dtype,".")}));var t={input:e};return r.a.runKernel(a.qb,t)}})},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)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e,r){var a;function i(){if(null==a){var t;if("undefined"!==typeof window)t=window;else if("undefined"!==typeof e)t=e;else if("undefined"!==typeof r)t=r;else{if("undefined"===typeof self)throw new Error("Could not find a global object");t=self}a=t}return a}function o(e,t){var n=function(){var e=i();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);var r=t();return n.set(e,r),n.get(e)}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}))}).call(this,n(137),n(187))},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){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){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";e.exports=n(350)},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return s}));var r=n(21),a=n(15);function i(e,t,n){var r=t.rank>1?t.shape[t.rank-1]:1,a=t.rank>1?t.rank-1:1,i="Must have updates.shape = indices.shape[:batchDim] + "+"shape[sliceDim:], got updates.shape: ".concat(n.shape)+", indices.shape: ".concat(t.shape,", shape: ").concat(e)+", sliceDim: ".concat(r,", and batchDim: ").concat(a,".");if(n.rank<a)throw new Error(i+" update.rank < ".concat(a,". "));if(e.length<r+(n.rank-a))throw new Error(i+" Output shape length < ".concat(r+(n.rank-a)));if(n.rank!==a+e.length-r)throw new Error(i+" update.rank != ".concat(a+e.length-r));for(var o=0;o<a;++o)if(n.shape[o]!==t.shape[o])throw new Error(i+" updates.shape[".concat(o,"] (").concat(n.shape[o],") != indices.shape[").concat(o,"] (").concat(t.shape[o],")."));for(var s=0;s<n.rank-a;++s)if(n.shape[s+a]!==e[s+r])throw new Error(i+" updates.shape[".concat(s+a,"] (").concat(n.shape[s+a],") != shape[").concat(s+a,"] (").concat(e[s+a],")"))}function o(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 ".concat(t.rank,"."));if(e.rank<1)throw new Error("tf.scatterND() expects the updates to be rank 1 or higher,"+" but the rank was ".concat(e.rank,"."));if("int32"!==t.dtype)throw new Error("The dtype of 'indices' should be int32, but got dtype: ".concat(t.dtype));if(n.length<1)throw new Error("Output rank must be greater or equal to 1, but got shape: ".concat(n));if(0===n.length){if(0===t.size)throw new Error("Indices specified for empty output. indices shape: ".concat(t.shape));if(0===e.size)throw new Error("Updates specified for empty output. updates shape: ".concat(e.shape))}i(n,t,e)}function s(e,t,n){for(var i=t.shape.length,o=i>1?t.shape[i-1]:1,s=n.length,c=1,u=o;u<s;++u)c*=n[u];var l=o<1?1:o;return{sliceRank:o,numUpdates:Object(a.O)(t.shape)/l,sliceSize:c,strides:[].concat(Object(r.a)(Object(a.j)(n.slice(0,o))),[1]),outputSize:Object(a.O)(n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"assertParamsValid",(function(){return i})),n.d(t,"maskToAxes",(function(){return o})),n.d(t,"computeOutShape",(function(){return s})),n.d(t,"stridesWithElidedDims",(function(){return c})),n.d(t,"getNormalizedAxes",(function(){return d})),n.d(t,"startIndicesWithElidedDims",(function(){return f})),n.d(t,"stopIndicesWithElidedDims",(function(){return p})),n.d(t,"stridesForAxis",(function(){return h})),n.d(t,"startForAxis",(function(){return b})),n.d(t,"stopForAxis",(function(){return m})),n.d(t,"isSliceContinous",(function(){return v})),n.d(t,"computeFlatOffset",(function(){return g})),n.d(t,"parseSliceParams",(function(){return y})),n.d(t,"sliceInfo",(function(){return O}));var r=n(21),a=n(15);function i(e,t,n){var r=e.shape.length;a.b(r===t.length,(function(){return"Error in slice".concat(r,"D: Length of begin ").concat(t," must ")+"match the rank of the array (".concat(r,").")})),a.b(r===n.length,(function(){return"Error in slice".concat(r,"D: Length of size ").concat(n," must ")+"match the rank of the array (".concat(r,").")}));for(var i=function(i){a.b(t[i]+n[i]<=e.shape[i],(function(){return"Error in slice".concat(r,"D: begin[").concat(i,"] + size[").concat(i,"] ")+"(".concat(t[i]+n[i],") would overflow input.shape[").concat(i,"] (").concat(e.shape[i],")")}))},o=0;o<r;++o)i(o)}function o(e){for(var t=[],n=0;e>0;)1&e&&t.push(n),e/=2,n++;return t}function s(e,t,n){for(var r=[],a=0;a<e.length;a++)r[a]=Math.ceil((t[a]-e[a])/n[a]);return r}function c(e,t,n,a){for(var i=Object(r.a)(e),o=i.length;o<a.length;o++)i.push(1);for(var s=0;s<n;s++)0===s?i[t]=1:(i.splice(t,0,1),i.pop());return i}function u(e,t,n){return n<=e?n:n-(t-1)}function l(e,t){for(var n=[],r=0;r<e;r++)n.push(t+r);return n}function d(e,t,n,r,a,i,o,s,u){var l=e.length,d=new Array(l),v=new Array(l),g=new Array(l);if(t.length&&n>0){var y=t[0],O=n+1;d=f(o,y,O,r,e),v=p(s,y,O,a,e),g=c(i,y,O,e)}else for(var x=0;x<l;x++)d[x]=b(o,r,i,e,x,u),v[x]=m(s,a,i,e,x,u),g[x]=h(i,x,u);return{begin:d,end:v,strides:g}}function f(e,t,n,a,i){for(var o=Object(r.a)(i),s=l(n,t),c=0;c<o.length;c++)if(s.indexOf(c)>-1)o[c]=0;else{var d=u(t,n,c),f=a[d];e&1<<d&&(f=0),o[c]=f}return o}function p(e,t,n,i,o){for(var s=Object(r.a)(o),c=l(n,t),d=0;d<s.length;d++)if(c.indexOf(d)>-1)s[d]=Number.MAX_SAFE_INTEGER;else{var f=u(t,n,d),p=i[f];e&1<<f&&(p=Number.MAX_SAFE_INTEGER),s[d]=p}for(var h=0;h<s.length;h++){var b=o[h];s[h]<0&&(s[h]+=b),s[h]=a.i(0,s[h],o[h])}return s}function h(e,t,n){var r=e[t];return(n&1<<t||null==r)&&(r=1),r}function b(e,t,n,r,i,o){var s=t[i],c=n[i]||1;(e&1<<i||o&1<<i||null==s)&&(s=c>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var u=r[i];return s<0&&(s+=u),s=a.i(0,s,u-1)}function m(e,t,n,r,i,o){var s=t[i],c=n[i]||1;(e&1<<i||o&1<<i||null==s)&&(s=c>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var u=r[i];return s<0&&(s+=u),s=c>0?a.i(0,s,u):a.i(-1,s,u-1)}function v(e,t,n){for(var r=n.length,a=0;a<n.length;a++)if(n[a]>1){r=a;break}for(var i=r+1;i<n.length;i++)if(t[i]>0||n[i]!==e[i])return!1;return!0}function g(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 y(e,t,n){var i,o,s=e.shape.length;return(i="number"===typeof t?[t].concat(Object(r.a)(new Array(s-1).fill(0))):t.length<s?t.concat(new Array(s-t.length).fill(0)):t.slice()).forEach((function(e){a.b(-1!==e,(function(){return"slice() does not support negative begin indexing."}))})),o=(o=null==n?new Array(s).fill(-1):"number"===typeof n?[n].concat(Object(r.a)(new Array(s-1).fill(-1))):n.length<s?n.concat(new Array(s-n.length).fill(-1)):n).map((function(t,n){return t>=0?t:(a.b(-1===t,(function(){return"Negative size values should be exactly -1 but got "+"".concat(t," for the slice() size at index ").concat(n,".")})),e.shape[n]-i[n])})),[i,o]}function O(e,t,n,r,a,i,c,u,l){var f=t.slice(),p=n.slice(),h=r;null==r&&(h=new Array(f.length));var b=o(c);if(b.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(0!==c&&0!==u)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(0!==c&&0!==l)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");var m=e.length-f.length,v=o(u),g=e.slice();v.forEach((function(e){f[e]=0,p[e]=1,g.splice(e,0,1)}));var y=d(g,b,m,f,p,h,a,i,c),O=y.begin,x=y.end,k=y.strides;f=O,p=x,h=k;var w=o(l);w.forEach((function(e){p[e]=f[e]+1,h[e]=1}));var j=s(f,p,h),S=j.filter((function(e,t){return-1===w.indexOf(t)}));return{nonStrided:h.every((function(e){return 1===e})),$begin:f,$end:p,$strides:h,size:j,newShape:g,outShape:S}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(24),c=n(48),u=n(8),l=n(13);var d=Object(u.b)({avgPool_:function(e,t,n,u,d){var f=Object(i.a)(e,"x","avgPool","float32");o.b(c.h(n,1),(function(){return"Error in avgPool: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(1,"'")}));var p=f,h=!1;3===f.rank&&(h=!0,p=Object(l.a)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),o.b(4===p.rank,(function(){return"Error in avgPool: x must be rank 4 but got rank ".concat(p.rank,".")})),null!=d&&o.b(o.v(u),(function(){return"Error in avgPool: pad must be an integer when using, "+"dimRoundingMode ".concat(d," but got pad ").concat(u,".")}));var b={x:p},m={filterSize:t,strides:n,pad:u,dimRoundingMode:d},v=r.a.runKernel(a.o,b,m);return v=Object(s.a)(v,f.dtype),h?Object(l.a)(v,[v.shape[1],v.shape[2],v.shape[3]]):v}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({cos_:function(e){var t={x:Object(i.a)(e,"x","cos")};return r.a.runKernel(a.I,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({cumsum_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=Object(i.a)(e,"x","cumsum"),c={x:s},u={axis:t,exclusive:n,reverse:o};return r.a.runKernel(a.L,c,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(8);var u=Object(c.b)({floorDiv_:function(e,t){var n=Object(s.a)(e,"a","floorDiv"),c=Object(s.a)(t,"b","floorDiv"),u=Object(o.makeTypesMatch)(n,c),l=Object(r.a)(u,2),d={a:n=l[0],b:c=l[1]};return a.a.runKernel(i.hb,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({elu_:function(e){var t={x:Object(i.a)(e,"x","elu")};return r.a.runKernel(a.W,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({floor_:function(e){var t={x:Object(i.a)(e,"x","floor")};return r.a.runKernel(a.gb,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({imag_:function(e){var t={input:Object(i.a)(e,"input","imag")};return r.a.runKernel(a.sb,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({leakyRelu_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,n=Object(i.a)(e,"x","leakyRelu"),o={x:n},s={alpha:t};return r.a.runKernel(a.yb,o,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(34),u=n(8);var l=Object(u.b)({less_:function(e,t){var n=Object(s.a)(e,"a","less","string_or_numeric"),u=Object(s.a)(t,"b","less","string_or_numeric"),l=Object(o.makeTypesMatch)(n,u),d=Object(r.a)(l,2);n=d[0],u=d[1],Object(c.a)(n.shape,u.shape);var f={a:n,b:u};return a.a.runKernel(i.zb,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(2),a=n(15),i=n(27),o=n(60),s=n(61),c=n(97),u=n(94),l=n(8),d=n(13),f=n(29),p=n(32);var h=Object(l.b)({logSumExp_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=Object(r.a)(e,"x","logSumExp"),h=Object(a.I)(t,l.shape),b=Object(u.a)(l,h,!0),m=Object(f.a)(l,b),v=Object(s.a)(m),g=Object(p.a)(v,h),y=Object(c.a)(g),O=Object(i.a)(Object(d.a)(b,y.shape),y);if(n){var x=Object(o.e)(O.shape,h);return Object(d.a)(O,x)}return O}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(34),s=n(8);var c=Object(s.b)({logicalOr_:function(e,t){var n=Object(i.a)(e,"a","logicalOr","bool"),s=Object(i.a)(t,"b","logicalOr","bool");Object(o.a)(n.shape,s.shape);var c={a:n,b:s};return r.a.runKernel(a.Hb,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(48),c=n(8),u=n(13);var l=Object(c.b)({maxPool_:function(e,t,n,c,l){var d=Object(i.a)(e,"x","maxPool"),f=d,p=!1;3===d.rank&&(p=!0,f=Object(u.a)(d,[1,d.shape[0],d.shape[1],d.shape[2]])),o.b(4===f.rank,(function(){return"Error in maxPool: input must be rank 4 but got rank ".concat(f.rank,".")})),o.b(s.h(n,1),(function(){return"Error in maxPool: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(1,"'")})),null!=l&&o.b(o.v(c),(function(){return"Error in maxPool: pad must be an integer when using, "+"dimRoundingMode ".concat(l," but got pad ").concat(c,".")}));var h={x:f},b={filterSize:t,strides:n,pad:c,dimRoundingMode:l},m=r.a.runKernel(a.Jb,h,b);return p?Object(u.a)(m,[m.shape[1],m.shape[2],m.shape[3]]):m}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(34),u=n(24),l=n(8);var d=Object(l.b)({minimum_:function(e,t){var n=Object(s.a)(e,"a","minimum"),l=Object(s.a)(t,"b","minimum"),d=Object(o.makeTypesMatch)(n,l),f=Object(r.a)(d,2);n=f[0],l=f[1],"bool"===n.dtype&&(n=Object(u.a)(n,"int32"),l=Object(u.a)(l,"int32")),Object(c.a)(n.shape,l.shape);var p={a:n,b:l};return a.a.runKernel(i.Rb,p)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(34),u=n(8);var l=Object(u.b)({notEqual_:function(e,t){var n=Object(s.a)(e,"a","notEqual","string_or_numeric"),u=Object(s.a)(t,"b","notEqual","string_or_numeric"),l=Object(o.makeTypesMatch)(n,u),d=Object(r.a)(l,2);n=d[0],u=d[1],Object(c.a)(n.shape,u.shape);var f={a:n,b:u};return a.a.runKernel(i.ac,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({prelu_:function(e,t){var n={x:Object(i.a)(e,"x","prelu"),alpha:Object(i.a)(t,"alpha","prelu")};return r.a.runKernel(a.gc,n)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({relu6_:function(e){var t={x:Object(i.a)(e,"x","relu6")};return r.a.runKernel(a.nc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(15),o=n(8);var s=Object(o.b)({fft_:function(e){Object(i.b)("complex64"===e.dtype,(function(){return"The dtype for tf.spectral.fft() must be complex64 "+"but got ".concat(e.dtype,".")}));var t={input:e};return r.a.runKernel(a.db,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(15),a=n(81),i=n(49),o=n(149),s=n(8),c=n(133),u=n(13),l=n(43),d=n(83),f=n(100),p=n(36),h=n(159);var b=Object(s.b)({rfft_:function(e,t){Object(r.b)("float32"===e.dtype,(function(){return"The dtype for rfft() must be real value but got ".concat(e.dtype)}));var n,s=e.shape[e.shape.length-1],b=e.size/s;if(null!=t&&t<s){var m=e.shape.map((function(e){return 0})),v=e.shape.map((function(e){return e}));v[e.shape.length-1]=t,n=Object(l.a)(e,m,v),s=t}else if(null!=t&&t>s){var g=e.shape.map((function(e){return e}));g[e.shape.length-1]=t-s,n=Object(i.a)([e,Object(f.a)(g)],e.shape.length-1),s=t}else n=e;var y=Object(p.a)(n),O=Object(u.a)(Object(a.a)(n,y),[b,s]),x=Object(h.a)(O),k=Math.floor(s/2)+1,w=Object(c.a)(x),j=Object(o.a)(x),S=Object(d.a)(w,[k,s-k],w.shape.length-1),N=Object(d.a)(j,[k,s-k],j.shape.length-1),I=n.shape.slice();return I[n.shape.length-1]=k,Object(u.a)(Object(a.a)(S[0],N[0]),I)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(34),u=n(8);var l=Object(u.b)({squaredDifference_:function(e,t){var n=Object(s.a)(e,"a","squaredDifference"),u=Object(s.a)(t,"b","squaredDifference"),l=Object(o.makeTypesMatch)(n,u),d=Object(r.a)(l,2);n=d[0],u=d[1],Object(c.a)(n.shape,u.shape);var f={a:n,b:u};return a.a.runKernel(i.Qc,f,{})}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({unsortedSegmentSum_:function(e,t,n){var s=Object(i.a)(e,"x","unsortedSegmentSum"),c=Object(i.a)(t,"segmentIds","unsortedSegmentSum","int32");Object(o.b)(Object(o.v)(n),(function(){return"numSegments must be of dtype int"}));var u={x:s,segmentIds:c},l={numSegments:n};return r.a.runKernel(a.gd,u,l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(2),a=n(15),i=n(65),o=n(60),s=n(94),c=n(132),u=n(8),l=n(73),d=n(13),f=n(33),p=n(58),h=n(40),b=n(32);function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(0===e.rank)return Object(i.a)(e);if(1!==e.rank&&null===n)return m(Object(d.a)(e,[-1]),t,n);if(1===e.rank||"number"===typeof n||Array.isArray(n)&&1===n.length){if(1===t)return Object(b.a)(Object(i.a)(e),n);if(t===1/0)return Object(s.a)(Object(i.a)(e),n);if(t===-1/0)return Object(c.a)(Object(i.a)(e),n);if("euclidean"===t||2===t)return Object(p.a)(Object(b.a)(Object(l.a)(Object(i.a)(e),Object(f.a)(2,"int32")),n));throw new Error("Error in norm: invalid ord value: ".concat(t))}if(Array.isArray(n)&&2===n.length){if(1===t)return Object(s.a)(Object(b.a)(Object(i.a)(e),n[0]),n[1]-1);if(t===1/0)return Object(s.a)(Object(b.a)(Object(i.a)(e),n[1]),n[0]);if(t===-1/0)return Object(c.a)(Object(b.a)(Object(i.a)(e),n[1]),n[0]);if("fro"===t||"euclidean"===t)return Object(p.a)(Object(b.a)(Object(h.a)(e),n));throw new Error("Error in norm: invalid ord value: ".concat(t))}throw new Error("Error in norm: invalid axis: ".concat(n))}var v=Object(u.b)({norm_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"euclidean",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=m(e=Object(r.a)(e,"x","norm"),t,n),c=s.shape;if(i){var u=Object(a.I)(n,e.shape);c=o.e(s.shape,u)}return Object(d.a)(s,c)}})},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(15),o=n(8),s=n(13);var c=Object(o.b)({conv2DBackpropInput_:function(e,t,n,o,c){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NHWC",l=arguments.length>6?arguments[6]:void 0;i.b(e.length===t.rank,(function(){return"Length of inShape "+"(".concat(e.length,") and rank of dy (").concat(t.rank,") must match")}));var d=e,f=t,p=!1;3===t.rank&&(p=!0,f=Object(s.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]]),d=[1,e[0],e[1],e[2]]),i.b(4===d.length,(function(){return"Error in conv2dDerInput: inShape must be length 4, but got length "+"".concat(d.length,".")})),i.b(4===f.rank,(function(){return"Error in conv2dDerInput: dy must be rank 4, but got "+"rank ".concat(f.rank)})),i.b(4===n.rank,(function(){return"Error in conv2dDerInput: filter must be rank 4, but got "+"rank ".concat(n.rank)}));var h="NHWC"===u?d[3]:d[1],b="NHWC"===u?f.shape[3]:f.shape[1];i.b(h===n.shape[2],(function(){return"Error in conv2dDerInput: depth of input (".concat(h,") must ")+"match input depth for filter ".concat(n.shape[2],".")})),i.b(b===n.shape[3],(function(){return"Error in conv2dDerInput: depth of output (".concat(b,") must ")+"match output depth for filter ".concat(n.shape[3],".")})),null!=l&&i.b(i.v(c),(function(){return"Error in conv2dDerInput: pad must be an integer when using, "+"dimRoundingMode ".concat(l," but got pad ").concat(c,".")}));var m={dy:f,filter:n},v={strides:o,pad:c,dataFormat:u,dimRoundingMode:l,inputShape:d},g=r.a.runKernel(a.E,m,v);return p?Object(s.a)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}));var r=n(9);n(2),n(15),n(19);function a(){return 32===r.a.backend.floatPrecision()?.001:.1}function i(e,t,n){if(null==n&&(n=a()),!o(e,t,n))throw new Error("Numbers differ: actual === ".concat(e,", expected === ").concat(t))}function o(e,t,n){return!isFinite(e)&&!isFinite(t)||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(15),o=n(8),s=n(13);var c=Object(o.b)({conv2DBackpropFilter_:function(e,t,n,o,c){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NHWC",l=arguments.length>6?arguments[6]:void 0,d=e;3===e.rank&&(d=Object(s.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));var f=t;3===f.rank&&(f=Object(s.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]])),i.b(4===d.rank,(function(){return"Error in conv2dDerFilter: input must be rank 4, but got shape "+"".concat(d.shape,".")})),i.b(4===f.rank,(function(){return"Error in conv2dDerFilter: dy must be rank 4, but got shape "+"".concat(f.shape,".")})),i.b(4===n.length,(function(){return"Error in conv2dDerFilter: filterShape must be length 4, but got "+"".concat(n,".")}));var p="NHWC"===u?d.shape[3]:d.shape[1],h="NHWC"===u?f.shape[3]:f.shape[1];i.b(p===n[2],(function(){return"Error in conv2dDerFilter: depth of input ".concat(p,") must ")+"match input depth in filter (".concat(n[2],".")})),i.b(h===n[3],(function(){return"Error in conv2dDerFilter: depth of dy (".concat(h,") must ")+"match output depth for filter (".concat(n[3],").")})),null!=l&&i.b(i.v(c),(function(){return"Error in conv2dDerFilter: pad must be an integer when using, "+"dimRoundingMode ".concat(l," but got pad ").concat(c,".")}));var b={x:d,dy:f},m={strides:o,pad:c,dataFormat:u,dimRoundingMode:l,filterShape:n};return r.a.runKernel(a.D,b,m)}})},function(e,t,n){"use strict";var r=n(140),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?o:s[e.$$typeof]||a}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=o;var u=Object.defineProperty,l=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var a=p(n);a&&a!==h&&e(t,a,r)}var o=l(n);d&&(o=o.concat(d(n)));for(var s=c(t),b=c(n),m=0;m<o.length;++m){var v=o[m];if(!i[v]&&(!r||!r[v])&&(!b||!b[v])&&(!s||!s[v])){var g=f(n,v);try{u(t,v,g)}catch(y){}}}}return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(72);function a(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(309);var a=n(236),i=n(310);function o(e,t){return Object(r.a)(e)||function(e,t){var n=e&&("undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,a,i=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(c){s=!0,a=c}finally{try{o||null==n.return||n.return()}finally{if(s)throw a}}return i}}(e,t)||Object(a.a)(e,t)||Object(i.a)()}},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 a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(4);function a(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(4),a=n.n(r);t.a=a.a.createContext(null)},function(e,t,n){"use strict";var r=n(4),a=r.createContext({});t.a=a},,function(e,t,n){"use strict";(function(e){n(9);var t=n(188),r=n(38),a=Object(r.b)();a.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.")})),a.registerFlag("IS_BROWSER",(function(){return t.isBrowser()})),a.registerFlag("IS_NODE",(function(){return"undefined"!==typeof e&&"undefined"!==typeof e.versions&&"undefined"!==typeof e.versions.node})),a.registerFlag("IS_CHROME",(function(){return"undefined"!==typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)})),a.registerFlag("PROD",(function(){return!1})),a.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(function(){return a.getBool("DEBUG")})),a.registerFlag("DEPRECATION_WARNINGS_ENABLED",(function(){return!0})),a.registerFlag("IS_TEST",(function(){return!1})),a.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(function(){return!0})),a.registerFlag("WRAP_TO_IMAGEBITMAP",(function(){return!1}))}).call(this,n(187))},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}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;if("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(a){return!1}}()?Object.assign:function(e,t){for(var n,s,c=o(e),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))a.call(n,l)&&(c[l]=n[l]);if(r){s=r(n);for(var d=0;d<s.length;d++)i.call(n,s[d])&&(c[s[d]]=n[s[d]])}}return c}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n(7),a=n(11),i=function(){function e(t,n){Object(r.a)(this,e),this.backend=t,this.dataMover=n,this.data=new WeakMap,this.dataIdsCount=0}return Object(a.a)(e,[{key:"get",value:function(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}},{key:"set",value:function(e,t){this.dataIdsCount++,this.data.set(e,t)}},{key:"has",value:function(e){return this.data.has(e)}},{key:"delete",value:function(e){return this.dataIdsCount--,this.data.delete(e)}},{key:"numDataIds",value:function(){return this.dataIdsCount}}]),e}(),o=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"refCount",value:function(e){return s("refCount")}},{key:"incRef",value:function(e){return s("incRef")}},{key:"timerAvailable",value:function(){return!0}},{key:"time",value:function(e){return s("time")}},{key:"read",value:function(e){return s("read")}},{key:"readSync",value:function(e){return s("readSync")}},{key:"numDataIds",value:function(){return s("numDataIds")}},{key:"disposeData",value:function(e,t){return s("disposeData")}},{key:"write",value:function(e,t,n){return s("write")}},{key:"move",value:function(e,t,n,r,a){return s("move")}},{key:"memory",value:function(){return s("memory")}},{key:"floatPrecision",value:function(){return s("floatPrecision")}},{key:"epsilon",value:function(){return 32===this.floatPrecision()?1e-7:1e-4}},{key:"dispose",value:function(){return s("dispose")}}]),e}();function s(e){throw new Error("'".concat(e,"' not yet implemented or not found in the registry. ")+"This kernel may not be supported by the tfjs backend you have chosen")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({tanh_:function(e){var t={x:Object(i.a)(e,"x","tanh")};return r.a.runKernel(a.Zc,t)}})},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var r=1.7580993408473768,a=1.0507009873554805},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return v}));var r=n(59),a=n(63),i=n(4),o=n.n(i),s=n(96),c=(n(30),n(14)),u=n(75),l=n(88);o.a.Component;var d=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=Object(s.b)(t.props),t}return Object(a.a)(t,e),t.prototype.render=function(){return o.a.createElement(r.c,{history:this.history,children:this.props.children})},t}(o.a.Component);var f=function(e,t){return"function"===typeof e?e(t):e},p=function(e,t){return"string"===typeof e?Object(s.c)(e,null,null,t):e},h=function(e){return e},b=o.a.forwardRef;"undefined"===typeof b&&(b=h);var m=b((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,i=Object(u.a)(e,["innerRef","navigate","onClick"]),s=i.target,l=Object(c.a)({},i,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return l.ref=h!==b&&t||n,o.a.createElement("a",l)}));var v=b((function(e,t){var n=e.component,a=void 0===n?m:n,i=e.replace,s=e.to,d=e.innerRef,v=Object(u.a)(e,["component","replace","to","innerRef"]);return o.a.createElement(r.e.Consumer,null,(function(e){e||Object(l.a)(!1);var n=e.history,r=p(f(s,e.location),e.location),u=r?n.createHref(r):"",m=Object(c.a)({},v,{href:u,navigate:function(){var t=f(s,e.location);(i?n.replace:n.push)(t)}});return h!==b?m.ref=t||d:m.innerRef=d,o.a.createElement(a,m)}))})),g=function(e){return e},y=o.a.forwardRef;"undefined"===typeof y&&(y=g);y((function(e,t){var n=e["aria-current"],a=void 0===n?"page":n,i=e.activeClassName,s=void 0===i?"active":i,d=e.activeStyle,h=e.className,b=e.exact,m=e.isActive,O=e.location,x=e.sensitive,k=e.strict,w=e.style,j=e.to,S=e.innerRef,N=Object(u.a)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return o.a.createElement(r.e.Consumer,null,(function(e){e||Object(l.a)(!1);var n=O||e.location,i=p(f(j,n),n),u=i.pathname,I=u&&u.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),C=I?Object(r.f)(n.pathname,{path:I,exact:b,sensitive:x,strict:k}):null,T=!!(m?m(C,n):C),E=T?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(h,s):h,A=T?Object(c.a)({},w,{},d):w,R=Object(c.a)({"aria-current":T&&a||null,className:E,style:A,to:i},N);return g!==y?R.ref=t||S:R.innerRef=S,o.a.createElement(v,R)}))}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},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){var n,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!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:i}catch(e){n=i}try{r="function"===typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var c,u=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&p())}function p(){if(!l){var e=s(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!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 h(e,t){this.fun=e,this.array=t}function b(){}a.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];u.push(new h(e,t)),1!==u.length||l||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=b,a.addListener=b,a.once=b,a.off=b,a.removeListener=b,a.removeAllListeners=b,a.emit=b,a.prependListener=b,a.prependOnceListener=b,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){if(e||"undefined"!==typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;var t=e.userAgent||e.vendor||window.opera;return/(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(t)||/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(t.substr(0,4))}return!1}function a(){return"undefined"!==typeof window&&null!=window.document||"undefined"!==typeof WorkerGlobalScope}n.r(t),n.d(t,"isMobile",(function(){return r})),n.d(t,"isBrowser",(function(){return a}))},function(e,t,n){"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];console.log(e.toString(t))}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({all_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=Object(i.a)(e,"x","all","bool"),s={x:o},c={axis:t,keepDims:n};return r.a.runKernel(a.f,s,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({any_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=Object(i.a)(e,"x","any","bool"),s={x:o},c={axis:t,keepDims:n};return r.a.runKernel(a.g,s,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({argMax_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.a)(e,"x","argMax"),o={x:n},s={axis:t};return r.a.runKernel(a.h,o,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({argMin_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(i.a)(e,"x","argMin"),o={x:n},s={axis:t};return r.a.runKernel(a.i,o,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(8);var u=Object(c.b)({atan2_:function(e,t){var n=Object(s.a)(e,"a","atan2"),c=Object(s.a)(t,"b","atan2"),u=Object(o.makeTypesMatch)(n,c),l=Object(r.a)(u,2),d={a:n=l[0],b:c=l[1]};return a.a.runKernel(i.m,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({bincount_:function(e,t,n){var s=Object(i.a)(e,"x","bincount"),c=Object(i.a)(t,"weights","bincount");o.b("int32"===s.dtype,(function(){return"Error in bincount: input "+"dtype must be int32, but got ".concat(s.dtype)})),o.b(n>=0,(function(){return"size must be non-negative, but got ".concat(n,".")})),o.b(c.size===s.size||0===c.size,(function(){return"Error in bincount: weights must have the same size as input or"+"0-length, but got input shape: ".concat(s.shape,", weights shape: ")+"".concat(c.shape,".")}));var u={x:s,weights:c},l={size:n};return r.a.runKernel(a.u,u,l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(2),a=n(15),i=n(90),o=n(48),s=n(8),c=n(13);var u=Object(s.b)({conv1d_:function(e,t,n,s){var u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NWC",l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,d=arguments.length>6?arguments[6]:void 0,f=Object(r.a)(e,"x","conv1d"),p=Object(r.a)(t,"filter","conv1d"),h=f,b=!1;2===f.rank&&(b=!0,h=Object(c.a)(f,[1,f.shape[0],f.shape[1]])),a.b(3===h.rank,(function(){return"Error in conv1d: input must be rank 3, but got rank ".concat(h.rank,".")})),a.b(3===p.rank,(function(){return"Error in conv1d: filter must be rank 3, but got rank "+"".concat(p.rank,".")})),null!=d&&a.b(a.v(s),(function(){return"Error in conv1d: pad must be an integer when using, "+"dimRoundingMode ".concat(d," but got pad ").concat(s,".")})),a.b(h.shape[2]===p.shape[1],(function(){return"Error in conv1d: depth of input (".concat(h.shape[2],") must match ")+"input depth for filter ".concat(p.shape[1],".")})),a.b(o.h(n,l),(function(){return"Error in conv1D: Either stride or dilation must be 1. "+"Got stride ".concat(n," and dilation '").concat(l,"'")})),a.b("NWC"===u,(function(){return"Error in conv1d: got dataFormat of ".concat(u," but only NWC is currently supported.")}));var m=Object(c.a)(p,[1,p.shape[0],p.shape[1],p.shape[2]]),v=Object(c.a)(h,[h.shape[0],1,h.shape[1],h.shape[2]]),g=[1,n],y=[1,l],O="NHWC",x=Object(i.a)(v,m,g,s,O,y,d);return b?Object(c.a)(x,[x.shape[2],x.shape[3]]):Object(c.a)(x,[x.shape[0],x.shape[2],x.shape[3]])}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),a=n(165),i=n(8);var o=Object(i.b)({conv2dTranspose_:function(e,t,n,i,o,s){var c=Object(r.a)(e,"x","conv2dTranspose"),u=Object(r.a)(t,"filter","conv2dTranspose");return Object(a.a)(n,c,u,i,o,"NHWC",s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({cosh_:function(e){var t={x:Object(i.a)(e,"x","cosh")};return r.a.runKernel(a.J,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({depthToSpace_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"NHWC",s=Object(i.a)(e,"x","depthToSpace"),c="NHWC"===n?s.shape[1]:s.shape[2],u="NHWC"===n?s.shape[2]:s.shape[3],l="NHWC"===n?s.shape[3]:s.shape[1];o.b(c*t>=0,(function(){return"Negative dimension size caused by overflow when multiplying\n ".concat(c," and ").concat(t," for depthToSpace with input shape\n ").concat(s.shape)})),o.b(u*t>=0,(function(){return"Negative dimension size caused by overflow when multiplying\n ".concat(u," and ").concat(t," for depthToSpace with input shape\n ").concat(s.shape)})),o.b(l%(t*t)===0,(function(){return"Dimension size must be evenly divisible by ".concat(t*t," but is ").concat(l," for depthToSpace with input shape ").concat(s.shape)}));var d={x:s},f={blockSize:t,dataFormat:n};return r.a.runKernel(a.N,d,f)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8),c=n(13);var u=Object(s.b)({dilation2d_:function(e,t,n,s){var u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[1,1],l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NHWC",d=Object(i.a)(e,"x","dilation2d"),f=Object(i.a)(t,"filter","dilation2d");o.b(3===d.rank||4===d.rank,(function(){return"Error in dilation2d: input must be rank 3 or 4, but got rank "+"".concat(d.rank,".")})),o.b(3===f.rank,(function(){return"Error in dilation2d: filter must be rank 3, but got rank "+"".concat(f.rank,".")})),o.b("NHWC"===l,(function(){return"Error in dilation2d: Only NHWC is currently supported, "+"but got dataFormat of ".concat(l)}));var p=d,h=!1;3===d.rank&&(p=Object(c.a)(d,[1,d.shape[0],d.shape[1],d.shape[2]]),h=!0);var b={x:p,filter:f},m={strides:n,pad:s,dilations:u},v=r.a.runKernel(a.S,b,m);return h?Object(c.a)(v,[v.shape[1],v.shape[2],v.shape[3]]):v}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(6),a=n(39),i=n(2),o=n(31),s=n(117),c=n(8),u=n(51),l=n(36);var d=Object(c.b)({divNoNan_:function(e,t){var n=Object(i.a)(e,"a","div"),c=Object(i.a)(t,"b","div"),d=Object(a.makeTypesMatch)(n,c),f=Object(r.a)(d,2);n=f[0],c=f[1];var p=Object(o.a)(n,c),h=Object(l.a)(p),b=Object(s.a)(c,h);return Object(u.a)(b,h,p)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(2),a=n(15),i=n(41),o=n(8),s=n(13);var c=Object(o.b)({dot_:function(e,t){var n=Object(r.a)(e,"t1","dot"),o=Object(r.a)(t,"t2","dot");a.b((1===n.rank||2===n.rank)&&(1===o.rank||2===o.rank),(function(){return"Error in dot: inputs must all be rank 1 or 2, but got ranks "+"".concat(n.rank," and ").concat(o.rank,".")}));var c=1===n.rank?n.size:n.shape[1],u=1===o.rank?o.size:o.shape[0];if(a.b(c===u,(function(){return"Error in dot: inner dimensions of inputs must match, but got "+"".concat(c," and ").concat(u,".")})),1===n.rank&&1===o.rank){var l=Object(s.a)(n,[1,-1]),d=Object(s.a)(o,[-1,1]),f=Object(i.a)(l,d);return Object(s.a)(f,[])}if(1===n.rank&&2===o.rank){var p=Object(s.a)(n,[1,-1]),h=Object(s.a)(o,[o.shape[0],o.shape[1]]),b=Object(i.a)(p,h);return Object(s.a)(b,[b.size])}if(2===n.rank&&1===o.rank){var m=Object(s.a)(o,[-1,1]),v=Object(i.a)(n,m);return Object(s.a)(v,[v.size])}var g=Object(s.a)(o,[o.shape[0],o.shape[1]]);return Object(i.a)(n,g)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8),c=n(13);var u=Object(s.b)({localResponseNormalization_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,l=Object(i.a)(e,"x","localResponseNormalization");o.b(4===l.rank||3===l.rank,(function(){return"Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ".concat(l.rank,".")})),o.b(o.v(t),(function(){return"Error in localResponseNormalization: depthRadius must be an "+"integer but got depthRadius ".concat(t,".")}));var d=l,f=!1;3===l.rank&&(f=!0,d=Object(c.a)(l,[1,l.shape[0],l.shape[1],l.shape[2]]));var p={x:d},h={depthRadius:t,bias:n,alpha:s,beta:u},b=r.a.runKernel(a.wb,p,h);return f?Object(c.a)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({log1p_:function(e){var t={x:Object(i.a)(e,"x","log1p")};return r.a.runKernel(a.Db,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({softplus_:function(e){var t={x:Object(i.a)(e,"x","softplus")};return r.a.runKernel(a.Gc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(2),a=n(34),i=n(82),o=n(120),s=n(153),c=n(8);var u=Object(c.b)({logicalXor_:function(e,t){var n=Object(r.a)(e,"a","logicalXor","bool"),c=Object(r.a)(t,"b","logicalXor","bool");return Object(a.a)(n.shape,c.shape),Object(i.a)(Object(s.a)(e,t),Object(o.a)(Object(i.a)(e,t)))}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({mirrorPad_:function(e,t,n){o.b("reflect"===n||"symmetric"===n,(function(){return"Invalid mode. Mode must be either reflect or symmetric. "+"Got ".concat(n,".")}));var s=Object(i.a)(e,"x","mirrorPad");if(0===s.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");o.b(t.length===s.rank,(function(){return"Padding doesn't match input. Must be ".concat(s.rank,". ")+"Got ".concat(t.length,".")}));for(var c="reflect"===n?1:0,u=function(e){o.b(2===t[e].length,(function(){return"Invalid number of paddings. Must be length of 2 each."})),o.b(t[e][0]>=0&&t[e][0]<=s.shape[e]-c&&t[e][1]>=0&&t[e][1]<=s.shape[e]-c,(function(){return"Padding in dimension ".concat(e," cannot be greater than or equal ")+"to ".concat(s.shape[e]-c," or less than 0 for input of ")+"shape ".concat(s.shape)}))},l=0;l<s.rank;l++)u(l);var d={paddings:t,mode:n},f={x:s};return r.a.runKernel(a.Sb,f,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(6),a=n(9),i=n(3),o=n(39),s=n(2),c=n(8);var u=Object(c.b)({mod_:function(e,t){var n=Object(s.a)(e,"a","mod"),c=Object(s.a)(t,"b","mod"),u=Object(o.makeTypesMatch)(n,c),l=Object(r.a)(u,2),d={a:n=l[0],b:c=l[1]};return a.a.runKernel(i.Tb,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({oneHot_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t<2)throw new Error("Error in oneHot: depth must be >=2, but it is ".concat(t));var s=Object(i.a)(e,"indices","oneHot","int32"),c={indices:s},u={depth:t,onValue:n,offValue:o};return r.a.runKernel(a.bc,c,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(6),a=n(2),i=n(15),o=n(143),s=n(115),c=n(48),u=n(154),l=n(8),d=n(13),f=n(122);var p=Object(l.b)({pool_:function(e,t,n,l,p,h){null==p&&(p=[1,1]),null==h&&(h=1),0===l&&(l="valid");var b=Object(a.a)(e,"x","maxPool"),m=b,v=!1;3===b.rank&&(v=!0,m=Object(d.a)(b,[1,b.shape[0],b.shape[1],b.shape[2]])),i.b(c.h(h,p),(function(){return"Error in pool: Either strides or dilations must be 1. "+"Got strides ".concat(h," and dilations '").concat(p,"'")}));var g,y=c.e(m.shape,t,h,p,l),O=[y.dilationHeight,y.dilationWidth];g="same"===l?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)})),a=n.map((function(e,t){return e-r[t]}));return n.map((function(e,t){return[r[t],a[t]]}))}([y.filterHeight,y.filterWidth],O):[[0,0],[0,0]];var x=1===O[0]&&1===O[1],k=function(e,t,n){var r=n.map((function(e){return e[0]})),a=n.map((function(e){return e[1]})),i=e.concat(r,a),o=t.map((function(e,t){return(e-i[t]%e)%e})),s=a.map((function(e,t){return e+o[t]})),c=t.map((function(e,t){return[r[t],s[t]]})),u=t.map((function(e,t){return[0,o[t]]}));return[c,u]}([y.inHeight,y.inWidth],O,g),w=Object(r.a)(k,2),j=w[0],S=w[1],N=x?l:"valid",I=x?m:Object(f.a)(m,O,j),C=("avg"===n?function(){return Object(o.a)(I,t,h,N)}:function(){return Object(u.a)(I,t,h,N)})(),T=x?C:Object(s.a)(C,O,S);return v?Object(d.a)(T,[T.shape[1],T.shape[2],T.shape[3]]):T}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(24),s=n(8);var c=Object(s.b)({prod_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=Object(i.a)(e,"x","prod");"bool"===s.dtype&&(s=Object(o.a)(s,"int32"));var c={x:s},u={axis:t,keepDims:n};return r.a.runKernel(a.hc,c,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(68),a=n(8),i=n(126);var o=Object(a.b)({randomUniform_:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"float32",o=arguments.length>4?arguments[4]:void 0,s=Object(r.a)(e,a),c=new i.c(t,n,null,o),u=0;u<s.values.length;u++)s.values[u]=c.nextValue();return s.toTensor()}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({round_:function(e){var t={x:Object(i.a)(e,"x","round")};return r.a.runKernel(a.vc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({rsqrt_:function(e){var t={x:Object(i.a)(e,"x","rsqrt")};return r.a.runKernel(a.wc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({selu_:function(e){var t={x:Object(i.a)(e,"x","selu")};return r.a.runKernel(a.zc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(2),a=n(15),i=n(90),o=n(116),s=n(8),c=n(13);var u=Object(s.b)({separableConv2d_:function(e,t,n,s,u){var l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1],d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"NHWC",f=Object(r.a)(e,"x","separableConv2d"),p=Object(r.a)(t,"depthwiseFilter","separableConv2d"),h=Object(r.a)(n,"pointwiseFilter","separableConv2d"),b=f,m=!1;if(3===f.rank&&(m=!0,b=Object(c.a)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),"NCHW"===d)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");a.b(4===b.rank,(function(){return"Error in separableConv2d: input must be rank 4, but got "+"rank ".concat(b.rank,".")})),a.b(4===p.rank,(function(){return"Error in separableConv2d: depthwise filter must be rank 4, but "+"got rank ".concat(p.rank,".")})),a.b(4===h.rank,(function(){return"Error in separableConv2d: pointwise filter must be rank 4, but "+"got rank ".concat(p.rank,".")})),a.b(1===h.shape[0],(function(){return"Error in separableConv2d: the first dimension of pointwise filter "+" must be 1, but got ".concat(h.shape[0],".")})),a.b(1===h.shape[1],(function(){return"Error in separableConv2d: the second dimension of pointwise "+"filter must be 1, but got ".concat(h.shape[1],".")}));var v=p.shape[2],g=p.shape[3];a.b(h.shape[2]===v*g,(function(){return"Error in separableConv2d: the third dimension of pointwise filter "+"must be ".concat(v*g,", ")+"but got ".concat(h.shape[2],".")}));var y=Object(o.a)(b,p,s,u,d,l),O=1,x=Object(i.a)(y,h,O,"valid",d);return m?Object(c.a)(x,[x.shape[1],x.shape[2],x.shape[3]]):x}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({sin_:function(e){var t={x:Object(i.a)(e,"x","sin")};return r.a.runKernel(a.Cc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({sinh_:function(e){var t={x:Object(i.a)(e,"x","sinh")};return r.a.runKernel(a.Dc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(81),a=n(49),i=n(149),o=n(18),s=n(8),c=n(133),u=n(13),l=n(69),d=n(33),f=n(43),p=n(134);var h=Object(s.b)({irfft_:function(e){var t,n=e.shape[e.shape.length-1],s=e.size/n;if(n<=2){var h=Object(u.a)(e,[s,n]);t=Object(p.a)(h)}else{var b=[s,2*(n-1)],m=Object(u.a)(Object(c.a)(e),[s,n]),v=Object(u.a)(Object(i.a)(e),[s,n]),g=Object(l.a)(Object(f.a)(m,[0,1],[s,n-2]),1),y=Object(o.a)(Object(l.a)(Object(f.a)(v,[0,1],[s,n-2]),1),Object(d.a)(-1)),O=Object(a.a)([m,g],1),x=Object(a.a)([v,y],1),k=Object(u.a)(Object(r.a)(O,x),[b[0],b[1]]);t=Object(p.a)(k)}if(t=Object(c.a)(t),3===e.rank&&0!==e.shape[0]){var w=t,j=e.shape[0];t=Object(u.a)(t,[j,t.shape[0]/j,t.shape[1]]),w.dispose()}return t}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),a=n(15),i=n(71);function o(e,t,n){if(Object(a.d)(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");var o=Object(r.c)(e,n);if(3!==o.length&&1!==o.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===o.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Object(i.a)(e,t,o,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(6),a=n(9),i=n(3),o=n(2),s=n(8);var c=Object(s.b)({topk_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=Object(o.a)(e,"x","topk");if(0===s.rank)throw new Error("topk() expects the input to be of rank 1 or higher");var c=s.shape[s.shape.length-1];if(t<0)throw new Error("'k' passed to topk() must be >= 0 but got ".concat(t));if(t>c)throw new Error("'k' passed to topk() must be <= the last dimension (".concat(c,") ")+"but got ".concat(t));var u={x:s},l={k:t,sorted:n},d=a.a.runKernel(i.bd,u,l),f=Object(r.a)(d,2),p=f[0],h=f[1];return{values:p,indices:h}}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(6),a=n(9),i=n(3),o=n(2),s=n(15),c=n(8);var u=Object(c.b)({unique_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object(o.a)(e,"x","unique","string_or_numeric");Object(s.b)(n.rank>0,(function(){return"The input tensor must be at least 1D"}));var c={x:n},u={axis:t},l=a.a.runKernel(i.ed,c,u),d=Object(r.a)(l,2),f=d[0],p=d[1];return{values:f,indices:p}}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(5),a=n.n(r),i=n(12),o=n(224),s=n(2);function c(){return(c=Object(i.a)(a.a.mark((function e(t){var n,r,i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(s.a)(t,"condition","whereAsync","bool"),e.next=3,n.data();case 3:return r=e.sent,i=Object(o.a)(n.shape,r),t!==n&&n.dispose(),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var u=function(e){return c.apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(68);function a(e,t){for(var n=[],a=0;a<t.length;a++)t[a]&&n.push(a);for(var i=Object(r.a)(e,"int32"),o=Object(r.a)([n.length,e.length],"int32"),s=0;s<n.length;s++){var c=i.indexToLoc(n[s]),u=s*e.length;o.values.set(c,u)}return o.toTensor()}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(15),o=n(8),s=n(13);var c=Object(o.b)({conv3DBackpropInput_:function(e,t,n,o,c){i.b(e.length===t.rank,(function(){return"Length of inShape "+"(".concat(e.length,") and rank of dy (").concat(t.rank,") must match")}));var u=e,l=t,d=!1;4===t.rank&&(d=!0,l=Object(s.a)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),u=[1,e[0],e[1],e[2],e[3]]);var f=u[4],p=l.shape[4];i.b(5===u.length,(function(){return"Error in conv3dDerInput: inShape must be length 5, but got length "+"".concat(u.length,".")})),i.b(5===l.rank,(function(){return"Error in conv3dDerInput: dy must be rank 5, but got "+"rank ".concat(l.rank)})),i.b(5===n.rank,(function(){return"Error in conv3dDerInput: filter must be rank 5, but got "+"rank ".concat(n.rank)})),i.b(f===n.shape[3],(function(){return"Error in conv3dDerInput: depth of input (".concat(f,") must ")+"match input depth for filter ".concat(n.shape[3],".")})),i.b(p===n.shape[4],(function(){return"Error in conv3dDerInput: depth of output (".concat(p,") must ")+"match output depth for filter ".concat(n.shape[4],".")}));var h={dy:l,filter:n},b={pad:c,strides:o,inputShape:u},m=r.a.runKernel(a.H,h,b);return d?Object(s.a)(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(231),a=n(9),i=n(3),o=n(2),s=n(15),c=n(8),u=n(13);var l=Object(c.b)({resizeNearestNeighbor_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=Object(o.a)(e,"images","resizeNearestNeighbor");s.b(3===l.rank||4===l.rank,(function(){return"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got "+"rank ".concat(l.rank,".")})),s.b(2===t.length,(function(){return"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+"".concat(t,".")})),s.b("float32"===l.dtype||"int32"===l.dtype,(function(){return"`images` must have `int32` or `float32` as dtype"})),s.b(!1===c||!1===n,(function(){return"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."}));var d=l,f=!1;3===l.rank&&(f=!0,d=Object(u.a)(l,[1,l.shape[0],l.shape[1],l.shape[2]])),Object(r.a)(t);var p={images:d},h={alignCorners:n,halfPixelCenters:c,size:t},b=a.a.runKernel(i.rc,p,h);return f?Object(u.a)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(225),a=n(227),i=n(124),o=n(226);function s(e){return Object(r.a)(e)||Object(a.a)(e)||Object(i.a)(e)||Object(o.a)()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(231),a=n(9),i=n(3),o=n(2),s=n(15),c=n(8),u=n(13);var l=Object(c.b)({resizeBilinear_:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=Object(o.a)(e,"images","resizeBilinear");s.b(3===l.rank||4===l.rank,(function(){return"Error in resizeBilinear: x must be rank 3 or 4, but got "+"rank ".concat(l.rank,".")})),s.b(2===t.length,(function(){return"Error in resizeBilinear: new shape must 2D, but got shape "+"".concat(t,".")})),s.b(!1===c||!1===n,(function(){return"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."}));var d=l,f=!1;3===l.rank&&(f=!0,d=Object(u.a)(l,[1,l.shape[0],l.shape[1],l.shape[2]])),Object(r.a)(t);var p={images:d},h={alignCorners:n,halfPixelCenters:c,size:t},b=a.a.runKernel(i.pc,p,h);return f?Object(u.a)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(8),o=n(13);var s=Object(i.b)({depthwiseConv2dNativeBackpropInput_:function(e,t,n,i,s){var c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1],u=arguments.length>6?arguments[6]:void 0,l=t,d=!1;3===t.rank&&(d=!0,l=Object(o.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));var f={dy:l,filter:n},p={strides:i,pad:s,dimRoundingMode:u,dilations:c,inputShape:e},h=r.a.runKernel(a.Q,f,p);return d?Object(o.a)(h,[h.shape[1],h.shape[2],h.shape[3]]):h}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(8),o=n(13);var s=Object(i.b)({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,i,s){var c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1],u=arguments.length>6?arguments[6]:void 0,l=e;3===e.rank&&(l=Object(o.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));var d=t;3===d.rank&&(d=Object(o.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));var f={x:l,dy:d},p={strides:i,pad:s,dimRoundingMode:u,dilations:c,filterShape:n};return r.a.runKernel(a.P,f,p)}})},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return de}));var r=n(30),a=n.n(r),i=n(306),o=n.n(i),s=n(307),c=n.n(s),u=n(4),l=n.n(u),d=n(177),f=n.n(d),p="bodyAttributes",h="htmlAttributes",b="titleAttributes",m={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},v=(Object.keys(m).map((function(e){return m[e]})),"charset"),g="cssText",y="href",O="http-equiv",x="innerHTML",k="itemprop",w="name",j="property",S="rel",N="src",I="target",C={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},T="defaultTitle",E="defer",A="encodeSpecialCharacters",R="onChangeClientState",F="titleTemplate",D=Object.keys(C).reduce((function(e,t){return e[C[t]]=t,e}),{}),_=[m.NOSCRIPT,m.SCRIPT,m.STYLE],M="data-react-helmet",z="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},L=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},P=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}}(),B=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},W=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},U=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},V=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!1===t?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},H=function(e){var t=Y(e,m.TITLE),n=Y(e,F);if(n&&t)return n.replace(/%s/g,(function(){return Array.isArray(t)?t.join(""):t}));var r=Y(e,T);return t||r||void 0},G=function(e){return Y(e,R)||function(){}},q=function(e,t){return t.filter((function(t){return"undefined"!==typeof t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return B({},e,t)}),{})},K=function(e,t){return t.filter((function(e){return"undefined"!==typeof e[m.BASE]})).map((function(e){return e[m.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),a=0;a<r.length;a++){var i=r[a].toLowerCase();if(-1!==e.indexOf(i)&&n[i])return t.concat(n)}return t}),[])},X=function(e,t,n){var r={};return n.filter((function(t){return!!Array.isArray(t[e])||("undefined"!==typeof t[e]&&ee("Helmet: "+e+' should be of type "Array". Instead found type "'+z(t[e])+'"'),!1)})).map((function(t){return t[e]})).reverse().reduce((function(e,n){var a={};n.filter((function(e){for(var n=void 0,i=Object.keys(e),o=0;o<i.length;o++){var s=i[o],c=s.toLowerCase();-1===t.indexOf(c)||n===S&&"canonical"===e[n].toLowerCase()||c===S&&"stylesheet"===e[c].toLowerCase()||(n=c),-1===t.indexOf(s)||s!==x&&s!==g&&s!==k||(n=s)}if(!n||!e[n])return!1;var u=e[n].toLowerCase();return r[n]||(r[n]={}),a[n]||(a[n]={}),!r[n][u]&&(a[n][u]=!0,!0)})).reverse().forEach((function(t){return e.push(t)}));for(var i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],c=f()({},r[s],a[s]);r[s]=c}return e}),[]).reverse()},Y=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},$=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout((function(){$(t)}),0)}}(),Q=function(e){return clearTimeout(e)},Z="undefined"!==typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||$:e.requestAnimationFrame||$,J="undefined"!==typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Q:e.cancelAnimationFrame||Q,ee=function(e){return console&&"function"===typeof console.warn&&console.warn(e)},te=null,ne=function(e,t){var n=e.baseTag,r=e.bodyAttributes,a=e.htmlAttributes,i=e.linkTags,o=e.metaTags,s=e.noscriptTags,c=e.onChangeClientState,u=e.scriptTags,l=e.styleTags,d=e.title,f=e.titleAttributes;ie(m.BODY,r),ie(m.HTML,a),ae(d,f);var p={baseTag:oe(m.BASE,n),linkTags:oe(m.LINK,i),metaTags:oe(m.META,o),noscriptTags:oe(m.NOSCRIPT,s),scriptTags:oe(m.SCRIPT,u),styleTags:oe(m.STYLE,l)},h={},b={};Object.keys(p).forEach((function(e){var t=p[e],n=t.newTags,r=t.oldTags;n.length&&(h[e]=n),r.length&&(b[e]=p[e].oldTags)})),t&&t(),c(e,h,b)},re=function(e){return Array.isArray(e)?e.join(""):e},ae=function(e,t){"undefined"!==typeof e&&document.title!==e&&(document.title=re(e)),ie(m.TITLE,t)},ie=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(M),a=r?r.split(","):[],i=[].concat(a),o=Object.keys(t),s=0;s<o.length;s++){var c=o[s],u=t[c]||"";n.getAttribute(c)!==u&&n.setAttribute(c,u),-1===a.indexOf(c)&&a.push(c);var l=i.indexOf(c);-1!==l&&i.splice(l,1)}for(var d=i.length-1;d>=0;d--)n.removeAttribute(i[d]);a.length===i.length?n.removeAttribute(M):n.getAttribute(M)!==o.join(",")&&n.setAttribute(M,o.join(","))}},oe=function(e,t){var n=document.head||document.querySelector(m.HEAD),r=n.querySelectorAll(e+"["+"data-react-helmet]"),a=Array.prototype.slice.call(r),i=[],o=void 0;return t&&t.length&&t.forEach((function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===x)n.innerHTML=t.innerHTML;else if(r===g)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var s="undefined"===typeof t[r]?"":t[r];n.setAttribute(r,s)}n.setAttribute(M,"true"),a.some((function(e,t){return o=t,n.isEqualNode(e)}))?a.splice(o,1):i.push(n)})),a.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return n.appendChild(e)})),{oldTags:a,newTags:i}},se=function(e){return Object.keys(e).reduce((function(t,n){var r="undefined"!==typeof e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[C[n]||n]=e[n],t}),t)},ue=function(e,t,n){switch(e){case m.TITLE:return{toComponent:function(){return function(e,t,n){var r,a=((r={key:t})[M]=!0,r),i=ce(n,a);return[l.a.createElement(m.TITLE,i,t)]}(0,t.title,t.titleAttributes)},toString:function(){return function(e,t,n,r){var a=se(n),i=re(t);return a?"<"+e+' data-react-helmet="true" '+a+">"+V(i,r)+"</"+e+">":"<"+e+' data-react-helmet="true">'+V(i,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case p:case h:return{toComponent:function(){return ce(t)},toString:function(){return se(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,n){var r,a=((r={key:n})[M]=!0,r);return Object.keys(t).forEach((function(e){var n=C[e]||e;if(n===x||n===g){var r=t.innerHTML||t.cssText;a.dangerouslySetInnerHTML={__html:r}}else a[n]=t[e]})),l.a.createElement(e,a)}))}(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var a=Object.keys(r).filter((function(e){return!(e===x||e===g)})).reduce((function(e,t){var a="undefined"===typeof r[t]?t:t+'="'+V(r[t],n)+'"';return e?e+" "+a:a}),""),i=r.innerHTML||r.cssText||"",o=-1===_.indexOf(e);return t+"<"+e+' data-react-helmet="true" '+a+(o?"/>":">"+i+"</"+e+">")}),"")}(e,t,n)}}}},le=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,a=e.htmlAttributes,i=e.linkTags,o=e.metaTags,s=e.noscriptTags,c=e.scriptTags,u=e.styleTags,l=e.title,d=void 0===l?"":l,f=e.titleAttributes;return{base:ue(m.BASE,t,r),bodyAttributes:ue(p,n,r),htmlAttributes:ue(h,a,r),link:ue(m.LINK,i,r),meta:ue(m.META,o,r),noscript:ue(m.NOSCRIPT,s,r),script:ue(m.SCRIPT,c,r),style:ue(m.STYLE,u,r),title:ue(m.TITLE,{title:d,titleAttributes:f},r)}},de=function(e){var t,n;return n=t=function(t){function n(){return L(this,n),U(this,t.apply(this,arguments))}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)}(n,t),n.prototype.shouldComponentUpdate=function(e){return!c()(this.props,e)},n.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case m.SCRIPT:case m.NOSCRIPT:return{innerHTML:t};case m.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},n.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,a=e.newChildProps,i=e.nestedChildren;return B({},r,((t={})[n.type]=[].concat(r[n.type]||[],[B({},a,this.mapNestedChildrenToProps(n,i))]),t))},n.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,a=e.newProps,i=e.newChildProps,o=e.nestedChildren;switch(r.type){case m.TITLE:return B({},a,((t={})[r.type]=o,t.titleAttributes=B({},i),t));case m.BODY:return B({},a,{bodyAttributes:B({},i)});case m.HTML:return B({},a,{htmlAttributes:B({},i)})}return B({},a,((n={})[r.type]=B({},i),n))},n.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=B({},t);return Object.keys(e).forEach((function(t){var r;n=B({},n,((r={})[t]=e[t],r))})),n},n.prototype.warnOnInvalidChildren=function(e,t){return!0},n.prototype.mapChildrenToProps=function(e,t){var n=this,r={};return l.a.Children.forEach(e,(function(e){if(e&&e.props){var a=e.props,i=a.children,o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[D[n]||n]=e[n],t}),t)}(W(a,["children"]));switch(n.warnOnInvalidChildren(e,i),e.type){case m.LINK:case m.META:case m.NOSCRIPT:case m.SCRIPT:case m.STYLE:r=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:r,newChildProps:o,nestedChildren:i});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:o,nestedChildren:i})}}})),t=this.mapArrayTypeChildrenToProps(r,t)},n.prototype.render=function(){var t=this.props,n=t.children,r=W(t,["children"]),a=B({},r);return n&&(a=this.mapChildrenToProps(n,a)),l.a.createElement(e,a)},P(n,null,[{key:"canUseDOM",set:function(t){e.canUseDOM=t}}]),n}(l.a.Component),t.propTypes={base:a.a.object,bodyAttributes:a.a.object,children:a.a.oneOfType([a.a.arrayOf(a.a.node),a.a.node]),defaultTitle:a.a.string,defer:a.a.bool,encodeSpecialCharacters:a.a.bool,htmlAttributes:a.a.object,link:a.a.arrayOf(a.a.object),meta:a.a.arrayOf(a.a.object),noscript:a.a.arrayOf(a.a.object),onChangeClientState:a.a.func,script:a.a.arrayOf(a.a.object),style:a.a.arrayOf(a.a.object),title:a.a.string,titleAttributes:a.a.object,titleTemplate:a.a.string},t.defaultProps={defer:!0,encodeSpecialCharacters:!0},t.peek=e.peek,t.rewind=function(){var t=e.rewind();return t||(t=le({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),t},n}(o()((function(e){return{baseTag:K([y,I],e),bodyAttributes:q(p,e),defer:Y(e,E),encode:Y(e,A),htmlAttributes:q(h,e),linkTags:X(m.LINK,[S,y],e),metaTags:X(m.META,[w,v,O,j,k],e),noscriptTags:X(m.NOSCRIPT,[x],e),onChangeClientState:G(e),scriptTags:X(m.SCRIPT,[N,x],e),styleTags:X(m.STYLE,[g],e),title:H(e),titleAttributes:q(b,e)}}),(function(e){te&&J(te),e.defer?te=Z((function(){ne(e,(function(){te=null}))})):(ne(e),te=null)}),le)((function(){return null})));de.renderStatic=de.rewind}).call(this,n(137))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(184);function a(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n(108),n(14);var r=n(135),a=(n(30),n(128),{xs:0,sm:600,md:960,lg:1280,xl:1920}),i={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(a[e],"px)")}};function o(e,t,n){if(Array.isArray(t)){var a=e.theme.breakpoints||i;return t.reduce((function(e,r,i){return e[a.up(a.keys[i])]=n(t[i]),e}),{})}if("object"===Object(r.a)(t)){var o=e.theme.breakpoints||i;return Object.keys(t).reduce((function(e,r){return e[o.up(r)]=n(t[r]),e}),{})}return n(t)}},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";(function(e){var r=n(329),a=n(330),i=n(331);function o(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!c.TYPED_ARRAY_SUPPORT&&!(this instanceof c))return new c(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 d(this,e)}return u(this,e,t,n)}function u(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);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=f(e,t);return e}(e,t,n,r):"string"===typeof t?function(e,t,n){"string"===typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),a=(e=s(e,r)).write(t,n);a!==r&&(e=e.slice(0,a));return e}(e,t,n):function(e,t){if(c.isBuffer(t)){var n=0|p(t.length);return 0===(e=s(e,n)).length||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):f(e,t);if("Buffer"===t.type&&i(t.data))return f(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 d(e,t){if(l(t),e=s(e,t<0?0:0|p(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|p(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(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 W(e).length;t=(""+t).toLowerCase(),r=!0}}function b(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 E(this,t,n);case"utf8":case"utf-8":return N(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").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,a){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=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"===typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,a);if("number"===typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,a){var i,o=1,s=e.length,c=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;o=2,s/=2,c/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var l=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===c)return l*o}else-1!==l&&(i-=i-l),l=-1}else for(n+c>s&&(n=s-c),i=n;i>=0;i--){for(var d=!0,f=0;f<c;f++)if(u(e,i+f)!==u(t,f)){d=!1;break}if(d)return i}return-1}function y(e,t,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r))>a&&(r=a):r=a;var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function O(e,t,n,r){return V(W(t,e.length-n),e,n,r)}function x(e,t,n,r){return V(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function k(e,t,n,r){return x(e,t,n,r)}function w(e,t,n,r){return V(U(t),e,n,r)}function j(e,t,n,r){return V(function(e,t){for(var n,r,a,i=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,a=n%256,i.push(a),i.push(r);return i}(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 N(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a<n;){var i,o,s,c,u=e[a],l=null,d=u>239?4:u>223?3:u>191?2:1;if(a+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128===(192&(i=e[a+1]))&&(c=(31&u)<<6|63&i)>127&&(l=c);break;case 3:i=e[a+1],o=e[a+2],128===(192&i)&&128===(192&o)&&(c=(15&u)<<12|(63&i)<<6|63&o)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=e[a+1],o=e[a+2],s=e[a+3],128===(192&i)&&128===(192&o)&&128===(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),a+=d}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=I));return n}(r)}t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.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=o(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,n){return u(null,e,t,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.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)},c.allocUnsafe=function(e){return d(null,e)},c.allocUnsafeSlow=function(e){return d(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,i=Math.min(n,r);a<i;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},c.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}},c.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=c.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,a),a+=o.length}return r},c.byteLength=h,c.prototype._isBuffer=!0,c.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},c.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},c.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},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?N(this,0,e):b.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.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+">"},c.prototype.compare=function(e,t,n,r,a){if(!c.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===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(a>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(r,a),l=e.slice(t,n),d=0;d<s;++d)if(u[d]!==l[d]){i=u[d],o=l[d];break}return i<o?-1:o<i?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},c.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 a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return O(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return k(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(127&e[a]);return r}function T(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(e[a]);return r}function E(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var a="",i=t;i<n;++i)a+=B(e[i]);return a}function A(e,t,n){for(var r=e.slice(t,n),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+256*r[i+1]);return a}function R(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 F(e,t,n,r,a,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function D(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(e.length-n,2);a<i;++a)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function _(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(e.length-n,4);a<i;++a)e[n+a]=t>>>8*(r?a:3-a)&255}function M(e,t,n,r,a,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,i){return i||M(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return i||M(e,0,n,8),a.write(e,t,n,r,52,8),n+8}c.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),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=c.prototype;else{var a=t-e;n=new c(a,void 0);for(var i=0;i<a;++i)n[i]=this[i+e]}return n},c.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],a=1,i=0;++i<t&&(a*=256);)r+=this[e+i]*a;return r},c.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],a=1;t>0&&(a*=256);)r+=this[e+--t]*a;return r},c.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],a=1,i=0;++i<t&&(a*=256);)r+=this[e+i]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,a=1,i=this[e+--r];r>0&&(a*=256);)i+=this[e+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||F(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=e/a&255;return t+n},c.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||F(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);F(this,e,t,n,a-1,-a)}var i=0,o=1,s=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);F(this,e,t,n,a-1,-a)}var i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.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 a,i=r-n;if(this===e&&n<t&&t<r)for(a=i-1;a>=0;--a)e[a+t]=this[a+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},c.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 a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==r&&"string"!==typeof r)throw new TypeError("encoding must be a string");if("string"===typeof r&&!c.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 i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i<n;++i)this[i]=e;else{var o=c.isBuffer(e)?e:W(new c(e,r).toString()),s=o.length;for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function W(e,t){var n;t=t||1/0;for(var r=e.length,a=null,i=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.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;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(P,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function V(e,t,n,r){for(var a=0;a<r&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}}).call(this,n(137))},function(e,t){e.exports=r;var n=null;try{n=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(N){}function r(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function a(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=a;var i={},o={};function s(e,t){var n,r,a;return t?(a=0<=(e>>>=0)&&e<256)&&(r=o[e])?r:(n=u(e,(0|e)<0?-1:0,!0),a&&(o[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(r=i[e])?r:(n=u(e,e<0?-1:0,!1),a&&(i[e]=n),n)}function c(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=h)return w}else{if(e<=-b)return j;if(e+1>=b)return k}return e<0?c(-e,t).neg():u(e%p|0,e/p|0,t)}function u(e,t,n){return new r(e,t,n)}r.fromInt=s,r.fromNumber=c,r.fromBits=u;var l=Math.pow;function d(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"===typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return d(e.substring(1),t,n).neg();for(var a=c(l(n,8)),i=v,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(l(n,s));i=i.mul(f).add(c(u))}else i=(i=i.mul(a)).add(c(u))}return i.unsigned=t,i}function f(e,t){return"number"===typeof e?c(e,t):"string"===typeof e?d(e,t):u(e.low,e.high,"boolean"===typeof t?t:e.unsigned)}r.fromString=d,r.fromValue=f;var p=4294967296,h=p*p,b=h/2,m=s(1<<24),v=s(0);r.ZERO=v;var g=s(0,!0);r.UZERO=g;var y=s(1);r.ONE=y;var O=s(1,!0);r.UONE=O;var x=s(-1);r.NEG_ONE=x;var k=u(-1,2147483647,!1);r.MAX_VALUE=k;var w=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=w;var j=u(0,-2147483648,!1);r.MIN_VALUE=j;var S=r.prototype;S.toInt=function(){return this.unsigned?this.low>>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(j)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var a=c(l(e,6),this.unsigned),i=this,o="";;){var s=i.div(a),u=(i.sub(s.mul(a)).toInt()>>>0).toString(e);if((i=s).isZero())return u+o;for(;u.length<6;)u="0"+u;o=""+u+o}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(j)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},S.isZero=function(){return 0===this.high&&0===this.low},S.eqz=S.isZero,S.isNegative=function(){return!this.unsigned&&this.high<0},S.isPositive=function(){return this.unsigned||this.high>=0},S.isOdd=function(){return 1===(1&this.low)},S.isEven=function(){return 0===(1&this.low)},S.equals=function(e){return a(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(a(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(j)?j:this.not().add(y)},S.neg=S.negate,S.add=function(e){a(e)||(e=f(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,o=e.high>>>16,s=65535&e.high,c=e.low>>>16,l=0,d=0,p=0,h=0;return p+=(h+=i+(65535&e.low))>>>16,d+=(p+=r+c)>>>16,l+=(d+=n+s)>>>16,l+=t+o,u((p&=65535)<<16|(h&=65535),(l&=65535)<<16|(d&=65535),this.unsigned)},S.subtract=function(e){return a(e)||(e=f(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return v;if(a(e)||(e=f(e)),n)return u(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(j))return e.isOdd()?j:v;if(e.eq(j))return this.isOdd()?j:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return c(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,l=65535&e.high,d=e.low>>>16,p=65535&e.low,h=0,b=0,g=0,y=0;return g+=(y+=o*p)>>>16,b+=(g+=i*p)>>>16,g&=65535,b+=(g+=o*d)>>>16,h+=(b+=r*p)>>>16,b&=65535,h+=(b+=i*d)>>>16,b&=65535,h+=(b+=o*l)>>>16,h+=t*p+r*d+i*l+o*s,u((g&=65535)<<16|(y&=65535),(h&=65535)<<16|(b&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(a(e)||(e=f(e)),e.isZero())throw Error("division by zero");var t,r,i;if(n)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return O;i=g}else{if(this.eq(j))return e.eq(y)||e.eq(x)?j:e.eq(j)?y:(t=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?y:x:(r=this.sub(e.mul(t)),i=t.add(r.div(e)));if(e.eq(j))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=v}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),s=o<=48?1:l(2,o-48),d=c(t),p=d.mul(e);p.isNegative()||p.gt(r);)p=(d=c(t-=s,this.unsigned)).mul(e);d.isZero()&&(d=y),i=i.add(d),r=r.sub(p)}return i},S.div=S.divide,S.modulo=function(e){return a(e)||(e=f(e)),n?u((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(e){return a(e)||(e=f(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return a(e)||(e=f(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return a(e)||(e=f(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return a(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},S.shl=S.shiftLeft,S.shiftRight=function(e){return a(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(a(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},S.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var o=a.apply(null,r);o&&e.push(o)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var s in r)n.call(r,s)&&r[s]&&e.push(s);else e.push(r.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";(function(e){var r=n(4),a=n.n(r),i=n(63),o=n(30),s=n.n(o),c=1073741823,u="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:{};function l(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)}))}}}var d=a.a.createContext||function(e,t){var n,a,o="__create-react-context-"+function(){var e="__global_unique_id__";return u[e]=(u[e]||0)+1}()+"__",d=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=l(t.props.value),t}Object(i.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,a=e.value;((i=r)===(o=a)?0!==i||1/i===1/o:i!==i&&o!==o)?n=0:(n="function"===typeof t?t(r,a):c,0!==(n|=0)&&this.emitter.set(e.value,n))}var i,o},r.render=function(){return this.props.children},n}(r.Component);d.childContextTypes=((n={})[o]=s.a.object.isRequired,n);var f=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}Object(i.a)(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=void 0===t||null===t?c: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?c: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 f.contextTypes=((a={})[o]=s.a.object,a),{Provider:d,Consumer:f}};t.a=d}).call(this,n(137))},function(e,t,n){var r=n(351);e.exports=p,e.exports.parse=i,e.exports.compile=function(e,t){return s(i(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,o=0,s="",l=t&&t.delimiter||"/";null!=(n=a.exec(e));){var d=n[0],f=n[1],p=n.index;if(s+=e.slice(o,p),o=p+d.length,f)s+=f[1];else{var h=e[o],b=n[2],m=n[3],v=n[4],g=n[5],y=n[6],O=n[7];s&&(r.push(s),s="");var x=null!=b&&null!=h&&h!==b,k="+"===y||"*"===y,w="?"===y||"*"===y,j=n[2]||l,S=v||g;r.push({name:m||i++,prefix:b||"",delimiter:j,optional:w,repeat:k,partial:x,asterisk:!!O,pattern:S?u(S):O?".*":"[^"+c(j)+"]+?"})}}return o<e.length&&(s+=e.substr(o)),s&&r.push(s),r}function o(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function s(e,t){for(var n=new Array(e.length),a=0;a<e.length;a++)"object"===typeof e[a]&&(n[a]=new RegExp("^(?:"+e[a].pattern+")$",d(t)));return function(t,a){for(var i="",s=t||{},c=(a||{}).pretty?o:encodeURIComponent,u=0;u<e.length;u++){var l=e[u];if("string"!==typeof l){var d,f=s[l.name];if(null==f){if(l.optional){l.partial&&(i+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(r(f)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var p=0;p<f.length;p++){if(d=c(f[p]),!n[u].test(d))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(d)+"`");i+=(0===p?l.prefix:l.delimiter)+d}}else{if(d=l.asterisk?encodeURI(f).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):c(f),!n[u].test(d))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+d+'"');i+=l.prefix+d}}else i+=l}return i}}function c(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function u(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function l(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function f(e,t,n){r(t)||(n=t||n,t=[]);for(var a=(n=n||{}).strict,i=!1!==n.end,o="",s=0;s<e.length;s++){var u=e[s];if("string"===typeof u)o+=c(u);else{var f=c(u.prefix),p="(?:"+u.pattern+")";t.push(u),u.repeat&&(p+="(?:"+f+p+")*"),o+=p=u.optional?u.partial?f+"("+p+")?":"(?:"+f+"("+p+"))?":f+"("+p+")"}}var h=c(n.delimiter||"/"),b=o.slice(-h.length)===h;return a||(o=(b?o.slice(0,-h.length):o)+"(?:"+h+"(?=$))?"),o+=i?"$":a&&b?"":"(?="+h+"|$)",l(new RegExp("^"+o,d(n)),t)}function p(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=[],a=0;a<e.length;a++)r.push(p(e[a],t,n).source);return l(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return f(i(e,n),t,n)}(e,t,n)}},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({acos_:function(e){var t={x:Object(i.a)(e,"x","acos")};return r.a.runKernel(a.b,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({acosh_:function(e){var t={x:Object(i.a)(e,"x","acosh")};return r.a.runKernel(a.c,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({addN_:function(e){o.b(Array.isArray(e),(function(){return"The argument passed to tf.addN() must be a list of tensors"})),o.b(e.length>=1,(function(){return"Must pass at least one tensor to tf.addN(), but got "+"".concat(e.length)}));var t=e.map((function(e,t){return Object(i.a)(e,"tensors".concat(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(!o.a(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));var s=t;return r.a.runKernel(a.e,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({asin_:function(e){var t={x:Object(i.a)(e,"x","asin")};return r.a.runKernel(a.j,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({asinh_:function(e){var t={x:Object(i.a)(e,"x","asinh")};return r.a.runKernel(a.k,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({atan_:function(e){var t={x:Object(i.a)(e,"x","atan")};return r.a.runKernel(a.l,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({atanh_:function(e){var t={x:Object(i.a)(e,"x","atanh")};return r.a.runKernel(a.n,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(24),c=n(8),u=n(13);var l=Object(c.b)({avgPool3d_:function(e,t,n,c,l){var d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NDHWC",f=Object(i.a)(e,"x","avgPool3d","float32"),p=f,h=!1;4===f.rank&&(h=!0,p=Object(u.a)(f,[1,f.shape[0],f.shape[1],f.shape[2],f.shape[3]])),o.b(5===p.rank,(function(){return"Error in avgPool3d: x must be rank 5 but got rank ".concat(p.rank,".")})),o.b("NDHWC"===d,(function(){return"Error in avgPool3d: Only NDHWC is currently supported, "+"but got dataFormat of ".concat(d)})),null!=l&&o.b(o.v(c),(function(){return"Error in avgPool3d: pad must be an integer when using, "+"dimRoundingMode ".concat(l," but got pad ").concat(c,".")}));var b={x:p},m={filterSize:t,strides:n,pad:c,dimRoundingMode:l,dataFormat:d},v=r.a.runKernel(a.p,b,m);return v=Object(s.a)(v,p.dtype),h?Object(u.a)(v,[v.shape[1],v.shape[2],v.shape[3],v.shape[4]]):v}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({ceil_:function(e){var t={x:Object(i.a)(e,"x","ceil")};return r.a.runKernel(a.x,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({clipByValue_:function(e,t,n){var s=Object(i.a)(e,"x","clipByValue");o.b(t<=n,(function(){return"Error in clip: min (".concat(t,") must be ")+"less than or equal to max (".concat(n,").")}));var c={x:s},u={clipValueMin:t,clipValueMax:n};return r.a.runKernel(a.y,c,u)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(48),c=n(8),u=n(13);var l=Object(c.b)({conv3d_:function(e,t,n,c){var l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"NDHWC",d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[1,1,1],f=Object(i.a)(e,"x","conv3d"),p=Object(i.a)(t,"filter","conv3d"),h=f,b=!1;4===f.rank&&(b=!0,h=Object(u.a)(f,[1,f.shape[0],f.shape[1],f.shape[2],f.shape[3]])),o.b(5===h.rank,(function(){return"Error in conv3d: input must be rank 5, but got rank ".concat(h.rank,".")})),o.b(5===p.rank,(function(){return"Error in conv3d: filter must be rank 5, but got rank "+"".concat(p.rank,".")})),o.b(h.shape[4]===p.shape[3],(function(){return"Error in conv3d: depth of input (".concat(h.shape[4],") must match ")+"input depth for filter ".concat(p.shape[3],".")})),o.b(Object(s.h)(n,d),(function(){return"Error in conv3D: Either strides or dilations must be 1. "+"Got strides ".concat(n," and dilations '").concat(d,"'")})),o.b("NDHWC"===l,(function(){return"Error in conv3d: got dataFormat of ".concat(l," but only NDHWC is currently supported.")}));var m={x:h,filter:p},v={strides:n,pad:c,dataFormat:l,dilations:d},g=r.a.runKernel(a.F,m,v);return b?Object(u.a)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8);var c=Object(s.b)({denseBincount_:function(e,t,n){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=Object(i.a)(e,"x","denseBincount"),u=Object(i.a)(t,"weights","denseBincount");o.b("int32"===c.dtype,(function(){return"Error in denseBincount: input "+"dtype must be int32, but got ".concat(c.dtype)})),o.b(c.rank<=2,(function(){return"Error in denseBincount: input must be at most rank 2, but got "+"rank ".concat(c.rank,".")})),o.b(n>=0,(function(){return"size must be non-negative, but got ".concat(n,".")})),o.b(u.size===c.size||0===u.size,(function(){return"Error in denseBincount: weights must have the same shape as x or "+"0-length, but got x shape: ".concat(c.shape,", weights shape: ")+"".concat(u.shape,".")}));var l={x:c,weights:u},d={size:n,binaryOutput:s};return r.a.runKernel(a.M,l,d)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({einsum_:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var s=n.map((function(e,t){return Object(i.a)(e,"tensors".concat(t),"einsum")})),c={equation:e};return r.a.runKernel(a.V,s,c)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(24),c=n(8);var u=Object(c.b)({erf_:function(e){var t=Object(i.a)(e,"x","erf");o.b("int32"===t.dtype||"float32"===t.dtype,(function(){return"Input dtype must be `int32` or `float32`."})),"int32"===t.dtype&&(t=Object(s.a)(t,"float32"));var n={x:t};return r.a.runKernel(a.Z,n)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({expm1_:function(e){var t={x:Object(i.a)(e,"x","expm1")};return r.a.runKernel(a.cb,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({isFinite_:function(e){var t={x:Object(i.a)(e,"x","isFinite")};return r.a.runKernel(a.tb,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({isInf_:function(e){var t={x:Object(i.a)(e,"x","isInf")};return r.a.runKernel(a.ub,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({isNaN_:function(e){var t={x:Object(i.a)(e,"x","isNaN")};return r.a.runKernel(a.vb,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(9),a=n(3);function i(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");var i={start:e,stop:t,num:n};return r.a.runKernel(a.Bb,{},i)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(55),a=n(2),i=n(18),o=n(45),s=n(8),c=n(93),u=n(205);var l=Object(s.b)({logSigmoid_:function(e){var t=Object(a.a)(e,"x","logSigmoid");return Object(r.a)((function(e){return{value:Object(o.a)(Object(u.a)(Object(o.a)(e))),gradFunc:function(t){return Object(i.a)(t,Object(c.a)(Object(o.a)(e)))}}}))(t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(6),a=n(55),i=n(2),o=n(24),s=n(61),c=n(97),u=n(94),l=n(18),d=n(8),f=n(29),p=n(32);var h=Object(d.b)({logSoftmax_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=Object(i.a)(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 ".concat(n.rank," and axis was ").concat(t));var d=Object(a.a)((function(e,n){var a=Object(u.a)(e,t,!0),i=Object(f.a)(e,a),d=Object(f.a)(Object(o.a)(i,"float32"),Object(c.a)(Object(p.a)(Object(s.a)(i),t,!0)));n([d]);return{value:d,gradFunc:function(e,n){var a=Object(r.a)(n,1)[0],i=Object(s.a)(a);return Object(f.a)(e,Object(l.a)(Object(p.a)(e,t,!0),i))}}}));return d(n)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(9),a=n(3),i=n(2),o=n(15),s=n(8),c=n(13);var u=Object(s.b)({maxPool3d_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1,1],n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NDHWC",d=Object(i.a)(e,"x","maxPool3d"),f=d,p=!1;4===d.rank&&(p=!0,f=Object(c.a)(d,[1,d.shape[0],d.shape[1],d.shape[2],d.shape[3]])),o.b(5===f.rank,(function(){return"Error in maxPool3d: x must be rank 5 but got rank ".concat(f.rank,".")})),o.b("NDHWC"===l,(function(){return"Error in maxPool3d: Only NDHWC is currently supported, "+"but got dataFormat of ".concat(l)})),null!=u&&o.b(o.v(s),(function(){return"Error in maxPool3d: pad must be an integer when using, "+"dimRoundingMode ".concat(u," but got pad ").concat(s,".")}));var h={x:f},b={filterSize:t,strides:n,pad:s,dimRoundingMode:u,dataFormat:l},m=r.a.runKernel(a.Kb,h,b);return p?Object(c.a)(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({maxPoolWithArgmax_:function(e,t,n,o){var s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=Object(i.a)(e,"x","maxPoolWithArgmax"),u={x:c},l={filterSize:t,strides:n,pad:o,includeBatchInIndex:s},d=r.a.runKernel(a.Nb,u,l);return{result:d[0],indexes:d[1]}}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(8),s=n(13);var c=Object(o.b)({multinomial_:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=Object(i.a)(e,"logits","multinomial"),u=c.size,l=c.rank;if(u<2)throw new Error("Error in multinomial: you need at least 2 outcomes, but got "+"".concat(u,"."));if(l>2)throw new Error("Rank of probabilities must be 1 or 2, but is ".concat(l));n=n||Math.random();var d=1===l?Object(s.a)(c,[1,-1]):c,f={logits:d},p={numSamples:t,seed:n,normalized:o},h=r.a.runKernel(a.Ub,f,p);return 1===l?Object(s.a)(h,[h.size]):h}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({onesLike_:function(e){var t={x:Object(i.a)(e,"x","onesLike")};return r.a.runKernel(a.cc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({reciprocal_:function(e){var t={x:Object(i.a)(e,"x","reciprocal")};return r.a.runKernel(a.lc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(5),a=n.n(r),i=n(12),o=n(10),s=n(2),c=n(15);function u(){return(u=Object(i.a)(a.a.mark((function e(t,n){var r,i,u,l,d,f,p,h,b,m,v;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(s.a)(t,"x","setdiff1d"),i=Object(s.a)(n,"y","setdiff1d"),c.b(r.dtype===i.dtype,(function(){return"x and y should have the same dtype, but got x (".concat(r.dtype,") and y (").concat(i.dtype,").")})),c.b(1===r.rank,(function(){return"x should be 1D tensor, but got x (".concat(r.shape,").")})),c.b(1===i.rank,(function(){return"y should be 1D tensor, but got y (".concat(i.shape,").")})),e.next=7,r.data();case 7:return u=e.sent,e.next=10,i.data();case 10:for(l=e.sent,d=new Set(l),f=0,p=0;p<u.length;p++)d.has(u[p])||f++;for(h=new o.b([f],r.dtype),b=new o.b([f],"int32"),m=0,v=0;m<u.length;m++)d.has(u[m])||(h.values[v]=u[m],b.values[v]=m,v++);return e.abrupt("return",[h.toTensor(),b.toTensor()]);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var l=function(e,t){return u.apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({sign_:function(e){var t={x:Object(i.a)(e,"x","sign")};return r.a.runKernel(a.Bc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({softmax_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=Object(i.a)(e,"logits","softmax","float32");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 ".concat(n.rank," and dim was ").concat(t));var o={logits:n},s={dim:t};return r.a.runKernel(a.Fc,o,s)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({stridedSlice_:function(e,t,n,o){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,d=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,f=Object(i.a)(e,"x","stridedSlice","string_or_numeric"),p={x:f},h={begin:t,end:n,strides:o,beginMask:s,endMask:c,ellipsisMask:u,newAxisMask:l,shrinkAxisMask:d};return r.a.runKernel(a.Sc,p,h)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({tan_:function(e){var t={x:Object(i.a)(e,"x","tan")};return r.a.runKernel(a.Yc,t)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(68),a=n(8),i=n(126);var o=Object(a.b)({truncatedNormal_:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(null!=a&&"bool"===a)throw new Error("Unsupported data type $ { dtype }");for(var s=new i.a(t,n,a,!0,o),c=Object(r.a)(e,a),u=0;u<c.values.length;u++)c.values[u]=s.nextValue();return c.toTensor()}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3),i=n(2),o=n(8),s=n(141);var c=Object(o.b)({scatterND_:function(e,t,n){var o=Object(i.a)(e,"indices","scatterND","int32"),c=Object(i.a)(t,"updates","scatterND");s.b(c,o,n);var u={indices:o,updates:c},l={shape:n};return r.a.runKernel(a.xc,u,l)}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n(3),i=n(2),o=n(8);var s=Object(o.b)({gatherND_:function(e,t){var n=Object(i.a)(t,"indices","gatherND","int32"),o={params:Object(i.a)(e,"x","gatherND","string_or_numeric"),indices:n};return r.a.runKernel(a.mb,o)}})},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r="undefined"!==typeof requestAnimationFrame?requestAnimationFrame:"undefined"!==typeof e?e:function(e){return e()};function a(){return new Promise((function(e){return r((function(){return e()}))}))}}).call(this,n(343).setImmediate)},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n(3);function i(e,t,n,r){if("int32"!==e.dtype)throw new Error("tf.sparseToDense() expects the indices to be int32 type,"+" but the dtype was ".concat(e.dtype,"."));if(e.rank>2)throw new Error("sparseIndices should be a scalar, vector, or matrix,"+" but got shape ".concat(e.shape,"."));var a=e.rank>0?e.shape[0]:1,i=e.rank>1?e.shape[1]:1;if(n.length!==i)throw new Error("outputShape has incorrect number of elements:,"+" ".concat(n.length,", should be: ").concat(i,"."));var o=t.size;if(0!==t.rank&&(1!==t.rank||o!==a))throw new Error("sparseValues has incorrect shape "+"".concat(t.shape,", should be [] or [").concat(a,"]"));if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}var o=n(2),s=n(8);var c=Object(s.b)({sparseToDense_:function(e,t,n){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,c=Object(o.a)(e,"sparseIndices","sparseToDense","int32"),u=Object(o.a)(t,"sparseValues","sparseToDense"),l=Object(o.a)(s,"defaultValue","sparseToDense",u.dtype);i(c,u,n,l);var d={sparseIndices:c,sparseValues:u,defaultValue:l},f={outputShape:n};return r.a.runKernel(a.Mc,d,f)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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:"AddV2",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},{tfName:"data_format",name:"dataFormat",type:"string",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:"DivNoNan",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"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",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:"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}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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}]},{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"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{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:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",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:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",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}]},{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}]},{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}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{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:"tensor"},{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:"tensor"},{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:"tensor"},{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:"tensor"},{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:"tensor"},{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:"tensor"},{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:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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},{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:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",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:"MaxPool3D",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:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",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},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",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:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{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:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{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[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",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:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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},{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"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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:"NonMaxSuppressionV4",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"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",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"},{start:5,name:"softNmsSigma",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}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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:"half_pixel_centers",name:"halfPixelCenters",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:"half_pixel_centers",name:"halfPixelCenters",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"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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}]},{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}]},{tfOpName:"SelectV2",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}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{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:"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:"BatchMatMulV2",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}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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:"FusedBatchNormV3",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}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{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"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{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}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{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[]"}]},{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}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}]},function(e,t,n){"use strict";n.r(t),n.d(t,"json",(function(){return r}));var r=[{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:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{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"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]}]},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return p}));var r=n(5),a=n.n(r),i=n(12),o=n(7),s=n(11),c=n(16),u=n(17),l=n(0),d=n(67),f=n(305),p=function(e){Object(c.a)(n,e);var t=Object(u.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,[{key:"decodeUTF8",value:function(){return new h(this)}}]),n}(d.a),h=function(e){Object(c.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(o.a)(this,n),(r=t.call(this)).upstream=e,r.impl=new b(e),r}return Object(s.a)(n,[{key:"summary",value:function(){return this.impl.summary()}},{key:"next",value:function(){var e=Object(i.a)(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.impl.next());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(f.a),b=function(t){Object(c.a)(d,t);var r=Object(u.a)(d);function d(e){var t;if(Object(o.a)(this,d),(t=r.call(this)).upstream=e,Object(l.Ud)().get("IS_BROWSER"))t.decoder=new TextDecoder("utf-8");else{var a=n(345).StringDecoder;t.decoder=new a("utf8")}return t}return Object(s.a)(d,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Utf8")}},{key:"pump",value:function(){var t=Object(i.a)(a.a.mark((function t(){var n,r,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.upstream.next();case 2:if(!(n=t.sent).done){t.next=7;break}return t.abrupt("return",!1);case 7:r=n.value;case 8:return i=Object(l.Ud)().get("IS_BROWSER")?this.decoder.decode(r,{stream:!0}):this.decoder.write(e.from(r.buffer)),this.outputQueue.push(i),t.abrupt("return",!0);case 11:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()}]),d}(d.b)}).call(this,n(239).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(20),a=n(5),i=n.n(a),o=n(12),s=n(7),c=n(11),u=n(16),l=n(17),d=n(67),f=function(e){Object(u.a)(n,e);var t=Object(l.a)(n);function n(){return Object(s.a)(this,n),t.apply(this,arguments)}return Object(c.a)(n,[{key:"split",value:function(e){return new p(this,e)}}]),n}(d.a),p=function(e){Object(u.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;return Object(s.a)(this,n),(a=t.call(this)).upstream=e,a.impl=new h(e,r),a}return Object(c.a)(n,[{key:"summary",value:function(){return this.impl.summary()}},{key:"next",value:function(){var e=Object(o.a)(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.impl.next());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(f),h=function(e){Object(u.a)(n,e);var t=Object(l.a)(n);function n(e,r){var a;return Object(s.a)(this,n),(a=t.call(this)).upstream=e,a.separator=r,a.carryover="",a}return Object(c.a)(n,[{key:"summary",value:function(){return"".concat(this.upstream.summary()," -> Split('").concat(this.separator,"')")}},{key:"pump",value:function(){var e=Object(o.a)(i.a.mark((function e(){var t,n,a,o,s;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.upstream.next();case 2:if(!(t=e.sent).done){e.next=9;break}if(""!==this.carryover){e.next=6;break}return e.abrupt("return",!1);case 6:return this.outputQueue.push(this.carryover),this.carryover="",e.abrupt("return",!0);case 9:(n=t.value.split(this.separator))[0]=this.carryover+n[0],a=Object(r.a)(n.slice(0,-1));try{for(a.s();!(o=a.n()).done;)s=o.value,this.outputQueue.push(s)}catch(i){a.e(i)}finally{a.f()}return this.carryover=n[n.length-1],e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(d.b)},function(e,t,n){"use strict";var r,a=n(4),i=(r=a)&&"object"===typeof r&&"default"in r?r.default:r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=!("undefined"===typeof window||!window.document||!window.document.createElement);e.exports=function(e,t,n){if("function"!==typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!==typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if("undefined"!==typeof n&&"function"!==typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!==typeof r)throw new Error("Expected WrappedComponent to be a React component.");var c,u=[];function l(){c=e(u.map((function(e){return e.props}))),d.canUseDOM?t(c):n&&(c=n(c))}var d=function(e){var t,n;function a(){return e.apply(this,arguments)||this}n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,a.peek=function(){return c},a.rewind=function(){if(a.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=c;return c=void 0,u=[],e};var o=a.prototype;return o.UNSAFE_componentWillMount=function(){u.push(this),l()},o.componentDidUpdate=function(){l()},o.componentWillUnmount=function(){var e=u.indexOf(this);u.splice(e,1),l()},o.render=function(){return i.createElement(r,this.props)},a}(a.PureComponent);return o(d,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),o(d,"canUseDOM",s),d}}},function(e,t){var n="undefined"!==typeof Element,r="function"===typeof Map,a="function"===typeof Set,i="function"===typeof ArrayBuffer&&!!ArrayBuffer.isView;function o(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var s,c,u,l;if(Array.isArray(e)){if((s=e.length)!=t.length)return!1;for(c=s;0!==c--;)if(!o(e[c],t[c]))return!1;return!0}if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(l=e.entries();!(c=l.next()).done;)if(!t.has(c.value[0]))return!1;for(l=e.entries();!(c=l.next()).done;)if(!o(c.value[1],t.get(c.value[0])))return!1;return!0}if(a&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(l=e.entries();!(c=l.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((s=e.length)!=t.length)return!1;for(c=s;0!==c--;)if(e[c]!==t[c])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((s=(u=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(c=s;0!==c--;)if(!Object.prototype.hasOwnProperty.call(t,u[c]))return!1;if(n&&e instanceof Element)return!1;for(c=s;0!==c--;)if(("_owner"!==u[c]&&"__v"!==u[c]&&"__o"!==u[c]||!e.$$typeof)&&!o(e[u[c]],t[u[c]]))return!1;return!0}return e!==e&&t!==t}e.exports=function(e,t){try{return o(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified Material-UI error #"+e+"; visit "+t+" for the full message."}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(14),a=n(23),i=n(4),o=n.n(i),s=(n(30),n(53)),c=n(25),u=n(50),l=n(79),d=n(35),f=!0,p=!1,h=null,b={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function m(e){e.metaKey||e.altKey||e.ctrlKey||(f=!0)}function v(){f=!1}function g(){"hidden"===this.visibilityState&&p&&(f=!0)}function y(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return f||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!b[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function O(){p=!0,window.clearTimeout(h),h=window.setTimeout((function(){p=!1}),100)}function x(){return{isFocusVisible:y,onBlurVisible:O,ref:i.useCallback((function(e){var t,n=s.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",m,!0),t.addEventListener("mousedown",v,!0),t.addEventListener("pointerdown",v,!0),t.addEventListener("touchstart",v,!0),t.addEventListener("visibilitychange",g,!0))}),[])}}var k=n(108),w=n(75),j=n(185),S=n(63),N=n(173);function I(e,t){var n=Object.create(null);return e&&i.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(i.isValidElement)(e)?t(e):e}(e)})),n}function C(e,t,n){return null!=n[t]?n[t]:e.props[t]}function T(e,t,n){var r=I(e.children),a=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,a=Object.create(null),i=[];for(var o in e)o in t?i.length&&(a[o]=i,i=[]):i.push(o);var s={};for(var c in t){if(a[c])for(r=0;r<a[c].length;r++){var u=a[c][r];s[a[c][r]]=n(u)}s[c]=n(c)}for(r=0;r<i.length;r++)s[i[r]]=n(i[r]);return s}(t,r);return Object.keys(a).forEach((function(o){var s=a[o];if(Object(i.isValidElement)(s)){var c=o in t,u=o in r,l=t[o],d=Object(i.isValidElement)(l)&&!l.props.in;!u||c&&!d?u||!c||d?u&&c&&Object(i.isValidElement)(l)&&(a[o]=Object(i.cloneElement)(s,{onExited:n.bind(null,s),in:l.props.in,exit:C(s,"exit",e),enter:C(s,"enter",e)})):a[o]=Object(i.cloneElement)(s,{in:!1}):a[o]=Object(i.cloneElement)(s,{onExited:n.bind(null,s),in:!0,exit:C(s,"exit",e),enter:C(s,"enter",e)})}})),a}var E=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},A=function(e){function t(t,n){var r,a=(r=e.call(this,t,n)||this).handleExited.bind(Object(j.a)(r));return r.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},r}Object(S.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,a=t.children,o=t.handleExited;return{children:t.firstRender?(n=e,r=o,I(n.children,(function(e){return Object(i.cloneElement)(e,{onExited:r.bind(null,e),in:!0,appear:C(e,"appear",n),enter:C(e,"enter",n),exit:C(e,"exit",n)})}))):T(e,a,o),firstRender:!1}},n.handleExited=function(e,t){var n=I(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(r.a)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Object(w.a)(e,["component","childFactory"]),a=this.state.contextValue,i=E(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?o.a.createElement(N.a.Provider,{value:a},i):o.a.createElement(N.a.Provider,{value:a},o.a.createElement(t,r,i))},t}(o.a.Component);A.propTypes={},A.defaultProps={component:"div",childFactory:function(e){return e}};var R=A,F="undefined"===typeof window?i.useEffect:i.useLayoutEffect;var D=function(e){var t=e.classes,n=e.pulsate,r=void 0!==n&&n,a=e.rippleX,o=e.rippleY,s=e.rippleSize,u=e.in,d=e.onExited,f=void 0===d?function(){}:d,p=e.timeout,h=i.useState(!1),b=h[0],m=h[1],v=Object(c.a)(t.ripple,t.rippleVisible,r&&t.ripplePulsate),g={width:s,height:s,top:-s/2+o,left:-s/2+a},y=Object(c.a)(t.child,b&&t.childLeaving,r&&t.childPulsate),O=Object(l.a)(f);return F((function(){if(!u){m(!0);var e=setTimeout(O,p);return function(){clearTimeout(e)}}}),[O,u,p]),i.createElement("span",{className:v,style:g},i.createElement("span",{className:y}))},_=i.forwardRef((function(e,t){var n=e.center,o=void 0!==n&&n,s=e.classes,u=e.className,l=Object(a.a)(e,["center","classes","className"]),d=i.useState([]),f=d[0],p=d[1],h=i.useRef(0),b=i.useRef(null);i.useEffect((function(){b.current&&(b.current(),b.current=null)}),[f]);var m=i.useRef(!1),v=i.useRef(null),g=i.useRef(null),y=i.useRef(null);i.useEffect((function(){return function(){clearTimeout(v.current)}}),[]);var O=i.useCallback((function(e){var t=e.pulsate,n=e.rippleX,r=e.rippleY,a=e.rippleSize,o=e.cb;p((function(e){return[].concat(Object(k.a)(e),[i.createElement(D,{key:h.current,classes:s,timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:a})])})),h.current+=1,b.current=o}),[s]),x=i.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,a=void 0!==r&&r,i=t.center,s=void 0===i?o||t.pulsate:i,c=t.fakeElement,u=void 0!==c&&c;if("mousedown"===e.type&&m.current)m.current=!1;else{"touchstart"===e.type&&(m.current=!0);var l,d,f,p=u?null:y.current,h=p?p.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)l=Math.round(h.width/2),d=Math.round(h.height/2);else{var b=e.touches?e.touches[0]:e,x=b.clientX,k=b.clientY;l=Math.round(x-h.left),d=Math.round(k-h.top)}if(s)(f=Math.sqrt((2*Math.pow(h.width,2)+Math.pow(h.height,2))/3))%2===0&&(f+=1);else{var w=2*Math.max(Math.abs((p?p.clientWidth:0)-l),l)+2,j=2*Math.max(Math.abs((p?p.clientHeight:0)-d),d)+2;f=Math.sqrt(Math.pow(w,2)+Math.pow(j,2))}e.touches?null===g.current&&(g.current=function(){O({pulsate:a,rippleX:l,rippleY:d,rippleSize:f,cb:n})},v.current=setTimeout((function(){g.current&&(g.current(),g.current=null)}),80)):O({pulsate:a,rippleX:l,rippleY:d,rippleSize:f,cb:n})}}),[o,O]),w=i.useCallback((function(){x({},{pulsate:!0})}),[x]),j=i.useCallback((function(e,t){if(clearTimeout(v.current),"touchend"===e.type&&g.current)return e.persist(),g.current(),g.current=null,void(v.current=setTimeout((function(){j(e,t)})));g.current=null,p((function(e){return e.length>0?e.slice(1):e})),b.current=t}),[]);return i.useImperativeHandle(t,(function(){return{pulsate:w,start:x,stop:j}}),[w,x,j]),i.createElement("span",Object(r.a)({className:Object(c.a)(s.root,u),ref:y},l),i.createElement(R,{component:null,exit:!0},f))})),M=Object(d.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(i.memo(_)),z=i.forwardRef((function(e,t){var n=e.action,o=e.buttonRef,d=e.centerRipple,f=void 0!==d&&d,p=e.children,h=e.classes,b=e.className,m=e.component,v=void 0===m?"button":m,g=e.disabled,y=void 0!==g&&g,O=e.disableRipple,k=void 0!==O&&O,w=e.disableTouchRipple,j=void 0!==w&&w,S=e.focusRipple,N=void 0!==S&&S,I=e.focusVisibleClassName,C=e.onBlur,T=e.onClick,E=e.onFocus,A=e.onFocusVisible,R=e.onKeyDown,F=e.onKeyUp,D=e.onMouseDown,_=e.onMouseLeave,z=e.onMouseUp,L=e.onTouchEnd,P=e.onTouchMove,B=e.onTouchStart,W=e.onDragLeave,U=e.tabIndex,V=void 0===U?0:U,H=e.TouchRippleProps,G=e.type,q=void 0===G?"button":G,K=Object(a.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),X=i.useRef(null);var Y=i.useRef(null),$=i.useState(!1),Q=$[0],Z=$[1];y&&Q&&Z(!1);var J=x(),ee=J.isFocusVisible,te=J.onBlurVisible,ne=J.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:j;return Object(l.a)((function(r){return t&&t(r),!n&&Y.current&&Y.current[e](r),!0}))}i.useImperativeHandle(n,(function(){return{focusVisible:function(){Z(!0),X.current.focus()}}}),[]),i.useEffect((function(){Q&&N&&!k&&Y.current.pulsate()}),[k,N,Q]);var ae=re("start",D),ie=re("stop",W),oe=re("stop",z),se=re("stop",(function(e){Q&&e.preventDefault(),_&&_(e)})),ce=re("start",B),ue=re("stop",L),le=re("stop",P),de=re("stop",(function(e){Q&&(te(e),Z(!1)),C&&C(e)}),!1),fe=Object(l.a)((function(e){X.current||(X.current=e.currentTarget),ee(e)&&(Z(!0),A&&A(e)),E&&E(e)})),pe=function(){var e=s.findDOMNode(X.current);return v&&"button"!==v&&!("A"===e.tagName&&e.href)},he=i.useRef(!1),be=Object(l.a)((function(e){N&&!he.current&&Q&&Y.current&&" "===e.key&&(he.current=!0,e.persist(),Y.current.stop(e,(function(){Y.current.start(e)}))),e.target===e.currentTarget&&pe()&&" "===e.key&&e.preventDefault(),R&&R(e),e.target===e.currentTarget&&pe()&&"Enter"===e.key&&!y&&(e.preventDefault(),T&&T(e))})),me=Object(l.a)((function(e){N&&" "===e.key&&Y.current&&Q&&!e.defaultPrevented&&(he.current=!1,e.persist(),Y.current.stop(e,(function(){Y.current.pulsate(e)}))),F&&F(e),T&&e.target===e.currentTarget&&pe()&&" "===e.key&&!e.defaultPrevented&&T(e)})),ve=v;"button"===ve&&K.href&&(ve="a");var ge={};"button"===ve?(ge.type=q,ge.disabled=y):("a"===ve&&K.href||(ge.role="button"),ge["aria-disabled"]=y);var ye=Object(u.a)(o,t),Oe=Object(u.a)(ne,X),xe=Object(u.a)(ye,Oe),ke=i.useState(!1),we=ke[0],je=ke[1];i.useEffect((function(){je(!0)}),[]);var Se=we&&!k&&!y;return i.createElement(ve,Object(r.a)({className:Object(c.a)(h.root,b,Q&&[h.focusVisible,I],y&&h.disabled),onBlur:de,onClick:T,onFocus:fe,onKeyDown:be,onKeyUp:me,onMouseDown:ae,onMouseLeave:se,onMouseUp:oe,onDragLeave:ie,onTouchEnd:ue,onTouchMove:le,onTouchStart:ce,ref:xe,tabIndex:y?-1:V},ge,K),p,Se?i.createElement(M,Object(r.a)({ref:Y,center:f},H)):null)}));t.a=Object(d.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(z)},,,,,,,,,,,function(e,t,n){"use strict";var r=n(177),a=60103,i=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,s=60110,c=60112;t.Suspense=60113;var u=60115,l=60116;if("function"===typeof Symbol&&Symbol.for){var d=Symbol.for;a=d("react.element"),i=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),o=d("react.provider"),s=d("react.context"),c=d("react.forward_ref"),t.Suspense=d("react.suspense"),u=d("react.memo"),l=d("react.lazy")}var f="function"===typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b={};function m(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||h}function v(){}function g(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||h}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=m.prototype;var y=g.prototype=new v;y.constructor=g,r(y,m.prototype),y.isPureReactComponent=!0;var O={current:null},x=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function w(e,t,n){var r,i={},o=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)x.call(t,r)&&!k.hasOwnProperty(r)&&(i[r]=t[r]);var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){for(var u=Array(c),l=0;l<c;l++)u[l]=arguments[l+2];i.children=u}if(e&&e.defaultProps)for(r in c=e.defaultProps)void 0===i[r]&&(i[r]=c[r]);return{$$typeof:a,type:e,key:o,ref:s,props:i,_owner:O.current}}function j(e){return"object"===typeof e&&null!==e&&e.$$typeof===a}var S=/\/+/g;function N(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 I(e,t,n,r,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c=!1;if(null===e)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case a:case i:c=!0}}if(c)return o=o(c=e),e=""===r?"."+N(c,0):r,Array.isArray(o)?(n="",null!=e&&(n=e.replace(S,"$&/")+"/"),I(o,t,n,"",(function(e){return e}))):null!=o&&(j(o)&&(o=function(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(S,"$&/")+"/")+e)),t.push(o)),1;if(c=0,r=""===r?".":r+":",Array.isArray(e))for(var u=0;u<e.length;u++){var l=r+N(s=e[u],u);c+=I(s,t,n,l,o)}else if("function"===typeof(l=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e)))for(e=l.call(e),u=0;!(s=e.next()).done;)c+=I(s=s.value,t,n,l=r+N(s,u++),o);else if("object"===s)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return c}function C(e,t,n){if(null==e)return e;var r=[],a=0;return I(e,r,"","",(function(e){return t.call(n,e,a++)})),r}function T(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.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)}))}if(1===e._status)return e._result;throw e._result}var E={current:null};function A(){var e=E.current;if(null===e)throw Error(p(321));return e}var R={ReactCurrentDispatcher:E,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:O,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:C,forEach:function(e,t,n){C(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return C(e,(function(){t++})),t},toArray:function(e){return C(e,(function(e){return e}))||[]},only:function(e){if(!j(e))throw Error(p(143));return e}},t.Component=m,t.PureComponent=g,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(p(267,e));var i=r({},e.props),o=e.key,s=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,c=O.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(l in t)x.call(t,l)&&!k.hasOwnProperty(l)&&(i[l]=void 0===t[l]&&void 0!==u?u[l]:t[l])}var l=arguments.length-2;if(1===l)i.children=n;else if(1<l){u=Array(l);for(var d=0;d<l;d++)u[d]=arguments[d+2];i.children=u}return{$$typeof:a,type:e.type,key:o,ref:s,props:i,_owner:c}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=w,t.createFactory=function(e){var t=w.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=j,t.lazy=function(e){return{$$typeof:l,_payload:{_status:-1,_result:e},_init:T}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return A().useCallback(e,t)},t.useContext=function(e,t){return A().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return A().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return A().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return A().useLayoutEffect(e,t)},t.useMemo=function(e,t){return A().useMemo(e,t)},t.useReducer=function(e,t,n){return A().useReducer(e,t,n)},t.useRef=function(e){return A().useRef(e)},t.useState=function(e){return A().useState(e)},t.version="17.0.2"},function(e,t,n){"use strict";var r=n(4),a=n(177),i=n(326);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));var s=new Set,c={};function u(e,t){l(e,t),l(e+"Capture",t)}function l(e,t){for(c[e]=t,e=0;e<t.length;e++)s.add(t[e])}var d=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),f=/^[: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]*$/,p=Object.prototype.hasOwnProperty,h={},b={};function m(e,t,n,r,a,i,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){v[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];v[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){v[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){v[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){v[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){v[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){v[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){v[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){v[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var g=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function O(e,t,n,r){var a=v.hasOwnProperty(t)?v[t]:null;(null!==a?0===a.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,a,r)&&(n=null),r||null===a?function(e){return!!p.call(b,e)||!p.call(h,e)&&(f.test(e)?b[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=null===n?3!==a.type&&"":n:(t=a.attributeName,r=a.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(a=a.type)||4===a&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,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(g,y);v[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(g,y);v[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(g,y);v[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){v[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),v.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){v[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var x=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=60103,w=60106,j=60107,S=60108,N=60114,I=60109,C=60110,T=60112,E=60113,A=60120,R=60115,F=60116,D=60121,_=60128,M=60129,z=60130,L=60131;if("function"===typeof Symbol&&Symbol.for){var P=Symbol.for;k=P("react.element"),w=P("react.portal"),j=P("react.fragment"),S=P("react.strict_mode"),N=P("react.profiler"),I=P("react.provider"),C=P("react.context"),T=P("react.forward_ref"),E=P("react.suspense"),A=P("react.suspense_list"),R=P("react.memo"),F=P("react.lazy"),D=P("react.block"),P("react.scope"),_=P("react.opaque.id"),M=P("react.debug_trace_mode"),z=P("react.offscreen"),L=P("react.legacy_hidden")}var B,W="function"===typeof Symbol&&Symbol.iterator;function U(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=W&&e[W]||e["@@iterator"])?e:null}function V(e){if(void 0===B)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);B=t&&t[1]||""}return"\n"+B+e}var H=!1;function G(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"===typeof c.stack){for(var a=c.stack.split("\n"),i=r.stack.split("\n"),o=a.length-1,s=i.length-1;1<=o&&0<=s&&a[o]!==i[s];)s--;for(;1<=o&&0<=s;o--,s--)if(a[o]!==i[s]){if(1!==o||1!==s)do{if(o--,0>--s||a[o]!==i[s])return"\n"+a[o].replace(" at new "," at ")}while(1<=o&&0<=s);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?V(e):""}function q(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1);case 11:return e=G(e.type.render,!1);case 22:return e=G(e.type._render,!1);case 1:return e=G(e.type,!0);default:return""}}function K(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 j:return"Fragment";case w:return"Portal";case N:return"Profiler";case S:return"StrictMode";case E:return"Suspense";case A:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case I:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case R:return K(e.type);case D:return K(e._render);case F:t=e._payload,e=e._init;try{return K(e(t))}catch(n){}}return null}function X(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Y(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function $(e){e._valueTracker||(e._valueTracker=function(e){var t=Y(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 a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,i.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 Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Y(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Z(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 J(e,t){var n=t.checked;return a({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=X(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 te(e,t){null!=(t=t.checked)&&O(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=X(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")?ae(e,t.type,n):t.hasOwnProperty("defaultValue")&&ae(e,t.type,X(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(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._wrapperState.initialChecked,""!==n&&(e.name=n)}function ae(e,t,n){"number"===t&&Z(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ie(e,t){return e=a({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 oe(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+X(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ce(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:X(n)}}function ue(e,t){var n=X(t.value),r=X(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 le(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var de="http://www.w3.org/1999/xhtml",fe="http://www.w3.org/2000/svg";function pe(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 he(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?pe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var be,me,ve=(me=function(e,t){if(e.namespaceURI!==fe||"innerHTML"in e)e.innerHTML=t;else{for((be=be||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=be.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 me(e,t)}))}:me);function ge(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 ye={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},Oe=["Webkit","ms","Moz","O"];function xe(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||ye.hasOwnProperty(e)&&ye[e]?(""+t).trim():t+"px"}function ke(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=xe(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(ye).forEach((function(e){Oe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ye[t]=ye[e]}))}));var we=a({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 je(e,t){if(t){if(we[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(o(62))}}function Se(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 Ne(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ie=null,Ce=null,Te=null;function Ee(e){if(e=ea(e)){if("function"!==typeof Ie)throw Error(o(280));var t=e.stateNode;t&&(t=na(t),Ie(e.stateNode,e.type,t))}}function Ae(e){Ce?Te?Te.push(e):Te=[e]:Ce=e}function Re(){if(Ce){var e=Ce,t=Te;if(Te=Ce=null,Ee(e),t)for(e=0;e<t.length;e++)Ee(t[e])}}function Fe(e,t){return e(t)}function De(e,t,n,r,a){return e(t,n,r,a)}function _e(){}var Me=Fe,ze=!1,Le=!1;function Pe(){null===Ce&&null===Te||(_e(),Re())}function Be(e,t){var n=e.stateNode;if(null===n)return null;var r=na(n);if(null===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":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(o(231,t,typeof n));return n}var We=!1;if(d)try{var Ue={};Object.defineProperty(Ue,"passive",{get:function(){We=!0}}),window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,Ue)}catch(me){We=!1}function Ve(e,t,n,r,a,i,o,s,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(l){this.onError(l)}}var He=!1,Ge=null,qe=!1,Ke=null,Xe={onError:function(e){He=!0,Ge=e}};function Ye(e,t,n,r,a,i,o,s,c){He=!1,Ge=null,Ve.apply(Xe,arguments)}function $e(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Qe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ze(e){if($e(e)!==e)throw Error(o(188))}function Je(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=$e(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var i=a.alternate;if(null===i){if(null!==(r=a.return)){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return Ze(a),e;if(i===r)return Ze(a),t;i=i.sibling}throw Error(o(188))}if(n.return!==r.return)n=a,r=i;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,r=i;break}if(c===r){s=!0,r=a,n=i;break}c=c.sibling}if(!s){for(c=i.child;c;){if(c===n){s=!0,n=i,r=a;break}if(c===r){s=!0,r=i,n=a;break}c=c.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return 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}function et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,at,it=!1,ot=[],st=null,ct=null,ut=null,lt=new Map,dt=new Map,ft=[],pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ht(e,t,n,r,a){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:a,targetContainers:[r]}}function bt(e,t){switch(e){case"focusin":case"focusout":st=null;break;case"dragenter":case"dragleave":ct=null;break;case"mouseover":case"mouseout":ut=null;break;case"pointerover":case"pointerout":lt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dt.delete(t.pointerId)}}function mt(e,t,n,r,a,i){return null===e||e.nativeEvent!==i?(e=ht(t,n,r,a,i),null!==t&&(null!==(t=ea(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.push(a),e)}function vt(e){var t=Jr(e.target);if(null!==t){var n=$e(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Qe(n)))return e.blockedOn=t,void at(e.lanePriority,(function(){i.unstable_runWithPriority(e.priority,(function(){rt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function gt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ea(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function yt(e,t,n){gt(e)&&n.delete(t)}function Ot(){for(it=!1;0<ot.length;){var e=ot[0];if(null!==e.blockedOn){null!==(e=ea(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&ot.shift()}null!==st&&gt(st)&&(st=null),null!==ct&&gt(ct)&&(ct=null),null!==ut&&gt(ut)&&(ut=null),lt.forEach(yt),dt.forEach(yt)}function xt(e,t){e.blockedOn===t&&(e.blockedOn=null,it||(it=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Ot)))}function kt(e){function t(t){return xt(t,e)}if(0<ot.length){xt(ot[0],e);for(var n=1;n<ot.length;n++){var r=ot[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==st&&xt(st,e),null!==ct&&xt(ct,e),null!==ut&&xt(ut,e),lt.forEach(t),dt.forEach(t),n=0;n<ft.length;n++)(r=ft[n]).blockedOn===e&&(r.blockedOn=null);for(;0<ft.length&&null===(n=ft[0]).blockedOn;)vt(n),null===n.blockedOn&&ft.shift()}function wt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var jt={animationend:wt("Animation","AnimationEnd"),animationiteration:wt("Animation","AnimationIteration"),animationstart:wt("Animation","AnimationStart"),transitionend:wt("Transition","TransitionEnd")},St={},Nt={};function It(e){if(St[e])return St[e];if(!jt[e])return e;var t,n=jt[e];for(t in n)if(n.hasOwnProperty(t)&&t in Nt)return St[e]=n[t];return e}d&&(Nt=document.createElement("div").style,"AnimationEvent"in window||(delete jt.animationend.animation,delete jt.animationiteration.animation,delete jt.animationstart.animation),"TransitionEvent"in window||delete jt.transitionend.transition);var Ct=It("animationend"),Tt=It("animationiteration"),Et=It("animationstart"),At=It("transitionend"),Rt=new Map,Ft=new Map,Dt=["abort","abort",Ct,"animationEnd",Tt,"animationIteration",Et,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",At,"transitionEnd","waiting","waiting"];function _t(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1];a="on"+(a[0].toUpperCase()+a.slice(1)),Ft.set(r,t),Rt.set(r,a),u(a,[r])}}(0,i.unstable_now)();var Mt=8;function zt(e){if(0!==(1&e))return Mt=15,1;if(0!==(2&e))return Mt=14,2;if(0!==(4&e))return Mt=13,4;var t=24&e;return 0!==t?(Mt=12,t):0!==(32&e)?(Mt=11,32):0!==(t=192&e)?(Mt=10,t):0!==(256&e)?(Mt=9,256):0!==(t=3584&e)?(Mt=8,t):0!==(4096&e)?(Mt=7,4096):0!==(t=4186112&e)?(Mt=6,t):0!==(t=62914560&e)?(Mt=5,t):67108864&e?(Mt=4,67108864):0!==(134217728&e)?(Mt=3,134217728):0!==(t=805306368&e)?(Mt=2,t):0!==(1073741824&e)?(Mt=1,1073741824):(Mt=8,e)}function Lt(e,t){var n=e.pendingLanes;if(0===n)return Mt=0;var r=0,a=0,i=e.expiredLanes,o=e.suspendedLanes,s=e.pingedLanes;if(0!==i)r=i,a=Mt=15;else if(0!==(i=134217727&n)){var c=i&~o;0!==c?(r=zt(c),a=Mt):0!==(s&=i)&&(r=zt(s),a=Mt)}else 0!==(i=n&~o)?(r=zt(i),a=Mt):0!==s&&(r=zt(s),a=Mt);if(0===r)return 0;if(r=n&((0>(r=31-Ht(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0===(t&o)){if(zt(t),a<=Mt)return t;Mt=a}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)a=1<<(n=31-Ht(t)),r|=e[n],t&=~a;return r}function Pt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Bt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Wt(24&~t))?Bt(10,t):e;case 10:return 0===(e=Wt(192&~t))?Bt(8,t):e;case 8:return 0===(e=Wt(3584&~t))&&(0===(e=Wt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Wt(805306368&~t))&&(t=268435456),t}throw Error(o(358,e))}function Wt(e){return e&-e}function Ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Vt(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Ht(t)]=n}var Ht=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Gt(e)/qt|0)|0},Gt=Math.log,qt=Math.LN2;var Kt=i.unstable_UserBlockingPriority,Xt=i.unstable_runWithPriority,Yt=!0;function $t(e,t,n,r){ze||_e();var a=Zt,i=ze;ze=!0;try{De(a,e,t,n,r)}finally{(ze=i)||Pe()}}function Qt(e,t,n,r){Xt(Kt,Zt.bind(null,e,t,n,r))}function Zt(e,t,n,r){var a;if(Yt)if((a=0===(4&t))&&0<ot.length&&-1<pt.indexOf(e))e=ht(null,e,t,n,r),ot.push(e);else{var i=Jt(e,t,n,r);if(null===i)a&&bt(e,r);else{if(a){if(-1<pt.indexOf(e))return e=ht(i,e,t,n,r),void ot.push(e);if(function(e,t,n,r,a){switch(t){case"focusin":return st=mt(st,e,t,n,r,a),!0;case"dragenter":return ct=mt(ct,e,t,n,r,a),!0;case"mouseover":return ut=mt(ut,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return lt.set(i,mt(lt.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,dt.set(i,mt(dt.get(i)||null,e,t,n,r,a)),!0}return!1}(i,e,t,n,r))return;bt(e,r)}Rr(e,t,r,null,n)}}}function Jt(e,t,n,r){var a=Ne(r);if(null!==(a=Jr(a))){var i=$e(a);if(null===i)a=null;else{var o=i.tag;if(13===o){if(null!==(a=Qe(i)))return a;a=null}else if(3===o){if(i.stateNode.hydrate)return 3===i.tag?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return Rr(e,t,r,a,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,a="value"in en?en.value:en.textContent,i=a.length;for(e=0;e<r&&n[e]===a[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===a[i-t];t++);return nn=a.slice(e,1<t?1-t:void 0)}function an(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}function on(){return!0}function sn(){return!1}function cn(e){function t(t,n,r,a,i){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(a):a[o]);return this.isDefaultPrevented=(null!=a.defaultPrevented?a.defaultPrevented:!1===a.returnValue)?on:sn,this.isPropagationStopped=sn,this}return a(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=on)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=on)},persist:function(){},isPersistent:on}),t}var un,ln,dn,fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=cn(fn),hn=a({},fn,{view:0,detail:0}),bn=cn(hn),mn=a({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:In,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==dn&&(dn&&"mousemove"===e.type?(un=e.screenX-dn.screenX,ln=e.screenY-dn.screenY):ln=un=0,dn=e),un)},movementY:function(e){return"movementY"in e?e.movementY:ln}}),vn=cn(mn),gn=cn(a({},mn,{dataTransfer:0})),yn=cn(a({},hn,{relatedTarget:0})),On=cn(a({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),xn=cn(a({},fn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),kn=cn(a({},fn,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jn={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"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function In(){return Nn}var Cn=cn(a({},hn,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=an(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?jn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:In,charCode:function(e){return"keypress"===e.type?an(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?an(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),Tn=cn(a({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),En=cn(a({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:In})),An=cn(a({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=cn(a({},mn,{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:0,deltaMode:0})),Fn=[9,13,27,32],Dn=d&&"CompositionEvent"in window,_n=null;d&&"documentMode"in document&&(_n=document.documentMode);var Mn=d&&"TextEvent"in window&&!_n,zn=d&&(!Dn||_n&&8<_n&&11>=_n),Ln=String.fromCharCode(32),Pn=!1;function Bn(e,t){switch(e){case"keyup":return-1!==Fn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Un=!1;var Vn={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 Hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vn[e.type]:"textarea"===t}function Gn(e,t,n,r){Ae(r),0<(t=Dr(t,"onChange")).length&&(n=new pn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var qn=null,Kn=null;function Xn(e){Nr(e,0)}function Yn(e){if(Q(ta(e)))return e}function $n(e,t){if("change"===e)return t}var Qn=!1;if(d){var Zn;if(d){var Jn="oninput"in document;if(!Jn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Jn="function"===typeof er.oninput}Zn=Jn}else Zn=!1;Qn=Zn&&(!document.documentMode||9<document.documentMode)}function tr(){qn&&(qn.detachEvent("onpropertychange",nr),Kn=qn=null)}function nr(e){if("value"===e.propertyName&&Yn(Kn)){var t=[];if(Gn(t,Kn,e,Ne(e)),e=Xn,ze)e(t);else{ze=!0;try{Fe(e,t)}finally{ze=!1,Pe()}}}}function rr(e,t,n){"focusin"===e?(tr(),Kn=n,(qn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function ar(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yn(Kn)}function ir(e,t){if("click"===e)return Yn(t)}function or(e,t){if("input"===e||"change"===e)return Yn(t)}var sr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},cr=Object.prototype.hasOwnProperty;function ur(e,t){if(sr(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(!cr.call(t,n[r])||!sr(e[n[r]],t[n[r]]))return!1;return!0}function lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dr(e,t){var n,r=lr(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=lr(r)}}function fr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function pr(){for(var e=window,t=Z();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Z((e=t.contentWindow).document)}return t}function hr(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)}var br=d&&"documentMode"in document&&11>=document.documentMode,mr=null,vr=null,gr=null,yr=!1;function Or(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;yr||null==mr||mr!==Z(r)||("selectionStart"in(r=mr)&&hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},gr&&ur(gr,r)||(gr=r,0<(r=Dr(vr,"onSelect")).length&&(t=new pn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=mr)))}_t("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur 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".split(" "),0),_t("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),_t(Dt,2);for(var xr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),kr=0;kr<xr.length;kr++)Ft.set(xr[kr],0);l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),jr=new Set("cancel close invalid load scroll toggle".split(" ").concat(wr));function Sr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,a,i,s,c,u){if(Ye.apply(this,arguments),He){if(!He)throw Error(o(198));var l=Ge;He=!1,Ge=null,qe||(qe=!0,Ke=l)}}(r,t,void 0,e),e.currentTarget=null}function Nr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,u=s.currentTarget;if(s=s.listener,c!==i&&a.isPropagationStopped())break e;Sr(a,s,u),i=c}else for(o=0;o<r.length;o++){if(c=(s=r[o]).instance,u=s.currentTarget,s=s.listener,c!==i&&a.isPropagationStopped())break e;Sr(a,s,u),i=c}}}if(qe)throw e=Ke,qe=!1,Ke=null,e}function Ir(e,t){var n=ra(t),r=e+"__bubble";n.has(r)||(Ar(t,e,2,!1),n.add(r))}var Cr="_reactListening"+Math.random().toString(36).slice(2);function Tr(e){e[Cr]||(e[Cr]=!0,s.forEach((function(t){jr.has(t)||Er(t,!1,e,null),Er(t,!0,e,null)})))}function Er(e,t,n,r){var a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,i=n;if("selectionchange"===e&&9!==n.nodeType&&(i=n.ownerDocument),null!==r&&!t&&jr.has(e)){if("scroll"!==e)return;a|=2,i=r}var o=ra(i),s=e+"__"+(t?"capture":"bubble");o.has(s)||(t&&(a|=4),Ar(i,e,a,t),o.add(s))}function Ar(e,t,n,r){var a=Ft.get(t);switch(void 0===a?2:a){case 0:a=$t;break;case 1:a=Qt;break;default:a=Zt}n=a.bind(null,t,n,e),a=void 0,!We||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(a=!0),r?void 0!==a?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):void 0!==a?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Rr(e,t,n,r,a){var i=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var s=r.stateNode.containerInfo;if(s===a||8===s.nodeType&&s.parentNode===a)break;if(4===o)for(o=r.return;null!==o;){var c=o.tag;if((3===c||4===c)&&((c=o.stateNode.containerInfo)===a||8===c.nodeType&&c.parentNode===a))return;o=o.return}for(;null!==s;){if(null===(o=Jr(s)))return;if(5===(c=o.tag)||6===c){r=i=o;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if(Le)return e(t,n);Le=!0;try{Me(e,t,n)}finally{Le=!1,Pe()}}((function(){var r=i,a=Ne(n),o=[];e:{var s=Rt.get(e);if(void 0!==s){var c=pn,u=e;switch(e){case"keypress":if(0===an(n))break e;case"keydown":case"keyup":c=Cn;break;case"focusin":u="focus",c=yn;break;case"focusout":u="blur",c=yn;break;case"beforeblur":case"afterblur":c=yn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=vn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=gn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=En;break;case Ct:case Tt:case Et:c=On;break;case At:c=An;break;case"scroll":c=bn;break;case"wheel":c=Rn;break;case"copy":case"cut":case"paste":c=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=Tn}var l=0!==(4&t),d=!l&&"scroll"===e,f=l?null!==s?s+"Capture":null:s;l=[];for(var p,h=r;null!==h;){var b=(p=h).stateNode;if(5===p.tag&&null!==b&&(p=b,null!==f&&(null!=(b=Be(h,f))&&l.push(Fr(h,b,p)))),d)break;h=h.return}0<l.length&&(s=new c(s,u,null,n,a),o.push({event:s,listeners:l}))}}if(0===(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||0!==(16&t)||!(u=n.relatedTarget||n.fromElement)||!Jr(u)&&!u[Qr])&&(c||s)&&(s=a.window===a?a:(s=a.ownerDocument)?s.defaultView||s.parentWindow:window,c?(c=r,null!==(u=(u=n.relatedTarget||n.toElement)?Jr(u):null)&&(u!==(d=$e(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(c=null,u=r),c!==u)){if(l=vn,b="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(l=Tn,b="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==c?s:ta(c),p=null==u?s:ta(u),(s=new l(b,h+"leave",c,n,a)).target=d,s.relatedTarget=p,b=null,Jr(a)===r&&((l=new l(f,h+"enter",u,n,a)).target=p,l.relatedTarget=d,b=l),d=b,c&&u)e:{for(f=u,h=0,p=l=c;p;p=_r(p))h++;for(p=0,b=f;b;b=_r(b))p++;for(;0<h-p;)l=_r(l),h--;for(;0<p-h;)f=_r(f),p--;for(;h--;){if(l===f||null!==f&&l===f.alternate)break e;l=_r(l),f=_r(f)}l=null}else l=null;null!==c&&Mr(o,s,c,l,!1),null!==u&&null!==d&&Mr(o,d,u,l,!0)}if("select"===(c=(s=r?ta(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===c&&"file"===s.type)var m=$n;else if(Hn(s))if(Qn)m=or;else{m=ar;var v=rr}else(c=s.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=ir);switch(m&&(m=m(e,r))?Gn(o,m,n,a):(v&&v(e,s,r),"focusout"===e&&(v=s._wrapperState)&&v.controlled&&"number"===s.type&&ae(s,"number",s.value)),v=r?ta(r):window,e){case"focusin":(Hn(v)||"true"===v.contentEditable)&&(mr=v,vr=r,gr=null);break;case"focusout":gr=vr=mr=null;break;case"mousedown":yr=!0;break;case"contextmenu":case"mouseup":case"dragend":yr=!1,Or(o,n,a);break;case"selectionchange":if(br)break;case"keydown":case"keyup":Or(o,n,a)}var g;if(Dn)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else Un?Bn(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(zn&&"ko"!==n.locale&&(Un||"onCompositionStart"!==y?"onCompositionEnd"===y&&Un&&(g=rn()):(tn="value"in(en=a)?en.value:en.textContent,Un=!0)),0<(v=Dr(r,y)).length&&(y=new kn(y,e,null,n,a),o.push({event:y,listeners:v}),g?y.data=g:null!==(g=Wn(n))&&(y.data=g))),(g=Mn?function(e,t){switch(e){case"compositionend":return Wn(t);case"keypress":return 32!==t.which?null:(Pn=!0,Ln);case"textInput":return(e=t.data)===Ln&&Pn?null:e;default:return null}}(e,n):function(e,t){if(Un)return"compositionend"===e||!Dn&&Bn(e,t)?(e=rn(),nn=tn=en=null,Un=!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 zn&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))&&(0<(r=Dr(r,"onBeforeInput")).length&&(a=new kn("onBeforeInput","beforeinput",null,n,a),o.push({event:a,listeners:r}),a.data=g))}Nr(o,t)}))}function Fr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dr(e,t){for(var n=t+"Capture",r=[];null!==e;){var a=e,i=a.stateNode;5===a.tag&&null!==i&&(a=i,null!=(i=Be(e,n))&&r.unshift(Fr(e,i,a)),null!=(i=Be(e,t))&&r.push(Fr(e,i,a))),e=e.return}return r}function _r(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Mr(e,t,n,r,a){for(var i=t._reactName,o=[];null!==n&&n!==r;){var s=n,c=s.alternate,u=s.stateNode;if(null!==c&&c===r)break;5===s.tag&&null!==u&&(s=u,a?null!=(c=Be(n,i))&&o.unshift(Fr(n,c,s)):a||null!=(c=Be(n,i))&&o.push(Fr(n,c,s))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}function zr(){}var Lr=null,Pr=null;function Br(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Wr(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 Ur="function"===typeof setTimeout?setTimeout:void 0,Vr="function"===typeof clearTimeout?clearTimeout:void 0;function Hr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Gr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function qr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Kr=0;var Xr=Math.random().toString(36).slice(2),Yr="__reactFiber$"+Xr,$r="__reactProps$"+Xr,Qr="__reactContainer$"+Xr,Zr="__reactEvents$"+Xr;function Jr(e){var t=e[Yr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qr]||n[Yr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=qr(e);null!==e;){if(n=e[Yr])return n;e=qr(e)}return t}n=(e=n).parentNode}return null}function ea(e){return!(e=e[Yr]||e[Qr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ta(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function na(e){return e[$r]||null}function ra(e){var t=e[Zr];return void 0===t&&(t=e[Zr]=new Set),t}var aa=[],ia=-1;function oa(e){return{current:e}}function sa(e){0>ia||(e.current=aa[ia],aa[ia]=null,ia--)}function ca(e,t){ia++,aa[ia]=e.current,e.current=t}var ua={},la=oa(ua),da=oa(!1),fa=ua;function pa(e,t){var n=e.type.contextTypes;if(!n)return ua;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,i={};for(a in n)i[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ha(e){return null!==(e=e.childContextTypes)&&void 0!==e}function ba(){sa(da),sa(la)}function ma(e,t,n){if(la.current!==ua)throw Error(o(168));ca(la,t),ca(da,n)}function va(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(o(108,K(t)||"Unknown",i));return a({},n,r)}function ga(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ua,fa=la.current,ca(la,e),ca(da,da.current),!0}function ya(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=va(e,t,fa),r.__reactInternalMemoizedMergedChildContext=e,sa(da),sa(la),ca(la,e)):sa(da),ca(da,n)}var Oa=null,xa=null,ka=i.unstable_runWithPriority,wa=i.unstable_scheduleCallback,ja=i.unstable_cancelCallback,Sa=i.unstable_shouldYield,Na=i.unstable_requestPaint,Ia=i.unstable_now,Ca=i.unstable_getCurrentPriorityLevel,Ta=i.unstable_ImmediatePriority,Ea=i.unstable_UserBlockingPriority,Aa=i.unstable_NormalPriority,Ra=i.unstable_LowPriority,Fa=i.unstable_IdlePriority,Da={},_a=void 0!==Na?Na:function(){},Ma=null,za=null,La=!1,Pa=Ia(),Ba=1e4>Pa?Ia:function(){return Ia()-Pa};function Wa(){switch(Ca()){case Ta:return 99;case Ea:return 98;case Aa:return 97;case Ra:return 96;case Fa:return 95;default:throw Error(o(332))}}function Ua(e){switch(e){case 99:return Ta;case 98:return Ea;case 97:return Aa;case 96:return Ra;case 95:return Fa;default:throw Error(o(332))}}function Va(e,t){return e=Ua(e),ka(e,t)}function Ha(e,t,n){return e=Ua(e),wa(e,t,n)}function Ga(){if(null!==za){var e=za;za=null,ja(e)}qa()}function qa(){if(!La&&null!==Ma){La=!0;var e=0;try{var t=Ma;Va(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ma=null}catch(n){throw null!==Ma&&(Ma=Ma.slice(e+1)),wa(Ta,Ga),n}finally{La=!1}}}var Ka=x.ReactCurrentBatchConfig;function Xa(e,t){if(e&&e.defaultProps){for(var n in t=a({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Ya=oa(null),$a=null,Qa=null,Za=null;function Ja(){Za=Qa=$a=null}function ei(e){var t=Ya.current;sa(Ya),e.type._context._currentValue=t}function ti(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function ni(e,t){$a=e,Za=Qa=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Do=!0),e.firstContext=null)}function ri(e,t){if(Za!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(Za=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Qa){if(null===$a)throw Error(o(308));Qa=t,$a.dependencies={lanes:0,firstContext:t,responders:null}}else Qa=Qa.next=t;return e._currentValue}var ai=!1;function ii(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function oi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function si(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ci(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function ui(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var a=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?a=i=o:i=i.next=o,n=n.next}while(null!==n);null===i?a=i=t:i=i.next=t}else a=i=t;return n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function li(e,t,n,r){var i=e.updateQueue;ai=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,c=i.shared.pending;if(null!==c){i.shared.pending=null;var u=c,l=u.next;u.next=null,null===s?o=l:s.next=l,s=u;var d=e.alternate;if(null!==d){var f=(d=d.updateQueue).lastBaseUpdate;f!==s&&(null===f?d.firstBaseUpdate=l:f.next=l,d.lastBaseUpdate=u)}}if(null!==o){for(f=i.baseState,s=0,d=l=u=null;;){c=o.lane;var p=o.eventTime;if((r&c)===c){null!==d&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var h=e,b=o;switch(c=t,p=n,b.tag){case 1:if("function"===typeof(h=b.payload)){f=h.call(p,f,c);break e}f=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null===(c="function"===typeof(h=b.payload)?h.call(p,f,c):h)||void 0===c)break e;f=a({},f,c);break e;case 2:ai=!0}}null!==o.callback&&(e.flags|=32,null===(c=i.effects)?i.effects=[o]:c.push(o))}else p={eventTime:p,lane:c,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===d?(l=d=p,u=f):d=d.next=p,s|=c;if(null===(o=o.next)){if(null===(c=i.shared.pending))break;o=c.next,c.next=null,i.lastBaseUpdate=c,i.shared.pending=null}}null===d&&(u=f),i.baseState=u,i.firstBaseUpdate=l,i.lastBaseUpdate=d,Ls|=s,e.lanes=s,e.memoizedState=f}}function di(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(null!==a){if(r.callback=null,r=n,"function"!==typeof a)throw Error(o(191,a));a.call(r)}}}var fi=(new r.Component).refs;function pi(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:a({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var hi={isMounted:function(e){return!!(e=e._reactInternals)&&$e(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=uc(),a=lc(e),i=si(r,a);i.payload=t,void 0!==n&&null!==n&&(i.callback=n),ci(e,i),dc(e,a,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=uc(),a=lc(e),i=si(r,a);i.tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),ci(e,i),dc(e,a,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=uc(),r=lc(e),a=si(n,r);a.tag=2,void 0!==t&&null!==t&&(a.callback=t),ci(e,a),dc(e,r,n)}};function bi(e,t,n,r,a,i,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,o):!t.prototype||!t.prototype.isPureReactComponent||(!ur(n,r)||!ur(a,i))}function mi(e,t,n){var r=!1,a=ua,i=t.contextType;return"object"===typeof i&&null!==i?i=ri(i):(a=ha(t)?fa:la.current,i=(r=null!==(r=t.contextTypes)&&void 0!==r)?pa(e,a):ua),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=hi,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function vi(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&&hi.enqueueReplaceState(t,t.state,null)}function gi(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs=fi,ii(e);var i=t.contextType;"object"===typeof i&&null!==i?a.context=ri(i):(i=ha(t)?fa:la.current,a.context=pa(e,i)),li(e,n,a,r),a.state=e.memoizedState,"function"===typeof(i=t.getDerivedStateFromProps)&&(pi(e,t,i,n),a.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof a.getSnapshotBeforeUpdate||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||(t=a.state,"function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),t!==a.state&&hi.enqueueReplaceState(a,a.state,null),li(e,n,a,r),a.state=e.memoizedState),"function"===typeof a.componentDidMount&&(e.flags|=4)}var yi=Array.isArray;function Oi(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var a=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===a?t.ref:((t=function(e){var t=r.refs;t===fi&&(t=r.refs={}),null===e?delete t[a]:t[a]=e})._stringRef=a,t)}if("string"!==typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function xi(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function ki(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.flags=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 a(e,t){return(e=Vc(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function c(e,t,n,r){return null===t||6!==t.tag?((t=Kc(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function u(e,t,n,r){return null!==t&&t.elementType===n.type?((r=a(t,n.props)).ref=Oi(e,t,n),r.return=e,r):((r=Hc(n.type,n.key,n.props,null,e.mode,r)).ref=Oi(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=Xc(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,r,i){return null===t||7!==t.tag?((t=Gc(n,e.mode,r,i)).return=e,t):((t=a(t,n)).return=e,t)}function f(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=Kc(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case k:return(n=Hc(t.type,t.key,t.props,null,e.mode,n)).ref=Oi(e,null,t),n.return=e,n;case w:return(t=Xc(t,e.mode,n)).return=e,t}if(yi(t)||U(t))return(t=Gc(t,e.mode,n,null)).return=e,t;xi(e,t)}return null}function p(e,t,n,r){var a=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==a?null:c(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case k:return n.key===a?n.type===j?d(e,t,n.props.children,r,a):u(e,t,n,r):null;case w:return n.key===a?l(e,t,n,r):null}if(yi(n)||U(n))return null!==a?null:d(e,t,n,r,null);xi(e,n)}return null}function h(e,t,n,r,a){if("string"===typeof r||"number"===typeof r)return c(t,e=e.get(n)||null,""+r,a);if("object"===typeof r&&null!==r){switch(r.$$typeof){case k:return e=e.get(null===r.key?n:r.key)||null,r.type===j?d(t,e,r.props.children,a,r.key):u(t,e,r,a);case w:return l(t,e=e.get(null===r.key?n:r.key)||null,r,a)}if(yi(r)||U(r))return d(t,e=e.get(n)||null,r,a,null);xi(t,r)}return null}function b(a,o,s,c){for(var u=null,l=null,d=o,b=o=0,m=null;null!==d&&b<s.length;b++){d.index>b?(m=d,d=null):m=d.sibling;var v=p(a,d,s[b],c);if(null===v){null===d&&(d=m);break}e&&d&&null===v.alternate&&t(a,d),o=i(v,o,b),null===l?u=v:l.sibling=v,l=v,d=m}if(b===s.length)return n(a,d),u;if(null===d){for(;b<s.length;b++)null!==(d=f(a,s[b],c))&&(o=i(d,o,b),null===l?u=d:l.sibling=d,l=d);return u}for(d=r(a,d);b<s.length;b++)null!==(m=h(d,a,b,s[b],c))&&(e&&null!==m.alternate&&d.delete(null===m.key?b:m.key),o=i(m,o,b),null===l?u=m:l.sibling=m,l=m);return e&&d.forEach((function(e){return t(a,e)})),u}function m(a,s,c,u){var l=U(c);if("function"!==typeof l)throw Error(o(150));if(null==(c=l.call(c)))throw Error(o(151));for(var d=l=null,b=s,m=s=0,v=null,g=c.next();null!==b&&!g.done;m++,g=c.next()){b.index>m?(v=b,b=null):v=b.sibling;var y=p(a,b,g.value,u);if(null===y){null===b&&(b=v);break}e&&b&&null===y.alternate&&t(a,b),s=i(y,s,m),null===d?l=y:d.sibling=y,d=y,b=v}if(g.done)return n(a,b),l;if(null===b){for(;!g.done;m++,g=c.next())null!==(g=f(a,g.value,u))&&(s=i(g,s,m),null===d?l=g:d.sibling=g,d=g);return l}for(b=r(a,b);!g.done;m++,g=c.next())null!==(g=h(b,a,m,g.value,u))&&(e&&null!==g.alternate&&b.delete(null===g.key?m:g.key),s=i(g,s,m),null===d?l=g:d.sibling=g,d=g);return e&&b.forEach((function(e){return t(a,e)})),l}return function(e,r,i,c){var u="object"===typeof i&&null!==i&&i.type===j&&null===i.key;u&&(i=i.props.children);var l="object"===typeof i&&null!==i;if(l)switch(i.$$typeof){case k:e:{for(l=i.key,u=r;null!==u;){if(u.key===l){switch(u.tag){case 7:if(i.type===j){n(e,u.sibling),(r=a(u,i.props.children)).return=e,e=r;break e}break;default:if(u.elementType===i.type){n(e,u.sibling),(r=a(u,i.props)).ref=Oi(e,u,i),r.return=e,e=r;break e}}n(e,u);break}t(e,u),u=u.sibling}i.type===j?((r=Gc(i.props.children,e.mode,c,i.key)).return=e,e=r):((c=Hc(i.type,i.key,i.props,null,e.mode,c)).ref=Oi(e,r,i),c.return=e,e=c)}return s(e);case w:e:{for(u=i.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),(r=a(r,i.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Xc(i,e.mode,c)).return=e,e=r}return s(e)}if("string"===typeof i||"number"===typeof i)return i=""+i,null!==r&&6===r.tag?(n(e,r.sibling),(r=a(r,i)).return=e,e=r):(n(e,r),(r=Kc(i,e.mode,c)).return=e,e=r),s(e);if(yi(i))return b(e,r,i,c);if(U(i))return m(e,r,i,c);if(l&&xi(e,i),"undefined"===typeof i&&!u)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(o(152,K(e.type)||"Component"))}return n(e,r)}}var wi=ki(!0),ji=ki(!1),Si={},Ni=oa(Si),Ii=oa(Si),Ci=oa(Si);function Ti(e){if(e===Si)throw Error(o(174));return e}function Ei(e,t){switch(ca(Ci,t),ca(Ii,e),ca(Ni,Si),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:he(null,"");break;default:t=he(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}sa(Ni),ca(Ni,t)}function Ai(){sa(Ni),sa(Ii),sa(Ci)}function Ri(e){Ti(Ci.current);var t=Ti(Ni.current),n=he(t,e.type);t!==n&&(ca(Ii,e),ca(Ni,n))}function Fi(e){Ii.current===e&&(sa(Ni),sa(Ii))}var Di=oa(0);function _i(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.flags))return t}else if(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 null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mi=null,zi=null,Li=!1;function Pi(e,t){var n=Wc(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Bi(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 Wi(e){if(Li){var t=zi;if(t){var n=t;if(!Bi(e,t)){if(!(t=Gr(n.nextSibling))||!Bi(e,t))return e.flags=-1025&e.flags|2,Li=!1,void(Mi=e);Pi(Mi,n)}Mi=e,zi=Gr(t.firstChild)}else e.flags=-1025&e.flags|2,Li=!1,Mi=e}}function Ui(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Mi=e}function Vi(e){if(e!==Mi)return!1;if(!Li)return Ui(e),Li=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Wr(t,e.memoizedProps))for(t=zi;t;)Pi(e,t),t=Gr(t.nextSibling);if(Ui(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){zi=Gr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}zi=null}}else zi=Mi?Gr(e.stateNode.nextSibling):null;return!0}function Hi(){zi=Mi=null,Li=!1}var Gi=[];function qi(){for(var e=0;e<Gi.length;e++)Gi[e]._workInProgressVersionPrimary=null;Gi.length=0}var Ki=x.ReactCurrentDispatcher,Xi=x.ReactCurrentBatchConfig,Yi=0,$i=null,Qi=null,Zi=null,Ji=!1,eo=!1;function to(){throw Error(o(321))}function no(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function ro(e,t,n,r,a,i){if(Yi=i,$i=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ki.current=null===e||null===e.memoizedState?Eo:Ao,e=n(r,a),eo){i=0;do{if(eo=!1,!(25>i))throw Error(o(301));i+=1,Zi=Qi=null,t.updateQueue=null,Ki.current=Ro,e=n(r,a)}while(eo)}if(Ki.current=To,t=null!==Qi&&null!==Qi.next,Yi=0,Zi=Qi=$i=null,Ji=!1,t)throw Error(o(300));return e}function ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Zi?$i.memoizedState=Zi=e:Zi=Zi.next=e,Zi}function io(){if(null===Qi){var e=$i.alternate;e=null!==e?e.memoizedState:null}else e=Qi.next;var t=null===Zi?$i.memoizedState:Zi.next;if(null!==t)Zi=t,Qi=e;else{if(null===e)throw Error(o(310));e={memoizedState:(Qi=e).memoizedState,baseState:Qi.baseState,baseQueue:Qi.baseQueue,queue:Qi.queue,next:null},null===Zi?$i.memoizedState=Zi=e:Zi=Zi.next=e}return Zi}function oo(e,t){return"function"===typeof t?t(e):t}function so(e){var t=io(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=Qi,a=r.baseQueue,i=n.pending;if(null!==i){if(null!==a){var s=a.next;a.next=i.next,i.next=s}r.baseQueue=a=i,n.pending=null}if(null!==a){a=a.next,r=r.baseState;var c=s=i=null,u=a;do{var l=u.lane;if((Yi&l)===l)null!==c&&(c=c.next={lane:0,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),r=u.eagerReducer===e?u.eagerState:e(r,u.action);else{var d={lane:l,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null};null===c?(s=c=d,i=r):c=c.next=d,$i.lanes|=l,Ls|=l}u=u.next}while(null!==u&&u!==a);null===c?i=r:c.next=s,sr(r,t.memoizedState)||(Do=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=c,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function co(e){var t=io(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(null!==a){n.pending=null;var s=a=a.next;do{i=e(i,s.action),s=s.next}while(s!==a);sr(i,t.memoizedState)||(Do=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function uo(e,t,n){var r=t._getVersion;r=r(t._source);var a=t._workInProgressVersionPrimary;if(null!==a?e=a===r:(e=e.mutableReadLanes,(e=(Yi&e)===e)&&(t._workInProgressVersionPrimary=r,Gi.push(t))),e)return n(t._source);throw Gi.push(t),Error(o(350))}function lo(e,t,n,r){var a=Es;if(null===a)throw Error(o(349));var i=t._getVersion,s=i(t._source),c=Ki.current,u=c.useState((function(){return uo(a,t,n)})),l=u[1],d=u[0];u=Zi;var f=e.memoizedState,p=f.refs,h=p.getSnapshot,b=f.source;f=f.subscribe;var m=$i;return e.memoizedState={refs:p,source:t,subscribe:r},c.useEffect((function(){p.getSnapshot=n,p.setSnapshot=l;var e=i(t._source);if(!sr(s,e)){e=n(t._source),sr(d,e)||(l(e),e=lc(m),a.mutableReadLanes|=e&a.pendingLanes),e=a.mutableReadLanes,a.entangledLanes|=e;for(var r=a.entanglements,o=e;0<o;){var c=31-Ht(o),u=1<<c;r[c]|=e,o&=~u}}}),[n,t,r]),c.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=lc(m);a.mutableReadLanes|=r&a.pendingLanes}catch(i){n((function(){throw i}))}}))}),[t,r]),sr(h,n)&&sr(b,t)&&sr(f,r)||((e={pending:null,dispatch:null,lastRenderedReducer:oo,lastRenderedState:d}).dispatch=l=Co.bind(null,$i,e),u.queue=e,u.baseQueue=null,d=uo(a,t,n),u.memoizedState=u.baseState=d),d}function fo(e,t,n){return lo(io(),e,t,n)}function po(e){var t=ao();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:oo,lastRenderedState:e}).dispatch=Co.bind(null,$i,e),[t.memoizedState,e]}function ho(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=$i.updateQueue)?(t={lastEffect:null},$i.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function bo(e){return e={current:e},ao().memoizedState=e}function mo(){return io().memoizedState}function vo(e,t,n,r){var a=ao();$i.flags|=e,a.memoizedState=ho(1|t,n,void 0,void 0===r?null:r)}function go(e,t,n,r){var a=io();r=void 0===r?null:r;var i=void 0;if(null!==Qi){var o=Qi.memoizedState;if(i=o.destroy,null!==r&&no(r,o.deps))return void ho(t,n,i,r)}$i.flags|=e,a.memoizedState=ho(1|t,n,i,r)}function yo(e,t){return vo(516,4,e,t)}function Oo(e,t){return go(516,4,e,t)}function xo(e,t){return go(4,2,e,t)}function ko(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 wo(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,go(4,2,ko.bind(null,t,e),n)}function jo(){}function So(e,t){var n=io();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&no(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function No(e,t){var n=io();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&no(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Io(e,t){var n=Wa();Va(98>n?98:n,(function(){e(!0)})),Va(97<n?97:n,(function(){var n=Xi.transition;Xi.transition=1;try{e(!1),t()}finally{Xi.transition=n}}))}function Co(e,t,n){var r=uc(),a=lc(e),i={lane:a,action:n,eagerReducer:null,eagerState:null,next:null},o=t.pending;if(null===o?i.next=i:(i.next=o.next,o.next=i),t.pending=i,o=e.alternate,e===$i||null!==o&&o===$i)eo=Ji=!0;else{if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,c=o(s,n);if(i.eagerReducer=o,i.eagerState=c,sr(c,s))return}catch(u){}dc(e,a,r)}}var To={readContext:ri,useCallback:to,useContext:to,useEffect:to,useImperativeHandle:to,useLayoutEffect:to,useMemo:to,useReducer:to,useRef:to,useState:to,useDebugValue:to,useDeferredValue:to,useTransition:to,useMutableSource:to,useOpaqueIdentifier:to,unstable_isNewReconciler:!1},Eo={readContext:ri,useCallback:function(e,t){return ao().memoizedState=[e,void 0===t?null:t],e},useContext:ri,useEffect:yo,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,vo(4,2,ko.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vo(4,2,e,t)},useMemo:function(e,t){var n=ao();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ao();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Co.bind(null,$i,e),[r.memoizedState,e]},useRef:bo,useState:po,useDebugValue:jo,useDeferredValue:function(e){var t=po(e),n=t[0],r=t[1];return yo((function(){var t=Xi.transition;Xi.transition=1;try{r(e)}finally{Xi.transition=t}}),[e]),n},useTransition:function(){var e=po(!1),t=e[0];return bo(e=Io.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=ao();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},lo(r,e,t,n)},useOpaqueIdentifier:function(){if(Li){var e=!1,t=function(e){return{$$typeof:_,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Kr++).toString(36))),Error(o(355))})),n=po(t)[1];return 0===(2&$i.mode)&&($i.flags|=516,ho(5,(function(){n("r:"+(Kr++).toString(36))}),void 0,null)),t}return po(t="r:"+(Kr++).toString(36)),t},unstable_isNewReconciler:!1},Ao={readContext:ri,useCallback:So,useContext:ri,useEffect:Oo,useImperativeHandle:wo,useLayoutEffect:xo,useMemo:No,useReducer:so,useRef:mo,useState:function(){return so(oo)},useDebugValue:jo,useDeferredValue:function(e){var t=so(oo),n=t[0],r=t[1];return Oo((function(){var t=Xi.transition;Xi.transition=1;try{r(e)}finally{Xi.transition=t}}),[e]),n},useTransition:function(){var e=so(oo)[0];return[mo().current,e]},useMutableSource:fo,useOpaqueIdentifier:function(){return so(oo)[0]},unstable_isNewReconciler:!1},Ro={readContext:ri,useCallback:So,useContext:ri,useEffect:Oo,useImperativeHandle:wo,useLayoutEffect:xo,useMemo:No,useReducer:co,useRef:mo,useState:function(){return co(oo)},useDebugValue:jo,useDeferredValue:function(e){var t=co(oo),n=t[0],r=t[1];return Oo((function(){var t=Xi.transition;Xi.transition=1;try{r(e)}finally{Xi.transition=t}}),[e]),n},useTransition:function(){var e=co(oo)[0];return[mo().current,e]},useMutableSource:fo,useOpaqueIdentifier:function(){return co(oo)[0]},unstable_isNewReconciler:!1},Fo=x.ReactCurrentOwner,Do=!1;function _o(e,t,n,r){t.child=null===e?ji(t,null,n,r):wi(t,e.child,n,r)}function Mo(e,t,n,r,a){n=n.render;var i=t.ref;return ni(t,a),r=ro(e,t,n,r,i,a),null===e||Do?(t.flags|=1,_o(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~a,ns(e,t,a))}function zo(e,t,n,r,a,i){if(null===e){var o=n.type;return"function"!==typeof o||Uc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Hc(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Lo(e,t,o,r,a,i))}return o=e.child,0===(a&i)&&(a=o.memoizedProps,(n=null!==(n=n.compare)?n:ur)(a,r)&&e.ref===t.ref)?ns(e,t,i):(t.flags|=1,(e=Vc(o,r)).ref=t.ref,e.return=t,t.child=e)}function Lo(e,t,n,r,a,i){if(null!==e&&ur(e.memoizedProps,r)&&e.ref===t.ref){if(Do=!1,0===(i&a))return t.lanes=e.lanes,ns(e,t,i);0!==(16384&e.flags)&&(Do=!0)}return Wo(e,t,n,r,i)}function Po(e,t,n){var r=t.pendingProps,a=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0===(4&t.mode))t.memoizedState={baseLanes:0},yc(t,n);else{if(0===(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},yc(t,e),null;t.memoizedState={baseLanes:0},yc(t,null!==i?i.baseLanes:n)}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,yc(t,r);return _o(e,t,a,n),t.child}function Bo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Wo(e,t,n,r,a){var i=ha(n)?fa:la.current;return i=pa(t,i),ni(t,a),n=ro(e,t,n,r,i,a),null===e||Do?(t.flags|=1,_o(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~a,ns(e,t,a))}function Uo(e,t,n,r,a){if(ha(n)){var i=!0;ga(t)}else i=!1;if(ni(t,a),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),mi(t,n,r),gi(t,n,r,a),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,u=n.contextType;"object"===typeof u&&null!==u?u=ri(u):u=pa(t,u=ha(n)?fa:la.current);var l=n.getDerivedStateFromProps,d="function"===typeof l||"function"===typeof o.getSnapshotBeforeUpdate;d||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||c!==u)&&vi(t,o,r,u),ai=!1;var f=t.memoizedState;o.state=f,li(t,r,o,a),c=t.memoizedState,s!==r||f!==c||da.current||ai?("function"===typeof l&&(pi(t,n,l,r),c=t.memoizedState),(s=ai||bi(t,n,s,r,f,c,u))?(d||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.flags|=4)):("function"===typeof o.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=s):("function"===typeof o.componentDidMount&&(t.flags|=4),r=!1)}else{o=t.stateNode,oi(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Xa(t.type,s),o.props=u,d=t.pendingProps,f=o.context,"object"===typeof(c=n.contextType)&&null!==c?c=ri(c):c=pa(t,c=ha(n)?fa:la.current);var p=n.getDerivedStateFromProps;(l="function"===typeof p||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==d||f!==c)&&vi(t,o,r,c),ai=!1,f=t.memoizedState,o.state=f,li(t,r,o,a);var h=t.memoizedState;s!==d||f!==h||da.current||ai?("function"===typeof p&&(pi(t,n,p,r),h=t.memoizedState),(u=ai||bi(t,n,u,r,f,h,c))?(l||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,h,c),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,h,c)),"function"===typeof o.componentDidUpdate&&(t.flags|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=c,r=u):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),r=!1)}return Vo(e,t,n,r,i,a)}function Vo(e,t,n,r,a,i){Bo(e,t);var o=0!==(64&t.flags);if(!r&&!o)return a&&ya(t,n,!1),ns(e,t,i);r=t.stateNode,Fo.current=t;var s=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=wi(t,e.child,null,i),t.child=wi(t,null,s,i)):_o(e,t,s,i),t.memoizedState=r.state,a&&ya(t,n,!0),t.child}function Ho(e){var t=e.stateNode;t.pendingContext?ma(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ma(0,t.context,!1),Ei(e,t.containerInfo)}var Go,qo,Ko,Xo={dehydrated:null,retryLane:0};function Yo(e,t,n){var r,a=t.pendingProps,i=Di.current,o=!1;return(r=0!==(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!==(2&i)),r?(o=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===a.fallback||!0===a.unstable_avoidThisFallback||(i|=1),ca(Di,1&i),null===e?(void 0!==a.fallback&&Wi(t),e=a.children,i=a.fallback,o?(e=$o(t,e,i,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Xo,e):"number"===typeof a.unstable_expectedLoadTime?(e=$o(t,e,i,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Xo,t.lanes=33554432,e):((n=qc({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,o?(a=Zo(e,t,a.children,a.fallback,n),o=t.child,i=e.child.memoizedState,o.memoizedState=null===i?{baseLanes:n}:{baseLanes:i.baseLanes|n},o.childLanes=e.childLanes&~n,t.memoizedState=Xo,a):(n=Qo(e,t,a.children,n),t.memoizedState=null,n))}function $o(e,t,n,r){var a=e.mode,i=e.child;return t={mode:"hidden",children:t},0===(2&a)&&null!==i?(i.childLanes=0,i.pendingProps=t):i=qc(t,a,0,null),n=Gc(n,a,r,null),i.return=e,n.return=e,i.sibling=n,e.child=i,n}function Qo(e,t,n,r){var a=e.child;return e=a.sibling,n=Vc(a,{mode:"visible",children:n}),0===(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function Zo(e,t,n,r,a){var i=t.mode,o=e.child;e=o.sibling;var s={mode:"hidden",children:n};return 0===(2&i)&&t.child!==o?((n=t.child).childLanes=0,n.pendingProps=s,null!==(o=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=o,o.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Vc(o,s),null!==e?r=Vc(e,r):(r=Gc(r,i,a,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function Jo(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),ti(e.return,t)}function es(e,t,n,r,a,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,lastEffect:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=a,o.lastEffect=i)}function ts(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(_o(e,t,r.children,n),0!==(2&(r=Di.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!==(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Jo(e,n);else if(19===e.tag)Jo(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ca(Di,r),0===(2&t.mode))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===_i(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),es(t,!1,a,n,i,t.lastEffect);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===_i(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}es(t,!0,n,null,i,t.lastEffect);break;case"together":es(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function ns(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ls|=t.lanes,0!==(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Vc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Vc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function rs(e,t){if(!Li)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function as(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return ha(t.type)&&ba(),null;case 3:return Ai(),sa(da),sa(la),qi(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Vi(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Fi(t);var i=Ti(Ci.current);if(n=t.type,null!==e&&null!=t.stateNode)qo(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=Ti(Ni.current),Vi(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Yr]=t,r[$r]=s,n){case"dialog":Ir("cancel",r),Ir("close",r);break;case"iframe":case"object":case"embed":Ir("load",r);break;case"video":case"audio":for(e=0;e<wr.length;e++)Ir(wr[e],r);break;case"source":Ir("error",r);break;case"img":case"image":case"link":Ir("error",r),Ir("load",r);break;case"details":Ir("toggle",r);break;case"input":ee(r,s),Ir("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Ir("invalid",r);break;case"textarea":ce(r,s),Ir("invalid",r)}for(var u in je(n,s),e=null,s)s.hasOwnProperty(u)&&(i=s[u],"children"===u?"string"===typeof i?r.textContent!==i&&(e=["children",i]):"number"===typeof i&&r.textContent!==""+i&&(e=["children",""+i]):c.hasOwnProperty(u)&&null!=i&&"onScroll"===u&&Ir("scroll",r));switch(n){case"input":$(r),re(r,s,!0);break;case"textarea":$(r),le(r);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(r.onclick=zr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(u=9===i.nodeType?i:i.ownerDocument,e===de&&(e=pe(n)),e===de?"script"===n?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),"select"===n&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[Yr]=t,e[$r]=r,Go(e,t),t.stateNode=e,u=Se(n,r),n){case"dialog":Ir("cancel",e),Ir("close",e),i=r;break;case"iframe":case"object":case"embed":Ir("load",e),i=r;break;case"video":case"audio":for(i=0;i<wr.length;i++)Ir(wr[i],e);i=r;break;case"source":Ir("error",e),i=r;break;case"img":case"image":case"link":Ir("error",e),Ir("load",e),i=r;break;case"details":Ir("toggle",e),i=r;break;case"input":ee(e,r),i=J(e,r),Ir("invalid",e);break;case"option":i=ie(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=a({},r,{value:void 0}),Ir("invalid",e);break;case"textarea":ce(e,r),i=se(e,r),Ir("invalid",e);break;default:i=r}je(n,i);var l=i;for(s in l)if(l.hasOwnProperty(s)){var d=l[s];"style"===s?ke(e,d):"dangerouslySetInnerHTML"===s?null!=(d=d?d.__html:void 0)&&ve(e,d):"children"===s?"string"===typeof d?("textarea"!==n||""!==d)&&ge(e,d):"number"===typeof d&&ge(e,""+d):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(c.hasOwnProperty(s)?null!=d&&"onScroll"===s&&Ir("scroll",e):null!=d&&O(e,s,d,u))}switch(n){case"input":$(e),re(e,r,!1);break;case"textarea":$(e),le(e);break;case"option":null!=r.value&&e.setAttribute("value",""+X(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?oe(e,!!r.multiple,s,!1):null!=r.defaultValue&&oe(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof i.onClick&&(e.onclick=zr)}Br(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Ko(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(o(166));n=Ti(Ci.current),Ti(Ni.current),Vi(t)?(r=t.stateNode,n=t.memoizedProps,r[Yr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Yr]=t,t.stateNode=r)}return null;case 13:return sa(Di),r=t.memoizedState,0!==(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Vi(t):n=null!==e.memoizedState,r&&!n&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&Di.current)?0===_s&&(_s=3):(0!==_s&&3!==_s||(_s=4),null===Es||0===(134217727&Ls)&&0===(134217727&Ps)||bc(Es,Rs))),(r||n)&&(t.flags|=4),null);case 4:return Ai(),null===e&&Tr(t.stateNode.containerInfo),null;case 10:return ei(t),null;case 17:return ha(t.type)&&ba(),null;case 19:if(sa(Di),null===(r=t.memoizedState))return null;if(s=0!==(64&t.flags),null===(u=r.rendering))if(s)rs(r,!1);else{if(0!==_s||null!==e&&0!==(64&e.flags))for(e=t.child;null!==e;){if(null!==(u=_i(e))){for(t.flags|=64,rs(r,!1),null!==(s=u.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(u=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,e=u.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ca(Di,1&Di.current|2),t.child}e=e.sibling}null!==r.tail&&Ba()>Vs&&(t.flags|=64,s=!0,rs(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=_i(u))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),rs(r,!0),null===r.tail&&"hidden"===r.tailMode&&!u.alternate&&!Li)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Ba()-r.renderingStartTime>Vs&&1073741824!==n&&(t.flags|=64,s=!0,rs(r,!1),t.lanes=33554432);r.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=r.last)?n.sibling=u:t.child=u,r.last=u)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Ba(),n.sibling=null,t=Di.current,ca(Di,s?1&t|2:1&t),n):null;case 23:case 24:return Oc(),null!==e&&null!==e.memoizedState!==(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(o(156,t.tag))}function is(e){switch(e.tag){case 1:ha(e.type)&&ba();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Ai(),sa(da),sa(la),qi(),0!==(64&(t=e.flags)))throw Error(o(285));return e.flags=-4097&t|64,e;case 5:return Fi(e),null;case 13:return sa(Di),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return sa(Di),null;case 4:return Ai(),null;case 10:return ei(e),null;case 23:case 24:return Oc(),null;default:return null}}function os(e,t){try{var n="",r=t;do{n+=q(r),r=r.return}while(r);var a=n}catch(i){a="\nError generating stack: "+i.message+"\n"+i.stack}return{value:e,source:t,stack:a}}function ss(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Go=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}},qo=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ti(Ni.current);var o,s=null;switch(n){case"input":i=J(e,i),r=J(e,r),s=[];break;case"option":i=ie(e,i),r=ie(e,r),s=[];break;case"select":i=a({},i,{value:void 0}),r=a({},r,{value:void 0}),s=[];break;case"textarea":i=se(e,i),r=se(e,r),s=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(e.onclick=zr)}for(d in je(n,r),n=null,i)if(!r.hasOwnProperty(d)&&i.hasOwnProperty(d)&&null!=i[d])if("style"===d){var u=i[d];for(o in u)u.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(c.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var l=r[d];if(u=null!=i?i[d]:void 0,r.hasOwnProperty(d)&&l!==u&&(null!=l||null!=u))if("style"===d)if(u){for(o in u)!u.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&u[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(d,n)),n=l;else"dangerouslySetInnerHTML"===d?(l=l?l.__html:void 0,u=u?u.__html:void 0,null!=l&&u!==l&&(s=s||[]).push(d,l)):"children"===d?"string"!==typeof l&&"number"!==typeof l||(s=s||[]).push(d,""+l):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(c.hasOwnProperty(d)?(null!=l&&"onScroll"===d&&Ir("scroll",e),s||u===l||(s=[])):"object"===typeof l&&null!==l&&l.$$typeof===_?l.toString():(s=s||[]).push(d,l))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}},Ko=function(e,t,n,r){n!==r&&(t.flags|=4)};var cs="function"===typeof WeakMap?WeakMap:Map;function us(e,t,n){(n=si(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ks||(Ks=!0,Xs=r),ss(0,t)},n}function ls(e,t,n){(n=si(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var a=t.value;n.payload=function(){return ss(0,t),r(a)}}var i=e.stateNode;return null!==i&&"function"===typeof i.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===Ys?Ys=new Set([this]):Ys.add(this),ss(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var ds="function"===typeof WeakSet?WeakSet:Set;function fs(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){zc(e,n)}else t.current=null}function ps(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Xa(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Hr(t.stateNode.containerInfo));case 5:case 6:case 4:case 17:return}throw Error(o(163))}function hs(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3===(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var a=e;r=a.next,0!==(4&(a=a.tag))&&0!==(1&a)&&(Dc(n,e),Fc(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Xa(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&di(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}di(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Br(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&kt(n)))));case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(o(163))}function bs(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"===typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var a=n.memoizedProps.style;a=void 0!==a&&null!==a&&a.hasOwnProperty("display")?a.display:null,r.style.display=xe("display",a)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&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}}function ms(e,t){if(xa&&"function"===typeof xa.onCommitFiberUnmount)try{xa.onCommitFiberUnmount(Oa,t)}catch(i){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,a=r.destroy;if(r=r.tag,void 0!==a)if(0!==(4&r))Dc(t,n);else{r=t;try{a()}catch(i){zc(r,i)}}n=n.next}while(n!==e)}break;case 1:if(fs(t),"function"===typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(i){zc(t,i)}break;case 5:fs(t);break;case 4:ks(e,t)}}function vs(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function gs(e){return 5===e.tag||3===e.tag||4===e.tag}function ys(e){e:{for(var t=e.return;null!==t;){if(gs(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(o(161))}16&n.flags&&(ge(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||gs(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.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Os(e,n,t):xs(e,n,t)}function Os(e,t,n){var r=e.tag,a=5===r||6===r;if(a)e=a?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=zr));else if(4!==r&&null!==(e=e.child))for(Os(e,t,n),e=e.sibling;null!==e;)Os(e,t,n),e=e.sibling}function xs(e,t,n){var r=e.tag,a=5===r||6===r;if(a)e=a?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(xs(e,t,n),e=e.sibling;null!==e;)xs(e,t,n),e=e.sibling}function ks(e,t){for(var n,r,a=t,i=!1;;){if(!i){i=a.return;e:for(;;){if(null===i)throw Error(o(160));switch(n=i.stateNode,i.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}i=i.return}i=!0}if(5===a.tag||6===a.tag){e:for(var s=e,c=a,u=c;;)if(ms(s,u),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===c)break e;for(;null===u.sibling;){if(null===u.return||u.return===c)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}r?(s=n,c=a.stateNode,8===s.nodeType?s.parentNode.removeChild(c):s.removeChild(c)):n.removeChild(a.stateNode)}else if(4===a.tag){if(null!==a.child){n=a.stateNode.containerInfo,r=!0,a.child.return=a,a=a.child;continue}}else if(ms(e,a),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(i=!1)}a.sibling.return=a.return,a=a.sibling}}function ws(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3===(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var a=null!==e?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,null!==i){for(n[$r]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),Se(e,a),t=Se(e,r),a=0;a<i.length;a+=2){var s=i[a],c=i[a+1];"style"===s?ke(n,c):"dangerouslySetInnerHTML"===s?ve(n,c):"children"===s?ge(n,c):O(n,s,c,t)}switch(e){case"input":ne(n,r);break;case"textarea":ue(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(i=r.value)?oe(n,!!r.multiple,i,!1):e!==!!r.multiple&&(null!=r.defaultValue?oe(n,!!r.multiple,r.defaultValue,!0):oe(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,kt(n.containerInfo)));case 12:return;case 13:return null!==t.memoizedState&&(Us=Ba(),bs(t.child,!0)),void js(t);case 19:return void js(t);case 17:return;case 23:case 24:return void bs(t,null!==t.memoizedState)}throw Error(o(163))}function js(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new ds),t.forEach((function(t){var r=Pc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Ss(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Ns=Math.ceil,Is=x.ReactCurrentDispatcher,Cs=x.ReactCurrentOwner,Ts=0,Es=null,As=null,Rs=0,Fs=0,Ds=oa(0),_s=0,Ms=null,zs=0,Ls=0,Ps=0,Bs=0,Ws=null,Us=0,Vs=1/0;function Hs(){Vs=Ba()+500}var Gs,qs=null,Ks=!1,Xs=null,Ys=null,$s=!1,Qs=null,Zs=90,Js=[],ec=[],tc=null,nc=0,rc=null,ac=-1,ic=0,oc=0,sc=null,cc=!1;function uc(){return 0!==(48&Ts)?Ba():-1!==ac?ac:ac=Ba()}function lc(e){if(0===(2&(e=e.mode)))return 1;if(0===(4&e))return 99===Wa()?1:2;if(0===ic&&(ic=zs),0!==Ka.transition){0!==oc&&(oc=null!==Ws?Ws.pendingLanes:0),e=ic;var t=4186112&~oc;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Wa(),0!==(4&Ts)&&98===e?e=Bt(12,ic):e=Bt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ic),e}function dc(e,t,n){if(50<nc)throw nc=0,rc=null,Error(o(185));if(null===(e=fc(e,t)))return null;Vt(e,t,n),e===Es&&(Ps|=t,4===_s&&bc(e,Rs));var r=Wa();1===t?0!==(8&Ts)&&0===(48&Ts)?mc(e):(pc(e,n),0===Ts&&(Hs(),Ga())):(0===(4&Ts)||98!==r&&99!==r||(null===tc?tc=new Set([e]):tc.add(e)),pc(e,n)),Ws=e}function fc(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function pc(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var c=31-Ht(s),u=1<<c,l=i[c];if(-1===l){if(0===(u&r)||0!==(u&a)){l=t,zt(u);var d=Mt;i[c]=10<=d?l+250:6<=d?l+5e3:-1}}else l<=t&&(e.expiredLanes|=u);s&=~u}if(r=Lt(e,e===Es?Rs:0),t=Mt,0===r)null!==n&&(n!==Da&&ja(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Da&&ja(n)}15===t?(n=mc.bind(null,e),null===Ma?(Ma=[n],za=wa(Ta,qa)):Ma.push(n),n=Da):14===t?n=Ha(99,mc.bind(null,e)):n=Ha(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(o(358,e))}}(t),hc.bind(null,e)),e.callbackPriority=t,e.callbackNode=n}}function hc(e){if(ac=-1,oc=ic=0,0!==(48&Ts))throw Error(o(327));var t=e.callbackNode;if(Rc()&&e.callbackNode!==t)return null;var n=Lt(e,e===Es?Rs:0);if(0===n)return null;var r=n,a=Ts;Ts|=16;var i=wc();for(Es===e&&Rs===r||(Hs(),xc(e,r));;)try{Nc();break}catch(c){kc(e,c)}if(Ja(),Is.current=i,Ts=a,null!==As?r=0:(Es=null,Rs=0,r=_s),0!==(zs&Ps))xc(e,0);else if(0!==r){if(2===r&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Hr(e.containerInfo)),0!==(n=Pt(e))&&(r=jc(e,n))),1===r)throw t=Ms,xc(e,0),bc(e,n),pc(e,Ba()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(o(345));case 2:Tc(e);break;case 3:if(bc(e,n),(62914560&n)===n&&10<(r=Us+500-Ba())){if(0!==Lt(e,0))break;if(((a=e.suspendedLanes)&n)!==n){uc(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ur(Tc.bind(null,e),r);break}Tc(e);break;case 4:if(bc(e,n),(4186112&n)===n)break;for(r=e.eventTimes,a=-1;0<n;){var s=31-Ht(n);i=1<<s,(s=r[s])>a&&(a=s),n&=~i}if(n=a,10<(n=(120>(n=Ba()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ns(n/1960))-n)){e.timeoutHandle=Ur(Tc.bind(null,e),n);break}Tc(e);break;case 5:Tc(e);break;default:throw Error(o(329))}}return pc(e,Ba()),e.callbackNode===t?hc.bind(null,e):null}function bc(e,t){for(t&=~Bs,t&=~Ps,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ht(t),r=1<<n;e[n]=-1,t&=~r}}function mc(e){if(0!==(48&Ts))throw Error(o(327));if(Rc(),e===Es&&0!==(e.expiredLanes&Rs)){var t=Rs,n=jc(e,t);0!==(zs&Ps)&&(n=jc(e,t=Lt(e,t)))}else n=jc(e,t=Lt(e,0));if(0!==e.tag&&2===n&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Hr(e.containerInfo)),0!==(t=Pt(e))&&(n=jc(e,t))),1===n)throw n=Ms,xc(e,0),bc(e,t),pc(e,Ba()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Tc(e),pc(e,Ba()),null}function vc(e,t){var n=Ts;Ts|=1;try{return e(t)}finally{0===(Ts=n)&&(Hs(),Ga())}}function gc(e,t){var n=Ts;Ts&=-2,Ts|=8;try{return e(t)}finally{0===(Ts=n)&&(Hs(),Ga())}}function yc(e,t){ca(Ds,Fs),Fs|=t,zs|=t}function Oc(){Fs=Ds.current,sa(Ds)}function xc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Vr(n)),null!==As)for(n=As.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&ba();break;case 3:Ai(),sa(da),sa(la),qi();break;case 5:Fi(r);break;case 4:Ai();break;case 13:case 19:sa(Di);break;case 10:ei(r);break;case 23:case 24:Oc()}n=n.return}Es=e,As=Vc(e.current,null),Rs=Fs=zs=t,_s=0,Ms=null,Bs=Ps=Ls=0}function kc(e,t){for(;;){var n=As;try{if(Ja(),Ki.current=To,Ji){for(var r=$i.memoizedState;null!==r;){var a=r.queue;null!==a&&(a.pending=null),r=r.next}Ji=!1}if(Yi=0,Zi=Qi=$i=null,eo=!1,Cs.current=null,null===n||null===n.return){_s=1,Ms=t,As=null;break}e:{var i=e,o=n.return,s=n,c=t;if(t=Rs,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==c&&"object"===typeof c&&"function"===typeof c.then){var u=c;if(0===(2&s.mode)){var l=s.alternate;l?(s.updateQueue=l.updateQueue,s.memoizedState=l.memoizedState,s.lanes=l.lanes):(s.updateQueue=null,s.memoizedState=null)}var d=0!==(1&Di.current),f=o;do{var p;if(p=13===f.tag){var h=f.memoizedState;if(null!==h)p=null!==h.dehydrated;else{var b=f.memoizedProps;p=void 0!==b.fallback&&(!0!==b.unstable_avoidThisFallback||!d)}}if(p){var m=f.updateQueue;if(null===m){var v=new Set;v.add(u),f.updateQueue=v}else m.add(u);if(0===(2&f.mode)){if(f.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var g=si(-1,1);g.tag=2,ci(s,g)}s.lanes|=1;break e}c=void 0,s=t;var y=i.pingCache;if(null===y?(y=i.pingCache=new cs,c=new Set,y.set(u,c)):void 0===(c=y.get(u))&&(c=new Set,y.set(u,c)),!c.has(s)){c.add(s);var O=Lc.bind(null,i,u,s);u.then(O,O)}f.flags|=4096,f.lanes=t;break e}f=f.return}while(null!==f);c=Error((K(s.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.")}5!==_s&&(_s=2),c=os(c,s),f=o;do{switch(f.tag){case 3:i=c,f.flags|=4096,t&=-t,f.lanes|=t,ui(f,us(0,i,t));break e;case 1:i=c;var x=f.type,k=f.stateNode;if(0===(64&f.flags)&&("function"===typeof x.getDerivedStateFromError||null!==k&&"function"===typeof k.componentDidCatch&&(null===Ys||!Ys.has(k)))){f.flags|=4096,t&=-t,f.lanes|=t,ui(f,ls(f,i,t));break e}}f=f.return}while(null!==f)}Cc(n)}catch(w){t=w,As===n&&null!==n&&(As=n=n.return);continue}break}}function wc(){var e=Is.current;return Is.current=To,null===e?To:e}function jc(e,t){var n=Ts;Ts|=16;var r=wc();for(Es===e&&Rs===t||xc(e,t);;)try{Sc();break}catch(a){kc(e,a)}if(Ja(),Ts=n,Is.current=r,null!==As)throw Error(o(261));return Es=null,Rs=0,_s}function Sc(){for(;null!==As;)Ic(As)}function Nc(){for(;null!==As&&!Sa();)Ic(As)}function Ic(e){var t=Gs(e.alternate,e,Fs);e.memoizedProps=e.pendingProps,null===t?Cc(e):As=t,Cs.current=null}function Cc(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(2048&t.flags)){if(null!==(n=as(n,t,Fs)))return void(As=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!==(1073741824&Fs)||0===(4&n.mode)){for(var r=0,a=n.child;null!==a;)r|=a.lanes|a.childLanes,a=a.sibling;n.childLanes=r}null!==e&&0===(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=is(t)))return n.flags&=2047,void(As=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(As=t);As=t=e}while(null!==t);0===_s&&(_s=5)}function Tc(e){var t=Wa();return Va(99,Ec.bind(null,e,t)),null}function Ec(e,t){do{Rc()}while(null!==Qs);if(0!==(48&Ts))throw Error(o(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null;var r=n.lanes|n.childLanes,a=r,i=e.pendingLanes&~a;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=a,e.mutableReadLanes&=a,e.entangledLanes&=a,a=e.entanglements;for(var s=e.eventTimes,c=e.expirationTimes;0<i;){var u=31-Ht(i),l=1<<u;a[u]=0,s[u]=-1,c[u]=-1,i&=~l}if(null!==tc&&0===(24&r)&&tc.has(e)&&tc.delete(e),e===Es&&(As=Es=null,Rs=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(a=Ts,Ts|=32,Cs.current=null,Lr=Yt,hr(s=pr())){if("selectionStart"in s)c={start:s.selectionStart,end:s.selectionEnd};else e:if(c=(c=s.ownerDocument)&&c.defaultView||window,(l=c.getSelection&&c.getSelection())&&0!==l.rangeCount){c=l.anchorNode,i=l.anchorOffset,u=l.focusNode,l=l.focusOffset;try{c.nodeType,u.nodeType}catch(N){c=null;break e}var d=0,f=-1,p=-1,h=0,b=0,m=s,v=null;t:for(;;){for(var g;m!==c||0!==i&&3!==m.nodeType||(f=d+i),m!==u||0!==l&&3!==m.nodeType||(p=d+l),3===m.nodeType&&(d+=m.nodeValue.length),null!==(g=m.firstChild);)v=m,m=g;for(;;){if(m===s)break t;if(v===c&&++h===i&&(f=d),v===u&&++b===l&&(p=d),null!==(g=m.nextSibling))break;v=(m=v).parentNode}m=g}c=-1===f||-1===p?null:{start:f,end:p}}else c=null;c=c||{start:0,end:0}}else c=null;Pr={focusedElem:s,selectionRange:c},Yt=!1,sc=null,cc=!1,qs=r;do{try{Ac()}catch(N){if(null===qs)throw Error(o(330));zc(qs,N),qs=qs.nextEffect}}while(null!==qs);sc=null,qs=r;do{try{for(s=e;null!==qs;){var y=qs.flags;if(16&y&&ge(qs.stateNode,""),128&y){var O=qs.alternate;if(null!==O){var x=O.ref;null!==x&&("function"===typeof x?x(null):x.current=null)}}switch(1038&y){case 2:ys(qs),qs.flags&=-3;break;case 6:ys(qs),qs.flags&=-3,ws(qs.alternate,qs);break;case 1024:qs.flags&=-1025;break;case 1028:qs.flags&=-1025,ws(qs.alternate,qs);break;case 4:ws(qs.alternate,qs);break;case 8:ks(s,c=qs);var k=c.alternate;vs(c),null!==k&&vs(k)}qs=qs.nextEffect}}catch(N){if(null===qs)throw Error(o(330));zc(qs,N),qs=qs.nextEffect}}while(null!==qs);if(x=Pr,O=pr(),y=x.focusedElem,s=x.selectionRange,O!==y&&y&&y.ownerDocument&&fr(y.ownerDocument.documentElement,y)){null!==s&&hr(y)&&(O=s.start,void 0===(x=s.end)&&(x=O),"selectionStart"in y?(y.selectionStart=O,y.selectionEnd=Math.min(x,y.value.length)):(x=(O=y.ownerDocument||document)&&O.defaultView||window).getSelection&&(x=x.getSelection(),c=y.textContent.length,k=Math.min(s.start,c),s=void 0===s.end?k:Math.min(s.end,c),!x.extend&&k>s&&(c=s,s=k,k=c),c=dr(y,k),i=dr(y,s),c&&i&&(1!==x.rangeCount||x.anchorNode!==c.node||x.anchorOffset!==c.offset||x.focusNode!==i.node||x.focusOffset!==i.offset)&&((O=O.createRange()).setStart(c.node,c.offset),x.removeAllRanges(),k>s?(x.addRange(O),x.extend(i.node,i.offset)):(O.setEnd(i.node,i.offset),x.addRange(O))))),O=[];for(x=y;x=x.parentNode;)1===x.nodeType&&O.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"===typeof y.focus&&y.focus(),y=0;y<O.length;y++)(x=O[y]).element.scrollLeft=x.left,x.element.scrollTop=x.top}Yt=!!Lr,Pr=Lr=null,e.current=n,qs=r;do{try{for(y=e;null!==qs;){var w=qs.flags;if(36&w&&hs(y,qs.alternate,qs),128&w){O=void 0;var j=qs.ref;if(null!==j){var S=qs.stateNode;switch(qs.tag){case 5:O=S;break;default:O=S}"function"===typeof j?j(O):j.current=O}}qs=qs.nextEffect}}catch(N){if(null===qs)throw Error(o(330));zc(qs,N),qs=qs.nextEffect}}while(null!==qs);qs=null,_a(),Ts=a}else e.current=n;if($s)$s=!1,Qs=e,Zs=t;else for(qs=r;null!==qs;)t=qs.nextEffect,qs.nextEffect=null,8&qs.flags&&((w=qs).sibling=null,w.stateNode=null),qs=t;if(0===(r=e.pendingLanes)&&(Ys=null),1===r?e===rc?nc++:(nc=0,rc=e):nc=0,n=n.stateNode,xa&&"function"===typeof xa.onCommitFiberRoot)try{xa.onCommitFiberRoot(Oa,n,void 0,64===(64&n.current.flags))}catch(N){}if(pc(e,Ba()),Ks)throw Ks=!1,e=Xs,Xs=null,e;return 0!==(8&Ts)||Ga(),null}function Ac(){for(;null!==qs;){var e=qs.alternate;cc||null===sc||(0!==(8&qs.flags)?et(qs,sc)&&(cc=!0):13===qs.tag&&Ss(e,qs)&&et(qs,sc)&&(cc=!0));var t=qs.flags;0!==(256&t)&&ps(e,qs),0===(512&t)||$s||($s=!0,Ha(97,(function(){return Rc(),null}))),qs=qs.nextEffect}}function Rc(){if(90!==Zs){var e=97<Zs?97:Zs;return Zs=90,Va(e,_c)}return!1}function Fc(e,t){Js.push(t,e),$s||($s=!0,Ha(97,(function(){return Rc(),null})))}function Dc(e,t){ec.push(t,e),$s||($s=!0,Ha(97,(function(){return Rc(),null})))}function _c(){if(null===Qs)return!1;var e=Qs;if(Qs=null,0!==(48&Ts))throw Error(o(331));var t=Ts;Ts|=32;var n=ec;ec=[];for(var r=0;r<n.length;r+=2){var a=n[r],i=n[r+1],s=a.destroy;if(a.destroy=void 0,"function"===typeof s)try{s()}catch(u){if(null===i)throw Error(o(330));zc(i,u)}}for(n=Js,Js=[],r=0;r<n.length;r+=2){a=n[r],i=n[r+1];try{var c=a.create;a.destroy=c()}catch(u){if(null===i)throw Error(o(330));zc(i,u)}}for(c=e.current.firstEffect;null!==c;)e=c.nextEffect,c.nextEffect=null,8&c.flags&&(c.sibling=null,c.stateNode=null),c=e;return Ts=t,Ga(),!0}function Mc(e,t,n){ci(e,t=us(0,t=os(n,t),1)),t=uc(),null!==(e=fc(e,1))&&(Vt(e,1,t),pc(e,t))}function zc(e,t){if(3===e.tag)Mc(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Mc(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Ys||!Ys.has(r))){var a=ls(n,e=os(t,e),1);if(ci(n,a),a=uc(),null!==(n=fc(n,1)))Vt(n,1,a),pc(n,a);else if("function"===typeof r.componentDidCatch&&(null===Ys||!Ys.has(r)))try{r.componentDidCatch(t,e)}catch(i){}break}}n=n.return}}function Lc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=uc(),e.pingedLanes|=e.suspendedLanes&n,Es===e&&(Rs&n)===n&&(4===_s||3===_s&&(62914560&Rs)===Rs&&500>Ba()-Us?xc(e,0):Bs|=n),pc(e,t)}function Pc(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0===(2&(t=e.mode))?t=1:0===(4&t)?t=99===Wa()?1:2:(0===ic&&(ic=zs),0===(t=Wt(62914560&~ic))&&(t=4194304))),n=uc(),null!==(e=fc(e,t))&&(Vt(e,t,n),pc(e,n))}function Bc(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.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Wc(e,t,n,r){return new Bc(e,t,n,r)}function Uc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Vc(e,t){var n=e.alternate;return null===n?((n=Wc(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.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Hc(e,t,n,r,a,i){var s=2;if(r=e,"function"===typeof e)Uc(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case j:return Gc(n.children,a,i,t);case M:s=8,a|=16;break;case S:s=8,a|=1;break;case N:return(e=Wc(12,n,t,8|a)).elementType=N,e.type=N,e.lanes=i,e;case E:return(e=Wc(13,n,t,a)).type=E,e.elementType=E,e.lanes=i,e;case A:return(e=Wc(19,n,t,a)).elementType=A,e.lanes=i,e;case z:return qc(n,a,i,t);case L:return(e=Wc(24,n,t,a)).elementType=L,e.lanes=i,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case I:s=10;break e;case C:s=9;break e;case T:s=11;break e;case R:s=14;break e;case F:s=16,r=null;break e;case D:s=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Wc(s,n,t,a)).elementType=e,t.type=r,t.lanes=i,t}function Gc(e,t,n,r){return(e=Wc(7,e,r,t)).lanes=n,e}function qc(e,t,n,r){return(e=Wc(23,e,r,t)).elementType=z,e.lanes=n,e}function Kc(e,t,n){return(e=Wc(6,e,null,t)).lanes=n,e}function Xc(e,t,n){return(t=Wc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Yc(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Ut(0),this.expirationTimes=Ut(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.mutableSourceEagerHydrationData=null}function $c(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:w,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Qc(e,t,n,r){var a=t.current,i=uc(),s=lc(a);e:if(n){t:{if($e(n=n._reactInternals)!==n||1!==n.tag)throw Error(o(170));var c=n;do{switch(c.tag){case 3:c=c.stateNode.context;break t;case 1:if(ha(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break t}}c=c.return}while(null!==c);throw Error(o(171))}if(1===n.tag){var u=n.type;if(ha(u)){n=va(n,u,c);break e}}n=c}else n=ua;return null===t.context?t.context=n:t.pendingContext=n,(t=si(i,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),ci(a,t),dc(a,s,i),s}function Zc(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Jc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function eu(e,t){Jc(e,t),(e=e.alternate)&&Jc(e,t)}function tu(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Yc(e,t,null!=n&&!0===n.hydrate),t=Wc(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,ii(t),e[Qr]=n.current,Tr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var a=(t=r[e])._getVersion;a=a(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,a]:n.mutableSourceEagerHydrationData.push(t,a)}this._internalRoot=n}function nu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ru(e,t,n,r,a){var i=n._reactRootContainer;if(i){var o=i._internalRoot;if("function"===typeof a){var s=a;a=function(){var e=Zc(o);s.call(e)}}Qc(t,o,e,a)}else{if(i=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 tu(e,0,t?{hydrate:!0}:void 0)}(n,r),o=i._internalRoot,"function"===typeof a){var c=a;a=function(){var e=Zc(o);c.call(e)}}gc((function(){Qc(t,o,e,a)}))}return Zc(o)}function au(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nu(t))throw Error(o(200));return $c(e,t,null,n)}Gs=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||da.current)Do=!0;else{if(0===(n&r)){switch(Do=!1,t.tag){case 3:Ho(t),Hi();break;case 5:Ri(t);break;case 1:ha(t.type)&&ga(t);break;case 4:Ei(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var a=t.type._context;ca(Ya,a._currentValue),a._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(n&t.child.childLanes)?Yo(e,t,n):(ca(Di,1&Di.current),null!==(t=ns(e,t,n))?t.sibling:null);ca(Di,1&Di.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(64&e.flags)){if(r)return ts(e,t,n);t.flags|=64}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),ca(Di,Di.current),r)break;return null;case 23:case 24:return t.lanes=0,Po(e,t,n)}return ns(e,t,n)}Do=0!==(16384&e.flags)}else Do=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,a=pa(t,la.current),ni(t,n),a=ro(null,t,r,e,a,n),t.flags|=1,"object"===typeof a&&null!==a&&"function"===typeof a.render&&void 0===a.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ha(r)){var i=!0;ga(t)}else i=!1;t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,ii(t);var s=r.getDerivedStateFromProps;"function"===typeof s&&pi(t,r,s,e),a.updater=hi,t.stateNode=a,a._reactInternals=t,gi(t,r,e,n),t=Vo(null,t,r,!0,i,n)}else t.tag=0,_o(null,t,a,n),t=t.child;return t;case 16:a=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,a=(i=a._init)(a._payload),t.type=a,i=t.tag=function(e){if("function"===typeof e)return Uc(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===T)return 11;if(e===R)return 14}return 2}(a),e=Xa(a,e),i){case 0:t=Wo(null,t,a,e,n);break e;case 1:t=Uo(null,t,a,e,n);break e;case 11:t=Mo(null,t,a,e,n);break e;case 14:t=zo(null,t,a,Xa(a.type,e),r,n);break e}throw Error(o(306,a,""))}return t;case 0:return r=t.type,a=t.pendingProps,Wo(e,t,r,a=t.elementType===r?a:Xa(r,a),n);case 1:return r=t.type,a=t.pendingProps,Uo(e,t,r,a=t.elementType===r?a:Xa(r,a),n);case 3:if(Ho(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,a=null!==(a=t.memoizedState)?a.element:null,oi(e,t),li(t,r,null,n),(r=t.memoizedState.element)===a)Hi(),t=ns(e,t,n);else{if((i=(a=t.stateNode).hydrate)&&(zi=Gr(t.stateNode.containerInfo.firstChild),Mi=t,i=Li=!0),i){if(null!=(e=a.mutableSourceEagerHydrationData))for(a=0;a<e.length;a+=2)(i=e[a])._workInProgressVersionPrimary=e[a+1],Gi.push(i);for(n=ji(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else _o(e,t,r,n),Hi();t=t.child}return t;case 5:return Ri(t),null===e&&Wi(t),r=t.type,a=t.pendingProps,i=null!==e?e.memoizedProps:null,s=a.children,Wr(r,a)?s=null:null!==i&&Wr(r,i)&&(t.flags|=16),Bo(e,t),_o(e,t,s,n),t.child;case 6:return null===e&&Wi(t),null;case 13:return Yo(e,t,n);case 4:return Ei(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=wi(t,null,r,n):_o(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,Mo(e,t,r,a=t.elementType===r?a:Xa(r,a),n);case 7:return _o(e,t,t.pendingProps,n),t.child;case 8:case 12:return _o(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,a=t.pendingProps,s=t.memoizedProps,i=a.value;var c=t.type._context;if(ca(Ya,c._currentValue),c._currentValue=i,null!==s)if(c=s.value,0===(i=sr(c,i)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(c,i):1073741823))){if(s.children===a.children&&!da.current){t=ns(e,t,n);break e}}else for(null!==(c=t.child)&&(c.return=t);null!==c;){var u=c.dependencies;if(null!==u){s=c.child;for(var l=u.firstContext;null!==l;){if(l.context===r&&0!==(l.observedBits&i)){1===c.tag&&((l=si(-1,n&-n)).tag=2,ci(c,l)),c.lanes|=n,null!==(l=c.alternate)&&(l.lanes|=n),ti(c.return,n),u.lanes|=n;break}l=l.next}}else s=10===c.tag&&c.type===t.type?null:c.child;if(null!==s)s.return=c;else for(s=c;null!==s;){if(s===t){s=null;break}if(null!==(c=s.sibling)){c.return=s.return,s=c;break}s=s.return}c=s}_o(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=(i=t.pendingProps).children,ni(t,n),r=r(a=ri(a,i.unstable_observedBits)),t.flags|=1,_o(e,t,r,n),t.child;case 14:return i=Xa(a=t.type,t.pendingProps),zo(e,t,a,i=Xa(a.type,i),r,n);case 15:return Lo(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Xa(r,a),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,ha(r)?(e=!0,ga(t)):e=!1,ni(t,n),mi(t,r,a),gi(t,r,a,n),Vo(null,t,r,!0,e,n);case 19:return ts(e,t,n);case 23:case 24:return Po(e,t,n)}throw Error(o(156,t.tag))},tu.prototype.render=function(e){Qc(e,this._internalRoot,null,null)},tu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Qc(null,e,null,(function(){t[Qr]=null}))},tt=function(e){13===e.tag&&(dc(e,4,uc()),eu(e,4))},nt=function(e){13===e.tag&&(dc(e,67108864,uc()),eu(e,67108864))},rt=function(e){if(13===e.tag){var t=uc(),n=lc(e);dc(e,n,t),eu(e,n)}},at=function(e,t){return t()},Ie=function(e,t,n){switch(t){case"input":if(ne(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 a=na(r);if(!a)throw Error(o(90));Q(r),ne(r,a)}}}break;case"textarea":ue(e,n);break;case"select":null!=(t=n.value)&&oe(e,!!n.multiple,t,!1)}},Fe=vc,De=function(e,t,n,r,a){var i=Ts;Ts|=4;try{return Va(98,e.bind(null,t,n,r,a))}finally{0===(Ts=i)&&(Hs(),Ga())}},_e=function(){0===(49&Ts)&&(function(){if(null!==tc){var e=tc;tc=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,pc(e,Ba())}))}Ga()}(),Rc())},Me=function(e,t){var n=Ts;Ts|=2;try{return e(t)}finally{0===(Ts=n)&&(Hs(),Ga())}};var iu={Events:[ea,ta,na,Ae,Re,Rc,{current:!1}]},ou={findFiberByHostInstance:Jr,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},su={bundleType:ou.bundleType,version:ou.version,rendererPackageName:ou.rendererPackageName,rendererConfig:ou.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Je(e))?null:e.stateNode},findFiberByHostInstance:ou.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cu.isDisabled&&cu.supportsFiber)try{Oa=cu.inject(su),xa=cu}catch(me){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iu,t.createPortal=au,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return e=null===(e=Je(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Ts;if(0!==(48&n))return e(t);Ts|=1;try{if(e)return Va(99,e.bind(null,t))}finally{Ts=n,Ga()}},t.hydrate=function(e,t,n){if(!nu(t))throw Error(o(200));return ru(null,e,t,!0,n)},t.render=function(e,t,n){if(!nu(t))throw Error(o(200));return ru(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!nu(e))throw Error(o(40));return!!e._reactRootContainer&&(gc((function(){ru(null,null,e,!1,(function(){e._reactRootContainer=null,e[Qr]=null}))})),!0)},t.unstable_batchedUpdates=vc,t.unstable_createPortal=function(e,t){return au(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nu(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return ru(e,t,n,!1,r)},t.version="17.0.2"},function(e,t,n){"use strict";e.exports=n(327)},function(e,t,n){"use strict";var r,a,i,o;if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();t.unstable_now=function(){return c.now()-u}}if("undefined"===typeof window||"function"!==typeof MessageChannel){var l=null,d=null,f=function e(){if(null!==l)try{var n=t.unstable_now();l(!0,n),l=null}catch(r){throw setTimeout(e,0),r}};r=function(e){null!==l?setTimeout(r,0,e):(l=e,setTimeout(f,0))},a=function(e,t){d=setTimeout(e,t)},i=function(){clearTimeout(d)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var p=window.setTimeout,h=window.clearTimeout;if("undefined"!==typeof console){var b=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!==typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var m=!1,v=null,g=-1,y=5,O=0;t.unstable_shouldYield=function(){return t.unstable_now()>=O},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,k=x.port2;x.port1.onmessage=function(){if(null!==v){var e=t.unstable_now();O=e+y;try{v(!0,e)?k.postMessage(null):(m=!1,v=null)}catch(n){throw k.postMessage(null),n}}else m=!1},r=function(e){v=e,m||(m=!0,k.postMessage(null))},a=function(e,n){g=p((function(){e(t.unstable_now())}),n)},i=function(){h(g),g=-1}}function w(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<N(a,t)))break e;e[r]=t,e[n]=a,n=r}}function j(e){return void 0===(e=e[0])?null:e}function S(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var i=2*(r+1)-1,o=e[i],s=i+1,c=e[s];if(void 0!==o&&0>N(o,n))void 0!==c&&0>N(c,o)?(e[r]=c,e[s]=n,r=s):(e[r]=o,e[i]=n,r=i);else{if(!(void 0!==c&&0>N(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}return null}function N(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var I=[],C=[],T=1,E=null,A=3,R=!1,F=!1,D=!1;function _(e){for(var t=j(C);null!==t;){if(null===t.callback)S(C);else{if(!(t.startTime<=e))break;S(C),t.sortIndex=t.expirationTime,w(I,t)}t=j(C)}}function M(e){if(D=!1,_(e),!F)if(null!==j(I))F=!0,r(z);else{var t=j(C);null!==t&&a(M,t.startTime-e)}}function z(e,n){F=!1,D&&(D=!1,i()),R=!0;var r=A;try{for(_(n),E=j(I);null!==E&&(!(E.expirationTime>n)||e&&!t.unstable_shouldYield());){var o=E.callback;if("function"===typeof o){E.callback=null,A=E.priorityLevel;var s=o(E.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?E.callback=s:E===j(I)&&S(I),_(n)}else S(I);E=j(I)}if(null!==E)var c=!0;else{var u=j(C);null!==u&&a(M,u.startTime-n),c=!1}return c}finally{E=null,A=r,R=!1}}var L=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){F||R||(F=!0,r(z))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return j(I)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=L,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,n,o){var s=t.unstable_now();switch("object"===typeof o&&null!==o?o="number"===typeof(o=o.delay)&&0<o?s+o:s:o=s,e){case 1:var c=-1;break;case 2:c=250;break;case 5:c=1073741823;break;case 4:c=1e4;break;default:c=5e3}return e={id:T++,callback:n,priorityLevel:e,startTime:o,expirationTime:c=o+c,sortIndex:-1},o>s?(e.sortIndex=o,w(C,e),null===j(I)&&e===j(C)&&(D?i():D=!0,a(M,o-s))):(e.sortIndex=c,w(I,e),F||R||(F=!0,r(z))),e},t.unstable_wrapCallback=function(e){var t=A;return function(){var n=A;A=t;try{return e.apply(this,arguments)}finally{A=n}}}},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(A){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof m?t:m,i=Object.create(a.prototype),o=new C(r||[]);return i._invoke=function(e,t,n){var r=d;return function(a,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===a)throw i;return E()}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?h:f,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,o),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(A){return{type:"throw",arg:A}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",b={};function m(){}function v(){}function g(){}var y={};y[i]=function(){return this};var O=Object.getPrototypeOf,x=O&&O(O(T([])));x&&x!==n&&r.call(x,i)&&(y=x);var k=g.prototype=m.prototype=Object.create(y);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(a,i,o,s){var c=l(e[a],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"===typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(c.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,a){n(e,r,t,a)}))}return a=a?a.then(i,i):i()}}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 b;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return b}var a=l(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,b;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function N(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function T(e){if(e){var n=e[i];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:E}}function E(){return{value:t,done:!0}}return v.prototype=k.constructor=g,g.constructor=v,v.displayName=c(g,s,"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,c(e,s,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},w(j.prototype),j.prototype[o]=function(){return this},e.AsyncIterator=j,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new j(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},w(k),c(k,s,"Generator"),k[i]=function(){return this},k.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=T,C.prototype={constructor:C,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(I),!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 a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(o)},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),b},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),I(n),b}},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 a=r.arg;I(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},e}(e.exports);try{regeneratorRuntime=r}catch(a){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=u(e),o=r[0],s=r[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),l=0,d=s>0?o-4:o;for(n=0;n<d;n+=4)t=a[e.charCodeAt(n)]<<18|a[e.charCodeAt(n+1)]<<12|a[e.charCodeAt(n+2)]<<6|a[e.charCodeAt(n+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===s&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,i=[],o=16383,s=0,c=n-a;s<c;s+=o)i.push(l(e,s,s+o>c?c:s+o));1===a?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===a&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],a=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=o.length;s<c;++s)r[s]=o[s],a[o.charCodeAt(s)]=s;function u(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 a,i,o=[],s=t;s<n;s+=3)a=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(i=a)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,a){var i,o,s=8*a-r-1,c=(1<<s)-1,u=c>>1,l=-7,d=n?a-1:0,f=n?-1:1,p=e[t+d];for(d+=f,i=p&(1<<-l)-1,p>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=r;l>0;o=256*o+e[t+d],d+=f,l-=8);if(0===i)i=1-u;else{if(i===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),i-=u}return(p?-1:1)*o*Math.pow(2,i-r)},t.write=function(e,t,n,r,a,i){var o,s,c,u=8*i-a-1,l=(1<<u)-1,d=l>>1,f=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,h=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(s=0,o=l):o+d>=1?(s=(t*c-1)*Math.pow(2,a),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,a),o=0));a>=8;e[n+p]=255&s,p+=h,s/=256,a-=8);for(o=o<<a|s,u+=a;u>0;e[n+p]=255&o,p+=h,o/=256,u-=8);e[n+p-h]|=128*b}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(e){var t,r=n(7),a=n(11),i=n(38),o=function(){return n(333)};var s=function(){function s(){Object(r.a)(this,s),this.util=n(334),this.textEncoder=new this.util.TextEncoder}return Object(a.a)(s,[{key:"fetch",value:function(e,n){return null!=Object(i.b)().global.fetch?Object(i.b)().global.fetch(e,n):(null==t&&(t=o()),t(e,n))}},{key:"now",value:function(){var t=e.hrtime();return 1e3*t[0]+t[1]/1e6}},{key:"encode",value:function(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error("Node built-in encoder only supports utf-8, but got ".concat(t));return this.textEncoder.encode(e)}},{key:"decode",value:function(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}}]),s}();Object(i.b)().get("IS_NODE")&&Object(i.b)().setPlatform("node",new s)}).call(this,n(187))},,,function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this,n=function(){var e=4022871197;return function(t){t=t.toString();for(var n=0;n<t.length;n++){var r=.02519603282416938*(e+=t.charCodeAt(n));r-=e=r>>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)}}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function c(e,t){var n=new o(e),r=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=c:n(89)&&n(139)?void 0===(r=function(){return c}.call(t,n,t,a))||(a.exports=r):this.alea=c}(0,e,n(89))}).call(this,n(138)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(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()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function c(e,t){var n=new o(e),r=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,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=c:n(89)&&n(139)?void 0===(r=function(){return c}.call(t,n,t,a))||(a.exports=r):this.xor128=c}(0,e,n(89))}).call(this,n(138)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(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 s(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 c(e,t){var n=new o(e),r=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,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=c:n(89)&&n(139)?void 0===(r=function(){return c}.call(t,n,t,a))||(a.exports=r):this.xorwow=c}(0,e,n(89))}).call(this,n(138)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,n,r=t.x,a=t.i;return e=r[a],n=(e^=e>>>7)^e<<24,n^=(e=r[a+1&7])^e>>>10,n^=(e=r[a+3&7])^e>>>3,n^=(e=r[a+4&7])^e<<7,e=r[a+7&7],n^=(e^=e<<13)^e<<9,r[a]=n,t.i=a+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 s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function c(e,t){null==e&&(e=+new Date);var n=new o(e),r=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,r&&(r.x&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=c:n(89)&&n(139)?void 0===(r=function(){return c}.call(t,n,t,a))||(a.exports=r):this.xorshift7=c}(0,e,n(89))}).call(this,n(138)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this;t.next=function(){var e,n,r=t.w,a=t.X,i=t.i;return t.w=r=r+1640531527|0,n=a[i+34&127],e=a[i=i+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=a[i]=n^e,t.i=i,n+(r^r>>>16)|0},function(e,t){var n,r,a,i,o,s=[],c=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,c=Math.max(c,t.length)),a=0,i=-32;i<c;++i)t&&(r^=t.charCodeAt((i+32)%t.length)),0===i&&(o=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,i>=0&&(o=o+1640531527|0,a=0==(n=s[127&i]^=r+o)?a+1:0);for(a>=128&&(s[127&(t&&t.length||0)]=-1),a=127,i=512;i>0;--i)r=s[a+34&127],n=s[a=a+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[a]=r^n;e.w=o,e.X=s,e.i=a}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function c(e,t){null==e&&(e=+new Date);var n=new o(e),r=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,r&&(r.X&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=c:n(89)&&n(139)?void 0===(r=function(){return c}.call(t,n,t,a))||(a.exports=r):this.xor4096=c}(0,e,n(89))}).call(this,n(138)(e))},function(e,t,n){(function(e){var r;!function(e,a,i){function o(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,a=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^a,t.a=a-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 s(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function c(e,t){var n=new o(e),r=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,r&&("object"==typeof r&&s(r,n),a.state=function(){return s(n,{})}),a}a&&a.exports?a.exports=c:n(89)&&n(139)?void 0===(r=function(){return c}.call(t,n,t,a))||(a.exports=r):this.tychei=c}(0,e,n(89))}).call(this,n(138)(e))},function(e,t,n){var r;!function(a,i){var o,s=this,c=256,u=i.pow(c,6),l=i.pow(2,52),d=2*l,f=255;function p(e,t,n){var r=[],f=v(m((t=1==t?{entropy:!0}:t||{}).entropy?[e,g(a)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(c):(e=new Uint8Array(c),(s.crypto||s.msCrypto).getRandomValues(e)),g(e)}catch(r){var t=s.navigator,n=t&&t.plugins;return[+new Date,s,n,s.screen,g(a)]}}():e,3),r),p=new h(r),y=function(){for(var e=p.g(6),t=u,n=0;e<l;)e=(e+n)*c,t*=c,n=p.g(1);for(;e>=d;)e/=2,t/=2,n>>>=1;return(e+n)/t};return y.int32=function(){return 0|p.g(4)},y.quick=function(){return p.g(4)/4294967296},y.double=y,v(g(p.S),a),(t.pass||n||function(e,t,n,r){return r&&(r.S&&b(r,p),e.state=function(){return b(p,{})}),n?(i.random=e,t):e})(y,f,"global"in t?t.global:this==i,t.state)}function h(e){var t,n=e.length,r=this,a=0,i=r.i=r.j=0,o=r.S=[];for(n||(e=[n++]);a<c;)o[a]=a++;for(a=0;a<c;a++)o[a]=o[i=f&i+e[a%n]+(t=o[a])],o[i]=t;(r.g=function(e){for(var t,n=0,a=r.i,i=r.j,o=r.S;e--;)t=o[a=f&a+1],n=n*c+o[f&(o[a]=o[i=f&i+t])+(o[i]=t)];return r.i=a,r.j=i,n})(c)}function b(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function m(e,t){var n,r=[],a=typeof e;if(t&&"object"==a)for(n in e)try{r.push(m(e[n],t-1))}catch(i){}return r.length?r:"string"==a?e:e+"\0"}function v(e,t){for(var n,r=e+"",a=0;a<r.length;)t[f&a]=f&(n^=19*t[f&a])+r.charCodeAt(a++);return g(t)}function g(e){return String.fromCharCode.apply(0,e)}if(i.seedrandom=p,v(i.random(),a),e.exports){e.exports=p;try{o=n(342)}catch(y){}}else void 0===(r=function(){return p}.call(t,n,t,e))||(e.exports=r)}([],Math)},,function(e,t,n){(function(e){var r="undefined"!==typeof e&&e||"undefined"!==typeof self&&self||window,a=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(a.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.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(344),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(137))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,a=1,i={},o=!1,s=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c: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;r=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)},c.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 o={callback:e,args:t};return i[a]=o,r(a),a++},c.clearImmediate=u}function u(e){delete i[e]}function l(e){if(o)setTimeout(l,0,e);else{var t=i[e];if(t){o=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{u(e),o=!1}}}}}("undefined"===typeof self?"undefined"===typeof e?this:e:self)}).call(this,n(137),n(187))},,,function(e,t,n){"use strict";var r=n(348);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,i,o){if(o!==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:i,resetWarningCache:a};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,n){"use strict";n(177);var r=n(4),a=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var i=Symbol.for;a=i("react.element"),t.Fragment=i("react.fragment")}var o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,i={},u=null,l=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(l=t.ref),t)s.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:a,type:e,key:u,ref:l,props:i,_owner:o.current}}t.jsx=u,t.jsxs=u},function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,x=r?Symbol.for("react.scope"):60119;function k(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case d:case f:case o:case c:case s:case h:return e;default:switch(e=e&&e.$$typeof){case l:case p:case v:case m:case u:return e;default:return t}}case i:return t}}}function w(e){return k(e)===f}t.AsyncMode=d,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=u,t.Element=a,t.ForwardRef=p,t.Fragment=o,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=c,t.StrictMode=s,t.Suspense=h,t.isAsyncMode=function(e){return w(e)||k(e)===d},t.isConcurrentMode=w,t.isContextConsumer=function(e){return k(e)===l},t.isContextProvider=function(e){return k(e)===u},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return k(e)===p},t.isFragment=function(e){return k(e)===o},t.isLazy=function(e){return k(e)===v},t.isMemo=function(e){return k(e)===m},t.isPortal=function(e){return k(e)===i},t.isProfiler=function(e){return k(e)===c},t.isStrictMode=function(e){return k(e)===s},t.isSuspense=function(e){return k(e)===h},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===f||e===c||e===s||e===h||e===b||"object"===typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===u||e.$$typeof===l||e.$$typeof===p||e.$$typeof===y||e.$$typeof===O||e.$$typeof===x||e.$$typeof===g)},t.typeOf=k},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(14),a=n(135);function i(e){return e&&"object"===Object(a.a)(e)&&e.constructor===Object}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},a=n.clone?Object(r.a)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(i(t[r])&&r in e?a[r]=o(e[r],t[r],n):a[r]=t[r])})),a}},function(e,t,n){"use strict";var r=n(23),a=n(14),i=n(4),o=(n(30),n(25)),s=n(35),c=i.forwardRef((function(e,t){var n=e.classes,s=e.className,c=e.component,u=void 0===c?"div":c,l=e.square,d=void 0!==l&&l,f=e.elevation,p=void 0===f?1:f,h=e.variant,b=void 0===h?"elevation":h,m=Object(r.a)(e,["classes","className","component","square","elevation","variant"]);return i.createElement(u,Object(a.a)({className:Object(o.a)(n.root,s,"outlined"===b?n.outlined:n["elevation".concat(p)],!d&&n.rounded),ref:t},m))}));t.a=Object(s.a)((function(e){var t={};return e.shadows.forEach((function(e,n){t["elevation".concat(n)]={boxShadow:e}})),Object(a.a)({root:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,transition:e.transitions.create("box-shadow")},rounded:{borderRadius:e.shape.borderRadius},outlined:{border:"1px solid ".concat(e.palette.divider)}},t)}),{name:"MuiPaper"})(c)},function(e,t,n){"use strict";n.d(t,"a",(function(){return bn}));var r=n(23),a=n(14),i=n(4),o=n.n(i),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},c="object"===("undefined"===typeof window?"undefined":s(window))&&"object"===("undefined"===typeof document?"undefined":s(document))&&9===document.nodeType,u=(n(111),n(171)),l=n(63),d=n(185),f=n(75),p={}.constructor;function h(e){if(null==e||"object"!==typeof e)return e;if(Array.isArray(e))return e.map(h);if(e.constructor!==p)return e;var t={};for(var n in e)t[n]=h(e[n]);return t}function b(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,a=h(t),i=r.plugins.onCreateRule(e,a,n);return i||(e[0],null)}var m=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n},v=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))return e;var n="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=", "),n+=m(e[r]," ");else n=m(e,", ");return t||"!important"!==e[e.length-1]||(n+=" !important"),n};function g(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function y(e,t,n){void 0===n&&(n={});var r="";if(!t)return r;var a=n.indent,i=void 0===a?0:a,o=t.fallbacks;if(e&&i++,o)if(Array.isArray(o))for(var s=0;s<o.length;s++){var c=o[s];for(var u in c){var l=c[u];null!=l&&(r&&(r+="\n"),r+=""+g(u+": "+v(l)+";",i))}}else for(var d in o){var f=o[d];null!=f&&(r&&(r+="\n"),r+=""+g(d+": "+v(f)+";",i))}for(var p in t){var h=t[p];null!=h&&"fallbacks"!==p&&(r&&(r+="\n"),r+=""+g(p+": "+v(h)+";",i))}return(r||n.allowEmpty)&&e?(r&&(r="\n"+r+"\n"),g(e+" {"+r,--i)+g("}",i)):r}var O=/([[\].#*$><+~=|^:(),"'`\s])/g,x="undefined"!==typeof CSS&&CSS.escape,k=function(e){return x?x(e):e.replace(O,"\\$1")},w=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,a=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:a&&(this.renderer=new a)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var a=t;n&&!1===n.process||(a=this.options.jss.plugins.onChangeValue(t,e,this));var i=null==a||!1===a,o=e in this.style;if(i&&!o&&!r)return this;var s=i&&o;if(s?delete this.style[e]:this.style[e]=a,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,a),this;var c=this.options.sheet;return c&&c.attached,this},e}(),j=function(e){function t(t,n,r){var a;(a=e.call(this,t,n,r)||this).selectorText=void 0,a.id=void 0,a.renderable=void 0;var i=r.selector,o=r.scoped,s=r.sheet,c=r.generateId;return i?a.selectorText=i:!1!==o&&(a.id=c(Object(d.a)(Object(d.a)(a)),s),a.selectorText="."+k(a.id)),a}Object(l.a)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==typeof n?e[t]=n:Array.isArray(n)&&(e[t]=v(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(a.a)({},e,{allowEmpty:!0}):e;return y(this.selectorText,this.style,n)},Object(u.a)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(w),S={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new j(e,t,n)}},N={indent:1,children:!0},I=/@([\w-]+)/,C=function(){function e(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e;var r=e.match(I);for(var i in this.at=r?r[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new Q(Object(a.a)({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){if(void 0===e&&(e=N),null==e.indent&&(e.indent=N.indent),null==e.children&&(e.children=N.children),!1===e.children)return this.query+" {}";var t=this.rules.toString(e);return t?this.query+" {\n"+t+"\n}":""},e}(),T=/@media|@supports\s+/,E={onCreateRule:function(e,t,n){return T.test(e)?new C(e,t,n):null}},A={indent:1,children:!0},R=/@keyframes\s+([\w-]+)/,F=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var r=e.match(R);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var i=n.scoped,o=n.sheet,s=n.generateId;for(var c in this.id=!1===i?this.name:k(s(this,o)),this.rules=new Q(Object(a.a)({},n,{parent:this})),t)this.rules.add(c,t[c],Object(a.a)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=A),null==e.indent&&(e.indent=A.indent),null==e.children&&(e.children=A.children),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),D=/@keyframes\s+/,_=/\$([\w-]+)/g,M=function(e,t){return"string"===typeof e?e.replace(_,(function(e,n){return n in t?t[n]:e})):e},z=function(e,t,n){var r=e[t],a=M(r,n);a!==r&&(e[t]=a)},L={onCreateRule:function(e,t,n){return"string"===typeof e&&D.test(e)?new F(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&z(e,"animation-name",n.keyframes),"animation"in e&&z(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return M(e,r.keyframes);default:return e}}},P=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).renderable=void 0,t}return Object(l.a)(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(a.a)({},e,{allowEmpty:!0}):e;return y(this.key,this.style,n)},t}(w),B={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new P(e,t,n):null}},W=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.style)){for(var t="",n=0;n<this.style.length;n++)t+=y(this.at,this.style[n]),this.style[n+1]&&(t+="\n");return t}return y(this.at,this.style,e)},e}(),U=/@font-face/,V={onCreateRule:function(e,t,n){return U.test(e)?new W(e,t,n):null}},H=function(){function e(e,t,n){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){return y(this.key,this.style,e)},e}(),G={onCreateRule:function(e,t,n){return"@viewport"===e||"@-ms-viewport"===e?new H(e,t,n):null}},q=function(){function e(e,t,n){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.value=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",n=0;n<this.value.length;n++)t+=this.key+" "+this.value[n]+";",this.value[n+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),K={"@charset":!0,"@import":!0,"@namespace":!0},X=[S,E,L,B,V,G,{onCreateRule:function(e,t,n){return e in K?new q(e,t,n):null}}],Y={process:!0},$={force:!0,process:!0},Q=function(){function e(e){this.map={},this.raw={},this.index=[],this.counter=0,this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var t=e.prototype;return t.add=function(e,t,n){var r=this.options,i=r.parent,o=r.sheet,s=r.jss,c=r.Renderer,u=r.generateId,l=r.scoped,d=Object(a.a)({classes:this.classes,parent:i,sheet:o,jss:s,Renderer:c,generateId:u,scoped:l,name:e,keyframes:this.keyframes,selector:void 0},n),f=e;e in this.raw&&(f=e+"-d"+this.counter++),this.raw[f]=t,f in this.classes&&(d.selector="."+k(this.classes[f]));var p=b(f,t,d);if(!p)return null;this.register(p);var h=void 0===d.index?this.index.length:d.index;return this.index.splice(h,0,p),p},t.get=function(e){return this.map[e]},t.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.index.indexOf(e),1)},t.indexOf=function(e){return this.index.indexOf(e)},t.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},t.register=function(e){this.map[e.key]=e,e instanceof j?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof F&&this.keyframes&&(this.keyframes[e.name]=e.id)},t.unregister=function(e){delete this.map[e.key],e instanceof j?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof F&&delete this.keyframes[e.name]},t.update=function(){var e,t,n;if("string"===typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],e=null),e)this.updateOne(this.map[e],t,n);else for(var r=0;r<this.index.length;r++)this.updateOne(this.index[r],t,n)},t.updateOne=function(t,n,r){void 0===r&&(r=Y);var a=this.options,i=a.jss.plugins,o=a.sheet;if(t.rules instanceof e)t.rules.update(n,r);else{var s=t,c=s.style;if(i.onUpdate(n,t,o,r),r.process&&c&&c!==s.style){for(var u in i.onProcessStyle(s.style,s,o),s.style){var l=s.style[u];l!==c[u]&&s.prop(u,l,$)}for(var d in c){var f=s.style[d],p=c[d];null==f&&f!==p&&s.prop(d,null,$)}}}},t.toString=function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,a=0;a<this.index.length;a++){var i=this.index[a].toString(e);(i||r)&&(t&&(t+="\n"),t+=i)}return t},e}(),Z=function(){function e(e,t){for(var n in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=Object(a.a)({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),t.Renderer&&(this.renderer=new t.Renderer(this)),this.rules=new Q(this.options),e)this.rules.add(n,e[n]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},t.addRule=function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var a=this.rules.add(e,t,n);return a?(this.options.jss.plugins.onProcessRule(a),this.attached?this.deployed?(r?r.push(a):(this.insertRule(a),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),a):a:(this.deployed=!1,a)):null},t.insertRule=function(e){this.renderer&&this.renderer.insertRule(e)},t.addRules=function(e,t){var n=[];for(var r in e){var a=this.addRule(r,e[r],t);a&&n.push(a)}return n},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t="object"===typeof e?e:this.rules.get(e);return!(!t||this.attached&&!t.renderable)&&(this.rules.remove(t),!(this.attached&&t.renderable&&this.renderer)||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.updateOne=function(e,t,n){return this.rules.updateOne(e,t,n),this},t.toString=function(e){return this.rules.toString(e)},e}(),J=function(){function e(){this.plugins={internal:[],external:[]},this.registry=void 0}var t=e.prototype;return t.onCreateRule=function(e,t,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var a=this.registry.onCreateRule[r](e,t,n);if(a)return a}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,n)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,n,r){for(var a=0;a<this.registry.onUpdate.length;a++)this.registry.onUpdate[a](e,t,n,r)},t.onChangeValue=function(e,t,n){for(var r=e,a=0;a<this.registry.onChangeValue.length;a++)r=this.registry.onChangeValue[a](r,t,n);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var n=this.plugins[t.queue];-1===n.indexOf(e)&&(n.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce((function(e,t){for(var n in t)n in e&&e[n].push(t[n]);return e}),{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),ee=new(function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,n=e.options.index;if(-1===t.indexOf(e))if(0===t.length||n>=this.index)t.push(e);else for(var r=0;r<t.length;r++)if(t[r].options.index>n)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(f.a)(t,["attached"]),a="",i=0;i<this.registry.length;i++){var o=this.registry[i];null!=n&&o.attached!==n||(a&&(a+="\n"),a+=o.toString(r))}return a},Object(u.a)(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}()),te="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window&&window.Math===Math?window:"undefined"!==typeof self&&self.Math===Math?self:Function("return this")(),ne="2f1acc6c3a606b082e5eef5e54414ffb";null==te[ne]&&(te[ne]=0);var re=te[ne]++,ae=function(e){void 0===e&&(e={});var t=0;return function(n,r){t+=1;var a="",i="";return r&&(r.options.classNamePrefix&&(i=r.options.classNamePrefix),null!=r.options.jss.id&&(a=String(r.options.jss.id))),e.minify?""+(i||"c")+re+a+t:i+n.key+"-"+re+(a?"-"+a:"")+"-"+t}},ie=function(e){var t;return function(){return t||(t=e()),t}},oe=function(e,t){try{return e.attributeStyleMap?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(n){return""}},se=function(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=v(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"important"),!0;e.attributeStyleMap?e.attributeStyleMap.set(t,r):e.style.setProperty(t,r)}catch(a){return!1}return!0},ce=function(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(n){}},ue=function(e,t){return e.selectorText=t,e.selectorText===t},le=ie((function(){return document.querySelector("head")}));function de(e){var t=ee.registry;if(t.length>0){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"===typeof r){var a=function(e){for(var t=le(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(a)return{parent:a.parentNode,node:a.nextSibling}}return!1}var fe=ie((function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null})),pe=function(e,t,n){try{if("insertRule"in e)e.insertRule(t,n);else if("appendRule"in e){e.appendRule(t)}}catch(r){return!1}return e.cssRules[n]},he=function(e,t){var n=e.cssRules.length;return void 0===t||t>n?n:t},be=function(){function e(e){this.getPropertyValue=oe,this.setProperty=se,this.removeProperty=ce,this.setSelector=ue,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,this.cssRules=[],e&&ee.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,a=t.element;this.element=a||function(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var i=fe();i&&this.element.setAttribute("nonce",i)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=de(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"===typeof n.nodeType){var a=n,i=a.parentNode;i&&i.insertBefore(e,a.nextSibling)}else le().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n<e.index.length;n++)this.insertRule(e.index[n],n,t)},t.insertRule=function(e,t,n){if(void 0===n&&(n=this.element.sheet),e.rules){var r=e,a=n;if("conditional"===e.type||"keyframes"===e.type){var i=he(n,t);if(!1===(a=pe(n,r.toString({children:!1}),i)))return!1;this.refCssRule(e,i,a)}return this.insertRules(r.rules,a),a}var o=e.toString();if(!o)return!1;var s=he(n,t),c=pe(n,o,s);return!1!==c&&(this.hasInsertedRules=!0,this.refCssRule(e,s,c),c)},t.refCssRule=function(e,t,n){e.renderable=n,e.options.parent instanceof Z&&(this.cssRules[t]=n)},t.deleteRule=function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),this.cssRules.splice(n,1),!0)},t.indexOf=function(e){return this.cssRules.indexOf(e)},t.replaceRule=function(e,t){var n=this.indexOf(e);return-1!==n&&(this.element.sheet.deleteRule(n),this.cssRules.splice(n,1),this.insertRule(t,n))},t.getRules=function(){return this.element.sheet.cssRules},e}(),me=0,ve=function(){function e(e){this.id=me++,this.version="10.6.0",this.plugins=new J,this.options={id:{minify:!1},createGenerateId:ae,Renderer:c?be:null,plugins:[]},this.generateId=ae({minify:!1});for(var t=0;t<X.length;t++)this.plugins.use(X[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId),e.id&&(this.options.id=Object(a.a)({},this.options.id,e.id)),(e.createGenerateId||e.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),"Renderer"in e&&(this.options.Renderer=e.Renderer),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var n=t.index;"number"!==typeof n&&(n=0===ee.index?0:ee.index+1);var r=new Z(e,Object(a.a)({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r},t.removeStyleSheet=function(e){return e.detach(),ee.remove(e),this},t.createRule=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"object"===typeof e)return this.createRule(void 0,e,t);var r=Object(a.a)({},n,{name:e,jss:this,Renderer:this.options.Renderer});r.generateId||(r.generateId=this.generateId),r.classes||(r.classes={}),r.keyframes||(r.keyframes={});var i=b(e,t,r);return i&&this.plugins.onProcessRule(i),i},t.use=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){e.plugins.use(t)})),this},e}();function ge(e){var t=null;for(var n in e){var r=e[n],a=typeof r;if("function"===a)t||(t={}),t[n]=r;else if("object"===a&&null!==r&&!Array.isArray(r)){var i=ge(r);i&&(t||(t={}),t[n]=i)}}return t}var ye="object"===typeof CSS&&null!=CSS&&"number"in CSS,Oe=function(e){return new ve(e)},xe=(Oe(),n(381)),ke={set:function(e,t,n,r){var a=e.get(t);a||(a=new Map,e.set(t,a)),a.set(n,r)},get:function(e,t,n){var r=e.get(t);return r?r.get(n):void 0},delete:function(e,t,n){e.get(t).delete(n)}},we=n(356),je=(n(30),"function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__"),Se=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];var Ne=Date.now(),Ie="fnValues"+Ne,Ce="fnStyle"+ ++Ne,Te=function(){return{onCreateRule:function(e,t,n){if("function"!==typeof t)return null;var r=b(e,{},n);return r[Ce]=t,r},onProcessStyle:function(e,t){if(Ie in t||Ce in t)return e;var n={};for(var r in e){var a=e[r];"function"===typeof a&&(delete e[r],n[r]=a)}return t[Ie]=n,e},onUpdate:function(e,t,n,r){var a=t,i=a[Ce];i&&(a.style=i(e)||{});var o=a[Ie];if(o)for(var s in o)a.prop(s,o[s](e),r)}}},Ee="@global",Ae="@global ",Re=function(){function e(e,t,n){for(var r in this.type="global",this.at=Ee,this.rules=void 0,this.options=void 0,this.key=void 0,this.isProcessed=!1,this.key=e,this.options=n,this.rules=new Q(Object(a.a)({},n,{parent:this})),t)this.rules.add(r,t[r]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(){return this.rules.toString()},e}(),Fe=function(){function e(e,t,n){this.type="global",this.at=Ee,this.options=void 0,this.rule=void 0,this.isProcessed=!1,this.key=void 0,this.key=e,this.options=n;var r=e.substr(Ae.length);this.rule=n.jss.createRule(r,t,Object(a.a)({},n,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),De=/\s*,\s*/g;function _e(e,t){for(var n=e.split(De),r="",a=0;a<n.length;a++)r+=t+" "+n[a].trim(),n[a+1]&&(r+=", ");return r}var Me=function(){return{onCreateRule:function(e,t,n){if(!e)return null;if(e===Ee)return new Re(e,t,n);if("@"===e[0]&&e.substr(0,Ae.length)===Ae)return new Fe(e,t,n);var r=n.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(n.scoped=!1),!1===n.scoped&&(n.selector=e),null},onProcessRule:function(e,t){"style"===e.type&&t&&(function(e,t){var n=e.options,r=e.style,i=r?r[Ee]:null;if(i){for(var o in i)t.addRule(o,i[o],Object(a.a)({},n,{selector:_e(o,e.selector)}));delete r[Ee]}}(e,t),function(e,t){var n=e.options,r=e.style;for(var i in r)if("@"===i[0]&&i.substr(0,Ee.length)===Ee){var o=_e(i.substr(Ee.length),e.selector);t.addRule(o,r[i],Object(a.a)({},n,{selector:o})),delete r[i]}}(e,t))}}},ze=/\s*,\s*/g,Le=/&/g,Pe=/\$([\w-]+)/g;var Be=function(){function e(e,t){return function(n,r){var a=e.getRule(r)||t&&t.getRule(r);return a?(a=a).selector:r}}function t(e,t){for(var n=t.split(ze),r=e.split(ze),a="",i=0;i<n.length;i++)for(var o=n[i],s=0;s<r.length;s++){var c=r[s];a&&(a+=", "),a+=-1!==c.indexOf("&")?c.replace(Le,o):o+" "+c}return a}function n(e,t,n){if(n)return Object(a.a)({},n,{index:n.index+1});var r=e.options.nestingLevel;r=void 0===r?1:r+1;var i=Object(a.a)({},e.options,{nestingLevel:r,index:t.indexOf(e)+1});return delete i.name,i}return{onProcessStyle:function(r,i,o){if("style"!==i.type)return r;var s,c,u=i,l=u.options.parent;for(var d in r){var f=-1!==d.indexOf("&"),p="@"===d[0];if(f||p){if(s=n(u,l,s),f){var h=t(d,u.selector);c||(c=e(l,o)),h=h.replace(Pe,c),l.addRule(h,r[d],Object(a.a)({},s,{selector:h}))}else p&&l.addRule(d,{},s).addRule(u.key,r[d],{selector:u.selector});delete r[d]}}return r}}},We=/[A-Z]/g,Ue=/^ms-/,Ve={};function He(e){return"-"+e.toLowerCase()}var Ge=function(e){if(Ve.hasOwnProperty(e))return Ve[e];var t=e.replace(We,He);return Ve[e]=Ue.test(t)?"-"+t:t};function qe(e){var t={};for(var n in e){t[0===n.indexOf("--")?n:Ge(n)]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(qe):t.fallbacks=qe(e.fallbacks)),t}var Ke=function(){return{onProcessStyle:function(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]=qe(e[t]);return e}return qe(e)},onChangeValue:function(e,t,n){if(0===t.indexOf("--"))return e;var r=Ge(t);return t===r?e:(n.prop(r,e),null)}}},Xe=ye&&CSS?CSS.px:"px",Ye=ye&&CSS?CSS.ms:"ms",$e=ye&&CSS?CSS.percent:"%";function Qe(e){var t=/(-[a-z])/g,n=function(e){return e[1].toUpperCase()},r={};for(var a in e)r[a]=e[a],r[a.replace(t,n)]=e[a];return r}var Ze=Qe({"animation-delay":Ye,"animation-duration":Ye,"background-position":Xe,"background-position-x":Xe,"background-position-y":Xe,"background-size":Xe,border:Xe,"border-bottom":Xe,"border-bottom-left-radius":Xe,"border-bottom-right-radius":Xe,"border-bottom-width":Xe,"border-left":Xe,"border-left-width":Xe,"border-radius":Xe,"border-right":Xe,"border-right-width":Xe,"border-top":Xe,"border-top-left-radius":Xe,"border-top-right-radius":Xe,"border-top-width":Xe,"border-width":Xe,"border-block":Xe,"border-block-end":Xe,"border-block-end-width":Xe,"border-block-start":Xe,"border-block-start-width":Xe,"border-block-width":Xe,"border-inline":Xe,"border-inline-end":Xe,"border-inline-end-width":Xe,"border-inline-start":Xe,"border-inline-start-width":Xe,"border-inline-width":Xe,"border-start-start-radius":Xe,"border-start-end-radius":Xe,"border-end-start-radius":Xe,"border-end-end-radius":Xe,margin:Xe,"margin-bottom":Xe,"margin-left":Xe,"margin-right":Xe,"margin-top":Xe,"margin-block":Xe,"margin-block-end":Xe,"margin-block-start":Xe,"margin-inline":Xe,"margin-inline-end":Xe,"margin-inline-start":Xe,padding:Xe,"padding-bottom":Xe,"padding-left":Xe,"padding-right":Xe,"padding-top":Xe,"padding-block":Xe,"padding-block-end":Xe,"padding-block-start":Xe,"padding-inline":Xe,"padding-inline-end":Xe,"padding-inline-start":Xe,"mask-position-x":Xe,"mask-position-y":Xe,"mask-size":Xe,height:Xe,width:Xe,"min-height":Xe,"max-height":Xe,"min-width":Xe,"max-width":Xe,bottom:Xe,left:Xe,top:Xe,right:Xe,inset:Xe,"inset-block":Xe,"inset-block-end":Xe,"inset-block-start":Xe,"inset-inline":Xe,"inset-inline-end":Xe,"inset-inline-start":Xe,"box-shadow":Xe,"text-shadow":Xe,"column-gap":Xe,"column-rule":Xe,"column-rule-width":Xe,"column-width":Xe,"font-size":Xe,"font-size-delta":Xe,"letter-spacing":Xe,"text-decoration-thickness":Xe,"text-indent":Xe,"text-stroke":Xe,"text-stroke-width":Xe,"word-spacing":Xe,motion:Xe,"motion-offset":Xe,outline:Xe,"outline-offset":Xe,"outline-width":Xe,perspective:Xe,"perspective-origin-x":$e,"perspective-origin-y":$e,"transform-origin":$e,"transform-origin-x":$e,"transform-origin-y":$e,"transform-origin-z":$e,"transition-delay":Ye,"transition-duration":Ye,"vertical-align":Xe,"flex-basis":Xe,"shape-margin":Xe,size:Xe,gap:Xe,grid:Xe,"grid-gap":Xe,"row-gap":Xe,"grid-row-gap":Xe,"grid-column-gap":Xe,"grid-template-rows":Xe,"grid-template-columns":Xe,"grid-auto-rows":Xe,"grid-auto-columns":Xe,"box-shadow-x":Xe,"box-shadow-y":Xe,"box-shadow-blur":Xe,"box-shadow-spread":Xe,"font-line-height":Xe,"text-shadow-x":Xe,"text-shadow-y":Xe,"text-shadow-blur":Xe});function Je(e,t,n){if(null==t)return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=Je(e,t[r],n);else if("object"===typeof t)if("fallbacks"===e)for(var a in t)t[a]=Je(a,t[a],n);else for(var i in t)t[i]=Je(e+"-"+i,t[i],n);else if("number"===typeof t&&!1===isNaN(t)){var o=n[e]||Ze[e];return!o||0===t&&o===Xe?t.toString():"function"===typeof o?o(t).toString():""+t+o}return t}var et=function(e){void 0===e&&(e={});var t=Qe(e);return{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r in e)e[r]=Je(r,e[r],t);return e},onChangeValue:function(e,n){return Je(n,e,t)}}},tt=n(108),nt="",rt="",at="",it="",ot=c&&"ontouchstart"in document.documentElement;if(c){var st={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},ct=document.createElement("p").style;for(var ut in st)if(ut+"Transform"in ct){nt=ut,rt=st[ut];break}"Webkit"===nt&&"msHyphens"in ct&&(nt="ms",rt=st.ms,it="edge"),"Webkit"===nt&&"-apple-trailing-word"in ct&&(at="apple")}var lt=nt,dt=rt,ft=at,pt=it,ht=ot;var bt={noPrefill:["appearance"],supportedProperty:function(e){return"appearance"===e&&("ms"===lt?"-webkit-"+e:dt+e)}},mt={noPrefill:["color-adjust"],supportedProperty:function(e){return"color-adjust"===e&&("Webkit"===lt?dt+"print-"+e:e)}},vt=/[-\s]+(.)?/g;function gt(e,t){return t?t.toUpperCase():""}function yt(e){return e.replace(vt,gt)}function Ot(e){return yt("-"+e)}var xt,kt={noPrefill:["mask"],supportedProperty:function(e,t){if(!/^mask/.test(e))return!1;if("Webkit"===lt){var n="mask-image";if(yt(n)in t)return e;if(lt+Ot(n)in t)return dt+e}return e}},wt={noPrefill:["text-orientation"],supportedProperty:function(e){return"text-orientation"===e&&("apple"!==ft||ht?e:dt+e)}},jt={noPrefill:["transform"],supportedProperty:function(e,t,n){return"transform"===e&&(n.transform?e:dt+e)}},St={noPrefill:["transition"],supportedProperty:function(e,t,n){return"transition"===e&&(n.transition?e:dt+e)}},Nt={noPrefill:["writing-mode"],supportedProperty:function(e){return"writing-mode"===e&&("Webkit"===lt||"ms"===lt&&"edge"!==pt?dt+e:e)}},It={noPrefill:["user-select"],supportedProperty:function(e){return"user-select"===e&&("Moz"===lt||"ms"===lt||"apple"===ft?dt+e:e)}},Ct={supportedProperty:function(e,t){return!!/^break-/.test(e)&&("Webkit"===lt?"WebkitColumn"+Ot(e)in t&&dt+"column-"+e:"Moz"===lt&&("page"+Ot(e)in t&&"page-"+e))}},Tt={supportedProperty:function(e,t){if(!/^(border|margin|padding)-inline/.test(e))return!1;if("Moz"===lt)return e;var n=e.replace("-inline","");return lt+Ot(n)in t&&dt+n}},Et={supportedProperty:function(e,t){return yt(e)in t&&e}},At={supportedProperty:function(e,t){var n=Ot(e);return"-"===e[0]||"-"===e[0]&&"-"===e[1]?e:lt+n in t?dt+e:"Webkit"!==lt&&"Webkit"+n in t&&"-webkit-"+e}},Rt={supportedProperty:function(e){return"scroll-snap"===e.substring(0,11)&&("ms"===lt?""+dt+e:e)}},Ft={supportedProperty:function(e){return"overscroll-behavior"===e&&("ms"===lt?dt+"scroll-chaining":e)}},Dt={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},_t={supportedProperty:function(e,t){var n=Dt[e];return!!n&&(lt+Ot(n)in t&&dt+n)}},Mt={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},zt=Object.keys(Mt),Lt=function(e){return dt+e},Pt=[bt,mt,kt,wt,jt,St,Nt,It,Ct,Tt,Et,At,Rt,Ft,_t,{supportedProperty:function(e,t,n){var r=n.multiple;if(zt.indexOf(e)>-1){var a=Mt[e];if(!Array.isArray(a))return lt+Ot(a)in t&&dt+a;if(!r)return!1;for(var i=0;i<a.length;i++)if(!(lt+Ot(a[0])in t))return!1;return a.map(Lt)}return!1}}],Bt=Pt.filter((function(e){return e.supportedProperty})).map((function(e){return e.supportedProperty})),Wt=Pt.filter((function(e){return e.noPrefill})).reduce((function(e,t){return e.push.apply(e,Object(tt.a)(t.noPrefill)),e}),[]),Ut={};if(c){xt=document.createElement("p");var Vt=window.getComputedStyle(document.documentElement,"");for(var Ht in Vt)isNaN(Ht)||(Ut[Vt[Ht]]=Vt[Ht]);Wt.forEach((function(e){return delete Ut[e]}))}function Gt(e,t){if(void 0===t&&(t={}),!xt)return e;if(null!=Ut[e])return Ut[e];"transition"!==e&&"transform"!==e||(t[e]=e in xt.style);for(var n=0;n<Bt.length&&(Ut[e]=Bt[n](e,xt.style,t),!Ut[e]);n++);try{xt.style[e]=""}catch(r){return!1}return Ut[e]}var qt,Kt={},Xt={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},Yt=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function $t(e,t,n){if("var"===t)return"var";if("all"===t)return"all";if("all"===n)return", all";var r=t?Gt(t):", "+Gt(n);return r||(t||n)}function Qt(e,t){var n=t;if(!qt||"content"===e)return t;if("string"!==typeof n||!isNaN(parseInt(n,10)))return n;var r=e+n;if(null!=Kt[r])return Kt[r];try{qt.style[e]=n}catch(a){return Kt[r]=!1,!1}if(Xt[e])n=n.replace(Yt,$t);else if(""===qt.style[e]&&("-ms-flex"===(n=dt+n)&&(qt.style[e]="-ms-flexbox"),qt.style[e]=n,""===qt.style[e]))return Kt[r]=!1,!1;return qt.style[e]="",Kt[r]=n,Kt[r]}c&&(qt=document.createElement("p"));var Zt=function(){function e(t){for(var n in t){var r=t[n];if("fallbacks"===n&&Array.isArray(r))t[n]=r.map(e);else{var a=!1,i=Gt(n);i&&i!==n&&(a=!0);var o=!1,s=Qt(i,v(r));s&&s!==r&&(o=!0),(a||o)&&(a&&delete t[n],t[i||n]=s||r)}}return t}return{onProcessRule:function(e){if("keyframes"===e.type){var t=e;t.at="-"===(n=t.at)[1]||"ms"===lt?n:"@"+dt+"keyframes"+n.substr(10)}var n},onProcessStyle:function(t,n){return"style"!==n.type?t:e(t)},onChangeValue:function(e,t){return Qt(t,v(e))||e}}};var Jt=function(){var e=function(e,t){return e.length===t.length?e>t?1:-1:e.length-t.length};return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},a=Object.keys(t).sort(e),i=0;i<a.length;i++)r[a[i]]=t[a[i]];return r}}};function en(){return{plugins:[Te(),Me(),Be(),Ke(),et(),"undefined"===typeof window?null:Zt(),Jt()]}}var tn=Oe(en()),nn={disableGeneration:!1,generateClassName:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.disableGlobal,n=void 0!==t&&t,r=e.productionPrefix,a=void 0===r?"jss":r,i=e.seed,o=void 0===i?"":i,s=""===o?"":"".concat(o,"-"),c=0,u=function(){return c+=1};return function(e,t){var r=t.options.name;if(r&&0===r.indexOf("Mui")&&!t.options.link&&!n){if(-1!==Se.indexOf(e.key))return"Mui-".concat(e.key);var i="".concat(s).concat(r,"-").concat(e.key);return t.options.theme[je]&&""===o?"".concat(i,"-").concat(u()):i}return"".concat(s).concat(a).concat(u())}}(),jss:tn,sheetsCache:null,sheetsManager:new Map,sheetsRegistry:null},rn=o.a.createContext(nn);var an=-1e9;function on(){return an+=1}n(135);var sn=n(353);function cn(e){var t="function"===typeof e;return{create:function(n,r){var i;try{i=t?e(n):e}catch(c){throw c}if(!r||!n.overrides||!n.overrides[r])return i;var o=n.overrides[r],s=Object(a.a)({},i);return Object.keys(o).forEach((function(e){s[e]=Object(sn.a)(s[e],o[e])})),s},options:{}}}var un={};function ln(e,t,n){var r=e.state;if(e.stylesOptions.disableGeneration)return t||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var a=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,a=!0),t!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=t,a=!0),a&&(r.cacheClasses.value=Object(xe.a)({baseClasses:r.cacheClasses.lastJSS,newClasses:t,Component:n})),r.cacheClasses.value}function dn(e,t){var n=e.state,r=e.theme,i=e.stylesOptions,o=e.stylesCreator,s=e.name;if(!i.disableGeneration){var c=ke.get(i.sheetsManager,o,r);c||(c={refs:0,staticSheet:null,dynamicStyles:null},ke.set(i.sheetsManager,o,r,c));var u=Object(a.a)({},o.options,i,{theme:r,flip:"boolean"===typeof i.flip?i.flip:"rtl"===r.direction});u.generateId=u.serverGenerateClassName||u.generateClassName;var l=i.sheetsRegistry;if(0===c.refs){var d;i.sheetsCache&&(d=ke.get(i.sheetsCache,o,r));var f=o.create(r,s);d||((d=i.jss.createStyleSheet(f,Object(a.a)({link:!1},u))).attach(),i.sheetsCache&&ke.set(i.sheetsCache,o,r,d)),l&&l.add(d),c.staticSheet=d,c.dynamicStyles=ge(f)}if(c.dynamicStyles){var p=i.jss.createStyleSheet(c.dynamicStyles,Object(a.a)({link:!0},u));p.update(t),p.attach(),n.dynamicSheet=p,n.classes=Object(xe.a)({baseClasses:c.staticSheet.classes,newClasses:p.classes}),l&&l.add(p)}else n.classes=c.staticSheet.classes;c.refs+=1}}function fn(e,t){var n=e.state;n.dynamicSheet&&n.dynamicSheet.update(t)}function pn(e){var t=e.state,n=e.theme,r=e.stylesOptions,a=e.stylesCreator;if(!r.disableGeneration){var i=ke.get(r.sheetsManager,a,n);i.refs-=1;var o=r.sheetsRegistry;0===i.refs&&(ke.delete(r.sheetsManager,a,n),r.jss.removeStyleSheet(i.staticSheet),o&&o.remove(i.staticSheet)),t.dynamicSheet&&(r.jss.removeStyleSheet(t.dynamicSheet),o&&o.remove(t.dynamicSheet))}}function hn(e,t){var n,r=o.a.useRef([]),a=o.a.useMemo((function(){return{}}),t);r.current!==a&&(r.current=a,n=e()),o.a.useEffect((function(){return function(){n&&n()}}),[a])}function bn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name,i=t.classNamePrefix,s=t.Component,c=t.defaultTheme,u=void 0===c?un:c,l=Object(r.a)(t,["name","classNamePrefix","Component","defaultTheme"]),d=cn(e),f=n||i||"makeStyles";d.options={index:on(),name:n,meta:f,classNamePrefix:f};var p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(we.a)()||u,r=Object(a.a)({},o.a.useContext(rn),l),i=o.a.useRef(),c=o.a.useRef();hn((function(){var a={name:n,state:{},stylesCreator:d,stylesOptions:r,theme:t};return dn(a,e),c.current=!1,i.current=a,function(){pn(a)}}),[t,d]),o.a.useEffect((function(){c.current&&fn(i.current,e),c.current=!0}));var f=ln(i.current,e.classes,s);return f};return p}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4),a=n.n(r);var i=a.a.createContext(null);function o(){return a.a.useContext(i)}},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(14);function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;e.Component;if(!n)return t;var a=Object(r.a)({},t);return Object.keys(n).forEach((function(e){n[e]&&(a[e]="".concat(t[e]," ").concat(n[e]))})),a}},function(e,t,n){"use strict";var r=n(14),a=n(23),i=n(4),o=(n(30),n(25)),s=n(35),c=n(42),u={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},l=i.forwardRef((function(e,t){var n=e.align,s=void 0===n?"inherit":n,l=e.classes,d=e.className,f=e.color,p=void 0===f?"initial":f,h=e.component,b=e.display,m=void 0===b?"initial":b,v=e.gutterBottom,g=void 0!==v&&v,y=e.noWrap,O=void 0!==y&&y,x=e.paragraph,k=void 0!==x&&x,w=e.variant,j=void 0===w?"body1":w,S=e.variantMapping,N=void 0===S?u:S,I=Object(a.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),C=h||(k?"p":N[j]||u[j])||"span";return i.createElement(C,Object(r.a)({className:Object(o.a)(l.root,d,"inherit"!==j&&l[j],"initial"!==p&&l["color".concat(Object(c.a)(p))],O&&l.noWrap,g&&l.gutterBottom,k&&l.paragraph,"inherit"!==s&&l["align".concat(Object(c.a)(s))],"initial"!==m&&l["display".concat(Object(c.a)(m))]),ref:t},I))}));t.a=Object(s.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(l)},function(e,t,n){"use strict";function r(e){var t=e.theme,n=e.name,r=e.props;if(!t||!t.props||!t.props[n])return r;var a,i=t.props[n];for(a in i)void 0===r[a]&&(r[a]=i[a]);return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(14),a=n(23),i=n(4),o=(n(30),n(25)),s=n(42),c=n(35),u=n(47),l=n(107),d=i.forwardRef((function(e,t){var n=e.classes,c=e.className,u=e.color,d=void 0===u?"primary":u,f=e.value,p=e.valueBuffer,h=e.variant,b=void 0===h?"indeterminate":h,m=Object(a.a)(e,["classes","className","color","value","valueBuffer","variant"]),v=Object(l.a)(),g={},y={bar1:{},bar2:{}};if("determinate"===b||"buffer"===b)if(void 0!==f){g["aria-valuenow"]=Math.round(f),g["aria-valuemin"]=0,g["aria-valuemax"]=100;var O=f-100;"rtl"===v.direction&&(O=-O),y.bar1.transform="translateX(".concat(O,"%)")}else 0;if("buffer"===b)if(void 0!==p){var x=(p||0)-100;"rtl"===v.direction&&(x=-x),y.bar2.transform="translateX(".concat(x,"%)")}else 0;return i.createElement("div",Object(r.a)({className:Object(o.a)(n.root,n["color".concat(Object(s.a)(d))],c,{determinate:n.determinate,indeterminate:n.indeterminate,buffer:n.buffer,query:n.query}[b]),role:"progressbar"},g,{ref:t},m),"buffer"===b?i.createElement("div",{className:Object(o.a)(n.dashed,n["dashedColor".concat(Object(s.a)(d))])}):null,i.createElement("div",{className:Object(o.a)(n.bar,n["barColor".concat(Object(s.a)(d))],("indeterminate"===b||"query"===b)&&n.bar1Indeterminate,{determinate:n.bar1Determinate,buffer:n.bar1Buffer}[b]),style:y.bar1}),"determinate"===b?null:i.createElement("div",{className:Object(o.a)(n.bar,("indeterminate"===b||"query"===b)&&n.bar2Indeterminate,"buffer"===b?[n["color".concat(Object(s.a)(d))],n.bar2Buffer]:n["barColor".concat(Object(s.a)(d))]),style:y.bar2}))}));t.a=Object(c.a)((function(e){var t=function(t){return"light"===e.palette.type?Object(u.e)(t,.62):Object(u.a)(t,.5)},n=t(e.palette.primary.main),r=t(e.palette.secondary.main);return{root:{position:"relative",overflow:"hidden",height:4,"@media print":{colorAdjust:"exact"}},colorPrimary:{backgroundColor:n},colorSecondary:{backgroundColor:r},determinate:{},indeterminate:{},buffer:{backgroundColor:"transparent"},query:{transform:"rotate(180deg)"},dashed:{position:"absolute",marginTop:0,height:"100%",width:"100%",animation:"$buffer 3s infinite linear"},dashedColorPrimary:{backgroundImage:"radial-gradient(".concat(n," 0%, ").concat(n," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},dashedColorSecondary:{backgroundImage:"radial-gradient(".concat(r," 0%, ").concat(r," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},bar:{width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},barColorPrimary:{backgroundColor:e.palette.primary.main},barColorSecondary:{backgroundColor:e.palette.secondary.main},bar1Indeterminate:{width:"auto",animation:"$indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite"},bar1Determinate:{transition:"transform .".concat(4,"s linear")},bar1Buffer:{zIndex:1,transition:"transform .".concat(4,"s linear")},bar2Indeterminate:{width:"auto",animation:"$indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite"},bar2Buffer:{transition:"transform .".concat(4,"s linear")},"@keyframes indeterminate1":{"0%":{left:"-35%",right:"100%"},"60%":{left:"100%",right:"-90%"},"100%":{left:"100%",right:"-90%"}},"@keyframes indeterminate2":{"0%":{left:"-200%",right:"100%"},"60%":{left:"107%",right:"-8%"},"100%":{left:"107%",right:"-8%"}},"@keyframes buffer":{"0%":{opacity:1,backgroundPosition:"0 -23px"},"50%":{opacity:0,backgroundPosition:"0 -23px"},"100%":{opacity:1,backgroundPosition:"-200px -23px"}}}}),{name:"MuiLinearProgress"})(d)},function(e,t,n){"use strict";var r=n(23),a=n(14),i=n(4),o=(n(30),n(25)),s=n(35),c=n(47),u=n(313),l=n(42),d=i.forwardRef((function(e,t){var n=e.children,s=e.classes,c=e.className,d=e.color,f=void 0===d?"default":d,p=e.component,h=void 0===p?"button":p,b=e.disabled,m=void 0!==b&&b,v=e.disableElevation,g=void 0!==v&&v,y=e.disableFocusRipple,O=void 0!==y&&y,x=e.endIcon,k=e.focusVisibleClassName,w=e.fullWidth,j=void 0!==w&&w,S=e.size,N=void 0===S?"medium":S,I=e.startIcon,C=e.type,T=void 0===C?"button":C,E=e.variant,A=void 0===E?"text":E,R=Object(r.a)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),F=I&&i.createElement("span",{className:Object(o.a)(s.startIcon,s["iconSize".concat(Object(l.a)(N))])},I),D=x&&i.createElement("span",{className:Object(o.a)(s.endIcon,s["iconSize".concat(Object(l.a)(N))])},x);return i.createElement(u.a,Object(a.a)({className:Object(o.a)(s.root,s[A],c,"inherit"===f?s.colorInherit:"default"!==f&&s["".concat(A).concat(Object(l.a)(f))],"medium"!==N&&[s["".concat(A,"Size").concat(Object(l.a)(N))],s["size".concat(Object(l.a)(N))]],g&&s.disableElevation,m&&s.disabled,j&&s.fullWidth),component:h,disabled:m,focusRipple:!O,focusVisibleClassName:Object(o.a)(s.focusVisible,k),ref:t,type:T},R),i.createElement("span",{className:s.label},F,n,D))}));t.a=Object(s.a)((function(e){return{root:Object(a.a)({},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:Object(c.c)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(c.c)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(c.c)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabledBackground)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(Object(c.c)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:Object(c.c)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(Object(c.c)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:Object(c.c)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&:hover":{backgroundColor:e.palette.grey.A100,boxShadow:e.shadows[4],"@media (hover: none)":{boxShadow:e.shadows[2],backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(d)},function(e,t,n){"use strict";var r=n(14),a=n(355),i=n(129);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(e,Object(r.a)({defaultTheme:i.a},t))}},function(e,t,n){"use strict";var r=n(4),a=n(87);t.a=Object(a.a)(r.createElement("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"}),"Description")},function(e,t,n){"use strict";var r=n(4),a=n(87);t.a=Object(a.a)(r.createElement("path",{d:"M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.6-1.4-1.4-1.8-1.4-1.8-1-.7.1-.7.1-.7 1.2 0 1.9 1.2 1.9 1.2 1 1.8 2.8 1.3 3.5 1 0-.8.4-1.3.7-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.2.5-2.3 1.3-3.1-.2-.4-.6-1.6 0-3.2 0 0 1-.3 3.4 1.2a11.5 11.5 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.6 1.6.2 2.8 0 3.2.9.8 1.3 1.9 1.3 3.2 0 4.6-2.8 5.6-5.5 5.9.5.4.9 1 .9 2.2v3.3c0 .3.1.7.8.6A12 12 0 0 0 12 .3"}),"GitHub")},function(e,t,n){"use strict";var r=n(4),a=n(87);t.a=Object(a.a)(r.createElement("path",{d:"M9.4 10.5l4.77-8.26C13.47 2.09 12.75 2 12 2c-2.4 0-4.6.85-6.32 2.25l3.66 6.35.06-.1zM21.54 9c-.92-2.92-3.15-5.26-6-6.34L11.88 9h9.66zm.26 1h-7.49l.29.5 4.76 8.25C21 16.97 22 14.61 22 12c0-.69-.07-1.35-.2-2zM8.54 12l-3.9-6.75C3.01 7.03 2 9.39 2 12c0 .69.07 1.35.2 2h7.49l-1.15-2zm-6.08 3c.92 2.92 3.15 5.26 6 6.34L12.12 15H2.46zm11.27 0l-3.9 6.76c.7.15 1.42.24 2.17.24 2.4 0 4.6-.85 6.32-2.25l-3.66-6.35-.93 1.6z"}),"Camera")},function(e,t,n){"use strict";var r=n(14),a=n(4),i=(n(30),n(35)),o={WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box"},s=function(e){return Object(r.a)({color:e.palette.text.primary},e.typography.body2,{backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}})};t.a=Object(i.a)((function(e){return{"@global":{html:o,"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:Object(r.a)({margin:0},s(e),{"&::backdrop":{backgroundColor:e.palette.background.default}})}}}),{name:"MuiCssBaseline"})((function(e){var t=e.children,n=void 0===t?null:t;return e.classes,a.createElement(a.Fragment,null,n)}))},function(e,t,n){"use strict";var r=n(14),a=n(23),i=n(4),o=(n(30),n(25)),s=n(35),c=n(42),u=n(354),l=i.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.color,d=void 0===l?"primary":l,f=e.position,p=void 0===f?"fixed":f,h=Object(a.a)(e,["classes","className","color","position"]);return i.createElement(u.a,Object(r.a)({square:!0,component:"header",elevation:4,className:Object(o.a)(n.root,n["position".concat(Object(c.a)(p))],n["color".concat(Object(c.a)(d))],s,"fixed"===p&&"mui-fixed"),ref:t},h))}));t.a=Object(s.a)((function(e){var t="light"===e.palette.type?e.palette.grey[100]:e.palette.grey[900];return{root:{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",zIndex:e.zIndex.appBar,flexShrink:0},positionFixed:{position:"fixed",top:0,left:"auto",right:0,"@media print":{position:"absolute"}},positionAbsolute:{position:"absolute",top:0,left:"auto",right:0},positionSticky:{position:"sticky",top:0,left:"auto",right:0},positionStatic:{position:"static"},positionRelative:{position:"relative"},colorDefault:{backgroundColor:t,color:e.palette.getContrastText(t)},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorInherit:{color:"inherit"},colorTransparent:{backgroundColor:"transparent",color:"inherit"}}}),{name:"MuiAppBar"})(l)},function(e,t,n){"use strict";var r=n(14),a=n(23),i=n(57),o=n(4),s=(n(30),n(25)),c=n(35),u=o.forwardRef((function(e,t){var n=e.classes,i=e.className,c=e.component,u=void 0===c?"div":c,l=e.disableGutters,d=void 0!==l&&l,f=e.variant,p=void 0===f?"regular":f,h=Object(a.a)(e,["classes","className","component","disableGutters","variant"]);return o.createElement(u,Object(r.a)({className:Object(s.a)(n.root,n[p],i,!d&&n.gutters),ref:t},h))}));t.a=Object(c.a)((function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:Object(i.a)({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),regular:e.mixins.toolbar,dense:{minHeight:48}}}),{name:"MuiToolbar"})(u)},function(e,t,n){"use strict";var r=n(23),a=n(57),i=n(14),o=n(4),s=(n(30),n(25)),c=n(35),u=n(313),l=n(42),d=o.forwardRef((function(e,t){var n=e.classes,a=e.className,c=e.disabled,d=void 0!==c&&c,f=e.disableFocusRipple,p=void 0!==f&&f,h=e.fullWidth,b=e.icon,m=e.indicator,v=e.label,g=e.onChange,y=e.onClick,O=e.onFocus,x=e.selected,k=e.selectionFollowsFocus,w=e.textColor,j=void 0===w?"inherit":w,S=e.value,N=e.wrapped,I=void 0!==N&&N,C=Object(r.a)(e,["classes","className","disabled","disableFocusRipple","fullWidth","icon","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"]);return o.createElement(u.a,Object(i.a)({focusRipple:!p,className:Object(s.a)(n.root,n["textColor".concat(Object(l.a)(j))],a,d&&n.disabled,x&&n.selected,v&&b&&n.labelIcon,h&&n.fullWidth,I&&n.wrapped),ref:t,role:"tab","aria-selected":x,disabled:d,onClick:function(e){g&&g(e,S),y&&y(e)},onFocus:function(e){k&&!x&&g&&g(e,S),O&&O(e)},tabIndex:x?0:-1},C),o.createElement("span",{className:n.wrapper},b,v),m)}));t.a=Object(c.a)((function(e){var t;return{root:Object(i.a)({},e.typography.button,(t={maxWidth:264,minWidth:72,position:"relative",boxSizing:"border-box",minHeight:48,flexShrink:0,padding:"6px 12px"},Object(a.a)(t,e.breakpoints.up("sm"),{padding:"6px 24px"}),Object(a.a)(t,"overflow","hidden"),Object(a.a)(t,"whiteSpace","normal"),Object(a.a)(t,"textAlign","center"),Object(a.a)(t,e.breakpoints.up("sm"),{minWidth:160}),t)),labelIcon:{minHeight:72,paddingTop:9,"& $wrapper > *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled}},textColorSecondary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:e.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}}}),{name:"MuiTab"})(d)},function(e,t,n){"use strict";var r=n(14),a=n(23),i=n(4),o=n.n(i),s=(n(30),n(25)),c=n(312);function u(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&"undefined"===typeof t[n]&&(e[n]=r[n]),e}),{})}var l=i.createContext();var d=l,f=n(35),p=n(42),h=n(50),b=n(113);function m(e,t){return parseInt(e[t],10)||0}var v="undefined"!==typeof window?i.useLayoutEffect:i.useEffect,g={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},y=i.forwardRef((function(e,t){var n=e.onChange,o=e.rows,s=e.rowsMax,c=e.rowsMin,u=void 0===c?1:c,l=e.style,d=e.value,f=Object(a.a)(e,["onChange","rows","rowsMax","rowsMin","style","value"]),p=o||u,y=i.useRef(null!=d).current,O=i.useRef(null),x=Object(h.a)(t,O),k=i.useRef(null),w=i.useRef(0),j=i.useState({}),S=j[0],N=j[1],I=i.useCallback((function(){var t=O.current,n=window.getComputedStyle(t),r=k.current;r.style.width=n.width,r.value=t.value||e.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");var a=n["box-sizing"],i=m(n,"padding-bottom")+m(n,"padding-top"),o=m(n,"border-bottom-width")+m(n,"border-top-width"),c=r.scrollHeight-i;r.value="x";var u=r.scrollHeight-i,l=c;p&&(l=Math.max(Number(p)*u,l)),s&&(l=Math.min(Number(s)*u,l));var d=(l=Math.max(l,u))+("border-box"===a?i+o:0),f=Math.abs(l-c)<=1;N((function(e){return w.current<20&&(d>0&&Math.abs((e.outerHeightStyle||0)-d)>1||e.overflow!==f)?(w.current+=1,{overflow:f,outerHeightStyle:d}):e}))}),[s,p,e.placeholder]);i.useEffect((function(){var e=Object(b.a)((function(){w.current=0,I()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[I]),v((function(){I()})),i.useEffect((function(){w.current=0}),[d]);return i.createElement(i.Fragment,null,i.createElement("textarea",Object(r.a)({value:d,onChange:function(e){w.current=0,y||I(),n&&n(e)},ref:x,rows:p,style:Object(r.a)({height:S.outerHeightStyle,overflow:S.overflow?"hidden":null},l)},f)),i.createElement("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:k,tabIndex:-1,style:Object(r.a)({},g,l)}))}));function O(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function x(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(O(e.value)&&""!==e.value||t&&O(e.defaultValue)&&""!==e.defaultValue)}var k="undefined"===typeof window?i.useEffect:i.useLayoutEffect,w=i.forwardRef((function(e,t){var n=e["aria-describedby"],o=e.autoComplete,f=e.autoFocus,b=e.classes,m=e.className,v=(e.color,e.defaultValue),g=e.disabled,O=e.endAdornment,w=(e.error,e.fullWidth),j=void 0!==w&&w,S=e.id,N=e.inputComponent,I=void 0===N?"input":N,C=e.inputProps,T=void 0===C?{}:C,E=e.inputRef,A=(e.margin,e.multiline),R=void 0!==A&&A,F=e.name,D=e.onBlur,_=e.onChange,M=e.onClick,z=e.onFocus,L=e.onKeyDown,P=e.onKeyUp,B=e.placeholder,W=e.readOnly,U=e.renderSuffix,V=e.rows,H=e.rowsMax,G=e.rowsMin,q=e.startAdornment,K=e.type,X=void 0===K?"text":K,Y=e.value,$=Object(a.a)(e,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","startAdornment","type","value"]),Q=null!=T.value?T.value:Y,Z=i.useRef(null!=Q).current,J=i.useRef(),ee=i.useCallback((function(e){0}),[]),te=Object(h.a)(T.ref,ee),ne=Object(h.a)(E,te),re=Object(h.a)(J,ne),ae=i.useState(!1),ie=ae[0],oe=ae[1],se=i.useContext(l);var ce=u({props:e,muiFormControl:se,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});ce.focused=se?se.focused:ie,i.useEffect((function(){!se&&g&&ie&&(oe(!1),D&&D())}),[se,g,ie,D]);var ue=se&&se.onFilled,le=se&&se.onEmpty,de=i.useCallback((function(e){x(e)?ue&&ue():le&&le()}),[ue,le]);k((function(){Z&&de({value:Q})}),[Q,de,Z]);i.useEffect((function(){de(J.current)}),[]);var fe=I,pe=Object(r.a)({},T,{ref:re});"string"!==typeof fe?pe=Object(r.a)({inputRef:re,type:X},pe,{ref:null}):R?!V||H||G?(pe=Object(r.a)({rows:V,rowsMax:H},pe),fe=y):fe="textarea":pe=Object(r.a)({type:X},pe);return i.useEffect((function(){se&&se.setAdornedStart(Boolean(q))}),[se,q]),i.createElement("div",Object(r.a)({className:Object(s.a)(b.root,b["color".concat(Object(p.a)(ce.color||"primary"))],m,ce.disabled&&b.disabled,ce.error&&b.error,j&&b.fullWidth,ce.focused&&b.focused,se&&b.formControl,R&&b.multiline,q&&b.adornedStart,O&&b.adornedEnd,"dense"===ce.margin&&b.marginDense),onClick:function(e){J.current&&e.currentTarget===e.target&&J.current.focus(),M&&M(e)},ref:t},$),q,i.createElement(d.Provider,{value:null},i.createElement(fe,Object(r.a)({"aria-invalid":ce.error,"aria-describedby":n,autoComplete:o,autoFocus:f,defaultValue:v,disabled:ce.disabled,id:S,onAnimationStart:function(e){de("mui-auto-fill-cancel"===e.animationName?J.current:{value:"x"})},name:F,placeholder:B,readOnly:W,required:ce.required,rows:V,value:Q,onKeyDown:L,onKeyUp:P},pe,{className:Object(s.a)(b.input,T.className,ce.disabled&&b.disabled,R&&b.inputMultiline,ce.hiddenLabel&&b.inputHiddenLabel,q&&b.inputAdornedStart,O&&b.inputAdornedEnd,"search"===X&&b.inputTypeSearch,"dense"===ce.margin&&b.inputMarginDense),onBlur:function(e){D&&D(e),T.onBlur&&T.onBlur(e),se&&se.onBlur?se.onBlur(e):oe(!1)},onChange:function(e){if(!Z){var t=e.target||J.current;if(null==t)throw new Error(Object(c.a)(1));de({value:t.value})}for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];T.onChange&&T.onChange.apply(T,[e].concat(r)),_&&_.apply(void 0,[e].concat(r))},onFocus:function(e){ce.disabled?e.stopPropagation():(z&&z(e),T.onFocus&&T.onFocus(e),se&&se.onFocus?se.onFocus(e):oe(!0))}}))),O,U?U(Object(r.a)({},ce,{startAdornment:q})):null)})),j=Object(f.a)((function(e){var t="light"===e.palette.type,n={color:"currentColor",opacity:t?.42:.5,transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},a={opacity:"0 !important"},i={opacity:t?.42:.5};return{"@global":{"@keyframes mui-auto-fill":{},"@keyframes mui-auto-fill-cancel":{}},root:Object(r.a)({},e.typography.body1,{color:e.palette.text.primary,lineHeight:"1.1876em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center","&$disabled":{color:e.palette.text.disabled,cursor:"default"}}),formControl:{},focused:{},disabled:{},adornedStart:{},adornedEnd:{},error:{},marginDense:{},multiline:{padding:"".concat(6,"px 0 ").concat(7,"px"),"&$marginDense":{paddingTop:3}},colorSecondary:{},fullWidth:{width:"100%"},input:{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"".concat(6,"px 0 ").concat(7,"px"),border:0,boxSizing:"content-box",background:"none",height:"1.1876em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{"-webkit-appearance":"none"},"label[data-shrink=false] + $formControl &":{"&::-webkit-input-placeholder":a,"&::-moz-placeholder":a,"&:-ms-input-placeholder":a,"&::-ms-input-placeholder":a,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus:-ms-input-placeholder":i,"&:focus::-ms-input-placeholder":i},"&$disabled":{opacity:1},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},inputMarginDense:{paddingTop:3},inputMultiline:{height:"auto",resize:"none",padding:0},inputTypeSearch:{"-moz-appearance":"textfield","-webkit-appearance":"textfield"},inputAdornedStart:{},inputAdornedEnd:{},inputHiddenLabel:{}}}),{name:"MuiInputBase"})(w),S=i.forwardRef((function(e,t){var n=e.disableUnderline,o=e.classes,c=e.fullWidth,u=void 0!==c&&c,l=e.inputComponent,d=void 0===l?"input":l,f=e.multiline,p=void 0!==f&&f,h=e.type,b=void 0===h?"text":h,m=Object(a.a)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return i.createElement(j,Object(r.a)({classes:Object(r.a)({},o,{root:Object(s.a)(o.root,!n&&o.underline),underline:null}),fullWidth:u,inputComponent:d,multiline:p,ref:t,type:b},m))}));S.muiName="Input";var N=Object(f.a)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{position:"relative"},formControl:{"label + &":{marginTop:16}},focused:{},disabled:{},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(t),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):before":{borderBottom:"2px solid ".concat(e.palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(t)}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{},marginDense:{},multiline:{},fullWidth:{},input:{},inputMarginDense:{},inputMultiline:{},inputTypeSearch:{}}}),{name:"MuiInput"})(S),I=i.forwardRef((function(e,t){var n=e.disableUnderline,o=e.classes,c=e.fullWidth,u=void 0!==c&&c,l=e.inputComponent,d=void 0===l?"input":l,f=e.multiline,p=void 0!==f&&f,h=e.type,b=void 0===h?"text":h,m=Object(a.a)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return i.createElement(j,Object(r.a)({classes:Object(r.a)({},o,{root:Object(s.a)(o.root,!n&&o.underline),underline:null}),fullWidth:u,inputComponent:d,multiline:p,ref:t,type:b},m))}));I.muiName="Input";var C=Object(f.a)((function(e){var t="light"===e.palette.type,n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)";return{root:{position:"relative",backgroundColor:r,borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:t?"rgba(0, 0, 0, 0.13)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:r}},"&$focused":{backgroundColor:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)"},"&$disabled":{backgroundColor:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(n),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:before":{borderBottom:"1px solid ".concat(e.palette.text.primary)},"&$disabled:before":{borderBottomStyle:"dotted"}},focused:{},disabled:{},adornedStart:{paddingLeft:12},adornedEnd:{paddingRight:12},error:{},marginDense:{},multiline:{padding:"27px 12px 10px","&$marginDense":{paddingTop:23,paddingBottom:6}},input:{padding:"27px 12px 10px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},inputMarginDense:{paddingTop:23,paddingBottom:6},inputHiddenLabel:{paddingTop:18,paddingBottom:19,"&$inputMarginDense":{paddingTop:10,paddingBottom:11}},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiFilledInput"})(I),T=n(57),E=n(107),A=i.forwardRef((function(e,t){e.children;var n=e.classes,o=e.className,c=e.label,u=e.labelWidth,l=e.notched,d=e.style,f=Object(a.a)(e,["children","classes","className","label","labelWidth","notched","style"]),h="rtl"===Object(E.a)().direction?"right":"left";if(void 0!==c)return i.createElement("fieldset",Object(r.a)({"aria-hidden":!0,className:Object(s.a)(n.root,o),ref:t,style:d},f),i.createElement("legend",{className:Object(s.a)(n.legendLabelled,l&&n.legendNotched)},c?i.createElement("span",null,c):i.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}})));var b=u>0?.75*u+8:.01;return i.createElement("fieldset",Object(r.a)({"aria-hidden":!0,style:Object(r.a)(Object(T.a)({},"padding".concat(Object(p.a)(h)),8),d),className:Object(s.a)(n.root,o),ref:t},f),i.createElement("legend",{className:n.legend,style:{width:l?b:.01}},i.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}})))})),R=Object(f.a)((function(e){return{root:{position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden"},legend:{textAlign:"left",padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},legendLabelled:{display:"block",width:"auto",textAlign:"left",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),"& > span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}}),{name:"PrivateNotchedOutline"})(A),F=i.forwardRef((function(e,t){var n=e.classes,o=e.fullWidth,c=void 0!==o&&o,u=e.inputComponent,l=void 0===u?"input":u,d=e.label,f=e.labelWidth,p=void 0===f?0:f,h=e.multiline,b=void 0!==h&&h,m=e.notched,v=e.type,g=void 0===v?"text":v,y=Object(a.a)(e,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return i.createElement(j,Object(r.a)({renderSuffix:function(e){return i.createElement(R,{className:n.notchedOutline,label:d,labelWidth:p,notched:"undefined"!==typeof m?m:Boolean(e.startAdornment||e.filled||e.focused)})},classes:Object(r.a)({},n,{root:Object(s.a)(n.root,n.underline),notchedOutline:null}),fullWidth:c,inputComponent:l,multiline:b,ref:t,type:g},y))}));F.muiName="Input";var D=Object(f.a)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:e.shape.borderRadius,"&:hover $notchedOutline":{borderColor:e.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:e.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiOutlinedInput"})(F);function _(){return i.useContext(d)}var M=i.forwardRef((function(e,t){var n=e.children,o=e.classes,c=e.className,l=(e.color,e.component),d=void 0===l?"label":l,f=(e.disabled,e.error,e.filled,e.focused,e.required,Object(a.a)(e,["children","classes","className","color","component","disabled","error","filled","focused","required"])),h=u({props:e,muiFormControl:_(),states:["color","required","focused","disabled","error","filled"]});return i.createElement(d,Object(r.a)({className:Object(s.a)(o.root,o["color".concat(Object(p.a)(h.color||"primary"))],c,h.disabled&&o.disabled,h.error&&o.error,h.filled&&o.filled,h.focused&&o.focused,h.required&&o.required),ref:t},f),n,h.required&&i.createElement("span",{"aria-hidden":!0,className:Object(s.a)(o.asterisk,h.error&&o.error)},"\u2009","*"))})),z=Object(f.a)((function(e){return{root:Object(r.a)({color:e.palette.text.secondary},e.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),colorSecondary:{"&$focused":{color:e.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:e.palette.error.main}}}}),{name:"MuiFormLabel"})(M),L=i.forwardRef((function(e,t){var n=e.classes,o=e.className,c=e.disableAnimation,l=void 0!==c&&c,d=(e.margin,e.shrink),f=(e.variant,Object(a.a)(e,["classes","className","disableAnimation","margin","shrink","variant"])),p=_(),h=d;"undefined"===typeof h&&p&&(h=p.filled||p.focused||p.adornedStart);var b=u({props:e,muiFormControl:p,states:["margin","variant"]});return i.createElement(z,Object(r.a)({"data-shrink":h,className:Object(s.a)(n.root,o,p&&n.formControl,!l&&n.animated,h&&n.shrink,"dense"===b.margin&&n.marginDense,{filled:n.filled,outlined:n.outlined}[b.variant]),classes:{focused:n.focused,disabled:n.disabled,error:n.error,required:n.required,asterisk:n.asterisk},ref:t},f))})),P=Object(f.a)((function(e){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}}),{name:"MuiInputLabel"})(L),B=n(172),W=i.forwardRef((function(e,t){var n=e.children,o=e.classes,c=e.className,u=e.color,l=void 0===u?"primary":u,f=e.component,h=void 0===f?"div":f,b=e.disabled,m=void 0!==b&&b,v=e.error,g=void 0!==v&&v,y=e.fullWidth,O=void 0!==y&&y,k=e.focused,w=e.hiddenLabel,j=void 0!==w&&w,S=e.margin,N=void 0===S?"none":S,I=e.required,C=void 0!==I&&I,T=e.size,E=e.variant,A=void 0===E?"standard":E,R=Object(a.a)(e,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),F=i.useState((function(){var e=!1;return n&&i.Children.forEach(n,(function(t){if(Object(B.a)(t,["Input","Select"])){var n=Object(B.a)(t,["Select"])?t.props.input:t;n&&n.props.startAdornment&&(e=!0)}})),e})),D=F[0],_=F[1],M=i.useState((function(){var e=!1;return n&&i.Children.forEach(n,(function(t){Object(B.a)(t,["Input","Select"])&&x(t.props,!0)&&(e=!0)})),e})),z=M[0],L=M[1],P=i.useState(!1),W=P[0],U=P[1],V=void 0!==k?k:W;m&&V&&U(!1);var H=i.useCallback((function(){L(!0)}),[]),G={adornedStart:D,setAdornedStart:_,color:l,disabled:m,error:g,filled:z,focused:V,fullWidth:O,hiddenLabel:j,margin:("small"===T?"dense":void 0)||N,onBlur:function(){U(!1)},onEmpty:i.useCallback((function(){L(!1)}),[]),onFilled:H,onFocus:function(){U(!0)},registerEffect:undefined,required:C,variant:A};return i.createElement(d.Provider,{value:G},i.createElement(h,Object(r.a)({className:Object(s.a)(o.root,c,"none"!==N&&o["margin".concat(Object(p.a)(N))],O&&o.fullWidth),ref:t},R),n))})),U=Object(f.a)({root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},{name:"MuiFormControl"})(W),V=i.forwardRef((function(e,t){var n=e.children,o=e.classes,c=e.className,l=e.component,d=void 0===l?"p":l,f=(e.disabled,e.error,e.filled,e.focused,e.margin,e.required,e.variant,Object(a.a)(e,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"])),p=u({props:e,muiFormControl:_(),states:["variant","margin","disabled","error","filled","focused","required"]});return i.createElement(d,Object(r.a)({className:Object(s.a)(o.root,("filled"===p.variant||"outlined"===p.variant)&&o.contained,c,p.disabled&&o.disabled,p.error&&o.error,p.filled&&o.filled,p.focused&&o.focused,p.required&&o.required,"dense"===p.margin&&o.marginDense),ref:t},f)," "===n?i.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}}):n)})),H=Object(f.a)((function(e){return{root:Object(r.a)({color:e.palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}}),{name:"MuiFormHelperText"})(V),G=n(381),q=n(170),K=n(135),X=(n(140),n(72)),Y=n(53),$=n.n(Y),Q=n(169);function Z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t){return null==t?e:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];e.apply(this,r),t.apply(this,r)}}),(function(){}))}var J=n(356),ee=n(383),te=n(130);var ne="undefined"!==typeof window?i.useLayoutEffect:i.useEffect;var re=i.forwardRef((function(e,t){var n=e.children,r=e.container,a=e.disablePortal,o=void 0!==a&&a,s=e.onRendered,c=i.useState(null),u=c[0],l=c[1],d=Object(h.a)(i.isValidElement(n)?n.ref:null,t);return ne((function(){o||l(function(e){return e="function"===typeof e?e():e,Y.findDOMNode(e)}(r)||document.body)}),[r,o]),ne((function(){if(u&&!o)return Object(te.a)(t,u),function(){Object(te.a)(t,null)}}),[t,u,o]),ne((function(){s&&(u||o)&&s()}),[s,u,o]),o?i.isValidElement(n)?i.cloneElement(n,{ref:d}):n:u?Y.createPortal(n,u):u})),ae=n(79),ie=n(238);var oe=n(171),se=n(108);function ce(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}function ue(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function le(e){return parseInt(window.getComputedStyle(e)["padding-right"],10)||0}function de(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4?arguments[4]:void 0,i=[t,n].concat(Object(se.a)(r)),o=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,(function(e){1===e.nodeType&&-1===i.indexOf(e)&&-1===o.indexOf(e.tagName)&&ue(e,a)}))}function fe(e,t){var n=-1;return e.some((function(e,r){return!!t(e)&&(n=r,!0)})),n}function pe(e,t){var n,r=[],a=[],i=e.container;if(!t.disableScrollLock){if(function(e){var t=Object(X.a)(e);return t.body===e?Object(Q.a)(t).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(i)){var o=ce();r.push({value:i.style.paddingRight,key:"padding-right",el:i}),i.style["padding-right"]="".concat(le(i)+o,"px"),n=Object(X.a)(i).querySelectorAll(".mui-fixed"),[].forEach.call(n,(function(e){a.push(e.style.paddingRight),e.style.paddingRight="".concat(le(e)+o,"px")}))}var s=i.parentElement,c="HTML"===s.nodeName&&"scroll"===window.getComputedStyle(s)["overflow-y"]?s:i;r.push({value:c.style.overflow,key:"overflow",el:c}),c.style.overflow="hidden"}return function(){n&&[].forEach.call(n,(function(e,t){a[t]?e.style.paddingRight=a[t]:e.style.removeProperty("padding-right")})),r.forEach((function(e){var t=e.value,n=e.el,r=e.key;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}var he=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modals=[],this.containers=[]}return Object(oe.a)(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&ue(e.modalRef,!1);var r=function(e){var t=[];return[].forEach.call(e.children,(function(e){e.getAttribute&&"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);de(t,e.mountNode,e.modalRef,r,!0);var a=fe(this.containers,(function(e){return e.container===t}));return-1!==a?(this.containers[a].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblingNodes:r}),n)}},{key:"mount",value:function(e,t){var n=fe(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];r.restore||(r.restore=pe(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=fe(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&ue(e.modalRef,!0),de(r.container,e.mountNode,e.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(n,1);else{var a=r.modals[r.modals.length-1];a.modalRef&&ue(a.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}();var be=function(e){var t=e.children,n=e.disableAutoFocus,r=void 0!==n&&n,a=e.disableEnforceFocus,o=void 0!==a&&a,s=e.disableRestoreFocus,c=void 0!==s&&s,u=e.getDoc,l=e.isEnabled,d=e.open,f=i.useRef(),p=i.useRef(null),b=i.useRef(null),m=i.useRef(),v=i.useRef(null),g=i.useCallback((function(e){v.current=Y.findDOMNode(e)}),[]),y=Object(h.a)(t.ref,g),O=i.useRef();return i.useEffect((function(){O.current=d}),[d]),!O.current&&d&&"undefined"!==typeof window&&(m.current=u().activeElement),i.useEffect((function(){if(d){var e=Object(X.a)(v.current);r||!v.current||v.current.contains(e.activeElement)||(v.current.hasAttribute("tabIndex")||v.current.setAttribute("tabIndex",-1),v.current.focus());var t=function(){null!==v.current&&(e.hasFocus()&&!o&&l()&&!f.current?v.current&&!v.current.contains(e.activeElement)&&v.current.focus():f.current=!1)},n=function(t){!o&&l()&&9===t.keyCode&&e.activeElement===v.current&&(f.current=!0,t.shiftKey?b.current.focus():p.current.focus())};e.addEventListener("focus",t,!0),e.addEventListener("keydown",n,!0);var a=setInterval((function(){t()}),50);return function(){clearInterval(a),e.removeEventListener("focus",t,!0),e.removeEventListener("keydown",n,!0),c||(m.current&&m.current.focus&&m.current.focus(),m.current=null)}}}),[r,o,c,l,d]),i.createElement(i.Fragment,null,i.createElement("div",{tabIndex:0,ref:p,"data-test":"sentinelStart"}),i.cloneElement(t,{ref:y}),i.createElement("div",{tabIndex:0,ref:b,"data-test":"sentinelEnd"}))},me={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},ve=i.forwardRef((function(e,t){var n=e.invisible,o=void 0!==n&&n,s=e.open,c=Object(a.a)(e,["invisible","open"]);return s?i.createElement("div",Object(r.a)({"aria-hidden":!0,ref:t},c,{style:Object(r.a)({},me.root,o?me.invisible:{},c.style)})):null}));var ge=new he,ye=i.forwardRef((function(e,t){var n=Object(J.a)(),o=Object(ee.a)({name:"MuiModal",props:Object(r.a)({},e),theme:n}),s=o.BackdropComponent,c=void 0===s?ve:s,u=o.BackdropProps,l=o.children,d=o.closeAfterTransition,f=void 0!==d&&d,p=o.container,b=o.disableAutoFocus,m=void 0!==b&&b,v=o.disableBackdropClick,g=void 0!==v&&v,y=o.disableEnforceFocus,O=void 0!==y&&y,x=o.disableEscapeKeyDown,k=void 0!==x&&x,w=o.disablePortal,j=void 0!==w&&w,S=o.disableRestoreFocus,N=void 0!==S&&S,I=o.disableScrollLock,C=void 0!==I&&I,T=o.hideBackdrop,E=void 0!==T&&T,A=o.keepMounted,R=void 0!==A&&A,F=o.manager,D=void 0===F?ge:F,_=o.onBackdropClick,M=o.onClose,z=o.onEscapeKeyDown,L=o.onRendered,P=o.open,B=Object(a.a)(o,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),W=i.useState(!0),U=W[0],V=W[1],H=i.useRef({}),G=i.useRef(null),q=i.useRef(null),K=Object(h.a)(q,t),$=function(e){return!!e.children&&e.children.props.hasOwnProperty("in")}(o),Q=function(){return Object(X.a)(G.current)},te=function(){return H.current.modalRef=q.current,H.current.mountNode=G.current,H.current},ne=function(){D.mount(te(),{disableScrollLock:C}),q.current.scrollTop=0},oe=Object(ae.a)((function(){var e=function(e){return e="function"===typeof e?e():e,Y.findDOMNode(e)}(p)||Q().body;D.add(te(),e),q.current&&ne()})),se=i.useCallback((function(){return D.isTopModal(te())}),[D]),ce=Object(ae.a)((function(e){G.current=e,e&&(L&&L(),P&&se()?ne():ue(q.current,!0))})),le=i.useCallback((function(){D.remove(te())}),[D]);if(i.useEffect((function(){return function(){le()}}),[le]),i.useEffect((function(){P?oe():$&&f||le()}),[P,le,$,f,oe]),!R&&!P&&(!$||U))return null;var de=function(e){return{root:{position:"fixed",zIndex:e.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}}(n||{zIndex:ie.a}),fe={};return void 0===l.props.tabIndex&&(fe.tabIndex=l.props.tabIndex||"-1"),$&&(fe.onEnter=Z((function(){V(!1)}),l.props.onEnter),fe.onExited=Z((function(){V(!0),f&&le()}),l.props.onExited)),i.createElement(re,{ref:ce,container:p,disablePortal:j},i.createElement("div",Object(r.a)({ref:K,onKeyDown:function(e){"Escape"===e.key&&se()&&(z&&z(e),k||(e.stopPropagation(),M&&M(e,"escapeKeyDown")))},role:"presentation"},B,{style:Object(r.a)({},de.root,!P&&U?de.hidden:{},B.style)}),E?null:i.createElement(c,Object(r.a)({open:P,onClick:function(e){e.target===e.currentTarget&&(_&&_(e),!g&&M&&M(e,"backdropClick"))}},u)),i.createElement(be,{disableEnforceFocus:O,disableAutoFocus:m,disableRestoreFocus:N,getDoc:Q,isEnabled:se,open:P},i.cloneElement(l,fe))))})),Oe=n(75),xe=n(63),ke=!1,we=n(173),je="unmounted",Se="exited",Ne="entering",Ie="entered",Ce="exiting",Te=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var a,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(a=Se,r.appearStatus=Ne):a=Ie:a=t.unmountOnExit||t.mountOnEnter?je:Se,r.state={status:a},r.nextCallback=null,r}Object(xe.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===je?{status:Se}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Ne&&n!==Ie&&(t=Ne):n!==Ne&&n!==Ie||(t=Ce)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!==typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===Ne?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===Se&&this.setState({status:je})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,a=this.props.nodeRef?[r]:[$.a.findDOMNode(this),r],i=a[0],o=a[1],s=this.getTimeouts(),c=r?s.appear:s.enter;!e&&!n||ke?this.safeSetState({status:Ie},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,o),this.safeSetState({status:Ne},(function(){t.props.onEntering(i,o),t.onTransitionEnd(c,(function(){t.safeSetState({status:Ie},(function(){t.props.onEntered(i,o)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:$.a.findDOMNode(this);t&&!ke?(this.props.onExit(r),this.safeSetState({status:Ce},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:Se},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:Se},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:$.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=a[0],o=a[1];this.props.addEndListener(i,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===je)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(Oe.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return o.a.createElement(we.a.Provider,{value:null},"function"===typeof n?n(e,r):o.a.cloneElement(o.a.Children.only(n),r))},t}(o.a.Component);function Ee(){}Te.contextType=we.a,Te.propTypes={},Te.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ee,onEntering:Ee,onEntered:Ee,onExit:Ee,onExiting:Ee,onExited:Ee},Te.UNMOUNTED=je,Te.EXITED=Se,Te.ENTERING=Ne,Te.ENTERED=Ie,Te.EXITING=Ce;var Ae=Te;function Re(e,t){var n=e.timeout,r=e.style,a=void 0===r?{}:r;return{duration:a.transitionDuration||"number"===typeof n?n:n[t.mode]||0,delay:a.transitionDelay}}function Fe(e){return"scale(".concat(e,", ").concat(Math.pow(e,2),")")}var De={entering:{opacity:1,transform:Fe(1)},entered:{opacity:1,transform:"none"}},_e=i.forwardRef((function(e,t){var n=e.children,o=e.disableStrictModeCompat,s=void 0!==o&&o,c=e.in,u=e.onEnter,l=e.onEntered,d=e.onEntering,f=e.onExit,p=e.onExited,b=e.onExiting,m=e.style,v=e.timeout,g=void 0===v?"auto":v,y=e.TransitionComponent,O=void 0===y?Ae:y,x=Object(a.a)(e,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),k=i.useRef(),w=i.useRef(),j=Object(E.a)(),S=j.unstable_strictMode&&!s,N=i.useRef(null),I=Object(h.a)(n.ref,t),C=Object(h.a)(S?N:void 0,I),T=function(e){return function(t,n){if(e){var r=S?[N.current,t]:[t,n],a=Object(q.a)(r,2),i=a[0],o=a[1];void 0===o?e(i):e(i,o)}}},A=T(d),R=T((function(e,t){!function(e){e.scrollTop}(e);var n,r=Re({style:m,timeout:g},{mode:"enter"}),a=r.duration,i=r.delay;"auto"===g?(n=j.transitions.getAutoHeightDuration(e.clientHeight),w.current=n):n=a,e.style.transition=[j.transitions.create("opacity",{duration:n,delay:i}),j.transitions.create("transform",{duration:.666*n,delay:i})].join(","),u&&u(e,t)})),F=T(l),D=T(b),_=T((function(e){var t,n=Re({style:m,timeout:g},{mode:"exit"}),r=n.duration,a=n.delay;"auto"===g?(t=j.transitions.getAutoHeightDuration(e.clientHeight),w.current=t):t=r,e.style.transition=[j.transitions.create("opacity",{duration:t,delay:a}),j.transitions.create("transform",{duration:.666*t,delay:a||.333*t})].join(","),e.style.opacity="0",e.style.transform=Fe(.75),f&&f(e)})),M=T(p);return i.useEffect((function(){return function(){clearTimeout(k.current)}}),[]),i.createElement(O,Object(r.a)({appear:!0,in:c,nodeRef:S?N:void 0,onEnter:R,onEntered:F,onEntering:A,onExit:_,onExited:M,onExiting:D,addEndListener:function(e,t){var n=S?e:t;"auto"===g&&(k.current=setTimeout(n,w.current||0))},timeout:"auto"===g?null:g},x),(function(e,t){return i.cloneElement(n,Object(r.a)({style:Object(r.a)({opacity:0,transform:Fe(.75),visibility:"exited"!==e||c?void 0:"hidden"},De[e],m,n.props.style),ref:C},t))}))}));_e.muiSupportAuto=!0;var Me=_e,ze=n(354);function Le(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function Pe(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function Be(e){return[e.horizontal,e.vertical].map((function(e){return"number"===typeof e?"".concat(e,"px"):e})).join(" ")}function We(e){return"function"===typeof e?e():e}var Ue=i.forwardRef((function(e,t){var n=e.action,o=e.anchorEl,c=e.anchorOrigin,u=void 0===c?{vertical:"top",horizontal:"left"}:c,l=e.anchorPosition,d=e.anchorReference,f=void 0===d?"anchorEl":d,p=e.children,h=e.classes,m=e.className,v=e.container,g=e.elevation,y=void 0===g?8:g,O=e.getContentAnchorEl,x=e.marginThreshold,k=void 0===x?16:x,w=e.onEnter,j=e.onEntered,S=e.onEntering,N=e.onExit,I=e.onExited,C=e.onExiting,T=e.open,E=e.PaperProps,A=void 0===E?{}:E,R=e.transformOrigin,F=void 0===R?{vertical:"top",horizontal:"left"}:R,D=e.TransitionComponent,_=void 0===D?Me:D,M=e.transitionDuration,z=void 0===M?"auto":M,L=e.TransitionProps,P=void 0===L?{}:L,B=Object(a.a)(e,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),W=i.useRef(),U=i.useCallback((function(e){if("anchorPosition"===f)return l;var t=We(o),n=(t&&1===t.nodeType?t:Object(X.a)(W.current).body).getBoundingClientRect(),r=0===e?u.vertical:"center";return{top:n.top+Le(n,r),left:n.left+Pe(n,u.horizontal)}}),[o,u.horizontal,u.vertical,l,f]),V=i.useCallback((function(e){var t=0;if(O&&"anchorEl"===f){var n=O(e);if(n&&e.contains(n)){var r=function(e,t){for(var n=t,r=0;n&&n!==e;)r+=(n=n.parentElement).scrollTop;return r}(e,n);t=n.offsetTop+n.clientHeight/2-r||0}0}return t}),[u.vertical,f,O]),H=i.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:Le(e,F.vertical)+t,horizontal:Pe(e,F.horizontal)}}),[F.horizontal,F.vertical]),G=i.useCallback((function(e){var t=V(e),n={width:e.offsetWidth,height:e.offsetHeight},r=H(n,t);if("none"===f)return{top:null,left:null,transformOrigin:Be(r)};var a=U(t),i=a.top-r.vertical,s=a.left-r.horizontal,c=i+n.height,u=s+n.width,l=Object(Q.a)(We(o)),d=l.innerHeight-k,p=l.innerWidth-k;if(i<k){var h=i-k;i-=h,r.vertical+=h}else if(c>d){var b=c-d;i-=b,r.vertical+=b}if(s<k){var m=s-k;s-=m,r.horizontal+=m}else if(u>p){var v=u-p;s-=v,r.horizontal+=v}return{top:"".concat(Math.round(i),"px"),left:"".concat(Math.round(s),"px"),transformOrigin:Be(r)}}),[o,f,U,V,H,k]),q=i.useCallback((function(){var e=W.current;if(e){var t=G(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}}),[G]),K=i.useCallback((function(e){W.current=Y.findDOMNode(e)}),[]);i.useEffect((function(){T&&q()})),i.useImperativeHandle(n,(function(){return T?{updatePosition:function(){q()}}:null}),[T,q]),i.useEffect((function(){if(T){var e=Object(b.a)((function(){q()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[T,q]);var $=z;"auto"!==z||_.muiSupportAuto||($=void 0);var J=v||(o?Object(X.a)(We(o)).body:void 0);return i.createElement(ye,Object(r.a)({container:J,open:T,ref:t,BackdropProps:{invisible:!0},className:Object(s.a)(h.root,m)},B),i.createElement(_,Object(r.a)({appear:!0,in:T,onEnter:w,onEntered:j,onExit:N,onExited:I,onExiting:C,timeout:$},P,{onEntering:Z((function(e,t){S&&S(e,t),q()}),P.onEntering)}),i.createElement(ze.a,Object(r.a)({elevation:y,ref:K},A,{className:Object(s.a)(h.paper,A.className)}),p)))})),Ve=Object(f.a)({root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},{name:"MuiPopover"})(Ue),He=n(174),Ge=i.forwardRef((function(e,t){var n=e.children,o=e.classes,c=e.className,u=e.component,l=void 0===u?"ul":u,d=e.dense,f=void 0!==d&&d,p=e.disablePadding,h=void 0!==p&&p,b=e.subheader,m=Object(a.a)(e,["children","classes","className","component","dense","disablePadding","subheader"]),v=i.useMemo((function(){return{dense:f}}),[f]);return i.createElement(He.a.Provider,{value:v},i.createElement(l,Object(r.a)({className:Object(s.a)(o.root,c,f&&o.dense,!h&&o.padding,b&&o.subheader),ref:t},m),b,n))})),qe=Object(f.a)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(Ge);function Ke(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function Xe(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function Ye(e,t){if(void 0===t)return!0;var n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function $e(e,t,n,r,a,i){for(var o=!1,s=a(e,t,!!t&&n);s;){if(s===e.firstChild){if(o)return;o=!0}var c=!r&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&Ye(s,i)&&!c)return void s.focus();s=a(e,s,n)}}var Qe="undefined"===typeof window?i.useEffect:i.useLayoutEffect,Ze=i.forwardRef((function(e,t){var n=e.actions,o=e.autoFocus,s=void 0!==o&&o,c=e.autoFocusItem,u=void 0!==c&&c,l=e.children,d=e.className,f=e.disabledItemsFocusable,p=void 0!==f&&f,b=e.disableListWrap,m=void 0!==b&&b,v=e.onKeyDown,g=e.variant,y=void 0===g?"selectedMenu":g,O=Object(a.a)(e,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),x=i.useRef(null),k=i.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Qe((function(){s&&x.current.focus()}),[s]),i.useImperativeHandle(n,(function(){return{adjustStyleForScrollbar:function(e,t){var n=!x.current.style.width;if(e.clientHeight<x.current.clientHeight&&n){var r="".concat(ce(),"px");x.current.style["rtl"===t.direction?"paddingLeft":"paddingRight"]=r,x.current.style.width="calc(100% + ".concat(r,")")}return x.current}}}),[]);var w=i.useCallback((function(e){x.current=Y.findDOMNode(e)}),[]),j=Object(h.a)(w,t),S=-1;i.Children.forEach(l,(function(e,t){i.isValidElement(e)&&(e.props.disabled||("selectedMenu"===y&&e.props.selected||-1===S)&&(S=t))}));var N=i.Children.map(l,(function(e,t){if(t===S){var n={};return u&&(n.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===y&&(n.tabIndex=0),i.cloneElement(e,n)}return e}));return i.createElement(qe,Object(r.a)({role:"menu",ref:j,className:d,onKeyDown:function(e){var t=x.current,n=e.key,r=Object(X.a)(t).activeElement;if("ArrowDown"===n)e.preventDefault(),$e(t,r,m,p,Ke);else if("ArrowUp"===n)e.preventDefault(),$e(t,r,m,p,Xe);else if("Home"===n)e.preventDefault(),$e(t,null,m,p,Ke);else if("End"===n)e.preventDefault(),$e(t,null,m,p,Xe);else if(1===n.length){var a=k.current,i=n.toLowerCase(),o=performance.now();a.keys.length>0&&(o-a.lastTime>500?(a.keys=[],a.repeating=!0,a.previousKeyMatched=!0):a.repeating&&i!==a.keys[0]&&(a.repeating=!1)),a.lastTime=o,a.keys.push(i);var s=r&&!a.repeating&&Ye(r,a);a.previousKeyMatched&&(s||$e(t,r,!1,p,Ke,a))?e.preventDefault():a.previousKeyMatched=!1}v&&v(e)},tabIndex:s?0:-1},O),N)})),Je={vertical:"top",horizontal:"right"},et={vertical:"top",horizontal:"left"},tt=i.forwardRef((function(e,t){var n=e.autoFocus,o=void 0===n||n,c=e.children,u=e.classes,l=e.disableAutoFocusItem,d=void 0!==l&&l,f=e.MenuListProps,p=void 0===f?{}:f,h=e.onClose,b=e.onEntering,m=e.open,v=e.PaperProps,g=void 0===v?{}:v,y=e.PopoverClasses,O=e.transitionDuration,x=void 0===O?"auto":O,k=e.variant,w=void 0===k?"selectedMenu":k,j=Object(a.a)(e,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","variant"]),S=Object(E.a)(),N=o&&!d&&m,I=i.useRef(null),C=i.useRef(null),T=-1;i.Children.map(c,(function(e,t){i.isValidElement(e)&&(e.props.disabled||("menu"!==w&&e.props.selected||-1===T)&&(T=t))}));var A=i.Children.map(c,(function(e,t){return t===T?i.cloneElement(e,{ref:function(t){C.current=Y.findDOMNode(t),Object(te.a)(e.ref,t)}}):e}));return i.createElement(Ve,Object(r.a)({getContentAnchorEl:function(){return C.current},classes:y,onClose:h,onEntering:function(e,t){I.current&&I.current.adjustStyleForScrollbar(e,S),b&&b(e,t)},anchorOrigin:"rtl"===S.direction?Je:et,transformOrigin:"rtl"===S.direction?Je:et,PaperProps:Object(r.a)({},g,{classes:Object(r.a)({},g.classes,{root:u.paper})}),open:m,ref:t,transitionDuration:x},j),i.createElement(Ze,Object(r.a)({onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),h&&h(e,"tabKeyDown"))},actions:I,autoFocus:o&&(-1===T||d),autoFocusItem:N,variant:w},p,{className:Object(s.a)(u.list,p.className)}),A))})),nt=Object(f.a)({paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},{name:"MuiMenu"})(tt);function rt(e,t){return"object"===Object(K.a)(t)&&null!==t?e===t:String(e)===String(t)}var at=i.forwardRef((function(e,t){var n=e["aria-label"],o=e.autoFocus,u=e.autoWidth,l=e.children,d=e.classes,f=e.className,b=e.defaultValue,m=e.disabled,v=e.displayEmpty,g=e.IconComponent,y=e.inputRef,O=e.labelId,k=e.MenuProps,w=void 0===k?{}:k,j=e.multiple,S=e.name,N=e.onBlur,I=e.onChange,C=e.onClose,T=e.onFocus,E=e.onOpen,A=e.open,R=e.readOnly,F=e.renderValue,D=e.SelectDisplayProps,_=void 0===D?{}:D,M=e.tabIndex,z=(e.type,e.value),L=e.variant,P=void 0===L?"standard":L,B=Object(a.a)(e,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),W=function(e){var t=e.controlled,n=e.default,r=(e.name,e.state,i.useRef(void 0!==t).current),a=i.useState(n),o=a[0],s=a[1];return[r?t:o,i.useCallback((function(e){r||s(e)}),[])]}({controlled:z,default:b,name:"Select"}),U=Object(q.a)(W,2),V=U[0],H=U[1],G=i.useRef(null),K=i.useState(null),Y=K[0],$=K[1],Q=i.useRef(null!=A).current,Z=i.useState(),J=Z[0],ee=Z[1],te=i.useState(!1),ne=te[0],re=te[1],ae=Object(h.a)(t,y);i.useImperativeHandle(ae,(function(){return{focus:function(){Y.focus()},node:G.current,value:V}}),[Y,V]),i.useEffect((function(){o&&Y&&Y.focus()}),[o,Y]),i.useEffect((function(){if(Y){var e=Object(X.a)(Y).getElementById(O);if(e){var t=function(){getSelection().isCollapsed&&Y.focus()};return e.addEventListener("click",t),function(){e.removeEventListener("click",t)}}}}),[O,Y]);var ie,oe,se=function(e,t){e?E&&E(t):C&&C(t),Q||(ee(u?null:Y.clientWidth),re(e))},ce=i.Children.toArray(l),ue=function(e){return function(t){var n;if(j||se(!1,t),j){n=Array.isArray(V)?V.slice():[];var r=V.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;e.props.onClick&&e.props.onClick(t),V!==n&&(H(n),I&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:n,name:S}}),I(t,e)))}},le=null!==Y&&(Q?A:ne);delete B["aria-invalid"];var de=[],fe=!1;(x({value:V})||v)&&(F?ie=F(V):fe=!0);var pe=ce.map((function(e){if(!i.isValidElement(e))return null;var t;if(j){if(!Array.isArray(V))throw new Error(Object(c.a)(2));(t=V.some((function(t){return rt(t,e.props.value)})))&&fe&&de.push(e.props.children)}else(t=rt(V,e.props.value))&&fe&&(oe=e.props.children);return t&&!0,i.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:ue(e),onKeyUp:function(t){" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));fe&&(ie=j?de.join(", "):oe);var he,be=J;!u&&Q&&Y&&(be=Y.clientWidth),he="undefined"!==typeof M?M:m?null:0;var me=_.id||(S?"mui-component-select-".concat(S):void 0);return i.createElement(i.Fragment,null,i.createElement("div",Object(r.a)({className:Object(s.a)(d.root,d.select,d.selectMenu,d[P],f,m&&d.disabled),ref:$,tabIndex:he,role:"button","aria-disabled":m?"true":void 0,"aria-expanded":le?"true":void 0,"aria-haspopup":"listbox","aria-label":n,"aria-labelledby":[O,me].filter(Boolean).join(" ")||void 0,onKeyDown:function(e){if(!R){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),se(!0,e))}},onMouseDown:m||R?null:function(e){0===e.button&&(e.preventDefault(),Y.focus(),se(!0,e))},onBlur:function(e){!le&&N&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:V,name:S}}),N(e))},onFocus:T},_,{id:me}),function(e){return null==e||"string"===typeof e&&!e.trim()}(ie)?i.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}}):ie),i.createElement("input",Object(r.a)({value:Array.isArray(V)?V.join(","):V,name:S,ref:G,"aria-hidden":!0,onChange:function(e){var t=ce.map((function(e){return e.props.value})).indexOf(e.target.value);if(-1!==t){var n=ce[t];H(n.props.value),I&&I(e,n)}},tabIndex:-1,className:d.nativeInput,autoFocus:o},B)),i.createElement(g,{className:Object(s.a)(d.icon,d["icon".concat(Object(p.a)(P))],le&&d.iconOpen,m&&d.disabled)}),i.createElement(nt,Object(r.a)({id:"menu-".concat(S||""),anchorEl:Y,open:le,onClose:function(e){se(!1,e)}},w,{MenuListProps:Object(r.a)({"aria-labelledby":O,role:"listbox",disableListWrap:!0},w.MenuListProps),PaperProps:Object(r.a)({},w.PaperProps,{style:Object(r.a)({minWidth:be},null!=w.PaperProps?w.PaperProps.style:null)})}),pe))})),it=n(87),ot=Object(it.a)(i.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),st=i.forwardRef((function(e,t){var n=e.classes,o=e.className,c=e.disabled,u=e.IconComponent,l=e.inputRef,d=e.variant,f=void 0===d?"standard":d,h=Object(a.a)(e,["classes","className","disabled","IconComponent","inputRef","variant"]);return i.createElement(i.Fragment,null,i.createElement("select",Object(r.a)({className:Object(s.a)(n.root,n.select,n[f],o,c&&n.disabled),disabled:c,ref:l||t},h)),e.multiple?null:i.createElement(u,{className:Object(s.a)(n.icon,n["icon".concat(Object(p.a)(f))],c&&n.disabled)}))})),ct=function(e){return{root:{},select:{"-moz-appearance":"none","-webkit-appearance":"none",userSelect:"none",borderRadius:0,minWidth:16,cursor:"pointer","&:focus":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"},"&$disabled":{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:e.palette.background.paper},"&&":{paddingRight:24}},filled:{"&&":{paddingRight:32}},outlined:{borderRadius:e.shape.borderRadius,"&&":{paddingRight:32}},selectMenu:{height:"auto",minHeight:"1.1876em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},disabled:{},icon:{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:e.palette.action.active,"&$disabled":{color:e.palette.action.disabled}},iconOpen:{transform:"rotate(180deg)"},iconFilled:{right:7},iconOutlined:{right:7},nativeInput:{bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%"}}},ut=i.createElement(N,null),lt=i.forwardRef((function(e,t){var n=e.children,o=e.classes,s=e.IconComponent,c=void 0===s?ot:s,l=e.input,d=void 0===l?ut:l,f=e.inputProps,p=(e.variant,Object(a.a)(e,["children","classes","IconComponent","input","inputProps","variant"])),h=u({props:e,muiFormControl:_(),states:["variant"]});return i.cloneElement(d,Object(r.a)({inputComponent:st,inputProps:Object(r.a)({children:n,classes:o,IconComponent:c,variant:h.variant,type:void 0},f,d?d.props.inputProps:{}),ref:t},p))}));lt.muiName="Select";Object(f.a)(ct,{name:"MuiNativeSelect"})(lt);var dt=ct,ft=i.createElement(N,null),pt=i.createElement(C,null),ht=i.forwardRef((function e(t,n){var o=t.autoWidth,s=void 0!==o&&o,c=t.children,l=t.classes,d=t.displayEmpty,f=void 0!==d&&d,p=t.IconComponent,h=void 0===p?ot:p,b=t.id,m=t.input,v=t.inputProps,g=t.label,y=t.labelId,O=t.labelWidth,x=void 0===O?0:O,k=t.MenuProps,w=t.multiple,j=void 0!==w&&w,S=t.native,N=void 0!==S&&S,I=t.onClose,C=t.onOpen,T=t.open,E=t.renderValue,A=t.SelectDisplayProps,R=t.variant,F=void 0===R?"standard":R,M=Object(a.a)(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),z=N?st:at,L=u({props:t,muiFormControl:_(),states:["variant"]}).variant||F,P=m||{standard:ft,outlined:i.createElement(D,{label:g,labelWidth:x}),filled:pt}[L];return i.cloneElement(P,Object(r.a)({inputComponent:z,inputProps:Object(r.a)({children:c,IconComponent:h,variant:L,type:void 0,multiple:j},N?{id:b}:{autoWidth:s,displayEmpty:f,labelId:y,MenuProps:k,onClose:I,onOpen:C,open:T,renderValue:E,SelectDisplayProps:Object(r.a)({id:b},A)},v,{classes:v?Object(G.a)({baseClasses:l,newClasses:v.classes,Component:e}):l},m?m.props.inputProps:{}),ref:n},M))}));ht.muiName="Select";var bt=Object(f.a)(dt,{name:"MuiSelect"})(ht),mt={standard:N,filled:C,outlined:D},vt=i.forwardRef((function(e,t){var n=e.autoComplete,o=e.autoFocus,c=void 0!==o&&o,u=e.children,l=e.classes,d=e.className,f=e.color,p=void 0===f?"primary":f,h=e.defaultValue,b=e.disabled,m=void 0!==b&&b,v=e.error,g=void 0!==v&&v,y=e.FormHelperTextProps,O=e.fullWidth,x=void 0!==O&&O,k=e.helperText,w=e.hiddenLabel,j=e.id,S=e.InputLabelProps,N=e.inputProps,I=e.InputProps,C=e.inputRef,T=e.label,E=e.multiline,A=void 0!==E&&E,R=e.name,F=e.onBlur,D=e.onChange,_=e.onFocus,M=e.placeholder,z=e.required,L=void 0!==z&&z,B=e.rows,W=e.rowsMax,V=e.select,G=void 0!==V&&V,q=e.SelectProps,K=e.type,X=e.value,Y=e.variant,$=void 0===Y?"standard":Y,Q=Object(a.a)(e,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","select","SelectProps","type","value","variant"]);var Z={};if("outlined"===$&&(S&&"undefined"!==typeof S.shrink&&(Z.notched=S.shrink),T)){var J,ee=null!==(J=null===S||void 0===S?void 0:S.required)&&void 0!==J?J:L;Z.label=i.createElement(i.Fragment,null,T,ee&&"\xa0*")}G&&(q&&q.native||(Z.id=void 0),Z["aria-describedby"]=void 0);var te=k&&j?"".concat(j,"-helper-text"):void 0,ne=T&&j?"".concat(j,"-label"):void 0,re=mt[$],ae=i.createElement(re,Object(r.a)({"aria-describedby":te,autoComplete:n,autoFocus:c,defaultValue:h,fullWidth:x,multiline:A,name:R,rows:B,rowsMax:W,type:K,value:X,id:j,inputRef:C,onBlur:F,onChange:D,onFocus:_,placeholder:M,inputProps:N},Z,I));return i.createElement(U,Object(r.a)({className:Object(s.a)(l.root,d),disabled:m,error:g,fullWidth:x,hiddenLabel:w,ref:t,required:L,color:p,variant:$},Q),T&&i.createElement(P,Object(r.a)({htmlFor:j,id:ne},S),T),G?i.createElement(bt,Object(r.a)({"aria-describedby":te,id:j,labelId:ne,value:X,input:ae},q),u):ae,k&&i.createElement(H,Object(r.a)({id:te},y),k))}));t.a=Object(f.a)({root:{}},{name:"MuiTextField"})(vt)},function(e,t,n){"use strict";var r=n(108),a=n(14),i=(n(30),n(128));var o=function(e){var t=function(t){var n=e(t);return t.css?Object(a.a)({},Object(i.a)(n,e(Object(a.a)({theme:t.theme},t.css))),function(e,t){var n={};return Object.keys(e).forEach((function(r){-1===t.indexOf(r)&&(n[r]=e[r])})),n}(t.css,[e.filterProps])):n};return t.propTypes={},t.filterProps=["css"].concat(Object(r.a)(e.filterProps)),t};var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=function(e){return t.reduce((function(t,n){var r=n(e);return r?Object(i.a)(t,r):t}),{})};return r.propTypes={},r.filterProps=t.reduce((function(e,t){return e.concat(t.filterProps)}),[]),r},c=n(57),u=n(237);function l(e,t){return t&&"string"===typeof t?t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e):null}var d=function(e){var t=e.prop,n=e.cssProperty,r=void 0===n?e.prop:n,a=e.themeKey,i=e.transform,o=function(e){if(null==e[t])return null;var n=e[t],o=l(e.theme,a)||{};return Object(u.a)(e,n,(function(e){var t;return"function"===typeof o?t=o(e):Array.isArray(o)?t=o[e]||e:(t=l(o,e)||e,i&&(t=i(t))),!1===r?t:Object(c.a)({},r,t)}))};return o.propTypes={},o.filterProps=[t],o};function f(e){return"number"!==typeof e?e:"".concat(e,"px solid")}var p=s(d({prop:"border",themeKey:"borders",transform:f}),d({prop:"borderTop",themeKey:"borders",transform:f}),d({prop:"borderRight",themeKey:"borders",transform:f}),d({prop:"borderBottom",themeKey:"borders",transform:f}),d({prop:"borderLeft",themeKey:"borders",transform:f}),d({prop:"borderColor",themeKey:"palette"}),d({prop:"borderRadius",themeKey:"shape"})),h=s(d({prop:"displayPrint",cssProperty:!1,transform:function(e){return{"@media print":{display:e}}}}),d({prop:"display"}),d({prop:"overflow"}),d({prop:"textOverflow"}),d({prop:"visibility"}),d({prop:"whiteSpace"})),b=s(d({prop:"flexBasis"}),d({prop:"flexDirection"}),d({prop:"flexWrap"}),d({prop:"justifyContent"}),d({prop:"alignItems"}),d({prop:"alignContent"}),d({prop:"order"}),d({prop:"flex"}),d({prop:"flexGrow"}),d({prop:"flexShrink"}),d({prop:"alignSelf"}),d({prop:"justifyItems"}),d({prop:"justifySelf"})),m=s(d({prop:"gridGap"}),d({prop:"gridColumnGap"}),d({prop:"gridRowGap"}),d({prop:"gridColumn"}),d({prop:"gridRow"}),d({prop:"gridAutoFlow"}),d({prop:"gridAutoColumns"}),d({prop:"gridAutoRows"}),d({prop:"gridTemplateColumns"}),d({prop:"gridTemplateRows"}),d({prop:"gridTemplateAreas"}),d({prop:"gridArea"})),v=s(d({prop:"position"}),d({prop:"zIndex",themeKey:"zIndex"}),d({prop:"top"}),d({prop:"right"}),d({prop:"bottom"}),d({prop:"left"})),g=s(d({prop:"color",themeKey:"palette"}),d({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette"})),y=d({prop:"boxShadow",themeKey:"shadows"});function O(e){return e<=1?"".concat(100*e,"%"):e}var x=d({prop:"width",transform:O}),k=d({prop:"maxWidth",transform:O}),w=d({prop:"minWidth",transform:O}),j=d({prop:"height",transform:O}),S=d({prop:"maxHeight",transform:O}),N=d({prop:"minHeight",transform:O}),I=(d({prop:"size",cssProperty:"width",transform:O}),d({prop:"size",cssProperty:"height",transform:O}),s(x,k,w,j,S,N,d({prop:"boxSizing"}))),C=n(400),T=s(d({prop:"fontFamily",themeKey:"typography"}),d({prop:"fontSize",themeKey:"typography"}),d({prop:"fontStyle",themeKey:"typography"}),d({prop:"fontWeight",themeKey:"typography"}),d({prop:"letterSpacing"}),d({prop:"lineHeight"}),d({prop:"textAlign"})),E=n(23),A=n(4),R=n.n(A),F=n(25),D=n(168),_=n.n(D),M=n(355);function z(e,t){var n={};return Object.keys(e).forEach((function(r){-1===t.indexOf(r)&&(n[r]=e[r])})),n}var L=n(129),P=function(e){var t=function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.name,o=Object(E.a)(r,["name"]),s=i,c="function"===typeof t?function(e){return{root:function(n){return t(Object(a.a)({theme:e},n))}}}:{root:t},u=Object(M.a)(c,Object(a.a)({Component:e,name:i||e.displayName,classNamePrefix:s},o));t.filterProps&&(n=t.filterProps,delete t.filterProps),t.propTypes&&(t.propTypes,delete t.propTypes);var l=R.a.forwardRef((function(t,r){var i=t.children,o=t.className,s=t.clone,c=t.component,l=Object(E.a)(t,["children","className","clone","component"]),d=u(t),f=Object(F.a)(d.root,o),p=l;if(n&&(p=z(p,n)),s)return R.a.cloneElement(i,Object(a.a)({className:Object(F.a)(i.props.className,f)},p));if("function"===typeof i)return i(Object(a.a)({className:f},p));var h=c||e;return R.a.createElement(h,Object(a.a)({ref:r,className:f},p),i)}));return _()(l,e),l}}(e);return function(e,n){return t(e,Object(a.a)({defaultTheme:L.a},n))}},B=o(s(p,h,b,m,v,g,y,I,C.b,T)),W=P("div")(B,{name:"MuiBox"});t.a=W},function(e,t,n){"use strict";var r,a=n(14),i=n(23),o=n(57),s=n(4),c=(n(140),n(30),n(25)),u=n(113),l=n(169);function d(){if(r)return r;var e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),r="reverse",e.scrollLeft>0?r="default":(e.scrollLeft=1,0===e.scrollLeft&&(r="negative")),document.body.removeChild(e),r}function f(e,t){var n=e.scrollLeft;if("rtl"!==t)return n;switch(d()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}function p(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}var h={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function b(e){var t=e.onChange,n=Object(i.a)(e,["onChange"]),r=s.useRef(),o=s.useRef(null),c=function(){r.current=o.current.offsetHeight-o.current.clientHeight};return s.useEffect((function(){var e=Object(u.a)((function(){var e=r.current;c(),e!==r.current&&t(r.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[t]),s.useEffect((function(){c(),t(r.current)}),[t]),s.createElement("div",Object(a.a)({style:h,ref:o},n))}var m=n(35),v=n(42),g=s.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.color,u=e.orientation,l=Object(i.a)(e,["classes","className","color","orientation"]);return s.createElement("span",Object(a.a)({className:Object(c.a)(n.root,n["color".concat(Object(v.a)(o))],r,"vertical"===u&&n.vertical),ref:t},l))})),y=Object(m.a)((function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}}),{name:"PrivateTabIndicator"})(g),O=n(87),x=Object(O.a)(s.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),k=Object(O.a)(s.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),w=n(313),j=s.createElement(x,{fontSize:"small"}),S=s.createElement(k,{fontSize:"small"}),N=s.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.direction,u=e.orientation,l=e.disabled,d=Object(i.a)(e,["classes","className","direction","orientation","disabled"]);return s.createElement(w.a,Object(a.a)({component:"div",className:Object(c.a)(n.root,r,l&&n.disabled,"vertical"===u&&n.vertical),ref:t,role:null,tabIndex:null},d),"left"===o?j:S)})),I=Object(m.a)({root:{width:40,flexShrink:0,opacity:.8,"&$disabled":{opacity:0}},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}},disabled:{}},{name:"MuiTabScrollButton"})(N),C=n(79),T=n(107),E=s.forwardRef((function(e,t){var n=e["aria-label"],r=e["aria-labelledby"],h=e.action,m=e.centered,v=void 0!==m&&m,g=e.children,O=e.classes,x=e.className,k=e.component,w=void 0===k?"div":k,j=e.indicatorColor,S=void 0===j?"secondary":j,N=e.onChange,E=e.orientation,A=void 0===E?"horizontal":E,R=e.ScrollButtonComponent,F=void 0===R?I:R,D=e.scrollButtons,_=void 0===D?"auto":D,M=e.selectionFollowsFocus,z=e.TabIndicatorProps,L=void 0===z?{}:z,P=e.TabScrollButtonProps,B=e.textColor,W=void 0===B?"inherit":B,U=e.value,V=e.variant,H=void 0===V?"standard":V,G=Object(i.a)(e,["aria-label","aria-labelledby","action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant"]),q=Object(T.a)(),K="scrollable"===H,X="rtl"===q.direction,Y="vertical"===A,$=Y?"scrollTop":"scrollLeft",Q=Y?"top":"left",Z=Y?"bottom":"right",J=Y?"clientHeight":"clientWidth",ee=Y?"height":"width";var te=s.useState(!1),ne=te[0],re=te[1],ae=s.useState({}),ie=ae[0],oe=ae[1],se=s.useState({start:!1,end:!1}),ce=se[0],ue=se[1],le=s.useState({overflow:"hidden",marginBottom:null}),de=le[0],fe=le[1],pe=new Map,he=s.useRef(null),be=s.useRef(null),me=function(){var e,t,n=he.current;if(n){var r=n.getBoundingClientRect();e={clientWidth:n.clientWidth,scrollLeft:n.scrollLeft,scrollTop:n.scrollTop,scrollLeftNormalized:f(n,q.direction),scrollWidth:n.scrollWidth,top:r.top,bottom:r.bottom,left:r.left,right:r.right}}if(n&&!1!==U){var a=be.current.children;if(a.length>0){var i=a[pe.get(U)];0,t=i?i.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},ve=Object(C.a)((function(){var e,t=me(),n=t.tabsMeta,r=t.tabMeta,a=0;if(r&&n)if(Y)a=r.top-n.top+n.scrollTop;else{var i=X?n.scrollLeftNormalized+n.clientWidth-n.scrollWidth:n.scrollLeft;a=r.left-n.left+i}var s=(e={},Object(o.a)(e,Q,a),Object(o.a)(e,ee,r?r[ee]:0),e);if(isNaN(ie[Q])||isNaN(ie[ee]))oe(s);else{var c=Math.abs(ie[Q]-s[Q]),u=Math.abs(ie[ee]-s[ee]);(c>=1||u>=1)&&oe(s)}})),ge=function(e){!function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},i=r.ease,o=void 0===i?p:i,s=r.duration,c=void 0===s?300:s,u=null,l=t[e],d=!1,f=function(){d=!0},h=function r(i){if(d)a(new Error("Animation cancelled"));else{null===u&&(u=i);var s=Math.min(1,(i-u)/c);t[e]=o(s)*(n-l)+l,s>=1?requestAnimationFrame((function(){a(null)})):requestAnimationFrame(r)}};l===n?a(new Error("Element already at target position")):requestAnimationFrame(h)}($,he.current,e)},ye=function(e){var t=he.current[$];Y?t+=e:(t+=e*(X?-1:1),t*=X&&"reverse"===d()?-1:1),ge(t)},Oe=function(){ye(-he.current[J])},xe=function(){ye(he.current[J])},ke=s.useCallback((function(e){fe({overflow:null,marginBottom:-e})}),[]),we=Object(C.a)((function(){var e=me(),t=e.tabsMeta,n=e.tabMeta;if(n&&t)if(n[Q]<t[Q]){var r=t[$]+(n[Q]-t[Q]);ge(r)}else if(n[Z]>t[Z]){var a=t[$]+(n[Z]-t[Z]);ge(a)}})),je=Object(C.a)((function(){if(K&&"off"!==_){var e,t,n=he.current,r=n.scrollTop,a=n.scrollHeight,i=n.clientHeight,o=n.scrollWidth,s=n.clientWidth;if(Y)e=r>1,t=r<a-i-1;else{var c=f(he.current,q.direction);e=X?c<o-s-1:c>1,t=X?c>1:c<o-s-1}e===ce.start&&t===ce.end||ue({start:e,end:t})}}));s.useEffect((function(){var e=Object(u.a)((function(){ve(),je()})),t=Object(l.a)(he.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}),[ve,je]);var Se=s.useCallback(Object(u.a)((function(){je()})));s.useEffect((function(){return function(){Se.clear()}}),[Se]),s.useEffect((function(){re(!0)}),[]),s.useEffect((function(){ve(),je()})),s.useEffect((function(){we()}),[we,ie]),s.useImperativeHandle(h,(function(){return{updateIndicator:ve,updateScrollButtons:je}}),[ve,je]);var Ne=s.createElement(y,Object(a.a)({className:O.indicator,orientation:A,color:S},L,{style:Object(a.a)({},ie,L.style)})),Ie=0,Ce=s.Children.map(g,(function(e){if(!s.isValidElement(e))return null;var t=void 0===e.props.value?Ie:e.props.value;pe.set(t,Ie);var n=t===U;return Ie+=1,s.cloneElement(e,{fullWidth:"fullWidth"===H,indicator:n&&!ne&&Ne,selected:n,selectionFollowsFocus:M,onChange:N,textColor:W,value:t})})),Te=function(){var e={};e.scrollbarSizeListener=K?s.createElement(b,{className:O.scrollable,onChange:ke}):null;var t=ce.start||ce.end,n=K&&("auto"===_&&t||"desktop"===_||"on"===_);return e.scrollButtonStart=n?s.createElement(F,Object(a.a)({orientation:A,direction:X?"right":"left",onClick:Oe,disabled:!ce.start,className:Object(c.a)(O.scrollButtons,"on"!==_&&O.scrollButtonsDesktop)},P)):null,e.scrollButtonEnd=n?s.createElement(F,Object(a.a)({orientation:A,direction:X?"left":"right",onClick:xe,disabled:!ce.end,className:Object(c.a)(O.scrollButtons,"on"!==_&&O.scrollButtonsDesktop)},P)):null,e}();return s.createElement(w,Object(a.a)({className:Object(c.a)(O.root,x,Y&&O.vertical),ref:t},G),Te.scrollButtonStart,Te.scrollbarSizeListener,s.createElement("div",{className:Object(c.a)(O.scroller,K?O.scrollable:O.fixed),style:de,ref:he,onScroll:Se},s.createElement("div",{"aria-label":n,"aria-labelledby":r,className:Object(c.a)(O.flexContainer,Y&&O.flexContainerVertical,v&&!K&&O.centered),onKeyDown:function(e){var t=e.target;if("tab"===t.getAttribute("role")){var n=null,r="vertical"!==A?"ArrowLeft":"ArrowUp",a="vertical"!==A?"ArrowRight":"ArrowDown";switch("vertical"!==A&&"rtl"===q.direction&&(r="ArrowRight",a="ArrowLeft"),e.key){case r:n=t.previousElementSibling||be.current.lastChild;break;case a:n=t.nextElementSibling||be.current.firstChild;break;case"Home":n=be.current.firstChild;break;case"End":n=be.current.lastChild}null!==n&&(n.focus(),e.preventDefault())}},ref:be,role:"tablist"},Ce),ne&&Ne),Te.scrollButtonEnd)}));t.a=Object(m.a)((function(e){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},vertical:{flexDirection:"column"},flexContainer:{display:"flex"},flexContainerVertical:{flexDirection:"column"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},scrollButtons:{},scrollButtonsDesktop:Object(o.a)({},e.breakpoints.down("xs"),{display:"none"}),indicator:{}}}),{name:"MuiTabs"})(E)},function(e,t,n){"use strict";var r=n(23),a=n(57),i=n(14),o=n(4),s=(n(30),n(25)),c=n(35),u=n(313),l=n(172),d=n(50),f=n(174),p=n(53),h="undefined"===typeof window?o.useEffect:o.useLayoutEffect,b=o.forwardRef((function(e,t){var n=e.alignItems,a=void 0===n?"center":n,c=e.autoFocus,b=void 0!==c&&c,m=e.button,v=void 0!==m&&m,g=e.children,y=e.classes,O=e.className,x=e.component,k=e.ContainerComponent,w=void 0===k?"li":k,j=e.ContainerProps,S=(j=void 0===j?{}:j).className,N=Object(r.a)(j,["className"]),I=e.dense,C=void 0!==I&&I,T=e.disabled,E=void 0!==T&&T,A=e.disableGutters,R=void 0!==A&&A,F=e.divider,D=void 0!==F&&F,_=e.focusVisibleClassName,M=e.selected,z=void 0!==M&&M,L=Object(r.a)(e,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),P=o.useContext(f.a),B={dense:C||P.dense||!1,alignItems:a},W=o.useRef(null);h((function(){b&&W.current&&W.current.focus()}),[b]);var U=o.Children.toArray(g),V=U.length&&Object(l.a)(U[U.length-1],["ListItemSecondaryAction"]),H=o.useCallback((function(e){W.current=p.findDOMNode(e)}),[]),G=Object(d.a)(H,t),q=Object(i.a)({className:Object(s.a)(y.root,O,B.dense&&y.dense,!R&&y.gutters,D&&y.divider,E&&y.disabled,v&&y.button,"center"!==a&&y.alignItemsFlexStart,V&&y.secondaryAction,z&&y.selected),disabled:E},L),K=x||"li";return v&&(q.component=x||"div",q.focusVisibleClassName=Object(s.a)(y.focusVisible,_),K=u.a),V?(K=q.component||x?K:"div","li"===w&&("li"===K?K="div":"li"===q.component&&(q.component="div")),o.createElement(f.a.Provider,{value:B},o.createElement(w,Object(i.a)({className:Object(s.a)(y.container,S),ref:G},N),o.createElement(K,q,U),U.pop()))):o.createElement(f.a.Provider,{value:B},o.createElement(K,Object(i.a)({ref:G},q),U))})),m=Object(c.a)((function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:e.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:e.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}},secondaryAction:{paddingRight:48},selected:{}}}),{name:"MuiListItem"})(b),v=o.forwardRef((function(e,t){var n,a=e.classes,c=e.className,u=e.component,l=void 0===u?"li":u,d=e.disableGutters,f=void 0!==d&&d,p=e.ListItemClasses,h=e.role,b=void 0===h?"menuitem":h,v=e.selected,g=e.tabIndex,y=Object(r.a)(e,["classes","className","component","disableGutters","ListItemClasses","role","selected","tabIndex"]);return e.disabled||(n=void 0!==g?g:-1),o.createElement(m,Object(i.a)({button:!0,role:b,tabIndex:n,component:l,selected:v,disableGutters:f,classes:Object(i.a)({dense:a.dense},p),className:Object(s.a)(a.root,c,v&&a.selected,!f&&a.gutters),ref:t},y))}));t.a=Object(c.a)((function(e){return{root:Object(i.a)({},e.typography.body1,Object(a.a)({minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",width:"auto",overflow:"hidden",whiteSpace:"nowrap"},e.breakpoints.up("sm"),{minHeight:"auto"})),gutters:{},selected:{},dense:Object(i.a)({},e.typography.body2,{minHeight:"auto"})}}),{name:"MuiMenuItem"})(v)},function(e,t,n){"use strict";var r=n(14),a=n(23),i=n(4),o=(n(30),n(25)),s=n(87),c=Object(s.a)(i.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel"),u=n(35),l=n(47),d=n(50),f=n(42),p=n(313);function h(e){return"Backspace"===e.key||"Delete"===e.key}var b=i.forwardRef((function(e,t){var n=e.avatar,s=e.classes,u=e.className,l=e.clickable,b=e.color,m=void 0===b?"default":b,v=e.component,g=e.deleteIcon,y=e.disabled,O=void 0!==y&&y,x=e.icon,k=e.label,w=e.onClick,j=e.onDelete,S=e.onKeyDown,N=e.onKeyUp,I=e.size,C=void 0===I?"medium":I,T=e.variant,E=void 0===T?"default":T,A=Object(a.a)(e,["avatar","classes","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant"]),R=i.useRef(null),F=Object(d.a)(R,t),D=function(e){e.stopPropagation(),j&&j(e)},_=!(!1===l||!w)||l,M="small"===C,z=v||(_?p.a:"div"),L=z===p.a?{component:"div"}:{},P=null;if(j){var B=Object(o.a)("default"!==m&&("default"===E?s["deleteIconColor".concat(Object(f.a)(m))]:s["deleteIconOutlinedColor".concat(Object(f.a)(m))]),M&&s.deleteIconSmall);P=g&&i.isValidElement(g)?i.cloneElement(g,{className:Object(o.a)(g.props.className,s.deleteIcon,B),onClick:D}):i.createElement(c,{className:Object(o.a)(s.deleteIcon,B),onClick:D})}var W=null;n&&i.isValidElement(n)&&(W=i.cloneElement(n,{className:Object(o.a)(s.avatar,n.props.className,M&&s.avatarSmall,"default"!==m&&s["avatarColor".concat(Object(f.a)(m))])}));var U=null;return x&&i.isValidElement(x)&&(U=i.cloneElement(x,{className:Object(o.a)(s.icon,x.props.className,M&&s.iconSmall,"default"!==m&&s["iconColor".concat(Object(f.a)(m))])})),i.createElement(z,Object(r.a)({role:_||j?"button":void 0,className:Object(o.a)(s.root,u,"default"!==m&&[s["color".concat(Object(f.a)(m))],_&&s["clickableColor".concat(Object(f.a)(m))],j&&s["deletableColor".concat(Object(f.a)(m))]],"default"!==E&&[s.outlined,{primary:s.outlinedPrimary,secondary:s.outlinedSecondary}[m]],O&&s.disabled,M&&s.sizeSmall,_&&s.clickable,j&&s.deletable),"aria-disabled":!!O||void 0,tabIndex:_||j?0:void 0,onClick:w,onKeyDown:function(e){e.currentTarget===e.target&&h(e)&&e.preventDefault(),S&&S(e)},onKeyUp:function(e){e.currentTarget===e.target&&(j&&h(e)?j(e):"Escape"===e.key&&R.current&&R.current.blur()),N&&N(e)},ref:F},L,A),W||U,i.createElement("span",{className:Object(o.a)(s.label,M&&s.labelSmall)},k),P)}));t.a=Object(u.a)((function(e){var t="light"===e.palette.type?e.palette.grey[300]:e.palette.grey[700],n=Object(l.c)(e.palette.text.primary,.26);return{root:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:e.palette.getContrastText(t),backgroundColor:t,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:0,textDecoration:"none",border:"none",padding:0,verticalAlign:"middle",boxSizing:"border-box","&$disabled":{opacity:.5,pointerEvents:"none"},"& $avatar":{marginLeft:5,marginRight:-6,width:24,height:24,color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],fontSize:e.typography.pxToRem(12)},"& $avatarColorPrimary":{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark},"& $avatarColorSecondary":{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.dark},"& $avatarSmall":{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)}},sizeSmall:{height:24},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},disabled:{},clickable:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover, &:focus":{backgroundColor:Object(l.b)(t,.08)},"&:active":{boxShadow:e.shadows[1]}},clickableColorPrimary:{"&:hover, &:focus":{backgroundColor:Object(l.b)(e.palette.primary.main,.08)}},clickableColorSecondary:{"&:hover, &:focus":{backgroundColor:Object(l.b)(e.palette.secondary.main,.08)}},deletable:{"&:focus":{backgroundColor:Object(l.b)(t,.08)}},deletableColorPrimary:{"&:focus":{backgroundColor:Object(l.b)(e.palette.primary.main,.2)}},deletableColorSecondary:{"&:focus":{backgroundColor:Object(l.b)(e.palette.secondary.main,.2)}},outlined:{backgroundColor:"transparent",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:Object(l.c)(e.palette.text.primary,e.palette.action.hoverOpacity)},"& $avatar":{marginLeft:4},"& $avatarSmall":{marginLeft:2},"& $icon":{marginLeft:4},"& $iconSmall":{marginLeft:2},"& $deleteIcon":{marginRight:5},"& $deleteIconSmall":{marginRight:3}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(e.palette.primary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:Object(l.c)(e.palette.primary.main,e.palette.action.hoverOpacity)}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(e.palette.secondary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:Object(l.c)(e.palette.secondary.main,e.palette.action.hoverOpacity)}},avatar:{},avatarSmall:{},avatarColorPrimary:{},avatarColorSecondary:{},icon:{color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],marginLeft:5,marginRight:-6},iconSmall:{width:18,height:18,marginLeft:4,marginRight:-4},iconColorPrimary:{color:"inherit"},iconColorSecondary:{color:"inherit"},label:{overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},labelSmall:{paddingLeft:8,paddingRight:8},deleteIcon:{WebkitTapHighlightColor:"transparent",color:n,height:22,width:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:Object(l.c)(n,.4)}},deleteIconSmall:{height:16,width:16,marginRight:4,marginLeft:-4},deleteIconColorPrimary:{color:Object(l.c)(e.palette.primary.contrastText,.7),"&:hover, &:active":{color:e.palette.primary.contrastText}},deleteIconColorSecondary:{color:Object(l.c)(e.palette.secondary.contrastText,.7),"&:hover, &:active":{color:e.palette.secondary.contrastText}},deleteIconOutlinedColorPrimary:{color:Object(l.c)(e.palette.primary.main,.7),"&:hover, &:active":{color:e.palette.primary.main}},deleteIconOutlinedColorSecondary:{color:Object(l.c)(e.palette.secondary.main,.7),"&:hover, &:active":{color:e.palette.secondary.main}}}}),{name:"MuiChip"})(b)},function(e,t,n){"use strict";var r=n(14),a=n(23),i=n(4),o=(n(30),n(25)),s=n(35),c=n(87),u=Object(c.a)(i.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");var l=i.forwardRef((function(e,t){var n=e.alt,s=e.children,c=e.classes,l=e.className,d=e.component,f=void 0===d?"div":d,p=e.imgProps,h=e.sizes,b=e.src,m=e.srcSet,v=e.variant,g=void 0===v?"circle":v,y=Object(a.a)(e,["alt","children","classes","className","component","imgProps","sizes","src","srcSet","variant"]),O=null,x=function(e){var t=e.src,n=e.srcSet,r=i.useState(!1),a=r[0],o=r[1];return i.useEffect((function(){if(t||n){o(!1);var e=!0,r=new Image;return r.src=t,r.srcSet=n,r.onload=function(){e&&o("loaded")},r.onerror=function(){e&&o("error")},function(){e=!1}}}),[t,n]),a}({src:b,srcSet:m}),k=b||m,w=k&&"error"!==x;return O=w?i.createElement("img",Object(r.a)({alt:n,src:b,srcSet:m,sizes:h,className:c.img},p)):null!=s?s:k&&n?n[0]:i.createElement(u,{className:c.fallback}),i.createElement(f,Object(r.a)({className:Object(o.a)(c.root,c.system,c[g],l,!w&&c.colorDefault),ref:t},y),O)}));t.a=Object(s.a)((function(e){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:e.palette.background.default,backgroundColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},circle:{},circular:{},rounded:{borderRadius:e.shape.borderRadius},square:{borderRadius:0},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4},fallback:{width:"75%",height:"75%"}}}),{name:"MuiAvatar"})(l)},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(170),a=n(237),i=n(128);var o={m:"margin",p:"padding"},s={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},c={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},u=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){if(e.length>2){if(!c[e])return[e];e=c[e]}var t=e.split(""),n=Object(r.a)(t,2),a=n[0],i=n[1],u=o[a],l=s[i]||"";return Array.isArray(l)?l.map((function(e){return u+e})):[u+l]})),l=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function d(e){var t=e.spacing||8;return"number"===typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"===typeof t?t:function(){}}function f(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function p(e){var t=d(e.theme);return Object.keys(e).map((function(n){if(-1===l.indexOf(n))return null;var r=f(u(n),t),i=e[n];return Object(a.a)(e,i,r)})).reduce(i.a,{})}p.propTypes={},p.filterProps=l;t.b=p}]]);
  3. //# sourceMappingURL=2.e1845539.chunk.js.map