const BQ={},Jg=(i,o)=>i===o,mB=Symbol("solid-proxy"),hQ={equals:Jg};let Ig=yg;const OB={},fB=1,RQ=2,gg={owned:null,cleanups:null,context:null,owner:null};var TA=null;let EQ=null,mA=null,IQ=null,$A=null,sB=null,zQ=0;function LQ(i,o){const y=mA,U=TA,G=i.length===0?gg:{owned:null,cleanups:null,context:null,owner:o||U};TA=G,mA=null;try{return _Q(()=>i(()=>$Q(G)),!0)}finally{mA=y,TA=U}}function Eg(i,o){o=o?Object.assign({},hQ,o):hQ;const y={value:i,observers:null,observerSlots:null,pending:OB,comparator:o.equals||void 0},U=G=>(typeof G=="function"&&(G=G(y.pending!==OB?y.pending:y.value)),TQ(y,G));return[Dg.bind(y),U]}function WQ(i,o,y){const U=PQ(i,o,!1,fB);iQ(U)}function AE(i,o,y){Ig=dg;const U=PQ(i,o,!1,fB);U.user=!0,sB?sB.push(U):queueMicrotask(()=>iQ(U))}function MB(i,o,y){y=y?Object.assign({},hQ,y):hQ;const U=PQ(i,o,!0,0);return U.pending=OB,U.observers=null,U.observerSlots=null,U.comparator=y.equals||void 0,iQ(U),Dg.bind(U)}function Cg(i){if(IQ)return i();let o;const y=IQ=[];try{o=i()}finally{IQ=null}return _Q(()=>{for(let U=0;UvQ(o()))}function Dg(){const i=EQ;if(this.sources&&(this.state||i)){const o=$A;$A=null,this.state===fB||i?iQ(this):aQ(this),$A=o}if(mA){const o=this.observers?this.observers.length:0;mA.sources?(mA.sources.push(this),mA.sourceSlots.push(o)):(mA.sources=[this],mA.sourceSlots=[o]),this.observers?(this.observers.push(mA),this.observerSlots.push(mA.sources.length-1)):(this.observers=[mA],this.observerSlots=[mA.sources.length-1])}return this.value}function TQ(i,o,y){if(i.comparator&&i.comparator(i.value,o))return o;if(IQ)return i.pending===OB&&IQ.push(i),i.pending=o,o;let U=!1;return i.value=o,i.observers&&i.observers.length&&_Q(()=>{for(let G=0;G1e6)throw $A=[],new Error},!1),o}function iQ(i){if(!i.fn)return;$Q(i);const o=TA,y=mA,U=zQ;mA=TA=i,Kg(i,i.value,U),mA=y,TA=o}function Kg(i,o,y){let U;try{U=i.fn(o)}catch(G){og(G)}(!i.updatedAt||i.updatedAt<=y)&&(i.observers&&i.observers.length?TQ(i,U):i.value=U,i.updatedAt=y)}function PQ(i,o,y,U=fB,G){const Y={fn:i,state:U,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:o,owner:TA,context:null,pure:y};return TA===null||TA!==gg&&(TA.owned?TA.owned.push(Y):TA.owned=[Y]),Y}function gQ(i){const o=EQ;if(i.state===0||o)return;if(i.state===RQ||o)return aQ(i);if(i.suspense&&CQ(i.suspense.inFallback))return i.suspense.effects.push(i);const y=[i];for(;(i=i.owner)&&(!i.updatedAt||i.updatedAt=0;U--)if(i=y[U],i.state===fB||o)iQ(i);else if(i.state===RQ||o){const G=$A;$A=null,aQ(i,y[0]),$A=G}}function _Q(i,o){if($A)return i();let y=!1;o||($A=[]),sB?y=!0:sB=[],zQ++;try{return i()}catch(U){og(U)}finally{lg(y)}}function lg(i){$A&&(yg($A),$A=null),!i&&(sB.length?Cg(()=>{Ig(sB),sB=null}):sB=null)}function yg(i){for(let o=0;o1?[]:null;return rg(()=>Ag(Y)),()=>{let C=i()||[],X,t;return CQ(()=>{let w=C.length,u,e,x,r,p,Z,_,$,q;if(w===0)k!==0&&(Ag(Y),Y=[],U=[],G=[],k=0,J&&(J=[])),y.fallback&&(U=[fg],G[0]=LQ(sA=>(Y[0]=sA,y.fallback())),k=1);else if(k===0){for(G=new Array(w),t=0;t=Z&&$>=Z&&U[_]===C[$];_--,$--)x[$]=G[_],r[$]=Y[_],J&&(p[$]=J[_]);for(u=new Map,e=new Array($+1),t=$;t>=Z;t--)q=C[t],X=u.get(q),e[t]=X===void 0?-1:X,u.set(q,t);for(X=Z;X<=_;X++)q=U[X],t=u.get(q),t!==void 0&&t!==-1?(x[t]=G[X],r[t]=Y[X],J&&(p[t]=J[X]),t=e[t],u.set(q,t)):Y[X]();for(t=Z;ti(o))}function QE(i){const o="fallback"in i&&{fallback:()=>i.fallback};return MB(ug(()=>i.each,i.children,o||void 0))}function IE(i){let o=!1;const y=MB(()=>i.when,void 0,{equals:(U,G)=>o?U===G:!U==!G});return MB(()=>{const U=y();if(U){const G=i.children;return(o=typeof G=="function"&&G.length>0)?CQ(()=>G(U)):G}return i.fallback})}function gE(i){let o=!1;const y=Vg(()=>i.children),U=MB(()=>{let G=y();Array.isArray(G)||(G=[G]);for(let Y=0;YG[0]===Y[0]&&(o?G[1]===Y[1]:!G[1]==!Y[1])&&G[2]===Y[2]});return MB(()=>{const[G,Y,k]=U();if(G<0)return i.fallback;const J=k.children;return(o=typeof J=="function"&&J.length>0)?CQ(()=>J(Y)):J})}function EE(i){return i}function CE(i,o){return MB(i,void 0,o?void 0:{equals:o})}function pg(i,o,y){let U=y.length,G=o.length,Y=U,k=0,J=0,C=o[G-1].nextSibling,X=null;for(;kt-J){const e=o[k];for(;J{U=G,o===document?i():xg(o,i(),o.firstChild?null:void 0,y)}),()=>{U(),o.textContent=""}}function DE(i,o,y){const U=document.createElement("template");U.innerHTML=i;let G=U.content.firstChild;return y&&(G=G.firstChild),G}function yE(i,o=window.document){const y=o[Bg]||(o[Bg]=new Set);for(let U=0,G=i.length;Uy[0](y[1],G)):i.addEventListener(o,y)}function xg(i,o,y,U){if(y!==void 0&&!U&&(U=[]),typeof o!="function")return tQ(i,o,U,y);WQ(G=>tQ(i,o(),G,y),U)}function bg(i){const o=`$$${i.type}`;let y=i.composedPath&&i.composedPath()[0]||i.target;for(i.target!==y&&Object.defineProperty(i,"target",{configurable:!0,value:y}),Object.defineProperty(i,"currentTarget",{configurable:!0,get(){return y||document}});y!==null;){const U=y[o];if(U&&!y.disabled){const G=y[`${o}Data`];if(G!==void 0?U(G,i):U(i),i.cancelBubble)return}y=y.host&&y.host!==y&&y.host instanceof Node?y.host:y.parentNode}}function tQ(i,o,y,U,G){for(BQ.context&&!y&&(y=[...i.childNodes]);typeof y=="function";)y=y();if(o===y)return y;const Y=typeof o,k=U!==void 0;if(i=k&&y[0]&&y[0].parentNode||i,Y==="string"||Y==="number"){if(BQ.context)return y;if(Y==="number"&&(o=o.toString()),k){let J=y[0];J&&J.nodeType===3?J.data=o:J=document.createTextNode(o),y=qB(i,y,U,J)}else y!==""&&typeof y=="string"?y=i.firstChild.data=o:y=i.textContent=o}else if(o==null||Y==="boolean"){if(BQ.context)return y;y=qB(i,y,U)}else{if(Y==="function")return WQ(()=>{let J=o();for(;typeof J=="function";)J=J();y=tQ(i,J,y,U)}),()=>y;if(Array.isArray(o)){const J=[];if(XQ(J,o,G))return WQ(()=>y=tQ(i,J,y,U,!0)),()=>y;if(BQ.context){for(let C=0;C=0;k--){const J=o[k];if(G!==J){const C=J.parentNode===i;!Y&&!k?C?i.replaceChild(G,J):i.insertBefore(G,y):C&&J.remove()}else Y=!0}}else i.insertBefore(G,y);return[G]}function Zg(i){if(i.__esModule)return i;var o=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(i).forEach(function(y){var U=Object.getOwnPropertyDescriptor(i,y);Object.defineProperty(o,y,U.get?U:{enumerable:!0,get:function(){return i[y]}})}),o}function YQ(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ug={exports:{}};(function(i){(function(){function o(F,N,V){return F.call.apply(F.bind,arguments)}function y(F,N,V){if(!F)throw Error();if(2=N.f?HA():F.fonts.load(q(N.a),N.h).then(function(s){1<=s.length?z():setTimeout(c,25)},function(){HA()})}c()}),b=null,P=new Promise(function(z,HA){b=setTimeout(HA,N.f)});Promise.race([P,n]).then(function(){b&&(clearTimeout(b),b=null),N.g(N.a)},function(){N.j(N.a)})};function LA(F,N,V,n,b,P,z){this.v=F,this.B=N,this.c=V,this.a=n,this.s=z||"BESbswy",this.f={},this.w=b||3e3,this.u=P||null,this.m=this.j=this.h=this.g=null,this.g=new FA(this.c,this.s),this.h=new FA(this.c,this.s),this.j=new FA(this.c,this.s),this.m=new FA(this.c,this.s),F=new $(this.a.c+",serif",YA(this.a)),F=xA(F),this.g.a.style.cssText=F,F=new $(this.a.c+",sans-serif",YA(this.a)),F=xA(F),this.h.a.style.cssText=F,F=new $("serif",YA(this.a)),F=xA(F),this.j.a.style.cssText=F,F=new $("sans-serif",YA(this.a)),F=xA(F),this.m.a.style.cssText=F,uA(this.g),uA(this.h),uA(this.j),uA(this.m)}var MA={D:"serif",C:"sans-serif"},gB=null;function O(){if(gB===null){var F=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);gB=!!F&&(536>parseInt(F[1],10)||parseInt(F[1],10)===536&&11>=parseInt(F[2],10))}return gB}LA.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=G(),BB(this)};function jA(F,N,V){for(var n in MA)if(MA.hasOwnProperty(n)&&N===F.f[MA[n]]&&V===F.f[MA[n]])return!0;return!1}function BB(F){var N=F.g.a.offsetWidth,V=F.h.a.offsetWidth,n;(n=N===F.f.serif&&V===F.f["sans-serif"])||(n=O()&&jA(F,N,V)),n?G()-F.A>=F.w?O()&&jA(F,N,V)&&(F.u===null||F.u.hasOwnProperty(F.a.c))?pA(F,F.v):pA(F,F.B):NB(F):pA(F,F.v)}function NB(F){setTimeout(U(function(){BB(this)},F),50)}function pA(F,N){setTimeout(U(function(){X(this.g.a),X(this.h.a),X(this.j.a),X(this.m.a),N(this.a)},F),0)}function yB(F,N,V){this.c=F,this.a=N,this.f=0,this.m=this.j=!1,this.s=V}var QB=null;yB.prototype.g=function(F){var N=this.a;N.g&&t(N.f,[N.a.c("wf",F.c,YA(F).toString(),"active")],[N.a.c("wf",F.c,YA(F).toString(),"loading"),N.a.c("wf",F.c,YA(F).toString(),"inactive")]),RA(N,"fontactive",F),this.m=!0,HB(this)},yB.prototype.h=function(F){var N=this.a;if(N.g){var V=K(N.f,N.a.c("wf",F.c,YA(F).toString(),"active")),n=[],b=[N.a.c("wf",F.c,YA(F).toString(),"loading")];V||n.push(N.a.c("wf",F.c,YA(F).toString(),"inactive")),t(N.f,n,b)}RA(N,"fontinactive",F),HB(this)};function HB(F){--F.f==0&&F.j&&(F.m?(F=F.a,F.g&&t(F.f,[F.a.c("wf","active")],[F.a.c("wf","loading"),F.a.c("wf","inactive")]),RA(F,"active")):m(F.a))}function GB(F){this.j=F,this.a=new GA,this.h=0,this.f=this.g=!0}GB.prototype.load=function(F){this.c=new Y(this.j,F.context||this.j),this.g=F.events!==!1,this.f=F.classes!==!1,j(this,new UA(this.c,F),F)};function JB(F,N,V,n,b){var P=--F.h==0;(F.f||F.g)&&setTimeout(function(){var z=b||null,HA=n||null||{};if(V.length===0&&P)m(N.a);else{N.f+=V.length,P&&(N.j=P);var c,s=[];for(c=0;ci.length<2?i:(...y)=>(U=>U.length>=i.length?i(...U):AI(i,U))([...o,...y]);JQ.curry=AI;JQ.default=AI;Object.defineProperty(MQ,"__esModule",{value:!0});MQ.chunk_=void 0;const qg=JQ,mg=(i,o)=>{if(i<=0)throw new Error("Chunk size has to be greater than 0.");const y=new Array(Math.ceil(o.length/i));for(let U=0,G=0;U1&&o.indexOf("Macintosh")!==-1&&o.indexOf("Safari")!==-1&&(y=!0),y}var sE=rQ.exports;const sg=Symbol("store-raw"),kQ=Symbol("store-node"),vg=Symbol("store-name");function Ng(i,o){let y=i[mB];if(!y){Object.defineProperty(i,mB,{value:y=new Proxy(i,zg)});const U=Object.keys(i),G=Object.getOwnPropertyDescriptors(i);for(let Y=0,k=U.length;Yi[mB][o]),y}function jg(i){if(ig()){const o=nQ(i);(o._||(o._=jQ()))()}return Reflect.ownKeys(i)}function jQ(){const[i,o]=Eg(void 0,{equals:!1,internal:!0});return i.$=o,i}const zg={get(i,o,y){if(o===sg)return i;if(o===mB)return y;const U=i[o];if(o===kQ||o==="__proto__")return U;const G=SQ(U);if(ig()&&(typeof U!="function"||i.hasOwnProperty(o))){let Y,k;G&&(Y=nQ(U))&&(k=Y._||(Y._=jQ()),k()),Y=nQ(i),k=Y[o]||(Y[o]=jQ()),k()}return G?Ng(U):U},set(){return!0},deleteProperty(){return!0},ownKeys:jg,getOwnPropertyDescriptor:Xg};function Hg(i,o,y){if(i[o]===y)return;const U=Array.isArray(i),G=i.length,Y=y===void 0,k=U||Y===o in i;Y?delete i[o]:i[o]=y;let J=nQ(i),C;(C=J[o])&&C.$(),U&&i.length!==G&&(C=J.length)&&C.$(),k&&(C=J._)&&C.$()}function Tg(i,o){const y=Object.keys(o);for(let U=0;U1){U=o.shift();const k=typeof U,J=Array.isArray(i);if(Array.isArray(U)){for(let C=0;C1){QQ(i[U],o,[U].concat(y));return}G=i[U],y=[U].concat(y)}let Y=o[0];typeof Y=="function"&&(Y=Y(G,y),Y===G)||U===void 0&&Y==null||(Y=eQ(Y),U===void 0||SQ(G)&&SQ(Y)&&!Array.isArray(Y)?Tg(G,Y):Hg(i,U,Y))}function NE(i,o){const y=eQ(i||{}),U=Ng(y);function G(...Y){Cg(()=>QQ(y,Y))}return[U,G]}var Pg={};(function(i){var o=function(y){var U="b",G="w",Y=-1,k="p",J="n",C="b",X="r",t="q",K="k",w="pnbrqkPNBRQK",u="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",e=["1-0","0-1","1/2-1/2","*"],x={b:[16,32,17,15],w:[-16,-32,-17,-15]},r={n:[-18,-33,-31,-14,18,33,31,14],b:[-17,-15,17,15],r:[-16,1,16,-1],q:[-17,-16,-15,1,17,16,15,-1],k:[-17,-16,-15,1,17,16,15,-1]},p=[20,0,0,0,0,0,0,24,0,0,0,0,0,0,20,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,24,24,24,24,24,24,56,0,56,24,24,24,24,24,24,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,20,0,0,0,0,0,0,24,0,0,0,0,0,0,20],Z=[17,0,0,0,0,0,0,16,0,0,0,0,0,0,15,0,0,17,0,0,0,0,0,16,0,0,0,0,0,15,0,0,0,0,17,0,0,0,0,16,0,0,0,0,15,0,0,0,0,0,0,17,0,0,0,16,0,0,0,15,0,0,0,0,0,0,0,0,17,0,0,16,0,0,15,0,0,0,0,0,0,0,0,0,0,17,0,16,0,15,0,0,0,0,0,0,0,0,0,0,0,0,17,16,15,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-15,-16,-17,0,0,0,0,0,0,0,0,0,0,0,0,-15,0,-16,0,-17,0,0,0,0,0,0,0,0,0,0,-15,0,0,-16,0,0,-17,0,0,0,0,0,0,0,0,-15,0,0,0,-16,0,0,0,-17,0,0,0,0,0,0,-15,0,0,0,0,-16,0,0,0,0,-17,0,0,0,0,-15,0,0,0,0,0,-16,0,0,0,0,0,-17,0,0,-15,0,0,0,0,0,0,-16,0,0,0,0,0,0,-17],_={p:0,n:1,b:2,r:3,q:4,k:5},$={NORMAL:"n",CAPTURE:"c",BIG_PAWN:"b",EP_CAPTURE:"e",PROMOTION:"p",KSIDE_CASTLE:"k",QSIDE_CASTLE:"q"},q={NORMAL:1,CAPTURE:2,BIG_PAWN:4,EP_CAPTURE:8,PROMOTION:16,KSIDE_CASTLE:32,QSIDE_CASTLE:64},sA=7,YA=6,nA=1,vA=0,UA={a8:0,b8:1,c8:2,d8:3,e8:4,f8:5,g8:6,h8:7,a7:16,b7:17,c7:18,d7:19,e7:20,f7:21,g7:22,h7:23,a6:32,b6:33,c6:34,d6:35,e6:36,f6:37,g6:38,h6:39,a5:48,b5:49,c5:50,d5:51,e5:52,f5:53,g5:54,h5:55,a4:64,b4:65,c4:66,d4:67,e4:68,f4:69,g4:70,h4:71,a3:80,b3:81,c3:82,d3:83,e3:84,f3:85,g3:86,h3:87,a2:96,b2:97,c2:98,d2:99,e2:100,f2:101,g2:102,h2:103,a1:112,b1:113,c1:114,d1:115,e1:116,f1:117,g1:118,h1:119},fA={w:[{square:UA.a1,flag:q.QSIDE_CASTLE},{square:UA.h1,flag:q.KSIDE_CASTLE}],b:[{square:UA.a8,flag:q.QSIDE_CASTLE},{square:UA.h8,flag:q.KSIDE_CASTLE}]},m=new Array(128),RA={w:Y,b:Y},GA=G,cA={w:0,b:0},FA=Y,uA=0,xA=1,lA=[],LA={},MA={};BB(typeof y>"u"?u:y);function gB(c){typeof c>"u"&&(c=!1),m=new Array(128),RA={w:Y,b:Y},GA=G,cA={w:0,b:0},FA=Y,uA=0,xA=1,lA=[],c||(LA={}),MA={},QB(pA())}function O(){for(var c=[],s={},L=function(S){S in MA&&(s[S]=MA[S])};lA.length>0;)c.push(OA());for(L(pA());c.length>0;)_A(c.pop()),L(pA());MA=s}function jA(){BB(u)}function BB(c,s){typeof s>"u"&&(s=!1);var L=c.split(/\s+/),S=L[0],l=0;if(!NB(c).valid)return!1;gB(s);for(var d=0;d-1&&(cA.w|=q.KSIDE_CASTLE),L[2].indexOf("Q")>-1&&(cA.w|=q.QSIDE_CASTLE),L[2].indexOf("k")>-1&&(cA.b|=q.KSIDE_CASTLE),L[2].indexOf("q")>-1&&(cA.b|=q.QSIDE_CASTLE),FA=L[3]==="-"?Y:UA[L[3]],uA=parseInt(L[4],10),xA=parseInt(L[5],10),QB(pA()),!0}function NB(c){var s={0:"No errors.",1:"FEN string must contain six space-delimited fields.",2:"6th field (move number) must be a positive integer.",3:"5th field (half move counter) must be a non-negative integer.",4:"4th field (en-passant square) is invalid.",5:"3rd field (castling availability) is invalid.",6:"2nd field (side to move) is invalid.",7:"1st field (piece positions) does not contain 8 '/'-delimited rows.",8:"1st field (piece positions) is invalid [consecutive numbers].",9:"1st field (piece positions) is invalid [invalid piece].",10:"1st field (piece positions) is invalid [row too large].",11:"Illegal en-passant square"},L=c.split(/\s+/);if(L.length!==6)return{valid:!1,error_number:1,error:s[1]};if(isNaN(L[5])||parseInt(L[5],10)<=0)return{valid:!1,error_number:2,error:s[2]};if(isNaN(L[4])||parseInt(L[4],10)<0)return{valid:!1,error_number:3,error:s[3]};if(!/^(-|[abcdefgh][36])$/.test(L[3]))return{valid:!1,error_number:4,error:s[4]};if(!/^(KQ?k?q?|Qk?q?|kq?|q|-)$/.test(L[2]))return{valid:!1,error_number:5,error:s[5]};if(!/^(w|b)$/.test(L[1]))return{valid:!1,error_number:6,error:s[6]};var S=L[0].split("/");if(S.length!==8)return{valid:!1,error_number:7,error:s[7]};for(var l=0;l0&&(s+=c,c=0);var S=m[L].color,l=m[L].type;s+=S===G?l.toUpperCase():l.toLowerCase()}L+1&136&&(c>0&&(s+=c),L!==UA.h1&&(s+="/"),c=0,L+=8)}var d="";cA[G]&q.KSIDE_CASTLE&&(d+="K"),cA[G]&q.QSIDE_CASTLE&&(d+="Q"),cA[U]&q.KSIDE_CASTLE&&(d+="k"),cA[U]&q.QSIDE_CASTLE&&(d+="q"),d=d||"-";var AA=FA===Y?"-":N(FA);return[s,GA,d,AA,uA,xA].join(" ")}function yB(c){for(var s=0;s0||(c!==u?(LA.SetUp="1",LA.FEN=c):(delete LA.SetUp,delete LA.FEN))}function HB(c){var s=m[UA[c]];return s?{type:s.type,color:s.color}:null}function GB(c,s){if(!("type"in c&&"color"in c)||w.indexOf(c.type.toLowerCase())===-1||!(s in UA))return!1;var L=UA[s];return c.type==K&&!(RA[c.color]==Y||RA[c.color]==L)?!1:(m[L]={type:c.type,color:c.color},c.type===K&&(RA[c.color]=L),QB(pA()),!0)}function JB(c){var s=HB(c);return m[UA[c]]=null,s&&s.type===K&&(RA[s.color]=Y),QB(pA()),s}function j(c,s,L,S,l){var d={color:GA,from:s,to:L,flags:S,piece:c[s].type};return l&&(d.flags|=q.PROMOTION,d.promotion=l),c[L]?d.captured=c[L].type:S&q.EP_CAPTURE&&(d.captured=k),d}function QA(c){function s(FB,VA,bA,DB,SB){if(FB[bA].type===k&&(zA(DB)===vA||zA(DB)===sA))for(var qA=[t,X,C,J],AB=0,oB=qA.length;AB0){if(S.color===G)return!0}else if(S.color===U)return!0;continue}if(S.type==="n"||S.type==="k")return!0;for(var AA=Z[d],iA=L+AA,wA=!1;iA!==s;){if(m[iA]!=null){wA=!0;break}iA+=AA}if(!wA)return!0}}}return!1}function PA(c){return dA(V(c),RA[c])}function EB(){return PA(GA)}function CB(){return EB()&&QA().length===0}function tB(){return!EB()&&QA().length===0}function wB(){for(var c={},s=[],L=0,S=0,l=UA.a8;l<=UA.h1;l++){if(S=(S+1)%2,l&136){l+=7;continue}var d=m[l];d&&(c[d.type]=d.type in c?c[d.type]+1:1,d.type===C&&s.push(S),L++)}if(L===2)return!0;if(L===3&&(c[C]===1||c[J]===1))return!0;if(L===c[C]+2){for(var AA=0,iA=s.length,l=0;l=3&&(L=!0),!c.length)break;_A(c.pop())}return L}function rB(c){lA.push({move:c,kings:{b:RA.b,w:RA.w},turn:GA,castling:{b:cA.b,w:cA.w},ep_square:FA,half_moves:uA,move_number:xA})}function _A(c){var s=GA,L=V(s);if(rB(c),m[c.to]=m[c.from],m[c.from]=null,c.flags&q.EP_CAPTURE&&(GA===U?m[c.to-16]=null:m[c.to+16]=null),c.flags&q.PROMOTION&&(m[c.to]={type:c.promotion,color:s}),m[c.to].type===K){if(RA[m[c.to].color]=c.to,c.flags&q.KSIDE_CASTLE){var S=c.to-1,l=c.to+1;m[S]=m[l],m[l]=null}else if(c.flags&q.QSIDE_CASTLE){var S=c.to+1,l=c.to-2;m[S]=m[l],m[l]=null}cA[s]=""}if(cA[s]){for(var d=0,AA=fA[s].length;d0?AA>0&&iA>0?N(L):iA>0?N(L).charAt(1):N(L).charAt(0):""}function VB(c){var s=c.charAt(0);if(s>="a"&&s<="h"){var L=c.match(/[a-h]\d.*[a-h]\d/);return L?void 0:k}return s=s.toLowerCase(),s==="o"?K:s}function kB(){for(var c=` +------------------------+ `,s=UA.a8;s<=UA.h1;s++){if(F(s)===0&&(c+=" "+"87654321"[zA(s)]+" |"),m[s]==null)c+=" . ";else{var L=m[s].type,S=m[s].color,l=S===G?L.toUpperCase():L.toLowerCase();c+=" "+l+" "}s+1&136&&(c+=`| `,s+=8)}return c+=` +------------------------+ `,c+=` a b c d e f g h `,c}function rA(c,s){var L=NA(c),S=!1;if(s){var l=L.match(/([pnbrqkPNBRQK])?([a-h][1-8])x?-?([a-h][1-8])([qrbnQRBN])?/);if(l){var d=l[1],AA=l[2],iA=l[3],wA=l[4];AA.length==1&&(S=!0)}else{var l=L.match(/([pnbrqkPNBRQK])?([a-h]?[1-8]?)x?-?([a-h][1-8])([qrbnQRBN])?/);if(l){var d=l[1],AA=l[2],iA=l[3],wA=l[4];if(AA.length==1)var S=!0}}}for(var KA=VB(L),oA=QA({legal:!0,piece:d||KA}),CA=0,ZA=oA.length;CA>4}function F(c){return c&15}function N(c){var s=F(c),L=zA(c);return"abcdefgh".substring(s,s+1)+"87654321".substring(L,L+1)}function V(c){return c===G?U:G}function n(c){return"0123456789".indexOf(c)!==-1}function b(c){var s=P(c);s.san=JA(s,QA({legal:!0})),s.to=N(s.to),s.from=N(s.from);var L="";for(var S in q)q[S]&s.flags&&(L+=$[S]);return s.flags=L,s}function P(c){var s=c instanceof Array?[]:{};for(var L in c)typeof L=="object"?s[L]=P(c[L]):s[L]=c[L];return s}function z(c){return c.replace(/^\s+|\s+$/g,"")}function HA(c){for(var s=QA({legal:!1}),L=0,S=GA,l=0,d=s.length;l0){var AA=HA(c-1);L+=AA}else L++;OA()}return L}return{WHITE:G,BLACK:U,PAWN:k,KNIGHT:J,BISHOP:C,ROOK:X,QUEEN:t,KING:K,SQUARES:function(){for(var c=[],s=UA.a8;s<=UA.h1;s++){if(s&136){s+=7;continue}c.push(N(s))}return c}(),FLAGS:$,load:function(c){return BB(c)},reset:function(){return jA()},moves:function(c){for(var s=QA(c),L=[],S=0,l=s.length;S=100||tB()||wB()||YB()},insufficient_material:function(){return wB()},in_threefold_repetition:function(){return YB()},game_over:function(){return uA>=100||CB()||tB()||wB()||YB()},validate_fen:function(c){return NB(c)},fen:function(){return pA()},board:function(){for(var c=[],s=[],L=UA.a8;L<=UA.h1;L++)m[L]==null?s.push(null):s.push({type:m[L].type,color:m[L].color}),L+1&136&&(c.push(s),s=[],L+=8);return c},pgn:function(c){var s=typeof c=="object"&&typeof c.newline_char=="string"?c.newline_char:` `,L=typeof c=="object"&&typeof c.max_width=="number"?c.max_width:0,S=[],l=!1;for(var d in LA)S.push("["+d+' "'+LA[d]+'"]'+s),l=!0;l&&lA.length&&S.push(s);for(var AA=function(kA){var IB=MA[pA()];if(typeof IB<"u"){var XA=kA.length>0?" ":"";kA=`${kA}${XA}{${IB}}`}return kA},iA=[];lA.length>0;)iA.push(OA());var wA=[],KA="";for(iA.length===0&&wA.push(AA(""));iA.length>0;){KA=AA(KA);var oA=iA.pop();!lA.length&&oA.color==="b"?KA=xA+". ...":oA.color==="w"&&(KA.length&&wA.push(KA),KA=xA+"."),KA=KA+" "+JA(oA,QA({legal:!0})),_A(oA)}if(KA.length&&wA.push(AA(KA)),typeof LA.Result<"u"&&wA.push(LA.Result),L===0)return S.join("")+wA.join(" ");for(var CA=function(){return S.length>0&&S[S.length-1]===" "?(S.pop(),!0):!1},ZA=function(kA,IB){for(var XA of IB.split(" "))if(!!XA){if(kA+XA.length>L){for(;CA();)kA--;S.push(s),kA=0}S.push(XA),kA+=XA.length,S.push(" "),kA++}return CA()&&kA--,kA},aA=0,d=0;dL&&wA[d].includes("{")){aA=ZA(aA,wA[d]);continue}aA+wA[d].length>L&&d!==0?(S[S.length-1]===" "&&S.pop(),S.push(s),aA=0):d!==0&&(S.push(" "),aA++),S.push(wA[d]),aA+=wA[d].length}return S.join("")},load_pgn:function(c,s){var L=typeof s<"u"&&"sloppy"in s?s.sloppy:!1;function S(VA){return VA.replace(/\\/g,"\\")}function l(VA,bA){for(var DB=typeof bA=="object"&&typeof bA.newline_char=="string"?bA.newline_char:`\r? `,SB={},qA=VA.split(new RegExp(S(DB))),AB="",oB="",hB=0;hB0&&(SB[AB]=oB);return SB}var d=typeof s=="object"&&typeof s.newline_char=="string"?s.newline_char:`\r? `,AA=new RegExp("^(\\[((?:"+S(d)+")|.)*\\])(?:"+S(d)+"){2}"),iA=AA.test(c)?AA.exec(c)[1]:"";jA();var wA=l(iA,s);for(var KA in wA)yB([KA,wA[KA]]);if(wA.SetUp==="1"&&!("FEN"in wA&&BB(wA.FEN,!0)))return!1;for(var oA=function(VA){return Array.from(VA).map(function(bA){return bA.charCodeAt(0)<128?bA.charCodeAt(0).toString(16):encodeURIComponent(bA).replace(/\%/g,"").toLowerCase()}).join("")},CA=function(VA){return VA.length==0?"":decodeURIComponent("%"+VA.match(/.{1,2}/g).join("%"))},ZA=function(VA){return VA=VA.replace(new RegExp(S(d),"g")," "),`{${oA(VA.slice(1,VA.length-1))}}`},aA=function(VA){if(VA.startsWith("{")&&VA.endsWith("}"))return CA(VA.slice(1,VA.length-1))},kA=c.replace(iA,"").replace(new RegExp(`({[^}]*})+?|;([^${S(d)}]*)`,"g"),function(VA,bA,DB){return bA!==void 0?ZA(bA):" "+ZA(`{${DB.slice(1)}}`)}).replace(new RegExp(S(d),"g")," "),IB=/(\([^\(\)]+\))+?/g;IB.test(kA);)kA=kA.replace(IB,"");kA=kA.replace(/\d+\.(\.\.)?/g,""),kA=kA.replace(/\.\.\./g,""),kA=kA.replace(/\$\d+/g,"");var XA=z(kA).split(new RegExp(/\s+/));XA=XA.join(",").replace(/,,+/g,",").split(",");for(var BA="",g="",iB=0;iB-1)g=XA[iB];else return!1;else g="",_A(BA)}return g&&Object.keys(LA).length&&!LA.Result&&yB(["Result",g]),!0},header:function(){return yB(arguments)},ascii:function(){return kB()},turn:function(){return GA},move:function(c,s){var L=typeof s<"u"&&"sloppy"in s?s.sloppy:!1,S=null;if(typeof c=="string")S=rA(c,L);else if(typeof c=="object"){for(var l=QA(),d=0,AA=l.length;d0;)s.push(OA());for(;s.length>0;){var l=s.pop();S?L.push(b(l)):L.push(JA(l,QA({legal:!0}))),_A(l)}return L},get_comment:function(){return MA[pA()]},set_comment:function(c){MA[pA()]=c.replace("{","[").replace("}","]")},delete_comment:function(){var c=MA[pA()];return delete MA[pA()],c},get_comments:function(){return O(),Object.keys(MA).map(function(c){return{fen:c,comment:MA[c]}})},delete_comments:function(){return O(),Object.keys(MA).map(function(c){var s=MA[c];return delete MA[c],{fen:c,comment:s}})}}};i.Chess=o})(Pg);var Gg={exports:{}};(function(i,o){(function(y){i.exports=y()})(function(){return function y(U,G,Y){function k(X,t){if(!G[X]){if(!U[X]){var K=typeof YQ=="function"&&YQ;if(!t&&K)return K(X,!0);if(J)return J(X,!0);var w=new Error("Cannot find module '"+X+"'");throw w.code="MODULE_NOT_FOUND",w}var u=G[X]={exports:{}};U[X][0].call(u.exports,function(e){var x=U[X][1][e];return k(x||e)},u,u.exports,y,U,G,Y)}return G[X].exports}for(var J=typeof YQ=="function"&&YQ,C=0;C0&&this._events[t].length>w&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),typeof console.trace=="function"&&console.trace())),this},Y.prototype.on=Y.prototype.addListener,Y.prototype.once=function(t,K){if(!k(K))throw TypeError("listener must be a function");var w=!1;function u(){this.removeListener(t,u),w||(w=!0,K.apply(this,arguments))}return u.listener=K,this.on(t,u),this},Y.prototype.removeListener=function(t,K){var w,u,e,x;if(!k(K))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(w=this._events[t],e=w.length,u=-1,w===K||k(w.listener)&&w.listener===K)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,K);else if(C(w)){for(x=e;x-- >0;)if(w[x]===K||w[x].listener&&w[x].listener===K){u=x;break}if(u<0)return this;w.length===1?(w.length=0,delete this._events[t]):w.splice(u,1),this._events.removeListener&&this.emit("removeListener",t,K)}return this},Y.prototype.removeAllListeners=function(t){var K,w;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[t]&&delete this._events[t],this;if(arguments.length===0){for(K in this._events)K!=="removeListener"&&this.removeAllListeners(K);return this.removeAllListeners("removeListener"),this._events={},this}if(w=this._events[t],k(w))this.removeListener(t,w);else if(w)for(;w.length;)this.removeListener(t,w[w.length-1]);return delete this._events[t],this},Y.prototype.listeners=function(t){var K;return!this._events||!this._events[t]?K=[]:k(this._events[t])?K=[this._events[t]]:K=this._events[t].slice(),K},Y.prototype.listenerCount=function(t){if(this._events){var K=this._events[t];if(k(K))return 1;if(K)return K.length}return 0},Y.listenerCount=function(t,K){return t.listenerCount(K)};function k(t){return typeof t=="function"}function J(t){return typeof t=="number"}function C(t){return typeof t=="object"&&t!==null}function X(t){return t===void 0}},{}],2:[function(y,U,G){var Y,k,J,C,X;X=navigator.userAgent.toLowerCase(),C=navigator.platform.toLowerCase(),Y=X.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0],J=Y[1]==="ie"&&document.documentMode,k={name:Y[1]==="version"?Y[3]:Y[1],version:J||parseFloat(Y[1]==="opera"&&Y[4]?Y[4]:Y[2]),platform:{name:X.match(/ip(?:ad|od|hone)/)?"ios":(X.match(/(?:webos|android)/)||C.match(/mac|win|linux/)||["other"])[0]}},k[k.name]=!0,k[k.name+parseInt(k.version,10)]=!0,k.platform[k.platform.name]=!0,U.exports=k},{}],3:[function(y,U,G){var Y,k,J,C=function(w,u){for(var e in u)X.call(u,e)&&(w[e]=u[e]);function x(){this.constructor=w}return x.prototype=u.prototype,w.prototype=new x,w.__super__=u.prototype,w},X={}.hasOwnProperty,t=[].indexOf||function(w){for(var u=0,e=this.length;u$;0<=$?++_:--_)q.push(null);return q}.call(this),p=this.spawnWorkers(),this.options.globalPalette===!0)this.renderNextFrame();else for(r=0,Z=p;0<=Z?rZ;0<=Z?++r:--r)this.renderNextFrame();return this.emit("start"),this.emit("progress",0)},x.prototype.abort=function(){for(var r;r=this.activeWorkers.shift(),r!=null;)this.log("killing active worker"),r.terminate();return this.running=!1,this.emit("abort")},x.prototype.spawnWorkers=function(){var r,p,Z;return r=Math.min(this.options.workers,this.frames.length),function(){Z=[];for(var _=p=this.freeWorkers.length;p<=r?_r;p<=r?_++:_--)Z.push(_);return Z}.apply(this).forEach(function(_){return function($){var q;return _.log("spawning worker "+$),q=new Worker(_.options.workerScript),q.onmessage=function(sA){return _.activeWorkers.splice(_.activeWorkers.indexOf(q),1),_.freeWorkers.push(q),_.frameFinished(sA.data)},_.freeWorkers.push(q)}}(this)),r},x.prototype.frameFinished=function(r){var p,Z;if(this.log("frame "+r.index+" finished - "+this.activeWorkers.length+" active"),this.finishedFrames++,this.emit("progress",this.finishedFrames/this.frames.length),this.imageParts[r.index]=r,this.options.globalPalette===!0&&(this.options.globalPalette=r.globalPalette,this.log("global palette analyzed"),this.frames.length>2))for(p=1,Z=this.freeWorkers.length;1<=Z?pZ;1<=Z?++p:--p)this.renderNextFrame();return t.call(this.imageParts,null)>=0?this.renderNextFrame():this.finishRendering()},x.prototype.finishRendering=function(){var r,p,Z,_,$,q,sA,YA,nA,vA,UA,fA,m,RA,GA,cA;for(YA=0,RA=this.imageParts,$=0,nA=RA.length;$=this.frames.length))return r=this.frames[this.nextFrame++],Z=this.freeWorkers.shift(),p=this.getTask(r),this.log("starting frame "+(p.index+1)+" of "+this.frames.length),this.activeWorkers.push(Z),Z.postMessage(p)},x.prototype.getContextData=function(r){return r.getImageData(0,0,this.options.width,this.options.height).data},x.prototype.getImageData=function(r){var p;return this._canvas==null&&(this._canvas=document.createElement("canvas"),this._canvas.width=this.options.width,this._canvas.height=this.options.height),p=this._canvas.getContext("2d"),p.setFill=this.options.background,p.fillRect(0,0,this.options.width,this.options.height),p.drawImage(r,0,0),this.getContextData(p)},x.prototype.getTask=function(r){var p,Z;if(p=this.frames.indexOf(r),Z={index:p,last:p===this.frames.length-1,delay:r.delay,transparent:r.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:J.name==="chrome"},r.data!=null)Z.data=r.data;else if(r.context!=null)Z.data=this.getContextData(r.context);else if(r.image!=null)Z.data=this.getImageData(r.image);else throw new Error("Invalid frame");return Z},x.prototype.log=function(){var r;if(r=1<=arguments.length?K.call(arguments,0):[],!!this.options.debug)return console.log.apply(console,r)},x}(Y),U.exports=k},{"./browser.coffee":2,events:1}]},{},[3])(3)})})(Gg);var HE=Gg.exports,wg={exports:{}};(function(i){(function(){function o(w,u){let e={};return[w,u].forEach(function(x){for(let r in x)Object.prototype.hasOwnProperty.call(x,r)&&(e[r]=x[r])}),e}function y(w){if(typeof w!="string"||!w.match(/^data:image\/webp;base64,/i))throw new Error("Failed to decode WebP Base64 URL");return window.atob(w.substring(23))}function U(w,u){let e=typeof w=="string"&&/^data:image\/webp/.test(w)?w:w.toDataURL("image/webp",u);return y(e)}function G(w){let u=w.charCodeAt(0),e=w.charCodeAt(1),x=w.charCodeAt(2),r=w.charCodeAt(3);return(u|e<<8|x<<16|r<<24)>>>0}function Y(w){let u=w.indexOf("VP8",12);if(u===-1)throw new Error("Bad image format, does this browser support WebP?");let e=!1;for(;u0&&j.trackNumber<127))throw new Error("TrackNumber must be > 0 and < 127");return NA.writeEBMLVarInt(j.trackNumber),NA.writeU16BE(j.timecode),NA.writeByte(0),QA={id:161,data:[NA.getAsDataArray(),j.frame]},JA={id:30113,data:[{id:166,data:[{id:238,data:1},{id:165,data:j.alpha}]}]},{id:160,data:[QA,JA]}}function gB(j){let QA=new w(4);if(!(j.trackNumber>0&&j.trackNumber<127))throw new Error("TrackNumber must be > 0 and < 127");return QA.writeEBMLVarInt(j.trackNumber),QA.writeU16BE(j.timecode),QA.writeByte(1<<7),{id:163,data:[QA.getAsDataArray(),j.frame]}}function O(j){return j.alpha?MA(j):gB(j)}function jA(j){return{id:524531317,data:[{id:231,data:Math.round(j.timecode)}]}}function BB(j,QA,JA){cA.push({id:187,data:[{id:179,data:QA},{id:183,data:[{id:247,data:j},{id:241,data:uA(JA)}]}]})}function NB(){let j={id:475249515,data:cA},QA=new w(16+cA.length*32);t(QA,FA.pos,j),FA.write(QA.getAsDataArray()),fA.Cues.positionEBML.data=uA(j.offset)}function pA(){if(YA.length===0)return;let j=0;for(let NA=0;NA=x&&pA()}function HB(){let j=new w(GA.size),QA=FA.pos;t(j,GA.dataOffset,GA.data),FA.seek(GA.dataOffset),FA.write(j.getAsDataArray()),FA.seek(QA)}function GB(){let j=new w(8),QA=FA.pos;j.writeDoubleBE(nA),FA.seek(RA.dataOffset),FA.write(j.getAsDataArray()),FA.seek(QA)}function JB(){let j=new w(10),QA=FA.pos;j.writeUnsignedIntBE(m.id),j.writeEBMLVarIntWidth(FA.pos-m.dataOffset,5),FA.seek(m.offset),FA.write(j.getAsDataArray()),FA.seek(QA)}this.addFrame=function(j,QA,JA){p||(Z=j.width||0,_=j.height||0,LA());let NA=Y(U(j,e.quality)),dA,PA=null;JA?dA=JA:typeof QA=="number"?dA=QA:dA=e.frameDuration,e.transparent&&(QA instanceof HTMLCanvasElement||typeof QA=="string"?PA=QA:NA.hasAlpha&&(PA=xA(j))),QB({frame:NA.frame,duration:dA,alpha:PA?Y(U(PA,e.alphaQuality)).frame:null})},this.complete=function(){return p||LA(),pA(),NB(),HB(),GB(),JB(),FA.complete("video/webm")},this.getWrittenSize=function(){return FA.length},e=o(UA,e||{}),yB()}};i.exports=K})()})(wg);var Yg={exports:{}};(function(i){(function(){let o=function(y){this.data=new Uint8Array(y),this.pos=0};o.prototype.seek=function(y){this.pos=y},o.prototype.writeBytes=function(y){for(let U=0;U>8,this.data[this.pos++]=y},o.prototype.writeDoubleBE=function(y){let U=new Uint8Array(new Float64Array([y]).buffer);for(let G=U.length-1;G>=0;G--)this.writeByte(U[G])},o.prototype.writeFloatBE=function(y){let U=new Uint8Array(new Float32Array([y]).buffer);for(let G=U.length-1;G>=0;G--)this.writeByte(U[G])},o.prototype.writeString=function(y){for(let U=0;U>8),this.writeU8(y);break;case 3:this.writeU8(1<<5|y>>16),this.writeU8(y>>8),this.writeU8(y);break;case 4:this.writeU8(1<<4|y>>24),this.writeU8(y>>16),this.writeU8(y>>8),this.writeU8(y);break;case 5:this.writeU8(1<<3|y/4294967296&7),this.writeU8(y>>24),this.writeU8(y>>16),this.writeU8(y>>8),this.writeU8(y);break;default:throw new Error("Bad EBML VINT size "+U)}},o.prototype.measureEBMLVarInt=function(y){if(y<(1<<7)-1)return 1;if(y<(1<<14)-1)return 2;if(y<(1<<21)-1)return 3;if(y<(1<<28)-1)return 4;if(y<34359738367)return 5;throw new Error("EBML VINT size not supported "+y)},o.prototype.writeEBMLVarInt=function(y){this.writeEBMLVarIntWidth(y,this.measureEBMLVarInt(y))},o.prototype.writeUnsignedIntBE=function(y,U){switch(U===void 0&&(U=this.measureUnsignedInt(y)),U){case 5:this.writeU8(Math.floor(y/4294967296));case 4:this.writeU8(y>>24);case 3:this.writeU8(y>>16);case 2:this.writeU8(y>>8);case 1:this.writeU8(y);break;default:throw new Error("Bad UINT size "+U)}},o.prototype.measureUnsignedInt=function(y){return y<1<<8?1:y<1<<16?2:y<1<<24?3:y<4294967296?4:5},o.prototype.getAsDataArray=function(){if(this.posthis.length)throw new Error("Seeking beyond the end of file is not allowed");this.pos=K},this.write=function(K){let w={offset:this.pos,data:K,length:t(K)},u=w.offset>=this.length;this.pos+=w.length,this.length=Math.max(this.length,this.pos),Y=Y.then(function(){if(J)return new Promise(function(e,x){X(w.data).then(function(r){let p=0,Z=Buffer.from(r.buffer),_=function($,q,sA){p+=q,p>=sA.length?e():y.write(J,sA,p,sA.length-p,w.offset+p,_)};y.write(J,Z,0,Z.length,w.offset,_)})});if(k)return new Promise(function(e,x){k.onwriteend=e,k.seek(w.offset),k.write(new Blob([w.data]))});if(!u)for(let e=0;e=x.offset+x.length)){if(w.offsetx.offset+x.length)throw new Error("Overwrite crosses blob boundaries");if(w.offset==x.offset&&w.length==x.length){x.data=w.data;return}else return X(x.data).then(function(r){return x.data=r,X(w.data)}).then(function(r){w.data=r,x.data.set(w.data,w.offset-x.offset)})}}G.push(w)})},this.complete=function(K){return J||k?Y=Y.then(function(){return null}):Y=Y.then(function(){let w=[];for(let u=0;u"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(K||w)&&(w?$=self.location.href:document.currentScript&&($=document.currentScript.src),Y&&($=Y),$=$.indexOf("blob:")!==0?$.substr(0,$.lastIndexOf("/")+1):"",r=function(A){try{var B=new XMLHttpRequest;return B.open("GET",A,!1),B.send(null),B.responseText}catch(Q){if(A=xB(A))return NI(A);throw Q}},w&&(p=function(A){try{var B=new XMLHttpRequest;return B.open("GET",A,!1),B.responseType="arraybuffer",B.send(null),new Uint8Array(B.response)}catch(Q){if(A=xB(A))return A;throw Q}}));var q=C.print||console.log.bind(console),sA=C.printErr||console.warn.bind(console);for(X in t)t.hasOwnProperty(X)&&(C[X]=t[X]);t=null,C.thisProgram&&(x=C.thisProgram);var YA,nA=0;C.wasmBinary&&(YA=C.wasmBinary),C.noExitRuntime&&C.noExitRuntime,typeof WebAssembly!="object"&&sA("no native wasm support detected");var vA,UA=new WebAssembly.Table({initial:1182,maximum:1182,element:"anyfunc"}),fA=!1;function m(A,B){A||rA("Assertion failed: "+B)}var RA=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function GA(A,B,Q){var I=B+Q;for(Q=B;A[Q]&&!(Q>=I);)++Q;if(16(E=(240&E)==224?(15&E)<<12|D<<6|H:(7&E)<<18|D<<12|H<<6|63&A[B++])?I+=String.fromCharCode(E):(E-=65536,I+=String.fromCharCode(55296|E>>10,56320|1023&E))}}else I+=String.fromCharCode(E)}return I}function cA(A){return A?GA(LA,A,void 0):""}function FA(A,B,Q,I){if(!(0=H&&(H=65536+((1023&H)<<10)|1023&A.charCodeAt(++D)),127>=H){if(Q>=I)break;B[Q++]=H}else{if(2047>=H){if(Q+1>=I)break;B[Q++]=192|H>>6}else{if(65535>=H){if(Q+2>=I)break;B[Q++]=224|H>>12}else{if(Q+3>=I)break;B[Q++]=240|H>>18,B[Q++]=128|H>>12&63}B[Q++]=128|H>>6&63}B[Q++]=128|63&H}}return B[Q]=0,Q-E}function uA(A){for(var B=0,Q=0;Q=I&&(I=65536+((1023&I)<<10)|1023&A.charCodeAt(++Q)),127>=I?++B:B=2047>=I?B+2:65535>=I?B+3:B+4}return B}var xA,lA,LA,MA,gB,O,jA,BB,NB,pA=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function yB(A){var B;for(B=A>>1;MA[B];)++B;if(32<(B<<=1)-A&&pA)return pA.decode(LA.subarray(A,B));B=0;for(var Q="";;){var I=MA[A+2*B>>1];if(I==0)return Q;++B,Q+=String.fromCharCode(I)}}function QB(A,B,Q){if(Q===void 0&&(Q=2147483647),2>Q)return 0;var I=B;Q=(Q-=2)<2*A.length?Q/2:A.length;for(var E=0;E>1]=A.charCodeAt(E),B+=2;return MA[B>>1]=0,B-I}function HB(A){return 2*A.length}function GB(A){for(var B=0,Q="";;){var I=O[A+4*B>>2];if(I==0)return Q;++B,65536<=I?(I-=65536,Q+=String.fromCharCode(55296|I>>10,56320|1023&I)):Q+=String.fromCharCode(I)}}function JB(A,B,Q){if(Q===void 0&&(Q=2147483647),4>Q)return 0;var I=B;Q=I+Q-4;for(var E=0;E=D&&(D=65536+((1023&D)<<10)|1023&A.charCodeAt(++E)),O[B>>2]=D,(B+=4)+4>Q)break}return O[B>>2]=0,B-I}function j(A){for(var B=0,Q=0;Q=I&&++Q,B+=4}return B}function QA(A){xA=A,C.HEAP8=lA=new Int8Array(A),C.HEAP16=MA=new Int16Array(A),C.HEAP32=O=new Int32Array(A),C.HEAPU8=LA=new Uint8Array(A),C.HEAPU16=gB=new Uint16Array(A),C.HEAPU32=jA=new Uint32Array(A),C.HEAPF32=BB=new Float32Array(A),C.HEAPF64=NB=new Float64Array(A)}var JA=C.INITIAL_MEMORY||16777216;function NA(A){for(;0>2]=A}function l(A,B){for(var Q=0,I=A.length-1;0<=I;I--){var E=A[I];E==="."?A.splice(I,1):E===".."?(A.splice(I,1),Q++):Q&&(A.splice(I,1),Q--)}if(B)for(;Q;Q--)A.unshift("..");return A}function d(A){var B=A.charAt(0)==="/",Q=A.substr(-1)==="/";return(A=l(A.split("/").filter(function(I){return!!I}),!B).join("/"))||B||(A="."),A&&Q&&(A+="/"),(B?"/":"")+A}function AA(A){var B=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(A).slice(1);return A=B[0],B=B[1],A||B?(B&&(B=B.substr(0,B.length-1)),A+B):"."}function iA(A){if(A==="/")return"/";var B=A.lastIndexOf("/");return B===-1?A:A.substr(B+1)}function wA(){var A=Array.prototype.slice.call(arguments,0);return d(A.join("/"))}function KA(A,B){return d(A+"/"+B)}function oA(){for(var A="",B=!1,Q=arguments.length-1;-1<=Q&&!B;Q--){if(typeof(B=0<=Q?arguments[Q]:g.cwd())!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!B)return"";A=B+"/"+A,B=B.charAt(0)==="/"}return(B?"/":"")+(A=l(A.split("/").filter(function(I){return!!I}),!B).join("/"))||"."}function CA(A,B){function Q(H){for(var h=0;hM?[]:H.slice(h,M-h+1)}A=oA(A).substr(1),B=oA(B).substr(1),A=Q(A.split("/")),B=Q(B.split("/"));for(var I=Math.min(A.length,B.length),E=I,D=0;D=B||(B=Math.max(B,Q*(1048576>Q?2:1.125)>>>0),Q!=0&&(B=Math.max(B,256)),Q=A.f,A.f=new Uint8Array(B),0B)A.f.length=B;else for(;A.f.length=A.node.l)return 0;if(8<(A=Math.min(A.node.l-E,I))&&D.subarray)B.set(D.subarray(E,E+A),Q);else for(I=0;IB)throw new g.b(28);return B},ia:function(A,B,Q){BA.lb(A.node,B+Q),A.node.l=Math.max(A.node.l,B+Q)},na:function(A,B,Q,I,E,D,H){if(!g.isFile(A.node.mode))throw new g.b(43);if(A=A.node.f,2&H||A.buffer!==B.buffer){if((0>>0)%g.L.length},sb:function(A){var B=g.Pa(A.parent.id,A.name);A.Y=g.L[B],g.L[B]=A},tb:function(A){var B=g.Pa(A.parent.id,A.name);if(g.L[B]===A)g.L[B]=A.Y;else for(B=g.L[B];B;){if(B.Y===A){B.Y=A.Y;break}B=B.Y}},P:function(A,B){var Q=g.bc(A);if(Q)throw new g.b(Q,A);for(Q=g.L[g.Pa(A.id,B)];Q;Q=Q.Y){var I=Q.name;if(Q.parent.id===A.id&&I===B)return Q}return g.lookup(A,B)},createNode:function(A,B,Q,I){return A=new g.Ab(A,B,Q,I),g.sb(A),A},La:function(A){g.tb(A)},Aa:function(A){return A===A.parent},W:function(A){return!!A.oa},isFile:function(A){return(61440&A)==32768},v:function(A){return(61440&A)==16384},ma:function(A){return(61440&A)==40960},ya:function(A){return(61440&A)==8192},$b:function(A){return(61440&A)==24576},isFIFO:function(A){return(61440&A)==4096},isSocket:function(A){return(49152&A)==49152},Vb:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},dc:function(A){var B=g.Vb[A];if(B===void 0)throw Error("Unknown file open mode: "+A);return B},mb:function(A){var B=["r","w","rw"][3&A];return 512&A&&(B+="w"),B},Z:function(A,B){return g.ub||(B.indexOf("r")===-1||292&A.mode)&&(B.indexOf("w")===-1||146&A.mode)&&(B.indexOf("x")===-1||73&A.mode)?0:2},bc:function(A){var B=g.Z(A,"x");return B||(A.g.lookup?0:2)},Wa:function(A,B){try{return g.P(A,B),20}catch{}return g.Z(A,"wx")},Ca:function(A,B,Q){try{var I=g.P(A,B)}catch(E){return E.B}if(A=g.Z(A,"wx"))return A;if(Q){if(!g.v(I.mode))return 54;if(g.Aa(I)||g.I(I)===g.cwd())return 10}else if(g.v(I.mode))return 31;return 0},cc:function(A,B){return A?g.ma(A.mode)?32:g.v(A.mode)&&(g.mb(B)!=="r"||512&B)?31:g.Z(A,g.mb(B)):44},Bb:4096,fc:function(A,B){for(B=B||g.Bb,A=A||0;A<=B;A++)if(!g.streams[A])return A;throw new g.b(33)},ba:function(A){return g.streams[A]},Sb:function(A,B,Q){g.Ja||(g.Ja=function(){},g.Ja.prototype={object:{get:function(){return this.node},set:function(D){this.node=D}}});var I,E=new g.Ja;for(I in A)E[I]=A[I];return A=E,B=g.fc(B,Q),A.fd=B,g.streams[B]=A},Lb:function(A){g.streams[A]=null},Kb:{open:function(A){A.h=g.Xb(A.node.rdev).h,A.h.open&&A.h.open(A)},K:function(){throw new g.b(70)}},Va:function(A){return A>>8},Oc:function(A){return 255&A},X:function(A,B){return A<<8|B},$a:function(A,B){g.jb[A]={h:B}},Xb:function(A){return g.jb[A]},pb:function(A){var B=[];for(A=[A];A.length;){var Q=A.pop();B.push(Q),A.push.apply(A,Q.pa)}return B},yb:function(A,B){function Q(H){return g.Fa--,B(H)}function I(H){if(H){if(!I.S)return I.S=!0,Q(H)}else++D>=E.length&&Q(null)}typeof A=="function"&&(B=A,A=!1),g.Fa++,1B)throw new g.b(28);var Q;if(!(Q=typeof A=="string"?g.m(A,{H:!0}).node:A).g.A)throw new g.b(63);if(g.v(Q.mode))throw new g.b(31);if(!g.isFile(Q.mode))throw new g.b(28);if(A=g.Z(Q,"w"))throw new g.b(A);Q.g.A(Q,{size:B,timestamp:Date.now()})},Fc:function(A,B){if(!(A=g.ba(A)))throw new g.b(8);if((2097155&A.flags)==0)throw new g.b(28);g.truncate(A.node,B)},Xc:function(A,B,Q){(A=g.m(A,{H:!0}).node).g.A(A,{timestamp:Math.max(B,Q)})},open:function(A,B,Q,I,E){if(A==="")throw new g.b(44);if(Q=64&(B=typeof B=="string"?g.dc(B):B)?4095&(Q===void 0?438:Q)|32768:0,typeof A=="object")var D=A;else{A=d(A);try{D=g.m(A,{H:!(131072&B)}).node}catch{}}var H=!1;if(64&B)if(D){if(128&B)throw new g.b(20)}else D=g.R(A,Q,0),H=!0;if(!D)throw new g.b(44);if(g.ya(D.mode)&&(B&=-513),65536&B&&!g.v(D.mode))throw new g.b(54);if(!H&&(Q=g.cc(D,B)))throw new g.b(Q);512&B&&g.truncate(D,0),B&=-131713,(I=g.Sb({node:D,path:g.I(D),flags:B,seekable:!0,position:0,h:D.h,wc:[],error:!1},I,E)).h.open&&I.h.open(I),!C.logReadFiles||1&B||(g.Ya||(g.Ya={}),A in g.Ya||(g.Ya[A]=1,sA("FS.trackingDelegate error on read file: "+A)));try{g.u.onOpenFile&&(E=0,(2097155&B)!=1&&(E|=g.zb.wb.Cb),(2097155&B)!=0&&(E|=g.zb.wb.Db),g.u.onOpenFile(A,E))}catch(h){sA("FS.trackingDelegate['onOpenFile']('"+A+"', flags) threw an exception: "+h.message)}return I},close:function(A){if(g.la(A))throw new g.b(8);A.Oa&&(A.Oa=null);try{A.h.close&&A.h.close(A)}catch(B){throw B}finally{g.Lb(A.fd)}A.fd=null},la:function(A){return A.fd===null},K:function(A,B,Q){if(g.la(A))throw new g.b(8);if(!A.seekable||!A.h.K)throw new g.b(70);if(Q!=0&&Q!=1&&Q!=2)throw new g.b(28);return A.position=A.h.K(A,B,Q),A.wc=[],A.position},read:function(A,B,Q,I,E){if(0>I||0>E)throw new g.b(28);if(g.la(A))throw new g.b(8);if((2097155&A.flags)==1)throw new g.b(8);if(g.v(A.node.mode))throw new g.b(31);if(!A.h.read)throw new g.b(28);var D=E!==void 0;if(D){if(!A.seekable)throw new g.b(70)}else E=A.position;return B=A.h.read(A,B,Q,I,E),D||(A.position+=B),B},write:function(A,B,Q,I,E,D){if(0>I||0>E)throw new g.b(28);if(g.la(A))throw new g.b(8);if((2097155&A.flags)==0)throw new g.b(8);if(g.v(A.node.mode))throw new g.b(31);if(!A.h.write)throw new g.b(28);A.seekable&&1024&A.flags&&g.K(A,0,2);var H=E!==void 0;if(H){if(!A.seekable)throw new g.b(70)}else E=A.position;B=A.h.write(A,B,Q,I,E,D),H||(A.position+=B);try{A.path&&g.u.onWriteToFile&&g.u.onWriteToFile(A.path)}catch(h){sA("FS.trackingDelegate['onWriteToFile']('"+A.path+"') threw an exception: "+h.message)}return B},ia:function(A,B,Q){if(g.la(A))throw new g.b(8);if(0>B||0>=Q)throw new g.b(28);if((2097155&A.flags)==0)throw new g.b(8);if(!g.isFile(A.node.mode)&&!g.v(A.node.mode))throw new g.b(43);if(!A.h.ia)throw new g.b(138);A.h.ia(A,B,Q)},na:function(A,B,Q,I,E,D,H){if((2&D)!=0&&(2&H)==0&&(2097155&A.flags)!=2)throw new g.b(2);if((2097155&A.flags)==1)throw new g.b(2);if(!A.h.na)throw new g.b(43);return A.h.na(A,B,Q,I,E,D,H)},da:function(A,B,Q,I,E){return A&&A.h.da?A.h.da(A,B,Q,I,E):0},Qc:function(){return 0},Ra:function(A,B,Q){if(!A.h.Ra)throw new g.b(59);return A.h.Ra(A,B,Q)},readFile:function(A,B){if((B=B||{}).flags=B.flags||"r",B.encoding=B.encoding||"binary",B.encoding!=="utf8"&&B.encoding!=="binary")throw Error('Invalid encoding type "'+B.encoding+'"');var Q,I=g.open(A,B.flags);A=g.stat(A).size;var E=new Uint8Array(A);return g.read(I,E,0,A,0),B.encoding==="utf8"?Q=GA(E,0):B.encoding==="binary"&&(Q=E),g.close(I),Q},writeFile:function(A,B,Q){if((Q=Q||{}).flags=Q.flags||"w",A=g.open(A,Q.flags,Q.mode),typeof B=="string"){var I=new Uint8Array(uA(B)+1);B=FA(B,I,0,I.length),g.write(A,I,0,B,void 0,Q.Jb)}else{if(!ArrayBuffer.isView(B))throw Error("Unsupported data type");g.write(A,B,0,B.byteLength,void 0,Q.Jb)}g.close(A)},cwd:function(){return g.ib},chdir:function(A){if((A=g.m(A,{H:!0})).node===null)throw new g.b(44);if(!g.v(A.node.mode))throw new g.b(54);var B=g.Z(A.node,"x");if(B)throw new g.b(B);g.ib=A.path},Ob:function(){g.mkdir("/tmp"),g.mkdir("/home"),g.mkdir("/home/web_user")},Nb:function(){if(g.mkdir("/dev"),g.$a(g.X(1,3),{read:function(){return 0},write:function(I,E,D,H){return H}}),g.Da("/dev/null",g.X(1,3)),aA(g.X(5,0),IB),aA(g.X(6,0),XA),g.Da("/dev/tty",g.X(5,0)),g.Da("/dev/tty1",g.X(6,0)),typeof crypto=="object"&&typeof crypto.getRandomValues=="function")var A=new Uint8Array(1),B=function(){return crypto.getRandomValues(A),A[0]};else if(u)try{var Q=y(4);B=function(){return Q.randomBytes(1)[0]}}catch{}B||(B=function(){rA("random_device")}),g.T("/dev","random",B),g.T("/dev","urandom",B),g.mkdir("/dev/shm"),g.mkdir("/dev/shm/tmp")},Qb:function(){g.mkdir("/proc"),g.mkdir("/proc/self"),g.mkdir("/proc/self/fd"),g.s({s:function(){var A=g.createNode("/proc/self","fd",16895,73);return A.g={lookup:function(B,Q){var I=g.ba(+Q);if(!I)throw new g.b(8);return(B={parent:null,s:{vb:"fake"},g:{readlink:function(){return I.path}}}).parent=B}},A}},{},"/proc/self/fd")},Rb:function(){C.stdin?g.T("/dev","stdin",C.stdin):g.symlink("/dev/tty","/dev/stdin"),C.stdout?g.T("/dev","stdout",null,C.stdout):g.symlink("/dev/tty","/dev/stdout"),C.stderr?g.T("/dev","stderr",null,C.stderr):g.symlink("/dev/tty1","/dev/stderr"),g.open("/dev/stdin","r"),g.open("/dev/stdout","w"),g.open("/dev/stderr","w")},kb:function(){g.b||(g.b=function(A,B){this.node=B,this.pc=function(Q){this.B=Q},this.pc(A),this.message="FS error"},g.b.prototype=Error(),g.b.prototype.constructor=g.b,[44].forEach(function(A){g.Na[A]=new g.b(A),g.Na[A].stack=""}))},rc:function(){g.kb(),g.L=Array(4096),g.s(BA,{},"/"),g.Ob(),g.Nb(),g.Qb(),g.Ub={MEMFS:BA}},ka:function(A,B,Q){g.ka.Qa=!0,g.kb(),C.stdin=A||C.stdin,C.stdout=B||C.stdout,C.stderr=Q||C.stderr,g.Rb()},quit:function(){g.ka.Qa=!1;var A=C._fflush;for(A&&A(0),A=0;Athis.length-1||0>R)){var f=R%this.chunkSize;return this.rb(R/this.chunkSize|0)[f]}},D.prototype.Ib=function(R){this.rb=R},D.prototype.eb=function(){var R=new XMLHttpRequest;if(R.open("HEAD",Q,!1),R.send(null),!(200<=R.status&&300>R.status||R.status===304))throw Error("Couldn't load "+Q+". Status: "+R.status);var f,W=Number(R.getResponseHeader("Content-length")),T=(f=R.getResponseHeader("Accept-Ranges"))&&f==="bytes";R=(f=R.getResponseHeader("Content-Encoding"))&&f==="gzip";var gA=1048576;T||(gA=W);var v=this;v.Ib(function(DA){var EA=DA*gA,a=(DA+1)*gA-1;if(a=Math.min(a,W-1),v.S[DA]===void 0){var IA=v.S;if(EA>a)throw Error("invalid range ("+EA+", "+a+") or no bytes requested!");if(a>W-1)throw Error("only "+W+" bytes available! programmer error!");var yA=new XMLHttpRequest;if(yA.open("GET",Q,!1),W!==gA&&yA.setRequestHeader("Range","bytes="+EA+"-"+a),typeof Uint8Array<"u"&&(yA.responseType="arraybuffer"),yA.overrideMimeType&&yA.overrideMimeType("text/plain; charset=x-user-defined"),yA.send(null),!(200<=yA.status&&300>yA.status||yA.status===304))throw Error("Couldn't load "+Q+". Status: "+yA.status);EA=yA.response!==void 0?new Uint8Array(yA.response||[]):wQ(yA.responseText||"",!0),IA[DA]=EA}if(v.S[DA]===void 0)throw Error("doXHR failed!");return v.S[DA]}),!R&&W||(gA=W=1,gA=W=this.rb(0).length,q("LazyFiles on gzip forces download of the whole file when length is accessed")),this.Fb=W,this.Eb=gA,this.Ua=!0},typeof XMLHttpRequest<"u"){if(!w)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var H=new D;Object.defineProperties(H,{length:{get:function(){return this.Ua||this.eb(),this.Fb}},chunkSize:{get:function(){return this.Ua||this.eb(),this.Eb}}}),H={Sa:!1,f:H}}else H={Sa:!1,url:Q};var h=g.Pb(A,B,H,I,E);H.f?h.f=H.f:H.url&&(h.f=null,h.url=H.url),Object.defineProperties(h,{l:{get:function(){return this.f.length}}});var M={};return Object.keys(h.h).forEach(function(R){var f=h.h[R];M[R]=function(){if(!g.nb(h))throw new g.b(29);return f.apply(null,arguments)}}),M.read=function(R,f,W,T,gA){if(!g.nb(h))throw new g.b(29);if(gA>=(R=R.node.f).length)return 0;if(T=Math.min(R.length-gA,T),R.slice)for(var v=0;v>2]}function bA(A){if(!(A=g.ba(A)))throw new g.b(8);return A}function DB(A){switch(A){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+A)}}var SB=void 0;function qA(A){for(var B="";LA[A];)B+=SB[LA[A++]];return B}var AB={},oB={},hB={};function VQ(A){if(A===void 0)return"_unknown";var B=(A=A.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=B&&57>=B?"_"+A:A}function KQ(A,B){return A=VQ(A),new Function("body","return function "+A+`() { "use strict"; return body.apply(this, arguments); }; `)(B)}function lQ(A){var B=Error,Q=KQ(A,function(I){this.name=A,this.message=I,(I=Error(I).stack)!==void 0&&(this.stack=this.toString()+` `+I.replace(/^Error(:[^\n]*)?\n/,""))});return Q.prototype=Object.create(B.prototype),Q.prototype.constructor=Q,Q.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},Q}var uB=void 0;function hA(A){throw new uB(A)}var QI=void 0;function DQ(A){throw new QI(A)}function KB(A,B,Q){function I(h){(h=Q(h)).length!==A.length&&DQ("Mismatched type converter count");for(var M=0;M"u"?(yQ=function(B){return B},A):(fQ=new FinalizationGroup(function(B){for(var Q=B.next();!Q.done;Q=B.next())(Q=Q.value).j?gI(Q):console.warn("object already deleted: "+Q.j)}),II=function(B){fQ.unregister(B.c)},(yQ=function(B){return fQ.register(B,B.c,B.c),B})(A))}var WB=void 0,vB=[];function uQ(){for(;vB.length;){var A=vB.pop();A.c.aa=!1,A.delete()}}function eB(){}var EI={};function CI(A,B,Q){if(A[B].N===void 0){var I=A[B];A[B]=function(){return A[B].N.hasOwnProperty(arguments.length)||hA("Function '"+Q+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+A[B].N+")!"),A[B].N[arguments.length].apply(this,arguments)},A[B].N=[],A[B].N[I.va]=I}}function Rg(A,B,Q,I,E,D,H,h){this.name=A,this.constructor=B,this.U=Q,this.$=I,this.G=E,this.Wb=D,this.ta=H,this.Tb=h,this.lc=[]}function FQ(A,B,Q){for(;B!==Q;)B.ta||hA("Expected null or instance of "+Q.name+", got an instance of "+B.name),A=B.ta(A),B=B.G;return A}function ag(A,B){return B===null?(this.Ta&&hA("null is not a valid "+this.name),0):(B.c||hA('Cannot pass "'+pB(B)+'" as a '+this.name),B.c.j||hA("Cannot pass deleted object as a pointer of type "+this.name),FQ(B.c.j,B.c.o.i,this.i))}function tg(A,B){if(B===null){if(this.Ta&&hA("null is not a valid "+this.name),this.Ba){var Q=this.mc();return A!==null&&A.push(this.$,Q),Q}return 0}if(B.c||hA('Cannot pass "'+pB(B)+'" as a '+this.name),B.c.j||hA("Cannot pass deleted object as a pointer of type "+this.name),!this.za&&B.c.o.za&&hA("Cannot convert argument of type "+(B.c.F?B.c.F.name:B.c.o.name)+" to parameter type "+this.name),Q=FQ(B.c.j,B.c.o.i,this.i),this.Ba)switch(B.c.D===void 0&&hA("Passing raw pointer to smart pointer is illegal"),this.qc){case 0:B.c.F===this?Q=B.c.D:hA("Cannot convert argument of type "+(B.c.F?B.c.F.name:B.c.o.name)+" to parameter type "+this.name);break;case 1:Q=B.c.D;break;case 2:if(B.c.F===this)Q=B.c.D;else{var I=B.clone();Q=this.nc(Q,FI(function(){I.delete()})),A!==null&&A.push(this.$,Q)}break;default:hA("Unsupporting sharing policy")}return Q}function kg(A,B){return B===null?(this.Ta&&hA("null is not a valid "+this.name),0):(B.c||hA('Cannot pass "'+pB(B)+'" as a '+this.name),B.c.j||hA("Cannot pass deleted object as a pointer of type "+this.name),B.c.o.za&&hA("Cannot convert argument of type "+B.c.o.name+" to parameter type "+this.name),FQ(B.c.j,B.c.o.i,this.i))}function oQ(A){return this.fromWireType(jA[A>>2])}var XB={};function UQ(A,B){return B.o&&B.j||DQ("makeClassHandle requires ptr and ptrType"),!!B.F!=!!B.D&&DQ("Both smartPtrType and smartPtr must be specified"),B.count={value:1},yQ(Object.create(A,{c:{value:B}}))}function aB(A,B,Q,I){this.name=A,this.i=B,this.Ta=Q,this.za=I,this.Ba=!1,this.$=this.nc=this.mc=this.xb=this.qc=this.kc=void 0,B.G!==void 0?this.toWireType=tg:(this.toWireType=I?ag:kg,this.O=null)}function nB(A,B){A=qA(A);for(var Q=C["dynCall_"+A],I=[],E=1;E>2)+I]);return Q}function pQ(A){for(;A.length;){var B=A.pop();A.pop()(B)}}function yI(A,B,Q){return A instanceof Object||hA(Q+' with invalid "this": '+A),A instanceof B.i.constructor||hA(Q+' incompatible with "this" of type '+A.constructor.name),A.c.j||hA("cannot call emscripten binding method "+Q+" on deleted object"),FQ(A.c.j,A.c.o.i,B.i)}var xQ=[],cB=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function FI(A){switch(A){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var B=xQ.length?xQ.pop():cB.length;return cB[B]={ra:1,value:A},B}}function pB(A){if(A===null)return"null";var B=typeof A;return B==="object"||B==="array"||B==="function"?A.toString():""+A}function eg(A,B){switch(B){case 2:return function(Q){return this.fromWireType(BB[Q>>2])};case 3:return function(Q){return this.fromWireType(NB[Q>>3])};default:throw new TypeError("Unknown float type: "+A)}}function ng(A,B,Q){switch(B){case 0:return Q?function(I){return lA[I]}:function(I){return LA[I]};case 1:return Q?function(I){return MA[I>>1]}:function(I){return gB[I>>1]};case 2:return Q?function(I){return O[I>>2]}:function(I){return jA[I>>2]};default:throw new TypeError("Unknown integer type: "+A)}}var bQ,oI={};function UI(){if(!bQ){var A,B={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:x||"./this.program"};for(A in oI)B[A]=oI[A];var Q=[];for(A in B)Q.push(A+"="+B[A]);bQ=Q}return bQ}function cQ(A){return A%4==0&&(A%100!=0||A%400==0)}function ZQ(A,B){for(var Q=0,I=0;I<=B;Q+=A[I++]);return Q}var sQ=[31,29,31,30,31,30,31,31,30,31,30,31],NQ=[31,28,31,30,31,30,31,31,30,31,30,31];function HQ(A,B){for(A=new Date(A.getTime());0I-A.getDate())){A.setDate(A.getDate()+B);break}B-=I-A.getDate()+1,A.setDate(1),11>Q?A.setMonth(Q+1):(A.setMonth(0),A.setFullYear(A.getFullYear()+1))}return A}function cI(A,B,Q,I){A||(A=this),this.parent=A,this.s=A.s,this.oa=null,this.id=g.ec++,this.name=B,this.mode=Q,this.g={},this.h={},this.rdev=I}Object.defineProperties(cI.prototype,{read:{get:function(){return(365&this.mode)==365},set:function(A){A?this.mode|=365:this.mode&=-366}},write:{get:function(){return(146&this.mode)==146},set:function(A){A?this.mode|=146:this.mode&=-147}},ac:{get:function(){return g.v(this.mode)}},Sa:{get:function(){return g.ya(this.mode)}}}),g.Ab=cI,g.rc();for(var sI=Array(256),GQ=0;256>GQ;++GQ)sI[GQ]=String.fromCharCode(GQ);function wQ(A,B){var Q=Array(uA(A)+1);return A=FA(A,Q,0,Q.length),B&&(Q.length=A),Q}function NI(A){for(var B=[],Q=0;Q>4,E=(15&E)<<4|D>>2;var h=(3&D)<<6|H;B+=String.fromCharCode(I),D!==64&&(B+=String.fromCharCode(E)),H!==64&&(B+=String.fromCharCode(h))}while(Q>2],B.ha.push(A),nA=I[E],0|A;return A=O[A>>2],nA=Q,0|A},__cxa_find_matching_catch_3:function(){var A=s;if(!A)return nA=0;var B=z[A],Q=B.type;if(!Q)return nA=0,0|A;var I=Array.prototype.slice.call(arguments);PB(Q),O[22792]=A,A=91168;for(var E=0;E>2],B.ha.push(A),nA=I[E],0|A;return A=O[A>>2],nA=Q,0|A},__cxa_find_matching_catch_4:function(){var A=s;if(!A)return nA=0;var B=z[A],Q=B.type;if(!Q)return nA=0,0|A;var I=Array.prototype.slice.call(arguments);PB(Q),O[22792]=A,A=91168;for(var E=0;E>2],B.ha.push(A),nA=I[E],0|A;return A=O[A>>2],nA=Q,0|A},__cxa_find_matching_catch_5:function(){var A=s;if(!A)return nA=0;var B=z[A],Q=B.type;if(!Q)return nA=0,0|A;var I=Array.prototype.slice.call(arguments);PB(Q),O[22792]=A,A=91168;for(var E=0;E>2],B.ha.push(A),nA=I[E],0|A;return A=O[A>>2],nA=Q,0|A},__cxa_free_exception:L,__cxa_get_exception_ptr:function(A){return A},__cxa_rethrow:function(){var A=HA.pop();throw A=c(A),z[A].Ea||(HA.push(A),z[A].Ea=!0),s=A,A},__cxa_throw:function(A,B,Q){throw z[A]={j:A,ha:[A],type:B,ja:Q,ra:0,fb:!1,Ea:!1},s=A,"uncaught_exception"in bB?bB.ab++:bB.ab=1,A},__cxa_uncaught_exceptions:function(){return bB.ab},__map_file:function(){return S(63),-1},__resumeException:function(A){throw s||(s=A),A},__sys_fcntl64:function(A,B,Q){FB=Q;try{var I=bA(A);switch(B){case 0:var E=VA();return 0>E?-28:g.open(I.path,I.flags,0,E).fd;case 1:case 2:return 0;case 3:return I.flags;case 4:return E=VA(),I.flags|=E,0;case 12:return E=VA(),MA[E+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return S(28),-1;default:return-28}}catch(D){return g!==void 0&&D instanceof g.b||rA(D),-D.B}},__sys_ioctl:function(A,B,Q){FB=Q;try{var I=bA(A);switch(B){case 21509:case 21505:return I.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return I.tty?0:-59;case 21519:if(!I.tty)return-59;var E=VA();return O[E>>2]=0;case 21520:return I.tty?-28:-59;case 21531:return E=VA(),g.Ra(I,B,E);case 21523:case 21524:return I.tty?0:-59;default:rA("bad ioctl syscall "+B)}}catch(D){return g!==void 0&&D instanceof g.b||rA(D),-D.B}},__sys_munmap:function(A,B){try{if((0|A)==-1||B===0)var Q=-28;else{var I=iB[A];if(I&&B===I.Lc){var E=g.ba(I.fd);if(2&I.Sc){var D=I.flags,H=I.offset,h=LA.slice(A,A+B);g.da(E,h,H,B,D)}iB[A]=null,I.Gb&&UB(I.Nc)}Q=0}return Q}catch(M){return g!==void 0&&M instanceof g.b||rA(M),-M.B}},__sys_open:function(A,B,Q){FB=Q;try{var I=cA(A),E=VA();return g.open(I,B,E).fd}catch(D){return g!==void 0&&D instanceof g.b||rA(D),-D.B}},__sys_stat64:function(A,B){try{A=cA(A);A:{var Q=g.stat;try{var I=Q(A)}catch(D){if(D&&D.node&&d(A)!==d(g.I(D.node))){var E=-54;break A}throw D}O[B>>2]=I.dev,O[B+4>>2]=0,O[B+8>>2]=I.ino,O[B+12>>2]=I.mode,O[B+16>>2]=I.nlink,O[B+20>>2]=I.uid,O[B+24>>2]=I.gid,O[B+28>>2]=I.rdev,O[B+32>>2]=0,N=[I.size>>>0,(F=I.size,1<=+wB(F)?0>>0:~~+YB((F-+(~~F>>>0))/4294967296)>>>0:0)],O[B+40>>2]=N[0],O[B+44>>2]=N[1],O[B+48>>2]=4096,O[B+52>>2]=I.blocks,O[B+56>>2]=I.atime.getTime()/1e3|0,O[B+60>>2]=0,O[B+64>>2]=I.mtime.getTime()/1e3|0,O[B+68>>2]=0,O[B+72>>2]=I.ctime.getTime()/1e3|0,O[B+76>>2]=0,N=[I.ino>>>0,(F=I.ino,1<=+wB(F)?0>>0:~~+YB((F-+(~~F>>>0))/4294967296)>>>0:0)],O[B+80>>2]=N[0],O[B+84>>2]=N[1],E=0}return E}catch(D){return g!==void 0&&D instanceof g.b||rA(D),-D.B}},_embind_register_bool:function(A,B,Q,I,E){var D=DB(Q);RB(A,{name:B=qA(B),fromWireType:function(H){return!!H},toWireType:function(H,h){return h?I:E},argPackAdvance:8,readValueFromPointer:function(H){if(Q===1)var h=lA;else if(Q===2)h=MA;else{if(Q!==4)throw new TypeError("Unknown boolean type size: "+B);h=O}return this.fromWireType(h[H>>D])},O:null})},_embind_register_class:function(A,B,Q,I,E,D,H,h,M,R,f,W,T){f=qA(f),D=nB(E,D),h&&(h=nB(H,h)),R&&(R=nB(M,R)),T=nB(W,T);var gA=VQ(f);(function(v,DA){C.hasOwnProperty(v)?(hA("Cannot register public name '"+v+"' twice"),CI(C,v,v),C.hasOwnProperty(void 0)&&hA("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),C[v].N[void 0]=DA):C[v]=DA})(gA,function(){jB("Cannot construct "+f+" due to unbound types",[I])}),KB([A,B,Q],I?[I]:[],function(v){if(v=v[0],I)var DA=v.i,EA=DA.U;else EA=eB.prototype;v=KQ(gA,function(){if(Object.getPrototypeOf(this)!==a)throw new uB("Use 'new' to construct "+f);if(IA.V===void 0)throw new uB(f+" has no accessible constructor");var WA=IA.V[arguments.length];if(WA===void 0)throw new uB("Tried to invoke ctor of "+f+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(IA.V).toString()+") parameters instead!");return WA.apply(this,arguments)});var a=Object.create(EA,{constructor:{value:v}});v.prototype=a;var IA=new Rg(f,v,a,T,DA,D,h,R);DA=new aB(f,IA,!0,!1),EA=new aB(f+"*",IA,!1,!1);var yA=new aB(f+" const*",IA,!1,!0);return EI[A]={pointerType:EA,Mb:yA},function(WA,lB){C.hasOwnProperty(WA)||DQ("Replacing nonexistant public symbol"),C[WA]=lB,C[WA].va=void 0}(gA,v),[DA,EA,yA]})},_embind_register_class_constructor:function(A,B,Q,I,E,D){m(0IA&&hA("argTypes array size mismatch! Must at least get return value and 'this' types!");var yA=v[1]!==null&&EA!==null,WA=!1;for(EA=1;EA>>h}}var M=B.indexOf("unsigned")!=-1;RB(A,{name:B,fromWireType:D,toWireType:function(R,f){if(typeof f!="number"&&typeof f!="boolean")throw new TypeError('Cannot convert "'+pB(f)+'" to '+this.name);if(fE)throw new TypeError('Passing a number "'+pB(f)+'" from JS side to C/C++ side to an argument of type "'+B+'", which is outside the valid range ['+I+", "+E+"]!");return M?f>>>0:0|f},argPackAdvance:8,readValueFromPointer:ng(B,H,I!==0),O:null})},_embind_register_memory_view:function(A,B,Q){function I(D){var H=jA;return new E(xA,H[1+(D>>=2)],H[D])}var E=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][B];RB(A,{name:Q=qA(Q),fromWireType:I,argPackAdvance:8,readValueFromPointer:I},{Zb:!0})},_embind_register_std_string:function(A,B){var Q=(B=qA(B))==="std::string";RB(A,{name:B,fromWireType:function(I){var E=jA[I>>2];if(Q){var D=LA[I+4+E],H=0;D!=0&&(H=D,LA[I+4+E]=0);var h=I+4;for(D=0;D<=E;++D){var M=I+4+D;if(LA[M]==0){if(h=cA(h),R===void 0)var R=h;else R+=String.fromCharCode(0),R+=h;h=M+1}}H!=0&&(LA[I+4+E]=H)}else{for(R=Array(E),D=0;D>2]=H,Q&&D)FA(E,LA,h+4,H+1);else if(D)for(D=0;D>2],f=H(),W=f[M+4+R*B>>h],T=0;W!=0&&(T=W,f[M+4+R*B>>h]=0);var gA=M+4;for(W=0;W<=R;++W){var v=M+4+W*B;if(f[v>>h]==0){if(gA=I(gA),DA===void 0)var DA=gA;else DA+=String.fromCharCode(0),DA+=gA;gA=v+B}}return T!=0&&(f[M+4+R*B>>h]=T),UB(M),DA},toWireType:function(M,R){typeof R!="string"&&hA("Cannot pass non-string to C++ string type "+Q);var f=D(R),W=zB(4+f+B);return jA[W>>2]=f>>h,E(R,W+4,f+B),M!==null&&M.push(UB,W),W},argPackAdvance:8,readValueFromPointer:oQ,O:function(M){UB(M)}})},_embind_register_void:function(A,B){RB(A,{Jc:!0,name:B=qA(B),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},abort:function(){rA()},emscripten_get_sbrk_ptr:function(){return 91008},emscripten_memcpy_big:function(A,B,Q){LA.copyWithin(A,B,B+Q)},emscripten_resize_heap:function(A){A>>>=0;var B=LA.length;if(2147483648=Q;Q*=2){var I=B*(1+.2/Q);I=Math.min(I,A+100663296),0<(I=Math.max(16777216,A,I))%65536&&(I+=65536-I%65536);A:{try{vA.grow(Math.min(2147483648,I)-xA.byteLength+65535>>>16),QA(vA.buffer);var E=1;break A}catch{}E=void 0}if(E)return!0}return!1},environ_get:function(A,B){var Q=0;return UI().forEach(function(I,E){var D=B+Q;for(E=O[A+4*E>>2]=D,D=0;D>0]=I.charCodeAt(D);lA[E>>0]=0,Q+=I.length+1}),0},environ_sizes_get:function(A,B){var Q=UI();O[A>>2]=Q.length;var I=0;return Q.forEach(function(E){I+=E.length+1}),O[B>>2]=I,0},fd_close:function(A){try{var B=bA(A);return g.close(B),0}catch(Q){return g!==void 0&&Q instanceof g.b||rA(Q),Q.B}},fd_read:function(A,B,Q,I){try{A:{for(var E=bA(A),D=A=0;D>2],h=g.read(E,lA,O[B+8*D>>2],H,void 0);if(0>h){var M=-1;break A}if(A+=h,h>2]=M,0}catch(R){return g!==void 0&&R instanceof g.b||rA(R),R.B}},fd_seek:function(A,B,Q,I,E){try{var D=bA(A);return-9007199254740992>=(A=4294967296*Q+(B>>>0))||9007199254740992<=A?-61:(g.K(D,A,I),N=[D.position>>>0,(F=D.position,1<=+wB(F)?0>>0:~~+YB((F-+(~~F>>>0))/4294967296)>>>0:0)],O[E>>2]=N[0],O[E+4>>2]=N[1],D.Oa&&A===0&&I===0&&(D.Oa=null),0)}catch(H){return g!==void 0&&H instanceof g.b||rA(H),H.B}},fd_write:function(A,B,Q,I){try{A:{for(var E=bA(A),D=A=0;D>2],O[B+(8*D+4)>>2],void 0);if(0>H){var h=-1;break A}A+=H}h=A}return O[I>>2]=h,0}catch(M){return g!==void 0&&M instanceof g.b||rA(M),M.B}},getTempRet0:function(){return 0|nA},gettimeofday:function(A){var B=Date.now();return O[A>>2]=B/1e3|0,O[A+4>>2]=B%1e3*1e3|0,0},invoke_diii:function(A,B,Q,I){var E=SA();try{return _I(A,B,Q,I)}catch(D){if(eA(E),D!==D+0&&D!=="longjmp")throw D;tA(1,0)}},invoke_fiii:function(A,B,Q,I){var E=SA();try{return PI(A,B,Q,I)}catch(D){if(eA(E),D!==D+0&&D!=="longjmp")throw D;tA(1,0)}},invoke_i:function(A){var B=SA();try{return KI(A)}catch(Q){if(eA(B),Q!==Q+0&&Q!=="longjmp")throw Q;tA(1,0)}},invoke_ii:function(A,B){var Q=SA();try{return lI(A,B)}catch(I){if(eA(Q),I!==I+0&&I!=="longjmp")throw I;tA(1,0)}},invoke_iif:function(A,B,Q){var I=SA();try{return jI(A,B,Q)}catch(E){if(eA(I),E!==E+0&&E!=="longjmp")throw E;tA(1,0)}},invoke_iii:function(A,B,Q){var I=SA();try{return dI(A,B,Q)}catch(E){if(eA(I),E!==E+0&&E!=="longjmp")throw E;tA(1,0)}},invoke_iiii:function(A,B,Q,I){var E=SA();try{return fI(A,B,Q,I)}catch(D){if(eA(E),D!==D+0&&D!=="longjmp")throw D;tA(1,0)}},invoke_iiiii:function(A,B,Q,I,E){var D=SA();try{return uI(A,B,Q,I,E)}catch(H){if(eA(D),H!==H+0&&H!=="longjmp")throw H;tA(1,0)}},invoke_iiiiid:function(A,B,Q,I,E,D){var H=SA();try{return WI(A,B,Q,I,E,D)}catch(h){if(eA(H),h!==h+0&&h!=="longjmp")throw h;tA(1,0)}},invoke_iiiiii:function(A,B,Q,I,E,D){var H=SA();try{return pI(A,B,Q,I,E,D)}catch(h){if(eA(H),h!==h+0&&h!=="longjmp")throw h;tA(1,0)}},invoke_iiiiiii:function(A,B,Q,I,E,D,H){var h=SA();try{return xI(A,B,Q,I,E,D,H)}catch(M){if(eA(h),M!==M+0&&M!=="longjmp")throw M;tA(1,0)}},invoke_iiiiiiii:function(A,B,Q,I,E,D,H,h){var M=SA();try{return bI(A,B,Q,I,E,D,H,h)}catch(R){if(eA(M),R!==R+0&&R!=="longjmp")throw R;tA(1,0)}},invoke_iiiiiiiiiii:function(A,B,Q,I,E,D,H,h,M,R,f){var W=SA();try{return ZI(A,B,Q,I,E,D,H,h,M,R,f)}catch(T){if(eA(W),T!==T+0&&T!=="longjmp")throw T;tA(1,0)}},invoke_iiiiiiiiiiii:function(A,B,Q,I,E,D,H,h,M,R,f,W){var T=SA();try{return qI(A,B,Q,I,E,D,H,h,M,R,f,W)}catch(gA){if(eA(T),gA!==gA+0&&gA!=="longjmp")throw gA;tA(1,0)}},invoke_iiiiiiiiiiiii:function(A,B,Q,I,E,D,H,h,M,R,f,W,T){var gA=SA();try{return mI(A,B,Q,I,E,D,H,h,M,R,f,W,T)}catch(v){if(eA(gA),v!==v+0&&v!=="longjmp")throw v;tA(1,0)}},invoke_iiiiij:function(A,B,Q,I,E,D,H){var h=SA();try{return OI(A,B,Q,I,E,D,H)}catch(M){if(eA(h),M!==M+0&&M!=="longjmp")throw M;tA(1,0)}},invoke_iiijiiiiii:function(A,B,Q,I,E,D,H,h,M,R,f){var W=SA();try{return vI(A,B,Q,I,E,D,H,h,M,R,f)}catch(T){if(eA(W),T!==T+0&&T!=="longjmp")throw T;tA(1,0)}},invoke_iij:function(A,B,Q,I){var E=SA();try{return XI(A,B,Q,I)}catch(D){if(eA(E),D!==D+0&&D!=="longjmp")throw D;tA(1,0)}},invoke_jii:function(A,B,Q){var I=SA();try{return zI(A,B,Q)}catch(E){if(eA(I),E!==E+0&&E!=="longjmp")throw E;tA(1,0)}},invoke_jiiii:function(A,B,Q,I,E){var D=SA();try{return TI(A,B,Q,I,E)}catch(H){if(eA(D),H!==H+0&&H!=="longjmp")throw H;tA(1,0)}},invoke_v:function(A){var B=SA();try{hI(A)}catch(Q){if(eA(B),Q!==Q+0&&Q!=="longjmp")throw Q;tA(1,0)}},invoke_vi:function(A,B){var Q=SA();try{RI(A,B)}catch(I){if(eA(Q),I!==I+0&&I!=="longjmp")throw I;tA(1,0)}},invoke_vii:function(A,B,Q){var I=SA();try{aI(A,B,Q)}catch(E){if(eA(I),E!==E+0&&E!=="longjmp")throw E;tA(1,0)}},invoke_viii:function(A,B,Q,I){var E=SA();try{tI(A,B,Q,I)}catch(D){if(eA(E),D!==D+0&&D!=="longjmp")throw D;tA(1,0)}},invoke_viiii:function(A,B,Q,I,E){var D=SA();try{kI(A,B,Q,I,E)}catch(H){if(eA(D),H!==H+0&&H!=="longjmp")throw H;tA(1,0)}},invoke_viiiii:function(A,B,Q,I,E,D){var H=SA();try{SI(A,B,Q,I,E,D)}catch(h){if(eA(H),h!==h+0&&h!=="longjmp")throw h;tA(1,0)}},invoke_viiiiiii:function(A,B,Q,I,E,D,H,h){var M=SA();try{eI(A,B,Q,I,E,D,H,h)}catch(R){if(eA(M),R!==R+0&&R!=="longjmp")throw R;tA(1,0)}},invoke_viiiiiiiiii:function(A,B,Q,I,E,D,H,h,M,R,f){var W=SA();try{nI(A,B,Q,I,E,D,H,h,M,R,f)}catch(T){if(eA(W),T!==T+0&&T!=="longjmp")throw T;tA(1,0)}},invoke_viiiiiiiiiiiiiii:function(A,B,Q,I,E,D,H,h,M,R,f,W,T,gA,v,DA){var EA=SA();try{MI(A,B,Q,I,E,D,H,h,M,R,f,W,T,gA,v,DA)}catch(a){if(eA(EA),a!==a+0&&a!=="longjmp")throw a;tA(1,0)}},invoke_viiiijji:function(A,B,Q,I,E,D,H,h,M,R){var f=SA();try{JI(A,B,Q,I,E,D,H,h,M,R)}catch(W){if(eA(f),W!==W+0&&W!=="longjmp")throw W;tA(1,0)}},invoke_viijii:function(A,B,Q,I,E,D,H){var h=SA();try{rI(A,B,Q,I,E,D,H)}catch(M){if(eA(h),M!==M+0&&M!=="longjmp")throw M;tA(1,0)}},invoke_viji:function(A,B,Q,I,E){var D=SA();try{VI(A,B,Q,I,E)}catch(H){if(eA(D),H!==H+0&&H!=="longjmp")throw H;tA(1,0)}},llvm_eh_typeid_for:function(A){return A},memory:vA,setTempRet0:function(A){nA=0|A},strftime_l:function(A,B,Q,I){return function(E,D,H,h){function M(a,IA,yA){for(a=typeof a=="number"?a.toString():a||"";a.lengthlB?-1:0=f(yA,a)?0>=f(IA,a)?a.getFullYear()+1:a.getFullYear():a.getFullYear()-1}var gA=O[h+40>>2];for(var v in h={uc:O[h>>2],tc:O[h+4>>2],Ga:O[h+8>>2],sa:O[h+12>>2],fa:O[h+16>>2],C:O[h+20>>2],Ha:O[h+24>>2],Ia:O[h+28>>2],Vc:O[h+32>>2],sc:O[h+36>>2],vc:gA?cA(gA):""},H=cA(H),gA={"%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"})H=H.replace(new RegExp(v,"g"),gA[v]);var DA="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),EA="January February March April May June July August September October November December".split(" ");for(v in gA={"%a":function(a){return DA[a.Ha].substring(0,3)},"%A":function(a){return DA[a.Ha]},"%b":function(a){return EA[a.fa].substring(0,3)},"%B":function(a){return EA[a.fa]},"%C":function(a){return R((a.C+1900)/100|0,2)},"%d":function(a){return R(a.sa,2)},"%e":function(a){return M(a.sa,2," ")},"%g":function(a){return T(a).toString().substring(2)},"%G":function(a){return T(a)},"%H":function(a){return R(a.Ga,2)},"%I":function(a){return(a=a.Ga)==0?a=12:12a.Ga?"AM":"PM"},"%S":function(a){return R(a.uc,2)},"%t":function(){return" "},"%u":function(a){return a.Ha||7},"%U":function(a){var IA=new Date(a.C+1900,0,1),yA=IA.getDay()===0?IA:HQ(IA,7-IA.getDay());return 0>f(yA,a=new Date(a.C+1900,a.fa,a.sa))?R(Math.ceil((31-yA.getDate()+(ZQ(cQ(a.getFullYear())?sQ:NQ,a.getMonth()-1)-31)+a.getDate())/7),2):f(yA,IA)===0?"01":"00"},"%V":function(a){var IA=new Date(a.C+1901,0,4),yA=W(new Date(a.C+1900,0,4));IA=W(IA);var WA=HQ(new Date(a.C+1900,0,1),a.Ia);return 0>f(WA,yA)?"53":0>=f(IA,WA)?"01":R(Math.ceil((yA.getFullYear()f(yA,a=new Date(a.C+1900,a.fa,a.sa))?R(Math.ceil((31-yA.getDate()+(ZQ(cQ(a.getFullYear())?sQ:NQ,a.getMonth()-1)-31)+a.getDate())/7),2):f(yA,IA)===0?"01":"00"},"%y":function(a){return(a.C+1900).toString().substring(2)},"%Y":function(a){return a.C+1900},"%z":function(a){var IA=0<=(a=a.sc);return a=Math.abs(a)/60,(IA?"+":"-")+String("0000"+(a/60*100+a%60)).slice(-4)},"%Z":function(a){return a.vc},"%%":function(){return"%"}})0<=H.indexOf(v)&&(H=H.replace(new RegExp(v,"g"),gA[v](h)));return(v=wQ(H,!1)).length>D?0:(lA.set(v,E),v.length-1)}(A,B,Q,I)},table:UA},GI=function(){function A(E){C.asm=E.exports,kB()}function B(E){A(E.instance)}function Q(E){return(YA||!K&&!w||typeof fetch!="function"||zA(n,"file://")?new Promise(function(D){D(P())}):fetch(n,{credentials:"same-origin"}).then(function(D){if(!D.ok)throw"failed to load wasm binary file at '"+n+"'";return D.arrayBuffer()}).catch(function(){return P()})).then(function(D){return WebAssembly.instantiate(D,I)}).then(E,function(D){sA("failed to asynchronously prepare wasm: "+D),rA(D)})}var I={env:HI,wasi_snapshot_preview1:HI};if(VB(),C.instantiateWasm)try{return C.instantiateWasm(I,A)}catch(E){return sA("Module.instantiateWasm callback failed with error: "+E),!1}return function(){if(YA||typeof WebAssembly.instantiateStreaming!="function"||zA(n,V)||zA(n,"file://")||typeof fetch!="function")return Q(B);fetch(n,{credentials:"same-origin"}).then(function(E){return WebAssembly.instantiateStreaming(E,I).then(B,function(D){sA("wasm streaming compile failed: "+D),sA("falling back to ArrayBuffer instantiation"),Q(B)})})}(),{}}();C.asm=GI;var wI=C.___wasm_call_ctors=function(){return(wI=C.___wasm_call_ctors=C.asm.__wasm_call_ctors).apply(null,arguments)},zB=C._malloc=function(){return(zB=C._malloc=C.asm.malloc).apply(null,arguments)},UB=C._free=function(){return(UB=C._free=C.asm.free).apply(null,arguments)},YI=C.___errno_location=function(){return(YI=C.___errno_location=C.asm.__errno_location).apply(null,arguments)},tA=C._setThrew=function(){return(tA=C._setThrew=C.asm.setThrew).apply(null,arguments)},bB=C.__ZSt18uncaught_exceptionv=function(){return(bB=C.__ZSt18uncaught_exceptionv=C.asm._ZSt18uncaught_exceptionv).apply(null,arguments)},TB=C.___cxa_can_catch=function(){return(TB=C.___cxa_can_catch=C.asm.__cxa_can_catch).apply(null,arguments)},PB=C.___cxa_is_pointer_type=function(){return(PB=C.___cxa_is_pointer_type=C.asm.__cxa_is_pointer_type).apply(null,arguments)},LI=C.___getTypeName=function(){return(LI=C.___getTypeName=C.asm.__getTypeName).apply(null,arguments)};C.___embind_register_native_and_builtin_types=function(){return(C.___embind_register_native_and_builtin_types=C.asm.__embind_register_native_and_builtin_types).apply(null,arguments)};var hI=C.dynCall_v=function(){return(hI=C.dynCall_v=C.asm.dynCall_v).apply(null,arguments)},RI=C.dynCall_vi=function(){return(RI=C.dynCall_vi=C.asm.dynCall_vi).apply(null,arguments)},aI=C.dynCall_vii=function(){return(aI=C.dynCall_vii=C.asm.dynCall_vii).apply(null,arguments)},tI=C.dynCall_viii=function(){return(tI=C.dynCall_viii=C.asm.dynCall_viii).apply(null,arguments)},kI=C.dynCall_viiii=function(){return(kI=C.dynCall_viiii=C.asm.dynCall_viiii).apply(null,arguments)},SI=C.dynCall_viiiii=function(){return(SI=C.dynCall_viiiii=C.asm.dynCall_viiiii).apply(null,arguments)},eI=C.dynCall_viiiiiii=function(){return(eI=C.dynCall_viiiiiii=C.asm.dynCall_viiiiiii).apply(null,arguments)},nI=C.dynCall_viiiiiiiiii=function(){return(nI=C.dynCall_viiiiiiiiii=C.asm.dynCall_viiiiiiiiii).apply(null,arguments)},MI=C.dynCall_viiiiiiiiiiiiiii=function(){return(MI=C.dynCall_viiiiiiiiiiiiiii=C.asm.dynCall_viiiiiiiiiiiiiii).apply(null,arguments)},JI=C.dynCall_viiiijji=function(){return(JI=C.dynCall_viiiijji=C.asm.dynCall_viiiijji).apply(null,arguments)},rI=C.dynCall_viijii=function(){return(rI=C.dynCall_viijii=C.asm.dynCall_viijii).apply(null,arguments)},VI=C.dynCall_viji=function(){return(VI=C.dynCall_viji=C.asm.dynCall_viji).apply(null,arguments)},KI=C.dynCall_i=function(){return(KI=C.dynCall_i=C.asm.dynCall_i).apply(null,arguments)},lI=C.dynCall_ii=function(){return(lI=C.dynCall_ii=C.asm.dynCall_ii).apply(null,arguments)},dI=C.dynCall_iii=function(){return(dI=C.dynCall_iii=C.asm.dynCall_iii).apply(null,arguments)},fI=C.dynCall_iiii=function(){return(fI=C.dynCall_iiii=C.asm.dynCall_iiii).apply(null,arguments)},uI=C.dynCall_iiiii=function(){return(uI=C.dynCall_iiiii=C.asm.dynCall_iiiii).apply(null,arguments)},pI=C.dynCall_iiiiii=function(){return(pI=C.dynCall_iiiiii=C.asm.dynCall_iiiiii).apply(null,arguments)},xI=C.dynCall_iiiiiii=function(){return(xI=C.dynCall_iiiiiii=C.asm.dynCall_iiiiiii).apply(null,arguments)},bI=C.dynCall_iiiiiiii=function(){return(bI=C.dynCall_iiiiiiii=C.asm.dynCall_iiiiiiii).apply(null,arguments)},ZI=C.dynCall_iiiiiiiiiii=function(){return(ZI=C.dynCall_iiiiiiiiiii=C.asm.dynCall_iiiiiiiiiii).apply(null,arguments)},qI=C.dynCall_iiiiiiiiiiii=function(){return(qI=C.dynCall_iiiiiiiiiiii=C.asm.dynCall_iiiiiiiiiiii).apply(null,arguments)},mI=C.dynCall_iiiiiiiiiiiii=function(){return(mI=C.dynCall_iiiiiiiiiiiii=C.asm.dynCall_iiiiiiiiiiiii).apply(null,arguments)},OI=C.dynCall_iiiiij=function(){return(OI=C.dynCall_iiiiij=C.asm.dynCall_iiiiij).apply(null,arguments)},WI=C.dynCall_iiiiid=function(){return(WI=C.dynCall_iiiiid=C.asm.dynCall_iiiiid).apply(null,arguments)},vI=C.dynCall_iiijiiiiii=function(){return(vI=C.dynCall_iiijiiiiii=C.asm.dynCall_iiijiiiiii).apply(null,arguments)},XI=C.dynCall_iij=function(){return(XI=C.dynCall_iij=C.asm.dynCall_iij).apply(null,arguments)},jI=C.dynCall_iif=function(){return(jI=C.dynCall_iif=C.asm.dynCall_iif).apply(null,arguments)},zI=C.dynCall_jii=function(){return(zI=C.dynCall_jii=C.asm.dynCall_jii).apply(null,arguments)},TI=C.dynCall_jiiii=function(){return(TI=C.dynCall_jiiii=C.asm.dynCall_jiiii).apply(null,arguments)},PI=C.dynCall_fiii=function(){return(PI=C.dynCall_fiii=C.asm.dynCall_fiii).apply(null,arguments)},_I=C.dynCall_diii=function(){return(_I=C.dynCall_diii=C.asm.dynCall_diii).apply(null,arguments)},SA=C.stackSave=function(){return(SA=C.stackSave=C.asm.stackSave).apply(null,arguments)};C.stackAlloc=function(){return(C.stackAlloc=C.asm.stackAlloc).apply(null,arguments)};var _B,eA=C.stackRestore=function(){return(eA=C.stackRestore=C.asm.stackRestore).apply(null,arguments)};function qQ(){function A(){if(!_B&&(_B=!0,C.calledRun=!0,!fA)){if(C.noFSInit||g.ka.Qa||g.ka(),NA(PA),g.ub=!1,NA(EB),C.onRuntimeInitialized&&C.onRuntimeInitialized(),C.postRun)for(typeof C.postRun=="function"&&(C.postRun=[C.postRun]);C.postRun.length;){var B=C.postRun.shift();CB.unshift(B)}NA(CB)}}if(!(0{Y.then(()=>{C()})}),J=()=>G(void 0,void 0,void 0,function*(){yield k;const C=new Y.H264MP4Encoder;return C.FS=Y.FS,C})},function(i,o){i.exports=OQ},function(i,o){i.exports=OQ}]);export{QE as F,HE as G,EE as M,IE as S,UE as W,cE as _,NE as a,Eg as b,Pg as c,yE as d,WQ as e,xg as f,AE as g,BE as h,sE as i,oE as j,gE as k,GE as l,CE as m,wE as n,iE as r,FE as s,DE as t};