const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/challengeFetch-4jZo7wlv.js","assets/config-DFJTa-qV.js","assets/boardGhostFetch-rA6L-Vw3.js","assets/ghostFetch-oIExdeNQ.js","assets/nameGate-CjjPXEDN.js","assets/gameServer-30SEdFsH.js","assets/bootstrap-CXNNrSQ7.js"])))=>i.map(i=>d[i]); (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))u(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function l(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(c){if(c.ep)return;c.ep=!0;const f=l(c);fetch(c.href,f)}})();const Sv="modulepreload",_v=function(r){return"/"+r},uf={},lt=function(i,l,u){let c=Promise.resolve();if(l&&l.length>0){let _=function(w){return Promise.all(w.map(O=>Promise.resolve(O).then(R=>({status:"fulfilled",value:R}),R=>({status:"rejected",reason:R}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),g=h?.nonce||h?.getAttribute("nonce");c=_(l.map(w=>{if(w=_v(w),w in uf)return;uf[w]=!0;const O=w.endsWith(".css"),R=O?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${w}"]${R}`))return;const L=document.createElement("link");if(L.rel=O?"stylesheet":Sv,O||(L.as="script"),L.crossOrigin="",L.href=w,g&&L.setAttribute("nonce",g),document.head.appendChild(L),O)return new Promise((z,Q)=>{L.addEventListener("load",z),L.addEventListener("error",()=>Q(new Error(`Unable to preload CSS for ${w}`)))})}))}function f(h){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=h,window.dispatchEvent(g),!g.defaultPrevented)throw h}return c.then(h=>{for(const g of h||[])g.status==="rejected"&&f(g.reason);return i().catch(f)})};var ra={exports:{}},ui={},ia={exports:{}},Z={};var cf;function Ev(){if(cf)return Z;cf=1;var r=Symbol.for("react.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),h=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),R=Symbol.iterator;function L(y){return y===null||typeof y!="object"?null:(y=R&&y[R]||y["@@iterator"],typeof y=="function"?y:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Q=Object.assign,X={};function b(y,A,K){this.props=y,this.context=A,this.refs=X,this.updater=K||z}b.prototype.isReactComponent={},b.prototype.setState=function(y,A){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,A,"setState")},b.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function ee(){}ee.prototype=b.prototype;function M(y,A,K){this.props=y,this.context=A,this.refs=X,this.updater=K||z}var J=M.prototype=new ee;J.constructor=M,Q(J,b.prototype),J.isPureReactComponent=!0;var se=Array.isArray,Ae=Object.prototype.hasOwnProperty,ze={current:null},Ye={key:!0,ref:!0,__self:!0,__source:!0};function at(y,A,K){var q,ne={},re=null,ce=null;if(A!=null)for(q in A.ref!==void 0&&(ce=A.ref),A.key!==void 0&&(re=""+A.key),A)Ae.call(A,q)&&!Ye.hasOwnProperty(q)&&(ne[q]=A[q]);var le=arguments.length-2;if(le===1)ne.children=K;else if(1>>1,A=D[y];if(0>>1;yc(ne,F))rec(ce,ne)?(D[y]=ce,D[re]=F,y=re):(D[y]=ne,D[q]=F,y=q);else if(rec(ce,F))D[y]=ce,D[re]=F,y=re;else break e}}return j}function c(D,j){var F=D.sortIndex-j.sortIndex;return F!==0?F:D.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var h=Date,g=h.now();r.unstable_now=function(){return h.now()-g}}var _=[],w=[],O=1,R=null,L=3,z=!1,Q=!1,X=!1,b=typeof setTimeout=="function"?setTimeout:null,ee=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function J(D){for(var j=l(w);j!==null;){if(j.callback===null)u(w);else if(j.startTime<=D)u(w),j.sortIndex=j.expirationTime,i(_,j);else break;j=l(w)}}function se(D){if(X=!1,J(D),!Q)if(l(_)!==null)Q=!0,je(Ae);else{var j=l(w);j!==null&&_e(se,j.startTime-D)}}function Ae(D,j){Q=!1,X&&(X=!1,ee(at),at=-1),z=!0;var F=L;try{for(J(j),R=l(_);R!==null&&(!(R.expirationTime>j)||D&&!_n());){var y=R.callback;if(typeof y=="function"){R.callback=null,L=R.priorityLevel;var A=y(R.expirationTime<=j);j=r.unstable_now(),typeof A=="function"?R.callback=A:R===l(_)&&u(_),J(j)}else u(_);R=l(_)}if(R!==null)var K=!0;else{var q=l(w);q!==null&&_e(se,q.startTime-j),K=!1}return K}finally{R=null,L=F,z=!1}}var ze=!1,Ye=null,at=-1,Kt=5,Bt=-1;function _n(){return!(r.unstable_now()-BtD||125y?(D.sortIndex=F,i(w,D),l(_)===null&&D===l(w)&&(X?(ee(at),at=-1):X=!0,_e(se,F-y))):(D.sortIndex=A,i(_,D),Q||z||(Q=!0,je(Ae))),D},r.unstable_shouldYield=_n,r.unstable_wrapCallback=function(D){var j=L;return function(){var F=L;L=j;try{return D.apply(this,arguments)}finally{L=F}}}})(oa)),oa}var mf;function Av(){return mf||(mf=1,la.exports=kv()),la.exports}var gf;function Tv(){if(gf)return Ze;gf=1;var r=qa(),i=Av();function l(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_=Object.prototype.hasOwnProperty,w=/^[: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]*$/,O={},R={};function L(e){return _.call(R,e)?!0:_.call(O,e)?!1:w.test(e)?R[e]=!0:(O[e]=!0,!1)}function z(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Q(e,t,n,s){if(t===null||typeof t>"u"||z(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function X(e,t,n,s,o,a,d){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=d}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new X(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new X(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new X(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new X(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){b[e]=new X(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new X(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new X(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new X(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new X(e,5,!1,e.toLowerCase(),null,!1,!1)});var ee=/[\-:]([a-z])/g;function M(e){return e[1].toUpperCase()}"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(ee,M);b[t]=new X(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(ee,M);b[t]=new X(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(ee,M);b[t]=new X(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new X(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new X("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new X(e,1,!1,e.toLowerCase(),null,!0,!0)});function J(e,t,n,s){var o=b.hasOwnProperty(t)?b[t]:null;(o!==null?o.type!==0:s||!(2p||o[d]!==a[p]){var m=` `+o[d].replace(" at new "," at ");return e.displayName&&m.includes("")&&(m=m.replace("",e.displayName)),m}while(1<=d&&0<=p);break}}}finally{K=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?A(e):""}function ne(e){switch(e.tag){case 5:return A(e.type);case 16:return A("Lazy");case 13:return A("Suspense");case 19:return A("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1),e;case 11:return e=q(e.type.render,!1),e;case 1:return e=q(e.type,!0),e;default:return""}}function re(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ye:return"Fragment";case ze:return"Portal";case Kt:return"Profiler";case at:return"StrictMode";case et:return"Suspense";case gt:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _n:return(e.displayName||"Context")+".Consumer";case Bt:return(e._context.displayName||"Context")+".Provider";case At:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Tt:return t=e.displayName||null,t!==null?t:re(e.type)||"Memo";case je:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}function ce(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(t);case 8:return t===at?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function le(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function tt(e){var t=me(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(d){s=""+d,a.call(this,d)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(d){s=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oi(e){e._valueTracker||(e._valueTracker=tt(e))}function pu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=me(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Pi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ul(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mu(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=le(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function gu(e,t){t=t.checked,t!=null&&J(e,"checked",t,!1)}function cl(e,t){gu(e,t);var n=le(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?dl(e,t.type,n):t.hasOwnProperty("defaultValue")&&dl(e,t.type,le(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vu(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function dl(e,t,n){(t!=="number"||Pi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kr=Array.isArray;function Wn(e,t,n,s){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ii.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ar(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tr={animationIterationCount:!0,aspectRatio:!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},Cm=["Webkit","ms","Moz","O"];Object.keys(Tr).forEach(function(e){Cm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tr[t]=Tr[e]})});function Cu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tr.hasOwnProperty(e)&&Tr[e]?(""+t).trim():t+"px"}function ku(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,o=Cu(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,o):e[n]=o}}var km=F({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 pl(e,t){if(t){if(km[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(l(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(l(61))}if(t.style!=null&&typeof t.style!="object")throw Error(l(62))}}function ml(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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}}var gl=null;function vl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yl=null,Yn=null,jn=null;function Au(e){if(e=Xr(e)){if(typeof yl!="function")throw Error(l(280));var t=e.stateNode;t&&(t=ts(t),yl(e.stateNode,e.type,t))}}function Tu(e){Yn?jn?jn.push(e):jn=[e]:Yn=e}function Ru(){if(Yn){var e=Yn,t=jn;if(jn=Yn=null,Au(e),t)for(e=0;e>>=0,e===0?32:31-(Bm(e)/xm|0)|0}var Fi=64,Hi=4194304;function Or(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ui(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,o=e.suspendedLanes,a=e.pingedLanes,d=n&268435455;if(d!==0){var p=d&~o;p!==0?s=Or(p):(a&=d,a!==0&&(s=Or(a)))}else d=n&~o,d!==0?s=Or(d):a!==0&&(s=Or(a));if(s===0)return 0;if(t!==0&&t!==s&&(t&o)===0&&(o=s&-s,a=t&-t,o>=a||o===16&&(a&4194240)!==0))return t;if((s&4)!==0&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0n;n++)t.push(e);return t}function Pr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vt(t),e[t]=n}function Gm(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0=Ur),tc=" ",nc=!1;function rc(e,t){switch(e){case"keyup":return pg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ic(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xn=!1;function gg(e,t){switch(e){case"compositionend":return ic(t);case"keypress":return t.which!==32?null:(nc=!0,tc);case"textInput":return e=t.data,e===tc&&nc?null:e;default:return null}}function vg(e,t){if(Xn)return e==="compositionend"||!xl&&rc(e,t)?(e=Ku(),Yi=Ol=en=null,Xn=!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)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dc(n)}}function hc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pc(){for(var e=window,t=Pi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pi(e.document)}return t}function Ul(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Tg(e){var t=pc(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hc(n.ownerDocument.documentElement,n)){if(s!==null&&Ul(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,a=Math.min(s.start,o);s=s.end===void 0?a:Math.min(s.end,o),!e.extend&&a>s&&(o=s,s=a,a=o),o=fc(n,a);var d=fc(n,s);o&&d&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==d.node||e.focusOffset!==d.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),a>s?(e.addRange(t),e.extend(d.node,d.offset)):(t.setEnd(d.node,d.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Kn=null,Gl=null,Wr=null,zl=!1;function mc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zl||Kn==null||Kn!==Pi(s)||(s=Kn,"selectionStart"in s&&Ul(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Wr&&br(Wr,s)||(Wr=s,s=qi(Gl,"onSelect"),0er||(e.current=Jl[er],Jl[er]=null,er--)}function de(e,t){er++,Jl[er]=e.current,e.current=t}var sn={},xe=rn(sn),Ve=rn(!1),Cn=sn;function tr(e,t){var n=e.type.contextTypes;if(!n)return sn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var o={},a;for(a in n)o[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function $e(e){return e=e.childContextTypes,e!=null}function ns(){pe(Ve),pe(xe)}function Oc(e,t,n){if(xe.current!==sn)throw Error(l(168));de(xe,t),de(Ve,n)}function Pc(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var o in s)if(!(o in t))throw Error(l(108,ce(e)||"Unknown",o));return F({},n,s)}function rs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sn,Cn=xe.current,de(xe,e),de(Ve,Ve.current),!0}function Ic(e,t,n){var s=e.stateNode;if(!s)throw Error(l(169));n?(e=Pc(e,t,Cn),s.__reactInternalMemoizedMergedChildContext=e,pe(Ve),pe(xe),de(xe,e)):pe(Ve),de(Ve,n)}var Ft=null,is=!1,eo=!1;function Mc(e){Ft===null?Ft=[e]:Ft.push(e)}function Hg(e){is=!0,Mc(e)}function ln(){if(!eo&&Ft!==null){eo=!0;var e=0,t=oe;try{var n=Ft;for(oe=1;e>=d,o-=d,Ht=1<<32-vt(t)+o|n<V?(Ie=Y,Y=null):Ie=Y.sibling;var ie=k(S,Y,E[V],I);if(ie===null){Y===null&&(Y=Ie);break}e&&Y&&ie.alternate===null&&t(S,Y),v=a(ie,v,V),W===null?G=ie:W.sibling=ie,W=ie,Y=Ie}if(V===E.length)return n(S,Y),ge&&An(S,V),G;if(Y===null){for(;VV?(Ie=Y,Y=null):Ie=Y.sibling;var mn=k(S,Y,ie.value,I);if(mn===null){Y===null&&(Y=Ie);break}e&&Y&&mn.alternate===null&&t(S,Y),v=a(mn,v,V),W===null?G=mn:W.sibling=mn,W=mn,Y=Ie}if(ie.done)return n(S,Y),ge&&An(S,V),G;if(Y===null){for(;!ie.done;V++,ie=E.next())ie=N(S,ie.value,I),ie!==null&&(v=a(ie,v,V),W===null?G=ie:W.sibling=ie,W=ie);return ge&&An(S,V),G}for(Y=s(S,Y);!ie.done;V++,ie=E.next())ie=B(Y,S,V,ie.value,I),ie!==null&&(e&&ie.alternate!==null&&Y.delete(ie.key===null?V:ie.key),v=a(ie,v,V),W===null?G=ie:W.sibling=ie,W=ie);return e&&Y.forEach(function(yv){return t(S,yv)}),ge&&An(S,V),G}function Ce(S,v,E,I){if(typeof E=="object"&&E!==null&&E.type===Ye&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Ae:e:{for(var G=E.key,W=v;W!==null;){if(W.key===G){if(G=E.type,G===Ye){if(W.tag===7){n(S,W.sibling),v=o(W,E.props.children),v.return=S,S=v;break e}}else if(W.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===je&&Uc(G)===W.type){n(S,W.sibling),v=o(W,E.props),v.ref=Kr(S,W,E),v.return=S,S=v;break e}n(S,W);break}else t(S,W);W=W.sibling}E.type===Ye?(v=Mn(E.props.children,S.mode,I,E.key),v.return=S,S=v):(I=Is(E.type,E.key,E.props,null,S.mode,I),I.ref=Kr(S,v,E),I.return=S,S=I)}return d(S);case ze:e:{for(W=E.key;v!==null;){if(v.key===W)if(v.tag===4&&v.stateNode.containerInfo===E.containerInfo&&v.stateNode.implementation===E.implementation){n(S,v.sibling),v=o(v,E.children||[]),v.return=S,S=v;break e}else{n(S,v);break}else t(S,v);v=v.sibling}v=qo(E,S.mode,I),v.return=S,S=v}return d(S);case je:return W=E._init,Ce(S,v,W(E._payload),I)}if(kr(E))return H(S,v,E,I);if(j(E))return U(S,v,E,I);as(S,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,v!==null&&v.tag===6?(n(S,v.sibling),v=o(v,E),v.return=S,S=v):(n(S,v),v=Zo(E,S.mode,I),v.return=S,S=v),d(S)):n(S,v)}return Ce}var sr=Gc(!0),zc=Gc(!1),us=rn(null),cs=null,lr=null,lo=null;function oo(){lo=lr=cs=null}function ao(e){var t=us.current;pe(us),e._currentValue=t}function uo(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function or(e,t){cs=e,lo=lr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Xe=!0),e.firstContext=null)}function dt(e){var t=e._currentValue;if(lo!==e)if(e={context:e,memoizedValue:t,next:null},lr===null){if(cs===null)throw Error(l(308));lr=e,cs.dependencies={lanes:0,firstContext:e}}else lr=lr.next=e;return t}var Tn=null;function co(e){Tn===null?Tn=[e]:Tn.push(e)}function bc(e,t,n,s){var o=t.interleaved;return o===null?(n.next=n,co(t)):(n.next=o.next,o.next=n),t.interleaved=n,Gt(e,s)}function Gt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var on=!1;function fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wc(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 zt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function an(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(te&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,Gt(e,n)}return o=s.interleaved,o===null?(t.next=t,co(s)):(t.next=o.next,o.next=t),s.interleaved=t,Gt(e,n)}function ds(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Al(e,n)}}function Yc(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var o=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var d={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?o=a=d:a=a.next=d,n=n.next}while(n!==null);a===null?o=a=t:a=a.next=t}else o=a=t;n={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function fs(e,t,n,s){var o=e.updateQueue;on=!1;var a=o.firstBaseUpdate,d=o.lastBaseUpdate,p=o.shared.pending;if(p!==null){o.shared.pending=null;var m=p,C=m.next;m.next=null,d===null?a=C:d.next=C,d=m;var T=e.alternate;T!==null&&(T=T.updateQueue,p=T.lastBaseUpdate,p!==d&&(p===null?T.firstBaseUpdate=C:p.next=C,T.lastBaseUpdate=m))}if(a!==null){var N=o.baseState;d=0,T=C=m=null,p=a;do{var k=p.lane,B=p.eventTime;if((s&k)===k){T!==null&&(T=T.next={eventTime:B,lane:0,tag:p.tag,payload:p.payload,callback:p.callback,next:null});e:{var H=e,U=p;switch(k=t,B=n,U.tag){case 1:if(H=U.payload,typeof H=="function"){N=H.call(B,N,k);break e}N=H;break e;case 3:H.flags=H.flags&-65537|128;case 0:if(H=U.payload,k=typeof H=="function"?H.call(B,N,k):H,k==null)break e;N=F({},N,k);break e;case 2:on=!0}}p.callback!==null&&p.lane!==0&&(e.flags|=64,k=o.effects,k===null?o.effects=[p]:k.push(p))}else B={eventTime:B,lane:k,tag:p.tag,payload:p.payload,callback:p.callback,next:null},T===null?(C=T=B,m=N):T=T.next=B,d|=k;if(p=p.next,p===null){if(p=o.shared.pending,p===null)break;k=p,p=k.next,k.next=null,o.lastBaseUpdate=k,o.shared.pending=null}}while(!0);if(T===null&&(m=N),o.baseState=m,o.firstBaseUpdate=C,o.lastBaseUpdate=T,t=o.shared.interleaved,t!==null){o=t;do d|=o.lane,o=o.next;while(o!==t)}else a===null&&(o.shared.lanes=0);Nn|=d,e.lanes=d,e.memoizedState=N}}function jc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var s=vo.transition;vo.transition={};try{e(!1),t()}finally{oe=n,vo.transition=s}}function cd(){return ft().memoizedState}function bg(e,t,n){var s=fn(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},dd(e))fd(t,n);else if(n=bc(e,t,n,s),n!==null){var o=We();Ct(n,e,s,o),hd(n,t,s)}}function Wg(e,t,n){var s=fn(e),o={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(dd(e))fd(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var d=t.lastRenderedState,p=a(d,n);if(o.hasEagerState=!0,o.eagerState=p,yt(p,d)){var m=t.interleaved;m===null?(o.next=o,co(t)):(o.next=m.next,m.next=o),t.interleaved=o;return}}catch{}n=bc(e,t,o,s),n!==null&&(o=We(),Ct(n,e,s,o),hd(n,t,s))}}function dd(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function fd(e,t){Jr=ms=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hd(e,t,n){if((n&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Al(e,n)}}var ys={readContext:dt,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},Yg={readContext:dt,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:nd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,gs(4194308,4,sd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gs(4194308,4,e,t)},useInsertionEffect:function(e,t){return gs(4,2,e,t)},useMemo:function(e,t){var n=Ot();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Ot();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=bg.bind(null,ye,e),[s.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:ed,useDebugValue:ko,useDeferredValue:function(e){return Ot().memoizedState=e},useTransition:function(){var e=ed(!1),t=e[0];return e=zg.bind(null,e[1]),Ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=ye,o=Ot();if(ge){if(n===void 0)throw Error(l(407));n=n()}else{if(n=t(),Pe===null)throw Error(l(349));(Ln&30)!==0||Kc(s,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,nd(Zc.bind(null,s,a,e),[e]),s.flags|=2048,ni(9,Qc.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=Ot(),t=Pe.identifierPrefix;if(ge){var n=Ut,s=Ht;n=(s&~(1<<32-vt(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=ei++,0<\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=d.createElement(n,{is:s.is}):(e=d.createElement(n),n==="select"&&(d=e,s.multiple?d.multiple=!0:s.size&&(d.size=s.size))):e=d.createElementNS(e,n),e[Lt]=t,e[$r]=s,Md(e,t,!1,!1),t.stateNode=e;e:{switch(d=ml(n,s),n){case"dialog":he("cancel",e),he("close",e),o=s;break;case"iframe":case"object":case"embed":he("load",e),o=s;break;case"video":case"audio":for(o=0;ofr&&(t.flags|=128,s=!0,ri(a,!1),t.lanes=4194304)}else{if(!s)if(e=hs(d),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ri(a,!0),a.tail===null&&a.tailMode==="hidden"&&!d.alternate&&!ge)return He(t),null}else 2*we()-a.renderingStartTime>fr&&n!==1073741824&&(t.flags|=128,s=!0,ri(a,!1),t.lanes=4194304);a.isBackwards?(d.sibling=t.child,t.child=d):(n=a.last,n!==null?n.sibling=d:t.child=d,a.last=d)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=we(),t.sibling=null,n=ve.current,de(ve,s?n&1|2:n&1),t):(He(t),null);case 22:case 23:return Xo(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?(st&1073741824)!==0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(l(156,t.tag))}function qg(e,t){switch(no(t),t.tag){case 1:return $e(t.type)&&ns(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ar(),pe(Ve),pe(xe),go(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return po(t),null;case 13:if(pe(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));ir()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ve),null;case 4:return ar(),null;case 10:return ao(t.type._context),null;case 22:case 23:return Xo(),null;case 24:return null;default:return null}}var ws=!1,Ue=!1,Jg=typeof WeakSet=="function"?WeakSet:Set,x=null;function cr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Ee(e,t,s)}else n.current=null}function xo(e,t,n){try{n()}catch(s){Ee(e,t,s)}}var xd=!1;function ev(e,t){if($l=bi,e=pc(),Ul(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var o=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var d=0,p=-1,m=-1,C=0,T=0,N=e,k=null;t:for(;;){for(var B;N!==n||o!==0&&N.nodeType!==3||(p=d+o),N!==a||s!==0&&N.nodeType!==3||(m=d+s),N.nodeType===3&&(d+=N.nodeValue.length),(B=N.firstChild)!==null;)k=N,N=B;for(;;){if(N===e)break t;if(k===n&&++C===o&&(p=d),k===a&&++T===s&&(m=d),(B=N.nextSibling)!==null)break;N=k,k=N.parentNode}N=B}n=p===-1||m===-1?null:{start:p,end:m}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xl={focusedElem:e,selectionRange:n},bi=!1,x=t;x!==null;)if(t=x,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,x=e;else for(;x!==null;){t=x;try{var H=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(H!==null){var U=H.memoizedProps,Ce=H.memoizedState,S=t.stateNode,v=S.getSnapshotBeforeUpdate(t.elementType===t.type?U:_t(t.type,U),Ce);S.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(I){Ee(t,t.return,I)}if(e=t.sibling,e!==null){e.return=t.return,x=e;break}x=t.return}return H=xd,xd=!1,H}function ii(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var o=s=s.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,a!==void 0&&xo(t,n,a)}o=o.next}while(o!==s)}}function Cs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Fo(e){var t=e.ref;if(t!==null){var n=e.stateNode;e.tag,e=n,typeof t=="function"?t(e):t.current=e}}function Fd(e){var t=e.alternate;t!==null&&(e.alternate=null,Fd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lt],delete t[$r],delete t[ql],delete t[xg],delete t[Fg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Hd(e){return e.tag===5||e.tag===3||e.tag===4}function Ud(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ho(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=es));else if(s!==4&&(e=e.child,e!==null))for(Ho(e,t,n),e=e.sibling;e!==null;)Ho(e,t,n),e=e.sibling}function Uo(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Uo(e,t,n),e=e.sibling;e!==null;)Uo(e,t,n),e=e.sibling}var De=null,Et=!1;function un(e,t,n){for(n=n.child;n!==null;)Gd(e,t,n),n=n.sibling}function Gd(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(xi,n)}catch{}switch(n.tag){case 5:Ue||cr(n,t);case 6:var s=De,o=Et;De=null,un(e,t,n),De=s,Et=o,De!==null&&(Et?(e=De,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):De.removeChild(n.stateNode));break;case 18:De!==null&&(Et?(e=De,n=n.stateNode,e.nodeType===8?Zl(e.parentNode,n):e.nodeType===1&&Zl(e,n),xr(e)):Zl(De,n.stateNode));break;case 4:s=De,o=Et,De=n.stateNode.containerInfo,Et=!0,un(e,t,n),De=s,Et=o;break;case 0:case 11:case 14:case 15:if(!Ue&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){o=s=s.next;do{var a=o,d=a.destroy;a=a.tag,d!==void 0&&((a&2)!==0||(a&4)!==0)&&xo(n,t,d),o=o.next}while(o!==s)}un(e,t,n);break;case 1:if(!Ue&&(cr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(p){Ee(n,t,p)}un(e,t,n);break;case 21:un(e,t,n);break;case 22:n.mode&1?(Ue=(s=Ue)||n.memoizedState!==null,un(e,t,n),Ue=s):un(e,t,n);break;default:un(e,t,n)}}function zd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Jg),t.forEach(function(s){var o=uv.bind(null,e,s);n.has(s)||(n.add(s),s.then(o,o))})}}function wt(e,t){var n=t.deletions;if(n!==null)for(var s=0;so&&(o=d),s&=~a}if(s=o,s=we()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*nv(s/1960))-s,10e?16:e,dn===null)var s=!1;else{if(e=dn,dn=null,Ls=0,(te&6)!==0)throw Error(l(331));var o=te;for(te|=4,x=e.current;x!==null;){var a=x,d=a.child;if((x.flags&16)!==0){var p=a.deletions;if(p!==null){for(var m=0;mwe()-bo?Pn(e,0):zo|=n),Qe(e,t)}function ef(e,t){t===0&&((e.mode&1)===0?t=1:(t=Hi,Hi<<=1,(Hi&130023424)===0&&(Hi=4194304)));var n=We();e=Gt(e,t),e!==null&&(Pr(e,t,n),Qe(e,n))}function av(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ef(e,n)}function uv(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(l(314))}s!==null&&s.delete(t),ef(e,n)}var tf;tf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ve.current)Xe=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Xe=!1,Qg(e,t,n);Xe=(e.flags&131072)!==0}else Xe=!1,ge&&(t.flags&1048576)!==0&&Dc(t,ls,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Es(e,t),e=t.pendingProps;var o=tr(t,xe.current);or(t,n),o=So(null,t,s,e,o,n);var a=_o();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$e(s)?(a=!0,rs(t)):a=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,fo(t),o.updater=Ss,t.stateNode=o,o._reactInternals=t,To(t,s,e,n),t=Oo(null,t,s,!0,a,n)):(t.tag=0,ge&&a&&to(t),be(null,t,o,n),t=t.child),t;case 16:s=t.elementType;e:{switch(Es(e,t),e=t.pendingProps,o=s._init,s=o(s._payload),t.type=s,o=t.tag=dv(s),e=_t(s,e),o){case 0:t=No(null,t,s,e,n);break e;case 1:t=Rd(null,t,s,e,n);break e;case 11:t=wd(null,t,s,e,n);break e;case 14:t=Cd(null,t,s,_t(s.type,e),n);break e}throw Error(l(306,s,""))}return t;case 0:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_t(s,o),No(e,t,s,o,n);case 1:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_t(s,o),Rd(e,t,s,o,n);case 3:e:{if(Ld(t),e===null)throw Error(l(387));s=t.pendingProps,a=t.memoizedState,o=a.element,Wc(e,t),fs(t,s,null,n);var d=t.memoizedState;if(s=d.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:d.cache,pendingSuspenseBoundaries:d.pendingSuspenseBoundaries,transitions:d.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){o=ur(Error(l(423)),t),t=Nd(e,t,s,n,o);break e}else if(s!==o){o=ur(Error(l(424)),t),t=Nd(e,t,s,n,o);break e}else for(it=nn(t.stateNode.containerInfo.firstChild),rt=t,ge=!0,St=null,n=zc(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ir(),s===o){t=bt(e,t,n);break e}be(e,t,s,n)}t=t.child}return t;case 5:return Vc(t),e===null&&io(t),s=t.type,o=t.pendingProps,a=e!==null?e.memoizedProps:null,d=o.children,Kl(s,o)?d=null:a!==null&&Kl(s,a)&&(t.flags|=32),Td(e,t),be(e,t,d,n),t.child;case 6:return e===null&&io(t),null;case 13:return Od(e,t,n);case 4:return ho(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=sr(t,null,s,n):be(e,t,s,n),t.child;case 11:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_t(s,o),wd(e,t,s,o,n);case 7:return be(e,t,t.pendingProps,n),t.child;case 8:return be(e,t,t.pendingProps.children,n),t.child;case 12:return be(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,o=t.pendingProps,a=t.memoizedProps,d=o.value,de(us,s._currentValue),s._currentValue=d,a!==null)if(yt(a.value,d)){if(a.children===o.children&&!Ve.current){t=bt(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var p=a.dependencies;if(p!==null){d=a.child;for(var m=p.firstContext;m!==null;){if(m.context===s){if(a.tag===1){m=zt(-1,n&-n),m.tag=2;var C=a.updateQueue;if(C!==null){C=C.shared;var T=C.pending;T===null?m.next=m:(m.next=T.next,T.next=m),C.pending=m}}a.lanes|=n,m=a.alternate,m!==null&&(m.lanes|=n),uo(a.return,n,t),p.lanes|=n;break}m=m.next}}else if(a.tag===10)d=a.type===t.type?null:a.child;else if(a.tag===18){if(d=a.return,d===null)throw Error(l(341));d.lanes|=n,p=d.alternate,p!==null&&(p.lanes|=n),uo(d,n,t),d=a.sibling}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===t){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}be(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,s=t.pendingProps.children,or(t,n),o=dt(o),s=s(o),t.flags|=1,be(e,t,s,n),t.child;case 14:return s=t.type,o=_t(s,t.pendingProps),o=_t(s.type,o),Cd(e,t,s,o,n);case 15:return kd(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_t(s,o),Es(e,t),t.tag=1,$e(s)?(e=!0,rs(t)):e=!1,or(t,n),md(t,s,o),To(t,s,o,n),Oo(null,t,s,!0,e,n);case 19:return Id(e,t,n);case 22:return Ad(e,t,n)}throw Error(l(156,t.tag))};function nf(e,t){return Bu(e,t)}function cv(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pt(e,t,n,s){return new cv(e,t,n,s)}function Qo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dv(e){if(typeof e=="function")return Qo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===At)return 11;if(e===Tt)return 14}return 2}function pn(e,t){var n=e.alternate;return n===null?(n=pt(e.tag,t,e.key,e.mode),n.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.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,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=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Is(e,t,n,s,o,a){var d=2;if(s=e,typeof e=="function")Qo(e)&&(d=1);else if(typeof e=="string")d=5;else e:switch(e){case Ye:return Mn(n.children,o,a,t);case at:d=8,o|=8;break;case Kt:return e=pt(12,n,t,o|2),e.elementType=Kt,e.lanes=a,e;case et:return e=pt(13,n,t,o),e.elementType=et,e.lanes=a,e;case gt:return e=pt(19,n,t,o),e.elementType=gt,e.lanes=a,e;case _e:return Ms(n,o,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Bt:d=10;break e;case _n:d=9;break e;case At:d=11;break e;case Tt:d=14;break e;case je:d=16,s=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=pt(d,n,t,o),t.elementType=e,t.type=s,t.lanes=a,t}function Mn(e,t,n,s){return e=pt(7,e,s,t),e.lanes=n,e}function Ms(e,t,n,s){return e=pt(22,e,s,t),e.elementType=_e,e.lanes=n,e.stateNode={isHidden:!1},e}function Zo(e,t,n){return e=pt(6,e,null,t),e.lanes=n,e}function qo(e,t,n){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fv(e,t,n,s,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kl(0),this.expirationTimes=kl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kl(0),this.identifierPrefix=s,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Jo(e,t,n,s,o,a,d,p,m){return e=new fv(e,t,n,p,m),t===1?(t=1,a===!0&&(t|=8)):t=0,a=pt(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fo(a),e}function hv(e,t,n){var s=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(i){console.error(i)}}return r(),sa.exports=Tv(),sa.exports}var yf;function Lv(){if(yf)return Gs;yf=1;var r=Rv();return Gs.createRoot=r.createRoot,Gs.hydrateRoot=r.hydrateRoot,Gs}var Nv=Lv();const Ia=new Set;function Fh(){return typeof window<"u"?window.location.pathname:"/"}let yi=Fh();function Ov(){for(const r of Ia)r()}function Ma(r){r!==yi&&(yi=r,Ov())}const Dt={getPath(){return yi},navigate(r){r!==yi&&(typeof window<"u"&&window.history.pushState(null,"",r),Ma(r))},replace(r){r!==yi&&(typeof window<"u"&&window.history.replaceState(null,"",r),Ma(r))},subscribe(r){return Ia.add(r),()=>Ia.delete(r)}};typeof window<"u"&&window.addEventListener("popstate",()=>Ma(Fh()));const Pv="https://hb.vntsm.com/v4/live/vms/sites/flappybird.io/index.js";function Je(r){self.__VM=self.__VM??[],self.__VM.push(r)}let Sf=!1;function Iv(){if(Sf)return;Sf=!0,Je((i,l)=>{Dt.subscribe(()=>l.Instances.pageManager.newPageSession(!1))});const r=document.createElement("script");r.src=Pv,r.async=!0,document.head.appendChild(r)}function Mv(r){typeof reportError=="function"?reportError(r):console.error(r)}function Me(r,i){let l=r;const u=new Set;return{publish(c){if(!i?.(l,c)){l=c;for(const f of u)try{f()}catch(h){Mv(h)}}},getSnapshot(){return l},subscribe(c){return u.add(c),()=>u.delete(c)}}}function Dv(r,i){return r.state===i.state&&r.score===i.score&&r.bestScore===i.bestScore}const Mt=Me({state:"getready",score:0,bestScore:0},Dv);function Bv(r){const i=()=>setTimeout(r,0);document.readyState==="complete"?i():window.addEventListener("load",i,{once:!0})}function xv(r){if(Mt.getSnapshot().state!=="play"){r();return}const i=Mt.subscribe(()=>{Mt.getSnapshot().state!=="play"&&(i(),r())})}function sl(r,i=Bv){i(()=>xv(r))}const Fv=100,Hv="https://us.i.posthog.com",Uv="2026-05-30",Gv={send_event:!1},zv=.1;function bv(){return{key:"phc_xDYYpKX7f6o9PdyXEpNZ44m6vY3DLVcGbQ4A2BWtBcHn",host:Hv}}async function Wv(){const{default:r}=await lt(async()=>{const{default:i}=await import("./module-qVKKXjGp.js");return{default:i}},[]);return r}function Yv(r,i=Wv,l=sl,u=Math.random){let c=null,f=!1,h=[],g=null;const _=[];let w=null;const O=R=>{R.init(r.key,{api_host:r.host,defaults:Uv,autocapture:!1,capture_pageview:!1,disable_session_recording:!0,capture_performance:{web_vitals:u(){const L=z=>R.isFeatureEnabled?.(z,Gv)===!0;w=L;for(const z of _)z(L)}),g!==null&&(c.identify(g),g=null);for(const[L,z]of h)c.capture(L,z);h=[]};return{init(){!r.key||f||(f=!0,l(()=>{i().then(O)}))},track(R,L){r.key&&(c?c.capture(R,L):h.lengthMath.trunc(Ne(r)/2)),Ba=4;function aa(r){return r<3?Xv:Kv}function n0(r){return r<3?null:r<4?Qv:Zv}const r0=Ne(Se.pipeSpacing),zh=Ne(Se.pipeMinY),i0=Ne(Se.pipeMaxY),s0=i0-zh,l0=26*qv,Cf=Math.trunc(l0/2),kf=Ci*Ci;function o0(r,i){return r<2?Ef:i{const L=gi.getSnapshot();if(h.state!=="play"&&L.state==="play")for(const z of l)z(L);if(h.state==="play"&&L.state==="gameover"){const z={progress:L,endedAtMs:i(),abandonEmitted:g===L.seed};g=null;for(const Q of u)Q(z)}h=L},w=()=>{if(r===null||r.visibilityState!=="hidden")return;const L=gi.getSnapshot();if(L.state==="play"&&L.seed!==g){g=L.seed;const z={progress:L,atMs:i()};for(const Q of c)Q(z)}for(const z of f)z()},O=gi.subscribe(_);r?.addEventListener("visibilitychange",w);function R(L){return z=>(L.add(z),()=>L.delete(z))}return{onRunStarted:R(l),onRunEnded:R(u),onRunAbandoned:R(c),onPageHidden:R(f),stop(){O(),r?.removeEventListener("visibilitychange",w)}}}const Li=a0(typeof document>"u"?null:document),Hn=Me("offered",(r,i)=>r===i);function eu(r){return r==="loading"||r==="playing"}const u0=3e4,c0=.1;function d0(r){const i=new Map,l=()=>{if(!r.visible()||r.inputHeld())return;const c=r.now();for(const[f,h]of i){const g=c-h.lastRefreshAt;g{const h=Hh(r.random,c0);h&&r.product.track("ad_refresh_requested",{placement:c,reason:"gameover",since_last_ms:Math.round(f),...Da(h)})};return{register(c,f){const h={refresh:f,lastRefreshAt:r.now()};return i.set(c,h),()=>{i.get(c)===h&&i.delete(c)}},start(){return r.events.onRunEnded(l)}}}const tu=d0({events:Li,now:()=>performance.now(),visible:()=>document.visibilityState==="visible",inputHeld:()=>eu(Hn.getSnapshot()),random:Math.random,product:mt}),bh="(max-width: 1024px)";function f0(){return window.matchMedia(bh).matches}function ll(){const[r,i]=fe.useState(f0);return fe.useEffect(()=>{const l=window.matchMedia(bh),u=()=>i(l.matches);return u(),l.addEventListener("change",u),()=>l.removeEventListener("change",u)},[]),r}function qe(r){return fe.useSyncExternalStore(r.subscribe,r.getSnapshot)}function Wh(r,i){return fe.useSyncExternalStore(r.subscribe,()=>i(r.getSnapshot()))}function h0(){return!1}function Yh(){return!1}function p0(){return!1}function m0(){return!1}const Xt=Me({resolved:!1,challengeLinks:h0(),ads:Yh(),instream:p0(),stickyDuringPlay:m0()}),g0=["horizontal_sticky","mobile_horizontal_sticky"];function v0(){Je((r,i)=>{const l=i.Config.verticalSticky();l.activate(),l.display()})}function y0(){Je((r,i)=>i.Config.verticalSticky().reload())}function nu({placementName:r,alias:i,minHeight:l=0}){const u=fe.useRef(null),c=Wh(Mt,w=>w.state==="play"),{ads:f,stickyDuringPlay:h}=qe(Xt),g=ll(),_=fe.useRef(!1);return fe.useEffect(()=>{!f||r!=="vertical_sticky"||!c||h||(_.current=!0,Je((w,O)=>O.Config.verticalSticky().deactivate()))},[f,r,c,h]),fe.useEffect(()=>{if(!(r!=="vertical_sticky"||!f||g))return tu.register("vertical_sticky",()=>{if(!_.current)return y0();_.current=!1,v0()})},[r,f,g]),fe.useEffect(()=>{if(!f)return;let w;return Je((O,R)=>{if(r==="vertical_sticky"){R.Config.verticalSticky().display();return}if(g0.includes(r)){w=R.Config.get(r).displayBody();return}const L=u.current;if(!L)return;w=(i?R.Config.get(r,i):R.Config.get(r)).display(L)}),()=>{Je((O,R)=>{if(r==="vertical_sticky"){R.Config.verticalSticky().destroy();return}w&&O.removePlacement(w.instance())})}},[f,r,i]),f?P.jsx("div",{ref:u,style:l?{minHeight:l}:void 0}):null}function S0({active:r,takeover:i,children:l}){const u=fe.useRef(null),f=ll()?"mobile_takeover":"desktop_takeover";return fe.useEffect(()=>{if(!i)return;let h;return Je((g,_)=>{const w=u.current;w&&(h=_.Config.get(f).display(w))}),()=>{Je(g=>{h&&g.removePlacement(h.instance())})}},[i,f]),P.jsxs("div",{className:"content-layout","data-active":r||void 0,children:[P.jsx("div",{id:"takeover",ref:u}),P.jsx("div",{id:"content-container",children:l})]})}const Af="mobile_banner",_0="mobileBanner",Tf="data-mobile-banner";function E0({content:r}){const i=ll(),l=qe(Xt).ads,u=Wh(Mt,g=>g.state==="play"),c=fe.useRef(null),f=i&&l,h=!r&&u;return fe.useEffect(()=>{if(!f)return;document.documentElement.setAttribute(Tf,"");let g;Je((w,O)=>{const R=c.current;R&&(g=O.Config.get(Af).display(R),g.setKnown(_0))});const _=tu.register(Af,()=>Je(w=>{g&&w.reload(g.instance())}));return()=>{_(),document.documentElement.removeAttribute(Tf),Je(w=>{g&&w.removePlacement(g.instance())})}},[f]),f?P.jsx("div",{className:"mobile-banner","data-hidden":h||void 0,ref:c}):null}function w0(r,i){return!(r.defaultPrevented||r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||i&&i!=="_self")}function Rf({to:r,onClick:i,...l}){const u=c=>{i?.(c),w0(c,l.target)&&(c.preventDefault(),Dt.navigate(r))};return P.jsx("a",{href:r,...l,onClick:u})}function jh(){return fe.useSyncExternalStore(Dt.subscribe,Dt.getPath)}const Vh="flappy_muted";function C0(){return typeof localStorage>"u"?!1:localStorage.getItem(Vh)==="true"}function k0(r){typeof localStorage>"u"||localStorage.setItem(Vh,String(r))}const zs=Me(C0()),ki={getSnapshot:zs.getSnapshot,subscribe:zs.subscribe,toggleMuted(){const r=!zs.getSnapshot();k0(r),zs.publish(r)}},A0=[{to:"/",label:"Game"},{to:"/leaderboard",label:"Leaderboard"},{to:"/about",label:"About"}];function T0(){const r=jh(),[i,l]=fe.useState(!1),u=qe(ki),c=()=>l(!1);return P.jsxs("nav",{className:"navbar",children:[P.jsx(Rf,{className:"navbar__logo",to:"/",onClick:c,children:P.jsx("img",{src:"/sprites/logo-nav.webp",alt:"Flappy Bird"})}),P.jsxs("button",{className:"navbar__toggle","aria-label":"Toggle menu","aria-expanded":i,onClick:()=>l(f=>!f),children:[P.jsx("span",{}),P.jsx("span",{}),P.jsx("span",{})]}),P.jsx("button",{className:"navbar__mute","aria-label":u?"Unmute":"Mute","aria-pressed":u,onClick:()=>ki.toggleMuted(),children:u?"🔇":"🔊"}),P.jsxs("div",{className:"navbar__collapse","data-open":i,children:[P.jsx("div",{className:"navbar__group",children:A0.map(f=>P.jsx(Rf,{className:"navbar__link",to:f.to,"data-active":r===f.to,onClick:c,children:f.label},f.to))}),P.jsx("a",{className:"navbar__link",href:"/how-to-play",onClick:c,children:"How to Play"}),P.jsx("a",{className:"navbar__link navbar__link--right",href:"/privacy.html",target:"_blank",rel:"noopener noreferrer",onClick:c,children:"Privacy Policy"}),P.jsx("a",{className:"navbar__link",href:"/terms.html",target:"_blank",rel:"noopener noreferrer",onClick:c,children:"Terms"})]})]})}const Lf=Se.displacement,$h=(r,i,l,u)=>({worldW:r*Lf,worldH:i*Lf,anchor:{x:l,y:u}}),ae=(r,i,l,u=.5,c=.5)=>({source:{kind:"atlas",frame:r},...$h(i,l,u,c)}),ci=(r,i,l,u=.5,c=.5)=>({source:{kind:"image",src:r},...$h(i,l,u,c)}),ue={background:ae("bg",144,256,.5,.5),cityline:ae("cityline",144,110,.5,0),ground:ae("ground",144,53,.5,1),pipeUp:ae("pipe_new",26,160,.5,1),pipeDown:ae("pipe_new",26,160,.5,1),bird0:ae("bird-0",17,11.6,.5,.5),bird1:ae("bird-1",17,11.6,.5,.5),bird2:ae("bird-2",17,17.9,.5,.5),logo:ci("/sprites/logo.webp",120,14.4,.5,.5),buttonGreen:ae("button-green",62,20,.5,.5),buttonBlue:ae("button-blue",62,20,.5,.5),buttonYellow:ae("button-yellow",62,20,.5,.5),buttonGray:ae("button-gray",62,20,.5,.5),tapHint:ae("tap-hint",45,25.2,.5,.5),chaseBtn:ci("/sprites/chase-btn.png",11.3,11.3,.5,.5),closeBtn:ci("/sprites/close-btn.png",11,11,.5,.5),soundOn:ci("/sprites/sound-on.png",14,12,.5,.5),soundOff:ci("/sprites/sound-off.png",14,12,.5,.5),scoreboard:ae("scoreboard",113,57.7,.5,.5),gameOver:ae("game-over",100,18.3,.5,.5),newBadge:ae("new-badge",18,8,.5,.5),panelOutside:ae("panel-outside",110,128.9,.5,.5),panelInside:ae("panel-inside",99.3,62.6,.5,.5),leaderboardRibbon:ae("leaderboard-ribbon",92,25.6,.5,.5),tabActive:ae("tab-active",36,13.3,.5,.5),tabInactive:ae("tab-inactive",36,13.3,.5,.5),rankCircle:ae("rank-circle",13.4,13.4,.5,.5),scoreSlot:ae("score-slot",39.7,11.3,.5,.5),youSlot:ae("you-slot",110,22,.5,.5),medalEmpty:ae("medal-empty",22,22,.5,.5),medalBronze:ae("medal-bronze",22,22,.5,.5),medalSilver:ae("medal-silver",22,22,.5,.5),medalGold:ae("medal-gold",22,22,.5,.5),medalPlatinum:ae("medal-platinum",22,22,.5,.5)},ru=["bird0","bird1","bird2"],Nf="/assets/atlas-D7zSkRSP.webp",R0={bg:{x:4,y:4,w:1440,h:2560},"bird-0":{x:3624,y:1112,w:220,h:150},"bird-1":{x:3852,y:1112,w:220,h:150},"bird-2":{x:3865,y:1310,w:220,h:232},"button-blue":{x:2568,y:1112,w:520,h:168},"button-gray":{x:3096,y:1112,w:520,h:168},"button-green":{x:3120,y:1856,w:520,h:168},"button-yellow":{x:3233,y:2342,w:520,h:168},"chase-btn":{x:2242,y:2056,w:232,h:232},cityline:{x:2568,y:4,w:1440,h:1100},"close-btn":{x:3120,y:1310,w:272,h:272},"game-over":{x:2136,y:2342,w:1089,h:199},ground:{x:1012,y:2572,w:1440,h:530},"leaderboard-ribbon":{x:3120,y:1590,w:927,h:258},"medal-bronze":{x:3616,y:2056,w:220,h:220},"medal-empty":{x:3844,y:2056,w:220,h:220},"medal-gold":{x:1452,y:2342,w:220,h:220},"medal-platinum":{x:1680,y:2342,w:220,h:220},"medal-silver":{x:1908,y:2342,w:220,h:220},"new-badge":{x:3262,y:2572,w:206,h:92},"panel-inside":{x:4,y:2572,w:1e3,h:630},"panel-outside":{x:1452,y:4,w:1108,h:1298},pipe_new:{x:1452,y:1310,w:206,h:1024},"rank-circle":{x:3761,y:2342,w:137,h:137},"score-slot":{x:2848,y:2572,w:406,h:116},scoreboard:{x:1666,y:1310,w:1446,h:738},"sound-off":{x:1666,y:2056,w:280,h:240},"sound-on":{x:1954,y:2056,w:280,h:240},"tab-active":{x:3648,y:1856,w:380,h:140},"tab-inactive":{x:2460,y:2572,w:380,h:140},"tap-hint":{x:3400,y:1310,w:457,h:256},"you-slot":{x:2482,y:2056,w:1126,h:225}},Of=r=>new Promise((i,l)=>{const u=new Image;u.onload=()=>i(u),u.onerror=()=>l(new Error(`Failed to load ${r}`)),u.src=r}),ua=async r=>{if(typeof createImageBitmap!="function")return Of(r);try{const i=await(await fetch(r)).blob();return await createImageBitmap(i)}catch{return Of(r)}},Pf=r=>({image:r,sx:0,sy:0,sw:"naturalWidth"in r&&r.naturalWidth||r.width,sh:"naturalHeight"in r&&r.naturalHeight||r.height}),If=.1,Mf=.002;class L0{images=new Map;themeOverrides=new Map;tintCache=new Map;themeToken=0;loaded=!1;async loadAll(){const l=new FontFace("Jersey10","url(/fonts/Jersey10-Regular.woff2)").load().then(h=>{document.fonts.add(h)}).catch(h=>{console.warn("Failed to load Jersey10 font, falling back to sans-serif",h)}),u=Object.entries(ue),c=ua(Nf).then(h=>{for(const[g,_]of u){if(_.source.kind!=="atlas")continue;const w=R0[_.source.frame];this.images.set(g,{image:h,sx:w.x,sy:w.y,sw:w.w,sh:w.h})}}).catch(()=>{console.error(`Failed to load sprite atlas: ${Nf}`)}),f=u.filter(([,h])=>h.source.kind==="image").map(([h,g])=>ua(g.source.src).then(_=>{this.images.set(h,Pf(_))}).catch(()=>{console.error(`Failed to load sprite: ${h}`)}));await Promise.all([c,...f,l]),this.loaded=!0}isLoaded(){return this.loaded}async applyTheme(i,l=ua){const u=++this.themeToken,c=Object.entries(i),f=await Promise.all(c.map(async([h,g])=>{try{const _=await l(g);return{name:h,img:_}}catch{return console.error(`Failed to load theme override: ${g}`),null}}));if(this.themeToken===u){this.themeOverrides.clear();for(const h of f)h&&this.themeOverrides.set(h.name,h.img)}}clearTheme(){this.themeToken++,this.themeOverrides.clear()}drawSprite(i,l,u,c,f={}){if(!this.loaded)return;const h=this.resolveRegion(l);if(!h)return;const g=ue[l],{rot:_=0,scale:w=1,flipX:O=!1,flipY:R=!1,tint:L}=f,{image:z,sx:Q,sy:X,sw:b,sh:ee}=L?this.getTinted(l,h,L):h;i.save(),i.translate(u,c),i.rotate(_);const M=w*(O?-1:1),J=-w*(R?-1:1);i.scale(M,J);const se=-g.worldW*g.anchor.x,Ae=-g.worldH*(1-g.anchor.y);i.drawImage(z,Q,X,b,ee,se,Ae,g.worldW,g.worldH),i.restore()}drawStretchedSprite(i,l,u,c,f){if(!this.loaded)return;const h=this.resolveRegion(l);if(!h)return;const g=ue[l],{scale:_=1,tint:w}=f,{image:O,sx:R,sy:L,sw:z,sh:Q}=w?this.getTinted(l,h,w):h,X=z*If,b=g.worldW*If*_,ee=Math.max(f.width,b*2),M=g.worldH*_,J=-ee*g.anchor.x,se=-M*(1-g.anchor.y),Ae=ee-b*2;i.save(),i.translate(u,c),i.scale(1,-1),i.drawImage(O,R,L,X,Q,J,se,b,M),i.drawImage(O,R+X,L,z-X*2,Q,J+b-Mf,se,Ae+Mf*2,M),i.drawImage(O,R+z-X,L,X,Q,J+ee-b,se,b,M),i.restore()}fillPipeShaft(i,l,u,c,f){if(!this.loaded||f<=c)return;const h=this.resolveRegion(l);if(!h)return;const g=ue[l];i.drawImage(h.image,h.sx,h.sy+h.sh-1,h.sw,1,u-g.worldW*g.anchor.x,c,g.worldW,f-c)}resolveRegion(i){const l=this.themeOverrides.get(i);return l?Pf(l):this.images.get(i)}getTinted(i,l,u){const c=`${i}:${u}`,f=this.tintCache.get(c);if(f)return f;const h=document.createElement("canvas");h.width=l.sw,h.height=l.sh;const g=h.getContext("2d");if(!g)return l;g.drawImage(l.image,l.sx,l.sy,l.sw,l.sh,0,0,l.sw,l.sh),g.globalCompositeOperation="multiply",g.fillStyle=u,g.fillRect(0,0,l.sw,l.sh),g.globalCompositeOperation="destination-in",g.drawImage(l.image,l.sx,l.sy,l.sw,l.sh,0,0,l.sw,l.sh);const _={image:h,sx:0,sy:0,sw:l.sw,sh:l.sh};return this.tintCache.set(c,_),_}}const N0=Se.startX-ue.pipeUp.worldW/2,O0=.02,P0=.33;function Xh(r){return Math.min(Math.max(N0-r/2-O0,0),P0)}const I0=.25,M0="#d8a96b",D0=.21,B0=.5,Df=1.15,x0=.15,F0=.01;function H0(r,i,l,u,c){G0(r,i,u,c);const f=Xh(u);r.save(),r.translate(-f,0),z0(r,i,l.scrollX,u),b0(r,i,l.pipes,c),W0(r,i,l.scrollX,u),l.ghost&&U0(r,i,l.ghost),i.drawSprite(r,ru[l.birdFrame],0,l.birdY,{rot:l.birdRot}),r.restore()}function U0(r,i,l){r.save(),r.globalAlpha=I0,i.drawSprite(r,ru[l.frame],l.x,l.y,{rot:l.rot}),r.restore()}function G0(r,i,l,u){const c=Math.max(l/ue.background.worldW,u/ue.background.worldH);i.drawSprite(r,"background",0,0,{scale:c})}function z0(r,i,l,u){const c=ue.cityline.worldW*Df,f=c-F0,h=l*B0%f,g=-u/2-h+c/2,_=Math.ceil(u/f)+2,w=Se.lowestHeight-x0;for(let O=0;O<_;O++)i.drawSprite(r,"cityline",g+O*f,w,{scale:Df})}function b0(r,i,l,u){const c=ue.pipeUp.worldH,f=u/2,h=-u/2;for(const g of l){const _=g.gapY-g.halfGap,w=g.gapY+g.halfGap;i.fillPipeShaft(r,"pipeUp",g.x,h,_-c),i.drawSprite(r,"pipeUp",g.x,_),i.fillPipeShaft(r,"pipeDown",g.x,w+c,f),i.drawSprite(r,"pipeDown",g.x,w,{flipY:!0})}}function W0(r,i,l,u){const c=ue.ground.worldW,f=l%c,h=Se.lowestHeight+D0,g=-u/2-f,_=Math.ceil(u/c)+2;r.fillStyle=M0,r.fillRect(-10,Se.lowestHeight,20,-10);for(let w=0;w<_;w++)i.drawSprite(r,"ground",g+w*c,h)}const iu=100;function Kh(r){return r===1?"gold":r===2?"silver":r===3?"bronze":"plain"}function Qh(r,i,l,u,c,f){const h=u==="daily"?r.daily:r.allTime,g=h.top.slice(0,iu).map((w,O)=>({rank:O+1,tier:Kh(O+1),identity:w.identity,name:w.name,score:w.highScore})),_=i===null?null:{rank:h.myRank?.rank??null,rankPending:h.myRank===null&&f,name:i,score:h.myRank?.highScore??l};return{top:g,you:_,mode:u,dailyResetCountdown:u==="daily"?c:null}}function Y0(r,i){return{allTime:{...r.allTime,myRank:i.allTime.myRank??r.allTime.myRank},daily:{...r.daily,myRank:i.daily.myRank??r.daily.myRank}}}const su="Jersey10, sans-serif",Un=100;function bn(r,i,l){if(l(r)<=i)return r;let u=r;for(;u.length>1&&l(`${u}…`)>i;)u=u.slice(0,-1);return`${u}…`}function ot(r,i,l){r.save(),r.font=`${Un}px ${su}`;const u=r.measureText(i).width;return r.restore(),u*(l/Un)}function Ai(r,i,l){r.save(),r.font=`${Un}px ${su}`,r.textAlign="center";const u=r.measureText(i);return r.restore(),(u.actualBoundingBoxRight-u.actualBoundingBoxLeft)/2*(l/Un)}function $(r,i,l,u,c,f,h){const g=c/Un;r.save(),r.translate(l,u),r.scale(g,-g),r.font=`${Un}px ${su}`,r.textAlign=f,r.textBaseline="middle",h?(r.fillStyle=h,r.fillText(i,0,0)):(r.strokeStyle="black",r.lineWidth=Un*.15,r.lineJoin="round",r.strokeText(i,0,0),r.fillStyle="white",r.fillText(i,0,0)),r.restore()}const $t=.52,Ge=.2,j0={green:"buttonGreen",blue:"buttonBlue",yellow:"buttonYellow",gray:"buttonGray"},ca=.12,V0=.08;function Ti(r,i,l,u,c,f=$t){const h=j0[l];i.drawStretchedSprite(r,h,u,c,{width:f,scale:Ge/ue[h].worldH})}function $0(r,i,l=$t){const u=l-V0,c=ot(r,i,ca);return c<=u?ca:ca*u/c}function mr(r,i,l,u,c,f,h=$t){Ti(r,i,l,c,f,h);const g=$0(r,u,h);$(r,u,c-Ai(r,u,g),f,g,"center")}const Ni=2,Gn=5,X0=1.7,K0=.1,Zh=-.62/2,xa=($t+K0)/2,Q0=.32;function Sr(r){return r-Q0}const qh=-.61,Z0=.09,Bf=.06,xf=ue.panelOutside.worldW,Jh=ue.panelOutside.worldH,ep=ue.gameOver.worldH,Ff=.1,q0=.075,J0=-.76,da=.15,ey=.04,ty=.07,Hf=.08,ny=.05,ry=.8,iy=.03;function sy(r){return r0}get maxOffset(){return this.max}scrollBy(i){this.offset=fa(this.offset+i,this.max)}beginDrag(i){this.dragging=!0,this.startPointerY=i,this.startOffset=this.offset}moveDrag(i){this.dragging&&(this.offset=fa(this.startOffset+(i-this.startPointerY),this.max))}endDrag(){this.dragging=!1}reset(){this.offset=0,this.dragging=!1}}class vy{page=0;dragX=0;dragging=!1;startX=0;startY=0;exceededSlop=!1;beginDrag(i,l){this.dragging=!0,this.startX=i,this.startY=l,this.dragX=0,this.exceededSlop=!1}moveDrag(i,l){this.dragging&&(this.dragX=i-this.startX,(Math.abs(i-this.startX)>Zs||Math.abs(l-this.startY)>Zs)&&(this.exceededSlop=!0))}endDrag(i,l){if(!this.dragging)return!1;this.moveDrag(i,l),this.dragging=!1;const u=!this.exceededSlop;return u||(this.dragX<=-Gf?this.setPage(this.page+1):this.dragX>=Gf&&this.setPage(this.page-1)),this.dragX=0,u}cancelDrag(){this.dragging=!1,this.dragX=0}setPage(i){this.page=Math.max(0,Math.min(Ni-1,i))}reset(){this.cancelDrag(),this.page=0}}function dp(r){return r.challengeBack?"challengeBack":r.challengeAgain?"challengeAgain":null}function vr(r,i,l,u,c,f){return r>=l-c/2&&r<=l+c/2&&i>=u-f/2&&i<=u+f/2}function yy(r,i){return vr(r,i,sp,_i,Qs,Uf)?"daily":vr(r,i,lp,_i,Qs,Uf)?"allTime":null}function fp(r,i,l,u={page:0,dragX:0}){const c=l.narrow?Ri-ou(u.page,u.dragX):l.panelOffsetX,f=(r-c)/l.panelScale,h=(i-l.panelY)/l.panelScale;return Math.abs(f)<=ue.panelOutside.worldW/2&&h<=_r&&h>=Er}function Sy(r,i,l){if(Math.abs(i-gr)<=$s/2||Math.abs(r-rp)>$s/2)return null;const u=Math.round((np+l-i)/Cr);if(u<0)return null;const c=ol(u)+l;return Math.abs(i-c)>$s/2||c>_r||c=c&&r<=c+Ty&&i<=f&&i>=f-Ry}function Oy(r,i,l,u){const c=-l/2,f=u/2-pp;return r>=c&&r<=c+Ly&&i<=f+bf/2&&i>=f-bf/2}function Py(r){return Math.sin(r*Cy)*wy}const Iy=.45,mp=.47,My=.04,Dy=ue.bird0.worldW/ue.bird0.worldH,By=1.2,Wf=.035,Yf=2,xy=.7,Fy=.09,Hy=.18,jf=.7,Uy=.35;function Gy(r,i,l,u){if(l===null||l>Yf)return;const c=Math.min(1,l/Hy),f=jf+(1-jf)*c*(2-c),h=Math.min(1,(Yf-l)/Uy);r.save(),r.globalAlpha*=h,r.translate(0,xy),r.scale(f,f),gp(r,i,u,0,Fy),r.restore()}function zy(r,i,l,u,c){r.save(),r.globalAlpha*=Iy,i.drawSprite(r,"bird0",l,u,{scale:c/ue.bird0.worldH}),r.restore()}function gp(r,i,l,u,c){const f=c*By,h=f*Dy,g=-(h+Wf+ot(r,l,c))/2;zy(r,i,g+h/2,u,f),$(r,l,g+h+Wf,u,c,"left")}function by(r,i,l,u,c){Ti(r,i,c,0,u,wr);const f=Wy(r,l);$(r,l,-Ai(r,l,f),u,f,"center")}function vp(){return wr-My*2}function Wy(r,i){return Math.min(Ge*mp,vp()/ot(r,i,1))}const Yy="CHASE DAILY TOP",ha="CHASING ",jy="YOUR BEST";function Vy(r,i,l){const u=` · ${i.score} ✓`;if(l!==null&&i.name===l)return`${ha}${jy}${u}`;const c=Ge*mp,f=vp()-ot(r,`${ha}${u}`,c),h=bn(i.name,f,g=>ot(r,g,c));return`${ha}${h}${u}`}function $y(r,i,l,u){if(!l.available)return;const c=l.armed?Vy(r,l.available,u):Yy;by(r,i,c,gn,l.armed?"green":"gray")}const xn=1.07,yr=.83,Xy="#f8eed7",yp="#26180d",Ky=.014,Qy="rgba(0, 0, 0, 0.55)",Zy=.286,qy=.183,pa=.082,Vf=xn-.12,$f=-.018,Jy=.406,eS=.075,qs=-.255,tS="CHALLENGE",Xf=.058,nS="NO GHOST RUN FOR THIS SCORE YET",rS="COULD NOT LOAD THIS GHOST — TRY AGAIN",Sp=.038,_p=xn/2-Sp,Ep=yr/2-Sp,Kf=.18,iS=.055,sS=.018,lS=Math.PI*1.5,oS=1;function ma(r,i,l,u,c,f){return r>=l-c/2&&r<=l+c/2&&i>=u-f/2&&i<=u+f/2}function aS(r,i,l){const u=r,c=i;return ma(u,c,_p,Ep,Kf,Kf)?"close":l==="ready"&&ma(u,c,0,qs,$t,Ge)?"confirm":ma(u,c,0,0,xn,yr)?null:"close"}function uS(r,i,l,u,c,f){r.save(),r.fillStyle=Qy,r.fillRect(-l/2,-u/2,l,u),r.fillStyle=Xy,r.fillRect(-xn/2,-yr/2,xn,yr),r.strokeStyle=yp,r.lineWidth=Ky,r.strokeRect(-xn/2,-yr/2,xn,yr);const h=`CHALLENGING ${c.name}'S`,g=bn(h,Vf,_=>ot(r,_,pa));if($(r,g,0,Zy,pa,"center"),$(r,"HIGH SCORE",0,qy,pa,"center"),i.drawStretchedSprite(r,"scoreSlot",0,$f,{width:Jy}),$(r,c.score.toString(),0,$f,eS,"center"),c.status==="ready")mr(r,i,"green",tS,0,qs);else if(c.status==="loading")cS(r,f);else{const _=c.status==="missing"?nS:rS,w=bn(_,Vf,O=>ot(r,O,Xf));$(r,w,0,qs,Xf,"center")}i.drawSprite(r,"closeBtn",_p,Ep),r.restore()}function cS(r,i){const l=i*oS*Math.PI*2;r.save(),r.strokeStyle=yp,r.lineWidth=sS,r.lineCap="round",r.beginPath(),r.arc(0,qs,iS,l,l+lS),r.stroke(),r.restore()}const dS="BEAT THE GHOST",fS="GHOST SURVIVED YOU",hS=.07,Qf="PLAY",pS="SHARE",mS="REVIVE",gS={challengeAgain:"CHALLENGE AGAIN",challengeBack:"CHALLENGE THEM BACK"},vS="rgba(0, 0, 0, 0.6)",yS=.2,SS=.08,_S=.025,ES="white",wS="rgba(0, 0, 0, 0.35)",wp="#b3835d",ga=.075,CS=.27,pr=.25,kS=Ks-$s/2,Zf=.4,qf=.2,AS=.21,TS=.245,RS=.17,LS=.08,NS=-.17,OS=.09,PS=.18,Jf=-.33,IS=.475,eh=.062,MS="#43290f",DS=.066,Js=-.41,Cp=-.315,BS=.36,Ua="-",xS="...",FS=.25,HS="#1d4f9e",US=-.05,GS=.12,zS=.35,bS=(_r+Er)/2,WS=.07,YS=.02,jS=Math.PI*1.5,VS=1,$S={gold:"#f6c12f",silver:"#d6d6d6",bronze:"#ef8a33",plain:"#e0b68f"},XS={bronze:"medalBronze",silver:"medalSilver",gold:"medalGold",platinum:"medalPlatinum"};function KS(r,i,l,u,c,f,h){const g=lu(u,f);r.save();const _=py(l.stateElapsed);_<1&&(r.globalAlpha=_),r.fillStyle=vS,r.fillRect(-u/2,-c/2,u,c),i.drawSprite(r,"gameOver",0,g.titleY),g.narrow?(qS(r,i,l,h,g),c_(r,h.carousel.page,g.pageDotsY)):JS(r,i,l,h,g);const w=my(l.stateElapsed);w>0&&(r.save(),w<1&&(r.globalAlpha=w),QS(r,i,l,h,g.buttonY),r.restore()),h.toast&&$(r,h.toast,0,g.buttonY-yS,SS,"center"),h.boardModal&&uS(r,i,u,c,h.boardModal,l.stateElapsed),r.restore()}function QS(r,i,l,u,c){mr(r,i,"blue",pS,Zh,c);const f=dp(u.buttons);if(f===null){mr(r,i,"green",Qf,xa,c),u.buttons.revive?mr(r,i,"yellow",mS,0,Sr(c)):ZS(r,i,l,Sr(c));return}mr(r,i,"yellow",gS[f],xa,c),mr(r,i,"green",Qf,0,Sr(c))}function ZS(r,i,l,u){if(!l.chaseOutcome)return;const c=l.chaseOutcome==="beat"?dS:fS;gp(r,i,c,u,hS)}function qS(r,i,l,u,c){const f=ou(u.carousel.page,u.carousel.dragX);el(r,-f,c,()=>kp(r,i,l)),el(r,Ri-f,c,()=>Ap(r,i,u,l.stateElapsed))}function JS(r,i,l,u,c){el(r,-c.panelOffsetX,c,()=>kp(r,i,l)),el(r,c.panelOffsetX,c,()=>Ap(r,i,u,l.stateElapsed))}function el(r,i,l,u){r.save(),r.translate(i,l.panelY),r.scale(l.panelScale,l.panelScale),u(),r.restore()}function kp(r,i,l){i.drawSprite(r,"panelOutside",0,0),i.drawSprite(r,"panelInside",0,CS),$(r,l.score.toString(),-pr,Zf,qf,"center"),$(r,"SCORE",-pr,AS,ga,"center"),$(r,l.bestScore.toString(),pr,Zf,qf,"center"),$(r,"HIGH",pr,TS,ga,"center"),$(r,"SCORE",pr,RS,ga,"center"),l.isNewBest&&i.drawSprite(r,"newBadge",pr,LS),$(r,"MEDAL",NS,Jf,OS,"center");const u=l.medal?XS[l.medal]:"medalEmpty";i.drawSprite(r,u,PS,Jf)}function Ap(r,i,l,u){const{leaderboard:c,leaderboardScrollOffset:f}=l;if(i.drawSprite(r,"panelOutside",0,0),i.drawSprite(r,"leaderboardRibbon",0,IS),!c){$(r,"OFFLINE",0,US,GS,"center",wp);return}o_(r,i,c.mode),c.dailyResetCountdown&&$(r,`RESETS IN ${c.dailyResetCountdown}`,0,uy,DS,"center"),r.save(),l.leaderboardRefreshing&&(r.globalAlpha*=zS),s_(r,i,c.top,f,l.rowChase),l_(r,f,c.top.length),c.you&&u_(r,i,c.you),r.restore(),l.leaderboardRefreshing&&e_(r,u)}function e_(r,i){const l=i*VS*Math.PI*2;r.save(),r.strokeStyle=wp,r.lineWidth=YS,r.lineCap="round",r.beginPath(),r.arc(0,bS,WS,l,l+jS),r.stroke(),r.restore()}const va=.022,t_=.05,n_=.1,r_="rgba(90, 58, 24, 0.12)",i_="#b3835d";function s_(r,i,l,u,c){const f=l.length,h=f>Gn,g=h?Math.floor(u/Cr):0,_=h?Math.min(f-1,g+Gn+1):Gn-1;for(let w=g;w<=_;w+=1){const O=w_r-L?z=Math.max(0,(_r-R)/L):R0&&(r.save(),z<1&&(r.globalAlpha*=z),a_(r,i,O,w,R,c),r.restore())}}function l_(r,i,l){if(l<=Gn)return;const u=_r,c=Er,f=u-c,h=Math.min(l,iu),g=Math.max(n_,f*Gn/h),_=cp(l),w=_>0?i/_:0,O=u-w*(f-g),R=ue.panelOutside.worldW/2-t_-va/2;r.fillStyle=r_,r.fillRect(R,c,va,f),r.fillStyle=i_,r.fillRect(R,O-g,va,g)}function o_(r,i,l){th(r,i,"DAILY",sp,l==="daily"),th(r,i,"ALL TIME",lp,l==="allTime")}function th(r,i,l,u,c){i.drawSprite(r,c?"tabActive":"tabInactive",u,_i),c?$(r,l,u,_i,eh,"center",MS):$(r,l,u,_i,eh,"center")}function a_(r,i,l,u,c,f){const h=u+1;i.drawSprite(r,"rankCircle",Js,c,{tint:$S[Kh(h)]}),$(r,h.toString(),Js,c,Bn,"center"),i.drawSprite(r,"scoreSlot",Ks,c);const g=f&&l!==null,_=l?bn(l.name,BS,O=>ot(r,O,Bn)):Ua,w=l?l.score.toString():Ua;$(r,_,Cp,c,Bn,"left"),$(r,w,g?kS:Ks,c,Bn,"center"),g&&i.drawSprite(r,"chaseBtn",rp,c)}function u_(r,i,l){i.drawSprite(r,"youSlot",0,gr,{scale:op}),i.drawSprite(r,"rankCircle",Js,gr,{tint:HS});const u=l.rank!==null?l.rank.toString():l.rankPending?xS:Ua;$(r,u,Js,gr,dy(u),"center"),$(r,"YOU",Cp,gr,Bn,"left"),$(r,l.score.toString(),FS,gr,Bn,"center")}function c_(r,i,l){for(let u=0;uot(r,h,Ge*al))} · ${l.chasing.score}`,f=ih(r,c);Ti(r,i,"green",0,gn,Ga),$(r,c,-Ai(r,c,f),gn,f,"center")}else if(l.unavailable==="missing")$(r,h_,0,rh,nh,"center"),$(r,p_,0,gn,g_,"center");else if(l.unavailable==="error"){$(r,m_,0,rh,nh,"center");const u=ih(r,ya);Ti(r,i,"gray",0,gn,Ga),$(r,ya,-Ai(r,ya,u),gn,u,"center")}}const y_=.05,S_=.3;function __(r,i){return i.plays===0?`YOUR ${i.score} · NOBODY HAS TRIED YET`:!i.bestAttempt||i.beats===0?`YOUR ${i.score} STANDS · ${i.plays} TRIED`:`${bn(i.bestAttempt.name.toUpperCase(),S_,u=>ot(r,u,Ge*al))} BEAT YOUR ${i.score} WITH ${i.bestAttempt.score} · ${i.plays} TRIED`}function E_(r){return r.plays===0?"gray":r.beats>0?"yellow":"green"}function w_(r,i,l){if(!l)return;const u=__(r,l),c=wr-y_*2,f=Math.min(Ge*al,c/ot(r,u,1));Ti(r,i,E_(l),0,Fa,wr),$(r,u,-Ai(r,u,f),Fa,f,"center")}const sh=.085,C_=.6,k_="TAP TO SET NAME",A_="✎",T_=.13,R_=.06,L_=.11,N_=.25,O_=1.1,P_="OFFLINE MODE",Tp=.33,Rp=.09,I_="SCORES WON'T BE RANKED",za=.235,Lp=.055,M_="CONNECTING…",D_=.06,B_=.35,x_="UNRANKED",F_=.055,H_=3,U_="BACK ONLINE",G_="NEXT RUN WILL BE RANKED",z_=.07,b_=.02,W_=Math.PI*1.5,Y_=1;function j_(r,i,l,u,c,f,h,g,_,w,O,R=null){l.state==="getready"?Z_(r,i,l,u,c,g,_,w,O,R):l.state==="play"?($(r,l.score.toString(),0,O_,N_,"center"),Gy(r,i,l.ghostBeatenElapsed,l.chaseKind==="challenge"?"CHALLENGE BEATEN":"GHOST BEATEN")):l.state==="gameover"&&h&&KS(r,i,l,u,c,f,h),V_(l)&&l.state!=="getready"&&K_(r,u,c),$_(l)&&X_(r)}function V_(r){return r.netMode==="offline"?!1:!r.runRanked||r.netMode==="fallback"}function $_(r){return r.netMode!=="online"||r.backOnlineElapsed===null||r.backOnlineElapsed>H_?!1:r.state==="getready"?!0:r.state==="play"&&!r.runRanked}function X_(r){$(r,U_,0,Tp,Rp,"center"),$(r,G_,0,za,Lp,"center")}function K_(r,i,l){const u=-i/2+Ha,c=l/2-hp;$(r,x_,u,c,F_,"left")}function Q_(r,i){const l=i*Y_*Math.PI*2;r.save(),r.strokeStyle="white",r.lineWidth=b_,r.lineCap="round",r.beginPath(),r.arc(0,B_,z_,l,l+W_),r.stroke(),r.restore()}function Z_(r,i,l,u,c,f,h,g,_,w){i.drawSprite(r,"logo",0,Ey+Py(l.elapsed)),q_(r,i,l.bestScore,f,h,u,c),i.drawSprite(r,"tapHint",0,ky),!_.chasing&&!_.unavailable&&($y(r,i,g,f),w_(r,i,w)),v_(r,i,_),l.netMode==="fallback"?($(r,P_,0,Tp,Rp,"center"),$(r,I_,0,za,Lp,"center")):l.netMode==="pending"&&(Q_(r,l.stateElapsed),$(r,M_,0,za,D_,"center"))}function q_(r,i,l,u,c,f,h){const g=h/2-hp,_=-f/2+Ha,w=f/2-Ha,O=u===null?k_:`${bn(u,C_,L=>ot(r,L,sh))} ${A_}`;$(r,O,_,g,sh,"left"),$(r,l.toString(),w,g,T_,"right"),$(r,"HIGH SCORE",w,g-L_,R_,"right");const R=h/2-pp;i.drawSprite(r,c?"soundOff":"soundOn",_+ue.soundOn.worldW/2,R)}const J_=Ne(-10),eE=Ne(10);function tE(r){return r-Ci=Ci)return null;const h=i.gapY-i.halfGap,g=Math.max(J_,Math.min(r,h)),_=r-g;if(f*f+_*_>30n)*iE&di,i=(i^i>>27n)*sE&di,i=i^i>>31n,i&di}nextFraction(){return Number(this.nextU64()%lE)}nextGapY(){return zh+Math.trunc(this.nextFraction()*s0/Sn)}}class oE{constructor(i,l,u,c=null){this.reviveStep=c,this.game=new au(0),this.game.seedPipes(i,u),this.scheduled=new Set(l)}reviveStep;game;scheduled;index=0;over=!1;get snapshot(){return this.game.snapshot}get score(){return this.game.publishedState.score}get stepIndex(){return this.index}get done(){return this.over}step(){return this.over?!1:this.game.snapshot.state==="gameover"&&!this.tryRevive()?(this.over=!0,!1):(this.scheduled.has(this.index)&&this.game.flap(),this.game.step(zn),this.index+=1,!0)}tryRevive(){return this.game.wasRevived||this.reviveStep!==this.game.durationSteps?!1:(this.game.revive(),!0)}}const aE=.6,Np=Math.round(aE/zn),uE=Np*zn*Se.speed;function lh(r,i,l){return r+(i-r)*l}class cE{run;prevY=0;prevRot=0;constructor(i,l,u){this.run=new oE(i,l,u);const c=this.run.snapshot;this.prevY=c.birdY,this.prevRot=c.birdRot;for(let f=0;fthis.soundListeners.delete(i)}onBestScoreChanged(i){return this.bestScoreListeners.add(i),()=>this.bestScoreListeners.delete(i)}seedPipes(i,l=Ba){this.nextSeed=i,this.simVersion=l}get flapTrace(){return this.flaps}get passStepTrace(){return this.passSteps}get isRanked(){return this.ranked}get wasRevived(){return this.revivedAtStep!==null}get reviveStep(){return this.revivedAtStep}get runDeathCause(){return this.deathCause}get durationSteps(){return this.playStep}get currentSeed(){return this.runSeed}get runSimVersion(){return this.simVersion}setNetMode(i){i==="online"&&this.netMode==="fallback"&&(this.recoveredAtElapsed=this.elapsed),this.netMode=i}setChase(i){this.chase=i,this.nextSeed=i?i.seed:null}restart(){this.currentState==="gameover"&&(this.emitSound("swoosh"),this.reset(),this.transition("getready"))}revive(){this.currentState!=="gameover"||this.revivedAtStep!==null||(this.revivedAtStep=this.playStep,this.applyReviveTransform(),this.birdRot=Sa,this.prevBirdY=this.birdY,this.prevBirdRot=this.birdRot,this.deathCause=null,this.emitSound("swoosh"),this.transition("play"))}applyReviveTransform(){this.pipes=[],this.birdY=0,this.birdVy=aa(this.simVersion)}flap(){if(this.currentState==="getready"){this.emitSound("flap"),this.beginRun(),this.transition("play"),this.birdVy=aa(this.simVersion);return}if(this.currentState==="play"){this.emitSound("flap"),this.birdVy=aa(this.simVersion),this.flaps[this.flaps.length-1]!==this.playStep&&this.flaps.push(this.playStep);return}}step(i){this.prevBirdY=this.birdY,this.prevBirdRot=this.birdRot,this.prevScrollX=this.scrollX,this.prevPipeScroll=this.pipeScroll,this.elapsed+=i;const l=this.currentState==="play";if(this.currentState==="play"||this.currentState==="gameover"){const u=n0(this.simVersion);u!==null&&this.birdVy<-u&&(this.birdVy=-u),this.birdVy-=$v,this.birdY+=Math.trunc(this.birdVy/120),tE(this.birdY)&&(this.birdY=Gh+Ci,this.birdVy=0,this.currentState==="play"&&(this.deathCause="ground",this.emitSound("hit"),this.transition("gameover")))}else this.birdY=Ne(Math.sin(this.elapsed*fE)*dE),this.birdVy=0,this.birdRot=0;if(this.currentState==="play"&&this.checkPipeCollision(),this.currentState!=="gameover"&&(this.scrollX+=Si,this.currentState==="play"&&this.advancePipes()),this.currentState==="play"||this.currentState==="gameover"?this.birdRot=this.birdVy>0?Sa:Math.max(mE,Sa+Vt(this.birdVy)*pE):this.birdRot=0,this.currentState!=="gameover"&&(this.animationTimer+=i),l){for(this.playStep+=1;this.pendingPasses>0;)this.passSteps.push(this.playStep),this.pendingPasses-=1;this.ghostReplay?.advance(),this.chase&&this.ghostBeatenAtElapsed===null&&this.score>this.chase.score&&(this.ghostBeatenAtElapsed=this.elapsed)}}get snapshot(){return this.composeSnapshot(this.birdY,this.birdRot,this.scrollX,0,1)}renderSnapshot(i){return this.composeSnapshot(_a(this.prevBirdY,this.birdY,i),_a(this.prevBirdRot,this.birdRot,i),_a(this.prevScrollX,this.scrollX,i),(this.pipeScroll-this.prevPipeScroll)*(1-i),i)}composeSnapshot(i,l,u,c,f){const h=this.pipes.map(g=>({x:Vt(g.x)+Vt(c),gapY:Vt(g.gapY),halfGap:Vt(g.halfGap),passed:g.passed}));return{state:this.currentState,birdY:Vt(i),birdRot:l,birdFrame:this.birdFrame(),pipes:h,netMode:this.netMode,runRanked:this.ranked,backOnlineElapsed:this.recoveredAtElapsed===null?null:this.elapsed-this.recoveredAtElapsed,scrollX:Vt(u),score:this.score,bestScore:this.bestScore,medal:this.medal(),elapsed:this.elapsed,stateElapsed:this.elapsed-this.stateEnteredElapsed,isNewBest:this.isNewBest,ghost:this.ghostReplay&&this.ghostReplay.alive&&this.currentState==="play"&&this.ghostBeatenAtElapsed===null?this.ghostReplay.view(f):null,ghostBeatenElapsed:this.ghostBeatenAtElapsed===null?null:this.elapsed-this.ghostBeatenAtElapsed,chaseOutcome:this.currentState==="gameover"&&this.chase?this.score>this.chase.score?"beat":"survived":null,chaseKind:this.chase?.kind??null}}get state(){return this.currentState}get stateElapsed(){return this.elapsed-this.stateEnteredElapsed}get chaseKind(){return this.chase?.kind??null}get publishedState(){return{state:this.currentState,score:this.score,bestScore:this.bestScore}}beginRun(){this.runSeed=this.nextSeed??gE(),this.prng=new ba(this.runSeed),this.playStep=0,this.spawnCount=0,this.flaps=[0],this.passSteps=[],this.pendingPasses=0,this.ranked=this.netMode==="online",this.revivedAtStep=null,this.deathCause=null,this.birdY=0,this.pipes=[],this.score=0,this.ghostReplay=this.chase?new cE(this.chase.seed,this.chase.flaps,this.chase.simVersion):null,this.ghostBeatenAtElapsed=null}advancePipes(){const i=this.pipes[this.pipes.length-1];(i?_f-i.x>=r0:this.playStep>=Vv)&&(this.pipes.push({x:_f,gapY:this.nextGapY(),halfGap:o0(this.simVersion,this.spawnCount),passed:!1}),this.spawnCount+=1),this.pipeScroll+=Si;for(const u of this.pipes)u.x-=Si,!u.passed&&u.x<=0&&(u.passed=!0,this.score+=1,this.pendingPasses+=1,this.emitSound("score"));this.pipes.length>0&&this.pipes[0].x=40?"platinum":this.score>=30?"gold":this.score>=20?"silver":this.score>=10?"bronze":null}birdFrame(){return this.currentState==="gameover"?2:Math.floor(this.animationTimer/hE)%2===0?0:1}reset(){this.birdY=0,this.birdVy=0,this.birdRot=0,this.prevBirdY=0,this.prevBirdRot=0,this.prevPipeScroll=this.pipeScroll,this.pipes=[],this.score=0,this.isNewBest=!1,this.ghostReplay=null}transition(i){if(i==="gameover"&&this.score>this.bestScore){this.bestScore=this.score,this.isNewBest=!0;for(const l of this.bestScoreListeners)l(this.bestScore)}this.currentState=i,this.stateEnteredElapsed=this.elapsed}emitSound(i){for(const l of this.soundListeners)l(i)}}const vn=Me({name:null},(r,i)=>r.name===i.name),Op=["Zippy","Peppy","Perky","Jumpy","Lofty","Windy","Sunny","Misty","Foggy","Gusty","Brisk","Swift","Quick","Rapid","Zoomy","Turbo","Hyper","Mega","Super","Ultra","Epic","Retro","Pixel","Neon","Gold","Shiny","Sleek","Slick","Sassy","Zesty","Spicy","Gutsy","Brave","Bold","Wild","Fiery","Solar","Lunar","Astro","Nova","Star","Storm","Downy","Fuzzy","Tiny","Micro","Mini","Itty","Jolly","Merry","Happy","Lucky","Dizzy","Loopy","Goofy","Wacky","Zany","Nutty","Agile","Deft","Spry","Fleet","High","Soar","Glide","Flick","Whirl","Twirl","Swoop","Dive","Loop","Zig","Zag","Boop","Bonk","Early","Night","Dusk","Royal","Regal","Noble","Fancy","Dandy","Jazzy","Funky","Rocky","Vivid","Aero","Sky","Cloud","Air","Puffy","Wavy","Curly","Amber","Azure","Coral","Mango","Berry","Lemon","Minty","Candy","Honey","Pearl","Ruby","Opal","Jade","Onyx","Topaz","Cozy","Zen","Calm"],Xs=["Bird","Birdie","Finch","Wren","Robin","Hawk","Eagle","Falcon","Owl","Owlet","Chick","Peep","Pip","Pippin","Egg","Beak","Wing","Plume","Quill","Talon","Crest","Perch","Roost","Flock","Flyer","Glider","Dodo","Kiwi","Emu","Toucan","Parrot","Macaw","Budgie","Canary","Dove","Pigeon","Crow","Raven","Magpie","Jay","Cuckoo","Lark","Pipit","Plover","Puffin","Petrel","Tern","Gull","Heron","Crane","Stork","Ibis","Egret","Osprey","Merlin","Condor","Roc","Piper","Hopper","Jumper","Dasher","Zoomer","Racer","Pilot","Ace","Rocket","Jet","Comet","Breeze","Gust","Zephyr","Wisp","Chirp","Tweet","Cheep","Squawk","Trill","Melody","Nugget","Waddle","Wobble","Bobble","Noodle","Doodle","Peck","Duck","Goose","Swan","Hen","Loon","Grouse","Quail","Pipe","Floof","Birb","Winger","Flappy","Diver","Swoosh","Bounce","Hover","Halo","Vortex","Streak","Bolt","Dart","Arrow","Zoomie","Boost","Nimbus","Cirrus","Spiral"],Wa=1e4,vE=4,uu=1179402576;function Pp(){return Op.length*Xs.length*Wa}function Ip(r){return r=(r^r>>>16)>>>0,r=Math.imul(r,2246822507)>>>0,r=(r^r>>>13)>>>0,r=Math.imul(r,3266489909)>>>0,r=(r^r>>>16)>>>0,r}function yE(r){const i=[];for(let l=0;l>>0));return i}function SE(r){let i=1;for(;Math.pow(2,i)52)throw new Error("domain too large for JS numbers");return i}function _E(r,i,l){let u=Math.floor(r/i),c=r%i;for(const f of l){const h=(u+Ip((c^f)>>>0))%i;u=c,c=h}return u*i+c}function EE(r,i=uu){const l=Pp();if(!Number.isInteger(r)||r<0||r>=l)throw new RangeError(`index must be an integer in [0, ${l})`);const u=SE(l),c=Math.pow(2,u/2),f=yE(i>>>0);let h=r;do h=_E(h,c,f);while(h>=l);return h}function wE(r){const i=r%Wa,l=Math.floor(r/Wa),u=l%Xs.length,c=Math.floor(l/Xs.length);return Op[c]+Xs[u]+String(i).padStart(4,"0")}function CE(r,i=uu){return wE(EE(r,i))}function kE(r=Math.random,i=uu){return CE(Math.floor(r()*Pp()),i)}const ah=Vt(Si),AE=-1.6,uh=14;function Ea(r,i,l){return r+(i-r)*l}class TE{constructor(i,l,u,c,f,h){this.name=i,this.tint=l,this.pilot=u,this.hopStep=h,this.game=new au(0),this.game.seedPipes(c,f),this.x=-h*ah,this.prevX=this.x}name;tint;pilot;hopStep;game;stepIndex=0;x;prevX;prevY=0;prevRot=0;hopped=!1;dead=!1;finished=!1;get alive(){return!this.dead}advance(i){if(this.finished)return null;if(!this.hopped){if(ir.nextFraction()/Sn,u=i===0?l()*BE:l();return{blunderChance:xE+FE*u*u,latencyBase:HE+Math.round(u*UE),latencyJitter:GE,aimBias:(l()*2-1)*bE*(dh+(1-dh)*u),wobbleRange:WE+YE*u,hoverTarget:jE+l()*VE}}class XE{constructor(i,l){this.rng=i,this.profile=l}rng;profile;pendingFlapStep=null;aimOrdinal=-1;pipeOffset=0;prevY=0;wantsFlap(i,l){const u=this.resolveAim(i);u.aimedPipe&&u.ordinal!==this.aimOrdinal&&(this.aimOrdinal=u.ordinal,this.pipeOffset=this.rollPipeOffset(u.aimedPipe));const c=u.target??this.profile.hoverTarget,f=(i.birdY-this.prevY)*fh,h=i.birdY<=this.prevY;if(this.prevY=i.birdY,this.pendingFlapStep!==null)return l>=this.pendingFlapStep?(this.pendingFlapStep=null,!0):!1;const _=c-i.birdY>IE?Math.max(zE,this.profile.latencyBase>>1):this.profile.latencyBase;return h&&this.predictedY(i.birdY,f,_)0?1:0),g=f!==null&&c.xkE(()=>r.nextFraction()/Sn);let u=l();for(let c=0;ci.name)}aliveBotCount(){let i=0;for(const l of this.bots)l.alive&&(i+=1);return i}views(i){const l=Math.max(this.stepCount-1+i,0),u=[];for(const c of this.bots){const f=c.view(l,i,Ya);f&&u.push(f)}return u}busX(i){const l=-Math.max(this.stepCount-1+i,0)*ew;return l=0&&i.lengthMp)break;i.push({name:u.name,score:u.score,ageSeconds:c})}return i}}const ow=Mp;function aw(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).has("royale")}const uw=3,cw=120;class dw{constructor(i){this.game=i,this.active=aw(),this.active&&(window.__royale=this)}game;active;match=null;prevState="getready";placement=null;winAtStep=null;aliveBots(){return this.match?.aliveBotCount()??0}matchSteps(){return this.match?.steps??0}afterStep(){if(!this.active)return;const i=this.game.publishedState.state;if(i==="play"){this.prevState!=="play"&&this.beginMatch();const l=this.match;l&&(l.advance(),this.winAtStep===null&&l.aliveBotCount()===0&&(this.winAtStep=l.steps))}else i==="gameover"&&this.prevState==="play"&&this.match&&(this.placement=this.winAtStep!==null?1:this.match.aliveBotCount()+1);this.prevState=i}frameView(i,l){if(!this.active)return null;if(l.state==="getready"||!this.match)return{bots:[],bus:{x:0,y:Ya},birdsLeft:this.match?.totalBirds??30,totalBirds:this.match?.totalBirds??30,feed:[],placement:null,winBanner:!1,inPlay:!1};const u=this.match,c=l.state==="play",f=u.busX(i);return{bots:u.views(i),bus:f===null?null:{x:f,y:Ya},birdsLeft:u.aliveBotCount()+(c?1:0),totalBirds:u.totalBirds,feed:u.recentFeed(),placement:l.state==="gameover"?this.placement:null,winBanner:c&&this.winAtStep!==null&&(u.steps-this.winAtStep)/cw{r.globalAlpha=Math.max(0,1-h.ageSeconds/ow),$(r,`${h.name} OUT (${h.score})`,c,f-.1-g*.08,.05,"left")}),r.globalAlpha=1),i.winBanner&&$(r,"LAST BIRD FLYING!",0,.6,.11,"center"),i.placement!==null&&$(r,`PLACED #${i.placement} OF ${i.totalBirds}`,0,u/2-.32,.1,"center"),r.restore()}const Dp="flappy_bestScore";function Cw(){try{const r=parseInt(localStorage.getItem(Dp)??"0",10);return Number.isFinite(r)&&r>0?r:0}catch{return 0}}function kw(r){try{localStorage.setItem(Dp,r.toString())}catch{return}}const Aw=3/4,Tw="#4EC0CA",Rw="#111111";class Lw{constructor(i,l){this.worldW=i,this.worldH=l,this.maxFrameW=l*Aw}worldW;worldH;pixelsPerUnit=1;offsetX=0;offsetY=0;frameW=0;frameH=0;framePxW=0;framePxH=0;canvasW=0;canvasH=0;safeBottomY=0;dpr=1;maxFrameW;handleResize(i,l,u,c){this.dpr=u,this.canvasW=Math.round(i*u),this.canvasH=Math.round(l*u),this.pixelsPerUnit=Math.min(this.canvasW/this.worldW,this.canvasH/this.worldH),this.frameW=Math.min(this.canvasW/this.pixelsPerUnit,this.maxFrameW),this.frameH=this.canvasH/this.pixelsPerUnit,this.framePxW=this.frameW*this.pixelsPerUnit,this.framePxH=this.frameH*this.pixelsPerUnit,this.offsetX=(this.canvasW-this.framePxW)/2,this.offsetY=(this.canvasH-this.framePxH)/2,this.safeBottomY=-this.frameH/2+c*u/this.pixelsPerUnit}setupContext(i){i.resetTransform(),this.offsetX>=1&&(i.fillStyle=Rw,i.fillRect(0,0,this.canvasW,this.canvasH)),i.save(),i.translate(Math.round(this.offsetX),Math.round(this.offsetY)),i.beginPath(),i.rect(0,0,Math.round(this.framePxW),Math.round(this.framePxH)),i.clip(),i.fillStyle=Tw,i.fillRect(0,0,this.framePxW,this.framePxH),i.translate(this.framePxW/2,this.framePxH/2),i.scale(this.pixelsPerUnit,-this.pixelsPerUnit)}restoreContext(i){i.restore()}screenToWorld(i,l){const u=i*this.dpr-this.offsetX-this.framePxW/2,c=l*this.dpr-this.offsetY-this.framePxH/2;return{x:u/this.pixelsPerUnit,y:-c/this.pixelsPerUnit}}cssPixelsToWorld(i){return i*this.dpr/this.pixelsPerUnit}}const Nw=["--chrome-bottom","--chrome-bottom-ad"];function Ow(r){return r.reduce((i,l)=>{const u=Number.parseFloat(l);return i+(Number.isFinite(u)?u:0)},0)}function Pw(){const r=getComputedStyle(document.documentElement);return Ow(Nw.map(i=>r.getPropertyValue(i)))}const mh=.45,gh=.035,Iw=4,vh=.7;class Mw{remaining=0;trigger(){this.remaining=mh}advance(i){if(this.remaining=Math.max(0,this.remaining-i),this.remaining===0)return{x:0,y:0};const l=this.remaining/mh,u=(1-l)*Iw*2*Math.PI;return{x:Math.sin(u)*gh*l,y:Math.cos(u*vh)*gh*vh*l}}}class Dw{constructor(i,l){this.step=i,this.maxFrameSeconds=l}step;maxFrameSeconds;accumulator=0;advance(i){if(i>this.maxFrameSeconds)return this.accumulator=0,0;this.accumulator+=i;let l=0;for(;this.accumulator>=this.step;)this.accumulator-=this.step,l++;return l}reset(){this.accumulator=0}get alpha(){return this.accumulator/this.step}}const Ca=["<30","30-45","45-60","60+"],Bw=1e-6;class xw{counts=[0,0,0,0];reset(){this.counts=[0,0,0,0]}record(i){if(ic+f,0);if(i===0)return null;const l=(i-1)/2;let u=0;for(let c=0;cl)return Ca[c];return Ca[Ca.length-1]}}const yh=[1,.85,.7,.55],Fw=1/165,Hw=1.6,Uw=2.5,Gw=60,zw=.08;class bw{stepIndex=0;windowFastest=1/0;windowSeconds=0;windowFrames=0;windowMisses=0;lastWindowBad=!1;get scale(){return yh[this.stepIndex]}record(i){if(i<=0||(ithis.windowFastest*Hw&&(this.windowMisses+=1),this.windowSecondszw;return!u||!this.lastWindowBad||this.stepIndex>=yh.length-1?(this.lastWindowBad=u,!1):(this.lastWindowBad=!1,this.stepIndex+=1,!0)}}class Ww{constructor(i,l,u,c,f,h=()=>({challengeAgain:!1,challengeBack:!1,revive:!1}),g=()=>null){this.game=i,this.camera=l,this.carousel=u,this.scroll=c,this.actions=f,this.buttons=h,this.modalStatus=g}game;camera;carousel;scroll;actions;buttons;modalStatus;gameOverStartX=0;gameOverStartY=0;gameOverAxis="none";gameOverScrolling=!1;currentGameOverLayout(){return lu(this.camera.frameW,this.camera.safeBottomY)}handlePointerDown(i,l){const u=this.camera.screenToWorld(i,l),c=this.game.state;if(c==="getready")if(Ny(u.x,u.y,this.camera.frameW,this.camera.frameH))this.actions.onEditName();else if(Oy(u.x,u.y,this.camera.frameW,this.camera.frameH))this.actions.onToggleMute();else{if(zf(u.x,u.y)&&this.actions.onRetryChallenge())return;if(zf(u.x,u.y)&&this.actions.onToggleChase())return;if(Ay(u.x,u.y)&&this.actions.onShareMyChallenge())return;this.game.flap()}else if(c==="play")this.game.flap();else if(c==="gameover"){if(this.modalStatus()!==null)return;this.carousel.beginDrag(u.x,u.y),this.gameOverStartX=u.x,this.gameOverStartY=u.y,this.gameOverAxis="none",this.gameOverScrolling=this.scroll.canScroll&&fp(u.x,u.y,this.currentGameOverLayout(),this.carousel),this.gameOverScrolling&&this.scroll.beginDrag(u.y)}}handlePointerMove(i,l){if(this.game.state!=="gameover")return;const u=this.camera.screenToWorld(i,l);if(this.gameOverAxis==="none"){const c=u.x-this.gameOverStartX,f=u.y-this.gameOverStartY;(Math.abs(c)>Zs||Math.abs(f)>Zs)&&(this.gameOverAxis=Math.abs(f)>Math.abs(c)?"vertical":"horizontal",this.gameOverAxis==="vertical"&&this.gameOverScrolling?this.carousel.cancelDrag():(this.scroll.endDrag(),this.gameOverScrolling=!1))}this.gameOverScrolling&&this.gameOverAxis==="vertical"?this.scroll.moveDrag(u.y):this.gameOverScrolling||this.carousel.moveDrag(u.x,u.y)}handlePointerUp(i,l){if(this.game.state!=="gameover")return;const u=this.camera.screenToWorld(i,l),c=this.modalStatus();if(c!==null){const g=aS(u.x,u.y,c);g&&this.actions.onBoardModal(g);return}if(!(this.gameOverScrolling?this.endScrollDrag():this.carousel.endDrag(u.x,u.y)))return;const h=_y(u.x,u.y,this.currentGameOverLayout(),this.carousel,this.buttons(),this.scroll.offset);if(h){if(h.kind==="page"){this.carousel.setPage(h.page);return}if(h.kind==="mode"){this.actions.onSelectMode(h.mode);return}this.gameOverButtonsActive()&&(h.kind==="play"?this.actions.onPlay():h.kind==="revive"?this.actions.onRevive():h.kind==="challengeAgain"?this.actions.onChallengeAgain():h.kind==="challengeBack"?this.actions.onChallengeBack():h.kind==="rowChase"?this.actions.onRowChase(h.index):this.actions.onShare())}}endScrollDrag(){return this.scroll.endDrag(),this.carousel.cancelDrag(),this.gameOverScrolling=!1,this.gameOverAxis==="none"}handlePointerCancel(){this.carousel.cancelDrag(),this.scroll.endDrag(),this.gameOverScrolling=!1}handleKeyDown(i){const l=this.game.state;if(l==="getready"||l==="play")(i==="Space"||i==="ArrowUp")&&this.game.flap();else if(l==="gameover"){if(this.modalStatus()!==null){i==="Escape"&&this.actions.onBoardModal("close");return}(i==="Space"||i==="Enter")&&this.gameOverButtonsActive()&&this.actions.onPlay()}}gameOverButtonsActive(){return this.game.stateElapsed>=ap}}const Yw={request:r=>requestAnimationFrame(r),cancel:r=>cancelAnimationFrame(r)};class jw{constructor(i,l=Yw){this.onFrame=i,this.scheduler=l}onFrame;scheduler;frameId=0;running=!1;start(){this.running||(this.running=!0,this.scheduleNext())}stop(){this.running=!1,this.scheduler.cancel(this.frameId)}restart(){this.stop(),this.start()}scheduleNext(){this.frameId=this.scheduler.request(this.tick)}tick=i=>{this.running&&(this.scheduleNext(),this.onFrame(i))}}function Sh(){return{top:[],myRank:null,totalRanked:0}}function Vw(r){return r.allTime.top.length>0||r.daily.top.length>0}function $w(r,i){return r===null||i===null?r===i:r.rank===i.rank&&r.highScore===i.highScore}function _h(r,i){return r.top===i.top&&$w(r.myRank,i.myRank)&&r.totalRanked===i.totalRanked}const vi=Me({allTime:Sh(),daily:Sh()},(r,i)=>_h(r.allTime,i.allTime)&&_h(r.daily,i.daily));class Xw{mode="daily";pinned=null;freezeArmed=!1;enterGameOver(i){this.mode="daily",this.pinned=i,this.freezeArmed=!0}handleLeaderboardChange(i,l){!l||!this.freezeArmed||(this.pinned=i,this.freezeArmed=!1)}selectMode(i){this.mode=i}compose(i,l){const u=this.pinned?Y0(this.pinned,i):i;return!l.connected&&!Vw(u)?null:Qh(u,l.playerName,l.bestScore,this.mode,l.countdown,l.reportStatus==="pending"||l.reportStatus==="reported")}}const bs=864e5,Kw=1e3,Eh=3600,wh=60;function ja(r){return bs-(r%bs+bs)%bs}function Va(r){const i=Math.max(0,Math.floor(r/Kw)),l=Math.floor(i/Eh),u=Math.floor(i%Eh/wh),c=i%wh;return`${ka(l)}H ${ka(u)}M ${ka(c)}S`}function ka(r){return r.toString().padStart(2,"0")}const Yt=Me({status:"idle",requestToken:0}),Ws={getSnapshot:Yt.getSnapshot,subscribe:Yt.subscribe,requestTheme(r){Yt.publish({status:"loading",requestToken:Yt.getSnapshot().requestToken+1,themeMap:r})},reset(){Yt.publish({status:"idle",requestToken:Yt.getSnapshot().requestToken+1,themeMap:void 0})},setStatus(r){Yt.getSnapshot().status!==r&&Yt.publish({...Yt.getSnapshot(),status:r})}},Qw=Me({status:"idle"}),Bp=Me(!1,(r,i)=>r===i),Fn=Me({status:"disconnected",identity:null,mode:"offline"},(r,i)=>r.status===i.status&&r.identity===i.identity&&r.mode===i.mode),Ys=Me(!1,(r,i)=>r===i),Ei={getSnapshot:Ys.getSnapshot,subscribe:Ys.subscribe,open(){Ys.publish(!0)},close(){Ys.publish(!1)}},tl=Me("idle",(r,i)=>r===i);function xp(r){return r!=="idle"}const Zw=2,qw=5,Jw=9e4,e1=3;class t1{constructor(i=()=>performance.now()){this.now=i}now;runs=0;shown=0;runsAtLastAttempt=0;lastAttemptAt=null;lastShownAt=null;lastRunRevived=!1;get runsThisSession(){return this.runs}sinceLastShownMs(){return this.lastShownAt===null?null:this.now()-this.lastShownAt}recordRunStarted(i){this.lastRunRevived=i,i||(this.runs+=1)}recordRequested(){this.startSpacingWindow()}recordShown(){this.shown+=1,this.lastShownAt=this.now(),this.startSpacingWindow()}due(){return this.lastRunRevived||this.shown>=e1||this.runs=Jw}startSpacingWindow(){this.runsAtLastAttempt=this.runs,this.lastAttemptAt=this.now()}}const n1={unfilled:"unfilled",failed:"playback_failed"};function r1(r){const{policy:i,product:l}=r,u=()=>({runs_this_session:i.runsThisSession,since_last_ms:i.sinceLastShownMs()});return{start(){return r.events.onRunStarted(c=>i.recordRunStarted(c.reviveStep!==null))},due(){const c=r.flags();return c.ads&&c.instream&&i.due()},show(){const c=u();return i.recordRequested(),l.track("instream_ad_requested",c),r.loadPlayer().then(f=>f(h=>{h==="playing"&&(i.recordShown(),l.track("instream_ad_started",c))})).then(f=>{if(f==="completed"){l.track("instream_ad_completed",c);return}if(f==="skipped"){l.track("instream_ad_skipped",c);return}l.track("instream_ad_failed",{...c,reason:n1[f]})})}}}const $a=r1({events:Li,flags:()=>Xt.getSnapshot(),policy:new t1,product:mt,loadPlayer:()=>lt(()=>Promise.resolve().then(()=>jC),void 0).then(r=>r.playInstreamAd)}),Fp=Me({status:"idle"}),i1=.25,Ch={flap:"/audio/sfx_wing.mp3",score:"/audio/sfx_point.mp3",hit:"/audio/sfx_hit.mp3",die:"/audio/sfx_die.mp3",swoosh:"/audio/sfx_swooshing.mp3"},Aa={};let jt=null,fi=null;const kh={async init(){jt||(jt=new(window.AudioContext||window.webkitAudioContext),fi=jt.createGain(),fi.gain.value=i1,fi.connect(jt.destination));const r=Object.keys(Ch).map(async i=>{try{const u=await(await fetch(Ch[i])).arrayBuffer(),c=await jt.decodeAudioData(u);Aa[i]=c}catch(l){console.error(`Failed to load audio: ${i}`,l)}});await Promise.all(r)},play(r){if(ki.getSnapshot()||!jt||!fi||!Aa[r])return;jt.state==="suspended"&&jt.resume();const i=jt.createBufferSource();i.buffer=Aa[r],i.connect(fi),i.start(0)}},hi=1080,js=1080,s1="#4EC0CA",l1="#d8a96b",Ta=140,Hp="Jersey10, sans-serif",o1="white",a1="black",u1=.15,Up="#b3835d",c1=130,d1=660,f1="flappybird.io",h1=60,Gp=540,zp=570,bp=620,p1=1.1,Xa=bp/p1,Ah=.48,m1=.86,g1=.17,v1=.022,y1=.085,S1=.74,_1="#54381c",E1="#cf9b76",w1="#dcab84",C1=.45,k1=.033,A1=.993,Ra=.25,T1=.163,R1=.2,L1=.075,N1=-.027,O1=.008,P1=-.067,I1=-.157,M1=.18,D1=-.17,B1=.09,x1=.18,F1=.22,Th=-.42,H1={bronze:"/sprites/medal-bronze.png",silver:"/sprites/medal-silver.png",gold:"/sprites/medal-gold.png",platinum:"/sprites/medal-platinum.png"};function yn(r,i){return{x:Gp+r*Xa,y:zp-i*Xa}}function kt(r){return r*Xa}async function U1(r){const i=document.createElement("canvas");i.width=hi,i.height=js;const l=i.getContext("2d");if(!l)throw new Error("Failed to acquire 2D context for the score card");l.imageSmoothingEnabled=!1,l.fillStyle=s1,l.fillRect(0,0,hi,js),l.fillStyle=l1,l.fillRect(0,js-Ta,hi,Ta);const[u,c,f,h,g]=await Promise.all([mi("/sprites/logo.webp"),mi("/sprites/panel-outside.png"),mi("/sprites/panel-inside.png"),r.isNewBest?mi("/sprites/new-badge.png"):Promise.resolve(null),mi(r.medal?H1[r.medal]:"/sprites/medal-empty.png")]);if(u&&pi(l,u,hi/2,c1,d1),c&&pi(l,c,Gp,zp,bp),f){const w=yn(0,k1);pi(l,f,w.x,w.y,kt(A1))}if(r.playerName){G1(l,0,Ah);const w=yn(0,Ah),O=z1(l,r.playerName,kt(y1),kt(S1));wi(l,r.playerName,w.x,w.y,O)}if(Rh(l,r.score.toString(),-Ra,["SCORE"],[N1]),Rh(l,r.best.toString(),Ra,["HIGH","SCORE"],[O1,P1]),h){const w=yn(Ra,I1);pi(l,h,w.x,w.y,kt(M1))}const _=yn(D1,Th);if(wi(l,"MEDAL",_.x,_.y,kt(B1),Up),g){const w=yn(x1,Th);pi(l,g,w.x,w.y,kt(F1))}return wi(l,r.linkLabel??f1,hi/2,js-Ta/2,h1),b1(i)}function Rh(r,i,l,u,c){const f=yn(l,T1);wi(r,i,f.x,f.y,kt(R1)),u.forEach((h,g)=>{const _=yn(l,c[g]);wi(r,h,_.x,_.y,kt(L1),Up)})}function G1(r,i,l){const u=yn(i,l),c=kt(m1),f=kt(g1),h=kt(v1),g=u.x-c/2,_=u.y-f/2,w=c-h*2,O=f-h*2;r.fillStyle=_1,r.fillRect(g,_,c,f),r.fillStyle=E1,r.fillRect(g+h,_+h,w,O),r.fillStyle=w1,r.fillRect(g+h,_+h,w,O*C1)}function z1(r,i,l,u){r.font=`${l}px ${Hp}`;const c=r.measureText(i).width;return c<=u?l:l*u/c}function pi(r,i,l,u,c){const f=c*(i.naturalHeight/i.naturalWidth);r.drawImage(i,l-c/2,u-f/2,c,f)}function wi(r,i,l,u,c,f){if(r.font=`${c}px ${Hp}`,r.textAlign="center",r.textBaseline="middle",f){r.fillStyle=f,r.fillText(i,l,u);return}r.strokeStyle=a1,r.lineWidth=c*u1,r.lineJoin="round",r.strokeText(i,l,u),r.fillStyle=o1,r.fillText(i,l,u)}function mi(r){return new Promise(i=>{const l=new Image;l.onload=()=>i(l),l.onerror=()=>i(null),l.src=r})}function b1(r){return new Promise((i,l)=>{r.toBlob(u=>u?i(u):l(new Error("Score card export failed")),"image/png")})}const Lh="https://flappybird.io";function Wp(){if(typeof window>"u")return Lh;const r=window.location.origin;return r&&r.startsWith("http")?r:Lh}const W1=/^[A-Za-z0-9_-]{1,16}$/,Y1=9999;function j1(r){return r!==null&&W1.test(r)}function Yp(r){const i=`${Wp()}/vs/${r.id}`;return!j1(r.challengerName)||r.score>Y1?i:`${i}?n=${r.challengerName}&s=${r.score}`}function V1(r){const i=new URL(Yp(r));return`${i.host}${i.pathname}`}function jp(r){return`I scored ${r.score} in Flappy Bird — same pipes, beat me: ${Yp(r)}`}const Vp="flappybird-score.png";function $1(r){return`I scored ${r} in Flappy Bird — can you beat it? ${Wp()}`}function X1(r,i){return i?jp(i):$1(r)}function K1(r,i=navigator,l=typeof ClipboardItem<"u"){const u=typeof i.share=="function"&&typeof i.canShare=="function"&&i.canShare({files:[r]}),c=l&&typeof i.clipboard?.write=="function";return{canShareFiles:u,canWriteClipboardImages:c}}async function Q1(r,i=null){let l;try{l=await U1({...r,linkLabel:i?V1(i):void 0})}catch{return"failed"}const u=new File([l],Vp,{type:"image/png"});return Z1(u,l,X1(r.score,i),K1(u))}async function Z1(r,i,l,u,c=navigator,f=tC){if(u.canShareFiles&&c.share)try{return await c.share({files:[r],text:l}),"webshare"}catch(g){if(g instanceof DOMException&&g.name==="AbortError")return"canceled"}if(u.canWriteClipboardImages&&c.clipboard?.write){const g=c.clipboard.write.bind(c.clipboard);if(await q1(g,i,l))return"clipboard"}const h=await J1(c,l);return eC(i,f,h)}async function q1(r,i,l){try{return await r([new ClipboardItem({"image/png":i,"text/plain":new Blob([l],{type:"text/plain"})})]),!0}catch{return!1}}async function J1(r,i){const l=r.clipboard?.writeText;if(typeof l!="function")return!1;try{return await l.call(r.clipboard,i),!0}catch{return!1}}function eC(r,i,l){try{return i(r),l?"download_with_link":"download"}catch{return l?"clipboard_text":"failed"}}function tC(r){const i=URL.createObjectURL(r),l=document.createElement("a");l.href=i,l.download=Vp,l.click(),URL.revokeObjectURL(i)}const nC=new Set(["webshare","clipboard","clipboard_text","download_with_link"]),rC={clipboard:"COPIED TO CLIPBOARD",clipboard_text:"LINK COPIED",download_with_link:"SAVED + LINK COPIED",download:"SAVED AS IMAGE",failed:"SHARE FAILED"},iC={clipboard:"LINK COPIED — GO BRAG",clipboard_text:"LINK COPIED — GO BRAG",failed:"CHALLENGE FAILED"};function sC(r){return nC.has(r)}function lC(r){return rC[r]??null}function Nh(r){return iC[r]??null}function La(r,i,l=mt){l.track("share_clicked",{surface:r,score:i})}function Na(r,i,l,u,c=mt){c.track("share_completed",{surface:r,outcome:i,score:l,has_challenge_link:u,link_delivered:sC(i)})}const Dn=Me({status:"idle",ghost:null});function oC(r){return r.ads?"ad":r.resolved?"free":null}function aC(r,i){return r===null?!1:r==="free"||i==="offered"}function uC(){return lt(async()=>{const{playRewardedAd:r}=await Promise.resolve().then(()=>UC);return{playRewardedAd:r}},void 0).then(({playRewardedAd:r})=>r)}function cC(r,i=uC){return r==="free"?Promise.resolve(!0):i().then(l=>l())}const Le=Me({id:null,status:"idle",challenge:null}),Ka=Me({latest:null}),dC=16;function fC(r,i){const l=i.name.toUpperCase().slice(0,dC);return r>i.score?`YOU BEAT ${l}'S ${i.score}!`:`${l}'S ${i.score} STANDS`}const cu=8,nl="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",hC=new RegExp(`^[${nl}]{${cu}}$`),pC=new RegExp(`^/vs/([${nl}]{${cu}})$`);function xk(r){return hC.test(r)}function $p(r){const i=pC.exec(r);return i?i[1]:null}function Fk(r=i=>crypto.getRandomValues(i)){const i=r(new Uint8Array(cu));let l="";for(const u of i)l+=nl[u%nl.length];return l}function Xp(r){const i=$p(r);i&&(Le.publish({id:i,status:"loading",challenge:null}),lt(async()=>{const{fetchChallenge:l}=await import("./challengeFetch-4jZo7wlv.js");return{fetchChallenge:l}},__vite__mapDeps([0,1])).then(({fetchChallenge:l})=>l(i)).then(l=>Le.publish(l?{id:i,status:"ready",challenge:l}:{id:i,status:"missing",challenge:null}),()=>Le.publish({id:i,status:"error",challenge:null})))}function mC(){Le.publish({id:null,status:"idle",challenge:null})}const It=Me({target:null,status:"loading",ghost:null}),gC={setChase:null,restart:!1};class vC{armed=!1;source=null;armedGhost=null;linkArmedId=null;boardGhost=null;lastLink=null;get armedSource(){return this.source}get lastChasedLink(){return this.lastLink}get hasBoardChallenge(){return this.boardGhost!==null}toggle(i){return this.source==="link"?null:this.armed?this.disarm():i.status!=="ready"||!i.ghost?null:this.armDaily(i.ghost)}confirmBoardChase(i){return this.boardGhost=i,this.armBoard()}challengeAgain(){return this.lastLink?{...this.armLink(this.lastLink),restart:!0}:this.boardGhost?this.armBoard():null}reconcileLink(i,l){const{id:u,status:c,challenge:f}=i;return!u||c!=="ready"||!f||this.linkArmedId===f.id||l!=="getready"?null:(this.linkArmedId=f.id,this.armLink(f))}leaveBoardChallenge(){this.boardGhost=null}reconcileDaily(i,l){return!this.armed||this.source!=="daily"||l!=="getready"||i.status==="loading"||i.status==="error"?null:!i.ghost||!this.armedGhost||i.ghost.seed!==this.armedGhost.seed?this.disarm():null}onGameOver(i){return this.lastLink=this.source==="link"?i.challenge:null,this.source==="board"||this.source==="link"?this.disarm():null}clearLinkArm(){this.linkArmedId=null}chaseUi(i){return this.source==="link"?{available:null,armed:!1}:this.source==="board"&&this.boardGhost?{available:{name:this.boardGhost.name,score:this.boardGhost.score},armed:!0}:{available:i.status==="ready"&&i.ghost?{name:i.ghost.name,score:i.ghost.score}:null,armed:this.armed}}challengeUi(i){const{id:l,status:u,challenge:c}=i;return{chasing:this.source==="link"&&c?{name:c.name,score:c.score}:null,unavailable:l!==null&&(u==="missing"||u==="error")?u:null}}chasedChallengeId(i,l){return i==="gameover"?this.lastLink?.id??null:this.source==="link"?l.challenge?.id??null:null}armDaily(i){return this.armed=!0,this.source="daily",this.armedGhost=i,{setChase:Oa("daily",i),restart:!1}}armBoard(){const i=this.boardGhost;return this.armed=!0,this.source="board",this.armedGhost=null,{setChase:i?Oa("challenge",i):null,restart:!0}}armLink(i){return this.armed=!0,this.source="link",this.armedGhost=null,{setChase:Oa("challenge",i),restart:!1}}disarm(){return this.armed=!1,this.source=null,this.armedGhost=null,gC}}function Oa(r,i){return{kind:r,seed:BigInt(i.seed),flaps:i.flaps,score:i.score,simVersion:i.simVersion}}class yC{constructor(i){this.create=i}create;lastRun=null;challengeId=null;request=null;capture(i){this.lastRun=i,this.challengeId=null}get run(){return this.lastRun}eligible(i,l){return i&&l&&this.lastRun!==null&&this.lastRun.score>=1}ensureId(i,l,u){return this.eligible(l,u)?this.mintId(i):Promise.resolve(null)}mintId(i){if(this.challengeId)return Promise.resolve(this.challengeId);if(this.request)return this.request;const l=this.lastRun;if(!l)return Promise.resolve(null);const u=this.create(l,i).then(c=>(c&&this.lastRun===l&&(this.challengeId=c),c)).finally(()=>{this.request===u&&(this.request=null)});return this.request=u,u}}function SC(r,i,l,u,c){if(r){const f=l!==null&&l.score>r.score;return{challengeAgain:!f,challengeBack:f&&u&&l!==null&&l.score>=1,revive:!1}}return{challengeAgain:i,challengeBack:!1,revive:c&&!i}}const _C=new Set(["ArrowDown","PageUp","PageDown","Home","End"]),EC=1.44,wC=2.56,CC=.25,kC=2.5;class AC{constructor(i){this.canvas=i;const l=i.getContext("2d",{alpha:!1});if(!l)throw new Error("Failed to acquire 2D rendering context");this.ctx=l,this.game=new au(Cw()),this.royale=new dw(this.game),this.inputRouter=new Ww(this.game,this.camera,this.gameOverCarousel,this.leaderboardScroll,{onPlay:()=>this.playOn(),onShare:()=>this.shareCurrentScore(),onRevive:()=>this.revive(),onEditName:()=>Ei.open(),onToggleMute:()=>ki.toggleMuted(),onSelectMode:u=>{this.gameOverBoard.selectMode(u),this.leaderboardScroll.reset()},onRetryChallenge:()=>this.retryChallenge(),onToggleChase:()=>this.toggleChase(),onShareMyChallenge:()=>this.shareMyChallenge(),onChallengeAgain:()=>this.challengeAgain(),onChallengeBack:()=>this.shareChallenge("rematch"),onRowChase:u=>this.openRowChallenge(u),onBoardModal:u=>this.handleBoardModal(u)},()=>this.gameOverButtonsState(),()=>this.boardModalStatus()),this.frameLoop=new jw(u=>this.frame(u))}canvas;ctx;renderer=new L0;camera=new Lw(EC,wC);game;royale;gameOverCarousel=new vy;leaderboardScroll=new gy;gameOverBoard=new Xw;screenShake=new Mw;toast=null;inputRouter;lastState="getready";chase=new vC;runChallenge=new yC((i,l)=>lt(async()=>{const{createRunChallenge:u}=await import("./challengeActions-Cc29Ejge.js");return{createRunChallenge:u}},[]).then(({createRunChallenge:u})=>u(i,l)));lastLeaderboardView=null;timestep=new Dw(zn,CC);fpsMeter=new xw;renderScale=new bw;frameLoop;lastTime=0;paused=!1;lastHandledToken=-1;reviveGranted=null;unsubscribeSound=()=>{};unsubscribeBestScore=()=>{};unsubscribeRemix=()=>{};unsubscribeLeaderboard=()=>{};unsubscribeConnection=()=>{};unsubscribeChallenge=()=>{};uninterruptedRun(){return this.game.chaseKind===null&&!this.royale.active&&Le.getSnapshot().id===null}reviveKind(){return oC(Xt.getSnapshot())}reviveAvailable(){return aC(this.reviveKind(),Hn.getSnapshot())&&!this.game.wasRevived&&this.uninterruptedRun()}offeredRevive(){return this.reviveAvailable()?this.reviveKind():null}revivedWith(){return this.game.wasRevived?this.reviveGranted:null}adHoldsInput(){return eu(Hn.getSnapshot())||xp(tl.getSnapshot())}revive(){const i=this.offeredRevive();i!==null&&cC(i).then(l=>{l&&(this.reviveGranted=i,this.game.revive())})}playOn(){const i=this.uninterruptedRun()&&$a.due();if(this.chase.leaveBoardChallenge(),this.challengeModeFinished()&&(this.chase.clearLinkArm(),mC()),i){$a.show().then(()=>this.game.restart());return}this.game.restart()}challengeModeFinished(){const{id:i,status:l}=Le.getSnapshot();return i===null?!1:l!=="ready"||this.chase.lastChasedLink!==null}retryChallenge(){const{id:i,status:l}=Le.getSnapshot();return i===null||l!=="error"?!1:(Xp(`/vs/${i}`),!0)}applyChase(i){this.game.setChase(i.setChase),i.restart&&this.game.restart()}toggleChase(){if(Le.getSnapshot().id!==null)return!1;const i=this.chase.toggle(Dn.getSnapshot());return i?(this.applyChase(i),!0):!1}challengeAgain(){const i=this.chase.challengeAgain();i&&this.applyChase(i)}boardModalStatus(){const{target:i,status:l}=It.getSnapshot();return i?l:null}boardModalView(){const{target:i,status:l}=It.getSnapshot();return i?{name:i.name,score:i.score,status:l}:null}openRowChallenge(i){const l=this.lastLeaderboardView,u=l&&i{const{fetchBoardGhost:l}=await import("./boardGhostFetch-rA6L-Vw3.js");return{fetchBoardGhost:l}},__vite__mapDeps([2,1])).then(({fetchBoardGhost:l})=>l(i.mode,i.identity)).then(l=>this.resolveBoardChallenge(i,l),()=>this.resolveBoardChallenge(i,void 0)))}resolveBoardChallenge(i,l){It.getSnapshot().target===i&&(l===void 0?It.publish({target:i,status:"error",ghost:null}):l===null?It.publish({target:i,status:"missing",ghost:null}):It.publish({target:i,status:"ready",ghost:{name:i.name,score:l.score,seed:l.seed,flaps:l.flaps,simVersion:l.simVersion}}))}handleBoardModal(i){if(i==="close"){this.closeBoardModal();return}const{status:l,ghost:u}=It.getSnapshot();l!=="ready"||!u||(this.closeBoardModal(),this.applyChase(this.chase.confirmBoardChase(u)))}closeBoardModal(){It.publish({target:null,status:"loading",ghost:null})}reconcileChallenge(){const i=this.chase.reconcileLink(Le.getSnapshot(),this.game.state);i&&this.applyChase(i)}reconcileChase(){const i=this.chase.reconcileDaily(Dn.getSnapshot(),this.game.state);i&&this.applyChase(i),this.reconcileChallenge()}refreshGhost(){const i=Dn.getSnapshot().ghost;Dn.publish({status:"loading",ghost:i}),lt(async()=>{const{fetchDailyWinnerGhost:l}=await import("./ghostFetch-oIExdeNQ.js");return{fetchDailyWinnerGhost:l}},__vite__mapDeps([3,1])).then(({fetchDailyWinnerGhost:l})=>l()).then(l=>Dn.publish(l?{status:"ready",ghost:l}:{status:"empty",ghost:null}),()=>Dn.publish({status:"error",ghost:i}))}shareCurrentScore(){const{score:i,bestScore:l,isNewBest:u,medal:c}=this.game.snapshot,f=vn.getSnapshot().name;La("score_card",i),this.runChallenge.ensureId("share",Xt.getSnapshot().challengeLinks,this.connected()).then(async h=>({challengeId:h,outcome:await Q1({score:i,best:l,isNewBest:u,medal:c,playerName:f},h?{id:h,score:i,challengerName:f}:null)})).then(({challengeId:h,outcome:g})=>{Na("score_card",g,i,h!==null),this.showToast(lC(g))})}showToast(i){i&&(this.toast={message:i,expiresAt:this.lastTime+kC*1e3})}activeToast(){return this.toast?this.lastTime>=this.toast.expiresAt?(this.toast=null,null):this.toast.message:null}connected(){return Fn.getSnapshot().status==="connected"}gameOverButtonsState(){return SC(this.chase.lastChasedLink,this.chase.hasBoardChallenge,this.runChallenge.run,this.connected(),this.reviveAvailable())}shareChallenge(i){const l=this.runChallenge.run;!l||l.score<1||(La("challenge",l.score),this.runChallenge.mintId(i).then(async u=>{if(!u)return{outcome:"failed",id:null};const{shareRunAsChallenge:c}=await lt(async()=>{const{shareRunAsChallenge:f}=await import("./challengeActions-Cc29Ejge.js");return{shareRunAsChallenge:f}},[]);return c(l,i,vn.getSnapshot().name,u)}).then(({outcome:u,id:c})=>{Na("challenge",u,l.score,c!==null),this.showToast(Nh(u))}))}shareMyChallenge(){const i=Ka.getSnapshot().latest;if(!i)return!1;La("my_challenge",i.score);const l=jp({id:i.id,score:i.score,challengerName:vn.getSnapshot().name});return lt(async()=>{const{shareChallengeText:u}=await import("./challengeShare-DjjA2nzb.js");return{shareChallengeText:u}},[]).then(({shareChallengeText:u})=>u(l)).then(u=>{Na("my_challenge",u,i.score,!0),this.showToast(Nh(u))}),!0}gameOverScreenState(i){const l=this.gameOverBoard.compose(vi.getSnapshot(),{playerName:vn.getSnapshot().name,bestScore:i,connected:Fn.getSnapshot().status==="connected",reportStatus:Qw.getSnapshot().status,countdown:Va(ja(Date.now()))});return this.leaderboardScroll.setTotalRows(l?.top.length??0),this.lastLeaderboardView=l,{carousel:this.gameOverCarousel,leaderboard:l,leaderboardScrollOffset:this.leaderboardScroll.offset,leaderboardRefreshing:Fp.getSnapshot().status==="refreshing",toast:this.activeToast(),rowChase:this.chase.armedSource!=="link",boardModal:this.boardModalView(),buttons:this.gameOverButtonsState()}}start(){this.renderer.loadAll().then(()=>Bp.publish(!0)),sl(()=>{kh.init()}),this.refreshGhost(),this.unsubscribeSound=this.game.onSound(l=>kh.play(l)),this.unsubscribeBestScore=this.game.onBestScoreChanged(kw),this.unsubscribeRemix=Ws.subscribe(this.handleRemixUpdate),this.unsubscribeLeaderboard=vi.subscribe(()=>{this.gameOverBoard.handleLeaderboardChange(vi.getSnapshot(),this.lastState==="gameover")}),this.handleRemixUpdate(),window.__game=this.game;const i=()=>this.game.setNetMode(Fn.getSnapshot().mode);i(),this.unsubscribeConnection=Fn.subscribe(i),this.unsubscribeChallenge=Le.subscribe(()=>this.reconcileChallenge()),this.reconcileChallenge(),window.addEventListener("resize",this.handleResize),window.addEventListener("keydown",this.handleKeyDown),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.canvas.addEventListener("pointerdown",this.handlePointerDown),this.canvas.addEventListener("pointermove",this.handlePointerMove),this.canvas.addEventListener("pointerup",this.handlePointerUp),this.canvas.addEventListener("pointercancel",this.handlePointerCancel),this.canvas.addEventListener("wheel",this.handleWheel,{passive:!1}),this.handleResize(),this.lastTime=performance.now(),this.frameLoop.start()}dispose(){window.removeEventListener("resize",this.handleResize),window.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.canvas.removeEventListener("pointerdown",this.handlePointerDown),this.canvas.removeEventListener("pointermove",this.handlePointerMove),this.canvas.removeEventListener("pointerup",this.handlePointerUp),this.canvas.removeEventListener("pointercancel",this.handlePointerCancel),this.canvas.removeEventListener("wheel",this.handleWheel),this.frameLoop.stop(),this.unsubscribeSound(),this.unsubscribeBestScore(),this.unsubscribeRemix(),this.unsubscribeLeaderboard(),this.unsubscribeConnection(),this.unsubscribeChallenge()}handleRemixUpdate=()=>{const i=Ws.getSnapshot();if(i.requestToken!==this.lastHandledToken)if(this.lastHandledToken=i.requestToken,i.status==="loading"&&i.themeMap){const l=i.requestToken;this.renderer.applyTheme(i.themeMap).then(()=>{Ws.getSnapshot().requestToken===l&&Ws.setStatus("applied")})}else i.status==="idle"&&this.renderer.clearTheme()};handleResize=()=>{const i=(window.devicePixelRatio||1)*this.renderScale.scale;this.camera.handleResize(window.innerWidth,window.innerHeight,i,Pw()),this.canvas.width!==this.camera.canvasW&&(this.canvas.width=this.camera.canvasW),this.canvas.height!==this.camera.canvasH&&(this.canvas.height=this.camera.canvasH);const l=`${window.innerWidth}px`,u=`${window.innerHeight}px`;this.canvas.style.width!==l&&(this.canvas.style.width=l),this.canvas.style.height!==u&&(this.canvas.style.height=u)};handleKeyDown=i=>{if(!Ei.getSnapshot()&&!this.adHoldsInput()){if(i.code==="KeyP"){i.preventDefault(),this.paused=!this.paused;return}(i.code==="Space"||i.code==="ArrowUp")&&i.preventDefault(),this.game.state==="play"&&_C.has(i.code)&&i.preventDefault(),this.inputRouter.handleKeyDown(i.code)}};handleVisibilityChange=()=>{if(document.visibilityState==="hidden"){this.inputRouter.handlePointerCancel();return}this.lastTime=performance.now(),this.timestep.reset(),this.frameLoop.restart()};handlePointerDown=i=>{this.inputRouter.handlePointerDown(i.clientX,i.clientY),this.tryCapturePointer(i.pointerId)};tryCapturePointer(i){try{this.canvas.setPointerCapture(i)}catch{return}}handlePointerMove=i=>{this.inputRouter.handlePointerMove(i.clientX,i.clientY)};handlePointerUp=i=>{this.inputRouter.handlePointerUp(i.clientX,i.clientY)};handlePointerCancel=()=>{this.inputRouter.handlePointerCancel()};handleWheel=i=>{if(this.game.state==="play"){i.preventDefault();return}if(this.game.state!=="gameover"||!this.leaderboardScroll.canScroll)return;if(this.boardModalStatus()!==null){i.preventDefault();return}const l=this.camera.screenToWorld(i.clientX,i.clientY),u=lu(this.camera.frameW,this.camera.safeBottomY);fp(l.x,l.y,u,this.gameOverCarousel)&&(i.preventDefault(),this.leaderboardScroll.scrollBy(this.camera.cssPixelsToWorld(i.deltaY)))};frame=i=>{const l=(i-this.lastTime)/1e3;if(this.lastTime=i,this.paused)this.timestep.reset();else{const c=this.timestep.advance(l);for(let f=0;f{const i=r.current;if(!i)return;const l=new AC(i);return l.start(),()=>l.dispose()},[]),P.jsx("canvas",{ref:r,style:{display:"block",touchAction:"none"}})}function RC(){const r=qe(Bp);return P.jsxs("div",{className:"loading-overlay","data-loaded":r,children:[P.jsx("img",{className:"loading-overlay__logo",src:"/sprites/logo.webp",alt:"Flappy Bird"}),P.jsx("div",{className:"loading-overlay__spinner"}),P.jsx("div",{className:"loading-overlay__label",children:"Loading…"})]})}const LC={"@":"a",$:"s","!":"i"},NC={0:"o",1:"i",3:"e",4:"a",5:"s",7:"t",8:"b"},OC=["beaner","bitch","blowjob","cunt","dildo","faggot","fagot","fuck","hitler","incest","jizz","kike","molest","nigga","nigger","penis","pussy","raghead","shit","slut","towelhead","tranny","vagina","wetback","whore"],PC=new Set(["anal","arse","ass","boobs","chink","chinks","cock","cocks","coon","coons","cum","dick","dicks","dyke","dykes","fag","fags","gook","gooks","hoe","hoes","hooker","hookers","nazi","nazis","negro","negroes","nig","nigs","paki","pedo","pedos","porn","porno","rape","raped","rapist","retard","retarded","retards","sex","sexy","spic","spics","tits","twat","twats","wank","wanker"]),IC=new Set(["r","k","i"]);function rl(r){return r>="a"&&r<="z"}function Oh(r){return r>="0"&&r<="9"}function MC(r){const i=[...r.toLowerCase()].map(c=>LC[c]??c),l=[...i];let u=0;for(;u0&&rl(i[u-1]),h=crl(c)?c:" ").join("").split(/\s+/).some(c=>PC.has(c))}const Kp=1,Qa=24;function Qp(r){const i=r.trim(),l=[...i].length;return lQa?{ok:!1,reason:"length"}:BC(i)?{ok:!1,reason:"blocked"}:{ok:!0,name:i}}function Hk(r){const i=Qp(r);return i.ok?i.name:null}function xC(){const r=qe(Ei),i=qe(vn).name,[l,u]=fe.useState(""),[c,f]=fe.useState(null);if(fe.useEffect(()=>{r&&(u(i??""),f(null))},[r,i]),!r)return null;const h=async _=>{_.preventDefault();const w=Qp(l);if(!w.ok){f(w.reason);return}const{submitPlayerName:O}=await lt(async()=>{const{submitPlayerName:R}=await import("./nameGate-CjjPXEDN.js");return{submitPlayerName:R}},__vite__mapDeps([4,5,1]));O(l)?(f(null),Ei.close()):f("blocked")},g=()=>{f(null),Ei.close()};return P.jsx("div",{className:"name-gate",children:P.jsxs("form",{className:"name-gate__panel",onSubmit:h,children:[P.jsx("button",{type:"button",className:"name-gate__close",onClick:g,"aria-label":"Close",children:"×"}),P.jsx("h2",{className:"name-gate__title",children:"Edit your name"}),P.jsx("p",{className:"name-gate__hint",children:"Shown on the leaderboard."}),P.jsx("input",{className:"name-gate__input",autoFocus:!0,maxLength:Qa,value:l,placeholder:"Your name",onChange:_=>{u(_.target.value),f(null)}}),c==="length"&&P.jsxs("p",{className:"name-gate__error",children:["Enter ",Kp,"–",Qa," characters."]}),c==="blocked"&&P.jsx("p",{className:"name-gate__error",children:"That name isn't allowed."}),P.jsx("div",{className:"name-gate__actions",children:P.jsx("button",{type:"submit",className:"name-gate__button",children:"Save"})})]})})}function Zp(r){let i=null,l,u="closed",c=null,f=null,h=null;const g=b=>{u=b,c?.(b)},_=()=>{h!==null&&(window.clearTimeout(h),h=null)},w=(b,ee)=>{_(),h=window.setTimeout(ee,b)},O=()=>{Je((b,ee)=>{ee.Config.getKnown(r.knownName).with(M=>M.hide()),l&&b.removePlacement(l.instance()),l=void 0})},R=b=>{if(f===null)return;_();const ee=f;f=null,g("closed"),c=null,O(),ee(b)},L=()=>{u==="loading"&&Je((b,ee)=>{ee.Config.getKnown(r.knownName).with(M=>{const J=M.videoApi();if(!J.hasAd){R("unfilled");return}g("playing"),M.show(),J.play()})})},z=()=>{w(r.playbackTimeoutMs,()=>R("failed"))},Q=b=>{Je((ee,M)=>{l=M.Config.get(r.placementName).display(b),l.setKnown(r.knownName),M.Config.getKnown(r.knownName).with(J=>{const se=J.videoApi(),Ae=M.Placement.PLACEMENT_EVENTS;J.hide(),J.on(Ae.BEFORE_EXECUTE,()=>J.hide(),!1),J.on(Ae.SLOT_VIDEO_AD_SKIPPED,()=>R("skipped"),!1),J.on(Ae.SLOT_VIDEO_AD_ERROR,()=>R("failed"),!1),se.on(se.EVENTS.LOADED,L,!1),se.on(se.EVENTS.STARTED,z,!1),se.on(se.EVENTS.COMPLETE,()=>R("completed"),!1)})})},X=()=>{R(u==="playing"?"failed":"unfilled")};return{init(b){i=b},play(b){const ee=i;return ee===null||f!==null?Promise.resolve("failed"):(c=b,g("loading"),new Promise(M=>{f=M,w(r.fillTimeoutMs,X),Q(ee)}))}}}const FC={loading:"loading",playing:"playing",closed:"closed"},qp=Zp({placementName:"video_reward_pvp",knownName:"pvpReward",fillTimeoutMs:1e4,playbackTimeoutMs:6e4});function Jp(r){qp.init(r)}function HC(){return Hn.getSnapshot()!=="offered"?Promise.resolve(!1):qp.play(r=>Hn.publish(FC[r])).then(r=>r==="completed")}const UC=Object.freeze(Object.defineProperty({__proto__:null,initRewardedAd:Jp,playRewardedAd:HC},Symbol.toStringTag,{value:"Module"}));function em({open:r,label:i,init:l}){const u=qe(Xt).ads,c=fe.useRef(null);return fe.useEffect(()=>{u&&c.current&&l(c.current)},[u,l]),P.jsxs("div",{className:"video-ad-overlay","data-open":r||void 0,children:[i!==null&&P.jsx("div",{className:"video-ad-overlay__label",children:i}),P.jsx("div",{ref:c,className:"video-ad-overlay__video"})]})}const GC="LOADING AD…";function zC(){const r=qe(Hn);return P.jsx(em,{open:eu(r),label:r==="loading"?GC:null,init:Jp})}const tm="video_preroll_pvp",bC="instream",nm=3e3,rm=45e3,WC={loading:"loading",playing:"playing",closed:"idle"},im=Zp({placementName:tm,knownName:bC,fillTimeoutMs:nm,playbackTimeoutMs:rm});function sm(r){im.init(r)}function YC(r){return tl.getSnapshot()!=="idle"?Promise.resolve("failed"):im.play(i=>{tl.publish(WC[i]),r(i)})}const jC=Object.freeze(Object.defineProperty({__proto__:null,INSTREAM_FILL_TIMEOUT_MS:nm,INSTREAM_PLACEMENT_NAME:tm,INSTREAM_PLAYBACK_TIMEOUT_MS:rm,initInstreamAd:sm,playInstreamAd:YC},Symbol.toStringTag,{value:"Module"})),VC="AD — YOUR GAME RESUMES AFTER THIS";function $C(){const r=xp(qe(tl));return P.jsx(em,{open:r,label:r?VC:null,init:sm})}function Ph(){return P.jsxs(P.Fragment,{children:[P.jsx(TC,{}),P.jsx(RC,{}),P.jsx(xC,{}),P.jsx(zC,{}),P.jsx($C,{})]})}function lm({placementName:r,minHeight:i}){return ll()?P.jsx(nu,{placementName:r,minHeight:i}):null}function XC(){return P.jsxs("div",{className:"page",children:[P.jsx("h1",{className:"page__title",children:"About"}),P.jsx("p",{children:"Welcome to Flappy Bird, the best place to play Flappy Bird online."}),P.jsxs("p",{children:["For any email-based inquiries please contact"," ",P.jsx("a",{className:"page__link",href:"mailto:support@flappybird.io",children:"support@flappybird.io"}),"."]}),P.jsx("p",{className:"page__fine",children:"Game and Site © 2026 Flappy Bird LLC"}),P.jsx(lm,{placementName:"mobile_mpu",minHeight:250})]})}function KC(r){const[i,l]=fe.useState(()=>Va(ja(Date.now())));return fe.useEffect(()=>{if(!r)return;const u=()=>l(Va(ja(Date.now())));u();const c=window.setInterval(u,1e3);return()=>window.clearInterval(c)},[r]),i}function QC({row:r,isSelf:i}){return P.jsxs("li",{className:"leaderboard-row","data-you":i||void 0,children:[P.jsx("span",{className:`leaderboard-row__rank leaderboard-row__rank--${r.tier}`,children:r.rank}),P.jsx("span",{className:"leaderboard-row__name",children:r.name}),P.jsx("span",{className:"leaderboard-row__score",children:r.score})]})}function ZC(){const{status:r,identity:i}=qe(Fn),l=qe(vi),u=qe(Fp),c=qe(vn).name,{bestScore:f}=qe(Mt),[h,g]=fe.useState("daily"),_=KC(h==="daily"),w=Qh(l,c,f,h,_,!1);return P.jsxs("div",{className:"page leaderboard-page",children:[P.jsxs("div",{className:"leaderboard-panel",children:[P.jsx("div",{className:"leaderboard-panel__ribbon",children:P.jsxs("div",{className:"leaderboard-tabs",children:[P.jsx("button",{type:"button",className:"leaderboard-tab","data-active":h==="daily"||void 0,onClick:()=>g("daily"),children:"DAILY"}),P.jsx("button",{type:"button",className:"leaderboard-tab","data-active":h==="allTime"||void 0,onClick:()=>g("allTime"),children:"ALL TIME"})]})}),w.dailyResetCountdown&&P.jsxs("p",{className:"leaderboard-countdown",children:["RESETS IN ",w.dailyResetCountdown]}),w.top.length>0?P.jsx("ol",{className:"leaderboard-panel__rows",children:w.top.map(O=>P.jsx(QC,{row:O,isSelf:O.identity===i},O.identity))}):r==="connecting"||u.status==="refreshing"?P.jsxs("div",{className:"leaderboard-panel__loading",children:[P.jsx("span",{className:"leaderboard-panel__spinner"}),P.jsx("p",{className:"leaderboard-panel__notice",children:"LOADING…"})]}):r==="connected"?P.jsx("p",{className:"leaderboard-panel__notice",children:"NO SCORES YET"}):P.jsx("p",{className:"leaderboard-panel__notice",children:"OFFLINE"}),w.you!==null&&(r==="connected"||w.top.length>0)&&P.jsxs("div",{className:"leaderboard-you",children:[P.jsx("span",{className:"leaderboard-you__rank",children:w.you.rank??"-"}),P.jsx("span",{className:"leaderboard-you__name",children:"YOU"}),P.jsx("span",{className:"leaderboard-you__score",children:w.you.score})]})]}),P.jsx(nu,{placementName:"video",minHeight:280}),P.jsx(lm,{placementName:"mobile_mpu",minHeight:250})]})}const om=["/about","/ads-test"],qC=["/leaderboard",...om];function JC(r){return r==="/ads-test"?Yh():qC.includes(r)}function Ih(r){switch(r){case"/about":return P.jsx(XC,{});case"/leaderboard":return P.jsx(ZC,{});case"/ads-test":return P.jsx(Ph,{});default:return P.jsx(Ph,{})}}function ek(){const r=jh(),i=JC(r),l=i&&om.includes(r);return P.jsxs(P.Fragment,{children:[P.jsx(S0,{active:i,takeover:l,children:i?Ih(r):null}),!i&&Ih(r),P.jsx(nu,{placementName:"vertical_sticky"},r),P.jsx(E0,{content:i}),P.jsx(T0,{})]})}function tk(){try{return navigator.globalPrivacyControl===!0}catch{return!1}}const nk=["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","IS","LI","NO","GB","CH"];function rk(r){r("consent","default",{region:nk,ad_storage:"denied",analytics_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",wait_for_update:500}),r("consent","default",{ad_storage:"denied",analytics_storage:"granted",ad_user_data:"denied",ad_personalization:"denied"}),tk()&&r("consent","update",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied"})}function am(){const r=window.gtag;if(r)return r;window.dataLayer=window.dataLayer??[];function i(...l){window.dataLayer.push(arguments)}return window.gtag=i,rk(i),i}function ik(){return"G-9MH7SB6EF5"}const um={init(){const r=ik(),i=am(),l=document.createElement("script");l.async=!0,l.src=`https://www.googletagmanager.com/gtag/js?id=${r}`,document.head.appendChild(l),i("js",new Date),i("config",r)},track(r,i){window.gtag?.("event",r,i??{})}};function sk(r){return{deviceClass:ak(r),osFamily:ok(r),dpr:r.devicePixelRatio,viewportH:Math.round(r.viewportHeight)}}function lk(){return sk({userAgent:navigator.userAgent,devicePixelRatio:window.devicePixelRatio||1,viewportHeight:window.innerHeight,maxTouchPoints:navigator.maxTouchPoints??0})}function cm(r){return/Macintosh/.test(r.userAgent)&&r.maxTouchPoints>1}function ok(r){const{userAgent:i}=r;return/CrOS/.test(i)?"chromeos":/Android/.test(i)?"android":/iPhone|iPad|iPod/.test(i)||cm(r)?"ios":/Macintosh/.test(i)?"mac":/Windows/.test(i)?"windows":/Linux/.test(i)?"linux":"other"}function ak(r){const{userAgent:i}=r;return/iPad/.test(i)||cm(r)||/Android/.test(i)&&!/Mobile/.test(i)?"tablet":/Android|iPhone|iPod/.test(i)?"mobile":"desktop"}class du{registered=[];add(i){this.registered.push(i)}disposeAll(){const i=this.registered.splice(0);for(const l of i)l()}}const dm="flappy_runsLifetime";function uk(){try{const r=parseInt(localStorage.getItem(dm)??"0",10);return Number.isFinite(r)&&r>0?r:0}catch{return 0}}function ck(r){try{localStorage.setItem(dm,r.toString())}catch{return}}const dk=.25,Mh={pipeTop:"pipe_top",pipeBottom:"pipe_bottom",ground:"ground"};function fk(){const[r]=performance.getEntriesByType("navigation");return r?r.domInteractive:0}function hk(){return{device:lk(),input:typeof window>"u"?null:window,events:Li,now:()=>performance.now()-fk(),random:Math.random}}function Za(r){return Math.abs(r).toString(16)}function Dh(r){return Math.round(r/Ja*100)/100}function pk(r,i=hk()){const{ga:l,product:u}=r;let c="unknown",f=0,h=uk(),g=!1,_=!1;const w=()=>({device_class:i.device.deviceClass,os_family:i.device.osFamily,dpr:i.device.dpr,input_method:c,runs_this_session:f}),O=M=>({...w(),run_seed_hash:Za(M.seed),sim_version:M.simVersion}),R=M=>f===1?{reason:"first_of_session",sampleRate:1}:M.isNewBest?{reason:"new_best",sampleRate:1}:Hh(i.random,dk),L=()=>h!==1||_?{}:(_=!0,{$set_once:{first_played_at:new Date().toISOString()}}),z=(M,J)=>({score:M.score,duration_seconds:Dh(M.durationSteps),flap_count:M.flaps.length,death_pipe_index:M.score,seed_hash:Za(M.seed),sim_version:M.simVersion,device_class:i.device.deviceClass,os:i.device.osFamily,dpr:i.device.dpr,input_method:c,fps_bucket:M.fpsBucket,runs_this_session:f,ranked:M.ranked,is_new_best:M.isNewBest,death_kind:Mh[M.deathCause??"ground"],chase_kind:M.chaseKind,chase_outcome:M.chaseOutcome,chased_challenge_id:M.chasedChallengeId,revive_offered:M.reviveOffer!==null,revive_kind:M.reviveOffer,runs_lifetime:h,is_first_run_ever:h===1,...Da(J)}),Q=M=>({score:M.score,duration_seconds:Dh(M.durationSteps),death_kind:Mh[M.deathCause??"ground"],revive_kind:M.revivedWith,...O(M)}),X=M=>{c=M.pointerType==="mouse"?"mouse":"touch"},b=()=>{c="keyboard"},ee=new du;return ee.add(i.events.onRunStarted(M=>{if(M.reviveStep!==null){u?.track("run_revived",{score:M.score,revive_kind:M.revivedWith,...O(M)});return}f+=1,h+=1,ck(h),l.track("game_start",O(M)),g||(g=!0,l.track("first_flap_latency",{latency_ms:Math.round(i.now())}))})),ee.add(i.events.onRunEnded(({progress:M})=>{if(M.reviveStep!==null){u?.track("run_revived_completed",Q(M));return}if(l.track("game_over",{score:M.score,death_pipe_index:M.score,fps_bucket:M.fpsBucket,...O(M)}),M.isNewBest&&l.track("new_best_score",{score:M.score,...O(M)}),u){const J=R(M);J&&u.track("run_completed",{...z(M,J),...L()})}})),ee.add(i.events.onRunAbandoned(({progress:M})=>{const J={score:M.score,...O(M)};l.track("run_abandon",J),u?.track("run_abandon",{...J,...Da(jv),...L()})})),i.input?.addEventListener("pointerdown",X),i.input?.addEventListener("keydown",b),ee.add(()=>{i.input?.removeEventListener("pointerdown",X),i.input?.removeEventListener("keydown",b)}),()=>ee.disposeAll()}function mk(){"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})})}const gk={"/":{lang:"en",ogLocale:"en_US",title:"Play Flappy Bird Online — Free, No Download",description:"Play Flappy Bird online for free — no download, no signup. Tap to flap, dodge the pipes, and climb the global daily and all-time leaderboards."},"/leaderboard":{lang:"en",ogLocale:"en_US",title:"Flappy Bird Daily & All-Time Leaderboard",description:"Today's top Flappy Bird scores and the all-time best. The daily board resets at midnight UTC — play free and see where you rank."},"/about":{lang:"en",ogLocale:"en_US",title:"About — flappybird.io",description:"About flappybird.io — play Flappy Bird online free in your browser, with global daily and all-time leaderboards."},"/ads-test":{lang:"en",ogLocale:"en_US",title:"Ad placement test — flappybird.io",description:"Internal Venatus ad placement review page for flappybird.io."},"/vs":{lang:"en",ogLocale:"en_US",title:"Can you beat this Flappy Bird score?",description:"Same pipes. One winner. Tap to play — free, no download."},"/pt":{lang:"pt",ogLocale:"pt_BR",title:"Jogue Flappy Bird Online — Grátis, Sem Download | flappybird.io",description:"Jogue Flappy Bird grátis no navegador — sem download, sem cadastro. Toque para voar, desvie dos canos e dispute o ranking diário e de todos os tempos."},"/es":{lang:"es",ogLocale:"es_ES",title:"Juega a Flappy Bird Online — Gratis, Sin Descargas | flappybird.io",description:"Juega a Flappy Bird gratis en tu navegador: sin descargas ni registro. Toca para volar, esquiva las tuberías y compite en la clasificación diaria y de todos los tiempos."},"/tr":{lang:"tr",ogLocale:"tr_TR",title:"Flappy Bird Online Oyna — Ücretsiz, İndirmesiz | flappybird.io",description:"Flappy Bird'ü tarayıcınızda ücretsiz oynayın — indirme yok, kayıt yok. Dokunarak uçun, borulardan kaçının, günlük ve tüm zamanlar liderlik tablosunda yarışın."},"/vi":{lang:"vi",ogLocale:"vi_VN",title:"Chơi Flappy Bird Online — Miễn Phí, Không Cần Tải | flappybird.io",description:"Chơi Flappy Bird miễn phí ngay trên trình duyệt — không cần tải, không cần đăng ký. Chạm để bay, né ống và đua thứ hạng trên bảng xếp hạng hằng ngày và mọi thời đại."}},Pa="https://flappybird.io",Vs=gk,vk=/^\/vs\/[1-9A-HJ-NP-Za-km-z]{8}$/,yk=new Set(["/ads-test"]);function fm(r){if(vk.test(r)){const u=Vs["/vs"];return{title:u.title,description:u.description,lang:u.lang,canonical:`${Pa}/vs`,robots:"noindex, follow"}}const i=r in Vs&&r!=="/vs",l=i?Vs[r]:Vs["/"];return{title:l.title,description:l.description,lang:l.lang,canonical:i?`${Pa}${r==="/"?"/":r}`:`${Pa}/`,robots:yk.has(r)?"noindex, follow":null}}function Sk(r){let i=document.head.querySelector('meta[name="description"]');i||(i=document.createElement("meta"),i.name="description",document.head.appendChild(i)),i.content=r}function _k(r){let i=document.head.querySelector('link[rel="canonical"]');i||(i=document.createElement("link"),i.rel="canonical",document.head.appendChild(i)),i.href=r}function Ek(r){let i=document.head.querySelector('meta[name="robots"]');if(r===null){i?.remove();return}i||(i=document.createElement("meta"),i.name="robots",document.head.appendChild(i)),i.content=r}function wk(){const r=fm(Dt.getPath()).title,{state:i,score:l}=Mt.getSnapshot();return i==="play"?`${r} — ${l}`:r}function hm(){const r=wk();document.title!==r&&(document.title=r)}function Bh(){const r=fm(Dt.getPath());hm(),document.documentElement.lang=r.lang,Sk(r.description),_k(r.canonical),Ek(r.robots)}function Ck(){Bh();const r=Dt.subscribe(Bh),i=Mt.subscribe(hm);return()=>{r(),i()}}function kk(r){return Xp(r.getPath()),Le.subscribe(()=>{Le.getSnapshot().id===null&&$p(r.getPath())&&r.replace("/")})}const il="spacetime.identity-token",Ak=6e4;function pm(r){const i=r.split(".")[1];if(i===void 0)return null;try{return JSON.parse(atob(i.replace(/-/g,"+").replace(/_/g,"/")))}catch{return null}}function Tk(r){const i=pm(r);return i===null||typeof i.exp!="number"?!1:i.exp*1e3"u")return null;const r=localStorage.getItem(il);return r!==null&&Tk(r)?(localStorage.removeItem(il),null):r}function Gk(r){typeof localStorage>"u"||localStorage.setItem(il,r)}function zk(){typeof localStorage>"u"||localStorage.removeItem(il)}function Lk(r,i,l,u,c=mt){c.track("challenge_created",{score:i,seed_hash:Za(u),challenge_id:l,from:r}),r==="rematch"&&c.track("challenge_rematch_created")}function mm(r=mt,i=Li,l=Rk()!==null,u=Date.now){let c=!1,f=null;const h=new Set,g=new Map,_=()=>{const{id:L,status:z}=Le.getSnapshot();c||L===null||z==="idle"||(c=!0,r.track("challenge_link_opened",{challenge_id:L,is_new_player:!l}))},w=()=>{const{id:L,status:z}=Le.getSnapshot();if(L!==null){if(z==="loading"){h.has(L)||(f=u());return}z==="idle"||h.has(L)||(h.add(L),r.track("challenge_link_resolved",{challenge_id:L,status:z,ms:f===null?null:u()-f}),f=null)}},O=()=>{_(),w()};O();const R=new du;return R.add(Le.subscribe(O)),R.add(i.onRunEnded(({progress:L})=>{const{status:z,challenge:Q}=Le.getSnapshot();if(z!=="ready"||!Q||L.chasedChallengeId!==Q.id)return;const X=(g.get(Q.id)??0)+1;g.set(Q.id,X),r.track("challenge_run_completed",{challenge_id:Q.id,beat:L.score>Q.score,score_delta:L.score-Q.score,attempt_n:X})})),()=>R.disposeAll()}const bk=Object.freeze(Object.defineProperty({__proto__:null,startChallengeAnalytics:mm,trackChallengeCreated:Lk},Symbol.toStringTag,{value:"Module"}));function Nk(r=mt,i=Li){const l=new du;return l.add(i.onRunStarted(u=>{u.chaseKind==="daily"&&r.track("ghost_chase_start")})),l.add(i.onRunEnded(({progress:u})=>{u.chaseKind==="daily"&&u.chaseOutcome==="beat"&&r.track("ghost_chase_beaten")})),()=>l.disposeAll()}const Ok=10,gm="flappy_myChallenges";function Pk(r){if(typeof r!="object"||r===null)return!1;const i=r;return typeof i.id=="string"&&typeof i.score=="number"&&typeof i.mintedAt=="number"}function fu(r=hu()){if(!r)return[];try{const i=JSON.parse(r.getItem(gm)??"[]");return Array.isArray(i)?i.filter(Pk):[]}catch{return[]}}function Ik(r,i=hu()){const l=fu(i).filter(c=>c.id!==r.id),u=[r,...l].slice(0,Ok);return vm(u,i),u}function Mk(r,i=hu()){const l=fu(i).filter(u=>u.id!==r);return vm(l,i),l}function vm(r,i){if(i)try{i.setItem(gm,JSON.stringify(r))}catch{return}}function hu(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}const ym=6e4;function Dk(){return{storage:typeof localStorage>"u"?null:localStorage,fetchStats:r=>lt(()=>import("./challengeFetch-4jZo7wlv.js"),__vite__mapDeps([0,1])).then(i=>i.fetchChallengeStats(r)),fetchBestAttempt:r=>lt(()=>import("./challengeFetch-4jZo7wlv.js"),__vite__mapDeps([0,1])).then(i=>i.fetchChallengeBestAttempt(r)),schedule:sl,now:Date.now,game:Mt,status:Ka,product:mt}}function Sm(r){let i=Number.NEGATIVE_INFINITY,l=!1,u=null;const c=_=>{r.status.publish({latest:_}),_&&_.plays>0&&!l&&(l=!0,r.product.track("my_challenge_shown",{challenge_id:_.id,plays:_.plays,beats:_.beats,beaten:_.beats>0}))},f=async _=>{const w=await r.fetchStats(_.id);if(!w)return Mk(_.id,r.storage),null;const O=w.plays>0?await r.fetchBestAttempt(_.id):null;return{id:w.id,score:w.score,plays:w.plays,beats:w.beats,bestAttempt:O}},h=()=>{if(u)return u;const _=fu(r.storage)[0];return i=r.now(),_?(u=f(_).then(c,()=>{}).finally(()=>{u=null}),u):(c(null),Promise.resolve())},g=()=>{r.now()-i{h()});let _=r.game.getSnapshot().state==="getready";return r.game.subscribe(()=>{const w=r.game.getSnapshot().state==="getready";w&&!_&&g(),_=w})},noteMinted(_){Ik(_,r.storage),i=r.now(),c({id:_.id,score:_.score,plays:0,beats:0,bestAttempt:null})},refresh:h}}const _m=Sm(Dk()),Wk=Object.freeze(Object.defineProperty({__proto__:null,MY_CHALLENGE_REFRESH_INTERVAL_MS:ym,createMyChallengeStatus:Sm,myChallengeStatus:_m},Symbol.toStringTag,{value:"Module"})),Em=document.getElementById("root");if(!Em)throw new Error("Root element #root not found");Nv.createRoot(Em).render(P.jsx(fe.StrictMode,{children:P.jsx(ek,{})}));Ck();mm();Nk();kk(Dt);am();um.init();mt.init();mt.onFlagsReady(r=>{Xt.publish({resolved:!0,challengeLinks:r("challenge-links"),ads:r("ads-enabled"),instream:r("instream-video"),stickyDuringPlay:r("sticky-during-play")})});const wm=()=>{Xt.getSnapshot().ads&&sl(Iv)};Xt.subscribe(wm);wm();pk({ga:um,product:mt});tu.start();$a.start();_m.start();mk();let xh=null;Fn.subscribe(()=>{const r=Fn.getSnapshot().identity;r&&r!==xh&&(xh=r,mt.identify(r))});const Bk={isVisible:()=>Dt.getPath()==="/leaderboard",subscribe:r=>Dt.subscribe(r)};lt(async()=>{const{startNet:r}=await import("./bootstrap-CXNNrSQ7.js");return{startNet:r}},__vite__mapDeps([6,5,1,4])).then(({startNet:r})=>r({leaderboardSurface:Bk})).catch(r=>console.error("Failed to start the net stack",r));export{du as D,lt as _,jp as a,Vw as b,bk as c,Le as d,zk as e,lk as f,Fn as g,Sh as h,Uk as i,xk as j,vi as k,Fp as l,Fk as m,Wk as n,Ei as o,Hk as p,vn as q,kE as r,Cw as s,Rk as t,Li as u,Qw as v,Gk as w};