/*! * Stockfish.js 16.1 (c) 2024, Chess.com, LLC * https://github.com/nmrugg/stockfish.js * License: GPLv3 * * Based on Stockfish (c) T. Romstad, M. Costalba, J. Kiiski, G. Linscott and other contributors. * https://github.com/official-stockfish/Stockfish * * Nets by Linmiao Xu (linrock) * https://tests.stockfishchess.org/nns?network_name=nn-9067e33176e */!function(){var a,u,s,e,t,r;function o(){function e(e){e=e||{},(f=f||(void 0!==e?e:{})).ready=new Promise(function(e,n){T=e,i=n}),"undefined"!=typeof global&&"[object process]"===Object.prototype.toString.call(global.process)&&"undefined"!=typeof fetch&&("undefined"==typeof XMLHttpRequest&&(global.XMLHttpRequest=function(){var t,r={open:function(e,n){t=n},send:function(){require("fs").readFile(t,function(e,n){r.readyState=4,e?(console.error(e),r.status=404,r.onerror(e)):(r.status=200,r.response=n,r.onreadystatechange(),r.onload())})}};return r}),fetch=null),f.print=function(e){f.listener?f.listener(e):console.log(e)},f.printErr=function(e){f.listener?f.listener(e):console.error(e)},f.terminate=function(){"undefined"!=typeof PThread&&PThread.Y()};var f,T,i,n,t,U,r,H,a,o=Object.assign({},f),u=[],s="./this.program",c=(e,n)=>{throw n},k="object"==typeof window,l="function"==typeof importScripts,q="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="",L=(q?(p=l?require("path").dirname(p)+"/":__dirname+"/",H=()=>{r||(U=require("fs"),r=require("path"))},n=function(e,n){return H(),e=r.normalize(e),U.readFileSync(e,n?void 0:"utf8")},t=e=>e=(e=n(e,!0)).buffer?e:new Uint8Array(e),1{if(m||0<_)throw process.exitCode=e,n;n instanceof j||d("exiting due to exception: "+n),process.exit(e)},f.inspect=function(){return"[Emscripten Module object]"}):(k||l)&&(l?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),p=0!==(p=Pe?Pe:p).indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",n=e=>{var n=new XMLHttpRequest;return n.open("GET",e,!1),n.send(null),n.responseText},l)&&(t=e=>{var n=new XMLHttpRequest;return n.open("GET",e,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),f.print||console.log.bind(console)),d=f.printErr||console.warn.bind(console),m=(Object.assign(f,o),f.arguments&&(u=f.arguments),f.thisProgram&&(s=f.thisProgram),f.quit&&(c=f.quit),f.wasmBinary&&(a=f.wasmBinary),f.noExitRuntime||!0);"object"!=typeof WebAssembly&&C("no native wasm support detected");var W,B,y,h,g,v=!1,N="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function J(e,n,t){var r=n+t;for(t=n;e[t]&&!(r<=t);)++t;if(16>10,56320|1023&a)))):r+=String.fromCharCode(a)}return r}function X(e){return e?J(h,e,void 0):""}function z(e,n,t,r){if(0>6}else{if(i<=65535){if(r<=t+2)break;n[t++]=224|i>>12}else{if(r<=t+3)break;n[t++]=240|i>>18,n[t++]=128|i>>12&63}n[t++]=128|i>>6&63}n[t++]=128|63&i}}n[t]=0}}function G(e){for(var n=0,t=0;t{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now(),fe={};function pe(){if(!ce){var e,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:s||"./this.program"};for(e in fe)void 0===fe[e]?delete n[e]:n[e]=fe[e];var t=[];for(e in n)t.push(e+"="+n[e]);ce=t}return ce}function A(e){return 0==e%4&&(0!=e%100||0==e%400)}function de(e,n){for(var t=0,r=0;r<=n;t+=e[r++]);return t}var I=[31,29,31,30,31,30,31,31,30,31,30,31],R=[31,28,31,30,31,30,31,31,30,31,30,31];function M(e,n){for(e=new Date(e.getTime());0r-e.getDate())){e.setDate(e.getDate()+n);break}n-=r-e.getDate()+1,e.setDate(1),t<11?e.setMonth(t+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function me(e,n,t,r){function o(e,n,t){for(e="number"==typeof e?e.toString():e||"";e.length>2];for(c in r={U:g[r>>2],T:g[r+4>>2],L:g[r+8>>2],K:g[r+12>>2],J:g[r+16>>2],I:g[r+20>>2],M:g[r+24>>2],N:g[r+28>>2],Z:g[r+32>>2],S:g[r+36>>2],V:l?X(l):""},t=X(t),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})t=t.replace(new RegExp(c,"g"),l[c]);var f,p,d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),m="January February March April May June July August September October November December".split(" "),l={"%a":function(e){return d[e.M].substring(0,3)},"%A":function(e){return d[e.M]},"%b":function(e){return m[e.J].substring(0,3)},"%B":function(e){return m[e.J]},"%C":function(e){return i((e.I+1900)/100|0,2)},"%d":function(e){return i(e.K,2)},"%e":function(e){return o(e.K,2," ")},"%g":function(e){return s(e).toString().substring(2)},"%G":s,"%H":function(e){return i(e.L,2)},"%I":function(e){return 0==(e=e.L)?e=12:12n?0:(y.set(c,e),c.length-1)}function x(e){try{e()}catch(e){C(e)}}var F=0,E=null,O=[],ye={},he={},ge=0,ve=null,we=[];function _e(t){var e,r={};for(e in t)!function(e){var n=t[e];r[e]="function"==typeof n?function(){O.push(e);try{return n.apply(null,arguments)}finally{v||(O.pop()!==e&&C(void 0),E&&1===F&&0===O.length&&(F=0,x(f._asyncify_stop_unwind),"undefined"!=typeof Fibers)&&Fibers.$())}}:n}(e);return r}function be(e){var o,i,n,t;v||(0===F?(i=o=!1,e(()=>{if(!v&&(o=!0,i)){F=2,x(()=>f._asyncify_start_rewind(E)),"undefined"!=typeof Browser&&Browser.P.R&&Browser.P.resume();var n=!1;try{var t=(0,f.asm[he[g[E+8>>2]]])()}catch(e){t=e,n=!0}var e,r=!1;if(E||(e=ve)&&(ve=null,(n?e.reject:e.resolve)(t),r=!0),n&&!r)throw t}}),i=!0,o||(F=1,e=Ae(10485772),n=e+12,g[e>>2]=n,g[e+4>>2]=n+10485760,n=O[0],void 0===(t=ye[n])&&(t=ge++,ye[n]=t,he[t]=n),g[e+8>>2]=t,E=e,x(()=>f._asyncify_start_unwind(E)),"undefined"!=typeof Browser&&Browser.P.R&&Browser.P.pause())):2===F?(F=0,x(f._asyncify_stop_rewind),Ce(E),E=null,we.forEach(e=>se(e))):C("invalid state: "+F))}var P,Se={c:function(){return 0},j:function(){},f:function(){return 0},g:function(){},a:function(){C("")},h:function(e,n){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return g[De()>>2]=28,-1;e=le()}return g[n>>2]=e/1e3|0,g[n+4>>2]=e%1e3*1e6|0,0},i:function(e,n,t){h.copyWithin(e,n,n+t)},b:function(e){var n=h.length;if(!(2147483648<(e>>>=0)))for(var t=1;t<=4;t*=2){var r=n*(1+.2/t),r=Math.min(r,e+100663296),o=Math;r=Math.max(e,r),o=o.min.call(o,2147483648,r+(65536-r%65536)%65536);e:{try{W.grow(o-B.byteLength+65535>>>16),V();var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},k:function(t){be(e=>{return n=e,setTimeout(function(){se(n)},t);var n})},n:function(r,o){var i=0;return pe().forEach(function(e,n){var t=o+i;for(n=g[r+4*n>>2]=t,t=0;t>0]=e.charCodeAt(t);y[n>>0]=0,i+=e.length+1}),0},o:function(e,n){var t=pe(),r=(g[e>>2]=t.length,0);return t.forEach(function(e){r+=e.length+1}),g[n>>2]=r,0},e:function(e){Ee(e)},d:function(){return 0},q:function(e,n,t,r){return e=ue.X(e),n=ue.W(e,n,t),g[r>>2]=n,0},l:function(){},p:function(e,n,t,r){for(var o=0,i=0;i>2],u=g[n+4>>2];n+=8;for(var s=0;s>2]=o,0},m:me},Ce=(!function(){function n(e){e=_e(e=e.exports),f.asm=e,W=f.asm.r,V(),$.unshift(f.asm.s),b--,f.monitorRunDependencies&&f.monitorRunDependencies(b),0==b&&(null!==te&&(clearInterval(te),te=null),S)&&(e=S,S=null,e())}function t(e){n(e.instance)}function r(e){return(a||!k&&!l||"function"!=typeof fetch?Promise.resolve().then(oe):fetch(w,{credentials:"same-origin"}).then(function(e){if(e.ok)return e.arrayBuffer();throw"failed to load wasm binary file at '"+w+"'"}).catch(oe)).then(function(e){return WebAssembly.instantiate(e,o)}).then(function(e){return e}).then(e,function(e){d("failed to asynchronously prepare wasm: "+e),C(e)})}var o={a:Se};if(b++,f.monitorRunDependencies&&f.monitorRunDependencies(b),f.instantiateWasm)try{var e=f.instantiateWasm(o,n);return _e(e)}catch(e){return d("Module.instantiateWasm callback failed with error: "+e)}(a||"function"!=typeof WebAssembly.instantiateStreaming||re()||"function"!=typeof fetch?r(t):fetch(w,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,o).then(t,function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),r(t)})})).catch(i)}(),f.___wasm_call_ctors=function(){return(f.___wasm_call_ctors=f.asm.s).apply(null,arguments)},f._main=function(){return(f._main=f.asm.t).apply(null,arguments)},f._command=function(){return(f._command=f.asm.u).apply(null,arguments)},f._free=function(){return(Ce=f._free=f.asm.v).apply(null,arguments)}),De=f.___errno_location=function(){return(De=f.___errno_location=f.asm.w).apply(null,arguments)},Ae=f._malloc=function(){return(Ae=f._malloc=f.asm.x).apply(null,arguments)},Ie=f.stackSave=function(){return(Ie=f.stackSave=f.asm.z).apply(null,arguments)},Re=f.stackRestore=function(){return(Re=f.stackRestore=f.asm.A).apply(null,arguments)},Y=f.stackAlloc=function(){return(Y=f.stackAlloc=f.asm.B).apply(null,arguments)},Me=f.dynCall_vi=function(){return(Me=f.dynCall_vi=f.asm.C).apply(null,arguments)},xe=f.dynCall_v=function(){return(xe=f.dynCall_v=f.asm.D).apply(null,arguments)};function j(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Fe(i){function e(){if(!P&&(P=!0,f.calledRun=!0,!v)){if(D($),D(Q),T(f),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Oe){var e=i,n=f._main,t=(e=e||[]).length+1,r=Y(4*(t+1));g[r>>2]=K(s);for(var o=1;o>2)+o]=K(e[o-1]);g[(r>>2)+t]=0;try{Ee(n(t,r))}catch(e){ie(e)}}if(f.postRun)for("function"==typeof f.postRun&&(f.postRun=[f.postRun]);f.postRun.length;)e=f.postRun.shift(),ee.unshift(e);D(ee)}}if(i=i||u,!(0{ve={resolve:e,reject:n}}).then(i):(r=i(r),o?Promise.resolve(r):r)},S=function e(){P||Fe(),P||(S=e)},f.run=Fe,f.preInit)for("function"==typeof f.preInit&&(f.preInit=[f.preInit]);0>>0)),i=a.slice(0,-n.length);for(e=0;e