(function(){const z=document.createElement("link").relList;if(z&&z.supports&&z.supports("modulepreload"))return;for(const A of document.querySelectorAll('link[rel="modulepreload"]'))o(A);new MutationObserver(A=>{for(const _ of A)if(_.type==="childList")for(const C of _.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&o(C)}).observe(document,{childList:!0,subtree:!0});function b(A){const _={};return A.integrity&&(_.integrity=A.integrity),A.referrerPolicy&&(_.referrerPolicy=A.referrerPolicy),A.crossOrigin==="use-credentials"?_.credentials="include":A.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function o(A){if(A.ep)return;A.ep=!0;const _=b(A);fetch(A.href,_)}})();function f0(v){return v&&v.__esModule&&Object.prototype.hasOwnProperty.call(v,"default")?v.default:v}var df={exports:{}},An={};var zd;function s0(){if(zd)return An;zd=1;var v=Symbol.for("react.transitional.element"),z=Symbol.for("react.fragment");function b(o,A,_){var C=null;if(_!==void 0&&(C=""+_),A.key!==void 0&&(C=""+A.key),"key"in A){_={};for(var L in A)L!=="key"&&(_[L]=A[L])}else _=A;return A=_.ref,{$$typeof:v,type:o,key:C,ref:A!==void 0?A:null,props:_}}return An.Fragment=z,An.jsx=b,An.jsxs=b,An}var Ad;function o0(){return Ad||(Ad=1,df.exports=s0()),df.exports}var f=o0(),hf={exports:{}},Nn={},mf={exports:{}},vf={};var Nd;function r0(){return Nd||(Nd=1,(function(v){function z(x,M){var X=x.length;x.push(M);l:for(;0>>1,pl=x[ml];if(0>>1;mlA(D,X))RA(w,D)?(x[ml]=w,x[R]=X,ml=R):(x[ml]=D,x[N]=X,ml=N);else if(RA(w,X))x[ml]=w,x[R]=X,ml=R;else break l}}return M}function A(x,M){var X=x.sortIndex-M.sortIndex;return X!==0?X:x.id-M.id}if(v.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;v.unstable_now=function(){return _.now()}}else{var C=Date,L=C.now();v.unstable_now=function(){return C.now()-L}}var O=[],E=[],G=1,H=null,J=3,_l=!1,xl=!1,il=!1,El=!1,V=typeof setTimeout=="function"?setTimeout:null,Rl=typeof clearTimeout=="function"?clearTimeout:null,Tl=typeof setImmediate<"u"?setImmediate:null;function jl(x){for(var M=b(E);M!==null;){if(M.callback===null)o(E);else if(M.startTime<=x)o(E),M.sortIndex=M.expirationTime,z(O,M);else break;M=b(E)}}function el(x){if(il=!1,jl(x),!xl)if(b(O)!==null)xl=!0,fl||(fl=!0,bl());else{var M=b(E);M!==null&&Fl(el,M.startTime-x)}}var fl=!1,Q=-1,hl=5,Zl=-1;function $(){return El?!0:!(v.unstable_now()-Zlx&&$());){var ml=H.callback;if(typeof ml=="function"){H.callback=null,J=H.priorityLevel;var pl=ml(H.expirationTime<=x);if(x=v.unstable_now(),typeof pl=="function"){H.callback=pl,jl(x),M=!0;break t}H===b(O)&&o(O),jl(x)}else o(O);H=b(O)}if(H!==null)M=!0;else{var d=b(E);d!==null&&Fl(el,d.startTime-x),M=!1}}break l}finally{H=null,J=X,_l=!1}M=void 0}}finally{M?bl():fl=!1}}}var bl;if(typeof Tl=="function")bl=function(){Tl(al)};else if(typeof MessageChannel<"u"){var it=new MessageChannel,Ml=it.port2;it.port1.onmessage=al,bl=function(){Ml.postMessage(null)}}else bl=function(){V(al,0)};function Fl(x,M){Q=V(function(){x(v.unstable_now())},M)}v.unstable_IdlePriority=5,v.unstable_ImmediatePriority=1,v.unstable_LowPriority=4,v.unstable_NormalPriority=3,v.unstable_Profiling=null,v.unstable_UserBlockingPriority=2,v.unstable_cancelCallback=function(x){x.callback=null},v.unstable_forceFrameRate=function(x){0>x||125ml?(x.sortIndex=X,z(E,x),b(O)===null&&x===b(E)&&(il?(Rl(Q),Q=-1):il=!0,Fl(el,X-ml))):(x.sortIndex=pl,z(O,x),xl||_l||(xl=!0,fl||(fl=!0,bl()))),x},v.unstable_shouldYield=$,v.unstable_wrapCallback=function(x){var M=J;return function(){var X=J;J=M;try{return x.apply(this,arguments)}finally{J=X}}}})(vf)),vf}var _d;function d0(){return _d||(_d=1,mf.exports=r0()),mf.exports}var yf={exports:{}},Z={};var Md;function h0(){if(Md)return Z;Md=1;var v=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),C=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),J=Symbol.iterator;function _l(d){return d===null||typeof d!="object"?null:(d=J&&d[J]||d["@@iterator"],typeof d=="function"?d:null)}var xl={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},il=Object.assign,El={};function V(d,N,D){this.props=d,this.context=N,this.refs=El,this.updater=D||xl}V.prototype.isReactComponent={},V.prototype.setState=function(d,N){if(typeof d!="object"&&typeof d!="function"&&d!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,d,N,"setState")},V.prototype.forceUpdate=function(d){this.updater.enqueueForceUpdate(this,d,"forceUpdate")};function Rl(){}Rl.prototype=V.prototype;function Tl(d,N,D){this.props=d,this.context=N,this.refs=El,this.updater=D||xl}var jl=Tl.prototype=new Rl;jl.constructor=Tl,il(jl,V.prototype),jl.isPureReactComponent=!0;var el=Array.isArray;function fl(){}var Q={H:null,A:null,T:null,S:null},hl=Object.prototype.hasOwnProperty;function Zl(d,N,D){var R=D.ref;return{$$typeof:v,type:d,key:N,ref:R!==void 0?R:null,props:D}}function $(d,N){return Zl(d.type,N,d.props)}function al(d){return typeof d=="object"&&d!==null&&d.$$typeof===v}function bl(d){var N={"=":"=0",":":"=2"};return"$"+d.replace(/[=:]/g,function(D){return N[D]})}var it=/\/+/g;function Ml(d,N){return typeof d=="object"&&d!==null&&d.key!=null?bl(""+d.key):N.toString(36)}function Fl(d){switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:switch(typeof d.status=="string"?d.then(fl,fl):(d.status="pending",d.then(function(N){d.status==="pending"&&(d.status="fulfilled",d.value=N)},function(N){d.status==="pending"&&(d.status="rejected",d.reason=N)})),d.status){case"fulfilled":return d.value;case"rejected":throw d.reason}}throw d}function x(d,N,D,R,w){var F=typeof d;(F==="undefined"||F==="boolean")&&(d=null);var sl=!1;if(d===null)sl=!0;else switch(F){case"bigint":case"string":case"number":sl=!0;break;case"object":switch(d.$$typeof){case v:case z:sl=!0;break;case G:return sl=d._init,x(sl(d._payload),N,D,R,w)}}if(sl)return w=w(d),sl=R===""?"."+Ml(d,0):R,el(w)?(D="",sl!=null&&(D=sl.replace(it,"$&/")+"/"),x(w,N,D,"",function(Ua){return Ua})):w!=null&&(al(w)&&(w=$(w,D+(w.key==null||d&&d.key===w.key?"":(""+w.key).replace(it,"$&/")+"/")+sl)),N.push(w)),1;sl=0;var Il=R===""?".":R+":";if(el(d))for(var Ul=0;Ul"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(v)}catch(z){console.error(z)}}return v(),gf.exports=m0(),gf.exports}var Cd;function y0(){if(Cd)return Nn;Cd=1;var v=d0(),z=xf(),b=v0();function o(l){var t="https://react.dev/errors/"+l;if(1pl||(l.current=ml[pl],ml[pl]=null,pl--)}function D(l,t){pl++,ml[pl]=l.current,l.current=t}var R=d(null),w=d(null),F=d(null),sl=d(null);function Il(l,t){switch(D(F,t),D(w,l),D(R,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?Wr(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=Wr(t),l=$r(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}N(R),D(R,l)}function Ul(){N(R),N(w),N(F)}function Ua(l){l.memoizedState!==null&&D(sl,l);var t=R.current,e=$r(t,l.type);t!==e&&(D(w,l),D(R,e))}function _n(l){w.current===l&&(N(R),N(w)),sl.current===l&&(N(sl),En._currentValue=X)}var Ju,Tf;function Ae(l){if(Ju===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ju=t&&t[1]||"",Tf=-1)":-1n||s[a]!==y[n]){var S=` `+s[a].replace(" at new "," at ");return l.displayName&&S.includes("")&&(S=S.replace("",l.displayName)),S}while(1<=a&&0<=n);break}}}finally{Wu=!1,Error.prepareStackTrace=e}return(e=l?l.displayName||l.name:"")?Ae(e):""}function Yd(l,t){switch(l.tag){case 26:case 27:case 5:return Ae(l.type);case 16:return Ae("Lazy");case 13:return l.child!==t&&t!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return $u(l.type,!1);case 11:return $u(l.type.render,!1);case 1:return $u(l.type,!0);case 31:return Ae("Activity");default:return""}}function jf(l){try{var t="",e=null;do t+=Yd(l,e),e=l,l=l.return;while(l);return t}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var Fu=Object.prototype.hasOwnProperty,ku=v.unstable_scheduleCallback,Iu=v.unstable_cancelCallback,Xd=v.unstable_shouldYield,Qd=v.unstable_requestPaint,ft=v.unstable_now,Ld=v.unstable_getCurrentPriorityLevel,zf=v.unstable_ImmediatePriority,Af=v.unstable_UserBlockingPriority,Mn=v.unstable_NormalPriority,Zd=v.unstable_LowPriority,Nf=v.unstable_IdlePriority,Vd=v.log,wd=v.unstable_setDisableYieldValue,Ca=null,st=null;function Pt(l){if(typeof Vd=="function"&&wd(l),st&&typeof st.setStrictMode=="function")try{st.setStrictMode(Ca,l)}catch{}}var ot=Math.clz32?Math.clz32:Wd,Kd=Math.log,Jd=Math.LN2;function Wd(l){return l>>>=0,l===0?32:31-(Kd(l)/Jd|0)|0}var On=256,Dn=262144,Un=4194304;function Ne(l){var t=l&42;if(t!==0)return t;switch(l&-l){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Cn(l,t,e){var a=l.pendingLanes;if(a===0)return 0;var n=0,u=l.suspendedLanes,c=l.pingedLanes;l=l.warmLanes;var i=a&134217727;return i!==0?(a=i&~u,a!==0?n=Ne(a):(c&=i,c!==0?n=Ne(c):e||(e=i&~l,e!==0&&(n=Ne(e))))):(i=a&~u,i!==0?n=Ne(i):c!==0?n=Ne(c):e||(e=a&~l,e!==0&&(n=Ne(e)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,e=t&-t,u>=e||u===32&&(e&4194048)!==0)?t:n}function Ha(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function $d(l,t){switch(l){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _f(){var l=Un;return Un<<=1,(Un&62914560)===0&&(Un=4194304),l}function Pu(l){for(var t=[],e=0;31>e;e++)t.push(l);return t}function Ra(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Fd(l,t,e,a,n,u){var c=l.pendingLanes;l.pendingLanes=e,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=e,l.entangledLanes&=e,l.errorRecoveryDisabledLanes&=e,l.shellSuspendCounter=0;var i=l.entanglements,s=l.expirationTimes,y=l.hiddenUpdates;for(e=c&~e;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var eh=/[\n"\\]/g;function pt(l){return l.replace(eh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function uc(l,t,e,a,n,u,c,i){l.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?l.type=c:l.removeAttribute("type"),t!=null?c==="number"?(t===0&&l.value===""||l.value!=t)&&(l.value=""+bt(t)):l.value!==""+bt(t)&&(l.value=""+bt(t)):c!=="submit"&&c!=="reset"||l.removeAttribute("value"),t!=null?cc(l,c,bt(t)):e!=null?cc(l,c,bt(e)):a!=null&&l.removeAttribute("value"),n==null&&u!=null&&(l.defaultChecked=!!u),n!=null&&(l.checked=n&&typeof n!="function"&&typeof n!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?l.name=""+bt(i):l.removeAttribute("name")}function Qf(l,t,e,a,n,u,c,i){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(l.type=u),t!=null||e!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){nc(l);return}e=e!=null?""+bt(e):"",t=t!=null?""+bt(t):e,i||t===l.value||(l.value=t),l.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,l.checked=i?l.checked:!!a,l.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(l.name=c),nc(l)}function cc(l,t,e){t==="number"&&Bn(l.ownerDocument)===l||l.defaultValue===""+e||(l.defaultValue=""+e)}function Ie(l,t,e,a){if(l=l.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(qt)try{var Ya={};Object.defineProperty(Ya,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Ya,Ya),window.removeEventListener("test",Ya,Ya)}catch{rc=!1}var te=null,dc=null,Gn=null;function Wf(){if(Gn)return Gn;var l,t=dc,e=t.length,a,n="value"in te?te.value:te.textContent,u=n.length;for(l=0;l=La),ls=" ",ts=!1;function es(l,t){switch(l){case"keyup":return Oh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function as(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var ea=!1;function Uh(l,t){switch(l){case"compositionend":return as(t);case"keypress":return t.which!==32?null:(ts=!0,ls);case"textInput":return l=t.data,l===ls&&ts?null:l;default:return null}}function Ch(l,t){if(ea)return l==="compositionend"||!gc&&es(l,t)?(l=Wf(),Gn=dc=te=null,ea=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:e,offset:t-l};l=a}l:{for(;e;){if(e.nextSibling){e=e.nextSibling;break l}e=e.parentNode}e=void 0}e=rs(e)}}function hs(l,t){return l&&t?l===t?!0:l&&l.nodeType===3?!1:t&&t.nodeType===3?hs(l,t.parentNode):"contains"in l?l.contains(t):l.compareDocumentPosition?!!(l.compareDocumentPosition(t)&16):!1:!1}function ms(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var t=Bn(l.document);t instanceof l.HTMLIFrameElement;){try{var e=typeof t.contentWindow.location.href=="string"}catch{e=!1}if(e)l=t.contentWindow;else break;t=Bn(l.document)}return t}function Sc(l){var t=l&&l.nodeName&&l.nodeName.toLowerCase();return t&&(t==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||t==="textarea"||l.contentEditable==="true")}var Qh=qt&&"documentMode"in document&&11>=document.documentMode,aa=null,xc=null,Ka=null,Ec=!1;function vs(l,t,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Ec||aa==null||aa!==Bn(a)||(a=aa,"selectionStart"in a&&Sc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ka&&wa(Ka,a)||(Ka=a,a=Du(xc,"onSelect"),0>=c,n-=c,Dt=1<<32-ot(t)+n|e<W?(ll=B,B=null):ll=B.sibling;var ul=g(h,B,m[W],T);if(ul===null){B===null&&(B=ll);break}l&&B&&ul.alternate===null&&t(h,B),r=u(ul,r,W),nl===null?q=ul:nl.sibling=ul,nl=ul,B=ll}if(W===m.length)return e(h,B),tl&&Yt(h,W),q;if(B===null){for(;WW?(ll=B,B=null):ll=B.sibling;var Te=g(h,B,ul.value,T);if(Te===null){B===null&&(B=ll);break}l&&B&&Te.alternate===null&&t(h,B),r=u(Te,r,W),nl===null?q=Te:nl.sibling=Te,nl=Te,B=ll}if(ul.done)return e(h,B),tl&&Yt(h,W),q;if(B===null){for(;!ul.done;W++,ul=m.next())ul=j(h,ul.value,T),ul!==null&&(r=u(ul,r,W),nl===null?q=ul:nl.sibling=ul,nl=ul);return tl&&Yt(h,W),q}for(B=a(B);!ul.done;W++,ul=m.next())ul=p(B,h,W,ul.value,T),ul!==null&&(l&&ul.alternate!==null&&B.delete(ul.key===null?W:ul.key),r=u(ul,r,W),nl===null?q=ul:nl.sibling=ul,nl=ul);return l&&B.forEach(function(i0){return t(h,i0)}),tl&&Yt(h,W),q}function gl(h,r,m,T){if(typeof m=="object"&&m!==null&&m.type===il&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case _l:l:{for(var q=m.key;r!==null;){if(r.key===q){if(q=m.type,q===il){if(r.tag===7){e(h,r.sibling),T=n(r,m.props.children),T.return=h,h=T;break l}}else if(r.elementType===q||typeof q=="object"&&q!==null&&q.$$typeof===hl&&Ge(q)===r.type){e(h,r.sibling),T=n(r,m.props),Ia(T,m),T.return=h,h=T;break l}e(h,r);break}else t(h,r);r=r.sibling}m.type===il?(T=Ce(m.props.children,h.mode,T,m.key),T.return=h,h=T):(T=Wn(m.type,m.key,m.props,null,h.mode,T),Ia(T,m),T.return=h,h=T)}return c(h);case xl:l:{for(q=m.key;r!==null;){if(r.key===q)if(r.tag===4&&r.stateNode.containerInfo===m.containerInfo&&r.stateNode.implementation===m.implementation){e(h,r.sibling),T=n(r,m.children||[]),T.return=h,h=T;break l}else{e(h,r);break}else t(h,r);r=r.sibling}T=Mc(m,h.mode,T),T.return=h,h=T}return c(h);case hl:return m=Ge(m),gl(h,r,m,T)}if(Fl(m))return U(h,r,m,T);if(bl(m)){if(q=bl(m),typeof q!="function")throw Error(o(150));return m=q.call(m),Y(h,r,m,T)}if(typeof m.then=="function")return gl(h,r,tu(m),T);if(m.$$typeof===Tl)return gl(h,r,kn(h,m),T);eu(h,m)}return typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint"?(m=""+m,r!==null&&r.tag===6?(e(h,r.sibling),T=n(r,m),T.return=h,h=T):(e(h,r),T=_c(m,h.mode,T),T.return=h,h=T),c(h)):e(h,r)}return function(h,r,m,T){try{ka=0;var q=gl(h,r,m,T);return ma=null,q}catch(B){if(B===ha||B===Pn)throw B;var nl=dt(29,B,null,h.mode);return nl.lanes=T,nl.return=h,nl}}}var Xe=Gs(!0),Ys=Gs(!1),ce=!1;function Qc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lc(l,t){l=l.updateQueue,t.updateQueue===l&&(t.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function ie(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function fe(l,t,e){var a=l.updateQueue;if(a===null)return null;if(a=a.shared,(cl&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=Jn(l),Es(l,null,e),t}return Kn(l,a,t,e),Jn(l)}function Pa(l,t,e){if(t=t.updateQueue,t!==null&&(t=t.shared,(e&4194048)!==0)){var a=t.lanes;a&=l.pendingLanes,e|=a,t.lanes=e,Of(l,e)}}function Zc(l,t){var e=l.updateQueue,a=l.alternate;if(a!==null&&(a=a.updateQueue,e===a)){var n=null,u=null;if(e=e.firstBaseUpdate,e!==null){do{var c={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};u===null?n=u=c:u=u.next=c,e=e.next}while(e!==null);u===null?n=u=t:u=u.next=t}else n=u=t;e={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},l.updateQueue=e;return}l=e.lastBaseUpdate,l===null?e.firstBaseUpdate=t:l.next=t,e.lastBaseUpdate=t}var Vc=!1;function ln(){if(Vc){var l=da;if(l!==null)throw l}}function tn(l,t,e,a){Vc=!1;var n=l.updateQueue;ce=!1;var u=n.firstBaseUpdate,c=n.lastBaseUpdate,i=n.shared.pending;if(i!==null){n.shared.pending=null;var s=i,y=s.next;s.next=null,c===null?u=y:c.next=y,c=s;var S=l.alternate;S!==null&&(S=S.updateQueue,i=S.lastBaseUpdate,i!==c&&(i===null?S.firstBaseUpdate=y:i.next=y,S.lastBaseUpdate=s))}if(u!==null){var j=n.baseState;c=0,S=y=s=null,i=u;do{var g=i.lane&-536870913,p=g!==i.lane;if(p?(P&g)===g:(a&g)===g){g!==0&&g===ra&&(Vc=!0),S!==null&&(S=S.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});l:{var U=l,Y=i;g=t;var gl=e;switch(Y.tag){case 1:if(U=Y.payload,typeof U=="function"){j=U.call(gl,j,g);break l}j=U;break l;case 3:U.flags=U.flags&-65537|128;case 0:if(U=Y.payload,g=typeof U=="function"?U.call(gl,j,g):U,g==null)break l;j=H({},j,g);break l;case 2:ce=!0}}g=i.callback,g!==null&&(l.flags|=64,p&&(l.flags|=8192),p=n.callbacks,p===null?n.callbacks=[g]:p.push(g))}else p={lane:g,tag:i.tag,payload:i.payload,callback:i.callback,next:null},S===null?(y=S=p,s=j):S=S.next=p,c|=g;if(i=i.next,i===null){if(i=n.shared.pending,i===null)break;p=i,i=p.next,p.next=null,n.lastBaseUpdate=p,n.shared.pending=null}}while(!0);S===null&&(s=j),n.baseState=s,n.firstBaseUpdate=y,n.lastBaseUpdate=S,u===null&&(n.shared.lanes=0),he|=c,l.lanes=c,l.memoizedState=j}}function Xs(l,t){if(typeof l!="function")throw Error(o(191,l));l.call(t)}function Qs(l,t){var e=l.callbacks;if(e!==null)for(l.callbacks=null,l=0;lu?u:8;var c=x.T,i={};x.T=i,si(l,!1,t,e);try{var s=n(),y=x.S;if(y!==null&&y(i,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var S=Fh(s,a);nn(l,t,S,gt(l))}else nn(l,t,a,gt(l))}catch(j){nn(l,t,{then:function(){},status:"rejected",reason:j},gt())}finally{M.p=u,c!==null&&i.types!==null&&(c.types=i.types),x.T=c}}function em(){}function ii(l,t,e,a){if(l.tag!==5)throw Error(o(476));var n=So(l).queue;po(l,n,t,X,e===null?em:function(){return xo(l),e(a)})}function So(l){var t=l.memoizedState;if(t!==null)return t;t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:X},next:null};var e={};return t.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:e},next:null},l.memoizedState=t,l=l.alternate,l!==null&&(l.memoizedState=t),t}function xo(l){var t=So(l);t.next===null&&(t=l.alternate.memoizedState),nn(l,t.next.queue,{},gt())}function fi(){return Kl(En)}function Eo(){return Hl().memoizedState}function To(){return Hl().memoizedState}function am(l){for(var t=l.return;t!==null;){switch(t.tag){case 24:case 3:var e=gt();l=ie(e);var a=fe(t,l,e);a!==null&&(ct(a,t,e),Pa(a,t,e)),t={cache:qc()},l.payload=t;return}t=t.return}}function nm(l,t,e){var a=gt();e={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},du(l)?zo(t,e):(e=Ac(l,t,e,a),e!==null&&(ct(e,l,a),Ao(e,t,a)))}function jo(l,t,e){var a=gt();nn(l,t,e,a)}function nn(l,t,e,a){var n={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(du(l))zo(t,n);else{var u=l.alternate;if(l.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var c=t.lastRenderedState,i=u(c,e);if(n.hasEagerState=!0,n.eagerState=i,rt(i,c))return Kn(l,t,n,0),Sl===null&&wn(),!1}catch{}if(e=Ac(l,t,n,a),e!==null)return ct(e,l,a),Ao(e,t,a),!0}return!1}function si(l,t,e,a){if(a={lane:2,revertLane:Qi(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},du(l)){if(t)throw Error(o(479))}else t=Ac(l,e,a,2),t!==null&&ct(t,l,2)}function du(l){var t=l.alternate;return l===K||t!==null&&t===K}function zo(l,t){ya=uu=!0;var e=l.pending;e===null?t.next=t:(t.next=e.next,e.next=t),l.pending=t}function Ao(l,t,e){if((e&4194048)!==0){var a=t.lanes;a&=l.pendingLanes,e|=a,t.lanes=e,Of(l,e)}}var un={readContext:Kl,use:fu,useCallback:Ol,useContext:Ol,useEffect:Ol,useImperativeHandle:Ol,useLayoutEffect:Ol,useInsertionEffect:Ol,useMemo:Ol,useReducer:Ol,useRef:Ol,useState:Ol,useDebugValue:Ol,useDeferredValue:Ol,useTransition:Ol,useSyncExternalStore:Ol,useId:Ol,useHostTransitionStatus:Ol,useFormState:Ol,useActionState:Ol,useOptimistic:Ol,useMemoCache:Ol,useCacheRefresh:Ol};un.useEffectEvent=Ol;var No={readContext:Kl,use:fu,useCallback:function(l,t){return Pl().memoizedState=[l,t===void 0?null:t],l},useContext:Kl,useEffect:so,useImperativeHandle:function(l,t,e){e=e!=null?e.concat([l]):null,ou(4194308,4,mo.bind(null,t,l),e)},useLayoutEffect:function(l,t){return ou(4194308,4,l,t)},useInsertionEffect:function(l,t){ou(4,2,l,t)},useMemo:function(l,t){var e=Pl();t=t===void 0?null:t;var a=l();if(Qe){Pt(!0);try{l()}finally{Pt(!1)}}return e.memoizedState=[a,t],a},useReducer:function(l,t,e){var a=Pl();if(e!==void 0){var n=e(t);if(Qe){Pt(!0);try{e(t)}finally{Pt(!1)}}}else n=t;return a.memoizedState=a.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:n},a.queue=l,l=l.dispatch=nm.bind(null,K,l),[a.memoizedState,l]},useRef:function(l){var t=Pl();return l={current:l},t.memoizedState=l},useState:function(l){l=ei(l);var t=l.queue,e=jo.bind(null,K,t);return t.dispatch=e,[l.memoizedState,e]},useDebugValue:ui,useDeferredValue:function(l,t){var e=Pl();return ci(e,l,t)},useTransition:function(){var l=ei(!1);return l=po.bind(null,K,l.queue,!0,!1),Pl().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,e){var a=K,n=Pl();if(tl){if(e===void 0)throw Error(o(407));e=e()}else{if(e=t(),Sl===null)throw Error(o(349));(P&127)!==0||Js(a,t,e)}n.memoizedState=e;var u={value:e,getSnapshot:t};return n.queue=u,so($s.bind(null,a,u,l),[l]),a.flags|=2048,ba(9,{destroy:void 0},Ws.bind(null,a,u,e,t),null),e},useId:function(){var l=Pl(),t=Sl.identifierPrefix;if(tl){var e=Ut,a=Dt;e=(a&~(1<<32-ot(a)-1)).toString(32)+e,t="_"+t+"R_"+e,e=cu++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}u[Vl]=t,u[lt]=a;l:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break l;for(;c.sibling===null;){if(c.return===null||c.return===t)break l;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=u;l:switch(Wl(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break l;case"img":a=!0;break l;default:a=!1}a&&wt(t)}}return Al(t),Ti(t,t.type,l===null?null:l.memoizedProps,t.pendingProps,e),null;case 6:if(l&&t.stateNode!=null)l.memoizedProps!==a&&wt(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(l=F.current,sa(t)){if(l=t.stateNode,e=t.memoizedProps,a=null,n=wl,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}l[Vl]=t,l=!!(l.nodeValue===e||a!==null&&a.suppressHydrationWarning===!0||Kr(l.nodeValue,e)),l||ne(t,!0)}else l=Uu(l).createTextNode(a),l[Vl]=t,t.stateNode=l}return Al(t),null;case 31:if(e=t.memoizedState,l===null||l.memoizedState!==null){if(a=sa(t),e!==null){if(l===null){if(!a)throw Error(o(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(557));l[Vl]=t}else He(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Al(t),l=!1}else e=Cc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=e),l=!0;if(!l)return t.flags&256?(mt(t),t):(mt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Al(t),null;case 13:if(a=t.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(n=sa(t),a!==null&&a.dehydrated!==null){if(l===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[Vl]=t}else He(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Al(t),n=!1}else n=Cc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(mt(t),t):(mt(t),null)}return mt(t),(t.flags&128)!==0?(t.lanes=e,t):(e=a!==null,l=l!==null&&l.memoizedState!==null,e&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),e!==l&&e&&(t.child.flags|=8192),gu(t,t.updateQueue),Al(t),null);case 4:return Ul(),l===null&&wi(t.stateNode.containerInfo),Al(t),null;case 10:return Qt(t.type),Al(t),null;case 19:if(N(Cl),a=t.memoizedState,a===null)return Al(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)fn(a,!1);else{if(Dl!==0||l!==null&&(l.flags&128)!==0)for(l=t.child;l!==null;){if(u=nu(l),u!==null){for(t.flags|=128,fn(a,!1),l=u.updateQueue,t.updateQueue=l,gu(t,l),t.subtreeFlags=0,l=e,e=t.child;e!==null;)Ts(e,l),e=e.sibling;return D(Cl,Cl.current&1|2),tl&&Yt(t,a.treeForkCount),t.child}l=l.sibling}a.tail!==null&&ft()>Eu&&(t.flags|=128,n=!0,fn(a,!1),t.lanes=4194304)}else{if(!n)if(l=nu(u),l!==null){if(t.flags|=128,n=!0,l=l.updateQueue,t.updateQueue=l,gu(t,l),fn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!tl)return Al(t),null}else 2*ft()-a.renderingStartTime>Eu&&e!==536870912&&(t.flags|=128,n=!0,fn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(l=a.last,l!==null?l.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(l=a.tail,a.rendering=l,a.tail=l.sibling,a.renderingStartTime=ft(),l.sibling=null,e=Cl.current,D(Cl,n?e&1|2:e&1),tl&&Yt(t,a.treeForkCount),l):(Al(t),null);case 22:case 23:return mt(t),Kc(),a=t.memoizedState!==null,l!==null?l.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(e&536870912)!==0&&(t.flags&128)===0&&(Al(t),t.subtreeFlags&6&&(t.flags|=8192)):Al(t),e=t.updateQueue,e!==null&&gu(t,e.retryQueue),e=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(e=l.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==e&&(t.flags|=2048),l!==null&&N(qe),null;case 24:return e=null,l!==null&&(e=l.memoizedState.cache),t.memoizedState.cache!==e&&(t.flags|=2048),Qt(Bl),Al(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function sm(l,t){switch(Dc(t),t.tag){case 1:return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 3:return Qt(Bl),Ul(),l=t.flags,(l&65536)!==0&&(l&128)===0?(t.flags=l&-65537|128,t):null;case 26:case 27:case 5:return _n(t),null;case 31:if(t.memoizedState!==null){if(mt(t),t.alternate===null)throw Error(o(340));He()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 13:if(mt(t),l=t.memoizedState,l!==null&&l.dehydrated!==null){if(t.alternate===null)throw Error(o(340));He()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return N(Cl),null;case 4:return Ul(),null;case 10:return Qt(t.type),null;case 22:case 23:return mt(t),Kc(),l!==null&&N(qe),l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 24:return Qt(Bl),null;case 25:return null;default:return null}}function ko(l,t){switch(Dc(t),t.tag){case 3:Qt(Bl),Ul();break;case 26:case 27:case 5:_n(t);break;case 4:Ul();break;case 31:t.memoizedState!==null&&mt(t);break;case 13:mt(t);break;case 19:N(Cl);break;case 10:Qt(t.type);break;case 22:case 23:mt(t),Kc(),l!==null&&N(qe);break;case 24:Qt(Bl)}}function sn(l,t){try{var e=t.updateQueue,a=e!==null?e.lastEffect:null;if(a!==null){var n=a.next;e=n;do{if((e.tag&l)===l){a=void 0;var u=e.create,c=e.inst;a=u(),c.destroy=a}e=e.next}while(e!==n)}}catch(i){rl(t,t.return,i)}}function re(l,t,e){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&l)===l){var c=a.inst,i=c.destroy;if(i!==void 0){c.destroy=void 0,n=t;var s=e,y=i;try{y()}catch(S){rl(n,s,S)}}}a=a.next}while(a!==u)}}catch(S){rl(t,t.return,S)}}function Io(l){var t=l.updateQueue;if(t!==null){var e=l.stateNode;try{Qs(t,e)}catch(a){rl(l,l.return,a)}}}function Po(l,t,e){e.props=Le(l.type,l.memoizedProps),e.state=l.memoizedState;try{e.componentWillUnmount()}catch(a){rl(l,t,a)}}function on(l,t){try{var e=l.ref;if(e!==null){switch(l.tag){case 26:case 27:case 5:var a=l.stateNode;break;case 30:a=l.stateNode;break;default:a=l.stateNode}typeof e=="function"?l.refCleanup=e(a):e.current=a}}catch(n){rl(l,t,n)}}function Ct(l,t){var e=l.ref,a=l.refCleanup;if(e!==null)if(typeof a=="function")try{a()}catch(n){rl(l,t,n)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(n){rl(l,t,n)}else e.current=null}function lr(l){var t=l.type,e=l.memoizedProps,a=l.stateNode;try{l:switch(t){case"button":case"input":case"select":case"textarea":e.autoFocus&&a.focus();break l;case"img":e.src?a.src=e.src:e.srcSet&&(a.srcset=e.srcSet)}}catch(n){rl(l,l.return,n)}}function ji(l,t,e){try{var a=l.stateNode;Dm(a,l.type,e,t),a[lt]=t}catch(n){rl(l,l.return,n)}}function tr(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&be(l.type)||l.tag===4}function zi(l){l:for(;;){for(;l.sibling===null;){if(l.return===null||tr(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&be(l.type)||l.flags&2||l.child===null||l.tag===4)continue l;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ai(l,t,e){var a=l.tag;if(a===5||a===6)l=l.stateNode,t?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(l,t):(t=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,t.appendChild(l),e=e._reactRootContainer,e!=null||t.onclick!==null||(t.onclick=Bt));else if(a!==4&&(a===27&&be(l.type)&&(e=l.stateNode,t=null),l=l.child,l!==null))for(Ai(l,t,e),l=l.sibling;l!==null;)Ai(l,t,e),l=l.sibling}function bu(l,t,e){var a=l.tag;if(a===5||a===6)l=l.stateNode,t?e.insertBefore(l,t):e.appendChild(l);else if(a!==4&&(a===27&&be(l.type)&&(e=l.stateNode),l=l.child,l!==null))for(bu(l,t,e),l=l.sibling;l!==null;)bu(l,t,e),l=l.sibling}function er(l){var t=l.stateNode,e=l.memoizedProps;try{for(var a=l.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Wl(t,a,e),t[Vl]=l,t[lt]=e}catch(u){rl(l,l.return,u)}}var Kt=!1,Yl=!1,Ni=!1,ar=typeof WeakSet=="function"?WeakSet:Set,Ll=null;function om(l,t){if(l=l.containerInfo,Wi=Yu,l=ms(l),Sc(l)){if("selectionStart"in l)var e={start:l.selectionStart,end:l.selectionEnd};else l:{e=(e=l.ownerDocument)&&e.defaultView||window;var a=e.getSelection&&e.getSelection();if(a&&a.rangeCount!==0){e=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{e.nodeType,u.nodeType}catch{e=null;break l}var c=0,i=-1,s=-1,y=0,S=0,j=l,g=null;t:for(;;){for(var p;j!==e||n!==0&&j.nodeType!==3||(i=c+n),j!==u||a!==0&&j.nodeType!==3||(s=c+a),j.nodeType===3&&(c+=j.nodeValue.length),(p=j.firstChild)!==null;)g=j,j=p;for(;;){if(j===l)break t;if(g===e&&++y===n&&(i=c),g===u&&++S===a&&(s=c),(p=j.nextSibling)!==null)break;j=g,g=j.parentNode}j=p}e=i===-1||s===-1?null:{start:i,end:s}}else e=null}e=e||{start:0,end:0}}else e=null;for($i={focusedElem:l,selectionRange:e},Yu=!1,Ll=t;Ll!==null;)if(t=Ll,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,Ll=l;else for(;Ll!==null;){switch(t=Ll,u=t.alternate,l=t.flags,t.tag){case 0:if((l&4)!==0&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(e=0;e title"))),Wl(u,a,e),u[Vl]=l,Ql(u),a=u;break l;case"link":var c=sd("link","href",n).get(a+(e.href||""));if(c){for(var i=0;igl&&(c=gl,gl=Y,Y=c);var h=ds(i,Y),r=ds(i,gl);if(h&&r&&(p.rangeCount!==1||p.anchorNode!==h.node||p.anchorOffset!==h.offset||p.focusNode!==r.node||p.focusOffset!==r.offset)){var m=j.createRange();m.setStart(h.node,h.offset),p.removeAllRanges(),Y>gl?(p.addRange(m),p.extend(r.node,r.offset)):(m.setEnd(r.node,r.offset),p.addRange(m))}}}}for(j=[],p=i;p=p.parentNode;)p.nodeType===1&&j.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;ie?32:e,x.T=null,e=Hi,Hi=null;var u=ve,c=kt;if(Xl=0,Ta=ve=null,kt=0,(cl&6)!==0)throw Error(o(331));var i=cl;if(cl|=4,mr(u.current),rr(u,u.current,c,e),cl=i,yn(0,!1),st&&typeof st.onPostCommitFiberRoot=="function")try{st.onPostCommitFiberRoot(Ca,u)}catch{}return!0}finally{M.p=n,x.T=a,Ur(l,t)}}function Hr(l,t,e){t=xt(e,t),t=hi(l.stateNode,t,2),l=fe(l,t,2),l!==null&&(Ra(l,2),Ht(l))}function rl(l,t,e){if(l.tag===3)Hr(l,l,e);else for(;t!==null;){if(t.tag===3){Hr(t,l,e);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(me===null||!me.has(a))){l=xt(e,l),e=Ro(2),a=fe(t,e,2),a!==null&&(Bo(e,a,t,l),Ra(a,2),Ht(a));break}}t=t.return}}function Gi(l,t,e){var a=l.pingCache;if(a===null){a=l.pingCache=new hm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(e)||(Oi=!0,n.add(e),l=bm.bind(null,l,t,e),t.then(l,l))}function bm(l,t,e){var a=l.pingCache;a!==null&&a.delete(t),l.pingedLanes|=l.suspendedLanes&e,l.warmLanes&=~e,Sl===l&&(P&e)===e&&(Dl===4||Dl===3&&(P&62914560)===P&&300>ft()-xu?(cl&2)===0&&ja(l,0):Di|=e,Ea===P&&(Ea=0)),Ht(l)}function Rr(l,t){t===0&&(t=_f()),l=Ue(l,t),l!==null&&(Ra(l,t),Ht(l))}function pm(l){var t=l.memoizedState,e=0;t!==null&&(e=t.retryLane),Rr(l,e)}function Sm(l,t){var e=0;switch(l.tag){case 31:case 13:var a=l.stateNode,n=l.memoizedState;n!==null&&(e=n.retryLane);break;case 19:a=l.stateNode;break;case 22:a=l.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),Rr(l,e)}function xm(l,t){return ku(l,t)}var _u=null,Aa=null,Yi=!1,Mu=!1,Xi=!1,ge=0;function Ht(l){l!==Aa&&l.next===null&&(Aa===null?_u=Aa=l:Aa=Aa.next=l),Mu=!0,Yi||(Yi=!0,Tm())}function yn(l,t){if(!Xi&&Mu){Xi=!0;do for(var e=!1,a=_u;a!==null;){if(l!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var c=a.suspendedLanes,i=a.pingedLanes;u=(1<<31-ot(42|l)+1)-1,u&=n&~(c&~i),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(e=!0,Yr(a,u))}else u=P,u=Cn(a,a===Sl?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Ha(a,u)||(e=!0,Yr(a,u));a=a.next}while(e);Xi=!1}}function Em(){Br()}function Br(){Mu=Yi=!1;var l=0;ge!==0&&Cm()&&(l=ge);for(var t=ft(),e=null,a=_u;a!==null;){var n=a.next,u=qr(a,t);u===0?(a.next=null,e===null?_u=n:e.next=n,n===null&&(Aa=e)):(e=a,(l!==0||(u&3)!==0)&&(Mu=!0)),a=n}Xl!==0&&Xl!==5||yn(l),ge!==0&&(ge=0)}function qr(l,t){for(var e=l.suspendedLanes,a=l.pingedLanes,n=l.expirationTimes,u=l.pendingLanes&-62914561;0i)break;var S=s.transferSize,j=s.initiatorType;S&&Jr(j)&&(s=s.responseEnd,c+=S*(s"u"?null:document;function ud(l,t,e){var a=Na;if(a&&typeof t=="string"&&t){var n=pt(t);n='link[rel="'+l+'"][href="'+n+'"]',typeof e=="string"&&(n+='[crossorigin="'+e+'"]'),nd.has(n)||(nd.add(n),l={rel:l,crossOrigin:e,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Wl(t,"link",l),Ql(t),a.head.appendChild(t)))}}function Lm(l){It.D(l),ud("dns-prefetch",l,null)}function Zm(l,t){It.C(l,t),ud("preconnect",l,t)}function Vm(l,t,e){It.L(l,t,e);var a=Na;if(a&&l&&t){var n='link[rel="preload"][as="'+pt(t)+'"]';t==="image"&&e&&e.imageSrcSet?(n+='[imagesrcset="'+pt(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(n+='[imagesizes="'+pt(e.imageSizes)+'"]')):n+='[href="'+pt(l)+'"]';var u=n;switch(t){case"style":u=_a(l);break;case"script":u=Ma(l)}Nt.has(u)||(l=H({rel:"preload",href:t==="image"&&e&&e.imageSrcSet?void 0:l,as:t},e),Nt.set(u,l),a.querySelector(n)!==null||t==="style"&&a.querySelector(Sn(u))||t==="script"&&a.querySelector(xn(u))||(t=a.createElement("link"),Wl(t,"link",l),Ql(t),a.head.appendChild(t)))}}function wm(l,t){It.m(l,t);var e=Na;if(e&&l){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+pt(a)+'"][href="'+pt(l)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ma(l)}if(!Nt.has(u)&&(l=H({rel:"modulepreload",href:l},t),Nt.set(u,l),e.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(xn(u)))return}a=e.createElement("link"),Wl(a,"link",l),Ql(a),e.head.appendChild(a)}}}function Km(l,t,e){It.S(l,t,e);var a=Na;if(a&&l){var n=Fe(a).hoistableStyles,u=_a(l);t=t||"default";var c=n.get(u);if(!c){var i={loading:0,preload:null};if(c=a.querySelector(Sn(u)))i.loading=5;else{l=H({rel:"stylesheet",href:l,"data-precedence":t},e),(e=Nt.get(u))&&ef(l,e);var s=c=a.createElement("link");Ql(s),Wl(s,"link",l),s._p=new Promise(function(y,S){s.onload=y,s.onerror=S}),s.addEventListener("load",function(){i.loading|=1}),s.addEventListener("error",function(){i.loading|=2}),i.loading|=4,Hu(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:i},n.set(u,c)}}}function Jm(l,t){It.X(l,t);var e=Na;if(e&&l){var a=Fe(e).hoistableScripts,n=Ma(l),u=a.get(n);u||(u=e.querySelector(xn(n)),u||(l=H({src:l,async:!0},t),(t=Nt.get(n))&&af(l,t),u=e.createElement("script"),Ql(u),Wl(u,"link",l),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function Wm(l,t){It.M(l,t);var e=Na;if(e&&l){var a=Fe(e).hoistableScripts,n=Ma(l),u=a.get(n);u||(u=e.querySelector(xn(n)),u||(l=H({src:l,async:!0,type:"module"},t),(t=Nt.get(n))&&af(l,t),u=e.createElement("script"),Ql(u),Wl(u,"link",l),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function cd(l,t,e,a){var n=(n=F.current)?Cu(n):null;if(!n)throw Error(o(446));switch(l){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(t=_a(e.href),e=Fe(n).hoistableStyles,a=e.get(t),a||(a={type:"style",instance:null,count:0,state:null},e.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){l=_a(e.href);var u=Fe(n).hoistableStyles,c=u.get(l);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(l,c),(u=n.querySelector(Sn(l)))&&!u._p&&(c.instance=u,c.state.loading=5),Nt.has(l)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},Nt.set(l,e),u||$m(n,l,e,c.state))),t&&a===null)throw Error(o(528,""));return c}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=e.async,e=e.src,typeof e=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ma(e),e=Fe(n).hoistableScripts,a=e.get(t),a||(a={type:"script",instance:null,count:0,state:null},e.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,l))}}function _a(l){return'href="'+pt(l)+'"'}function Sn(l){return'link[rel="stylesheet"]['+l+"]"}function id(l){return H({},l,{"data-precedence":l.precedence,precedence:null})}function $m(l,t,e,a){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=l.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Wl(t,"link",e),Ql(t),l.head.appendChild(t))}function Ma(l){return'[src="'+pt(l)+'"]'}function xn(l){return"script[async]"+l}function fd(l,t,e){if(t.count++,t.instance===null)switch(t.type){case"style":var a=l.querySelector('style[data-href~="'+pt(e.href)+'"]');if(a)return t.instance=a,Ql(a),a;var n=H({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(l.ownerDocument||l).createElement("style"),Ql(a),Wl(a,"style",n),Hu(a,e.precedence,l),t.instance=a;case"stylesheet":n=_a(e.href);var u=l.querySelector(Sn(n));if(u)return t.state.loading|=4,t.instance=u,Ql(u),u;a=id(e),(n=Nt.get(n))&&ef(a,n),u=(l.ownerDocument||l).createElement("link"),Ql(u);var c=u;return c._p=new Promise(function(i,s){c.onload=i,c.onerror=s}),Wl(u,"link",a),t.state.loading|=4,Hu(u,e.precedence,l),t.instance=u;case"script":return u=Ma(e.src),(n=l.querySelector(xn(u)))?(t.instance=n,Ql(n),n):(a=e,(n=Nt.get(u))&&(a=H({},e),af(a,n)),l=l.ownerDocument||l,n=l.createElement("script"),Ql(n),Wl(n,"link",a),l.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Hu(a,e.precedence,l));return t.instance}function Hu(l,t,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,c=0;c title"):null)}function Fm(l,t,e){if(e===1||t.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(l=t.disabled,typeof t.precedence=="string"&&l==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function rd(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function km(l,t,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var n=_a(a.href),u=t.querySelector(Sn(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=Bu.bind(l),t.then(l,l)),e.state.loading|=4,e.instance=u,Ql(u);return}u=t.ownerDocument||t,a=id(a),(n=Nt.get(n))&&ef(a,n),u=u.createElement("link"),Ql(u);var c=u;c._p=new Promise(function(i,s){c.onload=i,c.onerror=s}),Wl(u,"link",a),e.instance=u}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(l.count++,e=Bu.bind(l),t.addEventListener("load",e),t.addEventListener("error",e))}}var nf=0;function Im(l,t){return l.stylesheets&&l.count===0&&Gu(l,l.stylesheets),0nf?50:800)+t);return l.unsuspend=e,function(){l.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Bu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gu(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var qu=null;function Gu(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,qu=new Map,t.forEach(Pm,l),qu=null,Bu.call(l))}function Pm(l,t){if(!(t.state.loading&4)){var e=qu.get(l);if(e)var a=e.get(null);else{e=new Map,qu.set(l,e);for(var n=l.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(v)}catch(z){console.error(z)}}return v(),hf.exports=y0(),hf.exports}var b0=g0();const p0=f0(b0);var dl=xf();const Ku=18,Ef=Ku*Ku,Da=1e3,Ke=12,S0=Da*Ke,x0=S0+Da,E0=["orbit","intro","receptor","transition-photon","photon","transition-eventlist","eventlist","transition-binning","binning","transition-flux","flux","transition-periodogram","periodogram","transition-spectrogram","spectrogram","closing"],we=["orbit","intro","receptor","transition-photon","photon","transition-eventlist","eventlist","transition-binning","binning","transition-flux","flux","transition-periodogram","periodogram","transition-spectrogram","spectrogram","closing"],$l=[{label:"Red",shortLabel:"R",wavelength:690,hue:2,saturation:100,lightness:66,energy:.44,decay:700,radius:.28},{label:"Orange",shortLabel:"O",wavelength:620,hue:18,saturation:100,lightness:64,energy:.5,decay:760,radius:.3},{label:"Amber",shortLabel:"A",wavelength:590,hue:36,saturation:100,lightness:66,energy:.56,decay:820,radius:.32},{label:"Yellow",shortLabel:"Y",wavelength:570,hue:56,saturation:100,lightness:69,energy:.62,decay:900,radius:.34},{label:"Green",shortLabel:"G",wavelength:530,hue:108,saturation:84,lightness:66,energy:.7,decay:980,radius:.36},{label:"Cyan",shortLabel:"C",wavelength:500,hue:188,saturation:94,lightness:68,energy:.8,decay:1120,radius:.4},{label:"Blue",shortLabel:"B",wavelength:450,hue:232,saturation:100,lightness:71,energy:.92,decay:1300,radius:.45},{label:"Violet",shortLabel:"V",wavelength:410,hue:274,saturation:100,lightness:74,energy:1.08,decay:1540,radius:.52}],T0=[{page:"binning",title:"Count events per second",diagram:"count-time",rule:"Group event rows into 1 second time bins and count how many clicks fall into each bin.",output:"Light curve / count periodogram"},{page:"flux",title:"Sum energy per second",diagram:"energy-time",rule:"Group event rows into 1 second time bins and sum the total photon energy inside each bin.",output:"Flux variability"},{page:"periodogram",title:"Sum energy by wavelength bin",diagram:"energy-wavelength",rule:"Group event rows by wavelength and sum the energy across the recent time window.",output:"Spectrum"},{page:"spectrogram",title:"Count events by wavelength over time",diagram:"count-wavelength-time",rule:"Group event rows into both time bins and wavelength bins, then count clicks in each cell.",output:"Spectrogram"}],Gd={"transition-photon":{title:"Every photon has energy",body:"Colour tells us something about wavelength and energy. Before we record the hits, it helps to see what that means.",nextPage:"photon",emoji:"😶‍🌫️"},"transition-eventlist":{title:"Now record the hits",body:"Each photon hit becomes one row with a time, an energy, and a CCD position.",nextPage:"eventlist",emoji:"📝"},"transition-binning":{title:"Chart #1 : Brightness over time",body:"We now use the data and make the first chart",nextPage:"binning",emoji:"🫰🏻⏰"},"transition-flux":{title:"Chart #2: Energy over time",body:"Instead of counting clicks equally, we sum up the energy of each phton inside each time bin.",nextPage:"flux",emoji:"🔥⏰"},"transition-periodogram":{title:"Chart #3: Build a spectrum",body:"The same event list can also be grouped by wavelength. Is it lots of low-energy red photons, or high-energy violet ones? Let`s find out.",nextPage:"periodogram",emoji:"🌈"},"transition-spectrogram":{title:"Chart #3 : Let´s mix things up",body:"Now try both time bins, and wavelength/energy bins at the same time!",nextPage:"spectrogram",emoji:"🤪"}},Rd=["receptor","photon","eventlist","binning","flux","periodogram","spectrogram"];function j0(){return Array.from({length:Ef},(v,z)=>({id:z,level:0,size:.22,decay:900,tint:"hsla(0 0% 100% / 0)",glow:"hsla(0 0% 100% / 0)"}))}function z0(){return Array.from({length:$l.length},()=>0)}function A0(){return{cells:j0(),eventHistory:[],totalPhotons:0}}function ze(v,z,b){return Math.min(b,Math.max(z,v))}function N0(v){const z=Math.floor(v/1e3),b=Math.floor(z/60),o=z%60,A=Math.floor(v%1e3/10);return[b,o].map(_=>String(_).padStart(2,"0")).join(":")+"."+String(A).padStart(2,"0")}function _0(v){const z=v.replace(/^#/,"");return E0.includes(z)?z:"orbit"}function Bd(){return typeof window>"u"?"orbit":_0(window.location.hash)}function pf(v,z,b,o){return`hsla(${v} ${z}% ${b}% / ${o})`}function je(v,z){const b=$l[v],o=ze(.08+z*.88,.08,.96),A=Math.min(84,b.lightness+z*10);return`hsla(${b.hue} ${b.saturation}% ${A}% / ${o})`}function Sf(v,z,b,o){if(v.length===0)return"";const A=o?.min??Math.min(...v),_=o?.max??Math.max(...v),C=Math.max(_-A,1e-4);return v.map((L,O)=>{const E=v.length===1?z/2:O/(v.length-1)*z,G=b-(L-A)/C*(b-8)-4;return`${O===0?"M":"L"} ${E.toFixed(2)} ${G.toFixed(2)}`}).join(" ")}function M0(v,z,b,o){return v.length===0?"":`${Sf(v,z,b,o)} L ${z} ${b} L 0 ${b} Z`}function O0(v){const b=ze(v,0,1)*($l.length-1),o=Math.floor(b),A=Math.min($l.length-1,Math.ceil(b)),_=b-o,C=$l[o],L=$l[A],O=(E,G)=>E+(G-E)*_;return{label:_<.5?C.label:L.label,wavelength:O(C.wavelength,L.wavelength),energy:O(C.energy,L.energy),hue:O(C.hue,L.hue),saturation:O(C.saturation,L.saturation),lightness:O(C.lightness,L.lightness)}}function D0(){return Array.from({length:42},(v,z)=>({x:z*73%100/100,y:(z*37+11)%100/100,size:.8+z*17%7*.22,opacity:.24+z*29%10*.05}))}function U0(v){const z=D0(),b=v*24e-5,A=Math.cos(b)*178,_=Math.sin(b*.72)*34,C=Math.sin(b)*132,O=A*.72,E=_*.45,G=Rl=>1+Rl/620,H=460+(0-O)*.72,J=264+(0-E)*.42+C*.08,_l=ze(G(-O*.05),.88,1.14),xl=460+(A-O)*.72,il=236+(_-E)*.5-C*.16,El=ze(G(C),.82,1.34),V=b*.9;return{earth:{x:H,y:J,scale:_l},telescope:{x:xl,y:il,scale:El,rotation:V},stars:z}}function C0(){const[v,z]=dl.useState(0);dl.useEffect(()=>{let o=0;const A=performance.now(),_=C=>{z(C-A),o=window.requestAnimationFrame(_)};return o=window.requestAnimationFrame(_),()=>window.cancelAnimationFrame(o)},[]);const b=U0(v);return f.jsxs("div",{className:"ccd-orbit-screen",children:[f.jsxs("div",{className:"ccd-orbit-copy",children:[f.jsx("span",{className:"ccd-stat-label",children:"Glitch Hunters's guide to telescopes"}),f.jsx("h2",{children:"Orbital telescopes"}),f.jsx("p",{children:"Humanity has launched multiple telescopes into orbit, each designed to observe the universe from different vantage points."})]}),f.jsx("div",{className:"ccd-orbit-stage",children:f.jsxs("svg",{className:"ccd-orbit-svg",viewBox:"0 0 920 520","aria-label":"Telescope orbiting Earth",children:[f.jsxs("defs",{children:[f.jsxs("radialGradient",{id:"orbitEarthGlow",cx:"42%",cy:"34%",r:"68%",children:[f.jsx("stop",{offset:"0%",stopColor:"#6bd3ff"}),f.jsx("stop",{offset:"36%",stopColor:"#2f88d8"}),f.jsx("stop",{offset:"72%",stopColor:"#124180"}),f.jsx("stop",{offset:"100%",stopColor:"#061327"})]}),f.jsxs("linearGradient",{id:"orbitCubeFront",x1:"0",x2:"1",y1:"0",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:"#fff7e9"}),f.jsx("stop",{offset:"100%",stopColor:"#ff9d77"})]}),f.jsxs("linearGradient",{id:"orbitCubeSide",x1:"0",x2:"1",y1:"0",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:"#d3caf7"}),f.jsx("stop",{offset:"100%",stopColor:"#7967db"})]})]}),b.stars.map((o,A)=>f.jsx("circle",{cx:o.x*920,cy:o.y*520,fill:"rgba(255,255,255,0.92)",opacity:o.opacity,r:o.size},A)),f.jsx("ellipse",{className:"ccd-orbit-track",cx:b.earth.x,cy:b.earth.y+8,rx:174*b.earth.scale,ry:62*b.earth.scale}),f.jsxs("g",{transform:`translate(${b.earth.x} ${b.earth.y}) scale(${b.earth.scale})`,children:[f.jsx("circle",{className:"ccd-orbit-earth-atmosphere",cx:"0",cy:"0",r:"112"}),f.jsx("circle",{cx:"0",cy:"0",fill:"url(#orbitEarthGlow)",r:"96"}),f.jsx("path",{className:"ccd-orbit-continent",d:"M -38 -20 C -18 -46 8 -44 22 -12 C 36 10 18 26 -4 32 C -20 38 -42 22 -48 0 Z"}),f.jsx("path",{className:"ccd-orbit-continent",d:"M 18 20 C 38 14 54 26 48 48 C 42 62 18 62 10 44 C 6 34 8 24 18 20 Z"}),f.jsx("circle",{className:"ccd-orbit-night-shadow",cx:"30",cy:"4",r:"92"})]}),f.jsx("g",{transform:`translate(${b.telescope.x} ${b.telescope.y}) rotate(${b.telescope.rotation*180/Math.PI}) scale(${b.telescope.scale})`,children:f.jsxs("g",{className:"ccd-orbit-telescope",children:[f.jsx("polygon",{points:"-18,-18 12,-28 12,4 -18,14",fill:"url(#orbitCubeFront)"}),f.jsx("polygon",{points:"12,-28 30,-14 30,18 12,4",fill:"url(#orbitCubeSide)"}),f.jsx("polygon",{points:"-18,-18 0,-4 30,-14 12,-28",fill:"rgba(255,255,255,0.82)"}),f.jsx("rect",{x:"-42",y:"-5",width:"18",height:"10",rx:"2.5",fill:"#d9d2f5"}),f.jsx("rect",{x:"30",y:"-4",width:"22",height:"8",rx:"3",fill:"#ffc66f"}),f.jsx("rect",{x:"-6",y:"18",width:"12",height:"34",rx:"5",fill:"#bdb4e8"}),f.jsx("rect",{x:"-34",y:"30",width:"68",height:"10",rx:"5",fill:"#8e78ff",opacity:"0.88"})]})})]})}),f.jsx("div",{className:"ccd-orbit-actions",children:f.jsx("a",{className:"ccd-experience-button",href:"#intro",children:"Next"})})]})}function qd(v,z,b,o){const A=Array.from({length:Ke},()=>0),_=Math.max(0,b-Ke);return v.forEach(C=>{const L=Math.floor((C.time-z)/Da);L<_||L>=b||(A[L-_]+=o(C))}),A}function H0(v,z,b){const o=Array.from({length:$l.length},()=>Array.from({length:Ke},()=>0)),A=Math.max(0,b-Ke);return v.forEach(_=>{const C=Math.floor((_.time-z)/Da);C=b||(o[_.photonIndex][C-A]+=1)}),o}function R0(v,z,b){const o=z0();if(b<=0)return o;const A=Math.max(0,b-Ke);return v.forEach(_=>{const C=Math.floor((_.time-z)/Da);C>=A&&C"u")return null;const v=window.AudioContext??window.webkitAudioContext;return v?new v:null}function G0(v){const[z,b]=dl.useState(()=>A0()),[o,A]=dl.useState(0),[_,C]=dl.useState(!1),[L,O]=dl.useState(!0),[E]=dl.useState(()=>Date.now()),G=dl.useRef(E),H=dl.useRef(null),J=dl.useRef(null),_l=dl.useRef(v),xl=dl.useRef(null);dl.useEffect(()=>{_l.current=v},[v]);const il=()=>{const V=xl.current??q0();if(!V){O(!1);return}xl.current=V,V.resume().then(()=>{O(!0),C(V.state==="running")}).catch(()=>{C(!1)})};dl.useEffect(()=>{const V=()=>{il()};return window.addEventListener("pointerdown",V,{passive:!0}),window.addEventListener("keydown",V),()=>{window.removeEventListener("pointerdown",V),window.removeEventListener("keydown",V)}},[]),dl.useEffect(()=>()=>{xl.current&&xl.current.close()},[]);const El=(V,Rl,Tl)=>{if(!_l.current)return;const jl=xl.current;if(!jl||jl.state!=="running")return;const el=jl.currentTime+Tl,fl=jl.createOscillator(),Q=jl.createGain(),hl=jl.createBiquadFilter(),Zl=$l[V],$=820+V*92,al=.006+Rl*.004,bl=.018+Rl*.02;fl.type="triangle",fl.frequency.setValueAtTime($,el),fl.frequency.exponentialRampToValueAtTime($*.74,el+bl),hl.type="bandpass",hl.frequency.setValueAtTime(1400+Zl.hue*2.4,el),hl.Q.setValueAtTime(1.4,el),Q.gain.setValueAtTime(1e-4,el),Q.gain.exponentialRampToValueAtTime(al,el+.003),Q.gain.exponentialRampToValueAtTime(1e-4,el+bl),fl.connect(hl),hl.connect(Q),Q.connect(jl.destination),fl.start(el),fl.stop(el+bl+.008)};return dl.useEffect(()=>{const V=()=>{A(Date.now()-G.current)};return V(),H.current=window.setInterval(V,90),()=>{H.current!==null&&window.clearInterval(H.current)}},[]),dl.useEffect(()=>{let V=!1;const Rl=()=>{if(V)return;const Tl=[],jl=[];b(el=>{const fl=Date.now(),Q=el.cells.map(al=>{if(al.level<=.001)return al.level===0?al:{...al,level:0};const bl=36/al.decay;return{...al,level:Math.max(0,al.level-bl),size:Math.max(.2,al.size-bl*.3)}});let hl=el.totalPhotons;const Zl=Math.random()<.28?2:1;for(let al=0;alfl-al.time{El(el.photonIndex,el.energy,fl*.012)}),J.current=window.setTimeout(Rl,36+Math.random()*70)};return Rl(),()=>{V=!0,J.current!==null&&window.clearTimeout(J.current)}},[]),{audioArmed:_,audioSupported:L,enableAudio:il,elapsedMilliseconds:o,exposureStartTime:E,simulation:z}}function Y0({cells:v,activeHits:z,averageEnergy:b,guide:o}){return f.jsx("div",{className:"ccd-page",children:f.jsxs("div",{className:"ccd-stage",children:[f.jsx("div",{className:"ccd-grid-frame",children:f.jsxs("div",{className:"ccd-grid","aria-label":"Photon receptor grid",children:[v.map(A=>f.jsx("div",{className:"ccd-cell",children:f.jsx("span",{className:"ccd-hit",style:{opacity:A.opacity,transform:`translate(-50%, -50%) scale(${A.scale})`,width:`${A.size}rem`,height:`${A.size}rem`,background:A.tint,boxShadow:`0 0 ${.9+A.opacity*1.8}rem ${A.glow}`}})},A.id)),f.jsx("div",{className:"ccd-grid-glow"})]})}),o||null,f.jsxs("div",{className:"ccd-readout","aria-label":"Sensor readout",children:[f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Active pixels"}),f.jsx("strong",{children:String(z).padStart(3,"0")})]}),f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Mean charge"}),f.jsx("strong",{children:b.toFixed(3)})]})]})]})})}const X0={eyebrow:"Detector Plane",title:"Telescope detector view",description:"The core of the telescope is a camera, called a CCD array. Photons - light from distant galaxies - strike the CCD and light up specific pixels. This is the raw material for the everything a telescope does."},Q0={stepLabel:"Step 1",title:"Photons are hitting the detector",body:"Notice how some pixels are bigger than others? They have more energy."};function L0(){return f.jsx("div",{className:"ccd-intro-screen",children:f.jsxs("div",{className:"ccd-intro-panel",children:[f.jsx("div",{className:"ccd-intro-logo-frame","aria-hidden":"true",children:f.jsx("img",{alt:"",className:"ccd-intro-logo",src:"/glitchhunterlogo.png"})}),f.jsx("div",{className:"ccd-intro-brand",children:f.jsx("span",{className:"ccd-intro-brand-mark",children:"Glitch Hunter's"})}),f.jsxs("div",{className:"ccd-intro-copy",children:[f.jsx("h2",{children:"Guide to Telescopes"}),f.jsx("p",{children:"How do they work? What does the telescope actually do?"})]}),f.jsxs("div",{className:"ccd-intro-covers",children:[f.jsx("span",{className:"ccd-stat-label",children:"In this experience, you will see:"}),f.jsxs("div",{className:"ccd-intro-card",children:[f.jsx("span",{className:"ccd-intro-card-index",children:"01"}),f.jsx("strong",{children:"The CCD"}),f.jsx("p",{children:"The telescope's eye, where photons land."})]}),f.jsxs("div",{className:"ccd-intro-card",children:[f.jsx("span",{className:"ccd-intro-card-index",children:"02"}),f.jsx("strong",{children:"Energy and wavelength"}),f.jsx("p",{children:"Colour tells us whether a photon is lower-energy red or higher-energy violet."})]}),f.jsxs("div",{className:"ccd-intro-card",children:[f.jsx("span",{className:"ccd-intro-card-index",children:"03"}),f.jsx("strong",{children:"The event list"}),f.jsx("p",{children:"Each photon hit becomes a recorded row with time, energy, and detector position."})]}),f.jsxs("div",{className:"ccd-intro-card",children:[f.jsx("span",{className:"ccd-intro-card-index",children:"04"}),f.jsx("strong",{children:"Periodograms"}),f.jsx("p",{children:"Group events by time or wavelength to see brightness and spectral power."})]}),f.jsxs("div",{className:"ccd-intro-card",children:[f.jsx("span",{className:"ccd-intro-card-index",children:"05"}),f.jsx("strong",{children:"Spectrograms"}),f.jsx("p",{children:"Bin by both time and wavelength to see how the colours evolve."})]})]}),f.jsx("div",{className:"ccd-intro-actions",children:f.jsx("a",{className:"ccd-experience-button",href:"#receptor",children:"Next"})})]})})}function Z0(v){return v in Gd}function V0({onComplete:v}){return f.jsx("div",{className:"ccd-closing-screen",children:f.jsxs("div",{className:"ccd-closing-panel",children:[f.jsx("span",{className:"ccd-stat-label",children:"Key Concepts"}),f.jsx("h2",{children:"What to remember"}),f.jsxs("div",{className:"ccd-closing-grid",children:[f.jsxs("div",{className:"ccd-closing-card",children:[f.jsx("strong",{children:"Binning"}),f.jsx("p",{children:"Grouping events because they arrive at a similar time, or have a similar colour."})]}),f.jsxs("div",{className:"ccd-closing-card",children:[f.jsx("strong",{children:"Energy / wavelength"}),f.jsx("p",{children:"Red means long wavelength and low energy. Violet means short wavelength and high energy."})]}),f.jsxs("div",{className:"ccd-closing-card",children:[f.jsx("strong",{children:"Periodogram"}),f.jsx("p",{children:"How the brightness goes up and down over time."})]}),f.jsxs("div",{className:"ccd-closing-card",children:[f.jsx("strong",{children:"Spectrogram"}),f.jsx("p",{children:"How much there is of each colour."})]}),f.jsxs("div",{className:"ccd-closing-card",children:[f.jsx("strong",{children:"Periodo-spectrogram"}),f.jsx("p",{children:"Binning by both time and wavelength / frequency."})]})]}),f.jsx("p",{className:"ccd-closing-message",children:"You're on your way to becoming a Cosmotologist!"}),f.jsxs("div",{className:"ccd-closing-actions",children:[f.jsx("a",{className:"ccd-experience-button ccd-experience-button-secondary",href:"#orbit",children:"Start Over"}),f.jsx("button",{className:"ccd-experience-button",onClick:()=>{v?.({success:!0,score:100,data:{completedExperience:"ccd-photon-explorer",finalPage:"closing"}})},type:"button",children:"Take the Glitch Gate"})]})]})})}function w0({page:v}){const z=Gd[v];return f.jsx("div",{className:"ccd-transition-screen",children:f.jsxs("div",{className:"ccd-transition-card",children:[f.jsx("span",{className:"ccd-stat-label emojilarge",children:z.emoji}),f.jsx("h2",{children:z.title}),f.jsx("p",{children:z.body}),f.jsx("div",{className:"ccd-transition-actions",children:f.jsx("a",{className:"ccd-experience-button",href:`#${z.nextPage}`,children:"Next"})})]})})}const bf={eyebrow:"",title:"Space telescope 101",description:"In this interactive tutorial, you will see how photons hit eye of the telescope, and how that is turned into turned into different scientific charts. We`ll cover:"};function K0(){const[v,z]=dl.useState(.5),b=O0(v),o=pf(b.hue,b.saturation,b.lightness,.98);return f.jsx("div",{className:"ccd-page",children:f.jsxs("div",{className:"ccd-energy-panel",children:[f.jsxs("div",{className:"ccd-energy-scale",children:[f.jsx("div",{className:"ccd-energy-spectrum","aria-hidden":"true",style:{"--ccd-spectrum-position":`${v*100}%`,"--ccd-spectrum-color":o}}),f.jsx("div",{className:"ccd-energy-slider-wrap",children:f.jsx("input",{"aria-label":"Photon wavelength and energy slider",className:"ccd-energy-slider",max:1,min:0,onChange:A=>z(Number(A.target.value)),step:.001,type:"range",value:v})}),f.jsxs("div",{className:"ccd-energy-scale-labels",children:[f.jsx("span",{children:"Longer wavelength"}),f.jsx("span",{children:"Shorter wavelength"})]}),f.jsxs("div",{className:"ccd-energy-scale-labels ccd-energy-scale-labels-strong",children:[f.jsx("span",{children:"Red, lower energy"}),f.jsx("span",{children:"Violet, higher energy"})]})]}),f.jsxs("div",{className:"ccd-energy-readout",children:[f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Selected colour"}),f.jsx("strong",{style:{color:o},children:b.label})]}),f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Wavelength"}),f.jsxs("strong",{children:[b.wavelength.toFixed(0)," nm"]})]}),f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Energy"}),f.jsxs("strong",{children:[b.energy.toFixed(2)," units"]})]})]})]})})}const J0={eyebrow:"Photon Energy And Wavelength",title:"Photon colour maps to wavelength",description:"Each hit has energy and wavelength. Red means longer wavelength and lower energy, while violet means shorter wavelength and higher energy. Wavelength is mesaured in nano-meters (nm). One nanometer is one billionth of a meter - about the size of a virus. The visible spectrum ranges from around 380 nm (violet) to 750 nm (red). But telescopes can see beyond that, into high-energy ultraviolet and infrared wavelengths that our eyes can´t detect."},W0={stepLabel:"Colour has meaning",title:"One photon, one observation",body:"In this demo, whenever you see the 🟣 colour, it indicates high energy - short wavelength. 🔴 is lower energy, but longer wavelength. "};function $0({type:v}){if(v==="count-wavelength-time")return f.jsx("div",{className:"ccd-mini-diagram ccd-mini-diagram-grid","aria-hidden":"true",children:Array.from({length:12},(b,o)=>f.jsx("span",{className:"ccd-mini-diagram-grid-cell",style:{opacity:.28+o%4*.14}},o))});const z=v==="count-time"?[.28,.58,.38,.76,.46,.66]:v==="energy-time"?[.22,.5,.42,.88,.56,.72]:[.2,.32,.48,.84,.6,.3];return f.jsx("div",{className:"ccd-mini-diagram","aria-hidden":"true",children:z.map((b,o)=>f.jsx("span",{className:`ccd-mini-diagram-bar${v!=="count-time"?" is-energy":""}`,style:{height:`${b*100}%`}},o))})}function F0({page:v,onSelect:z,showGuide:b,onToggleGuide:o}){const A=v==="receptor",_=v==="photon",C=v==="eventlist";return f.jsxs("section",{className:"ccd-selector","aria-label":"Visualization selector",children:[f.jsxs("div",{className:"ccd-selector-root",children:[f.jsx("span",{className:"ccd-stat-label",children:"These plots are different ways of binning the same event list."}),f.jsx("p",{children:"Everything begins with the CCD receiving photons. Those hits become rows in an event list. After that, different binning rules produce different plots."})]}),f.jsxs("div",{className:"ccd-selector-raw",children:[f.jsxs("a",{className:`ccd-selector-link${A?" is-active":""}`,href:"#receptor",onClick:z,children:[f.jsx("span",{className:"ccd-selector-link-label",children:"Raw data"}),f.jsx("strong",{children:"1. Photons hit CCD pixels"}),f.jsx("span",{children:"This is the detector plane: the spatial pattern of hits on the telescope CCD."})]}),f.jsxs("a",{className:`ccd-selector-link${_?" is-active":""}`,href:"#photon",onClick:z,children:[f.jsx("span",{className:"ccd-selector-link-label",children:"Photon properties"}),f.jsx("strong",{children:"2. Colour indicates wavelength and energy"}),f.jsx("span",{children:"Red means lower energy and violet means higher energy, which is why later plots can bin by wavelength."})]}),f.jsxs("a",{className:`ccd-selector-link${C?" is-active":""}`,href:"#eventlist",onClick:z,children:[f.jsx("span",{className:"ccd-selector-link-label",children:"Recorded data"}),f.jsx("strong",{children:"3. Each hit becomes a row: time, energy, x, y"}),f.jsx("span",{children:"This is the FITS-style event table. Every later diagram is derived from these same rows."})]})]}),f.jsx("div",{className:"ccd-selector-section",children:f.jsxs("div",{className:"ccd-selector-axis",children:[f.jsx("span",{className:"ccd-stat-label",children:"4. Choose a binning rule"}),f.jsx("strong",{children:"Derived view: binned visualization"}),f.jsx("p",{children:"These plots are different ways of grouping the same event rows."})]})}),f.jsx("div",{className:"ccd-selector-results",children:T0.map(L=>f.jsxs("a",{className:`ccd-selector-leaf${L.page===v?" is-active":""}`,href:`#${L.page}`,onClick:z,children:[f.jsx("span",{className:"ccd-selector-leaf-dim",children:"Input: same event list"}),f.jsx($0,{type:L.diagram}),f.jsx("strong",{children:L.title}),f.jsxs("span",{children:["Rule: ",L.rule]}),f.jsxs("span",{children:["Output: ",L.output]})]},L.page))}),f.jsxs("div",{className:"ccd-selector-current",children:[f.jsx("span",{className:"ccd-stat-label",children:"Recording"}),f.jsx("button",{className:`ccd-selector-option${b?" is-active":""}`,onClick:o,type:"button",children:b?"Guide overlay on":"Guide overlay off"})]})]})}function k0(v){switch(v){case"intro":return bf;case"receptor":return X0;case"photon":return J0;case"eventlist":return tv;case"binning":return hv;case"flux":return ov;case"periodogram":return nv;case"spectrogram":return iv;case"closing":return bf;default:return bf}}function I0(v){switch(v){case"intro":return null;case"receptor":return Q0;case"photon":return W0;case"eventlist":return ev;case"binning":return mv;case"flux":return rv;case"periodogram":return uv;case"spectrogram":return fv}}function P0({page:v}){const z=we.indexOf(v),b=z>0?we[z-1]:null,o=z>=0&&z{const _=B0(o.cellIndex),C=(o.time-z)/1e3;return $l[o.photonIndex],f.jsxs("div",{className:"ccd-event-table",children:[f.jsx("span",{children:C.toFixed(3)}),f.jsx("span",{style:{color:je(o.photonIndex,.92)},children:o.energy.toFixed(2)}),f.jsx("span",{children:String(_.x).padStart(2,"0")}),f.jsx("span",{children:String(_.y).padStart(2,"0")})]},`${o.time}-${o.cellIndex}-${A}`)}),b.length===0?f.jsxs("div",{className:"ccd-event-table ccd-event-table-empty",children:[f.jsx("span",{children:"No rows yet"}),f.jsx("span",{children:"Waiting"}),f.jsx("span",{children:"--"}),f.jsx("span",{children:"--"})]}):null]})]}),f.jsx("div",{className:"ccd-flux-legend",children:$l.map((o,A)=>f.jsxs("span",{className:"ccd-flux-legend-item",children:[f.jsx("span",{className:"ccd-legend-dot",style:{background:je(A,.92),boxShadow:`0 0 0.8rem ${je(A,.56)}`}}),f.jsx("span",{children:o.label})]},o.label))})]})})}const tv={eyebrow:"FITS Event Table",title:"Photon event list view",description:"The clicks are recorded in a table, called the event list, with the time, energy, and CCD pixel position."},ev={stepLabel:"Step 3",title:"Each hit becomes a row in the event list",body:"Astronomy pipelines often save these events as FITS tables. This is the raw data you can download from Telescopes like Chandra!"};function av({spectralEnergy:v}){const z=Math.max(...v,.01),b=v.reduce((o,A)=>o+A,0)||1;return f.jsx("div",{className:"ccd-page",children:f.jsxs("div",{className:"ccd-chart-panel",children:[f.jsxs("div",{className:"ccd-chart-head",children:[f.jsx("span",{className:"ccd-stat-label",children:"Integrated over last 12 completed 1.0 s bins"}),f.jsxs("strong",{children:[b.toFixed(2)," total energy units"]})]}),f.jsx("div",{className:"ccd-periodogram","aria-label":"Periodogram chart",children:$l.map((o,A)=>{const _=ze(v[A]/z,0,1),C=v[A]/b;return f.jsxs("div",{className:"ccd-periodogram-band",children:[f.jsx("div",{className:"ccd-bar-shell",children:f.jsx("div",{className:"ccd-bar-fill",style:{height:`${18+_*82}%`,background:`linear-gradient(180deg, ${je(A,.55)}, ${je(A,1)})`,boxShadow:`0 0 1.4rem ${je(A,.72)}`}})}),f.jsxs("div",{className:"ccd-band-meta",children:[f.jsx("strong",{children:o.shortLabel}),f.jsxs("span",{children:[o.wavelength," nm"]}),f.jsxs("span",{children:[v[A].toFixed(2)," E"]}),f.jsxs("span",{children:[(C*100).toFixed(1),"%"]})]})]},o.label)})})]})})}const nv={eyebrow:"Spectral power",title:"Spectrogram of energy",description:"We put low-energy on the left, and high energy on the right. The energy of all the photons in each frequency bin integrated over some period (here last 12 secs) gives us the shape of the spectrum during that time."},uv={stepLabel:"Step 6",title:"Spectral power",body:"Spectral power reveals the energy distribution, and it´s very important for many applications. It can tell us a lot about how stars work"};function cv({spectrogramBins:v}){const z=Math.max(...v.flat(),1);return f.jsx("div",{className:"ccd-page",children:f.jsxs("div",{className:"ccd-chart-panel ccd-chart-panel-wide",children:[f.jsxs("div",{className:"ccd-chart-head",children:[f.jsx("span",{className:"ccd-stat-label",children:"Clicks per 1.0 s time bin"}),f.jsxs("strong",{children:[Ke," time bins x ",$l.length," frequency bins"]})]}),f.jsxs("div",{className:"ccd-spectrogram-shell",children:[f.jsx("div",{className:"ccd-spectrogram-axis",children:$l.map(b=>f.jsx("span",{children:b.label},b.label))}),f.jsx("div",{className:"ccd-spectrogram","aria-label":"Spectrogram heat map",children:$l.map((b,o)=>f.jsx("div",{className:"ccd-spectrogram-row",children:v[o].map((A,_)=>f.jsx("span",{className:"ccd-spectrogram-cell",style:{background:je(o,A/z),boxShadow:A>0?`0 0 0.8rem ${je(o,A/z)}`:"none"}},`${b.label}-${_}`))},b.label))})]}),f.jsxs("div",{className:"ccd-spectrogram-footer",children:[f.jsx("span",{children:"Earlier"}),f.jsx("span",{children:"Now"})]})]})})}const iv={eyebrow:"Frequency X Time",title:"Periodo-spectro-gram!",description:"You can play around with the same data and make many charts! This shows the energy arriving during each time bin for each frequency bin!"},fv={stepLabel:"Step 7",title:"Binned by time and frequency",body:"Is it useful? Maybe not for a lot of applications, but it looks pretty!"};function sv({fluxBins:v}){const z=v.some(il=>il>0)?v:[1.2,1.8,1.4,2.1,1.7,1.5,2.3,1.6,1.9,1.4,2,1.7],b=z.map((il,El)=>{const V=z.slice(0,El+1);return V.reduce((Rl,Tl)=>Rl+Tl,0)/V.length}),o=z[z.length-1]??0,A=z.reduce((il,El)=>il+El,0)/z.length,_=z.reduce((il,El)=>il+(El-A)**2,0)/z.length,C=Math.sqrt(_),L=Math.min(...z),O=Math.max(...z),E=Math.min(...b),G=Math.max(...b),H={min:Math.min(L,E),max:Math.max(O,G)},J=Sf(z,760,240,H),_l=M0(z,760,240,H),xl=Sf(b,760,240,H);return f.jsx("div",{className:"ccd-page",children:f.jsxs("div",{className:"ccd-chart-panel ccd-chart-panel-wide",children:[f.jsxs("div",{className:"ccd-chart-head",children:[f.jsx("span",{className:"ccd-stat-label",children:"Total energy per 1.0 s bin"}),f.jsxs("strong",{children:[o.toFixed(2)," energy units in latest bin"]})]}),f.jsxs("div",{className:"ccd-flux-chart-shell",children:[f.jsxs("svg",{className:"ccd-flux-chart",viewBox:"0 0 760 240","aria-label":"Total flux variability chart",preserveAspectRatio:"none",children:[f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"fluxArea",x1:"0",x2:"0",y1:"0",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:"rgba(255, 113, 74, 0.40)"}),f.jsx("stop",{offset:"100%",stopColor:"rgba(125, 100, 255, 0.03)"})]}),f.jsxs("linearGradient",{id:"fluxLine",x1:"0",x2:"1",y1:"0",y2:"0",children:[f.jsx("stop",{offset:"0%",stopColor:"#ff8d66"}),f.jsx("stop",{offset:"55%",stopColor:"#ffd35d"}),f.jsx("stop",{offset:"100%",stopColor:"#8f7dff"})]})]}),z.map((il,El)=>{const V=760/z.length;return f.jsx("rect",{className:El%2===0?"ccd-flux-bin":"ccd-flux-bin ccd-flux-bin-alt",x:El*V,y:0,width:V,height:240},El)}),f.jsx("path",{className:"ccd-flux-area",d:_l,fill:"url(#fluxArea)"}),f.jsx("path",{className:"ccd-flux-line",d:J,stroke:"url(#fluxLine)"}),f.jsx("path",{className:"ccd-flux-mean-line",d:xl})]}),f.jsxs("div",{className:"ccd-flux-legend",children:[f.jsxs("span",{className:"ccd-flux-legend-item",children:[f.jsx("span",{className:"ccd-flux-legend-swatch ccd-flux-legend-swatch-raw"}),f.jsx("span",{children:"Raw flux"})]}),f.jsxs("span",{className:"ccd-flux-legend-item",children:[f.jsx("span",{className:"ccd-flux-legend-swatch ccd-flux-legend-swatch-mean"}),f.jsx("span",{children:"Running mean"})]})]}),f.jsxs("div",{className:"ccd-flux-axis",children:[f.jsx("span",{children:"Earlier"}),f.jsx("span",{children:"Now"})]})]}),f.jsxs("div",{className:"ccd-flux-metrics",children:[f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Mean flux"}),f.jsx("strong",{children:A.toFixed(4)})]}),f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Sigma"}),f.jsx("strong",{children:C.toFixed(4)})]}),f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Range"}),f.jsxs("strong",{children:[L.toFixed(4)," to ",O.toFixed(4)]})]})]})]})})}const ov={eyebrow:"Flux Variability",title:"Total flux periodogram",description:"If we focus on the energy instead of the count, we get the flux - energy per second. It tells us how the total energy varies over time (1 sec bins)."},rv={stepLabel:"Step 5",title:"Periodogram of flux",body:"This tells you how much the flux varies over time . The dotted line is the running mean, which helps show trends over time."};function dv({countBins:v}){const z=v.some(A=>A>0)?v:[3,5,4,7,6,5,8,4,6,5,7,4],b=Math.max(...z,1),o=z.reduce((A,_)=>A+_,0)/z.length;return f.jsx("div",{className:"ccd-page",children:f.jsxs("div",{className:"ccd-chart-panel ccd-chart-panel-wide",children:[f.jsxs("div",{className:"ccd-chart-head",children:[f.jsx("span",{className:"ccd-stat-label",children:"Photon clicks per 1.0 s bin"}),f.jsxs("strong",{children:[o.toFixed(1)," clicks / second bin"]})]}),f.jsxs("div",{className:"ccd-counts-shell",children:[f.jsx("div",{className:"ccd-counts-chart","aria-label":"Photon counts per bin chart",children:z.map((A,_)=>f.jsxs("div",{className:"ccd-count-bin",children:[f.jsx("div",{className:"ccd-count-bin-label",children:A}),f.jsx("div",{className:"ccd-count-bar-shell",children:f.jsx("div",{className:"ccd-count-bar",style:{height:`${12+A/b*88}%`}})})]},_))}),f.jsxs("div",{className:"ccd-flux-axis",children:[f.jsx("span",{children:"Earlier"}),f.jsx("span",{children:"Now!"})]})]}),f.jsx("div",{className:"ccd-flux-legend",children:f.jsxs("span",{className:"ccd-flux-legend-item",children:[f.jsx("span",{className:"ccd-flux-legend-swatch ccd-counts-legend-swatch-bin"}),f.jsx("span",{children:"Photon count bins"})]})}),f.jsxs("div",{className:"ccd-flux-metrics",children:[f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Bin width"}),f.jsx("strong",{children:"1.0 s"})]}),f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Latest bin"}),f.jsxs("strong",{children:[z[z.length-1]??0," clicks"]})]}),f.jsxs("div",{className:"ccd-stat",children:[f.jsx("span",{className:"ccd-stat-label",children:"Mean bin count"}),f.jsx("strong",{children:o.toFixed(2)})]})]})]})})}const hv={eyebrow:"Brightness",title:"Periodogram of counts",description:"The first chart is the periodogram. We put the clicks into groups. They arrive same second, same group! This is called time bining. (each bin 1 sec). This gives us the count per second - or the periodogram of photon counts."},mv={stepLabel:"Step 4",title:"Brightness is counting clicks!",body:"If we ignore photon energy and just count how many events arrive each second, we get a brightness-style light curve from the same event list."};function vv({onComplete:v,onProgress:z}={}){const[b,o]=dl.useState(()=>Bd()),[A,_]=dl.useState(!1),[C,L]=dl.useState(!0),{elapsedMilliseconds:O,exposureStartTime:E,simulation:G}=G0(b==="receptor");dl.useEffect(()=>{const $=()=>{o(Bd()),_(!1)};return window.addEventListener("hashchange",$),()=>window.removeEventListener("hashchange",$)},[]),dl.useEffect(()=>{const $=we.indexOf(b);$<0||z?.(Math.round($/(we.length-1)*100))},[z,b]),dl.useEffect(()=>{if(!A)return;const $=al=>{al.key==="Escape"&&_(!1)};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[A]);const H=dl.useMemo(()=>G.cells.map($=>({id:$.id,opacity:ze($.level,0,1),scale:.72+ze($.level*.7,0,.86),size:$.size,tint:$.tint,glow:$.glow})),[G.cells]),J=Math.floor(O/Da),_l=dl.useMemo(()=>R0(G.eventHistory,E,J),[J,E,G.eventHistory]),xl=dl.useMemo(()=>qd(G.eventHistory,E,J,$=>$.energy),[J,E,G.eventHistory]),il=dl.useMemo(()=>qd(G.eventHistory,E,J,()=>1),[J,E,G.eventHistory]),El=dl.useMemo(()=>H0(G.eventHistory,E,J),[J,E,G.eventHistory]),V=H.filter($=>$.opacity>.08).length,Rl=H.reduce(($,al)=>$+al.opacity,0)/Ef,Tl=_l.reduce(($,al,bl,it)=>al>it[$]?bl:$,0),jl=$l[Tl],el=Z0(b)?b:null,fl=b==="orbit"||b==="intro"||b==="closing",Q=b==="orbit",hl=el||fl?null:k0(b),Zl=C&&!fl&&!el?f.jsx(P0,{page:b}):null;return f.jsx("main",{className:"ccd-shell",children:f.jsxs("section",{className:`ccd-panel${Q?" ccd-panel-wide-scene":""}`,children:[hl?f.jsx("header",{className:"ccd-topbar",children:f.jsxs("div",{className:"ccd-copy",children:[f.jsx("p",{className:"ccd-kicker",children:hl.eyebrow}),f.jsx("h1",{children:hl.title}),f.jsx("p",{className:"ccd-description",children:hl.description})]})}):null,A?f.jsx("div",{className:"ccd-modal-backdrop",onClick:()=>_(!1),role:"presentation",children:f.jsxs("div",{className:"ccd-modal",onClick:$=>$.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Visualization chooser",children:[f.jsxs("div",{className:"ccd-modal-header",children:[f.jsxs("div",{className:"ccd-copy",children:[f.jsx("p",{className:"ccd-kicker",children:"Data Pipeline"}),f.jsx("h2",{children:"How do we transform the event list?"})]}),f.jsx("button",{className:"ccd-modal-close",onClick:()=>_(!1),type:"button","aria-label":"Close visualization chooser",children:"Close"})]}),f.jsx(F0,{page:b,onSelect:()=>_(!1),showGuide:C,onToggleGuide:()=>L($=>!$)})]})}):null,f.jsxs("div",{className:"ccd-experience-frame",children:[b==="orbit"?f.jsx(C0,{}):null,b==="intro"?f.jsx(L0,{}):null,b==="closing"?f.jsx(V0,{onComplete:v}):null,el?f.jsx(w0,{page:el}):null,b==="receptor"?f.jsx(Y0,{cells:H,activeHits:V,averageEnergy:Rl,guide:Zl}):null,b==="photon"?f.jsx(K0,{}):null,b==="eventlist"?f.jsx(lv,{events:G.eventHistory,exposureStartTime:E}):null,b==="periodogram"?f.jsx(av,{spectralEnergy:_l}):null,b==="spectrogram"?f.jsx(cv,{spectrogramBins:El}):null,b==="flux"?f.jsx(sv,{fluxBins:xl}):null,b==="binning"?f.jsx(dv,{countBins:il}):null,b!=="receptor"?Zl:null]}),!fl&&!el?f.jsxs("div",{className:"ccd-summary-row","aria-label":"Simulation summary",children:[f.jsxs("div",{className:"ccd-summary-card",children:[f.jsx("span",{className:"ccd-stat-label",children:"Exposure time"}),f.jsx("strong",{children:N0(O)})]}),f.jsxs("div",{className:"ccd-summary-card",children:[f.jsx("span",{className:"ccd-stat-label",children:"Photon count"}),f.jsx("strong",{children:G.totalPhotons})]}),f.jsxs("div",{className:"ccd-summary-card",children:[f.jsx("span",{className:"ccd-stat-label",children:"Dominant Band (Last 1 s)"}),f.jsx("strong",{children:jl.label})]})]}):null]})})}p0.createRoot(document.getElementById("root")).render(f.jsx(vv,{}));