diff --git a/docs/assets/AudioEmitter-2bTNGdLP.js b/docs/assets/AudioEmitter-Dk4R9QgT.js similarity index 98% rename from docs/assets/AudioEmitter-2bTNGdLP.js rename to docs/assets/AudioEmitter-Dk4R9QgT.js index 51539921..61dd5760 100644 --- a/docs/assets/AudioEmitter-2bTNGdLP.js +++ b/docs/assets/AudioEmitter-Dk4R9QgT.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{r as t,t as n}from"./jsx-runtime-BpGWiA-R.js";import{i as r,o as i}from"./react-three-fiber.esm-CgPHUpXo.js";import{a,i as o}from"./SettingsProvider-CCHVZuSg.js";import{t as s}from"./logger-z_EpIdIa.js";import{Ut as c,bt as l,c as u}from"./three.module-07hRbor4.js";import{r as d}from"./engineStore-Dkm20jvr.js";import{r as f}from"./loaders-CIpiZadQ.js";import{n as p}from"./AudioContext-CMp1T7r9.js";import{t as m}from"./FloatingLabel-4Yii8rRq.js";var h=e(t(),1),g=n(),_=s(`AudioEmitter`),v=new Map,y=new Map;function b(e,t=1){y.set(e,t)}function x(e){y.delete(e)}var S=0;function C(){return S}function w(){S++;for(let[e]of y){try{e.stop()}catch{}try{e.disconnect()}catch{}}y.clear()}d.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of y)try{t.setPlaybackRate(n*e)}catch{}});function T(e,t){let n=t(e),r=n?.filename;if(!r)return null;let i=r.endsWith(`.wav`)?r:`${r}.wav`,a=n.description,o=a==null?void 0:t(a);return{filename:i,is3D:o?.is3D??!0,isLooping:o?.isLooping??!1,refDist:o?.referenceDistance??20,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function E(e,t,n,r,i){let a;try{a=f(e.filename)}catch{return}let o=d.getState().playback.rate,s=S;D(a,n,n=>{if(s===S)try{if(e.is3D&&i){let a=new l(t);a.setBuffer(n),a.setDistanceModel(`inverse`),a.setRefDistance(e.refDist),a.setMaxDistance(e.maxDist),a.setRolloffFactor(1),a.setVolume(e.volume),a.setPlaybackRate(o),r&&a.position.copy(r),i.add(a),y.set(a,1),a.play(),a.source.onended=()=>{y.delete(a);try{a.disconnect()}catch{}i.remove(a)}}else{let r=new u(t);r.setBuffer(n),r.setVolume(e.volume),r.setPlaybackRate(o),y.set(r,1),r.play(),r.source.onended=()=>{y.delete(r);try{r.disconnect()}catch{}}}}catch{}})}function D(e,t,n){v.has(e)?n(v.get(e)):t.load(e,t=>{v.set(e,t),n(t)},void 0,t=>{_.error(`Audio load error %s: %o`,e,t)})}var O=(0,h.memo)(function({entity:e}){let{debugMode:t}=o(),n=e.audioFileName??``,s=e.audioVolume??1,d=e.audioMinDistance??1,_=e.audioMaxDistance??1,v=e.audioMinLoopGap??0,y=e.audioMaxLoopGap??0,b=e.audioIs3D??!0?1:0,x=e.audioIsLooping??!0,[S,C,w]=e.position??[0,0,0],T=i(e=>e.scene),E=i(e=>e.camera),{audioLoader:O,audioListener:k}=p(),{audioEnabled:A}=a(),j=(0,h.useRef)(null),M=(0,h.useRef)(null),N=(0,h.useRef)(null),P=(0,h.useRef)(!1),F=(0,h.useRef)(!1),I=(0,h.useRef)(new c(S,C,w)),L=(0,h.useRef)(0),R=()=>{M.current!=null&&(clearTimeout(M.current),M.current=null),N.current!=null&&(clearTimeout(N.current),N.current=null)},[z]=(0,h.useState)(()=>Math.random());(0,h.useEffect)(()=>{if(!O||!k)return;L.current++;let e;if(b){let t=new l(k);t.position.copy(I.current),t.setDistanceModel(`inverse`),t.setRefDistance(d),t.setMaxDistance(_),t.setRolloffFactor(1),t.setVolume(s),e=t,T.add(e)}else e=new u(k),e.setVolume(s);return j.current=e,()=>{R();try{e.stop()}catch{}try{e.disconnect()}catch{}b&&T.remove(e),j.current=null,P.current=!1,F.current=!1}},[O,k,b,d,_,s,T]);let B=(e,t)=>{if(x)if(v>0||y>0){let n=Math.max(0,v),r=Math.max(n,y),i=n===r?n:z*(r-n)+n;e.loop=!1;let a=()=>{t===L.current&&(e.isPlaying===!1?M.current=setTimeout(()=>{if(t===L.current)try{e.play(),B(e,t)}catch{}},i):N.current=setTimeout(a,100))};N.current=setTimeout(a,100)}else e.setLoop(!0)},V=(0,h.useEffectEvent)(e=>{if(!O)return;let t=L.current;if(P.current)try{e.isPlaying||(e.play(),B(e,t))}catch{}else{let r;try{r=f(n)}catch{return}D(r,O,n=>{if(t===L.current&&!e.buffer){e.setBuffer(n),P.current=!0;try{e.play(),B(e,t)}catch{}}})}});return(0,h.useEffect)(()=>{let e=j.current;!e||b||!A||!n||V(e)},[A,b,n,O,k]),r(()=>{let e=j.current;if(!e||!b||!A||!n)return;let t=E.position.distanceTo(I.current),r=F.current,i=t<=_;if(i&&!r)F.current=!0,V(e);else if(!i&&r){F.current=!1,R();try{e.stop()}catch{}}}),(0,h.useEffect)(()=>{let e=j.current;if(e&&!A){R();try{e.stop()}catch{}F.current=!1}},[A]),t?(0,g.jsxs)(`mesh`,{position:I.current,children:[(0,g.jsx)(`sphereGeometry`,{args:[d,12,12]}),(0,g.jsx)(`meshBasicMaterial`,{color:`#00ff00`,wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,g.jsx)(m,{color:`#00ff00`,position:[0,d+1,0],children:n})]}):null});export{O as AudioEmitter,v as audioBufferCache,D as getCachedAudioBuffer,C as getSoundGeneration,E as playOneShotSound,T as resolveAudioProfile,w as stopAllTrackedSounds,b as trackSound,x as untrackSound}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{r as t,t as n}from"./jsx-runtime-BpGWiA-R.js";import{i as r,o as i}from"./react-three-fiber.esm-CgPHUpXo.js";import{a,i as o}from"./SettingsProvider-CCHVZuSg.js";import{t as s}from"./logger-z_EpIdIa.js";import{Ut as c,bt as l,c as u}from"./three.module-07hRbor4.js";import{r as d}from"./engineStore-Dkm20jvr.js";import{r as f}from"./loaders-CIpiZadQ.js";import{n as p}from"./AudioContext-CMp1T7r9.js";import{t as m}from"./FloatingLabel-Bm1LwAgd.js";var h=e(t(),1),g=n(),_=s(`AudioEmitter`),v=new Map,y=new Map;function b(e,t=1){y.set(e,t)}function x(e){y.delete(e)}var S=0;function C(){return S}function w(){S++;for(let[e]of y){try{e.stop()}catch{}try{e.disconnect()}catch{}}y.clear()}d.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of y)try{t.setPlaybackRate(n*e)}catch{}});function T(e,t){let n=t(e),r=n?.filename;if(!r)return null;let i=r.endsWith(`.wav`)?r:`${r}.wav`,a=n.description,o=a==null?void 0:t(a);return{filename:i,is3D:o?.is3D??!0,isLooping:o?.isLooping??!1,refDist:o?.referenceDistance??20,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function E(e,t,n,r,i){let a;try{a=f(e.filename)}catch{return}let o=d.getState().playback.rate,s=S;D(a,n,n=>{if(s===S)try{if(e.is3D&&i){let a=new l(t);a.setBuffer(n),a.setDistanceModel(`inverse`),a.setRefDistance(e.refDist),a.setMaxDistance(e.maxDist),a.setRolloffFactor(1),a.setVolume(e.volume),a.setPlaybackRate(o),r&&a.position.copy(r),i.add(a),y.set(a,1),a.play(),a.source.onended=()=>{y.delete(a);try{a.disconnect()}catch{}i.remove(a)}}else{let r=new u(t);r.setBuffer(n),r.setVolume(e.volume),r.setPlaybackRate(o),y.set(r,1),r.play(),r.source.onended=()=>{y.delete(r);try{r.disconnect()}catch{}}}}catch{}})}function D(e,t,n){v.has(e)?n(v.get(e)):t.load(e,t=>{v.set(e,t),n(t)},void 0,t=>{_.error(`Audio load error %s: %o`,e,t)})}var O=(0,h.memo)(function({entity:e}){let{debugMode:t}=o(),n=e.audioFileName??``,s=e.audioVolume??1,d=e.audioMinDistance??1,_=e.audioMaxDistance??1,v=e.audioMinLoopGap??0,y=e.audioMaxLoopGap??0,b=e.audioIs3D??!0?1:0,x=e.audioIsLooping??!0,[S,C,w]=e.position??[0,0,0],T=i(e=>e.scene),E=i(e=>e.camera),{audioLoader:O,audioListener:k}=p(),{audioEnabled:A}=a(),j=(0,h.useRef)(null),M=(0,h.useRef)(null),N=(0,h.useRef)(null),P=(0,h.useRef)(!1),F=(0,h.useRef)(!1),I=(0,h.useRef)(new c(S,C,w)),L=(0,h.useRef)(0),R=()=>{M.current!=null&&(clearTimeout(M.current),M.current=null),N.current!=null&&(clearTimeout(N.current),N.current=null)},[z]=(0,h.useState)(()=>Math.random());(0,h.useEffect)(()=>{if(!O||!k)return;L.current++;let e;if(b){let t=new l(k);t.position.copy(I.current),t.setDistanceModel(`inverse`),t.setRefDistance(d),t.setMaxDistance(_),t.setRolloffFactor(1),t.setVolume(s),e=t,T.add(e)}else e=new u(k),e.setVolume(s);return j.current=e,()=>{R();try{e.stop()}catch{}try{e.disconnect()}catch{}b&&T.remove(e),j.current=null,P.current=!1,F.current=!1}},[O,k,b,d,_,s,T]);let B=(e,t)=>{if(x)if(v>0||y>0){let n=Math.max(0,v),r=Math.max(n,y),i=n===r?n:z*(r-n)+n;e.loop=!1;let a=()=>{t===L.current&&(e.isPlaying===!1?M.current=setTimeout(()=>{if(t===L.current)try{e.play(),B(e,t)}catch{}},i):N.current=setTimeout(a,100))};N.current=setTimeout(a,100)}else e.setLoop(!0)},V=(0,h.useEffectEvent)(e=>{if(!O)return;let t=L.current;if(P.current)try{e.isPlaying||(e.play(),B(e,t))}catch{}else{let r;try{r=f(n)}catch{return}D(r,O,n=>{if(t===L.current&&!e.buffer){e.setBuffer(n),P.current=!0;try{e.play(),B(e,t)}catch{}}})}});return(0,h.useEffect)(()=>{let e=j.current;!e||b||!A||!n||V(e)},[A,b,n,O,k]),r(()=>{let e=j.current;if(!e||!b||!A||!n)return;let t=E.position.distanceTo(I.current),r=F.current,i=t<=_;if(i&&!r)F.current=!0,V(e);else if(!i&&r){F.current=!1,R();try{e.stop()}catch{}}}),(0,h.useEffect)(()=>{let e=j.current;if(e&&!A){R();try{e.stop()}catch{}F.current=!1}},[A]),t?(0,g.jsxs)(`mesh`,{position:I.current,children:[(0,g.jsx)(`sphereGeometry`,{args:[d,12,12]}),(0,g.jsx)(`meshBasicMaterial`,{color:`#00ff00`,wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,g.jsx)(m,{color:`#00ff00`,position:[0,d+1,0],children:n})]}):null});export{O as AudioEmitter,v as audioBufferCache,D as getCachedAudioBuffer,C as getSoundGeneration,E as playOneShotSound,T as resolveAudioProfile,w as stopAllTrackedSounds,b as trackSound,x as untrackSound}; \ No newline at end of file diff --git a/docs/assets/ChatInput-B9JdqF5v.js b/docs/assets/ChatInput-BrDNmg1o.js similarity index 86% rename from docs/assets/ChatInput-B9JdqF5v.js rename to docs/assets/ChatInput-BrDNmg1o.js index 68f7dabc..30685ce0 100644 --- a/docs/assets/ChatInput-B9JdqF5v.js +++ b/docs/assets/ChatInput-BrDNmg1o.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{k as i}from"./index-B1XI52_L.js";var a=t(),o=e(n(),1),s={InputForm:`_InputForm_18kom_1`,Input:`_Input_18kom_1`},c=r();function l(){let e=(0,a.c)(8),[t,n]=(0,o.useState)(``),r;e[0]===t?r=e[1]:(r=e=>{e.preventDefault();let r=t.trim();r&&(i.getState().sendCommand(`messageSent`,r),n(``))},e[0]=t,e[1]=r);let l=r,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>n(e.target.value),e[2]=f):f=e[2];let p;e[3]===t?p=e[4]:(p=(0,c.jsx)(`input`,{className:s.Input,type:`text`,placeholder:`Say something…`,value:t,onChange:f,onKeyDown:d,onKeyUp:u,maxLength:255}),e[3]=t,e[4]=p);let m;return e[5]!==l||e[6]!==p?(m=(0,c.jsx)(`form`,{className:s.InputForm,onSubmit:l,children:p}),e[5]=l,e[6]=p,e[7]=m):m=e[7],m}function u(e){return e.stopPropagation()}function d(e){return e.stopPropagation()}export{l as ChatInput}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{k as i}from"./index-DfaykQpF.js";var a=t(),o=e(n(),1),s={InputForm:`_InputForm_18kom_1`,Input:`_Input_18kom_1`},c=r();function l(){let e=(0,a.c)(8),[t,n]=(0,o.useState)(``),r;e[0]===t?r=e[1]:(r=e=>{e.preventDefault();let r=t.trim();r&&(i.getState().sendCommand(`messageSent`,r),n(``))},e[0]=t,e[1]=r);let l=r,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>n(e.target.value),e[2]=f):f=e[2];let p;e[3]===t?p=e[4]:(p=(0,c.jsx)(`input`,{className:s.Input,type:`text`,placeholder:`Say something…`,value:t,onChange:f,onKeyDown:d,onKeyUp:u,maxLength:255}),e[3]=t,e[4]=p);let m;return e[5]!==l||e[6]!==p?(m=(0,c.jsx)(`form`,{className:s.InputForm,onSubmit:l,children:p}),e[5]=l,e[6]=p,e[7]=m):m=e[7],m}function u(e){return e.stopPropagation()}function d(e){return e.stopPropagation()}export{l as ChatInput}; \ No newline at end of file diff --git a/docs/assets/ChatSoundPlayer-CkJcKyFh.js b/docs/assets/ChatSoundPlayer-DZxyjwrv.js similarity index 95% rename from docs/assets/ChatSoundPlayer-CkJcKyFh.js rename to docs/assets/ChatSoundPlayer-DZxyjwrv.js index f42989bf..62140ef0 100644 --- a/docs/assets/ChatSoundPlayer-CkJcKyFh.js +++ b/docs/assets/ChatSoundPlayer-DZxyjwrv.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{r as t}from"./jsx-runtime-BpGWiA-R.js";import{a as n}from"./SettingsProvider-CCHVZuSg.js";import{c as r}from"./three.module-07hRbor4.js";import{i,r as a}from"./engineStore-Dkm20jvr.js";import{r as o}from"./loaders-CIpiZadQ.js";import{n as s}from"./AudioContext-CMp1T7r9.js";import{getCachedAudioBuffer as c,getSoundGeneration as l,trackSound as u,untrackSound as d}from"./AudioEmitter-2bTNGdLP.js";var f=e(t(),1);function p(){let{audioLoader:e,audioListener:t}=s(),{audioEnabled:p}=n(),m=i(e=>e.playback.streamSnapshot?.chatMessages),h=i(e=>e.playback.streamSnapshot?.timeSec),g=(0,f.useRef)(new WeakSet),_=(0,f.useRef)(new Map);return(0,f.useEffect)(()=>{if(!p||!e||!t||!m?.length||h==null)return;let n=g.current,i=_.current;for(let s of m)if(!n.has(s)&&(n.add(s),s.soundPath&&!(Math.abs(h-s.timeSec)>2)))try{let n=o(s.soundPath),f=s.soundPitch??1,p=a.getState().playback.rate,m=s.sender,h=l();c(n,e,e=>{if(h!==l())return;if(m){let e=i.get(m);if(e){try{e.stop()}catch{}d(e);try{e.disconnect()}catch{}i.delete(m)}}let n=new r(t);n.setBuffer(e),n.setPlaybackRate(f*p),u(n,f),m&&i.set(m,n),n.play(),n.source.onended=()=>{d(n);try{n.disconnect()}catch{}m&&i.get(m)===n&&i.delete(m)}})}catch{}},[p,e,t,m,h]),null}export{p as ChatSoundPlayer}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{r as t}from"./jsx-runtime-BpGWiA-R.js";import{a as n}from"./SettingsProvider-CCHVZuSg.js";import{c as r}from"./three.module-07hRbor4.js";import{i,r as a}from"./engineStore-Dkm20jvr.js";import{r as o}from"./loaders-CIpiZadQ.js";import{n as s}from"./AudioContext-CMp1T7r9.js";import{getCachedAudioBuffer as c,getSoundGeneration as l,trackSound as u,untrackSound as d}from"./AudioEmitter-Dk4R9QgT.js";var f=e(t(),1);function p(){let{audioLoader:e,audioListener:t}=s(),{audioEnabled:p}=n(),m=i(e=>e.playback.streamSnapshot?.chatMessages),h=i(e=>e.playback.streamSnapshot?.timeSec),g=(0,f.useRef)(new WeakSet),_=(0,f.useRef)(new Map);return(0,f.useEffect)(()=>{if(!p||!e||!t||!m?.length||h==null)return;let n=g.current,i=_.current;for(let s of m)if(!n.has(s)&&(n.add(s),s.soundPath&&!(Math.abs(h-s.timeSec)>2)))try{let n=o(s.soundPath),f=s.soundPitch??1,p=a.getState().playback.rate,m=s.sender,h=l();c(n,e,e=>{if(h!==l())return;if(m){let e=i.get(m);if(e){try{e.stop()}catch{}d(e);try{e.disconnect()}catch{}i.delete(m)}}let n=new r(t);n.setBuffer(e),n.setPlaybackRate(f*p),u(n,f),m&&i.set(m,n),n.play(),n.source.onended=()=>{d(n);try{n.disconnect()}catch{}m&&i.get(m)===n&&i.delete(m)}})}catch{}},[p,e,t,m,h]),null}export{p as ChatSoundPlayer}; \ No newline at end of file diff --git a/docs/assets/DebugElements-DbcJj7CW.js b/docs/assets/DebugElements-Dy-m_wVx.js similarity index 98% rename from docs/assets/DebugElements-DbcJj7CW.js rename to docs/assets/DebugElements-Dy-m_wVx.js index 249f9c01..354fb594 100644 --- a/docs/assets/DebugElements-DbcJj7CW.js +++ b/docs/assets/DebugElements-Dy-m_wVx.js @@ -1 +1 @@ -import{r as e,t}from"./chunk-DECur_0Z.js";import{n,r,t as i}from"./jsx-runtime-BpGWiA-R.js";import{n as a,r as o}from"./react-three-fiber.esm-CgPHUpXo.js";import{t as s}from"./Html-BfjRWIZg.js";var c=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Stats=r()})(e,function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;to+1e3&&(c.update(1e3*s/(e-o),100),o=e,s=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,c=48*o,l=3*o,u=2*o,d=3*o,f=15*o,p=74*o,m=30*o,h=document.createElement(`canvas`);h.width=s,h.height=c,h.style.cssText=`width:80px;height:48px`;var g=h.getContext(`2d`);return g.font=`bold `+9*o+`px Helvetica,Arial,sans-serif`,g.textBaseline=`top`,g.fillStyle=n,g.fillRect(0,0,s,c),g.fillStyle=t,g.fillText(e,l,u),g.fillRect(d,f,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:h,update:function(c,_){r=Math.min(r,c),i=Math.max(i,c),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(a(c)+` `+e+` (`+a(r)+`-`+a(i)+`)`,l,u),g.drawImage(h,d+o,f,p-o,m,d,f,p-o,m),g.fillRect(d+p-o,f,o,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-o,f,o,a((1-c/_)*m))}}},e})})),l=e(r());function u(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function d(e,t=[],n){let[r,i]=l.useState();return l.useLayoutEffect(()=>{let t=e();return i(t),u(n,t),()=>u(n,null)},t),r}var f=e(c());function p({showPanel:e=0,className:t,parent:n}){let r=d(()=>new f.default,[]);return l.useEffect(()=>{if(r){let i=n&&n.current||document.body;r.showPanel(e),i?.appendChild(r.dom);let s=(t??``).split(` `).filter(e=>e);s.length&&r.dom.classList.add(...s);let c=o(()=>r.begin()),l=a(()=>r.end());return()=>{s.length&&r.dom.classList.remove(...s),i?.removeChild(r.dom),c(),l()}}},[n,r,t,e]),null}var m=n(),h={StatsPanel:`_StatsPanel_10m5i_1`,AxisLabel:`_AxisLabel_10m5i_8`},g=i();function _(){let e=(0,m.c)(10),t=(0,l.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{let e=t.current;e&&e.setColors(`rgb(153, 255, 0)`,`rgb(0, 153, 255)`,`rgb(255, 153, 0)`)},e[0]=n):n=e[0],(0,l.useEffect)(n);let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,g.jsx)(p,{className:h.StatsPanel}),e[1]=r):r=e[1];let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=[70],e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,g.jsx)(`axesHelper`,{ref:t,args:i,renderOrder:999,children:(0,g.jsx)(`lineBasicMaterial`,{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),e[3]=a):a=e[3];let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=[80,0,0],e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,g.jsx)(s,{position:o,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`y`,children:`Y`})}),e[5]=c):c=e[5];let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=[0,80,0],e[6]=u):u=e[6];let d;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,g.jsx)(s,{position:u,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`z`,children:`Z`})}),e[7]=d):d=e[7];let f;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=[0,0,80],e[8]=f):f=e[8];let _;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,g.jsxs)(g.Fragment,{children:[r,a,c,d,(0,g.jsx)(s,{position:f,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`x`,children:`X`})})]}),e[9]=_):_=e[9],_}export{_ as DebugElements}; \ No newline at end of file +import{r as e,t}from"./chunk-DECur_0Z.js";import{n,r,t as i}from"./jsx-runtime-BpGWiA-R.js";import{n as a,r as o}from"./react-three-fiber.esm-CgPHUpXo.js";import{t as s}from"./Html-DTt-Asp4.js";var c=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Stats=r()})(e,function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;to+1e3&&(c.update(1e3*s/(e-o),100),o=e,s=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,c=48*o,l=3*o,u=2*o,d=3*o,f=15*o,p=74*o,m=30*o,h=document.createElement(`canvas`);h.width=s,h.height=c,h.style.cssText=`width:80px;height:48px`;var g=h.getContext(`2d`);return g.font=`bold `+9*o+`px Helvetica,Arial,sans-serif`,g.textBaseline=`top`,g.fillStyle=n,g.fillRect(0,0,s,c),g.fillStyle=t,g.fillText(e,l,u),g.fillRect(d,f,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:h,update:function(c,_){r=Math.min(r,c),i=Math.max(i,c),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(a(c)+` `+e+` (`+a(r)+`-`+a(i)+`)`,l,u),g.drawImage(h,d+o,f,p-o,m,d,f,p-o,m),g.fillRect(d+p-o,f,o,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-o,f,o,a((1-c/_)*m))}}},e})})),l=e(r());function u(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function d(e,t=[],n){let[r,i]=l.useState();return l.useLayoutEffect(()=>{let t=e();return i(t),u(n,t),()=>u(n,null)},t),r}var f=e(c());function p({showPanel:e=0,className:t,parent:n}){let r=d(()=>new f.default,[]);return l.useEffect(()=>{if(r){let i=n&&n.current||document.body;r.showPanel(e),i?.appendChild(r.dom);let s=(t??``).split(` `).filter(e=>e);s.length&&r.dom.classList.add(...s);let c=o(()=>r.begin()),l=a(()=>r.end());return()=>{s.length&&r.dom.classList.remove(...s),i?.removeChild(r.dom),c(),l()}}},[n,r,t,e]),null}var m=n(),h={StatsPanel:`_StatsPanel_10m5i_1`,AxisLabel:`_AxisLabel_10m5i_8`},g=i();function _(){let e=(0,m.c)(10),t=(0,l.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{let e=t.current;e&&e.setColors(`rgb(153, 255, 0)`,`rgb(0, 153, 255)`,`rgb(255, 153, 0)`)},e[0]=n):n=e[0],(0,l.useEffect)(n);let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,g.jsx)(p,{className:h.StatsPanel}),e[1]=r):r=e[1];let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=[70],e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,g.jsx)(`axesHelper`,{ref:t,args:i,renderOrder:999,children:(0,g.jsx)(`lineBasicMaterial`,{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),e[3]=a):a=e[3];let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=[80,0,0],e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,g.jsx)(s,{position:o,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`y`,children:`Y`})}),e[5]=c):c=e[5];let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=[0,80,0],e[6]=u):u=e[6];let d;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,g.jsx)(s,{position:u,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`z`,children:`Z`})}),e[7]=d):d=e[7];let f;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=[0,0,80],e[8]=f):f=e[8];let _;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,g.jsxs)(g.Fragment,{children:[r,a,c,d,(0,g.jsx)(s,{position:f,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`x`,children:`X`})})]}),e[9]=_):_=e[9],_}export{_ as DebugElements}; \ No newline at end of file diff --git a/docs/assets/DemoPlaybackControls-B8inlhPI.js b/docs/assets/DemoPlaybackControls-D--l_WXN.js similarity index 91% rename from docs/assets/DemoPlaybackControls-B8inlhPI.js rename to docs/assets/DemoPlaybackControls-D--l_WXN.js index f57ad21e..2b4c9863 100644 --- a/docs/assets/DemoPlaybackControls-B8inlhPI.js +++ b/docs/assets/DemoPlaybackControls-D--l_WXN.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{C as i,D as a,E as o,O as s,S as c,T as l,u,w as d}from"./index-B1XI52_L.js";import{n as f,t as p}from"./gr-1PcjgMj0.js";var m=t(),h=e(n(),1),g={Root:`_Root_1sc8r_1`,PlayPause:`_PlayPause_1sc8r_16 _Button_1u47f_2`,Time:`_Time_1sc8r_41`,Seek:`_Seek_1sc8r_59`,Speed:`_Speed_1sc8r_66`,CameraMode:`_CameraMode_1sc8r_67`,Field:`_Field_1sc8r_85`},_=r();function v(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function y(){let e=(0,m.c)(42),t=a(),n=l(),r=i(),y=d(),x=s(),{play:S,pause:C,seek:w,setSpeed:T}=o(),E,D;e[0]!==n||e[1]!==C||e[2]!==S||e[3]!==t?(E=()=>{if(!t)return;let e=e=>{if(e.code!==`Space`)return;let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.tagName===`BUTTON`||t.isContentEditable||(e.preventDefault(),n?C():S())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},D=[t,n,S,C],e[0]=n,e[1]=C,e[2]=S,e[3]=t,e[4]=E,e[5]=D):(E=e[4],D=e[5]),(0,h.useEffect)(E,D);let O;e[6]!==T||e[7]!==x?(O=()=>{let e=c.indexOf(x);e>0&&T(c[e-1])},e[6]=T,e[7]=x,e[8]=O):O=e[8],u(`decreasePlaybackSpeed`,O);let k;e[9]!==T||e[10]!==x?(k=()=>{let e=c.indexOf(x);e{w(parseFloat(e.target.value))},e[12]=w,e[13]=A);let j=A,M;e[14]===T?M=e[15]:(M=e=>{T(parseFloat(e.target.value))},e[14]=T,e[15]=M);let N=M;if(!t||!Number.isFinite(t.duration))return null;let P=n?C:S,F=n?`Pause`:`Play`,I;e[16]===n?I=e[17]:(I=n?(0,_.jsx)(p,{}):(0,_.jsx)(f,{}),e[16]=n,e[17]=I);let L;e[18]!==P||e[19]!==F||e[20]!==I?(L=(0,_.jsx)(`button`,{className:g.PlayPause,onClick:P,"aria-label":F,autoFocus:!0,children:I}),e[18]=P,e[19]=F,e[20]=I,e[21]=L):L=e[21];let R;e[22]===r?R=e[23]:(R=v(r),e[22]=r,e[23]=R);let z;e[24]===y?z=e[25]:(z=v(y),e[24]=y,e[25]=z);let B=`${R} / ${z}`,V;e[26]===B?V=e[27]:(V=(0,_.jsx)(`span`,{className:g.Time,children:B}),e[26]=B,e[27]=V);let H;e[28]!==r||e[29]!==y||e[30]!==j?(H=(0,_.jsx)(`input`,{className:g.Seek,type:`range`,min:0,max:y,step:.01,value:r,onChange:j}),e[28]=r,e[29]=y,e[30]=j,e[31]=H):H=e[31];let U;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(`label`,{htmlFor:`playbackSpeed`,children:`Speed`}),e[32]=U):U=e[32];let W;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(W=c.map(b),e[33]=W):W=e[33];let G;e[34]!==N||e[35]!==x?(G=(0,_.jsxs)(`div`,{className:g.Field,children:[U,(0,_.jsx)(`select`,{id:`playbackSpeed`,className:g.Speed,value:x,onChange:N,children:W})]}),e[34]=N,e[35]=x,e[36]=G):G=e[36];let K;return e[37]!==V||e[38]!==H||e[39]!==G||e[40]!==L?(K=(0,_.jsxs)(`div`,{className:g.Root,children:[L,V,H,G]}),e[37]=V,e[38]=H,e[39]=G,e[40]=L,e[41]=K):K=e[41],K}function b(e){return(0,_.jsxs)(`option`,{value:e,children:[e,`x`]},e)}export{y as DemoPlaybackControls}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{C as i,D as a,E as o,O as s,S as c,T as l,u,w as d}from"./index-DfaykQpF.js";import{n as f,t as p}from"./gr-1PcjgMj0.js";var m=t(),h=e(n(),1),g={Root:`_Root_flggk_1`,PlayPause:`_PlayPause_flggk_16 _Button_p0g82_2`,Time:`_Time_flggk_36`,Seek:`_Seek_flggk_54`,Speed:`_Speed_flggk_61`,CameraMode:`_CameraMode_flggk_62`,Field:`_Field_flggk_80`},_=r();function v(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function y(){let e=(0,m.c)(42),t=a(),n=l(),r=i(),y=d(),x=s(),{play:S,pause:C,seek:w,setSpeed:T}=o(),E,D;e[0]!==n||e[1]!==C||e[2]!==S||e[3]!==t?(E=()=>{if(!t)return;let e=e=>{if(e.code!==`Space`)return;let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.tagName===`BUTTON`||t.isContentEditable||(e.preventDefault(),n?C():S())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},D=[t,n,S,C],e[0]=n,e[1]=C,e[2]=S,e[3]=t,e[4]=E,e[5]=D):(E=e[4],D=e[5]),(0,h.useEffect)(E,D);let O;e[6]!==T||e[7]!==x?(O=()=>{let e=c.indexOf(x);e>0&&T(c[e-1])},e[6]=T,e[7]=x,e[8]=O):O=e[8],u(`decreasePlaybackSpeed`,O);let k;e[9]!==T||e[10]!==x?(k=()=>{let e=c.indexOf(x);e{w(parseFloat(e.target.value))},e[12]=w,e[13]=A);let j=A,M;e[14]===T?M=e[15]:(M=e=>{T(parseFloat(e.target.value))},e[14]=T,e[15]=M);let N=M;if(!t||!Number.isFinite(t.duration))return null;let P=n?C:S,F=n?`Pause`:`Play`,I;e[16]===n?I=e[17]:(I=n?(0,_.jsx)(p,{}):(0,_.jsx)(f,{}),e[16]=n,e[17]=I);let L;e[18]!==P||e[19]!==F||e[20]!==I?(L=(0,_.jsx)(`button`,{className:g.PlayPause,onClick:P,"aria-label":F,autoFocus:!0,children:I}),e[18]=P,e[19]=F,e[20]=I,e[21]=L):L=e[21];let R;e[22]===r?R=e[23]:(R=v(r),e[22]=r,e[23]=R);let z;e[24]===y?z=e[25]:(z=v(y),e[24]=y,e[25]=z);let B=`${R} / ${z}`,V;e[26]===B?V=e[27]:(V=(0,_.jsx)(`span`,{className:g.Time,children:B}),e[26]=B,e[27]=V);let H;e[28]!==r||e[29]!==y||e[30]!==j?(H=(0,_.jsx)(`input`,{className:g.Seek,type:`range`,min:0,max:y,step:.01,value:r,onChange:j}),e[28]=r,e[29]=y,e[30]=j,e[31]=H):H=e[31];let U;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(`label`,{htmlFor:`playbackSpeed`,children:`Speed`}),e[32]=U):U=e[32];let W;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(W=c.map(b),e[33]=W):W=e[33];let G;e[34]!==N||e[35]!==x?(G=(0,_.jsxs)(`div`,{className:g.Field,children:[U,(0,_.jsx)(`select`,{id:`playbackSpeed`,className:g.Speed,value:x,onChange:N,children:W})]}),e[34]=N,e[35]=x,e[36]=G):G=e[36];let K;return e[37]!==V||e[38]!==H||e[39]!==G||e[40]!==L?(K=(0,_.jsxs)(`div`,{className:g.Root,children:[L,V,H,G]}),e[37]=V,e[38]=H,e[39]=G,e[40]=L,e[41]=K):K=e[41],K}function b(e){return(0,_.jsxs)(`option`,{value:e,children:[e,`x`]},e)}export{y as DemoPlaybackControls}; \ No newline at end of file diff --git a/docs/assets/DemoPlaybackControls-D1aGRzqE.css b/docs/assets/DemoPlaybackControls-D1aGRzqE.css new file mode 100644 index 00000000..1c16e222 --- /dev/null +++ b/docs/assets/DemoPlaybackControls-D1aGRzqE.css @@ -0,0 +1 @@ +@layer button{._Button_p0g82_2{color:#fff;cursor:pointer;background:#0062b3cc;border:1px solid #fff6;border-radius:5px;flex:auto;justify-content:center;align-items:center;gap:8px;width:auto;min-width:28px;height:auto;min-height:32px;margin:0;padding:4px 8px;font-family:inherit;font-size:18px;font-weight:500;transition:background .2s,border-color .2s;display:flex;position:relative;transform:translate(0);box-shadow:0 1px 2px #0006}._Button_p0g82_2 svg{opacity:.8;pointer-events:none;flex:none;transition:opacity .2s}._Button_p0g82_2:not(:has(._ButtonLabel_p0g82_37)) svg{opacity:1}._Button_p0g82_2:disabled{opacity:.6;color:#fffc;cursor:default;box-shadow:inset 0 0 12px 1px #36363680}@media (hover:hover){._Button_p0g82_2{color:#ffffffe6;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_p0g82_2:not(:disabled):hover{color:#fff;background:#0062b3cc;border-color:#fff6}._Button_p0g82_2 svg{opacity:.6}._Button_p0g82_2:not(:disabled):hover svg{opacity:1}}._Button_p0g82_2:not(:disabled):active,._Button_p0g82_2[aria-expanded=true]{background:#0062b3b3;border-color:#ffffff4d;transform:translateY(1px)}._Button_p0g82_2[data-active=true]{background:#0075d5e6;border-color:#fff6}._ButtonLabel_p0g82_37{font-size:14px}._ButtonHint_p0g82_92{opacity:.7;font-size:10px}._ButtonGroup_p0g82_97{flex:1 0 auto;align-items:stretch;width:100%;display:flex}._ButtonGroup_p0g82_97 ._Button_p0g82_2{background:#1b4f87b3;flex-direction:column;flex:1 0 0;gap:1px;padding-top:8px;padding-bottom:8px;font-size:22px;box-shadow:inset 0 0 10px #04284780}._ButtonGroup_p0g82_97 ._Button_p0g82_2 svg{margin-bottom:3px}._ButtonGroup_p0g82_97 ._Button_p0g82_2[data-active=true]{background:#0065cbcc;box-shadow:inset 0 2px 3px #08bdff80,inset 0 -2px 6px #00122880}._ButtonGroup_p0g82_97 ._Button_p0g82_2[data-active=true] svg{opacity:1}._ButtonGroup_p0g82_97 ._Button_p0g82_2:not(:first-child){border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}._ButtonGroup_p0g82_97 ._Button_p0g82_2:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}._DestructiveActionButton_p0g82_141{background:#d5423ab3;flex:none;min-width:28px;min-height:28px;margin:0 10px 0 0;padding:2px;font-size:16px}@media (hover:hover){._DestructiveActionButton_p0g82_141:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_p0g82_141{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}}._Root_flggk_1{z-index:2;align-items:center;gap:10px;padding:8px 10px;font-size:13px;display:flex}@media (pointer:coarse){._Root_flggk_1{padding:6px 8px}}._PlayPause_flggk_16{flex:none;justify-content:center;align-items:center;width:36px;height:36px;padding:0;font-size:12px;display:flex}@media (pointer:coarse){._PlayPause_flggk_16{width:40px;height:40px;font-size:14px}}._Time_flggk_36{font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0}@media (width<=599px){._Time_flggk_36{font-size:12px}}@media (width<=399px){._Time_flggk_36{font-size:11px}}._Seek_flggk_54[type=range]{flex:1 0 20px;width:20px;min-width:20px;max-width:none}._Speed_flggk_61,._CameraMode_flggk_62{color:#fff;background:#0009;border:1px solid #ffffff4d;border-radius:3px;flex-shrink:0;padding:3px 4px;font-size:13px}@media (pointer:coarse){._Speed_flggk_61,._CameraMode_flggk_62{padding:8px;font-size:14px}}._Field_flggk_80{align-items:center;gap:8px;display:flex}._Field_flggk_80 label{text-transform:uppercase;color:#fff9;font-size:11px;font-weight:500} diff --git a/docs/assets/DemoPlaybackControls-V-lirz3V.css b/docs/assets/DemoPlaybackControls-V-lirz3V.css deleted file mode 100644 index fa239a1f..00000000 --- a/docs/assets/DemoPlaybackControls-V-lirz3V.css +++ /dev/null @@ -1 +0,0 @@ -@layer button{._Button_1u47f_2{color:#fff;cursor:pointer;background:#0062b3cc;border:1px solid #fff6;border-radius:5px;flex:auto;justify-content:center;align-items:center;gap:8px;width:auto;min-width:28px;height:auto;min-height:32px;margin:0;padding:4px 8px;font-family:inherit;font-size:18px;font-weight:500;transition:background .2s,border-color .2s;display:flex;position:relative;transform:translate(0);box-shadow:0 1px 2px #0006}._Button_1u47f_2 svg{opacity:.8;pointer-events:none;flex:none;transition:opacity .2s}._Button_1u47f_2:disabled{opacity:.6;color:#fffc;cursor:default;box-shadow:inset 0 0 12px 1px #36363680}@media (hover:hover){._Button_1u47f_2{background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_1u47f_2:not(:disabled):hover{background:#0062b3cc;border-color:#fff6}._Button_1u47f_2 svg{opacity:.6}._Button_1u47f_2:not(:disabled):hover svg{opacity:1}}._Button_1u47f_2:not(:disabled):active,._Button_1u47f_2[aria-expanded=true]{background:#0062b3b3;border-color:#ffffff4d;transform:translateY(1px)}._Button_1u47f_2[data-active=true]{background:#0075d5e6;border-color:#fff6}._ButtonLabel_1u47f_82{font-size:14px}._ButtonHint_1u47f_86{opacity:.7;font-size:10px}._ButtonGroup_1u47f_91{flex:1 0 auto;align-items:stretch;width:100%;display:flex}._ButtonGroup_1u47f_91 ._Button_1u47f_2{background:#1b4f87b3;flex-direction:column;flex:1 0 0;gap:1px;padding-top:8px;padding-bottom:8px;font-size:22px;box-shadow:inset 0 0 10px #04284780}._ButtonGroup_1u47f_91 ._Button_1u47f_2 svg{margin-bottom:3px}._ButtonGroup_1u47f_91 ._Button_1u47f_2[data-active=true]{background:#0065cbcc;box-shadow:inset 0 2px 3px #08bdff80,inset 0 -2px 6px #00122880}._ButtonGroup_1u47f_91 ._Button_1u47f_2[data-active=true] svg{opacity:1}._ButtonGroup_1u47f_91 ._Button_1u47f_2:not(:first-child){border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}._ButtonGroup_1u47f_91 ._Button_1u47f_2:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}._DestructiveActionButton_1u47f_135{background:#d5423ab3;flex:none;min-width:28px;min-height:28px;margin:0 10px 0 0;padding:2px;font-size:16px}@media (hover:hover){._DestructiveActionButton_1u47f_135:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_1u47f_135{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}}._Root_1sc8r_1{z-index:2;align-items:center;gap:10px;padding:8px 10px;font-size:13px;display:flex}@media (pointer:coarse){._Root_1sc8r_1{padding:6px 8px}}._PlayPause_1sc8r_16{flex:none;justify-content:center;align-items:center;width:36px;height:36px;padding:0;font-size:12px;display:flex}@media (pointer:coarse){._PlayPause_1sc8r_16{width:40px;height:40px;font-size:14px}}._Time_1sc8r_41{font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0}@media (width<=599px){._Time_1sc8r_41{font-size:12px}}@media (width<=399px){._Time_1sc8r_41{font-size:11px}}._Seek_1sc8r_59[type=range]{flex:1 0 20px;width:20px;min-width:20px;max-width:none}._Speed_1sc8r_66,._CameraMode_1sc8r_67{color:#fff;background:#0009;border:1px solid #ffffff4d;border-radius:3px;flex-shrink:0;padding:3px 4px;font-size:13px}@media (pointer:coarse){._Speed_1sc8r_66,._CameraMode_1sc8r_67{padding:8px;font-size:14px}}._Field_1sc8r_85{align-items:center;gap:8px;display:flex}._Field_1sc8r_85 label{text-transform:uppercase;color:#fff9;font-size:11px;font-weight:500} diff --git a/docs/assets/FloatingLabel-4Yii8rRq.js b/docs/assets/FloatingLabel-Bm1LwAgd.js similarity index 95% rename from docs/assets/FloatingLabel-4Yii8rRq.js rename to docs/assets/FloatingLabel-Bm1LwAgd.js index 8f426241..bea351a8 100644 --- a/docs/assets/FloatingLabel-4Yii8rRq.js +++ b/docs/assets/FloatingLabel-Bm1LwAgd.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i}from"./react-three-fiber.esm-CgPHUpXo.js";import{Ut as a}from"./three.module-07hRbor4.js";import{t as o}from"./Html-BfjRWIZg.js";var s={Label:`_Label_8rn2m_1`},c=t(),l=e(n(),1),u=r(),d=[0,0,0],f=new a;function p(e,t,n,r){let i=e.matrixWorld.elements;return(t-i[12])*-i[8]+(n-i[13])*-i[9]+(r-i[14])*-i[10]<0}var m=(0,l.memo)(function(e){let t=(0,c.c)(12),{children:n,color:r,position:a,opacity:m}=e,h=r===void 0?`white`:r,g=a===void 0?d:a,_=m===void 0?`fadeWithDistance`:m,v=_===`fadeWithDistance`,y=(0,l.useRef)(null),[b,x]=(0,l.useState)(_!==0),S=(0,l.useRef)(null),C;t[0]!==v||t[1]!==b||t[2]!==_?(C=e=>{let{camera:t}=e,n=y.current;if(!n)return;n.getWorldPosition(f);let r=p(t,f.x,f.y,f.z);if(v){let e=r?1/0:t.position.distanceTo(f),n=e<200;if(b!==n&&x(n),S.current&&n){let t=Math.max(0,Math.min(1,1-e/200));S.current.style.opacity=t.toString()}}else{let e=!r&&_!==0;b!==e&&x(e),S.current&&(S.current.style.opacity=_.toString())}},t[0]=v,t[1]=b,t[2]=_,t[3]=C):C=t[3],i(C);let w;t[4]!==n||t[5]!==h||t[6]!==v||t[7]!==b||t[8]!==g?(w=b?(0,u.jsx)(o,{position:g,center:!0,children:(0,u.jsx)(`div`,{ref:S,className:s.Label,style:{color:h,opacity:v?0:void 0},children:n})}):null,t[4]=n,t[5]=h,t[6]=v,t[7]=b,t[8]=g,t[9]=w):w=t[9];let T;return t[10]===w?T=t[11]:(T=(0,u.jsx)(`group`,{ref:y,children:w}),t[10]=w,t[11]=T),T});export{m as t}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i}from"./react-three-fiber.esm-CgPHUpXo.js";import{Ut as a}from"./three.module-07hRbor4.js";import{t as o}from"./Html-DTt-Asp4.js";var s={Label:`_Label_8rn2m_1`},c=t(),l=e(n(),1),u=r(),d=[0,0,0],f=new a;function p(e,t,n,r){let i=e.matrixWorld.elements;return(t-i[12])*-i[8]+(n-i[13])*-i[9]+(r-i[14])*-i[10]<0}var m=(0,l.memo)(function(e){let t=(0,c.c)(12),{children:n,color:r,position:a,opacity:m}=e,h=r===void 0?`white`:r,g=a===void 0?d:a,_=m===void 0?`fadeWithDistance`:m,v=_===`fadeWithDistance`,y=(0,l.useRef)(null),[b,x]=(0,l.useState)(_!==0),S=(0,l.useRef)(null),C;t[0]!==v||t[1]!==b||t[2]!==_?(C=e=>{let{camera:t}=e,n=y.current;if(!n)return;n.getWorldPosition(f);let r=p(t,f.x,f.y,f.z);if(v){let e=r?1/0:t.position.distanceTo(f),n=e<200;if(b!==n&&x(n),S.current&&n){let t=Math.max(0,Math.min(1,1-e/200));S.current.style.opacity=t.toString()}}else{let e=!r&&_!==0;b!==e&&x(e),S.current&&(S.current.style.opacity=_.toString())}},t[0]=v,t[1]=b,t[2]=_,t[3]=C):C=t[3],i(C);let w;t[4]!==n||t[5]!==h||t[6]!==v||t[7]!==b||t[8]!==g?(w=b?(0,u.jsx)(o,{position:g,center:!0,children:(0,u.jsx)(`div`,{ref:S,className:s.Label,style:{color:h,opacity:v?0:void 0},children:n})}):null,t[4]=n,t[5]=h,t[6]=v,t[7]=b,t[8]=g,t[9]=w):w=t[9];let T;return t[10]===w?T=t[11]:(T=(0,u.jsx)(`group`,{ref:y,children:w}),t[10]=w,t[11]=T),T});export{m as t}; \ No newline at end of file diff --git a/docs/assets/GameView-DOXRUG38.js b/docs/assets/GameView-C7uJjiJd.js similarity index 97% rename from docs/assets/GameView-DOXRUG38.js rename to docs/assets/GameView-C7uJjiJd.js index 0702f135..4b5e8a14 100644 --- a/docs/assets/GameView-DOXRUG38.js +++ b/docs/assets/GameView-C7uJjiJd.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PlayerModel-CbQhsRlW.js","assets/chunk-DECur_0Z.js","assets/GenericShape-BC0gDQiR.js","assets/Texture-CIsc25mc.js","assets/react-three-fiber.esm-CgPHUpXo.js","assets/jsx-runtime-BpGWiA-R.js","assets/three.module-07hRbor4.js","assets/traditional-BTL5qX2E.js","assets/useBaseQuery-NrPec9_7.js","assets/index-B1XI52_L.js","assets/preload-helper-CwUjIIrH.js","assets/mission-Bem2ztlS.js","assets/logger-z_EpIdIa.js","assets/streamHelpers-D2N8suZp.js","assets/SettingsProvider-CCHVZuSg.js","assets/manifest-CirqV3Ls.js","assets/stringUtils-EmGsjr9D.js","assets/iconBase-BCRUFbxq.js","assets/middleware-DPacZrFu.js","assets/JoystickContext-YJ6eVLFP.js","assets/scene-BdOVRsxo.js","assets/cameraTourStore-PEzPVGnX.js","assets/engineStore-Dkm20jvr.js","assets/index-DvT5LFSb.css","assets/FloatingLabel-4Yii8rRq.js","assets/Html-BfjRWIZg.js","assets/extends-COZGby3T.js","assets/FloatingLabel-DfptgH-Y.css","assets/globalFogUniforms-CtxQvsRj.js","assets/loaders-CIpiZadQ.js","assets/AudioContext-CMp1T7r9.js","assets/AudioEmitter-2bTNGdLP.js","assets/DebugSuspense-Dk4MzcWf.js","assets/ShapeErrorBoundary-CJ_4YTMy.js","assets/streamPlaybackStore-DhJekvnx.js","assets/ShapeModel-BCrUHJyp.js","assets/Projectiles-DWQwPDtG.js","assets/ForceFieldBare-BzZ8rEsl.js","assets/WaterBlock-C_DD6ULb.js","assets/StreamingController-DfXluNV4.js","assets/gameEntityTypes-B1KihaDt.js","assets/DebugElements-DbcJj7CW.js","assets/DebugElements-BP0b5jan.css","assets/Mission-Coy6f_9U.js","assets/useQuery-FY4YqwDi.js","assets/misToScene-DdnDTJru.js","assets/ChatSoundPlayer-CkJcKyFh.js"])))=>i.map(i=>d[i]); -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i,i as a,o,t as s}from"./react-three-fiber.esm-CgPHUpXo.js";import{a as c,i as l}from"./SettingsProvider-CCHVZuSg.js";import{t as u}from"./useQuery-FY4YqwDi.js";import{C as d,D as f,E as p,T as m,d as h,n as g,r as _,t as v,u as y,w as b,x}from"./GenericShape-BC0gDQiR.js";import{t as S}from"./stringUtils-EmGsjr9D.js";import{t as C}from"./logger-z_EpIdIa.js";import{n as w,t as T}from"./cameraTourStore-PEzPVGnX.js";import{t as E,x as D}from"./streamHelpers-D2N8suZp.js";import{A as O,At as k,C as A,Dt as j,E as M,Et as ee,Gt as te,Ht as N,K as P,M as F,O as I,Ot as ne,S as re,St as ie,Ut as L,Vt as ae,_ as oe,b as R,f as z,h as se,k as ce,lt as B,m as V,nt as le,v as ue,w as H}from"./three.module-07hRbor4.js";import{n as U,r as de,t as fe}from"./scene-BdOVRsxo.js";import"./mission-Bem2ztlS.js";import{a as pe,i as me}from"./engineStore-Dkm20jvr.js";import{t as W}from"./preload-helper-CwUjIIrH.js";import{A as he,D as ge,F as _e,I as ve,M as ye,N as be,R as xe,_ as Se,a as Ce,c as we,g as Te,i as Ee,k as De,l as Oe,m as ke,n as Ae,o as je,p as Me,r as Ne,s as Pe,t as Fe,u as Ie,z as Le}from"./index-B1XI52_L.js";import{f as Re,o as ze,p as G,s as Be,t as Ve,u as He}from"./loaders-CIpiZadQ.js";import{t as Ue}from"./AudioContext-CMp1T7r9.js";import{t as We}from"./extends-COZGby3T.js";import{t as Ge}from"./Html-BfjRWIZg.js";import{t as Ke}from"./Texture-CIsc25mc.js";import{t as qe}from"./FloatingLabel-4Yii8rRq.js";import{t as Je}from"./DebugSuspense-Dk4MzcWf.js";import{t as Ye}from"./gameEntityTypes-B1KihaDt.js";import{n as Xe}from"./streamPlaybackStore-DhJekvnx.js";import{c as Ze,d as Qe,f as $e,i as et,n as tt,o as nt,r as rt,s as it,t as at}from"./globalFogUniforms-CtxQvsRj.js";import{t as ot}from"./ShapeErrorBoundary-CJ_4YTMy.js";var K=e(n());function st(e,t,n){let r=o(e=>e.size),i=o(e=>e.viewport),a=typeof e==`number`?e:r.width*i.dpr,s=typeof t==`number`?t:r.height*i.dpr,c=(typeof e==`number`?n:e)||{},{samples:l=0,depth:u,...d}=c,f=u??c.depthBuffer,p=K.useMemo(()=>{let e=new te(a,s,{minFilter:P,magFilter:P,type:F,...d});return f&&(e.depthTexture=new H(a,s,ce)),e.samples=l,e},[]);return K.useLayoutEffect(()=>{p.setSize(a,s),l&&(p.samples=l)},[l,p,a,s]),K.useEffect(()=>()=>p.dispose(),[]),p}var ct=e=>typeof e==`function`,lt=K.forwardRef(({envMap:e,resolution:t=256,frames:n=1/0,makeDefault:r,children:i,...s},c)=>{let l=o(({set:e})=>e),u=o(({camera:e})=>e),d=o(({size:e})=>e),f=K.useRef(null);K.useImperativeHandle(c,()=>f.current,[]);let p=K.useRef(null),m=st(t);K.useLayoutEffect(()=>{s.manual||(f.current.aspect=d.width/d.height)},[d,s]),K.useLayoutEffect(()=>{f.current.updateProjectionMatrix()});let h=0,g=null,_=ct(i);return a(t=>{_&&(n===1/0||h{if(r){let e=u;return l(()=>({camera:f.current})),()=>l(()=>({camera:e}))}},[f,r,l]),K.createElement(K.Fragment,null,K.createElement(`perspectiveCamera`,We({ref:f},s),!_&&i),K.createElement(`group`,{ref:p},_&&i(m.texture)))});function ut(e,{path:t}){let[n]=i(re,[e],e=>e.setPath(t));return n}ut.preload=(e,{path:t})=>i.preload(re,[e],e=>e.setPath(t));var q=t(),dt={sunLightPointsDown:{value:!0}};function ft(e){dt.sunLightPointsDown.value=e}var J=r(),pt=C(`SceneLighting`);function mt(){let e=(0,q.c)(6),t=ve(),n,r;if(e[0]===t?(n=e[1],r=e[2]):(n=()=>{t?pt.debug(`sunData: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)`,t.direction.x.toFixed(3),t.direction.y.toFixed(3),t.direction.z.toFixed(3),t.color.r.toFixed(3),t.color.g.toFixed(3),t.color.b.toFixed(3),t.ambient.r.toFixed(3),t.ambient.g.toFixed(3),t.ambient.b.toFixed(3)):pt.debug(`No sunData — using fallback ambient #888`)},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,K.useEffect)(n,r),!t){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`ambientLight`,{color:`#888888`,intensity:1}),e[3]=t):t=e[3],t}let i;return e[4]===t?i=e[5]:(i=(0,J.jsx)(ht,{sunData:t}),e[4]=t,e[5]=i),i}function ht(e){let t=(0,q.c)(29),{sunData:n}=e,r;t[0]===n.direction?r=t[1]:(r=de(n.direction),t[0]=n.direction,t[1]=r);let[i,a,o]=r,s=Math.sqrt(i*i+a*a+o*o),c=i/s,l=a/s,u=o/s,d;t[2]!==c||t[3]!==l||t[4]!==u?(d=new L(c,l,u),t[2]=c,t[3]=l,t[4]=u,t[5]=d):d=t[5];let f=d,p=-f.x*5e3,m=-f.y*5e3,h=-f.z*5e3,g;t[6]!==p||t[7]!==m||t[8]!==h?(g=new L(p,m,h),t[6]=p,t[7]=m,t[8]=h,t[9]=g):g=t[9];let _=g,v;t[10]!==n.color.b||t[11]!==n.color.g||t[12]!==n.color.r?(v=new R(n.color.r,n.color.g,n.color.b),t[10]=n.color.b,t[11]=n.color.g,t[12]=n.color.r,t[13]=v):v=t[13];let y=v,b;t[14]!==n.ambient.b||t[15]!==n.ambient.g||t[16]!==n.ambient.r?(b=new R(n.ambient.r,n.ambient.g,n.ambient.b),t[14]=n.ambient.b,t[15]=n.ambient.g,t[16]=n.ambient.r,t[17]=b):b=t[17];let x=b,S=f.y<0,C,w;t[18]===S?(C=t[19],w=t[20]):(C=()=>{ft(S)},w=[S],t[18]=S,t[19]=C,t[20]=w),(0,K.useEffect)(C,w);let T;t[21]!==y||t[22]!==_?(T=(0,J.jsx)(`directionalLight`,{position:_,color:y,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4,"shadow-radius":2}),t[21]=y,t[22]=_,t[23]=T):T=t[23];let E;t[24]===x?E=t[25]:(E=(0,J.jsx)(`ambientLight`,{color:x,intensity:1}),t[24]=x,t[25]=E);let D;return t[26]!==T||t[27]!==E?(D=(0,J.jsxs)(J.Fragment,{children:[T,E]}),t[26]=T,t[27]=E,t[28]=D):D=t[28],D}function gt(){let e=(0,q.c)(4),{fpsLimit:t}=c(),n=o(_t),r,i;return e[0]!==t||e[1]!==n?(r=()=>{if(t==null)return;let e=1e3/t,r=0,i;function a(t){i=requestAnimationFrame(a),t-r>=e&&(r=t-(t-r)%e,n())}return i=requestAnimationFrame(a),()=>cancelAnimationFrame(i)},i=[t,n],e[0]=t,e[1]=n,e[2]=r,e[3]=i):(r=e[2],i=e[3]),(0,K.useEffect)(r,i),t}function _t(e){return e.invalidate}function vt(){return gt(),null}var yt={toneMapping:0,outputColorSpace:ne};function bt(e){let t=(0,q.c)(11),{children:n,renderOnDemand:r,dpr:i,onCreated:a}=e,o=r===void 0?!1:r,{renderOnDemand:u}=l(),d=o||u,{fpsLimit:f}=c(),p=f!=null&&!d,m=d||p?`demand`:`always`,h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={type:1},t[0]=h):h=t[0];let g;t[1]===n?g=t[2]:(g=(0,J.jsx)(K.Suspense,{children:n}),t[1]=n,t[2]=g);let _;t[3]===p?_=t[4]:(_=p?(0,J.jsx)(vt,{}):null,t[3]=p,t[4]=_);let v;return t[5]!==i||t[6]!==a||t[7]!==m||t[8]!==g||t[9]!==_?(v=(0,J.jsxs)(s,{frameloop:m,dpr:i,gl:yt,shadows:h,onCreated:a,children:[g,_]}),t[5]=i,t[6]=a,t[7]=m,t[8]=g,t[9]=_,t[10]=v):v=t[10],v}function xt(e){let t=(0,q.c)(12),{entity:n}=e,{registerCamera:r,unregisterCamera:i}=Se(),a=(0,K.useId)(),o=n.cameraDataBlock,s;t[0]===n.position?s=t[1]:(s=n.position?new L(...n.position):new L,t[0]=n.position,t[1]=s);let c=s,l;t[2]===n.rotation?l=t[3]:(l=n.rotation?new ie(...n.rotation):new ie,t[2]=n.rotation,t[3]=l);let u=l,d,f;return t[4]!==o||t[5]!==a||t[6]!==c||t[7]!==r||t[8]!==u||t[9]!==i?(d=()=>{if(o===`Observer`){let e={id:a,position:c,rotation:u};return r(e),()=>{i(e)}}},f=[a,o,r,i,c,u],t[4]=o,t[5]=a,t[6]=c,t[7]=r,t[8]=u,t[9]=i,t[10]=d,t[11]=f):(d=t[10],f=t[11]),(0,K.useEffect)(d,f),null}function St(e){let t=(0,q.c)(3),{entity:n}=e,r;return t[0]!==n.label||t[1]!==n.position?(r=n.label?(0,J.jsx)(qe,{position:n.position,opacity:.6,children:n.label}):null,t[0]=n.label,t[1]=n.position,t[2]=r):r=t[2],r}function Ct(e){let t=new Float32Array(e.length);for(let n=0;ni.map(i=>d[i]); +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i,i as a,o,t as s}from"./react-three-fiber.esm-CgPHUpXo.js";import{a as c,i as l}from"./SettingsProvider-CCHVZuSg.js";import{t as u}from"./useQuery-lKBLxuin.js";import{C as d,D as f,E as p,T as m,d as h,n as g,r as _,t as v,u as y,w as b,x}from"./GenericShape-FZ5loHEW.js";import{t as S}from"./stringUtils-EmGsjr9D.js";import{t as C}from"./logger-z_EpIdIa.js";import{n as w,t as T}from"./cameraTourStore-PEzPVGnX.js";import{t as E,x as D}from"./streamHelpers-D2N8suZp.js";import{A as O,At as k,C as A,Dt as j,E as M,Et as ee,Gt as te,Ht as N,K as P,M as F,O as I,Ot as ne,S as re,St as ie,Ut as L,Vt as ae,_ as oe,b as R,f as z,h as se,k as ce,lt as B,m as V,nt as le,v as ue,w as H}from"./three.module-07hRbor4.js";import{n as U,r as de,t as fe}from"./scene-BdOVRsxo.js";import"./mission-Bem2ztlS.js";import{a as pe,i as me}from"./engineStore-Dkm20jvr.js";import{t as W}from"./preload-helper-CwUjIIrH.js";import{A as he,D as ge,F as _e,I as ve,M as ye,N as be,R as xe,_ as Se,a as Ce,c as we,g as Te,i as Ee,k as De,l as Oe,m as ke,n as Ae,o as je,p as Me,r as Ne,s as Pe,t as Fe,u as Ie,z as Le}from"./index-DfaykQpF.js";import{f as Re,o as ze,p as G,s as Be,t as Ve,u as He}from"./loaders-CIpiZadQ.js";import{t as Ue}from"./AudioContext-CMp1T7r9.js";import{t as We}from"./extends-COZGby3T.js";import{t as Ge}from"./Html-DTt-Asp4.js";import{t as Ke}from"./Texture-CIsc25mc.js";import{t as qe}from"./FloatingLabel-Bm1LwAgd.js";import{t as Je}from"./DebugSuspense-Dk4MzcWf.js";import{t as Ye}from"./gameEntityTypes-B1KihaDt.js";import{n as Xe}from"./streamPlaybackStore-DhJekvnx.js";import{c as Ze,d as Qe,f as $e,i as et,n as tt,o as nt,r as rt,s as it,t as at}from"./globalFogUniforms-CtxQvsRj.js";import{t as ot}from"./ShapeErrorBoundary-CJ_4YTMy.js";var K=e(n());function st(e,t,n){let r=o(e=>e.size),i=o(e=>e.viewport),a=typeof e==`number`?e:r.width*i.dpr,s=typeof t==`number`?t:r.height*i.dpr,c=(typeof e==`number`?n:e)||{},{samples:l=0,depth:u,...d}=c,f=u??c.depthBuffer,p=K.useMemo(()=>{let e=new te(a,s,{minFilter:P,magFilter:P,type:F,...d});return f&&(e.depthTexture=new H(a,s,ce)),e.samples=l,e},[]);return K.useLayoutEffect(()=>{p.setSize(a,s),l&&(p.samples=l)},[l,p,a,s]),K.useEffect(()=>()=>p.dispose(),[]),p}var ct=e=>typeof e==`function`,lt=K.forwardRef(({envMap:e,resolution:t=256,frames:n=1/0,makeDefault:r,children:i,...s},c)=>{let l=o(({set:e})=>e),u=o(({camera:e})=>e),d=o(({size:e})=>e),f=K.useRef(null);K.useImperativeHandle(c,()=>f.current,[]);let p=K.useRef(null),m=st(t);K.useLayoutEffect(()=>{s.manual||(f.current.aspect=d.width/d.height)},[d,s]),K.useLayoutEffect(()=>{f.current.updateProjectionMatrix()});let h=0,g=null,_=ct(i);return a(t=>{_&&(n===1/0||h{if(r){let e=u;return l(()=>({camera:f.current})),()=>l(()=>({camera:e}))}},[f,r,l]),K.createElement(K.Fragment,null,K.createElement(`perspectiveCamera`,We({ref:f},s),!_&&i),K.createElement(`group`,{ref:p},_&&i(m.texture)))});function ut(e,{path:t}){let[n]=i(re,[e],e=>e.setPath(t));return n}ut.preload=(e,{path:t})=>i.preload(re,[e],e=>e.setPath(t));var q=t(),dt={sunLightPointsDown:{value:!0}};function ft(e){dt.sunLightPointsDown.value=e}var J=r(),pt=C(`SceneLighting`);function mt(){let e=(0,q.c)(6),t=ve(),n,r;if(e[0]===t?(n=e[1],r=e[2]):(n=()=>{t?pt.debug(`sunData: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)`,t.direction.x.toFixed(3),t.direction.y.toFixed(3),t.direction.z.toFixed(3),t.color.r.toFixed(3),t.color.g.toFixed(3),t.color.b.toFixed(3),t.ambient.r.toFixed(3),t.ambient.g.toFixed(3),t.ambient.b.toFixed(3)):pt.debug(`No sunData — using fallback ambient #888`)},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,K.useEffect)(n,r),!t){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`ambientLight`,{color:`#888888`,intensity:1}),e[3]=t):t=e[3],t}let i;return e[4]===t?i=e[5]:(i=(0,J.jsx)(ht,{sunData:t}),e[4]=t,e[5]=i),i}function ht(e){let t=(0,q.c)(29),{sunData:n}=e,r;t[0]===n.direction?r=t[1]:(r=de(n.direction),t[0]=n.direction,t[1]=r);let[i,a,o]=r,s=Math.sqrt(i*i+a*a+o*o),c=i/s,l=a/s,u=o/s,d;t[2]!==c||t[3]!==l||t[4]!==u?(d=new L(c,l,u),t[2]=c,t[3]=l,t[4]=u,t[5]=d):d=t[5];let f=d,p=-f.x*5e3,m=-f.y*5e3,h=-f.z*5e3,g;t[6]!==p||t[7]!==m||t[8]!==h?(g=new L(p,m,h),t[6]=p,t[7]=m,t[8]=h,t[9]=g):g=t[9];let _=g,v;t[10]!==n.color.b||t[11]!==n.color.g||t[12]!==n.color.r?(v=new R(n.color.r,n.color.g,n.color.b),t[10]=n.color.b,t[11]=n.color.g,t[12]=n.color.r,t[13]=v):v=t[13];let y=v,b;t[14]!==n.ambient.b||t[15]!==n.ambient.g||t[16]!==n.ambient.r?(b=new R(n.ambient.r,n.ambient.g,n.ambient.b),t[14]=n.ambient.b,t[15]=n.ambient.g,t[16]=n.ambient.r,t[17]=b):b=t[17];let x=b,S=f.y<0,C,w;t[18]===S?(C=t[19],w=t[20]):(C=()=>{ft(S)},w=[S],t[18]=S,t[19]=C,t[20]=w),(0,K.useEffect)(C,w);let T;t[21]!==y||t[22]!==_?(T=(0,J.jsx)(`directionalLight`,{position:_,color:y,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4,"shadow-radius":2}),t[21]=y,t[22]=_,t[23]=T):T=t[23];let E;t[24]===x?E=t[25]:(E=(0,J.jsx)(`ambientLight`,{color:x,intensity:1}),t[24]=x,t[25]=E);let D;return t[26]!==T||t[27]!==E?(D=(0,J.jsxs)(J.Fragment,{children:[T,E]}),t[26]=T,t[27]=E,t[28]=D):D=t[28],D}function gt(){let e=(0,q.c)(4),{fpsLimit:t}=c(),n=o(_t),r,i;return e[0]!==t||e[1]!==n?(r=()=>{if(t==null)return;let e=1e3/t,r=0,i;function a(t){i=requestAnimationFrame(a),t-r>=e&&(r=t-(t-r)%e,n())}return i=requestAnimationFrame(a),()=>cancelAnimationFrame(i)},i=[t,n],e[0]=t,e[1]=n,e[2]=r,e[3]=i):(r=e[2],i=e[3]),(0,K.useEffect)(r,i),t}function _t(e){return e.invalidate}function vt(){return gt(),null}var yt={toneMapping:0,outputColorSpace:ne};function bt(e){let t=(0,q.c)(11),{children:n,renderOnDemand:r,dpr:i,onCreated:a}=e,o=r===void 0?!1:r,{renderOnDemand:u}=l(),d=o||u,{fpsLimit:f}=c(),p=f!=null&&!d,m=d||p?`demand`:`always`,h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={type:1},t[0]=h):h=t[0];let g;t[1]===n?g=t[2]:(g=(0,J.jsx)(K.Suspense,{children:n}),t[1]=n,t[2]=g);let _;t[3]===p?_=t[4]:(_=p?(0,J.jsx)(vt,{}):null,t[3]=p,t[4]=_);let v;return t[5]!==i||t[6]!==a||t[7]!==m||t[8]!==g||t[9]!==_?(v=(0,J.jsxs)(s,{frameloop:m,dpr:i,gl:yt,shadows:h,onCreated:a,children:[g,_]}),t[5]=i,t[6]=a,t[7]=m,t[8]=g,t[9]=_,t[10]=v):v=t[10],v}function xt(e){let t=(0,q.c)(12),{entity:n}=e,{registerCamera:r,unregisterCamera:i}=Se(),a=(0,K.useId)(),o=n.cameraDataBlock,s;t[0]===n.position?s=t[1]:(s=n.position?new L(...n.position):new L,t[0]=n.position,t[1]=s);let c=s,l;t[2]===n.rotation?l=t[3]:(l=n.rotation?new ie(...n.rotation):new ie,t[2]=n.rotation,t[3]=l);let u=l,d,f;return t[4]!==o||t[5]!==a||t[6]!==c||t[7]!==r||t[8]!==u||t[9]!==i?(d=()=>{if(o===`Observer`){let e={id:a,position:c,rotation:u};return r(e),()=>{i(e)}}},f=[a,o,r,i,c,u],t[4]=o,t[5]=a,t[6]=c,t[7]=r,t[8]=u,t[9]=i,t[10]=d,t[11]=f):(d=t[10],f=t[11]),(0,K.useEffect)(d,f),null}function St(e){let t=(0,q.c)(3),{entity:n}=e,r;return t[0]!==n.label||t[1]!==n.position?(r=n.label?(0,J.jsx)(qe,{position:n.position,opacity:.6,children:n.label}):null,t[0]=n.label,t[1]=n.position,t[2]=r):r=t[2],r}function Ct(e){let t=new Float32Array(e.length);for(let n=0;ne.scene),r=o(e=>e.camera),i=(0,K.useRef)(null),s=(0,K.useMemo)(()=>tt(e.fogVolumes),[e.fogVolumes]);return(0,K.useEffect)(()=>{kn||=(it(),!0)},[]),(0,K.useEffect)(()=>{rt();let[t,a]=In(e,r.position.y),o=new O(e.fogColor,t,a);return n.fog=o,i.current=o,et(r.position.y,s),()=>{n.fog=null,i.current=null,rt()}},[n,r,e,s]),(0,K.useEffect)(()=>{let n=i.current;if(n)if(t){let[t,i]=In(e,r.position.y);n.near=t,n.far=i}else n.near=1e10,n.far=1e10},[t,e,r.position.y]),a(()=>{let n=i.current;if(!n)return;let a=r.position.y;if(et(a,s,t),t){let[t,r]=In(e,a);n.near=t,n.far=r,n.color.copy(e.fogColor)}}),null}var Rn=(0,K.memo)(function({entity:e}){let{skyData:t}=e;On.debug(`Rendering: materialList=%s, useSkyTextures=%s`,t.materialList,t.useSkyTextures);let{fogEnabled:n}=c(),r=t.materialList||void 0,i=(0,K.useMemo)(()=>An(t.skySolidColor),[t.skySolidColor]),a=t.useSkyTextures,s=(0,K.useMemo)(()=>Dn(t),[t]);On.debug(`fogState: fogColor=(%s, %s, %s) visibleDistance=%d fogDistance=%d enabled=%s volumes=%d`,t.fogColor.r.toFixed(3),t.fogColor.g.toFixed(3),t.fogColor.b.toFixed(3),t.visibleDistance,t.fogDistance,s.enabled,s.fogVolumes.length);let l=(0,K.useMemo)(()=>An(t.fogColor),[t.fogColor]),u=i||l,d=s.enabled&&n,f=s.fogColor,p=o(e=>e.scene),m=o(e=>e.gl);(0,K.useEffect)(()=>{if(d){let e=f.clone();p.background=e,m.setClearColor(e)}else if(u){let e=u[0].clone();p.background=e,m.setClearColor(e)}else p.background=null;return()=>{p.background=null}},[p,m,d,f,u]);let h=i?.[1];return(0,J.jsxs)(J.Fragment,{children:[r&&a&&r.length>0?(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(Pn,{materialList:r,fogColor:d?f:void 0,fogState:d?s:void 0},r)}):h?(0,J.jsx)(Fn,{skyColor:h,fogColor:d?f:void 0,fogState:d?s:void 0}):null,(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(wn,{scene:t})}),s.enabled?(0,J.jsx)(Ln,{fogState:s,enabled:n}):null]})});function zn(e){let t=(0,q.c)(3),{children:n}=e,{audioEnabled:r}=c(),i;return t[0]!==r||t[1]!==n?(i=r?(0,J.jsx)(K.Suspense,{children:n}):null,t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Z(e,t){let n=(0,K.lazy)(()=>t().then(t=>({default:t[e]}))),r=t=>{let r=(0,q.c)(5),{entity:i}=t,a=`${e}:${i.id}`,o;r[0]===i?o=r[1]:(o=(0,J.jsx)(n,{entity:i}),r[0]=i,r[1]=o);let s;return r[2]!==a||r[3]!==o?(s=(0,J.jsx)(Je,{name:a,children:o}),r[2]=a,r[3]=o,r[4]=s):s=r[4],s};return r.displayName=`createLazy(${e})`,r}var Bn=Z(`PlayerModel`,()=>W(()=>import(`./PlayerModel-CbQhsRlW.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]))),Vn=Z(`ExplosionShape`,()=>W(()=>import(`./ShapeModel-BCrUHJyp.js`),__vite__mapDeps([35,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,34]))),Hn=Z(`TracerProjectile`,()=>W(()=>import(`./Projectiles-DWQwPDtG.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),Un=Z(`SpriteProjectile`,()=>W(()=>import(`./Projectiles-DWQwPDtG.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),Wn=Z(`ForceFieldBare`,()=>W(()=>import(`./ForceFieldBare-BzZ8rEsl.js`),__vite__mapDeps([37,1,3,4,5,6,7,14,15,16,32,12,29,11]))),Gn=Z(`AudioEmitter`,()=>W(()=>import(`./AudioEmitter-2bTNGdLP.js`),__vite__mapDeps([31,1,4,5,6,7,14,15,16,12,30,22,18,24,25,9,10,11,13,17,19,20,21,23,26,27,29]))),Kn=Z(`WaterBlock`,()=>W(()=>import(`./WaterBlock-C_DD6ULb.js`),__vite__mapDeps([38,1,26,3,4,5,6,7,14,15,16,28,29,11,12,20]))),qn=Z(`WeaponModel`,()=>W(()=>import(`./ShapeModel-BCrUHJyp.js`),__vite__mapDeps([35,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,34]))),Jn=(0,K.memo)(function(e){let t=(0,q.c)(26),{entity:n}=e;switch(n.renderType){case`Shape`:{let e;return t[0]===n?e=t[1]:(e=(0,J.jsx)(Yn,{entity:n}),t[0]=n,t[1]=e),e}case`ForceFieldBare`:{let e;return t[2]===n?e=t[3]:(e=(0,J.jsx)(Wn,{entity:n}),t[2]=n,t[3]=e),e}case`Player`:{let e;return t[4]===n?e=t[5]:(e=(0,J.jsx)(Bn,{entity:n}),t[4]=n,t[5]=e),e}case`Explosion`:{let e;return t[6]===n?e=t[7]:(e=(0,J.jsx)(Vn,{entity:n}),t[6]=n,t[7]=e),e}case`Tracer`:{let e;return t[8]===n?e=t[9]:(e=(0,J.jsx)(Hn,{entity:n}),t[8]=n,t[9]=e),e}case`Sprite`:{let e;return t[10]===n?e=t[11]:(e=(0,J.jsx)(Un,{entity:n}),t[10]=n,t[11]=e),e}case`AudioEmitter`:{let e;return t[12]===n?e=t[13]:(e=(0,J.jsx)(zn,{children:(0,J.jsx)(Gn,{entity:n})}),t[12]=n,t[13]=e),e}case`Camera`:{let e;return t[14]===n?e=t[15]:(e=(0,J.jsx)(xt,{entity:n}),t[14]=n,t[15]=e),e}case`WayPoint`:{let e;return t[16]===n?e=t[17]:(e=(0,J.jsx)(St,{entity:n}),t[16]=n,t[17]=e),e}case`TerrainBlock`:{let e;return t[18]===n.terrainData?e=t[19]:(e=(0,J.jsx)(Kt,{scene:n.terrainData}),t[18]=n.terrainData,t[19]=e),e}case`InteriorInstance`:{let e;return t[20]===n.interiorData?e=t[21]:(e=(0,J.jsx)(cn,{scene:n.interiorData}),t[20]=n.interiorData,t[21]=e),e}case`Sky`:{let e;return t[22]===n?e=t[23]:(e=(0,J.jsx)(Rn,{entity:n}),t[22]=n,t[23]=e),e}case`Sun`:return null;case`WaterBlock`:{let e;return t[24]===n?e=t[25]:(e=(0,J.jsx)(Kn,{entity:n}),t[24]=n,t[25]=e),e}case`MissionArea`:return null;case`None`:return null;default:return null}});function Yn(e){let t=(0,q.c)(24),{entity:n}=e,{animationEnabled:r}=c(),i=(0,K.useRef)(null),o;if(t[0]!==r||t[1]!==n.rotate?(o=()=>{if(!i.current||!n.rotate||!r)return;let e=performance.now()/1e3;i.current.rotation.y=e/3*Math.PI*2},t[0]=r,t[1]=n.rotate,t[2]=o):o=t[2],a(o),!n.shapeName)throw Error(`Shape entity missing shapeName: ${n.id}`);let s=n.runtimeObject,l=n.shapeType??`StaticShape`,u=n.dataBlock?.toLowerCase()===`flag`,d=n.teamId&&n.teamId>0?S[n.teamId]:null,f=u&&d?`${d} Flag`:null,p=n.shapeType===`Item`?`pink`:n.threads?`#00ff88`:`yellow`,m=n.rotate?i:void 0,h=s?void 0:n,_;t[3]===f?_=t[4]:(_=f?(0,J.jsx)(qe,{opacity:.6,children:f}):null,t[3]=f,t[4]=_);let y;t[5]!==p||t[6]!==h||t[7]!==_?(y=(0,J.jsx)(g,{loadingColor:p,streamEntity:h,children:_}),t[5]=p,t[6]=h,t[7]=_,t[8]=y):y=t[8];let b;t[9]!==n.barrelShapeName||t[10]!==s?(b=n.barrelShapeName&&(0,J.jsx)(x,{object:s,shapeName:n.barrelShapeName,type:`Turret`,children:(0,J.jsx)(`group`,{position:[0,1.5,0],children:(0,J.jsx)(g,{})})}),t[9]=n.barrelShapeName,t[10]=s,t[11]=b):b=t[11];let C;t[12]===n?C=t[13]:(C=n.weaponShape&&(0,J.jsx)(ot,{fallback:(0,J.jsx)(v,{color:`red`,label:n.weaponShape}),children:(0,J.jsx)(Je,{name:`Weapon:${n.id}/${n.weaponShape}`,fallback:(0,J.jsx)(v,{color:`cyan`,label:n.weaponShape}),children:(0,J.jsx)(qn,{entity:n})})}),t[12]=n,t[13]=C);let w;t[14]!==m||t[15]!==y||t[16]!==b||t[17]!==C?(w=(0,J.jsxs)(`group`,{ref:m,children:[y,b,C]}),t[14]=m,t[15]=y,t[16]=b,t[17]=C,t[18]=w):w=t[18];let T;return t[19]!==n.shapeName||t[20]!==l||t[21]!==w||t[22]!==s?(T=(0,J.jsx)(x,{object:s,shapeName:n.shapeName,type:l,children:w}),t[19]=n.shapeName,t[20]=l,t[21]=w,t[22]=s,t[23]=T):T=t[23],T}var Xn={Root:`_Root_dlg08_1`,Top:`_Top_dlg08_9 _Root_dlg08_1`,Bottom:`_Bottom_dlg08_14 _Root_dlg08_1`,IffArrow:`_IffArrow_dlg08_19`,Name:`_Name_dlg08_26`,HealthBar:`_HealthBar_dlg08_34`,HealthFill:`_HealthFill_dlg08_43`},Zn=150,Qn=.1,$n=-.2,er=G(`gui/hud_alliedtriangle`),tr=G(`gui/hud_enemytriangle`),nr=new L,rr=[];function ir(e){let t=(0,q.c)(21),{entity:n}=e,r=_(n.shapeName??n.dataBlock),i=o(or),s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),[f,p]=(0,K.useState)(!0),m=(0,K.useRef)(null),g;t[0]===r.scene?g=t[1]:(g=new z().setFromObject(r.scene),t[0]=r.scene,t[1]=g);let v=g.max.y+Qn,y=n.keyframes??rr,b;t[2]===y?b=t[3]:(b=y.some(ar),t[2]=y,t[3]=b);let x=b,S;t[4]!==i||t[5]!==n.id||t[6]!==n.iffColor||t[7]!==n.playerName||t[8]!==x||t[9]!==f||t[10]!==y?(S=()=>{let e=s.current;if(!e)return;e.getWorldPosition(nr);let t=i.position.distanceTo(nr),r=i.matrixWorld.elements,a=!((nr.x-r[12])*-r[8]+(nr.y-r[13])*-r[9]+(nr.z-r[14])*-r[10]<0)&&t=1){c.current&&(c.current.style.opacity=`0`),l.current&&(l.current.style.opacity=`0`);return}let _=Math.max(0,Math.min(1,1-t/Zn)).toString();if(c.current&&(c.current.style.opacity=_),l.current&&(l.current.style.opacity=_),m.current){let e=n.playerName??n.id;m.current.textContent!==e&&(m.current.textContent=e)}if(d.current&&n.iffColor){let e=n.iffColor.r>n.iffColor.g?tr:er;d.current.getAttribute(`src`)!==e&&(d.current.src=e)}u.current&&x&&(u.current.style.width=`${Math.max(0,Math.min(100,g*100))}%`,u.current.style.background=n.iffColor?`rgb(${n.iffColor.r}, ${n.iffColor.g}, ${n.iffColor.b})`:``)},t[4]=i,t[5]=n.id,t[6]=n.iffColor,t[7]=n.playerName,t[8]=x,t[9]=f,t[10]=y,t[11]=S):S=t[11],a(S);let C=n.iffColor&&n.iffColor.r>n.iffColor.g?tr:er,w;t[12]!==n.id||t[13]!==n.playerName||t[14]!==x||t[15]!==v||t[16]!==C||t[17]!==f?(w=f&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ge,{position:[0,v,0],center:!0,children:(0,J.jsx)(`div`,{ref:c,className:Xn.Top,children:(0,J.jsx)(`img`,{ref:d,className:Xn.IffArrow,src:C,alt:``})})}),(0,J.jsx)(Ge,{position:[0,$n,0],center:!0,children:(0,J.jsxs)(`div`,{ref:l,className:Xn.Bottom,children:[(0,J.jsx)(`div`,{ref:m,className:Xn.Name,children:n.playerName??n.id}),x&&(0,J.jsx)(`div`,{className:Xn.HealthBar,children:(0,J.jsx)(`div`,{ref:u,className:Xn.HealthFill})})]})})]}),t[12]=n.id,t[13]=n.playerName,t[14]=x,t[15]=v,t[16]=C,t[17]=f,t[18]=w):w=t[18];let T;return t[19]===w?T=t[20]:(T=(0,J.jsx)(`group`,{ref:s,children:w}),t[19]=w,t[20]=T),T}function ar(e){return e.health!=null}function or(e){return e.camera}var sr={Root:`_Root_yuidw_1`,Distance:`_Distance_yuidw_9`,Icon:`_Icon_yuidw_18`},cr=1.5,lr=G(`commander/MiniIcons/com_flag_grey`),ur=new L;function dr(e){let t=(0,q.c)(9),{entity:n}=e,r=(0,K.useRef)(null),i=(0,K.useRef)(null),s=(0,K.useRef)(null),c=o(fr),l;t[0]!==c||t[1]!==n.iffColor?(l=()=>{if(i.current&&n.iffColor){let{r:e,g:t,b:r}=n.iffColor;i.current.style.backgroundColor=`rgb(${e},${t},${r})`}if(s.current&&r.current){r.current.getWorldPosition(ur);let e=c.position.distanceTo(ur);s.current.textContent=e.toFixed(1)}},t[0]=c,t[1]=n.iffColor,t[2]=l):l=t[2],a(l);let u=n.iffColor?`rgb(${n.iffColor.r},${n.iffColor.g},${n.iffColor.b})`:`rgb(200,200,200)`,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=[0,cr,0],t[3]=d):d=t[3];let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,J.jsx)(`span`,{ref:s,className:sr.Distance}),t[4]=f):f=t[4];let p;t[5]===u?p=t[6]:(p={backgroundColor:u,"--flag-icon-url":`url(${lr})`},t[5]=u,t[6]=p);let m=p,h;return t[7]===m?h=t[8]:(h=(0,J.jsx)(`group`,{ref:r,children:(0,J.jsx)(Ge,{position:d,center:!0,children:(0,J.jsxs)(`div`,{className:sr.Root,children:[f,(0,J.jsx)(`div`,{ref:i,className:sr.Icon,style:m})]})})}),t[7]=m,t[8]=h),h}function fr(e){return e.camera}function pr(){let e=(0,q.c)(1),t=mr,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsx)(`group`,{ref:t,children:(0,J.jsx)(hr,{})}),e[0]=n):n=e[0],n}function mr(e){Xe.setState({root:e})}var hr=(0,K.memo)(function(){let e=ye(),t=(0,K.useRef)(new Map).current,n=new Set;for(let r of e)n.add(r.id),t.set(r.id,r);for(let e of t.keys())n.has(e)||t.delete(e);return(0,J.jsx)(J.Fragment,{children:[...t.values()].map(e=>(0,J.jsx)(gr,{entity:e},e.id))})}),gr=(0,K.memo)(function(e){let t=(0,q.c)(7),{entity:n}=e;if(Ye(n)){let e;t[0]===n?e=t[1]:(e=(0,J.jsx)(Jn,{entity:n}),t[0]=n,t[1]=e);let r;return t[2]!==n.id||t[3]!==e?(r=(0,J.jsx)(`group`,{name:n.id,children:e}),t[2]=n.id,t[3]=e,t[4]=r):r=t[4],r}if(n.renderType===`None`)return null;let r;return t[5]===n?r=t[6]:(r=(0,J.jsx)(br,{entity:n}),t[5]=n,t[6]=r),r});function _r(e){let t=(0,q.c)(2),{entity:n}=e,r=me(vr);if(n.id===r)return null;let i;return t[0]===n?i=t[1]:(i=(0,J.jsx)(ir,{entity:n}),t[0]=n,t[1]=i),i}function vr(e){return e.playback.streamSnapshot?.controlPlayerGhostId}function yr({entity:e}){let t=(0,K.useRef)(!1),[n,r]=(0,K.useState)(()=>(((`targetRenderFlags`in e?e.targetRenderFlags:void 0)??0)&2)!=0);return t.current=n,a(()=>{let n=(((`targetRenderFlags`in e?e.targetRenderFlags:void 0)??0)&2)!=0;n!==t.current&&(t.current=n,r(n))}),n?(0,J.jsx)(dr,{entity:e}):null}function br(e){let t=(0,q.c)(39),{entity:n}=e,r=n.position,i=n.scale,a;bb0:{if(!n.rotation){a=void 0;break bb0}let e;t[0]===n.rotation?e=t[1]:(e=new ie(...n.rotation),t[0]=n.rotation,t[1]=e),a=e}let o=a,s=n.renderType===`Player`;if(n.renderType===`Shape`&&!n.shapeName){let e=n.id,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(`sphereGeometry`,{args:[.3,6,4]}),t[2]=a):a=t[2];let s;t[3]===n.className?s=t[4]:(s=y(n.className),t[3]=n.className,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,J.jsxs)(`mesh`,{children:[a,(0,J.jsx)(`meshBasicMaterial`,{color:s,wireframe:!0})]}),t[5]=s,t[6]=c);let l;t[7]===n?l=t[8]:(l=(0,J.jsx)(yr,{entity:n}),t[7]=n,t[8]=l);let u;return t[9]!==n.id||t[10]!==r||t[11]!==o||t[12]!==i||t[13]!==c||t[14]!==l?(u=(0,J.jsxs)(`group`,{name:e,position:r,quaternion:o,scale:i,children:[c,l]}),t[9]=n.id,t[10]=r,t[11]=o,t[12]=i,t[13]=c,t[14]=l,t[15]=u):u=t[15],u}let c;t[16]!==n.className||t[17]!==n.renderType?(c=n.renderType===`Explosion`?null:(0,J.jsxs)(`mesh`,{children:[(0,J.jsx)(`sphereGeometry`,{args:[.5,8,6]}),(0,J.jsx)(`meshBasicMaterial`,{color:y(n.className),wireframe:!0})]}),t[16]=n.className,t[17]=n.renderType,t[18]=c):c=t[18];let l=c,u;t[19]===n?u=t[20]:(u=(0,J.jsx)(Jn,{entity:n}),t[19]=n,t[20]=u);let d;t[21]!==l||t[22]!==u?(d=(0,J.jsx)(ot,{fallback:l,children:u}),t[21]=l,t[22]=u,t[23]=d):d=t[23];let f;t[24]!==n||t[25]!==s?(f=s&&(0,J.jsx)(_r,{entity:n}),t[24]=n,t[25]=s,t[26]=f):f=t[26];let p;t[27]===n?p=t[28]:(p=(0,J.jsx)(yr,{entity:n}),t[27]=n,t[28]=p);let m;t[29]!==d||t[30]!==f||t[31]!==p?(m=(0,J.jsxs)(`group`,{name:`model`,children:[d,f,p]}),t[29]=d,t[30]=f,t[31]=p,t[32]=m):m=t[32];let h;return t[33]!==n.id||t[34]!==r||t[35]!==o||t[36]!==i||t[37]!==m?(h=(0,J.jsx)(`group`,{name:n.id,position:r,quaternion:o,scale:i,children:m}),t[33]=n.id,t[34]=r,t[35]=o,t[36]=i,t[37]=m,t[38]=h):h=t[38],h}function xr(){let e=(0,q.c)(3),{fov:t}=c(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[0,256,0],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r=(0,J.jsx)(lt,{makeDefault:!0,position:n,fov:t}),e[1]=t,e[2]=r),r}function Sr(e){let t=(0,q.c)(3),{children:n}=e,{debugMode:r}=l(),i;return t[0]!==n||t[1]!==r?(i=r?(0,J.jsx)(K.Suspense,{children:n}):null,t[0]=n,t[1]=r,t[2]=i):i=t[2],i}var Cr=C(`InputConsumer`),wr=270,Tr=Math.PI/2-.01,Er=45,Dr=31,Or=40,kr=1/32,Ar=2*Math.PI;function jr(e){return((Math.round(e/Ar*65536)|0)<<16>>16)*Ar/65536}var Mr=new L,Nr=new L,Pr=new L,Fr=new M(0,0,0,`YXZ`);function Ir(e,t,n,r,i,a,o){if(r===0&&i===0&&a===0)return;let s=Math.sin(t),c=Math.cos(t),l=Math.sin(n),u=Math.cos(n),d=o*kr;e.x+=(c*r+s*u*i+s*l*a)*d,e.y+=(-s*r+c*u*i+c*l*a)*d,e.z+=(-l*i+u*a)*d}function Lr(){let{moveQueue:e,mode:t,setMode:n}=Me(),r=he(e=>e.adapter),i=he(e=>e.gameStatus),s=he(e=>e.liveReady),c=he(e=>e.sendMoves),l=pe(),u=o(e=>e.camera),d=m(),f=(0,K.useRef)(null),h=(0,K.useRef)([]),g=(0,K.useRef)(0),_=(0,K.useRef)(0),v=(0,K.useRef)(null),y=(0,K.useRef)(0),b=(0,K.useRef)(0),x=(0,K.useRef)({x:0,y:0,z:0}),S=(0,K.useRef)(0),C=(0,K.useRef)(0),w=(0,K.useRef)({x:0,y:0,z:0}),T=(0,K.useRef)(!1),D=(0,K.useRef)({x:0,y:0,z:0}),O=(0,K.useRef)({x:0,y:0,z:0}),k=(0,K.useRef)(!1),A=(0,K.useRef)(null),j=(0,K.useRef)(0),M=(0,K.useRef)(0),ee=(0,K.useRef)(0),te=(0,K.useRef)(0),N=(0,K.useRef)(0),P=(0,K.useRef)([!1,!1,!1,!1,!1,!1]),F=!!r&&(i===`connected`||i===`authenticating`);return(0,K.useEffect)(()=>{if(F&&r){if(f.current===r)return;Cr.info(`wiring adapter to engine store`);let e=De.getState(),t={source:`live`,duration:1/0,missionName:e.mapName??null,gameType:null,serverDisplayName:e.serverName??null,recorderName:e.warriorName??null,recordingDate:null,streamingPlayback:r};l.getState().setRecording(t),l.getState().setPlaybackStatus(`playing`),f.current=r,T.current=!1,k.current=!1,A.current=null,h.current.length=0,g.current=0,_.current=0,v.current=null,n(`fly`)}else !F&&f.current&&(l.getState().playback.recording?.source===`live`&&l.getState().setRecording(null),f.current=null,T.current=!1,k.current=!1,A.current=null,h.current.length=0,n(`local`))},[F,r,l,n]),(0,K.useEffect)(()=>{!s&&f.current&&(Cr.info(`mission change: resetting prediction state and mode`),T.current=!1,k.current=!1,A.current=null,h.current.length=0,g.current=0,_.current=0,v.current=null,j.current=0,M.current=0,ee.current=0,te.current=0,N.current=0,P.current.fill(!1),n(`fly`))},[s,n]),(0,K.useEffect)(()=>{if(!F)return Xe.subscribe(e=>{n(e.cameraMode===`orbitOverride`?`follow`:`local`)})},[F,n]),p(()=>{if(!f.current||i!==`connected`||!s)return;let e=j.current,t=M.current;j.current=0,M.current=0;let n=ee.current,r=te.current,a=N.current;ee.current=0,te.current=0,N.current=0;let o=[...P.current];P.current.fill(!1);let l=jr(e),u=jr(t);y.current+=l-e,b.current+=u-t,S.current=y.current,C.current=b.current,w.current={...x.current};let d=Or*2,p=y.current-l,m=b.current-u;Ir(x.current,p,m,n,r,a,d),o[1]=!0;let _=g.current++,v={x:n,y:r,z:a,yaw:e,pitch:t,roll:0,trigger:o,freeLook:!1},T=h.current;T.push({moveIndex:_,move:v,yaw:l,pitch:u,x:n,y:r,z:a}),T.length>Er&&T.splice(0,T.length-Er);let E=f.current.lastMoveAck;for(;T.length>0&&T[0].moveIndex0){let e=T.slice(0,Dr);c(e.map(e=>e.move),e[0].moveIndex)}let F=f.current.getSnapshot();if(F!==A.current){A.current=F;let e=F?.camera;if(e?.orbitTargetId){let t=F.entities.find(t=>t.id===e.orbitTargetId);t?.position&&(D.current={...O.current},O.current={x:t.position[0],y:t.position[1],z:t.position[2]},k.current||=(D.current={...O.current},!0))}}}),a((r,a)=>{let o=e.current;if(o.length>0){let t=0,n=0,r=0,a=0,c=0,l=0,d=[!1,!1,!1,!1,!1,!1];for(let e of o){t+=e.deltaYaw,n+=e.deltaPitch,Math.abs(e.x)>Math.abs(r)&&(r=e.x),Math.abs(e.y)>Math.abs(a)&&(a=e.y),Math.abs(e.z)>Math.abs(c)&&(c=e.z),l+=e.delta;for(let t=0;t_.current){_.current=e;let t=h.current;for(;t.length>0&&t[0].moveIndexe.id===p.orbitTargetId);if(e?.position){let t={x:e.position[0],y:e.position[1],z:e.position[2]};O.current=t,D.current={...t},k.current=!0}}}if(T.current){if(t===`fly`)zr(r.camera,w.current,x.current,y.current,b.current,d());else if(t===`follow`){if(!k.current)return;Br(r.camera,D.current,O.current,y.current,b.current,d(),p?.orbitDistance??4,p?.orbitTargetId)}}}),(0,K.useEffect)(()=>()=>{f.current&&=(l.getState().playback.recording?.source===`live`&&l.getState().setRecording(null),null)},[l]),null}function Rr(e,t,n,r,i,a,o){if((t!==0||n!==0)&&(Fr.setFromQuaternion(e.quaternion,`YXZ`),Fr.y-=t,Fr.x-=n,Fr.x=Math.max(-Tr,Math.min(Tr,Fr.x)),e.quaternion.setFromEuler(Fr)),r!==0||i!==0||a!==0){e.getWorldDirection(Mr),Mr.normalize(),Nr.crossVectors(e.up,Mr).normalize(),Pr.set(0,0,0),i!==0&&Pr.addScaledVector(Mr,i),r!==0&&Pr.addScaledVector(Nr,-r),a!==0&&(Pr.y+=a);let t=Pr.length();t>0&&(Pr.multiplyScalar(Math.min(1,t)/t*wr*o),e.position.add(Pr))}}function zr(e,t,n,r,i,a){let o=t.x+(n.x-t.x)*a,s=t.y+(n.y-t.y)*a,c=t.z+(n.z-t.z)*a;e.position.set(s,c,o);let[l,u,d,f]=D(r,i);e.quaternion.set(l,u,d,f)}function Br(e,t,n,r,i,a,o,s){let c=t.x+(n.x-t.x)*a,l=t.y+(n.y-t.y)*a,u=t.z+(n.z-t.z)*a+(s!=null&&Xe.getState().entities.get(s)?.renderType===`Player`?1:0),d=Math.sin(i),f=Math.cos(i),p=Math.sin(r),m=Math.cos(r),h=Math.max(.1,o),g=c-p*f*h,_=l-m*f*h,v=u+d*h;e.position.set(_,v,g);let[y,b,x,S]=D(r,i);e.quaternion.set(y,b,x,S)}var Vr=C(`CameraTourConsumer`);function Hr(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}var Ur=3,Wr=2,Gr=1.8,Kr=1.8,qr=1.2,Jr=.6,Yr=3/4*(2*Math.PI),Xr=Yr/Jr,Zr=1.5,Qr=1.5,$r=6,ei=180,ti=1.4,ni=new z,ri=new z,ii=new z,ai=new le,oi=new L,si=new L,ci=new L,li=new L,ui=new L,Q=new ie,di=new ie,fi=new le,pi=new M;function mi(e){if(e.orbitCenter)return ui.set(e.orbitCenter[0],e.orbitCenter[1],e.orbitCenter[2]);let t=e.targets[e.currentIndex];return ui.set(t.position[0],t.position[1],t.position[2])}function hi(e){return e.orbitRadius??Ur}function gi(e){return hi(e)*(Wr/Ur)}function _i(e,t,n){let r=mi(e),i=hi(e),a=gi(e);return n.set(r.x+Math.cos(t)*i,r.y+a,r.z+Math.sin(t)*i)}function vi(e,t,n){let r=e.getObjectByName(t.entityId);if(r){ni.setFromObject(r),ni.getCenter(oi),n.orbitCenter=[oi.x,oi.y,oi.z];let e=fi.copy(r.matrixWorld).invert();ri.makeEmpty(),r.traverse(t=>{t.geometry&&(t.geometry.boundingBox||t.geometry.computeBoundingBox(),ii.copy(t.geometry.boundingBox),ai.multiplyMatrices(e,t.matrixWorld),ii.applyMatrix4(ai),ri.union(ii))}),ri.getSize(si);let i=si.y,a=Math.max(si.x,si.z),o=i/2+Kr,s=a/2+qr,c=Math.max(o,s);n.orbitRadius=Math.max(Gr,c);let l=o>=s?`height`:`spread`,u=c=e.phaseDuration&&(e.phase=`orbiting`,e.elapsed=0,e.orbitStartAngle=Si(t.position,e))}function Ti(e,t,n){let r=e.targets.length===1,i=e.currentIndex>=e.targets.length-1;e.elapsed+=n;let a=e.orbitStartAngle,o=Xr+Zr,s;if(e.elapsed<=Xr)s=a+e.elapsed*Jr;else{let t=e.elapsed-Xr,n=Math.min(1,t/Zr),r=t*Jr*(1-n/2);s=a+Yr+r}_i(e,s,ci),t.position.copy(ci);let c=bi(ci,mi(e));t.quaternion.copy(c),e.elapsed>=o&&(r||i?T.getState().cancel():T.getState().advanceTarget())}function Ei(){let e=(0,q.c)(4),t=o(ji),n=o(Ai),r=o(ki),i=(0,K.useRef)(null);Ie(`nextStop`,Oi),Ie(`exitTour`,Di);let s;return e[0]!==n||e[1]!==t||e[2]!==r?(s=(e,a)=>{let o=T.getState().animation;if(!o){i.current&&=(yi(n.quaternion),null);return}t(),i.current=o,o.phase===`traveling`?wi(o,n,a,r):Ti(o,n,a)},e[0]=n,e[1]=t,e[2]=r,e[3]=s):s=e[3],a(s),null}function Di(){T.getState().cancel()}function Oi(){let e=T.getState().animation;e&&(e.currentIndex>=e.targets.length-1?T.getState().cancel():T.getState().advanceTarget())}function ki(e){return e.scene}function Ai(e){return e.camera}function ji(e){return e.invalidate}var Mi=3;function $({map:e}){let t=je,n=o(e=>e.gl.domElement),r=(0,K.useMemo)(()=>{let n=e.map(e=>{let t=Array.isArray(e.keys)?e.keys:[e.keys];return{name:e.name,bindings:t.map(Oe)}}),r={};for(let e of n)r[e.name]=Ne(e.bindings[0]);let i=new Map,a=[],o=[],s=[],c=[],l=[];for(let e of n)for(let t of e.bindings)switch(t.type){case`key`:{let n=i.get(t.code);n||(n=[],i.set(t.code,n)),n.push({action:e,binding:t});break}case`click`:a.push({action:e,binding:t});break;case`drag`:o.push({action:e,binding:t});break;case`pointerLockMove`:s.push({action:e});break;case`scroll`:c.push({action:e});break;case`touch`:l.push({action:e});break}function u(e){return e==null?!0:e===!!document.pointerLockElement}function d(e){let{actions:n}=t.getState(),r={};for(let[,t]of i)for(let{action:i,binding:a}of t){let t=e.has(a.code)&&Pe(e,a.modifiers),o=n[i.name]?.pressed??!1;t&&!o?(r[i.name]={pressed:!0},we(i.name)):!t&&o&&(r[i.name]={pressed:!1})}Object.keys(r).length>0&&t.setState(e=>({...e,actions:{...e.actions,...r}}))}let f=-1,p=0,m=0,h=!1;function g(e,n){t.setState(t=>({...t,actions:{...t.actions,[e]:n}}))}function _(e){let t=!!document.pointerLockElement;for(let{action:t,binding:n}of a){if(!u(n.whenPointerLocked))continue;let r=n.button??0;e.button===r&&Ce(e,n.modifiers)&&g(t.name,{pressed:!0})}t||(f=e.button,p=e.clientX,m=e.clientY,h=!1)}function v(e){if(document.pointerLockElement){if(s.length>0){let{actions:n}=t.getState(),r={};for(let{action:t}of s){let i=n[t.name];r[t.name]={...i,deltaX:i.deltaX+e.movementX,deltaY:i.deltaY+e.movementY}}t.setState(e=>({...e,actions:{...e.actions,...r}}))}return}if(f<0)return;if(!h){let n=e.clientX-p,r=e.clientY-m;if(Math.abs(n)0&&t.setState(e=>({...e,actions:{...e.actions,...r}}))}function y(e){let n=!!document.pointerLockElement;for(let{action:n,binding:r}of a){if(!u(r.whenPointerLocked))continue;let i=r.button??0;e.button===i&&t.getState().actions[n.name].pressed&&(we(n.name),g(n.name,{pressed:!1}))}if(!n&&e.button===f){for(let{action:e,binding:n}of o)u(n.whenPointerLocked)&&(n.button??0)===f&&t.getState().actions[e.name].dragging&&g(e.name,Ae());f=-1,h=!1}}function b(e){for(let{action:t}of c)g(t.name,{deltaX:e.deltaX,deltaY:e.deltaY}),we(t.name)}let x=null,S=0,C=0;function w(e){if(x!==null||l.length===0)return;let t=e.changedTouches[0];if(t){x=t.identifier,S=t.clientX,C=t.clientY;for(let{action:e}of l)g(e.name,{touching:!0,dragging:!1,deltaX:0,deltaY:0})}}function T(e){if(x!==null)for(let n=0;ne.name),initialActions:r,deriveKeyActions:d,hasKeyBindings:i.size>0,handleMouseDown:_,handleMouseMove:v,handleMouseUp:y,handleWheel:b,handleTouchStart:w,handleTouchMove:T,handleTouchEnd:E,hasMouseBindings:a.length>0||o.length>0||s.length>0,hasScrollBindings:c.length>0,hasTouchBindings:l.length>0}},[e,t]);return(0,K.useEffect)(()=>{t.setState(e=>({...e,actions:{...e.actions,...r.initialActions}}));let e;return r.hasKeyBindings&&(r.deriveKeyActions(t.getState().keys),e=t.subscribe(e=>e.keys,e=>r.deriveKeyActions(e))),r.hasMouseBindings&&(n.addEventListener(`mousedown`,r.handleMouseDown),document.addEventListener(`mousemove`,r.handleMouseMove),document.addEventListener(`mouseup`,r.handleMouseUp)),r.hasScrollBindings&&n.addEventListener(`wheel`,r.handleWheel,{passive:!0}),r.hasTouchBindings&&(n.addEventListener(`touchstart`,r.handleTouchStart,{passive:!0}),document.addEventListener(`touchmove`,r.handleTouchMove,{passive:!0}),document.addEventListener(`touchend`,r.handleTouchEnd,{passive:!0}),document.addEventListener(`touchcancel`,r.handleTouchEnd,{passive:!0})),()=>{e?.(),r.hasMouseBindings&&(n.removeEventListener(`mousedown`,r.handleMouseDown),document.removeEventListener(`mousemove`,r.handleMouseMove),document.removeEventListener(`mouseup`,r.handleMouseUp)),r.hasScrollBindings&&n.removeEventListener(`wheel`,r.handleWheel),r.hasTouchBindings&&(n.removeEventListener(`touchstart`,r.handleTouchStart),document.removeEventListener(`touchmove`,r.handleTouchMove),document.removeEventListener(`touchend`,r.handleTouchEnd),document.removeEventListener(`touchcancel`,r.handleTouchEnd)),t.setState(e=>{let t={...e.actions};for(let e of r.actionNames)delete t[e];return{...e,actions:t}})}},[r,t,n]),null}var Ni=[{name:`moveForward`,keys:[`KeyW`]},{name:`moveBackward`,keys:[`KeyS`]},{name:`moveLeft`,keys:[`KeyA`]},{name:`moveRight`,keys:[`KeyD`]},{name:`moveUp`,keys:[`KeyE`]},{name:`moveDown`,keys:[`KeyQ`]},{name:`adjustSpeed`,keys:[{type:`scroll`}]}],Pi=[{name:`lookUp`,keys:[`ArrowUp`]},{name:`lookDown`,keys:[`ArrowDown`]},{name:`lookLeft`,keys:[`ArrowLeft`]},{name:`lookRight`,keys:[`ArrowRight`]},{name:`dragLook`,keys:[{type:`drag`,button:0}]},{name:`lockedLook`,keys:[{type:`pointerLockMove`}]},{name:`touchLook`,keys:[{type:`touch`}]}],Fi=[{name:`canvasClick`,keys:[{type:`click`,button:0,whenPointerLocked:!1}]}],Ii=[{name:`camera1`,keys:[`Digit1`]},{name:`camera2`,keys:[`Digit2`]},{name:`camera3`,keys:[`Digit3`]},{name:`camera4`,keys:[`Digit4`]},{name:`camera5`,keys:[`Digit5`]},{name:`camera6`,keys:[`Digit6`]},{name:`camera7`,keys:[`Digit7`]},{name:`camera8`,keys:[`Digit8`]},{name:`camera9`,keys:[`Digit9`]}],Li=[{name:`playPause`,keys:[`Space`]},{name:`decreasePlaybackSpeed`,keys:[`Comma`,`Shift-Comma`]},{name:`increasePlaybackSpeed`,keys:[`Period`,`Shift-Period`]}],Ri=[{name:`toggleObserverMode`,keys:[`Space`]}],zi=[{name:`nextPlayer`,keys:[{type:`click`,button:0,whenPointerLocked:!0}]}],Bi=[{name:`nextStop`,keys:[{type:`click`,button:0}]},{name:`exitTour`,keys:[`Escape`]}];function Vi(){let e=(0,q.c)(27),t=ge(),n=ke(),r=w(Hi),i=t?.source===`demo`,a=t?.source===`live`,o=!t,s=o&&!r||a&&n===`fly`,c=!r,l=!r,u;e[0]===s?u=e[1]:(u=s&&(0,J.jsx)($,{map:Ni}),e[0]=s,e[1]=u);let d;e[2]===c?d=e[3]:(d=c&&(0,J.jsx)($,{map:Pi}),e[2]=c,e[3]=d);let f;e[4]===l?f=e[5]:(f=l&&(0,J.jsx)($,{map:Fi}),e[4]=l,e[5]=f);let p;e[6]!==o||e[7]!==r?(p=o&&!r&&(0,J.jsx)($,{map:Ii}),e[6]=o,e[7]=r,e[8]=p):p=e[8];let m;e[9]===i?m=e[10]:(m=i&&(0,J.jsx)($,{map:Li}),e[9]=i,e[10]=m);let h;e[11]===a?h=e[12]:(h=a&&(0,J.jsx)($,{map:Ri}),e[11]=a,e[12]=h);let g;e[13]!==n||e[14]!==a?(g=a&&n===`follow`&&(0,J.jsx)($,{map:zi}),e[13]=n,e[14]=a,e[15]=g):g=e[15];let _;e[16]===r?_=e[17]:(_=r&&(0,J.jsx)($,{map:Bi}),e[16]=r,e[17]=_);let v;return e[18]!==u||e[19]!==d||e[20]!==f||e[21]!==p||e[22]!==m||e[23]!==h||e[24]!==g||e[25]!==_?(v=(0,J.jsxs)(J.Fragment,{children:[u,d,f,p,m,h,g,_]}),e[18]=u,e[19]=d,e[20]=f,e[21]=p,e[22]=m,e[23]=h,e[24]=g,e[25]=_,e[26]=v):v=e[26],v}function Hi(e){return e.animation!==null}function Ui(e,t){return(0,K.lazy)(()=>t().then(t=>({default:t[e]})))}var Wi=Ui(`StreamingController`,()=>W(()=>import(`./StreamingController-DfXluNV4.js`),__vite__mapDeps([39,1,9,10,11,12,4,5,6,7,13,14,15,16,17,18,19,20,21,22,23,2,3,8,24,25,26,27,28,29,30,31,0,32,33,34,40]))),Gi=Ui(`DebugElements`,()=>W(()=>import(`./DebugElements-DbcJj7CW.js`),__vite__mapDeps([41,1,25,9,10,11,12,4,5,6,7,13,14,15,16,17,18,19,20,21,22,23,26,42]))),Ki=Ui(`Mission`,()=>W(()=>import(`./Mission-Coy6f_9U.js`),__vite__mapDeps([43,1,9,10,11,12,4,5,6,7,13,14,15,16,17,18,19,20,21,22,23,44,8,29,45]))),qi=Ui(`ChatSoundPlayer`,()=>W(()=>import(`./ChatSoundPlayer-CkJcKyFh.js`),__vite__mapDeps([46,1,14,5,15,16,6,30,4,7,22,18,31,12,24,25,9,10,11,13,17,19,20,21,23,26,27,29]))),Ji=(0,K.memo)(function(e){let t=(0,q.c)(23),{dpr:n,onCreated:r,missionName:i,missionType:a,onLoadingChange:o}=e,s=ge(),c=be(),l=c===`demo`||c===`live`,u,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(Vi,{}),d=(0,J.jsx)(Fe,{}),t[0]=u,t[1]=d):(u=t[0],d=t[1]);let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,J.jsx)(mt,{}),t[2]=f):f=t[2];let p,m;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(pr,{})}),m=(0,J.jsx)(xr,{}),t[3]=p,t[4]=m):(p=t[3],m=t[4]);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,J.jsx)(zn,{children:(0,J.jsx)(qi,{})}),t[5]=h):h=t[5];let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(Sr,{children:(0,J.jsx)(Gi,{})}),t[6]=g):g=t[6];let _;t[7]===s?_=t[8]:(_=s?(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(Wi,{recording:s})}):null,t[7]=s,t[8]=_);let v;t[9]!==l||t[10]!==i||t[11]!==a||t[12]!==o?(v=l?null:(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(Ki,{name:i,missionType:a,onLoadingChange:o},`${i}~${a}`)}),t[9]=l,t[10]=i,t[11]=a,t[12]=o,t[13]=v):v=t[13];let y,x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,J.jsx)(Ei,{}),x=(0,J.jsx)(Lr,{}),t[14]=y,t[15]=x):(y=t[14],x=t[15]);let S;t[16]!==_||t[17]!==v?(S=(0,J.jsx)(b,{children:(0,J.jsxs)(Te,{children:[u,d,(0,J.jsxs)(Ue,{children:[f,p,m,h,g,_,v,y,x]})]})}),t[16]=_,t[17]=v,t[18]=S):S=t[18];let C;return t[19]!==n||t[20]!==r||t[21]!==S?(C=(0,J.jsx)(bt,{dpr:n,onCreated:r,children:S}),t[19]=n,t[20]=r,t[21]=S,t[22]=C):C=t[22],C});export{Ji as GameView}; \ No newline at end of file + `,depthWrite:!1,depthTest:!1})]})}function In(e,t){let{fogDistance:n,visibleDistance:r}=e;return[n,r]}function Ln({fogState:e,enabled:t}){let n=o(e=>e.scene),r=o(e=>e.camera),i=(0,K.useRef)(null),s=(0,K.useMemo)(()=>tt(e.fogVolumes),[e.fogVolumes]);return(0,K.useEffect)(()=>{kn||=(it(),!0)},[]),(0,K.useEffect)(()=>{rt();let[t,a]=In(e,r.position.y),o=new O(e.fogColor,t,a);return n.fog=o,i.current=o,et(r.position.y,s),()=>{n.fog=null,i.current=null,rt()}},[n,r,e,s]),(0,K.useEffect)(()=>{let n=i.current;if(n)if(t){let[t,i]=In(e,r.position.y);n.near=t,n.far=i}else n.near=1e10,n.far=1e10},[t,e,r.position.y]),a(()=>{let n=i.current;if(!n)return;let a=r.position.y;if(et(a,s,t),t){let[t,r]=In(e,a);n.near=t,n.far=r,n.color.copy(e.fogColor)}}),null}var Rn=(0,K.memo)(function({entity:e}){let{skyData:t}=e;On.debug(`Rendering: materialList=%s, useSkyTextures=%s`,t.materialList,t.useSkyTextures);let{fogEnabled:n}=c(),r=t.materialList||void 0,i=(0,K.useMemo)(()=>An(t.skySolidColor),[t.skySolidColor]),a=t.useSkyTextures,s=(0,K.useMemo)(()=>Dn(t),[t]);On.debug(`fogState: fogColor=(%s, %s, %s) visibleDistance=%d fogDistance=%d enabled=%s volumes=%d`,t.fogColor.r.toFixed(3),t.fogColor.g.toFixed(3),t.fogColor.b.toFixed(3),t.visibleDistance,t.fogDistance,s.enabled,s.fogVolumes.length);let l=(0,K.useMemo)(()=>An(t.fogColor),[t.fogColor]),u=i||l,d=s.enabled&&n,f=s.fogColor,p=o(e=>e.scene),m=o(e=>e.gl);(0,K.useEffect)(()=>{if(d){let e=f.clone();p.background=e,m.setClearColor(e)}else if(u){let e=u[0].clone();p.background=e,m.setClearColor(e)}else p.background=null;return()=>{p.background=null}},[p,m,d,f,u]);let h=i?.[1];return(0,J.jsxs)(J.Fragment,{children:[r&&a&&r.length>0?(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(Pn,{materialList:r,fogColor:d?f:void 0,fogState:d?s:void 0},r)}):h?(0,J.jsx)(Fn,{skyColor:h,fogColor:d?f:void 0,fogState:d?s:void 0}):null,(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(wn,{scene:t})}),s.enabled?(0,J.jsx)(Ln,{fogState:s,enabled:n}):null]})});function zn(e){let t=(0,q.c)(3),{children:n}=e,{audioEnabled:r}=c(),i;return t[0]!==r||t[1]!==n?(i=r?(0,J.jsx)(K.Suspense,{children:n}):null,t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Z(e,t){let n=(0,K.lazy)(()=>t().then(t=>({default:t[e]}))),r=t=>{let r=(0,q.c)(5),{entity:i}=t,a=`${e}:${i.id}`,o;r[0]===i?o=r[1]:(o=(0,J.jsx)(n,{entity:i}),r[0]=i,r[1]=o);let s;return r[2]!==a||r[3]!==o?(s=(0,J.jsx)(Je,{name:a,children:o}),r[2]=a,r[3]=o,r[4]=s):s=r[4],s};return r.displayName=`createLazy(${e})`,r}var Bn=Z(`PlayerModel`,()=>W(()=>import(`./PlayerModel-Cm8DLHtl.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]))),Vn=Z(`ExplosionShape`,()=>W(()=>import(`./ShapeModel-BMJjmLiG.js`),__vite__mapDeps([35,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,34]))),Hn=Z(`TracerProjectile`,()=>W(()=>import(`./Projectiles-Uxzfj6xB.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),Un=Z(`SpriteProjectile`,()=>W(()=>import(`./Projectiles-Uxzfj6xB.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),Wn=Z(`ForceFieldBare`,()=>W(()=>import(`./ForceFieldBare-BzZ8rEsl.js`),__vite__mapDeps([37,1,3,4,5,6,7,14,15,16,32,12,29,11]))),Gn=Z(`AudioEmitter`,()=>W(()=>import(`./AudioEmitter-Dk4R9QgT.js`),__vite__mapDeps([31,1,4,5,6,7,14,15,16,12,30,22,18,24,25,9,10,11,13,17,19,20,21,23,26,27,29]))),Kn=Z(`WaterBlock`,()=>W(()=>import(`./WaterBlock-C_DD6ULb.js`),__vite__mapDeps([38,1,26,3,4,5,6,7,14,15,16,28,29,11,12,20]))),qn=Z(`WeaponModel`,()=>W(()=>import(`./ShapeModel-BMJjmLiG.js`),__vite__mapDeps([35,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,34]))),Jn=(0,K.memo)(function(e){let t=(0,q.c)(26),{entity:n}=e;switch(n.renderType){case`Shape`:{let e;return t[0]===n?e=t[1]:(e=(0,J.jsx)(Yn,{entity:n}),t[0]=n,t[1]=e),e}case`ForceFieldBare`:{let e;return t[2]===n?e=t[3]:(e=(0,J.jsx)(Wn,{entity:n}),t[2]=n,t[3]=e),e}case`Player`:{let e;return t[4]===n?e=t[5]:(e=(0,J.jsx)(Bn,{entity:n}),t[4]=n,t[5]=e),e}case`Explosion`:{let e;return t[6]===n?e=t[7]:(e=(0,J.jsx)(Vn,{entity:n}),t[6]=n,t[7]=e),e}case`Tracer`:{let e;return t[8]===n?e=t[9]:(e=(0,J.jsx)(Hn,{entity:n}),t[8]=n,t[9]=e),e}case`Sprite`:{let e;return t[10]===n?e=t[11]:(e=(0,J.jsx)(Un,{entity:n}),t[10]=n,t[11]=e),e}case`AudioEmitter`:{let e;return t[12]===n?e=t[13]:(e=(0,J.jsx)(zn,{children:(0,J.jsx)(Gn,{entity:n})}),t[12]=n,t[13]=e),e}case`Camera`:{let e;return t[14]===n?e=t[15]:(e=(0,J.jsx)(xt,{entity:n}),t[14]=n,t[15]=e),e}case`WayPoint`:{let e;return t[16]===n?e=t[17]:(e=(0,J.jsx)(St,{entity:n}),t[16]=n,t[17]=e),e}case`TerrainBlock`:{let e;return t[18]===n.terrainData?e=t[19]:(e=(0,J.jsx)(Kt,{scene:n.terrainData}),t[18]=n.terrainData,t[19]=e),e}case`InteriorInstance`:{let e;return t[20]===n.interiorData?e=t[21]:(e=(0,J.jsx)(cn,{scene:n.interiorData}),t[20]=n.interiorData,t[21]=e),e}case`Sky`:{let e;return t[22]===n?e=t[23]:(e=(0,J.jsx)(Rn,{entity:n}),t[22]=n,t[23]=e),e}case`Sun`:return null;case`WaterBlock`:{let e;return t[24]===n?e=t[25]:(e=(0,J.jsx)(Kn,{entity:n}),t[24]=n,t[25]=e),e}case`MissionArea`:return null;case`None`:return null;default:return null}});function Yn(e){let t=(0,q.c)(24),{entity:n}=e,{animationEnabled:r}=c(),i=(0,K.useRef)(null),o;if(t[0]!==r||t[1]!==n.rotate?(o=()=>{if(!i.current||!n.rotate||!r)return;let e=performance.now()/1e3;i.current.rotation.y=e/3*Math.PI*2},t[0]=r,t[1]=n.rotate,t[2]=o):o=t[2],a(o),!n.shapeName)throw Error(`Shape entity missing shapeName: ${n.id}`);let s=n.runtimeObject,l=n.shapeType??`StaticShape`,u=n.dataBlock?.toLowerCase()===`flag`,d=n.teamId&&n.teamId>0?S[n.teamId]:null,f=u&&d?`${d} Flag`:null,p=n.shapeType===`Item`?`pink`:n.threads?`#00ff88`:`yellow`,m=n.rotate?i:void 0,h=s?void 0:n,_;t[3]===f?_=t[4]:(_=f?(0,J.jsx)(qe,{opacity:.6,children:f}):null,t[3]=f,t[4]=_);let y;t[5]!==p||t[6]!==h||t[7]!==_?(y=(0,J.jsx)(g,{loadingColor:p,streamEntity:h,children:_}),t[5]=p,t[6]=h,t[7]=_,t[8]=y):y=t[8];let b;t[9]!==n.barrelShapeName||t[10]!==s?(b=n.barrelShapeName&&(0,J.jsx)(x,{object:s,shapeName:n.barrelShapeName,type:`Turret`,children:(0,J.jsx)(`group`,{position:[0,1.5,0],children:(0,J.jsx)(g,{})})}),t[9]=n.barrelShapeName,t[10]=s,t[11]=b):b=t[11];let C;t[12]===n?C=t[13]:(C=n.weaponShape&&(0,J.jsx)(ot,{fallback:(0,J.jsx)(v,{color:`red`,label:n.weaponShape}),children:(0,J.jsx)(Je,{name:`Weapon:${n.id}/${n.weaponShape}`,fallback:(0,J.jsx)(v,{color:`cyan`,label:n.weaponShape}),children:(0,J.jsx)(qn,{entity:n})})}),t[12]=n,t[13]=C);let w;t[14]!==m||t[15]!==y||t[16]!==b||t[17]!==C?(w=(0,J.jsxs)(`group`,{ref:m,children:[y,b,C]}),t[14]=m,t[15]=y,t[16]=b,t[17]=C,t[18]=w):w=t[18];let T;return t[19]!==n.shapeName||t[20]!==l||t[21]!==w||t[22]!==s?(T=(0,J.jsx)(x,{object:s,shapeName:n.shapeName,type:l,children:w}),t[19]=n.shapeName,t[20]=l,t[21]=w,t[22]=s,t[23]=T):T=t[23],T}var Xn={Root:`_Root_dlg08_1`,Top:`_Top_dlg08_9 _Root_dlg08_1`,Bottom:`_Bottom_dlg08_14 _Root_dlg08_1`,IffArrow:`_IffArrow_dlg08_19`,Name:`_Name_dlg08_26`,HealthBar:`_HealthBar_dlg08_34`,HealthFill:`_HealthFill_dlg08_43`},Zn=150,Qn=.1,$n=-.2,er=G(`gui/hud_alliedtriangle`),tr=G(`gui/hud_enemytriangle`),nr=new L,rr=[];function ir(e){let t=(0,q.c)(21),{entity:n}=e,r=_(n.shapeName??n.dataBlock),i=o(or),s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),[f,p]=(0,K.useState)(!0),m=(0,K.useRef)(null),g;t[0]===r.scene?g=t[1]:(g=new z().setFromObject(r.scene),t[0]=r.scene,t[1]=g);let v=g.max.y+Qn,y=n.keyframes??rr,b;t[2]===y?b=t[3]:(b=y.some(ar),t[2]=y,t[3]=b);let x=b,S;t[4]!==i||t[5]!==n.id||t[6]!==n.iffColor||t[7]!==n.playerName||t[8]!==x||t[9]!==f||t[10]!==y?(S=()=>{let e=s.current;if(!e)return;e.getWorldPosition(nr);let t=i.position.distanceTo(nr),r=i.matrixWorld.elements,a=!((nr.x-r[12])*-r[8]+(nr.y-r[13])*-r[9]+(nr.z-r[14])*-r[10]<0)&&t=1){c.current&&(c.current.style.opacity=`0`),l.current&&(l.current.style.opacity=`0`);return}let _=Math.max(0,Math.min(1,1-t/Zn)).toString();if(c.current&&(c.current.style.opacity=_),l.current&&(l.current.style.opacity=_),m.current){let e=n.playerName??n.id;m.current.textContent!==e&&(m.current.textContent=e)}if(d.current&&n.iffColor){let e=n.iffColor.r>n.iffColor.g?tr:er;d.current.getAttribute(`src`)!==e&&(d.current.src=e)}u.current&&x&&(u.current.style.width=`${Math.max(0,Math.min(100,g*100))}%`,u.current.style.background=n.iffColor?`rgb(${n.iffColor.r}, ${n.iffColor.g}, ${n.iffColor.b})`:``)},t[4]=i,t[5]=n.id,t[6]=n.iffColor,t[7]=n.playerName,t[8]=x,t[9]=f,t[10]=y,t[11]=S):S=t[11],a(S);let C=n.iffColor&&n.iffColor.r>n.iffColor.g?tr:er,w;t[12]!==n.id||t[13]!==n.playerName||t[14]!==x||t[15]!==v||t[16]!==C||t[17]!==f?(w=f&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ge,{position:[0,v,0],center:!0,children:(0,J.jsx)(`div`,{ref:c,className:Xn.Top,children:(0,J.jsx)(`img`,{ref:d,className:Xn.IffArrow,src:C,alt:``})})}),(0,J.jsx)(Ge,{position:[0,$n,0],center:!0,children:(0,J.jsxs)(`div`,{ref:l,className:Xn.Bottom,children:[(0,J.jsx)(`div`,{ref:m,className:Xn.Name,children:n.playerName??n.id}),x&&(0,J.jsx)(`div`,{className:Xn.HealthBar,children:(0,J.jsx)(`div`,{ref:u,className:Xn.HealthFill})})]})})]}),t[12]=n.id,t[13]=n.playerName,t[14]=x,t[15]=v,t[16]=C,t[17]=f,t[18]=w):w=t[18];let T;return t[19]===w?T=t[20]:(T=(0,J.jsx)(`group`,{ref:s,children:w}),t[19]=w,t[20]=T),T}function ar(e){return e.health!=null}function or(e){return e.camera}var sr={Root:`_Root_yuidw_1`,Distance:`_Distance_yuidw_9`,Icon:`_Icon_yuidw_18`},cr=1.5,lr=G(`commander/MiniIcons/com_flag_grey`),ur=new L;function dr(e){let t=(0,q.c)(9),{entity:n}=e,r=(0,K.useRef)(null),i=(0,K.useRef)(null),s=(0,K.useRef)(null),c=o(fr),l;t[0]!==c||t[1]!==n.iffColor?(l=()=>{if(i.current&&n.iffColor){let{r:e,g:t,b:r}=n.iffColor;i.current.style.backgroundColor=`rgb(${e},${t},${r})`}if(s.current&&r.current){r.current.getWorldPosition(ur);let e=c.position.distanceTo(ur);s.current.textContent=e.toFixed(1)}},t[0]=c,t[1]=n.iffColor,t[2]=l):l=t[2],a(l);let u=n.iffColor?`rgb(${n.iffColor.r},${n.iffColor.g},${n.iffColor.b})`:`rgb(200,200,200)`,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=[0,cr,0],t[3]=d):d=t[3];let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,J.jsx)(`span`,{ref:s,className:sr.Distance}),t[4]=f):f=t[4];let p;t[5]===u?p=t[6]:(p={backgroundColor:u,"--flag-icon-url":`url(${lr})`},t[5]=u,t[6]=p);let m=p,h;return t[7]===m?h=t[8]:(h=(0,J.jsx)(`group`,{ref:r,children:(0,J.jsx)(Ge,{position:d,center:!0,children:(0,J.jsxs)(`div`,{className:sr.Root,children:[f,(0,J.jsx)(`div`,{ref:i,className:sr.Icon,style:m})]})})}),t[7]=m,t[8]=h),h}function fr(e){return e.camera}function pr(){let e=(0,q.c)(1),t=mr,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsx)(`group`,{ref:t,children:(0,J.jsx)(hr,{})}),e[0]=n):n=e[0],n}function mr(e){Xe.setState({root:e})}var hr=(0,K.memo)(function(){let e=ye(),t=(0,K.useRef)(new Map).current,n=new Set;for(let r of e)n.add(r.id),t.set(r.id,r);for(let e of t.keys())n.has(e)||t.delete(e);return(0,J.jsx)(J.Fragment,{children:[...t.values()].map(e=>(0,J.jsx)(gr,{entity:e},e.id))})}),gr=(0,K.memo)(function(e){let t=(0,q.c)(7),{entity:n}=e;if(Ye(n)){let e;t[0]===n?e=t[1]:(e=(0,J.jsx)(Jn,{entity:n}),t[0]=n,t[1]=e);let r;return t[2]!==n.id||t[3]!==e?(r=(0,J.jsx)(`group`,{name:n.id,children:e}),t[2]=n.id,t[3]=e,t[4]=r):r=t[4],r}if(n.renderType===`None`)return null;let r;return t[5]===n?r=t[6]:(r=(0,J.jsx)(br,{entity:n}),t[5]=n,t[6]=r),r});function _r(e){let t=(0,q.c)(2),{entity:n}=e,r=me(vr);if(n.id===r)return null;let i;return t[0]===n?i=t[1]:(i=(0,J.jsx)(ir,{entity:n}),t[0]=n,t[1]=i),i}function vr(e){return e.playback.streamSnapshot?.controlPlayerGhostId}function yr({entity:e}){let t=(0,K.useRef)(!1),[n,r]=(0,K.useState)(()=>(((`targetRenderFlags`in e?e.targetRenderFlags:void 0)??0)&2)!=0);return t.current=n,a(()=>{let n=(((`targetRenderFlags`in e?e.targetRenderFlags:void 0)??0)&2)!=0;n!==t.current&&(t.current=n,r(n))}),n?(0,J.jsx)(dr,{entity:e}):null}function br(e){let t=(0,q.c)(39),{entity:n}=e,r=n.position,i=n.scale,a;bb0:{if(!n.rotation){a=void 0;break bb0}let e;t[0]===n.rotation?e=t[1]:(e=new ie(...n.rotation),t[0]=n.rotation,t[1]=e),a=e}let o=a,s=n.renderType===`Player`;if(n.renderType===`Shape`&&!n.shapeName){let e=n.id,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(`sphereGeometry`,{args:[.3,6,4]}),t[2]=a):a=t[2];let s;t[3]===n.className?s=t[4]:(s=y(n.className),t[3]=n.className,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,J.jsxs)(`mesh`,{children:[a,(0,J.jsx)(`meshBasicMaterial`,{color:s,wireframe:!0})]}),t[5]=s,t[6]=c);let l;t[7]===n?l=t[8]:(l=(0,J.jsx)(yr,{entity:n}),t[7]=n,t[8]=l);let u;return t[9]!==n.id||t[10]!==r||t[11]!==o||t[12]!==i||t[13]!==c||t[14]!==l?(u=(0,J.jsxs)(`group`,{name:e,position:r,quaternion:o,scale:i,children:[c,l]}),t[9]=n.id,t[10]=r,t[11]=o,t[12]=i,t[13]=c,t[14]=l,t[15]=u):u=t[15],u}let c;t[16]!==n.className||t[17]!==n.renderType?(c=n.renderType===`Explosion`?null:(0,J.jsxs)(`mesh`,{children:[(0,J.jsx)(`sphereGeometry`,{args:[.5,8,6]}),(0,J.jsx)(`meshBasicMaterial`,{color:y(n.className),wireframe:!0})]}),t[16]=n.className,t[17]=n.renderType,t[18]=c):c=t[18];let l=c,u;t[19]===n?u=t[20]:(u=(0,J.jsx)(Jn,{entity:n}),t[19]=n,t[20]=u);let d;t[21]!==l||t[22]!==u?(d=(0,J.jsx)(ot,{fallback:l,children:u}),t[21]=l,t[22]=u,t[23]=d):d=t[23];let f;t[24]!==n||t[25]!==s?(f=s&&(0,J.jsx)(_r,{entity:n}),t[24]=n,t[25]=s,t[26]=f):f=t[26];let p;t[27]===n?p=t[28]:(p=(0,J.jsx)(yr,{entity:n}),t[27]=n,t[28]=p);let m;t[29]!==d||t[30]!==f||t[31]!==p?(m=(0,J.jsxs)(`group`,{name:`model`,children:[d,f,p]}),t[29]=d,t[30]=f,t[31]=p,t[32]=m):m=t[32];let h;return t[33]!==n.id||t[34]!==r||t[35]!==o||t[36]!==i||t[37]!==m?(h=(0,J.jsx)(`group`,{name:n.id,position:r,quaternion:o,scale:i,children:m}),t[33]=n.id,t[34]=r,t[35]=o,t[36]=i,t[37]=m,t[38]=h):h=t[38],h}function xr(){let e=(0,q.c)(3),{fov:t}=c(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[0,256,0],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r=(0,J.jsx)(lt,{makeDefault:!0,position:n,fov:t}),e[1]=t,e[2]=r),r}function Sr(e){let t=(0,q.c)(3),{children:n}=e,{debugMode:r}=l(),i;return t[0]!==n||t[1]!==r?(i=r?(0,J.jsx)(K.Suspense,{children:n}):null,t[0]=n,t[1]=r,t[2]=i):i=t[2],i}var Cr=C(`InputConsumer`),wr=270,Tr=Math.PI/2-.01,Er=45,Dr=31,Or=40,kr=1/32,Ar=2*Math.PI;function jr(e){return((Math.round(e/Ar*65536)|0)<<16>>16)*Ar/65536}var Mr=new L,Nr=new L,Pr=new L,Fr=new M(0,0,0,`YXZ`);function Ir(e,t,n,r,i,a,o){if(r===0&&i===0&&a===0)return;let s=Math.sin(t),c=Math.cos(t),l=Math.sin(n),u=Math.cos(n),d=o*kr;e.x+=(c*r+s*u*i+s*l*a)*d,e.y+=(-s*r+c*u*i+c*l*a)*d,e.z+=(-l*i+u*a)*d}function Lr(){let{moveQueue:e,mode:t,setMode:n}=Me(),r=he(e=>e.adapter),i=he(e=>e.gameStatus),s=he(e=>e.liveReady),c=he(e=>e.sendMoves),l=pe(),u=o(e=>e.camera),d=m(),f=(0,K.useRef)(null),h=(0,K.useRef)([]),g=(0,K.useRef)(0),_=(0,K.useRef)(0),v=(0,K.useRef)(null),y=(0,K.useRef)(0),b=(0,K.useRef)(0),x=(0,K.useRef)({x:0,y:0,z:0}),S=(0,K.useRef)(0),C=(0,K.useRef)(0),w=(0,K.useRef)({x:0,y:0,z:0}),T=(0,K.useRef)(!1),D=(0,K.useRef)({x:0,y:0,z:0}),O=(0,K.useRef)({x:0,y:0,z:0}),k=(0,K.useRef)(!1),A=(0,K.useRef)(null),j=(0,K.useRef)(0),M=(0,K.useRef)(0),ee=(0,K.useRef)(0),te=(0,K.useRef)(0),N=(0,K.useRef)(0),P=(0,K.useRef)([!1,!1,!1,!1,!1,!1]),F=!!r&&(i===`connected`||i===`authenticating`);return(0,K.useEffect)(()=>{if(F&&r){if(f.current===r)return;Cr.info(`wiring adapter to engine store`);let e=De.getState(),t={source:`live`,duration:1/0,missionName:e.mapName??null,gameType:null,serverDisplayName:e.serverName??null,recorderName:e.warriorName??null,recordingDate:null,streamingPlayback:r};l.getState().setRecording(t),l.getState().setPlaybackStatus(`playing`),f.current=r,T.current=!1,k.current=!1,A.current=null,h.current.length=0,g.current=0,_.current=0,v.current=null,n(`fly`)}else !F&&f.current&&(l.getState().playback.recording?.source===`live`&&l.getState().setRecording(null),f.current=null,T.current=!1,k.current=!1,A.current=null,h.current.length=0,n(`local`))},[F,r,l,n]),(0,K.useEffect)(()=>{!s&&f.current&&(Cr.info(`mission change: resetting prediction state and mode`),T.current=!1,k.current=!1,A.current=null,h.current.length=0,g.current=0,_.current=0,v.current=null,j.current=0,M.current=0,ee.current=0,te.current=0,N.current=0,P.current.fill(!1),n(`fly`))},[s,n]),(0,K.useEffect)(()=>{if(!F)return Xe.subscribe(e=>{n(e.cameraMode===`orbitOverride`?`follow`:`local`)})},[F,n]),p(()=>{if(!f.current||i!==`connected`||!s)return;let e=j.current,t=M.current;j.current=0,M.current=0;let n=ee.current,r=te.current,a=N.current;ee.current=0,te.current=0,N.current=0;let o=[...P.current];P.current.fill(!1);let l=jr(e),u=jr(t);y.current+=l-e,b.current+=u-t,S.current=y.current,C.current=b.current,w.current={...x.current};let d=Or*2,p=y.current-l,m=b.current-u;Ir(x.current,p,m,n,r,a,d),o[1]=!0;let _=g.current++,v={x:n,y:r,z:a,yaw:e,pitch:t,roll:0,trigger:o,freeLook:!1},T=h.current;T.push({moveIndex:_,move:v,yaw:l,pitch:u,x:n,y:r,z:a}),T.length>Er&&T.splice(0,T.length-Er);let E=f.current.lastMoveAck;for(;T.length>0&&T[0].moveIndex0){let e=T.slice(0,Dr);c(e.map(e=>e.move),e[0].moveIndex)}let F=f.current.getSnapshot();if(F!==A.current){A.current=F;let e=F?.camera;if(e?.orbitTargetId){let t=F.entities.find(t=>t.id===e.orbitTargetId);t?.position&&(D.current={...O.current},O.current={x:t.position[0],y:t.position[1],z:t.position[2]},k.current||=(D.current={...O.current},!0))}}}),a((r,a)=>{let o=e.current;if(o.length>0){let t=0,n=0,r=0,a=0,c=0,l=0,d=[!1,!1,!1,!1,!1,!1];for(let e of o){t+=e.deltaYaw,n+=e.deltaPitch,Math.abs(e.x)>Math.abs(r)&&(r=e.x),Math.abs(e.y)>Math.abs(a)&&(a=e.y),Math.abs(e.z)>Math.abs(c)&&(c=e.z),l+=e.delta;for(let t=0;t_.current){_.current=e;let t=h.current;for(;t.length>0&&t[0].moveIndexe.id===p.orbitTargetId);if(e?.position){let t={x:e.position[0],y:e.position[1],z:e.position[2]};O.current=t,D.current={...t},k.current=!0}}}if(T.current){if(t===`fly`)zr(r.camera,w.current,x.current,y.current,b.current,d());else if(t===`follow`){if(!k.current)return;Br(r.camera,D.current,O.current,y.current,b.current,d(),p?.orbitDistance??4,p?.orbitTargetId)}}}),(0,K.useEffect)(()=>()=>{f.current&&=(l.getState().playback.recording?.source===`live`&&l.getState().setRecording(null),null)},[l]),null}function Rr(e,t,n,r,i,a,o){if((t!==0||n!==0)&&(Fr.setFromQuaternion(e.quaternion,`YXZ`),Fr.y-=t,Fr.x-=n,Fr.x=Math.max(-Tr,Math.min(Tr,Fr.x)),e.quaternion.setFromEuler(Fr)),r!==0||i!==0||a!==0){e.getWorldDirection(Mr),Mr.normalize(),Nr.crossVectors(e.up,Mr).normalize(),Pr.set(0,0,0),i!==0&&Pr.addScaledVector(Mr,i),r!==0&&Pr.addScaledVector(Nr,-r),a!==0&&(Pr.y+=a);let t=Pr.length();t>0&&(Pr.multiplyScalar(Math.min(1,t)/t*wr*o),e.position.add(Pr))}}function zr(e,t,n,r,i,a){let o=t.x+(n.x-t.x)*a,s=t.y+(n.y-t.y)*a,c=t.z+(n.z-t.z)*a;e.position.set(s,c,o);let[l,u,d,f]=D(r,i);e.quaternion.set(l,u,d,f)}function Br(e,t,n,r,i,a,o,s){let c=t.x+(n.x-t.x)*a,l=t.y+(n.y-t.y)*a,u=t.z+(n.z-t.z)*a+(s!=null&&Xe.getState().entities.get(s)?.renderType===`Player`?1:0),d=Math.sin(i),f=Math.cos(i),p=Math.sin(r),m=Math.cos(r),h=Math.max(.1,o),g=c-p*f*h,_=l-m*f*h,v=u+d*h;e.position.set(_,v,g);let[y,b,x,S]=D(r,i);e.quaternion.set(y,b,x,S)}var Vr=C(`CameraTourConsumer`);function Hr(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}var Ur=3,Wr=2,Gr=1.8,Kr=1.8,qr=1.2,Jr=.6,Yr=3/4*(2*Math.PI),Xr=Yr/Jr,Zr=1.5,Qr=1.5,$r=6,ei=180,ti=1.4,ni=new z,ri=new z,ii=new z,ai=new le,oi=new L,si=new L,ci=new L,li=new L,ui=new L,Q=new ie,di=new ie,fi=new le,pi=new M;function mi(e){if(e.orbitCenter)return ui.set(e.orbitCenter[0],e.orbitCenter[1],e.orbitCenter[2]);let t=e.targets[e.currentIndex];return ui.set(t.position[0],t.position[1],t.position[2])}function hi(e){return e.orbitRadius??Ur}function gi(e){return hi(e)*(Wr/Ur)}function _i(e,t,n){let r=mi(e),i=hi(e),a=gi(e);return n.set(r.x+Math.cos(t)*i,r.y+a,r.z+Math.sin(t)*i)}function vi(e,t,n){let r=e.getObjectByName(t.entityId);if(r){ni.setFromObject(r),ni.getCenter(oi),n.orbitCenter=[oi.x,oi.y,oi.z];let e=fi.copy(r.matrixWorld).invert();ri.makeEmpty(),r.traverse(t=>{t.geometry&&(t.geometry.boundingBox||t.geometry.computeBoundingBox(),ii.copy(t.geometry.boundingBox),ai.multiplyMatrices(e,t.matrixWorld),ii.applyMatrix4(ai),ri.union(ii))}),ri.getSize(si);let i=si.y,a=Math.max(si.x,si.z),o=i/2+Kr,s=a/2+qr,c=Math.max(o,s);n.orbitRadius=Math.max(Gr,c);let l=o>=s?`height`:`spread`,u=c=e.phaseDuration&&(e.phase=`orbiting`,e.elapsed=0,e.orbitStartAngle=Si(t.position,e))}function Ti(e,t,n){let r=e.targets.length===1,i=e.currentIndex>=e.targets.length-1;e.elapsed+=n;let a=e.orbitStartAngle,o=Xr+Zr,s;if(e.elapsed<=Xr)s=a+e.elapsed*Jr;else{let t=e.elapsed-Xr,n=Math.min(1,t/Zr),r=t*Jr*(1-n/2);s=a+Yr+r}_i(e,s,ci),t.position.copy(ci);let c=bi(ci,mi(e));t.quaternion.copy(c),e.elapsed>=o&&(r||i?T.getState().cancel():T.getState().advanceTarget())}function Ei(){let e=(0,q.c)(4),t=o(ji),n=o(Ai),r=o(ki),i=(0,K.useRef)(null);Ie(`nextStop`,Oi),Ie(`exitTour`,Di);let s;return e[0]!==n||e[1]!==t||e[2]!==r?(s=(e,a)=>{let o=T.getState().animation;if(!o){i.current&&=(yi(n.quaternion),null);return}t(),i.current=o,o.phase===`traveling`?wi(o,n,a,r):Ti(o,n,a)},e[0]=n,e[1]=t,e[2]=r,e[3]=s):s=e[3],a(s),null}function Di(){T.getState().cancel()}function Oi(){let e=T.getState().animation;e&&(e.currentIndex>=e.targets.length-1?T.getState().cancel():T.getState().advanceTarget())}function ki(e){return e.scene}function Ai(e){return e.camera}function ji(e){return e.invalidate}var Mi=3;function $({map:e}){let t=je,n=o(e=>e.gl.domElement),r=(0,K.useMemo)(()=>{let n=e.map(e=>{let t=Array.isArray(e.keys)?e.keys:[e.keys];return{name:e.name,bindings:t.map(Oe)}}),r={};for(let e of n)r[e.name]=Ne(e.bindings[0]);let i=new Map,a=[],o=[],s=[],c=[],l=[];for(let e of n)for(let t of e.bindings)switch(t.type){case`key`:{let n=i.get(t.code);n||(n=[],i.set(t.code,n)),n.push({action:e,binding:t});break}case`click`:a.push({action:e,binding:t});break;case`drag`:o.push({action:e,binding:t});break;case`pointerLockMove`:s.push({action:e});break;case`scroll`:c.push({action:e});break;case`touch`:l.push({action:e});break}function u(e){return e==null?!0:e===!!document.pointerLockElement}function d(e){let{actions:n}=t.getState(),r={};for(let[,t]of i)for(let{action:i,binding:a}of t){let t=e.has(a.code)&&Pe(e,a.modifiers),o=n[i.name]?.pressed??!1;t&&!o?(r[i.name]={pressed:!0},we(i.name)):!t&&o&&(r[i.name]={pressed:!1})}Object.keys(r).length>0&&t.setState(e=>({...e,actions:{...e.actions,...r}}))}let f=-1,p=0,m=0,h=!1;function g(e,n){t.setState(t=>({...t,actions:{...t.actions,[e]:n}}))}function _(e){let t=!!document.pointerLockElement;for(let{action:t,binding:n}of a){if(!u(n.whenPointerLocked))continue;let r=n.button??0;e.button===r&&Ce(e,n.modifiers)&&g(t.name,{pressed:!0})}t||(f=e.button,p=e.clientX,m=e.clientY,h=!1)}function v(e){if(document.pointerLockElement){if(s.length>0){let{actions:n}=t.getState(),r={};for(let{action:t}of s){let i=n[t.name];r[t.name]={...i,deltaX:i.deltaX+e.movementX,deltaY:i.deltaY+e.movementY}}t.setState(e=>({...e,actions:{...e.actions,...r}}))}return}if(f<0)return;if(!h){let n=e.clientX-p,r=e.clientY-m;if(Math.abs(n)0&&t.setState(e=>({...e,actions:{...e.actions,...r}}))}function y(e){let n=!!document.pointerLockElement;for(let{action:n,binding:r}of a){if(!u(r.whenPointerLocked))continue;let i=r.button??0;e.button===i&&t.getState().actions[n.name].pressed&&(we(n.name),g(n.name,{pressed:!1}))}if(!n&&e.button===f){for(let{action:e,binding:n}of o)u(n.whenPointerLocked)&&(n.button??0)===f&&t.getState().actions[e.name].dragging&&g(e.name,Ae());f=-1,h=!1}}function b(e){for(let{action:t}of c)g(t.name,{deltaX:e.deltaX,deltaY:e.deltaY}),we(t.name)}let x=null,S=0,C=0;function w(e){if(x!==null||l.length===0)return;let t=e.changedTouches[0];if(t){x=t.identifier,S=t.clientX,C=t.clientY;for(let{action:e}of l)g(e.name,{touching:!0,dragging:!1,deltaX:0,deltaY:0})}}function T(e){if(x!==null)for(let n=0;ne.name),initialActions:r,deriveKeyActions:d,hasKeyBindings:i.size>0,handleMouseDown:_,handleMouseMove:v,handleMouseUp:y,handleWheel:b,handleTouchStart:w,handleTouchMove:T,handleTouchEnd:E,hasMouseBindings:a.length>0||o.length>0||s.length>0,hasScrollBindings:c.length>0,hasTouchBindings:l.length>0}},[e,t]);return(0,K.useEffect)(()=>{t.setState(e=>({...e,actions:{...e.actions,...r.initialActions}}));let e;return r.hasKeyBindings&&(r.deriveKeyActions(t.getState().keys),e=t.subscribe(e=>e.keys,e=>r.deriveKeyActions(e))),r.hasMouseBindings&&(n.addEventListener(`mousedown`,r.handleMouseDown),document.addEventListener(`mousemove`,r.handleMouseMove),document.addEventListener(`mouseup`,r.handleMouseUp)),r.hasScrollBindings&&n.addEventListener(`wheel`,r.handleWheel,{passive:!0}),r.hasTouchBindings&&(n.addEventListener(`touchstart`,r.handleTouchStart,{passive:!0}),document.addEventListener(`touchmove`,r.handleTouchMove,{passive:!0}),document.addEventListener(`touchend`,r.handleTouchEnd,{passive:!0}),document.addEventListener(`touchcancel`,r.handleTouchEnd,{passive:!0})),()=>{e?.(),r.hasMouseBindings&&(n.removeEventListener(`mousedown`,r.handleMouseDown),document.removeEventListener(`mousemove`,r.handleMouseMove),document.removeEventListener(`mouseup`,r.handleMouseUp)),r.hasScrollBindings&&n.removeEventListener(`wheel`,r.handleWheel),r.hasTouchBindings&&(n.removeEventListener(`touchstart`,r.handleTouchStart),document.removeEventListener(`touchmove`,r.handleTouchMove),document.removeEventListener(`touchend`,r.handleTouchEnd),document.removeEventListener(`touchcancel`,r.handleTouchEnd)),t.setState(e=>{let t={...e.actions};for(let e of r.actionNames)delete t[e];return{...e,actions:t}})}},[r,t,n]),null}var Ni=[{name:`moveForward`,keys:[`KeyW`]},{name:`moveBackward`,keys:[`KeyS`]},{name:`moveLeft`,keys:[`KeyA`]},{name:`moveRight`,keys:[`KeyD`]},{name:`moveUp`,keys:[`KeyE`]},{name:`moveDown`,keys:[`KeyQ`]},{name:`adjustSpeed`,keys:[{type:`scroll`}]}],Pi=[{name:`lookUp`,keys:[`ArrowUp`]},{name:`lookDown`,keys:[`ArrowDown`]},{name:`lookLeft`,keys:[`ArrowLeft`]},{name:`lookRight`,keys:[`ArrowRight`]},{name:`dragLook`,keys:[{type:`drag`,button:0}]},{name:`lockedLook`,keys:[{type:`pointerLockMove`}]},{name:`touchLook`,keys:[{type:`touch`}]}],Fi=[{name:`canvasClick`,keys:[{type:`click`,button:0,whenPointerLocked:!1}]}],Ii=[{name:`camera1`,keys:[`Digit1`]},{name:`camera2`,keys:[`Digit2`]},{name:`camera3`,keys:[`Digit3`]},{name:`camera4`,keys:[`Digit4`]},{name:`camera5`,keys:[`Digit5`]},{name:`camera6`,keys:[`Digit6`]},{name:`camera7`,keys:[`Digit7`]},{name:`camera8`,keys:[`Digit8`]},{name:`camera9`,keys:[`Digit9`]}],Li=[{name:`playPause`,keys:[`Space`]},{name:`decreasePlaybackSpeed`,keys:[`Comma`,`Shift-Comma`]},{name:`increasePlaybackSpeed`,keys:[`Period`,`Shift-Period`]}],Ri=[{name:`toggleObserverMode`,keys:[`Space`]}],zi=[{name:`nextPlayer`,keys:[{type:`click`,button:0,whenPointerLocked:!0}]}],Bi=[{name:`nextStop`,keys:[{type:`click`,button:0}]},{name:`exitTour`,keys:[`Escape`]}];function Vi(){let e=(0,q.c)(27),t=ge(),n=ke(),r=w(Hi),i=t?.source===`demo`,a=t?.source===`live`,o=!t,s=o&&!r||a&&n===`fly`,c=!r,l=!r,u;e[0]===s?u=e[1]:(u=s&&(0,J.jsx)($,{map:Ni}),e[0]=s,e[1]=u);let d;e[2]===c?d=e[3]:(d=c&&(0,J.jsx)($,{map:Pi}),e[2]=c,e[3]=d);let f;e[4]===l?f=e[5]:(f=l&&(0,J.jsx)($,{map:Fi}),e[4]=l,e[5]=f);let p;e[6]!==o||e[7]!==r?(p=o&&!r&&(0,J.jsx)($,{map:Ii}),e[6]=o,e[7]=r,e[8]=p):p=e[8];let m;e[9]===i?m=e[10]:(m=i&&(0,J.jsx)($,{map:Li}),e[9]=i,e[10]=m);let h;e[11]===a?h=e[12]:(h=a&&(0,J.jsx)($,{map:Ri}),e[11]=a,e[12]=h);let g;e[13]!==n||e[14]!==a?(g=a&&n===`follow`&&(0,J.jsx)($,{map:zi}),e[13]=n,e[14]=a,e[15]=g):g=e[15];let _;e[16]===r?_=e[17]:(_=r&&(0,J.jsx)($,{map:Bi}),e[16]=r,e[17]=_);let v;return e[18]!==u||e[19]!==d||e[20]!==f||e[21]!==p||e[22]!==m||e[23]!==h||e[24]!==g||e[25]!==_?(v=(0,J.jsxs)(J.Fragment,{children:[u,d,f,p,m,h,g,_]}),e[18]=u,e[19]=d,e[20]=f,e[21]=p,e[22]=m,e[23]=h,e[24]=g,e[25]=_,e[26]=v):v=e[26],v}function Hi(e){return e.animation!==null}function Ui(e,t){return(0,K.lazy)(()=>t().then(t=>({default:t[e]})))}var Wi=Ui(`StreamingController`,()=>W(()=>import(`./StreamingController-CqQqOUzP.js`),__vite__mapDeps([39,1,9,10,11,12,4,5,6,7,13,14,15,16,17,18,19,20,21,22,23,2,3,8,24,25,26,27,28,29,30,31,0,32,33,34,40]))),Gi=Ui(`DebugElements`,()=>W(()=>import(`./DebugElements-Dy-m_wVx.js`),__vite__mapDeps([41,1,25,9,10,11,12,4,5,6,7,13,14,15,16,17,18,19,20,21,22,23,26,42]))),Ki=Ui(`Mission`,()=>W(()=>import(`./Mission-nILJLxCJ.js`),__vite__mapDeps([43,1,9,10,11,12,4,5,6,7,13,14,15,16,17,18,19,20,21,22,23,44,8,29,45]))),qi=Ui(`ChatSoundPlayer`,()=>W(()=>import(`./ChatSoundPlayer-DZxyjwrv.js`),__vite__mapDeps([46,1,14,5,15,16,6,30,4,7,22,18,31,12,24,25,9,10,11,13,17,19,20,21,23,26,27,29]))),Ji=(0,K.memo)(function(e){let t=(0,q.c)(23),{dpr:n,onCreated:r,missionName:i,missionType:a,onLoadingChange:o}=e,s=ge(),c=be(),l=c===`demo`||c===`live`,u,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(Vi,{}),d=(0,J.jsx)(Fe,{}),t[0]=u,t[1]=d):(u=t[0],d=t[1]);let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,J.jsx)(mt,{}),t[2]=f):f=t[2];let p,m;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(pr,{})}),m=(0,J.jsx)(xr,{}),t[3]=p,t[4]=m):(p=t[3],m=t[4]);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,J.jsx)(zn,{children:(0,J.jsx)(qi,{})}),t[5]=h):h=t[5];let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(Sr,{children:(0,J.jsx)(Gi,{})}),t[6]=g):g=t[6];let _;t[7]===s?_=t[8]:(_=s?(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(Wi,{recording:s})}):null,t[7]=s,t[8]=_);let v;t[9]!==l||t[10]!==i||t[11]!==a||t[12]!==o?(v=l?null:(0,J.jsx)(K.Suspense,{children:(0,J.jsx)(Ki,{name:i,missionType:a,onLoadingChange:o},`${i}~${a}`)}),t[9]=l,t[10]=i,t[11]=a,t[12]=o,t[13]=v):v=t[13];let y,x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,J.jsx)(Ei,{}),x=(0,J.jsx)(Lr,{}),t[14]=y,t[15]=x):(y=t[14],x=t[15]);let S;t[16]!==_||t[17]!==v?(S=(0,J.jsx)(b,{children:(0,J.jsxs)(Te,{children:[u,d,(0,J.jsxs)(Ue,{children:[f,p,m,h,g,_,v,y,x]})]})}),t[16]=_,t[17]=v,t[18]=S):S=t[18];let C;return t[19]!==n||t[20]!==r||t[21]!==S?(C=(0,J.jsx)(bt,{dpr:n,onCreated:r,children:S}),t[19]=n,t[20]=r,t[21]=S,t[22]=C):C=t[22],C});export{Ji as GameView}; \ No newline at end of file diff --git a/docs/assets/GenericShape-BC0gDQiR.js b/docs/assets/GenericShape-BC0gDQiR.js deleted file mode 100644 index 40577650..00000000 --- a/docs/assets/GenericShape-BC0gDQiR.js +++ /dev/null @@ -1,9 +0,0 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i,i as a}from"./react-three-fiber.esm-CgPHUpXo.js";import{a as o,i as s}from"./SettingsProvider-CCHVZuSg.js";import{n as c,r as l,t as u}from"./useBaseQuery-NrPec9_7.js";import{t as d}from"./logger-z_EpIdIa.js";import{$ as f,B as p,Ct as m,D as h,Dt as g,F as _,Ft as v,G as y,H as b,Ht as x,I as S,J as C,K as w,L as T,Mt as E,N as D,Nt as O,Ot as k,P as ee,Q as te,R as ne,Rt as re,St as ie,T as ae,U as oe,Ut as A,W as se,Wt as ce,X as le,Z as j,_t as ue,a as de,at as M,b as N,ct as fe,d as pe,dt as me,et as he,f as ge,ft as _e,g as ve,h as ye,ht as be,it as P,j as xe,jt as Se,lt as Ce,m as F,mt as we,nt as I,o as Te,ot as L,pt as Ee,q as De,rt as Oe,st as ke,tt as Ae,ut as je,v as R,vt as Me,xt as Ne,yt as Pe,z as Fe,zt as Ie}from"./three.module-07hRbor4.js";import{i as Le,n as Re,r as ze}from"./engineStore-Dkm20jvr.js";import{a as Be,c as Ve,d as He,p as Ue,t as We}from"./loaders-CIpiZadQ.js";import{t as Ge}from"./Texture-CIsc25mc.js";import{t as Ke}from"./FloatingLabel-4Yii8rRq.js";import{c as qe,f as Je,l as Ye,o as Xe,t as Ze,u as Qe}from"./globalFogUniforms-CtxQvsRj.js";function $e(e,t){return u({...e,enabled:!0,suspense:!0,throwOnError:c,placeholderData:void 0},l,t)}var et=parseInt(`182`.replace(/\D+/g,``));function tt(e,t){if(t===0)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),e;if(t===2||t===1){let n=e.getIndex();if(n===null){let t=[],r=e.getAttribute(`position`);if(r!==void 0){for(let e=0;e=2.0 are supported.`));return}let s=new Jt(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+t+`".`)}}s.setExtensions(a),s.setPlugins(o),s.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}};function ot(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var V={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`},st=class{constructor(e){this.parser=e,this.name=V.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},xt=class{constructor(e){this.parser=e,this.name=V.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return this.detectSupport().then(function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw Error(`THREE.GLTFLoader: WebP required by asset but unsupported.`);return n.loadTexture(e)})}detectSupport(){return this.isSupported||=new Promise(function(e){let t=new Image;t.src=`data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA`,t.onload=t.onerror=function(){e(t.height===1)}}),this.isSupported}},St=class{constructor(e){this.parser=e,this.name=V.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return this.detectSupport().then(function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw Error(`THREE.GLTFLoader: AVIF required by asset but unsupported.`);return n.loadTexture(e)})}detectSupport(){return this.isSupported||=new Promise(function(e){let t=new Image;t.src=`data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=`,t.onload=t.onerror=function(){e(t.height===1)}}),this.isSupported}},Ct=class{constructor(e){this.name=V.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}else return null}},wt=class{constructor(e){this.name=V.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==U.TRIANGLES&&e.mode!==U.TRIANGLE_STRIP&&e.mode!==U.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new I,n=new A,a=new ie,s=new A(1,1,1),c=new _(e.geometry,e.material,r);for(let e=0;e=152?{TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`}:{TEXCOORD_0:`uv`,TEXCOORD_1:`uv2`},COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},G={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},Rt={CUBICSPLINE:void 0,LINEAR:p,STEP:Fe},zt={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`};function Bt(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new ke({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),e.DefaultMaterial}function K(e,t,n){for(let r in n.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function q(e,t){t.extras!==void 0&&(typeof t.extras==`object`?Object.assign(e.userData,t.extras):console.warn(`THREE.GLTFLoader: Ignoring primitive type .extras, `+t.extras))}function Vt(e,t,n){let r=!1,i=!1,a=!1;for(let e=0,n=t.length;e0||e.search(/^data\:image\/jpeg/)===0?`image/jpeg`:e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?`image/webp`:`image/png`}var qt=new I,Jt=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new ot,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=!1,i=-1;typeof navigator<`u`&&navigator.userAgent!==void 0&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf(`Firefox`)>-1,i=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>`u`||n||r&&i<98?this.textureLoader=new Ie(this.options.manager):this.textureLoader=new D(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new h(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return K(i,a,r),q(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+ e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n=2&&p.setY(t,u[e*a+1]),a>=3&&p.setZ(t,u[e*a+2]),a>=4&&p.setW(t,u[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}}return p})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let c=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=Pt[n.magFilter]||1006,t.minFilter=Pt[n.minFilter]||1008,t.wrapS=Ft[n.wrapS]||1e3,t.wrapT=Ft[n.wrapT]||1e3,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=c,c}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,c=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){c=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let l=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new re(e);t.needsUpdate=!0,n(t)}),t.load(j.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return c===!0&&o.revokeObjectURL(s),q(e,a),e.userData.mimeType=a.mimeType||Kt(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[V.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[V.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[V.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(typeof r==`number`&&(r=r===rt?z:B),`colorSpace`in a?a.colorSpace=r:a.encoding=r===z?rt:it),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new Pe,he.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new oe,he.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return ke}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},c=[];if(s[V.KHR_MATERIALS_UNLIT]){let e=r[V.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new N(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],B),o.opacity=e[3]}n.baseColorTexture!==void 0&&c.push(t.assignTexture(o,`map`,n.baseColorTexture,z)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),c.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=2);let l=i.alphaMode||zt.OPAQUE;if(l===zt.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===zt.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==P&&(c.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new x(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==P&&(c.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==P){let e=i.emissiveFactor;o.emissive=new N().setRGB(e[0],e[1],e[2],B)}return i.emissiveTexture!==void 0&&a!==P&&c.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,z)),Promise.all(c).then(function(){let n=new a(o);return i.name&&(n.name=i.name),q(n,i),t.associations.set(n,{materials:e}),i.extensions&&K(r,n,i),n})}createUniqueName(e){let t=Ne.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[V.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return Xt(n,e,t)})}let a=[];for(let n=0,o=e.length;n0&&Ht(d,i),d.name=t.createUniqueName(i.name||`mesh_`+e),q(d,i),u.extensions&&K(r,d,u),t.assignFinalMaterial(d),c.push(d)}for(let n=0,r=c.length;n1?new xe:t.length===1?t[0]:new Ee,o!==t[0])for(let e=0,n=t.length;e{let t=new Map;for(let[e,n]of r.associations)(e instanceof he||e instanceof re)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];G[i.path]===G.weights?e.traverse(function(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}):s.push(o);let c;switch(G[i.path]){case G.weights:c=_e;break;case G.rotation:c=m;break;case G.position:case G.scale:c=ce;break;default:switch(n.itemSize){case 1:c=_e;break;default:c=ce;break}break}let l=r.interpolation===void 0?p:Rt[r.interpolation],u=this._getArrayFromAccessor(n);for(let e=0,n=s.length;e{let n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)},n,r)}decodeDracoFile(e,t,n,r){let i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(let e in t.attributeTypes){let n=t.attributeTypes[e];n.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[e]=n.name)}let n=JSON.stringify(t);if(Zt.has(e)){let t=Zt.get(e);if(t.key===n)return t.promise;if(e.byteLength===0)throw Error(`THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.`)}let r,i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:`decode`,id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),Zt.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new ye;e.index&&t.setIndex(new F(e.index.array,1));for(let n=0;n{n.load(e,t,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!=`object`||this.decoderConfig.type===`js`,t=[];return e?t.push(this._loadLibrary(`draco_decoder.js`,`text`)):(t.push(this._loadLibrary(`draco_wasm_wrapper.js`,`text`)),t.push(this._loadLibrary(`draco_decoder.wasm`,`arraybuffer`))),this.decoderPending=Promise.all(t).then(t=>{let n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let r=$t.toString(),i=[`/* draco decoder */`,n,``,`/* worker */`,r.substring(r.indexOf(`{`)+1,r.lastIndexOf(`}`))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log(`Task load: `,this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let t=e.draco,o=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(r),r.byteLength);try{let e=n(t,o,s,a),r=e.attributes.map(e=>e.array.buffer);e.index&&r.push(e.index.array.buffer),self.postMessage({type:`decode`,id:i.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:`error`,id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(o)}});break}};function n(e,t,n,a){let o=a.attributeIDs,s=a.attributeTypes,c,l,u=t.GetEncodedGeometryType(n);if(u===e.TRIANGULAR_MESH)c=new e.Mesh,l=t.DecodeBufferToMesh(n,c);else if(u===e.POINT_CLOUD)c=new e.PointCloud,l=t.DecodeBufferToPointCloud(n,c);else throw Error(`THREE.DRACOLoader: Unexpected geometry type.`);if(!l.ok()||c.ptr===0)throw Error(`THREE.DRACOLoader: Decoding failed: `+l.error_msg());let d={index:null,attributes:[]};for(let n in o){let r=self[s[n]],l,u;if(a.useUniqueIDs)u=o[n],l=t.GetAttributeByUniqueId(c,u);else{if(u=t.GetAttributeId(c,e[o[n]]),u===-1)continue;l=t.GetAttribute(c,u)}d.attributes.push(i(e,t,c,n,r,l))}return u===e.TRIANGULAR_MESH&&(d.index=r(e,t,c)),e.destroy(c),d}function r(e,t,n){let r=n.num_faces()*3,i=r*4,a=e._malloc(i);t.GetTrianglesUInt32Array(n,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:o,itemSize:1}}function i(e,t,n,r,i,o){let s=o.num_components(),c=n.num_points()*s,l=c*i.BYTES_PER_ELEMENT,u=a(e,i),d=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,o,u,l,d);let f=new i(e.HEAPF32.buffer,d,c).slice();return e._free(d),{name:r,array:f,itemSize:s}}function a(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}}var en,tn=()=>{if(en)return en;let e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!=`object`)return{supported:!1};let n=`B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB`;WebAssembly.validate(e)&&(n=`B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB`);let r,i=WebAssembly.instantiate(a(n),{}).then(e=>{r=e.instance,r.exports.__wasm_call_ctors()});function a(e){let n=new Uint8Array(e.length);for(let t=0;t96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let r=0;for(let i=0;i{n&&n(r),e&&(nn||=new Qt,nn.setDecoderPath(typeof e==`string`?e:rn),r.setDRACOLoader(nn)),t&&r.setMeshoptDecoder(typeof tn==`function`?tn():tn)}}var Y=(e,t,n,r)=>i(at,e,an(t,n,r));Y.preload=(e,t,n,r)=>i.preload(at,e,an(t,n,r)),Y.clear=e=>i.clear(at,e),Y.setDecoderPath=e=>{rn=e};var X=t(),Z=r(),on=1/32,sn=(0,J.createContext)(null);function cn({children:e}){let t=(0,J.useRef)(void 0),n=(0,J.useRef)(0),r=(0,J.useRef)(0);a((e,i)=>{for(n.current+=i;n.current>=on;)if(n.current-=on,r.current++,t.current)for(let e of t.current)e(r.current)});let i=(0,J.useCallback)(e=>(t.current??=new Set,t.current.add(e),()=>{t.current.delete(e)}),[]),o=(0,J.useCallback)(()=>r.current,[]),s=(0,J.useCallback)(()=>n.current/on,[]),c=(0,J.useMemo)(()=>({subscribe:i,getTick:o,getTickFraction:s}),[i,o,s]);return(0,Z.jsx)(sn.Provider,{value:c,children:e})}function ln(e){let t=(0,X.c)(5),n=(0,J.useContext)(sn);if(!n)throw Error(`useTick must be used within a TickProvider`);let r=(0,J.useEffectEvent)(e),i;t[0]!==n||t[1]!==r?(i=()=>n.subscribe(r),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===n?a=t[4]:(a=[n],t[3]=n,t[4]=a),(0,J.useEffect)(i,a)}function un(){let e=(0,J.useContext)(sn);if(!e)throw Error(`useGetTickFraction must be used within a TickProvider`);return e.getTickFraction}var dn=(0,J.createContext)(null),fn={didCatch:!1,error:null},pn=class extends J.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=fn}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(fn))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&mn(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(fn))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,J.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,J.createElement)(dn.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function mn(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function hn(e){let t=new Map,n=new Map,r=e.clone();return gn(e,r,function(e,r){t.set(r,e),n.set(e,r)}),r.traverse(function(e){if(!e.isSkinnedMesh)return;let r=e,i=t.get(e),a=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=a.map(function(e){return n.get(e)}),r.bind(r.skeleton,r.bindMatrix)}),r}function gn(e,t,n){n(e,t);for(let r=0;r{let n=t%o,a=Math.floor(t/o);l.drawImage(e.image,n*r,a*i)});let u=new ve(c);return u.colorSpace=k,u.generateMipmaps=!1,u.minFilter=Ce,u.magFilter=Ce,u.wrapS=R,u.wrapT=R,u.repeat.set(1/o,1/s),{texture:u,columns:o,rows:s,slotCount:a,frameToSlot:t,frameOffsetSeconds:[],totalDurationSeconds:0,lastSlot:-1}}function En(e,t){let n=0;e.frameOffsetSeconds=t.map(e=>(n+=e.frameCount*Sn,n)),e.totalDurationSeconds=n}function Q(e,t){let n=e.frameToSlot[t]??0;if(n===e.lastSlot)return;e.lastSlot=n;let r=n%e.columns,i=e.rows-1-Math.floor(n/e.columns);e.texture.offset.set(r/e.columns,i/e.rows)}function Dn(e,t){let n=e.totalDurationSeconds;if(n<=0)return 0;let r=t;r>n&&(r-=n*Math.floor(r/n));for(let t=0;tBe(t,e)),o=Tn(await Promise.all(a.map(Qe)),i);return En(o,n),Cn.set(e,o),o}function kn(e){let t=(0,X.c)(17),{animationEnabled:n}=o(),r;t[0]===e?r=t[1]:(r={queryKey:[`ifl`,e],queryFn:()=>Ve(e)},t[0]=e,t[1]=r);let{data:i}=$e(r),a;t[2]===i?a=t[3]:(a=wn(i),t[2]=i,t[3]=a);let{uniqueNames:s,frameToSlot:c}=a,l;if(t[4]!==e||t[5]!==s){let n;t[7]===e?n=t[8]:(n=t=>Be(t,e),t[7]=e,t[8]=n),l=s.map(n),t[4]=e,t[5]=s,t[6]=l}else l=t[6];let u=Ge(l),d;t[9]!==c||t[10]!==i||t[11]!==e||t[12]!==u?(d=Cn.get(e),d||(d=Tn(u,c),Cn.set(e,d)),En(d,i),t[9]=c,t[10]=i,t[11]=e,t[12]=u,t[13]=d):d=t[13];let f=d,p;return t[14]!==n||t[15]!==f?(p=e=>{let t=e/32;Q(f,n?Dn(f,t):0)},t[14]=n,t[15]=f,t[16]=p):p=t[16],ln(p),f.texture}var An={directional:1,ambient:1.5};function jn(e){e.uniforms.shapeDirectionalFactor={value:An.directional},e.uniforms.shapeAmbientFactor={value:An.ambient},e.fragmentShader=e.fragmentShader.replace(`#include `,`#include -uniform float shapeDirectionalFactor; -uniform float shapeAmbientFactor; -`),e.fragmentShader=e.fragmentShader.replace(`#include `,`#include - // Apply shape-specific lighting multipliers - reflectedLight.directDiffuse *= shapeDirectionalFactor; - reflectedLight.indirectDiffuse *= shapeAmbientFactor; -`)}function Mn(e){let t=new Set;return e.bones.forEach((e,n)=>{e.name.match(/^Hulk/i)&&t.add(n)}),t}var Nn=2.1,Pn=.25,Fn=32/1e3,$=new A,In=new A,Ln=new I,Rn=new A(0,1,0),zn=new ie().setFromAxisAngle(new A(0,1,0),Math.PI/2),Bn=zn.clone().invert();function Vn(e,t){let n=Number.isFinite(t)&&t>1e-6?t:4/3,r=Math.max(.01,Math.min(179.99,e))*Math.PI/180;return 2*Math.atan(Math.tan(r/2)/n)*180/Math.PI}function Hn(e){e.wrapS=R,e.wrapT=R,e.minFilter=w,e.magFilter=w,e.colorSpace=``,e.flipY=!1,e.needsUpdate=!0}function Un(e,t){return t.set(e[1],e[2],e[0])}function Wn(e,t){$.crossVectors(e,Rn),$.lengthSq()<1e-8&&$.set(-1,0,0),$.normalize(),In.crossVectors($,e).normalize(),Ln.set($.x,e.x,In.x,0,$.y,e.y,In.y,0,$.z,e.z,In.z,0,0,0,0,1),t.setFromRotationMatrix(Ln)}function Gn(e,t){if(e.length===0)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let n=0,r=e.length-1;for(;r-n>1;){let i=n+r>>1;e[i].time<=t?n=i:r=i}return e[n]}function Kn(e,t,n,r){let i=e.clone(!0),a=t.find(e=>e.name===`Root`);if(a){let e=new Te(i);if(e.clipAction(a).play(),r)for(let n of r){let r=t.find(e=>e.name.toLowerCase()===n.toLowerCase());if(r){let t=e.clipAction(r);t.time=r.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,s=null;return i.traverse(e=>{!o&&e.name===n&&(o=new A,s=new ie,e.getWorldPosition(o),e.getWorldQuaternion(s))}),!o||!s?null:{position:o,quaternion:s}}function qn(e,t){if(t.size===0||!e.attributes.skinIndex)return;let n=e.attributes.skinIndex,r=e.attributes.skinWeight,i=e.index;if(!i)return;let a=Array(n.count).fill(!1);for(let e=0;e.01&&t.has(o)){a[e]=!0;break}}let o=[],s=i.array;for(let e=0;e1){let t=0,n=0,r=0;for(let a of e)t+=i[a*3],n+=i[a*3+1],r+=i[a*3+2];let a=Math.sqrt(t*t+n*n+r*r);a>0&&(t/=a,n/=a,r/=a);for(let a of e)i[a*3]=t,i[a*3+1]=n,i[a*3+2]=r}n.needsUpdate=!0}function Yn(e,t,n=!1,r={}){let i=e.userData?.resource_path,a=new Set(e.userData?.flag_names??[]);if(!i){let t=new M({color:e.color,side:2,reflectivity:0});return ir(t),{material:t}}if(a.has(`IflMaterial`)){let r=ar(e,null,a,n,t);if(Array.isArray(r)){let e=r[1];return{material:e,backMaterial:r[0],initialize:(t,n)=>Xn(e,i,t,n)}}return{material:r,initialize:(e,t)=>Xn(r,i,e,t)}}let o=Ye(Ue(i)),s=a.has(`Translucent`);n||s?Je(o,{disableMipmaps:!0,anisotropy:r.anisotropy}):Je(o,{anisotropy:r.anisotropy});let c=ar(e,o,a,n,t);return Array.isArray(c)?{material:c[1],backMaterial:c[0]}:{material:c}}async function Xn(e,t,n,r){let i=await On(`textures/${t}.ifl`);e.map=i.texture,e.needsUpdate=!0;let a=!1,o=n.onBeforeRender;return n.onBeforeRender=function(...e){o?.apply(this,e),!a&&Q(i,Dn(i,r()))},()=>{a=!0,n.onBeforeRender=o??(()=>{})}}function Zn(e,t,n={}){let r=[],i=t?vn(t):!1,a=null;e.traverse(e=>{!a&&e.skeleton&&(a=e.skeleton)});let o=a?Mn(a):new Set,s=[];e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name===`Unassigned`){e.visible=!1;return}let t=!!e.userData?.vis_sequence;(e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry&&(qn(e.geometry,o),Jn(e.geometry));let a=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let o=Yn(t,a,i,n);if(o.initialize&&r.push({mesh:e,initialize:o.initialize}),o.backMaterial&&e.parent){let t=e.clone();t.material=o.backMaterial,s.push({parent:e.parent,mesh:t})}return o.material});else if(e.material){let t=Yn(e.material,a,i,n);if(t.initialize&&r.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let n=e.clone();n.material=t.backMaterial,s.push({parent:e.parent,mesh:n})}}});for(let{parent:e,mesh:t}of s)e.add(t);return r}function Qn(e){e.traverse(e=>{if(e.geometry&&e.geometry.dispose(),e.material){let t=Array.isArray(e.material)?e.material:[e.material];for(let e of t)e.dispose()}})}function $n(e){switch(e.toLowerCase()){case`player`:return`#00ff88`;case`vehicle`:return`#ff8800`;case`projectile`:return`#ff0044`;case`deployable`:return`#ffcc00`;default:return`#8888ff`}}var er=d(`GenericShape`);function tr(){let{recording:e}=ze.getState().playback;return e==null?performance.now()/1e3:Re()/1e3}var nr=e=>{Xe(e,Ze),jn(e)},rr=e=>{Xe(e,Ze)};function ir(e){e.onBeforeCompile=e instanceof M?nr:rr}function ar(e,t,n,r,i=1,a=!1){let o=n.has(`Translucent`),s=n.has(`Additive`),c=n.has(`SelfIlluminating`),l=i<1||a;if(c||s){let e=s||o||l,n=new P({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...l&&{opacity:i},...s&&{blending:2}});return ir(n),n}if(r||o){let e={map:t,transparent:l,alphaTest:l?0:.5,...l&&{opacity:i,depthWrite:!1},reflectivity:0},n=new M({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),r=new M({...e,side:0});return ir(n),ir(r),[n,r]}let u=new M({map:t,side:2,reflectivity:0,...l&&{transparent:!0,opacity:i,depthWrite:!1}});return ir(u),u}function or(e){let t=(0,X.c)(2),n;return t[0]===e?n=t[1]:(n=He(e),t[0]=e,t[1]=n),Y(n)}var sr=(0,J.memo)(function(e){let t=(0,X.c)(35),{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s,vis:c,animated:l}=e,u=o===void 0?!1:o,d=s===void 0?!1:s,f=c===void 0?1:c,p=l===void 0?!1:l,m=n.userData.resource_path,h;t[0]===n.userData.flag_names?h=t[1]:(h=n.userData.flag_names?new Set(n.userData.flag_names):ur,t[0]=n.userData.flag_names,t[1]=h);let g=h,_=kn(`textures/${m}.ifl`),v;t[2]===r?v=t[3]:(v=r&&vn(r),t[2]=r,t[3]=v);let y=!!v,b;t[4]!==p||t[5]!==g||t[6]!==y||t[7]!==n||t[8]!==_||t[9]!==f?(b=ar(n,_,g,y,f,p),t[4]=p,t[5]=g,t[6]=y,t[7]=n,t[8]=_,t[9]=f,t[10]=b):b=t[10];let x=b;if(cr(x),Array.isArray(x)){let e=a||i,n;t[11]===x[0]?n=t[12]:(n=(0,Z.jsx)(`primitive`,{object:x[0],attach:`material`}),t[11]=x[0],t[12]=n);let r;t[13]!==u||t[14]!==d||t[15]!==e||t[16]!==n?(r=(0,Z.jsx)(`mesh`,{geometry:e,castShadow:u,receiveShadow:d,children:n}),t[13]=u,t[14]=d,t[15]=e,t[16]=n,t[17]=r):r=t[17];let o;t[18]===x[1]?o=t[19]:(o=(0,Z.jsx)(`primitive`,{object:x[1],attach:`material`}),t[18]=x[1],t[19]=o);let s;t[20]!==u||t[21]!==i||t[22]!==d||t[23]!==o?(s=(0,Z.jsx)(`mesh`,{geometry:i,castShadow:u,receiveShadow:d,children:o}),t[20]=u,t[21]=i,t[22]=d,t[23]=o,t[24]=s):s=t[24];let c;return t[25]!==r||t[26]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[r,s]}),t[25]=r,t[26]=s,t[27]=c):c=t[27],c}let S;t[28]===x?S=t[29]:(S=(0,Z.jsx)(`primitive`,{object:x,attach:`material`}),t[28]=x,t[29]=S);let C;return t[30]!==u||t[31]!==i||t[32]!==d||t[33]!==S?(C=(0,Z.jsx)(`mesh`,{geometry:i,castShadow:u,receiveShadow:d,children:S}),t[30]=u,t[31]=i,t[32]=d,t[33]=S,t[34]=C):C=t[34],C});function cr(e){let t=(0,X.c)(3),n,r;t[0]===e?(n=t[1],r=t[2]):(n=()=>()=>{Array.isArray(e)?e.forEach(lr):e.dispose()},r=[e],t[0]=e,t[1]=n,t[2]=r),(0,J.useEffect)(n,r)}function lr(e){return e.dispose()}var ur=new Set,dr=(0,J.memo)(function(e){let t=(0,X.c)(43),{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s,vis:c,animated:l}=e,u=o===void 0?!1:o,d=s===void 0?!1:s,f=c===void 0?1:c,p=l===void 0?!1:l,m=n.userData.resource_path,h;t[0]===n.userData.flag_names?h=t[1]:(h=n.userData.flag_names?new Set(n.userData.flag_names):ur,t[0]=n.userData.flag_names,t[1]=h);let g=h;m||er.warn(`No resource_path found on "%s" — rendering fallback`,r);let _;t[2]===m?_=t[3]:(_=m?Ue(m):We,t[2]=m,t[3]=_);let v=_,y;t[4]===r?y=t[5]:(y=r&&vn(r),t[4]=r,t[5]=y);let b=!!y,x;t[6]===g?x=t[7]:(x=g.has(`Translucent`),t[6]=g,t[7]=x);let S=x,C=qe(),w;t[8]!==C||t[9]!==b||t[10]!==S?(w=e=>b||S?Je(e,{disableMipmaps:!0,anisotropy:C}):Je(e,{anisotropy:C}),t[8]=C,t[9]=b,t[10]=S,t[11]=w):w=t[11];let T=Ge(v,w),E;t[12]!==p||t[13]!==g||t[14]!==b||t[15]!==n||t[16]!==T||t[17]!==f?(E=ar(n,T,g,b,f,p),t[12]=p,t[13]=g,t[14]=b,t[15]=n,t[16]=T,t[17]=f,t[18]=E):E=t[18];let D=E;if(cr(D),Array.isArray(D)){let e=a||i,n;t[19]===D[0]?n=t[20]:(n=(0,Z.jsx)(`primitive`,{object:D[0],attach:`material`}),t[19]=D[0],t[20]=n);let r;t[21]!==u||t[22]!==d||t[23]!==e||t[24]!==n?(r=(0,Z.jsx)(`mesh`,{geometry:e,castShadow:u,receiveShadow:d,children:n}),t[21]=u,t[22]=d,t[23]=e,t[24]=n,t[25]=r):r=t[25];let o;t[26]===D[1]?o=t[27]:(o=(0,Z.jsx)(`primitive`,{object:D[1],attach:`material`}),t[26]=D[1],t[27]=o);let s;t[28]!==u||t[29]!==i||t[30]!==d||t[31]!==o?(s=(0,Z.jsx)(`mesh`,{geometry:i,castShadow:u,receiveShadow:d,children:o}),t[28]=u,t[29]=i,t[30]=d,t[31]=o,t[32]=s):s=t[32];let c;return t[33]!==r||t[34]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[r,s]}),t[33]=r,t[34]=s,t[35]=c):c=t[35],c}let O;t[36]===D?O=t[37]:(O=(0,Z.jsx)(`primitive`,{object:D,attach:`material`}),t[36]=D,t[37]=O);let k;return t[38]!==u||t[39]!==i||t[40]!==d||t[41]!==O?(k=(0,Z.jsx)(`mesh`,{geometry:i,castShadow:u,receiveShadow:d,children:O}),t[38]=u,t[39]=i,t[40]=d,t[41]=O,t[42]=k):k=t[42],k});(0,J.memo)(function(e){let t=(0,X.c)(18),{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s,vis:c,animated:l}=e,u=o===void 0?!1:o,d=s===void 0?!1:s,f=c===void 0?1:c,p=l===void 0?!1:l,m=new Set(n.userData.flag_names??[]).has(`IflMaterial`),h=n.userData.resource_path;if(m&&h){let e;return t[0]!==p||t[1]!==a||t[2]!==u||t[3]!==i||t[4]!==n||t[5]!==d||t[6]!==r||t[7]!==f?(e=(0,Z.jsx)(sr,{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:u,receiveShadow:d,vis:f,animated:p}),t[0]=p,t[1]=a,t[2]=u,t[3]=i,t[4]=n,t[5]=d,t[6]=r,t[7]=f,t[8]=e):e=t[8],e}else if(n.name){let e;return t[9]!==p||t[10]!==a||t[11]!==u||t[12]!==i||t[13]!==n||t[14]!==d||t[15]!==r||t[16]!==f?(e=(0,Z.jsx)(dr,{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:u,receiveShadow:d,vis:f,animated:p}),t[9]=p,t[10]=a,t[11]=u,t[12]=i,t[13]=n,t[14]=d,t[15]=r,t[16]=f,t[17]=e):e=t[17],e}else return null});function fr(e){let t=(0,X.c)(9),{color:n,label:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`boxGeometry`,{args:[10,10,10]}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,Z.jsx)(`meshStandardMaterial`,{color:n,wireframe:!0}),t[1]=n,t[2]=a);let o;t[3]!==n||t[4]!==r?(o=r?(0,Z.jsx)(Ke,{color:n,children:r}):null,t[3]=n,t[4]=r,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,Z.jsxs)(`mesh`,{children:[i,a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function pr(e){let t=(0,X.c)(4),{color:n,label:r}=e,{debugMode:i}=s(),a;return t[0]!==n||t[1]!==i||t[2]!==r?(a=i?(0,Z.jsx)(fr,{color:n,label:r}):null,t[0]=n,t[1]=i,t[2]=r,t[3]=a):a=t[3],a}var mr=(0,J.memo)(function(e){let t=(0,X.c)(15),{loadingColor:n,streamEntity:r,children:i}=e,a=n===void 0?`yellow`:n,{object:o,shapeName:s}=bn();if(!s){let e=`${o?._id}: `,n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(pr,{color:`orange`,label:e}),t[0]=e,t[1]=n),n}let c=`${o?._id}: ${s}`,l;t[2]===c?l=t[3]:(l=(0,Z.jsx)(pr,{color:`red`,label:c}),t[2]=c,t[3]=l);let u;t[4]===a?u=t[5]:(u=(0,Z.jsx)(fr,{color:a}),t[4]=a,t[5]=u);let d;t[6]===r?d=t[7]:(d=(0,Z.jsx)(gr,{streamEntity:r}),t[6]=r,t[7]=d);let f;t[8]!==i||t[9]!==u||t[10]!==d?(f=(0,Z.jsxs)(J.Suspense,{fallback:u,children:[d,i]}),t[8]=i,t[9]=u,t[10]=d,t[11]=f):f=t[11];let p;return t[12]!==l||t[13]!==f?(p=(0,Z.jsx)(pn,{fallback:l,children:f}),t[12]=l,t[13]=f,t[14]=p):p=t[14],p}),hr=(0,J.memo)(function({gltf:e,streamEntity:t}){let{object:n,shapeName:r}=bn(),{debugMode:i}=s(),{animationEnabled:c}=o(),l=Le(e=>e.runtime.runtime),u=qe(),{clonedScene:d,mixer:p,clipsByName:m,visNodesBySequence:h,iflMeshes:g}=(0,J.useMemo)(()=>{let t=hn(e.scene),n=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let r=new Set(t.userData.flag_names??[]),i=t.userData.resource_path;if(r.has(`IflMaterial`)&&i){let t=e.userData,r=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,a=t?.ifl_duration?Number(t.ifl_duration):void 0,o=t?.ifl_sequence?!!t.ifl_cyclic:void 0,s=t?.ifl_tool_begin==null?void 0:Number(t.ifl_tool_begin);n.push({mesh:e,iflPath:`textures/${i}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:r,iflDuration:a,iflCyclic:o,iflToolBegin:s})}}),Zn(t,r??void 0,{anisotropy:u});for(let{mesh:e,hasVisSequence:t}of n)t||(e.visible=!0);let i=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let n=t.vis_keyframes,r=t.vis_duration,a=(t.vis_sequence??``).toLowerCase();if(!a||!Array.isArray(n)||n.length<=1||!r||r<=0)return;let o=i.get(a);o||(o=[],i.set(a,o)),o.push({mesh:e,keyframes:n,duration:r,cyclic:!!t.vis_cyclic})});let a=new Map;for(let t of e.animations)a.set(t.name.toLowerCase(),t);return{clonedScene:t,mixer:a.size>0?new Te(t):null,clipsByName:a,visNodesBySequence:i,iflMeshes:n}},[e,u]);(0,J.useEffect)(()=>()=>{Qn(d),p?.uncacheRoot(d)},[d,p]);let _=(0,J.useRef)(new Map),v=(0,J.useRef)(new Map),y=(0,J.useRef)([]),b=(0,J.useRef)(0),x=(0,J.useRef)(c);x.current=c;let S=(0,J.useRef)(t);S.current=t;let C=(0,J.useRef)(null),w=(0,J.useRef)(null),T=(0,J.useRef)(void 0);(0,J.useEffect)(()=>{y.current=[],v.current.clear();for(let e of g)On(e.iflPath).then(t=>{let n=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;n&&(n.map=t.texture,n.needsUpdate=!0);let r={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};y.current.push(r),v.current.set(e.mesh,t)}).catch(t=>{er.warn(`Failed to load IFL atlas for %s: %o`,e.iflPath,t)})},[g]);let E=(0,J.useMemo)(()=>{let t=new Map,n=e.scene.userData?.dts_sequence_names,r=e.scene.userData?.dts_sequence_cyclic;if(typeof n==`string`&&typeof r==`string`)try{let e=JSON.parse(n),i=JSON.parse(r);for(let n=0;n{let e=_.current,t=S.current==null;function r(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,n=Yn(t,e.mesh.userData?.vis??0);e.mesh.material=n.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=v.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}function i(t,n){let i=n.toLowerCase();a(t);let o=m.get(i),s=h.get(i),c={sequence:i,startTime:tr()};if(o&&p){let e=p.clipAction(o);E.get(i)??!0?e.setLoop(f,1/0):(e.setLoop(te,1),e.clampWhenFinished=!0),e.reset().play(),c.action=e}if(s){for(let e of s)r(e);c.visNodes=s}e.set(t,c)}function a(t){let n=e.get(t);if(n){if(n.action&&n.action.stop(),n.visNodes)for(let e of n.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(C.current=i,w.current=a,!t)return()=>{C.current=null,w.current=null,T.current=void 0;for(let t of[...e.keys()])a(t)};let o=[];l&&(o.push(l.$.onMethodCalled(`ShapeBase`,`playThread`,(e,t,r)=>{e._id===n?._id&&i(Number(t),String(r))})),o.push(l.$.onMethodCalled(`ShapeBase`,`stopThread`,(e,t)=>{e._id===n?._id&&a(Number(t))})),o.push(l.$.onMethodCalled(`ShapeBase`,`pauseThread`,(t,r)=>{if(t._id!==n?._id)return;let i=e.get(Number(r));i?.action&&(i.action.paused=!0)})));for(let[e,t]of[[0,`power`],[1,`ambient`]])(m.has(t)||h.has(t))&&i(e,t);return()=>{o.forEach(e=>e()),C.current=null,w.current=null,T.current=void 0;for(let t of[...e.keys()])a(t)}},[p,m,h,E,n,l]);let D=(0,J.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if(typeof t==`string`)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return a((e,t)=>{let n=_.current,r=S.current!=null,i=ze.getState().playback,a=r?i.status===`playing`?t*i.rate:0:t,o=S.current?.threads,s=T.current;if(o!==s){let e=C.current,t=w.current;if(e&&t){T.current=o;let r=[];if(o)for(let e of o)r[e.index]=e;let i=[];if(s)for(let e of s)i[e.index]=e;let a=Math.max(r.length,i.length);for(let o=0;o0){b.current+=a;for(let e of l){if(!c){Q(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,r]of n)if(r.sequence===e.sequenceName){let n=tr()-r.startTime,i=e.sequenceDuration;t=(e.cyclic?n/i%1:Math.min(n/i,1))*i+(e.toolBegin??0);break}Q(e.atlas,Dn(e.atlas,t))}else Q(e.atlas,Dn(e.atlas,b.current))}}}),(0,Z.jsxs)(`group`,{rotation:[0,Math.PI/2,0],children:[(0,Z.jsx)(`primitive`,{object:d}),i?(0,Z.jsxs)(Ke,{children:[n?._id,`: `,r]}):null]})});function gr(e){let t=(0,X.c)(3),{streamEntity:n}=e,{shapeName:r}=bn(),i=or(r),a;return t[0]!==i||t[1]!==n?(a=(0,Z.jsx)(hr,{gltf:i,streamEntity:n}),t[0]=i,t[1]=n,t[2]=a):a=t[2],a}export{pn as C,Y as D,ln as E,hn as S,un as T,Un as _,Nn as a,Q as b,Bn as c,Gn as d,Kn as f,Vn as g,Hn as h,Pn as i,Qn as l,Wn as m,mr as n,Fn as o,Zn as p,or as r,zn as s,fr as t,$n as u,Dn as v,cn as w,xn as x,On as y}; \ No newline at end of file diff --git a/docs/assets/GenericShape-FZ5loHEW.js b/docs/assets/GenericShape-FZ5loHEW.js new file mode 100644 index 00000000..293f184f --- /dev/null +++ b/docs/assets/GenericShape-FZ5loHEW.js @@ -0,0 +1,9 @@ +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i,i as a}from"./react-three-fiber.esm-CgPHUpXo.js";import{a as o,i as s}from"./SettingsProvider-CCHVZuSg.js";import{n as c,r as l,t as u}from"./useBaseQuery-Co62zxSo.js";import{t as d}from"./logger-z_EpIdIa.js";import{$ as f,B as p,Ct as m,D as h,Dt as g,F as _,Ft as v,G as y,H as b,Ht as x,I as S,J as C,K as w,L as T,Mt as E,N as D,Nt as O,Ot as k,P as ee,Q as A,R as te,Rt as ne,St as re,T as ie,U as ae,Ut as j,W as oe,Wt as se,X as ce,Z as M,_t as le,a as ue,at as N,b as P,ct as de,d as fe,dt as pe,et as me,f as he,ft as ge,g as _e,h as ve,ht as ye,i as be,it as F,j as xe,jt as Se,lt as Ce,m as I,mt as we,nt as L,o as Te,ot as R,pt as Ee,q as De,rt as Oe,st as ke,tt as Ae,ut as je,v as z,vt as Me,xt as Ne,yt as Pe,z as Fe,zt as Ie}from"./three.module-07hRbor4.js";import{i as Le,n as Re,r as ze}from"./engineStore-Dkm20jvr.js";import{a as Be,c as Ve,d as He,p as Ue,t as We}from"./loaders-CIpiZadQ.js";import{t as Ge}from"./Texture-CIsc25mc.js";import{t as Ke}from"./FloatingLabel-Bm1LwAgd.js";import{c as qe,f as Je,l as Ye,o as Xe,t as Ze,u as Qe}from"./globalFogUniforms-CtxQvsRj.js";function $e(e,t){return u({...e,enabled:!0,suspense:!0,throwOnError:c,placeholderData:void 0},l,t)}var et=parseInt(`182`.replace(/\D+/g,``));function tt(e,t){if(t===0)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),e;if(t===2||t===1){let n=e.getIndex();if(n===null){let t=[],r=e.getAttribute(`position`);if(r!==void 0){for(let e=0;e=2.0 are supported.`));return}let s=new Jt(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+t+`".`)}}s.setExtensions(a),s.setPlugins(o),s.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}};function ot(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var H={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`},st=class{constructor(e){this.parser=e,this.name=H.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},xt=class{constructor(e){this.parser=e,this.name=H.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return this.detectSupport().then(function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw Error(`THREE.GLTFLoader: WebP required by asset but unsupported.`);return n.loadTexture(e)})}detectSupport(){return this.isSupported||=new Promise(function(e){let t=new Image;t.src=`data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA`,t.onload=t.onerror=function(){e(t.height===1)}}),this.isSupported}},St=class{constructor(e){this.parser=e,this.name=H.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return this.detectSupport().then(function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw Error(`THREE.GLTFLoader: AVIF required by asset but unsupported.`);return n.loadTexture(e)})}detectSupport(){return this.isSupported||=new Promise(function(e){let t=new Image;t.src=`data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=`,t.onload=t.onerror=function(){e(t.height===1)}}),this.isSupported}},Ct=class{constructor(e){this.name=H.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}else return null}},wt=class{constructor(e){this.name=H.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==W.TRIANGLES&&e.mode!==W.TRIANGLE_STRIP&&e.mode!==W.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new L,n=new j,a=new re,s=new j(1,1,1),c=new _(e.geometry,e.material,r);for(let e=0;e=152?{TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`}:{TEXCOORD_0:`uv`,TEXCOORD_1:`uv2`},COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},K={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},Rt={CUBICSPLINE:void 0,LINEAR:p,STEP:Fe},zt={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`};function Bt(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new ke({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),e.DefaultMaterial}function q(e,t,n){for(let r in n.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function J(e,t){t.extras!==void 0&&(typeof t.extras==`object`?Object.assign(e.userData,t.extras):console.warn(`THREE.GLTFLoader: Ignoring primitive type .extras, `+t.extras))}function Vt(e,t,n){let r=!1,i=!1,a=!1;for(let e=0,n=t.length;e0||e.search(/^data\:image\/jpeg/)===0?`image/jpeg`:e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?`image/webp`:`image/png`}var qt=new L,Jt=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new ot,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=!1,i=-1;typeof navigator<`u`&&navigator.userAgent!==void 0&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf(`Firefox`)>-1,i=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>`u`||n||r&&i<98?this.textureLoader=new Ie(this.options.manager):this.textureLoader=new D(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new h(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return q(i,a,r),J(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+ e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n=2&&p.setY(t,u[e*a+1]),a>=3&&p.setZ(t,u[e*a+2]),a>=4&&p.setW(t,u[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}}return p})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let c=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=Pt[n.magFilter]||1006,t.minFilter=Pt[n.minFilter]||1008,t.wrapS=Ft[n.wrapS]||1e3,t.wrapT=Ft[n.wrapT]||1e3,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=c,c}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,c=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){c=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let l=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new ne(e);t.needsUpdate=!0,n(t)}),t.load(M.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return c===!0&&o.revokeObjectURL(s),J(e,a),e.userData.mimeType=a.mimeType||Kt(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[H.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[H.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[H.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(typeof r==`number`&&(r=r===rt?B:V),`colorSpace`in a?a.colorSpace=r:a.encoding=r===B?rt:it),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new Pe,me.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new ae,me.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return ke}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},c=[];if(s[H.KHR_MATERIALS_UNLIT]){let e=r[H.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new P(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],V),o.opacity=e[3]}n.baseColorTexture!==void 0&&c.push(t.assignTexture(o,`map`,n.baseColorTexture,B)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),c.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=2);let l=i.alphaMode||zt.OPAQUE;if(l===zt.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===zt.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==F&&(c.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new x(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==F&&(c.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==F){let e=i.emissiveFactor;o.emissive=new P().setRGB(e[0],e[1],e[2],V)}return i.emissiveTexture!==void 0&&a!==F&&c.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,B)),Promise.all(c).then(function(){let n=new a(o);return i.name&&(n.name=i.name),J(n,i),t.associations.set(n,{materials:e}),i.extensions&&q(r,n,i),n})}createUniqueName(e){let t=Ne.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[H.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return Xt(n,e,t)})}let a=[];for(let n=0,o=e.length;n0&&Ht(d,i),d.name=t.createUniqueName(i.name||`mesh_`+e),J(d,i),u.extensions&&q(r,d,u),t.assignFinalMaterial(d),c.push(d)}for(let n=0,r=c.length;n1?new xe:t.length===1?t[0]:new Ee,o!==t[0])for(let e=0,n=t.length;e{let t=new Map;for(let[e,n]of r.associations)(e instanceof me||e instanceof ne)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];K[i.path]===K.weights?e.traverse(function(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}):s.push(o);let c;switch(K[i.path]){case K.weights:c=ge;break;case K.rotation:c=m;break;case K.position:case K.scale:c=se;break;default:switch(n.itemSize){case 1:c=ge;break;default:c=se;break}break}let l=r.interpolation===void 0?p:Rt[r.interpolation],u=this._getArrayFromAccessor(n);for(let e=0,n=s.length;e{let n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)},n,r)}decodeDracoFile(e,t,n,r){let i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(let e in t.attributeTypes){let n=t.attributeTypes[e];n.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[e]=n.name)}let n=JSON.stringify(t);if(Zt.has(e)){let t=Zt.get(e);if(t.key===n)return t.promise;if(e.byteLength===0)throw Error(`THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.`)}let r,i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:`decode`,id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),Zt.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new ve;e.index&&t.setIndex(new I(e.index.array,1));for(let n=0;n{n.load(e,t,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!=`object`||this.decoderConfig.type===`js`,t=[];return e?t.push(this._loadLibrary(`draco_decoder.js`,`text`)):(t.push(this._loadLibrary(`draco_wasm_wrapper.js`,`text`)),t.push(this._loadLibrary(`draco_decoder.wasm`,`arraybuffer`))),this.decoderPending=Promise.all(t).then(t=>{let n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let r=$t.toString(),i=[`/* draco decoder */`,n,``,`/* worker */`,r.substring(r.indexOf(`{`)+1,r.lastIndexOf(`}`))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log(`Task load: `,this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let t=e.draco,o=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(r),r.byteLength);try{let e=n(t,o,s,a),r=e.attributes.map(e=>e.array.buffer);e.index&&r.push(e.index.array.buffer),self.postMessage({type:`decode`,id:i.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:`error`,id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(o)}});break}};function n(e,t,n,a){let o=a.attributeIDs,s=a.attributeTypes,c,l,u=t.GetEncodedGeometryType(n);if(u===e.TRIANGULAR_MESH)c=new e.Mesh,l=t.DecodeBufferToMesh(n,c);else if(u===e.POINT_CLOUD)c=new e.PointCloud,l=t.DecodeBufferToPointCloud(n,c);else throw Error(`THREE.DRACOLoader: Unexpected geometry type.`);if(!l.ok()||c.ptr===0)throw Error(`THREE.DRACOLoader: Decoding failed: `+l.error_msg());let d={index:null,attributes:[]};for(let n in o){let r=self[s[n]],l,u;if(a.useUniqueIDs)u=o[n],l=t.GetAttributeByUniqueId(c,u);else{if(u=t.GetAttributeId(c,e[o[n]]),u===-1)continue;l=t.GetAttribute(c,u)}d.attributes.push(i(e,t,c,n,r,l))}return u===e.TRIANGULAR_MESH&&(d.index=r(e,t,c)),e.destroy(c),d}function r(e,t,n){let r=n.num_faces()*3,i=r*4,a=e._malloc(i);t.GetTrianglesUInt32Array(n,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:o,itemSize:1}}function i(e,t,n,r,i,o){let s=o.num_components(),c=n.num_points()*s,l=c*i.BYTES_PER_ELEMENT,u=a(e,i),d=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,o,u,l,d);let f=new i(e.HEAPF32.buffer,d,c).slice();return e._free(d),{name:r,array:f,itemSize:s}}function a(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}}var en,tn=()=>{if(en)return en;let e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!=`object`)return{supported:!1};let n=`B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB`;WebAssembly.validate(e)&&(n=`B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB`);let r,i=WebAssembly.instantiate(a(n),{}).then(e=>{r=e.instance,r.exports.__wasm_call_ctors()});function a(e){let n=new Uint8Array(e.length);for(let t=0;t96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let r=0;for(let i=0;i{n&&n(r),e&&(nn||=new Qt,nn.setDecoderPath(typeof e==`string`?e:rn),r.setDRACOLoader(nn)),t&&r.setMeshoptDecoder(typeof tn==`function`?tn():tn)}}var on=(e,t,n,r)=>i(at,e,an(t,n,r));on.preload=(e,t,n,r)=>i.preload(at,e,an(t,n,r)),on.clear=e=>i.clear(at,e),on.setDecoderPath=e=>{rn=e};var X=t(),Z=r(),sn=1/32,cn=(0,Y.createContext)(null);function ln({children:e}){let t=(0,Y.useRef)(void 0),n=(0,Y.useRef)(0),r=(0,Y.useRef)(0);a((e,i)=>{for(n.current+=i;n.current>=sn;)if(n.current-=sn,r.current++,t.current)for(let e of t.current)e(r.current)});let i=(0,Y.useCallback)(e=>(t.current??=new Set,t.current.add(e),()=>{t.current.delete(e)}),[]),o=(0,Y.useCallback)(()=>r.current,[]),s=(0,Y.useCallback)(()=>n.current/sn,[]),c=(0,Y.useMemo)(()=>({subscribe:i,getTick:o,getTickFraction:s}),[i,o,s]);return(0,Z.jsx)(cn.Provider,{value:c,children:e})}function un(e){let t=(0,X.c)(5),n=(0,Y.useContext)(cn);if(!n)throw Error(`useTick must be used within a TickProvider`);let r=(0,Y.useEffectEvent)(e),i;t[0]!==n||t[1]!==r?(i=()=>n.subscribe(r),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===n?a=t[4]:(a=[n],t[3]=n,t[4]=a),(0,Y.useEffect)(i,a)}function dn(){let e=(0,Y.useContext)(cn);if(!e)throw Error(`useGetTickFraction must be used within a TickProvider`);return e.getTickFraction}var fn=(0,Y.createContext)(null),pn={didCatch:!1,error:null},mn=class extends Y.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=pn}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(pn))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&hn(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(pn))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,Y.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,Y.createElement)(fn.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function hn(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function gn(e){let t=new Map,n=new Map,r=e.clone();return _n(e,r,function(e,r){t.set(r,e),n.set(e,r)}),r.traverse(function(e){if(!e.isSkinnedMesh)return;let r=e,i=t.get(e),a=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=a.map(function(e){return n.get(e)}),r.bind(r.skeleton,r.bindMatrix)}),r}function _n(e,t,n){n(e,t);for(let r=0;r{let n=t%o,a=Math.floor(t/o);l.drawImage(e.image,n*r,a*i)});let u=new _e(c);return u.colorSpace=k,u.generateMipmaps=!1,u.minFilter=Ce,u.magFilter=Ce,u.wrapS=z,u.wrapT=z,u.repeat.set(1/o,1/s),{texture:u,columns:o,rows:s,slotCount:a,frameToSlot:t,frameOffsetSeconds:[],totalDurationSeconds:0,lastSlot:-1}}function Dn(e,t){let n=0;e.frameOffsetSeconds=t.map(e=>(n+=e.frameCount*Cn,n)),e.totalDurationSeconds=n}function Q(e,t){let n=e.frameToSlot[t]??0;if(n===e.lastSlot)return;e.lastSlot=n;let r=n%e.columns,i=e.rows-1-Math.floor(n/e.columns);e.texture.offset.set(r/e.columns,i/e.rows)}function On(e,t){let n=e.totalDurationSeconds;if(n<=0)return 0;let r=t;r>n&&(r-=n*Math.floor(r/n));for(let t=0;tBe(t,e)),o=En(await Promise.all(a.map(Qe)),i);return Dn(o,n),wn.set(e,o),o}function An(e){let t=(0,X.c)(17),{animationEnabled:n}=o(),r;t[0]===e?r=t[1]:(r={queryKey:[`ifl`,e],queryFn:()=>Ve(e)},t[0]=e,t[1]=r);let{data:i}=$e(r),a;t[2]===i?a=t[3]:(a=Tn(i),t[2]=i,t[3]=a);let{uniqueNames:s,frameToSlot:c}=a,l;if(t[4]!==e||t[5]!==s){let n;t[7]===e?n=t[8]:(n=t=>Be(t,e),t[7]=e,t[8]=n),l=s.map(n),t[4]=e,t[5]=s,t[6]=l}else l=t[6];let u=Ge(l),d;t[9]!==c||t[10]!==i||t[11]!==e||t[12]!==u?(d=wn.get(e),d||(d=En(u,c),wn.set(e,d)),Dn(d,i),t[9]=c,t[10]=i,t[11]=e,t[12]=u,t[13]=d):d=t[13];let f=d,p;return t[14]!==n||t[15]!==f?(p=e=>{let t=e/32;Q(f,n?On(f,t):0)},t[14]=n,t[15]=f,t[16]=p):p=t[16],un(p),f.texture}var jn={directional:1,ambient:1.5};function Mn(e){e.uniforms.shapeDirectionalFactor={value:jn.directional},e.uniforms.shapeAmbientFactor={value:jn.ambient},e.fragmentShader=e.fragmentShader.replace(`#include `,`#include +uniform float shapeDirectionalFactor; +uniform float shapeAmbientFactor; +`),e.fragmentShader=e.fragmentShader.replace(`#include `,`#include + // Apply shape-specific lighting multipliers + reflectedLight.directDiffuse *= shapeDirectionalFactor; + reflectedLight.indirectDiffuse *= shapeAmbientFactor; +`)}function Nn(e){let t=new Set;return e.bones.forEach((e,n)=>{e.name.match(/^Hulk/i)&&t.add(n)}),t}var Pn=2.1,Fn=.25,In=32/1e3,$=new j,Ln=new j,Rn=new L,zn=new j(0,1,0),Bn=new re().setFromAxisAngle(new j(0,1,0),Math.PI/2),Vn=Bn.clone().invert();function Hn(e,t){let n=Number.isFinite(t)&&t>1e-6?t:4/3,r=Math.max(.01,Math.min(179.99,e))*Math.PI/180;return 2*Math.atan(Math.tan(r/2)/n)*180/Math.PI}function Un(e){e.wrapS=z,e.wrapT=z,e.minFilter=w,e.magFilter=w,e.colorSpace=``,e.flipY=!1,e.needsUpdate=!0}function Wn(e,t){return t.set(e[1],e[2],e[0])}function Gn(e,t){$.crossVectors(e,zn),$.lengthSq()<1e-8&&$.set(-1,0,0),$.normalize(),Ln.crossVectors($,e).normalize(),Rn.set($.x,e.x,Ln.x,0,$.y,e.y,Ln.y,0,$.z,e.z,Ln.z,0,0,0,0,1),t.setFromRotationMatrix(Rn)}function Kn(e,t){if(e.length===0)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let n=0,r=e.length-1;for(;r-n>1;){let i=n+r>>1;e[i].time<=t?n=i:r=i}return e[n]}function qn(e,t,n,r){let i=e.clone(!0),a=t.find(e=>e.name===`Root`);if(a){let e=new Te(i);if(e.clipAction(a).play(),r)for(let n of r){let r=t.find(e=>e.name.toLowerCase()===n.toLowerCase());if(r){let t=e.clipAction(r);t.time=r.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,s=null;return i.traverse(e=>{!o&&e.name===n&&(o=new j,s=new re,e.getWorldPosition(o),e.getWorldQuaternion(s))}),!o||!s?null:{position:o,quaternion:s}}function Jn(e,t){if(t.size===0||!e.attributes.skinIndex)return;let n=e.attributes.skinIndex,r=e.attributes.skinWeight,i=e.index;if(!i)return;let a=Array(n.count).fill(!1);for(let e=0;e.01&&t.has(o)){a[e]=!0;break}}let o=[],s=i.array;for(let e=0;e1){let t=0,n=0,r=0;for(let a of e)t+=i[a*3],n+=i[a*3+1],r+=i[a*3+2];let a=Math.sqrt(t*t+n*n+r*r);a>0&&(t/=a,n/=a,r/=a);for(let a of e)i[a*3]=t,i[a*3+1]=n,i[a*3+2]=r}n.needsUpdate=!0}function Xn(e,t,n=!1,r={}){let i=e.userData?.resource_path,a=new Set(e.userData?.flag_names??[]);if(!i){let t=new N({color:e.color,side:2,reflectivity:0});return ar(t),{material:t}}if(a.has(`IflMaterial`)){let r=or(e,null,a,n,t);if(Array.isArray(r)){let e=r[1];return{material:e,backMaterial:r[0],initialize:(t,n)=>Zn(e,i,t,n)}}return{material:r,initialize:(e,t)=>Zn(r,i,e,t)}}let o=Ye(Ue(i)),s=a.has(`Translucent`);n||s?Je(o,{disableMipmaps:!0,anisotropy:r.anisotropy}):Je(o,{anisotropy:r.anisotropy});let c=or(e,o,a,n,t);return Array.isArray(c)?{material:c[1],backMaterial:c[0]}:{material:c}}async function Zn(e,t,n,r){let i=await kn(`textures/${t}.ifl`);e.map=i.texture,e.needsUpdate=!0;let a=!1,o=n.onBeforeRender;return n.onBeforeRender=function(...e){o?.apply(this,e),!a&&Q(i,On(i,r()))},()=>{a=!0,n.onBeforeRender=o??(()=>{})}}function Qn(e,t,n={}){let r=[],i=t?yn(t):!1,a=null;e.traverse(e=>{!a&&e.skeleton&&(a=e.skeleton)});let o=a?Nn(a):new Set,s=[];e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name===`Unassigned`){e.visible=!1;return}let t=!!e.userData?.vis_sequence;(e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry&&(Jn(e.geometry,o),Yn(e.geometry));let a=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let o=Xn(t,a,i,n);if(o.initialize&&r.push({mesh:e,initialize:o.initialize}),o.backMaterial&&e.parent){let t=e.clone();t.material=o.backMaterial,s.push({parent:e.parent,mesh:t})}return o.material});else if(e.material){let t=Xn(e.material,a,i,n);if(t.initialize&&r.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let n=e.clone();n.material=t.backMaterial,s.push({parent:e.parent,mesh:n})}}});for(let{parent:e,mesh:t}of s)e.add(t);return r}function $n(e){e.traverse(e=>{if(e.geometry&&e.geometry.dispose(),e.material){let t=Array.isArray(e.material)?e.material:[e.material];for(let e of t)e.dispose()}})}function er(e){switch(e.toLowerCase()){case`player`:return`#00ff88`;case`vehicle`:return`#ff8800`;case`projectile`:return`#ff0044`;case`deployable`:return`#ffcc00`;default:return`#8888ff`}}var tr=d(`GenericShape`);function nr(){let{recording:e}=ze.getState().playback;return e==null?performance.now()/1e3:Re()/1e3}var rr=e=>{Xe(e,Ze),Mn(e)},ir=e=>{Xe(e,Ze)};function ar(e){e.onBeforeCompile=e instanceof N?rr:ir}function or(e,t,n,r,i=1,a=!1){let o=n.has(`Translucent`),s=n.has(`Additive`),c=n.has(`SelfIlluminating`),l=i<1||a;if(c||s){let e=s||o||l,n=new F({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...l&&{opacity:i},...s&&{blending:2}});return ar(n),n}if(r||o){let e={map:t,transparent:l,alphaTest:l?0:.5,...l&&{opacity:i,depthWrite:!1},reflectivity:0},n=new N({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),r=new N({...e,side:0});return ar(n),ar(r),[n,r]}let u=new N({map:t,side:2,reflectivity:0,...l&&{transparent:!0,opacity:i,depthWrite:!1}});return ar(u),u}function sr(e){let t=(0,X.c)(2),n;return t[0]===e?n=t[1]:(n=He(e),t[0]=e,t[1]=n),on(n)}var cr=(0,Y.memo)(function(e){let t=(0,X.c)(35),{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s,vis:c,animated:l}=e,u=o===void 0?!1:o,d=s===void 0?!1:s,f=c===void 0?1:c,p=l===void 0?!1:l,m=n.userData.resource_path,h;t[0]===n.userData.flag_names?h=t[1]:(h=n.userData.flag_names?new Set(n.userData.flag_names):dr,t[0]=n.userData.flag_names,t[1]=h);let g=h,_=An(`textures/${m}.ifl`),v;t[2]===r?v=t[3]:(v=r&&yn(r),t[2]=r,t[3]=v);let y=!!v,b;t[4]!==p||t[5]!==g||t[6]!==y||t[7]!==n||t[8]!==_||t[9]!==f?(b=or(n,_,g,y,f,p),t[4]=p,t[5]=g,t[6]=y,t[7]=n,t[8]=_,t[9]=f,t[10]=b):b=t[10];let x=b;if(lr(x),Array.isArray(x)){let e=a||i,n;t[11]===x[0]?n=t[12]:(n=(0,Z.jsx)(`primitive`,{object:x[0],attach:`material`}),t[11]=x[0],t[12]=n);let r;t[13]!==u||t[14]!==d||t[15]!==e||t[16]!==n?(r=(0,Z.jsx)(`mesh`,{geometry:e,castShadow:u,receiveShadow:d,children:n}),t[13]=u,t[14]=d,t[15]=e,t[16]=n,t[17]=r):r=t[17];let o;t[18]===x[1]?o=t[19]:(o=(0,Z.jsx)(`primitive`,{object:x[1],attach:`material`}),t[18]=x[1],t[19]=o);let s;t[20]!==u||t[21]!==i||t[22]!==d||t[23]!==o?(s=(0,Z.jsx)(`mesh`,{geometry:i,castShadow:u,receiveShadow:d,children:o}),t[20]=u,t[21]=i,t[22]=d,t[23]=o,t[24]=s):s=t[24];let c;return t[25]!==r||t[26]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[r,s]}),t[25]=r,t[26]=s,t[27]=c):c=t[27],c}let S;t[28]===x?S=t[29]:(S=(0,Z.jsx)(`primitive`,{object:x,attach:`material`}),t[28]=x,t[29]=S);let C;return t[30]!==u||t[31]!==i||t[32]!==d||t[33]!==S?(C=(0,Z.jsx)(`mesh`,{geometry:i,castShadow:u,receiveShadow:d,children:S}),t[30]=u,t[31]=i,t[32]=d,t[33]=S,t[34]=C):C=t[34],C});function lr(e){let t=(0,X.c)(3),n,r;t[0]===e?(n=t[1],r=t[2]):(n=()=>()=>{Array.isArray(e)?e.forEach(ur):e.dispose()},r=[e],t[0]=e,t[1]=n,t[2]=r),(0,Y.useEffect)(n,r)}function ur(e){return e.dispose()}var dr=new Set,fr=(0,Y.memo)(function(e){let t=(0,X.c)(43),{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s,vis:c,animated:l}=e,u=o===void 0?!1:o,d=s===void 0?!1:s,f=c===void 0?1:c,p=l===void 0?!1:l,m=n.userData.resource_path,h;t[0]===n.userData.flag_names?h=t[1]:(h=n.userData.flag_names?new Set(n.userData.flag_names):dr,t[0]=n.userData.flag_names,t[1]=h);let g=h;m||tr.warn(`No resource_path found on "%s" — rendering fallback`,r);let _;t[2]===m?_=t[3]:(_=m?Ue(m):We,t[2]=m,t[3]=_);let v=_,y;t[4]===r?y=t[5]:(y=r&&yn(r),t[4]=r,t[5]=y);let b=!!y,x;t[6]===g?x=t[7]:(x=g.has(`Translucent`),t[6]=g,t[7]=x);let S=x,C=qe(),w;t[8]!==C||t[9]!==b||t[10]!==S?(w=e=>b||S?Je(e,{disableMipmaps:!0,anisotropy:C}):Je(e,{anisotropy:C}),t[8]=C,t[9]=b,t[10]=S,t[11]=w):w=t[11];let T=Ge(v,w),E;t[12]!==p||t[13]!==g||t[14]!==b||t[15]!==n||t[16]!==T||t[17]!==f?(E=or(n,T,g,b,f,p),t[12]=p,t[13]=g,t[14]=b,t[15]=n,t[16]=T,t[17]=f,t[18]=E):E=t[18];let D=E;if(lr(D),Array.isArray(D)){let e=a||i,n;t[19]===D[0]?n=t[20]:(n=(0,Z.jsx)(`primitive`,{object:D[0],attach:`material`}),t[19]=D[0],t[20]=n);let r;t[21]!==u||t[22]!==d||t[23]!==e||t[24]!==n?(r=(0,Z.jsx)(`mesh`,{geometry:e,castShadow:u,receiveShadow:d,children:n}),t[21]=u,t[22]=d,t[23]=e,t[24]=n,t[25]=r):r=t[25];let o;t[26]===D[1]?o=t[27]:(o=(0,Z.jsx)(`primitive`,{object:D[1],attach:`material`}),t[26]=D[1],t[27]=o);let s;t[28]!==u||t[29]!==i||t[30]!==d||t[31]!==o?(s=(0,Z.jsx)(`mesh`,{geometry:i,castShadow:u,receiveShadow:d,children:o}),t[28]=u,t[29]=i,t[30]=d,t[31]=o,t[32]=s):s=t[32];let c;return t[33]!==r||t[34]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[r,s]}),t[33]=r,t[34]=s,t[35]=c):c=t[35],c}let O;t[36]===D?O=t[37]:(O=(0,Z.jsx)(`primitive`,{object:D,attach:`material`}),t[36]=D,t[37]=O);let k;return t[38]!==u||t[39]!==i||t[40]!==d||t[41]!==O?(k=(0,Z.jsx)(`mesh`,{geometry:i,castShadow:u,receiveShadow:d,children:O}),t[38]=u,t[39]=i,t[40]=d,t[41]=O,t[42]=k):k=t[42],k});(0,Y.memo)(function(e){let t=(0,X.c)(18),{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:o,receiveShadow:s,vis:c,animated:l}=e,u=o===void 0?!1:o,d=s===void 0?!1:s,f=c===void 0?1:c,p=l===void 0?!1:l,m=new Set(n.userData.flag_names??[]).has(`IflMaterial`),h=n.userData.resource_path;if(m&&h){let e;return t[0]!==p||t[1]!==a||t[2]!==u||t[3]!==i||t[4]!==n||t[5]!==d||t[6]!==r||t[7]!==f?(e=(0,Z.jsx)(cr,{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:u,receiveShadow:d,vis:f,animated:p}),t[0]=p,t[1]=a,t[2]=u,t[3]=i,t[4]=n,t[5]=d,t[6]=r,t[7]=f,t[8]=e):e=t[8],e}else if(n.name){let e;return t[9]!==p||t[10]!==a||t[11]!==u||t[12]!==i||t[13]!==n||t[14]!==d||t[15]!==r||t[16]!==f?(e=(0,Z.jsx)(fr,{material:n,shapeName:r,geometry:i,backGeometry:a,castShadow:u,receiveShadow:d,vis:f,animated:p}),t[9]=p,t[10]=a,t[11]=u,t[12]=i,t[13]=n,t[14]=d,t[15]=r,t[16]=f,t[17]=e):e=t[17],e}else return null});function pr(e){let t=(0,X.c)(9),{color:n,label:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`boxGeometry`,{args:[10,10,10]}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,Z.jsx)(`meshStandardMaterial`,{color:n,wireframe:!0}),t[1]=n,t[2]=a);let o;t[3]!==n||t[4]!==r?(o=r?(0,Z.jsx)(Ke,{color:n,children:r}):null,t[3]=n,t[4]=r,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,Z.jsxs)(`mesh`,{children:[i,a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function mr(e){let t=(0,X.c)(4),{color:n,label:r}=e,{debugMode:i}=s(),a;return t[0]!==n||t[1]!==i||t[2]!==r?(a=i?(0,Z.jsx)(pr,{color:n,label:r}):null,t[0]=n,t[1]=i,t[2]=r,t[3]=a):a=t[3],a}var hr=(0,Y.memo)(function(e){let t=(0,X.c)(15),{loadingColor:n,streamEntity:r,children:i}=e,a=n===void 0?`yellow`:n,{object:o,shapeName:s}=xn();if(!s){let e=`${o?._id}: `,n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(mr,{color:`orange`,label:e}),t[0]=e,t[1]=n),n}let c=`${o?._id}: ${s}`,l;t[2]===c?l=t[3]:(l=(0,Z.jsx)(mr,{color:`red`,label:c}),t[2]=c,t[3]=l);let u;t[4]===a?u=t[5]:(u=(0,Z.jsx)(pr,{color:a}),t[4]=a,t[5]=u);let d;t[6]===r?d=t[7]:(d=(0,Z.jsx)(_r,{streamEntity:r}),t[6]=r,t[7]=d);let f;t[8]!==i||t[9]!==u||t[10]!==d?(f=(0,Z.jsxs)(Y.Suspense,{fallback:u,children:[d,i]}),t[8]=i,t[9]=u,t[10]=d,t[11]=f):f=t[11];let p;return t[12]!==l||t[13]!==f?(p=(0,Z.jsx)(mn,{fallback:l,children:f}),t[12]=l,t[13]=f,t[14]=p):p=t[14],p}),gr=(0,Y.memo)(function({gltf:e,streamEntity:t}){let{object:n,shapeName:r}=xn(),{debugMode:i}=s(),{animationEnabled:c}=o(),l=Le(e=>e.runtime.runtime),u=qe(),{clonedScene:d,mixer:p,clipsByName:m,visNodesBySequence:h,iflMeshes:g}=(0,Y.useMemo)(()=>{let t=gn(e.scene),n=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let r=new Set(t.userData.flag_names??[]),i=t.userData.resource_path;if(r.has(`IflMaterial`)&&i){let t=e.userData,r=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,a=t?.ifl_duration?Number(t.ifl_duration):void 0,o=t?.ifl_sequence?!!t.ifl_cyclic:void 0,s=t?.ifl_tool_begin==null?void 0:Number(t.ifl_tool_begin);n.push({mesh:e,iflPath:`textures/${i}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:r,iflDuration:a,iflCyclic:o,iflToolBegin:s})}}),Qn(t,r??void 0,{anisotropy:u});for(let{mesh:e,hasVisSequence:t}of n)t||(e.visible=!0);let i=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let n=t.vis_keyframes,r=t.vis_duration,a=(t.vis_sequence??``).toLowerCase();if(!a||!Array.isArray(n)||n.length<=1||!r||r<=0)return;let o=i.get(a);o||(o=[],i.set(a,o)),o.push({mesh:e,keyframes:n,duration:r,cyclic:!!t.vis_cyclic})});let a=new Map;for(let t of e.animations)a.set(t.name.toLowerCase(),t);return{clonedScene:t,mixer:a.size>0?new Te(t):null,clipsByName:a,visNodesBySequence:i,iflMeshes:n}},[e,u]);(0,Y.useEffect)(()=>()=>{$n(d),p?.uncacheRoot(d)},[d,p]);let _=(0,Y.useRef)(new Map),v=(0,Y.useRef)(new Map),y=(0,Y.useRef)([]),b=(0,Y.useRef)(0),x=(0,Y.useRef)(c);x.current=c;let S=(0,Y.useRef)(null),C=(0,Y.useRef)(t);C.current=t;let w=(0,Y.useRef)(null),T=(0,Y.useRef)(null),E=(0,Y.useRef)(void 0);(0,Y.useEffect)(()=>{y.current=[],v.current.clear();for(let e of g)kn(e.iflPath).then(t=>{let n=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;n&&(n.map=t.texture,n.needsUpdate=!0);let r={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};y.current.push(r),v.current.set(e.mesh,t)}).catch(t=>{tr.warn(`Failed to load IFL atlas for %s: %o`,e.iflPath,t)})},[g]);let{seqCyclicByName:D,seqBlendByName:O}=(0,Y.useMemo)(()=>{let t=new Map,n=new Map,r=e.scene.userData?.dts_sequence_names,i=e.scene.userData?.dts_sequence_cyclic,a=e.scene.userData?.dts_sequence_blend;if(typeof r==`string`)try{let e=JSON.parse(r),o=typeof i==`string`?JSON.parse(i):[],s=typeof a==`string`?JSON.parse(a):[];for(let r=0;r{let e=_.current,t=C.current==null;function r(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,n=Xn(t,e.mesh.userData?.vis??0);e.mesh.material=n.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=v.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}function i(t,n){let i=n.toLowerCase();a(t);let o=m.get(i),s=h.get(i),c={sequence:i,startTime:nr()};if(o&&p){let e=p.clipAction(o);D.get(i)??!0?e.setLoop(f,1/0):(e.setLoop(A,1),e.clampWhenFinished=!0),O.has(i)&&(e.blendMode=be),e.reset().play(),c.action=e}if(s){for(let e of s)r(e);c.visNodes=s}e.set(t,c)}function a(t){let n=e.get(t);if(n){if(n.action&&n.action.stop(),n.visNodes)for(let e of n.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(w.current=i,T.current=a,!t)return()=>{w.current=null,T.current=null,E.current=void 0;for(let t of[...e.keys()])a(t)};let o=[];l&&(o.push(l.$.onMethodCalled(`ShapeBase`,`playThread`,(e,t,r)=>{e._id===n?._id&&i(Number(t),String(r))})),o.push(l.$.onMethodCalled(`ShapeBase`,`stopThread`,(e,t)=>{e._id===n?._id&&a(Number(t))})),o.push(l.$.onMethodCalled(`ShapeBase`,`pauseThread`,(t,r)=>{if(t._id!==n?._id)return;let i=e.get(Number(r));i?.action&&(i.action.paused=!0)})));for(let[e,t]of[[0,`power`],[1,`ambient`]])(m.has(t)||h.has(t))&&i(e,t);if(p&&m.has(`wheel0`)){let e=[];for(let t=0;t<6;t++){let n={rotation:0},r=m.get(`wheel${t}`);if(r){let e=p.clipAction(r);e.setLoop(A,1),e.clampWhenFinished=!0,e.paused=!0,e.play(),n.wheelAction=e}let i=m.get(`spring${t}`);if(i){let e=p.clipAction(i);e.setLoop(A,1),e.clampWhenFinished=!0,e.paused=!0,e.play(),e.time=0,n.springAction=e}let a=m.get(`turn${t}`);if(a){let e=p.clipAction(a);e.setLoop(A,1),e.clampWhenFinished=!0,e.paused=!0,e.play(),e.time=a.duration*.5,n.turnAction=e}e.push(n)}S.current=e}else S.current=null;return()=>{o.forEach(e=>e()),w.current=null,T.current=null,E.current=void 0,S.current=null;for(let t of[...e.keys()])a(t)}},[p,m,h,D,O,n,l]);let k=(0,Y.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if(typeof t==`string`)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return a((e,t)=>{let n=_.current,r=C.current!=null,i=ze.getState().playback,a=r?i.status===`playing`?t*i.rate:0:t,o=C.current?.threads,s=E.current;if(o!==s){let e=w.current,t=T.current;if(e&&t){E.current=o;let r=[];if(o)for(let e of o)r[e.index]=e;let i=[];if(s)for(let e of s)i[e.index]=e;let a=Math.max(r.length,i.length);for(let o=0;o0){b.current+=a;for(let e of u){if(!c){Q(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,r]of n)if(r.sequence===e.sequenceName){let n=nr()-r.startTime,i=e.sequenceDuration;t=(e.cyclic?n/i%1:Math.min(n/i,1))*i+(e.toolBegin??0);break}Q(e.atlas,On(e.atlas,t))}else Q(e.atlas,On(e.atlas,b.current))}}}),(0,Z.jsxs)(`group`,{rotation:[0,Math.PI/2,0],children:[(0,Z.jsx)(`primitive`,{object:d}),i?(0,Z.jsxs)(Ke,{children:[n?._id,`: `,r]}):null]})});function _r(e){let t=(0,X.c)(3),{streamEntity:n}=e,{shapeName:r}=xn(),i=sr(r),a;return t[0]!==i||t[1]!==n?(a=(0,Z.jsx)(gr,{gltf:i,streamEntity:n}),t[0]=i,t[1]=n,t[2]=a):a=t[2],a}export{mn as C,on as D,un as E,gn as S,dn as T,Wn as _,Pn as a,Q as b,Vn as c,Kn as d,qn as f,Hn as g,Un as h,Fn as i,$n as l,Gn as m,hr as n,In as o,Qn as p,sr as r,Bn as s,pr as t,er as u,On as v,ln as w,Sn as x,kn as y}; \ No newline at end of file diff --git a/docs/assets/Html-BfjRWIZg.js b/docs/assets/Html-DTt-Asp4.js similarity index 98% rename from docs/assets/Html-BfjRWIZg.js rename to docs/assets/Html-DTt-Asp4.js index f73062a0..308f5581 100644 --- a/docs/assets/Html-BfjRWIZg.js +++ b/docs/assets/Html-DTt-Asp4.js @@ -1,4 +1,4 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{r as t}from"./jsx-runtime-BpGWiA-R.js";import{i as n,o as r}from"./react-three-fiber.esm-CgPHUpXo.js";import{Ht as i,Ut as a,ht as o,mt as s}from"./three.module-07hRbor4.js";import{dt as c}from"./index-B1XI52_L.js";import{t as l}from"./extends-COZGby3T.js";var u=e(t()),d=e(c()),f=new a,p=new a,m=new a,h=new i;function ee(e,t,n){let r=f.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,a=n.height/2;return[r.x*i+i,-(r.y*a)+a]}function te(e,t){let n=f.setFromMatrixPosition(e.matrixWorld),r=p.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),a=t.getWorldDirection(m);return i.angleTo(a)>Math.PI/2}function g(e,t,n,r){let i=f.setFromMatrixPosition(e.matrixWorld),a=i.clone();a.project(t),h.set(a.x,a.y),n.setFromCamera(h,t);let o=n.intersectObjects(r,!0);if(o.length){let e=o[0].distance;return i.distanceTo(n.ray.origin)Math.abs(e)<1e-10?0:e;function b(e,t,n=``){let r=`matrix3d(`;for(let n=0;n!==16;n++)r+=y(t[n]*e.elements[n])+(n===15?`)`:`,`);return n+r}var x=(e=>t=>b(t,e))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),S=(e=>(t,n)=>b(t,e(n),`translate(-50%,-50%)`))(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1]);function ne(e){return e&&typeof e==`object`&&`current`in e}var C=u.forwardRef(({children:e,eps:t=.001,style:i,className:o,prepend:s,center:c,fullscreen:f,portal:p,distanceFactor:m,sprite:h=!1,transform:b=!1,occlude:C,onOcclude:w,castShadow:re,receiveShadow:ie,material:ae,geometry:T,zIndexRange:E=[16777271,0],calculatePosition:D=ee,as:O=`div`,wrapperClass:k,pointerEvents:A=`auto`,...j},M)=>{let{gl:N,camera:P,scene:F,size:I,raycaster:L,events:R,viewport:z}=r(),[B]=u.useState(()=>document.createElement(O)),V=u.useRef(null),H=u.useRef(null),U=u.useRef(0),W=u.useRef([0,0]),G=u.useRef(null),K=u.useRef(null),q=p?.current||R.connected||N.domElement.parentNode,J=u.useRef(null),Y=u.useRef(!1),X=u.useMemo(()=>C&&C!==`blending`||Array.isArray(C)&&C.length&&ne(C[0]),[C]);u.useLayoutEffect(()=>{let e=N.domElement;C&&C===`blending`?(e.style.zIndex=`${Math.floor(E[0]/2)}`,e.style.position=`absolute`,e.style.pointerEvents=`none`):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[C]),u.useLayoutEffect(()=>{if(H.current){let e=V.current=d.createRoot(B);if(F.updateMatrixWorld(),b)B.style.cssText=`position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;`;else{let e=D(H.current,P,I);B.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return q&&(s?q.prepend(B):q.appendChild(B)),()=>{q&&q.removeChild(B),e.unmount()}}},[q,b]),u.useLayoutEffect(()=>{k&&(B.className=k)},[k]);let Z=u.useMemo(()=>b?{position:`absolute`,top:0,left:0,width:I.width,height:I.height,transformStyle:`preserve-3d`,pointerEvents:`none`}:{position:`absolute`,transform:c?`translate3d(-50%,-50%,0)`:`none`,...f&&{top:-I.height/2,left:-I.width/2,width:I.width,height:I.height},...i},[i,c,f,I,b]),oe=u.useMemo(()=>({position:`absolute`,pointerEvents:A}),[A]);u.useLayoutEffect(()=>{if(Y.current=!1,b){var t;(t=V.current)==null||t.render(u.createElement(`div`,{ref:G,style:Z},u.createElement(`div`,{ref:K,style:oe},u.createElement(`div`,{ref:M,className:o,style:i,children:e}))))}else{var n;(n=V.current)==null||n.render(u.createElement(`div`,{ref:M,style:Z,className:o,children:e}))}});let Q=u.useRef(!0);n(e=>{if(H.current){P.updateMatrixWorld(),H.current.updateWorldMatrix(!0,!1);let e=b?W.current:D(H.current,P,I);if(b||Math.abs(U.current-P.zoom)>t||Math.abs(W.current[0]-e[0])>t||Math.abs(W.current[1]-e[1])>t){let t=te(H.current,P),n=!1;X&&(Array.isArray(C)?n=C.map(e=>e.current):C!==`blending`&&(n=[F]));let r=Q.current;n?Q.current=g(H.current,P,L,n)&&!t:Q.current=!t,r!==Q.current&&(w?w(!Q.current):B.style.display=Q.current?`block`:`none`);let i=Math.floor(E[0]/2),a=C?X?[E[0],i]:[i-1,0]:E;if(B.style.zIndex=`${v(H.current,P,a)}`,b){let[e,t]=[I.width/2,I.height/2],n=P.projectionMatrix.elements[5]*t,{isOrthographicCamera:r,top:i,left:a,bottom:o,right:s}=P,c=x(P.matrixWorldInverse),l=r?`scale(${n})translate(${y(-(s+a)/2)}px,${y((i+o)/2)}px)`:`translateZ(${n}px)`,u=H.current.matrixWorld;h&&(u=P.matrixWorldInverse.clone().transpose().copyPosition(u).scale(H.current.scale),u.elements[3]=u.elements[7]=u.elements[11]=0,u.elements[15]=1),B.style.width=I.width+`px`,B.style.height=I.height+`px`,B.style.perspective=r?``:`${n}px`,G.current&&K.current&&(G.current.style.transform=`${l}${c}translate(${e}px,${t}px)`,K.current.style.transform=S(u,1/((m||10)/400)))}else{let t=m===void 0?1:_(H.current,P)*m;B.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}W.current=e,U.current=P.zoom}}if(!X&&J.current&&!Y.current)if(b){if(G.current){let e=G.current.children[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let{isOrthographicCamera:t}=P;if(t||T)j.scale&&(Array.isArray(j.scale)?j.scale instanceof a?J.current.scale.copy(j.scale.clone().divideScalar(1)):J.current.scale.set(1/j.scale[0],1/j.scale[1],1/j.scale[2]):J.current.scale.setScalar(1/j.scale));else{let t=(m||10)/400,n=e.clientWidth*t,r=e.clientHeight*t;J.current.scale.set(n,r,1)}Y.current=!0}}}else{let t=B.children[0];if(t!=null&&t.clientWidth&&t!=null&&t.clientHeight){let e=1/z.factor,n=t.clientWidth*e,r=t.clientHeight*e;J.current.scale.set(n,r,1),Y.current=!0}J.current.lookAt(e.camera.position)}});let $=u.useMemo(()=>({vertexShader:b?void 0:` +import{r as e}from"./chunk-DECur_0Z.js";import{r as t}from"./jsx-runtime-BpGWiA-R.js";import{i as n,o as r}from"./react-three-fiber.esm-CgPHUpXo.js";import{Ht as i,Ut as a,ht as o,mt as s}from"./three.module-07hRbor4.js";import{dt as c}from"./index-DfaykQpF.js";import{t as l}from"./extends-COZGby3T.js";var u=e(t()),d=e(c()),f=new a,p=new a,m=new a,h=new i;function ee(e,t,n){let r=f.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,a=n.height/2;return[r.x*i+i,-(r.y*a)+a]}function te(e,t){let n=f.setFromMatrixPosition(e.matrixWorld),r=p.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),a=t.getWorldDirection(m);return i.angleTo(a)>Math.PI/2}function g(e,t,n,r){let i=f.setFromMatrixPosition(e.matrixWorld),a=i.clone();a.project(t),h.set(a.x,a.y),n.setFromCamera(h,t);let o=n.intersectObjects(r,!0);if(o.length){let e=o[0].distance;return i.distanceTo(n.ray.origin)Math.abs(e)<1e-10?0:e;function b(e,t,n=``){let r=`matrix3d(`;for(let n=0;n!==16;n++)r+=y(t[n]*e.elements[n])+(n===15?`)`:`,`);return n+r}var x=(e=>t=>b(t,e))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),S=(e=>(t,n)=>b(t,e(n),`translate(-50%,-50%)`))(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1]);function ne(e){return e&&typeof e==`object`&&`current`in e}var C=u.forwardRef(({children:e,eps:t=.001,style:i,className:o,prepend:s,center:c,fullscreen:f,portal:p,distanceFactor:m,sprite:h=!1,transform:b=!1,occlude:C,onOcclude:w,castShadow:re,receiveShadow:ie,material:ae,geometry:T,zIndexRange:E=[16777271,0],calculatePosition:D=ee,as:O=`div`,wrapperClass:k,pointerEvents:A=`auto`,...j},M)=>{let{gl:N,camera:P,scene:F,size:I,raycaster:L,events:R,viewport:z}=r(),[B]=u.useState(()=>document.createElement(O)),V=u.useRef(null),H=u.useRef(null),U=u.useRef(0),W=u.useRef([0,0]),G=u.useRef(null),K=u.useRef(null),q=p?.current||R.connected||N.domElement.parentNode,J=u.useRef(null),Y=u.useRef(!1),X=u.useMemo(()=>C&&C!==`blending`||Array.isArray(C)&&C.length&&ne(C[0]),[C]);u.useLayoutEffect(()=>{let e=N.domElement;C&&C===`blending`?(e.style.zIndex=`${Math.floor(E[0]/2)}`,e.style.position=`absolute`,e.style.pointerEvents=`none`):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[C]),u.useLayoutEffect(()=>{if(H.current){let e=V.current=d.createRoot(B);if(F.updateMatrixWorld(),b)B.style.cssText=`position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;`;else{let e=D(H.current,P,I);B.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return q&&(s?q.prepend(B):q.appendChild(B)),()=>{q&&q.removeChild(B),e.unmount()}}},[q,b]),u.useLayoutEffect(()=>{k&&(B.className=k)},[k]);let Z=u.useMemo(()=>b?{position:`absolute`,top:0,left:0,width:I.width,height:I.height,transformStyle:`preserve-3d`,pointerEvents:`none`}:{position:`absolute`,transform:c?`translate3d(-50%,-50%,0)`:`none`,...f&&{top:-I.height/2,left:-I.width/2,width:I.width,height:I.height},...i},[i,c,f,I,b]),oe=u.useMemo(()=>({position:`absolute`,pointerEvents:A}),[A]);u.useLayoutEffect(()=>{if(Y.current=!1,b){var t;(t=V.current)==null||t.render(u.createElement(`div`,{ref:G,style:Z},u.createElement(`div`,{ref:K,style:oe},u.createElement(`div`,{ref:M,className:o,style:i,children:e}))))}else{var n;(n=V.current)==null||n.render(u.createElement(`div`,{ref:M,style:Z,className:o,children:e}))}});let Q=u.useRef(!0);n(e=>{if(H.current){P.updateMatrixWorld(),H.current.updateWorldMatrix(!0,!1);let e=b?W.current:D(H.current,P,I);if(b||Math.abs(U.current-P.zoom)>t||Math.abs(W.current[0]-e[0])>t||Math.abs(W.current[1]-e[1])>t){let t=te(H.current,P),n=!1;X&&(Array.isArray(C)?n=C.map(e=>e.current):C!==`blending`&&(n=[F]));let r=Q.current;n?Q.current=g(H.current,P,L,n)&&!t:Q.current=!t,r!==Q.current&&(w?w(!Q.current):B.style.display=Q.current?`block`:`none`);let i=Math.floor(E[0]/2),a=C?X?[E[0],i]:[i-1,0]:E;if(B.style.zIndex=`${v(H.current,P,a)}`,b){let[e,t]=[I.width/2,I.height/2],n=P.projectionMatrix.elements[5]*t,{isOrthographicCamera:r,top:i,left:a,bottom:o,right:s}=P,c=x(P.matrixWorldInverse),l=r?`scale(${n})translate(${y(-(s+a)/2)}px,${y((i+o)/2)}px)`:`translateZ(${n}px)`,u=H.current.matrixWorld;h&&(u=P.matrixWorldInverse.clone().transpose().copyPosition(u).scale(H.current.scale),u.elements[3]=u.elements[7]=u.elements[11]=0,u.elements[15]=1),B.style.width=I.width+`px`,B.style.height=I.height+`px`,B.style.perspective=r?``:`${n}px`,G.current&&K.current&&(G.current.style.transform=`${l}${c}translate(${e}px,${t}px)`,K.current.style.transform=S(u,1/((m||10)/400)))}else{let t=m===void 0?1:_(H.current,P)*m;B.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}W.current=e,U.current=P.zoom}}if(!X&&J.current&&!Y.current)if(b){if(G.current){let e=G.current.children[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let{isOrthographicCamera:t}=P;if(t||T)j.scale&&(Array.isArray(j.scale)?j.scale instanceof a?J.current.scale.copy(j.scale.clone().divideScalar(1)):J.current.scale.set(1/j.scale[0],1/j.scale[1],1/j.scale[2]):J.current.scale.setScalar(1/j.scale));else{let t=(m||10)/400,n=e.clientWidth*t,r=e.clientHeight*t;J.current.scale.set(n,r,1)}Y.current=!0}}}else{let t=B.children[0];if(t!=null&&t.clientWidth&&t!=null&&t.clientHeight){let e=1/z.factor,n=t.clientWidth*e,r=t.clientHeight*e;J.current.scale.set(n,r,1),Y.current=!0}J.current.lookAt(e.camera.position)}});let $=u.useMemo(()=>({vertexShader:b?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite diff --git a/docs/assets/KeyboardOverlay-D875z9z7.js b/docs/assets/KeyboardOverlay-Du-YZ_-q.js similarity index 99% rename from docs/assets/KeyboardOverlay-D875z9z7.js rename to docs/assets/KeyboardOverlay-Du-YZ_-q.js index dbafbfd0..e00e550d 100644 --- a/docs/assets/KeyboardOverlay-D875z9z7.js +++ b/docs/assets/KeyboardOverlay-Du-YZ_-q.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{r as i}from"./SettingsProvider-CCHVZuSg.js";import{n as a}from"./cameraTourStore-PEzPVGnX.js";import{B as o,D as s,G as c,H as l,J as u,K as d,N as f,O as p,P as m,S as h,T as g,V as _,b as v,d as y,m as b,q as x,x as S}from"./index-B1XI52_L.js";import{n as C,t as w}from"./gr-1PcjgMj0.js";var T=t(),E=e(n(),1);function D(e){return document.addEventListener(`pointerlockchange`,e),()=>document.removeEventListener(`pointerlockchange`,e)}function O(){return document.pointerLockElement!==null}function k(){return(0,E.useSyncExternalStore)(D,O,A)}function A(){return!1}var j={Root:`_Root_88qkf_1`,Column:`_Column_88qkf_13`,Row:`_Row_88qkf_25`,Spacer:`_Spacer_88qkf_31`,Sep:`_Sep_88qkf_35`,Key:`_Key_88qkf_39`,Label:`_Label_88qkf_78`,MultiInput:`_MultiInput_88qkf_120`,Input:`_Input_88qkf_128`,ColumnLabel:`_ColumnLabel_88qkf_161`,PlayPauseIcon:`_PlayPauseIcon_88qkf_170`,MouseIcon:`_MouseIcon_88qkf_174`},M=r();function N(e,t){let n=e[t];return n!=null&&`pressed`in n&&n.pressed}function P(e){let t=(0,T.c)(24),{action:n,input:r,label:i,labelPosition:a,labelSize:o,inputSize:s,size:c,disabled:l,debounce:u}=e,d=a===void 0?`hidden`:a,f=o===void 0?`fill`:o,p=s===void 0?`fill`:s,m=c===void 0?`fill`:c,h=l===void 0?!1:l,g=(0,E.useRef)(void 0),[_,v]=(0,E.useState)(!1),b;t[0]===n?b=t[1]:(b=typeof n==`function`?n:e=>N(e,n),t[0]=n,t[1]=b);let x=y(b),S,C;t[2]!==u||t[3]!==x?(S=()=>{if(u)if(x)clearTimeout(g.current),g.current=void 0,v(!0);else return g.current=setTimeout(()=>{g.current=void 0,v(!1)},u),()=>clearTimeout(g.current)},C=[x,u],t[2]=u,t[3]=x,t[4]=S,t[5]=C):(S=t[4],C=t[5]),(0,E.useEffect)(S,C);let w=u?_:x,D;t[6]!==i||t[7]!==d||t[8]!==f?(D=d===`left`?(0,M.jsx)(`span`,{className:j.Label,"data-size":f,children:i}):null,t[6]=i,t[7]=d,t[8]=f,t[9]=D):D=t[9];let O;t[10]!==r||t[11]!==p?(O=Array.isArray(r)?(0,M.jsx)(`div`,{className:j.MultiInput,"data-size":p,children:r.map(F)}):(0,M.jsx)(`span`,{className:j.Input,"data-size":p,children:r}),t[10]=r,t[11]=p,t[12]=O):O=t[12];let k;t[13]!==i||t[14]!==d||t[15]!==f?(k=d===`right`?(0,M.jsx)(`span`,{className:j.Label,"data-size":f,children:i}):null,t[13]=i,t[14]=d,t[15]=f,t[16]=k):k=t[16];let A;return t[17]!==h||t[18]!==w||t[19]!==m||t[20]!==O||t[21]!==k||t[22]!==D?(A=(0,M.jsxs)(`div`,{className:j.Key,"data-pressed":w,"data-size":m,"data-disabled":h,children:[D,O,k]}),t[17]=h,t[18]=w,t[19]=m,t[20]=O,t[21]=k,t[22]=D,t[23]=A):A=t[23],A}function F(e,t){return(0,M.jsx)(`span`,{className:j.Input,children:e},t)}function I(){let e=(0,T.c)(12),t=k(),[n,r]=(0,E.useState)(!1),i=(0,E.useRef)(!1),a,o;e[0]===t?(a=e[1],o=e[2]):(a=()=>{if(i.current&&!t){r(!0);let e=setTimeout(()=>r(!1),150);return()=>clearTimeout(e)}i.current=t},o=[t],e[0]=t,e[1]=a,e[2]=o),(0,E.useEffect)(a,o);let s=t||n,c;e[3]!==n||e[4]!==s?(c=s?()=>n:`canvasClick`,e[3]=n,e[4]=s,e[5]=c):c=e[5];let l=s?`Unlock mouse`:`Capture mouse`,u;e[6]===s?u=e[7]:(u=s?`Esc`:(0,M.jsx)(v,{className:j.MouseIcon}),e[6]=s,e[7]=u);let d;return e[8]!==c||e[9]!==l||e[10]!==u?(d=(0,M.jsx)(P,{action:c,label:l,input:u,labelPosition:`right`,inputSize:`auto`}),e[8]=c,e[9]=l,e[10]=u,e[11]=d):d=e[11],d}function L(){let e=(0,T.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsxs)(`div`,{className:j.Row,children:[(0,M.jsx)(`div`,{className:j.Spacer}),(0,M.jsx)(P,{action:`moveForward`,input:`W`,label:`Forward`}),(0,M.jsx)(`div`,{className:j.Spacer})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(`div`,{className:j.Column,children:[t,(0,M.jsxs)(`div`,{className:j.Row,children:[(0,M.jsx)(P,{action:`moveLeft`,input:`A`,label:`Strafe left`}),(0,M.jsx)(P,{action:`moveBackward`,input:`S`,label:`Backward`}),(0,M.jsx)(P,{action:`moveRight`,input:`D`,label:`Strafe right`})]})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`moveUp`,input:`E`,label:(0,M.jsx)(l,{}),labelPosition:`left`,labelSize:`auto`})}),e[2]=r):r=e[2];let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[n,(0,M.jsxs)(`div`,{className:j.Column,children:[r,(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`moveDown`,input:`Q`,label:(0,M.jsx)(_,{}),labelPosition:`left`,labelSize:`auto`})})]})]}),e[3]=i):i=e[3],i}function R(){let e=(0,T.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(`div`,{className:j.Spacer}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(`div`,{className:j.Row,children:[t,(0,M.jsx)(P,{action:`lookUp`,input:(0,M.jsx)(u,{}),label:`Look up`}),(0,M.jsx)(`div`,{className:j.Spacer})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,M.jsx)(P,{action:`lookLeft`,input:(0,M.jsx)(d,{}),label:`Look left`}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(P,{action:`lookDown`,input:(0,M.jsx)(c,{}),label:`Look down`}),e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsxs)(`div`,{className:j.Column,children:[n,(0,M.jsxs)(`div`,{className:j.Row,children:[r,i,(0,M.jsx)(P,{action:`lookRight`,input:(0,M.jsx)(x,{}),label:`Look right`})]})]}),e[4]=a):a=e[4],a}function z(){let e=(0,T.c)(8),{speedMultiplier:t}=i(),[n,r]=(0,E.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{r(B);let e=setTimeout(()=>{r(!1)},100);return()=>clearTimeout(e)},e[0]=a):a=e[0];let o;e[1]===t?o=e[2]:(o=[t],e[1]=t,e[2]=o),(0,E.useEffect)(a,o);let s;e[3]===n?s=e[4]:(s=e=>(e.adjustSpeed?.deltaY??0)!==0&&(n??!1),e[3]=n,e[4]=s);let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,M.jsx)(S,{className:j.MouseIcon}),e[5]=c):c=e[5];let l;return e[6]===s?l=e[7]:(l=(0,M.jsx)(P,{action:s,debounce:50,label:`Adjust speed`,input:c,labelPosition:`right`,inputSize:`auto`}),e[6]=s,e[7]=l),l}function B(e){return e!=null}function V(){let e=(0,T.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{action:H,input:(0,M.jsx)(o,{className:j.MouseIcon}),label:`Rotate camera`,labelPosition:`right`,inputSize:`auto`}),e[0]=t):t=e[0],t}function H(e){return e.dragLook?.dragging??!1}function U(){let e=(0,T.c)(6),t=f()===`map`,n=m(`Camera`),r=t?n.length:0,i,a;e[0]===r?(i=e[1],a=e[2]):(i=e=>Array.from({length:r},(t,n)=>N(e,`camera${n+1}`)).some(W),a=r===1?`1`:(0,M.jsxs)(M.Fragment,{children:[`1 – `,r]}),e[0]=r,e[1]=i,e[2]=a);let o;return e[3]!==i||e[4]!==a?(o=(0,M.jsx)(P,{action:i,input:a,label:`Select camera`,labelPosition:`right`}),e[3]=i,e[4]=a,e[5]=o):o=e[5],o}function W(e){return e}function G(){let e=(0,T.c)(11),t=k(),n=f()===`map`,r=m(`Camera`),i=n?r.length:0,a,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsx)(L,{}),o=(0,M.jsx)(R,{}),e[0]=a,e[1]=o):(a=e[0],o=e[1]);let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(z,{})}),e[2]=s):s=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[s,(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(I,{})})]}),e[3]=c):c=e[3];let l;e[4]===t?l=e[5]:(l=t?null:(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(V,{})}),e[4]=t,e[5]=l);let u;e[6]===i?u=e[7]:(u=i>0&&(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(U,{})}),e[6]=i,e[7]=u);let d;return e[8]!==l||e[9]!==u?(d=(0,M.jsxs)(M.Fragment,{children:[a,o,c,(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[l,u]})]}),e[8]=l,e[9]=u,e[10]=d):d=e[10],d}function K(){let e=(0,T.c)(15),t=g(),n=p(),r=h.indexOf(n)+1,i=h.indexOf(n)-1,a=r>=h.length,o=i<0,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[`<`,`,`],e[0]=s):s=e[0];let c;e[1]===o?c=e[2]:(c=(0,M.jsx)(P,{action:`decreasePlaybackSpeed`,label:`Slow down`,input:s,labelPosition:`right`,disabled:o}),e[1]=o,e[2]=c);let l;e[3]===t?l=e[4]:(l=(0,M.jsx)(P,{action:`playPause`,label:t?(0,M.jsx)(w,{className:j.PlayPauseIcon}):(0,M.jsx)(C,{className:j.PlayPauseIcon}),input:`Space`,labelPosition:`left`,size:`auto`}),e[3]=t,e[4]=l);let u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=[`>`,`.`],e[5]=u):u=e[5];let d;e[6]===a?d=e[7]:(d=(0,M.jsx)(P,{action:`increasePlaybackSpeed`,input:u,label:`Speed up`,labelPosition:`left`,disabled:a}),e[6]=a,e[7]=d);let f;e[8]!==c||e[9]!==l||e[10]!==d?(f=(0,M.jsx)(`div`,{className:j.Column,children:(0,M.jsxs)(`div`,{className:j.Row,children:[c,l,d]})}),e[8]=c,e[9]=l,e[10]=d,e[11]=f):f=e[11];let m;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,M.jsx)(`div`,{className:j.Column,children:(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(I,{})})}),e[12]=m):m=e[12];let _;return e[13]===f?_=e[14]:(_=(0,M.jsxs)(M.Fragment,{children:[f,m]}),e[13]=f,e[14]=_),_}function q(){let e=(0,T.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(`div`,{className:j.Column,children:(0,M.jsxs)(`div`,{className:j.Row,children:[(0,M.jsx)(P,{action:`nextStop`,label:`Skip to next stop`,input:(0,M.jsx)(v,{className:j.MouseIcon}),labelPosition:`right`}),(0,M.jsx)(P,{action:`exitTour`,label:`Exit tour`,input:`Esc`,labelPosition:`right`})]})})}),e[0]=t):t=e[0],t}function J(){let e=(0,T.c)(23),t=b(),n=k(),r;e[0]===t?r=e[1]:(r=t===`fly`?(0,M.jsx)(L,{}):null,e[0]=t,e[1]=r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(R,{}),e[2]=i):i=e[2];let a;e[3]===t?a=e[4]:(a=t===`fly`?(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(z,{})}):null,e[3]=t,e[4]=a);let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(I,{})}),e[5]=o):o=e[5];let s;e[6]===a?s=e[7]:(s=(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[a,o]}),e[6]=a,e[7]=s);let c;e[8]===n?c=e[9]:(c=n?null:(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(V,{})}),e[8]=n,e[9]=c);let l;e[10]!==t||e[11]!==n?(l=t===`follow`&&n?(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`nextPlayer`,label:`Next player`,input:(0,M.jsx)(v,{className:j.MouseIcon}),labelPosition:`right`,inputSize:`auto`})}):null,e[10]=t,e[11]=n,e[12]=l):l=e[12];let u=t===`follow`?`Fly mode`:`Follow mode`,d;e[13]===u?d=e[14]:(d=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`toggleObserverMode`,label:u,input:`Space`,labelPosition:`right`,inputSize:`auto`})}),e[13]=u,e[14]=d);let f;e[15]!==c||e[16]!==l||e[17]!==d?(f=(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[c,l,d]}),e[15]=c,e[16]=l,e[17]=d,e[18]=f):f=e[18];let p;return e[19]!==r||e[20]!==s||e[21]!==f?(p=(0,M.jsxs)(M.Fragment,{children:[r,i,s,f]}),e[19]=r,e[20]=s,e[21]=f,e[22]=p):p=e[22],p}function Y(){let e=(0,T.c)(13),t=s(),n=b(),r=a(X),i=t?.source===`demo`,o=t?.source===`live`,c=!t,l=o&&(n===`fly`||n===`follow`),u=c&&!r,d;e[0]===u?d=e[1]:(d=u&&(0,M.jsx)(G,{}),e[0]=u,e[1]=d);let f;e[2]===l?f=e[3]:(f=l&&(0,M.jsx)(J,{}),e[2]=l,e[3]=f);let p;e[4]===i?p=e[5]:(p=i&&(0,M.jsx)(K,{}),e[4]=i,e[5]=p);let m;e[6]===r?m=e[7]:(m=r&&(0,M.jsx)(q,{}),e[6]=r,e[7]=m);let h;return e[8]!==d||e[9]!==f||e[10]!==p||e[11]!==m?(h=(0,M.jsxs)(`div`,{className:j.Root,children:[d,f,p,m]}),e[8]=d,e[9]=f,e[10]=p,e[11]=m,e[12]=h):h=e[12],h}function X(e){return e.animation!==null}export{Y as KeyboardOverlay}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{r as i}from"./SettingsProvider-CCHVZuSg.js";import{n as a}from"./cameraTourStore-PEzPVGnX.js";import{B as o,D as s,G as c,H as l,J as u,K as d,N as f,O as p,P as m,S as h,T as g,V as _,b as v,d as y,m as b,q as x,x as S}from"./index-DfaykQpF.js";import{n as C,t as w}from"./gr-1PcjgMj0.js";var T=t(),E=e(n(),1);function D(e){return document.addEventListener(`pointerlockchange`,e),()=>document.removeEventListener(`pointerlockchange`,e)}function O(){return document.pointerLockElement!==null}function k(){return(0,E.useSyncExternalStore)(D,O,A)}function A(){return!1}var j={Root:`_Root_88qkf_1`,Column:`_Column_88qkf_13`,Row:`_Row_88qkf_25`,Spacer:`_Spacer_88qkf_31`,Sep:`_Sep_88qkf_35`,Key:`_Key_88qkf_39`,Label:`_Label_88qkf_78`,MultiInput:`_MultiInput_88qkf_120`,Input:`_Input_88qkf_128`,ColumnLabel:`_ColumnLabel_88qkf_161`,PlayPauseIcon:`_PlayPauseIcon_88qkf_170`,MouseIcon:`_MouseIcon_88qkf_174`},M=r();function N(e,t){let n=e[t];return n!=null&&`pressed`in n&&n.pressed}function P(e){let t=(0,T.c)(24),{action:n,input:r,label:i,labelPosition:a,labelSize:o,inputSize:s,size:c,disabled:l,debounce:u}=e,d=a===void 0?`hidden`:a,f=o===void 0?`fill`:o,p=s===void 0?`fill`:s,m=c===void 0?`fill`:c,h=l===void 0?!1:l,g=(0,E.useRef)(void 0),[_,v]=(0,E.useState)(!1),b;t[0]===n?b=t[1]:(b=typeof n==`function`?n:e=>N(e,n),t[0]=n,t[1]=b);let x=y(b),S,C;t[2]!==u||t[3]!==x?(S=()=>{if(u)if(x)clearTimeout(g.current),g.current=void 0,v(!0);else return g.current=setTimeout(()=>{g.current=void 0,v(!1)},u),()=>clearTimeout(g.current)},C=[x,u],t[2]=u,t[3]=x,t[4]=S,t[5]=C):(S=t[4],C=t[5]),(0,E.useEffect)(S,C);let w=u?_:x,D;t[6]!==i||t[7]!==d||t[8]!==f?(D=d===`left`?(0,M.jsx)(`span`,{className:j.Label,"data-size":f,children:i}):null,t[6]=i,t[7]=d,t[8]=f,t[9]=D):D=t[9];let O;t[10]!==r||t[11]!==p?(O=Array.isArray(r)?(0,M.jsx)(`div`,{className:j.MultiInput,"data-size":p,children:r.map(F)}):(0,M.jsx)(`span`,{className:j.Input,"data-size":p,children:r}),t[10]=r,t[11]=p,t[12]=O):O=t[12];let k;t[13]!==i||t[14]!==d||t[15]!==f?(k=d===`right`?(0,M.jsx)(`span`,{className:j.Label,"data-size":f,children:i}):null,t[13]=i,t[14]=d,t[15]=f,t[16]=k):k=t[16];let A;return t[17]!==h||t[18]!==w||t[19]!==m||t[20]!==O||t[21]!==k||t[22]!==D?(A=(0,M.jsxs)(`div`,{className:j.Key,"data-pressed":w,"data-size":m,"data-disabled":h,children:[D,O,k]}),t[17]=h,t[18]=w,t[19]=m,t[20]=O,t[21]=k,t[22]=D,t[23]=A):A=t[23],A}function F(e,t){return(0,M.jsx)(`span`,{className:j.Input,children:e},t)}function I(){let e=(0,T.c)(12),t=k(),[n,r]=(0,E.useState)(!1),i=(0,E.useRef)(!1),a,o;e[0]===t?(a=e[1],o=e[2]):(a=()=>{if(i.current&&!t){r(!0);let e=setTimeout(()=>r(!1),150);return()=>clearTimeout(e)}i.current=t},o=[t],e[0]=t,e[1]=a,e[2]=o),(0,E.useEffect)(a,o);let s=t||n,c;e[3]!==n||e[4]!==s?(c=s?()=>n:`canvasClick`,e[3]=n,e[4]=s,e[5]=c):c=e[5];let l=s?`Unlock mouse`:`Capture mouse`,u;e[6]===s?u=e[7]:(u=s?`Esc`:(0,M.jsx)(v,{className:j.MouseIcon}),e[6]=s,e[7]=u);let d;return e[8]!==c||e[9]!==l||e[10]!==u?(d=(0,M.jsx)(P,{action:c,label:l,input:u,labelPosition:`right`,inputSize:`auto`}),e[8]=c,e[9]=l,e[10]=u,e[11]=d):d=e[11],d}function L(){let e=(0,T.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsxs)(`div`,{className:j.Row,children:[(0,M.jsx)(`div`,{className:j.Spacer}),(0,M.jsx)(P,{action:`moveForward`,input:`W`,label:`Forward`}),(0,M.jsx)(`div`,{className:j.Spacer})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(`div`,{className:j.Column,children:[t,(0,M.jsxs)(`div`,{className:j.Row,children:[(0,M.jsx)(P,{action:`moveLeft`,input:`A`,label:`Strafe left`}),(0,M.jsx)(P,{action:`moveBackward`,input:`S`,label:`Backward`}),(0,M.jsx)(P,{action:`moveRight`,input:`D`,label:`Strafe right`})]})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`moveUp`,input:`E`,label:(0,M.jsx)(l,{}),labelPosition:`left`,labelSize:`auto`})}),e[2]=r):r=e[2];let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[n,(0,M.jsxs)(`div`,{className:j.Column,children:[r,(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`moveDown`,input:`Q`,label:(0,M.jsx)(_,{}),labelPosition:`left`,labelSize:`auto`})})]})]}),e[3]=i):i=e[3],i}function R(){let e=(0,T.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(`div`,{className:j.Spacer}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(`div`,{className:j.Row,children:[t,(0,M.jsx)(P,{action:`lookUp`,input:(0,M.jsx)(u,{}),label:`Look up`}),(0,M.jsx)(`div`,{className:j.Spacer})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,M.jsx)(P,{action:`lookLeft`,input:(0,M.jsx)(d,{}),label:`Look left`}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(P,{action:`lookDown`,input:(0,M.jsx)(c,{}),label:`Look down`}),e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsxs)(`div`,{className:j.Column,children:[n,(0,M.jsxs)(`div`,{className:j.Row,children:[r,i,(0,M.jsx)(P,{action:`lookRight`,input:(0,M.jsx)(x,{}),label:`Look right`})]})]}),e[4]=a):a=e[4],a}function z(){let e=(0,T.c)(8),{speedMultiplier:t}=i(),[n,r]=(0,E.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{r(B);let e=setTimeout(()=>{r(!1)},100);return()=>clearTimeout(e)},e[0]=a):a=e[0];let o;e[1]===t?o=e[2]:(o=[t],e[1]=t,e[2]=o),(0,E.useEffect)(a,o);let s;e[3]===n?s=e[4]:(s=e=>(e.adjustSpeed?.deltaY??0)!==0&&(n??!1),e[3]=n,e[4]=s);let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,M.jsx)(S,{className:j.MouseIcon}),e[5]=c):c=e[5];let l;return e[6]===s?l=e[7]:(l=(0,M.jsx)(P,{action:s,debounce:50,label:`Adjust speed`,input:c,labelPosition:`right`,inputSize:`auto`}),e[6]=s,e[7]=l),l}function B(e){return e!=null}function V(){let e=(0,T.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{action:H,input:(0,M.jsx)(o,{className:j.MouseIcon}),label:`Rotate camera`,labelPosition:`right`,inputSize:`auto`}),e[0]=t):t=e[0],t}function H(e){return e.dragLook?.dragging??!1}function U(){let e=(0,T.c)(6),t=f()===`map`,n=m(`Camera`),r=t?n.length:0,i,a;e[0]===r?(i=e[1],a=e[2]):(i=e=>Array.from({length:r},(t,n)=>N(e,`camera${n+1}`)).some(W),a=r===1?`1`:(0,M.jsxs)(M.Fragment,{children:[`1 – `,r]}),e[0]=r,e[1]=i,e[2]=a);let o;return e[3]!==i||e[4]!==a?(o=(0,M.jsx)(P,{action:i,input:a,label:`Select camera`,labelPosition:`right`}),e[3]=i,e[4]=a,e[5]=o):o=e[5],o}function W(e){return e}function G(){let e=(0,T.c)(11),t=k(),n=f()===`map`,r=m(`Camera`),i=n?r.length:0,a,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsx)(L,{}),o=(0,M.jsx)(R,{}),e[0]=a,e[1]=o):(a=e[0],o=e[1]);let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(z,{})}),e[2]=s):s=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[s,(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(I,{})})]}),e[3]=c):c=e[3];let l;e[4]===t?l=e[5]:(l=t?null:(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(V,{})}),e[4]=t,e[5]=l);let u;e[6]===i?u=e[7]:(u=i>0&&(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(U,{})}),e[6]=i,e[7]=u);let d;return e[8]!==l||e[9]!==u?(d=(0,M.jsxs)(M.Fragment,{children:[a,o,c,(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[l,u]})]}),e[8]=l,e[9]=u,e[10]=d):d=e[10],d}function K(){let e=(0,T.c)(15),t=g(),n=p(),r=h.indexOf(n)+1,i=h.indexOf(n)-1,a=r>=h.length,o=i<0,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[`<`,`,`],e[0]=s):s=e[0];let c;e[1]===o?c=e[2]:(c=(0,M.jsx)(P,{action:`decreasePlaybackSpeed`,label:`Slow down`,input:s,labelPosition:`right`,disabled:o}),e[1]=o,e[2]=c);let l;e[3]===t?l=e[4]:(l=(0,M.jsx)(P,{action:`playPause`,label:t?(0,M.jsx)(w,{className:j.PlayPauseIcon}):(0,M.jsx)(C,{className:j.PlayPauseIcon}),input:`Space`,labelPosition:`left`,size:`auto`}),e[3]=t,e[4]=l);let u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=[`>`,`.`],e[5]=u):u=e[5];let d;e[6]===a?d=e[7]:(d=(0,M.jsx)(P,{action:`increasePlaybackSpeed`,input:u,label:`Speed up`,labelPosition:`left`,disabled:a}),e[6]=a,e[7]=d);let f;e[8]!==c||e[9]!==l||e[10]!==d?(f=(0,M.jsx)(`div`,{className:j.Column,children:(0,M.jsxs)(`div`,{className:j.Row,children:[c,l,d]})}),e[8]=c,e[9]=l,e[10]=d,e[11]=f):f=e[11];let m;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,M.jsx)(`div`,{className:j.Column,children:(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(I,{})})}),e[12]=m):m=e[12];let _;return e[13]===f?_=e[14]:(_=(0,M.jsxs)(M.Fragment,{children:[f,m]}),e[13]=f,e[14]=_),_}function q(){let e=(0,T.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(`div`,{className:j.Column,children:(0,M.jsxs)(`div`,{className:j.Row,children:[(0,M.jsx)(P,{action:`nextStop`,label:`Skip to next stop`,input:(0,M.jsx)(v,{className:j.MouseIcon}),labelPosition:`right`}),(0,M.jsx)(P,{action:`exitTour`,label:`Exit tour`,input:`Esc`,labelPosition:`right`})]})})}),e[0]=t):t=e[0],t}function J(){let e=(0,T.c)(23),t=b(),n=k(),r;e[0]===t?r=e[1]:(r=t===`fly`?(0,M.jsx)(L,{}):null,e[0]=t,e[1]=r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(R,{}),e[2]=i):i=e[2];let a;e[3]===t?a=e[4]:(a=t===`fly`?(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(z,{})}):null,e[3]=t,e[4]=a);let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(I,{})}),e[5]=o):o=e[5];let s;e[6]===a?s=e[7]:(s=(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[a,o]}),e[6]=a,e[7]=s);let c;e[8]===n?c=e[9]:(c=n?null:(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(V,{})}),e[8]=n,e[9]=c);let l;e[10]!==t||e[11]!==n?(l=t===`follow`&&n?(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`nextPlayer`,label:`Next player`,input:(0,M.jsx)(v,{className:j.MouseIcon}),labelPosition:`right`,inputSize:`auto`})}):null,e[10]=t,e[11]=n,e[12]=l):l=e[12];let u=t===`follow`?`Fly mode`:`Follow mode`,d;e[13]===u?d=e[14]:(d=(0,M.jsx)(`div`,{className:j.Row,children:(0,M.jsx)(P,{action:`toggleObserverMode`,label:u,input:`Space`,labelPosition:`right`,inputSize:`auto`})}),e[13]=u,e[14]=d);let f;e[15]!==c||e[16]!==l||e[17]!==d?(f=(0,M.jsxs)(`div`,{className:j.Column,"data-height":`compact`,children:[c,l,d]}),e[15]=c,e[16]=l,e[17]=d,e[18]=f):f=e[18];let p;return e[19]!==r||e[20]!==s||e[21]!==f?(p=(0,M.jsxs)(M.Fragment,{children:[r,i,s,f]}),e[19]=r,e[20]=s,e[21]=f,e[22]=p):p=e[22],p}function Y(){let e=(0,T.c)(13),t=s(),n=b(),r=a(X),i=t?.source===`demo`,o=t?.source===`live`,c=!t,l=o&&(n===`fly`||n===`follow`),u=c&&!r,d;e[0]===u?d=e[1]:(d=u&&(0,M.jsx)(G,{}),e[0]=u,e[1]=d);let f;e[2]===l?f=e[3]:(f=l&&(0,M.jsx)(J,{}),e[2]=l,e[3]=f);let p;e[4]===i?p=e[5]:(p=i&&(0,M.jsx)(K,{}),e[4]=i,e[5]=p);let m;e[6]===r?m=e[7]:(m=r&&(0,M.jsx)(q,{}),e[6]=r,e[7]=m);let h;return e[8]!==d||e[9]!==f||e[10]!==p||e[11]!==m?(h=(0,M.jsxs)(`div`,{className:j.Root,children:[d,f,p,m]}),e[8]=d,e[9]=f,e[10]=p,e[11]=m,e[12]=h):h=e[12],h}function X(e){return e.animation!==null}export{Y as KeyboardOverlay}; \ No newline at end of file diff --git a/docs/assets/MapInfoDialog-BlS8j0JO.js b/docs/assets/MapInfoDialog-C3Dk90R7.js similarity index 98% rename from docs/assets/MapInfoDialog-BlS8j0JO.js rename to docs/assets/MapInfoDialog-C3Dk90R7.js index 67132721..7a844527 100644 --- a/docs/assets/MapInfoDialog-BlS8j0JO.js +++ b/docs/assets/MapInfoDialog-C3Dk90R7.js @@ -1,4 +1,4 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{t as i}from"./useQuery-FY4YqwDi.js";import{c as a}from"./manifest-CirqV3Ls.js";import{U as o,W as s}from"./index-B1XI52_L.js";import{i as c,l,n as u}from"./loaders-CIpiZadQ.js";var d=t(),f=e(n(),1),p={GuiMarkup:`_GuiMarkup_jg4va_1`,Bullet:`_Bullet_jg4va_12`},m=r(),h=new Set([`spop`,`spush`,`lmargin`,`font`,`color`,`bitmap`,`a`,`/a`]);function g(e){return e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:`text`,value:e}:null;{let[t,...n]=e.split(`:`);return h.has(t.toLowerCase())?{type:`tag`,name:t,args:n}:{type:`text`,value:`<${e}>`}}}).filter(e=>e!=null)}function _(e){let[t,n]=e;return{fontDescription:t,fontSize:n?Math.max(11,Math.min(parseInt(n.trim(),10),16)):void 0}}function v(e){let t=g(e),n={type:`span`,source:`root`,style:{},children:[]},r=n,i=[r],a=e=>e.children!=null&&e.children.some(e=>typeof e==`string`||a(e));for(let e of t)switch(e.type){case`text`:r.children.push(e.value);break;case`tag`:switch(e.name){case`spush`:{let e={type:`span`,source:`spush`,style:{},children:[]};r.children.push(e),r=e,i.push(r);break}case`spop`:if(r.source!==`root`){let e=i.pop();for(;e.source!==`spush`;)e=i.pop();r=i[i.length-1]}break;case`lmargin`:break;case`font`:{let t=_(e.args).fontSize;if(!a(r))r.style.fontSize=t;else{let e={type:`span`,source:`spush`,style:{fontSize:t},children:[]};r.children.push(e),r=e,i.push(r)}break}case`color`:if(!a(r))r.style.color=`#${e.args[0].trim()}`;else{let t={type:`span`,source:`spush`,style:{color:`#${e.args[0].trim()}`},children:[]};r.children.push(t),r=t,i.push(r)}break;case`bitmap`:{let t={type:`bitmap`,value:e.args[0]};r.children.push(t);break}case`a`:{let t=e.args[0].trim().split(` `),n={type:`a`,source:`a`,value:`http://${t.length===2&&t[0]===`wwwlink`?t[1]:t[0]}`,style:{},children:[]};r.children.push(n),r=n,i.push(r);break}case`/a`:{let e=i.pop();for(;e.source!==`a`;)e=i.pop();r=i[i.length-1];break}}}return y(n)}function y(e){switch(e.type){case`span`:return f.createElement(`span`,{style:Object.keys(e.style).length===0?void 0:e.style},...e.children.map(e=>typeof e==`string`?e:y(e)));case`a`:return f.createElement(`a`,{href:e.value,style:Object.keys(e.style).length===0?void 0:e.style,rel:`noopener noreferrer`,target:`_blank`},...e.children.map(e=>typeof e==`string`?e:y(e)));case`bitmap`:return(0,m.jsx)(S,{name:e.value})}}var b=new Map;function x(e){if(b.has(e))return b.get(e);let t;try{t=c(a(`textures/gui/${e}`))}catch{t=null}return b.set(e,t),t}function S(e){let t=(0,d.c)(5),{name:n}=e,r;t[0]===n?r=t[1]:(r=x(n),t[0]=n,t[1]=r);let i=r;if(i){let e;return t[2]===i?e=t[3]:(e=(0,m.jsx)(`img`,{src:i,alt:``,className:p.Bitmap}),t[2]=i,t[3]=e),e}if(/bullet/i.test(n)){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`span`,{className:p.Bullet,children:`•`}),t[4]=e):e=t[4],e}return null}var C=/<(?:font|color|bitmap|just|lmargin|a):/i;function w(e){return C.test(e)}function T(e,t){let n=t.toUpperCase();return e.split(` +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{t as i}from"./useQuery-lKBLxuin.js";import{c as a}from"./manifest-CirqV3Ls.js";import{U as o,W as s}from"./index-DfaykQpF.js";import{i as c,l,n as u}from"./loaders-CIpiZadQ.js";var d=t(),f=e(n(),1),p={GuiMarkup:`_GuiMarkup_jg4va_1`,Bullet:`_Bullet_jg4va_12`},m=r(),h=new Set([`spop`,`spush`,`lmargin`,`font`,`color`,`bitmap`,`a`,`/a`]);function g(e){return e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:`text`,value:e}:null;{let[t,...n]=e.split(`:`);return h.has(t.toLowerCase())?{type:`tag`,name:t,args:n}:{type:`text`,value:`<${e}>`}}}).filter(e=>e!=null)}function _(e){let[t,n]=e;return{fontDescription:t,fontSize:n?Math.max(11,Math.min(parseInt(n.trim(),10),16)):void 0}}function v(e){let t=g(e),n={type:`span`,source:`root`,style:{},children:[]},r=n,i=[r],a=e=>e.children!=null&&e.children.some(e=>typeof e==`string`||a(e));for(let e of t)switch(e.type){case`text`:r.children.push(e.value);break;case`tag`:switch(e.name){case`spush`:{let e={type:`span`,source:`spush`,style:{},children:[]};r.children.push(e),r=e,i.push(r);break}case`spop`:if(r.source!==`root`){let e=i.pop();for(;e.source!==`spush`;)e=i.pop();r=i[i.length-1]}break;case`lmargin`:break;case`font`:{let t=_(e.args).fontSize;if(!a(r))r.style.fontSize=t;else{let e={type:`span`,source:`spush`,style:{fontSize:t},children:[]};r.children.push(e),r=e,i.push(r)}break}case`color`:if(!a(r))r.style.color=`#${e.args[0].trim()}`;else{let t={type:`span`,source:`spush`,style:{color:`#${e.args[0].trim()}`},children:[]};r.children.push(t),r=t,i.push(r)}break;case`bitmap`:{let t={type:`bitmap`,value:e.args[0]};r.children.push(t);break}case`a`:{let t=e.args[0].trim().split(` `),n={type:`a`,source:`a`,value:`http://${t.length===2&&t[0]===`wwwlink`?t[1]:t[0]}`,style:{},children:[]};r.children.push(n),r=n,i.push(r);break}case`/a`:{let e=i.pop();for(;e.source!==`a`;)e=i.pop();r=i[i.length-1];break}}}return y(n)}function y(e){switch(e.type){case`span`:return f.createElement(`span`,{style:Object.keys(e.style).length===0?void 0:e.style},...e.children.map(e=>typeof e==`string`?e:y(e)));case`a`:return f.createElement(`a`,{href:e.value,style:Object.keys(e.style).length===0?void 0:e.style,rel:`noopener noreferrer`,target:`_blank`},...e.children.map(e=>typeof e==`string`?e:y(e)));case`bitmap`:return(0,m.jsx)(S,{name:e.value})}}var b=new Map;function x(e){if(b.has(e))return b.get(e);let t;try{t=c(a(`textures/gui/${e}`))}catch{t=null}return b.set(e,t),t}function S(e){let t=(0,d.c)(5),{name:n}=e,r;t[0]===n?r=t[1]:(r=x(n),t[0]=n,t[1]=r);let i=r;if(i){let e;return t[2]===i?e=t[3]:(e=(0,m.jsx)(`img`,{src:i,alt:``,className:p.Bitmap}),t[2]=i,t[3]=e),e}if(/bullet/i.test(n)){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`span`,{className:p.Bullet,children:`•`}),t[4]=e):e=t[4],e}return null}var C=/<(?:font|color|bitmap|just|lmargin|a):/i;function w(e){return C.test(e)}function T(e,t){let n=t.toUpperCase();return e.split(` `).flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(n)?[]:[e.replace(/^\[[^\]]+\]/,``)]}).join(` `)}function E(e){let t=(0,d.c)(4),{markup:n}=e,r;t[0]===n?r=t[1]:(r=v(n),t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,m.jsx)(`div`,{className:p.GuiMarkup,children:i}),t[2]=i,t[3]=a),a}var D={Dialog:`_Dialog_tbn5d_1 _Dialog_1t9wa_1`,Overlay:`_Overlay_tbn5d_10 _Overlay_1t9wa_22`,Body:`_Body_tbn5d_14`,Left:`_Left_tbn5d_22`,PreviewImage:`_PreviewImage_tbn5d_29`,PreviewImageFloating:`_PreviewImageFloating_tbn5d_35`,Title:`_Title_tbn5d_45`,MapMeta:`_MapMeta_tbn5d_53`,MapPlanet:`_MapPlanet_tbn5d_63`,MapQuote:`_MapQuote_tbn5d_67`,MapBlurb:`_MapBlurb_tbn5d_86`,Section:`_Section_tbn5d_91`,SectionTitle:`_SectionTitle_tbn5d_95`,MusicTrack:`_MusicTrack_tbn5d_105`,MusicButton:`_MusicButton_tbn5d_119`,Footer:`_Footer_tbn5d_146`,CloseButton:`_CloseButton_tbn5d_158 _DialogButton_1t9wa_33`,Hint:`_Hint_tbn5d_162`,MusicTrackName:`_MusicTrackName_tbn5d_168`};function ee(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n={queryKey:[`parsedMission`,e],queryFn:()=>l(e)},t[0]=e,t[1]=n),i(n)}function te(e){for(let t of e.body){if(t.type!==`ObjectDeclaration`)continue;let{instanceName:e,body:n}=t;if(e&&e.type===`Identifier`&&e.name.toLowerCase()===`missiongroup`){let e={};for(let t of n){if(t.type!==`Assignment`)continue;let{target:n,value:r}=t;n.type===`Identifier`&&r.type===`StringLiteral`&&(e[n.name.toLowerCase()]=r.value)}return e}}return{}}function ne(e,t){if(e)try{return c(a(`textures/gui/${e}`))}catch{}try{return c(a(`textures/gui/Load_${t}`))}catch{}return null}function re(e){let t=(0,d.c)(7),{src:n,alt:r,className:i}=e,a=i===void 0?D.PreviewImage:i,[o,s]=(0,f.useState)(null),c,l;if(t[0]===n?(c=t[1],l=t[2]):(c=()=>{let e=!1,t;return fetch(n).then(j).then(A).then(k).then(n=>{e||!n||(t=URL.createObjectURL(n),s(t))}).catch(O),()=>{e=!0,t&&URL.revokeObjectURL(t)}},l=[n],t[0]=n,t[1]=c,t[2]=l),(0,f.useEffect)(c,l),!o)return null;let u;return t[3]!==r||t[4]!==a||t[5]!==o?(u=(0,m.jsx)(`img`,{src:o,alt:r,className:a}),t[3]=r,t[4]=a,t[5]=o,t[6]=u):u=t[6],u}function O(){}function k(e){return new Promise(t=>{let n=document.createElement(`canvas`);n.width=e.width,n.height=e.height,n.getContext(`2d`)?.drawImage(e,0,0),e.close(),n.toBlob(t)})}function A(e){return createImageBitmap(e,{colorSpaceConversion:`none`})}function j(e){return e.blob()}function ie(e){let t=(0,d.c)(22),{track:n}=e,[r,i]=(0,f.useState)(!1),[a,c]=(0,f.useState)(!0),l=(0,f.useRef)(null),p;t[0]===n?p=t[1]:(p=n.toLowerCase(),t[0]=n,t[1]=p);let h=`${u}music/${p}.mp3`,g,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=l.current;if(e)return()=>{e.pause()}},_=[],t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,f.useEffect)(g,_);let v;t[4]===r?v=t[5]:(v=()=>{let e=l.current;e&&(r?e.pause():e.play().catch(()=>c(!1)))},t[4]=r,t[5]=v);let y=v,b,x,S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>i(!0),x=()=>i(!1),S=()=>c(!1),t[6]=b,t[7]=x,t[8]=S):(b=t[6],x=t[7],S=t[8]);let C;t[9]===h?C=t[10]:(C=(0,m.jsx)(`audio`,{ref:l,src:h,loop:!0,onPlay:b,onPause:x,onError:S}),t[9]=h,t[10]=C);let w;t[11]===n?w=t[12]:(w=(0,m.jsx)(`span`,{className:D.MusicTrackName,children:n}),t[11]=n,t[12]=w);let T;t[13]!==a||t[14]!==r||t[15]!==y?(T=a&&(0,m.jsx)(`button`,{className:D.MusicButton,onClick:y,"aria-label":r?`Pause music`:`Play music`,children:r?(0,m.jsx)(s,{}):(0,m.jsx)(o,{})}),t[13]=a,t[14]=r,t[15]=y,t[16]=T):T=t[16];let E;return t[17]!==r||t[18]!==T||t[19]!==C||t[20]!==w?(E=(0,m.jsxs)(`div`,{className:D.MusicTrack,"data-playing":r,children:[C,w,T]}),t[17]=r,t[18]=T,t[19]=C,t[20]=w,t[21]=E):E=t[21],E}function M(e){let t=(0,d.c)(100),{onClose:n,missionName:r,missionType:i}=e,{data:a}=ee(r),o=(0,f.useRef)(null),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o.current?.focus();try{document.exitPointerLock()}catch{}},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),(0,f.useEffect)(s,c);let l,u;t[2]===n?(l=t[3],u=t[4]):(l=()=>{let e=e=>{if(e.key===`Escape`)n();else if(e.key===`k`&&(e.metaKey||e.ctrlKey)){n();return}e.stopImmediatePropagation()},t=se;return window.addEventListener(`keydown`,e,{capture:!0}),window.addEventListener(`keyup`,t,{capture:!0}),()=>{window.removeEventListener(`keydown`,e,{capture:!0}),window.removeEventListener(`keyup`,t,{capture:!0})}},u=[n],t[2]=n,t[3]=l,t[4]=u),(0,f.useEffect)(l,u);let p;t[5]===a?p=t[6]:(p=a?te(a.ast):{},t[5]=a,t[6]=p);let h=p,g;t[7]!==r||t[8]!==a?(g=a?ne(a.bitmap,r):null,t[7]=r,t[8]=a,t[9]=g):g=t[9];let _=g,v=a?.displayName??r,y;t[10]===i?y=t[11]:(y=i.toLowerCase(),t[10]=i,t[11]=y);let b=y===`singleplayer`,x=h.musictrack,S,C,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U;if(t[12]!==_||t[13]!==v||t[14]!==b||t[15]!==i||t[16]!==n||t[17]!==a){let e=a?.missionString?T(a.missionString,i):null,r,s,c,l;if(t[36]!==a?.missionQuote){if(l=a?.missionQuote?.trim()??``,s=w(l),c=``,r=``,!s)for(let e of l.split(` `)){let t=e.trim();t.match(/^--[^-]/)?r=t.replace(/^-+\s*/,``).trim():t&&(c+=(c?` diff --git a/docs/assets/Mission-Coy6f_9U.js b/docs/assets/Mission-nILJLxCJ.js similarity index 98% rename from docs/assets/Mission-Coy6f_9U.js rename to docs/assets/Mission-nILJLxCJ.js index fdd0a206..10f88b68 100644 --- a/docs/assets/Mission-Coy6f_9U.js +++ b/docs/assets/Mission-nILJLxCJ.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{t as i}from"./useQuery-FY4YqwDi.js";import{a,i as o,o as s,s as c}from"./manifest-CirqV3Ls.js";import{t as l}from"./logger-z_EpIdIa.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./misToScene-DdnDTJru.js";import{c as g,l as _,n as v,o as y,r as b,s as x,t as S}from"./mission-Bem2ztlS.js";import{r as C}from"./engineStore-Dkm20jvr.js";import{j as w}from"./index-B1XI52_L.js";import{i as T,l as E}from"./loaders-CIpiZadQ.js";var D=e(_(),1),O=t(),k=l(`scriptLoader`);function A(){return async e=>{let t;try{t=T(e)}catch(t){return k.warn(`Script not in manifest: %s (%s)`,e,t),null}try{let n=await fetch(t);return n.ok?await n.text():(k.error(`Script fetch failed: %s (%d)`,e,n.status),null)}catch(t){return k.error(`Script fetch error: %s %o`,e,t),null}}}var j=e(n(),1),M=r(),N=(0,j.createContext)(null);function P(e){let t=(0,O.c)(3),{runtime:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,M.jsx)(N.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}var F=(0,j.createContext)(null).Provider,I=[`scripts/admin.cs`,`scripts/ai.cs`,`scripts/aiBotProfiles.cs`,`scripts/aiBountyGame.cs`,`scripts/aiChat.cs`,`scripts/aiCnH.cs`,`scripts/aiCTF.cs`,`scripts/aiDeathMatch.cs`,`scripts/aiDebug.cs`,`scripts/aiDefaultTasks.cs`,`scripts/aiDnD.cs`,`scripts/aiHumanTasks.cs`,`scripts/aiHunters.cs`,`scripts/aiInventory.cs`,`scripts/aiObjectiveBuilder.cs`,`scripts/aiObjectives.cs`,`scripts/aiRabbit.cs`,`scripts/aiSiege.cs`,`scripts/aiTDM.cs`,`scripts/aiTeamHunters.cs`,`scripts/deathMessages.cs`,`scripts/graphBuild.cs`,`scripts/navGraph.cs`,`scripts/serverTasks.cs`,`scripts/spdialog.cs`];function L(e,t){if(t)return e.state.datablocks.get(t)}function R(e){if(typeof e==`string`){let t=e.toLowerCase();return t!==`0`&&t!==`false`&&t!==``}return!!e}function z(e){let t=e.split(` `).map(e=>parseFloat(e));return[t[0]??0,t[1]??0,t[2]??0]}function B(e){let[t,n,r,i]=e.split(` `).map(parseFloat),a=-(i||0)*Math.PI/360,o=Math.sin(a),s=Math.cos(a),c=Math.sqrt((n||0)*(n||0)+(r||0)*(r||0)+(t||0)*(t||0));return c<1e-8?[0,0,0,1]:[(n||0)/c*o,(r||0)/c*o,(t||0)/c*o,s]}function V(e,t,n){let r=e._className,i=`mission_${e._id}`,a=S(e),o=b(e),s=B(e.rotation??`1 0 0 0`),c=v(e,`dataBlock`)??``,l=L(t,c),g={id:i,className:r,runtimeObject:e,missionTypesList:v(e,`missionTypesList`)},_={...g,position:a,rotation:s,scale:o};switch(r){case`TerrainBlock`:return{...g,renderType:`TerrainBlock`,terrainData:u(e)};case`InteriorInstance`:return{...g,renderType:`InteriorInstance`,interiorData:h(e)};case`Sky`:return{...g,renderType:`Sky`,skyData:m(e)};case`Sun`:return{...g,renderType:`Sun`,sunData:d(e)};case`WaterBlock`:return{...g,renderType:`WaterBlock`,waterData:p(e)};case`MissionArea`:return{...g,renderType:`MissionArea`,missionAreaData:f(e)};case`StaticShape`:case`Item`:case`Turret`:case`TSStatic`:{let i=v(e,`team`);return H(_,e,l,t,r,i!=null&&i!==``?parseInt(i,10):n,c)}case`ForceFieldBare`:return U(_,e,l,o);case`AudioEmitter`:return{..._,renderType:`AudioEmitter`,audioFileName:v(e,`fileName`)??void 0,audioVolume:parseFloat(v(e,`volume`))||1,audioIs3D:(v(e,`is3D`)??`0`)!==`0`,audioIsLooping:(v(e,`isLooping`)??`0`)!==`0`,audioMinDistance:parseFloat(v(e,`minDistance`))||1,audioMaxDistance:parseFloat(v(e,`maxDistance`))||1,audioMinLoopGap:parseFloat(v(e,`minLoopGap`))||0,audioMaxLoopGap:parseFloat(v(e,`maxLoopGap`))||0};case`Camera`:return{..._,renderType:`Camera`,cameraDataBlock:c||void 0};case`WayPoint`:return{..._,renderType:`WayPoint`,label:v(e,`name`)||void 0};default:return null}}function H(e,t,n,r,i,a,o){let s=i===`TSStatic`?v(t,`shapeName`):v(n,`shapeFile`),c=i===`Turret`?`Turret`:i===`Item`?`Item`:i===`TSStatic`?`TSStatic`:`StaticShape`,l={...e,renderType:`Shape`,shapeName:s,shapeType:c,dataBlock:o||void 0,teamId:a};if(i===`Item`&&(l.rotate=R(v(t,`rotate`)??v(n,`rotate`))),i===`Turret`){let e=v(t,`initialBarrel`);e&&(l.barrelShapeName=v(L(r,e),`shapeFile`))}return l}function U(e,t,n,r){let i=v(n,`color`),a=i?z(i):[1,1,1],o=parseFloat(v(n,`baseTranslucency`))||1,s=parseInt(v(n,`numFrames`),10)||1,c=parseFloat(v(n,`framesPerSec`))||1,l=parseFloat(v(n,`scrollSpeed`))||0,u=parseFloat(v(n,`umapping`))||1,d=parseFloat(v(n,`vmapping`))||1,f=[];for(let e=0;e{let t=(0,D.default)(e,{nocase:!0});return a().filter(e=>t(e)).map(e=>{let[,t]=c(e);return t})},isFile:e=>s()[o(e)]!=null};function X(e){let t=(0,O.c)(2),n;return t[0]===e?n=t[1]:(n={queryKey:[`parsedMission`,e],queryFn:()=>E(e)},t[0]=e,t[1]=n),i(n)}function Z(e,t,n){let r=(0,O.c)(6),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={ready:!1,runtime:void 0,progress:0},r[0]=i):i=r[0];let[a,o]=(0,j.useState)(i),s,c;return r[1]!==e||r[2]!==t||r[3]!==n?(s=()=>{if(!n)return;let r=new AbortController,i=!1,a=null,s=x(),c=()=>{o(e=>({...e,progress:s.progress}))};s.on(`update`,c);let{runtime:l,ready:u}=y({missionName:e,missionType:t,runtimeOptions:{loadScript:q,fileSystem:Y,cache:J,signal:r.signal,progress:s,ignoreScripts:I}});return u.then(()=>{if(i||r.signal.aborted)return;C.getState().setRuntime(l);let n=l.getObjectByName(`MissionGroup`);if(n){let r=G(n,l,t);w.getState().setAllEntities(r),w.getState().setMissionInfo({missionName:e,missionType:t??void 0})}o({ready:!0,runtime:l,progress:1})}).catch($),a=l.subscribeRuntimeEvents(Q),C.getState().setRuntime(l),()=>{i=!0,s.off(`update`,c),r.abort(),a?.(),C.getState().clearRuntime(),w.getState().clearEntities(),l.destroy()}},c=[e,t,n],r[1]=e,r[2]=t,r[3]=n,r[4]=s,r[5]=c):(s=r[4],c=r[5]),(0,j.useEffect)(s,c),a}function Q(e){e.type===`batch.flushed`&&C.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function $(e){e instanceof Error&&e.name===`AbortError`||K.error(`Mission runtime failed to become ready: %o`,e)}var ee=(0,j.memo)(function(e){let t=(0,O.c)(13),{name:n,missionType:r,onLoadingChange:i}=e,{data:a}=X(n),{ready:o,runtime:s,progress:c}=Z(n,r,a),l=!a||!o||!s,u;t[0]!==r||t[1]!==a?(u={metadata:a,missionType:r},t[0]=r,t[1]=a,t[2]=u):u=t[2];let d=u,f,p;if(t[3]!==l||t[4]!==i||t[5]!==c?(f=()=>{i?.(l,c)},p=[l,c,i],t[3]=l,t[4]=i,t[5]=c,t[6]=f,t[7]=p):(f=t[6],p=t[7]),(0,j.useEffect)(f,p),l)return null;let m;t[8]===s?m=t[9]:(m=(0,M.jsx)(P,{runtime:s}),t[8]=s,t[9]=m);let h;return t[10]!==d||t[11]!==m?(h=(0,M.jsx)(F,{value:d,children:m}),t[10]=d,t[11]=m,t[12]=h):h=t[12],h});export{ee as Mission}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{t as i}from"./useQuery-lKBLxuin.js";import{a,i as o,o as s,s as c}from"./manifest-CirqV3Ls.js";import{t as l}from"./logger-z_EpIdIa.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./misToScene-DdnDTJru.js";import{c as g,l as _,n as v,o as y,r as b,s as x,t as S}from"./mission-Bem2ztlS.js";import{r as C}from"./engineStore-Dkm20jvr.js";import{j as w}from"./index-DfaykQpF.js";import{i as T,l as E}from"./loaders-CIpiZadQ.js";var D=e(_(),1),O=t(),k=l(`scriptLoader`);function A(){return async e=>{let t;try{t=T(e)}catch(t){return k.warn(`Script not in manifest: %s (%s)`,e,t),null}try{let n=await fetch(t);return n.ok?await n.text():(k.error(`Script fetch failed: %s (%d)`,e,n.status),null)}catch(t){return k.error(`Script fetch error: %s %o`,e,t),null}}}var j=e(n(),1),M=r(),N=(0,j.createContext)(null);function P(e){let t=(0,O.c)(3),{runtime:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,M.jsx)(N.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}var F=(0,j.createContext)(null).Provider,I=[`scripts/admin.cs`,`scripts/ai.cs`,`scripts/aiBotProfiles.cs`,`scripts/aiBountyGame.cs`,`scripts/aiChat.cs`,`scripts/aiCnH.cs`,`scripts/aiCTF.cs`,`scripts/aiDeathMatch.cs`,`scripts/aiDebug.cs`,`scripts/aiDefaultTasks.cs`,`scripts/aiDnD.cs`,`scripts/aiHumanTasks.cs`,`scripts/aiHunters.cs`,`scripts/aiInventory.cs`,`scripts/aiObjectiveBuilder.cs`,`scripts/aiObjectives.cs`,`scripts/aiRabbit.cs`,`scripts/aiSiege.cs`,`scripts/aiTDM.cs`,`scripts/aiTeamHunters.cs`,`scripts/deathMessages.cs`,`scripts/graphBuild.cs`,`scripts/navGraph.cs`,`scripts/serverTasks.cs`,`scripts/spdialog.cs`];function L(e,t){if(t)return e.state.datablocks.get(t)}function R(e){if(typeof e==`string`){let t=e.toLowerCase();return t!==`0`&&t!==`false`&&t!==``}return!!e}function z(e){let t=e.split(` `).map(e=>parseFloat(e));return[t[0]??0,t[1]??0,t[2]??0]}function B(e){let[t,n,r,i]=e.split(` `).map(parseFloat),a=-(i||0)*Math.PI/360,o=Math.sin(a),s=Math.cos(a),c=Math.sqrt((n||0)*(n||0)+(r||0)*(r||0)+(t||0)*(t||0));return c<1e-8?[0,0,0,1]:[(n||0)/c*o,(r||0)/c*o,(t||0)/c*o,s]}function V(e,t,n){let r=e._className,i=`mission_${e._id}`,a=S(e),o=b(e),s=B(e.rotation??`1 0 0 0`),c=v(e,`dataBlock`)??``,l=L(t,c),g={id:i,className:r,runtimeObject:e,missionTypesList:v(e,`missionTypesList`)},_={...g,position:a,rotation:s,scale:o};switch(r){case`TerrainBlock`:return{...g,renderType:`TerrainBlock`,terrainData:u(e)};case`InteriorInstance`:return{...g,renderType:`InteriorInstance`,interiorData:h(e)};case`Sky`:return{...g,renderType:`Sky`,skyData:m(e)};case`Sun`:return{...g,renderType:`Sun`,sunData:d(e)};case`WaterBlock`:return{...g,renderType:`WaterBlock`,waterData:p(e)};case`MissionArea`:return{...g,renderType:`MissionArea`,missionAreaData:f(e)};case`StaticShape`:case`Item`:case`Turret`:case`TSStatic`:{let i=v(e,`team`);return H(_,e,l,t,r,i!=null&&i!==``?parseInt(i,10):n,c)}case`ForceFieldBare`:return U(_,e,l,o);case`AudioEmitter`:return{..._,renderType:`AudioEmitter`,audioFileName:v(e,`fileName`)??void 0,audioVolume:parseFloat(v(e,`volume`))||1,audioIs3D:(v(e,`is3D`)??`0`)!==`0`,audioIsLooping:(v(e,`isLooping`)??`0`)!==`0`,audioMinDistance:parseFloat(v(e,`minDistance`))||1,audioMaxDistance:parseFloat(v(e,`maxDistance`))||1,audioMinLoopGap:parseFloat(v(e,`minLoopGap`))||0,audioMaxLoopGap:parseFloat(v(e,`maxLoopGap`))||0};case`Camera`:return{..._,renderType:`Camera`,cameraDataBlock:c||void 0};case`WayPoint`:return{..._,renderType:`WayPoint`,label:v(e,`name`)||void 0};default:return null}}function H(e,t,n,r,i,a,o){let s=i===`TSStatic`?v(t,`shapeName`):v(n,`shapeFile`),c=i===`Turret`?`Turret`:i===`Item`?`Item`:i===`TSStatic`?`TSStatic`:`StaticShape`,l={...e,renderType:`Shape`,shapeName:s,shapeType:c,dataBlock:o||void 0,teamId:a};if(i===`Item`&&(l.rotate=R(v(t,`rotate`)??v(n,`rotate`))),i===`Turret`){let e=v(t,`initialBarrel`);e&&(l.barrelShapeName=v(L(r,e),`shapeFile`))}return l}function U(e,t,n,r){let i=v(n,`color`),a=i?z(i):[1,1,1],o=parseFloat(v(n,`baseTranslucency`))||1,s=parseInt(v(n,`numFrames`),10)||1,c=parseFloat(v(n,`framesPerSec`))||1,l=parseFloat(v(n,`scrollSpeed`))||0,u=parseFloat(v(n,`umapping`))||1,d=parseFloat(v(n,`vmapping`))||1,f=[];for(let e=0;e{let t=(0,D.default)(e,{nocase:!0});return a().filter(e=>t(e)).map(e=>{let[,t]=c(e);return t})},isFile:e=>s()[o(e)]!=null};function X(e){let t=(0,O.c)(2),n;return t[0]===e?n=t[1]:(n={queryKey:[`parsedMission`,e],queryFn:()=>E(e)},t[0]=e,t[1]=n),i(n)}function Z(e,t,n){let r=(0,O.c)(6),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={ready:!1,runtime:void 0,progress:0},r[0]=i):i=r[0];let[a,o]=(0,j.useState)(i),s,c;return r[1]!==e||r[2]!==t||r[3]!==n?(s=()=>{if(!n)return;let r=new AbortController,i=!1,a=null,s=x(),c=()=>{o(e=>({...e,progress:s.progress}))};s.on(`update`,c);let{runtime:l,ready:u}=y({missionName:e,missionType:t,runtimeOptions:{loadScript:q,fileSystem:Y,cache:J,signal:r.signal,progress:s,ignoreScripts:I}});return u.then(()=>{if(i||r.signal.aborted)return;C.getState().setRuntime(l);let n=l.getObjectByName(`MissionGroup`);if(n){let r=G(n,l,t);w.getState().setAllEntities(r),w.getState().setMissionInfo({missionName:e,missionType:t??void 0})}o({ready:!0,runtime:l,progress:1})}).catch($),a=l.subscribeRuntimeEvents(Q),C.getState().setRuntime(l),()=>{i=!0,s.off(`update`,c),r.abort(),a?.(),C.getState().clearRuntime(),w.getState().clearEntities(),l.destroy()}},c=[e,t,n],r[1]=e,r[2]=t,r[3]=n,r[4]=s,r[5]=c):(s=r[4],c=r[5]),(0,j.useEffect)(s,c),a}function Q(e){e.type===`batch.flushed`&&C.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function $(e){e instanceof Error&&e.name===`AbortError`||K.error(`Mission runtime failed to become ready: %o`,e)}var ee=(0,j.memo)(function(e){let t=(0,O.c)(13),{name:n,missionType:r,onLoadingChange:i}=e,{data:a}=X(n),{ready:o,runtime:s,progress:c}=Z(n,r,a),l=!a||!o||!s,u;t[0]!==r||t[1]!==a?(u={metadata:a,missionType:r},t[0]=r,t[1]=a,t[2]=u):u=t[2];let d=u,f,p;if(t[3]!==l||t[4]!==i||t[5]!==c?(f=()=>{i?.(l,c)},p=[l,c,i],t[3]=l,t[4]=i,t[5]=c,t[6]=f,t[7]=p):(f=t[6],p=t[7]),(0,j.useEffect)(f,p),l)return null;let m;t[8]===s?m=t[9]:(m=(0,M.jsx)(P,{runtime:s}),t[8]=s,t[9]=m);let h;return t[10]!==d||t[11]!==m?(h=(0,M.jsx)(F,{value:d,children:m}),t[10]=d,t[11]=m,t[12]=h):h=t[12],h});export{ee as Mission}; \ No newline at end of file diff --git a/docs/assets/PlayerHUD-ZLAOgfFu.js b/docs/assets/PlayerHUD-IFZkOeCb.js similarity index 98% rename from docs/assets/PlayerHUD-ZLAOgfFu.js rename to docs/assets/PlayerHUD-IFZkOeCb.js index f45f7943..aebbcca5 100644 --- a/docs/assets/PlayerHUD-ZLAOgfFu.js +++ b/docs/assets/PlayerHUD-IFZkOeCb.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatInput-B9JdqF5v.js","assets/chunk-DECur_0Z.js","assets/index-B1XI52_L.js","assets/preload-helper-CwUjIIrH.js","assets/mission-Bem2ztlS.js","assets/logger-z_EpIdIa.js","assets/react-three-fiber.esm-CgPHUpXo.js","assets/jsx-runtime-BpGWiA-R.js","assets/three.module-07hRbor4.js","assets/traditional-BTL5qX2E.js","assets/streamHelpers-D2N8suZp.js","assets/SettingsProvider-CCHVZuSg.js","assets/manifest-CirqV3Ls.js","assets/stringUtils-EmGsjr9D.js","assets/iconBase-BCRUFbxq.js","assets/middleware-DPacZrFu.js","assets/JoystickContext-YJ6eVLFP.js","assets/scene-BdOVRsxo.js","assets/cameraTourStore-PEzPVGnX.js","assets/engineStore-Dkm20jvr.js","assets/index-DvT5LFSb.css","assets/ChatInput-bC9wt42K.css"])))=>i.map(i=>d[i]); -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{t as i}from"./stringUtils-EmGsjr9D.js";import{i as a}from"./engineStore-Dkm20jvr.js";import{t as o}from"./preload-helper-CwUjIIrH.js";import{p as s}from"./loaders-CIpiZadQ.js";import{n as c}from"./streamPlaybackStore-DhJekvnx.js";var l=e(n(),1),u=e=>e;function d(e,t=u){let n=l.useSyncExternalStore(e.subscribe,l.useCallback(()=>t(e.getState()),[e,t]),l.useCallback(()=>t(e.getInitialState()),[e,t]));return l.useDebugValue(n),n}var f=t(),p={PlayerHUD:`_PlayerHUD_13ssv_1`,Compass:`_Compass_13ssv_11`,CompassRing:`_CompassRing_13ssv_20`,CompassNSEW:`_CompassNSEW_13ssv_29`,CompassClock:`_CompassClock_13ssv_38`,Bars:`_Bars_13ssv_51`,BarTrack:`_BarTrack_13ssv_63`,BarFillHealth:`_BarFillHealth_13ssv_71`,BarFillEnergy:`_BarFillEnergy_13ssv_77`,WeaponHUD:`_WeaponHUD_13ssv_85`,PackInvItem:`_PackInvItem_13ssv_95`,WeaponSeparator:`_WeaponSeparator_13ssv_105`,TeamScores:`_TeamScores_13ssv_111`,ObserverCount:`_ObserverCount_13ssv_126`,TeamRow:`_TeamRow_13ssv_136`,TeamName:`_TeamName_13ssv_145`,TeamNameFriendly:`_TeamNameFriendly_13ssv_152 _TeamName_13ssv_145`,TeamNameEnemy:`_TeamNameEnemy_13ssv_157 _TeamName_13ssv_145`,TeamScore:`_TeamScore_13ssv_111`,TeamCount:`_TeamCount_13ssv_170`,PackInventoryHUD:`_PackInventoryHUD_13ssv_179`,PackInvIcon:`_PackInvIcon_13ssv_210`,PackInvCount:`_PackInvCount_13ssv_215`,PackInvInfinity:`_PackInvInfinity_13ssv_222`,Reticle:`_Reticle_13ssv_230`,ReticleImage:`_ReticleImage_13ssv_237`,ReticleDot:`_ReticleDot_13ssv_242`},m={ChatContainer:`_ChatContainer_qc3qt_1`,ChatWindow:`_ChatWindow_qc3qt_14`,ChatMessage:`_ChatMessage_qc3qt_39`,ChatColor0:`_ChatColor0_qc3qt_46`,ChatColor1:`_ChatColor1_qc3qt_49`,ChatColor2:`_ChatColor2_qc3qt_52`,ChatColor3:`_ChatColor3_qc3qt_55`,ChatColor4:`_ChatColor4_qc3qt_58`,ChatColor5:`_ChatColor5_qc3qt_61`,ChatColor6:`_ChatColor6_qc3qt_64`,ChatColor7:`_ChatColor7_qc3qt_67`,ChatColor8:`_ChatColor8_qc3qt_70`,ChatColor9:`_ChatColor9_qc3qt_73`},h=r(),g=(0,l.lazy)(()=>o(()=>import(`./ChatInput-B9JdqF5v.js`).then(e=>({default:e.ChatInput})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),_=[],v={0:m.ChatColor0,1:m.ChatColor1,2:m.ChatColor2,3:m.ChatColor3,4:m.ChatColor4,5:m.ChatColor5,6:m.ChatColor6,7:m.ChatColor7,8:m.ChatColor8,9:m.ChatColor9};function ee(e){return v[e]??v[0]}function te(e){return e.colorCode!=null&&v[e.colorCode]?v[e.colorCode]:v[0]}var y=(0,l.memo)(function(){let e=(0,f.c)(12),t=a(b),n=a(x),r=(0,l.useRef)(null),i=n[n.length-1]?.id,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},e[0]=o):o=e[0];let s;e[1]===i?s=e[2]:(s=[i],e[1]=i,e[2]=s),(0,l.useEffect)(o,s);let c;e[3]===n?c=e[4]:(c=n.map(C),e[3]=n,e[4]=c);let u;e[5]===c?u=e[6]:(u=(0,h.jsx)(`div`,{ref:r,className:m.ChatWindow,children:c}),e[5]=c,e[6]=u);let d;e[7]===t?d=e[8]:(d=t&&(0,h.jsx)(l.Suspense,{children:(0,h.jsx)(g,{})}),e[7]=t,e[8]=d);let p;return e[9]!==u||e[10]!==d?(p=(0,h.jsxs)(`div`,{className:m.ChatContainer,children:[u,d]}),e[9]=u,e[10]=d,e[11]=p):p=e[11],p});function b(e){return e.playback.recording?.source===`live`}function x(e){return e.playback.streamSnapshot?.chatMessages??_}function S(e,t){return(0,h.jsx)(`span`,{className:ee(e.colorCode),children:e.text},t)}function C(e){return(0,h.jsx)(`div`,{className:m.ChatMessage,hidden:!e.text,children:e.segments?e.segments.map(S):(0,h.jsxs)(`span`,{className:te(e),children:[e.sender?`${e.sender}: `:``,e.text]})},e.id)}var w=s(`gui/hud_new_compass`),T=s(`gui/hud_new_NSEW`);function E(e){let t=Math.abs(e)/1e3,n=e<0?Math.ceil(t):Math.floor(t),r=Math.floor(n/60),i=n%60;return`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`}function D(){let e=(0,f.c)(8),t=a(k),n=a(O);if(t==null)return null;let r=t*180/Math.PI,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,h.jsx)(`img`,{src:w,alt:``,className:p.CompassRing}),e[0]=i):i=e[0];let o=`rotate(${-r}deg)`,s;e[1]===o?s=e[2]:(s=(0,h.jsx)(`img`,{src:T,alt:``,className:p.CompassNSEW,style:{transform:o}}),e[1]=o,e[2]=s);let c;e[3]===n?c=e[4]:(c=n!=null&&(0,h.jsx)(`span`,{className:p.CompassClock,children:E(n)}),e[3]=n,e[4]=c);let l;return e[5]!==s||e[6]!==c?(l=(0,h.jsxs)(`div`,{className:p.Compass,children:[i,s,c]}),e[5]=s,e[6]=c,e[7]=l):l=e[7],l}function O(e){return e.playback.streamSnapshot?.matchClockMs}function k(e){return e.playback.streamSnapshot?.camera?.yaw}function A(){let e=(0,f.c)(2),t=a(j);if(t==null)return null;let n=`${Math.max(0,Math.min(100,t*100))}%`,r;return e[0]===n?r=e[1]:(r=(0,h.jsx)(`div`,{className:p.BarTrack,children:(0,h.jsx)(`div`,{className:p.BarFillHealth,style:{width:n}})}),e[0]=n,e[1]=r),r}function j(e){return e.playback.streamSnapshot?.status?.health}function M(){let e=(0,f.c)(2),t=a(N);if(t==null)return null;let n=`${Math.max(0,Math.min(100,t*100))}%`,r;return e[0]===n?r=e[1]:(r=(0,h.jsx)(`div`,{className:p.BarTrack,children:(0,h.jsx)(`div`,{className:p.BarFillEnergy,style:{width:n}})}),e[0]=n,e[1]=r),r}function N(e){return e.playback.streamSnapshot?.status?.energy}var P={weapon_energy:`gui/ret_blaster`,weapon_plasma:`gui/ret_plasma`,weapon_chaingun:`gui/ret_chaingun`,weapon_disc:`gui/ret_disc`,weapon_grenade_launcher:`gui/ret_grenade`,weapon_sniper:`gui/hud_ret_sniper`,weapon_elf:`gui/ret_elf`,weapon_mortar:`gui/ret_mortor`,weapon_missile:`gui/ret_missile`,weapon_targeting:`gui/hud_ret_targlaser`,weapon_shocklance:`gui/hud_ret_shocklance`};function F(e){return e?e.replace(/\.dts$/i,``).toLowerCase():``}function I(){let e=(0,f.c)(5),t=a(L);if(t===void 0)return null;let n=P[F(t)];if(n){let t;e[0]===n?t=e[1]:(t=s(n),e[0]=n,e[1]=t);let r;return e[2]===t?r=e[3]:(r=(0,h.jsx)(`div`,{className:p.Reticle,children:(0,h.jsx)(`img`,{src:t,alt:``,className:p.ReticleImage})}),e[2]=t,e[3]=r),r}let r;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,h.jsx)(`div`,{className:p.Reticle,children:(0,h.jsx)(`div`,{className:p.ReticleDot})}),e[4]=r):r=e[4],r}function L(e){let t=e.playback.streamSnapshot;if(!t||t.camera?.mode!==`first-person`)return;let n=t.controlPlayerGhostId;if(n)return t.entities.find(e=>e.id===n)?.weaponShape}var R={0:{icon:`gui/hud_blaster`,label:`Blaster`},1:{icon:`gui/hud_plasma`,label:`Plasma`},2:{icon:`gui/hud_chaingun`,label:`Chaingun`},3:{icon:`gui/hud_disc`,label:`Spinfusor`},4:{icon:`gui/hud_grenlaunch`,label:`GL`},5:{icon:`gui/hud_sniper`,label:`Laser Rifle`},6:{icon:`gui/hud_elfgun`,label:`ELF Gun`},7:{icon:`gui/hud_new_mortar`,label:`Mortar`},8:{icon:`gui/hud_missiles`,label:`Missile`},9:{icon:`gui/hud_targetlaser`,label:`Targeting`},10:{icon:`gui/hud_shocklance`,label:`Shocklance`},11:{icon:`gui/hud_disc`,label:`Spinfusor`},12:{icon:`gui/hud_grenlaunch`,label:`GL`},13:{icon:`gui/hud_chaingun`,label:`Chaingun`},14:{icon:`gui/hud_targetlaser`,label:`Targeting`},15:{icon:`gui/hud_targetlaser`,label:`Targeting`},16:{icon:`gui/hud_shocklance`,label:`Shocklance`},17:{icon:`gui/hud_new_mortar`,label:`Mortar`}},ne=new Map(Object.entries(R).map(([e,t])=>[Number(e),s(t.icon)])),z=new Set([9,14,15]),B=s(`gui/hud_infinity`);function V(e){let t=(0,f.c)(12),{slot:n,isSelected:r}=e,i=R[n.index];if(!i)return null;let a=n.ammo<0,o;t[0]===n.index?o=t[1]:(o=ne.get(n.index),t[0]=n.index,t[1]=o);let s;t[2]!==i.label||t[3]!==o?(s=(0,h.jsx)(`img`,{src:o,alt:i.label,className:p.PackInvIcon}),t[2]=i.label,t[3]=o,t[4]=s):s=t[4];let c;t[5]!==a||t[6]!==n.ammo?(c=a?(0,h.jsx)(`img`,{src:B,alt:`\\u221E`,className:p.PackInvInfinity}):(0,h.jsx)(`span`,{className:p.PackInvCount,children:n.ammo}),t[5]=a,t[6]=n.ammo,t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,h.jsxs)(`div`,{className:p.PackInvItem,"data-active":r,children:[s,c]}),t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function H(){let e=(0,f.c)(15),t=a(U);if(!t||!t.slots.length)return null;let n,r;if(e[0]!==t.slots){r=[],n=[];for(let e of t.slots)z.has(e.index)?n.push(e):r.push(e);e[0]=t.slots,e[1]=n,e[2]=r}else n=e[1],r=e[2];let i;e[3]!==r||e[4]!==t?(i=r.map(e=>(0,h.jsx)(V,{slot:e,isSelected:e.index===t.activeIndex},e.index)),e[3]=r,e[4]=t,e[5]=i):i=e[5];let o;e[6]===n.length?o=e[7]:(o=n.length>0&&(0,h.jsx)(`div`,{className:p.WeaponSeparator}),e[6]=n.length,e[7]=o);let s;e[8]!==n||e[9]!==t?(s=n.map(e=>(0,h.jsx)(V,{slot:e,isSelected:e.index===t.activeIndex},e.index)),e[8]=n,e[9]=t,e[10]=s):s=e[10];let c;return e[11]!==i||e[12]!==o||e[13]!==s?(c=(0,h.jsxs)(`div`,{className:p.WeaponHUD,children:[i,o,s]}),e[11]=i,e[12]=o,e[13]=s,e[14]=c):c=e[14],c}function U(e){return e.playback.streamSnapshot?.weaponsHud}function W(){let e=(0,f.c)(18),t=a(J),n=a(q),r=a(G);if(!t?.length)return null;let o,s,c;if(e[0]!==r||e[1]!==n||e[2]!==t){let a;e[6]===n?a=e[7]:(a=(e,t)=>{if(n){if(e.teamId===n)return-1;if(t.teamId===n)return 1}return e.teamId-t.teamId},e[6]=n,e[7]=a);let l=[...t].sort(a);c=p.TeamScores,e[8]===r?o=e[9]:(o=r>0&&(0,h.jsx)(`tr`,{children:(0,h.jsxs)(`td`,{className:p.ObserverCount,colSpan:3,children:[r,` `,r===1?`observer`:`observers`]})}),e[8]=r,e[9]=o);let u;e[10]===n?u=e[11]:(u=e=>{let t=n!=null&&n>0&&e.teamId===n,r=e.name||(i[e.teamId]??`Team ${e.teamId}`);return(0,h.jsxs)(`tr`,{className:p.TeamRow,children:[(0,h.jsx)(`td`,{className:t?p.TeamNameFriendly:p.TeamNameEnemy,children:r}),(0,h.jsxs)(`td`,{className:p.TeamCount,children:[`(`,e.playerCount.toLocaleString(),`)`]}),(0,h.jsx)(`td`,{className:p.TeamScore,children:e.score.toLocaleString()})]},e.teamId)},e[10]=n,e[11]=u),s=l.map(u),e[0]=r,e[1]=n,e[2]=t,e[3]=o,e[4]=s,e[5]=c}else o=e[3],s=e[4],c=e[5];let l;e[12]!==o||e[13]!==s?(l=(0,h.jsxs)(`tbody`,{children:[o,s]}),e[12]=o,e[13]=s,e[14]=l):l=e[14];let u;return e[15]!==c||e[16]!==l?(u=(0,h.jsx)(`table`,{className:c,children:l}),e[15]=c,e[16]=l,e[17]=u):u=e[17],u}function G(e){return e.playback.streamSnapshot?.playerRoster?.filter(K).length??0}function K(e){return e.teamId<=0}function q(e){return e.playback.streamSnapshot?.playerSensorGroup}function J(e){return e.playback.streamSnapshot?.teamScores}var Y={0:`gui/hud_new_packammo`,1:`gui/hud_new_packcloak`,2:`gui/hud_new_packenergy`,3:`gui/hud_new_packrepair`,4:`gui/hud_new_packsatchel`,5:`gui/hud_new_packshield`,6:`gui/hud_new_packinventory`,7:`gui/hud_new_packmotionsens`,8:`gui/hud_new_packradar`,9:`gui/hud_new_packturretout`,10:`gui/hud_new_packturretin`,11:`gui/hud_new_packsensjam`,12:`gui/hud_new_packturret`,13:`gui/hud_new_packturret`,14:`gui/hud_new_packturret`,15:`gui/hud_new_packturret`,16:`gui/hud_new_packturret`,17:`gui/hud_new_packturret`,18:`gui/hud_satchel_unarmed`,19:`gui/hud_new_packenergy`},X={1:`gui/hud_new_packcloak_armed`,3:`gui/hud_new_packrepair_armed`,4:`gui/hud_satchel_armed`,5:`gui/hud_new_packshield_armed`,11:`gui/hud_new_packsensjam_armed`},Z=new Map(Object.entries(Y).map(([e,t])=>[Number(e),s(t)])),re=new Map(Object.entries(X).map(([e,t])=>[Number(e),s(t)])),Q={0:{icon:`gui/hud_handgren`,label:`Grenade`},1:{icon:`gui/hud_mine`,label:`Mine`},2:{icon:`gui/hud_beacon`,label:`Beacon`},3:{icon:`gui/hud_medpack`,label:`Repair Kit`}},ie=new Map(Object.entries(Q).map(([e,t])=>[Number(e),s(t.icon)]));function ae(){let e=(0,f.c)(25),t=a(ce),n=a(se),r=t&&t.packIndex>=0,i;if(r){let n;e[0]!==t.active||e[1]!==t.packIndex?(n=t.active?re.get(t.packIndex):void 0,e[0]=t.active,e[1]=t.packIndex,e[2]=n):n=e[2];let r=n,a;e[3]!==r||e[4]!==t.packIndex?(a=r??Z.get(t.packIndex),e[3]=r,e[4]=t.packIndex,e[5]=a):a=e[5],i=a}let o;if(e[6]!==n){if(o=new Map,n)for(let e of n.slots)o.set(e.slot,e.count);e[6]=n,e[7]=o}else o=e[7];let s,c,l,u;if(e[8]!==t||e[9]!==o||e[10]!==r||e[11]!==i){u=Symbol.for(`react.early_return_sentinel`);bb0:{let n=Object.keys(Q).map(Number).sort(oe);if(!r&&!o.size){u=null;break bb0}s=p.PackInventoryHUD,e[16]!==t||e[17]!==i?(c=i&&(0,h.jsxs)(`div`,{className:p.PackInvItem,"data-active":t.active??!1,children:[(0,h.jsx)(`img`,{src:i,alt:``,className:p.PackInvIcon}),(0,h.jsx)(`span`,{className:p.PackInvCount,children:t.text||`\xA0`})]}),e[16]=t,e[17]=i,e[18]=c):c=e[18];let a;e[19]===o?a=e[20]:(a=e=>{let t=Q[e],n=ie.get(e);return!t||!n?null:(0,h.jsxs)(`div`,{className:p.PackInvItem,children:[(0,h.jsx)(`img`,{src:n,alt:t.label,className:p.PackInvIcon}),(0,h.jsx)(`span`,{className:p.PackInvCount,children:o.get(e)??0})]},e)},e[19]=o,e[20]=a),l=n.map(a)}e[8]=t,e[9]=o,e[10]=r,e[11]=i,e[12]=s,e[13]=c,e[14]=l,e[15]=u}else s=e[12],c=e[13],l=e[14],u=e[15];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;return e[21]!==s||e[22]!==c||e[23]!==l?(d=(0,h.jsxs)(`div`,{className:s,children:[c,l]}),e[21]=s,e[22]=c,e[23]=l,e[24]=d):d=e[24],d}function oe(e,t){return e-t}function se(e){return e.playback.streamSnapshot?.inventoryHud}function ce(e){return e.playback.streamSnapshot?.backpackHud}function le(){let e=(0,f.c)(10),t=a(ue),n=d(c,$),r=t&&n!==`freeFly`,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,h.jsx)(y,{}),e[0]=i):i=e[0];let o;e[1]===r?o=e[2]:(o=r&&(0,h.jsxs)(`div`,{className:p.Bars,children:[(0,h.jsx)(A,{}),(0,h.jsx)(M,{})]}),e[1]=r,e[2]=o);let s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,h.jsx)(D,{}),e[3]=s):s=e[3];let l;e[4]===r?l=e[5]:(l=r&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(H,{}),(0,h.jsx)(ae,{}),(0,h.jsx)(I,{})]}),e[4]=r,e[5]=l);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,h.jsx)(W,{}),e[6]=u):u=e[6];let m;return e[7]!==o||e[8]!==l?(m=(0,h.jsxs)(`div`,{className:p.PlayerHUD,children:[i,o,s,l,u]}),e[7]=o,e[8]=l,e[9]=m):m=e[9],m}function $(e){return e.cameraMode}function ue(e){return!!e.playback.streamSnapshot?.controlPlayerGhostId}export{le as PlayerHUD}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatInput-BrDNmg1o.js","assets/chunk-DECur_0Z.js","assets/index-DfaykQpF.js","assets/preload-helper-CwUjIIrH.js","assets/mission-Bem2ztlS.js","assets/logger-z_EpIdIa.js","assets/react-three-fiber.esm-CgPHUpXo.js","assets/jsx-runtime-BpGWiA-R.js","assets/three.module-07hRbor4.js","assets/traditional-BTL5qX2E.js","assets/streamHelpers-D2N8suZp.js","assets/SettingsProvider-CCHVZuSg.js","assets/manifest-CirqV3Ls.js","assets/stringUtils-EmGsjr9D.js","assets/iconBase-BCRUFbxq.js","assets/middleware-DPacZrFu.js","assets/JoystickContext-YJ6eVLFP.js","assets/scene-BdOVRsxo.js","assets/cameraTourStore-PEzPVGnX.js","assets/engineStore-Dkm20jvr.js","assets/index-DPUMrbG6.css","assets/ChatInput-bC9wt42K.css"])))=>i.map(i=>d[i]); +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{t as i}from"./stringUtils-EmGsjr9D.js";import{i as a}from"./engineStore-Dkm20jvr.js";import{t as o}from"./preload-helper-CwUjIIrH.js";import{p as s}from"./loaders-CIpiZadQ.js";import{n as c}from"./streamPlaybackStore-DhJekvnx.js";var l=e(n(),1),u=e=>e;function d(e,t=u){let n=l.useSyncExternalStore(e.subscribe,l.useCallback(()=>t(e.getState()),[e,t]),l.useCallback(()=>t(e.getInitialState()),[e,t]));return l.useDebugValue(n),n}var f=t(),p={PlayerHUD:`_PlayerHUD_13ssv_1`,Compass:`_Compass_13ssv_11`,CompassRing:`_CompassRing_13ssv_20`,CompassNSEW:`_CompassNSEW_13ssv_29`,CompassClock:`_CompassClock_13ssv_38`,Bars:`_Bars_13ssv_51`,BarTrack:`_BarTrack_13ssv_63`,BarFillHealth:`_BarFillHealth_13ssv_71`,BarFillEnergy:`_BarFillEnergy_13ssv_77`,WeaponHUD:`_WeaponHUD_13ssv_85`,PackInvItem:`_PackInvItem_13ssv_95`,WeaponSeparator:`_WeaponSeparator_13ssv_105`,TeamScores:`_TeamScores_13ssv_111`,ObserverCount:`_ObserverCount_13ssv_126`,TeamRow:`_TeamRow_13ssv_136`,TeamName:`_TeamName_13ssv_145`,TeamNameFriendly:`_TeamNameFriendly_13ssv_152 _TeamName_13ssv_145`,TeamNameEnemy:`_TeamNameEnemy_13ssv_157 _TeamName_13ssv_145`,TeamScore:`_TeamScore_13ssv_111`,TeamCount:`_TeamCount_13ssv_170`,PackInventoryHUD:`_PackInventoryHUD_13ssv_179`,PackInvIcon:`_PackInvIcon_13ssv_210`,PackInvCount:`_PackInvCount_13ssv_215`,PackInvInfinity:`_PackInvInfinity_13ssv_222`,Reticle:`_Reticle_13ssv_230`,ReticleImage:`_ReticleImage_13ssv_237`,ReticleDot:`_ReticleDot_13ssv_242`},m={ChatContainer:`_ChatContainer_qc3qt_1`,ChatWindow:`_ChatWindow_qc3qt_14`,ChatMessage:`_ChatMessage_qc3qt_39`,ChatColor0:`_ChatColor0_qc3qt_46`,ChatColor1:`_ChatColor1_qc3qt_49`,ChatColor2:`_ChatColor2_qc3qt_52`,ChatColor3:`_ChatColor3_qc3qt_55`,ChatColor4:`_ChatColor4_qc3qt_58`,ChatColor5:`_ChatColor5_qc3qt_61`,ChatColor6:`_ChatColor6_qc3qt_64`,ChatColor7:`_ChatColor7_qc3qt_67`,ChatColor8:`_ChatColor8_qc3qt_70`,ChatColor9:`_ChatColor9_qc3qt_73`},h=r(),g=(0,l.lazy)(()=>o(()=>import(`./ChatInput-BrDNmg1o.js`).then(e=>({default:e.ChatInput})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),_=[],v={0:m.ChatColor0,1:m.ChatColor1,2:m.ChatColor2,3:m.ChatColor3,4:m.ChatColor4,5:m.ChatColor5,6:m.ChatColor6,7:m.ChatColor7,8:m.ChatColor8,9:m.ChatColor9};function ee(e){return v[e]??v[0]}function te(e){return e.colorCode!=null&&v[e.colorCode]?v[e.colorCode]:v[0]}var y=(0,l.memo)(function(){let e=(0,f.c)(12),t=a(b),n=a(x),r=(0,l.useRef)(null),i=n[n.length-1]?.id,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},e[0]=o):o=e[0];let s;e[1]===i?s=e[2]:(s=[i],e[1]=i,e[2]=s),(0,l.useEffect)(o,s);let c;e[3]===n?c=e[4]:(c=n.map(C),e[3]=n,e[4]=c);let u;e[5]===c?u=e[6]:(u=(0,h.jsx)(`div`,{ref:r,className:m.ChatWindow,children:c}),e[5]=c,e[6]=u);let d;e[7]===t?d=e[8]:(d=t&&(0,h.jsx)(l.Suspense,{children:(0,h.jsx)(g,{})}),e[7]=t,e[8]=d);let p;return e[9]!==u||e[10]!==d?(p=(0,h.jsxs)(`div`,{className:m.ChatContainer,children:[u,d]}),e[9]=u,e[10]=d,e[11]=p):p=e[11],p});function b(e){return e.playback.recording?.source===`live`}function x(e){return e.playback.streamSnapshot?.chatMessages??_}function S(e,t){return(0,h.jsx)(`span`,{className:ee(e.colorCode),children:e.text},t)}function C(e){return(0,h.jsx)(`div`,{className:m.ChatMessage,hidden:!e.text,children:e.segments?e.segments.map(S):(0,h.jsxs)(`span`,{className:te(e),children:[e.sender?`${e.sender}: `:``,e.text]})},e.id)}var w=s(`gui/hud_new_compass`),T=s(`gui/hud_new_NSEW`);function E(e){let t=Math.abs(e)/1e3,n=e<0?Math.ceil(t):Math.floor(t),r=Math.floor(n/60),i=n%60;return`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`}function D(){let e=(0,f.c)(8),t=a(k),n=a(O);if(t==null)return null;let r=t*180/Math.PI,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,h.jsx)(`img`,{src:w,alt:``,className:p.CompassRing}),e[0]=i):i=e[0];let o=`rotate(${-r}deg)`,s;e[1]===o?s=e[2]:(s=(0,h.jsx)(`img`,{src:T,alt:``,className:p.CompassNSEW,style:{transform:o}}),e[1]=o,e[2]=s);let c;e[3]===n?c=e[4]:(c=n!=null&&(0,h.jsx)(`span`,{className:p.CompassClock,children:E(n)}),e[3]=n,e[4]=c);let l;return e[5]!==s||e[6]!==c?(l=(0,h.jsxs)(`div`,{className:p.Compass,children:[i,s,c]}),e[5]=s,e[6]=c,e[7]=l):l=e[7],l}function O(e){return e.playback.streamSnapshot?.matchClockMs}function k(e){return e.playback.streamSnapshot?.camera?.yaw}function A(){let e=(0,f.c)(2),t=a(j);if(t==null)return null;let n=`${Math.max(0,Math.min(100,t*100))}%`,r;return e[0]===n?r=e[1]:(r=(0,h.jsx)(`div`,{className:p.BarTrack,children:(0,h.jsx)(`div`,{className:p.BarFillHealth,style:{width:n}})}),e[0]=n,e[1]=r),r}function j(e){return e.playback.streamSnapshot?.status?.health}function M(){let e=(0,f.c)(2),t=a(N);if(t==null)return null;let n=`${Math.max(0,Math.min(100,t*100))}%`,r;return e[0]===n?r=e[1]:(r=(0,h.jsx)(`div`,{className:p.BarTrack,children:(0,h.jsx)(`div`,{className:p.BarFillEnergy,style:{width:n}})}),e[0]=n,e[1]=r),r}function N(e){return e.playback.streamSnapshot?.status?.energy}var P={weapon_energy:`gui/ret_blaster`,weapon_plasma:`gui/ret_plasma`,weapon_chaingun:`gui/ret_chaingun`,weapon_disc:`gui/ret_disc`,weapon_grenade_launcher:`gui/ret_grenade`,weapon_sniper:`gui/hud_ret_sniper`,weapon_elf:`gui/ret_elf`,weapon_mortar:`gui/ret_mortor`,weapon_missile:`gui/ret_missile`,weapon_targeting:`gui/hud_ret_targlaser`,weapon_shocklance:`gui/hud_ret_shocklance`};function F(e){return e?e.replace(/\.dts$/i,``).toLowerCase():``}function I(){let e=(0,f.c)(5),t=a(L);if(t===void 0)return null;let n=P[F(t)];if(n){let t;e[0]===n?t=e[1]:(t=s(n),e[0]=n,e[1]=t);let r;return e[2]===t?r=e[3]:(r=(0,h.jsx)(`div`,{className:p.Reticle,children:(0,h.jsx)(`img`,{src:t,alt:``,className:p.ReticleImage})}),e[2]=t,e[3]=r),r}let r;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,h.jsx)(`div`,{className:p.Reticle,children:(0,h.jsx)(`div`,{className:p.ReticleDot})}),e[4]=r):r=e[4],r}function L(e){let t=e.playback.streamSnapshot;if(!t||t.camera?.mode!==`first-person`)return;let n=t.controlPlayerGhostId;if(n)return t.entities.find(e=>e.id===n)?.weaponShape}var R={0:{icon:`gui/hud_blaster`,label:`Blaster`},1:{icon:`gui/hud_plasma`,label:`Plasma`},2:{icon:`gui/hud_chaingun`,label:`Chaingun`},3:{icon:`gui/hud_disc`,label:`Spinfusor`},4:{icon:`gui/hud_grenlaunch`,label:`GL`},5:{icon:`gui/hud_sniper`,label:`Laser Rifle`},6:{icon:`gui/hud_elfgun`,label:`ELF Gun`},7:{icon:`gui/hud_new_mortar`,label:`Mortar`},8:{icon:`gui/hud_missiles`,label:`Missile`},9:{icon:`gui/hud_targetlaser`,label:`Targeting`},10:{icon:`gui/hud_shocklance`,label:`Shocklance`},11:{icon:`gui/hud_disc`,label:`Spinfusor`},12:{icon:`gui/hud_grenlaunch`,label:`GL`},13:{icon:`gui/hud_chaingun`,label:`Chaingun`},14:{icon:`gui/hud_targetlaser`,label:`Targeting`},15:{icon:`gui/hud_targetlaser`,label:`Targeting`},16:{icon:`gui/hud_shocklance`,label:`Shocklance`},17:{icon:`gui/hud_new_mortar`,label:`Mortar`}},ne=new Map(Object.entries(R).map(([e,t])=>[Number(e),s(t.icon)])),z=new Set([9,14,15]),B=s(`gui/hud_infinity`);function V(e){let t=(0,f.c)(12),{slot:n,isSelected:r}=e,i=R[n.index];if(!i)return null;let a=n.ammo<0,o;t[0]===n.index?o=t[1]:(o=ne.get(n.index),t[0]=n.index,t[1]=o);let s;t[2]!==i.label||t[3]!==o?(s=(0,h.jsx)(`img`,{src:o,alt:i.label,className:p.PackInvIcon}),t[2]=i.label,t[3]=o,t[4]=s):s=t[4];let c;t[5]!==a||t[6]!==n.ammo?(c=a?(0,h.jsx)(`img`,{src:B,alt:`\\u221E`,className:p.PackInvInfinity}):(0,h.jsx)(`span`,{className:p.PackInvCount,children:n.ammo}),t[5]=a,t[6]=n.ammo,t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,h.jsxs)(`div`,{className:p.PackInvItem,"data-active":r,children:[s,c]}),t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function H(){let e=(0,f.c)(15),t=a(U);if(!t||!t.slots.length)return null;let n,r;if(e[0]!==t.slots){r=[],n=[];for(let e of t.slots)z.has(e.index)?n.push(e):r.push(e);e[0]=t.slots,e[1]=n,e[2]=r}else n=e[1],r=e[2];let i;e[3]!==r||e[4]!==t?(i=r.map(e=>(0,h.jsx)(V,{slot:e,isSelected:e.index===t.activeIndex},e.index)),e[3]=r,e[4]=t,e[5]=i):i=e[5];let o;e[6]===n.length?o=e[7]:(o=n.length>0&&(0,h.jsx)(`div`,{className:p.WeaponSeparator}),e[6]=n.length,e[7]=o);let s;e[8]!==n||e[9]!==t?(s=n.map(e=>(0,h.jsx)(V,{slot:e,isSelected:e.index===t.activeIndex},e.index)),e[8]=n,e[9]=t,e[10]=s):s=e[10];let c;return e[11]!==i||e[12]!==o||e[13]!==s?(c=(0,h.jsxs)(`div`,{className:p.WeaponHUD,children:[i,o,s]}),e[11]=i,e[12]=o,e[13]=s,e[14]=c):c=e[14],c}function U(e){return e.playback.streamSnapshot?.weaponsHud}function W(){let e=(0,f.c)(18),t=a(J),n=a(q),r=a(G);if(!t?.length)return null;let o,s,c;if(e[0]!==r||e[1]!==n||e[2]!==t){let a;e[6]===n?a=e[7]:(a=(e,t)=>{if(n){if(e.teamId===n)return-1;if(t.teamId===n)return 1}return e.teamId-t.teamId},e[6]=n,e[7]=a);let l=[...t].sort(a);c=p.TeamScores,e[8]===r?o=e[9]:(o=r>0&&(0,h.jsx)(`tr`,{children:(0,h.jsxs)(`td`,{className:p.ObserverCount,colSpan:3,children:[r,` `,r===1?`observer`:`observers`]})}),e[8]=r,e[9]=o);let u;e[10]===n?u=e[11]:(u=e=>{let t=n!=null&&n>0&&e.teamId===n,r=e.name||(i[e.teamId]??`Team ${e.teamId}`);return(0,h.jsxs)(`tr`,{className:p.TeamRow,children:[(0,h.jsx)(`td`,{className:t?p.TeamNameFriendly:p.TeamNameEnemy,children:r}),(0,h.jsxs)(`td`,{className:p.TeamCount,children:[`(`,e.playerCount.toLocaleString(),`)`]}),(0,h.jsx)(`td`,{className:p.TeamScore,children:e.score.toLocaleString()})]},e.teamId)},e[10]=n,e[11]=u),s=l.map(u),e[0]=r,e[1]=n,e[2]=t,e[3]=o,e[4]=s,e[5]=c}else o=e[3],s=e[4],c=e[5];let l;e[12]!==o||e[13]!==s?(l=(0,h.jsxs)(`tbody`,{children:[o,s]}),e[12]=o,e[13]=s,e[14]=l):l=e[14];let u;return e[15]!==c||e[16]!==l?(u=(0,h.jsx)(`table`,{className:c,children:l}),e[15]=c,e[16]=l,e[17]=u):u=e[17],u}function G(e){return e.playback.streamSnapshot?.playerRoster?.filter(K).length??0}function K(e){return e.teamId<=0}function q(e){return e.playback.streamSnapshot?.playerSensorGroup}function J(e){return e.playback.streamSnapshot?.teamScores}var Y={0:`gui/hud_new_packammo`,1:`gui/hud_new_packcloak`,2:`gui/hud_new_packenergy`,3:`gui/hud_new_packrepair`,4:`gui/hud_new_packsatchel`,5:`gui/hud_new_packshield`,6:`gui/hud_new_packinventory`,7:`gui/hud_new_packmotionsens`,8:`gui/hud_new_packradar`,9:`gui/hud_new_packturretout`,10:`gui/hud_new_packturretin`,11:`gui/hud_new_packsensjam`,12:`gui/hud_new_packturret`,13:`gui/hud_new_packturret`,14:`gui/hud_new_packturret`,15:`gui/hud_new_packturret`,16:`gui/hud_new_packturret`,17:`gui/hud_new_packturret`,18:`gui/hud_satchel_unarmed`,19:`gui/hud_new_packenergy`},X={1:`gui/hud_new_packcloak_armed`,3:`gui/hud_new_packrepair_armed`,4:`gui/hud_satchel_armed`,5:`gui/hud_new_packshield_armed`,11:`gui/hud_new_packsensjam_armed`},Z=new Map(Object.entries(Y).map(([e,t])=>[Number(e),s(t)])),re=new Map(Object.entries(X).map(([e,t])=>[Number(e),s(t)])),Q={0:{icon:`gui/hud_handgren`,label:`Grenade`},1:{icon:`gui/hud_mine`,label:`Mine`},2:{icon:`gui/hud_beacon`,label:`Beacon`},3:{icon:`gui/hud_medpack`,label:`Repair Kit`}},ie=new Map(Object.entries(Q).map(([e,t])=>[Number(e),s(t.icon)]));function ae(){let e=(0,f.c)(25),t=a(ce),n=a(se),r=t&&t.packIndex>=0,i;if(r){let n;e[0]!==t.active||e[1]!==t.packIndex?(n=t.active?re.get(t.packIndex):void 0,e[0]=t.active,e[1]=t.packIndex,e[2]=n):n=e[2];let r=n,a;e[3]!==r||e[4]!==t.packIndex?(a=r??Z.get(t.packIndex),e[3]=r,e[4]=t.packIndex,e[5]=a):a=e[5],i=a}let o;if(e[6]!==n){if(o=new Map,n)for(let e of n.slots)o.set(e.slot,e.count);e[6]=n,e[7]=o}else o=e[7];let s,c,l,u;if(e[8]!==t||e[9]!==o||e[10]!==r||e[11]!==i){u=Symbol.for(`react.early_return_sentinel`);bb0:{let n=Object.keys(Q).map(Number).sort(oe);if(!r&&!o.size){u=null;break bb0}s=p.PackInventoryHUD,e[16]!==t||e[17]!==i?(c=i&&(0,h.jsxs)(`div`,{className:p.PackInvItem,"data-active":t.active??!1,children:[(0,h.jsx)(`img`,{src:i,alt:``,className:p.PackInvIcon}),(0,h.jsx)(`span`,{className:p.PackInvCount,children:t.text||`\xA0`})]}),e[16]=t,e[17]=i,e[18]=c):c=e[18];let a;e[19]===o?a=e[20]:(a=e=>{let t=Q[e],n=ie.get(e);return!t||!n?null:(0,h.jsxs)(`div`,{className:p.PackInvItem,children:[(0,h.jsx)(`img`,{src:n,alt:t.label,className:p.PackInvIcon}),(0,h.jsx)(`span`,{className:p.PackInvCount,children:o.get(e)??0})]},e)},e[19]=o,e[20]=a),l=n.map(a)}e[8]=t,e[9]=o,e[10]=r,e[11]=i,e[12]=s,e[13]=c,e[14]=l,e[15]=u}else s=e[12],c=e[13],l=e[14],u=e[15];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;return e[21]!==s||e[22]!==c||e[23]!==l?(d=(0,h.jsxs)(`div`,{className:s,children:[c,l]}),e[21]=s,e[22]=c,e[23]=l,e[24]=d):d=e[24],d}function oe(e,t){return e-t}function se(e){return e.playback.streamSnapshot?.inventoryHud}function ce(e){return e.playback.streamSnapshot?.backpackHud}function le(){let e=(0,f.c)(10),t=a(ue),n=d(c,$),r=t&&n!==`freeFly`,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,h.jsx)(y,{}),e[0]=i):i=e[0];let o;e[1]===r?o=e[2]:(o=r&&(0,h.jsxs)(`div`,{className:p.Bars,children:[(0,h.jsx)(A,{}),(0,h.jsx)(M,{})]}),e[1]=r,e[2]=o);let s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,h.jsx)(D,{}),e[3]=s):s=e[3];let l;e[4]===r?l=e[5]:(l=r&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(H,{}),(0,h.jsx)(ae,{}),(0,h.jsx)(I,{})]}),e[4]=r,e[5]=l);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,h.jsx)(W,{}),e[6]=u):u=e[6];let m;return e[7]!==o||e[8]!==l?(m=(0,h.jsxs)(`div`,{className:p.PlayerHUD,children:[i,o,s,l,u]}),e[7]=o,e[8]=l,e[9]=m):m=e[9],m}function $(e){return e.cameraMode}function ue(e){return!!e.playback.streamSnapshot?.controlPlayerGhostId}export{le as PlayerHUD}; \ No newline at end of file diff --git a/docs/assets/PlayerModel-CbQhsRlW.js b/docs/assets/PlayerModel-Cm8DLHtl.js similarity index 99% rename from docs/assets/PlayerModel-CbQhsRlW.js rename to docs/assets/PlayerModel-Cm8DLHtl.js index ad284d69..ed0708f6 100644 --- a/docs/assets/PlayerModel-CbQhsRlW.js +++ b/docs/assets/PlayerModel-Cm8DLHtl.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i}from"./react-three-fiber.esm-CgPHUpXo.js";import{a}from"./SettingsProvider-CCHVZuSg.js";import{S as o,a as s,d as c,f as l,i as u,l as d,p as f,r as p,t as m}from"./GenericShape-BC0gDQiR.js";import{$ as h,Q as g,bt as _,i as v,o as y,s as b}from"./three.module-07hRbor4.js";import{a as x,i as S,o as C}from"./engineStore-Dkm20jvr.js";import{r as ee}from"./loaders-CIpiZadQ.js";import{n as te}from"./AudioContext-CMp1T7r9.js";import{getCachedAudioBuffer as ne,getSoundGeneration as w,playOneShotSound as T,resolveAudioProfile as re,trackSound as ie,untrackSound as E}from"./AudioEmitter-2bTNGdLP.js";import{t as D}from"./DebugSuspense-Dk4MzcWf.js";import{n as O}from"./streamPlaybackStore-DhJekvnx.js";import{c as k}from"./globalFogUniforms-CtxQvsRj.js";import{t as A}from"./ShapeErrorBoundary-CJ_4YTMy.js";var j=t(),M=e(n(),1),N=.1,P=20;function F(e){return-2*Math.atan2(e[1],e[3])}function ae(e,t,n,r){if(n)return{animation:`fall`,timeScale:1};if(!e)return{animation:`root`,timeScale:1};let[i,a,o]=e,s=i*i+a*a;if(Math.abs(o)>2||s>P*P)return r?{animation:`jet`,timeScale:1}:{animation:`root`,timeScale:1};let c=F(t),l=Math.cos(c),u=Math.sin(c),d=i*l+a*u,f=-i*u+a*l,p=f,m=-f,h=-d,g=Math.max(p,m,h,d);return g0&&(this.delayTime=e[0].timeoutValue??0)}get stateIndex(){return this.currentStateIndex}reset(){this.currentStateIndex=0,this.delayTime=this.states.length>0?this.states[0].timeoutValue??0:0,this.lastFireCount=-1}tick(e,t){if(this.states.length===0)return{sequenceName:null,isFiring:!1,spinTimeScale:0,reverse:!1,scaleAnimation:!1,timeoutValue:0,transitioned:!1,soundDataBlockIds:[],stateIndex:-1};let n=this.lastFireCount>=0&&t.fireCount!==this.lastFireCount;this.lastFireCount=t.fireCount;let r=[];if(n){let e=this.states.findIndex(e=>e.fire);if(e>=0&&e!==this.currentStateIndex){this.currentStateIndex=e,this.delayTime=this.states[e].timeoutValue??0;let t=this.states[e].soundDataBlockId;t>=0&&r.push(t)}}this.delayTime-=e;let i=n,a=this.evaluateTickTransitions(t),o=0;for(;a>=0&&o=0&&r.push(c),this.states[a].spin){case R:this.spinTimeScale=0;break;case V:this.spinTimeScale=1;break;case z:e===B&&s>0&&(this.delayTime*=1-n/s);break;case B:e===z&&s>0&&(this.delayTime*=1-n/s);break}a=this.evaluateEntryTransitions(t)}let s=this.states[this.currentStateIndex],c=s.timeoutValue??0;switch(s.spin){case R:this.spinTimeScale=0;break;case z:this.spinTimeScale=c>0?Math.max(0,1-this.delayTime/c):1;break;case V:this.spinTimeScale=1;break;case B:this.spinTimeScale=c>0?Math.max(0,this.delayTime/c):0;break}return{sequenceName:this.resolveSequenceName(s),isFiring:s.fire,spinTimeScale:this.spinTimeScale,reverse:!s.direction,scaleAnimation:s.scaleAnimation,timeoutValue:s.timeoutValue??0,transitioned:i,soundDataBlockIds:r,stateIndex:this.currentStateIndex}}evaluateTickTransitions(e){let t=this.states[this.currentStateIndex],n=this.delayTime<=0;if(!(n||!t.waitForTimeout))return-1;let r=this.evaluateConditions(t,e);if(r!==-1)return r;if(n){let e=t.transitionOnTimeout;if(e!==I)return e}return-1}evaluateEntryTransitions(e){let t=this.states[this.currentStateIndex];return this.evaluateConditions(t,e)}evaluateConditions(e,t){let n=t.loaded?e.transitionOnLoaded:e.transitionOnNotLoaded;if(n!==I)return n;let r=t.ammo?e.transitionOnAmmo:e.transitionOnNoAmmo;if(r!==I)return r;let i=t.target?e.transitionOnTarget:e.transitionOnNoTarget;if(i!==I)return i;let a=t.wet?e.transitionOnWet:e.transitionOnNotWet;if(a!==I)return a;let o=t.triggerDown?e.transitionOnTriggerDown:e.transitionOnTriggerUp;return o===I?-1:o}resolveSequenceName(e){return e.sequence==null||e.sequence<0?null:this.seqIndexToName[e.sequence]??null}},U=r();function oe(e){if(!e)return`lookde`;let t=e.toLowerCase();return t.includes(`missile`)?`lookms`:t.includes(`sniper`)?`looksn`:`lookde`}var W=8,G=[`root`,`run`,`back`,`side`,`fall`,`jet`,`jump`,`land`];function K(e,t,n=0){let r=new Map,i=[];for(let n of e){let e=n.indexOf(` `);if(e===-1)continue;let r=n.slice(0,e).toLowerCase(),a=n.slice(e+1).trim().toLowerCase();if(!a||!r.startsWith(t)||!r.endsWith(`.dsq`))continue;let o=r.slice(t.length,-4);o&&i.push({clipName:o,alias:a})}let a=new Set;for(let e=0;e{let t=n?.toLowerCase();return t?e.runtime.sequenceAliases.get(t):void 0}),l=k(),{clonedScene:w,mixer:T,mount0:j,mount1:N,mount2:P,iflInitializers:F}=(0,M.useMemo)(()=>{let e=o(r.scene),t=f(e,void 0,{anisotropy:l});e.traverse(e=>{if(e.isMesh&&e.material){let t=Array.isArray(e.material)?e.material:[e.material];for(let e of t)e.side=0}});let n=new y(e),i=null,a=null,s=null;return e.traverse(e=>{!i&&e.name===`Mount0`&&(i=e),!a&&e.name===`Mount1`&&(a=e),!s&&e.name===`Mount2`&&(s=e)}),{clonedScene:e,mixer:n,mount0:i,mount1:a,mount2:s,iflInitializers:t}},[r,l]);(0,M.useEffect)(()=>()=>{d(w),T.uncacheRoot(w)},[w,T]);let I=(0,M.useRef)(new Map),L=(0,M.useRef)({head:null,headside:null}),R=(0,M.useRef)(new Map),z=(0,M.useRef)(null),B=(0,M.useRef)({name:`root`,timeScale:1}),V=(0,M.useRef)(!1),H=(0,M.useRef)(void 0),G=(0,M.useMemo)(()=>{let e=t.getState().playback.recording?.streamingPlayback,i=n?.toLowerCase();if(!e||!i)return new Map;let a=e.getShapeConstructorSequences(i);if(!a)return new Map;let o=i.replace(/\.dts$/i,``)+`_`;return K(a,o,se(r.scene,a,o))},[t,n,r.scene]),q=(0,M.useMemo)(()=>{let e=new Map,t=r.scene.userData?.dts_sequence_names,n=r.scene.userData?.dts_sequence_cyclic;if(typeof t==`string`&&typeof n==`string`)try{let r=JSON.parse(t),i=JSON.parse(n),a=new Map;for(let e=0;e{let e=C(r.animations,T,s);I.current=e;let t=e.get(`root`);t&&t.play(),B.current={name:`root`,timeScale:1};let n={head:null,headside:null};for(let{key:e,names:t}of[{key:`head`,names:[`head`]},{key:`headside`,names:[`headside`]}]){let i=r.animations.find(e=>t.includes(e.name.toLowerCase()));if(!i)continue;let a=i.clone(),o=Math.round(i.duration*30/2);b.makeClipAdditive(a,o,i,30);let s=T.clipAction(a);s.blendMode=v,s.timeScale=0,s.weight=1,s.play(),n[e]=s}L.current=n;let i=new Map,a=r.animations.find(e=>e.name.toLowerCase()===`lookde`),o=a?Math.round(a.duration*30/2):0;for(let e of[`lookde`,`lookms`,`looksn`]){let t=r.animations.find(t=>t.name.toLowerCase()===e);if(!t)continue;let n=t.clone(),s=a??t;b.makeClipAdditive(n,o,s,30);let c=T.clipAction(n);c.blendMode=v,c.timeScale=0,c.weight=0,c.play(),i.set(e,c)}R.current=i;let c=i.get(`lookde`);return c&&(c.weight=1,z.current=`lookde`),T.update(0),()=>{T.stopAllAction(),I.current=new Map,L.current={head:null,headside:null},R.current=new Map,z.current=null}},[T,r.animations,s]),(0,M.useEffect)(()=>{let e=[];for(let{mesh:t,initialize:n}of F)n(t,()=>O.getState().time).then(t=>e.push(t)).catch(()=>{});return()=>e.forEach(e=>e())},[F]);let ce=(0,M.useRef)(e.weaponShape),[J,le]=(0,M.useState)(e.weaponShape),de=(0,M.useRef)(e.packShape),[Y,fe]=(0,M.useState)(e.packShape),pe=(0,M.useRef)(e.flagShape),[X,Z]=(0,M.useState)(e.flagShape),{audioLoader:Q,audioListener:$}=te(),he=a()?.audioEnabled??!1,ge=(0,M.useRef)(null),_e=(0,M.useRef)(null),ve=(0,M.useRef)(null);return(0,M.useEffect)(()=>{if(!Q)return;let n=t.getState().playback.recording?.streamingPlayback;if(!n||!e.dataBlockId)return;let r=n.getDataBlockData.bind(n),i=r(e.dataBlockId)?.sounds?.[0];if(i==null)return;let a=re(i,r);if(a){ve.current=a;try{ne(ee(a.filename),Q,e=>{_e.current=e})}catch{}}},[Q,t,e.dataBlockId]),(0,M.useEffect)(()=>()=>{let e=ge.current;if(e){E(e);try{e.stop()}catch{}try{e.disconnect()}catch{}e.parent?.remove(e),ge.current=null}},[]),i((n,r)=>{e.weaponShape!==ce.current&&(ce.current=e.weaponShape,le(e.weaponShape)),e.packShape!==de.current&&(de.current=e.packShape,fe(e.packShape)),e.flagShape!==pe.current&&(pe.current=e.flagShape,Z(e.flagShape));let i=t.getState().playback,a=i.status===`playing`,o=O.getState().time,s=c(e.keyframes??[],o),l=s?.damageState!=null&&s.damageState>=1,d=I.current;if(l&&!V.current){V.current=!0;let e=s.actionAnim==null?void 0:G.get(s.actionAnim);if(e){let t=d.get(e.clipName);if(t){let n=d.get(B.current.name.toLowerCase());n&&n.fadeOut(u),t.setLoop(g,1),t.clampWhenFinished=!0,t.reset().fadeIn(u).play(),B.current={name:e.clipName,timeScale:1},H.current=s.actionAnim}}}if(!l&&V.current){V.current=!1,H.current=void 0;let e=d.get(B.current.name.toLowerCase());e&&(e.stop(),e.setLoop(h,1/0),e.clampWhenFinished=!1),B.current={name:`root`,timeScale:1};let t=d.get(`root`);t&&t.reset().play()}let f=s?.actionAnim,p=H.current;if(!V.current&&f!==p){H.current=f;let e=f!=null&&f>=W,t=p!=null&&p>=W;if(e){let e=G.get(f);if(e){let t=d.get(e.clipName);if(t){let n=d.get(B.current.name.toLowerCase());n&&n.fadeOut(u),t.setLoop(g,1),t.clampWhenFinished=!0,t.reset().fadeIn(u).play(),B.current={name:e.clipName,timeScale:1}}}}else if(t){let e=G.get(p);if(e){let t=d.get(e.clipName);t&&(t.fadeOut(u),t.setLoop(h,1/0),t.clampWhenFinished=!1)}B.current={name:`root`,timeScale:1};let t=d.get(`root`);t&&t.reset().fadeIn(u).play()}}if(f!=null&&f>=W&&s?.actionAtEnd){let e=G.get(f);if(e){let t=d.get(e.clipName);t&&(t.paused=!0)}}let m=H.current!=null&&H.current>=W;if(!V.current&&!m){let t=ae(s?.velocity,s?.rotation??[0,0,0,1],e.falling,e.jetting),n=B.current;if(t.animation!==n.name||t.timeScale!==n.timeScale){let e=d.get(n.name.toLowerCase()),r=d.get(t.animation.toLowerCase());r&&(q.get(t.animation)??!0?(r.setLoop(h,1/0),r.clampWhenFinished=!1):(r.setLoop(g,1),r.clampWhenFinished=!0),a&&e&&e!==r?(e.fadeOut(u),r.reset().fadeIn(u).play()):(e&&e!==r&&e.stop(),r.reset().play()),r.timeScale=t.timeScale,B.current={name:t.animation,timeScale:t.timeScale})}}let v=oe(e.weaponShape);if(v!==z.current){let e=R.current,t=z.current?e.get(z.current):null,n=e.get(v);n&&(t&&(t.weight=0),n.weight=l?0:1,z.current=v)}let{head:y,headside:b}=L.current,x=z.current?R.current.get(z.current):null,S=l?0:1,C=e.headPitch??0,ee=e.headYaw??0,te=(C+1)/2,ne=(ee+1)/2;x&&(x.time=te*x.getClip().duration,x.weight=S),y&&(y.time=te*y.getClip().duration,y.weight=S),b&&(b.time=ne*b.getClip().duration,b.weight=S);let re=!!e.jetting&&!l,D=ve.current,k=ge.current,A=k?.isPlaying??!1;if(re&&!A){if(he&&$&&_e.current&&D){let e=k;e||(e=new _($),e.setDistanceModel(`inverse`),e.setRefDistance(D.refDist),e.setMaxDistance(D.maxDist),e.setRolloffFactor(1),e.setVolume(D.volume),w.add(e),ge.current=e);try{e.setBuffer(_e.current),e.setLoop(!0),e.setPlaybackRate(i.rate),e.play(),ie(e,1)}catch{}}}else if(!re&&A&&k){E(k);try{k.stop()}catch{}}a?T.update(r*i.rate):T.update(0)}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`group`,{rotation:[0,Math.PI/2,0],children:(0,U.jsx)(`primitive`,{object:w})}),J&&j&&(0,U.jsx)(A,{fallback:(0,U.jsx)(m,{color:`red`,label:J}),children:(0,U.jsx)(D,{name:`Weapon:${e.id}/${J}`,fallback:(0,U.jsx)(m,{color:`cyan`,label:J}),children:(0,U.jsx)(ue,{entity:e,weaponShape:J,mount0:j})})},J),Y&&N&&(0,U.jsx)(A,{fallback:(0,U.jsx)(m,{color:`red`,label:Y}),children:(0,U.jsx)(D,{name:`Pack:${e.id}/${Y}`,fallback:(0,U.jsx)(m,{color:`cyan`,label:Y}),children:(0,U.jsx)(me,{packShape:Y,mountBone:N})})},Y),X&&P&&(0,U.jsx)(A,{fallback:(0,U.jsx)(m,{color:`red`,label:X}),children:(0,U.jsx)(D,{name:`Flag:${e.id}/${X}`,fallback:(0,U.jsx)(m,{color:`cyan`,label:X}),children:(0,U.jsx)(me,{packShape:X,mountBone:P})})},X)]})}function le(e,t){let n=e.userData?.dts_sequence_names;if(typeof n==`string`)try{return JSON.parse(n).map(e=>e.toLowerCase())}catch{}return t.map(e=>e.name.toLowerCase())}function ue(e){let t=(0,j.c)(43),{entity:n,weaponShape:r,mount0:s}=e,c=x(),u=p(r),m=k(),g,v,b,S;if(t[0]!==m||t[1]!==u.animations||t[2]!==u.scene){g=o(u.scene),v=f(g,void 0,{anisotropy:m});let e=l(u.scene,u.animations,`Mountpoint`);if(e){let t=e.quaternion.clone().invert(),n=e.position.clone().negate().applyQuaternion(t);g.position.copy(n),g.quaternion.copy(t)}S=new Map,g.traverse(e=>{if(!e.isMesh)return;let t=(e.userData?.vis_sequence??``).toLowerCase();if(!t)return;let n=S.get(t);n||(n=[],S.set(t,n)),n.push(e)}),b=new y(g),t[0]=m,t[1]=u.animations,t[2]=u.scene,t[3]=g,t[4]=v,t[5]=b,t[6]=S}else g=t[3],v=t[4],b=t[5],S=t[6];let C=b,E=u.scene,D;t[7]!==E||t[8]!==u.animations?(D=le(E,u.animations),t[7]=E,t[8]=u.animations,t[9]=D):D=t[9];let O=D,A;t[10]!==g||t[11]!==v||t[12]!==C||t[13]!==O||t[14]!==S?(A={weaponClone:g,weaponMixer:C,seqIndexToName:O,visNodesBySequence:S,weaponIflInitializers:v},t[10]=g,t[11]=v,t[12]=C,t[13]=O,t[14]=S,t[15]=A):A=t[15];let{weaponClone:N,weaponMixer:P,seqIndexToName:F,visNodesBySequence:ae,weaponIflInitializers:I}=A,L,R;t[16]!==N||t[17]!==P?(L=()=>()=>{d(N),P.uncacheRoot(N)},R=[N,P],t[16]=N,t[17]=P,t[18]=L,t[19]=R):(L=t[18],R=t[19]),(0,M.useEffect)(L,R);let z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(z=new Map,t[20]=z):z=t[20];let B=(0,M.useRef)(z),V=(0,M.useRef)(null),U,oe;t[21]!==u.animations||t[22]!==P?(U=()=>{let e=new Map;for(let t of u.animations)e.set(t.name.toLowerCase(),P.clipAction(t));B.current=e;let t=e.get(`spin`);return t&&(t.setLoop(h,1/0),t.timeScale=0,t.play()),V.current=t??null,P.update(0),()=>{P.stopAllAction(),B.current=new Map,V.current=null,ce(X,Z)}},oe=[P,u.animations],t[21]=u.animations,t[22]=P,t[23]=U,t[24]=oe):(U=t[23],oe=t[24]),(0,M.useEffect)(U,oe);let W,G;t[25]===I?(W=t[26],G=t[27]):(W=()=>{let e=[];for(let{mesh:t,initialize:n}of I)n(t,fe).then(t=>e.push(t)).catch(Y);return()=>e.forEach(de)},G=[I],t[25]=I,t[26]=W,t[27]=G),(0,M.useEffect)(W,G);let{audioLoader:K,audioListener:q}=te(),se=a()?.audioEnabled??!1,J=(0,M.useRef)(null),ue=(0,M.useRef)(null),me=(0,M.useRef)(n.weaponImageStates),X=(0,M.useRef)(null),Z=(0,M.useRef)(-1),Q,$;t[28]!==s||t[29]!==N?(Q=()=>(s.add(N),()=>{s.remove(N)}),$=[N,s],t[28]=s,t[29]=N,t[30]=Q,t[31]=$):(Q=t[30],$=t[31]),(0,M.useEffect)(Q,$);let he;return t[32]!==se||t[33]!==q||t[34]!==K||t[35]!==c||t[36]!==n.weaponImageState||t[37]!==n.weaponImageStates||t[38]!==F||t[39]!==ae||t[40]!==N||t[41]!==P?(he=(e,t)=>{let r=c.getState().playback,i=r.status===`playing`,a=B.current,o=n.weaponImageState,s=n.weaponImageStates;s!==me.current&&(me.current=s,s&&s.length>0?J.current=new H(s,F):J.current=null,ue.current=null,ce(X,Z,N)),!J.current&&s&&s.length>0&&(J.current=new H(s,F));let l=J.current;if(l&&o&&i){let e=t*r.rate,n=l.tick(e,o);if(pe(n,a,ue,ae),X.current&&n.stateIndex!==Z.current&&ce(X,Z,N),se&&K&&q&&n.soundDataBlockIds.length>0){let e=r.recording?.streamingPlayback.getDataBlockData.bind(r.recording.streamingPlayback);if(e)for(let t of n.soundDataBlockIds){let n=re(t,e);if(n)if(n.isLooping){if(!X.current)try{let e=ee(n.filename),t=w();ne(e,K,e=>{if(t!==w()||X.current)return;let i=l.stateIndex,a=new _(q);a.setBuffer(e),a.setDistanceModel(`inverse`),a.setRefDistance(n.refDist),a.setMaxDistance(n.maxDist),a.setRolloffFactor(1),a.setVolume(n.volume),a.setPlaybackRate(r.rate),a.setLoop(!0),N.add(a),ie(a),a.play(),X.current=a,Z.current=i})}catch{}}else T(n,q,K,void 0,N)}}V.current&&(V.current.timeScale=n.spinTimeScale)}i?P.update(t*r.rate):P.update(0)},t[32]=se,t[33]=q,t[34]=K,t[35]=c,t[36]=n.weaponImageState,t[37]=n.weaponImageStates,t[38]=F,t[39]=ae,t[40]=N,t[41]=P,t[42]=he):he=t[42],i(he),null}function de(e){return e()}function Y(){}function fe(){return O.getState().time}function pe(e,t,n,r){let i=e.sequenceName,a=n.current;if(i===a&&!e.transitioned)return;if(i!==a){if(a){let e=r.get(a);if(e)for(let t of e)t.visible=!1}if(i){let e=r.get(i);if(e)for(let t of e)t.visible=!0}}if(!i){if(a){let e=t.get(a);e&&e.fadeOut(u),n.current=null}return}let o=t.get(i);if(o&&(e.transitioned||i!==a)){let r=a?t.get(a):null;if(e.isFiring||e.timeoutValue>0?(o.setLoop(g,1),o.clampWhenFinished=!0):(o.setLoop(h,1/0),o.clampWhenFinished=!1),e.scaleAnimation&&e.timeoutValue>0){let t=o.getClip().duration;o.timeScale=t>0?t/e.timeoutValue:1}else o.timeScale=e.reverse?-1:1;r&&r!==o?(r.fadeOut(u),o.reset().fadeIn(u).play()):o.reset().play(),n.current=i}}function me(e){let t=(0,j.c)(15),{packShape:n,mountBone:r}=e,i=p(n),a=k(),s,c;if(t[0]!==a||t[1]!==i.animations||t[2]!==i.scene){s=o(i.scene),c=f(s,void 0,{anisotropy:a});let e=l(i.scene,i.animations,`Mountpoint`);if(e){let t=e.quaternion.clone().invert(),n=e.position.clone().negate().applyQuaternion(t);s.position.copy(n),s.quaternion.copy(t)}t[0]=a,t[1]=i.animations,t[2]=i.scene,t[3]=s,t[4]=c}else s=t[3],c=t[4];let u;t[5]!==s||t[6]!==c?(u={packClone:s,packIflInitializers:c},t[5]=s,t[6]=c,t[7]=u):u=t[7];let{packClone:m,packIflInitializers:h}=u,g,_;t[8]!==r||t[9]!==m?(g=()=>(r.add(m),()=>{r.remove(m),d(m)}),_=[m,r],t[8]=r,t[9]=m,t[10]=g,t[11]=_):(g=t[10],_=t[11]),(0,M.useEffect)(g,_);let v,y;return t[12]===h?(v=t[13],y=t[14]):(v=()=>{let e=[];for(let{mesh:t,initialize:n}of h)n(t,Q).then(t=>e.push(t)).catch(Z);return()=>e.forEach(X)},y=[h],t[12]=h,t[13]=v,t[14]=y),(0,M.useEffect)(v,y),null}function X(e){return e()}function Z(){}function Q(){return O.getState().time}function $(e){let t=(0,j.c)(7),{shapeName:n,eyeOffsetRef:r}=e,i=p(n),a;t[0]!==r||t[1]!==i.animations||t[2]!==i.scene?(a=()=>{let e=l(i.scene,i.animations,`Eye`);e?r.current.set(e.position.z,e.position.y,-e.position.x):r.current.set(0,s,0)},t[0]=r,t[1]=i.animations,t[2]=i.scene,t[3]=a):a=t[3];let o;return t[4]!==r||t[5]!==i?(o=[i,r],t[4]=r,t[5]=i,t[6]=o):o=t[6],(0,M.useEffect)(a,o),null}export{$ as PlayerEyeOffset,J as PlayerModel}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i}from"./react-three-fiber.esm-CgPHUpXo.js";import{a}from"./SettingsProvider-CCHVZuSg.js";import{S as o,a as s,d as c,f as l,i as u,l as d,p as f,r as p,t as m}from"./GenericShape-FZ5loHEW.js";import{$ as h,Q as g,bt as _,i as v,o as y,s as b}from"./three.module-07hRbor4.js";import{a as x,i as S,o as C}from"./engineStore-Dkm20jvr.js";import{r as ee}from"./loaders-CIpiZadQ.js";import{n as te}from"./AudioContext-CMp1T7r9.js";import{getCachedAudioBuffer as ne,getSoundGeneration as w,playOneShotSound as T,resolveAudioProfile as re,trackSound as ie,untrackSound as E}from"./AudioEmitter-Dk4R9QgT.js";import{t as D}from"./DebugSuspense-Dk4MzcWf.js";import{n as O}from"./streamPlaybackStore-DhJekvnx.js";import{c as k}from"./globalFogUniforms-CtxQvsRj.js";import{t as A}from"./ShapeErrorBoundary-CJ_4YTMy.js";var j=t(),M=e(n(),1),N=.1,P=20;function F(e){return-2*Math.atan2(e[1],e[3])}function ae(e,t,n,r){if(n)return{animation:`fall`,timeScale:1};if(!e)return{animation:`root`,timeScale:1};let[i,a,o]=e,s=i*i+a*a;if(Math.abs(o)>2||s>P*P)return r?{animation:`jet`,timeScale:1}:{animation:`root`,timeScale:1};let c=F(t),l=Math.cos(c),u=Math.sin(c),d=i*l+a*u,f=-i*u+a*l,p=f,m=-f,h=-d,g=Math.max(p,m,h,d);return g0&&(this.delayTime=e[0].timeoutValue??0)}get stateIndex(){return this.currentStateIndex}reset(){this.currentStateIndex=0,this.delayTime=this.states.length>0?this.states[0].timeoutValue??0:0,this.lastFireCount=-1}tick(e,t){if(this.states.length===0)return{sequenceName:null,isFiring:!1,spinTimeScale:0,reverse:!1,scaleAnimation:!1,timeoutValue:0,transitioned:!1,soundDataBlockIds:[],stateIndex:-1};let n=this.lastFireCount>=0&&t.fireCount!==this.lastFireCount;this.lastFireCount=t.fireCount;let r=[];if(n){let e=this.states.findIndex(e=>e.fire);if(e>=0&&e!==this.currentStateIndex){this.currentStateIndex=e,this.delayTime=this.states[e].timeoutValue??0;let t=this.states[e].soundDataBlockId;t>=0&&r.push(t)}}this.delayTime-=e;let i=n,a=this.evaluateTickTransitions(t),o=0;for(;a>=0&&o=0&&r.push(c),this.states[a].spin){case R:this.spinTimeScale=0;break;case V:this.spinTimeScale=1;break;case z:e===B&&s>0&&(this.delayTime*=1-n/s);break;case B:e===z&&s>0&&(this.delayTime*=1-n/s);break}a=this.evaluateEntryTransitions(t)}let s=this.states[this.currentStateIndex],c=s.timeoutValue??0;switch(s.spin){case R:this.spinTimeScale=0;break;case z:this.spinTimeScale=c>0?Math.max(0,1-this.delayTime/c):1;break;case V:this.spinTimeScale=1;break;case B:this.spinTimeScale=c>0?Math.max(0,this.delayTime/c):0;break}return{sequenceName:this.resolveSequenceName(s),isFiring:s.fire,spinTimeScale:this.spinTimeScale,reverse:!s.direction,scaleAnimation:s.scaleAnimation,timeoutValue:s.timeoutValue??0,transitioned:i,soundDataBlockIds:r,stateIndex:this.currentStateIndex}}evaluateTickTransitions(e){let t=this.states[this.currentStateIndex],n=this.delayTime<=0;if(!(n||!t.waitForTimeout))return-1;let r=this.evaluateConditions(t,e);if(r!==-1)return r;if(n){let e=t.transitionOnTimeout;if(e!==I)return e}return-1}evaluateEntryTransitions(e){let t=this.states[this.currentStateIndex];return this.evaluateConditions(t,e)}evaluateConditions(e,t){let n=t.loaded?e.transitionOnLoaded:e.transitionOnNotLoaded;if(n!==I)return n;let r=t.ammo?e.transitionOnAmmo:e.transitionOnNoAmmo;if(r!==I)return r;let i=t.target?e.transitionOnTarget:e.transitionOnNoTarget;if(i!==I)return i;let a=t.wet?e.transitionOnWet:e.transitionOnNotWet;if(a!==I)return a;let o=t.triggerDown?e.transitionOnTriggerDown:e.transitionOnTriggerUp;return o===I?-1:o}resolveSequenceName(e){return e.sequence==null||e.sequence<0?null:this.seqIndexToName[e.sequence]??null}},U=r();function oe(e){if(!e)return`lookde`;let t=e.toLowerCase();return t.includes(`missile`)?`lookms`:t.includes(`sniper`)?`looksn`:`lookde`}var W=8,G=[`root`,`run`,`back`,`side`,`fall`,`jet`,`jump`,`land`];function K(e,t,n=0){let r=new Map,i=[];for(let n of e){let e=n.indexOf(` `);if(e===-1)continue;let r=n.slice(0,e).toLowerCase(),a=n.slice(e+1).trim().toLowerCase();if(!a||!r.startsWith(t)||!r.endsWith(`.dsq`))continue;let o=r.slice(t.length,-4);o&&i.push({clipName:o,alias:a})}let a=new Set;for(let e=0;e{let t=n?.toLowerCase();return t?e.runtime.sequenceAliases.get(t):void 0}),l=k(),{clonedScene:w,mixer:T,mount0:j,mount1:N,mount2:P,iflInitializers:F}=(0,M.useMemo)(()=>{let e=o(r.scene),t=f(e,void 0,{anisotropy:l});e.traverse(e=>{if(e.isMesh&&e.material){let t=Array.isArray(e.material)?e.material:[e.material];for(let e of t)e.side=0}});let n=new y(e),i=null,a=null,s=null;return e.traverse(e=>{!i&&e.name===`Mount0`&&(i=e),!a&&e.name===`Mount1`&&(a=e),!s&&e.name===`Mount2`&&(s=e)}),{clonedScene:e,mixer:n,mount0:i,mount1:a,mount2:s,iflInitializers:t}},[r,l]);(0,M.useEffect)(()=>()=>{d(w),T.uncacheRoot(w)},[w,T]);let I=(0,M.useRef)(new Map),L=(0,M.useRef)({head:null,headside:null}),R=(0,M.useRef)(new Map),z=(0,M.useRef)(null),B=(0,M.useRef)({name:`root`,timeScale:1}),V=(0,M.useRef)(!1),H=(0,M.useRef)(void 0),G=(0,M.useMemo)(()=>{let e=t.getState().playback.recording?.streamingPlayback,i=n?.toLowerCase();if(!e||!i)return new Map;let a=e.getShapeConstructorSequences(i);if(!a)return new Map;let o=i.replace(/\.dts$/i,``)+`_`;return K(a,o,se(r.scene,a,o))},[t,n,r.scene]),q=(0,M.useMemo)(()=>{let e=new Map,t=r.scene.userData?.dts_sequence_names,n=r.scene.userData?.dts_sequence_cyclic;if(typeof t==`string`&&typeof n==`string`)try{let r=JSON.parse(t),i=JSON.parse(n),a=new Map;for(let e=0;e{let e=C(r.animations,T,s);I.current=e;let t=e.get(`root`);t&&t.play(),B.current={name:`root`,timeScale:1};let n={head:null,headside:null};for(let{key:e,names:t}of[{key:`head`,names:[`head`]},{key:`headside`,names:[`headside`]}]){let i=r.animations.find(e=>t.includes(e.name.toLowerCase()));if(!i)continue;let a=i.clone(),o=Math.round(i.duration*30/2);b.makeClipAdditive(a,o,i,30);let s=T.clipAction(a);s.blendMode=v,s.timeScale=0,s.weight=1,s.play(),n[e]=s}L.current=n;let i=new Map,a=r.animations.find(e=>e.name.toLowerCase()===`lookde`),o=a?Math.round(a.duration*30/2):0;for(let e of[`lookde`,`lookms`,`looksn`]){let t=r.animations.find(t=>t.name.toLowerCase()===e);if(!t)continue;let n=t.clone(),s=a??t;b.makeClipAdditive(n,o,s,30);let c=T.clipAction(n);c.blendMode=v,c.timeScale=0,c.weight=0,c.play(),i.set(e,c)}R.current=i;let c=i.get(`lookde`);return c&&(c.weight=1,z.current=`lookde`),T.update(0),()=>{T.stopAllAction(),I.current=new Map,L.current={head:null,headside:null},R.current=new Map,z.current=null}},[T,r.animations,s]),(0,M.useEffect)(()=>{let e=[];for(let{mesh:t,initialize:n}of F)n(t,()=>O.getState().time).then(t=>e.push(t)).catch(()=>{});return()=>e.forEach(e=>e())},[F]);let ce=(0,M.useRef)(e.weaponShape),[J,le]=(0,M.useState)(e.weaponShape),de=(0,M.useRef)(e.packShape),[Y,fe]=(0,M.useState)(e.packShape),pe=(0,M.useRef)(e.flagShape),[X,Z]=(0,M.useState)(e.flagShape),{audioLoader:Q,audioListener:$}=te(),he=a()?.audioEnabled??!1,ge=(0,M.useRef)(null),_e=(0,M.useRef)(null),ve=(0,M.useRef)(null);return(0,M.useEffect)(()=>{if(!Q)return;let n=t.getState().playback.recording?.streamingPlayback;if(!n||!e.dataBlockId)return;let r=n.getDataBlockData.bind(n),i=r(e.dataBlockId)?.sounds?.[0];if(i==null)return;let a=re(i,r);if(a){ve.current=a;try{ne(ee(a.filename),Q,e=>{_e.current=e})}catch{}}},[Q,t,e.dataBlockId]),(0,M.useEffect)(()=>()=>{let e=ge.current;if(e){E(e);try{e.stop()}catch{}try{e.disconnect()}catch{}e.parent?.remove(e),ge.current=null}},[]),i((n,r)=>{e.weaponShape!==ce.current&&(ce.current=e.weaponShape,le(e.weaponShape)),e.packShape!==de.current&&(de.current=e.packShape,fe(e.packShape)),e.flagShape!==pe.current&&(pe.current=e.flagShape,Z(e.flagShape));let i=t.getState().playback,a=i.status===`playing`,o=O.getState().time,s=c(e.keyframes??[],o),l=s?.damageState!=null&&s.damageState>=1,d=I.current;if(l&&!V.current){V.current=!0;let e=s.actionAnim==null?void 0:G.get(s.actionAnim);if(e){let t=d.get(e.clipName);if(t){let n=d.get(B.current.name.toLowerCase());n&&n.fadeOut(u),t.setLoop(g,1),t.clampWhenFinished=!0,t.reset().fadeIn(u).play(),B.current={name:e.clipName,timeScale:1},H.current=s.actionAnim}}}if(!l&&V.current){V.current=!1,H.current=void 0;let e=d.get(B.current.name.toLowerCase());e&&(e.stop(),e.setLoop(h,1/0),e.clampWhenFinished=!1),B.current={name:`root`,timeScale:1};let t=d.get(`root`);t&&t.reset().play()}let f=s?.actionAnim,p=H.current;if(!V.current&&f!==p){H.current=f;let e=f!=null&&f>=W,t=p!=null&&p>=W;if(e){let e=G.get(f);if(e){let t=d.get(e.clipName);if(t){let n=d.get(B.current.name.toLowerCase());n&&n.fadeOut(u),t.setLoop(g,1),t.clampWhenFinished=!0,t.reset().fadeIn(u).play(),B.current={name:e.clipName,timeScale:1}}}}else if(t){let e=G.get(p);if(e){let t=d.get(e.clipName);t&&(t.fadeOut(u),t.setLoop(h,1/0),t.clampWhenFinished=!1)}B.current={name:`root`,timeScale:1};let t=d.get(`root`);t&&t.reset().fadeIn(u).play()}}if(f!=null&&f>=W&&s?.actionAtEnd){let e=G.get(f);if(e){let t=d.get(e.clipName);t&&(t.paused=!0)}}let m=H.current!=null&&H.current>=W;if(!V.current&&!m){let t=ae(s?.velocity,s?.rotation??[0,0,0,1],e.falling,e.jetting),n=B.current;if(t.animation!==n.name||t.timeScale!==n.timeScale){let e=d.get(n.name.toLowerCase()),r=d.get(t.animation.toLowerCase());r&&(q.get(t.animation)??!0?(r.setLoop(h,1/0),r.clampWhenFinished=!1):(r.setLoop(g,1),r.clampWhenFinished=!0),a&&e&&e!==r?(e.fadeOut(u),r.reset().fadeIn(u).play()):(e&&e!==r&&e.stop(),r.reset().play()),r.timeScale=t.timeScale,B.current={name:t.animation,timeScale:t.timeScale})}}let v=oe(e.weaponShape);if(v!==z.current){let e=R.current,t=z.current?e.get(z.current):null,n=e.get(v);n&&(t&&(t.weight=0),n.weight=l?0:1,z.current=v)}let{head:y,headside:b}=L.current,x=z.current?R.current.get(z.current):null,S=l?0:1,C=e.headPitch??0,ee=e.headYaw??0,te=(C+1)/2,ne=(ee+1)/2;x&&(x.time=te*x.getClip().duration,x.weight=S),y&&(y.time=te*y.getClip().duration,y.weight=S),b&&(b.time=ne*b.getClip().duration,b.weight=S);let re=!!e.jetting&&!l,D=ve.current,k=ge.current,A=k?.isPlaying??!1;if(re&&!A){if(he&&$&&_e.current&&D){let e=k;e||(e=new _($),e.setDistanceModel(`inverse`),e.setRefDistance(D.refDist),e.setMaxDistance(D.maxDist),e.setRolloffFactor(1),e.setVolume(D.volume),w.add(e),ge.current=e);try{e.setBuffer(_e.current),e.setLoop(!0),e.setPlaybackRate(i.rate),e.play(),ie(e,1)}catch{}}}else if(!re&&A&&k){E(k);try{k.stop()}catch{}}a?T.update(r*i.rate):T.update(0)}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`group`,{rotation:[0,Math.PI/2,0],children:(0,U.jsx)(`primitive`,{object:w})}),J&&j&&(0,U.jsx)(A,{fallback:(0,U.jsx)(m,{color:`red`,label:J}),children:(0,U.jsx)(D,{name:`Weapon:${e.id}/${J}`,fallback:(0,U.jsx)(m,{color:`cyan`,label:J}),children:(0,U.jsx)(ue,{entity:e,weaponShape:J,mount0:j})})},J),Y&&N&&(0,U.jsx)(A,{fallback:(0,U.jsx)(m,{color:`red`,label:Y}),children:(0,U.jsx)(D,{name:`Pack:${e.id}/${Y}`,fallback:(0,U.jsx)(m,{color:`cyan`,label:Y}),children:(0,U.jsx)(me,{packShape:Y,mountBone:N})})},Y),X&&P&&(0,U.jsx)(A,{fallback:(0,U.jsx)(m,{color:`red`,label:X}),children:(0,U.jsx)(D,{name:`Flag:${e.id}/${X}`,fallback:(0,U.jsx)(m,{color:`cyan`,label:X}),children:(0,U.jsx)(me,{packShape:X,mountBone:P})})},X)]})}function le(e,t){let n=e.userData?.dts_sequence_names;if(typeof n==`string`)try{return JSON.parse(n).map(e=>e.toLowerCase())}catch{}return t.map(e=>e.name.toLowerCase())}function ue(e){let t=(0,j.c)(43),{entity:n,weaponShape:r,mount0:s}=e,c=x(),u=p(r),m=k(),g,v,b,S;if(t[0]!==m||t[1]!==u.animations||t[2]!==u.scene){g=o(u.scene),v=f(g,void 0,{anisotropy:m});let e=l(u.scene,u.animations,`Mountpoint`);if(e){let t=e.quaternion.clone().invert(),n=e.position.clone().negate().applyQuaternion(t);g.position.copy(n),g.quaternion.copy(t)}S=new Map,g.traverse(e=>{if(!e.isMesh)return;let t=(e.userData?.vis_sequence??``).toLowerCase();if(!t)return;let n=S.get(t);n||(n=[],S.set(t,n)),n.push(e)}),b=new y(g),t[0]=m,t[1]=u.animations,t[2]=u.scene,t[3]=g,t[4]=v,t[5]=b,t[6]=S}else g=t[3],v=t[4],b=t[5],S=t[6];let C=b,E=u.scene,D;t[7]!==E||t[8]!==u.animations?(D=le(E,u.animations),t[7]=E,t[8]=u.animations,t[9]=D):D=t[9];let O=D,A;t[10]!==g||t[11]!==v||t[12]!==C||t[13]!==O||t[14]!==S?(A={weaponClone:g,weaponMixer:C,seqIndexToName:O,visNodesBySequence:S,weaponIflInitializers:v},t[10]=g,t[11]=v,t[12]=C,t[13]=O,t[14]=S,t[15]=A):A=t[15];let{weaponClone:N,weaponMixer:P,seqIndexToName:F,visNodesBySequence:ae,weaponIflInitializers:I}=A,L,R;t[16]!==N||t[17]!==P?(L=()=>()=>{d(N),P.uncacheRoot(N)},R=[N,P],t[16]=N,t[17]=P,t[18]=L,t[19]=R):(L=t[18],R=t[19]),(0,M.useEffect)(L,R);let z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(z=new Map,t[20]=z):z=t[20];let B=(0,M.useRef)(z),V=(0,M.useRef)(null),U,oe;t[21]!==u.animations||t[22]!==P?(U=()=>{let e=new Map;for(let t of u.animations)e.set(t.name.toLowerCase(),P.clipAction(t));B.current=e;let t=e.get(`spin`);return t&&(t.setLoop(h,1/0),t.timeScale=0,t.play()),V.current=t??null,P.update(0),()=>{P.stopAllAction(),B.current=new Map,V.current=null,ce(X,Z)}},oe=[P,u.animations],t[21]=u.animations,t[22]=P,t[23]=U,t[24]=oe):(U=t[23],oe=t[24]),(0,M.useEffect)(U,oe);let W,G;t[25]===I?(W=t[26],G=t[27]):(W=()=>{let e=[];for(let{mesh:t,initialize:n}of I)n(t,fe).then(t=>e.push(t)).catch(Y);return()=>e.forEach(de)},G=[I],t[25]=I,t[26]=W,t[27]=G),(0,M.useEffect)(W,G);let{audioLoader:K,audioListener:q}=te(),se=a()?.audioEnabled??!1,J=(0,M.useRef)(null),ue=(0,M.useRef)(null),me=(0,M.useRef)(n.weaponImageStates),X=(0,M.useRef)(null),Z=(0,M.useRef)(-1),Q,$;t[28]!==s||t[29]!==N?(Q=()=>(s.add(N),()=>{s.remove(N)}),$=[N,s],t[28]=s,t[29]=N,t[30]=Q,t[31]=$):(Q=t[30],$=t[31]),(0,M.useEffect)(Q,$);let he;return t[32]!==se||t[33]!==q||t[34]!==K||t[35]!==c||t[36]!==n.weaponImageState||t[37]!==n.weaponImageStates||t[38]!==F||t[39]!==ae||t[40]!==N||t[41]!==P?(he=(e,t)=>{let r=c.getState().playback,i=r.status===`playing`,a=B.current,o=n.weaponImageState,s=n.weaponImageStates;s!==me.current&&(me.current=s,s&&s.length>0?J.current=new H(s,F):J.current=null,ue.current=null,ce(X,Z,N)),!J.current&&s&&s.length>0&&(J.current=new H(s,F));let l=J.current;if(l&&o&&i){let e=t*r.rate,n=l.tick(e,o);if(pe(n,a,ue,ae),X.current&&n.stateIndex!==Z.current&&ce(X,Z,N),se&&K&&q&&n.soundDataBlockIds.length>0){let e=r.recording?.streamingPlayback.getDataBlockData.bind(r.recording.streamingPlayback);if(e)for(let t of n.soundDataBlockIds){let n=re(t,e);if(n)if(n.isLooping){if(!X.current)try{let e=ee(n.filename),t=w();ne(e,K,e=>{if(t!==w()||X.current)return;let i=l.stateIndex,a=new _(q);a.setBuffer(e),a.setDistanceModel(`inverse`),a.setRefDistance(n.refDist),a.setMaxDistance(n.maxDist),a.setRolloffFactor(1),a.setVolume(n.volume),a.setPlaybackRate(r.rate),a.setLoop(!0),N.add(a),ie(a),a.play(),X.current=a,Z.current=i})}catch{}}else T(n,q,K,void 0,N)}}V.current&&(V.current.timeScale=n.spinTimeScale)}i?P.update(t*r.rate):P.update(0)},t[32]=se,t[33]=q,t[34]=K,t[35]=c,t[36]=n.weaponImageState,t[37]=n.weaponImageStates,t[38]=F,t[39]=ae,t[40]=N,t[41]=P,t[42]=he):he=t[42],i(he),null}function de(e){return e()}function Y(){}function fe(){return O.getState().time}function pe(e,t,n,r){let i=e.sequenceName,a=n.current;if(i===a&&!e.transitioned)return;if(i!==a){if(a){let e=r.get(a);if(e)for(let t of e)t.visible=!1}if(i){let e=r.get(i);if(e)for(let t of e)t.visible=!0}}if(!i){if(a){let e=t.get(a);e&&e.fadeOut(u),n.current=null}return}let o=t.get(i);if(o&&(e.transitioned||i!==a)){let r=a?t.get(a):null;if(e.isFiring||e.timeoutValue>0?(o.setLoop(g,1),o.clampWhenFinished=!0):(o.setLoop(h,1/0),o.clampWhenFinished=!1),e.scaleAnimation&&e.timeoutValue>0){let t=o.getClip().duration;o.timeScale=t>0?t/e.timeoutValue:1}else o.timeScale=e.reverse?-1:1;r&&r!==o?(r.fadeOut(u),o.reset().fadeIn(u).play()):o.reset().play(),n.current=i}}function me(e){let t=(0,j.c)(15),{packShape:n,mountBone:r}=e,i=p(n),a=k(),s,c;if(t[0]!==a||t[1]!==i.animations||t[2]!==i.scene){s=o(i.scene),c=f(s,void 0,{anisotropy:a});let e=l(i.scene,i.animations,`Mountpoint`);if(e){let t=e.quaternion.clone().invert(),n=e.position.clone().negate().applyQuaternion(t);s.position.copy(n),s.quaternion.copy(t)}t[0]=a,t[1]=i.animations,t[2]=i.scene,t[3]=s,t[4]=c}else s=t[3],c=t[4];let u;t[5]!==s||t[6]!==c?(u={packClone:s,packIflInitializers:c},t[5]=s,t[6]=c,t[7]=u):u=t[7];let{packClone:m,packIflInitializers:h}=u,g,_;t[8]!==r||t[9]!==m?(g=()=>(r.add(m),()=>{r.remove(m),d(m)}),_=[m,r],t[8]=r,t[9]=m,t[10]=g,t[11]=_):(g=t[10],_=t[11]),(0,M.useEffect)(g,_);let v,y;return t[12]===h?(v=t[13],y=t[14]):(v=()=>{let e=[];for(let{mesh:t,initialize:n}of h)n(t,Q).then(t=>e.push(t)).catch(Z);return()=>e.forEach(X)},y=[h],t[12]=h,t[13]=v,t[14]=y),(0,M.useEffect)(v,y),null}function X(e){return e()}function Z(){}function Q(){return O.getState().time}function $(e){let t=(0,j.c)(7),{shapeName:n,eyeOffsetRef:r}=e,i=p(n),a;t[0]!==r||t[1]!==i.animations||t[2]!==i.scene?(a=()=>{let e=l(i.scene,i.animations,`Eye`);e?r.current.set(e.position.z,e.position.y,-e.position.x):r.current.set(0,s,0)},t[0]=r,t[1]=i.animations,t[2]=i.scene,t[3]=a):a=t[3];let o;return t[4]!==r||t[5]!==i?(o=[i,r],t[4]=r,t[5]=i,t[6]=o):o=t[6],(0,M.useEffect)(a,o),null}export{$ as PlayerEyeOffset,J as PlayerModel}; \ No newline at end of file diff --git a/docs/assets/Projectiles-DWQwPDtG.js b/docs/assets/Projectiles-Uxzfj6xB.js similarity index 98% rename from docs/assets/Projectiles-DWQwPDtG.js rename to docs/assets/Projectiles-Uxzfj6xB.js index 6c7ea912..d0c3dcc0 100644 --- a/docs/assets/Projectiles-DWQwPDtG.js +++ b/docs/assets/Projectiles-Uxzfj6xB.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i}from"./react-three-fiber.esm-CgPHUpXo.js";import{_ as a,h as o,m as s}from"./GenericShape-BC0gDQiR.js";import{Ot as c,St as l,Ut as u,b as d}from"./three.module-07hRbor4.js";import{p as f}from"./loaders-CIpiZadQ.js";import{t as p}from"./Texture-CIsc25mc.js";var m=t(),h=e(n(),1),g=r(),_=new u,v=new u,y=new u,b=new u,x=new u,S=new u,C=new u(0,1,0);function w(e){let t=(0,m.c)(14),{entity:n}=e,{visual:r}=n,i;t[0]===r.texture?i=t[1]:(i=f(r.texture),t[0]=r.texture,t[1]=i);let a=p(i,T),o=Array.isArray(a)?a[0]:a,s;t[2]!==r.color.b||t[3]!==r.color.g||t[4]!==r.color.r?(s=new d().setRGB(r.color.r,r.color.g,r.color.b,c),t[2]=r.color.b,t[3]=r.color.g,t[4]=r.color.r,t[5]=s):s=t[5];let l=s,u;t[6]===r.size?u=t[7]:(u=[r.size,r.size,1],t[6]=r.size,t[7]=u);let h;t[8]!==l||t[9]!==o?(h=(0,g.jsx)(`spriteMaterial`,{map:o,color:l,transparent:!0,blending:2,depthWrite:!1,toneMapped:!1}),t[8]=l,t[9]=o,t[10]=h):h=t[10];let _;return t[11]!==u||t[12]!==h?(_=(0,g.jsx)(`sprite`,{scale:u,children:h}),t[11]=u,t[12]=h,t[13]=_):_=t[13],_}function T(e){o(Array.isArray(e)?e[0]:e)}function E(e){let t=(0,m.c)(29),{entity:n}=e,{visual:r}=n,o=(0,h.useRef)(null),c=(0,h.useRef)(null),u=(0,h.useRef)(null),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=new l,t[0]=d):d=t[0];let w=(0,h.useRef)(d),T;t[1]===r.texture?T=t[2]:(T=f(r.texture),t[1]=r.texture,t[2]=T);let E=r.crossTexture??r.texture,O;t[3]===E?O=t[4]:(O=f(E),t[3]=E,t[4]=O);let k;t[5]!==T||t[6]!==O?(k=[T,O],t[5]=T,t[6]=O,t[7]=k):k=t[7];let A=p(k,D),j;t[8]===A?j=t[9]:(j=Array.isArray(A)?A:[A,A],t[8]=A,t[9]=j);let[M,N]=j,P;t[10]!==n.direction||t[11]!==n.keyframes?.[0]||t[12]!==r.crossSize||t[13]!==r.crossViewAng||t[14]!==r.renderCross||t[15]!==r.tracerLength||t[16]!==r.tracerWidth?(P=e=>{let{camera:t}=e,i=o.current,l=c.current;if(!i||!l)return;let d=n.keyframes?.[0],f=d?.position,p=n.direction??d?.velocity;if(!f||!p){i.visible=!1,u.current&&(u.current.visible=!1);return}if(a(p,_),_.lengthSq()<1e-8){i.visible=!1,u.current&&(u.current.visible=!1);return}_.normalize(),i.visible=!0,a(f,S),v.copy(S).sub(t.position),y.crossVectors(v,_),y.lengthSq()<1e-8&&(y.crossVectors(C,_),y.lengthSq()<1e-8&&y.set(1,0,0)),y.normalize().multiplyScalar(r.tracerWidth);let m=r.tracerLength*.5;b.copy(_).multiplyScalar(-m),x.copy(_).multiplyScalar(m);let h=l.array;h[0]=b.x+y.x,h[1]=b.y+y.y,h[2]=b.z+y.z,h[3]=b.x-y.x,h[4]=b.y-y.y,h[5]=b.z-y.z,h[6]=x.x-y.x,h[7]=x.y-y.y,h[8]=x.z-y.z,h[9]=x.x+y.x,h[10]=x.y+y.y,h[11]=x.z+y.z,l.needsUpdate=!0;let g=u.current;if(!g)return;if(!r.renderCross){g.visible=!1;return}v.normalize();let T=_.dot(v);if(T>-r.crossViewAng&&T{let{camera:t}=e,i=o.current,l=c.current;if(!i||!l)return;let d=n.keyframes?.[0],f=d?.position,p=n.direction??d?.velocity;if(!f||!p){i.visible=!1,u.current&&(u.current.visible=!1);return}if(a(p,_),_.lengthSq()<1e-8){i.visible=!1,u.current&&(u.current.visible=!1);return}_.normalize(),i.visible=!0,a(f,S),v.copy(S).sub(t.position),y.crossVectors(v,_),y.lengthSq()<1e-8&&(y.crossVectors(C,_),y.lengthSq()<1e-8&&y.set(1,0,0)),y.normalize().multiplyScalar(r.tracerWidth);let m=r.tracerLength*.5;b.copy(_).multiplyScalar(-m),x.copy(_).multiplyScalar(m);let h=l.array;h[0]=b.x+y.x,h[1]=b.y+y.y,h[2]=b.z+y.z,h[3]=b.x-y.x,h[4]=b.y-y.y,h[5]=b.z-y.z,h[6]=x.x-y.x,h[7]=x.y-y.y,h[8]=x.z-y.z,h[9]=x.x+y.x,h[10]=x.y+y.y,h[11]=x.z+y.z,l.needsUpdate=!0;let g=u.current;if(!g)return;if(!r.renderCross){g.visible=!1;return}v.normalize();let T=_.dot(v);if(T>-r.crossViewAng&&Te.ping),n=t.reduce((e,t)=>e+t,0)/t.length,r=t.reduce((e,t)=>e+(t-n)**2,0)/t.length;return{avg:Math.round(n),dev:Math.round(Math.sqrt(r))}}function h(e){let t=e<0?`-`:``,n=Math.abs(e),r=Math.floor(n/60),i=Math.floor(n%60);return`${t}${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`}function g(e){let t=(0,u.c)(5),{clockMs:n}=e,r=Math.abs(n)/1e3,i=n<0?Math.ceil(r):Math.floor(r),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,p.jsx)(c,{className:f.ClockIcon}),t[0]=a):a=t[0];let o;t[1]===i?o=t[2]:(o=h(i),t[1]=i,t[2]=o);let s;return t[3]===o?s=t[4]:(s=(0,p.jsxs)(`span`,{className:f.MatchClock,children:[a,` `,(0,p.jsx)(`span`,{className:f.Time,children:o})]}),t[3]=o,t[4]=s),s}function _(e){return e.name||i[e.teamId]||`Team ${e.teamId}`}function v(e){let t=(0,u.c)(56),{onClose:n}=e,r=(0,d.useRef)(null),i=o()===`live`,{connectedClientId:s,teamScores:c,playerRoster:h,matchClockMs:v}=a(se,oe),y,b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{r.current?.focus();try{document.exitPointerLock()}catch{}},b=[],t[0]=y,t[1]=b):(y=t[0],b=t[1]),(0,d.useEffect)(y,b);let x,S;t[2]===n?(x=t[3],S=t[4]):(x=()=>{let e=e=>{e.key===`Escape`&&n(),e.stopImmediatePropagation()},t=ae;return window.addEventListener(`keydown`,e,{capture:!0}),window.addEventListener(`keyup`,t,{capture:!0}),()=>{window.removeEventListener(`keydown`,e,{capture:!0}),window.removeEventListener(`keyup`,t,{capture:!0})}},S=[n],t[2]=n,t[3]=x,t[4]=S),(0,d.useEffect)(x,S);let C,w;t[5]===i?(C=t[6],w=t[7]):(C=()=>{if(!i)return;let e=ie;e();let t=setInterval(e,4e3);return()=>clearInterval(t)},w=[i],t[5]=i,t[6]=C,t[7]=w),(0,d.useEffect)(C,w);let T;if(t[8]!==h){let e=new Map,n=[];if(h)for(let t of h)if(t.teamId>0){let n=e.get(t.teamId);n?n.push(t):e.set(t.teamId,[t])}else n.push(t);for(let t of e.values())t.sort(re);n.sort(ne),T={teamPlayers:e,observers:n},t[8]=h,t[9]=T}else T=t[9];let{teamPlayers:E,observers:D}=T,O;bb0:{if(!c?.length){let e;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[10]=e):e=t[10],O=e;break bb0}let e;t[11]===c?e=t[12]:(e=[...c].sort(te),t[11]=c,t[12]=e),O=e}let k=O,A=k.length>=2,j=k[0],M=k[1],N;t[13]!==j||t[14]!==E?(N=j?E.get(j.teamId)??[]:[],t[13]=j,t[14]=E,t[15]=N):N=t[15];let P=N,F;t[16]!==M||t[17]!==E?(F=M?E.get(M.teamId)??[]:[],t[16]=M,t[17]=E,t[18]=F):F=t[18];let I=F,L;t[19]===P?L=t[20]:(L=m(P),t[19]=P,t[20]=L);let R=L,z;t[21]===I?z=t[22]:(z=m(I),t[21]=I,t[22]=z);let B=z,V=Math.max(P.length,I.length),H;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(`h2`,{className:f.Title,children:`Score`}),t[23]=H):H=t[23];let U;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,p.jsx)(l,{className:f.PlayersIcon}),t[24]=U):U=t[24];let W=h?.length??0,G;t[25]===W?G=t[26]:(G=(0,p.jsxs)(`span`,{className:f.PlayerTotal,children:[U,` `,W,` players`]}),t[25]=W,t[26]=G);let K;t[27]===v?K=t[28]:(K=v!=null&&(0,p.jsx)(g,{clockMs:v}),t[27]=v,t[28]=K);let q;t[29]!==G||t[30]!==K?(q=(0,p.jsxs)(`header`,{className:f.TitleBar,children:[H,` `,G,` `,K]}),t[29]=G,t[30]=K,t[31]=q):q=t[31];let J;t[32]!==s||t[33]!==A||t[34]!==V||t[35]!==D||t[36]!==h?.length||t[37]!==j||t[38]!==R||t[39]!==P||t[40]!==M||t[41]!==B||t[42]!==I?(J=A?(0,p.jsx)(`div`,{className:f.TableWrapper,children:(0,p.jsxs)(`table`,{className:f.Table,children:[(0,p.jsxs)(`thead`,{children:[(0,p.jsxs)(`tr`,{className:f.TeamHeaderRow,children:[(0,p.jsx)(`th`,{className:f.TeamName,children:_(j)}),(0,p.jsx)(`th`,{className:f.TeamScore,children:j.score}),(0,p.jsx)(`th`,{className:f.TeamName,children:_(M)}),(0,p.jsx)(`th`,{className:f.TeamScore,children:M.score})]}),(0,p.jsxs)(`tr`,{className:f.ColumnHeaderRow,children:[(0,p.jsxs)(`th`,{className:f.ColumnHeader,children:[(0,p.jsxs)(`span`,{children:[`Players (`,P.length,`)`]}),P.length>0&&(0,p.jsxs)(`span`,{className:f.ColumnPing,children:[` `,`PING: `,R.avg,` ± `,R.dev,` ms`]})]}),(0,p.jsx)(`th`,{className:f.ColumnHeaderScore,children:`Score`}),(0,p.jsxs)(`th`,{className:f.ColumnHeader,children:[(0,p.jsxs)(`span`,{children:[`Players (`,I.length,`)`]}),I.length>0&&(0,p.jsxs)(`span`,{className:f.ColumnPing,children:[` `,`PING: `,B.avg,` ± `,B.dev,` ms`]})]}),(0,p.jsx)(`th`,{className:f.ColumnHeaderScore,children:`Score`})]})]}),(0,p.jsx)(`tbody`,{className:f.PlayerBody,children:Array.from({length:V},(e,t)=>{let n=P[t],r=I[t],i=s!=null&&n?.clientId===s,a=s!=null&&r?.clientId===s;return(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`td`,{className:i?f.PlayerNameLocal:f.PlayerName,children:n?.name||(n?`...`:``)}),(0,p.jsx)(`td`,{className:i?f.PlayerScoreLocal:f.PlayerScore,children:n==null?``:n.score}),(0,p.jsx)(`td`,{className:a?f.PlayerNameLocal:f.PlayerName,children:r?.name||(r?`...`:``)}),(0,p.jsx)(`td`,{className:a?f.PlayerScoreLocal:f.PlayerScore,children:r==null?``:r.score})]},`${n?.clientId??``}-${r?.clientId??``}`)})}),D.length>0&&(()=>{let e=Math.ceil(D.length/2),t=Math.ceil(D.length/2);return(0,p.jsxs)(`tbody`,{className:f.ObserverBody,children:[(0,p.jsxs)(`tr`,{className:f.ColumnHeaderRow,children:[(0,p.jsxs)(`th`,{colSpan:2,className:f.ColumnHeader,children:[`Observers (`,D.length,`)`]}),(0,p.jsx)(`th`,{colSpan:2,className:f.ColumnHeader,children:`\xA0`})]}),Array.from({length:t},(t,n)=>{let r=D[n],i=D[n+e],a=s!=null&&r?.clientId===s,o=s!=null&&i?.clientId===s;return(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`td`,{className:a?f.PlayerNameLocal:f.PlayerName,children:r?.name||(r?`...`:``)}),(0,p.jsx)(`td`,{className:a?f.PlayerScoreLocal:f.PlayerScore,children:r==null?``:r.score}),(0,p.jsx)(`td`,{className:o?f.PlayerNameLocal:f.PlayerName,children:i?.name||``}),(0,p.jsx)(`td`,{className:o?f.PlayerScoreLocal:f.PlayerScore,children:i==null?``:i.score})]},`${r?.clientId??``}-${i?.clientId??``}`)})]})})()]})}):(0,p.jsx)(`div`,{className:f.Empty,children:h?.length?`No team data available`:`Waiting for player data…`}),t[32]=s,t[33]=A,t[34]=V,t[35]=D,t[36]=h?.length,t[37]=j,t[38]=R,t[39]=P,t[40]=M,t[41]=B,t[42]=I,t[43]=J):J=t[43];let Y;t[44]===n?Y=t[45]:(Y=(0,p.jsx)(`button`,{className:f.CloseButton,onClick:n,children:`Close`}),t[44]=n,t[45]=Y);let X;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,p.jsx)(`span`,{className:f.Hint,children:`Esc to close`}),t[46]=X):X=t[46];let Z;t[47]===Y?Z=t[48]:(Z=(0,p.jsxs)(`div`,{className:f.Footer,children:[Y,X]}),t[47]=Y,t[48]=Z);let Q;t[49]!==q||t[50]!==J||t[51]!==Z?(Q=(0,p.jsxs)(`div`,{ref:r,className:f.Dialog,onClick:ee,role:`dialog`,"aria-modal":`true`,"aria-label":`Score Screen`,tabIndex:-1,children:[q,J,Z]}),t[49]=q,t[50]=J,t[51]=Z,t[52]=Q):Q=t[52];let $;return t[53]!==n||t[54]!==Q?($=(0,p.jsx)(`div`,{className:f.Overlay,onClick:n,children:Q}),t[53]=n,t[54]=Q,t[55]=$):$=t[55],$}function ee(e){return e.stopPropagation()}function te(e,t){return e.teamId-t.teamId}function ne(e,t){return(e.name??``).localeCompare(t.name??``)}function re(e,t){return t.score-e.score||(e.name??``).localeCompare(t.name??``)}function ie(){s.getState().sendCommand(`getScores`)}function ae(e){e.stopImmediatePropagation()}function oe(e,t){return e.connectedClientId===t.connectedClientId&&e.teamScores===t.teamScores&&e.playerRoster===t.playerRoster&&e.matchClockMs===t.matchClockMs}function se(e){let t=e.playback.streamSnapshot;return{connectedClientId:t?.connectedClientId,teamScores:t?.teamScores,playerRoster:t?.playerRoster,matchClockMs:t?.matchClockMs}}export{v as ScoreScreen}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{t as i}from"./stringUtils-EmGsjr9D.js";import{i as a}from"./engineStore-Dkm20jvr.js";import{N as o,k as s,v as c,y as l}from"./index-DfaykQpF.js";var u=t(),d=e(n(),1),f={Dialog:`_Dialog_4rdu6_1 _Dialog_1t9wa_1`,Overlay:`_Overlay_4rdu6_11 _Overlay_1t9wa_22`,TitleBar:`_TitleBar_4rdu6_15`,PlayerTotal:`_PlayerTotal_4rdu6_27`,Title:`_Title_4rdu6_15`,MatchClock:`_MatchClock_4rdu6_46`,Time:`_Time_4rdu6_56`,PlayersIcon:`_PlayersIcon_4rdu6_60`,ClockIcon:`_ClockIcon_4rdu6_64`,TableWrapper:`_TableWrapper_4rdu6_69`,Table:`_Table_4rdu6_69`,TeamHeaderRow:`_TeamHeaderRow_4rdu6_92`,TeamName:`_TeamName_4rdu6_99`,TeamScore:`_TeamScore_4rdu6_109`,ColumnHeaderRow:`_ColumnHeaderRow_4rdu6_117`,ColumnHeader:`_ColumnHeader_4rdu6_117`,ColumnHeaderScore:`_ColumnHeaderScore_4rdu6_134`,PlayerScore:`_PlayerScore_4rdu6_141`,ColumnPing:`_ColumnPing_4rdu6_145`,PlayerBody:`_PlayerBody_4rdu6_154`,PlayerName:`_PlayerName_4rdu6_168`,PlayerNameLocal:`_PlayerNameLocal_4rdu6_179 _PlayerName_4rdu6_168`,PlayerScoreLocal:`_PlayerScoreLocal_4rdu6_193 _PlayerScore_4rdu6_141`,ObserverBody:`_ObserverBody_4rdu6_202`,Footer:`_Footer_4rdu6_223`,CloseButton:`_CloseButton_4rdu6_233 _DialogButton_1t9wa_33`,Hint:`_Hint_4rdu6_237`,Empty:`_Empty_4rdu6_243`},p=r();function m(e){if(!e.length)return{avg:0,dev:0};let t=e.map(e=>e.ping),n=t.reduce((e,t)=>e+t,0)/t.length,r=t.reduce((e,t)=>e+(t-n)**2,0)/t.length;return{avg:Math.round(n),dev:Math.round(Math.sqrt(r))}}function h(e){let t=e<0?`-`:``,n=Math.abs(e),r=Math.floor(n/60),i=Math.floor(n%60);return`${t}${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`}function g(e){let t=(0,u.c)(5),{clockMs:n}=e,r=Math.abs(n)/1e3,i=n<0?Math.ceil(r):Math.floor(r),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,p.jsx)(c,{className:f.ClockIcon}),t[0]=a):a=t[0];let o;t[1]===i?o=t[2]:(o=h(i),t[1]=i,t[2]=o);let s;return t[3]===o?s=t[4]:(s=(0,p.jsxs)(`span`,{className:f.MatchClock,children:[a,` `,(0,p.jsx)(`span`,{className:f.Time,children:o})]}),t[3]=o,t[4]=s),s}function _(e){return e.name||i[e.teamId]||`Team ${e.teamId}`}function v(e){let t=(0,u.c)(56),{onClose:n}=e,r=(0,d.useRef)(null),i=o()===`live`,{connectedClientId:s,teamScores:c,playerRoster:h,matchClockMs:v}=a(se,oe),y,b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{r.current?.focus();try{document.exitPointerLock()}catch{}},b=[],t[0]=y,t[1]=b):(y=t[0],b=t[1]),(0,d.useEffect)(y,b);let x,S;t[2]===n?(x=t[3],S=t[4]):(x=()=>{let e=e=>{e.key===`Escape`&&n(),e.stopImmediatePropagation()},t=ae;return window.addEventListener(`keydown`,e,{capture:!0}),window.addEventListener(`keyup`,t,{capture:!0}),()=>{window.removeEventListener(`keydown`,e,{capture:!0}),window.removeEventListener(`keyup`,t,{capture:!0})}},S=[n],t[2]=n,t[3]=x,t[4]=S),(0,d.useEffect)(x,S);let C,w;t[5]===i?(C=t[6],w=t[7]):(C=()=>{if(!i)return;let e=ie;e();let t=setInterval(e,4e3);return()=>clearInterval(t)},w=[i],t[5]=i,t[6]=C,t[7]=w),(0,d.useEffect)(C,w);let T;if(t[8]!==h){let e=new Map,n=[];if(h)for(let t of h)if(t.teamId>0){let n=e.get(t.teamId);n?n.push(t):e.set(t.teamId,[t])}else n.push(t);for(let t of e.values())t.sort(re);n.sort(ne),T={teamPlayers:e,observers:n},t[8]=h,t[9]=T}else T=t[9];let{teamPlayers:E,observers:D}=T,O;bb0:{if(!c?.length){let e;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[10]=e):e=t[10],O=e;break bb0}let e;t[11]===c?e=t[12]:(e=[...c].sort(te),t[11]=c,t[12]=e),O=e}let k=O,A=k.length>=2,j=k[0],M=k[1],N;t[13]!==j||t[14]!==E?(N=j?E.get(j.teamId)??[]:[],t[13]=j,t[14]=E,t[15]=N):N=t[15];let P=N,F;t[16]!==M||t[17]!==E?(F=M?E.get(M.teamId)??[]:[],t[16]=M,t[17]=E,t[18]=F):F=t[18];let I=F,L;t[19]===P?L=t[20]:(L=m(P),t[19]=P,t[20]=L);let R=L,z;t[21]===I?z=t[22]:(z=m(I),t[21]=I,t[22]=z);let B=z,V=Math.max(P.length,I.length),H;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(`h2`,{className:f.Title,children:`Score`}),t[23]=H):H=t[23];let U;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,p.jsx)(l,{className:f.PlayersIcon}),t[24]=U):U=t[24];let W=h?.length??0,G;t[25]===W?G=t[26]:(G=(0,p.jsxs)(`span`,{className:f.PlayerTotal,children:[U,` `,W,` players`]}),t[25]=W,t[26]=G);let K;t[27]===v?K=t[28]:(K=v!=null&&(0,p.jsx)(g,{clockMs:v}),t[27]=v,t[28]=K);let q;t[29]!==G||t[30]!==K?(q=(0,p.jsxs)(`header`,{className:f.TitleBar,children:[H,` `,G,` `,K]}),t[29]=G,t[30]=K,t[31]=q):q=t[31];let J;t[32]!==s||t[33]!==A||t[34]!==V||t[35]!==D||t[36]!==h?.length||t[37]!==j||t[38]!==R||t[39]!==P||t[40]!==M||t[41]!==B||t[42]!==I?(J=A?(0,p.jsx)(`div`,{className:f.TableWrapper,children:(0,p.jsxs)(`table`,{className:f.Table,children:[(0,p.jsxs)(`thead`,{children:[(0,p.jsxs)(`tr`,{className:f.TeamHeaderRow,children:[(0,p.jsx)(`th`,{className:f.TeamName,children:_(j)}),(0,p.jsx)(`th`,{className:f.TeamScore,children:j.score}),(0,p.jsx)(`th`,{className:f.TeamName,children:_(M)}),(0,p.jsx)(`th`,{className:f.TeamScore,children:M.score})]}),(0,p.jsxs)(`tr`,{className:f.ColumnHeaderRow,children:[(0,p.jsxs)(`th`,{className:f.ColumnHeader,children:[(0,p.jsxs)(`span`,{children:[`Players (`,P.length,`)`]}),P.length>0&&(0,p.jsxs)(`span`,{className:f.ColumnPing,children:[` `,`PING: `,R.avg,` ± `,R.dev,` ms`]})]}),(0,p.jsx)(`th`,{className:f.ColumnHeaderScore,children:`Score`}),(0,p.jsxs)(`th`,{className:f.ColumnHeader,children:[(0,p.jsxs)(`span`,{children:[`Players (`,I.length,`)`]}),I.length>0&&(0,p.jsxs)(`span`,{className:f.ColumnPing,children:[` `,`PING: `,B.avg,` ± `,B.dev,` ms`]})]}),(0,p.jsx)(`th`,{className:f.ColumnHeaderScore,children:`Score`})]})]}),(0,p.jsx)(`tbody`,{className:f.PlayerBody,children:Array.from({length:V},(e,t)=>{let n=P[t],r=I[t],i=s!=null&&n?.clientId===s,a=s!=null&&r?.clientId===s;return(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`td`,{className:i?f.PlayerNameLocal:f.PlayerName,children:n?.name||(n?`...`:``)}),(0,p.jsx)(`td`,{className:i?f.PlayerScoreLocal:f.PlayerScore,children:n==null?``:n.score}),(0,p.jsx)(`td`,{className:a?f.PlayerNameLocal:f.PlayerName,children:r?.name||(r?`...`:``)}),(0,p.jsx)(`td`,{className:a?f.PlayerScoreLocal:f.PlayerScore,children:r==null?``:r.score})]},`${n?.clientId??``}-${r?.clientId??``}`)})}),D.length>0&&(()=>{let e=Math.ceil(D.length/2),t=Math.ceil(D.length/2);return(0,p.jsxs)(`tbody`,{className:f.ObserverBody,children:[(0,p.jsxs)(`tr`,{className:f.ColumnHeaderRow,children:[(0,p.jsxs)(`th`,{colSpan:2,className:f.ColumnHeader,children:[`Observers (`,D.length,`)`]}),(0,p.jsx)(`th`,{colSpan:2,className:f.ColumnHeader,children:`\xA0`})]}),Array.from({length:t},(t,n)=>{let r=D[n],i=D[n+e],a=s!=null&&r?.clientId===s,o=s!=null&&i?.clientId===s;return(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`td`,{className:a?f.PlayerNameLocal:f.PlayerName,children:r?.name||(r?`...`:``)}),(0,p.jsx)(`td`,{className:a?f.PlayerScoreLocal:f.PlayerScore,children:r==null?``:r.score}),(0,p.jsx)(`td`,{className:o?f.PlayerNameLocal:f.PlayerName,children:i?.name||``}),(0,p.jsx)(`td`,{className:o?f.PlayerScoreLocal:f.PlayerScore,children:i==null?``:i.score})]},`${r?.clientId??``}-${i?.clientId??``}`)})]})})()]})}):(0,p.jsx)(`div`,{className:f.Empty,children:h?.length?`No team data available`:`Waiting for player data…`}),t[32]=s,t[33]=A,t[34]=V,t[35]=D,t[36]=h?.length,t[37]=j,t[38]=R,t[39]=P,t[40]=M,t[41]=B,t[42]=I,t[43]=J):J=t[43];let Y;t[44]===n?Y=t[45]:(Y=(0,p.jsx)(`button`,{className:f.CloseButton,onClick:n,children:`Close`}),t[44]=n,t[45]=Y);let X;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,p.jsx)(`span`,{className:f.Hint,children:`Esc to close`}),t[46]=X):X=t[46];let Z;t[47]===Y?Z=t[48]:(Z=(0,p.jsxs)(`div`,{className:f.Footer,children:[Y,X]}),t[47]=Y,t[48]=Z);let Q;t[49]!==q||t[50]!==J||t[51]!==Z?(Q=(0,p.jsxs)(`div`,{ref:r,className:f.Dialog,onClick:ee,role:`dialog`,"aria-modal":`true`,"aria-label":`Score Screen`,tabIndex:-1,children:[q,J,Z]}),t[49]=q,t[50]=J,t[51]=Z,t[52]=Q):Q=t[52];let $;return t[53]!==n||t[54]!==Q?($=(0,p.jsx)(`div`,{className:f.Overlay,onClick:n,children:Q}),t[53]=n,t[54]=Q,t[55]=$):$=t[55],$}function ee(e){return e.stopPropagation()}function te(e,t){return e.teamId-t.teamId}function ne(e,t){return(e.name??``).localeCompare(t.name??``)}function re(e,t){return t.score-e.score||(e.name??``).localeCompare(t.name??``)}function ie(){s.getState().sendCommand(`getScores`)}function ae(e){e.stopImmediatePropagation()}function oe(e,t){return e.connectedClientId===t.connectedClientId&&e.teamScores===t.teamScores&&e.playerRoster===t.playerRoster&&e.matchClockMs===t.matchClockMs}function se(e){let t=e.playback.streamSnapshot;return{connectedClientId:t?.connectedClientId,teamScores:t?.teamScores,playerRoster:t?.playerRoster,matchClockMs:t?.matchClockMs}}export{v as ScoreScreen}; \ No newline at end of file diff --git a/docs/assets/ServerBrowser-BK-yGyhv.js b/docs/assets/ServerBrowser-DxPc-p2a.js similarity index 98% rename from docs/assets/ServerBrowser-BK-yGyhv.js rename to docs/assets/ServerBrowser-DxPc-p2a.js index a59707e6..b0a7e094 100644 --- a/docs/assets/ServerBrowser-BK-yGyhv.js +++ b/docs/assets/ServerBrowser-DxPc-p2a.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as ee}from"./SettingsProvider-CCHVZuSg.js";import{A as i,y as te}from"./index-B1XI52_L.js";var ne=t(),a=e(n(),1),o={Dialog:`_Dialog_1s844_1 _Dialog_1t9wa_1`,Overlay:`_Overlay_1s844_10 _Overlay_1t9wa_22`,Header:`_Header_1s844_14`,Title:`_Title_1s844_22`,HiddenRadio:`_HiddenRadio_1s844_31`,RefreshButton:`_RefreshButton_1s844_41 _DialogButton_1t9wa_33`,ServerCount:`_ServerCount_1s844_47`,TableWrapper:`_TableWrapper_1s844_52`,Table:`_Table_1s844_52`,CompactHidden:`_CompactHidden_1s844_118`,EmptyServer:`_EmptyServer_1s844_169`,Empty:`_Empty_1s844_169`,PasswordIcon:`_PasswordIcon_1s844_186`,PlayersIcon:`_PlayersIcon_1s844_198`,Footer:`_Footer_1s844_209`,JoinButton:`_JoinButton_1s844_220 _DialogButton_1t9wa_33`,CloseButton:`_CloseButton_1s844_225 _Secondary_1t9wa_72 _DialogButton_1t9wa_33`,WarriorField:`_WarriorField_1s844_229`,WarriorLabel:`_WarriorLabel_1s844_235`,WarriorInput:`_WarriorInput_1s844_241`,Hint:`_Hint_1s844_261`,Actions:`_Actions_1s844_267 _Actions_1t9wa_86`},s=r();function c(e){let t=(0,ne.c)(102),{onClose:n}=e,r=i(le),c=i(ce),l=i(se),u=i(oe),d=i(ae),{warriorName:f,setWarriorName:ue}=ee(),[p,de]=(0,a.useState)(null),m;t[0]!==d||t[1]!==n||t[2]!==p||t[3]!==f?(m=()=>{p&&(d(p,f),n())},t[0]=d,t[1]=n,t[2]=p,t[3]=f,t[4]=m):m=t[4];let h=m,fe;t[5]!==d||t[6]!==n||t[7]!==f?(fe=e=>{d(e,f),n()},t[5]=d,t[6]=n,t[7]=f,t[8]=fe):fe=t[8];let g=fe,[_,pe]=(0,a.useState)(`ping`),[v,me]=(0,a.useState)(`asc`),he=(0,a.useRef)(null),y,b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{he.current?.focus();try{document.exitPointerLock()}catch{}},b=[],t[9]=y,t[10]=b):(y=t[9],b=t[10]),(0,a.useEffect)(y,b);let x,S;t[11]===u?(x=t[12],S=t[13]):(x=()=>{u()},S=[u],t[11]=u,t[12]=x,t[13]=S),(0,a.useEffect)(x,S);let ge,C;t[14]===n?(ge=t[15],C=t[16]):(ge=()=>{let e=e=>{e.stopPropagation(),e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},C=[n],t[14]=n,t[15]=ge,t[16]=C),(0,a.useEffect)(ge,C);let w;t[17]===_?w=t[18]:(w=e=>{_===e?me(ie):(pe(e),me(`desc`))},t[17]=_,t[18]=w);let T=w,E;if(t[19]!==r||t[20]!==v||t[21]!==_){let e;t[23]!==v||t[24]!==_?(e=(e,t)=>{let n=e[_],r=t[_],ee=typeof n==`number`&&typeof r==`number`?n-r:String(n).localeCompare(String(r));return v===`asc`?ee:-ee},t[23]=v,t[24]=_,t[25]=e):e=t[25],E=[...r].sort(e),t[19]=r,t[20]=v,t[21]=_,t[22]=E}else E=t[22];let _e=E,D;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,s.jsx)(`h2`,{className:o.Title,children:`Server Browser`}),t[26]=D):D=t[26];let ve=r.length===1?``:`s`,O;t[27]!==r.length||t[28]!==ve?(O=(0,s.jsxs)(`span`,{className:o.ServerCount,children:[r.length,` server`,ve]}),t[27]=r.length,t[28]=ve,t[29]=O):O=t[29];let k;t[30]!==u||t[31]!==c?(k=(0,s.jsx)(`button`,{className:o.RefreshButton,onClick:u,disabled:c,children:`Refresh`}),t[30]=u,t[31]=c,t[32]=k):k=t[32];let A;t[33]!==O||t[34]!==k?(A=(0,s.jsxs)(`div`,{className:o.Header,children:[D,O,k]}),t[33]=O,t[34]=k,t[35]=A):A=t[35];let j;t[36]===T?j=t[37]:(j=(0,s.jsx)(`th`,{"data-column":`server`,onClick:()=>T(`name`),children:`Server Name`}),t[36]=T,t[37]=j);let M;t[38]===T?M=t[39]:(M=()=>T(`playerCount`),t[38]=T,t[39]=M);let N;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,s.jsx)(te,{className:o.PlayersIcon,title:`Players`,"aria-label":`Players`}),t[40]=N):N=t[40];let P;t[41]===M?P=t[42]:(P=(0,s.jsx)(`th`,{"data-column":`players`,onClick:M,children:N}),t[41]=M,t[42]=P);let F;t[43]===T?F=t[44]:(F=(0,s.jsx)(`th`,{"data-column":`ping`,onClick:()=>T(`ping`),children:`Ping`}),t[43]=T,t[44]=F);let I;t[45]===T?I=t[46]:(I=(0,s.jsx)(`th`,{"data-column":`map`,onClick:()=>T(`mapName`),children:`Map`}),t[45]=T,t[46]=I);let L;t[47]===T?L=t[48]:(L=(0,s.jsx)(`th`,{"data-column":`gameType`,onClick:()=>T(`gameType`),children:`Type`}),t[47]=T,t[48]=L);let R;t[49]===T?R=t[50]:(R=(0,s.jsx)(`th`,{"data-column":`mod`,onClick:()=>T(`mod`),children:`Mod`}),t[49]=T,t[50]=R);let z;t[51]!==j||t[52]!==P||t[53]!==F||t[54]!==I||t[55]!==L||t[56]!==R?(z=(0,s.jsx)(`thead`,{children:(0,s.jsxs)(`tr`,{children:[j,P,F,I,L,R]})}),t[51]=j,t[52]=P,t[53]=F,t[54]=I,t[55]=L,t[56]=R,t[57]=z):z=t[57];let B;if(t[58]!==l||t[59]!==g||t[60]!==n||t[61]!==p||t[62]!==_e){let e;t[64]!==l||t[65]!==g||t[66]!==n||t[67]!==p?(e=e=>(0,s.jsxs)(`tr`,{onClick:()=>{de(e.address);let t=document.forms.namedItem(`serverList`).elements.namedItem(`serverAddress`);Array.from(t).find(t=>t.value===e.address).focus()},onDoubleClick:()=>{de(e.address),g(e.address),n()},children:[(0,s.jsxs)(`td`,{"data-column":`server`,children:[(0,s.jsx)(`input`,{type:`radio`,className:o.HiddenRadio,name:`serverAddress`,value:e.address,checked:p===e.address,onChange:e=>{de(e.target.value)}}),e.passwordRequired&&(0,s.jsx)(`span`,{className:o.PasswordIcon,children:`🔒`}),e.name]}),(0,s.jsxs)(`td`,{className:e.playerCount===0?o.EmptyServer:void 0,"data-column":`players`,children:[e.playerCount,(0,s.jsxs)(`span`,{className:o.CompactHidden,children:[` / `,e.maxPlayers]})]}),(0,s.jsx)(`td`,{"data-column":`ping`,children:l==null?`—`:(e.ping+l).toLocaleString()}),(0,s.jsx)(`td`,{"data-column":`map`,children:e.mapName}),(0,s.jsx)(`td`,{"data-column":`gameType`,children:e.gameType}),(0,s.jsx)(`td`,{"data-column":`mod`,children:e.mod})]},e.address),t[64]=l,t[65]=g,t[66]=n,t[67]=p,t[68]=e):e=t[68],B=_e.map(e),t[58]=l,t[59]=g,t[60]=n,t[61]=p,t[62]=_e,t[63]=B}else B=t[63];let V;t[69]===B?V=t[70]:(V=(0,s.jsx)(`tbody`,{children:B}),t[69]=B,t[70]=V);let H;t[71]!==z||t[72]!==V?(H=(0,s.jsxs)(`table`,{className:o.Table,children:[z,V]}),t[71]=z,t[72]=V,t[73]=H):H=t[73];let U;t[74]!==h||t[75]!==H?(U=(0,s.jsx)(`div`,{className:o.TableWrapper,children:(0,s.jsx)(`form`,{name:`serverList`,onSubmit:h,children:H})}),t[74]=h,t[75]=H,t[76]=U):U=t[76];let W;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,s.jsx)(`label`,{className:o.WarriorLabel,htmlFor:`warriorName`,children:`Warrior`}),t[77]=W):W=t[77];let G;t[78]===ue?G=t[79]:(G=e=>ue(e.target.value),t[78]=ue,t[79]=G);let K;t[80]!==G||t[81]!==f?(K=(0,s.jsxs)(`div`,{className:o.WarriorField,children:[W,(0,s.jsx)(`input`,{id:`warriorName`,className:o.WarriorInput,type:`text`,value:f,onChange:G,placeholder:`Name thyself…`,maxLength:24})]}),t[80]=G,t[81]=f,t[82]=K):K=t[82];let q;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,s.jsx)(`span`,{className:o.Hint,children:`Double-click a server to join`}),t[83]=q):q=t[83];let J;t[84]===n?J=t[85]:(J=(0,s.jsx)(`button`,{onClick:n,className:o.CloseButton,children:`Cancel`}),t[84]=n,t[85]=J);let ye=!p,Y;t[86]!==h||t[87]!==ye?(Y=(0,s.jsx)(`button`,{onClick:h,disabled:ye,className:o.JoinButton,children:`Join`}),t[86]=h,t[87]=ye,t[88]=Y):Y=t[88];let X;t[89]!==J||t[90]!==Y?(X=(0,s.jsxs)(`div`,{className:o.Actions,children:[J,Y]}),t[89]=J,t[90]=Y,t[91]=X):X=t[91];let Z;t[92]!==K||t[93]!==X?(Z=(0,s.jsxs)(`div`,{className:o.Footer,children:[K,q,X]}),t[92]=K,t[93]=X,t[94]=Z):Z=t[94];let Q;t[95]!==A||t[96]!==U||t[97]!==Z?(Q=(0,s.jsxs)(`div`,{className:o.Dialog,ref:he,tabIndex:-1,onClick:re,children:[A,U,Z]}),t[95]=A,t[96]=U,t[97]=Z,t[98]=Q):Q=t[98];let $;return t[99]!==n||t[100]!==Q?($=(0,s.jsx)(`div`,{className:o.Overlay,onClick:n,children:Q}),t[99]=n,t[100]=Q,t[101]=$):$=t[101],$}function re(e){return e.stopPropagation()}function ie(e){return e===`asc`?`desc`:`asc`}function ae(e){return e.joinServer}function oe(e){return e.listServers}function se(e){return e.browserToRelayPing}function ce(e){return e.serversLoading}function le(e){return e.servers}export{c as ServerBrowser}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as ee}from"./SettingsProvider-CCHVZuSg.js";import{A as i,y as te}from"./index-DfaykQpF.js";var ne=t(),a=e(n(),1),o={Dialog:`_Dialog_1s844_1 _Dialog_1t9wa_1`,Overlay:`_Overlay_1s844_10 _Overlay_1t9wa_22`,Header:`_Header_1s844_14`,Title:`_Title_1s844_22`,HiddenRadio:`_HiddenRadio_1s844_31`,RefreshButton:`_RefreshButton_1s844_41 _DialogButton_1t9wa_33`,ServerCount:`_ServerCount_1s844_47`,TableWrapper:`_TableWrapper_1s844_52`,Table:`_Table_1s844_52`,CompactHidden:`_CompactHidden_1s844_118`,EmptyServer:`_EmptyServer_1s844_169`,Empty:`_Empty_1s844_169`,PasswordIcon:`_PasswordIcon_1s844_186`,PlayersIcon:`_PlayersIcon_1s844_198`,Footer:`_Footer_1s844_209`,JoinButton:`_JoinButton_1s844_220 _DialogButton_1t9wa_33`,CloseButton:`_CloseButton_1s844_225 _Secondary_1t9wa_72 _DialogButton_1t9wa_33`,WarriorField:`_WarriorField_1s844_229`,WarriorLabel:`_WarriorLabel_1s844_235`,WarriorInput:`_WarriorInput_1s844_241`,Hint:`_Hint_1s844_261`,Actions:`_Actions_1s844_267 _Actions_1t9wa_86`},s=r();function c(e){let t=(0,ne.c)(102),{onClose:n}=e,r=i(le),c=i(ce),l=i(se),u=i(oe),d=i(ae),{warriorName:f,setWarriorName:ue}=ee(),[p,de]=(0,a.useState)(null),m;t[0]!==d||t[1]!==n||t[2]!==p||t[3]!==f?(m=()=>{p&&(d(p,f),n())},t[0]=d,t[1]=n,t[2]=p,t[3]=f,t[4]=m):m=t[4];let h=m,fe;t[5]!==d||t[6]!==n||t[7]!==f?(fe=e=>{d(e,f),n()},t[5]=d,t[6]=n,t[7]=f,t[8]=fe):fe=t[8];let g=fe,[_,pe]=(0,a.useState)(`ping`),[v,me]=(0,a.useState)(`asc`),he=(0,a.useRef)(null),y,b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{he.current?.focus();try{document.exitPointerLock()}catch{}},b=[],t[9]=y,t[10]=b):(y=t[9],b=t[10]),(0,a.useEffect)(y,b);let x,S;t[11]===u?(x=t[12],S=t[13]):(x=()=>{u()},S=[u],t[11]=u,t[12]=x,t[13]=S),(0,a.useEffect)(x,S);let ge,C;t[14]===n?(ge=t[15],C=t[16]):(ge=()=>{let e=e=>{e.stopPropagation(),e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},C=[n],t[14]=n,t[15]=ge,t[16]=C),(0,a.useEffect)(ge,C);let w;t[17]===_?w=t[18]:(w=e=>{_===e?me(ie):(pe(e),me(`desc`))},t[17]=_,t[18]=w);let T=w,E;if(t[19]!==r||t[20]!==v||t[21]!==_){let e;t[23]!==v||t[24]!==_?(e=(e,t)=>{let n=e[_],r=t[_],ee=typeof n==`number`&&typeof r==`number`?n-r:String(n).localeCompare(String(r));return v===`asc`?ee:-ee},t[23]=v,t[24]=_,t[25]=e):e=t[25],E=[...r].sort(e),t[19]=r,t[20]=v,t[21]=_,t[22]=E}else E=t[22];let _e=E,D;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,s.jsx)(`h2`,{className:o.Title,children:`Server Browser`}),t[26]=D):D=t[26];let ve=r.length===1?``:`s`,O;t[27]!==r.length||t[28]!==ve?(O=(0,s.jsxs)(`span`,{className:o.ServerCount,children:[r.length,` server`,ve]}),t[27]=r.length,t[28]=ve,t[29]=O):O=t[29];let k;t[30]!==u||t[31]!==c?(k=(0,s.jsx)(`button`,{className:o.RefreshButton,onClick:u,disabled:c,children:`Refresh`}),t[30]=u,t[31]=c,t[32]=k):k=t[32];let A;t[33]!==O||t[34]!==k?(A=(0,s.jsxs)(`div`,{className:o.Header,children:[D,O,k]}),t[33]=O,t[34]=k,t[35]=A):A=t[35];let j;t[36]===T?j=t[37]:(j=(0,s.jsx)(`th`,{"data-column":`server`,onClick:()=>T(`name`),children:`Server Name`}),t[36]=T,t[37]=j);let M;t[38]===T?M=t[39]:(M=()=>T(`playerCount`),t[38]=T,t[39]=M);let N;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,s.jsx)(te,{className:o.PlayersIcon,title:`Players`,"aria-label":`Players`}),t[40]=N):N=t[40];let P;t[41]===M?P=t[42]:(P=(0,s.jsx)(`th`,{"data-column":`players`,onClick:M,children:N}),t[41]=M,t[42]=P);let F;t[43]===T?F=t[44]:(F=(0,s.jsx)(`th`,{"data-column":`ping`,onClick:()=>T(`ping`),children:`Ping`}),t[43]=T,t[44]=F);let I;t[45]===T?I=t[46]:(I=(0,s.jsx)(`th`,{"data-column":`map`,onClick:()=>T(`mapName`),children:`Map`}),t[45]=T,t[46]=I);let L;t[47]===T?L=t[48]:(L=(0,s.jsx)(`th`,{"data-column":`gameType`,onClick:()=>T(`gameType`),children:`Type`}),t[47]=T,t[48]=L);let R;t[49]===T?R=t[50]:(R=(0,s.jsx)(`th`,{"data-column":`mod`,onClick:()=>T(`mod`),children:`Mod`}),t[49]=T,t[50]=R);let z;t[51]!==j||t[52]!==P||t[53]!==F||t[54]!==I||t[55]!==L||t[56]!==R?(z=(0,s.jsx)(`thead`,{children:(0,s.jsxs)(`tr`,{children:[j,P,F,I,L,R]})}),t[51]=j,t[52]=P,t[53]=F,t[54]=I,t[55]=L,t[56]=R,t[57]=z):z=t[57];let B;if(t[58]!==l||t[59]!==g||t[60]!==n||t[61]!==p||t[62]!==_e){let e;t[64]!==l||t[65]!==g||t[66]!==n||t[67]!==p?(e=e=>(0,s.jsxs)(`tr`,{onClick:()=>{de(e.address);let t=document.forms.namedItem(`serverList`).elements.namedItem(`serverAddress`);Array.from(t).find(t=>t.value===e.address).focus()},onDoubleClick:()=>{de(e.address),g(e.address),n()},children:[(0,s.jsxs)(`td`,{"data-column":`server`,children:[(0,s.jsx)(`input`,{type:`radio`,className:o.HiddenRadio,name:`serverAddress`,value:e.address,checked:p===e.address,onChange:e=>{de(e.target.value)}}),e.passwordRequired&&(0,s.jsx)(`span`,{className:o.PasswordIcon,children:`🔒`}),e.name]}),(0,s.jsxs)(`td`,{className:e.playerCount===0?o.EmptyServer:void 0,"data-column":`players`,children:[e.playerCount,(0,s.jsxs)(`span`,{className:o.CompactHidden,children:[` / `,e.maxPlayers]})]}),(0,s.jsx)(`td`,{"data-column":`ping`,children:l==null?`—`:(e.ping+l).toLocaleString()}),(0,s.jsx)(`td`,{"data-column":`map`,children:e.mapName}),(0,s.jsx)(`td`,{"data-column":`gameType`,children:e.gameType}),(0,s.jsx)(`td`,{"data-column":`mod`,children:e.mod})]},e.address),t[64]=l,t[65]=g,t[66]=n,t[67]=p,t[68]=e):e=t[68],B=_e.map(e),t[58]=l,t[59]=g,t[60]=n,t[61]=p,t[62]=_e,t[63]=B}else B=t[63];let V;t[69]===B?V=t[70]:(V=(0,s.jsx)(`tbody`,{children:B}),t[69]=B,t[70]=V);let H;t[71]!==z||t[72]!==V?(H=(0,s.jsxs)(`table`,{className:o.Table,children:[z,V]}),t[71]=z,t[72]=V,t[73]=H):H=t[73];let U;t[74]!==h||t[75]!==H?(U=(0,s.jsx)(`div`,{className:o.TableWrapper,children:(0,s.jsx)(`form`,{name:`serverList`,onSubmit:h,children:H})}),t[74]=h,t[75]=H,t[76]=U):U=t[76];let W;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,s.jsx)(`label`,{className:o.WarriorLabel,htmlFor:`warriorName`,children:`Warrior`}),t[77]=W):W=t[77];let G;t[78]===ue?G=t[79]:(G=e=>ue(e.target.value),t[78]=ue,t[79]=G);let K;t[80]!==G||t[81]!==f?(K=(0,s.jsxs)(`div`,{className:o.WarriorField,children:[W,(0,s.jsx)(`input`,{id:`warriorName`,className:o.WarriorInput,type:`text`,value:f,onChange:G,placeholder:`Name thyself…`,maxLength:24})]}),t[80]=G,t[81]=f,t[82]=K):K=t[82];let q;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,s.jsx)(`span`,{className:o.Hint,children:`Double-click a server to join`}),t[83]=q):q=t[83];let J;t[84]===n?J=t[85]:(J=(0,s.jsx)(`button`,{onClick:n,className:o.CloseButton,children:`Cancel`}),t[84]=n,t[85]=J);let ye=!p,Y;t[86]!==h||t[87]!==ye?(Y=(0,s.jsx)(`button`,{onClick:h,disabled:ye,className:o.JoinButton,children:`Join`}),t[86]=h,t[87]=ye,t[88]=Y):Y=t[88];let X;t[89]!==J||t[90]!==Y?(X=(0,s.jsxs)(`div`,{className:o.Actions,children:[J,Y]}),t[89]=J,t[90]=Y,t[91]=X):X=t[91];let Z;t[92]!==K||t[93]!==X?(Z=(0,s.jsxs)(`div`,{className:o.Footer,children:[K,q,X]}),t[92]=K,t[93]=X,t[94]=Z):Z=t[94];let Q;t[95]!==A||t[96]!==U||t[97]!==Z?(Q=(0,s.jsxs)(`div`,{className:o.Dialog,ref:he,tabIndex:-1,onClick:re,children:[A,U,Z]}),t[95]=A,t[96]=U,t[97]=Z,t[98]=Q):Q=t[98];let $;return t[99]!==n||t[100]!==Q?($=(0,s.jsx)(`div`,{className:o.Overlay,onClick:n,children:Q}),t[99]=n,t[100]=Q,t[101]=$):$=t[101],$}function re(e){return e.stopPropagation()}function ie(e){return e===`asc`?`desc`:`asc`}function ae(e){return e.joinServer}function oe(e){return e.listServers}function se(e){return e.browserToRelayPing}function ce(e){return e.serversLoading}function le(e){return e.servers}export{c as ServerBrowser}; \ No newline at end of file diff --git a/docs/assets/ShapeModel-BCrUHJyp.js b/docs/assets/ShapeModel-BMJjmLiG.js similarity index 98% rename from docs/assets/ShapeModel-BCrUHJyp.js rename to docs/assets/ShapeModel-BMJjmLiG.js index 0b9967ae..902751cb 100644 --- a/docs/assets/ShapeModel-BCrUHJyp.js +++ b/docs/assets/ShapeModel-BMJjmLiG.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i}from"./react-three-fiber.esm-CgPHUpXo.js";import{S as a,b as o,c as s,f as c,l,n as u,p as d,r as f,s as p,v as m,x as h,y as g}from"./GenericShape-BC0gDQiR.js";import{Q as _,o as v}from"./three.module-07hRbor4.js";import{n as y,r as b}from"./engineStore-Dkm20jvr.js";import{n as x}from"./streamPlaybackStore-DhJekvnx.js";import{c as S}from"./globalFogUniforms-CtxQvsRj.js";var C=t(),w=e(n(),1),T=r();function E(e){if(!e)return`lookde`;let t=e.toLowerCase();return t.includes(`missile`)?`lookms`:t.includes(`sniper`)?`looksn`:`lookde`}function D(e){let t=(0,C.c)(18),{entity:n}=e,r=n.weaponShape,i=n.shapeName,a=f(i),o=f(r),l;if(t[0]!==a.animations||t[1]!==a.scene||t[2]!==r||t[3]!==o.animations||t[4]!==o.scene){bb0:{let e=E(r),n=c(a.scene,a.animations,`Mount0`,[e]);if(!n){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e={position:void 0,quaternion:void 0},t[6]=e):e=t[6],l=e;break bb0}let i=c(o.scene,o.animations,`Mountpoint`),u,d;if(i){let e=i.quaternion.clone().invert(),t=i.position.clone().negate().applyQuaternion(e);d=n.quaternion.clone().multiply(e),u=t.clone().applyQuaternion(n.quaternion).add(n.position)}else u=n.position.clone(),d=n.quaternion.clone();let f=u.applyQuaternion(p),m=p.clone().multiply(d).multiply(s),h;t[7]!==f||t[8]!==m?(h={position:f,quaternion:m},t[7]=f,t[8]=m,t[9]=h):h=t[9],l=h}t[0]=a.animations,t[1]=a.scene,t[2]=r,t[3]=o.animations,t[4]=o.scene,t[5]=l}else l=t[5];let d=l,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m={_class:`weapon`,_className:`Weapon`,_id:0},t[10]=m):m=t[10];let g=m,_;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,T.jsx)(u,{loadingColor:`#4488ff`}),t[11]=_):_=t[11];let v;t[12]!==d.position||t[13]!==d.quaternion?(v=(0,T.jsx)(`group`,{position:d.position,quaternion:d.quaternion,children:_}),t[12]=d.position,t[13]=d.quaternion,t[14]=v):v=t[14];let y;return t[15]!==r||t[16]!==v?(y=(0,T.jsx)(h,{object:g,shapeName:r,type:`Item`,children:v}),t[15]=r,t[16]=v,t[17]=y):y=t[17],y}function O(e){let t=e.sizes,n=e.times;if(!Array.isArray(t)||t.length===0)return{times:[0,1],sizes:[[1,1,1],[1,1,1]]};let r=t.map(e=>[e.x/100,e.y/100,e.z/100]);return{times:Array.isArray(n)?n:r.map((e,t)=>t/Math.max(r.length-1,1)),sizes:r}}function k(e,t){let{times:n,sizes:r}=e;if(n.length===0)return[1,1,1];if(t<=n[0])return r[0];if(t>=n[n.length-1])return r[r.length-1];for(let e=0;e=n[e]&&t<=n[e+1]){let i=(t-n[e])/(n[e+1]-n[e]);return[r[e][0]+(r[e+1][0]-r[e][0])*i,r[e][1]+(r[e+1][1]-r[e][1])*i,r[e][2]+(r[e+1][2]-r[e][2])*i]}return r[r.length-1]}function A({entity:e}){let t=x.getState().playback,n=f(e.shapeName),r=S(),s=(0,w.useRef)(null),c=(0,w.useRef)(y()),u=(0,w.useRef)(Math.random()*Math.PI*2),p=(0,w.useRef)([]),h=(0,w.useMemo)(()=>{if(e.explosionDataBlockId)return t.getDataBlockData(e.explosionDataBlockId)},[e.explosionDataBlockId,t]),C=(0,w.useMemo)(()=>h?O(h):void 0,[h]),E=(0,w.useMemo)(()=>{let e=h?.explosionScale;return e?[e.x/100,e.y/100,e.z/100]:[1,1,1]},[h]),D=(h?.lifetimeMS??31)*32,A=e.faceViewer!==!1,{scene:j,mixer:M,visNodes:N,iflInfos:P,materials:F}=(0,w.useMemo)(()=>{let t=a(n.scene),i=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let n=new Set(t.userData.flag_names??[]),r=t.userData.resource_path;if(n.has(`IflMaterial`)&&r){let t=e.userData;i.push({mesh:e,iflPath:`textures/${r}.ifl`,sequenceName:t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,duration:t?.ifl_duration?Number(t.ifl_duration):void 0,cyclic:t?.ifl_sequence?!!t.ifl_cyclic:void 0,toolBegin:t?.ifl_tool_begin==null?void 0:Number(t.ifl_tool_begin)})}}),d(t,e.shapeName,{anisotropy:r});let o=[];t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let n=t.vis_keyframes,r=t.vis_duration,i=(t.vis_sequence??``).toLowerCase();!i||!Array.isArray(n)||n.length<=1||!r||r<=0||i===`ambient`&&o.push({mesh:e,keyframes:n,duration:r,cyclic:!!t.vis_cyclic})});for(let e of o)e.mesh.visible=!0,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);for(let e of i)e.mesh.userData?.vis_sequence||(e.mesh.visible=!0);let s=new Map;for(let e of n.animations)s.set(e.name.toLowerCase(),e);let c=s.get(`ambient`),l=null;if(c){l=new v(t);let e=l.clipAction(c);e.setLoop(_,1),e.clampWhenFinished=!0,e.timeScale=(h?.playSpeed??20)/20,e.play()}let u=[];return t.traverse(e=>{e.isMesh&&(Array.isArray(e.material)?u.push(...e.material):e.material&&u.push(e.material))}),t.traverse(e=>{e.frustumCulled=!1}),{scene:t,mixer:l,visNodes:o,iflInfos:i,materials:u}},[n,h,r]);return(0,w.useEffect)(()=>()=>{l(j),M?.uncacheRoot(j)},[j,M]),(0,w.useEffect)(()=>{p.current=[];for(let e of P)g(e.iflPath).then(t=>{let n=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;n&&(n.map=t.texture,n.needsUpdate=!0),p.current.push({atlas:t,info:e})}).catch(()=>{})},[P]),i((e,t)=>{let n=s.current;if(!n)return;let r=b.getState().playback,i=r.status===`playing`?t*r.rate:0,a=y()-c.current,l=Math.min(a/D,1),d=a/1e3;M&&M.update(i);let f=l>.8?1-(l-.8)/.2:1;for(let{mesh:e,keyframes:t,duration:n,cyclic:r}of N){let i=e.material;if(!i||Array.isArray(i))continue;let a=d/n,o=r?a%1:Math.min(a,1),s=t.length,c=o*s,l=Math.floor(c)%s,u=(l+1)%s,p=c-Math.floor(c);i.opacity=(t[l]+(t[u]-t[l])*p)*f}if(f<1)for(let e of F)`opacity`in e&&(e.transparent=!0,e.opacity*=f);for(let{atlas:e,info:t}of p.current){let n;n=t.sequenceName&&t.duration?(t.cyclic?d/t.duration%1:Math.min(d/t.duration,1))*t.duration+(t.toolBegin??0):d,o(e,m(e,n))}if(C){let e=k(C,l);n.scale.set(e[0]*E[0],e[1]*E[1],e[2]*E[2])}A&&(n.lookAt(e.camera.position),n.rotateZ(u.current))}),(0,T.jsx)(`group`,{ref:s,children:(0,T.jsx)(`group`,{rotation:[0,Math.PI,0],children:(0,T.jsx)(`primitive`,{object:j})})})}export{A as ExplosionShape,D as WeaponModel}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i}from"./react-three-fiber.esm-CgPHUpXo.js";import{S as a,b as o,c as s,f as c,l,n as u,p as d,r as f,s as p,v as m,x as h,y as g}from"./GenericShape-FZ5loHEW.js";import{Q as _,o as v}from"./three.module-07hRbor4.js";import{n as y,r as b}from"./engineStore-Dkm20jvr.js";import{n as x}from"./streamPlaybackStore-DhJekvnx.js";import{c as S}from"./globalFogUniforms-CtxQvsRj.js";var C=t(),w=e(n(),1),T=r();function E(e){if(!e)return`lookde`;let t=e.toLowerCase();return t.includes(`missile`)?`lookms`:t.includes(`sniper`)?`looksn`:`lookde`}function D(e){let t=(0,C.c)(18),{entity:n}=e,r=n.weaponShape,i=n.shapeName,a=f(i),o=f(r),l;if(t[0]!==a.animations||t[1]!==a.scene||t[2]!==r||t[3]!==o.animations||t[4]!==o.scene){bb0:{let e=E(r),n=c(a.scene,a.animations,`Mount0`,[e]);if(!n){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e={position:void 0,quaternion:void 0},t[6]=e):e=t[6],l=e;break bb0}let i=c(o.scene,o.animations,`Mountpoint`),u,d;if(i){let e=i.quaternion.clone().invert(),t=i.position.clone().negate().applyQuaternion(e);d=n.quaternion.clone().multiply(e),u=t.clone().applyQuaternion(n.quaternion).add(n.position)}else u=n.position.clone(),d=n.quaternion.clone();let f=u.applyQuaternion(p),m=p.clone().multiply(d).multiply(s),h;t[7]!==f||t[8]!==m?(h={position:f,quaternion:m},t[7]=f,t[8]=m,t[9]=h):h=t[9],l=h}t[0]=a.animations,t[1]=a.scene,t[2]=r,t[3]=o.animations,t[4]=o.scene,t[5]=l}else l=t[5];let d=l,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m={_class:`weapon`,_className:`Weapon`,_id:0},t[10]=m):m=t[10];let g=m,_;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,T.jsx)(u,{loadingColor:`#4488ff`}),t[11]=_):_=t[11];let v;t[12]!==d.position||t[13]!==d.quaternion?(v=(0,T.jsx)(`group`,{position:d.position,quaternion:d.quaternion,children:_}),t[12]=d.position,t[13]=d.quaternion,t[14]=v):v=t[14];let y;return t[15]!==r||t[16]!==v?(y=(0,T.jsx)(h,{object:g,shapeName:r,type:`Item`,children:v}),t[15]=r,t[16]=v,t[17]=y):y=t[17],y}function O(e){let t=e.sizes,n=e.times;if(!Array.isArray(t)||t.length===0)return{times:[0,1],sizes:[[1,1,1],[1,1,1]]};let r=t.map(e=>[e.x/100,e.y/100,e.z/100]);return{times:Array.isArray(n)?n:r.map((e,t)=>t/Math.max(r.length-1,1)),sizes:r}}function k(e,t){let{times:n,sizes:r}=e;if(n.length===0)return[1,1,1];if(t<=n[0])return r[0];if(t>=n[n.length-1])return r[r.length-1];for(let e=0;e=n[e]&&t<=n[e+1]){let i=(t-n[e])/(n[e+1]-n[e]);return[r[e][0]+(r[e+1][0]-r[e][0])*i,r[e][1]+(r[e+1][1]-r[e][1])*i,r[e][2]+(r[e+1][2]-r[e][2])*i]}return r[r.length-1]}function A({entity:e}){let t=x.getState().playback,n=f(e.shapeName),r=S(),s=(0,w.useRef)(null),c=(0,w.useRef)(y()),u=(0,w.useRef)(Math.random()*Math.PI*2),p=(0,w.useRef)([]),h=(0,w.useMemo)(()=>{if(e.explosionDataBlockId)return t.getDataBlockData(e.explosionDataBlockId)},[e.explosionDataBlockId,t]),C=(0,w.useMemo)(()=>h?O(h):void 0,[h]),E=(0,w.useMemo)(()=>{let e=h?.explosionScale;return e?[e.x/100,e.y/100,e.z/100]:[1,1,1]},[h]),D=(h?.lifetimeMS??31)*32,A=e.faceViewer!==!1,{scene:j,mixer:M,visNodes:N,iflInfos:P,materials:F}=(0,w.useMemo)(()=>{let t=a(n.scene),i=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let n=new Set(t.userData.flag_names??[]),r=t.userData.resource_path;if(n.has(`IflMaterial`)&&r){let t=e.userData;i.push({mesh:e,iflPath:`textures/${r}.ifl`,sequenceName:t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,duration:t?.ifl_duration?Number(t.ifl_duration):void 0,cyclic:t?.ifl_sequence?!!t.ifl_cyclic:void 0,toolBegin:t?.ifl_tool_begin==null?void 0:Number(t.ifl_tool_begin)})}}),d(t,e.shapeName,{anisotropy:r});let o=[];t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let n=t.vis_keyframes,r=t.vis_duration,i=(t.vis_sequence??``).toLowerCase();!i||!Array.isArray(n)||n.length<=1||!r||r<=0||i===`ambient`&&o.push({mesh:e,keyframes:n,duration:r,cyclic:!!t.vis_cyclic})});for(let e of o)e.mesh.visible=!0,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);for(let e of i)e.mesh.userData?.vis_sequence||(e.mesh.visible=!0);let s=new Map;for(let e of n.animations)s.set(e.name.toLowerCase(),e);let c=s.get(`ambient`),l=null;if(c){l=new v(t);let e=l.clipAction(c);e.setLoop(_,1),e.clampWhenFinished=!0,e.timeScale=(h?.playSpeed??20)/20,e.play()}let u=[];return t.traverse(e=>{e.isMesh&&(Array.isArray(e.material)?u.push(...e.material):e.material&&u.push(e.material))}),t.traverse(e=>{e.frustumCulled=!1}),{scene:t,mixer:l,visNodes:o,iflInfos:i,materials:u}},[n,h,r]);return(0,w.useEffect)(()=>()=>{l(j),M?.uncacheRoot(j)},[j,M]),(0,w.useEffect)(()=>{p.current=[];for(let e of P)g(e.iflPath).then(t=>{let n=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;n&&(n.map=t.texture,n.needsUpdate=!0),p.current.push({atlas:t,info:e})}).catch(()=>{})},[P]),i((e,t)=>{let n=s.current;if(!n)return;let r=b.getState().playback,i=r.status===`playing`?t*r.rate:0,a=y()-c.current,l=Math.min(a/D,1),d=a/1e3;M&&M.update(i);let f=l>.8?1-(l-.8)/.2:1;for(let{mesh:e,keyframes:t,duration:n,cyclic:r}of N){let i=e.material;if(!i||Array.isArray(i))continue;let a=d/n,o=r?a%1:Math.min(a,1),s=t.length,c=o*s,l=Math.floor(c)%s,u=(l+1)%s,p=c-Math.floor(c);i.opacity=(t[l]+(t[u]-t[l])*p)*f}if(f<1)for(let e of F)`opacity`in e&&(e.transparent=!0,e.opacity*=f);for(let{atlas:e,info:t}of p.current){let n;n=t.sequenceName&&t.duration?(t.cyclic?d/t.duration%1:Math.min(d/t.duration,1))*t.duration+(t.toolBegin??0):d,o(e,m(e,n))}if(C){let e=k(C,l);n.scale.set(e[0]*E[0],e[1]*E[1],e[2]*E[2])}A&&(n.lookAt(e.camera.position),n.rotateZ(u.current))}),(0,T.jsx)(`group`,{ref:s,children:(0,T.jsx)(`group`,{rotation:[0,Math.PI,0],children:(0,T.jsx)(`primitive`,{object:j})})})}export{A as ExplosionShape,D as WeaponModel}; \ No newline at end of file diff --git a/docs/assets/StreamingController-DfXluNV4.js b/docs/assets/StreamingController-CqQqOUzP.js similarity index 74% rename from docs/assets/StreamingController-DfXluNV4.js rename to docs/assets/StreamingController-CqQqOUzP.js index 03f7a5ed..0daf2512 100644 --- a/docs/assets/StreamingController-DfXluNV4.js +++ b/docs/assets/StreamingController-CqQqOUzP.js @@ -1,4 +1,4 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i,o as a}from"./react-three-fiber.esm-CgPHUpXo.js";import{a as o,i as s}from"./SettingsProvider-CCHVZuSg.js";import{a as c,g as l,h as u,o as d}from"./GenericShape-BC0gDQiR.js";import{t as f}from"./logger-z_EpIdIa.js";import{At as p,Bt as m,C as h,It as g,Lt as _,O as v,Pt as y,St as b,Ut as x,Vt as S,bt as C,g as w,h as T,it as E,m as D,p as O,rt as k,wt as A}from"./three.module-07hRbor4.js";import{a as j,n as M,r as N,t as P}from"./engineStore-Dkm20jvr.js";import{j as F}from"./index-B1XI52_L.js";import{p as I,r as ee}from"./loaders-CIpiZadQ.js";import{n as te}from"./AudioContext-CMp1T7r9.js";import{getCachedAudioBuffer as L,getSoundGeneration as ne,playOneShotSound as re,resolveAudioProfile as R,stopAllTrackedSounds as z,trackSound as ie,untrackSound as ae}from"./AudioEmitter-2bTNGdLP.js";import{t as oe}from"./gameEntityTypes-B1KihaDt.js";import{n as B,t as se}from"./streamPlaybackStore-DhJekvnx.js";import{l as ce}from"./globalFogUniforms-CtxQvsRj.js";import{PlayerEyeOffset as le}from"./PlayerModel-CbQhsRlW.js";var ue=t(),V=e(n(),1),de=Math.PI/180,fe=-9.81,pe=Math.PI/(180*1e3),me=1/100,he=-1e3,ge=50,H=5,_e=5,ve=10;function U(e,t,n){let r=e[t];return typeof r==`number`&&Number.isFinite(r)?r:n}function W(e,t,n){let r=e[t];return typeof r==`boolean`?r:typeof r==`number`?r!==0:n}function ye(e){let t=e.keys,n=[];if(Array.isArray(t)&&t.length>0)for(let e=0;e0&&t[0]&&(r=t[0])}return{dragCoefficient:U(e,`dragCoefficient`,0)*_e,windCoefficient:U(e,`windCoefficient`,1),gravityCoefficient:U(e,`gravityCoefficient`,0)*ve,inheritedVelFactor:U(e,`inheritedVelFactor`,0),constantAcceleration:U(e,`constantAcceleration`,0),lifetimeMS:U(e,`lifetimeMS`,31)<=t){let r=e[n-1],i=e[n],a=i.time-r.time,o=a>0?(t-r.time)/a:0;return{r:r.r+(i.r-r.r)*o,g:r.g+(i.g-r.g)*o,b:r.b+(i.b-r.b)*o,a:r.a+(i.a-r.a)*o,size:r.size+(i.size-r.size)*o}}let n=e[e.length-1];return{r:n.r,g:n.g,b:n.b,a:n.a,size:n.size}}var Te=class{data;particles=[];maxParticles;internalClock=0;nextParticleTime=0;emitterAge=0;emitterLifetime;emitterDead=!1;constructor(e,t=256,n){this.data=e,this.maxParticles=t;let r=n??e.lifetimeMS;!n&&e.lifetimeVarianceMS>0&&(r+=Math.round(G(0,e.lifetimeVarianceMS))),this.emitterLifetime=r}emitBurst(e,t,n=[0,0,1]){for(let r=0;r0;){if(this.nextParticleTime>0){let e=Math.min(r,this.nextParticleTime);this.nextParticleTime-=e,r-=e,this.internalClock+=e;continue}if(this.particles.length0)){let e=this.particles[this.particles.length-1];e.currentAge+=r,e.currentAge>=e.totalLifetime&&this.particles.pop()}let t=this.data.ejectionPeriodMS;this.data.periodVarianceMS>0&&(t+=Math.round(G(0,this.data.periodVarianceMS))),this.nextParticleTime=Math.max(1,t)}}update(e){this.emitterAge+=e,this.emitterLifetime>0&&this.emitterAge>this.emitterLifetime&&(this.emitterDead=!0);let t=e/1e3,n=this.data.particles;for(let r=this.particles.length-1;r>=0;r--){let i=this.particles[r];if(i.currentAge+=e,i.currentAge>=i.totalLifetime){this.particles[r]=this.particles[this.particles.length-1],this.particles.pop();continue}let a=n.dragCoefficient,o=n.gravityCoefficient,s=i.acc[0]-i.vel[0]*a,c=i.acc[1]-i.vel[1]*a,l=i.acc[2]-i.vel[2]*a+fe*o;i.vel[0]+=s*t,i.vel[1]+=c*t,i.vel[2]+=l*t,i.pos[0]+=i.vel[0]*t,i.pos[1]+=i.vel[1]*t,i.pos[2]+=i.vel[2]*t;let u=i.currentAge/i.totalLifetime,d=we(n.keys,u);i.r=d.r,i.g=d.g,i.b=d.b,i.a=d.a,i.size=d.size,i.currentSpin=i.spinSpeed*i.currentAge*pe}}isDead(){return this.emitterDead&&this.particles.length===0}kill(){this.emitterDead=!0}addParticle(e,t){let n=this.data,r=n.particles,i=t[0],a=t[1],o=t[2],s=Se(i,a,o),c=(n.thetaMin+Math.random()*(n.thetaMax-n.thetaMin))*de,l=(this.internalClock/1e3*n.phiReferenceVel+Math.random()*n.phiVariance)*de;[i,a,o]=Ce(i,a,o,s[0],s[1],s[2],c),[i,a,o]=Ce(i,a,o,t[0],t[1],t[2],l);let u=Math.sqrt(i*i+a*a+o*o);u>1e-8&&(i/=u,a/=u,o/=u);let d=G(n.ejectionVelocity,n.velocityVariance),f=[e[0]+i*n.ejectionOffset,e[1]+a*n.ejectionOffset,e[2]+o*n.ejectionOffset],p=[i*d,a*d,o*d],m=r.constantAcceleration,h=[p[0]*m,p[1]*m,p[2]*m],g=r.lifetimeMS;r.lifetimeVarianceMS>0&&(g+=Math.round(G(0,r.lifetimeVarianceMS))),g=Math.max(1,g);let _=r.spinSpeed+xe(r.spinRandomMin,r.spinRandomMax),v=r.keys[0];this.particles.push({pos:f,vel:p,acc:h,orientDir:[i,a,o],currentAge:0,totalLifetime:g,dataIndex:0,spinSpeed:_,currentSpin:0,r:v.r,g:v.g,b:v.b,a:v.a,size:v.size})}},Ee=` +import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i,o as a}from"./react-three-fiber.esm-CgPHUpXo.js";import{a as o,i as s}from"./SettingsProvider-CCHVZuSg.js";import{a as c,g as l,h as u,o as d}from"./GenericShape-FZ5loHEW.js";import{t as f}from"./logger-z_EpIdIa.js";import{At as p,Bt as m,C as h,It as g,Lt as _,O as v,Pt as y,St as b,Ut as x,Vt as S,bt as C,g as w,h as T,it as E,m as D,p as O,rt as k,wt as A}from"./three.module-07hRbor4.js";import{a as j,n as M,r as N,t as P}from"./engineStore-Dkm20jvr.js";import{j as F}from"./index-DfaykQpF.js";import{p as I,r as ee}from"./loaders-CIpiZadQ.js";import{n as te}from"./AudioContext-CMp1T7r9.js";import{getCachedAudioBuffer as L,getSoundGeneration as ne,playOneShotSound as re,resolveAudioProfile as R,stopAllTrackedSounds as z,trackSound as ie,untrackSound as ae}from"./AudioEmitter-Dk4R9QgT.js";import{t as oe}from"./gameEntityTypes-B1KihaDt.js";import{n as B,t as se}from"./streamPlaybackStore-DhJekvnx.js";import{l as ce}from"./globalFogUniforms-CtxQvsRj.js";import{PlayerEyeOffset as le}from"./PlayerModel-Cm8DLHtl.js";var ue=t(),V=e(n(),1),de=Math.PI/180,fe=-9.81,pe=Math.PI/(180*1e3),me=1/100,he=-1e3,ge=50,H=5,_e=5,ve=10;function U(e,t,n){let r=e[t];return typeof r==`number`&&Number.isFinite(r)?r:n}function W(e,t,n){let r=e[t];return typeof r==`boolean`?r:typeof r==`number`?r!==0:n}function ye(e){let t=e.keys,n=[];if(Array.isArray(t)&&t.length>0)for(let e=0;e0&&t[0]&&(r=t[0])}return{dragCoefficient:U(e,`dragCoefficient`,0)*_e,windCoefficient:U(e,`windCoefficient`,1),gravityCoefficient:U(e,`gravityCoefficient`,0)*ve,inheritedVelFactor:U(e,`inheritedVelFactor`,0),constantAcceleration:U(e,`constantAcceleration`,0),lifetimeMS:U(e,`lifetimeMS`,31)<=t){let r=e[n-1],i=e[n],a=i.time-r.time,o=a>0?(t-r.time)/a:0;return{r:r.r+(i.r-r.r)*o,g:r.g+(i.g-r.g)*o,b:r.b+(i.b-r.b)*o,a:r.a+(i.a-r.a)*o,size:r.size+(i.size-r.size)*o}}let n=e[e.length-1];return{r:n.r,g:n.g,b:n.b,a:n.a,size:n.size}}var Te=class{data;particles=[];maxParticles;internalClock=0;nextParticleTime=0;emitterAge=0;emitterLifetime;emitterDead=!1;constructor(e,t=256,n){this.data=e,this.maxParticles=t;let r=n??e.lifetimeMS;!n&&e.lifetimeVarianceMS>0&&(r+=Math.round(G(0,e.lifetimeVarianceMS))),this.emitterLifetime=r}emitBurst(e,t,n=[0,0,1]){for(let r=0;r0;){if(this.nextParticleTime>0){let e=Math.min(r,this.nextParticleTime);this.nextParticleTime-=e,r-=e,this.internalClock+=e;continue}if(this.particles.length0)){let e=this.particles[this.particles.length-1];e.currentAge+=r,e.currentAge>=e.totalLifetime&&this.particles.pop()}let t=this.data.ejectionPeriodMS;this.data.periodVarianceMS>0&&(t+=Math.round(G(0,this.data.periodVarianceMS))),this.nextParticleTime=Math.max(1,t)}}update(e){this.emitterAge+=e,this.emitterLifetime>0&&this.emitterAge>this.emitterLifetime&&(this.emitterDead=!0);let t=e/1e3,n=this.data.particles;for(let r=this.particles.length-1;r>=0;r--){let i=this.particles[r];if(i.currentAge+=e,i.currentAge>=i.totalLifetime){this.particles[r]=this.particles[this.particles.length-1],this.particles.pop();continue}let a=n.dragCoefficient,o=n.gravityCoefficient,s=i.acc[0]-i.vel[0]*a,c=i.acc[1]-i.vel[1]*a,l=i.acc[2]-i.vel[2]*a+fe*o;i.vel[0]+=s*t,i.vel[1]+=c*t,i.vel[2]+=l*t,i.pos[0]+=i.vel[0]*t,i.pos[1]+=i.vel[1]*t,i.pos[2]+=i.vel[2]*t;let u=i.currentAge/i.totalLifetime,d=we(n.keys,u);i.r=d.r,i.g=d.g,i.b=d.b,i.a=d.a,i.size=d.size,i.currentSpin=i.spinSpeed*i.currentAge*pe}}isDead(){return this.emitterDead&&this.particles.length===0}kill(){this.emitterDead=!0}addParticle(e,t){let n=this.data,r=n.particles,i=t[0],a=t[1],o=t[2],s=Se(i,a,o),c=(n.thetaMin+Math.random()*(n.thetaMax-n.thetaMin))*de,l=(this.internalClock/1e3*n.phiReferenceVel+Math.random()*n.phiVariance)*de;[i,a,o]=Ce(i,a,o,s[0],s[1],s[2],c),[i,a,o]=Ce(i,a,o,t[0],t[1],t[2],l);let u=Math.sqrt(i*i+a*a+o*o);u>1e-8&&(i/=u,a/=u,o/=u);let d=G(n.ejectionVelocity,n.velocityVariance),f=[e[0]+i*n.ejectionOffset,e[1]+a*n.ejectionOffset,e[2]+o*n.ejectionOffset],p=[i*d,a*d,o*d],m=r.constantAcceleration,h=[p[0]*m,p[1]*m,p[2]*m],g=r.lifetimeMS;r.lifetimeVarianceMS>0&&(g+=Math.round(G(0,r.lifetimeVarianceMS))),g=Math.max(1,g);let _=r.spinSpeed+xe(r.spinRandomMin,r.spinRandomMax),v=r.keys[0];this.particles.push({pos:f,vel:p,acc:h,orientDir:[i,a,o],currentAge:0,totalLifetime:g,dataIndex:0,spinSpeed:_,currentSpin:0,r:v.r,g:v.g,b:v.b,a:v.a,size:v.size})}},Ee=` // 'position' is auto-declared by Three.js for ShaderMaterial. attribute vec4 particleColor; attribute float particleSize; @@ -86,4 +86,4 @@ void main() { vec4 tex = texture2D(uTexture, vUV); gl_FragColor = vec4(vColor.rgb * tex.rgb, vColor.a * tex.a); } -`;function He(e){let t=(e+1)*2,n=new Float32Array(t*3),r=new Float32Array(t*2),i=new Float32Array(t*4),a=e*6,o=new Uint16Array(a);for(let t=0;t0){let e=0;for(let n of t)e=Math.max(e,n.x,n.y,n.z);if(e>0)return e/1e3}let n=e.particleRadius;return typeof n==`number`&&n>0?n:5}function qe(e){let t=new T,n=e*4,r=e*6,i=new Float32Array(n*2);for(let t=0;t{let i=p.current,a=r.current;if(!i||!a)return;let o=N.getState().playback,s=o.status===`playing`,m=s?t*o.rate:0,g=m*1e3,v=n.getDataBlockData.bind(n);for(let e of a.entities){if(e.type!==`Explosion`||!e.explosionDataBlockId||!e.position||_.current.has(e.id))continue;_.current.add(e.id);let t=Xe(e.explosionDataBlockId,v);if(!t)continue;let n=[...e.position];for(let e of t.burstEmitters){let t=new Te(e.data,q);t.emitBurst(n,e.density);let r=Y(e.data.particles.textureName),a=qe(q),o=Je(r,e.data.particles.useInvAlpha,e.data.orientParticles),s=new k(a,o);s.frustumCulled=!1,i.add(s),h.current.push({emitter:t,mesh:s,geometry:a,material:o,targetTexture:r,origin:n,isBurst:!0,hasBurst:!0})}for(let e of t.streamingEmitters){let r=new Te(e,q,t.lifetimeMS),a=Y(e.particles.textureName),o=qe(q),s=Je(a,e.particles.useInvAlpha,e.orientParticles),c=new k(o,s);c.frustumCulled=!1,i.add(c),h.current.push({emitter:r,mesh:c,geometry:o,material:s,targetTexture:a,origin:n,isBurst:!1,hasBurst:!1})}let r=v(e.explosionDataBlockId);if(c){let a=r?Ke(r):5,o=Ge(e.dataBlock),s=new E({color:o,wireframe:!0,transparent:!0,opacity:1,depthWrite:!1}),c=new k(Ie,s);c.frustumCulled=!1,c.scale.setScalar(a),c.position.set(n[1],n[2],n[0]),i.add(c);let{sprite:l,material:u}=Le(`${e.id}: ${e.dataBlock??`expId:${e.explosionDataBlockId}`}`,o);l.position.set(n[1],n[2]+a+2,n[0]),l.frustumCulled=!1,i.add(l),O.current.push({entityId:e.id,mesh:c,material:s,label:l,labelMaterial:u,creationTime:M(),lifetimeMS:Math.max(t.lifetimeMS,3e3),targetRadius:a})}let a=r?.shockwave;if(typeof a==`number`){let t=Re(a,v);if(t){let r=Y(t.textureName),a=He(t.numSegments),o=We(r),s=new k(a,o);s.frustumCulled=!1,s.position.set(n[1],n[2],n[0]),i.add(s);let c=null,l=null;t.renderBottom&&(l=He(t.numSegments),c=new k(l,o),c.frustumCulled=!1,c.position.set(n[1],n[2],n[0]),c.scale.y=-1,i.add(c));let u=Math.abs(t.velocity)>1e-10?t.velocity:0;j.current.push({entityId:e.id,mesh:s,bottomMesh:c,geometry:a,bottomGeometry:l,material:o,creationTime:M(),lifetimeMS:t.lifetimeMS,data:t,radius:0,velocity:u})}}}let b=new Set;for(let e of a.entities){if(b.add(e.id),!e.maintainEmitterId||y.current.has(e.id))continue;y.current.add(e.id);let t=v(e.maintainEmitterId);if(!t)continue;let n=be(t,v);if(!n)continue;let r=e.position?[...e.position]:[0,0,0],a=new Te(n,q),o=Y(n.particles.textureName),s=qe(q),c=Je(o,n.particles.useInvAlpha,n.orientParticles),l=new k(s,c);l.frustumCulled=!1,i.add(l),h.current.push({emitter:a,mesh:l,geometry:s,material:c,targetTexture:o,origin:r,isBurst:!1,hasBurst:!1,followEntityId:e.id})}for(let e of h.current)e.followEntityId&&!b.has(e.followEntityId)&&e.emitter.kill();for(let e of y.current)b.has(e)||y.current.delete(e);let w=h.current;for(let e=w.length-1;e>=0;e--){let t=w[e];if(t.shaderChecked||=(Ye(f,t.material,t.isBurst?`burst`:`stream`),!0),t.followEntityId){let e=a.entities.find(e=>e.id===t.followEntityId);e?.position&&(t.origin[0]=e.position[0],t.origin[1]=e.position[1],t.origin[2]=e.position[2]),e?.direction&&(t.emitAxis=e.direction)}if(t.isBurst||t.emitter.emitPeriodic(t.origin,g,t.emitAxis),t.emitter.update(g),je.has(t.targetTexture)&&t.material.uniforms.particleTexture.value!==t.targetTexture&&(t.material.uniforms.particleTexture.value=t.targetTexture),t.material.uniforms.debugOpacity.value=c?.2:1,Ze(t),c){t.debugOriginMesh||(t.debugOriginMesh=new k(Me,Ne),t.debugOriginMesh.frustumCulled=!1,i.add(t.debugOriginMesh)),t.debugOriginMesh.position.set(t.origin[1],t.origin[2],t.origin[0]),t.debugParticleMeshes||=[];let e=Math.min(t.emitter.particles.length,8);for(;t.debugParticleMeshes.length=0;e--){let t=D[e],n=A-t.creationTime,r=Math.min(n/t.lifetimeMS,1),a=Math.min(r/.1,1);t.mesh.scale.setScalar(t.targetRadius*a),t.material.opacity=1-r,t.labelMaterial.opacity=1-r,r>=1&&(i.remove(t.mesh),i.remove(t.label),t.material.dispose(),t.labelMaterial.dispose(),D.splice(e,1))}let P=j.current;for(let t=P.length-1;t>=0;t--){let n=P[t],r=A-n.creationTime,a=Math.min(r/n.lifetimeMS,1),o=m;n.velocity+=n.data.acceleration*o,n.radius+=n.velocity*o;let s=ze(n.data,a);Ue(n.geometry,n.data,n.radius,s,n.data.is2D),n.bottomGeometry&&Ue(n.bottomGeometry,n.data,n.radius,s,n.data.is2D),n.data.is2D&&n.mesh.lookAt(e.camera.position),a>=1&&(i.remove(n.mesh),n.bottomMesh&&i.remove(n.bottomMesh),n.geometry.dispose(),n.bottomGeometry?.dispose(),n.material.dispose(),P.splice(t,1))}if(s&&l&&u&&d&&p.current){for(let e of a.entities){if(e.type!==`Explosion`||!e.explosionDataBlockId||!e.position)continue;let t=`snd:${e.id}`;if(T.current.has(t))continue;T.current.add(t);let n=v(e.explosionDataBlockId);if(!n)continue;let r=n.soundProfile;if(typeof r!=`number`)continue;let i=R(r,v);i&&re(i,d,u,new x(e.position[1],e.position[2],e.position[0]),p.current)}let e=S.current;for(let t of a.entities){if(t.type!==`Projectile`||!t.dataBlockId||!t.position)continue;if(e.has(t.id)){e.get(t.id).position.set(t.position[1],t.position[2],t.position[0]);continue}if(e.size>=Qe)continue;let n=v(t.dataBlockId);if(!n)continue;let r=n.sound;if(typeof r!=`number`)continue;let i=R(r,v);if(!(!i||!i.isLooping||!i.is3D))try{let n=ee(i.filename),r=ne();L(n,u,n=>{if(r!==ne()||!b.has(t.id)||e.has(t.id))return;let a=p.current;if(!a)return;let s=new C(d);s.setBuffer(n),s.setDistanceModel(`inverse`),s.setRefDistance(i.refDist),s.setMaxDistance(i.maxDist),s.setRolloffFactor(1),s.setVolume(i.volume),s.setPlaybackRate(o.rate),s.setLoop(!0),s.position.set(t.position[1],t.position[2],t.position[0]),a.add(s),ie(s),s.play(),e.set(t.id,s)})}catch{}}for(let[t,n]of e)if(!b.has(t)){ae(n);try{n.stop()}catch{}try{n.disconnect()}catch{}p.current?.remove(n),e.delete(t)}for(let e of a.audioEvents){let t=`${e.timeSec}:${e.profileId}:${e.position?.x??``}`;if(T.current.has(t))continue;T.current.add(t);let n=R(e.profileId,v);n&&re(n,d,u,e.position?new x(e.position.y,e.position.z,e.position.x):void 0,p.current)}}if(_.current.size>500){let e=new Set(a.entities.map(tt));for(let t of _.current)e.has(t)||_.current.delete(t)}if(T.current.size>500){let e=new Set(a.entities.map(et));for(let t of T.current)t.startsWith(`snd:`)&&e.has(t.slice(4))||T.current.delete(t)}},t[7]=l,t[8]=d,t[9]=u,t[10]=c,t[11]=f,t[12]=n,t[13]=r,t[14]=P):P=t[14],i(P);let F,I;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{let e=p.current;for(let t of h.current){if(e&&(e.remove(t.mesh),t.debugOriginMesh&&e.remove(t.debugOriginMesh),t.debugParticleMeshes))for(let n of t.debugParticleMeshes)e.remove(n);t.geometry.dispose(),t.material.dispose()}h.current=[];for(let t of O.current)e&&(e.remove(t.mesh),e.remove(t.label)),t.material.dispose(),t.labelMaterial.dispose();O.current=[];for(let t of j.current)e&&(e.remove(t.mesh),t.bottomMesh&&e.remove(t.bottomMesh)),t.geometry.dispose(),t.bottomGeometry?.dispose(),t.material.dispose();j.current=[],_.current.clear(),y.current.clear();for(let[,t]of S.current){ae(t);try{t.stop()}catch{}try{t.disconnect()}catch{}e&&e.remove(t)}S.current.clear(),T.current.clear()},F=[],t[15]=F,t[16]=I):(F=t[15],I=t[16]),(0,V.useEffect)(I,F);let z;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,K.jsx)(`group`,{ref:p}),t[17]=z):z=t[17],z}function et(e){return e.id}function tt(e){return e.id}function nt(e){return e.gl}function X(e,t){return{id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t,position:e.position,rotation:e.rotation,velocity:e.velocity,keyframes:[{time:t??0,position:e.position??[0,0,0],rotation:e.rotation??[0,0,0,1]}]}}function rt(e,t){if(e.sceneData){let n={id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t};switch(e.sceneData.className){case`TerrainBlock`:return{...n,renderType:`TerrainBlock`,terrainData:e.sceneData};case`InteriorInstance`:return{...n,renderType:`InteriorInstance`,interiorData:e.sceneData};case`Sky`:return{...n,renderType:`Sky`,skyData:e.sceneData};case`Sun`:return{...n,renderType:`Sun`,sunData:e.sceneData};case`WaterBlock`:return{...n,renderType:`WaterBlock`,waterData:e.sceneData};case`MissionArea`:return{...n,renderType:`MissionArea`,missionAreaData:e.sceneData};case`TSStatic`:return{...X(e,t),renderType:`Shape`,shapeName:e.sceneData.shapeName,shapeType:`TSStatic`,dataBlock:e.dataBlock}}}return e.visual?.kind===`tracer`?{...X(e,t),renderType:`Tracer`,visual:e.visual,dataBlock:e.dataBlock,direction:e.direction}:e.visual?.kind===`sprite`?{...X(e,t),renderType:`Sprite`,visual:e.visual}:e.type===`Player`?{...X(e,t),renderType:`Player`,shapeName:e.dataBlock,dataBlock:e.dataBlock,weaponShape:e.weaponShape,packShape:e.packShape,flagShape:e.flagShape,falling:e.falling,jetting:e.jetting,playerName:e.playerName,iffColor:e.iffColor,threads:e.threads,weaponImageState:e.weaponImageState,weaponImageStates:e.weaponImageStates,headPitch:e.headPitch,headYaw:e.headYaw,targetRenderFlags:e.targetRenderFlags}:e.type===`Explosion`?e.dataBlock?{...X(e,t),renderType:`Explosion`,shapeName:e.dataBlock,dataBlock:e.dataBlock,explosionDataBlockId:e.explosionDataBlockId,faceViewer:e.faceViewer}:{...X(e,t),renderType:`None`}:e.className===`ForceFieldBare`?{...X(e,t),renderType:`ForceFieldBare`,forceFieldData:e.forceFieldData?{textures:e.forceFieldData.textures,color:e.forceFieldData.color,baseTranslucency:e.forceFieldData.baseTranslucency,numFrames:e.forceFieldData.textures.length,framesPerSec:e.forceFieldData.framesPerSec,scrollSpeed:e.forceFieldData.scrollSpeed,umapping:e.forceFieldData.umapping,vmapping:e.forceFieldData.vmapping,dimensions:e.forceFieldData.dimensions}:void 0}:e.className===`AudioEmitter`?{...X(e,t),renderType:`AudioEmitter`,audioFileName:e.audioFileName,audioVolume:e.audioVolume,audioIs3D:e.audioIs3D,audioIsLooping:e.audioIsLooping??!0,audioMinDistance:e.audioMinDistance,audioMaxDistance:e.audioMaxDistance,audioMinLoopGap:e.audioMinLoopGap,audioMaxLoopGap:e.audioMaxLoopGap}:e.className===`WayPoint`?{...X(e,t),renderType:`WayPoint`,label:e.label}:e.className===`Camera`?{...X(e,t),renderType:`Camera`}:{...X(e,t),renderType:`Shape`,shapeName:e.dataBlock,shapeType:e.className===`Turret`?`Turret`:e.className===`Item`?`Item`:`StaticShape`,dataBlock:e.dataBlock,weaponShape:e.weaponShape,threads:e.threads,targetRenderFlags:e.targetRenderFlags,iffColor:e.iffColor}}function it(e,t){return e[t]}function at(e,t){switch(e.renderType){case`Player`:{let n=e;n.threads=t.threads,n.weaponShape=t.weaponShape,n.packShape=t.packShape,n.flagShape=t.flagShape,n.falling=t.falling,n.jetting=t.jetting,n.weaponImageState=t.weaponImageState,n.weaponImageStates=t.weaponImageStates,n.playerName=t.playerName,n.iffColor=t.iffColor,n.headPitch=t.headPitch,n.headYaw=t.headYaw,n.targetRenderFlags=t.targetRenderFlags;break}case`Shape`:{let n=e;n.threads=t.threads,n.targetRenderFlags=t.targetRenderFlags,n.iffColor=t.iffColor;break}}}var ot=new WeakMap;function st(e){let t=ot.get(e);return t||(t=new Map(e.entities.map(e=>[e.id,e])),ot.set(e,t)),t}function ct(e){F.getState().setAllStreamEntities(Array.from(e.values()))}var lt=new x,Z=new b,ut=new b,dt=new b(0,1,0,0),Q=new x,$=new x,ft=new x;function pt(e){let t=(0,ue.c)(26),{recording:n}=e,r=j(),{fov:a}=o(),s=(0,V.useRef)(0),u=(0,V.useRef)(null),f=(0,V.useRef)(null),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=new x(0,c,0),t[0]=p):p=t[0];let m=(0,V.useRef)(p),h=(0,V.useRef)(n.streamingPlayback??null),g=(0,V.useRef)(null),_;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=new Map,t[1]=_):_=t[1];let v=(0,V.useRef)(_),y=(0,V.useRef)(null),[b,S]=(0,V.useState)(null),C;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{if(e===y.current)return;y.current=e;let t=v.current,n=new Map;for(let r of e.entities){let i=t.get(r.id),a=i&&(i.renderType===`Shape`||i.renderType===`Player`||i.renderType===`Explosion`);if(!i||i.className!==(r.className??r.type)||i.ghostIndex!==r.ghostIndex||i.dataBlockId!==r.dataBlockId||i.shapeHint!==r.shapeHint||a&&r.dataBlock!=null&&it(i,`shapeName`)!==r.dataBlock||i.renderType!==`Player`&&a&&it(i,`weaponShape`)!==r.weaponShape?i=rt(r,e.timeSec):at(i,r),n.set(r.id,i),oe(i)||i.renderType===`None`)continue;let o=i.keyframes;o.length===0&&o.push({time:e.timeSec,position:r.position??[0,0,0],rotation:r.rotation??[0,0,0,1]});let s=o[0];s.time=e.timeSec,r.position&&(s.position=r.position),r.rotation&&(s.rotation=r.rotation),s.velocity=r.velocity,s.health=r.health,s.energy=r.energy,s.actionAnim=r.actionAnim,s.actionAtEnd=r.actionAtEnd,s.damageState=r.damageState}for(let[r,i]of t)if(!n.has(r)&&i.renderType===`Explosion`&&i.shapeName&&i.spawnTime!=null&&e.timeSec-i.spawnTime<5){n.set(r,i);continue}let r=n.size!==t.size||[...n.keys()].some(e=>!t.has(e));v.current=n,r&&ct(n);let i=null;if(e.camera?.mode===`first-person`&&e.camera.controlEntityId){let t=n.get(e.camera.controlEntityId),r=t?it(t,`shapeName`):void 0;r&&(i=r)}S(e=>e===i?e:i)},t[2]=C):C=t[2];let w=C,T;t[3]!==r||t[4]!==n.gameType||t[5]!==n.missionName||t[6]!==n.recorderName||t[7]!==n.recordingDate||t[8]!==n.serverDisplayName||t[9]!==n.source||t[10]!==n.streamingPlayback?(T=()=>{z(),h.current=n.streamingPlayback??null,v.current=new Map,y.current=null,g.current=null,se(),s.current=0,u.current=null,f.current=null;let e=h.current;if(B.setState({playback:e}),F.getState().beginStreaming(n.source),!e){r.getState().setPlaybackStreamSnapshot(null);return}e.onMissionInfoChange=()=>{F.getState().setMissionInfo({missionDisplayName:e.missionDisplayName??void 0,missionTypeDisplayName:e.missionTypeDisplayName??void 0,gameClassName:e.gameClassName??void 0,recorderName:e.connectedPlayerName??void 0})};let t=e.missionDisplayName,i=e.missionTypeDisplayName,a=e.gameClassName,o=e.serverDisplayName,c=e.connectedPlayerName;n.source!==`live`&&e.reset(),e.missionDisplayName=t,e.missionTypeDisplayName=i,e.gameClassName=a,e.serverDisplayName=o,e.connectedPlayerName=c,F.getState().setMissionInfo({missionName:n.missionName??void 0,missionTypeDisplayName:n.gameType??void 0,missionDisplayName:t??void 0,gameClassName:a??void 0,serverDisplayName:o??n.serverDisplayName??void 0,recorderName:c??n.recorderName??void 0,recordingDate:n.recordingDate??void 0});let l=e.getSnapshot();return B.setState({time:l.timeSec}),s.current=l.timeSec,u.current=l,f.current=l,w(l),r.getState().setPlaybackStreamSnapshot(l),g.current=l,()=>{z(),h.current=null,se()}},t[3]=r,t[4]=n.gameType,t[5]=n.missionName,t[6]=n.recorderName,t[7]=n.recordingDate,t[8]=n.serverDisplayName,t[9]=n.source,t[10]=n.streamingPlayback,t[11]=T):T=t[11];let E;t[12]!==r||t[13]!==n?(E=[n,r,w],t[12]=r,t[13]=n,t[14]=E):E=t[14],(0,V.useEffect)(T,E);let D;t[15]!==r||t[16]!==n.source||t[17]!==a?(D=(e,t)=>{let i=h.current;if(!i)return;let o=r.getState(),c=o.playback,p=c.status===`playing`,_=c.timeMs/1e3,y=!p&&Math.abs(_-s.current)>5e-4,b=p&&Math.abs(_-B.getState().time)>.05,x=y||b;x&&(s.current=_),p&&(P(t,c.rate),s.current+=t*c.rate);let S=Math.max(1,Math.ceil(t*1e3*Math.max(c.rate,.01)/32)+2),C=s.current+d,T=i.stepToTime(C,p&&!x?S:1/0),E=f.current;!E||T.timeSec.032*1.5?(u.current=T,f.current=T):T.timeSec!==E.timeSec&&(u.current=E,f.current=T);let D=f.current??T,O=u.current??D,k=D.timeSec-d,A=Math.max(0,Math.min(1,(s.current-k)/d));B.setState({time:s.current}),T.exhausted&&p&&(s.current=Math.min(s.current,T.timeSec)),w(D),B.getState().entities=v.current,D!==g.current&&(g.current=D,o.setPlaybackStreamSnapshot(D));let j=D.camera,M=j&&O.camera&&O.camera.mode===j.mode&&O.camera.controlEntityId===j.controlEntityId&&O.camera.orbitTargetId===j.orbitTargetId?O.camera:null,N=B.getState().cameraMode,F=n.source===`live`;if(j&&N!==`freeFly`){if(!F&&N!==`orbitOverride`)if(M){let t=M.position[0],n=M.position[1],r=M.position[2],i=j.position[0],a=j.position[1],o=j.position[2],s=t+(i-t)*A,c=n+(a-n)*A,l=r+(o-r)*A;e.camera.position.set(c,l,s),Z.set(...M.rotation),ut.set(...j.rotation),Z.slerp(ut,A),e.camera.quaternion.copy(Z)}else e.camera.position.set(j.position[1],j.position[2],j.position[0]),e.camera.quaternion.set(...j.rotation);if(`isPerspectiveCamera`in e.camera&&e.camera.isPerspectiveCamera){let t=e.camera,n=l(a,t.aspect);Math.abs(t.fov-n)>.01&&(t.fov=n,t.updateProjectionMatrix())}}let I=st(D),ee=st(O),te=v.current,L=B.getState().root;if(L)for(let t of L.children){let n=te.get(t.name);if(n&&oe(n))continue;let r=I.get(t.name);if(!r){let e=n&&`keyframes`in n?n.keyframes:void 0;if(e?.[0]?.position){let n=e[0];t.visible=!0,t.position.set(n.position[1],n.position[2],n.position[0]);continue}}if(!r?.position){t.visible=!1;continue}t.visible=!0;let i=ee.get(t.name);if(i?.position){let e=i.position[0],n=i.position[1],a=i.position[2],o=r.position[0],s=r.position[1],c=r.position[2],l=e+(o-e)*A,u=n+(s-n)*A,d=a+(c-a)*A;t.position.set(u,d,l)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion).multiply(dt):r.visual?.kind===`tracer`?t.quaternion.identity():r.rotation&&(i?.rotation?(Z.set(...i.rotation),ut.set(...r.rotation),Z.slerp(ut,A),t.quaternion.copy(Z)):t.quaternion.set(...r.rotation))}let ne=j?.mode,re=N===`orbitOverride`&&!F&&j?.orbitTargetId!=null;if(N!==`freeFly`&&!F&&(ne===`third-person`||re)&&L&&j?.orbitTargetId){let t=L.children.find(e=>e.name===j.orbitTargetId);if(t){let n=I.get(j.orbitTargetId);$.copy(t.position),n?.type===`Player`&&($.y+=1);let r=!1;if(re){let e=B.getState(),t=Math.sin(e.orbitOverridePitch),n=Math.cos(e.orbitOverridePitch),i=Math.sin(e.orbitOverrideYaw),a=Math.cos(e.orbitOverrideYaw);Q.set(-a*n,-t,-i*n),r=Q.lengthSq()>1e-8}else if(j.orbitDirection)Q.set(j.orbitDirection[0],j.orbitDirection[1],j.orbitDirection[2]),r=Q.lengthSq()>1e-8;else if(typeof j.yaw==`number`&&typeof j.pitch==`number`){let e=Math.sin(j.pitch),t=Math.cos(j.pitch),n=Math.sin(j.yaw),i=Math.cos(j.yaw);Q.set(-i*t,-e,-n*t),r=Q.lengthSq()>1e-8}if(r||=(Q.copy(e.camera.position).sub($),Q.lengthSq()>1e-8),r){Q.normalize();let t=Math.max(.1,j.orbitDistance??4);ft.copy($).addScaledVector(Q,t),e.camera.position.copy(ft),e.camera.lookAt($)}}}if(N===`original`&&ne===`first-person`&&L&&j?.controlEntityId){let t=L.children.find(e=>e.name===j.controlEntityId);t?(lt.copy(m.current).applyQuaternion(t.quaternion),e.camera.position.add(lt)):e.camera.position.y=e.camera.position.y+m.current.y}p&&T.exhausted&&o.setPlaybackStatus(`paused`);let R=s.current*1e3;Math.abs(R-c.timeMs)>.5&&o.setPlaybackTime(R)},t[15]=r,t[16]=n.source,t[17]=a,t[18]=D):D=t[18],i(D);let O;t[19]===n.streamingPlayback?O=t[20]:(O=(0,K.jsx)($e,{playback:n.streamingPlayback,snapshotRef:f}),t[19]=n.streamingPlayback,t[20]=O);let k;t[21]===b?k=t[22]:(k=b&&(0,K.jsx)(V.Suspense,{children:(0,K.jsx)(le,{shapeName:b,eyeOffsetRef:m})}),t[21]=b,t[22]=k);let A;return t[23]!==O||t[24]!==k?(A=(0,K.jsxs)(K.Fragment,{children:[O,k]}),t[23]=O,t[24]=k,t[25]=A):A=t[25],A}export{pt as StreamingController}; \ No newline at end of file +`;function He(e){let t=(e+1)*2,n=new Float32Array(t*3),r=new Float32Array(t*2),i=new Float32Array(t*4),a=e*6,o=new Uint16Array(a);for(let t=0;t0){let e=0;for(let n of t)e=Math.max(e,n.x,n.y,n.z);if(e>0)return e/1e3}let n=e.particleRadius;return typeof n==`number`&&n>0?n:5}function qe(e){let t=new T,n=e*4,r=e*6,i=new Float32Array(n*2);for(let t=0;t{let i=p.current,a=r.current;if(!i||!a)return;let o=N.getState().playback,s=o.status===`playing`,m=s?t*o.rate:0,g=m*1e3,v=n.getDataBlockData.bind(n);for(let e of a.entities){if(e.type!==`Explosion`||!e.explosionDataBlockId||!e.position||_.current.has(e.id))continue;_.current.add(e.id);let t=Xe(e.explosionDataBlockId,v);if(!t)continue;let n=[...e.position];for(let e of t.burstEmitters){let t=new Te(e.data,q);t.emitBurst(n,e.density);let r=Y(e.data.particles.textureName),a=qe(q),o=Je(r,e.data.particles.useInvAlpha,e.data.orientParticles),s=new k(a,o);s.frustumCulled=!1,i.add(s),h.current.push({emitter:t,mesh:s,geometry:a,material:o,targetTexture:r,origin:n,isBurst:!0,hasBurst:!0})}for(let e of t.streamingEmitters){let r=new Te(e,q,t.lifetimeMS),a=Y(e.particles.textureName),o=qe(q),s=Je(a,e.particles.useInvAlpha,e.orientParticles),c=new k(o,s);c.frustumCulled=!1,i.add(c),h.current.push({emitter:r,mesh:c,geometry:o,material:s,targetTexture:a,origin:n,isBurst:!1,hasBurst:!1})}let r=v(e.explosionDataBlockId);if(c){let a=r?Ke(r):5,o=Ge(e.dataBlock),s=new E({color:o,wireframe:!0,transparent:!0,opacity:1,depthWrite:!1}),c=new k(Ie,s);c.frustumCulled=!1,c.scale.setScalar(a),c.position.set(n[1],n[2],n[0]),i.add(c);let{sprite:l,material:u}=Le(`${e.id}: ${e.dataBlock??`expId:${e.explosionDataBlockId}`}`,o);l.position.set(n[1],n[2]+a+2,n[0]),l.frustumCulled=!1,i.add(l),O.current.push({entityId:e.id,mesh:c,material:s,label:l,labelMaterial:u,creationTime:M(),lifetimeMS:Math.max(t.lifetimeMS,3e3),targetRadius:a})}let a=r?.shockwave;if(typeof a==`number`){let t=Re(a,v);if(t){let r=Y(t.textureName),a=He(t.numSegments),o=We(r),s=new k(a,o);s.frustumCulled=!1,s.position.set(n[1],n[2],n[0]),i.add(s);let c=null,l=null;t.renderBottom&&(l=He(t.numSegments),c=new k(l,o),c.frustumCulled=!1,c.position.set(n[1],n[2],n[0]),c.scale.y=-1,i.add(c));let u=Math.abs(t.velocity)>1e-10?t.velocity:0;j.current.push({entityId:e.id,mesh:s,bottomMesh:c,geometry:a,bottomGeometry:l,material:o,creationTime:M(),lifetimeMS:t.lifetimeMS,data:t,radius:0,velocity:u})}}}let b=new Set;for(let e of a.entities){if(b.add(e.id),!e.maintainEmitterId||y.current.has(e.id))continue;y.current.add(e.id);let t=v(e.maintainEmitterId);if(!t)continue;let n=be(t,v);if(!n)continue;let r=e.position?[...e.position]:[0,0,0],a=new Te(n,q),o=Y(n.particles.textureName),s=qe(q),c=Je(o,n.particles.useInvAlpha,n.orientParticles),l=new k(s,c);l.frustumCulled=!1,i.add(l),h.current.push({emitter:a,mesh:l,geometry:s,material:c,targetTexture:o,origin:r,isBurst:!1,hasBurst:!1,followEntityId:e.id})}for(let e of h.current)e.followEntityId&&!b.has(e.followEntityId)&&e.emitter.kill();for(let e of y.current)b.has(e)||y.current.delete(e);let w=h.current;for(let e=w.length-1;e>=0;e--){let t=w[e];if(t.shaderChecked||=(Ye(f,t.material,t.isBurst?`burst`:`stream`),!0),t.followEntityId){let e=a.entities.find(e=>e.id===t.followEntityId);e?.position&&(t.origin[0]=e.position[0],t.origin[1]=e.position[1],t.origin[2]=e.position[2]),e?.direction&&(t.emitAxis=e.direction)}if(t.isBurst||t.emitter.emitPeriodic(t.origin,g,t.emitAxis),t.emitter.update(g),je.has(t.targetTexture)&&t.material.uniforms.particleTexture.value!==t.targetTexture&&(t.material.uniforms.particleTexture.value=t.targetTexture),t.material.uniforms.debugOpacity.value=c?.2:1,Ze(t),c){t.debugOriginMesh||(t.debugOriginMesh=new k(Me,Ne),t.debugOriginMesh.frustumCulled=!1,i.add(t.debugOriginMesh)),t.debugOriginMesh.position.set(t.origin[1],t.origin[2],t.origin[0]),t.debugParticleMeshes||=[];let e=Math.min(t.emitter.particles.length,8);for(;t.debugParticleMeshes.length=0;e--){let t=D[e],n=A-t.creationTime,r=Math.min(n/t.lifetimeMS,1),a=Math.min(r/.1,1);t.mesh.scale.setScalar(t.targetRadius*a),t.material.opacity=1-r,t.labelMaterial.opacity=1-r,r>=1&&(i.remove(t.mesh),i.remove(t.label),t.material.dispose(),t.labelMaterial.dispose(),D.splice(e,1))}let P=j.current;for(let t=P.length-1;t>=0;t--){let n=P[t],r=A-n.creationTime,a=Math.min(r/n.lifetimeMS,1),o=m;n.velocity+=n.data.acceleration*o,n.radius+=n.velocity*o;let s=ze(n.data,a);Ue(n.geometry,n.data,n.radius,s,n.data.is2D),n.bottomGeometry&&Ue(n.bottomGeometry,n.data,n.radius,s,n.data.is2D),n.data.is2D&&n.mesh.lookAt(e.camera.position),a>=1&&(i.remove(n.mesh),n.bottomMesh&&i.remove(n.bottomMesh),n.geometry.dispose(),n.bottomGeometry?.dispose(),n.material.dispose(),P.splice(t,1))}if(s&&l&&u&&d&&p.current){for(let e of a.entities){if(e.type!==`Explosion`||!e.explosionDataBlockId||!e.position)continue;let t=`snd:${e.id}`;if(T.current.has(t))continue;T.current.add(t);let n=v(e.explosionDataBlockId);if(!n)continue;let r=n.soundProfile;if(typeof r!=`number`)continue;let i=R(r,v);i&&re(i,d,u,new x(e.position[1],e.position[2],e.position[0]),p.current)}let e=S.current;for(let t of a.entities){if(t.type!==`Projectile`||!t.dataBlockId||!t.position)continue;if(e.has(t.id)){e.get(t.id).position.set(t.position[1],t.position[2],t.position[0]);continue}if(e.size>=Qe)continue;let n=v(t.dataBlockId);if(!n)continue;let r=n.sound;if(typeof r!=`number`)continue;let i=R(r,v);if(!(!i||!i.isLooping||!i.is3D))try{let n=ee(i.filename),r=ne();L(n,u,n=>{if(r!==ne()||!b.has(t.id)||e.has(t.id))return;let a=p.current;if(!a)return;let s=new C(d);s.setBuffer(n),s.setDistanceModel(`inverse`),s.setRefDistance(i.refDist),s.setMaxDistance(i.maxDist),s.setRolloffFactor(1),s.setVolume(i.volume),s.setPlaybackRate(o.rate),s.setLoop(!0),s.position.set(t.position[1],t.position[2],t.position[0]),a.add(s),ie(s),s.play(),e.set(t.id,s)})}catch{}}for(let[t,n]of e)if(!b.has(t)){ae(n);try{n.stop()}catch{}try{n.disconnect()}catch{}p.current?.remove(n),e.delete(t)}for(let e of a.audioEvents){let t=`${e.timeSec}:${e.profileId}:${e.position?.x??``}`;if(T.current.has(t))continue;T.current.add(t);let n=R(e.profileId,v);n&&re(n,d,u,e.position?new x(e.position.y,e.position.z,e.position.x):void 0,p.current)}}if(_.current.size>500){let e=new Set(a.entities.map(tt));for(let t of _.current)e.has(t)||_.current.delete(t)}if(T.current.size>500){let e=new Set(a.entities.map(et));for(let t of T.current)t.startsWith(`snd:`)&&e.has(t.slice(4))||T.current.delete(t)}},t[7]=l,t[8]=d,t[9]=u,t[10]=c,t[11]=f,t[12]=n,t[13]=r,t[14]=P):P=t[14],i(P);let F,I;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{let e=p.current;for(let t of h.current){if(e&&(e.remove(t.mesh),t.debugOriginMesh&&e.remove(t.debugOriginMesh),t.debugParticleMeshes))for(let n of t.debugParticleMeshes)e.remove(n);t.geometry.dispose(),t.material.dispose()}h.current=[];for(let t of O.current)e&&(e.remove(t.mesh),e.remove(t.label)),t.material.dispose(),t.labelMaterial.dispose();O.current=[];for(let t of j.current)e&&(e.remove(t.mesh),t.bottomMesh&&e.remove(t.bottomMesh)),t.geometry.dispose(),t.bottomGeometry?.dispose(),t.material.dispose();j.current=[],_.current.clear(),y.current.clear();for(let[,t]of S.current){ae(t);try{t.stop()}catch{}try{t.disconnect()}catch{}e&&e.remove(t)}S.current.clear(),T.current.clear()},F=[],t[15]=F,t[16]=I):(F=t[15],I=t[16]),(0,V.useEffect)(I,F);let z;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,K.jsx)(`group`,{ref:p}),t[17]=z):z=t[17],z}function et(e){return e.id}function tt(e){return e.id}function nt(e){return e.gl}function X(e,t){return{id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t,position:e.position,rotation:e.rotation,velocity:e.velocity,keyframes:[{time:t??0,position:e.position??[0,0,0],rotation:e.rotation??[0,0,0,1]}]}}function rt(e,t){if(e.sceneData){let n={id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t};switch(e.sceneData.className){case`TerrainBlock`:return{...n,renderType:`TerrainBlock`,terrainData:e.sceneData};case`InteriorInstance`:return{...n,renderType:`InteriorInstance`,interiorData:e.sceneData};case`Sky`:return{...n,renderType:`Sky`,skyData:e.sceneData};case`Sun`:return{...n,renderType:`Sun`,sunData:e.sceneData};case`WaterBlock`:return{...n,renderType:`WaterBlock`,waterData:e.sceneData};case`MissionArea`:return{...n,renderType:`MissionArea`,missionAreaData:e.sceneData};case`TSStatic`:return{...X(e,t),renderType:`Shape`,shapeName:e.sceneData.shapeName,shapeType:`TSStatic`,dataBlock:e.dataBlock}}}return e.visual?.kind===`tracer`?{...X(e,t),renderType:`Tracer`,visual:e.visual,dataBlock:e.dataBlock,direction:e.direction}:e.visual?.kind===`sprite`?{...X(e,t),renderType:`Sprite`,visual:e.visual}:e.type===`Player`?{...X(e,t),renderType:`Player`,shapeName:e.dataBlock,dataBlock:e.dataBlock,weaponShape:e.weaponShape,packShape:e.packShape,flagShape:e.flagShape,falling:e.falling,jetting:e.jetting,playerName:e.playerName,iffColor:e.iffColor,threads:e.threads,weaponImageState:e.weaponImageState,weaponImageStates:e.weaponImageStates,headPitch:e.headPitch,headYaw:e.headYaw,targetRenderFlags:e.targetRenderFlags}:e.type===`Explosion`?e.dataBlock?{...X(e,t),renderType:`Explosion`,shapeName:e.dataBlock,dataBlock:e.dataBlock,explosionDataBlockId:e.explosionDataBlockId,faceViewer:e.faceViewer}:{...X(e,t),renderType:`None`}:e.className===`ForceFieldBare`?{...X(e,t),renderType:`ForceFieldBare`,forceFieldData:e.forceFieldData?{textures:e.forceFieldData.textures,color:e.forceFieldData.color,baseTranslucency:e.forceFieldData.baseTranslucency,numFrames:e.forceFieldData.textures.length,framesPerSec:e.forceFieldData.framesPerSec,scrollSpeed:e.forceFieldData.scrollSpeed,umapping:e.forceFieldData.umapping,vmapping:e.forceFieldData.vmapping,dimensions:e.forceFieldData.dimensions}:void 0}:e.className===`AudioEmitter`?{...X(e,t),renderType:`AudioEmitter`,audioFileName:e.audioFileName,audioVolume:e.audioVolume,audioIs3D:e.audioIs3D,audioIsLooping:e.audioIsLooping??!0,audioMinDistance:e.audioMinDistance,audioMaxDistance:e.audioMaxDistance,audioMinLoopGap:e.audioMinLoopGap,audioMaxLoopGap:e.audioMaxLoopGap}:e.className===`WayPoint`?{...X(e,t),renderType:`WayPoint`,label:e.label}:e.className===`Camera`?{...X(e,t),renderType:`Camera`}:{...X(e,t),renderType:`Shape`,shapeName:e.dataBlock,shapeType:e.className===`Turret`?`Turret`:e.className===`Item`?`Item`:`StaticShape`,dataBlock:e.dataBlock,weaponShape:e.weaponShape,threads:e.threads,targetRenderFlags:e.targetRenderFlags,iffColor:e.iffColor,wheels:e.wheels,steeringYaw:e.steeringYaw,frozen:e.frozen,maxSteeringAngle:e.maxSteeringAngle}}function it(e,t){return e[t]}function at(e,t){switch(e.renderType){case`Player`:{let n=e;n.threads=t.threads,n.weaponShape=t.weaponShape,n.packShape=t.packShape,n.flagShape=t.flagShape,n.falling=t.falling,n.jetting=t.jetting,n.weaponImageState=t.weaponImageState,n.weaponImageStates=t.weaponImageStates,n.playerName=t.playerName,n.iffColor=t.iffColor,n.headPitch=t.headPitch,n.headYaw=t.headYaw,n.targetRenderFlags=t.targetRenderFlags;break}case`Shape`:{let n=e;n.threads=t.threads,n.targetRenderFlags=t.targetRenderFlags,n.iffColor=t.iffColor;break}}}var ot=new WeakMap;function st(e){let t=ot.get(e);return t||(t=new Map(e.entities.map(e=>[e.id,e])),ot.set(e,t)),t}function ct(e){F.getState().setAllStreamEntities(Array.from(e.values()))}var lt=new x,Z=new b,ut=new b,dt=new b(0,1,0,0),Q=new x,$=new x,ft=new x;function pt(e){let t=(0,ue.c)(26),{recording:n}=e,r=j(),{fov:a}=o(),s=(0,V.useRef)(0),u=(0,V.useRef)(null),f=(0,V.useRef)(null),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=new x(0,c,0),t[0]=p):p=t[0];let m=(0,V.useRef)(p),h=(0,V.useRef)(n.streamingPlayback??null),g=(0,V.useRef)(null),_;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=new Map,t[1]=_):_=t[1];let v=(0,V.useRef)(_),y=(0,V.useRef)(null),[b,S]=(0,V.useState)(null),C;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{if(e===y.current)return;y.current=e;let t=v.current,n=new Map;for(let r of e.entities){let i=t.get(r.id),a=i&&(i.renderType===`Shape`||i.renderType===`Player`||i.renderType===`Explosion`);if(!i||i.className!==(r.className??r.type)||i.ghostIndex!==r.ghostIndex||i.dataBlockId!==r.dataBlockId||i.shapeHint!==r.shapeHint||a&&r.dataBlock!=null&&it(i,`shapeName`)!==r.dataBlock||i.renderType!==`Player`&&a&&it(i,`weaponShape`)!==r.weaponShape?i=rt(r,e.timeSec):at(i,r),n.set(r.id,i),oe(i)||i.renderType===`None`)continue;let o=i.keyframes;o.length===0&&o.push({time:e.timeSec,position:r.position??[0,0,0],rotation:r.rotation??[0,0,0,1]});let s=o[0];s.time=e.timeSec,r.position&&(s.position=r.position),r.rotation&&(s.rotation=r.rotation),s.velocity=r.velocity,s.health=r.health,s.energy=r.energy,s.actionAnim=r.actionAnim,s.actionAtEnd=r.actionAtEnd,s.damageState=r.damageState}for(let[r,i]of t)if(!n.has(r)&&i.renderType===`Explosion`&&i.shapeName&&i.spawnTime!=null&&e.timeSec-i.spawnTime<5){n.set(r,i);continue}let r=n.size!==t.size||[...n.keys()].some(e=>!t.has(e));v.current=n,r&&ct(n);let i=null;if(e.camera?.mode===`first-person`&&e.camera.controlEntityId){let t=n.get(e.camera.controlEntityId),r=t?it(t,`shapeName`):void 0;r&&(i=r)}S(e=>e===i?e:i)},t[2]=C):C=t[2];let w=C,T;t[3]!==r||t[4]!==n.gameType||t[5]!==n.missionName||t[6]!==n.recorderName||t[7]!==n.recordingDate||t[8]!==n.serverDisplayName||t[9]!==n.source||t[10]!==n.streamingPlayback?(T=()=>{z(),h.current=n.streamingPlayback??null,v.current=new Map,y.current=null,g.current=null,se(),s.current=0,u.current=null,f.current=null;let e=h.current;if(B.setState({playback:e}),F.getState().beginStreaming(n.source),!e){r.getState().setPlaybackStreamSnapshot(null);return}e.onMissionInfoChange=()=>{F.getState().setMissionInfo({missionDisplayName:e.missionDisplayName??void 0,missionTypeDisplayName:e.missionTypeDisplayName??void 0,gameClassName:e.gameClassName??void 0,recorderName:e.connectedPlayerName??void 0})};let t=e.missionDisplayName,i=e.missionTypeDisplayName,a=e.gameClassName,o=e.serverDisplayName,c=e.connectedPlayerName;n.source!==`live`&&e.reset(),e.missionDisplayName=t,e.missionTypeDisplayName=i,e.gameClassName=a,e.serverDisplayName=o,e.connectedPlayerName=c,F.getState().setMissionInfo({missionName:n.missionName??void 0,missionTypeDisplayName:n.gameType??void 0,missionDisplayName:t??void 0,gameClassName:a??void 0,serverDisplayName:o??n.serverDisplayName??void 0,recorderName:c??n.recorderName??void 0,recordingDate:n.recordingDate??void 0});let l=e.getSnapshot();return B.setState({time:l.timeSec}),s.current=l.timeSec,u.current=l,f.current=l,w(l),r.getState().setPlaybackStreamSnapshot(l),g.current=l,()=>{z(),h.current=null,se()}},t[3]=r,t[4]=n.gameType,t[5]=n.missionName,t[6]=n.recorderName,t[7]=n.recordingDate,t[8]=n.serverDisplayName,t[9]=n.source,t[10]=n.streamingPlayback,t[11]=T):T=t[11];let E;t[12]!==r||t[13]!==n?(E=[n,r,w],t[12]=r,t[13]=n,t[14]=E):E=t[14],(0,V.useEffect)(T,E);let D;t[15]!==r||t[16]!==n.source||t[17]!==a?(D=(e,t)=>{let i=h.current;if(!i)return;let o=r.getState(),c=o.playback,p=c.status===`playing`,_=c.timeMs/1e3,y=!p&&Math.abs(_-s.current)>5e-4,b=p&&Math.abs(_-B.getState().time)>.05,x=y||b;x&&(s.current=_),p&&(P(t,c.rate),s.current+=t*c.rate);let S=Math.max(1,Math.ceil(t*1e3*Math.max(c.rate,.01)/32)+2),C=s.current+d,T=i.stepToTime(C,p&&!x?S:1/0),E=f.current;!E||T.timeSec.032*1.5?(u.current=T,f.current=T):T.timeSec!==E.timeSec&&(u.current=E,f.current=T);let D=f.current??T,O=u.current??D,k=D.timeSec-d,A=Math.max(0,Math.min(1,(s.current-k)/d));B.setState({time:s.current}),T.exhausted&&p&&(s.current=Math.min(s.current,T.timeSec)),w(D),B.getState().entities=v.current,D!==g.current&&(g.current=D,o.setPlaybackStreamSnapshot(D));let j=D.camera,M=j&&O.camera&&O.camera.mode===j.mode&&O.camera.controlEntityId===j.controlEntityId&&O.camera.orbitTargetId===j.orbitTargetId?O.camera:null,N=B.getState().cameraMode,F=n.source===`live`;if(j&&N!==`freeFly`){if(!F&&N!==`orbitOverride`)if(M){let t=M.position[0],n=M.position[1],r=M.position[2],i=j.position[0],a=j.position[1],o=j.position[2],s=t+(i-t)*A,c=n+(a-n)*A,l=r+(o-r)*A;e.camera.position.set(c,l,s),Z.set(...M.rotation),ut.set(...j.rotation),Z.slerp(ut,A),e.camera.quaternion.copy(Z)}else e.camera.position.set(j.position[1],j.position[2],j.position[0]),e.camera.quaternion.set(...j.rotation);if(`isPerspectiveCamera`in e.camera&&e.camera.isPerspectiveCamera){let t=e.camera,n=l(a,t.aspect);Math.abs(t.fov-n)>.01&&(t.fov=n,t.updateProjectionMatrix())}}let I=st(D),ee=st(O),te=v.current,L=B.getState().root;if(L)for(let t of L.children){let n=te.get(t.name);if(n&&oe(n))continue;let r=I.get(t.name);if(!r){let e=n&&`keyframes`in n?n.keyframes:void 0;if(e?.[0]?.position){let n=e[0];t.visible=!0,t.position.set(n.position[1],n.position[2],n.position[0]);continue}}if(!r?.position){t.visible=!1;continue}t.visible=!0;let i=ee.get(t.name);if(i?.position){let e=i.position[0],n=i.position[1],a=i.position[2],o=r.position[0],s=r.position[1],c=r.position[2],l=e+(o-e)*A,u=n+(s-n)*A,d=a+(c-a)*A;t.position.set(u,d,l)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion).multiply(dt):r.visual?.kind===`tracer`?t.quaternion.identity():r.rotation&&(i?.rotation?(Z.set(...i.rotation),ut.set(...r.rotation),Z.slerp(ut,A),t.quaternion.copy(Z)):t.quaternion.set(...r.rotation))}let ne=j?.mode,re=N===`orbitOverride`&&!F&&j?.orbitTargetId!=null;if(N!==`freeFly`&&!F&&(ne===`third-person`||re)&&L&&j?.orbitTargetId){let t=L.children.find(e=>e.name===j.orbitTargetId);if(t){let n=I.get(j.orbitTargetId);$.copy(t.position),n?.type===`Player`&&($.y+=1);let r=!1;if(re){let e=B.getState(),t=Math.sin(e.orbitOverridePitch),n=Math.cos(e.orbitOverridePitch),i=Math.sin(e.orbitOverrideYaw),a=Math.cos(e.orbitOverrideYaw);Q.set(-a*n,-t,-i*n),r=Q.lengthSq()>1e-8}else if(j.orbitDirection)Q.set(j.orbitDirection[0],j.orbitDirection[1],j.orbitDirection[2]),r=Q.lengthSq()>1e-8;else if(typeof j.yaw==`number`&&typeof j.pitch==`number`){let e=Math.sin(j.pitch),t=Math.cos(j.pitch),n=Math.sin(j.yaw),i=Math.cos(j.yaw);Q.set(-i*t,-e,-n*t),r=Q.lengthSq()>1e-8}if(r||=(Q.copy(e.camera.position).sub($),Q.lengthSq()>1e-8),r){Q.normalize();let t=Math.max(.1,j.orbitDistance??4);ft.copy($).addScaledVector(Q,t),e.camera.position.copy(ft),e.camera.lookAt($)}}}if(N===`original`&&ne===`first-person`&&L&&j?.controlEntityId){let t=L.children.find(e=>e.name===j.controlEntityId);t?(lt.copy(m.current).applyQuaternion(t.quaternion),e.camera.position.add(lt)):e.camera.position.y=e.camera.position.y+m.current.y}p&&T.exhausted&&o.setPlaybackStatus(`paused`);let R=s.current*1e3;Math.abs(R-c.timeMs)>.5&&o.setPlaybackTime(R)},t[15]=r,t[16]=n.source,t[17]=a,t[18]=D):D=t[18],i(D);let O;t[19]===n.streamingPlayback?O=t[20]:(O=(0,K.jsx)($e,{playback:n.streamingPlayback,snapshotRef:f}),t[19]=n.streamingPlayback,t[20]=O);let k;t[21]===b?k=t[22]:(k=b&&(0,K.jsx)(V.Suspense,{children:(0,K.jsx)(le,{shapeName:b,eyeOffsetRef:m})}),t[21]=b,t[22]=k);let A;return t[23]!==O||t[24]!==k?(A=(0,K.jsxs)(K.Fragment,{children:[O,k]}),t[23]=O,t[24]=k,t[25]=A):A=t[25],A}export{pt as StreamingController}; \ No newline at end of file diff --git a/docs/assets/TouchHandler-CV_1nnl6.js b/docs/assets/TouchHandler-BGxxpP92.js similarity index 95% rename from docs/assets/TouchHandler-CV_1nnl6.js rename to docs/assets/TouchHandler-BGxxpP92.js index a6f00c96..8d3540d1 100644 --- a/docs/assets/TouchHandler-CV_1nnl6.js +++ b/docs/assets/TouchHandler-BGxxpP92.js @@ -1 +1 @@ -import{n as e}from"./jsx-runtime-BpGWiA-R.js";import{i as t}from"./react-three-fiber.esm-CgPHUpXo.js";import{r as n}from"./SettingsProvider-CCHVZuSg.js";import{n as r}from"./JoystickContext-YJ6eVLFP.js";import{f as i,h as a}from"./index-B1XI52_L.js";var o=e(),s=.004,c=2.5,l=.08,u=.15,d=.15;function f(){let e=(0,o.c)(9),{speedMultiplier:f,touchMode:p,invertDrag:m,invertJoystick:h}=n(),{moveState:g,lookState:_}=r(),v=a(),[,y]=i(),b;return e[0]!==y||e[1]!==m||e[2]!==h||e[3]!==_.current||e[4]!==g.current||e[5]!==v||e[6]!==f||e[7]!==p?(b=(e,t)=>{let{force:n,angle:r}=g.current,{force:i,angle:a}=_.current,o=y().touchLook,b=m?1:-1,x=0,S=0;p===`moveLookStick`&&o&&o.dragging&&(x=b*o.deltaX*s,S=b*o.deltaY*s);let C=0,w=0;if(p===`dualStick`){if(i>u){let e=(i-u)/(1-u),n=Math.cos(a),r=Math.sin(a),o=h?1:-1;x-=o*n*e*c*t,S+=o*r*e*c*t}if(n>l){let e=(n-l)/(1-l),t=Math.cos(r),i=Math.sin(r);C=Math.max(-1,Math.min(1,t*e*f)),w=Math.max(-1,Math.min(1,i*e*f))}}else if(p===`moveLookStick`&&n>0&&(w=Math.max(-1,Math.min(1,.5*f)),n>=d)){let e=Math.cos(r),i=Math.sin(r),a=(n-d)/(1-d),o=h?1:-1;x-=o*e*a*c*.5*t,S+=o*i*a*c*.5*t}!(x!==0||S!==0)&&!(C!==0||w!==0)||v({deltaYaw:x,deltaPitch:S,x:C,y:w,z:0,triggers:[],delta:t})},e[0]=y,e[1]=m,e[2]=h,e[3]=_.current,e[4]=g.current,e[5]=v,e[6]=f,e[7]=p,e[8]=b):b=e[8],t(b),null}export{f as TouchHandler}; \ No newline at end of file +import{n as e}from"./jsx-runtime-BpGWiA-R.js";import{i as t}from"./react-three-fiber.esm-CgPHUpXo.js";import{r as n}from"./SettingsProvider-CCHVZuSg.js";import{n as r}from"./JoystickContext-YJ6eVLFP.js";import{f as i,h as a}from"./index-DfaykQpF.js";var o=e(),s=.004,c=2.5,l=.08,u=.15,d=.15;function f(){let e=(0,o.c)(9),{speedMultiplier:f,touchMode:p,invertDrag:m,invertJoystick:h}=n(),{moveState:g,lookState:_}=r(),v=a(),[,y]=i(),b;return e[0]!==y||e[1]!==m||e[2]!==h||e[3]!==_.current||e[4]!==g.current||e[5]!==v||e[6]!==f||e[7]!==p?(b=(e,t)=>{let{force:n,angle:r}=g.current,{force:i,angle:a}=_.current,o=y().touchLook,b=m?1:-1,x=0,S=0;p===`moveLookStick`&&o&&o.dragging&&(x=b*o.deltaX*s,S=b*o.deltaY*s);let C=0,w=0;if(p===`dualStick`){if(i>u){let e=(i-u)/(1-u),n=Math.cos(a),r=Math.sin(a),o=h?1:-1;x-=o*n*e*c*t,S+=o*r*e*c*t}if(n>l){let e=(n-l)/(1-l),t=Math.cos(r),i=Math.sin(r);C=Math.max(-1,Math.min(1,t*e*f)),w=Math.max(-1,Math.min(1,i*e*f))}}else if(p===`moveLookStick`&&n>0&&(w=Math.max(-1,Math.min(1,.5*f)),n>=d)){let e=Math.cos(r),i=Math.sin(r),a=(n-d)/(1-d),o=h?1:-1;x-=o*e*a*c*.5*t,S+=o*i*a*c*.5*t}!(x!==0||S!==0)&&!(C!==0||w!==0)||v({deltaYaw:x,deltaPitch:S,x:C,y:w,z:0,triggers:[],delta:t})},e[0]=y,e[1]=m,e[2]=h,e[3]=_.current,e[4]=g.current,e[5]=v,e[6]=f,e[7]=p,e[8]=b):b=e[8],t(b),null}export{f as TouchHandler}; \ No newline at end of file diff --git a/docs/assets/demoStreaming-vQjQowT8.js b/docs/assets/demoStreaming-Tnv976xF.js similarity index 99% rename from docs/assets/demoStreaming-vQjQowT8.js rename to docs/assets/demoStreaming-Tnv976xF.js index 9631e6ae..dfd74a9c 100644 --- a/docs/assets/demoStreaming-vQjQowT8.js +++ b/docs/assets/demoStreaming-Tnv976xF.js @@ -1 +1 @@ -import{A as e,D as t,O as n,_ as r,a as i,b as a,d as o,l as s,n as c,r as l,t as u,v as d,y as f}from"./streamHelpers-D2N8suZp.js";import{i as p}from"./scene-BdOVRsxo.js";import{L as m}from"./index-B1XI52_L.js";function h(e){let t=null,n=null,i=null,a=null,o=null,s=null,c=NaN,l=null;for(let u=0;u=3&&d[1]?.endsWith(`Game`)&&(i=d[1]),e[u]!==`readplayerinfo`)continue;let f=e[u+1];if(f){if(f.startsWith(`1 `)){let e=f.split(` `);e[1]&&(c=parseInt(e[1],10)),e[2]&&(s=r(e[2]).trim());continue}if(f.startsWith(`2 `)){let e=f.split(` `);e[1]&&(a=e[1]),e[3]&&(l=e[3]),e[4]&&(t=e[4]);continue}if(f.startsWith(`3 `)){let e=f.split(` `);e[1]&&(o=e[1]),e[2]&&(n=e[2])}}}return{missionDisplayName:t,missionType:n,gameClassName:i,serverDisplayName:a,mod:o,recorderName:s,recorderClientId:Number.isFinite(c)?c:null,recordingDate:l}}function g(e){let t={weaponsHud:null,backpackHud:null,inventoryHud:null,teamScores:[],playerRoster:new Map,chatMessages:[],clockTimeMin:null,gravity:-20};if(!e.length)return t;let n=0,i=()=>{let t=e[n++];return t===``?``:t??``};if(i(),n>=e.length)return t;let a=parseInt(i(),10)||0,o=new Map;for(let e=0;e0&&o.set(s,(o.get(s)??0)+1)}if(n>=e.length||(i(),n>=e.length))return t;{let e=i().split(` `),n=e[0]??``,r=e[1]===`1`||e[1]===`true`,a=e[2]??``,o=e[4]===`1`||e[4]===`true`;r&&n&&(t.backpackHud={packIndex:c(n),active:o,text:a})}if(n>=e.length)return t;let s=i().split(` `),l=parseInt(s[4],10)||0,u=parseInt(s[5],10)||0,d=parseInt(s[6],10);for(let e=0;e=e.length)return t;let p=i().split(` `),m=parseInt(p[4],10)||0,h=parseInt(p[5],10)||0,g=parseInt(p[6],10);for(let e=0;e0&&e.set(n,r)}e.size>0&&(t.inventoryHud={slots:e,activeSlot:isNaN(g)?-1:g})}if(n>=e.length)return t;let _=i().split(` `),v=_[1]??``,y=parseInt(_[2],10)||0,b=[];for(let e=0;e=8)for(let e=0;e<2;e++){let n=e*4,r=e+1;t.teamScores.push({teamId:r,name:b[n]??``,score:parseInt(b[n+1],10)||0,playerCount:o.get(r)??0})}else if(v===`TR2Game`&&y>=4)for(let e=0;e<2;e++){let n=e*2,r=e+1;t.teamScores.push({teamId:r,name:b[n+1]??``,score:parseInt(b[n],10)||0,playerCount:o.get(r)??0})}if(n>=e.length)return t;{let e=i().split(` `),n=parseFloat(e[1]??``);Number.isFinite(n)&&(t.clockTimeMin=n)}for(let r=0;r<10&&!(n>=e.length);r++){let e=i();e&&t.chatMessages.push(e)}if(n=0?t(`Player`,this.initialBlock.controlObjectGhostIndex):void 0;for(let e of this.initialBlock.initialGhosts){if(e.type!==`create`||e.classId==null)continue;let r=this.registry.getGhostParser(e.classId)?.name;if(!r)throw Error(`No ghost parser for classId ${e.classId} (ghost index ${e.index})`);let i=t(r,e.index),a={id:i,ghostIndex:e.index,className:r,spawnTick:0,type:n(r),rotation:[0,0,0,1]};if(this.applyGhostData(a,e.parsedData),e.parsedData){let t=p(r,e.index,e.parsedData);t&&(a.sceneData=t)}this.entities.set(i,a),this.entityIdByGhostIndex.set(e.index,i)}if(this.playerSensorGroup===0&&this.lastControlType===`player`&&this.latestControl.ghostIndex>=0){let e=this.entityIdByGhostIndex.get(this.latestControl.ghostIndex),t=e?this.entities.get(e):void 0;t?.sensorGroup!=null&&t.sensorGroup>0&&(this.playerSensorGroup=t.sensorGroup)}for(let e of this.initialBlock.initialEvents){let t=this.registry.getEventParser(e.classId)?.name;if(t===`SetSensorGroupEvent`&&e.parsedData){let t=e.parsedData.sensorGroup;t!=null&&(this.playerSensorGroup=t)}else if(t===`RemoteCommandEvent`&&e.parsedData){let t=this.resolveNetString(e.parsedData.funcName),n=e.parsedData.args;t===`ServerMessage`&&this.handleServerMessage(n),this.handleHudRemoteCommand(t,n)}}let c=g(this.initialBlock.demoValues);c.weaponsHud&&(this.weaponsHud.slots=c.weaponsHud.slots,this.weaponsHud.activeIndex=c.weaponsHud.activeIndex),c.backpackHud&&(this.backpackHud.packIndex=c.backpackHud.packIndex,this.backpackHud.active=c.backpackHud.active,this.backpackHud.text=c.backpackHud.text),c.inventoryHud&&(this.inventoryHud.slots=c.inventoryHud.slots,this.inventoryHud.activeSlot=c.inventoryHud.activeSlot),this.teamScores=c.teamScores,this.playerRoster=new Map(c.playerRoster),c.clockTimeMin!=null&&(this.clockAnchorStreamSec=0,this.clockDurationMs=c.clockTimeMin*60*1e3);for(let e of c.chatMessages){let t=o(e);if(!t.length)continue;let n=t.map(e=>e.text).join(``);if(!n.trim())continue;let r=t[0].colorCode;if(t.some(e=>e.colorCode===3||e.colorCode===4)&&n.includes(`: `)){let e=n.indexOf(`: `);this.pushChatMessage({timeSec:0,sender:n.slice(0,e),text:n.slice(e+2),kind:`chat`,colorCode:r,segments:t})}else this.pushChatMessage({timeSec:0,sender:``,text:n,kind:`server`,colorCode:r,segments:t})}this.updateCameraAndHud()}getSnapshot(){if(this._cachedSnapshot&&this._cachedSnapshotTick===this.moveTicks)return this._cachedSnapshot;let e=this.buildSnapshot();return this._cachedSnapshot=e,this._cachedSnapshotTick=this.moveTicks,e}getEffectShapes(){let e=new Set,t=t=>{let n=t.dtsFileName;n&&e.add(n);let r=t.subExplosions;if(Array.isArray(r))for(let t of r){if(t==null)continue;let n=this.getDataBlockData(t);n?.dtsFileName&&e.add(n.dtsFileName)}};for(let[,e]of this.initialBlock.dataBlocks){let n=e.data?.explosion;if(n==null)continue;let r=this.getDataBlockData(n);r&&t(r)}return[...e]}stepToTime(e,t=1/0){let n=Math.floor((Number.isFinite(e)?Math.max(0,e):0)*1e3/32),r=!1;n({index:e,ammo:t})),activeIndex:this.weaponsHud.activeIndex},o=n&&n.inventoryHudGen===this._inventoryHudGen?n.inventoryHud:{slots:Array.from(this.inventoryHud.slots.entries()).map(([e,t])=>({slot:e,count:t})),activeSlot:this.inventoryHud.activeSlot},s=n&&n.backpackPackIndex===this.backpackHud.packIndex&&n.backpackActive===this.backpackHud.active&&n.backpackText===this.backpackHud.text?n.backpackHud:this.backpackHud.packIndex>=0?{...this.backpackHud}:null,c,l;if(n&&n.teamScoresGen===this._teamScoresGen&&n.rosterGen===this._rosterGen)c=n.teamScores,l=n.playerRoster;else{c=this.teamScores.map(e=>({...e}));let e=new Map;for(let{teamId:t}of this.playerRoster.values())t>0&&e.set(t,(e.get(t)??0)+1);for(let t of c)t.playerCount=e.get(t.teamId)??0;l=[];for(let[e,t]of this.playerRoster)l.push({clientId:e,...t})}return this._snap={teamScoresGen:this._teamScoresGen,rosterGen:this._rosterGen,teamScores:c,playerRoster:l,weaponsHudGen:this._weaponsHudGen,weaponsHud:a,inventoryHudGen:this._inventoryHudGen,inventoryHud:o,backpackPackIndex:this.backpackHud.packIndex,backpackActive:this.backpackHud.active,backpackText:this.backpackHud.text,backpackHud:s},{timeSec:t,exhausted:this.exhausted,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:r,audioEvents:i,weaponsHud:a,backpackHud:s,inventoryHud:o,teamScores:c,playerRoster:l,connectedClientId:this.connectedClientId,matchClockMs:this.computeMatchClockMs(t)}}isPacketData(e){return!!e&&typeof e==`object`&&`gameState`in e&&`events`in e&&`ghosts`in e}isMoveData(e){return!!e&&typeof e==`object`&&`yaw`in e}isInfoData(e){return!!e&&typeof e==`object`&&`value1`in e&&typeof e.value1==`number`&&`value2`in e&&typeof e.value2==`number`}};async function v(t){let n=new e(new Uint8Array(t)),{header:r,initialBlock:i}=await n.load(),a=h(i.demoValues),o=new _(n);return o.missionDisplayName=a.missionDisplayName,o.missionTypeDisplayName=a.missionType,o.gameClassName=a.gameClassName,o.serverDisplayName=a.serverDisplayName,o.connectedPlayerName=a.recorderName,o.connectedClientId=a.recorderClientId,{source:`demo`,duration:r.demoLengthMs/1e3,missionName:i.missionName??null,gameType:a.missionType,serverDisplayName:a.serverDisplayName,recorderName:a.recorderName,recordingDate:a.recordingDate,streamingPlayback:o}}export{v as createDemoStreamingRecording}; \ No newline at end of file +import{A as e,D as t,O as n,_ as r,a as i,b as a,d as o,l as s,n as c,r as l,t as u,v as d,y as f}from"./streamHelpers-D2N8suZp.js";import{i as p}from"./scene-BdOVRsxo.js";import{L as m}from"./index-DfaykQpF.js";function h(e){let t=null,n=null,i=null,a=null,o=null,s=null,c=NaN,l=null;for(let u=0;u=3&&d[1]?.endsWith(`Game`)&&(i=d[1]),e[u]!==`readplayerinfo`)continue;let f=e[u+1];if(f){if(f.startsWith(`1 `)){let e=f.split(` `);e[1]&&(c=parseInt(e[1],10)),e[2]&&(s=r(e[2]).trim());continue}if(f.startsWith(`2 `)){let e=f.split(` `);e[1]&&(a=e[1]),e[3]&&(l=e[3]),e[4]&&(t=e[4]);continue}if(f.startsWith(`3 `)){let e=f.split(` `);e[1]&&(o=e[1]),e[2]&&(n=e[2])}}}return{missionDisplayName:t,missionType:n,gameClassName:i,serverDisplayName:a,mod:o,recorderName:s,recorderClientId:Number.isFinite(c)?c:null,recordingDate:l}}function g(e){let t={weaponsHud:null,backpackHud:null,inventoryHud:null,teamScores:[],playerRoster:new Map,chatMessages:[],clockTimeMin:null,gravity:-20};if(!e.length)return t;let n=0,i=()=>{let t=e[n++];return t===``?``:t??``};if(i(),n>=e.length)return t;let a=parseInt(i(),10)||0,o=new Map;for(let e=0;e0&&o.set(s,(o.get(s)??0)+1)}if(n>=e.length||(i(),n>=e.length))return t;{let e=i().split(` `),n=e[0]??``,r=e[1]===`1`||e[1]===`true`,a=e[2]??``,o=e[4]===`1`||e[4]===`true`;r&&n&&(t.backpackHud={packIndex:c(n),active:o,text:a})}if(n>=e.length)return t;let s=i().split(` `),l=parseInt(s[4],10)||0,u=parseInt(s[5],10)||0,d=parseInt(s[6],10);for(let e=0;e=e.length)return t;let p=i().split(` `),m=parseInt(p[4],10)||0,h=parseInt(p[5],10)||0,g=parseInt(p[6],10);for(let e=0;e0&&e.set(n,r)}e.size>0&&(t.inventoryHud={slots:e,activeSlot:isNaN(g)?-1:g})}if(n>=e.length)return t;let _=i().split(` `),v=_[1]??``,y=parseInt(_[2],10)||0,b=[];for(let e=0;e=8)for(let e=0;e<2;e++){let n=e*4,r=e+1;t.teamScores.push({teamId:r,name:b[n]??``,score:parseInt(b[n+1],10)||0,playerCount:o.get(r)??0})}else if(v===`TR2Game`&&y>=4)for(let e=0;e<2;e++){let n=e*2,r=e+1;t.teamScores.push({teamId:r,name:b[n+1]??``,score:parseInt(b[n],10)||0,playerCount:o.get(r)??0})}if(n>=e.length)return t;{let e=i().split(` `),n=parseFloat(e[1]??``);Number.isFinite(n)&&(t.clockTimeMin=n)}for(let r=0;r<10&&!(n>=e.length);r++){let e=i();e&&t.chatMessages.push(e)}if(n=0?t(`Player`,this.initialBlock.controlObjectGhostIndex):void 0;for(let e of this.initialBlock.initialGhosts){if(e.type!==`create`||e.classId==null)continue;let r=this.registry.getGhostParser(e.classId)?.name;if(!r)throw Error(`No ghost parser for classId ${e.classId} (ghost index ${e.index})`);let i=t(r,e.index),a={id:i,ghostIndex:e.index,className:r,spawnTick:0,type:n(r),rotation:[0,0,0,1]};if(this.applyGhostData(a,e.parsedData),e.parsedData){let t=p(r,e.index,e.parsedData);t&&(a.sceneData=t)}this.entities.set(i,a),this.entityIdByGhostIndex.set(e.index,i)}if(this.playerSensorGroup===0&&this.lastControlType===`player`&&this.latestControl.ghostIndex>=0){let e=this.entityIdByGhostIndex.get(this.latestControl.ghostIndex),t=e?this.entities.get(e):void 0;t?.sensorGroup!=null&&t.sensorGroup>0&&(this.playerSensorGroup=t.sensorGroup)}for(let e of this.initialBlock.initialEvents){let t=this.registry.getEventParser(e.classId)?.name;if(t===`SetSensorGroupEvent`&&e.parsedData){let t=e.parsedData.sensorGroup;t!=null&&(this.playerSensorGroup=t)}else if(t===`RemoteCommandEvent`&&e.parsedData){let t=this.resolveNetString(e.parsedData.funcName),n=e.parsedData.args;t===`ServerMessage`&&this.handleServerMessage(n),this.handleHudRemoteCommand(t,n)}}let c=g(this.initialBlock.demoValues);c.weaponsHud&&(this.weaponsHud.slots=c.weaponsHud.slots,this.weaponsHud.activeIndex=c.weaponsHud.activeIndex),c.backpackHud&&(this.backpackHud.packIndex=c.backpackHud.packIndex,this.backpackHud.active=c.backpackHud.active,this.backpackHud.text=c.backpackHud.text),c.inventoryHud&&(this.inventoryHud.slots=c.inventoryHud.slots,this.inventoryHud.activeSlot=c.inventoryHud.activeSlot),this.teamScores=c.teamScores,this.playerRoster=new Map(c.playerRoster),c.clockTimeMin!=null&&(this.clockAnchorStreamSec=0,this.clockDurationMs=c.clockTimeMin*60*1e3);for(let e of c.chatMessages){let t=o(e);if(!t.length)continue;let n=t.map(e=>e.text).join(``);if(!n.trim())continue;let r=t[0].colorCode;if(t.some(e=>e.colorCode===3||e.colorCode===4)&&n.includes(`: `)){let e=n.indexOf(`: `);this.pushChatMessage({timeSec:0,sender:n.slice(0,e),text:n.slice(e+2),kind:`chat`,colorCode:r,segments:t})}else this.pushChatMessage({timeSec:0,sender:``,text:n,kind:`server`,colorCode:r,segments:t})}this.updateCameraAndHud()}getSnapshot(){if(this._cachedSnapshot&&this._cachedSnapshotTick===this.moveTicks)return this._cachedSnapshot;let e=this.buildSnapshot();return this._cachedSnapshot=e,this._cachedSnapshotTick=this.moveTicks,e}getEffectShapes(){let e=new Set,t=t=>{let n=t.dtsFileName;n&&e.add(n);let r=t.subExplosions;if(Array.isArray(r))for(let t of r){if(t==null)continue;let n=this.getDataBlockData(t);n?.dtsFileName&&e.add(n.dtsFileName)}};for(let[,e]of this.initialBlock.dataBlocks){let n=e.data?.explosion;if(n==null)continue;let r=this.getDataBlockData(n);r&&t(r)}return[...e]}stepToTime(e,t=1/0){let n=Math.floor((Number.isFinite(e)?Math.max(0,e):0)*1e3/32),r=!1;n({index:e,ammo:t})),activeIndex:this.weaponsHud.activeIndex},o=n&&n.inventoryHudGen===this._inventoryHudGen?n.inventoryHud:{slots:Array.from(this.inventoryHud.slots.entries()).map(([e,t])=>({slot:e,count:t})),activeSlot:this.inventoryHud.activeSlot},s=n&&n.backpackPackIndex===this.backpackHud.packIndex&&n.backpackActive===this.backpackHud.active&&n.backpackText===this.backpackHud.text?n.backpackHud:this.backpackHud.packIndex>=0?{...this.backpackHud}:null,c,l;if(n&&n.teamScoresGen===this._teamScoresGen&&n.rosterGen===this._rosterGen)c=n.teamScores,l=n.playerRoster;else{c=this.teamScores.map(e=>({...e}));let e=new Map;for(let{teamId:t}of this.playerRoster.values())t>0&&e.set(t,(e.get(t)??0)+1);for(let t of c)t.playerCount=e.get(t.teamId)??0;l=[];for(let[e,t]of this.playerRoster)l.push({clientId:e,...t})}return this._snap={teamScoresGen:this._teamScoresGen,rosterGen:this._rosterGen,teamScores:c,playerRoster:l,weaponsHudGen:this._weaponsHudGen,weaponsHud:a,inventoryHudGen:this._inventoryHudGen,inventoryHud:o,backpackPackIndex:this.backpackHud.packIndex,backpackActive:this.backpackHud.active,backpackText:this.backpackHud.text,backpackHud:s},{timeSec:t,exhausted:this.exhausted,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:r,audioEvents:i,weaponsHud:a,backpackHud:s,inventoryHud:o,teamScores:c,playerRoster:l,connectedClientId:this.connectedClientId,matchClockMs:this.computeMatchClockMs(t)}}isPacketData(e){return!!e&&typeof e==`object`&&`gameState`in e&&`events`in e&&`ghosts`in e}isMoveData(e){return!!e&&typeof e==`object`&&`yaw`in e}isInfoData(e){return!!e&&typeof e==`object`&&`value1`in e&&typeof e.value1==`number`&&`value2`in e&&typeof e.value2==`number`}};async function v(t){let n=new e(new Uint8Array(t)),{header:r,initialBlock:i}=await n.load(),a=h(i.demoValues),o=new _(n);return o.missionDisplayName=a.missionDisplayName,o.missionTypeDisplayName=a.missionType,o.gameClassName=a.gameClassName,o.serverDisplayName=a.serverDisplayName,o.connectedPlayerName=a.recorderName,o.connectedClientId=a.recorderClientId,{source:`demo`,duration:r.demoLengthMs/1e3,missionName:i.missionName??null,gameType:a.missionType,serverDisplayName:a.serverDisplayName,recorderName:a.recorderName,recordingDate:a.recordingDate,streamingPlayback:o}}export{v as createDemoStreamingRecording}; \ No newline at end of file diff --git a/docs/assets/index-B1XI52_L.js b/docs/assets/index-B1XI52_L.js deleted file mode 100644 index 5e5aa266..00000000 --- a/docs/assets/index-B1XI52_L.js +++ /dev/null @@ -1,12 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/demoStreaming-vQjQowT8.js","assets/streamHelpers-D2N8suZp.js","assets/chunk-DECur_0Z.js","assets/three.module-07hRbor4.js","assets/scene-BdOVRsxo.js","assets/logger-z_EpIdIa.js","assets/demoTimelineScanner-BGzL-XZF.js","assets/TouchHandler-CV_1nnl6.js","assets/react-three-fiber.esm-CgPHUpXo.js","assets/jsx-runtime-BpGWiA-R.js","assets/traditional-BTL5qX2E.js","assets/SettingsProvider-CCHVZuSg.js","assets/manifest-CirqV3Ls.js","assets/stringUtils-EmGsjr9D.js","assets/JoystickContext-YJ6eVLFP.js","assets/TouchJoystick-DYqKShVz.js","assets/preload-helper-CwUjIIrH.js","assets/TouchJoystick-Dn73xHvm.css","assets/KeyboardOverlay-D875z9z7.js","assets/gr-1PcjgMj0.js","assets/iconBase-BCRUFbxq.js","assets/cameraTourStore-PEzPVGnX.js","assets/KeyboardOverlay-CpSto9KR.css","assets/GameView-DOXRUG38.js","assets/mission-Bem2ztlS.js","assets/extends-COZGby3T.js","assets/GenericShape-BC0gDQiR.js","assets/Texture-CIsc25mc.js","assets/useBaseQuery-NrPec9_7.js","assets/FloatingLabel-4Yii8rRq.js","assets/Html-BfjRWIZg.js","assets/FloatingLabel-DfptgH-Y.css","assets/globalFogUniforms-CtxQvsRj.js","assets/loaders-CIpiZadQ.js","assets/engineStore-Dkm20jvr.js","assets/middleware-DPacZrFu.js","assets/useQuery-FY4YqwDi.js","assets/AudioContext-CMp1T7r9.js","assets/DebugSuspense-Dk4MzcWf.js","assets/ShapeErrorBoundary-CJ_4YTMy.js","assets/gameEntityTypes-B1KihaDt.js","assets/streamPlaybackStore-DhJekvnx.js","assets/GameView-PJcE9IRi.css","assets/DemoPlaybackControls-B8inlhPI.js","assets/DemoPlaybackControls-V-lirz3V.css","assets/PlayerHUD-ZLAOgfFu.js","assets/PlayerHUD-DWa6gIym.css","assets/MapInfoDialog-BlS8j0JO.js","assets/MapInfoDialog-qPSE5ow_.css","assets/ServerBrowser-BK-yGyhv.js","assets/ServerBrowser-B1ZZ25fp.css","assets/ScoreScreen-94psq8zp.js","assets/ScoreScreen-FWyMMObP.css"])))=>i.map(i=>d[i]); -import{r as e,t}from"./chunk-DECur_0Z.js";import{n,r,t as i}from"./jsx-runtime-BpGWiA-R.js";import{i as a,o,s}from"./react-three-fiber.esm-CgPHUpXo.js";import{a as c,c as l,d as u,f as d,i as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x}from"./SettingsProvider-CCHVZuSg.js";import{t as S}from"./iconBase-BCRUFbxq.js";import{l as C,n as w,r as T,s as E}from"./manifest-CirqV3Ls.js";import{n as D,r as O,t as k}from"./stringUtils-EmGsjr9D.js";import{t as A}from"./logger-z_EpIdIa.js";import{i as j,n as M,r as ee}from"./traditional-BTL5qX2E.js";import{n as te,t as N}from"./cameraTourStore-PEzPVGnX.js";import{C as P,D as ne,E as re,O as F,S as ie,T as ae,_ as I,a as oe,b as L,c as se,f as ce,g as le,h as ue,i as de,k as fe,l as pe,m as me,o as he,p as ge,r as _e,s as ve,t as ye,u as be,v as xe,w as Se,x as Ce,y as we}from"./streamHelpers-D2N8suZp.js";import{St as Te,Ut as Ee}from"./three.module-07hRbor4.js";import{i as De}from"./scene-BdOVRsxo.js";import{i as Oe}from"./mission-Bem2ztlS.js";import{t as ke}from"./middleware-DPacZrFu.js";import{i as Ae,r as je}from"./engineStore-Dkm20jvr.js";import{t as Me}from"./preload-helper-CwUjIIrH.js";import{t as Ne}from"./JoystickContext-YJ6eVLFP.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Pe=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Pe()})),Ie=t((e=>{var t=s(),n=r(),i=Fe();function a(e){var t=`https://react.dev/errors/`+e;if(1F||(e.current=re[F],re[F]=null,F--)}function I(e,t){F++,re[F]=e.current,e.current=t}var oe=ie(null),L=ie(null),se=ie(null),ce=ie(null);function le(e,t){switch(I(se,t),I(L,e),I(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(oe),I(oe,e)}function ue(){ae(oe),ae(L),ae(se)}function de(e){e.memoizedState!==null&&I(ce,e);var t=oe.current,n=Hd(t,e.type);t!==n&&(I(L,e),I(oe,n))}function fe(e){L.current===e&&(ae(oe),ae(L)),ce.current===e&&(ae(ce),Qf._currentValue=ne)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Ie=null;function Le(e){if(typeof Me==`function`&&Ne(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Pe,e)}catch{}}var Re=Math.clz32?Math.clz32:ze,R=Math.log,z=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(R(e)/z|0)|0}var Be=256,Ve=262144,He=4194304;function Ue(e){var t=e&42;if(t!==0)return t;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: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(e,t){switch(e){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 qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),cn=!1;if(sn)try{var ln={};Object.defineProperty(ln,`passive`,{get:function(){cn=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{cn=!1}var un=null,dn=null,fn=null;function pn(){if(fn)return fn;var e,t=dn,n=t.length,r,i=`value`in un?un.value:un.textContent,a=i.length;for(e=0;e=Gn),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Wn&&Xn(e,t)?(e=pn(),fn=dn=un=null,Qn=!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=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Sr(n)}}function wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ft(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ft(e.document)}return t}function Er(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`)}var Dr=sn&&`documentMode`in document&&11>=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==Ft(r)||(r=Or,`selectionStart`in r&&Er(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&xr(Ar,r)||(Ar=r,r=Ed(kr,`onSelect`),0>=o,i-=o,wi=1<<32-Re(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),V&&Ei(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),V&&Ei(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return V&&Ei(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),V&&Ei(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===v&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Ea(l)===r.type){n(e,r.sibling),c=i(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===v?(c=di(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ui(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case _:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=mi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Ea(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ma(o),c);if(o.$$typeof===S)return b(e,r,ea(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=fi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Y&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ri(e),ni(e,null,n),t}return $r(e,r,t,n),ri(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=N.T,s={};N.T=s,As(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,ma(c,r),fu(e)):ks(e,t,r,fu(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=xs(e).queue;vs(e,i,t,ne,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},fu())}function Cs(){return $i(Qf)}function ws(){return G().memoizedState}function Ts(){return G().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Va(n);var r=Ha(t,e,n);r!==null&&(mu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=ei(e,t,n,r),n!==null&&(mu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,fu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,br(s,o))return $r(e,t,i,0),Il===null&&Qr(),!1}catch{}if(n=ei(e,t,i,r),n!==null)return mu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(a(479))}else t=ei(e,n,r,2),t!==null&&mu(t,e,2)}function js(e){var t=e.alternate;return e===U||t!==null&&t===U}function Ms(e,t){mo=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}var Ps={readContext:$i,use:jo,useCallback:W,useContext:W,useEffect:W,useImperativeHandle:W,useLayoutEffect:W,useInsertionEffect:W,useMemo:W,useReducer:W,useRef:W,useState:W,useDebugValue:W,useDeferredValue:W,useTransition:W,useSyncExternalStore:W,useId:W,useHostTransitionStatus:W,useFormState:W,useActionState:W,useOptimistic:W,useMemoCache:W,useCacheRefresh:W};Ps.useEffectEvent=W;var Fs={readContext:$i,use:jo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(ho){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(ho){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=Os.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(Oo(),e,t)},useTransition:function(){var e=Uo(!1);return e=vs.bind(null,U,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,i=Oo();if(V){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Il===null)throw Error(a(349));Z&127||Ro(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,os(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=Il.identifierPrefix;if(V){var n=Ti,r=wi;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=go++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[at]=t,o[ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=se.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ji,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Ii(t,!0)}else e=Bd(e).createTextNode(r),e[at]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[at]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(a(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[at]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),i=!1}else i=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return ue(),e===null&&Sd(t.stateNode.containerInfo),Pc(t),null;case 10:return qi(t.type),Pc(t),null;case 19:if(ae(so),r=t.memoizedState,r===null)return Pc(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Nc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)li(n,e),n=n.sibling;return I(so,so.current&1|2),V&&Ei(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>eu&&(t.flags|=128,i=!0,Nc(r,!1),t.lanes=4194304)}else{if(!i)if(e=co(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!V)return Pc(t),null}else 2*Te()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,i=!0,Nc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=so.current,I(so,i?n&1|2:n&1),V&&Ei(t,r.treeForkCount),e);case 22:case 23:return oo(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ae(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),Pc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Ic(e,t){switch(ki(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(a(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(so),null;case 4:return ue(),null;case 10:return qi(t.type),null;case 22:case 23:return oo(t),eo(),e!==null&&ae(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function Lc(e,t){switch(ki(t),t.tag){case 3:qi(aa),ue();break;case 26:case 27:case 5:fe(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:ae(so);break;case 10:qi(t.type);break;case 22:case 23:oo(t),eo(),e!==null&&ae(ga);break;case 24:qi(aa)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Wu(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Wu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Wu(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){Wu(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Wu(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Wu(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Wu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Wu(e,t,n)}else n.current=null}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Wu(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ot]=t}catch(t){Wu(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(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.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[at]=e,t[ot]=n}catch(t){Wu(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,J=typeof WeakSet==`function`?WeakSet:Set,el=null;function tl(e,t){if(e=e.containerInfo,Rd=sp,e=Tr(e),Er(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,el=t;el!==null;)if(t=el,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,el=e;else for(;el!==null;){switch(t=el,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[at]=e,vt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Cr(s,h),v=Cr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,N.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,Y&6)throw Error(a(331));var c=Y;if(Y|=4,jl(o.current),Cl(o,o.current,s,n),Y=c,id(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{P.p=i,N.T=r,Bu(e,t)}}function Uu(e,t,n){t=gi(n,t),t=Js(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Ye(e,2),rd(e))}function Wu(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=gi(n,e),n=Ys(2),r=Ha(t,n,2),r!==null&&(Xs(n,r,t,e),Ye(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Vl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Z&n)===n&&(Ul===4||Ul===3&&(Z&62914560)===Z&&300>Te()-Ql?!(Y&2)&&xu(e,0):Kl|=n,Jl===Z&&(Jl=0)),rd(e)}function qu(e,t){t===0&&(t=qe()),e=ti(e,t),e!==null&&(Ye(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return xe(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Z,a=We(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ge(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Te(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}ru!==0&&ru!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=_t(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);vt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=se.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=_t(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=_t(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=_t(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Lt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),vt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Lt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,vt(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),vt(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,vt(i),i):(r=n,(i=mf.get(o))&&(r=m({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),vt(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){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;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ie()})),Re=e(Le(),1),R=e(r(),1),z=n();function ze(e,t,n){return r=>{if(!(t.length===0||t.some(t=>!x(r.getAll(t),e.getAll(t)))))return _("[nuqs `%s`] no change, returning previous",t.join(`,`),r),r;let i=Be(e,t,n);return _(`[nuqs \`%s\`] subbed search params change - from %O - to %O`,t.join(`,`),r,i),i}}function Be(e,t,n){if(t.length===0)return e;let r=n?new URLSearchParams(e):e;for(let n of e.keys())t.includes(n)||r.delete(n);return r}var Ve=`__nuqs__`,He=u();function Ue(e){return function(t,n){let r=new URL(location.href);r.search=m(t),_(`[nuqs react] Updating url: %s`,r),e&&n.shallow===!1?(n.history===`push`?location.assign:location.replace).call(location,r):(n.history===`push`?history.pushState:history.replaceState).call(history,history.state,Ve,r),He.emit(`update`,t),n.scroll===!0&&window.scrollTo({top:0})}}var We=(0,R.createContext)({fullPageNavigationOnShallowFalseUpdates:!1});function Ge(e){let{fullPageNavigationOnShallowFalseUpdates:t}=(0,R.useContext)(We),[n,r]=(0,R.useState)(()=>typeof location>`u`?new URLSearchParams:Be(new URLSearchParams(location.search),e,!1));return(0,R.useEffect)(()=>{let t=()=>{r(ze(new URLSearchParams(location.search),e,!1))},n=t=>{r(ze(t,e,!0))};return He.on(`update`,n),window.addEventListener(`popstate`,t),()=>{He.off(`update`,n),window.removeEventListener(`popstate`,t)}},[e.join(`&`)]),{searchParams:n,updateUrl:(0,R.useMemo)(()=>Ue(t),[t])}}var Ke=d(Ge);function qe({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return(0,R.createElement)(We.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},(0,R.createElement)(Ke,{...n,children:e}))}var Je=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ye=new class extends Je{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Xe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ze=new class{#e=Xe;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Qe(e){setTimeout(e,0)}var $e=typeof window>`u`||`Deno`in globalThis;function et(){}function tt(e,t){return typeof e==`function`?e(t):e}function nt(e){return typeof e==`number`&&e>=0&&e!==1/0}function rt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function it(e,t){return typeof e==`function`?e(t):e}function at(e,t){return typeof e==`function`?e(t):e}function ot(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ct(o,t.options))return!1}else if(!ut(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function st(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(lt(t.options.mutationKey)!==lt(a))return!1}else if(!ut(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ct(e,t){return(t?.queryKeyHashFn||lt)(e)}function lt(e){return JSON.stringify(e,(e,t)=>ht(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ut(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ut(e[n],t[n])):!1}var dt=Object.prototype.hasOwnProperty;function ft(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=mt(e)&&mt(t);if(!r&&!(ht(e)&&ht(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{Ze.setTimeout(t,e)})}function vt(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ft(e,t)}function yt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function bt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xt=Symbol();function St(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===xt?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ct(e,t){return typeof e==`function`?e(...t):!!e}function wt(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Tt=(()=>{let e=()=>$e;return{isServer(){return e()},setIsServer(t){e=t}}})();function Et(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Dt=Qe;function Ot(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Dt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var kt=Ot(),At=new class extends Je{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function jt(e){return Math.min(1e3*2**e,3e4)}function Mt(e){return(e??`online`)===`online`?At.isOnline():!0}var Nt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Pt(e){let t=!1,n=0,r,i=Et(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Nt(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Ye.isFocused()&&(e.networkMode===`always`||At.isOnline())&&e.canRun(),u=()=>Mt(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Tt.isServer()?0:3),o=e.retryDelay??jt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&nl()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Ft=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nt(this.gcTime)&&(this.#e=Ze.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Tt.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Ze.clearTimeout(this.#e),void 0)}},It=class extends Ft{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=zt(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=zt(this.options);e.data!==void 0&&(this.setState(Rt(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=vt(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(et).catch(et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>at(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xt||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>it(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!rt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=St(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Pt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Nt&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Nt){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Lt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Rt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),kt.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Lt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Rt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function zt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function Bt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{wt(e,()=>t.signal,()=>n=!0)},u=St(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?bt:yt;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ht:Vt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Vt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Vt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ht(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ut=class extends Ft{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Wt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Pt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),kt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Wt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Gt=class extends Je{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ut({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Kt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Kt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Kt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Kt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){kt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>st(t,e))}findAll(e={}){return this.getAll().filter(t=>st(e,t))}notify(e){kt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return kt.batch(()=>Promise.all(e.map(e=>e.continue().catch(et))))}};function Kt(e){return e.options.scope?.id}var qt=class extends Je{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ct(r,t),a=this.get(i);return a||(a=new It({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){kt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ot(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ot(e,t)):t}notify(e){kt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Jt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new qt,this.#t=e.mutationCache||new Gt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=At.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(it(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=tt(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return kt.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;kt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return kt.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=kt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(et).catch(et)}invalidateQueries(e,t={}){return kt.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=kt.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(et)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(et)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(it(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(et).catch(et)}fetchInfiniteQuery(e){return e.behavior=Bt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(et).catch(et)}ensureInfiniteQueryData(e){return e.behavior=Bt(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return At.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(lt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ut(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(lt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ut(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ct(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===xt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},B=i(),Yt=R.createContext(void 0),Xt=e=>{let t=R.useContext(Yt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Zt=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,B.jsx)(Yt.Provider,{value:e,children:t})),Qt=(0,R.createContext)({live:!1});function $t(){return(0,R.useContext)(Qt)}function en(e){let t=(0,z.c)(5),{children:n}=e,[r]=p(`features`,l),i;t[0]===r?i=t[1]:(i=()=>({live:new Set((r??``).split(`,`).map(tn).filter(Boolean)).has(`live`)}),t[0]=r,t[1]=i);let[a]=(0,R.useState)(i),o;return t[2]!==n||t[3]!==a?(o=(0,B.jsx)(Qt.Provider,{value:a,children:n}),t[2]=n,t[3]=a,t[4]=o):o=t[4],o}function tn(e){return e.trim().toLowerCase()}function nn(e){return S({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z`},child:[]}]})(e)}function rn(e){return S({tag:`svg`,attr:{viewBox:`0 0 384 512`},child:[{tag:`path`,attr:{d:`M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`},child:[]}]})(e)}function an(e){return S({tag:`svg`,attr:{viewBox:`0 0 384 512`},child:[{tag:`path`,attr:{d:`M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z`},child:[]}]})(e)}function on(e){return S({tag:`svg`,attr:{viewBox:`0 0 448 512`},child:[{tag:`path`,attr:{d:`M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z`},child:[]}]})(e)}function sn(e){return S({tag:`svg`,attr:{viewBox:`0 0 448 512`},child:[{tag:`path`,attr:{d:`M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z`},child:[]}]})(e)}function cn(e){return S({tag:`svg`,attr:{viewBox:`0 0 384 512`},child:[{tag:`path`,attr:{d:`M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 370.8 224 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`},child:[]}]})(e)}function ln(e){return S({tag:`svg`,attr:{viewBox:`0 0 576 512`},child:[{tag:`path`,attr:{d:`M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z`},child:[]}]})(e)}function un(e){return S({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z`},child:[]}]})(e)}function dn(e){return S({tag:`svg`,attr:{viewBox:`0 0 288 512`},child:[{tag:`path`,attr:{d:`M112 316.94v156.69l22.02 33.02c4.75 7.12 15.22 7.12 19.97 0L176 473.63V316.94c-10.39 1.92-21.06 3.06-32 3.06s-21.61-1.14-32-3.06zM144 0C64.47 0 0 64.47 0 144s64.47 144 144 144 144-64.47 144-144S223.53 0 144 0zm0 76c-37.5 0-68 30.5-68 68 0 6.62-5.38 12-12 12s-12-5.38-12-12c0-50.73 41.28-92 92-92 6.62 0 12 5.38 12 12s-5.38 12-12 12z`},child:[]}]})(e)}function fn(e){return S({tag:`svg`,attr:{viewBox:`0 0 320 512`},child:[{tag:`path`,attr:{d:`M177 255.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 351.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 425.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1zm-34-192L7 199.7c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l96.4-96.4 96.4 96.4c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9l-136-136c-9.2-9.4-24.4-9.4-33.8 0z`},child:[]}]})(e)}function pn(e){return S({tag:`svg`,attr:{viewBox:`0 0 320 512`},child:[{tag:`path`,attr:{d:`M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z`},child:[]}]})(e)}var mn={Button:`_Button_1u47f_2`,Icon:`_Icon_1u47f_79`,ButtonLabel:`_ButtonLabel_1u47f_82`,ButtonHint:`_ButtonHint_1u47f_86`,ButtonGroup:`_ButtonGroup_1u47f_91`,DestructiveActionButton:`_DestructiveActionButton_1u47f_135 _Button_1u47f_2`},hn={Button:`_Button_1xmvi_1 _Button_1u47f_2`,ClipboardIcon:`_ClipboardIcon_1xmvi_10`,showClipboardCheck:`_showClipboardCheck_1xmvi_1`,PinIcon:`_PinIcon_1xmvi_20`};function gn({position:e,quaternion:t}){let n=e=>parseFloat(e.toFixed(3));return`#c${`${n(e.x)},${n(e.y)},${n(e.z)}`}~${`${n(t.x)},${n(t.y)},${n(t.z)},${n(t.w)}`}`}function _n(e){let t=(0,z.c)(12),{cameraRef:n,missionName:r,missionType:i,disabled:a}=e,{fogEnabled:o}=c(),[s,l]=(0,R.useState)(!1),u=(0,R.useRef)(null),d;t[0]!==n||t[1]!==o||t[2]!==r||t[3]!==i?(d=async()=>{u.current&&clearTimeout(u.current);let e=n.current;if(!e)return;let t=gn(e),a=new URLSearchParams;a.set(`mission`,`${r}~${i}`),a.set(`fog`,o.toString());let s=`${window.location.pathname}?${a}${t}`,c=`${window.location.origin}${s}`;window.history.replaceState(null,``,s);try{await navigator.clipboard.writeText(c),l(!0),u.current=setTimeout(()=>{l(!1)},1100)}catch(e){console.error(e)}},t[0]=n,t[1]=o,t[2]=r,t[3]=i,t[4]=d):d=t[4];let f=d,p=s?`true`:`false`,m,h,g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,B.jsx)(dn,{className:hn.PinIcon}),h=(0,B.jsx)(rn,{className:hn.ClipboardIcon}),g=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:` Link to coordinates`}),t[5]=m,t[6]=h,t[7]=g):(m=t[5],h=t[6],g=t[7]);let _;return t[8]!==a||t[9]!==f||t[10]!==p?(_=(0,B.jsxs)(`button`,{type:`button`,className:hn.Button,"aria-label":`Link to coordinates`,title:`Copy the current coordinates to URL`,onClick:f,disabled:a,"data-copied":p,id:`copyCoordinatesButton`,children:[m,h,g]}),t[8]=a,t[9]=f,t[10]=p,t[11]=_):_=t[11],_}function vn(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0V0z`},child:[]},{tag:`path`,attr:{d:`M21 3H3c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5a2 2 0 0 0-2-2zm0 14H3V5h18v12zm-5-6-7 4V7z`},child:[]}]})(e)}function yn(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`m18.89 14.75-4.09-2.04c-.28-.14-.58-.21-.89-.21H13v-6c0-.83-.67-1.5-1.5-1.5S10 5.67 10 6.5v10.74l-3.25-.74a.99.99 0 0 0-.92.28l-.83.84 4.54 4.79c.38.38 1.14.59 1.67.59h6.16c1 0 1.84-.73 1.98-1.72l.63-4.46c.12-.85-.32-1.68-1.09-2.07z`},child:[]},{tag:`path`,attr:{d:`M20.13 3.87C18.69 2.17 15.6 1 12 1S5.31 2.17 3.87 3.87L2 2v5h5L4.93 4.93c1-1.29 3.7-2.43 7.07-2.43s6.07 1.14 7.07 2.43L17 7h5V2l-1.87 1.87z`},child:[]}]})(e)}var bn=j(e=>({events:null,scanProgress:null,setEvents(t){e({events:t})},setScanProgress(t){e({scanProgress:t})},reset(){e({events:null,scanProgress:null})}}));function xn(e,t){return M(bn,e,t)}var Sn=A(`relayClient`),Cn=class{ws=null;handlers;url;_connected=!1;wsPingInterval=null;smoothedWsPing=0;constructor(e,t){this.url=e,this.handlers=t}get connected(){return this._connected}connect(){this.ws=new WebSocket(this.url),this.ws.binaryType=`arraybuffer`,this.ws.onopen=()=>{Sn.info(`WebSocket connected to %s`,this.url),this._connected=!0,this.startWsPing(),this.handlers.onOpen?.()},this.ws.onmessage=e=>{if(e.data instanceof ArrayBuffer)this.handlers.onGamePacket?.(new Uint8Array(e.data));else try{let t=JSON.parse(e.data);this.handleMessage(t)}catch(e){Sn.error(`Failed to parse relay message: %o`,e)}},this.ws.onclose=()=>{Sn.info(`WebSocket disconnected`),this._connected=!1,this.stopWsPing(),this.handlers.onClose?.()},this.ws.onerror=()=>{Sn.error(`WebSocket error`),this.handlers.onError?.(`WebSocket connection error`)}}handleMessage(e){switch(e.type){case`serverList`:this.handlers.onServerList?.(e.servers);break;case`status`:this.handlers.onStatus?.(e.status,e.message,e.connectSequence,e.mapName);break;case`ping`:this.handlers.onPing?.(e.ms);break;case`wsPong`:{let t=Date.now()-e.ts;this.smoothedWsPing=this.smoothedWsPing===0?t:this.smoothedWsPing*.5+t*.5,this.handlers.onWsPing?.(Math.round(this.smoothedWsPing));break}case`error`:this.handlers.onError?.(e.message);break}}listServers(){this.send({type:`listServers`})}sendWsPing(){this.send({type:`wsPing`,ts:Date.now()})}joinServer(e,t){Sn.info(`Joining server: %s`,e),this.send({type:`joinServer`,address:e,warriorName:t})}sendAuthEvent(e,t){this.send({type:`sendCommand`,command:e,args:t})}sendCommand(e,t){this.send({type:`sendCommand`,command:e,args:t})}sendCRCResponse(e,t,n){this.send({type:`sendCRCResponse`,crcValue:e,field1:t,field2:n})}sendCRCCompute(e,t,n,r){this.send({type:`sendCRCCompute`,seed:e,field2:t,includeTextures:r,datablocks:n})}sendGhostAck(e,t){this.send({type:`sendGhostAck`,sequence:e,ghostCount:t})}sendMoves(e,t){this.send({type:`sendMoves`,moves:e,moveStartIndex:t})}close(){this.stopWsPing(),this.ws&&=(this.ws.close(),null),this._connected=!1}startWsPing(){this.smoothedWsPing=0,this.send({type:`wsPing`,ts:Date.now()}),this.wsPingInterval=setInterval(()=>{this.send({type:`wsPing`,ts:Date.now()})},7e3)}stopWsPing(){this.wsPingInterval!=null&&(clearInterval(this.wsPingInterval),this.wsPingInterval=null)}send(e){this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):Sn.warn(`send dropped (ws not open): %s`,e.type)}},wn=256,Tn=wn/2,En=2048,Dn=null;function On(e){Dn=e}function kn(e,t){return Dn?Dn(e,t):null}function An(e,t){return(n,r)=>{let i=n/t+Tn,a=r/t+Tn,o=Math.max(0,Math.min(wn-1,i)),s=Math.max(0,Math.min(wn-1,a)),c=Math.floor(o),l=Math.floor(s),u=Math.min(c+1,wn-1),d=Math.min(l+1,wn-1),f=o-c,p=s-l,m=e[l*wn+c],h=e[l*wn+u],g=e[d*wn+c],_=e[d*wn+u],v=m*(1-f)+h*f,y=g*(1-f)+_*f;return(v*(1-p)+y*p)/65535*En}}var jn=A(`StreamEngine`),Mn=class{registry;ghostTracker;entities=new Map;entityIdByGhostIndex=new Map;tickCount=0;camera=null;chatMessages=[];chatMessageIdCounter=0;_chatGen=0;_chatSnapshotGen=-1;_chatSnapshot=[];audioEvents=[];netStrings=new Map;targetNames=new Map;targetTeams=new Map;targetRenderFlags=new Map;pendingNameTags=new Map;sensorGroupColors=new Map;playerSensorGroup=0;lastStatus={health:1,energy:1};latestControl={ghostIndex:-1};controlPlayerGhostId;lastControlType=`camera`;isPiloting=!1;lastPilotGhostIndex;lastVehicleHeading=0;lastVehiclePitch=0;lastVehicleOrbitDir;lastVehicleVelocity;lastVehiclePosTime=0;lastVehiclePos;firstPerson=!0;lastCameraMode;lastOrbitGhostIndex;lastOrbitDistance;latestFov=90;weaponsHud={slots:new Map,activeIndex:-1};backpackHud={packIndex:-1,active:!1,text:``};inventoryHud={slots:new Map,activeSlot:-1};teamScores=[];playerRoster=new Map;clockAnchorStreamSec=null;clockDurationMs=0;missionDisplayName=null;missionTypeDisplayName=null;gameClassName=null;serverDisplayName=null;connectedPlayerName=null;connectedClientId=null;onMissionInfoChange;nextExplosionId=0;resolveGhostClassName(e,t){if(typeof t==`number`){let e=this.registry.getGhostParser(t)?.name;if(e)return e}let n=this.entityIdByGhostIndex.get(e);if(n){let e=this.entities.get(n);if(e?.className)return e.className}let r=this.ghostTracker.getGhost(e);if(r?.className)return r.className}resolveEntityIdForGhostIndex(e){let t=this.entityIdByGhostIndex.get(e);if(t)return t;let n=this.ghostTracker.getGhost(e);if(n)return ne(n.className,e)}resetSharedState(){this.entities.clear(),this.entityIdByGhostIndex.clear(),this.tickCount=0,this.camera=null,this.chatMessages=[],this.chatMessageIdCounter=0,this._chatGen=0,this._chatSnapshotGen=-1,this._chatSnapshot=[],this.audioEvents=[],this.netStrings.clear(),this.targetNames.clear(),this.targetTeams.clear(),this.targetRenderFlags.clear(),this.sensorGroupColors.clear(),this.playerSensorGroup=0,this.lastStatus={health:1,energy:1},this.latestControl={ghostIndex:-1},this.controlPlayerGhostId=void 0,this.lastControlType=`camera`,this.isPiloting=!1,this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0,this.firstPerson=!0,this.lastCameraMode=void 0,this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0,this.latestFov=90,this.weaponsHud={slots:new Map,activeIndex:-1},this.backpackHud={packIndex:-1,active:!1,text:``},this.inventoryHud={slots:new Map,activeSlot:-1},this.teamScores=[],this.playerRoster.clear(),this.clockAnchorStreamSec=null,this.clockDurationMs=0,this.nextExplosionId=0,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null}resolveNetString(e){if(e.length>=2&&e.charCodeAt(0)===1){let t=parseInt(e.slice(1),10);if(Number.isFinite(t))return this.netStrings.get(t)??e}return e}formatRemoteArgs(e,t){let n=this.resolveNetString(e);for(let e=0;e0&&(this.playerSensorGroup=t.sensorGroup)}if(t){let e=oe(t);if(e&&(this.lastControlType=e),this.lastControlType===`player`)this.isPiloting=!!(t.pilot||t.controlObjectGhost!=null),this.isPiloting&&typeof t.controlObjectGhost==`number`?this.lastPilotGhostIndex=t.controlObjectGhost:this.isPiloting||(this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0);else if(this.isPiloting=!1,typeof t.cameraMode==`number`)if(this.lastCameraMode=t.cameraMode,t.cameraMode===3){typeof t.orbitObjectGhostIndex==`number`&&(this.lastOrbitGhostIndex=t.orbitObjectGhostIndex);let e=t.minOrbitDist,n=t.maxOrbitDist,r=t.curOrbitDist;typeof e==`number`&&typeof n==`number`&&Number.isFinite(e)&&Number.isFinite(n)?this.lastOrbitDistance=Math.max(0,n-e):typeof r==`number`&&Number.isFinite(r)&&(this.lastOrbitDistance=Math.max(0,r))}else this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0}e.cameraFov!==void 0&&(this.latestFov=e.cameraFov)}processEvent(e,t){let n=e.parsedData;if(!n)return;let r=n.type;if(r===`GhostAlwaysObjectEvent`){let e=n.ghostIndex,t=n.classId,r=n.objectData,i=n._hasObjectData,a=typeof t==`number`?this.registry.getGhostParser(t)?.name??`classId=${t}`:`?`;jn.debug(`GhostAlwaysObjectEvent: ghost=%d class=%s hasData=%s %s`,e,a,i,r?`keys=[${Object.keys(r).join(`,`)}]`:`(no data)`),e!=null&&t!=null&&this.processGhostUpdate({index:e,type:`create`,classId:t,parsedData:r});return}if(r===`NetStringEvent`||t===`NetStringEvent`){let e=n.id,t=n.value;if(e!=null&&typeof t==`string`){this.netStrings.set(e,t);let n=this.pendingNameTags.get(e);if(n!=null){this.pendingNameTags.delete(e);let r=I(t).trim();this.targetNames.set(n,r);for(let e of this.entities.values())e.targetId===n&&(e.playerName=r)}}return}if(r===`TargetInfoEvent`||t===`TargetInfoEvent`){let e=n.targetId,t=n.nameTag;if(e!=null&&t!=null){let n=this.netStrings.get(t);n?this.targetNames.set(e,I(n).trim()):this.pendingNameTags.set(t,e)}let r=n.sensorGroup;e!=null&&r!=null&&this.targetTeams.set(e,r);let i=n.renderFlags;if(e!=null&&i!=null&&this.targetRenderFlags.set(e,i),e!=null){let t=this.targetNames.get(e),n=this.targetTeams.get(e),r=this.targetRenderFlags.get(e);for(let i of this.entities.values())i.targetId===e&&(t&&(i.playerName=t),n!=null&&(i.sensorGroup=n),r!=null&&(i.targetRenderFlags=r))}return}if(r===`SetSensorGroupEvent`||t===`SetSensorGroupEvent`){let e=n.sensorGroup;e!=null&&(this.playerSensorGroup=e);return}if(r===`SensorGroupColorEvent`||t===`SensorGroupColorEvent`){let e=n.sensorGroup,t=n.colors;if(t){let n=this.sensorGroupColors.get(e);n||(n=new Map,this.sensorGroupColors.set(e,n));for(let e of t)e.default?n.delete(e.index):n.set(e.index,{r:e.r??0,g:e.g??0,b:e.b??0})}return}if(r===`RemoteCommandEvent`||t===`RemoteCommandEvent`){let e=this.resolveNetString(n.funcName),t=n.args,r=this.getTimeSec();if(e===`ChatMessage`&&t.length>=4){let e=de(this.resolveNetString(t[3])),n=t[4]?I(this.resolveNetString(t[4])):``,i=this.formatRemoteArgs(t[3],t.slice(4));if(i){let a=i.indexOf(`: `),{text:o,wavPath:s}=he(a>=0?i.slice(a+2):i),c,l;if(s){let e=this.resolveNetString(t[1]);c=e?`voice/${e}/${s}.wav`:s;let n=this.resolveNetString(t[2]);if(n){let e=parseFloat(n);Number.isFinite(e)&&(l=Math.max(.5,Math.min(2,e)))}}let u=e??0;this.pushChatMessage({timeSec:r,sender:n,text:o,kind:`chat`,colorCode:u,segments:[{text:n?`${n}: ${o}`:o,colorCode:u}],soundPath:c,soundPitch:l})}}else if(e===`CannedChatMessage`&&t.length>=6){let e=de(this.resolveNetString(t[1])),n=I(this.resolveNetString(t[2])),i=I(this.resolveNetString(t[4])),a=this.formatRemoteArgs(t[1],t.slice(2));if(a){let{wavPath:o}=he(a),s=he(I(this.resolveNetString(t[3]))).text,c,l;if(o){let e=this.resolveNetString(t[5]);if(c=e?`voice/${e}/${o}.wav`:o,t[6]){let e=parseFloat(this.resolveNetString(t[6]));Number.isFinite(e)&&(l=Math.max(.5,Math.min(2,e)))}}let u=e??0,d=[];i&&d.push({text:`[${i}] `,colorCode:0}),d.push({text:n?`${n}: ${s}`:s,colorCode:u}),this.pushChatMessage({timeSec:r,sender:n,text:s,kind:`chat`,colorCode:u,segments:d,soundPath:c,soundPitch:l})}}else if(e===`ServerMessage`&&t.length>=2){this.handleServerMessage(t);let e=de(this.resolveNetString(t[1])),n=this.formatRemoteArgs(t[1],t.slice(2));if(n){let{text:t,wavPath:i}=he(n),a=e??0;this.pushChatMessage({timeSec:r,sender:``,text:t,kind:`server`,colorCode:a,segments:[{text:t,colorCode:a}],soundPath:i??void 0})}}else this.handleHudRemoteCommand(e,t);return}if(r===`Sim3DAudioEvent`||r===`Sim2DAudioEvent`||t===`Sim3DAudioEvent`||t===`Sim2DAudioEvent`){let e=n.profileId;if(typeof e==`number`){let i=this.getTimeSec(),a=r===`Sim3DAudioEvent`||t===`Sim3DAudioEvent`?n.position:void 0;this.audioEvents.push({profileId:e,position:a,timeSec:i}),this.audioEvents.length>100&&this.audioEvents.splice(0,this.audioEvents.length-100)}}}processGhostUpdate(e){let t=e.index,n=this.entityIdByGhostIndex.get(t);if(n){let t=this.entities.get(n);t&&t.type===`Projectile`&&!t.hasExploded&&t.explosionDataBlockId!=null&&t.position&&(e.type===`delete`||e.type===`create`)&&this.spawnExplosion(t,[...t.position])}if(e.type===`delete`){n&&(this.removeSoundSlotEntities(n),this.entities.delete(n),this.entityIdByGhostIndex.delete(t));return}let r=this.resolveGhostClassName(t,e.classId);if(!r){if(e.type===`create`)throw Error(`No ghost parser for classId ${e.classId} (ghost index ${t})`);return}let i=ne(r,t);n&&n!==i&&(this.removeSoundSlotEntities(n),this.entities.delete(n));let a,o=this.entities.get(i);if(o&&e.type===`create`?(this.removeSoundSlotEntities(i),o.spawnTick=this.tickCount,this.resetEntity(o),a=o):o?a=o:(a={id:i,ghostIndex:t,className:r,spawnTick:this.tickCount,type:F(r),rotation:[0,0,0,1]},this.entities.set(i,a)),a.ghostIndex=t,a.className=r,a.type=F(r),this.entityIdByGhostIndex.set(t,i),this.applyGhostData(a,e.parsedData),e.type===`create`&&e.parsedData){let n=De(r,t,e.parsedData);n&&(a.sceneData=n)}}resetEntity(e){e.rotation=[0,0,0,1],e.hasExploded=void 0,e.explosionShape=void 0,e.explosionLifetimeTicks=void 0,e.faceViewer=void 0,e.simulatedVelocity=void 0,e.projectilePhysics=void 0,e.gravityMod=void 0,e.direction=void 0,e.velocity=void 0,e.position=void 0,e.dataBlock=void 0,e.dataBlockId=void 0,e.shapeHint=void 0,e.visual=void 0,e.targetId=void 0,e.targetRenderFlags=void 0,e.carryingFlag=void 0,e.sensorGroup=void 0,e.playerName=void 0,e.weaponShape=void 0,e.packShape=void 0,e.falling=void 0,e.jetting=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0,e.weaponImageStatesDbId=void 0,e.itemPhysics=void 0,e.threads=void 0,e.headPitch=void 0,e.headYaw=void 0,e.health=void 0,e.energy=void 0,e.maxEnergy=void 0,e.damageState=void 0,e.actionAnim=void 0,e.actionAtEnd=void 0,e.explosionDataBlockId=void 0,e.maintainEmitterId=void 0}applyGhostData(e,t){if(!t)return;let n=t,r=n.dataBlockId;if(r!=null){e.dataBlockId=r;let t=this.getDataBlockData(r),i=me(e.className,t);if(e.visual=le(e.className,t)??ue(e.className,t),typeof i==`string`&&(e.shapeHint=i,e.dataBlock=i),e.type===`Player`&&typeof t?.maxEnergy==`number`&&(e.maxEnergy=t.maxEnergy),e.type===`Projectile`&&(ae.has(e.className)?e.projectilePhysics=`linear`:Se.has(e.className)?(e.projectilePhysics=`ballistic`,e.gravityMod=ve(t,[`gravityMod`])??1):re.has(e.className)&&(e.projectilePhysics=`seeker`)),e.type===`Projectile`&&e.explosionDataBlockId==null){let t=this.resolveExplosionInfo(r);t&&(e.explosionShape=t.shape,e.faceViewer=t.faceViewer,e.explosionLifetimeTicks=t.lifetimeTicks,e.explosionDataBlockId=t.explosionDataBlockId)}if(e.type===`Projectile`&&e.maintainEmitterId==null){let n=t?.baseEmitter;typeof n==`number`&&n>0&&(e.maintainEmitterId=n)}if(e.className===`ForceFieldBare`&&t){let r=t.color1,i=[];for(let e=0;e<5;e++){let n=t[`texture${e}`];n&&i.push(n)}let a=n.scale;e.forceFieldData={textures:i,color:r?[r.r,r.g,r.b]:[1,1,1],baseTranslucency:t.baseTranslucency??1,dimensions:a?[a.y,a.z,a.x]:[1,1,1],framesPerSec:t.framesPerSec??1,scrollSpeed:t.scrollSpeed??0,umapping:t.umapping??1,vmapping:t.vmapping??1}}}if(e.type===`Player`){let t=n.images;if(Array.isArray(t)&&t.length>0){let n=t.find(e=>e.index===0);if(n?.dataBlockId&&n.dataBlockId>0){let t=this.getDataBlockData(n.dataBlockId),r=me(`ShapeBaseImageData`,t);if(r){let n=t?.mountPoint;(n==null||n<=0)&&!/pack_/i.test(r)&&(e.weaponShape=r)}let i=e.weaponImageState;e.weaponImageState={dataBlockId:n.dataBlockId,triggerDown:n.triggerDown??i?.triggerDown??!1,ammo:n.ammo??i?.ammo??!0,loaded:n.loaded??i?.loaded??!0,target:n.target??i?.target??!1,wet:n.wet??i?.wet??!1,fireCount:n.fireCount??i?.fireCount??0},t&&e.weaponImageStatesDbId!==n.dataBlockId&&(e.weaponImageStates=ce(t),e.weaponImageStatesDbId=n.dataBlockId)}else n&&!n.dataBlockId&&(e.weaponShape=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0);let r=t.find(e=>e.index===2);if(r?.dataBlockId&&r.dataBlockId>0){let t=me(`ShapeBaseImageData`,this.getDataBlockData(r.dataBlockId));t&&(e.packShape=t)}else r&&!r.dataBlockId&&(e.packShape=void 0);let i=t.find(e=>e.index===3);if(i?.dataBlockId&&i.dataBlockId>0){e.carryingFlag=!0;let t=me(`ShapeBaseImageData`,this.getDataBlockData(i.dataBlockId));if(t&&(e.flagShape=t),e.targetId!=null&&e.targetId>=0){let t=this.targetRenderFlags.get(e.targetId)??0,n=t|2;n!==t&&(this.targetRenderFlags.set(e.targetId,n),e.targetRenderFlags=n)}}else if(i&&!i.dataBlockId&&(e.carryingFlag=!1,e.flagShape=void 0,e.targetId!=null&&e.targetId>=0)){let t=this.targetRenderFlags.get(e.targetId)??0,n=t&-3;n!==t&&(this.targetRenderFlags.set(e.targetId,n),e.targetRenderFlags=n)}}}let i=pe(n.position)?n.position:pe(n.initialPosition)?n.initialPosition:pe(n.explodePosition)?n.explodePosition:pe(n.endPoint)?n.endPoint:pe(n.transform?.position)?n.transform.position:void 0;i&&(e.position=[i.x,i.y,i.z],this.updateSoundSlotPositions(e));let a=be(n.direction)?n.direction:void 0;if(a&&(e.direction=[a.x,a.y,a.z]),e.type===`Player`&&typeof n.rotationZ==`number`&&(e.rotation=ge(n.rotationZ)),e.type===`Player`&&(typeof n.headX==`number`&&(e.headPitch=n.headX),typeof n.headZ==`number`&&(e.headYaw=n.headZ)),se(n.angPosition)){let t=L(n.angPosition);t&&(e.rotation=t)}else if(se(n.transform?.rotation)){let t=L(n.transform.rotation);t&&(e.rotation=t)}else if(e.type===`Item`&&typeof n.rotation?.angle==`number`){let t=n.rotation;e.rotation=ge((t.zSign??1)*t.angle)}else if(e.type===`Projectile`){let t=n.velocity??n.direction??(pe(n.initialPosition)&&pe(n.endPos)?{x:n.endPos.x-n.initialPosition.x,y:n.endPos.y-n.initialPosition.y,z:n.endPos.z-n.initialPosition.z}:void 0);be(t)&&(t.x!==0||t.y!==0)&&(e.rotation=ge(Math.atan2(t.x,t.y)))}if(be(n.velocity)&&(e.velocity=[n.velocity.x,n.velocity.y,n.velocity.z],e.direction||=[n.velocity.x,n.velocity.y,n.velocity.z]),typeof n.moveFlag0==`boolean`&&(e.falling=n.moveFlag0),typeof n.moveFlag1==`boolean`&&(e.jetting=n.moveFlag1),e.type===`Item`){let t=n.atRest;if(t===!1&&be(n.velocity)){let t=n.velocity;e.itemPhysics={velocity:[t.x,t.y,t.z],atRest:!1},jn.debug(`Item %s (%s): atRest=false pos=%s vel=%s`,e.id,e.shapeHint??e.dataBlock??`db#${e.dataBlockId}`,n.position?`${n.position.x.toFixed(1)},${n.position.y.toFixed(1)},${n.position.z.toFixed(1)}`:`none`,`${t.x.toFixed(1)},${t.y.toFixed(1)},${t.z.toFixed(1)}`)}else t===!0&&(jn.debug(`Item %s (%s): atRest=true pos=%s`,e.id,e.shapeHint??e.dataBlock??`db#${e.dataBlockId}`,e.position?`${e.position[0].toFixed(1)},${e.position[1].toFixed(1)},${e.position[2].toFixed(1)}`:`none`),e.itemPhysics=void 0)}if(e.projectilePhysics){if(e.projectilePhysics===`linear`){let t=ve(e.dataBlockId==null?void 0:this.getDataBlockData(e.dataBlockId),[`dryVelocity`,`muzzleVelocity`,`bulletVelocity`])??80,r=e.direction??[0,1,0],i=r[0]*t,a=r[1]*t,o=r[2]*t,s=n.excessVel,c=n.excessDir;typeof s==`number`&&s>0&&be(c)&&(i+=c.x*s,a+=c.y*s,o+=c.z*s),e.simulatedVelocity=[i,a,o]}else be(n.velocity)&&(e.simulatedVelocity=[n.velocity.x,n.velocity.y,n.velocity.z]);let t=n.currTick;if(typeof t==`number`&&t>0&&e.simulatedVelocity&&e.position){let n=32/1e3*t,r=e.simulatedVelocity;if(e.position[0]+=r[0]*n,e.position[1]+=r[1]*n,e.position[2]+=r[2]*n,e.projectilePhysics===`ballistic`){let t=-9.81*(e.gravityMod??1);e.position[2]+=.5*t*n*n,r[2]+=t*n}}}let o=pe(n.explodePosition)?n.explodePosition:pe(n.explodePoint)?n.explodePoint:void 0;if(e.type===`Projectile`&&!e.hasExploded&&o&&e.explosionDataBlockId!=null&&this.spawnExplosion(e,[o.x,o.y,o.z]),typeof n.damageLevel==`number`&&(e.health=_e(1-n.damageLevel,0,1)),typeof n.damageState==`number`&&(e.damageState=n.damageState),typeof n.action==`number`&&(e.actionAnim=n.action,e.actionAtEnd=!!n.actionAtEnd),Array.isArray(n.threads)){let t=n.threads;if(e.threads){let n=[...e.threads];for(let e of t){let t=n.findIndex(t=>t.index===e.index);t>=0?n[t]=e:n.push(e)}e.threads=n}else e.threads=t}if(typeof n.energy==`number`&&(e.energy=_e(n.energy,0,1)),typeof n.targetId==`number`){e.targetId=n.targetId;let t=this.targetNames.get(n.targetId);t&&(e.playerName=t);let r=this.targetTeams.get(n.targetId);r!=null&&(e.sensorGroup=r,e.ghostIndex===this.latestControl.ghostIndex&&this.lastControlType===`player`&&(this.playerSensorGroup=r));let i=this.targetRenderFlags.get(n.targetId);i!=null&&(e.targetRenderFlags=i)}let s=n.sounds;Array.isArray(s)&&this.syncSoundSlotEntities(e,s),e.className===`WayPoint`&&typeof n.name==`string`&&(e.label=n.name),e.className===`AudioEmitter`&&(typeof n.filename==`string`&&(e.audioFileName=n.filename),typeof n.volume==`number`&&(e.audioVolume=n.volume),typeof n.is3D==`boolean`&&(e.audioIs3D=n.is3D),typeof n.isLooping==`boolean`&&(e.audioIsLooping=n.isLooping),typeof n.minDistance==`number`&&(e.audioMinDistance=n.minDistance),typeof n.maxDistance==`number`&&(e.audioMaxDistance=n.maxDistance),typeof n.minLoopGap==`number`&&(e.audioMinLoopGap=n.minLoopGap),typeof n.maxLoopGap==`number`&&(e.audioMaxLoopGap=n.maxLoopGap))}syncSoundSlotEntities(e,t){for(let n of t){let t=`${e.id}:sound:${n.index}`;if(n.playing&&typeof n.profileId==`number`){let r=this.getDataBlockData(n.profileId),i=r?.filename;if(!i)continue;let a=i.endsWith(`.wav`)?i:`${i}.wav`,o=r.description,s=o==null?void 0:this.getDataBlockData(o),c=this.entities.get(t);c?c.position=e.position:this.entities.set(t,{id:t,ghostIndex:e.ghostIndex,className:`AudioEmitter`,type:`AudioEmitter`,spawnTick:this.tickCount,position:e.position,rotation:[0,0,0,1],audioFileName:a,audioVolume:s?.volume??1,audioIs3D:s?.is3D??!0,audioIsLooping:s?.isLooping??!1,audioMinDistance:s?.referenceDistance??20,audioMaxDistance:s?.maxDistance??100,audioMinLoopGap:s?.minLoopGap??0,audioMaxLoopGap:s?.maxLoopGap??0})}else this.entities.delete(t)}}updateSoundSlotPositions(e){for(let t=0;t<4;t++){let n=this.entities.get(`${e.id}:sound:${t}`);n&&(n.position=e.position)}}removeSoundSlotEntities(e){for(let t=0;t<4;t++)this.entities.delete(`${e}:sound:${t}`)}resolveExplosionInfo(e){let t=this.getDataBlockData(e);if(!t)return;let n=t.explosion;if(n==null)return;let r=this.getDataBlockData(n);if(!r)return;let i=r.dtsFileName||void 0,a=r.lifetimeMS??31;return{shape:i,faceViewer:r.faceViewer!==!1&&r.faceViewer!==0,lifetimeTicks:a,explosionDataBlockId:n}}spawnExplosion(e,t){e.hasExploded=!0;let n=e.explosionLifetimeTicks??31,r=`fx_${this.nextExplosionId++}`,i={id:r,ghostIndex:-1,className:`Explosion`,spawnTick:this.tickCount,type:`Explosion`,dataBlock:e.explosionShape,explosionDataBlockId:e.explosionDataBlockId,position:t,rotation:[0,0,0,1],isExplosion:!0,faceViewer:e.faceViewer!==!1,expiryTick:this.tickCount+n};if(this.entities.set(r,i),e.explosionDataBlockId!=null){let n=this.getDataBlockData(e.explosionDataBlockId)?.subExplosions;if(Array.isArray(n))for(let e of n){if(e==null)continue;let n=this.getDataBlockData(e);if(!n)continue;let r=n.dtsFileName||void 0,i=n.lifetimeMS??31,a=n.offset??0,o=Math.random()*Math.PI*2,s=[t[0]+Math.cos(o)*a,t[1]+Math.sin(o)*a,t[2]],c=`fx_${this.nextExplosionId++}`,l={id:c,ghostIndex:-1,className:`Explosion`,spawnTick:this.tickCount,type:`Explosion`,dataBlock:r,explosionDataBlockId:e,position:s,rotation:[0,0,0,1],isExplosion:!0,faceViewer:n.faceViewer!==!1&&n.faceViewer!==0,expiryTick:this.tickCount+i};this.entities.set(c,l)}}e.position=void 0,e.simulatedVelocity=void 0}advanceProjectiles(){let e=32/1e3;for(let t of this.entities.values()){if(!t.simulatedVelocity||!t.position)continue;let n=t.simulatedVelocity,r=t.position;t.projectilePhysics===`ballistic`&&(n[2]+=-9.81*(t.gravityMod??1)*e),r[0]+=n[0]*e,r[1]+=n[1]*e,r[2]+=n[2]*e,(n[0]!==0||n[1]!==0)&&(t.rotation=ge(Math.atan2(n[0],n[1])))}}advanceItems(){let e=32/1e3;for(let t of this.entities.values()){let n=t.itemPhysics;if(!n||n.atRest||!t.position)continue;let r=n.velocity,i=t.position;r[2]+=-20*e,i[0]+=r[0]*e,i[1]+=r[1]*e,i[2]+=r[2]*e;let a=kn(i[0],i[1]);if(a!=null&&i[2]0){let e=Math.max(0,1-t/o);r[0]*=e,r[1]*=e}r[2]=e*.2,Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2])<.15&&(r[0]=r[1]=r[2]=0,n.atRest=!0)}i[2]<-1e3&&(n.atRest=!0)}}removeExpiredExplosions(){for(let[e,t]of this.entities)t.isExplosion&&t.expiryTick!=null&&this.tickCount>=t.expiryTick&&this.entities.delete(e)}updateCameraAndHud(){let e=this.latestControl,t=this.getTimeSec(),n=e.data,r=this.lastControlType;if(this.removeExpiredExplosions(),e.position){let{yaw:i,pitch:a}=this.getCameraYawPitch(n);if(this.isPiloting){if(n){let e=n.controlObjectData?.angPosition;if(e&&typeof e.w==`number`){this.lastVehicleHeading=xe(e),this.lastVehiclePitch=we(e);let t=L(e);if(t){let[e,n,r,i]=t,a=1-2*(n*n+r*r),o=2*(e*n+r*i),s=2*(e*r-n*i);this.lastVehicleOrbitDir=[-a,-o,-s]}}}i=this.lastVehicleHeading,a=this.lastVehiclePitch}if(this.camera={time:t,position:[e.position.x,e.position.y,e.position.z],rotation:Ce(i,_e(a,-ye,ye)),fov:this.latestFov,mode:`observer`,yaw:i,pitch:a},r===`camera`)if((typeof n?.cameraMode==`number`?n.cameraMode:this.lastCameraMode)===3){this.camera.mode=`third-person`,typeof this.lastOrbitDistance==`number`&&(this.camera.orbitDistance=this.lastOrbitDistance);let e=typeof n?.orbitObjectGhostIndex==`number`?n.orbitObjectGhostIndex:this.lastOrbitGhostIndex;typeof e==`number`&&e>=0&&(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(e))}else this.camera.mode=`observer`;else e.ghostIndex>=0&&(this.controlPlayerGhostId=this.resolveEntityIdForGhostIndex(e.ghostIndex)),this.firstPerson?this.camera.mode=`first-person`:(this.camera.mode=`third-person`,this.isPiloting&&this.lastPilotGhostIndex!=null?(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),this.camera.orbitDistance=15,this.lastVehicleOrbitDir&&(this.camera.orbitDirection=this.lastVehicleOrbitDir)):(this.camera.orbitTargetId=this.controlPlayerGhostId,this.camera.orbitDistance=3)),this.controlPlayerGhostId&&(this.camera.controlEntityId=this.controlPlayerGhostId);if(r===`player`&&e.position){if(this.isPiloting&&this.lastPilotGhostIndex!=null){let r=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),i=r?this.entities.get(r):void 0;if(i){let r=n?.controlObjectData;if(r){i.position=[e.position.x,e.position.y,e.position.z],this.lastVehiclePos=i.position.slice(),this.lastVehiclePosTime=t;let n=r.linMomentum;if(n&&pe(n)){let e=i.dataBlockId,t=(e==null?void 0:this.getDataBlockData(e))?.mass??200,r=t>0?1/t:1/200;this.lastVehicleVelocity=[n.x*r,n.y*r,n.z*r],i.velocity=this.lastVehicleVelocity}let a=r.angPosition;if(a&&typeof a.w==`number`){let e=L(a);e&&(i.rotation=e)}}else if(this.lastVehiclePos&&this.lastVehicleVelocity&&this.lastVehiclePosTime>0){let e=t-this.lastVehiclePosTime;if(e>0&&e<1){let[t,n,r]=this.lastVehicleVelocity;i.position=[this.lastVehiclePos[0]+t*e,this.lastVehiclePos[1]+n*e,this.lastVehiclePos[2]+r*e]}}}}else if(this.controlPlayerGhostId){let t=this.entities.get(this.controlPlayerGhostId);if(t){t.position=[e.position.x,e.position.y,e.position.z],t.rotation=ge(i),t.headPitch=this.getControlPlayerHeadPitch(a);let r=n?.velocity;be(r)&&(t.velocity=[r.x,r.y,r.z])}}}}else this.camera&&={...this.camera,time:t,fov:this.latestFov};let i={health:1,energy:1};if(this.camera?.mode===`first-person`){let e=this.controlPlayerGhostId,t=e?this.entities.get(e):void 0;i.health=t?.health??1;let r=n?.energyLevel;if(typeof r==`number`){let e=t?.maxEnergy??60;e>0&&(i.energy=_e(r/e,0,1))}else i.energy=t?.energy??1}else if(this.camera?.mode===`third-person`&&this.camera.orbitTargetId){let e=this.entities.get(this.camera.orbitTargetId);i.health=e?.health??1,i.energy=e?.energy??1}this.lastStatus=i}getControlPlayerHeadPitch(e){return _e(e/ye,-1,1)}getAbsoluteRotation(e){return e?typeof e.rotationZ==`number`&&typeof e.headX==`number`?{yaw:e.rotationZ,pitch:e.headX}:typeof e.rotZ==`number`&&typeof e.rotX==`number`?{yaw:e.rotZ,pitch:e.rotX}:null:null}resolveIffColor(e){if(this.playerSensorGroup===0)return;let t=this.sensorGroupColors.get(this.playerSensorGroup);if(t){let n=t.get(e);if(n)return n}if(e===this.playerSensorGroup)return ie;if(e!==0)return P}pushChatMessage(e){this.chatMessages.push({...e,id:++this.chatMessageIdCounter}),this.chatMessages.length>200&&this.chatMessages.splice(0,this.chatMessages.length-200),this._chatGen++}handleServerMessage(e){if(e.length<2)return;let t=this.resolveNetString(e[0]);if((t===`MsgTeamScoreIs`||t===`MsgTeamScore`)&&e.length>=4){let t=parseInt(this.resolveNetString(e[2]),10),n=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(t)&&!isNaN(n)){let e=this.teamScores.find(e=>e.teamId===t);e&&(e.score=n,this.onTeamScoresChanged())}}else if(t===`MsgCTFAddTeam`&&e.length>=6){let t=parseInt(this.resolveNetString(e[2]),10),n=I(this.resolveNetString(e[3])),r=parseInt(this.resolveNetString(e[5]),10);if(!isNaN(t)&&t>0){let e=this.teamScores.find(e=>e.teamId===t);e?(e.name=n,e.score=isNaN(r)?e.score:r):this.teamScores.push({teamId:t,name:n,score:isNaN(r)?0:r,playerCount:0}),this.onTeamScoresChanged()}}else if(t===`MsgClientJoin`&&e.length>=4){let t=I(this.resolveNetString(e[2])).trim(),n=parseInt(this.resolveNetString(e[3]),10);isNaN(n)||(this.playerRoster.set(n,{name:t,teamId:0,score:0,ping:0,packetLoss:0}),this.onRosterChanged()),!this.connectedPlayerName&&t&&I(this.resolveNetString(e[1])).includes(`Welcome to Tribes`)&&(this.connectedPlayerName=t,this.connectedClientId=n,this.onMissionInfoChange?.())}else if(t===`MsgClientDrop`&&e.length>=4){let t=parseInt(this.resolveNetString(e[3]),10);isNaN(t)||(this.playerRoster.delete(t),this.onRosterChanged())}else if(t===`MsgClientJoinTeam`&&e.length>=6){let t=parseInt(this.resolveNetString(e[4]),10),n=parseInt(this.resolveNetString(e[5]),10);if(!isNaN(t)&&!isNaN(n)){let e=this.playerRoster.get(t);e?e.teamId=n:this.playerRoster.set(t,{name:``,teamId:n,score:0,ping:0,packetLoss:0}),this.onRosterChanged()}}else if(t===`MsgPlayerScore`&&e.length>=5){let t=parseInt(this.resolveNetString(e[2]),10);if(!isNaN(t)){let n=this.playerRoster.get(t);if(n){let t=parseInt(this.resolveNetString(e[3]),10),r=parseInt(this.resolveNetString(e[4]),10),i=parseInt(this.resolveNetString(e[5]??``),10);isNaN(t)||(n.score=t),isNaN(r)||(n.ping=r),isNaN(i)||(n.packetLoss=i),this.onRosterChanged()}}}else if(t===`MsgSystemClock`&&e.length>=4){let t=parseFloat(this.resolveNetString(e[3]));this.clockAnchorStreamSec=this.getTimeSec(),this.clockDurationMs=Number.isFinite(t)?t:0}else if(t===`MsgMissionDropInfo`&&e.length>=5){let t=I(this.resolveNetString(e[2])),n=I(this.resolveNetString(e[3])),r=I(this.resolveNetString(e[4]));jn.info(`mission drop info: mission=%s gameType=%s server=%s`,t,n,r),this.missionDisplayName=t||this.missionDisplayName,this.missionTypeDisplayName=n||this.missionTypeDisplayName,this.serverDisplayName=r||this.serverDisplayName,this.onMissionInfoChange?.()}else if(t===`MsgLoadInfo`&&e.length>=5){let t=I(this.resolveNetString(e[3])),n=I(this.resolveNetString(e[4]));jn.info(`load info: mission=%s gameType=%s`,t,n),this.missionDisplayName=t||this.missionDisplayName,this.missionTypeDisplayName=n||this.missionTypeDisplayName,this.onMissionInfoChange?.()}else if(t===`MsgClientReady`&&e.length>=3){let t=this.resolveNetString(e[2]);jn.info(`client ready: gameClass=%s`,t),this.gameClassName=t||this.gameClassName,this.onMissionInfoChange?.()}}onTeamScoresChanged(){}onRosterChanged(){}handleHudRemoteCommand(e,t){if(e===`setWeaponsHudItem`&&t.length>=3){let e=parseInt(t[0],10),n=parseInt(t[1],10),r=t[2]===`1`||t[2]===`true`;isNaN(e)||(r?this.weaponsHud.slots.set(e,isNaN(n)?-1:n):this.weaponsHud.slots.delete(e),this.onWeaponsHudChanged())}else if(e===`setWeaponsHudAmmo`&&t.length>=2){let e=parseInt(t[0],10),n=parseInt(t[1],10);isNaN(e)||(this.weaponsHud.slots.set(e,isNaN(n)?-1:n),this.onWeaponsHudChanged())}else if(e===`setWeaponsHudActive`&&t.length>=1){let e=parseInt(t[0],10);this.weaponsHud.activeIndex=isNaN(e)?-1:e,!isNaN(e)&&e>=0&&!this.weaponsHud.slots.has(e)&&this.weaponsHud.slots.set(e,-1),this.onWeaponsHudChanged()}else if(e===`setWeaponsHudClearAll`)this.weaponsHud.slots.clear(),this.weaponsHud.activeIndex=-1,this.onWeaponsHudChanged();else if(e===`setBackpackHudItem`&&t.length>=2){let e=parseInt(t[0],10);(t[1]===`1`||t[1]===`true`)&&!isNaN(e)?(this.backpackHud.packIndex=e,this.backpackHud.active=!1,this.backpackHud.text=``):(this.backpackHud.packIndex=-1,this.backpackHud.active=!1,this.backpackHud.text=``)}else if(e===`setSatchelArmed`)this.backpackHud.active=!0;else if(e===`setCloakIconOn`||e===`setRepairPackIconOn`||e===`setShieldIconOn`||e===`setSenJamIconOn`)this.backpackHud.active=!0;else if(e===`setCloakIconOff`||e===`setRepairPackIconOff`||e===`setShieldIconOff`||e===`setSenJamIconOff`)this.backpackHud.active=!1;else if(e===`updatePackText`&&t.length>=1)this.backpackHud.text=t[0]??``;else if(e===`setInventoryHudItem`&&t.length>=3){let e=parseInt(t[0],10),n=parseInt(t[1],10),r=t[2]===`1`||t[2]===`true`;isNaN(e)||(r&&!isNaN(n)?this.inventoryHud.slots.set(e,n):this.inventoryHud.slots.delete(e),this.onInventoryHudChanged())}else if(e===`setInventoryHudAmount`&&t.length>=2){let e=parseInt(t[0],10),n=parseInt(t[1],10);!isNaN(e)&&!isNaN(n)&&(this.inventoryHud.slots.set(e,n),this.onInventoryHudChanged())}else e===`setInventoryHudClearAll`&&(this.inventoryHud.slots.clear(),this.inventoryHud.activeSlot=-1,this.onInventoryHudChanged())}onWeaponsHudChanged(){}onInventoryHudChanged(){}buildEntityList(e){let t=[];for(let n of this.entities.values()){if(e&&!e(n))continue;let r=n.targetId!=null&&n.targetId>=0?this.targetRenderFlags.get(n.targetId)??n.targetRenderFlags:n.targetRenderFlags;n.type===`Player`&&!n.carryingFlag&&(r=r==null?r:r&-3),t.push({id:n.id,type:n.type,visual:n.visual,direction:n.direction,ghostIndex:n.ghostIndex,className:n.className,dataBlockId:n.dataBlockId,shapeHint:n.shapeHint,dataBlock:n.dataBlock,weaponShape:n.weaponShape,packShape:n.packShape,flagShape:n.flagShape,falling:n.falling,jetting:n.jetting,playerName:n.playerName,targetRenderFlags:r,iffColor:(n.type===`Player`||(r??0)&2)&&n.sensorGroup!=null?this.resolveIffColor(n.sensorGroup):void 0,position:n.position&&(n.simulatedVelocity||n.itemPhysics&&!n.itemPhysics.atRest)?[...n.position]:n.position,rotation:n.rotation,velocity:n.velocity,health:n.health,energy:n.energy,actionAnim:n.actionAnim,actionAtEnd:n.actionAtEnd,damageState:n.damageState,faceViewer:n.faceViewer,threads:n.threads,explosionDataBlockId:n.explosionDataBlockId,maintainEmitterId:n.maintainEmitterId,weaponImageState:n.weaponImageState,weaponImageStates:n.weaponImageStates,headPitch:n.headPitch,headYaw:n.headYaw,label:n.label,audioFileName:n.audioFileName,audioVolume:n.audioVolume,audioIs3D:n.audioIs3D,audioIsLooping:n.audioIsLooping,audioMinDistance:n.audioMinDistance,audioMaxDistance:n.audioMaxDistance,audioMinLoopGap:n.audioMinLoopGap,audioMaxLoopGap:n.audioMaxLoopGap,sceneData:n.sceneData,forceFieldData:n.forceFieldData})}return t}computeMatchClockMs(e){if(this.clockAnchorStreamSec==null)return null;let t=(e-this.clockAnchorStreamSec)*1e3;return-this.clockDurationMs+t}buildHudState(){let e={slots:Array.from(this.weaponsHud.slots.entries()).map(([e,t])=>({index:e,ammo:t})),activeIndex:this.weaponsHud.activeIndex},t={slots:Array.from(this.inventoryHud.slots.entries()).map(([e,t])=>({slot:e,count:t})),activeSlot:this.inventoryHud.activeSlot},n=this.backpackHud.packIndex>=0?{...this.backpackHud}:null,r=this.teamScores.map(e=>({...e})),i=new Map;for(let{teamId:e}of this.playerRoster.values())e>0&&i.set(e,(i.get(e)??0)+1);for(let e of r)e.playerCount=i.get(e.teamId)??0;let a=[];for(let[e,t]of this.playerRoster)a.push({clientId:e,...t});return{weaponsHud:e,inventoryHud:t,backpackHud:n,teamScores:r,playerRoster:a}}buildTimeFilteredEvents(e){return this._chatSnapshotGen!==this._chatGen&&(this._chatSnapshot=this.chatMessages.slice(),this._chatSnapshotGen=this._chatGen),{chatMessages:this._chatSnapshot,audioEvents:this.audioEvents.filter(t=>t.timeSec>e-.5&&t.timeSec<=e)}}},Nn=A(`liveStreaming`),Pn=class extends Mn{packetParser;relay;currentTimeSec=0;connectSynced=!1;_snapshot=null;_snapshotTick=-1;_ready=!1;_teamScoresGen=0;_rosterGen=0;_weaponsHudGen=0;_inventoryHudGen=0;_cachedHud=null;dataBlockClassNames=new Map;onReady;onMissionChange;missionName=null;lastMoveAck=0;constructor(e){super(),this.relay=e;let{registry:t,ghostTracker:n,packetParser:r}=fe();this.packetParser=r,this.ghostTracker=n,this.registry=t}getDataBlockData(e){return this.packetParser.getDataBlockDataMap()?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){this._shapeConstructorCache=new Map;let t=this.packetParser.getDataBlockDataMap();if(t){for(let[,e]of t){let t=e.shape,n=e.sequences;t&&n&&this._shapeConstructorCache.set(t.toLowerCase(),n)}return this._shapeConstructorCache.get(e.toLowerCase())}}getTimeSec(){return this.currentTimeSec}getCameraYawPitch(e){return this.getAbsoluteRotation(e)??{yaw:0,pitch:0}}getEffectShapes(){let e=new Set,t=this.packetParser.getDataBlockDataMap();if(!t)return[];for(let[,n]of t){let r=n.explosion;if(r==null)continue;let i=t.get(r);i?.dtsFileName&&e.add(i.dtsFileName)}return[...e]}onTeamScoresChanged(){this._teamScoresGen++}onRosterChanged(){this._rosterGen++}onWeaponsHudChanged(){this._weaponsHudGen++}onInventoryHudChanged(){this._inventoryHudGen++}reset(){this.resetSharedState(),this.ghostTracker.clear?.(),this.currentTimeSec=0,this._snapshot=null,this._snapshotTick=-1,this._cachedHud=null,this.dataBlockClassNames.clear(),this.observerMode=`fly`,this.missionName=null}getSnapshot(){return this._snapshot&&this._snapshotTick===this.tickCount?this._snapshot:this.buildSnapshot()}stepToTime(e,t){return this.currentTimeSec=e,this.getSnapshot()}syncConnectSequence(e){if(this.connectSynced||e.length<1)return;this.connectSynced=!0;let t=e[0]>>1&1;this.packetParser.setConnectionProtocolState({lastSeqRecvdAtSend:Array(32).fill(0),lastSeqRecvd:0,highestAckedSeq:0,lastSendSeq:536870911,ackMask:0,connectSequence:t,lastRecvAckAck:0,connectionEstablished:!0})}feedPacket(e){this.syncConnectSequence(e),this.processPacket(e)}handleRelayCommands(e){if(e.type!==`RemoteCommandEvent`)return;let t=e.funcName;if(!t)return;let n=this.resolveNetString(t);if([`t2csri_pokeClient`,`t2csri_getChallengeChunk`,`t2csri_decryptChallenge`].includes(n)){let t=(e.args??[]).map(e=>this.resolveNetString(e)).filter(e=>e!==``);Nn.info(`auth event: %s %o`,n,t),this.relay.sendAuthEvent(n,t);return}let r=(e.args??[]).map(e=>this.resolveNetString(e));if(n===`MissionStartPhase1`){let e=r[0]??``,t=r[1]??null;Nn.info(`mission phase 1, seq=%s mission=%s resolvedArgs=%o`,e,t,r),t&&t!==this.missionName&&(this.missionName=t,this.entities.clear(),this.entityIdByGhostIndex.clear(),this._ready=!1,this._snapshot=null,this._snapshotTick=-1,this._cachedHud=null,this.observerMode=`fly`,this.lastMoveAck=0,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.onMissionChange?.(t)),this.relay.sendCommand(`MissionStartPhase1Done`,[e])}else if(n===`MissionStartPhase2`){let e=r[0]??``;Nn.info(`mission phase 2 (datablocks), seq=%s`,e),this.relay.sendCommand(`MissionStartPhase2Done`,[e])}else if(n===`MissionStartPhase3`){let e=r[0]??``,t=r[1]??null;Nn.info(`mission phase 3 (ghosting), seq=%s mission=%s`,e,t),t&&(this.missionName=t),this.relay.sendCommand(`setClientFav`,[``]),this.relay.sendCommand(`MissionStartPhase3Done`,[e])}}handleCRCChallenge(e){if(e.type!==`CRCChallengeEvent`)return;let t=e.crcValue,n=e.field1,r=e.field2,i=(n&1)!=0;Nn.info(`CRC challenge: seed=0x%s f1=0x%s f2=0x%s includeTextures=%s`,(t>>>0).toString(16),(n>>>0).toString(16),(r>>>0).toString(16),i);let a=this.packetParser.getDataBlockDataMap(),o=[];if(a)for(let[e,t]of a){let n=this.dataBlockClassNames.get(e);if(!n)continue;let r=me(n,t);o.push({objectId:e,className:n,shapeName:r??``})}Nn.info(`CRC: sending %d datablocks for computation`,o.length),this.relay.sendCRCCompute(t,r,o,i)}handleGhostingMessage(e){if(e.type!==`GhostingMessageEvent`)return;let t=e.message,n=e.sequence,r=e.ghostCount;Nn.info(`GhostingMessageEvent: message=%d sequence=%d ghostCount=%d`,t,n,r),t===0&&(Nn.info(`Sending ghost ack (type 1) for sequence %d`,n),this.relay.sendGhostAck(n,r))}observerMode=`fly`;requestScores(){this.relay.sendCommand(`getScores`,[])}getPlayerList(){let e=[];for(let[t,n]of this.targetNames){let r=this.targetTeams.get(t)??0;e.push({targetId:t,name:n,sensorGroup:r})}return e}processPacket(e){try{let t=this.packetParser.protocolRejected,n=this.packetParser.protocolNoDispatch,r=this.packetParser.parsePacket(e),i=this.packetParser.protocolRejected>t,a=this.packetParser.protocolNoDispatch>n;(i||a)&&Nn.warn(`packet #%d %s: %d bytes (total rejected=%d, noDispatch=%d)`,this.tickCount,i?`REJECTED`:`no-dispatch`,e.length,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch);let o=this.tickCount<20,s=this.tickCount%100==0,c=o||s;c&&Nn.debug(`packet #%d: %d events, %d ghosts, %d bytes%s%s`,this.tickCount,r.events.length,r.ghosts.length,e.length,r.gameState.controlObjectGhostIndex===void 0?``:`, control=${r.gameState.controlObjectGhostIndex}`,r.gameState.cameraFov===void 0?``:`, fov=${r.gameState.cameraFov}`),this.lastMoveAck=r.gameState.lastMoveAck,this.processControlObject(r.gameState);for(let e of r.events)if(e.parsedData){this.handleRelayCommands(e.parsedData),this.handleCRCChallenge(e.parsedData),this.handleGhostingMessage(e.parsedData);let t=e.parsedData.type;if(t===`RemoteCommandEvent`){let t=this.resolveNetString(e.parsedData.funcName??``);Nn.debug(`remote: %s`,t)}if(o&&t!==`NetStringEvent`&&t!==`RemoteCommandEvent`&&Nn.debug(`event: %s%s`,t,t===`SimDataBlockEvent`?` id=${e.parsedData.objectId} class=${e.parsedData.dataBlockClassName}`:``),t===`SimDataBlockEvent`){let t=e.parsedData.objectId,n=e.parsedData.dataBlockClassName;if(t!=null&&n&&this.dataBlockClassNames.set(t,n),c){let r=e.parsedData.dataBlockData,i=me(n??``,r);Nn.debug(`datablock: id=%d class=%s%s`,t,n??`?`,i?` shape=${i}`:``)}}let n=this.registry.getEventParser(e.classId)?.name;if(this.processEvent(e,n),o&&t===`NetStringEvent`){let t=e.parsedData.id,n=e.parsedData.value;t!=null&&typeof n==`string`&&Nn.trace(`netString #%d = "%s"`,t,n.length>60?n.slice(0,60)+`…`:n)}if(t===`TargetInfoEvent`){let t=e.parsedData.targetId,n=e.parsedData.nameTag;if(t!=null&&n!=null){let r=this.netStrings.get(n);if(r){let n=I(r);Nn.info(`target #%d: "%s" team=%s`,t,n,e.parsedData.sensorGroup??`?`)}}}if(t===`SetSensorGroupEvent`){let t=e.parsedData.sensorGroup;t!=null&&Nn.info(`sensor group changed: → %d`,t)}if(t===`SensorGroupColorEvent`){let t=e.parsedData.sensorGroup,n=e.parsedData.colors;n&&Nn.debug(`sensor group colors: group=%d, %d entries`,t,n.length)}}for(let e of r.ghosts){if(e.type===`create`){let t=e.parsedData?.position,n=t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.z==`number`,r=this.resolveGhostClassName(e.index,e.classId);Nn.debug(`ghost create: #%d %s%s (%d entities total)`,e.index,r??`?`,n?` at (${t.x.toFixed(1)}, ${t.y.toFixed(1)}, ${t.z.toFixed(1)})`:``,this.entities.size+1),this._ready||(this._ready=!0,this.onReady?.())}else if(e.type===`delete`){let t=this.entityIdByGhostIndex.get(e.index),n=t?this.entities.get(t):void 0;(this.tickCount<50||this.tickCount%200==0)&&Nn.debug(`ghost delete: #%d %s (%d entities remaining)`,e.index,n?.className??`?`,this.entities.size-1)}this.processGhostUpdate(e)}if(this.tickCount++,this.advanceProjectiles(),this.advanceItems(),s&&this.tickCount>1){let e=this.packetParser.getDataBlockDataMap();Nn.info(`status @ tick %d: %d entities, %d datablocks, rejected=%d, noDispatch=%d`,this.tickCount,this.entities.size,e?.size??0,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch)}let l=this.entities.size;if(this.tickCount===1||l>0&&l%25==0&&this.tickCount<100){let e=new Map;for(let t of this.entities.values())e.set(t.type,(e.get(t.type)??0)+1);let t=[...e.entries()].map(([e,t])=>`${e}=${t}`).join(` `);Nn.info(`entity count: %d (%s)`,l,t)}let u=this.camera?.mode;if(this.updateCameraAndHud(),this.camera&&this.camera.mode!==u&&Nn.info(`camera mode: %s → %s%s`,u??`none`,this.camera.mode,this.camera.mode===`third-person`?` orbit=${this.camera.orbitTargetId??`?`} dist=${this.camera.orbitDistance??`?`}`:``),this.tickCount<=5&&this.camera){let[e,t,n]=this.camera.position;Nn.debug(`camera: mode=%s pos=(%s, %s, %s) fov=%s`,this.camera.mode,e.toFixed(1),t.toFixed(1),n.toFixed(1),this.camera.fov)}}catch(t){let n={tickCount:this.tickCount,entityCount:this.entities.size,dataLength:e.length,controlGhost:this.latestControl.ghostIndex,connectSynced:this.connectSynced};Nn.error(`Failed to process live packet: %o %o`,t,n)}}buildSnapshot(){let e=this.buildEntityList(),t=this.currentTimeSec,{chatMessages:n,audioEvents:r}=this.buildTimeFilteredEvents(t),i=this._cachedHud,a,o,s,c,l;i&&i.weaponsHudGen===this._weaponsHudGen&&i.inventoryHudGen===this._inventoryHudGen&&i.teamScoresGen===this._teamScoresGen&&i.rosterGen===this._rosterGen&&i.backpackPackIndex===this.backpackHud.packIndex&&i.backpackActive===this.backpackHud.active?(a=i.weaponsHud,o=i.inventoryHud,s=i.backpackHud,c=i.teamScores,l=i.playerRoster):({weaponsHud:a,inventoryHud:o,backpackHud:s,teamScores:c,playerRoster:l}=this.buildHudState(),this._cachedHud={weaponsHudGen:this._weaponsHudGen,inventoryHudGen:this._inventoryHudGen,teamScoresGen:this._teamScoresGen,rosterGen:this._rosterGen,backpackPackIndex:this.backpackHud.packIndex,backpackActive:this.backpackHud.active,weaponsHud:a,inventoryHud:o,backpackHud:s,teamScores:c,playerRoster:l}),this.camera||={time:t,position:[0,0,200],rotation:[0,0,0,1],fov:90,mode:`observer`};let u={timeSec:t,exhausted:!1,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:n,audioEvents:r,weaponsHud:a,backpackHud:s,inventoryHud:o,teamScores:c,playerRoster:l,connectedClientId:this.connectedClientId,matchClockMs:this.computeMatchClockMs(t)};return this._snapshot=u,this._snapshotTick=this.tickCount,u}},Fn=j()(e=>({missionEntities:new Map,streamEntities:new Map,isStreaming:!1,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:0,setEntity(t){e(e=>{let n=new Map(e.missionEntities);return n.set(t.id,t),{missionEntities:n,version:e.version+1}})},deleteEntity(t){e(e=>{if(!e.missionEntities.has(t))return e;let n=new Map(e.missionEntities);return n.delete(t),{missionEntities:n,version:e.version+1}})},setEntities(t){e(e=>{let n=new Map(e.missionEntities);for(let e of t)n.set(e.id,e);return{missionEntities:n,version:e.version+1}})},setAllEntities(t){e(e=>{let n=new Map;for(let e of t)n.set(e.id,e);return{missionEntities:n,dataSource:e.isStreaming?e.dataSource:`map`}})},clearEntities(){e(e=>e.missionEntities.size===0?e:e.isStreaming?{missionEntities:new Map,version:e.version+1}:{missionEntities:new Map,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1})},setMissionInfo(t){let n={};if(t.missionName!==void 0&&(n.missionName=t.missionName),t.missionType!==void 0&&(n.missionType=t.missionType),t.missionTypeDisplayName!==void 0&&(n.missionTypeDisplayName=t.missionTypeDisplayName),t.missionDisplayName!==void 0&&(n.missionDisplayName=t.missionDisplayName),t.gameClassName!==void 0&&(n.gameClassName=t.gameClassName,t.missionType===void 0))if(t.gameClassName){let e=t.gameClassName.replace(/Game$/i,``);n.missionType=Oe[e.toLowerCase()]??e}else n.missionType=null;t.serverDisplayName!==void 0&&(n.serverDisplayName=t.serverDisplayName),t.recorderName!==void 0&&(n.recorderName=t.recorderName),t.recordingDate!==void 0&&(n.recordingDate=t.recordingDate),e(e=>({...n,version:e.version+1}))},beginStreaming(t){e(e=>({isStreaming:!0,dataSource:t,streamEntities:new Map,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1}))},endStreaming(){e(e=>e.isStreaming?{isStreaming:!1,dataSource:e.missionEntities.size>0?`map`:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,streamEntities:new Map,version:e.version+1}:e)},setStreamEntity(t){e(e=>{let n=new Map(e.streamEntities);return n.set(t.id,t),{streamEntities:n,version:e.version+1}})},deleteStreamEntity(t){e(e=>{if(!e.streamEntities.has(t))return e;let n=new Map(e.streamEntities);return n.delete(t),{streamEntities:n,version:e.version+1}})},setStreamEntities(t){e(e=>{let n=new Map(e.streamEntities);for(let e of t)n.set(e.id,e);return{streamEntities:n,version:e.version+1}})},setAllStreamEntities(t){e(e=>{let n=new Map;for(let e of t)n.set(e.id,e);let r=e.streamEntities;return n.size===r.size&&[...n.keys()].every(e=>r.has(e))?e:{streamEntities:n,version:e.version+1}})},clearStreamEntities(){e(e=>e.streamEntities.size===0?e:{streamEntities:new Map,version:e.version+1})}}));function In(e){return e.isStreaming?e.streamEntities:e.missionEntities}function Ln(e){return e.version}function Rn(){return M(Fn,Ln),M(Fn,In)}function zn(){return Rn()}function Bn(e){let t=e.isStreaming?e.streamEntities:e.missionEntities,n=[];for(let e of t.values())e.renderType!==`None`&&n.push(e);return n}function Vn(e,t){if(e.length!==t.length)return!1;for(let n=0;n({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,servers:[],serversLoading:!1,adapter:null,liveReady:!1,_relay:null,_adapter:null,_pending:[],_listInFlight:!1,connectRelay(n=dr){let r=t();r._relay&&r._relay.close();let i=new Cn(n,{onOpen(){e({relayConnected:!0});let n=t();for(let e of n._pending)e();n._pending=[]},onStatus(t,n,r,i){ur.info(`game status: %s%s%s`,t,n?` — ${n}`:``,i?` map=${i}`:``),e({gameStatus:t,gameStatusMessage:n,...i?{mapName:i}:{}})},onServerList(n){t()._listInFlight=!1,e({servers:n,serversLoading:!1})},onGamePacket(e){let n=t()._adapter;n||ur.warn(`received game packet but no adapter is active`),n?.feedPacket(e)},onPing(t){e({relayToGameServerPing:t})},onWsPing(t){e({browserToRelayPing:t})},onError(n){ur.error(`error: %s`,n),t()._listInFlight=!1,e({serversLoading:!1})},onClose(){let n=t();n._relay===i&&(n._relay=null,n._adapter=null,n._pending=[],n._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1}))}});i.connect(),t()._relay=i},disconnectRelay(){let n=t();n._relay?.close(),n._relay=null,n._adapter=null,n._pending=[],n._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1})},listServers(){let n=t();if(n._listInFlight)return;n._listInFlight=!0;let r=()=>{let e=t();e._relay?.sendWsPing(),e._relay?.listServers()};e({serversLoading:!0}),n._relay?.connected?r():(n._pending.push(r),n._relay||t().connectRelay())},joinServer(n,r){let i=t();if(!i._relay)return;let a=i.servers.find(e=>e.address===n),o=new Pn(i._relay);o.onReady=()=>e({liveReady:!0}),o.onMissionChange=t=>{ur.info(`mission changed: %s`,t),e({mapName:t,liveReady:!1}),Fn.getState().setMissionInfo({missionName:t,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null})},o.onMissionInfoChange=()=>{Fn.getState().setMissionInfo({missionDisplayName:o.missionDisplayName??void 0,missionTypeDisplayName:o.missionTypeDisplayName??void 0,gameClassName:o.gameClassName??void 0,serverDisplayName:o.serverDisplayName??void 0,recorderName:o.connectedPlayerName??void 0})},i._adapter=o,e({mapName:a?.mapName??i.mapName,serverName:a?.name,warriorName:r,liveReady:!1,gameStatus:null,adapter:o}),Fn.getState().setMissionInfo({missionName:a?.mapName??void 0,missionTypeDisplayName:a?.gameType??void 0,serverDisplayName:a?.name??void 0,recorderName:r??void 0}),i._relay.joinServer(n,r)},disconnectServer(){t().disconnectRelay()},sendMoves(e,n){t()._relay?.sendMoves(e,n)},sendCommand(e,...n){t()._relay?.sendCommand(e,n)}}));function pr(e,t){return M(fr,e,t)}function mr(e){return e.relayToGameServerPing!=null&&e.browserToRelayPing!=null?e.relayToGameServerPing+e.browserToRelayPing:e.relayToGameServerPing??null}var hr=[.25,.5,1,2,4];function gr(e){let t=(0,z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,B.jsx)(B.Fragment,{children:n}),t[0]=n,t[1]=r),r}function _r(){return Ae(vr)}function vr(e){return e.playback.recording}function yr(){return Ae(br)}function br(e){return e.playback.status===`playing`}function xr(){return Ae(Sr)}function Sr(e){return e.playback.timeMs/1e3}function Cr(){return Ae(wr)}function wr(e){return e.playback.durationMs/1e3}function Tr(){return Ae(Er)}function Er(e){return e.playback.rate}function Dr(){let e=(0,z.c)(17),t=_r(),n=Ae(jr),r=Ae(Ar),i=Ae(kr),a=Ae(Or),o;e[0]===n?o=e[1]:(o=e=>{n(e)},e[0]=n,e[1]=o);let s=o,c;e[2]!==t||e[3]!==r?(c=()=>{t&&r(`playing`)},e[2]=t,e[3]=r,e[4]=c):c=e[4];let l=c,u;e[5]===r?u=e[6]:(u=()=>{r(`paused`)},e[5]=r,e[6]=u);let d=u,f;e[7]===i?f=e[8]:(f=e=>{i(e*1e3)},e[7]=i,e[8]=f);let p=f,m;e[9]===a?m=e[10]:(m=e=>{a(e)},e[9]=a,e[10]=m);let h=m,g;return e[11]!==d||e[12]!==l||e[13]!==p||e[14]!==s||e[15]!==h?(g={setRecording:s,play:l,pause:d,seek:p,setSpeed:h},e[11]=d,e[12]=l,e[13]=p,e[14]=s,e[15]=h,e[16]=g):g=e[16],g}function Or(e){return e.setPlaybackRate}function kr(e){return e.setPlaybackTime}function Ar(e){return e.setPlaybackStatus}function jr(e){return e.setRecording}var Mr=A(`LoadDemoButton`);function Nr({isActive:e=!1,choosingMap:t=!1,onCancelChoosingMap:n}){let r=_r()?.source===`demo`,{setRecording:i}=Dr(),a=(0,R.useRef)(null),o=(0,R.useRef)(0),s=(0,R.useRef)(null),c=(0,R.useCallback)(()=>{if(N.getState().cancel(),t&&r){n?.();return}if(r){o.current+=1,s.current?.abort(),s.current=null,i(null),bn.getState().reset();return}a.current?.click()},[r,t,n,i]);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`input`,{ref:a,type:`file`,accept:`.rec`,style:{display:`none`},onChange:(0,R.useCallback)(async e=>{let t=e.target.files?.[0];if(t){e.target.value=``;try{let e=await t.arrayBuffer(),n=o.current+1;o.current=n;let{createDemoStreamingRecording:r}=await Me(async()=>{let{createDemoStreamingRecording:e}=await import(`./demoStreaming-vQjQowT8.js`);return{createDemoStreamingRecording:e}},__vite__mapDeps([0,1,2,3,4,5])),a=await r(e);if(o.current!==n)return;fr.getState().disconnectServer(),i(a),s.current?.abort();let c=new AbortController;s.current=c;let l=bn.getState();l.reset(),l.setScanProgress(0),Me(async()=>{let{scanDemoTimeline:e}=await import(`./demoTimelineScanner-BGzL-XZF.js`);return{scanDemoTimeline:e}},__vite__mapDeps([6,1,2,3,5])).then(({scanDemoTimeline:t})=>t(e,a.recorderName,e=>{o.current===n&&bn.getState().setScanProgress(e)},c.signal)).then(e=>{if(o.current!==n)return;let t=bn.getState();t.setEvents(e),t.setScanProgress(null)}).catch(e=>{o.current===n&&(e instanceof Error&&e.name===`AbortError`||(Mr.error(`Timeline scan failed: %o`,e),bn.getState().setScanProgress(null)))})}catch(e){Mr.error(`Failed to load demo: %o`,e)}}},[i])}),(0,B.jsxs)(`button`,{type:`button`,className:mn.Button,"aria-label":r?`Unload demo`:`Load demo (.rec)`,title:r?`Unload demo`:`Load demo (.rec)`,onClick:c,"data-active":e,children:[(0,B.jsx)(vn,{className:mn.DemoIcon}),(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Demo`}),(0,B.jsx)(`span`,{className:mn.ButtonHint,children:t&&r?`Return to demo`:r?`Click to unload`:`Load a .rec file`})]})]})}function Pr(e){return S({tag:`svg`,attr:{fill:`currentColor`,viewBox:`0 0 16 16`},child:[{tag:`path`,attr:{d:`M11.251.068a.5.5 0 0 1 .227.58L9.677 6.5H13a.5.5 0 0 1 .364.843l-8 8.5a.5.5 0 0 1-.842-.49L6.323 9.5H3a.5.5 0 0 1-.364-.843l8-8.5a.5.5 0 0 1 .615-.09z`},child:[]}]})(e)}function Fr(e){return S({tag:`svg`,attr:{fill:`currentColor`,viewBox:`0 0 16 16`},child:[{tag:`path`,attr:{d:`m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393`},child:[]}]})(e)}var Ir={JoinServerButton:`_JoinServerButton_cz8os_1 _Button_1u47f_2`,Icon:`_Icon_cz8os_5 _Icon_1u47f_79`,blink:`_blink_cz8os_1`};function Lr(e){let t=(0,z.c)(15),{isActive:n,onOpenServerBrowser:r}=e,i=pr(zr),a=pr(Rr),o=i===`connected`,s=i===`connecting`||i===`challenging`||i===`authenticating`,c=o?`Connected –\xA0click to disconnect`:`Join server`,l=o?`Connected –\xA0click to disconnect`:`Join server`,u;t[0]!==a||t[1]!==o||t[2]!==r?(u=()=>{N.getState().cancel(),o?a():r()},t[0]=a,t[1]=o,t[2]=r,t[3]=u):u=t[3];let d,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(Pr,{className:Ir.Icon}),f=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Live`}),t[4]=d,t[5]=f):(d=t[4],f=t[5]);let p=s?`Connecting…`:o?`Connected`:`Join a game`,m;t[6]===p?m=t[7]:(m=(0,B.jsxs)(B.Fragment,{children:[f,(0,B.jsx)(`span`,{className:mn.ButtonHint,children:p})]}),t[6]=p,t[7]=m);let h;return t[8]!==n||t[9]!==o||t[10]!==c||t[11]!==l||t[12]!==u||t[13]!==m?(h=(0,B.jsxs)(`button`,{type:`button`,className:Ir.JoinServerButton,"aria-label":c,title:l,"data-connected":o,onClick:u,"data-active":n,children:[d,m]}),t[8]=n,t[9]=o,t[10]=c,t[11]=l,t[12]=u,t[13]=m,t[14]=h):h=t[14],h}function Rr(e){return e.disconnectServer}function zr(e){return e.gameStatus}function Br(e,t=[]){let n=[];function r(t,r){let i=R.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=R.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=R.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>R.createContext(e));return function(n){let r=n?.[e]||t;return R.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Vr(i,...t)]}function Vr(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Hr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ur(...e){return t=>{let n=!1,r=e.map(e=>{let r=Hr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t{let{children:r,...i}=e,a=R.Children.toArray(r),o=a.find(Jr);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,B.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,B.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Kr(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(R.isValidElement(n)){let e=Xr(n),i=Yr(r,n.props);return n.type!==R.Fragment&&(i.ref=t?Ur(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qr=Symbol(`radix.slottable`);function Jr(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===qr}function Yr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Xr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Zr(e){let t=e+`CollectionProvider`,[n,r]=Br(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=R.useRef(null),a=R.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Gr(s),l=R.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,B.jsx)(c,{ref:Wr(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Gr(u),p=R.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=R.useRef(null),s=Wr(t,o),c=a(u,n);return R.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return R.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function Qr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var $r=globalThis?.document?R.useLayoutEffect:()=>{},ei=R.useInsertionEffect||$r;function ti({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ni({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=R.useRef(e!==void 0);R.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,R.useCallback(t=>{if(s){let n=ri(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ni({defaultProp:e,onChange:t}){let[n,r]=R.useState(e),i=R.useRef(n),a=R.useRef(t);return ei(()=>{a.current=t},[t]),R.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ri(e){return typeof e==`function`}var ii=e(Fe(),1),ai=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Gr(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function oi(e,t){return R.useReducer((e,n)=>t[e][n]??e,e)}var si=e=>{let{present:t,children:n}=e,r=ci(t),i=typeof n==`function`?n({present:r.isPresent}):R.Children.only(n),a=Wr(r.ref,ui(i));return typeof n==`function`||r.isPresent?R.cloneElement(i,{ref:a}):null};si.displayName=`Presence`;function ci(e){let[t,n]=R.useState(),r=R.useRef(null),i=R.useRef(e),a=R.useRef(`none`),[o,s]=oi(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return R.useEffect(()=>{let e=li(r.current);a.current=o===`mounted`?e:`none`},[o]),$r(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=li(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),$r(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=li(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=li(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:R.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function li(e){return e?.animationName||`none`}function ui(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var di=R.useId||(()=>void 0),fi=0;function pi(e){let[t,n]=R.useState(di());return $r(()=>{e||n(e=>e??String(fi++))},[e]),e||(t?`radix-${t}`:``)}var mi=`Collapsible`,[hi,gi]=Br(mi),[_i,vi]=hi(mi),yi=R.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=ti({prop:r,defaultProp:i??!1,onChange:o,caller:mi});return(0,B.jsx)(_i,{scope:n,disabled:a,contentId:pi(),open:c,onOpenToggle:R.useCallback(()=>l(e=>!e),[l]),children:(0,B.jsx)(ai.div,{"data-state":Ti(c),"data-disabled":a?``:void 0,...s,ref:t})})});yi.displayName=mi;var bi=`CollapsibleTrigger`,xi=R.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=vi(bi,n);return(0,B.jsx)(ai.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ti(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Qr(e.onClick,i.onOpenToggle)})});xi.displayName=bi;var Si=`CollapsibleContent`,Ci=R.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=vi(Si,e.__scopeCollapsible);return(0,B.jsx)(si,{present:n||i.open,children:({present:e})=>(0,B.jsx)(wi,{...r,ref:t,present:e})})});Ci.displayName=Si;var wi=R.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=vi(Si,n),[s,c]=R.useState(r),l=R.useRef(null),u=Wr(t,l),d=R.useRef(0),f=d.current,p=R.useRef(0),m=p.current,h=o.open||s,g=R.useRef(h),_=R.useRef(void 0);return R.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),$r(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,B.jsx)(ai.div,{"data-state":Ti(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Ti(e){return e?`open`:`closed`}var Ei=yi,Di=xi,Oi=Ci,ki=R.createContext(void 0);function Ai(e){let t=R.useContext(ki);return e||t||`ltr`}var ji=`Accordion`,Mi=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[V,Ni,Pi]=Zr(ji),[Fi,Ii]=Br(ji,[Pi,gi]),Li=gi(),Ri=R.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,B.jsx)(V.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,B.jsx)(Wi,{...a,ref:t}):(0,B.jsx)(Ui,{...i,ref:t})})});Ri.displayName=ji;var[zi,Bi]=Fi(ji),[Vi,Hi]=Fi(ji,{collapsible:!1}),Ui=R.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,c]=ti({prop:n,defaultProp:r??``,onChange:i,caller:ji});return(0,B.jsx)(zi,{scope:e.__scopeAccordion,value:R.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:R.useCallback(()=>a&&c(``),[a,c]),children:(0,B.jsx)(Vi,{scope:e.__scopeAccordion,collapsible:a,children:(0,B.jsx)(qi,{...o,ref:t})})})}),Wi=R.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=ti({prop:n,defaultProp:r??[],onChange:i,caller:ji}),c=R.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=R.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,B.jsx)(zi,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,B.jsx)(Vi,{scope:e.__scopeAccordion,collapsible:!0,children:(0,B.jsx)(qi,{...a,ref:t})})})}),[Gi,Ki]=Fi(ji),qi=R.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=Wr(R.useRef(null),t),c=Ni(n),l=Ai(i)===`ltr`,u=Qr(e.onKeyDown,e=>{if(!Mi.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=()=>{o=r+1,o>s&&(o=0)},d=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,B.jsx)(Gi,{scope:n,disabled:r,direction:i,orientation:a,children:(0,B.jsx)(V.Slot,{scope:n,children:(0,B.jsx)(ai.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})}),Ji=`AccordionItem`,[Yi,Xi]=Fi(Ji),Zi=R.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=Ki(Ji,n),o=Bi(Ji,n),s=Li(n),c=pi(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,B.jsx)(Yi,{scope:n,open:l,disabled:u,triggerId:c,children:(0,B.jsx)(Ei,{"data-orientation":a.orientation,"data-state":ia(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});Zi.displayName=Ji;var Qi=`AccordionHeader`,$i=R.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=Ki(ji,n),a=Xi(Qi,n);return(0,B.jsx)(ai.h3,{"data-orientation":i.orientation,"data-state":ia(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});$i.displayName=Qi;var ea=`AccordionTrigger`,ta=R.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=Ki(ji,n),a=Xi(ea,n),o=Hi(ea,n),s=Li(n);return(0,B.jsx)(V.ItemSlot,{scope:n,children:(0,B.jsx)(Di,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});ta.displayName=ea;var na=`AccordionContent`,ra=R.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=Ki(ji,n),a=Xi(na,n),o=Li(n);return(0,B.jsx)(Oi,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})});ra.displayName=na;function ia(e){return e?`open`:`closed`}var aa=Ri,oa=Zi,sa=ta,ca=ra;function la(e){return S({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M256 16C141.31 16 48 109.31 48 224v154.83l82 32.81L146.88 496H192v-64h32v64h16v-64h32v64h16v-64h32v64h45.12L382 411.64l82-32.81V224c0-114.69-93.31-208-208-208zm-88 320a56 56 0 1 1 56-56 56.06 56.06 0 0 1-56 56zm51.51 64L244 320h24l24.49 80zM344 336a56 56 0 1 1 56-56 56.06 56.06 0 0 1-56 56zm104 32z`},child:[]}]})(e)}function ua(e){return S({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`m190.06 414 163.12-139.78a24 24 0 0 0 0-36.44L190.06 98c-15.57-13.34-39.62-2.28-39.62 18.22v279.6c0 20.5 24.05 31.56 39.62 18.18z`},child:[]}]})(e)}var da={AccordionGroup:`_AccordionGroup_1ysdj_1`,Trigger:`_Trigger_1ysdj_7`,TriggerIcon:`_TriggerIcon_1ysdj_24`,Content:`_Content_1ysdj_35`,slideDown:`_slideDown_1ysdj_1`,slideUp:`_slideUp_1ysdj_1`,Body:`_Body_1ysdj_47`,BodyNoPadding:`_BodyNoPadding_1ysdj_51`};function fa(e){let t=(0,z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,B.jsx)(aa,{className:da.AccordionGroup,...e}),t[0]=e,t[1]=n),n}function pa(e){let t=(0,z.c)(10),{value:n,label:r,children:i,noPadding:a}=e,o=a===void 0?!1:a,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsx)(ua,{className:da.TriggerIcon}),t[0]=s):s=t[0];let c;t[1]===r?c=t[2]:(c=(0,B.jsxs)(sa,{className:da.Trigger,children:[s,` `,r]}),t[1]=r,t[2]=c);let l=o?da.BodyNoPadding:da.Body,u;t[3]!==i||t[4]!==l?(u=(0,B.jsx)(ca,{className:da.Content,children:(0,B.jsx)(`div`,{className:l,children:i})}),t[3]=i,t[4]=l,t[5]=u):u=t[5];let d;return t[6]!==c||t[7]!==u||t[8]!==n?(d=(0,B.jsxs)(oa,{value:n,children:[c,u]}),t[6]=c,t[7]=u,t[8]=n,t[9]=d):d=t[9],d}function ma(e){return S({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M144,16H112A64.07,64.07,0,0,0,48,80v96a64.07,64.07,0,0,0,64,64h32a64.07,64.07,0,0,0,64-64V80A64.07,64.07,0,0,0,144,16Zm48,160a48.05,48.05,0,0,1-48,48H112a48.05,48.05,0,0,1-48-48V80a48.05,48.05,0,0,1,48-48h32a48.05,48.05,0,0,1,48,48ZM136,83.31v89.38l10.34-10.35a8,8,0,0,1,11.32,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L120,172.69V83.31L109.66,93.66A8,8,0,0,1,98.34,82.34l24-24a8,8,0,0,1,11.32,0l24,24a8,8,0,0,1-11.32,11.32Z`},child:[]}]})(e)}function ha(e){return S({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M144,16H112A64.07,64.07,0,0,0,48,80v96a64.07,64.07,0,0,0,64,64h32a64.07,64.07,0,0,0,64-64V80A64.07,64.07,0,0,0,144,16Zm48,64v24H128V32h16A48.05,48.05,0,0,1,192,80ZM144,224H112a48.05,48.05,0,0,1-48-48V120H192v56A48.05,48.05,0,0,1,144,224Z`},child:[]}]})(e)}function ga(e){return S({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M239.22,59.44l-45.63,95.82a3.54,3.54,0,0,1-.16.34l-34.21,71.84a8,8,0,1,1-14.44-6.88L173.62,160H40a8,8,0,0,1-5.66-13.66L76.69,104,34.34,61.66A8,8,0,0,1,40,48H232a8,8,0,0,1,7.22,11.44Z`},child:[]}]})(e)}function _a(e){return S({tag:`svg`,attr:{viewBox:`0 0 1024 1024`},child:[{tag:`path`,attr:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm234.8 736.5L223.5 277.2c16-19.7 34-37.7 53.7-53.7l523.3 523.3c-16 19.6-34 37.7-53.7 53.7z`},child:[]}]})(e)}function va(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`},child:[]},{tag:`circle`,attr:{cx:`9`,cy:`7`,r:`4`},child:[]},{tag:`path`,attr:{d:`M22 21v-2a4 4 0 0 0-3-3.87`},child:[]},{tag:`path`,attr:{d:`M16 3.13a4 4 0 0 1 0 7.75`},child:[]}]})(e)}function ya(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`},child:[]},{tag:`path`,attr:{d:`M3 9h18`},child:[]},{tag:`path`,attr:{d:`m15 14-3 3-3-3`},child:[]}]})(e)}function ba(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`},child:[]},{tag:`path`,attr:{d:`M3 9h18`},child:[]},{tag:`path`,attr:{d:`m9 16 3-3 3 3`},child:[]}]})(e)}function xa(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`},child:[]},{tag:`path`,attr:{d:`M9 3v18`},child:[]},{tag:`path`,attr:{d:`m14 9 3 3-3 3`},child:[]}]})(e)}function Sa(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`},child:[]},{tag:`path`,attr:{d:`M9 3v18`},child:[]},{tag:`path`,attr:{d:`m16 15-3-3 3-3`},child:[]}]})(e)}function Ca(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`circle`,attr:{cx:`12`,cy:`12`,r:`10`},child:[]},{tag:`line`,attr:{x1:`22`,x2:`18`,y1:`12`,y2:`12`},child:[]},{tag:`line`,attr:{x1:`6`,x2:`2`,y1:`12`,y2:`12`},child:[]},{tag:`line`,attr:{x1:`12`,x2:`12`,y1:`6`,y2:`2`},child:[]},{tag:`line`,attr:{x1:`12`,x2:`12`,y1:`22`,y2:`18`},child:[]}]})(e)}function wa(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`},child:[]},{tag:`path`,attr:{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`},child:[]},{tag:`path`,attr:{d:`M12 11h4`},child:[]},{tag:`path`,attr:{d:`M12 16h4`},child:[]},{tag:`path`,attr:{d:`M8 11h.01`},child:[]},{tag:`path`,attr:{d:`M8 16h.01`},child:[]}]})(e)}function Ta(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M2 8V2h6`},child:[]},{tag:`path`,attr:{d:`m2 2 10 10`},child:[]},{tag:`path`,attr:{d:`M12 2A10 10 0 1 1 2 12`},child:[]}]})(e)}var Ea={Root:`_Root_cfjcw_1`,ProgressWrap:`_ProgressWrap_cfjcw_6`,ProgressLabel:`_ProgressLabel_cfjcw_13`,ProgressBar:`_ProgressBar_cfjcw_19`,ProgressFill:`_ProgressFill_cfjcw_27`,Filters:`_Filters_cfjcw_33`,FilterButton:`_FilterButton_cfjcw_40`,EventList:`_EventList_cfjcw_57`,EventRow:`_EventRow_cfjcw_63`,EventTime:`_EventTime_cfjcw_120`,EventIcon:`_EventIcon_cfjcw_129`,EventDescription:`_EventDescription_cfjcw_172`,Killer:`_Killer_cfjcw_177`,Victim:`_Victim_cfjcw_180`,DamageType:`_DamageType_cfjcw_183`,Empty:`_Empty_cfjcw_186`};function Da(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}var Oa={kill:(0,B.jsx)(Ca,{}),death:(0,B.jsx)(la,{}),"flag-grab":(0,B.jsx)(ga,{}),"flag-return":(0,B.jsx)(ga,{}),"flag-cap":(0,B.jsx)(ga,{}),"match-start":(0,B.jsx)(Fr,{}),"match-end":(0,B.jsx)(_a,{})},ka={chaingun:`chaingunned`,plasma:`plasma rifled`};function Aa(e){if(e.type===`kill`&&e.killer&&e.victim)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:Ea.Killer,title:e.killer,children:`You`}),` `,(0,B.jsx)(`span`,{className:Ea.DamageType,children:e.weapon?ka[e.weapon]??`${e.weapon}${e.weapon.endsWith(`e`)?`d`:`ed`}`:`killed`}),` `,(0,B.jsx)(`span`,{className:Ea.Victim,children:e.victim})]});if(e.type===`death`)return e.killer?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:Ea.Killer,children:e.killer}),` `,(0,B.jsx)(`span`,{className:Ea.DamageType,children:e.weapon?ka[e.weapon]??`${e.weapon}${e.weapon.endsWith(`e`)?`d`:`ed`}`:`killed`}),` `,(0,B.jsx)(`span`,{className:Ea.Victim,title:e.victim,children:`you`})]}):(0,B.jsx)(B.Fragment,{children:e.description});if(e.type===`flag-grab`)return(0,B.jsxs)(B.Fragment,{children:[`You grabbed `,e.flagTeamName?`the ${e.flagTeamName} flag`:`the enemy flag`]});if(e.type===`flag-return`)return(0,B.jsx)(B.Fragment,{children:`You returned your flag`});if(e.type===`flag-cap`&&e.capturer){let t=e.teamAffinity===`friendly`?`the enemy flag`:e.teamAffinity===`enemy`?`your flag`:e.flagTeamName?`the ${e.flagTeamName} flag`:`a flag`;return(0,B.jsxs)(B.Fragment,{children:[e.capturer,` captured `,t]})}return e.type===`match-start`?`Match started`:e.type===`match-end`?`Match ended`:e.description}function ja(){let e=(0,z.c)(58),t=xn(Ra),n=xn(La),{seek:r}=Dr(),[i,a]=(0,R.useState)(`all`),o,s;if(e[0]!==t||e[1]!==i||e[2]!==n||e[3]!==r){s=Symbol.for(`react.early_return_sentinel`);bb0:{let c=t?.filter(e=>i===`all`||e.type===i)??[],l;e[6]===r?l=e[7]:(l=e=>{r(Math.max(0,e-3)),document.activeElement instanceof HTMLElement&&document.activeElement.blur()},e[6]=r,e[7]=l);let u=l;if(n!=null&&t==null){let t;e[8]===n?t=e[9]:(t=Math.round(n*100),e[8]=n,e[9]=t);let r;e[10]===t?r=e[11]:(r=(0,B.jsxs)(`span`,{className:Ea.ProgressLabel,children:[`Scanning… `,t,`%`]}),e[10]=t,e[11]=r);let i=`${n*100}%`,a;e[12]===i?a=e[13]:(a=(0,B.jsx)(`div`,{className:Ea.ProgressBar,children:(0,B.jsx)(`div`,{className:Ea.ProgressFill,style:{width:i}})}),e[12]=i,e[13]=a);let o;e[14]!==r||e[15]!==a?(o=(0,B.jsx)(`div`,{className:Ea.Root,children:(0,B.jsxs)(`div`,{className:Ea.ProgressWrap,children:[r,a]})}),e[14]=r,e[15]=a,e[16]=o):o=e[16],s=o;break bb0}if(!t){s=null;break bb0}let d;e[17]===t?d=e[18]:(d=t.filter(Ia),e[17]=t,e[18]=d);let f=d.length,p;e[19]===t?p=e[20]:(p=t.filter(Fa),e[19]=t,e[20]=p);let m=p.length,h;e[21]===t?h=e[22]:(h=t.filter(Pa),e[21]=t,e[22]=h);let g=h.length,_;e[23]===t?_=e[24]:(_=t.filter(Na),e[23]=t,e[24]=_);let v=_.length,y;e[25]===t?y=e[26]:(y=t.filter(Ma),e[25]=t,e[26]=y);let b=y.length,x=i===`all`,S;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>a(`all`),e[27]=S):S=e[27];let C;e[28]!==t.length||e[29]!==x?(C=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":x,onClick:S,children:[`All (`,t.length,`)`]}),e[28]=t.length,e[29]=x,e[30]=C):C=e[30];let w=i===`kill`,T;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>a(`kill`),e[31]=T):T=e[31];let E;e[32]!==f||e[33]!==w?(E=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":w,onClick:T,children:[`Kills (`,f,`)`]}),e[32]=f,e[33]=w,e[34]=E):E=e[34];let D=i===`death`,O;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>a(`death`),e[35]=O):O=e[35];let k;e[36]!==m||e[37]!==D?(k=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":D,onClick:O,children:[`Deaths (`,m,`)`]}),e[36]=m,e[37]=D,e[38]=k):k=e[38];let A=i===`flag-grab`,j;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>a(`flag-grab`),e[39]=j):j=e[39];let M;e[40]!==g||e[41]!==A?(M=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":A,onClick:j,children:[`Grabs (`,g,`)`]}),e[40]=g,e[41]=A,e[42]=M):M=e[42];let ee=i===`flag-return`,te;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>a(`flag-return`),e[43]=te):te=e[43];let N;e[44]!==v||e[45]!==ee?(N=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":ee,onClick:te,children:[`Returns (`,v,`)`]}),e[44]=v,e[45]=ee,e[46]=N):N=e[46];let P=i===`flag-cap`,ne;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(ne=()=>a(`flag-cap`),e[47]=ne):ne=e[47];let re;e[48]!==b||e[49]!==P?(re=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":P,onClick:ne,children:[`Caps (`,b,`)`]}),e[48]=b,e[49]=P,e[50]=re):re=e[50];let F;e[51]!==C||e[52]!==E||e[53]!==k||e[54]!==M||e[55]!==N||e[56]!==re?(F=(0,B.jsxs)(`div`,{className:Ea.Filters,children:[C,E,k,M,N,re]}),e[51]=C,e[52]=E,e[53]=k,e[54]=M,e[55]=N,e[56]=re,e[57]=F):F=e[57],o=(0,B.jsxs)(`div`,{className:Ea.Root,children:[F,c.length===0?(0,B.jsx)(`div`,{className:Ea.Empty,children:`No events found.`}):(0,B.jsx)(`div`,{className:Ea.EventList,children:c.map((e,t)=>(0,B.jsxs)(`button`,{type:`button`,className:Ea.EventRow,onClick:()=>u(e.timeSec),children:[(0,B.jsx)(`span`,{className:Ea.EventTime,children:Da(e.timeSec)}),(0,B.jsx)(`span`,{className:Ea.EventIcon,"data-type":e.type,"data-affinity":e.teamAffinity,children:Oa[e.type]}),(0,B.jsx)(`span`,{className:Ea.EventDescription,children:Aa(e)})]},`${e.timeSec}-${e.type}-${t}`))})]})}e[0]=t,e[1]=i,e[2]=n,e[3]=r,e[4]=o,e[5]=s}else o=e[4],s=e[5];return s===Symbol.for(`react.early_return_sentinel`)?o:s}function Ma(e){return e.type===`flag-cap`}function Na(e){return e.type===`flag-return`}function Pa(e){return e.type===`flag-grab`}function Fa(e){return e.type===`death`}function Ia(e){return e.type===`kill`}function La(e){return e.scanProgress}function Ra(e){return e.events}var za=new Map([[`flag`,`Flags`],[`huntersflag1`,`Flags`],[`huntersflag2`,`Flags`],[`huntersflag4`,`Flags`],[`huntersflag8`,`Flags`],[`stationinventory`,`Inventory Stations`],[`stationammo`,`Inventory Stations`],[`mobileinvstation`,`Inventory Stations`],[`stationvehiclepad`,`Vehicle Pads`],[`stationvehicle`,`Vehicle Pads`],[`generatorlarge`,`Generators`],[`solarpanel`,`Generators`],[`sensorlargepulse`,`Sensors`],[`sensormediumpulse`,`Sensors`],[`turretbaselarge`,`Turrets`],[`sentryturret`,`Turrets`],[`repairpatch`,`Health`],[`repairkit`,`Health`],[`ammopack`,`Packs`],[`energypack`,`Packs`],[`shieldpack`,`Packs`],[`repairpack`,`Packs`],[`cloakingpack`,`Packs`],[`sensorjammerpack`,`Packs`],[`aabarrelpack`,`Packs`],[`elfbarrelpack`,`Packs`],[`missilebarrelpack`,`Packs`],[`mortarbarrelpack`,`Packs`],[`plasmabarrelpack`,`Packs`],[`inventorydeployable`,`Packs`],[`motionsensordeployable`,`Packs`],[`pulsesensordeployable`,`Packs`],[`turretoutdoordeployable`,`Packs`],[`turretindoordeployable`,`Packs`],[`satchelcharge`,`Weapons`],[`blaster`,`Weapons`],[`chaingun`,`Weapons`],[`disc`,`Weapons`],[`grenadelauncher`,`Weapons`],[`elfgun`,`Weapons`],[`missilelauncher`,`Weapons`],[`mortar`,`Weapons`],[`plasma`,`Weapons`],[`shocklance`,`Weapons`],[`sniperrifle`,`Weapons`],[`targetinglaser`,`Weapons`],[`chaingunammo`,`Ammo`],[`discammo`,`Ammo`],[`grenadelauncherammo`,`Ammo`],[`missilelauncherammo`,`Ammo`],[`mortarammo`,`Ammo`],[`plasmaammo`,`Ammo`],[`bombammo`,`Ammo`],[`assaultmortarammo`,`Ammo`],[`grenade`,`Ammo`],[`concussiongrenade`,`Ammo`],[`flashgrenade`,`Ammo`],[`flaregrenade`,`Ammo`],[`cameragrenade`,`Ammo`],[`mine`,`Ammo`],[`beacon`,`Ammo`],[`flipflop`,`Switches`],[`nexus`,`Nexus`],[`nexusbase`,`Nexus`],[`nexuscap`,`Nexus`]]),Ba=[`Flags`,`Inventory Stations`,`Generators`,`Vehicle Pads`,`Turrets`,`Sensors`,`Nexus`,`Switches`,`Packs`,`Health`,`Weapons`,`Ammo`];function Va(e){return e.renderType===`Shape`&&typeof e.dataBlock==`string`&&e.dataBlock!==``&&Array.isArray(e.position)}function Ha(e,t){let n=new Map;for(let r of e.values()){if(!Va(r))continue;let e=za.get(r.dataBlock.toLowerCase());if(!e)continue;let i=r.dataBlock;if(t&&r.runtimeObject){let e=O(r.runtimeObject,t);e&&(i=e)}let a=n.get(e);a||(a=[],n.set(e,a)),a.push({entityId:r.id,label:i,position:r.position,teamId:r.teamId})}let r=[];for(let e of Ba){let t=n.get(e);t&&t.length>0&&(t.sort((e,t)=>{let n=(e.teamId??0)-(t.teamId??0);return n===0?e.label.localeCompare(t.label):n}),r.push({name:e,targets:t}))}return r}var Ua={Root:`_Root_pb9qa_1`,Empty:`_Empty_pb9qa_6`,TourAllButton:`_TourAllButton_pb9qa_13`,CategoryHeader:`_CategoryHeader_pb9qa_40`,CategoryCount:`_CategoryCount_pb9qa_58`,TourButton:`_TourButton_pb9qa_63`,PlayIcon:`_PlayIcon_pb9qa_83`,ExitIcon:`_ExitIcon_pb9qa_87`,ItemList:`_ItemList_pb9qa_100`,ItemRow:`_ItemRow_pb9qa_106`,ItemLabel:`_ItemLabel_pb9qa_151`,TeamBadge:`_TeamBadge_pb9qa_156`};function Wa(e){return S({tag:`svg`,attr:{viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`},child:[{tag:`path`,attr:{fillRule:`evenodd`,d:`M3 4.25A2.25 2.25 0 0 1 5.25 2h5.5A2.25 2.25 0 0 1 13 4.25v2a.75.75 0 0 1-1.5 0v-2a.75.75 0 0 0-.75-.75h-5.5a.75.75 0 0 0-.75.75v11.5c0 .414.336.75.75.75h5.5a.75.75 0 0 0 .75-.75v-2a.75.75 0 0 1 1.5 0v2A2.25 2.25 0 0 1 10.75 18h-5.5A2.25 2.25 0 0 1 3 15.75V4.25Z`,clipRule:`evenodd`},child:[]},{tag:`path`,attr:{fillRule:`evenodd`,d:`M19 10a.75.75 0 0 0-.75-.75H8.704l1.048-.943a.75.75 0 1 0-1.004-1.114l-2.5 2.25a.75.75 0 0 0 0 1.114l2.5 2.25a.75.75 0 1 0 1.004-1.114l-1.048-.943h9.546A.75.75 0 0 0 19 10Z`,clipRule:`evenodd`},child:[]}]})(e)}var Ga=`__all__`;function Ka(e){return e.animation?{targets:e.animation.targets,categoryName:e.animation.categoryName,currentIndex:e.animation.currentIndex}:null}function qa(e,t){return e===t?!0:!e||!t?!1:e.categoryName===t.categoryName&&e.currentIndex===t.currentIndex&&e.targets===t.targets}function Ja(){let e=(0,z.c)(28),t=zn(),n=Ae(Xa),r;e[0]!==n||e[1]!==t?(r=Ha(t,n),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i=r,a=te(Ka,qa),o;if(e[3]!==i){o=new Map;for(let e=0;e{let n=e.teamId!=null&&e.teamId>0?e.teamId:1/0,r=t.teamId!=null&&t.teamId>0?t.teamId:1/0;if(n!==r)return n-r;let i=o.get(e)??0,a=o.get(t)??0;return i===a?e.label.localeCompare(t.label):i-a},e[8]=o,e[9]=t),s=i.flatMap(Ya).sort(t),e[5]=i,e[6]=o,e[7]=s}else s=e[7];let c=s;if(i.length===0){let t;return e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(`div`,{className:Ua.Root,children:(0,B.jsx)(`p`,{className:Ua.Empty,children:`No map features found`})}),e[10]=t):t=e[10],t}let l=a!==null&&a.categoryName===Ga,u;e[11]!==c||e[12]!==l?(u=()=>{l?N.getState().cancel():N.getState().startTour(c,Ga)},e[11]=c,e[12]=l,e[13]=u):u=e[13];let d=u,f;e[14]===l?f=e[15]:(f=l?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Wa,{className:Ua.ExitIcon}),` Exit tour`]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Fr,{className:Ua.PlayIcon}),` `,(0,B.jsx)(`span`,{className:Ua.ButtonLabel,children:`Tour all features`})]}),e[14]=l,e[15]=f);let p;e[16]!==d||e[17]!==l||e[18]!==f?(p=(0,B.jsx)(`button`,{type:`button`,className:Ua.TourAllButton,"data-active":l,onClick:d,children:f}),e[16]=d,e[17]=l,e[18]=f,e[19]=p):p=e[19];let m;if(e[20]!==i||e[21]!==a){let t;e[23]===a?t=e[24]:(t=e=>(0,B.jsx)(Za,{category:e,tourState:a},e.name),e[23]=a,e[24]=t),m=i.map(t),e[20]=i,e[21]=a,e[22]=m}else m=e[22];let h;return e[25]!==p||e[26]!==m?(h=(0,B.jsxs)(`div`,{className:Ua.Root,children:[p,m]}),e[25]=p,e[26]=m,e[27]=h):h=e[27],h}function Ya(e){return e.targets}function Xa(e){return e.runtime.runtime?.state.datablocks}function Za(e){let t=(0,z.c)(30),{category:n,tourState:r}=e,i=r!==null&&r.categoryName===n.name,a;t[0]!==n.name||t[1]!==n.targets||t[2]!==i?(a=()=>{i?N.getState().cancel():N.getState().startTour(n.targets,n.name)},t[0]=n.name,t[1]=n.targets,t[2]=i,t[3]=a):a=t[3];let o=a,s;t[4]===n.name?s=t[5]:(s=(0,B.jsx)(`span`,{children:n.name}),t[4]=n.name,t[5]=s);let c;t[6]===n.targets.length?c=t[7]:(c=(0,B.jsxs)(`span`,{className:Ua.CategoryCount,children:[`(`,n.targets.length,`)`]}),t[6]=n.targets.length,t[7]=c);let l;t[8]===i?l=t[9]:(l=i?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Wa,{className:Ua.ExitIcon}),` Exit tour`]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Fr,{className:Ua.PlayIcon}),` Tour all`]}),t[8]=i,t[9]=l);let u;t[10]!==o||t[11]!==i||t[12]!==l?(u=(0,B.jsx)(`button`,{type:`button`,className:Ua.TourButton,"data-active":i,onClick:o,children:l}),t[10]=o,t[11]=i,t[12]=l,t[13]=u):u=t[13];let d;t[14]!==s||t[15]!==c||t[16]!==u?(d=(0,B.jsxs)(`div`,{className:Ua.CategoryHeader,children:[s,c,u]}),t[14]=s,t[15]=c,t[16]=u,t[17]=d):d=t[17];let f;if(t[18]!==n.targets||t[19]!==i||t[20]!==r){let e;t[22]!==i||t[23]!==r?(e=(e,t)=>{let n=i&&r.currentIndex===t||r!==null&&r.targets[r.currentIndex]?.entityId===e.entityId;return(0,B.jsxs)(`button`,{type:`button`,className:Ua.ItemRow,"data-active":n,onClick:()=>N.getState().flyTo(e),children:[(0,B.jsx)(Fr,{className:Ua.PlayIcon}),` `,(0,B.jsx)(`span`,{className:Ua.ItemLabel,children:e.label}),e.teamId!=null&&e.teamId>0&&(0,B.jsx)(`span`,{className:Ua.TeamBadge,"data-team":e.teamId,children:k[e.teamId]??`Team ${e.teamId}`})]},e.entityId)},t[22]=i,t[23]=r,t[24]=e):e=t[24],f=n.targets.map(e),t[18]=n.targets,t[19]=i,t[20]=r,t[21]=f}else f=t[21];let p;t[25]===f?p=t[26]:(p=(0,B.jsx)(`div`,{className:Ua.ItemList,children:f}),t[25]=f,t[26]=p);let m;return t[27]!==d||t[28]!==p?(m=(0,B.jsxs)(B.Fragment,{children:[d,p]}),t[27]=d,t[28]=p,t[29]=m):m=t[29],m}function Qa(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M16 21L11.2381 12.2698L15 6L23 21H16ZM8 10L14 21H2L8 10ZM5.5 8C4.11929 8 3 6.88071 3 5.5C3 4.11929 4.11929 3 5.5 3C6.88071 3 8 4.11929 8 5.5C8 6.88071 6.88071 8 5.5 8Z`},child:[]}]})(e)}function $a(e){let t=(0,z.c)(6),{isActive:n,onClick:r}=e,i=n===void 0?!1:n,a,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(Qa,{}),o=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Explore`}),s=(0,B.jsx)(`span`,{className:mn.ButtonHint,children:`Browse maps`}),t[0]=a,t[1]=o,t[2]=s):(a=t[0],o=t[1],s=t[2]);let c;return t[3]!==i||t[4]!==r?(c=(0,B.jsxs)(`button`,{type:`button`,className:mn.Button,onClick:r,"data-active":i,children:[a,o,s]}),t[3]=i,t[4]=r,t[5]=c):c=t[5],c}function eo(e){let t=(0,z.c)(7),{missionName:n,onClick:r}=e,i=Jn(),a=Xn(),o=i===`demo`||i===`live`?a:n,s;t[0]===o?s=t[1]:(s=o?C(o):!1,t[0]=o,t[1]=s);let c=!s,l,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,B.jsx)(wa,{}),u=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Show map info`}),t[2]=l,t[3]=u):(l=t[2],u=t[3]);let d;return t[4]!==r||t[5]!==c?(d=(0,B.jsxs)(`button`,{type:`button`,className:mn.Button,"aria-label":`Show map info`,onClick:r,disabled:c,children:[l,u]}),t[4]=r,t[5]=c,t[6]=d):d=t[6],d}function to(e){let t=(0,z.c)(4),{onClick:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,B.jsx)(va,{}),i=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Show scores`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let a;return t[2]===n?a=t[3]:(a=(0,B.jsxs)(`button`,{type:`button`,className:mn.Button,"aria-label":`Show scores`,onClick:n,children:[r,i]}),t[2]=n,t[3]=a),a}var H={InspectorControls:`_InspectorControls_cm86c_1`,Dropdown:`_Dropdown_cm86c_8`,Group:`_Group_cm86c_16`,CheckboxField:`_CheckboxField_cm86c_24`,Label:`_Label_cm86c_39`,Description:`_Description_cm86c_47`,Control:`_Control_cm86c_60`,Field:`_Field_cm86c_67`,Tools:`_Tools_cm86c_91`,MapInfoButton:`_MapInfoButton_cm86c_114 _Button_1u47f_2`,ShowScoresButton:`_ShowScoresButton_cm86c_115 _Button_1u47f_2`,ForceRenderButton:`_ForceRenderButton_cm86c_119`,CloseSidebarButton:`_CloseSidebarButton_cm86c_131 _Button_1u47f_2`},no=[`controls`,`preferences`,`audio`,`timeline`],ro=(0,R.memo)(function(e){let t=(0,z.c)(209),{missionName:n,missionType:r,onOpenMapInfo:i,onOpenScoreScreen:a,onOpenServerBrowser:o,onChooseMap:s,onCancelChoosingMap:l,choosingMap:u,cameraRef:d,invalidateRef:p,onClose:m}=e,h=g(),_=Jn(),y=_r(),b=Xn(),x=_===`demo`||_===`live`?b:n,S;t[0]===x?S=t[1]:(S=x?C(x):!1,t[0]=x,t[1]=S);let w=S,T=pr(io),{fogEnabled:E,setFogEnabled:D,fov:O,setFov:k,audioEnabled:A,setAudioEnabled:j,audioVolume:M,setAudioVolume:ee,animationEnabled:te,setAnimationEnabled:N,fpsLimit:P,setFpsLimit:ne,showInputOverlay:re,setShowInputOverlay:F}=c(),{speedMultiplier:ie,setSpeedMultiplier:ae,mouseSensitivity:I,setMouseSensitivity:oe,touchMode:L,setTouchMode:se,invertScroll:ce,setInvertScroll:le,invertDrag:ue,setInvertDrag:de,invertJoystick:fe,setInvertJoystick:pe}=v(),{debugMode:me,setDebugMode:he,renderOnDemand:ge,setRenderOnDemand:_e}=f(),[ve,ye]=(0,R.useState)(!1),be=(0,R.useRef)(null),xe=(0,R.useRef)(null),Se=(0,R.useRef)(null),Ce,we;t[2]===ve?(Ce=t[3],we=t[4]):(Ce=()=>{ve&&be.current?.focus()},we=[ve],t[2]=ve,t[3]=Ce,t[4]=we),(0,R.useEffect)(Ce,we);let Te;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(Te=e=>{let t=e.relatedTarget;t&&Se.current?.contains(t)||ye(!1)},t[5]=Te):Te=t[5];let Ee=Te,De;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(De=e=>{e.key===`Escape`&&(ye(!1),xe.current?.focus())},t[6]=De):De=t[6];let Oe=De,ke=_===`map`&&!y||(u??!1),Ae;t[7]!==s||t[8]!==ke?(Ae=(0,B.jsx)($a,{isActive:ke,onClick:s}),t[7]=s,t[8]=ke,t[9]=Ae):Ae=t[9];let je=!u&&y?.source===`demo`,Me;t[10]!==u||t[11]!==l||t[12]!==je?(Me=(0,B.jsx)(Nr,{isActive:je,choosingMap:u,onCancelChoosingMap:l}),t[10]=u,t[11]=l,t[12]=je,t[13]=Me):Me=t[13];let Ne;t[14]!==u||t[15]!==T||t[16]!==o?(Ne=o&&(0,B.jsx)(Lr,{isActive:!u&&T,onOpenServerBrowser:o}),t[14]=u,t[15]=T,t[16]=o,t[17]=Ne):Ne=t[17];let Pe;t[18]!==Ne||t[19]!==Ae||t[20]!==Me?(Pe=(0,B.jsxs)(`div`,{className:mn.ButtonGroup,children:[Ae,Me,Ne]}),t[18]=Ne,t[19]=Ae,t[20]=Me,t[21]=Pe):Pe=t[21];let Fe=!w,Ie;t[22]!==d||t[23]!==n||t[24]!==r||t[25]!==Fe?(Ie=(0,B.jsx)(_n,{missionName:n,missionType:r,cameraRef:d,disabled:Fe}),t[22]=d,t[23]=n,t[24]=r,t[25]=Fe,t[26]=Ie):Ie=t[26];let Le;t[27]!==n||t[28]!==i?(Le=(0,B.jsx)(eo,{missionName:n,onClick:i}),t[27]=n,t[28]=i,t[29]=Le):Le=t[29];let Re;t[30]===a?Re=t[31]:(Re=a&&(0,B.jsx)(to,{onClick:a}),t[30]=a,t[31]=Re);let ze;t[32]!==Pe||t[33]!==Ie||t[34]!==Le||t[35]!==Re?(ze=(0,B.jsxs)(`div`,{className:H.Tools,children:[Pe,Ie,Le,Re]}),t[32]=Pe,t[33]=Ie,t[34]=Le,t[35]=Re,t[36]=ze):ze=t[36];let Be;t[37]===y?.source?Be=t[38]:(Be=y?.source===`demo`&&(0,B.jsx)(pa,{value:`timeline`,label:`Timeline`,noPadding:!0,children:(0,B.jsx)(ja,{})}),t[37]=y?.source,t[38]=Be);let Ve;t[39]!==_||t[40]!==y?(Ve=_===`map`&&!y&&(0,B.jsx)(pa,{value:`mapFeatures`,label:`Map Features`,noPadding:!0,children:(0,B.jsx)(Ja,{})}),t[39]=_,t[40]=y,t[41]=Ve):Ve=t[41];let He;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,B.jsx)(`label`,{htmlFor:`speedInput`,children:`Fly speed`}),t[42]=He):He=t[42];let Ue;t[43]===ie?Ue=t[44]:(Ue=Math.round(ie*100),t[43]=ie,t[44]=Ue);let We;t[45]===ae?We=t[46]:(We=e=>ae(parseFloat(e.target.value)/100),t[45]=ae,t[46]=We);let Ge;t[47]!==Ue||t[48]!==We?(Ge=(0,B.jsx)(`div`,{className:H.Control,children:(0,B.jsx)(`input`,{id:`speedInput`,type:`range`,min:1,max:100,step:1,value:Ue,onChange:We})}),t[47]=Ue,t[48]=We,t[49]=Ge):Ge=t[49];let Ke=h===!1?` Use your scroll wheel or trackpad to adjust while flying.`:``,qe;t[50]===Ke?qe=t[51]:(qe=(0,B.jsxs)(`p`,{className:H.Description,children:[`How fast you move in free-flying mode.`,Ke]}),t[50]=Ke,t[51]=qe);let Je;t[52]!==Ge||t[53]!==qe?(Je=(0,B.jsxs)(`div`,{className:H.Field,children:[He,Ge,qe]}),t[52]=Ge,t[53]=qe,t[54]=Je):Je=t[54];let Ye;t[55]!==h||t[56]!==se||t[57]!==L?(Ye=h?(0,B.jsxs)(`div`,{className:H.Field,children:[(0,B.jsx)(`label`,{htmlFor:`touchModeInput`,children:`Joystick`}),` `,(0,B.jsx)(`div`,{className:H.Control,children:(0,B.jsxs)(`select`,{id:`touchModeInput`,value:L,onChange:e=>se(e.target.value),children:[(0,B.jsx)(`option`,{value:`dualStick`,children:`Dual stick`}),(0,B.jsx)(`option`,{value:`moveLookStick`,children:`Single stick`})]})}),(0,B.jsx)(`p`,{className:H.Description,children:`Single stick has a unified move + look control. Dual stick has independent move + look.`})]}):null,t[55]=h,t[56]=se,t[57]=L,t[58]=Ye):Ye=t[58];let Xe;t[59]!==ce||t[60]!==h||t[61]!==le?(Xe=h===!1?(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[(0,B.jsx)(`input`,{id:`invertScroll`,type:`checkbox`,checked:ce,onChange:e=>{le(e.target.checked)}}),(0,B.jsx)(`label`,{className:H.Label,htmlFor:`invertScroll`,children:`Invert scroll direction`}),(0,B.jsx)(`p`,{className:H.Description,children:`Reverse which scroll direction increases and decreases fly speed.`})]}):null,t[59]=ce,t[60]=h,t[61]=le,t[62]=Xe):Xe=t[62];let Ze;t[63]!==fe||t[64]!==h||t[65]!==pe?(Ze=h?(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[(0,B.jsx)(`input`,{id:`invertJoystick`,type:`checkbox`,checked:fe,onChange:e=>{pe(e.target.checked)}}),(0,B.jsx)(`label`,{className:H.Label,htmlFor:`invertJoystick`,children:`Invert joystick direction`}),(0,B.jsx)(`p`,{className:H.Description,children:`Reverse joystick look direction.`})]}):null,t[63]=fe,t[64]=h,t[65]=pe,t[66]=Ze):Ze=t[66];let Qe;t[67]===de?Qe=t[68]:(Qe=e=>{de(e.target.checked)},t[67]=de,t[68]=Qe);let $e;t[69]!==ue||t[70]!==Qe?($e=(0,B.jsx)(`input`,{id:`invertDrag`,type:`checkbox`,checked:ue,onChange:Qe}),t[69]=ue,t[70]=Qe,t[71]=$e):$e=t[71];let et,tt;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`invertDrag`,children:`Invert drag direction`}),tt=(0,B.jsx)(`p`,{className:H.Description,children:`Reverse how dragging the viewport aims the camera.`}),t[72]=et,t[73]=tt):(et=t[72],tt=t[73]);let nt;t[74]===$e?nt=t[75]:(nt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[$e,et,tt]}),t[74]=$e,t[75]=nt);let rt;t[76]!==h||t[77]!==I||t[78]!==oe?(rt=h===!1&&(0,B.jsxs)(`div`,{className:H.Field,children:[(0,B.jsx)(`label`,{htmlFor:`mouseSensitivityInput`,children:`Mouse sensitivity`}),(0,B.jsx)(`div`,{className:H.Control,children:(0,B.jsx)(`input`,{id:`mouseSensitivityInput`,type:`range`,min:1,max:256,step:2,value:Math.round(I*16e3),onChange:e=>{oe(parseInt(e.target.value)/16e3)}})})]}),t[76]=h,t[77]=I,t[78]=oe,t[79]=rt):rt=t[79];let it;t[80]!==Je||t[81]!==Ye||t[82]!==Xe||t[83]!==Ze||t[84]!==nt||t[85]!==rt?(it=(0,B.jsxs)(pa,{value:`controls`,label:`Controls`,children:[Je,Ye,Xe,Ze,nt,rt]}),t[80]=Je,t[81]=Ye,t[82]=Xe,t[83]=Ze,t[84]=nt,t[85]=rt,t[86]=it):it=t[86];let at;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,B.jsx)(`label`,{htmlFor:`fovInput`,children:`FOV`}),t[87]=at):at=t[87];let ot;t[88]===O?ot=t[89]:(ot=(0,B.jsxs)(`output`,{htmlFor:`fovInput`,children:[O,`°`]}),t[88]=O,t[89]=ot);let st;t[90]===k?st=t[91]:(st=e=>k(parseInt(e.target.value)),t[90]=k,t[91]=st);let ct;t[92]!==O||t[93]!==st?(ct=(0,B.jsx)(`input`,{id:`fovInput`,type:`range`,min:75,max:120,step:5,value:O,onChange:st}),t[92]=O,t[93]=st,t[94]=ct):ct=t[94];let lt;t[95]!==ot||t[96]!==ct?(lt=(0,B.jsxs)(`div`,{className:H.Field,children:[at,(0,B.jsxs)(`div`,{className:H.Control,children:[ot,ct]})]}),t[95]=ot,t[96]=ct,t[97]=lt):lt=t[97];let ut;t[98]===F?ut=t[99]:(ut=e=>{F(e.target.checked)},t[98]=F,t[99]=ut);let dt;t[100]!==re||t[101]!==ut?(dt=(0,B.jsx)(`input`,{id:`showInputOverlayInput`,type:`checkbox`,checked:re,onChange:ut}),t[100]=re,t[101]=ut,t[102]=dt):dt=t[102];let ft;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`showInputOverlayInput`,children:`Show input overlay`}),t[103]=ft):ft=t[103];let pt;t[104]===dt?pt=t[105]:(pt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[dt,ft]}),t[104]=dt,t[105]=pt);let mt;t[106]!==lt||t[107]!==pt?(mt=(0,B.jsxs)(pa,{value:`preferences`,label:`Preferences`,children:[lt,pt]}),t[106]=lt,t[107]=pt,t[108]=mt):mt=t[108];let ht;t[109]===j?ht=t[110]:(ht=e=>{j(e.target.checked)},t[109]=j,t[110]=ht);let gt;t[111]!==A||t[112]!==ht?(gt=(0,B.jsx)(`input`,{id:`audioInput`,type:`checkbox`,checked:A,onChange:ht}),t[111]=A,t[112]=ht,t[113]=gt):gt=t[113];let _t;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`audioInput`,children:`Enable audio`}),t[114]=_t):_t=t[114];let vt;t[115]===gt?vt=t[116]:(vt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[gt,_t]}),t[115]=gt,t[116]=vt);let yt;t[117]===Symbol.for(`react.memo_cache_sentinel`)?(yt=(0,B.jsx)(`label`,{htmlFor:`volumeInput`,children:`Master volume`}),t[117]=yt):yt=t[117];let bt;t[118]===M?bt=t[119]:(bt=Math.round(M*100),t[118]=M,t[119]=bt);let xt;t[120]===bt?xt=t[121]:(xt=(0,B.jsxs)(`output`,{htmlFor:`volumeInput`,children:[bt,`%`]}),t[120]=bt,t[121]=xt);let St;t[122]===ee?St=t[123]:(St=e=>ee(parseFloat(e.target.value)),t[122]=ee,t[123]=St);let Ct;t[124]!==M||t[125]!==St?(Ct=(0,B.jsx)(`input`,{id:`volumeInput`,type:`range`,min:0,max:1,step:.05,value:M,onChange:St}),t[124]=M,t[125]=St,t[126]=Ct):Ct=t[126];let wt;t[127]!==xt||t[128]!==Ct?(wt=(0,B.jsxs)(`div`,{className:H.Field,children:[yt,(0,B.jsxs)(`div`,{className:H.Control,children:[xt,Ct]})]}),t[127]=xt,t[128]=Ct,t[129]=wt):wt=t[129];let Tt;t[130]!==vt||t[131]!==wt?(Tt=(0,B.jsxs)(pa,{value:`audio`,label:`Audio`,children:[vt,wt]}),t[130]=vt,t[131]=wt,t[132]=Tt):Tt=t[132];let Et;t[133]===D?Et=t[134]:(Et=e=>{D(e.target.checked)},t[133]=D,t[134]=Et);let Dt;t[135]!==E||t[136]!==Et?(Dt=(0,B.jsx)(`input`,{id:`fogInput`,type:`checkbox`,checked:E,onChange:Et}),t[135]=E,t[136]=Et,t[137]=Dt):Dt=t[137];let Ot;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(Ot=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`fogInput`,children:`Enable fog`}),t[138]=Ot):Ot=t[138];let kt;t[139]===Dt?kt=t[140]:(kt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[Dt,Ot]}),t[139]=Dt,t[140]=kt);let At;t[141]===N?At=t[142]:(At=e=>{N(e.target.checked)},t[141]=N,t[142]=At);let jt;t[143]!==te||t[144]!==At?(jt=(0,B.jsx)(`input`,{id:`animationInput`,type:`checkbox`,checked:te,onChange:At}),t[143]=te,t[144]=At,t[145]=jt):jt=t[145];let Mt;t[146]===Symbol.for(`react.memo_cache_sentinel`)?(Mt=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`animationInput`,children:`Enable animations`}),t[146]=Mt):Mt=t[146];let Nt;t[147]===jt?Nt=t[148]:(Nt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[jt,Mt]}),t[147]=jt,t[148]=Nt);let Pt;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(Pt=(0,B.jsx)(`label`,{htmlFor:`fpsLimitInput`,children:`FPS limit`}),t[149]=Pt):Pt=t[149];let Ft=P??``,It;t[150]===ne?It=t[151]:(It=e=>{let t=e.target.value;ne(t===``?null:parseInt(t))},t[150]=ne,t[151]=It);let Lt,Rt,zt,Bt,Vt;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(Lt=(0,B.jsx)(`option`,{value:`30`,children:`30`}),Rt=(0,B.jsx)(`option`,{value:`60`,children:`60`}),zt=(0,B.jsx)(`option`,{value:`120`,children:`120`}),Bt=(0,B.jsx)(`option`,{value:`144`,children:`144`}),Vt=(0,B.jsx)(`option`,{value:``,children:`No limit`}),t[152]=Lt,t[153]=Rt,t[154]=zt,t[155]=Bt,t[156]=Vt):(Lt=t[152],Rt=t[153],zt=t[154],Bt=t[155],Vt=t[156]);let Ht;t[157]!==Ft||t[158]!==It?(Ht=(0,B.jsx)(`div`,{className:H.Control,children:(0,B.jsxs)(`select`,{id:`fpsLimitInput`,value:Ft,onChange:It,children:[Lt,Rt,zt,Bt,Vt]})}),t[157]=Ft,t[158]=It,t[159]=Ht):Ht=t[159];let Ut;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(Ut=(0,B.jsx)(`p`,{className:H.Description,children:`Give your device a break by capping the framerate.`}),t[160]=Ut):Ut=t[160];let Wt;t[161]===Ht?Wt=t[162]:(Wt=(0,B.jsxs)(`div`,{className:H.Field,children:[Pt,Ht,Ut]}),t[161]=Ht,t[162]=Wt);let Gt;t[163]!==kt||t[164]!==Nt||t[165]!==Wt?(Gt=(0,B.jsxs)(pa,{value:`graphics`,label:`Graphics`,children:[kt,Nt,Wt]}),t[163]=kt,t[164]=Nt,t[165]=Wt,t[166]=Gt):Gt=t[166];let Kt;t[167]===he?Kt=t[168]:(Kt=e=>{he(e.target.checked)},t[167]=he,t[168]=Kt);let qt;t[169]!==me||t[170]!==Kt?(qt=(0,B.jsx)(`input`,{id:`debugInput`,type:`checkbox`,checked:me,onChange:Kt}),t[169]=me,t[170]=Kt,t[171]=qt):qt=t[171];let Jt;t[172]===Symbol.for(`react.memo_cache_sentinel`)?(Jt=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`debugInput`,children:`Render debug visuals`}),t[172]=Jt):Jt=t[172];let Yt;t[173]===qt?Yt=t[174]:(Yt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[qt,Jt]}),t[173]=qt,t[174]=Yt);let Xt;t[175]===_e?Xt=t[176]:(Xt=e=>{_e(e.target.checked)},t[175]=_e,t[176]=Xt);let Zt;t[177]!==ge||t[178]!==Xt?(Zt=(0,B.jsx)(`input`,{id:`onDemandInput`,type:`checkbox`,checked:ge,onChange:Xt}),t[177]=ge,t[178]=Xt,t[179]=Zt):Zt=t[179];let Qt;t[180]===Symbol.for(`react.memo_cache_sentinel`)?(Qt=(0,B.jsx)(`label`,{htmlFor:`onDemandInput`,children:`Render on demand `}),t[180]=Qt):Qt=t[180];let $t;t[181]===p?$t=t[182]:($t=()=>p.current?.(),t[181]=p,t[182]=$t);let en;t[183]===Symbol.for(`react.memo_cache_sentinel`)?(en=(0,B.jsx)(nn,{}),t[183]=en):en=t[183];let tn;t[184]===$t?tn=t[185]:(tn=(0,B.jsxs)(`div`,{className:H.Label,children:[Qt,(0,B.jsx)(`button`,{type:`button`,className:H.ForceRenderButton,title:`Force render`,"aria-label":`Force render`,onClick:$t,children:en})]}),t[184]=$t,t[185]=tn);let rn;t[186]===Symbol.for(`react.memo_cache_sentinel`)?(rn=(0,B.jsx)(`p`,{className:H.Description,children:`Significantly decreases CPU and GPU usage by only rendering frames when requested. Helpful when developing parts of the app unrelated to rendering.`}),t[186]=rn):rn=t[186];let an;t[187]!==Zt||t[188]!==tn?(an=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[Zt,tn,rn]}),t[187]=Zt,t[188]=tn,t[189]=an):an=t[189];let on;t[190]!==Yt||t[191]!==an?(on=(0,B.jsxs)(pa,{value:`debug`,label:`Debug`,children:[Yt,an]}),t[190]=Yt,t[191]=an,t[192]=on):on=t[192];let sn;t[193]!==Be||t[194]!==Ve||t[195]!==it||t[196]!==mt||t[197]!==Tt||t[198]!==Gt||t[199]!==on?(sn=(0,B.jsx)(`div`,{className:H.Accordions,children:(0,B.jsxs)(fa,{type:`multiple`,defaultValue:no,children:[Be,Ve,it,mt,Tt,Gt,on]})}),t[193]=Be,t[194]=Ve,t[195]=it,t[196]=mt,t[197]=Tt,t[198]=Gt,t[199]=on,t[200]=sn):sn=t[200];let cn;t[201]===Symbol.for(`react.memo_cache_sentinel`)?(cn=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Close`}),t[201]=cn):cn=t[201];let ln;t[202]===m?ln=t[203]:(ln=(0,B.jsx)(`button`,{className:H.CloseSidebarButton,onClick:m,children:cn}),t[202]=m,t[203]=ln);let un;return t[204]!==ve||t[205]!==ze||t[206]!==sn||t[207]!==ln?(un=(0,B.jsx)(`div`,{className:H.InspectorControls,children:(0,B.jsx)(`div`,{ref:Se,children:(0,B.jsxs)(`div`,{className:H.Dropdown,ref:be,id:`settingsPanel`,tabIndex:-1,onKeyDown:Oe,onBlur:Ee,"data-open":ve,children:[ze,sn,ln]})})}),t[204]=ve,t[205]=ze,t[206]=sn,t[207]=ln,t[208]=un):un=t[208],un});function io(e){return e.gameStatus===`connected`||e.gameStatus===`authenticating`}function ao(...e){}function oo(e,t){return so(e)?e(co(t)?t():t):e}function so(e){return typeof e==`function`}function co(e){return typeof e==`function`}function lo(e,t){return typeof Object.hasOwn==`function`?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function U(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function uo(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``)}function fo(e,t){let n={...e};for(let e of t)lo(n,e)&&delete n[e];return n}function po(e,t){let n={};for(let r of t)lo(e,r)&&(n[r]=e[r]);return n}function mo(e){return e}function ho(e,t){if(!e)throw Error(typeof t==`string`?t:`Invariant failed`)}function go(e){return Object.keys(e)}function _o(e,...t){let n=typeof e==`function`?e(...t):e;return n==null?!1:!n}function vo(e){return e.disabled||e[`aria-disabled`]===!0||e[`aria-disabled`]===`true`}function yo(e){let t={};for(let n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function W(...e){for(let t of e)if(t!==void 0)return t}function bo(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function xo(e){return!e||!(0,R.isValidElement)(e)?!1:`ref`in e.props||`ref`in e}function So(e){return xo(e)?{...e.props}.ref||e.ref:null}function Co(e,t){let n={...e};for(let r in t){if(!lo(t,r))continue;if(r===`className`){let r=`className`;n[r]=e[r]?`${e[r]} ${t[r]}`:t[r];continue}if(r===`style`){let r=`style`;n[r]=e[r]?{...e[r],...t[r]}:t[r];continue}let i=t[r];if(typeof i==`function`&&r.startsWith(`on`)){let t=e[r];if(typeof t==`function`){n[r]=(...e)=>{i(...e),t(...e)};continue}}n[r]=i}return n}var wo=To();function To(){return typeof window<`u`&&!!window.document?.createElement}function Eo(e){return e?`self`in e?e.document:e.ownerDocument||document:document}function Do(e){return e?`self`in e?e.self:Eo(e).defaultView||window:self}function Oo(e,t=!1){let{activeElement:n}=Eo(e);if(!n?.nodeName)return null;if(ko(n)&&n.contentDocument?.body)return Oo(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Eo(n).getElementById(e);if(t)return t}}return n}function G(e,t){return e===t||e.contains(t)}function ko(e){return e.tagName===`IFRAME`}function Ao(e){let t=e.tagName.toLowerCase();return t===`button`?!0:t===`input`&&e.type?jo.indexOf(e.type)!==-1:!1}var jo=[`button`,`color`,`file`,`image`,`reset`,`submit`];function Mo(e){if(typeof e.checkVisibility==`function`)return e.checkVisibility();let t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}function No(e){try{let t=e instanceof HTMLInputElement&&e.selectionStart!==null,n=e.tagName===`TEXTAREA`;return t||n||!1}catch{return!1}}function Po(e){return e.isContentEditable||No(e)}function Fo(e){if(No(e))return e.value;if(e.isContentEditable){let t=Eo(e).createRange();return t.selectNodeContents(e),t.toString()}return``}function Io(e){let t=0,n=0;if(No(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){let r=Eo(e).getSelection();if(r?.rangeCount&&r.anchorNode&&G(e,r.anchorNode)&&r.focusNode&&G(e,r.focusNode)){let i=r.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(e),a.setEnd(i.startContainer,i.startOffset),t=a.toString().length,a.setEnd(i.endContainer,i.endOffset),n=a.toString().length}}return{start:t,end:n}}function Lo(e,t){let n=[`dialog`,`menu`,`listbox`,`tree`,`grid`],r=e?.getAttribute(`role`);return r&&n.indexOf(r)!==-1?r:t}function Ro(e){if(!e)return null;let t=e=>e===`auto`||e===`scroll`;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:n}=getComputedStyle(e);if(t(n))return e}return Ro(e.parentElement)||document.scrollingElement||document.body}function zo(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function Bo(e,t){let n=e.map((e,t)=>[t,e]),r=!1;return n.sort(([e,n],[i,a])=>{let o=t(n),s=t(a);return o===s||!o||!s?0:Vo(o,s)?(e>i&&(r=!0),-1):(et):e}function Vo(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Ho(){return wo&&!!navigator.maxTouchPoints}function Uo(){return wo?/mac|iphone|ipad|ipod/i.test(navigator.platform):!1}function Wo(){return wo&&Uo()&&/apple/i.test(navigator.vendor)}function Go(){return wo&&/firefox\//i.test(navigator.userAgent)}function Ko(){return wo&&navigator.platform.startsWith(`Mac`)&&!Ho()}function qo(e){return!!(e.currentTarget&&!G(e.currentTarget,e.target))}function Jo(e){return e.target===e.currentTarget}function Yo(e){let t=e.currentTarget;if(!t)return!1;let n=Uo();if(n&&!e.metaKey||!n&&!e.ctrlKey)return!1;let r=t.tagName.toLowerCase();return r===`a`||r===`button`&&t.type===`submit`||r===`input`&&t.type===`submit`}function Xo(e){let t=e.currentTarget;if(!t)return!1;let n=t.tagName.toLowerCase();return e.altKey?n===`a`||n===`button`&&t.type===`submit`||n===`input`&&t.type===`submit`:!1}function Zo(e,t){let n=new FocusEvent(`blur`,t),r=e.dispatchEvent(n),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent(`focusout`,i)),r}function Qo(e,t,n){let r=new KeyboardEvent(t,n);return e.dispatchEvent(r)}function $o(e,t){let n=new MouseEvent(`click`,t);return e.dispatchEvent(n)}function es(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!G(n,r)}function ts(e,t,n,r){let i=(e=>{if(r){let t=setTimeout(e,r);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),n()}),a=()=>{i(),n()};return e.addEventListener(t,a,{once:!0,capture:!0}),i}function ns(e,t,n,r=window){let i=[];try{r.document.addEventListener(e,t,n);for(let a of Array.from(r.frames))i.push(ns(e,t,n,a))}catch{}return()=>{try{r.document.removeEventListener(e,t,n)}catch{}for(let e of i)e()}}var rs={...R},is=rs.useId;rs.useDeferredValue;var as=rs.useInsertionEffect,K=wo?R.useLayoutEffect:R.useEffect;function os(e){let[t]=(0,R.useState)(e);return t}function ss(e){let t=(0,R.useRef)(e);return K(()=>{t.current=e}),t}function q(e){let t=(0,R.useRef)(()=>{throw Error(`Cannot call an event handler while rendering.`)});return as?as(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>t.current?.call(t,...e),[])}function cs(e){let[t,n]=(0,R.useState)(null);return K(()=>{if(t==null||!e)return;let n=null;return e(e=>(n=e,t)),()=>{e(n)}},[t,e]),[t,n]}function ls(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let n of e)bo(n,t)}},e)}function us(e){if(is){let t=is();return e||t}let[t,n]=(0,R.useState)(e);return K(()=>{e||t||n(`id-${Math.random().toString(36).slice(2,8)}`)},[e,t]),e||t}function ds(e,t){let n=e=>{if(typeof e==`string`)return e},[r,i]=(0,R.useState)(()=>n(t));return K(()=>{i((e&&`current`in e?e.current:e)?.tagName.toLowerCase()||n(t))},[e,t]),r}function fs(e,t,n){let r=os(n),[i,a]=(0,R.useState)(r);return(0,R.useEffect)(()=>{let n=e&&`current`in e?e.current:e;if(!n)return;let i=()=>{a(n.getAttribute(t)??r)},o=new MutationObserver(i);return o.observe(n,{attributeFilter:[t]}),i(),()=>o.disconnect()},[e,t,r]),i}function ps(e,t){let n=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(n.current)return e();n.current=!0},t),(0,R.useEffect)(()=>()=>{n.current=!1},[])}function ms(e,t){let n=(0,R.useRef)(!1);K(()=>{if(n.current)return e();n.current=!0},t),K(()=>()=>{n.current=!1},[])}function hs(){return(0,R.useReducer)(()=>[],[])}function gs(e){return q(typeof e==`function`?e:()=>e)}function _s(e,t,n=[]){let r=(0,R.useCallback)(n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n)),[...n,e.wrapElement]);return{...e,wrapElement:r}}function vs(e=!1,t){let[n,r]=(0,R.useState)(null);return{portalRef:ls(r,t),portalNode:n,domReady:!e||n}}function ys(e,t,n){let r=e.onLoadedMetadataCapture,i=(0,R.useMemo)(()=>Object.assign(()=>{},r,{[t]:n}),[r,t,n]);return[r?.[t],{onLoadedMetadataCapture:i}]}var bs=!1;function xs(){return(0,R.useEffect)(()=>{bs||=(ns(`mousemove`,Es,!0),ns(`mousedown`,Ds,!0),ns(`mouseup`,Ds,!0),ns(`keydown`,Ds,!0),ns(`scroll`,Ds,!0),!0)},[]),q(()=>Ss)}var Ss=!1,Cs=0,ws=0;function Ts(e){let t=e.movementX||e.screenX-Cs,n=e.movementY||e.screenY-ws;return Cs=e.screenX,ws=e.screenY,t||n||!1}function Es(e){Ts(e)&&(Ss=!0)}function Ds(){Ss=!1}function Os(e){let t=R.forwardRef((t,n)=>e({...t,ref:n}));return t.displayName=e.displayName||e.name,t}function ks(e,t){return R.memo(e,t)}function As(e,t){let{wrapElement:n,render:r,...i}=t,a=ls(t.ref,So(r)),o;if(R.isValidElement(r)){let e={...r.props,ref:a};o=R.cloneElement(r,Co(i,e))}else o=r?r(i):(0,B.jsx)(e,{...i});return n?n(o):o}function js(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function Ms(e=[],t=[]){let n=R.createContext(void 0),r=R.createContext(void 0),i=()=>R.useContext(n),a=(e=!1)=>{let t=R.useContext(r),n=i();return e?t:t||n},o=()=>{let e=R.useContext(r),t=i();if(!(e&&e===t))return t},s=t=>e.reduceRight((e,n)=>(0,B.jsx)(n,{...t,children:e}),(0,B.jsx)(n.Provider,{...t}));return{context:n,scopedContext:r,useContext:i,useScopedContext:a,useProviderContext:o,ContextProvider:s,ScopedContextProvider:e=>(0,B.jsx)(s,{...e,children:t.reduceRight((t,n)=>(0,B.jsx)(n,{...e,children:t}),(0,B.jsx)(r.Provider,{...e}))})}}var Ns=Ms(),Ps=Ns.useContext;Ns.useScopedContext,Ns.useProviderContext;var Fs=Ns.ContextProvider,Is=Ns.ScopedContextProvider,Ls=Ms([Fs],[Is]),Rs=Ls.useContext;Ls.useScopedContext;var zs=Ls.useProviderContext,Bs=Ls.ContextProvider,Vs=Ls.ScopedContextProvider,Hs=(0,R.createContext)(void 0),Us=(0,R.createContext)(void 0);function Ws(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function Gs(e,t){return t&&e.item(t)||null}function Ks(e){let t=[];for(let n of e){let e=t.find(e=>e[0]?.rowId===n.rowId);e?e.push(n):t.push([n])}return t}function qs(e,t=!1){if(No(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let n=Eo(e).getSelection();n?.selectAllChildren(e),t&&n?.collapseToEnd()}}var Js=Symbol(`FOCUS_SILENTLY`);function Ys(e){e[Js]=!0,e.focus({preventScroll:!0})}function Xs(e){let t=e[Js];return delete e[Js],t}function Zs(e,t,n){if(!t||t===n)return!1;let r=e.item(t.id);return!(!r||n&&r.element===n)}var Qs=`div`,$s=js(function({store:e,shouldRegisterItem:t=!0,getItem:n=mo,element:r,...i}){let a=Ps();e||=a;let o=us(i.id),s=(0,R.useRef)(r);return(0,R.useEffect)(()=>{let r=s.current;if(!o||!r||!t)return;let i=n({id:o,element:r});return e?.renderItem(i)},[o,t,n,e]),i={...i,ref:ls(s,i.ref)},yo(i)});Os(function(e){return As(Qs,$s(e))});var ec=(0,R.createContext)(!0),tc=`input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])`;function nc(e){return Number.parseInt(e.getAttribute(`tabindex`)||`0`,10)<0}function rc(e){return!(!e.matches(tc)||!Mo(e)||e.closest(`[inert]`))}function ic(e){if(!rc(e)||nc(e))return!1;if(!(`form`in e)||!e.form||e.checked||e.type!==`radio`)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!(`length`in t))return!0;let n=Oo(e);return!n||n===e||!(`form`in n)||n.form!==e.form||n.name!==e.name}function ac(e,t){let n=Array.from(e.querySelectorAll(tc));t&&n.unshift(e);let r=n.filter(rc);return r.forEach((e,t)=>{if(!ko(e))return;let n=e.contentDocument?.body;n&&r.splice(t,1,...ac(n))}),r}function oc(e,t,n){let r=Array.from(e.querySelectorAll(tc)),i=r.filter(ic);return t&&ic(e)&&i.unshift(e),i.forEach((e,t)=>{if(!ko(e))return;let r=e.contentDocument?.body;if(!r)return;let a=oc(r,!1,n);i.splice(t,1,...a)}),!i.length&&n?r:i}function sc(e,t,n){let[r]=oc(e,t,n);return r||null}function cc(e,t,n,r){let i=Oo(e),a=ac(e,t),o=a.indexOf(i),s=a.slice(o+1);return s.find(ic)||(n?a.find(ic):null)||(r?s[0]:null)||null}function lc(e,t){return cc(document.body,!1,e,t)}function uc(e,t,n,r){let i=Oo(e),a=ac(e,t).reverse(),o=a.indexOf(i),s=a.slice(o+1);return s.find(ic)||(n?a.find(ic):null)||(r?s[0]:null)||null}function dc(e,t){return uc(document.body,!1,e,t)}function fc(e){for(;e&&!rc(e);)e=e.closest(tc);return e||null}function pc(e){let t=Oo(e);if(!t)return!1;if(t===e)return!0;let n=t.getAttribute(`aria-activedescendant`);return n?n===e.id:!1}function mc(e){let t=Oo(e);if(!t)return!1;if(G(e,t))return!0;let n=t.getAttribute(`aria-activedescendant`);return!n||!(`id`in e)?!1:n===e.id?!0:!!e.querySelector(`#${CSS.escape(n)}`)}function hc(e){!mc(e)&&rc(e)&&e.focus()}function gc(e){let t=e.getAttribute(`tabindex`)??``;e.setAttribute(`data-tabindex`,t),e.setAttribute(`tabindex`,`-1`)}function _c(e,t){let n=oc(e,t);for(let e of n)gc(e)}function vc(e){let t=e.querySelectorAll(`[data-tabindex]`),n=e=>{let t=e.getAttribute(`data-tabindex`);e.removeAttribute(`data-tabindex`),t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)};e.hasAttribute(`data-tabindex`)&&n(e);for(let e of t)n(e)}function yc(e,t){`scrollIntoView`in e?(e.focus({preventScroll:!0}),e.scrollIntoView({block:`nearest`,inline:`nearest`,...t})):e.focus()}var bc=`div`,xc=Wo(),Sc=[`text`,`search`,`url`,`tel`,`email`,`password`,`number`,`date`,`month`,`week`,`time`,`datetime`,`datetime-local`],Cc=Symbol(`safariFocusAncestor`);function wc(e){return e?!!e[Cc]:!1}function Tc(e,t){e&&(e[Cc]=t)}function Ec(e){let{tagName:t,readOnly:n,type:r}=e;return t===`TEXTAREA`&&!n||t===`SELECT`&&!n?!0:t===`INPUT`&&!n?Sc.includes(r):!!(e.isContentEditable||e.getAttribute(`role`)===`combobox`&&e.dataset.name)}function Dc(e){return`labels`in e?e.labels:null}function Oc(e){return e.tagName.toLowerCase()===`input`&&e.type?e.type===`radio`||e.type===`checkbox`:!1}function kc(e){return e?e===`button`||e===`summary`||e===`input`||e===`select`||e===`textarea`||e===`a`:!0}function Ac(e){return e?e===`button`||e===`input`||e===`select`||e===`textarea`:!0}function jc(e,t,n,r,i){return e?t?n&&!r?-1:void 0:n?i:i||0:i}function Mc(e,t){return q(n=>{e?.(n),!n.defaultPrevented&&t&&(n.stopPropagation(),n.preventDefault())})}var Nc=!1,Pc=!0;function Fc(e){let t=e.target;t&&`hasAttribute`in t&&(t.hasAttribute(`data-focus-visible`)||(Pc=!1))}function Ic(e){e.metaKey||e.ctrlKey||e.altKey||(Pc=!0)}var Lc=js(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:n,onFocusVisible:r,...i}){let a=(0,R.useRef)(null);(0,R.useEffect)(()=>{e&&(Nc||=(ns(`mousedown`,Fc,!0),ns(`keydown`,Ic,!0),!0))},[e]),xc&&(0,R.useEffect)(()=>{if(!e)return;let t=a.current;if(!t||!Oc(t))return;let n=Dc(t);if(!n)return;let r=()=>queueMicrotask(()=>t.focus());for(let e of n)e.addEventListener(`mouseup`,r);return()=>{for(let e of n)e.removeEventListener(`mouseup`,r)}},[e]);let o=e&&vo(i),s=!!o&&!t,[c,l]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&s&&c&&l(!1)},[e,s,c]),(0,R.useEffect)(()=>{if(!e||!c)return;let t=a.current;if(!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(()=>{rc(t)||l(!1)});return n.observe(t),()=>n.disconnect()},[e,c]);let u=Mc(i.onKeyPressCapture,o),d=Mc(i.onMouseDownCapture,o),f=Mc(i.onClickCapture,o),p=i.onMouseDown,m=q(t=>{if(p?.(t),t.defaultPrevented||!e)return;let n=t.currentTarget;if(!xc||qo(t)||!Ao(n)&&!Oc(n))return;let r=!1,i=()=>{r=!0};n.addEventListener(`focusin`,i,{capture:!0,once:!0});let a=fc(n.parentElement);Tc(a,!0),ts(n,`mouseup`,()=>{n.removeEventListener(`focusin`,i,!0),Tc(a,!1),!r&&hc(n)})}),h=(t,n)=>{if(n&&(t.currentTarget=n),!e)return;let i=t.currentTarget;i&&pc(i)&&(r?.(t),!t.defaultPrevented&&(i.dataset.focusVisible=`true`,l(!0)))},g=i.onKeyDownCapture,_=q(t=>{if(g?.(t),t.defaultPrevented||!e||c||t.metaKey||t.altKey||t.ctrlKey||!Jo(t))return;let n=t.currentTarget;ts(n,`focusout`,()=>h(t,n))}),v=i.onFocusCapture,y=q(t=>{if(v?.(t),t.defaultPrevented||!e)return;if(!Jo(t)){l(!1);return}let n=t.currentTarget;Pc||Ec(t.target)?ts(t.target,`focusout`,()=>h(t,n)):l(!1)}),b=i.onBlur,x=q(t=>{b?.(t),e&&es(t)&&(t.currentTarget.removeAttribute(`data-focus-visible`),l(!1))}),S=(0,R.useContext)(ec),C=q(t=>{e&&n&&t&&S&&queueMicrotask(()=>{pc(t)||rc(t)&&t.focus()})}),w=ds(a),T=e&&kc(w),E=e&&Ac(w),D=i.style,O=(0,R.useMemo)(()=>s?{pointerEvents:`none`,...D}:D,[s,D]);return i={"data-focus-visible":e&&c||void 0,"data-autofocus":n||void 0,"aria-disabled":o||void 0,...i,ref:ls(a,C,i.ref),style:O,tabIndex:jc(e,s,T,E,i.tabIndex),disabled:E&&s?!0:void 0,contentEditable:o?void 0:i.contentEditable,onKeyPressCapture:u,onClickCapture:f,onMouseDownCapture:d,onMouseDown:m,onKeyDownCapture:_,onFocusCapture:y,onBlur:x},yo(i)});Os(function(e){return As(bc,Lc(e))});var Rc=`button`;function zc(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return e.key===`Enter`?Ao(t)||t.tagName===`SUMMARY`||t.tagName===`A`:e.key===` `?Ao(t)||t.tagName===`SUMMARY`||t.tagName===`INPUT`||t.tagName===`SELECT`:!1}var Bc=Symbol(`command`),Vc=js(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let r=(0,R.useRef)(null),[i,a]=(0,R.useState)(!1);(0,R.useEffect)(()=>{r.current&&a(Ao(r.current))},[]);let[o,s]=(0,R.useState)(!1),c=(0,R.useRef)(!1),l=vo(n),[u,d]=ys(n,Bc,!0),f=n.onKeyDown,p=q(n=>{f?.(n);let r=n.currentTarget;if(n.defaultPrevented||u||l||!Jo(n)||No(r)||r.isContentEditable)return;let i=e&&n.key===`Enter`,a=t&&n.key===` `,o=n.key===`Enter`&&!e,d=n.key===` `&&!t;if(o||d){n.preventDefault();return}if(i||a){let e=zc(n);if(i){if(!e){n.preventDefault();let{view:e,...t}=n,i=()=>$o(r,t);Go()?ts(r,`keyup`,i):queueMicrotask(i)}}else a&&(c.current=!0,e||(n.preventDefault(),s(!0)))}}),m=n.onKeyUp,h=q(e=>{if(m?.(e),e.defaultPrevented||u||l||e.metaKey)return;let n=t&&e.key===` `;if(c.current&&n&&(c.current=!1,!zc(e))){e.preventDefault(),s(!1);let t=e.currentTarget,{view:n,...r}=e;queueMicrotask(()=>$o(t,r))}});return n={"data-active":o||void 0,type:i?`button`:void 0,...d,...n,ref:ls(r,n.ref),onKeyDown:p,onKeyUp:h},n=Lc(n),n});Os(function(e){return As(Rc,Vc(e))});function Hc(e,t){let n=e.__unstableInternals;return ho(n,`Invalid store`),n[t]}function Uc(e,...t){let n=e,r=n,i=Symbol(),a=ao,o=new Set,s=new Set,c=new Set,l=new Set,u=new Set,d=new WeakMap,f=new WeakMap,p=e=>(c.add(e),()=>c.delete(e)),m=()=>{let e=o.size,r=Symbol();o.add(r);let i=()=>{o.delete(r),!o.size&&a()};if(e)return i;let s=go(n).map(e=>U(...t.map(t=>{let n=(t?.getState)?.call(t);if(n&&lo(n,e))return qc(t,[e],t=>{S(e,t[e],!0)})}))),l=[];for(let e of c)l.push(e());let u=t.map(Gc);return a=U(...s,...l,...u),i},h=(e,t,n=l)=>(n.add(t),f.set(t,e),()=>{var e;(e=d.get(t))==null||e(),d.delete(t),f.delete(t),n.delete(t)}),g=(e,t)=>h(e,t),_=(e,t)=>(d.set(t,t(n,n)),h(e,t)),v=(e,t)=>(d.set(t,t(n,r)),h(e,t,u)),y=e=>Uc(po(n,e),C),b=e=>Uc(fo(n,e),C),x=()=>n,S=(e,a,o=!1)=>{var c;if(!lo(n,e))return;let p=oo(a,n[e]);if(p===n[e])return;if(!o)for(let n of t)(c=n?.setState)==null||c.call(n,e,p);let m=n;n={...n,[e]:p};let h=Symbol();i=h,s.add(e);let g=(t,r,i)=>{var a;let o=f.get(t);(!o||o.some(t=>i?i.has(t):t===e))&&((a=d.get(t))==null||a(),d.set(t,t(n,r)))};for(let e of l)g(e,m);queueMicrotask(()=>{if(i!==h)return;let e=n;for(let e of u)g(e,r,s);r=e,s.clear()})},C={getState:x,setState:S,__unstableInternals:{setup:p,init:m,subscribe:g,sync:_,batch:v,pick:y,omit:b}};return C}function Wc(e,...t){if(e)return Hc(e,`setup`)(...t)}function Gc(e,...t){if(e)return Hc(e,`init`)(...t)}function Kc(e,...t){if(e)return Hc(e,`subscribe`)(...t)}function qc(e,...t){if(e)return Hc(e,`sync`)(...t)}function Jc(e,...t){if(e)return Hc(e,`batch`)(...t)}function Yc(e,...t){if(e)return Hc(e,`omit`)(...t)}function Xc(e,...t){if(e)return Hc(e,`pick`)(...t)}function Zc(...e){let t={};for(let n of e){let e=(n?.getState)?.call(n);e&&Object.assign(t,e)}let n=Uc(t,...e);return Object.assign({},...e,n)}var{useSyncExternalStore:Qc}=e(ee(),1).default,$c=()=>()=>{};function J(e,t=mo){let n=R.useCallback(t=>e?Kc(e,null,t):$c(),[e]),r=()=>{let n=typeof t==`string`?t:null,r=typeof t==`function`?t:null,i=e?.getState();if(r)return r(i);if(i&&n&&lo(i,n))return i[n]};return Qc(n,r,r)}function el(e,t){let n=R.useRef({}),r=R.useCallback(t=>e?Kc(e,null,t):$c(),[e]),i=()=>{let r=e?.getState(),i=!1,a=n.current;for(let e in t){let n=t[e];if(typeof n==`function`){let t=n(r);t!==a[e]&&(a[e]=t,i=!0)}if(typeof n==`string`){if(!r||!lo(r,n))continue;let t=r[n];t!==a[e]&&(a[e]=t,i=!0)}}return i&&(n.current={...a}),n.current};return Qc(r,i,i)}function tl(e,t,n,r){let i=lo(t,n)?t[n]:void 0,a=ss({value:i,setValue:r?t[r]:void 0});K(()=>qc(e,[n],(e,t)=>{let{value:r,setValue:i}=a.current;i&&e[n]!==t[n]&&e[n]!==r&&i(e[n])}),[e,n]),K(()=>{if(i!==void 0)return e.setState(n,i),Jc(e,[n],()=>{i!==void 0&&e.setState(n,i)})})}function nl(e,t){let[n,r]=R.useState(()=>e(t));K(()=>Gc(n),[n]);let i=R.useCallback(e=>J(n,e),[n]);return[R.useMemo(()=>({...n,useState:i}),[n,i]),q(()=>{r(n=>e({...t,...n.getState()}))})]}var rl=`button`;function il(e){return Po(e)?!0:e.tagName===`INPUT`&&!Ao(e)}function al(e,t=!1){let n=e.clientHeight,{top:r}=e.getBoundingClientRect(),i=Math.max(n*.875,n-40)*1.5,a=t?n-i+r:i+r;return e.tagName===`HTML`?a+e.scrollTop:a}function ol(e,t=!1){let{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function sl(e,t,n,r=!1){if(!t||!n)return;let{renderedItems:i}=t.getState(),a=Ro(e);if(!a)return;let o=al(a,r),s,c;for(let e=0;e=0){c!==void 0&&ce.rowId===m);return f.ariaPosInSet+t.findIndex(e=>e.id===u)},isTabbable(t){if(!t?.renderedItems.length)return!0;if(t.virtualFocus)return!1;if(i)return!0;if(t.activeId===null)return!1;let n=e?.item(t.activeId);return n?.disabled||!n?.element?!0:t.activeId===u}}),b=(0,R.useCallback)(e=>{let t={...e,id:u||e.id,rowId:m,disabled:!!p,children:e.element?.textContent};return a?a(t):t},[u,m,p,a]),x=c.onFocus,S=(0,R.useRef)(!1),C=q(t=>{if(x?.(t),t.defaultPrevented||qo(t)||!u||!e||cl(t,e))return;let{virtualFocus:n,baseElement:r}=e.getState();e.setActiveId(u),Po(t.currentTarget)&&qs(t.currentTarget),n&&Jo(t)&&(il(t.currentTarget)||r?.isConnected&&(Wo()&&t.currentTarget.hasAttribute(`data-autofocus`)&&t.currentTarget.scrollIntoView({block:`nearest`,inline:`nearest`}),S.current=!0,t.relatedTarget===r||Zs(e,t.relatedTarget)?Ys(r):r.focus()))}),w=c.onBlurCapture,T=q(t=>{w?.(t),!t.defaultPrevented&&e?.getState()?.virtualFocus&&S.current&&(S.current=!1,t.preventDefault(),t.stopPropagation())}),E=c.onKeyDown,D=gs(n),O=gs(r),k=q(t=>{if(E?.(t),t.defaultPrevented||!Jo(t)||!e)return;let{currentTarget:n}=t,r=e.getState(),i=!!e.item(u)?.rowId,a=r.orientation!==`horizontal`,o=r.orientation!==`vertical`,s=()=>!!(i||o||!r.baseElement||!No(r.baseElement)),c={ArrowUp:(i||a)&&e.up,ArrowRight:(i||o)&&e.next,ArrowDown:(i||a)&&e.down,ArrowLeft:(i||o)&&e.previous,Home:()=>{if(s())return!i||t.ctrlKey?e?.first():e?.previous(-1)},End:()=>{if(s())return!i||t.ctrlKey?e?.last():e?.next(-1)},PageUp:()=>sl(n,e,e?.up,!0),PageDown:()=>sl(n,e,e?.down)}[t.key];if(c){if(Po(n)){let e=Io(n),r=o&&t.key===`ArrowLeft`,i=o&&t.key===`ArrowRight`,s=a&&t.key===`ArrowUp`,c=a&&t.key===`ArrowDown`;if(i||c){let{length:t}=Fo(n);if(e.end!==t)return}else if((r||s)&&e.start!==0)return}let r=c();if(D(t)||r!==void 0){if(!O(t))return;t.preventDefault(),e.move(r)}}}),A=(0,R.useMemo)(()=>({id:u,baseElement:h}),[u,h]);return c=_s(c,e=>(0,B.jsx)(Hs.Provider,{value:A,children:e}),[A]),c={"data-active-item":g||void 0,...c,id:u,ref:ls(d,c.ref),tabIndex:y?c.tabIndex:-1,onFocus:C,onBlurCapture:T,onKeyDown:k},c=Vc(c),c=$s({store:e,...c,getItem:b,shouldRegisterItem:u?c.shouldRegisterItem:!1}),yo({...c,"aria-setsize":_,"aria-posinset":v})});ks(Os(function(e){return As(rl,ll(e))}));function ul(e){let t=[];for(let n of e)t.push(...n);return t}function dl(e){return e.slice().reverse()}var fl=`div`;function pl(e){return e.some(e=>!!e.rowId)}function ml(e){let t=e.target;return t&&!No(t)?!1:e.key.length===1&&!e.ctrlKey&&!e.metaKey}function hl(e){return e.key===`Shift`||e.key===`Control`||e.key===`Alt`||e.key===`Meta`}function gl(e,t,n){return q(r=>{if(t?.(r),r.defaultPrevented||r.isPropagationStopped()||!Jo(r)||hl(r)||ml(r))return;let i=Gs(e,e.getState().activeId)?.element;if(!i)return;let{view:a,...o}=r;i!==n?.current&&i.focus(),Qo(i,r.type,o)||r.preventDefault(),r.currentTarget.contains(i)&&r.stopPropagation()})}function _l(e){return Ws(ul(dl(Ks(e))))}function vl(e,t){let{virtualFocus:n,baseElement:r}=e.getState();if(!n||!r||!No(r)){t();return}let i=r.scrollLeft,a=r.scrollTop;t(),r.scrollLeft=i,r.scrollTop=a}function yl(e){let[t,n]=(0,R.useState)(!1),r=(0,R.useCallback)(()=>n(!0),[]),i=J(e,t=>Gs(e,t.activeId));return(0,R.useEffect)(()=>{let r=i?.element;t&&r&&(n(!1),vl(e,()=>{r.focus({preventScroll:!0})}))},[e,i,t]),r}var bl=js(function({store:e,composite:t=!0,focusOnMove:n=t,moveOnKeyPress:r=!0,...i}){let a=zs();e||=a,ho(e,!1);let o=(0,R.useRef)(null),s=(0,R.useRef)(null),c=yl(e),l=J(e,`moves`),[,u]=cs(t?e.setBaseElement:null);(0,R.useEffect)(()=>{if(!e||!l||!t||!n)return;let{activeId:r}=e.getState(),i=Gs(e,r)?.element;i&&vl(e,()=>yc(i))},[e,l,t,n]),K(()=>{if(!e||!l||!t)return;let{baseElement:n,activeId:r}=e.getState();if(r!==null||!n)return;let i=s.current;s.current=null,i&&Zo(i,{relatedTarget:n}),pc(n)||n.focus()},[e,l,t]);let d=J(e,`activeId`),f=J(e,`virtualFocus`);K(()=>{if(!e||!t||!f)return;let n=s.current;if(s.current=null,!n)return;let r=Gs(e,d)?.element||Oo(n);r!==n&&Zo(n,{relatedTarget:r})},[e,d,f,t]);let p=gl(e,i.onKeyDownCapture,s),m=gl(e,i.onKeyUpCapture,s),h=i.onFocusCapture,g=q(t=>{if(h?.(t),t.defaultPrevented||!e)return;let{virtualFocus:n}=e.getState();if(!n)return;let r=t.relatedTarget,i=Xs(t.currentTarget);Jo(t)&&i&&(t.stopPropagation(),s.current=r)}),_=i.onFocus,v=q(n=>{if(_?.(n),n.defaultPrevented||!t||!e)return;let{relatedTarget:r}=n,{virtualFocus:i}=e.getState();i?Jo(n)&&!Zs(e,r)&&queueMicrotask(c):Jo(n)&&e.setActiveId(null)}),y=i.onBlurCapture,b=q(t=>{if(y?.(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:r}=e.getState();if(!n)return;let i=Gs(e,r)?.element,a=t.relatedTarget,o=Zs(e,a),c=s.current;s.current=null,Jo(t)&&o?(a===i?c&&c!==a&&Zo(c,t):i?Zo(i,t):c&&Zo(c,t),t.stopPropagation()):!Zs(e,t.target)&&i&&Zo(i,t)}),x=i.onKeyDown,S=gs(r),C=q(t=>{if(x?.(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!Jo(t))return;let{orientation:n,renderedItems:r,activeId:i}=e.getState();if(Gs(e,i)?.element?.isConnected)return;let a=n!==`horizontal`,o=n!==`vertical`,s=pl(r);if((t.key===`ArrowLeft`||t.key===`ArrowRight`||t.key===`Home`||t.key===`End`)&&No(t.currentTarget))return;let c={ArrowUp:(s||a)&&(()=>s?_l(r)?.id:e?.last()),ArrowRight:(s||o)&&e.first,ArrowDown:(s||a)&&e.first,ArrowLeft:(s||o)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let n=c();if(n!==void 0){if(!S(t))return;t.preventDefault(),e.move(n)}}});i=_s(i,t=>(0,B.jsx)(Bs,{value:e,children:t}),[e]);let w=J(e,n=>{if(e&&t&&n.virtualFocus)return Gs(e,n.activeId)?.id});return i={"aria-activedescendant":w,...i,ref:ls(o,u,i.ref),onKeyDownCapture:p,onKeyUpCapture:m,onFocusCapture:g,onFocus:v,onBlurCapture:b,onKeyDown:C},i=Lc({focusable:J(e,e=>t&&(e.virtualFocus||e.activeId===null)),...i}),i});Os(function(e){return As(fl,bl(e))});var xl=Ms();xl.useContext,xl.useScopedContext;var Sl=xl.useProviderContext,Cl=xl.ContextProvider,wl=xl.ScopedContextProvider,Tl=Ms([Cl],[wl]);Tl.useContext,Tl.useScopedContext;var El=Tl.useProviderContext,Dl=Tl.ContextProvider,Ol=Tl.ScopedContextProvider,kl=(0,R.createContext)(void 0),Al=(0,R.createContext)(void 0),jl=`div`;function Ml(e,t){let n=setTimeout(t,e);return()=>clearTimeout(n)}function Nl(e){let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)}function Pl(...e){return e.join(`, `).split(`, `).reduce((e,t)=>{let n=t.endsWith(`ms`)?1:1e3,r=Number.parseFloat(t||`0s`)*n;return r>e?r:e},0)}function Fl(e,t,n){return!n&&t!==!1&&(!e||!!t)}var Y=js(function({store:e,alwaysVisible:t,...n}){let r=Sl();e||=r,ho(e,!1);let i=(0,R.useRef)(null),a=us(n.id),[o,s]=(0,R.useState)(null),c=J(e,`open`),l=J(e,`mounted`),u=J(e,`animated`),d=J(e,`contentElement`),f=J(e.disclosure,`contentElement`);K(()=>{i.current&&e?.setContentElement(i.current)},[e]),K(()=>{let t;return e?.setState(`animated`,e=>(t=e,!0)),()=>{t!==void 0&&e?.setState(`animated`,t)}},[e]),K(()=>{if(u){if(!d?.isConnected){s(null);return}return Nl(()=>{s(c?`enter`:l?`leave`:null)})}},[u,d,c,l]),K(()=>{if(!e||!u||!o||!d)return;let t=()=>e?.setState(`animating`,!1),n=()=>(0,ii.flushSync)(t);if(o===`leave`&&c||o===`enter`&&!c)return;if(typeof u==`number`)return Ml(u,n);let{transitionDuration:r,animationDuration:i,transitionDelay:a,animationDelay:s}=getComputedStyle(d),{transitionDuration:l=`0`,animationDuration:p=`0`,transitionDelay:m=`0`,animationDelay:h=`0`}=f?getComputedStyle(f):{},g=Pl(a,s,m,h)+Pl(r,i,l,p);if(!g){o===`enter`&&e.setState(`animated`,!1),t();return}return Ml(Math.max(g-1e3/60,0),n)},[e,u,d,f,c,o]),n=_s(n,t=>(0,B.jsx)(Ol,{value:e,children:t}),[e]);let p=Fl(l,n.hidden,t),m=n.style,h=(0,R.useMemo)(()=>p?{...m,display:`none`}:m,[p,m]);return n={"data-open":c||void 0,"data-enter":o===`enter`||void 0,"data-leave":o===`leave`||void 0,hidden:p,...n,id:a,ref:ls(a?e.setContentElement:null,i,n.ref),style:h},yo(n)}),Il=Os(function(e){return As(jl,Y(e))});Os(function({unmountOnHide:e,...t}){let n=Sl();return J(t.store||n,t=>!e||t?.mounted)===!1?null:(0,B.jsx)(Il,{...t})});function X(e={}){let t=Zc(e.store,Yc(e.disclosure,[`contentElement`,`disclosureElement`])),n=t?.getState(),r=W(e.open,n?.open,e.defaultOpen,!1),i=W(e.animated,n?.animated,!1),a=Uc({open:r,animated:i,animating:!!i&&r,mounted:r,contentElement:W(n?.contentElement,null),disclosureElement:W(n?.disclosureElement,null)},t);return Wc(a,()=>qc(a,[`animated`,`animating`],e=>{e.animated||a.setState(`animating`,!1)})),Wc(a,()=>Kc(a,[`open`],()=>{a.getState().animated&&a.setState(`animating`,!0)})),Wc(a,()=>qc(a,[`open`,`animating`],e=>{a.setState(`mounted`,e.open||e.animating)})),{...a,disclosure:e.disclosure,setOpen:e=>a.setState(`open`,e),show:()=>a.setState(`open`,!0),hide:()=>a.setState(`open`,!1),toggle:()=>a.setState(`open`,e=>!e),stopAnimation:()=>a.setState(`animating`,!1),setContentElement:e=>a.setState(`contentElement`,e),setDisclosureElement:e=>a.setState(`disclosureElement`,e)}}function Z(e,t,n){return ps(t,[n.store,n.disclosure]),tl(e,n,`open`,`setOpen`),tl(e,n,`mounted`,`setMounted`),tl(e,n,`animated`),Object.assign(e,{disclosure:n.disclosure})}function Ll(e={}){let[t,n]=nl(X,e);return Z(t,n,e)}var Rl=Ms([Dl],[Ol]);Rl.useContext,Rl.useScopedContext;var zl=Rl.useProviderContext,Bl=Rl.ContextProvider,Vl=Rl.ScopedContextProvider;function Hl(e){let t=e.find(e=>!!e.element),n=[...e].reverse().find(e=>!!e.element),r=t?.element?.parentElement;for(;r&&n?.element;){if(n&&r.contains(n.element))return r;r=r.parentElement}return Eo(r).body}function Ul(e){return e?.__unstablePrivateStore}function Wl(e={}){e.store;let t=e.store?.getState(),n=W(e.items,t?.items,e.defaultItems,[]),r=new Map(n.map(e=>[e.id,e])),i={items:n,renderedItems:W(t?.renderedItems,[])},a=Ul(e.store),o=Uc({items:n,renderedItems:i.renderedItems},a),s=Uc(i,e.store),c=e=>{let t=Bo(e,e=>e.element);o.setState(`renderedItems`,t),s.setState(`renderedItems`,t)};Wc(s,()=>Gc(o)),Wc(o,()=>Jc(o,[`items`],e=>{s.setState(`items`,e.items)})),Wc(o,()=>Jc(o,[`renderedItems`],e=>{let t=!0,n=requestAnimationFrame(()=>{let{renderedItems:t}=s.getState();e.renderedItems!==t&&c(e.renderedItems)});if(typeof IntersectionObserver!=`function`)return()=>cancelAnimationFrame(n);let r=()=>{if(t){t=!1;return}cancelAnimationFrame(n),n=requestAnimationFrame(()=>c(e.renderedItems))},i=Hl(e.renderedItems),a=new IntersectionObserver(r,{root:i});for(let t of e.renderedItems)t.element&&a.observe(t.element);return()=>{cancelAnimationFrame(n),a.disconnect()}}));let l=(e,t,n=!1)=>{let i;return t(t=>{let n=t.findIndex(({id:t})=>t===e.id),a=t.slice();if(n!==-1){i=t[n];let o={...i,...e};a[n]=o,r.set(e.id,o)}else a.push(e),r.set(e.id,e);return a}),()=>{t(t=>{if(!i)return n&&r.delete(e.id),t.filter(({id:t})=>t!==e.id);let a=t.findIndex(({id:t})=>t===e.id);if(a===-1)return t;let o=t.slice();return o[a]=i,r.set(e.id,i),o})}},u=e=>l(e,e=>o.setState(`items`,e),!0);return{...s,registerItem:u,renderItem:e=>U(u(e),l(e,e=>o.setState(`renderedItems`,e))),item:e=>{if(!e)return null;let t=r.get(e);if(!t){let{items:n}=o.getState();t=n.find(t=>t.id===e),t&&r.set(e,t)}return t||null},__unstablePrivateStore:o}}function Gl(e,t,n){return ps(t,[n.store]),tl(e,n,`items`,`setItems`),e}var Kl={id:null};function ql(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function Jl(e,t){return e.filter(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function Yl(e,t){return e.filter(e=>e.rowId===t)}function Xl(e,t,n=!1){let r=e.findIndex(e=>e.id===t);return[...e.slice(r+1),...n?[Kl]:[],...e.slice(0,r)]}function Zl(e){let t=[];for(let n of e){let e=t.find(e=>e[0]?.rowId===n.rowId);e?e.push(n):t.push([n])}return t}function Ql(e){let t=0;for(let{length:n}of e)n>t&&(t=n);return t}function $l(e){return{id:`__EMPTY_ITEM__`,disabled:!0,rowId:e}}function eu(e,t,n){let r=Ql(e);for(let i of e)for(let e=0;eqc(i,[`renderedItems`,`activeId`],e=>{i.setState(`activeId`,t=>t===void 0?ql(e.renderedItems)?.id:t)}));let a=(e=`next`,t={})=>{let n=i.getState(),{skip:r=0,activeId:a=n.activeId,focusShift:o=n.focusShift,focusLoop:s=n.focusLoop,focusWrap:c=n.focusWrap,includesBaseElement:l=n.includesBaseElement,renderedItems:u=n.renderedItems,rtl:d=n.rtl}=t,f=e===`up`||e===`down`,p=e===`next`||e===`down`,m=p?d&&!f:!d||f,h=o&&!r,g=f?ul(eu(Zl(u),a,h)):u;if(g=m?dl(g):g,g=f?tu(g):g,a==null)return ql(g)?.id;let _=g.find(e=>e.id===a);if(!_)return ql(g)?.id;let v=g.some(e=>e.rowId),y=g.indexOf(_),b=g.slice(y+1),x=Yl(b,_.rowId);if(r){let e=Jl(x,a);return(e.slice(r)[0]||e[e.length-1])?.id}let S=s&&(f?s!==`horizontal`:s!==`vertical`),C=v&&c&&(f?c!==`horizontal`:c!==`vertical`),w=p?(!v||f)&&S&&l:f?l:!1;if(S)return ql(Xl(C&&!w?g:Yl(g,_.rowId),a,w),a)?.id;if(C){let e=ql(w?x:b,a);return w?e?.id||null:e?.id}let T=ql(x,a);return!T&&w?null:T?.id};return{...n,...i,setBaseElement:e=>i.setState(`baseElement`,e),setActiveId:e=>i.setState(`activeId`,e),move:e=>{e!==void 0&&(i.setState(`activeId`,e),i.setState(`moves`,e=>e+1))},first:()=>ql(i.getState().renderedItems)?.id,last:()=>ql(dl(i.getState().renderedItems))?.id,next:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`next`,e)),previous:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`previous`,e)),down:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`down`,e)),up:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`up`,e))}}function ru(e){return{id:us(e.id),...e}}function iu(e,t,n){return e=Gl(e,t,n),tl(e,n,`activeId`,`setActiveId`),tl(e,n,`includesBaseElement`),tl(e,n,`virtualFocus`),tl(e,n,`orientation`),tl(e,n,`rtl`),tl(e,n,`focusLoop`),tl(e,n,`focusWrap`),tl(e,n,`focusShift`),e}var au=(0,R.createContext)(void 0),ou=Ms([Bl,Bs],[Vl,Vs]),su=ou.useContext,cu=ou.useScopedContext,lu=ou.useProviderContext,uu=ou.ContextProvider,du=ou.ScopedContextProvider,fu=(0,R.createContext)(void 0),pu=(0,R.createContext)(!1),mu=(0,R.createContext)(null),hu=`span`,gu=js(function(e){return e={...e,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:`1px`,...e.style}},e});Os(function(e){return As(hu,gu(e))});var _u=`span`,vu=js(function(e){return e={"data-focus-trap":``,tabIndex:0,"aria-hidden":!0,...e,style:{position:`fixed`,top:0,left:0,...e.style}},e=gu(e),e}),yu=Os(function(e){return As(_u,vu(e))}),bu=`div`;function xu(e){return Eo(e).body}function Su(e,t){return t?typeof t==`function`?t(e):t:Eo(e).createElement(`div`)}function Cu(e=`id`){return`${e?`${e}-`:``}${Math.random().toString(36).slice(2,8)}`}function wu(e){queueMicrotask(()=>{e?.focus()})}var Tu=js(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:n,portalRef:r,portal:i=!0,...a}){let o=(0,R.useRef)(null),s=ls(o,a.ref),c=(0,R.useContext)(mu),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),p=(0,R.useRef)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),g=(0,R.useRef)(null);return K(()=>{let e=o.current;if(!e||!i){u(null);return}let t=Su(e,n);if(!t){u(null);return}let a=t.isConnected;if(a||(c||xu(e)).appendChild(t),t.id||=e.id?`portal/${e.id}`:Cu(),u(t),bo(r,t),!a)return()=>{t.remove(),bo(r,null)}},[i,n,c,r]),K(()=>{if(!i||!e||!t)return;let n=Eo(t).createElement(`span`);return n.style.position=`fixed`,t.insertAdjacentElement(`afterend`,n),f(n),()=>{n.remove(),f(null)}},[i,e,t]),(0,R.useEffect)(()=>{if(!l||!e)return;let t=0,n=e=>{if(!es(e))return;let n=e.type===`focusin`;if(cancelAnimationFrame(t),n)return vc(l);t=requestAnimationFrame(()=>{_c(l,!0)})};return l.addEventListener(`focusin`,n,!0),l.addEventListener(`focusout`,n,!0),()=>{cancelAnimationFrame(t),l.removeEventListener(`focusin`,n,!0),l.removeEventListener(`focusout`,n,!0)}},[l,e]),a=_s(a,t=>{if(t=(0,B.jsx)(mu.Provider,{value:l||c,children:t}),!i)return t;if(!l)return(0,B.jsx)(`span`,{ref:s,id:a.id,style:{position:`fixed`},hidden:!0});t=(0,B.jsxs)(B.Fragment,{children:[e&&l&&(0,B.jsx)(yu,{ref:m,"data-focus-trap":a.id,className:`__focus-trap-inner-before`,onFocus:e=>{es(e,l)?wu(lc()):wu(p.current)}}),t,e&&l&&(0,B.jsx)(yu,{ref:h,"data-focus-trap":a.id,className:`__focus-trap-inner-after`,onFocus:e=>{es(e,l)?wu(dc()):wu(g.current)}})]}),l&&(t=(0,ii.createPortal)(t,l));let n=(0,B.jsxs)(B.Fragment,{children:[e&&l&&(0,B.jsx)(yu,{ref:p,"data-focus-trap":a.id,className:`__focus-trap-outer-before`,onFocus:e=>{e.relatedTarget!==g.current&&es(e,l)?wu(m.current):wu(dc())}}),e&&(0,B.jsx)(`span`,{"aria-owns":l?.id,style:{position:`fixed`}}),e&&l&&(0,B.jsx)(yu,{ref:g,"data-focus-trap":a.id,className:`__focus-trap-outer-after`,onFocus:e=>{if(es(e,l))wu(h.current);else{let e=lc();if(e===m.current){requestAnimationFrame(()=>lc()?.focus());return}wu(e)}}})]});return d&&e&&(n=(0,ii.createPortal)(n,d)),(0,B.jsxs)(B.Fragment,{children:[n,t]})},[l,c,i,a.id,e,d]),a={...a,ref:s},a});Os(function(e){return As(bu,Tu(e))});var Eu=(0,R.createContext)(0);function Du({level:e,children:t}){let n=(0,R.useContext)(Eu),r=Math.max(Math.min(e||n+1,6),1);return(0,B.jsx)(Eu.Provider,{value:r,children:t})}var Ou=`div`,ku=js(function({autoFocusOnShow:e=!0,...t}){return t=_s(t,t=>(0,B.jsx)(ec.Provider,{value:e,children:t}),[e]),t});Os(function(e){return As(Ou,ku(e))});function Au(e,t){let n=Eo(e).createElement(`button`);return n.type=`button`,n.tabIndex=-1,n.textContent=`Dismiss popup`,Object.assign(n.style,{border:`0px`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0px`,position:`absolute`,whiteSpace:`nowrap`,width:`1px`}),n.addEventListener(`click`,t),e.prepend(n),()=>{n.removeEventListener(`click`,t),n.remove()}}function ju(e){let t=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(!e){t.current=null;return}return ns(`mousedown`,e=>{t.current=e.target},!0)},[e]),t}var Mu=new WeakMap;function Nu(e,t,n){Mu.has(e)||Mu.set(e,new Map);let r=Mu.get(e),i=r.get(t);if(!i)return r.set(t,n()),()=>{var e;(e=r.get(t))==null||e(),r.delete(t)};let a=n(),o=()=>{a(),i(),r.delete(t)};return r.set(t,o),()=>{r.get(t)===o&&(a(),r.set(t,i))}}function Pu(e,t,n){return Nu(e,t,()=>{let r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r==null?e.removeAttribute(t):e.setAttribute(t,r)}})}function Fu(e,t,n){return Nu(e,t,()=>{let r=t in e,i=e[t];return e[t]=n,()=>{r?e[t]=i:delete e[t]}})}function Iu(e,t){return e?Nu(e,`style`,()=>{let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}):()=>{}}function Lu(e,t,n){return e?Nu(e,t,()=>{let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}):()=>{}}var Ru=[`SCRIPT`,`STYLE`];function zu(e){return`__ariakit-dialog-snapshot-${e}`}function Bu(e,t){let n=Eo(t),r=zu(e);if(!n.body[r])return!0;do{if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}while(!0)}function Vu(e,t,n){return Ru.includes(t.tagName)||!Bu(e,t)?!1:!n.some(e=>e&&G(t,e))}function Hu(e,t,n,r){for(let i of t){if(!i?.isConnected)continue;let a=t.some(e=>!e||e===i?!1:e.contains(i)),o=Eo(i),s=i;for(;i.parentElement&&i!==o.body;){if(r?.(i.parentElement,s),!a)for(let r of i.parentElement.children)Vu(e,r,t)&&n(r,s);i=i.parentElement}}}function Uu(e,t){let{body:n}=Eo(t[0]),r=[];return Hu(e,t,t=>{r.push(Fu(t,zu(e),!0))}),U(Fu(n,zu(e),!0),()=>{for(let e of r)e()})}function Wu(e,...t){if(!e)return!1;let n=e.getAttribute(`data-backdrop`);return n==null?!1:n===``||n===`true`||!t.length?!0:t.some(e=>n===e)}function Gu(e=``,t=!1){return`__ariakit-dialog-${t?`ancestor`:`outside`}${e?`-${e}`:``}`}function Ku(e,t=``){return U(Fu(e,Gu(),!0),Fu(e,Gu(t),!0))}function qu(e,t=``){return U(Fu(e,Gu(``,!0),!0),Fu(e,Gu(t,!0),!0))}function Ju(e,t){let n=Gu(t,!0);if(e[n])return!0;let r=Gu(t);do{if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}while(!0)}function Yu(e,t){let n=[],r=t.map(e=>e?.id);return Hu(e,t,t=>{Wu(t,...r)||n.unshift(Ku(t,e))},(t,r)=>{r.hasAttribute(`data-dialog`)&&r.id!==e||n.unshift(qu(t,e))}),()=>{for(let e of n)e()}}function Xu(e){return e.tagName===`HTML`?!0:G(Eo(e).body,e)}function Zu(e,t){if(!e)return!1;if(G(e,t))return!0;let n=t.getAttribute(`aria-activedescendant`);if(n){let t=Eo(e).getElementById(n);if(t)return G(e,t)}return!1}function Qu(e,t){if(!(`clientY`in e))return!1;let n=t.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}function $u({store:e,type:t,listener:n,capture:r,domReady:i}){let a=q(n),o=J(e,`open`),s=(0,R.useRef)(!1);K(()=>{if(!o||!i)return;let{contentElement:t}=e.getState();if(!t)return;let n=()=>{s.current=!0};return t.addEventListener(`focusin`,n,!0),()=>t.removeEventListener(`focusin`,n,!0)},[e,o,i]),(0,R.useEffect)(()=>o?ns(t,t=>{let{contentElement:n,disclosureElement:r}=e.getState(),i=t.target;n&&i&&Xu(i)&&(G(n,i)||Zu(r,i)||i.hasAttribute(`data-focus-trap`)||Qu(t,n)||s.current&&!Ju(i,n.id)||wc(i)||a(t))},r):void 0,[o,r,e,t,a])}function ed(e,t){return typeof e==`function`?e(t):!!e}function td(e,t,n){let r=ju(J(e,`open`)),i={store:e,domReady:n,capture:!0};$u({...i,type:`click`,listener:n=>{let{contentElement:i}=e.getState(),a=r.current;a&&Mo(a)&&Ju(a,i?.id)&&ed(t,n)&&e.hide()}}),$u({...i,type:`focusin`,listener:n=>{let{contentElement:r}=e.getState();r&&n.target!==Eo(r)&&ed(t,n)&&e.hide()}}),$u({...i,type:`contextmenu`,listener:n=>{ed(t,n)&&e.hide()}})}var nd=(0,R.createContext)({});function rd(e){let t=(0,R.useContext)(nd),[n,r]=(0,R.useState)([]),i=(0,R.useCallback)(e=>(r(t=>[...t,e]),U(t.add?.call(t,e),()=>{r(t=>t.filter(t=>t!==e))})),[t]);K(()=>qc(e,[`open`,`contentElement`],n=>{if(n.open&&n.contentElement)return t.add?.call(t,e)}),[e,t]);let a=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,B.jsx)(nd.Provider,{value:a,children:e}),[a]),nestedDialogs:n}}function id({attribute:e,contentId:t,contentElement:n,enabled:r}){let[i,a]=hs(),o=(0,R.useCallback)(()=>{if(!r||!n)return!1;let{body:i}=Eo(n),a=i.getAttribute(e);return!a||a===t},[i,r,n,e,t]);return(0,R.useEffect)(()=>{if(!r||!t||!n)return;let{body:i}=Eo(n);if(o())return i.setAttribute(e,t),()=>i.removeAttribute(e);let s=new MutationObserver(()=>(0,ii.flushSync)(a));return s.observe(i,{attributeFilter:[e]}),()=>s.disconnect()},[i,r,t,n,o,e]),o}function ad(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?`paddingLeft`:`paddingRight`}function od(e,t,n){let r=id({attribute:`data-dialog-prevent-body-scroll`,contentElement:e,contentId:t,enabled:n});(0,R.useEffect)(()=>{if(!r()||!e)return;let t=Eo(e),n=Do(e),{documentElement:i,body:a}=t,o=i.style.getPropertyValue(`--scrollbar-width`),s=o?Number.parseInt(o,10):n.innerWidth-i.clientWidth,c=()=>Lu(i,`--scrollbar-width`,`${s}px`),l=ad(i),u=()=>Iu(a,{overflow:`hidden`,[l]:`${s}px`}),d=()=>{let{scrollX:e,scrollY:t,visualViewport:r}=n,i=r?.offsetLeft??0,o=r?.offsetTop??0,c=Iu(a,{position:`fixed`,overflow:`hidden`,top:`${-(t-Math.floor(o))}px`,left:`${-(e-Math.floor(i))}px`,right:`0`,[l]:`${s}px`});return()=>{c(),n.scrollTo({left:e,top:t,behavior:`instant`})}},f=Uo()&&!Ko();return U(c(),f?d():u())},[r,e])}function sd(e,...t){if(!e)return!1;let n=e.getAttribute(`data-focus-trap`);return n==null?!1:t.length?n===``?!1:t.some(e=>n===e):!0}function cd(){return`inert`in HTMLElement.prototype}function ld(e){return Pu(e,`aria-hidden`,`true`)}function ud(e,t){return`style`in e?cd()?Fu(e,`inert`,!0):U(...oc(e,!0).map(e=>{if(t?.some(t=>t&&G(t,e)))return ao;let n=Nu(e,`focus`,()=>(e.focus=ao,()=>{delete e.focus}));return U(Pu(e,`tabindex`,`-1`),n)}),ld(e),Iu(e,{pointerEvents:`none`,userSelect:`none`,cursor:`default`})):ao}function dd(e,t){let n=[],r=t.map(e=>e?.id);return Hu(e,t,e=>{Wu(e,...r)||sd(e,...r)||n.unshift(ud(e,t))},e=>{e.hasAttribute(`role`)&&(t.some(t=>t&&G(t,e))||n.unshift(Pu(e,`role`,`none`)))}),()=>{for(let e of n)e()}}var fd=`div`,pd=`a.button.details.dialog.div.form.h1.h2.h3.h4.h5.h6.header.img.input.label.li.nav.ol.p.section.select.span.summary.textarea.ul.svg`.split(`.`);js(function(e){return e});var md=Os(function(e){return As(fd,e)});Object.assign(md,pd.reduce((e,t)=>(e[t]=Os(function(e){return As(t,e)}),e),{}));function hd({store:e,backdrop:t,alwaysVisible:n,hidden:r}){let i=(0,R.useRef)(null),a=Ll({disclosure:e}),o=J(e,`contentElement`);(0,R.useEffect)(()=>{let e=i.current,t=o;e&&t&&(e.style.zIndex=getComputedStyle(t).zIndex)},[o]),K(()=>{let e=o?.id;if(!e)return;let t=i.current;if(t)return qu(t,e)},[o]);let s=Y({ref:i,store:a,role:`presentation`,"data-backdrop":o?.id||``,alwaysVisible:n,hidden:r??void 0,style:{position:`fixed`,top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,B.jsx)(md,{...s,render:t});let c=typeof t==`boolean`?`div`:t;return(0,B.jsx)(md,{...s,render:(0,B.jsx)(c,{})})}function gd(e={}){return X(e)}function _d(e,t,n){return Z(e,t,n)}function vd(e={}){let[t,n]=nl(gd,e);return _d(t,n,e)}var yd=`div`,Q=Wo();function bd(e){let t=Oo();return!t||e&&G(e,t)?!1:!!rc(t)}function xd(e,t=!1){if(!e)return null;let n=`current`in e?e.current:e;return n?t?rc(n)?n:null:n:null}var Sd=js(function({store:e,open:t,onClose:n,focusable:r=!0,modal:i=!0,portal:a=!!i,backdrop:o=!!i,hideOnEscape:s=!0,hideOnInteractOutside:c=!0,getPersistentElements:l,preventBodyScroll:u=!!i,autoFocusOnShow:d=!0,autoFocusOnHide:f=!0,initialFocus:p,finalFocus:m,unmountOnHide:h,unstable_treeSnapshotKey:g,..._}){let v=El(),y=(0,R.useRef)(null),b=vd({store:e||v,open:t,setOpen(e){if(e)return;let t=y.current;if(!t)return;let r=new Event(`close`,{bubbles:!1,cancelable:!0});n&&t.addEventListener(`close`,n,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&b.setOpen(!0)}}),{portalRef:x,domReady:S}=vs(a,_.portalRef),C=_.preserveTabOrder,w=J(b,e=>C&&!i&&e.mounted),T=us(_.id),E=J(b,`open`),D=J(b,`mounted`),O=J(b,`contentElement`),k=Fl(D,_.hidden,_.alwaysVisible);od(O,T,u&&!k),td(b,c,S);let{wrapElement:A,nestedDialogs:j}=rd(b);_=_s(_,A,[A]),K(()=>{if(!E)return;let e=y.current,t=Oo(e,!0);t&&t.tagName!==`BODY`&&(e&&G(e,t)||b.setDisclosureElement(t))},[b,E]),Q&&(0,R.useEffect)(()=>{if(!D)return;let{disclosureElement:e}=b.getState();if(!e||!Ao(e))return;let t=()=>{let t=!1,n=()=>{t=!0};e.addEventListener(`focusin`,n,{capture:!0,once:!0}),ts(e,`mouseup`,()=>{e.removeEventListener(`focusin`,n,!0),!t&&hc(e)})};return e.addEventListener(`mousedown`,t),()=>{e.removeEventListener(`mousedown`,t)}},[b,D]),(0,R.useEffect)(()=>{if(!D||!S)return;let e=y.current;if(!e)return;let t=Do(e),n=t.visualViewport||t,r=()=>{let n=t.visualViewport?.height??t.innerHeight;e.style.setProperty(`--dialog-viewport-height`,`${n}px`)};return r(),n.addEventListener(`resize`,r),()=>{n.removeEventListener(`resize`,r)}},[D,S]),(0,R.useEffect)(()=>{if(!i||!D||!S)return;let e=y.current;if(e&&!e.querySelector(`[data-dialog-dismiss]`))return Au(e,b.hide)},[b,i,D,S]),K(()=>{if(!cd()||E||!D||!S)return;let e=y.current;if(e)return ud(e)},[E,D,S]);let M=E&&S;K(()=>{if(!T||!M)return;let e=y.current;return Uu(T,[e])},[T,M,g]);let ee=q(l);K(()=>{if(!T||!M)return;let{disclosureElement:e}=b.getState(),t=[y.current,...ee()||[],...j.map(e=>e.getState().contentElement)];return i?U(Yu(T,t),dd(T,t)):Yu(T,[e,...t])},[T,b,M,ee,j,i,g]);let te=!!d,N=gs(d),[P,ne]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!E||!te||!S||!O?.isConnected)return;let e=xd(p,!0)||O.querySelector(`[data-autofocus=true],[autofocus]`)||sc(O,!0,a&&w)||O,t=rc(e);N(t?e:null)&&(ne(!0),queueMicrotask(()=>{e.focus(),Q&&t&&e.scrollIntoView({block:`nearest`,inline:`nearest`})}))},[E,te,S,O,p,a,w,N]);let re=!!f,F=gs(f),[ie,ae]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(E)return ae(!0),()=>ae(!1)},[E]);let I=(0,R.useCallback)((e,t=!0)=>{let{disclosureElement:n}=b.getState();if(bd(e))return;let r=xd(m)||n;if(r?.id){let e=Eo(r),t=`[aria-activedescendant="${r.id}"]`,n=e.querySelector(t);n&&(r=n)}if(r&&!rc(r)){let e=r.closest(`[data-dialog]`);if(e?.id){let t=Eo(e),n=`[aria-controls~="${e.id}"]`,i=t.querySelector(n);i&&(r=i)}}let i=r&&rc(r);if(!i&&t){requestAnimationFrame(()=>I(e,!1));return}F(i?r:null)&&i&&r?.focus({preventScroll:!0})},[b,m,F]),oe=(0,R.useRef)(!1);K(()=>{if(E||!ie||!re)return;let e=y.current;oe.current=!0,I(e)},[E,ie,S,re,I]),(0,R.useEffect)(()=>{if(!ie||!re)return;let e=y.current;return()=>{if(oe.current){oe.current=!1;return}I(e)}},[ie,re,I]);let L=gs(s);(0,R.useEffect)(()=>!S||!D?void 0:ns(`keydown`,e=>{if(e.key!==`Escape`||e.defaultPrevented)return;let t=y.current;if(!t||Ju(t))return;let n=e.target;if(!n)return;let{disclosureElement:r}=b.getState();(n.tagName===`BODY`||G(t,n)||!r||G(r,n))&&L(e)&&b.hide()},!0),[b,S,D,L]),_=_s(_,e=>(0,B.jsx)(Du,{level:i?1:void 0,children:e}),[i]);let se=_.hidden,ce=_.alwaysVisible;_=_s(_,e=>o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(hd,{store:b,backdrop:o,hidden:se,alwaysVisible:ce}),e]}):e,[b,o,se,ce]);let[le,ue]=(0,R.useState)(),[de,fe]=(0,R.useState)();return _=_s(_,e=>(0,B.jsx)(Ol,{value:b,children:(0,B.jsx)(kl.Provider,{value:ue,children:(0,B.jsx)(Al.Provider,{value:fe,children:e})})}),[b]),_={"data-dialog":``,role:`dialog`,tabIndex:r?-1:void 0,"aria-labelledby":le,"aria-describedby":de,..._,id:T,ref:ls(y,_.ref)},_=ku({..._,autoFocusOnShow:P}),_=Y({store:b,..._}),_=Lc({..._,focusable:r}),_=Tu({portal:a,..._,portalRef:x,preserveTabOrder:w}),_});function Cd(e,t=El){return Os(function(n){let r=t();return J(n.store||r,e=>!n.unmountOnHide||e?.mounted||!!n.open)?(0,B.jsx)(e,{...n}):null})}Cd(Os(function(e){return As(yd,Sd(e))}),El);var wd=Math.min,Td=Math.max,Ed=Math.round,Dd=Math.floor,Od=e=>({x:e,y:e}),kd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ad(e,t,n){return Td(e,wd(t,n))}function jd(e,t){return typeof e==`function`?e(t):e}function Md(e){return e.split(`-`)[0]}function $(e){return e.split(`-`)[1]}function Nd(e){return e===`x`?`y`:`x`}function Pd(e){return e===`y`?`height`:`width`}function Fd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Id(e){return Nd(Fd(e))}function Ld(e,t,n){n===void 0&&(n=!1);let r=$(e),i=Id(e),a=Pd(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Kd(o)),[o,Kd(o)]}function Rd(e){let t=Kd(e);return[zd(e),t,zd(t)]}function zd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Bd=[`left`,`right`],Vd=[`right`,`left`],Hd=[`top`,`bottom`],Ud=[`bottom`,`top`];function Wd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Vd:Bd:t?Bd:Vd;case`left`:case`right`:return t?Hd:Ud;default:return[]}}function Gd(e,t,n,r){let i=$(e),a=Wd(Md(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(zd)))),a}function Kd(e){let t=Md(e);return kd[t]+e.slice(t.length)}function qd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:qd(e)}function Yd(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Xd(e,t,n){let{reference:r,floating:i}=e,a=Fd(t),o=Id(t),s=Pd(o),c=Md(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch($(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Zd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=jd(t,e),p=Jd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Yd(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Yd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Qd=50,$d=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Zd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Xd(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=jd(e,t)||{};if(l==null)return{};let d=Jd(u),f={x:n,y:r},p=Id(i),m=Pd(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=wd(d[_],T),D=wd(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Ad(O,A,k),M=!c.arrow&&$(i)!=null&&A!==j&&a.reference[m]/2-(Ae<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Fd(t))||T.every(e=>Fd(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Fd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},nf=new Set([`left`,`top`]);async function rf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Md(n),s=$(n),c=Fd(n)===`y`,l=nf.has(o)?-1:1,u=a&&c?-1:1,d=jd(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var af=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await rf(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},of=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=jd(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Fd(Md(i)),p=Nd(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ad(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ad(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},sf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=jd(e,t),u={x:n,y:r},d=Fd(i),f=Nd(d),p=u[f],m=u[d],h=jd(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=nf.has(Md(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},cf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=jd(e,t),u=await o.detectOverflow(t,l),d=Md(i),f=$(i),p=Fd(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=wd(h-u[g],v),x=wd(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Td(u.left,0),t=Td(u.right,0),n=Td(u.top,0),r=Td(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Td(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Td(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function lf(){return typeof window<`u`}function uf(e){return pf(e)?(e.nodeName||``).toLowerCase():`#document`}function df(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ff(e){return((pf(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function pf(e){return lf()?e instanceof Node||e instanceof df(e).Node:!1}function mf(e){return lf()?e instanceof Element||e instanceof df(e).Element:!1}function hf(e){return lf()?e instanceof HTMLElement||e instanceof df(e).HTMLElement:!1}function gf(e){return!lf()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof df(e).ShadowRoot}function _f(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Of(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function vf(e){return/^(table|td|th)$/.test(uf(e))}function yf(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var bf=/transform|translate|scale|rotate|perspective|filter/,xf=/paint|layout|strict|content/,Sf=e=>!!e&&e!==`none`,Cf;function wf(e){let t=mf(e)?Of(e):e;return Sf(t.transform)||Sf(t.translate)||Sf(t.scale)||Sf(t.rotate)||Sf(t.perspective)||!Ef()&&(Sf(t.backdropFilter)||Sf(t.filter))||bf.test(t.willChange||``)||xf.test(t.contain||``)}function Tf(e){let t=Af(e);for(;hf(t)&&!Df(t);){if(wf(t))return t;if(yf(t))return null;t=Af(t)}return null}function Ef(){return Cf??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Cf}function Df(e){return/^(html|body|#document)$/.test(uf(e))}function Of(e){return df(e).getComputedStyle(e)}function kf(e){return mf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Af(e){if(uf(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||gf(e)&&e.host||ff(e);return gf(t)?t.host:t}function jf(e){let t=Af(e);return Df(t)?e.ownerDocument?e.ownerDocument.body:e.body:hf(t)&&_f(t)?t:jf(t)}function Mf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=jf(e),i=r===e.ownerDocument?.body,a=df(r);if(i){let e=Nf(a);return t.concat(a,a.visualViewport||[],_f(r)?r:[],e&&n?Mf(e):[])}else return t.concat(r,Mf(r,[],n))}function Nf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pf(e){let t=Of(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=hf(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ed(n)!==a||Ed(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ff(e){return mf(e)?e:e.contextElement}function If(e){let t=Ff(e);if(!hf(t))return Od(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Pf(t),o=(a?Ed(n.width):n.width)/r,s=(a?Ed(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Lf=Od(0);function Rf(e){let t=df(e);return!Ef()||!t.visualViewport?Lf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==df(e)?!1:t}function Bf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ff(e),o=Od(1);t&&(r?mf(r)&&(o=If(r)):o=If(e));let s=zf(a,n,r)?Rf(a):Od(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=df(a),t=r&&mf(r)?df(r):r,n=e,i=Nf(n);for(;i&&r&&t!==n;){let e=If(i),t=i.getBoundingClientRect(),r=Of(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=df(i),i=Nf(n)}}return Yd({width:u,height:d,x:c,y:l})}function Vf(e,t){let n=kf(e).scrollLeft;return t?t.left+n:Bf(ff(e)).left+n}function Hf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Vf(e,n),y:n.top+t.scrollTop}}function Uf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ff(r),s=t?yf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Od(1),u=Od(0),d=hf(r);if((d||!d&&!a)&&((uf(r)!==`body`||_f(o))&&(c=kf(r)),d)){let e=Bf(r);l=If(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Hf(o,c):Od(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Wf(e){return Array.from(e.getClientRects())}function Gf(e){let t=ff(e),n=kf(e),r=e.ownerDocument.body,i=Td(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Td(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Vf(e),s=-n.scrollTop;return Of(r).direction===`rtl`&&(o+=Td(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Kf=25;function qf(e,t){let n=df(e),r=ff(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ef();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Vf(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Kf&&(a-=o)}else l<=Kf&&(a+=l);return{width:a,height:o,x:s,y:c}}function Jf(e,t){let n=Bf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=hf(e)?If(e):Od(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Yf(e,t,n){let r;if(t===`viewport`)r=qf(e,n);else if(t===`document`)r=Gf(ff(e));else if(mf(t))r=Jf(t,n);else{let n=Rf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yd(r)}function Xf(e,t){let n=Af(e);return n===t||!mf(n)||Df(n)?!1:Of(n).position===`fixed`||Xf(n,t)}function Zf(e,t){let n=t.get(e);if(n)return n;let r=Mf(e,[],!1).filter(e=>mf(e)&&uf(e)!==`body`),i=null,a=Of(e).position===`fixed`,o=a?Af(e):e;for(;mf(o)&&!Df(o);){let t=Of(o),n=wf(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||_f(o)&&!n&&Xf(e,o))?r=r.filter(e=>e!==o):i=t,o=Af(o)}return t.set(e,r),r}function Qf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?yf(t)?[]:Zf(t,this._c):[].concat(n),r],o=Yf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{o(!1,1e-7)},1e3)}n===1&&!sp(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lp(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ff(e),u=i||a?[...l?Mf(l):[],...t?Mf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cp(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Bf(e):null;c&&g();function g(){let t=Bf(e);h&&!sp(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var up=af,dp=of,fp=tf,pp=cf,mp=ef,hp=sf,gp=(e,t,n)=>{let r=new Map,i={platform:op,...n},a={...i.platform,_c:r};return $d(e,t,{...i,platform:a})},_p=`div`;function vp(e=0,t=0,n=0,r=0){if(typeof DOMRect==`function`)return new DOMRect(e,t,n,r);let i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...i,toJSON:()=>i}}function yp(e){if(!e)return vp();let{x:t,y:n,width:r,height:i}=e;return vp(t,n,r,i)}function bp(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?yp(r):n.getBoundingClientRect()}}}function xp(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function Sp(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}function Cp(e,t){return up(({placement:n})=>{let r=(e?.clientHeight||0)/2,i=typeof t.gutter==`number`?t.gutter+r:t.gutter??r;return{crossAxis:n.split(`-`)[1]?void 0:t.shift,mainAxis:i,alignmentAxis:t.shift}})}function wp(e){if(e.flip===!1)return;let t=typeof e.flip==`string`?e.flip.split(` `):void 0;return ho(!t||t.every(xp),!1),fp({padding:e.overflowPadding,fallbackPlacements:t})}function Tp(e){if(!(!e.slide&&!e.overlap))return dp({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:hp()})}function Ep(e){return pp({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:i}){let a=t.floating,o=Math.round(i.reference.width);n=Math.floor(n),r=Math.floor(r),a.style.setProperty(`--popover-anchor-width`,`${o}px`),a.style.setProperty(`--popover-available-width`,`${n}px`),a.style.setProperty(`--popover-available-height`,`${r}px`),e.sameWidth&&(a.style.width=`${o}px`),e.fitViewport&&(a.style.maxWidth=`${n}px`,a.style.maxHeight=`${r}px`)}})}function Dp(e,t){if(e)return mp({element:e,padding:t.arrowPadding})}var Op=js(function({store:e,modal:t=!1,portal:n=!!t,preserveTabOrder:r=!0,autoFocusOnShow:i=!0,wrapperProps:a,fixed:o=!1,flip:s=!0,shift:c=0,slide:l=!0,overlap:u=!1,sameWidth:d=!1,fitViewport:f=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:g,updatePosition:_,...v}){let y=zl();e||=y,ho(e,!1);let b=J(e,`arrowElement`),x=J(e,`anchorElement`),S=J(e,`disclosureElement`),C=J(e,`popoverElement`),w=J(e,`contentElement`),T=J(e,`placement`),E=J(e,`mounted`),D=J(e,`rendered`),O=(0,R.useRef)(null),[k,A]=(0,R.useState)(!1),{portalRef:j,domReady:M}=vs(n,v.portalRef),ee=q(g),te=q(_),N=!!_;K(()=>{if(!C?.isConnected)return;C.style.setProperty(`--popover-overflow-padding`,`${h}px`);let t=bp(x,ee),n=async()=>{if(!E)return;b||(O.current=O.current||document.createElement(`div`));let n=b||O.current,r=[Cp(n,{gutter:p,shift:c}),wp({flip:s,overflowPadding:h}),Tp({slide:l,shift:c,overlap:u,overflowPadding:h}),Dp(n,{arrowPadding:m}),Ep({sameWidth:d,fitViewport:f,overflowPadding:h})],i=await gp(t,C,{placement:T,strategy:o?`fixed`:`absolute`,middleware:r});e?.setState(`currentPlacement`,i.placement),A(!0);let a=Sp(i.x),g=Sp(i.y);if(Object.assign(C.style,{top:`0`,left:`0`,transform:`translate3d(${a}px,${g}px,0)`}),n&&i.middlewareData.arrow){let{x:e,y:t}=i.middlewareData.arrow,r=i.placement.split(`-`)[0],a=n.clientWidth/2,o=n.clientHeight/2,s=e==null?-a:e+a,c=t==null?-o:t+o;C.style.setProperty(`--popover-transform-origin`,{top:`${s}px calc(100% + ${o}px)`,bottom:`${s}px ${-o}px`,left:`calc(100% + ${a}px) ${c}px`,right:`${-a}px ${c}px`}[r]),Object.assign(n.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,[r]:`100%`})}},r=lp(t,C,async()=>{N?(await te({updatePosition:n}),A(!0)):await n()},{elementResize:typeof ResizeObserver==`function`});return()=>{A(!1),r()}},[e,D,C,b,x,C,T,E,M,o,s,c,l,u,d,f,p,m,h,ee,N,te]),K(()=>{if(!E||!M||!C?.isConnected||!w?.isConnected)return;let e=()=>{C.style.zIndex=getComputedStyle(w).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[E,M,C,w]);let P=o?`fixed`:`absolute`;return v=_s(v,t=>(0,B.jsx)(`div`,{...a,style:{position:P,top:0,left:0,width:`max-content`,...a?.style},ref:e?.setPopoverElement,children:t}),[e,P,a]),v=_s(v,t=>(0,B.jsx)(Vl,{value:e,children:t}),[e]),v={"data-placing":!k||void 0,...v,style:{position:`relative`,...v.style}},v=Sd({store:e,modal:t,portal:n,preserveTabOrder:r,preserveTabOrderAnchor:S||x,autoFocusOnShow:k&&i,...v,portalRef:j}),v});Cd(Os(function(e){return As(_p,Op(e))}),zl);function kp({popover:e,...t}={}){let n=Zc(t.store,Yc(e,[`arrowElement`,`anchorElement`,`contentElement`,`popoverElement`,`disclosureElement`])),r=n?.getState(),i=gd({...t,store:n}),a=W(t.placement,r?.placement,`bottom`),o=Uc({...i.getState(),placement:a,currentPlacement:a,anchorElement:W(r?.anchorElement,null),popoverElement:W(r?.popoverElement,null),arrowElement:W(r?.arrowElement,null),rendered:Symbol(`rendered`)},i,n);return{...i,...o,setAnchorElement:e=>o.setState(`anchorElement`,e),setPopoverElement:e=>o.setState(`popoverElement`,e),setArrowElement:e=>o.setState(`arrowElement`,e),render:()=>o.setState(`rendered`,Symbol(`rendered`))}}function Ap(e,t,n){return ps(t,[n.popover]),tl(e,n,`placement`),_d(e,t,n)}var jp=`div`,Mp=js(function({store:e,...t}){let n=zl();return e||=n,t={...t,ref:ls(e?.setAnchorElement,t.ref)},t});Os(function(e){return As(jp,Mp(e))});var Np=(0,R.createContext)(void 0),Pp=`div`,Fp=js(function(e){let[t,n]=(0,R.useState)();return e=_s(e,e=>(0,B.jsx)(Np.Provider,{value:n,children:e}),[]),e={role:`group`,"aria-labelledby":t,...e},yo(e)});Os(function(e){return As(Pp,Fp(e))});var Ip=`div`,Lp=js(function({store:e,...t}){return t=Fp(t),t});Os(function(e){return As(Ip,Lp(e))});var Rp=`div`,zp=js(function(e){let t=(0,R.useContext)(Np),n=us(e.id);return K(()=>(t?.(n),()=>t?.(void 0)),[t,n]),e={"aria-hidden":!0,...e,id:n},yo(e)});Os(function(e){return As(Rp,zp(e))});var Bp=`div`,Vp=js(function({store:e,...t}){return t=zp(t),t});Os(function(e){return As(Bp,Vp(e))});var Hp=`div`;function Up(e){let t=e.relatedTarget;return t?.nodeType===Node.ELEMENT_NODE?t:null}function Wp(e){let t=Up(e);return t?G(e.currentTarget,t):!1}var Gp=Symbol(`composite-hover`);function Kp(e){let t=Up(e);if(!t)return!1;do{if(lo(t,Gp)&&t[Gp])return!0;t=t.parentElement}while(t);return!1}var qp=js(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:n=!!t,...r}){let i=Rs();e||=i,ho(e,!1);let a=xs(),o=r.onMouseMove,s=gs(t),c=q(t=>{if(o?.(t),!t.defaultPrevented&&a()&&s(t)){if(!mc(t.currentTarget)){let t=e?.getState().baseElement;t&&!pc(t)&&t.focus()}e?.setActiveId(t.currentTarget.id)}}),l=r.onMouseLeave,u=gs(n),d=q(t=>{var n;l?.(t),!t.defaultPrevented&&a()&&(Wp(t)||Kp(t)||s(t)&&u(t)&&(e?.setActiveId(null),(n=e?.getState().baseElement)==null||n.focus()))}),f=(0,R.useCallback)(e=>{e&&(e[Gp]=!0)},[]);return r={...r,ref:ls(f,r.ref),onMouseMove:c,onMouseLeave:d},yo(r)});ks(Os(function(e){return As(Hp,qp(e))}));var Jp=`input`;function Yp(e,t,n){return n?e.find(e=>!e.disabled&&e.value)?.value===t:!1}function Xp(e,t){return!t||e==null?!1:(e=uo(e),t.length>e.length&&t.toLowerCase().indexOf(e.toLowerCase())===0)}function Zp(e){return e.type===`input`}function Qp(e){return e===`inline`||e===`list`||e===`both`||e===`none`}function $p(e){return e.find(e=>e.disabled?!1:e.element?.getAttribute(`role`)!==`tab`)?.id}var em=js(function({store:e,focusable:t=!0,autoSelect:n=!1,getAutoSelectId:r,setValueOnChange:i,showMinLength:a=0,showOnChange:o,showOnMouseDown:s,showOnClick:c=s,showOnKeyDown:l,showOnKeyPress:u=l,blurActiveItemOnClick:d,setValueOnClick:f=!0,moveOnKeyPress:p=!0,autoComplete:m=`list`,...h}){let g=lu();e||=g,ho(e,!1);let _=(0,R.useRef)(null),[v,y]=hs(),b=(0,R.useRef)(!1),x=(0,R.useRef)(!1),S=J(e,e=>e.virtualFocus&&n),C=m===`inline`||m===`both`,[w,T]=(0,R.useState)(C);ms(()=>{C&&T(!0)},[C]);let E=J(e,`value`),D=(0,R.useRef)(void 0);(0,R.useEffect)(()=>qc(e,[`selectedValue`,`activeId`],(e,t)=>{D.current=t.selectedValue}),[e]);let O=J(e,e=>{if(C&&w&&!(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||D.current?.includes(e.activeValue))))return e.activeValue}),k=J(e,`renderedItems`),A=J(e,`open`),j=J(e,`contentElement`),M=(0,R.useMemo)(()=>!C||!w?E:Yp(k,O,S)?Xp(E,O)?E+(O?.slice(E.length)||``):E:O||E,[C,w,k,O,S,E]);(0,R.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>T(!0);return e.addEventListener(`combobox-item-move`,t),()=>{e.removeEventListener(`combobox-item-move`,t)}},[]),(0,R.useEffect)(()=>{if(!C||!w||!O||!Yp(k,O,S)||!Xp(E,O))return;let e=ao;return queueMicrotask(()=>{let t=_.current;if(!t)return;let{start:n,end:r}=Io(t),i=E.length,a=O.length;zo(t,i,a),e=()=>{if(!pc(t))return;let{start:e,end:o}=Io(t);e===i&&o===a&&zo(t,n,r)}}),()=>e()},[v,C,w,O,k,S,E]);let ee=(0,R.useRef)(null),te=q(r),N=(0,R.useRef)(null),P=(0,R.useRef)(!1),ne=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(!A||!j)return;let t=Ro(j);if(!t)return;ee.current=t;let n=()=>{b.current=!1,P.current=!0},r=()=>{if(ne.current||(P.current=!0),!e||!b.current)return;let{activeId:t}=e.getState();t!==null&&t!==N.current&&(b.current=!1)},i={passive:!0,capture:!0};return t.addEventListener(`wheel`,n,i),t.addEventListener(`touchmove`,n,i),t.addEventListener(`scroll`,r,i),()=>{t.removeEventListener(`wheel`,n,!0),t.removeEventListener(`touchmove`,n,!0),t.removeEventListener(`scroll`,r,!0)}},[A,j,e]),K(()=>{P.current=!1,E&&(x.current||(b.current=!0))},[E]),K(()=>{S!==`always`&&A||(b.current=A)},[S,A]);let re=J(e,`resetValueOnSelect`);ps(()=>{let t=b.current;if(!e||!A||!t&&(!re||P.current))return;let{baseElement:n,contentElement:r,activeId:i}=e.getState();if(!(n&&!pc(n))){if(r?.hasAttribute(`data-placing`)){let e=new MutationObserver(y);return e.observe(r,{attributeFilter:[`data-placing`]}),()=>e.disconnect()}if(S&&t){let t=te(k),n=t===void 0?$p(k)??e.first():t;N.current=n,e.move(n??null)}else{let t=e.item(i||e.first())?.element;t&&`scrollIntoView`in t&&(ne.current=!0,t.scrollIntoView({block:`nearest`,inline:`nearest`}),requestAnimationFrame(()=>{ne.current=!1}))}}},[e,A,v,E,S,re,te,k]),(0,R.useEffect)(()=>{if(!C)return;let t=_.current;if(!t)return;let n=[t,j].filter(e=>!!e),r=t=>{n.every(e=>es(t,e))&&e?.setValue(M)};for(let e of n)e.addEventListener(`focusout`,r);return()=>{for(let e of n)e.removeEventListener(`focusout`,r)}},[C,j,e,M]);let F=e=>e.currentTarget.value.length>=a,ie=h.onChange,ae=gs(o??F),I=gs(i??!e.tag),oe=q(t=>{if(ie?.(t),t.defaultPrevented||!e)return;let n=t.currentTarget,{value:r,selectionStart:i,selectionEnd:a}=n,o=t.nativeEvent;if(b.current=!0,Zp(o)&&(o.isComposing&&(b.current=!1,x.current=!0),C)){let e=o.inputType===`insertText`||o.inputType===`insertCompositionText`,t=i===r.length;T(e&&t)}if(I(t)){let t=r===e.getState().value;e.setValue(r),queueMicrotask(()=>{zo(n,i,a)}),C&&S&&t&&y()}ae(t)&&e.show(),(!S||!b.current)&&e.setActiveId(null)}),L=h.onCompositionEnd,se=q(e=>{b.current=!0,x.current=!1,L?.(e),!e.defaultPrevented&&S&&y()}),ce=h.onMouseDown,le=gs(d??(()=>!!e?.getState().includesBaseElement)),ue=gs(f),de=gs(c??F),fe=q(t=>{ce?.(t),!t.defaultPrevented&&(t.button||t.ctrlKey||e&&(le(t)&&e.setActiveId(null),ue(t)&&e.setValue(M),de(t)&&ts(t.currentTarget,`mouseup`,e.show)))}),pe=h.onKeyDown,me=gs(u??F),he=q(t=>{if(pe?.(t),t.repeat||(b.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:n}=e.getState();n||(t.key===`ArrowUp`||t.key===`ArrowDown`)&&me(t)&&(t.preventDefault(),e.show())}),ge=h.onBlur,_e=q(e=>{b.current=!1,ge?.(e),e.defaultPrevented}),ve=us(h.id),ye=Qp(m)?m:void 0,be=J(e,e=>e.activeId===null);return h={role:`combobox`,"aria-autocomplete":ye,"aria-haspopup":Lo(j,`listbox`),"aria-expanded":A,"aria-controls":j?.id,"data-active-item":be||void 0,value:M,...h,id:ve,ref:ls(_,h.ref),onChange:oe,onCompositionEnd:se,onMouseDown:fe,onKeyDown:he,onBlur:_e},h=bl({store:e,focusable:t,...h,moveOnKeyPress:e=>_o(p,e)?!1:(C&&T(!0),!0)}),h=Mp({store:e,...h}),{autoComplete:`off`,...h}}),tm=Os(function(e){return As(Jp,em(e))}),nm=`div`,rm=js(function({store:e,...t}){let n=cu();return e||=n,ho(e,!1),Lo(J(e,`contentElement`))===`grid`&&(t={role:`rowgroup`,...t}),t=Lp({store:e,...t}),t}),im=Os(function(e){return As(nm,rm(e))}),am=`div`,om=js(function(e){return e=Vp(e),e}),sm=Os(function(e){return As(am,om(e))}),cm=`div`;function lm(e,t){if(t!=null)return e==null?!1:Array.isArray(e)?e.includes(t):e===t}function um(e){return{menu:`menuitem`,listbox:`option`,tree:`treeitem`}[e]??`option`}var dm=js(function({store:e,value:t,hideOnClick:n,setValueOnClick:r,selectValueOnClick:i=!0,resetValueOnSelect:a,focusOnHover:o=!1,moveOnKeyPress:s=!0,getItem:c,...l}){let u=cu();e||=u,ho(e,!1);let{resetValueOnSelectState:d,multiSelectable:f,selected:p}=el(e,{resetValueOnSelectState:`resetValueOnSelect`,multiSelectable(e){return Array.isArray(e.selectedValue)},selected(e){return lm(e.selectedValue,t)}}),m=(0,R.useCallback)(e=>{let n={...e,value:t};return c?c(n):n},[t,c]);r??=!f,n??=t!=null&&!f;let h=l.onClick,g=gs(r),_=gs(i),v=gs(a??d??f),y=gs(n),b=q(n=>{h?.(n),!n.defaultPrevented&&(Xo(n)||Yo(n)||(t!=null&&(_(n)&&(v(n)&&e?.resetValue(),e?.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),g(n)&&e?.setValue(t)),y(n)&&e?.hide()))}),x=l.onKeyDown,S=q(t=>{if(x?.(t),t.defaultPrevented)return;let n=e?.getState().baseElement;n&&(pc(n)||(t.key.length===1||t.key===`Backspace`||t.key===`Delete`)&&(queueMicrotask(()=>n.focus()),No(n)&&e?.setValue(n.value)))});f&&p!=null&&(l={"aria-selected":p,...l}),l=_s(l,e=>(0,B.jsx)(fu.Provider,{value:t,children:(0,B.jsx)(pu.Provider,{value:p??!1,children:e})}),[t,p]),l={role:um((0,R.useContext)(au)),children:t,...l,onClick:b,onKeyDown:S};let C=gs(s);return l=ll({store:e,...l,getItem:m,moveOnKeyPress:t=>{if(!C(t))return!1;let n=new Event(`combobox-item-move`);return(e?.getState().baseElement)?.dispatchEvent(n),!0}}),l=qp({store:e,focusOnHover:o,...l}),l}),fm=ks(Os(function(e){return As(cm,dm(e))})),pm=`div`,mm=js(function({store:e,alwaysVisible:t,...n}){let r=cu(!0),i=su();e||=i;let a=!!e&&e===r;ho(e,!1);let o=(0,R.useRef)(null),s=us(n.id),c=J(e,`mounted`),l=Fl(c,n.hidden,t),u=l?{...n.style,display:`none`}:n.style,d=J(e,e=>Array.isArray(e.selectedValue)),f=fs(o,`role`,n.role),p=(f===`listbox`||f===`tree`||f===`grid`)&&d||void 0,[m,h]=(0,R.useState)(!1),g=J(e,`contentElement`);K(()=>{if(!c)return;let e=o.current;if(!e||g!==e)return;let t=()=>{h(!!e.querySelector(`[role='listbox']`))},n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributeFilter:[`role`]}),t(),()=>n.disconnect()},[c,g]),m||(n={role:`listbox`,"aria-multiselectable":p,...n}),n=_s(n,t=>(0,B.jsx)(du,{value:e,children:(0,B.jsx)(au.Provider,{value:f,children:t})}),[e,f]);let _=s&&(!r||!a)?e.setContentElement:null;return n={hidden:l,...n,id:s,ref:ls(_,o,n.ref),style:u},yo(n)}),hm=Os(function(e){return As(pm,mm(e))}),gm=`div`;function _m(e,...t){if(!e)return!1;if(`id`in e){let n=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(`, `);return n?e.matches(n):!1}return!1}var vm=js(function({store:e,modal:t,tabIndex:n,alwaysVisible:r,autoFocusOnHide:i=!0,hideOnInteractOutside:a=!0,...o}){let s=lu();e||=s,ho(e,!1);let c=J(e,`baseElement`),l=(0,R.useRef)(!1),u=J(e.tag,e=>e?.renderedItems.length);return o=mm({store:e,alwaysVisible:r,...o}),o=Op({store:e,modal:t,alwaysVisible:r,backdrop:!1,autoFocusOnShow:!1,finalFocus:c,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:u,...o,getPersistentElements(){let n=o.getPersistentElements?.call(o)||[];if(!t||!e)return n;let{contentElement:r,baseElement:i}=e.getState();if(!i)return n;let a=Eo(i),s=[];if(r?.id&&s.push(`[aria-controls~="${r.id}"]`),i?.id&&s.push(`[aria-controls~="${i.id}"]`),!s.length)return[...n,i];let c=s.join(`,`),l=a.querySelectorAll(c);return[...n,...l]},autoFocusOnHide(e){return _o(i,e)?!1:l.current?(l.current=!1,!1):!0},hideOnInteractOutside(t){let n=e?.getState(),r=n?.contentElement?.id,i=n?.baseElement?.id;if(_m(t.target,r,i))return!1;let o=typeof a==`function`?a(t):a;return o&&(l.current=t.type===`click`),o}}),o}),ym=Cd(Os(function(e){return As(gm,vm(e))}),lu);(0,R.createContext)(null),(0,R.createContext)(null);var bm=Ms([Bs],[Vs]),xm=bm.useContext;bm.useScopedContext,bm.useProviderContext,bm.ContextProvider,bm.ScopedContextProvider;var Sm=Wo()&&Ho();function Cm({tag:e,...t}={}){let n=Zc(t.store,Xc(e,[`value`,`rtl`])),r=e?.getState(),i=n?.getState(),a=W(t.activeId,i?.activeId,t.defaultActiveId,null),o=nu({...t,activeId:a,includesBaseElement:W(t.includesBaseElement,i?.includesBaseElement,!0),orientation:W(t.orientation,i?.orientation,`vertical`),focusLoop:W(t.focusLoop,i?.focusLoop,!0),focusWrap:W(t.focusWrap,i?.focusWrap,!0),virtualFocus:W(t.virtualFocus,i?.virtualFocus,!0)}),s=kp({...t,placement:W(t.placement,i?.placement,`bottom-start`)}),c=W(t.value,i?.value,t.defaultValue,``),l=W(t.selectedValue,i?.selectedValue,r?.values,t.defaultSelectedValue,``),u=Array.isArray(l),d={...o.getState(),...s.getState(),value:c,selectedValue:l,resetValueOnSelect:W(t.resetValueOnSelect,i?.resetValueOnSelect,u),resetValueOnHide:W(t.resetValueOnHide,i?.resetValueOnHide,u&&!e),activeValue:i?.activeValue},f=Uc(d,o,s,n);return Sm&&Wc(f,()=>qc(f,[`virtualFocus`],()=>{f.setState(`virtualFocus`,!1)})),Wc(f,()=>{if(e)return U(qc(f,[`selectedValue`],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),qc(e,[`values`],e=>{f.setState(`selectedValue`,e.values)}))}),Wc(f,()=>qc(f,[`resetValueOnHide`,`mounted`],e=>{e.resetValueOnHide&&(e.mounted||f.setState(`value`,c))})),Wc(f,()=>qc(f,[`open`],e=>{e.open||(f.setState(`activeId`,a),f.setState(`moves`,0))})),Wc(f,()=>qc(f,[`moves`,`activeId`],(e,t)=>{e.moves===t.moves&&f.setState(`activeValue`,void 0)})),Wc(f,()=>Jc(f,[`moves`,`renderedItems`],(e,t)=>{if(e.moves===t.moves)return;let{activeId:n}=f.getState(),r=o.item(n);f.setState(`activeValue`,r?.value)})),{...s,...o,...f,tag:e,setValue:e=>f.setState(`value`,e),resetValue:()=>f.setState(`value`,d.value),setSelectedValue:e=>f.setState(`selectedValue`,e)}}function wm(e){let t=xm();return e={...e,tag:e.tag===void 0?t:e.tag},ru(e)}function Tm(e,t,n){return ps(t,[n.tag]),tl(e,n,`value`,`setValue`),tl(e,n,`selectedValue`,`setSelectedValue`),tl(e,n,`resetValueOnHide`),tl(e,n,`resetValueOnSelect`),Object.assign(iu(Ap(e,t,n),t,n),{tag:n.tag})}function Em(e={}){e=wm(e);let[t,n]=nl(Cm,e);return Tm(t,n,e)}function Dm(e={}){return(0,B.jsx)(uu,{value:Em(e),children:e.children})}var Om=e(t(((e,t)=>{var n={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,Ấ:`A`,Ắ:`A`,Ẳ:`A`,Ẵ:`A`,Ặ:`A`,Æ:`AE`,Ầ:`A`,Ằ:`A`,Ȃ:`A`,Ả:`A`,Ạ:`A`,Ẩ:`A`,Ẫ:`A`,Ậ:`A`,Ç:`C`,Ḉ:`C`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,Ế:`E`,Ḗ:`E`,Ề:`E`,Ḕ:`E`,Ḝ:`E`,Ȇ:`E`,Ẻ:`E`,Ẽ:`E`,Ẹ:`E`,Ể:`E`,Ễ:`E`,Ệ:`E`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,Ḯ:`I`,Ȋ:`I`,Ỉ:`I`,Ị:`I`,Ð:`D`,Ñ:`N`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,Ố:`O`,Ṍ:`O`,Ṓ:`O`,Ȏ:`O`,Ỏ:`O`,Ọ:`O`,Ổ:`O`,Ỗ:`O`,Ộ:`O`,Ờ:`O`,Ở:`O`,Ỡ:`O`,Ớ:`O`,Ợ:`O`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,Ủ:`U`,Ụ:`U`,Ử:`U`,Ữ:`U`,Ự:`U`,Ý:`Y`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,ấ:`a`,ắ:`a`,ẳ:`a`,ẵ:`a`,ặ:`a`,æ:`ae`,ầ:`a`,ằ:`a`,ȃ:`a`,ả:`a`,ạ:`a`,ẩ:`a`,ẫ:`a`,ậ:`a`,ç:`c`,ḉ:`c`,è:`e`,é:`e`,ê:`e`,ë:`e`,ế:`e`,ḗ:`e`,ề:`e`,ḕ:`e`,ḝ:`e`,ȇ:`e`,ẻ:`e`,ẽ:`e`,ẹ:`e`,ể:`e`,ễ:`e`,ệ:`e`,ì:`i`,í:`i`,î:`i`,ï:`i`,ḯ:`i`,ȋ:`i`,ỉ:`i`,ị:`i`,ð:`d`,ñ:`n`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,ố:`o`,ṍ:`o`,ṓ:`o`,ȏ:`o`,ỏ:`o`,ọ:`o`,ổ:`o`,ỗ:`o`,ộ:`o`,ờ:`o`,ở:`o`,ỡ:`o`,ớ:`o`,ợ:`o`,ù:`u`,ú:`u`,û:`u`,ü:`u`,ủ:`u`,ụ:`u`,ử:`u`,ữ:`u`,ự:`u`,ý:`y`,ÿ:`y`,Ā:`A`,ā:`a`,Ă:`A`,ă:`a`,Ą:`A`,ą:`a`,Ć:`C`,ć:`c`,Ĉ:`C`,ĉ:`c`,Ċ:`C`,ċ:`c`,Č:`C`,č:`c`,C̆:`C`,c̆:`c`,Ď:`D`,ď:`d`,Đ:`D`,đ:`d`,Ē:`E`,ē:`e`,Ĕ:`E`,ĕ:`e`,Ė:`E`,ė:`e`,Ę:`E`,ę:`e`,Ě:`E`,ě:`e`,Ĝ:`G`,Ǵ:`G`,ĝ:`g`,ǵ:`g`,Ğ:`G`,ğ:`g`,Ġ:`G`,ġ:`g`,Ģ:`G`,ģ:`g`,Ĥ:`H`,ĥ:`h`,Ħ:`H`,ħ:`h`,Ḫ:`H`,ḫ:`h`,Ĩ:`I`,ĩ:`i`,Ī:`I`,ī:`i`,Ĭ:`I`,ĭ:`i`,Į:`I`,į:`i`,İ:`I`,ı:`i`,IJ:`IJ`,ij:`ij`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,Ḱ:`K`,ḱ:`k`,K̆:`K`,k̆:`k`,Ĺ:`L`,ĺ:`l`,Ļ:`L`,ļ:`l`,Ľ:`L`,ľ:`l`,Ŀ:`L`,ŀ:`l`,Ł:`l`,ł:`l`,Ḿ:`M`,ḿ:`m`,M̆:`M`,m̆:`m`,Ń:`N`,ń:`n`,Ņ:`N`,ņ:`n`,Ň:`N`,ň:`n`,ʼn:`n`,N̆:`N`,n̆:`n`,Ō:`O`,ō:`o`,Ŏ:`O`,ŏ:`o`,Ő:`O`,ő:`o`,Œ:`OE`,œ:`oe`,P̆:`P`,p̆:`p`,Ŕ:`R`,ŕ:`r`,Ŗ:`R`,ŗ:`r`,Ř:`R`,ř:`r`,R̆:`R`,r̆:`r`,Ȓ:`R`,ȓ:`r`,Ś:`S`,ś:`s`,Ŝ:`S`,ŝ:`s`,Ş:`S`,Ș:`S`,ș:`s`,ş:`s`,Š:`S`,š:`s`,Ţ:`T`,ţ:`t`,ț:`t`,Ț:`T`,Ť:`T`,ť:`t`,Ŧ:`T`,ŧ:`t`,T̆:`T`,t̆:`t`,Ũ:`U`,ũ:`u`,Ū:`U`,ū:`u`,Ŭ:`U`,ŭ:`u`,Ů:`U`,ů:`u`,Ű:`U`,ű:`u`,Ų:`U`,ų:`u`,Ȗ:`U`,ȗ:`u`,V̆:`V`,v̆:`v`,Ŵ:`W`,ŵ:`w`,Ẃ:`W`,ẃ:`w`,X̆:`X`,x̆:`x`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Y̆:`Y`,y̆:`y`,Ź:`Z`,ź:`z`,Ż:`Z`,ż:`z`,Ž:`Z`,ž:`z`,ſ:`s`,ƒ:`f`,Ơ:`O`,ơ:`o`,Ư:`U`,ư:`u`,Ǎ:`A`,ǎ:`a`,Ǐ:`I`,ǐ:`i`,Ǒ:`O`,ǒ:`o`,Ǔ:`U`,ǔ:`u`,Ǖ:`U`,ǖ:`u`,Ǘ:`U`,ǘ:`u`,Ǚ:`U`,ǚ:`u`,Ǜ:`U`,ǜ:`u`,Ứ:`U`,ứ:`u`,Ṹ:`U`,ṹ:`u`,Ǻ:`A`,ǻ:`a`,Ǽ:`AE`,ǽ:`ae`,Ǿ:`O`,ǿ:`o`,Þ:`TH`,þ:`th`,Ṕ:`P`,ṕ:`p`,Ṥ:`S`,ṥ:`s`,X́:`X`,x́:`x`,Ѓ:`Г`,ѓ:`г`,Ќ:`К`,ќ:`к`,A̋:`A`,a̋:`a`,E̋:`E`,e̋:`e`,I̋:`I`,i̋:`i`,Ǹ:`N`,ǹ:`n`,Ồ:`O`,ồ:`o`,Ṑ:`O`,ṑ:`o`,Ừ:`U`,ừ:`u`,Ẁ:`W`,ẁ:`w`,Ỳ:`Y`,ỳ:`y`,Ȁ:`A`,ȁ:`a`,Ȅ:`E`,ȅ:`e`,Ȉ:`I`,ȉ:`i`,Ȍ:`O`,ȍ:`o`,Ȑ:`R`,ȑ:`r`,Ȕ:`U`,ȕ:`u`,B̌:`B`,b̌:`b`,Č̣:`C`,č̣:`c`,Ê̌:`E`,ê̌:`e`,F̌:`F`,f̌:`f`,Ǧ:`G`,ǧ:`g`,Ȟ:`H`,ȟ:`h`,J̌:`J`,ǰ:`j`,Ǩ:`K`,ǩ:`k`,M̌:`M`,m̌:`m`,P̌:`P`,p̌:`p`,Q̌:`Q`,q̌:`q`,Ř̩:`R`,ř̩:`r`,Ṧ:`S`,ṧ:`s`,V̌:`V`,v̌:`v`,W̌:`W`,w̌:`w`,X̌:`X`,x̌:`x`,Y̌:`Y`,y̌:`y`,A̧:`A`,a̧:`a`,B̧:`B`,b̧:`b`,Ḑ:`D`,ḑ:`d`,Ȩ:`E`,ȩ:`e`,Ɛ̧:`E`,ɛ̧:`e`,Ḩ:`H`,ḩ:`h`,I̧:`I`,i̧:`i`,Ɨ̧:`I`,ɨ̧:`i`,M̧:`M`,m̧:`m`,O̧:`O`,o̧:`o`,Q̧:`Q`,q̧:`q`,U̧:`U`,u̧:`u`,X̧:`X`,x̧:`x`,Z̧:`Z`,z̧:`z`,й:`и`,Й:`И`,ё:`е`,Ё:`Е`},r=Object.keys(n).join(`|`),i=new RegExp(r,`g`),a=new RegExp(r,``);function o(e){return n[e]}var s=function(e){return e.replace(i,o)},c=function(e){return!!e.match(a)};t.exports=s,t.exports.has=c,t.exports.remove=s}))()),km={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},Am=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function jm(e,t,n={}){let{keys:r,threshold:i=km.MATCHES,baseSort:a=Am,sorter:o=e=>e.sort((e,t)=>Lm(e,t,a))}=n;return o(e.reduce(s,[])).map(({item:e})=>e);function s(e,a,o){let s=Mm(a,r,t,n),{rank:c,keyThreshold:l=i}=s;return c>=l&&e.push({...s,item:a,index:o}),e}}jm.rankings=km;function Mm(e,t,n,r){if(!t){let t=e;return{rankedValue:t,rank:Pm(t,n,r),keyIndex:-1,keyThreshold:r.threshold}}return Vm(e,t).reduce(({rank:e,rankedValue:t,keyIndex:i,keyThreshold:a},{itemValue:o,attributes:s},c)=>{let l=Pm(o,n,r),u=t,{minRanking:d,maxRanking:f,threshold:p}=s;return l=km.MATCHES?l=d:l>f&&(l=f),l>e&&(e=l,i=c,a=p,u=o),{rankedValue:u,rank:e,keyIndex:i,keyThreshold:a}},{rankedValue:e,rank:km.NO_MATCH,keyIndex:-1,keyThreshold:r.threshold})}function*Nm(e,t){let n=-1;for(;(n=e.indexOf(t,n+1))>-1;)yield n;return-1}function Pm(e,t,n){if(e=Rm(e,n),t=Rm(t,n),t.length>e.length)return km.NO_MATCH;if(e===t)return km.CASE_SENSITIVE_EQUAL;e=e.toLowerCase(),t=t.toLowerCase();let r=Nm(e,t),i=r.next(),a=i.value;if(e.length===t.length&&a===0)return km.EQUAL;if(a===0)return km.STARTS_WITH;let o=i;for(;!o.done;){if(o.value>0&&e[o.value-1]===` `)return km.WORD_STARTS_WITH;o=r.next()}return a>0?km.CONTAINS:t.length===1?km.NO_MATCH:Fm(e).includes(t)?km.ACRONYM:Im(e,t)}function Fm(e){let t=``,n=` `;for(let r=0;r-1))return km.NO_MATCH}return a(r-o)}function Lm(e,t,n){let{rank:r,keyIndex:i}=e,{rank:a,keyIndex:o}=t;return r===a?i===o?n(e,t):ia?-1:1}function Rm(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,Om.default)(e)),e}function zm(e,t){typeof t==`object`&&(t=t.key);let n;if(typeof t==`function`)n=t(e);else if(e==null)n=null;else if(Object.hasOwnProperty.call(e,t))n=e[t];else if(t.includes(`.`))return Bm(t,e);else n=null;return n==null?[]:Array.isArray(n)?n:[String(n)]}function Bm(e,t){let n=e.split(`.`),r=[t];for(let e=0,t=n.length;e{var n=200,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=1,o=2,s=1/0,c=9007199254740991,l=`[object Arguments]`,u=`[object Array]`,d=`[object Boolean]`,f=`[object Date]`,p=`[object Error]`,m=`[object Function]`,h=`[object GeneratorFunction]`,g=`[object Map]`,_=`[object Number]`,v=`[object Object]`,y=`[object Promise]`,b=`[object RegExp]`,x=`[object Set]`,S=`[object String]`,C=`[object Symbol]`,w=`[object WeakMap]`,T=`[object ArrayBuffer]`,E=`[object DataView]`,D=`[object Float32Array]`,O=`[object Float64Array]`,k=`[object Int8Array]`,A=`[object Int16Array]`,j=`[object Int32Array]`,M=`[object Uint8Array]`,ee=`[object Uint8ClampedArray]`,te=`[object Uint16Array]`,N=`[object Uint32Array]`,P=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,ae=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,L={};L[D]=L[O]=L[k]=L[A]=L[j]=L[M]=L[ee]=L[te]=L[N]=!0,L[l]=L[u]=L[T]=L[d]=L[E]=L[f]=L[p]=L[m]=L[g]=L[_]=L[v]=L[b]=L[x]=L[S]=L[w]=!1;var se=typeof global==`object`&&global&&global.Object===Object&&global,ce=typeof self==`object`&&self&&self.Object===Object&&self,le=se||ce||Function(`return this`)(),ue=typeof e==`object`&&e&&!e.nodeType&&e,de=ue&&typeof t==`object`&&t&&!t.nodeType&&t,fe=de&&de.exports===ue&&se.process,pe=function(){try{return fe&&fe.binding(`util`)}catch{}}(),me=pe&&pe.isTypedArray;function he(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n-1}function lt(e,t){var n=this.__data__,r=Et(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}it.prototype.clear=at,it.prototype.delete=ot,it.prototype.get=st,it.prototype.has=ct,it.prototype.set=lt;function ut(e){var t=-1,n=e?e.length:0;for(this.clear();++tt||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function B(e,t){return function(n,r){if(n==null)return n;if(!bn(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++al))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=i&a?new gt:void 0;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=c}function wn(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function Tn(e){return!!e&&typeof e==`object`}function En(e){return typeof e==`symbol`||Tn(e)&&Ne.call(e)==C}var Dn=me?be(me):Lt;function On(e){return e==null?``:Gt(e)}function kn(e,t,n){var r=e==null?void 0:At(e,t);return r===void 0?n:r}function An(e,t){return e!=null&&rn(e,t,Mt)}function jn(e){return bn(e)?Tt(e):zt(e)}function Mn(e){return e}function Nn(e){return on(e)?_e(pn(e)):Wt(e)}t.exports=hn}))(),1),qm={InputWrapper:`_InputWrapper_1p1ez_1`,Shortcut:`_Shortcut_1p1ez_9`,Input:`_Input_1p1ez_1`,SelectedValue:`_SelectedValue_1p1ez_52`,SelectedName:`_SelectedName_1p1ez_67`,ItemType:`_ItemType_1p1ez_79`,Popover:`_Popover_1p1ez_83`,PopoverWrapper:`_PopoverWrapper_1p1ez_97`,List:`_List_1p1ez_110`,Group:`_Group_1p1ez_114`,GroupLabel:`_GroupLabel_1p1ez_122`,Item:`_Item_1p1ez_79`,ItemHeader:`_ItemHeader_1p1ez_162`,ItemName:`_ItemName_1p1ez_168`,ItemTypes:`_ItemTypes_1p1ez_174`,ItemMissionName:`_ItemMissionName_1p1ez_193`,NoResults:`_NoResults_1p1ez_198`,Backdrop:`_Backdrop_1p1ez_205`,CloseButton:`_CloseButton_1p1ez_215`},Jm=new Set([`SkiFree`,`SkiFree_Daily`,`SkiFree_Randomizer`]),Ym={"missions.vl2":`Official`,"TR2final105-client.vl2":`Team Rabbit 2`,"z_mappacks/CTF/Classic_maps_v1.vl2":`Classic`,"z_mappacks/CTF/DynamixFinalPack.vl2":`Official`,"z_mappacks/CTF/KryMapPack_b3EDIT.vl2":`KryMapPack`,"z_mappacks/CTF/S5maps.vl2":`S5`,"z_mappacks/CTF/S8maps.vl2":`S8`,"z_mappacks/CTF/TWL-MapPack.vl2":`TWL`,"z_mappacks/CTF/TWL-MapPackEDIT.vl2":`TWL`,"z_mappacks/CTF/TWL2-MapPack.vl2":`TWL2`,"z_mappacks/CTF/TWL2-MapPackEDIT.vl2":`TWL2`,"z_mappacks/TWL_T2arenaOfficialMaps.vl2":`Arena`,"z_mappacks/xPack2.vl2":`xPack2`,"z_mappacks/z_DMP2-V0.6.vl2":`DMP2 (Discord Map Pack)`,"z_mappacks/zDMP-4.7.3DX.vl2":`DMP (Discord Map Pack)`,"z_mappacks/zDMP-4.7.3DX-ServerOnly.vl2":`DMP (Discord Map Pack)`},Xm={"z_mappacks/DM":`DM`,"z_mappacks/LCTF":`LCTF`,"z_mappacks/Lak":`LakRabbit`},Zm=e=>{let t=e.match(/^(.*)(\/[^/]+)$/);return t?t[1]:``},Qm=T().filter(e=>!Jm.has(e)).map(e=>{let t=w(e),[n]=E(t.resourcePath),r=Zm(n),i=Ym[n]??Xm[r]??null;return{resourcePath:t.resourcePath,missionName:e,displayName:t.displayName,sourcePath:n,groupName:i,missionTypes:t.missionTypes}}),$m=new Map(Qm.map(e=>[e.missionName,e]));function eh(e){let t=new Map;for(let n of e){let e=t.get(n.groupName)??[];e.push(n),t.set(n.groupName,e)}return t.forEach((e,n)=>{t.set(n,(0,Km.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],[`asc`]))}),(0,Km.default)(Array.from(t.entries()),[([e])=>e===`Official`?0:e==null?2:1,([e])=>e?e.toLowerCase():``],[`asc`,`asc`])}var th=eh(Qm),nh=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function rh(e){let t=(0,z.c)(12),{mission:n}=e,r=n.displayName||n.missionName,i;t[0]===r?i=t[1]:(i=(0,B.jsx)(`span`,{className:qm.ItemName,children:r}),t[0]=r,t[1]=i);let a;t[2]===n.missionTypes?a=t[3]:(a=n.missionTypes.length>0&&(0,B.jsx)(`span`,{className:qm.ItemTypes,children:n.missionTypes.map(ih)}),t[2]=n.missionTypes,t[3]=a);let o;t[4]!==i||t[5]!==a?(o=(0,B.jsxs)(`span`,{className:qm.ItemHeader,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===n.missionName?s=t[8]:(s=(0,B.jsx)(`span`,{className:qm.ItemMissionName,children:n.missionName}),t[7]=n.missionName,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,B.jsxs)(B.Fragment,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ih(e){return(0,B.jsx)(`span`,{className:qm.ItemType,"data-mission-type":e,children:e},e)}function ah(e){let t=(0,z.c)(65),{value:n,missionType:r,onChange:i,disabled:a,autoFocus:o,onCancel:s}=e,[c,l]=(0,R.useState)(``),u=(0,R.useRef)(null),d=(0,R.useRef)(r),f;t[0]===s?f=t[1]:(f=e=>{e||s?.()},t[0]=s,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{(0,R.startTransition)(()=>l(e))},t[2]=p):p=t[2];let m=Em({resetValueOnHide:!0,selectedValue:n,setOpen:f,setSelectedValue:e=>{if(e){let t=d.current,n=w(e).missionTypes;(!t||!n.includes(t))&&(t=n[0]),i({missionName:e,missionType:t}),u.current?.blur()}},setValue:p}),h=J(m,`open`),g,_;t[3]!==o||t[4]!==m?(g=()=>{o&&(u.current?.focus(),m.show())},_=[o,m],t[3]=o,t[4]=m,t[5]=g,t[6]=_):(g=t[5],_=t[6]),(0,R.useEffect)(g,_);let v,y;t[7]===m?(v=t[8],y=t[9]):(v=()=>{let e=e=>{e.code===`KeyK`&&(e.metaKey||e.ctrlKey)&&(e.stopPropagation(),e.preventDefault(),u.current?.focus(),m.show())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},y=[m],t[7]=m,t[8]=v,t[9]=y),(0,R.useEffect)(v,y);let b;t[10]===n?b=t[11]:(b=$m.get(n),t[10]=n,t[11]=b);let x=b,S;bb0:{if(!c){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e={type:`grouped`,groups:th},t[12]=e):e=t[12],S=e;break bb0}let e;t[13]===c?e=t[14]:(e=jm(Qm,c,{keys:[`displayName`,`missionName`,`missionTypes`,`groupName`]}),t[13]=c,t[14]=e);let n=e,r;t[15]===n?r=t[16]:(r={type:`flat`,missions:n},t[15]=n,t[16]=r),S=r}let C=S,T=x?x.displayName||x.missionName:n,E=C.type===`flat`?C.missions.length===0:C.groups.length===0,D=e=>(0,B.jsx)(fm,{value:e.missionName,className:qm.Item,focusOnHover:!0,onClick:t=>{if(t.target&&t.target instanceof HTMLElement){let r=t.target.dataset.missionType;r?(d.current=r,e.missionName===n&&i({missionName:e.missionName,missionType:r})):d.current=null}else d.current=null},children:(0,B.jsx)(rh,{mission:e})},e.missionName),O=Dm,k=h?`visible`:`hidden`,A;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,B.jsx)(`div`,{className:qm.Backdrop}),t[17]=A):A=t[17];let j;t[18]===k?j=t[19]:(j=(0,B.jsx)(R.Activity,{mode:k,children:A}),t[18]=k,t[19]=j);let M=x?void 0:`Choose a map…`,ee,te;t[20]===m?(ee=t[21],te=t[22]):(ee=()=>{try{document.exitPointerLock()}catch{}m.show()},te=e=>{e.key===`Escape`&&!m.getState().open&&u.current?.blur()},t[20]=m,t[21]=ee,t[22]=te);let N;t[23]!==o||t[24]!==a||t[25]!==M||t[26]!==ee||t[27]!==te?(N=(0,B.jsx)(tm,{ref:u,autoSelect:!0,autoFocus:o,disabled:a,placeholder:M,className:qm.Input,onFocus:ee,onKeyDown:te}),t[23]=o,t[24]=a,t[25]=M,t[26]=ee,t[27]=te,t[28]=N):N=t[28];let P;t[29]!==T||t[30]!==r||t[31]!==x?(P=x&&(0,B.jsxs)(`div`,{className:qm.SelectedValue,children:[(0,B.jsx)(`span`,{className:qm.SelectedName,children:T}),r&&(0,B.jsx)(`span`,{className:qm.ItemType,"data-mission-type":r,children:r})]}),t[29]=T,t[30]=r,t[31]=x,t[32]=P):P=t[32];let ne;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,B.jsx)(`kbd`,{className:qm.Shortcut,children:nh?`⌘K`:`^K`}),t[33]=ne):ne=t[33];let re;t[34]!==N||t[35]!==P?(re=(0,B.jsxs)(`div`,{className:qm.InputWrapper,onKeyDown:sh,children:[N,P,ne]}),t[34]=N,t[35]=P,t[36]=re):re=t[36];let F;t[37]!==m||t[38]!==s?(F=()=>{m.hide(),s?.()},t[37]=m,t[38]=s,t[39]=F):F=t[39];let ie;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,B.jsx)(Gm,{}),t[40]=ie):ie=t[40];let ae;t[41]!==h||t[42]!==F?(ae=(0,B.jsx)(`button`,{type:`button`,className:qm.CloseButton,"data-open":h,onClick:F,children:ie}),t[41]=h,t[42]=F,t[43]=ae):ae=t[43];let I=ym,oe=qm,L;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(L={className:qm.PopoverWrapper},t[44]=L):L=t[44];let se=oh,ce=hm,le=qm,ue=C.type===`flat`?C.missions.map(D):C.groups.map(e=>{let[t,n]=e;return t?(0,B.jsxs)(im,{className:qm.Group,children:[(0,B.jsx)(sm,{className:qm.GroupLabel,children:t}),n.map(D)]},t):(0,B.jsx)(R.Fragment,{children:n.map(D)},`ungrouped`)}),de;t[45]===E?de=t[46]:(de=E&&(0,B.jsx)(`div`,{className:qm.NoResults,children:`No missions found`}),t[45]=E,t[46]=de);let fe;t[47]!==ce||t[48]!==le.List||t[49]!==ue||t[50]!==de?(fe=(0,B.jsxs)(ce,{className:le.List,children:[ue,de]}),t[47]=ce,t[48]=le.List,t[49]=ue,t[50]=de,t[51]=fe):fe=t[51];let pe;t[52]!==I||t[53]!==oe.Popover||t[54]!==L||t[55]!==se||t[56]!==fe?(pe=(0,B.jsx)(I,{gutter:4,fitViewport:!0,sameWidth:!0,fixed:!0,autoFocusOnHide:!1,className:oe.Popover,wrapperProps:L,onKeyDown:se,children:fe}),t[52]=I,t[53]=oe.Popover,t[54]=L,t[55]=se,t[56]=fe,t[57]=pe):pe=t[57];let me;return t[58]!==O||t[59]!==m||t[60]!==j||t[61]!==re||t[62]!==ae||t[63]!==pe?(me=(0,B.jsxs)(O,{store:m,children:[j,re,ae,pe]}),t[58]=O,t[59]=m,t[60]=j,t[61]=re,t[62]=ae,t[63]=pe,t[64]=me):me=t[64],me}function oh(e){e.metaKey||e.stopPropagation()}function sh(e){e.metaKey||e.stopPropagation()}function ch(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`m12 6-6 8h12zM6 16h12v2H6z`},child:[]}]})(e)}var lh={Header:`_Header_klnnn_1`,MissionInfo:`_MissionInfo_klnnn_9`,MissionName:`_MissionName_klnnn_21 _SelectedName_1p1ez_67`,MissionType:`_MissionType_klnnn_25 _ItemType_1p1ez_79`,MissionTypeDisplayName:`_MissionTypeDisplayName_klnnn_30`,Metadata:`_Metadata_klnnn_35`,Attribution:`_Attribution_klnnn_46`,ServerInfo:`_ServerInfo_klnnn_47`,PlayerName:`_PlayerName_klnnn_51`,RecordingDate:`_RecordingDate_klnnn_52`,ServerName:`_ServerName_klnnn_53`,EjectButton:`_EjectButton_klnnn_57 _DestructiveActionButton_1u47f_135 _Button_1u47f_2`,DisconnectButton:`_DisconnectButton_klnnn_58 _DestructiveActionButton_1u47f_135 _Button_1u47f_2`,EjectIcon:`_EjectIcon_klnnn_62`,Error:`_Error_klnnn_67`,Pulsing:`_Pulsing_klnnn_81`,blink:`_blink_klnnn_1`,ConnectionPing:`_ConnectionPing_klnnn_85`,PingDot:`_PingDot_klnnn_95 _Pulsing_klnnn_81`};function uh(){let e=(0,z.c)(28),t=Jn(),n=nr(),r=Qn(),i=er(),a=ir(),o=or(),s=cr(),[c,l]=s?s.split(` `):[null,null],u=t===`live`,d=_r(),f=pr(ph),p=pr(mr),m=fh,h=dh,g=lh,_;e[0]!==n||e[1]!==r||e[2]!==i?(_=n&&r?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:lh.MissionName,children:n}),r&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`span`,{className:lh.MissionType,"data-mission-type":r,children:i===`LCTF`?`LCTF`:r})]})]}):null,e[0]=n,e[1]=r,e[2]=i,e[3]=_):_=e[3];let v;e[4]===_?v=e[5]:(v=(0,B.jsx)(`div`,{className:lh.MissionInfo,children:_}),e[4]=_,e[5]=v);let y;e[6]!==f||e[7]!==p?(y=f&&p!=null?(0,B.jsxs)(`span`,{className:lh.ConnectionPing,"data-quality":p<150?`good`:p<300?`fine`:`poor`,children:[(0,B.jsx)(`span`,{className:lh.PingDot}),` `,D(p)]}):null,e[6]=f,e[7]=p,e[8]=y):y=e[8];let b=lh,x=u?f?o?(0,B.jsxs)(`div`,{className:lh.Attribution,children:[`Connected as`,` `,(0,B.jsx)(`span`,{className:lh.PlayerName,children:o})]}):null:(0,B.jsx)(`div`,{className:lh.Error,children:`Disconnected`}):o&&s?(0,B.jsxs)(`div`,{className:lh.Attribution,children:[`Recorded by `,(0,B.jsx)(`span`,{className:lh.PlayerName,children:o}),` `,`on`,` `,(0,B.jsx)(`span`,{className:lh.RecordingDate,children:c.replace(/-/g,` `)}),` `,`at`,` `,(0,B.jsx)(`span`,{className:lh.RecordingDate,children:(l??``).replace(/(AM|PM)$/,` $1`)})]}):null,S;e[9]===a?S=e[10]:(S=a?(0,B.jsxs)(`div`,{className:lh.ServerInfo,children:[`Server: `,(0,B.jsx)(`span`,{className:lh.ServerName,children:a})]}):null,e[9]=a,e[10]=S);let C;e[11]!==b.Metadata||e[12]!==x||e[13]!==S?(C=(0,B.jsxs)(`div`,{className:b.Metadata,children:[x,S]}),e[11]=b.Metadata,e[12]=x,e[13]=S,e[14]=C):C=e[14];let w;e[15]!==t||e[16]!==h||e[17]!==m||e[18]!==u||e[19]!==f||e[20]!==d?(w=t===`demo`?(0,B.jsx)(`button`,{type:`button`,className:lh.EjectButton,title:`Unload demo`,"aria-label":`Unload demo`,onClick:m,disabled:!d,children:(0,B.jsx)(ch,{className:lh.EjectIcon})}):u?(0,B.jsx)(`button`,{type:`button`,className:lh.DisconnectButton,title:`Disconnect`,"aria-label":`Disconnect`,onClick:h,disabled:!f,children:(0,B.jsx)(Ta,{})}):null,e[15]=t,e[16]=h,e[17]=m,e[18]=u,e[19]=f,e[20]=d,e[21]=w):w=e[21];let T;return e[22]!==g.Header||e[23]!==v||e[24]!==y||e[25]!==C||e[26]!==w?(T=(0,B.jsxs)(`div`,{className:g.Header,children:[v,y,C,w]}),e[22]=g.Header,e[23]=v,e[24]=y,e[25]=C,e[26]=w,e[27]=T):T=e[27],T}function dh(){fr.getState().disconnectServer(),je.getState().setRecording(null)}function fh(){je.getState().setRecording(null)}function ph(e){return e.gameStatus===`connected`||e.gameStatus===`authenticating`}function mh(e){let t=(0,z.c)(5),{onChangeMission:n}=e,{setRecording:r}=Dr(),i=(0,R.useEffectEvent)(n),a;t[0]!==i||t[1]!==r?(a=()=>(window.setMissionName=e=>{let t=w(e).missionTypes;i({missionName:e,missionType:t[0]})},window.getMissionList=T,window.getMissionInfo=w,window.loadDemoRecording=r,hh),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=[r],t[3]=r,t[4]=o),(0,R.useEffect)(a,o)}function hh(){delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo,delete window.loadDemoRecording}var gh=(0,R.createContext)(null);function _h(){let e=(0,R.useContext)(gh);if(!e)throw Error(`useCameras must be used within CamerasProvider`);return e}function vh({children:e}){let t=o(e=>e.camera),[n,r]=(0,R.useState)(-1),[i,a]=(0,R.useState)({}),[s,c]=(0,R.useState)(()=>({initialized:!1,position:null,quarternion:null})),l=(0,R.useCallback)(e=>{a(t=>({...t,[e.id]:e}))},[]),u=(0,R.useCallback)(e=>{a(t=>{let{[e.id]:n,...r}=t;return r})},[]),d=Object.keys(i).length,f=(0,R.useCallback)(e=>{if(e>=0&&e{f(d?(n+1)%d:-1)},[d,n,f]);(0,R.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith(`#c`)){let[t,n]=e.slice(2).split(`~`),r=t.split(`,`).map(e=>parseFloat(e)),i=n.split(`,`).map(e=>parseFloat(e));c({initialized:!0,position:new Ee(...r),quarternion:new Te(...i)})}else c({initialized:!0,position:null,quarternion:null})};return window.addEventListener(`hashchange`,e),e(),()=>{window.removeEventListener(`hashchange`,e)}},[]),(0,R.useEffect)(()=>{s.initialized&&s.position&&(t.position.copy(s.position),s.quarternion&&t.quaternion.copy(s.quarternion))},[t,s]),(0,R.useEffect)(()=>{!s.initialized||s.position||d>0&&n===-1&&f(0)},[d,f,n,s]);let m=(0,R.useMemo)(()=>({registerCamera:l,unregisterCamera:u,nextCamera:p,setCameraIndex:f,cameraCount:d}),[l,u,p,f,d]);return d===0&&n!==-1&&r(-1),(0,B.jsx)(gh.Provider,{value:m,children:e})}var yh=(0,R.createContext)(null);function bh(){let e=(0,R.useContext)(yh);if(!e)throw Error(`useInputContext must be used within an InputProvider`);return e}function xh(){return bh().onInput}function Sh(){return bh().mode}var Ch=new Set([`Ctrl`,`Shift`,`Alt`]),wh=new Set([`MetaLeft`,`MetaRight`,`ControlLeft`,`ControlRight`,`ShiftLeft`,`ShiftRight`,`AltLeft`,`AltRight`]);function Th(e){if(typeof e!=`string`)return e;let t=e.split(`-`),n=t.pop(),r=[];for(let e of t)Ch.has(e)&&r.push(e);return{type:`key`,code:n,modifiers:r.length>0?r:void 0}}function Eh(e,t){let n=e.has(`ControlLeft`)||e.has(`ControlRight`),r=e.has(`ShiftLeft`)||e.has(`ShiftRight`),i=e.has(`AltLeft`)||e.has(`AltRight`);return n===(t?.includes(`Ctrl`)??!1)&&r===(t?.includes(`Shift`)??!1)&&i===(t?.includes(`Alt`)??!1)}function Dh(e,t){let n=t?.includes(`Ctrl`)??!1,r=t?.includes(`Shift`)??!1,i=t?.includes(`Alt`)??!1;return e.ctrlKey===n&&e.shiftKey===r&&e.altKey===i}function Oh(){return{pressed:!1}}function kh(){return{dragging:!1,deltaX:0,deltaY:0,startX:0,startY:0}}function Ah(){return{deltaX:0,deltaY:0}}function jh(){return{touching:!1,dragging:!1,deltaX:0,deltaY:0}}function Mh(e){switch(e.type){case`key`:case`click`:return Oh();case`drag`:case`pointerLockMove`:return kh();case`scroll`:return Ah();case`touch`:return jh()}}var Nh=j()(ke(()=>({keys:new Set,actions:{}}))),Ph=new Map;function Fh(e,t){let n=Ph.get(e);return n||(n=new Set,Ph.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&Ph.delete(e)}}function Ih(e){let t=Ph.get(e);if(t)for(let e of t)e()}var Lh=new Set([`text`,`search`,`url`,`tel`,`email`,`password`,`number`,`date`,`datetime-local`,`month`,`week`,`time`]),Rh=new Set([`Space`,`Enter`,`NumpadEnter`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]);function zh(e){if(e.code===`Tab`)return document.pointerLockElement?(e.preventDefault(),!1):!0;let t=document.activeElement;if(!t||t===document.body)return!1;let n=t.tagName;if(t.isContentEditable||n===`TEXTAREA`)return!0;if(n===`INPUT`){let n=t.type.toLowerCase();return Lh.has(n)?!0:Rh.has(e.code)}return n===`BUTTON`||n===`SELECT`||n===`A`||n===`SUMMARY`?Rh.has(e.code):!1}function Bh(e){if(e.metaKey||zh(e))return;let{keys:t}=Nh.getState();if(t.has(e.code))return;let n=new Set(t);n.add(e.code),Nh.setState(e=>({...e,keys:n}))}function Vh(e){let{keys:t}=Nh.getState();if(!t.has(e.code))return;let n=new Set(t);if(n.delete(e.code),e.code===`MetaLeft`||e.code===`MetaRight`)for(let e of n)wh.has(e)||n.delete(e);Nh.setState(e=>({...e,keys:n}))}function Hh(){let{keys:e}=Nh.getState();e.size!==0&&Nh.setState(e=>({...e,keys:new Set}))}window.addEventListener(`keydown`,Bh),window.addEventListener(`keyup`,Vh),window.addEventListener(`blur`,Hh);function Uh(e){let t=(0,z.c)(2),n;return t[0]===e?n=t[1]:(n=t=>e(t.actions),t[0]=e,t[1]=n),M(Nh,n)}function Wh(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[Nh.subscribe,Gh],e[0]=t):t=e[0],t}function Gh(){return Nh.getState().actions}function Kh(){let{actions:e}=Nh.getState(),t={};for(let[n,r]of Object.entries(e))`deltaX`in r&&(r.deltaX!==0||r.deltaY!==0)&&(t[n]={...r,deltaX:0,deltaY:0});Object.keys(t).length>0&&Nh.setState(e=>({...e,actions:{...e.actions,...t}}))}function qh(e,t){let n=(0,z.c)(5),r=(0,R.useEffectEvent)(t),i;n[0]!==e||n[1]!==r?(i=()=>Fh(e,r),n[0]=e,n[1]=r,n[2]=i):i=n[2];let a;n[3]===e?a=n[4]:(a=[e],n[3]=e,n[4]=a),(0,R.useEffect)(i,a)}var Jh=1,Yh=11,Xh=.002;function Zh(e){let t=(e-b)/(1-b);return(Math.round(t*15)+1)/16}function Qh(e,t){let n=e[t];return n!=null&&`pressed`in n&&n.pressed}function $h(){let e=(0,z.c)(41),t=g(),{speedMultiplier:n,setSpeedMultiplier:r,mouseSensitivity:i,invertScroll:s,invertDrag:c}=v(),{onInput:l,mode:u}=bh(),[,d]=Wh(),f=o(ng),{setCameraIndex:p,cameraCount:m}=_h(),h=(0,R.useRef)(!1),_=(0,R.useRef)(!1),y,x;e[0]===t?(y=e[1],x=e[2]):(y=()=>{t&&document.pointerLockElement&&document.exitPointerLock()},x=[t],e[0]=t,e[1]=y,e[2]=x),(0,R.useEffect)(y,x);let S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],e[3]=S):S=e[3],(0,R.useEffect)(eg,S);let C;e[4]!==f||e[5]!==t?(C=()=>{!t&&!N.getState().animation&&f.domElement.requestPointerLock()},e[4]=f,e[5]=t,e[6]=C):C=e[6],qh(`canvasClick`,C);let w;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{h.current=!0},e[7]=w):w=e[7],qh(`nextPlayer`,w);let T;e[8]!==d||e[9]!==s||e[10]!==r?(T=()=>{let e=d().adjustSpeed;if(!e||e.deltaY===0)return;let t=s?-1:1,n=(e.deltaY>0?-1:1)*t,i=Math.ceil(Math.log2(Math.abs(e.deltaY)+1)),a=Math.max(Jh,Math.min(Yh,i))*n;r(e=>{let t=Math.round(e*100)+a;return Math.max(b,Math.min(1,t/100))})},e[8]=d,e[9]=s,e[10]=r,e[11]=T):T=e[11],qh(`adjustSpeed`,T);let E;e[12]!==m||e[13]!==p?(E=e=>{eD(0),e[15]=D,e[16]=O),qh(`camera1`,O);let k;e[17]===D?k=e[18]:(k=()=>D(1),e[17]=D,e[18]=k),qh(`camera2`,k);let A;e[19]===D?A=e[20]:(A=()=>D(2),e[19]=D,e[20]=A),qh(`camera3`,A);let j;e[21]===D?j=e[22]:(j=()=>D(3),e[21]=D,e[22]=j),qh(`camera4`,j);let M;e[23]===D?M=e[24]:(M=()=>D(4),e[23]=D,e[24]=M),qh(`camera5`,M);let ee;e[25]===D?ee=e[26]:(ee=()=>D(5),e[25]=D,e[26]=ee),qh(`camera6`,ee);let te;e[27]===D?te=e[28]:(te=()=>D(6),e[27]=D,e[28]=te),qh(`camera7`,te);let P;e[29]===D?P=e[30]:(P=()=>D(7),e[29]=D,e[30]=P),qh(`camera8`,P);let ne;e[31]===D?ne=e[32]:(ne=()=>D(8),e[31]=D,e[32]=ne),qh(`camera9`,ne);let re;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(re=()=>{_.current=!0},e[33]=re):re=e[33],qh(`toggleObserverMode`,re);let F;return e[34]!==d||e[35]!==c||e[36]!==u||e[37]!==i||e[38]!==l||e[39]!==n?(F=(e,t)=>{if(N.getState().animation)return;let r=d(),a=0,o=0,s=r.lockedLook;s&&(s.deltaX!==0||s.deltaY!==0)&&(a=s.deltaX*i,o=s.deltaY*i);let f=r.dragLook;if(f?.dragging&&(f.deltaX!==0||f.deltaY!==0)){let e=(c?1:-1)*(u===`follow`?-1:1);a+=e*f.deltaX*Xh,o+=e*f.deltaY*Xh}Qh(r,`lookLeft`)&&(a-=1*t),Qh(r,`lookRight`)&&(a+=1*t),Qh(r,`lookUp`)&&(o-=1*t),Qh(r,`lookDown`)&&(o+=1*t);let p=0,m=0,g=0;Qh(r,`moveLeft`)&&(p=-1),Qh(r,`moveRight`)&&(p+=1),Qh(r,`moveForward`)&&(m=1),Qh(r,`moveBackward`)&&--m,Qh(r,`moveUp`)&&(g=1),Qh(r,`moveDown`)&&--g;let v=Zh(n);p=Math.max(-1,Math.min(1,p*v)),m=Math.max(-1,Math.min(1,m*v)),g=Math.max(-1,Math.min(1,g*v));let y=[!1,!1,!1,!1,!1,!1];h.current&&=(y[0]=!0,!1),_.current&&=(y[2]=!0,!1),Kh();let b=a!==0||o!==0,x=p!==0||m!==0||g!==0,S=y.some(Boolean);!b&&!x&&!S||l({deltaYaw:a,deltaPitch:o,x:p,y:m,z:g,triggers:y,delta:t})},e[34]=d,e[35]=c,e[36]=u,e[37]=i,e[38]=l,e[39]=n,e[40]=F):F=e[40],a(F),null}function eg(){return N.subscribe(tg)}function tg(e){e.animation&&document.pointerLockElement&&document.exitPointerLock()}function ng(e){return e.gl}var rg=(0,R.lazy)(()=>Me(()=>import(`./TouchHandler-CV_1nnl6.js`).then(e=>({default:e.TouchHandler})),__vite__mapDeps([7,8,2,9,3,10,11,12,13,14])));function ig(e){let t=(0,z.c)(9),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let i=(0,R.useRef)(r),[a,o]=(0,R.useState)(`local`),s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i.current.push(e)},t[1]=s):s=t[1];let c=s,l;t[2]===a?l=t[3]:(l={moveQueue:i,onInput:c,mode:a,setMode:o},t[2]=a,t[3]=l);let u;t[4]===n?u=t[5]:(u=(0,B.jsx)(Ne,{children:n}),t[4]=n,t[5]=u);let d;return t[6]!==l||t[7]!==u?(d=(0,B.jsx)(yh.Provider,{value:l,children:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8],d}function ag(){let e=(0,z.c)(5),t=g(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,B.jsx)($h,{}),e[0]=n):n=e[0];let r;e[1]===t?r=e[2]:(r=t?(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(rg,{})}):null,e[1]=t,e[2]=r);let i;return e[3]===r?i=e[4]:(i=(0,B.jsxs)(B.Fragment,{children:[n,r]}),e[3]=r,e[4]=i),i}var og=(0,R.lazy)(()=>Me(()=>import(`./TouchJoystick-DYqKShVz.js`).then(e=>({default:e.TouchJoystick})),__vite__mapDeps([15,2,16,11,9,12,13,14,17]))),sg=(0,R.lazy)(()=>Me(()=>import(`./KeyboardOverlay-D875z9z7.js`).then(e=>({default:e.KeyboardOverlay})),__vite__mapDeps([18,2,11,9,12,13,19,20,21,10,22])));function cg(){let e=(0,z.c)(9),t=g(),n=te(lg),{showInputOverlay:r}=c(),i;e[0]!==t||e[1]!==n?(i=t&&!n?(0,B.jsx)(og,{}):null,e[0]=t,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==t||e[4]!==r?(a=t===!1&&r?(0,B.jsx)(sg,{}):null,e[3]=t,e[4]=r,e[5]=a):a=e[5];let o;return e[6]!==i||e[7]!==a?(o=(0,B.jsxs)(R.Suspense,{children:[i,a]}),e[6]=i,e[7]=a,e[8]=o):o=e[8],o}function lg(e){return e.animation!==null}var ug={LoadingIndicator:`_LoadingIndicator_8ijel_1`,loadingComplete:`_loadingComplete_8ijel_1`,Spinner:`_Spinner_8ijel_19`,spin:`_spin_8ijel_1`,Progress:`_Progress_8ijel_28`,ProgressBar:`_ProgressBar_8ijel_36`,ProgressText:`_ProgressText_8ijel_43`};function dg(e){let t=(0,z.c)(12),{isLoading:n,progress:r}=e,i=r===void 0?null:r,a=(i??0)*100,o=!n,s=i==null,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,B.jsx)(`div`,{className:ug.Spinner}),t[0]=c):c=t[0];let l=`${a}%`,u;t[1]===l?u=t[2]:(u=(0,B.jsx)(`div`,{className:ug.Progress,children:(0,B.jsx)(`div`,{className:ug.ProgressBar,style:{width:l}})}),t[1]=l,t[2]=u);let d;t[3]===a?d=t[4]:(d=Math.round(a),t[3]=a,t[4]=d);let f;t[5]===d?f=t[6]:(f=(0,B.jsxs)(`div`,{className:ug.ProgressText,children:[d,`%`]}),t[5]=d,t[6]=f);let p;return t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==f?(p=(0,B.jsxs)(`div`,{className:ug.LoadingIndicator,"data-complete":o,"data-indeterminate":s,children:[c,u,f]}),t[7]=o,t[8]=s,t[9]=u,t[10]=f,t[11]=p):p=t[11],p}var fg={Dialog:`_Dialog_1t9wa_1`,Overlay:`_Overlay_1t9wa_22`,DialogButton:`_DialogButton_1t9wa_33`,Secondary:`_Secondary_1t9wa_72 _DialogButton_1t9wa_33`,Actions:`_Actions_1t9wa_86`};function pg(e){let t=(0,z.c)(5),{onClose:n}=e,r;t[0]===n?r=t[1]:(r=e=>{n?.()},t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,B.jsx)(`div`,{className:fg.Dialog,children:(0,B.jsx)(dg,{isLoading:!0})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,B.jsx)(`div`,{className:fg.Overlay,onClick:r,children:i}),t[3]=r,t[4]=a),a}var mg={Button:`_Button_sprpv_1`};function hg(e){let t=(0,z.c)(9),{isOpen:n,orientation:r,onClick:i}=e,a=n?`Close sidebar`:`Open sidebar`,o=n?`Close sidebar`:`Open sidebar`,s;t[0]!==n||t[1]!==r?(s=r===`top`?n?(0,B.jsx)(ba,{}):(0,B.jsx)(ya,{}):n?(0,B.jsx)(Sa,{}):(0,B.jsx)(xa,{}),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c;return t[3]!==i||t[4]!==r||t[5]!==a||t[6]!==o||t[7]!==s?(c=(0,B.jsx)(`button`,{type:`button`,className:mg.Button,"data-orientation":r,"aria-label":a,title:o,onClick:i,children:s}),t[3]=i,t[4]=r,t[5]=a,t[6]=o,t[7]=s,t[8]=c):c=t[8],c}var gg={Button:`_Button_wk3rb_1 _DestructiveActionButton_1u47f_135 _Button_1u47f_2`,ButtonLabel:`_ButtonLabel_wk3rb_9 _ButtonLabel_1u47f_82`};function _g(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsxs)(`button`,{type:`button`,className:gg.Button,onClick:vg,children:[(0,B.jsx)(Wa,{}),(0,B.jsx)(`span`,{className:gg.ButtonLabel,children:`Exit tour`})]}),e[0]=t):t=e[0],t}function vg(){return N.getState().cancel()}var yg={Frame:`_Frame_1u5rk_1`,Toolbar:`_Toolbar_1u5rk_16`,Sidebar:`_Sidebar_1u5rk_29`,Content:`_Content_1u5rk_43`,ThreeView:`_ThreeView_1u5rk_52`,PlayerBar:`_PlayerBar_1u5rk_61`,Backdrop:`_Backdrop_1u5rk_71`};function bg({children:e}){return e}function xg(e,t){return(0,R.lazy)(()=>t().then(t=>({default:t[e]})))}var Sg=xg(`GameView`,()=>Me(()=>import(`./GameView-DOXRUG38.js`),__vite__mapDeps([23,2,16,24,5,25,26,27,8,9,3,10,28,11,12,13,29,30,31,32,33,34,35,36,1,37,38,39,4,21,40,41,42]))),Cg=xg(`DemoPlaybackControls`,()=>Me(()=>import(`./DemoPlaybackControls-B8inlhPI.js`),__vite__mapDeps([43,2,19,20,9,44]))),wg=xg(`PlayerHUD`,()=>Me(()=>import(`./PlayerHUD-ZLAOgfFu.js`),__vite__mapDeps([45,2,16,9,33,24,5,12,13,34,10,35,41,46]))),Tg=xg(`MapInfoDialog`,()=>Me(()=>import(`./MapInfoDialog-BlS8j0JO.js`),__vite__mapDeps([47,2,36,28,9,33,24,5,12,13,48]))),Eg=xg(`ServerBrowser`,()=>Me(()=>import(`./ServerBrowser-BK-yGyhv.js`),__vite__mapDeps([49,2,11,9,12,13,50]))),Dg=xg(`ScoreScreen`,()=>Me(()=>import(`./ScoreScreen-94psq8zp.js`),__vite__mapDeps([51,2,9,34,10,35,13,52])));function Og(){let[e,t]=y(),n=$t(),{clearFogEnabledOverride:r,sidebarOpen:i,setSidebarOpen:a}=c(),{missionName:o,missionType:s}=e,[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)(!1),[h,_]=(0,R.useState)(!1),[v,b]=(0,R.useState)(0),[x,S]=(0,R.useState)(!0),C=g(),T=te(e=>e.animation!==null),E=(0,R.useCallback)(e=>{window.location.hash=``,r(),_(!1),N.getState().cancel(),fr.getState().disconnectServer(),je.getState().setRecording(null),Fn.getState().endStreaming(),t(e),C&&a(!1)},[r,t,C,a]);mh({onChangeMission:E});let D=_r(),O=Jn(),k=O===`demo`||O===`live`,A=Xn(),j=Qn();(0,R.useEffect)(()=>{if(!(!k||!A))try{let e=w(A);t({missionName:A,missionType:j&&e.missionTypes.includes(j)?j:void 0})}catch{t(null)}},[k,A,j,t]),(0,R.useEffect)(()=>{D&&_(!1)},[D]);let M=pr(e=>e.gameStatus);(0,R.useEffect)(()=>{M===`connected`&&C&&a(!1)},[M,C,a]),(0,R.useEffect)(()=>{D&&C&&a(!1)},[C,D,a]),(0,R.useEffect)(()=>{T&&C&&a(!1)},[C,T,a]),(0,R.useEffect)(()=>{let e=e=>{e.code===`Backslash`&&(e.metaKey||e.ctrlKey)&&(e.stopPropagation(),e.preventDefault(),a(e=>!e))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]);let ee=v,P=ee<1;(0,R.useEffect)(()=>{if(P)S(!0);else{let e=setTimeout(()=>S(!1),500);return()=>clearTimeout(e)}},[P]);let ne=(0,R.useCallback)((e,t=0)=>{b(t)},[]),re=(0,R.useRef)(null),F=(0,R.useRef)(null),ie=(0,R.useCallback)(()=>u(!0),[]),ae=(0,R.useCallback)(()=>m(!0),[]),I=(0,R.useCallback)(()=>{f(!0)},[]),oe=(0,R.useCallback)(()=>_(!0),[]),L=(0,R.useCallback)(()=>{_(!1)},[]),se=(0,R.useCallback)(e=>{re.current=e.camera,F.current=e.invalidate},[]);return(0,B.jsx)(`main`,{className:yg.Frame,children:(0,B.jsxs)(gr,{children:[(0,B.jsxs)(`header`,{className:yg.Toolbar,children:[(0,B.jsx)(hg,{orientation:`top`,isOpen:i,onClick:()=>{a(e=>!e)}}),(0,B.jsx)(hg,{orientation:`left`,isOpen:i,onClick:()=>{a(e=>!e)}}),(0,B.jsx)(R.Activity,{mode:k&&!h?`visible`:`hidden`,children:(0,B.jsx)(uh,{})}),(0,B.jsx)(R.Activity,{mode:!k||h?`visible`:`hidden`,children:(0,B.jsx)(ah,{value:h?``:o,missionType:h?``:s??``,onChange:E,autoFocus:h,onCancel:L})}),T&&(0,B.jsx)(_g,{})]}),i?(0,B.jsx)(`div`,{className:yg.Backdrop}):null,(0,B.jsx)(R.Activity,{mode:i?`visible`:`hidden`,children:(0,B.jsx)(`div`,{className:yg.Sidebar,"data-open":i,children:(0,B.jsx)(ro,{missionName:o,missionType:s,choosingMap:h,cameraRef:re,invalidateRef:F,onOpenMapInfo:ie,onOpenScoreScreen:k?ae:void 0,onOpenServerBrowser:n.live?I:void 0,onChooseMap:oe,onCancelChoosingMap:L,onClose:()=>{a(!1)}})})}),(0,B.jsx)(ig,{children:(0,B.jsxs)(`div`,{className:yg.Content,children:[(0,B.jsx)(`div`,{className:yg.ThreeView,children:(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(Sg,{missionName:o,missionType:s,dpr:l||d||p?.25:void 0,onCreated:se,onLoadingChange:ne})})}),k&&!p?(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(wg,{})}):null,(0,B.jsx)(cg,{}),x&&(0,B.jsx)(dg,{isLoading:P,progress:ee})]})}),(0,B.jsx)(`footer`,{className:yg.PlayerBar,children:D?.source===`demo`?(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(Cg,{})}):null}),l?(0,B.jsx)(bg,{children:(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(pg,{onClose:()=>u(!1)}),children:(0,B.jsx)(Tg,{onClose:()=>u(!1),missionName:o,missionType:s??``})})}):null,d?(0,B.jsx)(bg,{children:(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(pg,{onClose:()=>f(!1)}),children:(0,B.jsx)(Eg,{onClose:()=>f(!1)})})}):null,p?(0,B.jsx)(bg,{children:(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(pg,{onClose:()=>m(!1)}),children:(0,B.jsx)(Dg,{onClose:()=>m(!1)})})}):null]})})}var kg=new Jt;function Ag(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(qe,{children:(0,B.jsx)(en,{children:(0,B.jsx)(Zt,{client:kg,children:(0,B.jsx)(h,{children:(0,B.jsx)(Og,{})})})})})}),e[0]=t):t=e[0],t}(0,Re.createRoot)(document.getElementById(`root`)).render((0,B.jsx)(R.StrictMode,{children:(0,B.jsx)(Ag,{})}));export{Tt as $,pr as A,yn as B,xr as C,_r as D,Dr as E,Kn as F,cn as G,fn as H,qn as I,an as J,sn as K,Mn as L,Hn as M,Jn as N,Tr as O,Un as P,Et as Q,An as R,hr as S,yr as T,un as U,pn as V,ln as W,Lt as X,Xt as Y,kt as Z,_h as _,Dh as a,pt as at,ha as b,Ih as c,Ze as ct,Uh as d,Le as dt,nt as et,Wh as f,vh as g,xh as h,jh as i,it,Fn as j,fr as k,Th as l,Ye as lt,Sh as m,kh as n,vt as nt,Nh as o,Ct as ot,bh as p,on as q,Mh as r,at as rt,Eh as s,rt as st,ag as t,et as tt,qh as u,Je as ut,Wm as v,Cr as w,ma as x,va as y,On as z}; \ No newline at end of file diff --git a/docs/assets/index-DPUMrbG6.css b/docs/assets/index-DPUMrbG6.css new file mode 100644 index 00000000..b9f02f07 --- /dev/null +++ b/docs/assets/index-DPUMrbG6.css @@ -0,0 +1 @@ +@layer button{@media (hover:hover){._Button_p0g82_2{color:#ffffffe6;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_p0g82_2:not(:disabled):hover{color:#fff;background:#0062b3cc;border-color:#fff6}._Button_p0g82_2 svg{opacity:.6}._Button_p0g82_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_p0g82_141:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_p0g82_141{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}@media (hover:hover){._Button_p0g82_2{color:#ffffffe6;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_p0g82_2:not(:disabled):hover{color:#fff;background:#0062b3cc;border-color:#fff6}._Button_p0g82_2 svg{opacity:.6}._Button_p0g82_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_p0g82_141:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_p0g82_141{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}@media (hover:hover){._Button_p0g82_2{color:#ffffffe6;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_p0g82_2:not(:disabled):hover{color:#fff;background:#0062b3cc;border-color:#fff6}._Button_p0g82_2 svg{opacity:.6}._Button_p0g82_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_p0g82_141:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_p0g82_141{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}@media (hover:hover){._Button_p0g82_2{color:#ffffffe6;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_p0g82_2:not(:disabled):hover{color:#fff;background:#0062b3cc;border-color:#fff6}._Button_p0g82_2 svg{opacity:.6}._Button_p0g82_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_p0g82_141:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_p0g82_141{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}@media (hover:hover){._Button_p0g82_2{color:#ffffffe6;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_p0g82_2:not(:disabled):hover{color:#fff;background:#0062b3cc;border-color:#fff6}._Button_p0g82_2 svg{opacity:.6}._Button_p0g82_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_p0g82_141:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_p0g82_141{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}._Button_p0g82_2{color:#fff;cursor:pointer;background:#0062b3cc;border:1px solid #fff6;border-radius:5px;flex:auto;justify-content:center;align-items:center;gap:8px;width:auto;min-width:28px;height:auto;min-height:32px;margin:0;padding:4px 8px;font-family:inherit;font-size:18px;font-weight:500;transition:background .2s,border-color .2s;display:flex;position:relative;transform:translate(0);box-shadow:0 1px 2px #0006}._Button_p0g82_2 svg{opacity:.8;pointer-events:none;flex:none;transition:opacity .2s}._Button_p0g82_2:not(:has(._ButtonLabel_p0g82_37)) svg{opacity:1}._Button_p0g82_2:disabled{opacity:.6;color:#fffc;cursor:default;box-shadow:inset 0 0 12px 1px #36363680}@media (hover:hover){._Button_p0g82_2{color:#ffffffe6;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_p0g82_2:not(:disabled):hover{color:#fff;background:#0062b3cc;border-color:#fff6}._Button_p0g82_2 svg{opacity:.6}._Button_p0g82_2:not(:disabled):hover svg{opacity:1}}._Button_p0g82_2:not(:disabled):active,._Button_p0g82_2[aria-expanded=true]{background:#0062b3b3;border-color:#ffffff4d;transform:translateY(1px)}._Button_p0g82_2[data-active=true]{background:#0075d5e6;border-color:#fff6}._ButtonLabel_p0g82_37{font-size:14px}._ButtonHint_p0g82_92{opacity:.7;font-size:10px}._ButtonGroup_p0g82_97{flex:1 0 auto;align-items:stretch;width:100%;display:flex}._ButtonGroup_p0g82_97 ._Button_p0g82_2{background:#1b4f87b3;flex-direction:column;flex:1 0 0;gap:1px;padding-top:8px;padding-bottom:8px;font-size:22px;box-shadow:inset 0 0 10px #04284780}._ButtonGroup_p0g82_97 ._Button_p0g82_2 svg{margin-bottom:3px}._ButtonGroup_p0g82_97 ._Button_p0g82_2[data-active=true]{background:#0065cbcc;box-shadow:inset 0 2px 3px #08bdff80,inset 0 -2px 6px #00122880}._ButtonGroup_p0g82_97 ._Button_p0g82_2[data-active=true] svg{opacity:1}._ButtonGroup_p0g82_97 ._Button_p0g82_2:not(:first-child){border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}._ButtonGroup_p0g82_97 ._Button_p0g82_2:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}._DestructiveActionButton_p0g82_141{background:#d5423ab3;flex:none;min-width:28px;min-height:28px;margin:0 10px 0 0;padding:2px;font-size:16px}@media (hover:hover){._DestructiveActionButton_p0g82_141:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_p0g82_141{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}}:root{--monospace-font:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace}html{box-sizing:border-box;background:#000;margin:0;padding:0;overflow:hidden}*,:before,:after{box-sizing:inherit}body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:100%}body{margin:0;padding:0;overflow:hidden}._Button_1xmvi_1[data-copied=true]{background:#0075d5e6;border-color:#fff6}._ClipboardIcon_1xmvi_10{opacity:1;display:none}._Button_1xmvi_1[data-copied=true] ._ClipboardIcon_1xmvi_10{animation:.22s linear infinite _showClipboardCheck_1xmvi_1;display:block}._Button_1xmvi_1[data-copied=true] ._PinIcon_1xmvi_20{display:none}@keyframes _showClipboardCheck_1xmvi_1{0%{opacity:1}to{opacity:.2}}._JoinServerButton_cz8os_1[data-connected=true] ._Icon_cz8os_5{animation:1.2s ease-out infinite _blink_cz8os_1}@keyframes _blink_cz8os_1{0%{opacity:1}to{opacity:.25}}._AccordionGroup_1ysdj_1{flex-direction:column;gap:1px;display:flex}._Trigger_1ysdj_7{color:#fff;text-align:left;text-transform:uppercase;letter-spacing:.0417em;background:#ffffff1a;border:0;align-items:center;gap:4px;width:100%;padding:6px 8px;font-family:inherit;font-size:12px;font-weight:400;display:flex}._TriggerIcon_1ysdj_24{opacity:.5;font-size:12px;transition:transform .2s;transform:rotate(0)}._Trigger_1ysdj_7[data-state=open] ._TriggerIcon_1ysdj_24{transform:rotate(90deg)}._Content_1ysdj_35{overflow:hidden}._Content_1ysdj_35[data-state=open]{animation:.3s _slideDown_1ysdj_1}._Content_1ysdj_35[data-state=closed]{animation:.3s _slideUp_1ysdj_1}._Body_1ysdj_47{padding:16px 12px 10px}@keyframes _slideDown_1ysdj_1{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes _slideUp_1ysdj_1{0%{height:var(--radix-accordion-content-height)}to{height:0}}@media (pointer:coarse){._Trigger_1ysdj_7{padding-top:12px;padding-bottom:12px}}._Root_cfjcw_1{flex-direction:column;display:flex}._ProgressWrap_cfjcw_6{flex-direction:column;gap:4px;padding:12px 10px;display:flex}._ProgressLabel_cfjcw_13{opacity:.7;text-align:center;font-size:11px}._ProgressBar_cfjcw_19{background:#ffffff1a;border-radius:2px;width:100%;height:4px;overflow:hidden}._ProgressFill_cfjcw_27{background:#0a84ffcc;height:100%;transition:width .15s}._Filters_cfjcw_33{flex-wrap:wrap;gap:4px;padding:10px;display:flex}._FilterButton_cfjcw_40{color:#ffffffb3;cursor:pointer;background:#ffffff0d;border:1px solid #fff3;border-radius:3px;padding:2px 8px;font-family:inherit;font-size:11px}._FilterButton_cfjcw_40[data-active=true]{color:#fff;background:#0062b399;border-color:#64b4ff80}._EventList_cfjcw_57{flex-direction:column;padding:2px 0 12px;display:flex}._EventRow_cfjcw_63{color:#fffc;text-align:left;cursor:pointer;white-space:nowrap;background:0 0;border:0;align-items:center;gap:8px;padding:3px 10px 3px 8px;font-family:inherit;font-size:13px;display:flex}@media (hover:hover){._EventRow_cfjcw_63:hover{background:#ffffff1a}._FilterButton_cfjcw_40:hover{background:#ffffff1a;border-color:#ffffff4d}._FilterButton_cfjcw_40[data-active=true]:hover{background:#0062b3cc;border-color:#64b4ffb3}}._EventRow_cfjcw_63:active{color:#fff;background:#0055b1cc}@media (pointer:coarse){._FilterButton_cfjcw_40{flex:1 0 auto;padding:4px 8px;font-size:13px}._EventList_cfjcw_57{gap:2px}._EventRow_cfjcw_63{padding-top:5px;padding-bottom:5px;font-size:14px}}._EventTime_cfjcw_120{font-variant-numeric:tabular-nums;opacity:.6;text-align:right;flex-shrink:0;min-width:3.5em;font-size:11px}._EventIcon_cfjcw_129{flex-shrink:0;align-items:center;margin:0 1px;font-size:13px;display:flex}._EventIcon_cfjcw_129[data-type=kill],._EventIcon_cfjcw_129[data-type=death]{color:#8a8380}._EventIcon_cfjcw_129[data-type=flag-cap]{color:#69db7c;margin:0;font-size:15px}._EventIcon_cfjcw_129[data-type=flag-grab],._EventIcon_cfjcw_129[data-type=flag-return]{margin:0;font-size:15px}._EventIcon_cfjcw_129[data-type=flag-cap][data-affinity=enemy]{color:#ff6b6b}._EventIcon_cfjcw_129[data-type=flag-cap][data-affinity=neutral]{color:#adb5bd}._EventIcon_cfjcw_129[data-type=match-start]{color:#74c0fc;margin:0;font-size:15px}._EventIcon_cfjcw_129[data-type=match-end]{color:#74c0fc}._EventDescription_cfjcw_172{text-overflow:ellipsis;overflow:hidden}._Empty_cfjcw_186{opacity:.5;text-align:center;padding:4px 10px 12px;font-size:12px}._Root_pb9qa_1{flex-direction:column;display:flex}._Empty_pb9qa_6{opacity:.5;text-align:center;padding:4px 10px 12px;font-size:12px}._TourAllButton_pb9qa_13{color:#fffc;cursor:pointer;background:0 0;border:0;justify-content:flex-start;align-self:flex-start;align-items:center;gap:6px;padding:10px 14px;font-family:inherit;font-size:14px;font-weight:500;display:flex}@media (hover:hover){._TourAllButton_pb9qa_13:hover{color:#fff}}._CategoryHeader_pb9qa_40{color:#fff9;text-transform:uppercase;letter-spacing:.04em;-webkit-user-select:none;user-select:none;align-items:baseline;gap:6px;padding:4px 4px 4px 14px;font-size:12px;font-weight:600;display:flex}._CategoryHeader_pb9qa_40:not(:first-child){border-top:1px solid #ffffff0f;padding-top:8px}._CategoryCount_pb9qa_58{opacity:.7;font-weight:400}._TourButton_pb9qa_63{color:#fffc;cursor:pointer;text-transform:none;background:0 0;border:0;border-radius:0;align-items:center;gap:5px;margin:0 0 0 auto;padding:6px 8px;font-family:inherit;font-size:12px;font-weight:500;display:flex}._PlayIcon_pb9qa_83{color:#74c0fc}._ExitIcon_pb9qa_87{color:#ff8363}@media (hover:hover){._TourButton_pb9qa_63:hover{color:#fff}}._ItemList_pb9qa_100{flex-direction:column;padding:0 0 8px;display:flex}._ItemRow_pb9qa_106{color:#fffc;text-align:left;cursor:pointer;white-space:nowrap;background:0 0;border:0;align-items:center;gap:4px;padding:4px 10px 4px 12px;font-family:inherit;font-size:13px;display:flex}._ItemRow_pb9qa_106 ._PlayIcon_pb9qa_83{font-size:12px}@media (hover:hover){._ItemRow_pb9qa_106:not(:hover) ._PlayIcon_pb9qa_83{visibility:hidden}}._ItemRow_pb9qa_106[data-active=true]{color:#fff;background:#0055b180}@media (hover:hover){._ItemRow_pb9qa_106:hover{background:#ffffff1a}._ItemRow_pb9qa_106[data-active=true]:hover{background:#0055b199}}._ItemRow_pb9qa_106:active{color:#fff;background:#0055b1cc}._ItemLabel_pb9qa_151{text-overflow:ellipsis;overflow:hidden}._TeamBadge_pb9qa_156{color:#fff;border-radius:2px;flex-shrink:0;margin:0 0 0 6px;padding:0 4px;font-size:11px;line-height:1.5}._TeamBadge_pb9qa_156[data-team="1"]{background:#086c8acc}._TeamBadge_pb9qa_156[data-team="2"]{background:#8f5e14cc}@media (pointer:coarse){._CategoryHeader_pb9qa_40{padding:6px 8px 6px 16px;font-size:13px}._TourButton_pb9qa_63{font-size:13px}._ItemRow_pb9qa_106{padding-top:6px;padding-bottom:6px;padding-left:14px;font-size:14px}}._InspectorControls_cm86c_1{z-index:2;font-size:13px;line-height:1.231;position:relative}._Dropdown_cm86c_8{flex-direction:column;justify-content:center;align-items:stretch;gap:0;display:flex}._Group_cm86c_16{flex-wrap:wrap;justify-content:center;align-items:center;gap:20px;display:flex}._CheckboxField_cm86c_24{grid-template-rows:auto auto;grid-template-columns:auto 1fr;align-items:center;gap:0 6px;margin:0 0 8px;display:grid}._CheckboxField_cm86c_24 input[type=checkbox]{grid-area:1/1;margin-left:0}._CheckboxField_cm86c_24 ._Label_cm86c_39{grid-area:1/2;align-items:center;gap:6px;display:flex}._Description_cm86c_47{opacity:.6;margin:2px 0 0;padding:0;font-size:12px;line-height:1.5}._CheckboxField_cm86c_24 ._Description_cm86c_47{grid-area:2/2}._Control_cm86c_60{justify-content:flex-end;align-items:center;gap:8px;display:flex}._Field_cm86c_67{grid-template-rows:auto auto;grid-template-columns:1fr auto;align-items:center;margin:0 0 12px;display:grid}._Field_cm86c_67:has(._Description_cm86c_47){margin:0 0 10px}._Field_cm86c_67 select{margin-bottom:6px}._Field_cm86c_67 input[type=range]{max-width:100px}._Field_cm86c_67 output{opacity:.7}._Tools_cm86c_91{flex-wrap:wrap;align-items:center;gap:8px;padding:10px;display:flex}._Field_cm86c_67 label{grid-area:1/1}._Field_cm86c_67 ._Control_cm86c_60{grid-area:1/2}._Field_cm86c_67 ._Description_cm86c_47{grid-area:2/1/auto/-1}._ForceRenderButton_cm86c_119{color:#4cb5ff;cursor:pointer;background:0 0;border:0;place-content:center;margin:0;padding:0 2px;font-size:16px;display:grid}._CloseSidebarButton_cm86c_131{margin:12px;padding-top:8px;padding-bottom:8px}@media (width>=900px){._CloseSidebarButton_cm86c_131{display:none}}@media (pointer:coarse){._Tools_cm86c_91{padding-top:12px;padding-bottom:13px}._Field_cm86c_67{grid-template-columns:auto minmax(0,70%);gap:0 20px;margin-bottom:20px}._CheckboxField_cm86c_24{margin-bottom:16px}._Description_cm86c_47{font-size:13px;line-height:1.53846}._Field_cm86c_67 label,._CheckboxField_cm86c_24 ._Label_cm86c_39{font-size:15px}._CheckboxField_cm86c_24 input[type=checkbox]{min-width:19px;min-height:19px;padding-right:6px}._Field_cm86c_67 select{width:100%;max-width:none;padding:4px 6px;font-size:15px}._Field_cm86c_67 input[type=range]{width:100%;max-width:none;padding-top:10px;padding-bottom:10px}}@media (width<=499px){._PopoverWrapper_avklz_97{width:auto!important;max-width:none!important;left:8px!important;right:8px!important;transform:translateY(44px)!important}._Popover_avklz_83{min-width:0}}@media (pointer:fine){._CloseButton_avklz_215{visibility:hidden}}@media (width<=899px){._InputWrapper_avklz_1{flex:1 1 0;max-width:460px;margin-left:4px}._Input_avklz_1{width:100%}}._InputWrapper_avklz_1{z-index:2;align-items:center;margin:10px 10px 10px 8px;display:flex;position:relative}._Shortcut_avklz_9{color:#fff9;pointer-events:none;background:#ffffff26;border-radius:3px;padding:1px 4px;font-family:system-ui,sans-serif;font-size:11px;position:absolute;right:7px}._Input_avklz_1[aria-expanded=true]~._Shortcut_avklz_9{display:none}._Input_avklz_1{color:#fff;-webkit-user-select:text;user-select:text;background:#0009;border:1px solid #ffffff4d;border-radius:3px;outline:none;width:280px;padding:6px 36px 6px 8px;font-size:14px}._Input_avklz_1[aria-expanded=true]{padding-right:8px}._Input_avklz_1:focus{border-color:#fff9}._Input_avklz_1::placeholder{color:#777;font-family:inherit;font-size:12px}._SelectedValue_avklz_52{pointer-events:none;align-items:center;gap:6px;display:flex;position:absolute;left:8px;right:36px;overflow:hidden}._Input_avklz_1[aria-expanded=true]~._SelectedValue_avklz_52{display:none}._SelectedName_avklz_67{color:#fff;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:600;line-height:1.28571;overflow:hidden}._SelectedValue_avklz_52>._ItemType_avklz_79{flex-shrink:0}._Popover_avklz_83{z-index:100;min-width:360px;max-height:var(--popover-available-height,90vh);overscroll-behavior:contain;background:#141414f2;border:1px solid #ffffff80;border-radius:3px;overflow:hidden auto;box-shadow:0 8px 24px #0009}@media (width<=499px){._PopoverWrapper_avklz_97{width:auto!important;max-width:none!important;left:8px!important;right:8px!important;transform:translateY(44px)!important}._Popover_avklz_83{min-width:0}}._List_avklz_110{padding:4px 0}._List_avklz_110:has(>._Group_avklz_114:first-child){padding-top:0}._Group_avklz_114{padding-bottom:4px}._GroupLabel_avklz_122{color:#c6caca;z-index:1;background:#3a4548f2;border-bottom:1px solid #ffffff4d;padding:6px 8px 6px 12px;font-size:13px;font-weight:600;position:sticky;top:0}._Group_avklz_114:not(:last-child){border-bottom:1px solid #ffffff4d}._Item_avklz_79{cursor:pointer;border-radius:4px;outline:none;flex-direction:column;gap:1px;margin:4px 4px 0;padding:6px 8px;scroll-margin-top:32px;display:flex}._List_avklz_110>._Item_avklz_79:first-child{margin-top:0}._Item_avklz_79[data-active-item]{background:#ffffff26}._Item_avklz_79[aria-selected=true]{background:#6496ff4d}._ItemHeader_avklz_162{align-items:center;gap:6px;display:flex}._ItemName_avklz_168{color:#fff;font-size:14px;font-weight:600}._ItemTypes_avklz_174{gap:3px;display:flex}._ItemType_avklz_79{color:#fff;background:#ff9d0066;border-radius:3px;padding:2px 5px;font-size:10px;font-weight:600;line-height:1.3}._ItemType_avklz_79:hover{background:#ff9d00b3}._ItemMissionName_avklz_193{color:#ffffff80;font-size:12px}._NoResults_avklz_198{color:#ffffff80;text-align:center;padding:12px 8px;font-size:13px}._Backdrop_avklz_205{z-index:1;background:#00000080;position:fixed;inset:0}._CloseButton_avklz_215{z-index:101;color:#ffffff80;background:0 0;border:0;flex:none;place-content:center;align-self:stretch;margin:0 0 0 -8px;padding:6px 12px 6px 8px;font-size:24px;display:grid;position:relative}@media (pointer:fine){._CloseButton_avklz_215{visibility:hidden}}._CloseButton_avklz_215[data-open=false]{visibility:hidden}@media (width<=899px){._InputWrapper_avklz_1{flex:1 1 0;max-width:460px;margin-left:4px}._Input_avklz_1{width:100%}}._Header_klnnn_1{flex:auto;justify-content:flex-start;align-items:center;gap:12px;display:flex}._MissionInfo_klnnn_9{color:#fff;background:0 0;border:1px solid #fff0;border-radius:3px;align-items:center;gap:6px;margin:10px auto 10px 4px;padding:5px 8px;display:flex}._MissionType_klnnn_25{pointer-events:none}._MissionTypeDisplayName_klnnn_30{opacity:.5;font-size:12px}._Metadata_klnnn_35{text-align:right;flex-direction:column;gap:2px;margin-left:4px;padding:8px 0;font-size:12px;line-height:1.16667;display:flex}._Attribution_klnnn_46,._ServerInfo_klnnn_47{color:#83938b}._PlayerName_klnnn_51,._RecordingDate_klnnn_52,._ServerName_klnnn_53{color:#eceae7}._EjectIcon_klnnn_62{margin-top:-.5px;font-size:21px}._Error_klnnn_67{color:#ff6a45}@media (width<=899px){._Metadata_klnnn_35{display:none}._MissionInfo_klnnn_9{margin-left:0}}._Pulsing_klnnn_81{animation:1.2s ease-out infinite _blink_klnnn_1}._ConnectionPing_klnnn_85{background:#ffffff1a;border-radius:12px;align-items:center;gap:6px;padding:5px 8px;font-size:12px;display:inline-flex}._PingDot_klnnn_95{background:currentColor;border-radius:3px;width:6px;height:6px;display:inline-block}._ConnectionPing_klnnn_85[data-quality=good] ._PingDot_klnnn_95{color:#74ff45}._ConnectionPing_klnnn_85[data-quality=fine] ._PingDot_klnnn_95{color:#ff9e2f}._ConnectionPing_klnnn_85[data-quality=poor] ._PingDot_klnnn_95{color:#e83f25}@keyframes _blink_klnnn_1{0%{opacity:1}to{opacity:.25}}._LoadingIndicator_8ijel_1{pointer-events:none;z-index:1;opacity:.8;flex-direction:column;align-items:center;gap:16px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._LoadingIndicator_8ijel_1[data-complete=true]{animation:.3s ease-out forwards _loadingComplete_8ijel_1}._Spinner_8ijel_19{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite _spin_8ijel_1}._Progress_8ijel_28{background:#fff3;border-radius:2px;width:200px;height:4px;overflow:hidden}._ProgressBar_8ijel_36{background:#fff;border-radius:2px;height:100%;transition:width .1s ease-out}._ProgressText_8ijel_43{color:#ffffffb3;font-variant-numeric:tabular-nums;font-size:14px}._LoadingIndicator_8ijel_1[data-indeterminate=true] ._Progress_8ijel_28,._LoadingIndicator_8ijel_1[data-indeterminate=true] ._ProgressText_8ijel_43{display:none}@keyframes _spin_8ijel_1{to{transform:rotate(360deg)}}@keyframes _loadingComplete_8ijel_1{0%{opacity:1}to{opacity:0}}._Dialog_1t9wa_1{color:#b0d5c9;-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;background:#142526cc;border:1px solid #41838b99;border-radius:4px;outline:none;min-width:120px;max-width:calc(100dvw - 40px);min-height:120px;max-height:calc(100dvh - 40px);font-size:14px;line-height:1.5;position:relative;overflow:hidden;box-shadow:0 0 50px #0006,inset 0 0 60px #01070d99}._Overlay_1t9wa_22{z-index:10;background:#000000b3;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}._DialogButton_1t9wa_33{color:#99fff1;text-shadow:0 -1px 1px #0006;cursor:pointer;background:linear-gradient(#30a497cc,#1f9688cc 33%,#218377cc 67%,#046564cc);border:1px solid #387c74cc;border-top-color:#57b7b9cc;border-radius:4px;padding:4px 18px;font-family:inherit;font-size:14px;font-weight:500;box-shadow:inset 0 0 4px #02808e80}._DialogButton_1t9wa_33:hover:not(:disabled){color:#b1fff5;border:1px solid #409188e6;border-top-color:#5ac6c2e6;box-shadow:inset 0 0 4px #02808e80,0 0 5px #3effbf80}._DialogButton_1t9wa_33:active:not(:disabled){transform:translateY(1px)}._DialogButton_1t9wa_33:disabled{opacity:.4;cursor:not-allowed}._Secondary_1t9wa_72{box-shadow:none;color:#a2e2cfcc;text-shadow:none;background:0 0;border:1px solid #387c74cc}._Secondary_1t9wa_72:hover:not(:disabled){color:#a9ffe5cc;border:1px solid #3f9087e6}._Actions_1t9wa_86{align-items:center;gap:10px;display:flex}@media (width<=719px){._Dialog_1t9wa_1{border-radius:0;max-width:calc(100dvw - 20px);max-height:calc(100dvh - 20px)}}@media (width<=639px){._Overlay_1t9wa_22{padding:10px}}._Button_n870r_1{color:#fff;cursor:pointer;opacity:.6;background:0 0;border:0;border-radius:0;flex:none;place-content:center;align-self:stretch;min-width:30px;min-height:30px;margin:0 0 0 2px;padding:2px 4px 2px 8px;font-size:24px;display:grid}._Button_n870r_1:active,._Button_n870r_1[data-active=true]{opacity:1;transform:translateY(1px)}._Button_n870r_1[data-orientation=top]{min-width:48px;min-height:48px;margin:0;display:none}@media (hover:hover){._Button_n870r_1:not(:disabled):hover{opacity:1}}._Button_n870r_1 svg{pointer-events:none}@media (width<=899px){._Button_n870r_1[data-orientation=left]{display:none}._Button_n870r_1[data-orientation=top]{display:grid}}@media (pointer:coarse){._Button_n870r_1{font-size:28px}}._Button_wk3rb_1{gap:6px;margin:0 10px 0 auto;padding:4px 10px 4px 6px;font-size:20px}._ButtonLabel_wk3rb_9{font-size:13px;font-weight:500}@media (width<=799px){._Button_wk3rb_1{margin:0 10px 0 0;padding-right:6px}._Button_wk3rb_1 ._ButtonLabel_wk3rb_9{display:none}}._Frame_1u5rk_1{grid-template:"sidebar toolbar""sidebar content"1fr"sidebar footer"/auto 1fr;width:100dvw;height:100dvh;display:grid;overflow:hidden}._Toolbar_1u5rk_16{color:#fff;z-index:3;view-transition-class:layout;background:#191f1f;border-bottom:1px solid #465555;grid-area:toolbar;align-items:center;display:flex;position:relative;box-shadow:0 0 3px 1px #0006}._Sidebar_1u5rk_29{color:#fff;z-index:2;background:#191f1f;border-right:1px solid #465555;grid-area:sidebar;width:320px;height:100%;min-height:0;position:relative;overflow-y:auto;box-shadow:0 0 3px 1px #0006}._Content_1u5rk_43{z-index:0;grid-area:content;min-width:0;min-height:0;position:relative;overflow:hidden}._ThreeView_1u5rk_52{z-index:0;position:absolute;inset:0}._PlayerBar_1u5rk_61{color:#fff;z-index:1;background:#191f1f;border-top:1px solid #465555;grid-area:footer;position:relative;box-shadow:0 0 3px 1px #0006}._Backdrop_1u5rk_71{display:none}@media (width<=899px){._Frame_1u5rk_1{grid-template:"toolbar""content"1fr"footer"/1fr;display:grid}._Sidebar_1u5rk_29{border:1px solid #465555;border-top:0;grid-area:content-start/content/footer-end;justify-self:center;width:auto;max-width:500px;height:calc(100% + 1px);margin:0 -1px}._Toolbar_1u5rk_16{justify-content:space-between}._Backdrop_1u5rk_71{z-index:2;background:#000000b3;display:block;position:fixed;inset:0}} diff --git a/docs/assets/index-DfaykQpF.js b/docs/assets/index-DfaykQpF.js new file mode 100644 index 00000000..7364af67 --- /dev/null +++ b/docs/assets/index-DfaykQpF.js @@ -0,0 +1,12 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/demoStreaming-Tnv976xF.js","assets/streamHelpers-D2N8suZp.js","assets/chunk-DECur_0Z.js","assets/three.module-07hRbor4.js","assets/scene-BdOVRsxo.js","assets/logger-z_EpIdIa.js","assets/demoTimelineScanner-BGzL-XZF.js","assets/TouchHandler-BGxxpP92.js","assets/react-three-fiber.esm-CgPHUpXo.js","assets/jsx-runtime-BpGWiA-R.js","assets/traditional-BTL5qX2E.js","assets/SettingsProvider-CCHVZuSg.js","assets/manifest-CirqV3Ls.js","assets/stringUtils-EmGsjr9D.js","assets/JoystickContext-YJ6eVLFP.js","assets/TouchJoystick-DYqKShVz.js","assets/preload-helper-CwUjIIrH.js","assets/TouchJoystick-Dn73xHvm.css","assets/KeyboardOverlay-Du-YZ_-q.js","assets/gr-1PcjgMj0.js","assets/iconBase-BCRUFbxq.js","assets/cameraTourStore-PEzPVGnX.js","assets/KeyboardOverlay-CpSto9KR.css","assets/GameView-C7uJjiJd.js","assets/mission-Bem2ztlS.js","assets/extends-COZGby3T.js","assets/GenericShape-FZ5loHEW.js","assets/Texture-CIsc25mc.js","assets/useBaseQuery-Co62zxSo.js","assets/FloatingLabel-Bm1LwAgd.js","assets/Html-DTt-Asp4.js","assets/FloatingLabel-DfptgH-Y.css","assets/globalFogUniforms-CtxQvsRj.js","assets/loaders-CIpiZadQ.js","assets/engineStore-Dkm20jvr.js","assets/middleware-DPacZrFu.js","assets/useQuery-lKBLxuin.js","assets/AudioContext-CMp1T7r9.js","assets/DebugSuspense-Dk4MzcWf.js","assets/ShapeErrorBoundary-CJ_4YTMy.js","assets/gameEntityTypes-B1KihaDt.js","assets/streamPlaybackStore-DhJekvnx.js","assets/GameView-PJcE9IRi.css","assets/DemoPlaybackControls-D--l_WXN.js","assets/DemoPlaybackControls-D1aGRzqE.css","assets/PlayerHUD-IFZkOeCb.js","assets/PlayerHUD-DWa6gIym.css","assets/MapInfoDialog-C3Dk90R7.js","assets/MapInfoDialog-qPSE5ow_.css","assets/ServerBrowser-DxPc-p2a.js","assets/ServerBrowser-B1ZZ25fp.css","assets/ScoreScreen-oQegOqLS.js","assets/ScoreScreen-FWyMMObP.css"])))=>i.map(i=>d[i]); +import{r as e,t}from"./chunk-DECur_0Z.js";import{n,r,t as i}from"./jsx-runtime-BpGWiA-R.js";import{i as a,o,s}from"./react-three-fiber.esm-CgPHUpXo.js";import{a as c,c as l,d as u,f as d,i as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x}from"./SettingsProvider-CCHVZuSg.js";import{t as S}from"./iconBase-BCRUFbxq.js";import{l as C,n as w,r as T,s as E}from"./manifest-CirqV3Ls.js";import{n as D,r as O,t as k}from"./stringUtils-EmGsjr9D.js";import{t as A}from"./logger-z_EpIdIa.js";import{i as j,n as M,r as ee}from"./traditional-BTL5qX2E.js";import{n as te,t as N}from"./cameraTourStore-PEzPVGnX.js";import{C as P,D as ne,E as re,O as F,S as ie,T as ae,_ as I,a as oe,b as L,c as se,f as ce,g as le,h as ue,i as de,k as fe,l as pe,m as me,o as he,p as ge,r as _e,s as ve,t as ye,u as be,v as xe,w as Se,x as Ce,y as we}from"./streamHelpers-D2N8suZp.js";import{St as Te,Ut as Ee}from"./three.module-07hRbor4.js";import{i as De}from"./scene-BdOVRsxo.js";import{i as Oe}from"./mission-Bem2ztlS.js";import{t as ke}from"./middleware-DPacZrFu.js";import{i as Ae,r as je}from"./engineStore-Dkm20jvr.js";import{t as Me}from"./preload-helper-CwUjIIrH.js";import{t as Ne}from"./JoystickContext-YJ6eVLFP.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Pe=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Pe()})),Ie=t((e=>{var t=s(),n=r(),i=Fe();function a(e){var t=`https://react.dev/errors/`+e;if(1F||(e.current=re[F],re[F]=null,F--)}function I(e,t){F++,re[F]=e.current,e.current=t}var oe=ie(null),L=ie(null),se=ie(null),ce=ie(null);function le(e,t){switch(I(se,t),I(L,e),I(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(oe),I(oe,e)}function ue(){ae(oe),ae(L),ae(se)}function de(e){e.memoizedState!==null&&I(ce,e);var t=oe.current,n=Hd(t,e.type);t!==n&&(I(L,e),I(oe,n))}function fe(e){L.current===e&&(ae(oe),ae(L)),ce.current===e&&(ae(ce),Qf._currentValue=ne)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Ie=null;function Le(e){if(typeof Me==`function`&&Ne(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Pe,e)}catch{}}var Re=Math.clz32?Math.clz32:ze,R=Math.log,z=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(R(e)/z|0)|0}var Be=256,Ve=262144,He=4194304;function Ue(e){var t=e&42;if(t!==0)return t;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: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(e,t){switch(e){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 qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),cn=!1;if(sn)try{var ln={};Object.defineProperty(ln,`passive`,{get:function(){cn=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{cn=!1}var un=null,dn=null,fn=null;function pn(){if(fn)return fn;var e,t=dn,n=t.length,r,i=`value`in un?un.value:un.textContent,a=i.length;for(e=0;e=Gn),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Wn&&Xn(e,t)?(e=pn(),fn=dn=un=null,Qn=!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=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Sr(n)}}function wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ft(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ft(e.document)}return t}function Er(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`)}var Dr=sn&&`documentMode`in document&&11>=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==Ft(r)||(r=Or,`selectionStart`in r&&Er(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&xr(Ar,r)||(Ar=r,r=Ed(kr,`onSelect`),0>=o,i-=o,wi=1<<32-Re(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),V&&Ei(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),V&&Ei(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return V&&Ei(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),V&&Ei(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===v&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Ea(l)===r.type){n(e,r.sibling),c=i(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===v?(c=di(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ui(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case _:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=mi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Ea(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ma(o),c);if(o.$$typeof===S)return b(e,r,ea(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=fi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Y&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ri(e),ni(e,null,n),t}return $r(e,r,t,n),ri(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=N.T,s={};N.T=s,As(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,ma(c,r),fu(e)):ks(e,t,r,fu(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=xs(e).queue;vs(e,i,t,ne,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},fu())}function Cs(){return $i(Qf)}function ws(){return G().memoizedState}function Ts(){return G().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Va(n);var r=Ha(t,e,n);r!==null&&(mu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=ei(e,t,n,r),n!==null&&(mu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,fu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,br(s,o))return $r(e,t,i,0),Il===null&&Qr(),!1}catch{}if(n=ei(e,t,i,r),n!==null)return mu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(a(479))}else t=ei(e,n,r,2),t!==null&&mu(t,e,2)}function js(e){var t=e.alternate;return e===U||t!==null&&t===U}function Ms(e,t){mo=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}var Ps={readContext:$i,use:jo,useCallback:W,useContext:W,useEffect:W,useImperativeHandle:W,useLayoutEffect:W,useInsertionEffect:W,useMemo:W,useReducer:W,useRef:W,useState:W,useDebugValue:W,useDeferredValue:W,useTransition:W,useSyncExternalStore:W,useId:W,useHostTransitionStatus:W,useFormState:W,useActionState:W,useOptimistic:W,useMemoCache:W,useCacheRefresh:W};Ps.useEffectEvent=W;var Fs={readContext:$i,use:jo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(ho){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(ho){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=Os.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(Oo(),e,t)},useTransition:function(){var e=Uo(!1);return e=vs.bind(null,U,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,i=Oo();if(V){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Il===null)throw Error(a(349));Z&127||Ro(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,os(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=Il.identifierPrefix;if(V){var n=Ti,r=wi;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=go++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[at]=t,o[ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=se.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ji,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Ii(t,!0)}else e=Bd(e).createTextNode(r),e[at]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[at]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(a(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[at]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),i=!1}else i=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return ue(),e===null&&Sd(t.stateNode.containerInfo),Pc(t),null;case 10:return qi(t.type),Pc(t),null;case 19:if(ae(so),r=t.memoizedState,r===null)return Pc(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Nc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)li(n,e),n=n.sibling;return I(so,so.current&1|2),V&&Ei(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>eu&&(t.flags|=128,i=!0,Nc(r,!1),t.lanes=4194304)}else{if(!i)if(e=co(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!V)return Pc(t),null}else 2*Te()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,i=!0,Nc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=so.current,I(so,i?n&1|2:n&1),V&&Ei(t,r.treeForkCount),e);case 22:case 23:return oo(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ae(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),Pc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Ic(e,t){switch(ki(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(a(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(so),null;case 4:return ue(),null;case 10:return qi(t.type),null;case 22:case 23:return oo(t),eo(),e!==null&&ae(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function Lc(e,t){switch(ki(t),t.tag){case 3:qi(aa),ue();break;case 26:case 27:case 5:fe(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:ae(so);break;case 10:qi(t.type);break;case 22:case 23:oo(t),eo(),e!==null&&ae(ga);break;case 24:qi(aa)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Wu(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Wu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Wu(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){Wu(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Wu(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Wu(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Wu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Wu(e,t,n)}else n.current=null}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Wu(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ot]=t}catch(t){Wu(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(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.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[at]=e,t[ot]=n}catch(t){Wu(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,J=typeof WeakSet==`function`?WeakSet:Set,el=null;function tl(e,t){if(e=e.containerInfo,Rd=sp,e=Tr(e),Er(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,el=t;el!==null;)if(t=el,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,el=e;else for(;el!==null;){switch(t=el,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[at]=e,vt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Cr(s,h),v=Cr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,N.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,Y&6)throw Error(a(331));var c=Y;if(Y|=4,jl(o.current),Cl(o,o.current,s,n),Y=c,id(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{P.p=i,N.T=r,Bu(e,t)}}function Uu(e,t,n){t=gi(n,t),t=Js(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Ye(e,2),rd(e))}function Wu(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=gi(n,e),n=Ys(2),r=Ha(t,n,2),r!==null&&(Xs(n,r,t,e),Ye(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Vl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Z&n)===n&&(Ul===4||Ul===3&&(Z&62914560)===Z&&300>Te()-Ql?!(Y&2)&&xu(e,0):Kl|=n,Jl===Z&&(Jl=0)),rd(e)}function qu(e,t){t===0&&(t=qe()),e=ti(e,t),e!==null&&(Ye(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return xe(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Z,a=We(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ge(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Te(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}ru!==0&&ru!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=_t(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);vt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=se.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=_t(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=_t(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=_t(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Lt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),vt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Lt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,vt(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),vt(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,vt(i),i):(r=n,(i=mf.get(o))&&(r=m({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),vt(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){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;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ie()})),Re=e(Le(),1),R=e(r(),1),z=n();function ze(e,t,n){return r=>{if(!(t.length===0||t.some(t=>!x(r.getAll(t),e.getAll(t)))))return _("[nuqs `%s`] no change, returning previous",t.join(`,`),r),r;let i=Be(e,t,n);return _(`[nuqs \`%s\`] subbed search params change + from %O + to %O`,t.join(`,`),r,i),i}}function Be(e,t,n){if(t.length===0)return e;let r=n?new URLSearchParams(e):e;for(let n of e.keys())t.includes(n)||r.delete(n);return r}var Ve=`__nuqs__`,He=u();function Ue(e){return function(t,n){let r=new URL(location.href);r.search=m(t),_(`[nuqs react] Updating url: %s`,r),e&&n.shallow===!1?(n.history===`push`?location.assign:location.replace).call(location,r):(n.history===`push`?history.pushState:history.replaceState).call(history,history.state,Ve,r),He.emit(`update`,t),n.scroll===!0&&window.scrollTo({top:0})}}var We=(0,R.createContext)({fullPageNavigationOnShallowFalseUpdates:!1});function Ge(e){let{fullPageNavigationOnShallowFalseUpdates:t}=(0,R.useContext)(We),[n,r]=(0,R.useState)(()=>typeof location>`u`?new URLSearchParams:Be(new URLSearchParams(location.search),e,!1));return(0,R.useEffect)(()=>{let t=()=>{r(ze(new URLSearchParams(location.search),e,!1))},n=t=>{r(ze(t,e,!0))};return He.on(`update`,n),window.addEventListener(`popstate`,t),()=>{He.off(`update`,n),window.removeEventListener(`popstate`,t)}},[e.join(`&`)]),{searchParams:n,updateUrl:(0,R.useMemo)(()=>Ue(t),[t])}}var Ke=d(Ge);function qe({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return(0,R.createElement)(We.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},(0,R.createElement)(Ke,{...n,children:e}))}var Je=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ye=new class extends Je{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Xe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ze=new class{#e=Xe;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Qe(e){setTimeout(e,0)}var $e=typeof window>`u`||`Deno`in globalThis;function et(){}function tt(e,t){return typeof e==`function`?e(t):e}function nt(e){return typeof e==`number`&&e>=0&&e!==1/0}function rt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function it(e,t){return typeof e==`function`?e(t):e}function at(e,t){return typeof e==`function`?e(t):e}function ot(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ct(o,t.options))return!1}else if(!ut(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function st(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(lt(t.options.mutationKey)!==lt(a))return!1}else if(!ut(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ct(e,t){return(t?.queryKeyHashFn||lt)(e)}function lt(e){return JSON.stringify(e,(e,t)=>ht(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ut(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ut(e[n],t[n])):!1}var dt=Object.prototype.hasOwnProperty;function ft(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=mt(e)&&mt(t);if(!r&&!(ht(e)&&ht(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{Ze.setTimeout(t,e)})}function vt(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ft(e,t)}function yt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function bt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xt=Symbol();function St(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===xt?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ct(e,t){return typeof e==`function`?e(...t):!!e}function wt(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Tt=(()=>{let e=()=>$e;return{isServer(){return e()},setIsServer(t){e=t}}})();function Et(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Dt=Qe;function Ot(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Dt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var kt=Ot(),At=new class extends Je{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function jt(e){return Math.min(1e3*2**e,3e4)}function Mt(e){return(e??`online`)===`online`?At.isOnline():!0}var Nt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Pt(e){let t=!1,n=0,r,i=Et(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Nt(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Ye.isFocused()&&(e.networkMode===`always`||At.isOnline())&&e.canRun(),u=()=>Mt(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Tt.isServer()?0:3),o=e.retryDelay??jt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&nl()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Ft=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nt(this.gcTime)&&(this.#e=Ze.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Tt.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Ze.clearTimeout(this.#e),void 0)}},It=class extends Ft{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=zt(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=zt(this.options);e.data!==void 0&&(this.setState(Rt(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=vt(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(et).catch(et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>at(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xt||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>it(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!rt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=St(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Pt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Nt&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Nt){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Lt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Rt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),kt.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Lt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Rt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function zt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function Bt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{wt(e,()=>t.signal,()=>n=!0)},u=St(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?bt:yt;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ht:Vt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Vt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Vt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ht(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ut=class extends Ft{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Wt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Pt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),kt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Wt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Gt=class extends Je{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ut({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Kt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Kt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Kt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Kt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){kt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>st(t,e))}findAll(e={}){return this.getAll().filter(t=>st(e,t))}notify(e){kt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return kt.batch(()=>Promise.all(e.map(e=>e.continue().catch(et))))}};function Kt(e){return e.options.scope?.id}var qt=class extends Je{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ct(r,t),a=this.get(i);return a||(a=new It({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){kt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ot(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ot(e,t)):t}notify(e){kt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Jt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new qt,this.#t=e.mutationCache||new Gt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=At.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(it(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=tt(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return kt.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;kt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return kt.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=kt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(et).catch(et)}invalidateQueries(e,t={}){return kt.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=kt.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(et)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(et)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(it(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(et).catch(et)}fetchInfiniteQuery(e){return e.behavior=Bt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(et).catch(et)}ensureInfiniteQueryData(e){return e.behavior=Bt(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return At.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(lt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ut(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(lt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ut(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ct(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===xt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},B=i(),Yt=R.createContext(void 0),Xt=e=>{let t=R.useContext(Yt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Zt=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,B.jsx)(Yt.Provider,{value:e,children:t})),Qt=(0,R.createContext)({live:!1});function $t(){return(0,R.useContext)(Qt)}function en(e){let t=(0,z.c)(5),{children:n}=e,[r]=p(`features`,l),i;t[0]===r?i=t[1]:(i=()=>({live:new Set((r??``).split(`,`).map(tn).filter(Boolean)).has(`live`)}),t[0]=r,t[1]=i);let[a]=(0,R.useState)(i),o;return t[2]!==n||t[3]!==a?(o=(0,B.jsx)(Qt.Provider,{value:a,children:n}),t[2]=n,t[3]=a,t[4]=o):o=t[4],o}function tn(e){return e.trim().toLowerCase()}function nn(e){return S({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z`},child:[]}]})(e)}function rn(e){return S({tag:`svg`,attr:{viewBox:`0 0 384 512`},child:[{tag:`path`,attr:{d:`M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`},child:[]}]})(e)}function an(e){return S({tag:`svg`,attr:{viewBox:`0 0 384 512`},child:[{tag:`path`,attr:{d:`M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z`},child:[]}]})(e)}function on(e){return S({tag:`svg`,attr:{viewBox:`0 0 448 512`},child:[{tag:`path`,attr:{d:`M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z`},child:[]}]})(e)}function sn(e){return S({tag:`svg`,attr:{viewBox:`0 0 448 512`},child:[{tag:`path`,attr:{d:`M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z`},child:[]}]})(e)}function cn(e){return S({tag:`svg`,attr:{viewBox:`0 0 384 512`},child:[{tag:`path`,attr:{d:`M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 370.8 224 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`},child:[]}]})(e)}function ln(e){return S({tag:`svg`,attr:{viewBox:`0 0 576 512`},child:[{tag:`path`,attr:{d:`M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z`},child:[]}]})(e)}function un(e){return S({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z`},child:[]}]})(e)}function dn(e){return S({tag:`svg`,attr:{viewBox:`0 0 288 512`},child:[{tag:`path`,attr:{d:`M112 316.94v156.69l22.02 33.02c4.75 7.12 15.22 7.12 19.97 0L176 473.63V316.94c-10.39 1.92-21.06 3.06-32 3.06s-21.61-1.14-32-3.06zM144 0C64.47 0 0 64.47 0 144s64.47 144 144 144 144-64.47 144-144S223.53 0 144 0zm0 76c-37.5 0-68 30.5-68 68 0 6.62-5.38 12-12 12s-12-5.38-12-12c0-50.73 41.28-92 92-92 6.62 0 12 5.38 12 12s-5.38 12-12 12z`},child:[]}]})(e)}function fn(e){return S({tag:`svg`,attr:{viewBox:`0 0 320 512`},child:[{tag:`path`,attr:{d:`M177 255.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 351.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 425.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1zm-34-192L7 199.7c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l96.4-96.4 96.4 96.4c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9l-136-136c-9.2-9.4-24.4-9.4-33.8 0z`},child:[]}]})(e)}function pn(e){return S({tag:`svg`,attr:{viewBox:`0 0 320 512`},child:[{tag:`path`,attr:{d:`M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z`},child:[]}]})(e)}var mn={Button:`_Button_p0g82_2`,ButtonLabel:`_ButtonLabel_p0g82_37`,Icon:`_Icon_p0g82_85`,ButtonHint:`_ButtonHint_p0g82_92`,ButtonGroup:`_ButtonGroup_p0g82_97`,DestructiveActionButton:`_DestructiveActionButton_p0g82_141 _Button_p0g82_2`},hn={Button:`_Button_1xmvi_1 _Button_p0g82_2`,ClipboardIcon:`_ClipboardIcon_1xmvi_10`,showClipboardCheck:`_showClipboardCheck_1xmvi_1`,PinIcon:`_PinIcon_1xmvi_20`};function gn({position:e,quaternion:t}){let n=e=>parseFloat(e.toFixed(3));return`#c${`${n(e.x)},${n(e.y)},${n(e.z)}`}~${`${n(t.x)},${n(t.y)},${n(t.z)},${n(t.w)}`}`}function _n(e){let t=(0,z.c)(12),{cameraRef:n,missionName:r,missionType:i,disabled:a}=e,{fogEnabled:o}=c(),[s,l]=(0,R.useState)(!1),u=(0,R.useRef)(null),d;t[0]!==n||t[1]!==o||t[2]!==r||t[3]!==i?(d=async()=>{u.current&&clearTimeout(u.current);let e=n.current;if(!e)return;let t=gn(e),a=new URLSearchParams,s=i?`${r}~${i}`:r;a.set(`mission`,s),a.set(`fog`,o.toString());let c=`${window.location.pathname}?${a}${t}`,d=`${window.location.origin}${c}`;window.history.replaceState(null,``,c);try{await navigator.clipboard.writeText(d),l(!0),u.current=setTimeout(()=>{l(!1)},1100)}catch(e){console.error(e)}},t[0]=n,t[1]=o,t[2]=r,t[3]=i,t[4]=d):d=t[4];let f=d,p=s?`true`:`false`,m,h,g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,B.jsx)(dn,{className:hn.PinIcon}),h=(0,B.jsx)(rn,{className:hn.ClipboardIcon}),g=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:` Link to coordinates`}),t[5]=m,t[6]=h,t[7]=g):(m=t[5],h=t[6],g=t[7]);let _;return t[8]!==a||t[9]!==f||t[10]!==p?(_=(0,B.jsxs)(`button`,{type:`button`,className:hn.Button,"aria-label":`Link to coordinates`,title:`Copy the current coordinates to URL`,onClick:f,disabled:a,"data-copied":p,id:`copyCoordinatesButton`,children:[m,h,g]}),t[8]=a,t[9]=f,t[10]=p,t[11]=_):_=t[11],_}function vn(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0V0z`},child:[]},{tag:`path`,attr:{d:`M21 3H3c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5a2 2 0 0 0-2-2zm0 14H3V5h18v12zm-5-6-7 4V7z`},child:[]}]})(e)}function yn(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`m18.89 14.75-4.09-2.04c-.28-.14-.58-.21-.89-.21H13v-6c0-.83-.67-1.5-1.5-1.5S10 5.67 10 6.5v10.74l-3.25-.74a.99.99 0 0 0-.92.28l-.83.84 4.54 4.79c.38.38 1.14.59 1.67.59h6.16c1 0 1.84-.73 1.98-1.72l.63-4.46c.12-.85-.32-1.68-1.09-2.07z`},child:[]},{tag:`path`,attr:{d:`M20.13 3.87C18.69 2.17 15.6 1 12 1S5.31 2.17 3.87 3.87L2 2v5h5L4.93 4.93c1-1.29 3.7-2.43 7.07-2.43s6.07 1.14 7.07 2.43L17 7h5V2l-1.87 1.87z`},child:[]}]})(e)}var bn=j(e=>({events:null,scanProgress:null,setEvents(t){e({events:t})},setScanProgress(t){e({scanProgress:t})},reset(){e({events:null,scanProgress:null})}}));function xn(e,t){return M(bn,e,t)}var Sn=A(`relayClient`),Cn=class{ws=null;handlers;url;_connected=!1;wsPingInterval=null;smoothedWsPing=0;constructor(e,t){this.url=e,this.handlers=t}get connected(){return this._connected}connect(){this.ws=new WebSocket(this.url),this.ws.binaryType=`arraybuffer`,this.ws.onopen=()=>{Sn.info(`WebSocket connected to %s`,this.url),this._connected=!0,this.startWsPing(),this.handlers.onOpen?.()},this.ws.onmessage=e=>{if(e.data instanceof ArrayBuffer)this.handlers.onGamePacket?.(new Uint8Array(e.data));else try{let t=JSON.parse(e.data);this.handleMessage(t)}catch(e){Sn.error(`Failed to parse relay message: %o`,e)}},this.ws.onclose=()=>{Sn.info(`WebSocket disconnected`),this._connected=!1,this.stopWsPing(),this.handlers.onClose?.()},this.ws.onerror=()=>{Sn.error(`WebSocket error`),this.handlers.onError?.(`WebSocket connection error`)}}handleMessage(e){switch(e.type){case`serverList`:this.handlers.onServerList?.(e.servers);break;case`status`:this.handlers.onStatus?.(e.status,e.message,e.connectSequence,e.mapName);break;case`ping`:this.handlers.onPing?.(e.ms);break;case`wsPong`:{let t=Date.now()-e.ts;this.smoothedWsPing=this.smoothedWsPing===0?t:this.smoothedWsPing*.5+t*.5,this.handlers.onWsPing?.(Math.round(this.smoothedWsPing));break}case`error`:this.handlers.onError?.(e.message);break}}listServers(){this.send({type:`listServers`})}sendWsPing(){this.send({type:`wsPing`,ts:Date.now()})}joinServer(e,t){Sn.info(`Joining server: %s`,e),this.send({type:`joinServer`,address:e,warriorName:t})}sendAuthEvent(e,t){this.send({type:`sendCommand`,command:e,args:t})}sendCommand(e,t){this.send({type:`sendCommand`,command:e,args:t})}sendCRCResponse(e,t,n){this.send({type:`sendCRCResponse`,crcValue:e,field1:t,field2:n})}sendCRCCompute(e,t,n,r){this.send({type:`sendCRCCompute`,seed:e,field2:t,includeTextures:r,datablocks:n})}sendGhostAck(e,t){this.send({type:`sendGhostAck`,sequence:e,ghostCount:t})}sendMoves(e,t){this.send({type:`sendMoves`,moves:e,moveStartIndex:t})}close(){this.stopWsPing(),this.ws&&=(this.ws.close(),null),this._connected=!1}startWsPing(){this.smoothedWsPing=0,this.send({type:`wsPing`,ts:Date.now()}),this.wsPingInterval=setInterval(()=>{this.send({type:`wsPing`,ts:Date.now()})},7e3)}stopWsPing(){this.wsPingInterval!=null&&(clearInterval(this.wsPingInterval),this.wsPingInterval=null)}send(e){this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):Sn.warn(`send dropped (ws not open): %s`,e.type)}},wn=256,Tn=wn/2,En=2048,Dn=null;function On(e){Dn=e}function kn(e,t){return Dn?Dn(e,t):null}function An(e,t){return(n,r)=>{let i=n/t+Tn,a=r/t+Tn,o=Math.max(0,Math.min(wn-1,i)),s=Math.max(0,Math.min(wn-1,a)),c=Math.floor(o),l=Math.floor(s),u=Math.min(c+1,wn-1),d=Math.min(l+1,wn-1),f=o-c,p=s-l,m=e[l*wn+c],h=e[l*wn+u],g=e[d*wn+c],_=e[d*wn+u],v=m*(1-f)+h*f,y=g*(1-f)+_*f;return(v*(1-p)+y*p)/65535*En}}var jn=A(`StreamEngine`),Mn=class{registry;ghostTracker;entities=new Map;entityIdByGhostIndex=new Map;tickCount=0;camera=null;chatMessages=[];chatMessageIdCounter=0;_chatGen=0;_chatSnapshotGen=-1;_chatSnapshot=[];audioEvents=[];netStrings=new Map;targetNames=new Map;targetTeams=new Map;targetRenderFlags=new Map;pendingNameTags=new Map;sensorGroupColors=new Map;playerSensorGroup=0;lastStatus={health:1,energy:1};latestControl={ghostIndex:-1};controlPlayerGhostId;lastControlType=`camera`;isPiloting=!1;lastPilotGhostIndex;lastVehicleHeading=0;lastVehiclePitch=0;lastVehicleOrbitDir;lastVehicleVelocity;lastVehiclePosTime=0;lastVehiclePos;firstPerson=!0;lastCameraMode;lastOrbitGhostIndex;lastOrbitDistance;latestFov=90;weaponsHud={slots:new Map,activeIndex:-1};backpackHud={packIndex:-1,active:!1,text:``};inventoryHud={slots:new Map,activeSlot:-1};teamScores=[];playerRoster=new Map;clockAnchorStreamSec=null;clockDurationMs=0;missionDisplayName=null;missionTypeDisplayName=null;gameClassName=null;serverDisplayName=null;connectedPlayerName=null;connectedClientId=null;onMissionInfoChange;nextExplosionId=0;resolveGhostClassName(e,t){if(typeof t==`number`){let e=this.registry.getGhostParser(t)?.name;if(e)return e}let n=this.entityIdByGhostIndex.get(e);if(n){let e=this.entities.get(n);if(e?.className)return e.className}let r=this.ghostTracker.getGhost(e);if(r?.className)return r.className}resolveEntityIdForGhostIndex(e){let t=this.entityIdByGhostIndex.get(e);if(t)return t;let n=this.ghostTracker.getGhost(e);if(n)return ne(n.className,e)}resetSharedState(){this.entities.clear(),this.entityIdByGhostIndex.clear(),this.tickCount=0,this.camera=null,this.chatMessages=[],this.chatMessageIdCounter=0,this._chatGen=0,this._chatSnapshotGen=-1,this._chatSnapshot=[],this.audioEvents=[],this.netStrings.clear(),this.targetNames.clear(),this.targetTeams.clear(),this.targetRenderFlags.clear(),this.sensorGroupColors.clear(),this.playerSensorGroup=0,this.lastStatus={health:1,energy:1},this.latestControl={ghostIndex:-1},this.controlPlayerGhostId=void 0,this.lastControlType=`camera`,this.isPiloting=!1,this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0,this.firstPerson=!0,this.lastCameraMode=void 0,this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0,this.latestFov=90,this.weaponsHud={slots:new Map,activeIndex:-1},this.backpackHud={packIndex:-1,active:!1,text:``},this.inventoryHud={slots:new Map,activeSlot:-1},this.teamScores=[],this.playerRoster.clear(),this.clockAnchorStreamSec=null,this.clockDurationMs=0,this.nextExplosionId=0,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null}resolveNetString(e){if(e.length>=2&&e.charCodeAt(0)===1){let t=parseInt(e.slice(1),10);if(Number.isFinite(t))return this.netStrings.get(t)??e}return e}formatRemoteArgs(e,t){let n=this.resolveNetString(e);for(let e=0;e0&&(this.playerSensorGroup=t.sensorGroup)}if(t){let e=oe(t);if(e&&(this.lastControlType=e),this.lastControlType===`player`)this.isPiloting=!!(t.pilot||t.controlObjectGhost!=null),this.isPiloting&&typeof t.controlObjectGhost==`number`?this.lastPilotGhostIndex=t.controlObjectGhost:this.isPiloting||(this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0);else if(this.isPiloting=!1,typeof t.cameraMode==`number`)if(this.lastCameraMode=t.cameraMode,t.cameraMode===3){typeof t.orbitObjectGhostIndex==`number`&&(this.lastOrbitGhostIndex=t.orbitObjectGhostIndex);let e=t.minOrbitDist,n=t.maxOrbitDist,r=t.curOrbitDist;typeof e==`number`&&typeof n==`number`&&Number.isFinite(e)&&Number.isFinite(n)?this.lastOrbitDistance=Math.max(0,n-e):typeof r==`number`&&Number.isFinite(r)&&(this.lastOrbitDistance=Math.max(0,r))}else this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0}e.cameraFov!==void 0&&(this.latestFov=e.cameraFov)}processEvent(e,t){let n=e.parsedData;if(!n)return;let r=n.type;if(r===`GhostAlwaysObjectEvent`){let e=n.ghostIndex,t=n.classId,r=n.objectData,i=n._hasObjectData,a=typeof t==`number`?this.registry.getGhostParser(t)?.name??`classId=${t}`:`?`;jn.debug(`GhostAlwaysObjectEvent: ghost=%d class=%s hasData=%s %s`,e,a,i,r?`keys=[${Object.keys(r).join(`,`)}]`:`(no data)`),e!=null&&t!=null&&this.processGhostUpdate({index:e,type:`create`,classId:t,parsedData:r});return}if(r===`NetStringEvent`||t===`NetStringEvent`){let e=n.id,t=n.value;if(e!=null&&typeof t==`string`){this.netStrings.set(e,t);let n=this.pendingNameTags.get(e);if(n!=null){this.pendingNameTags.delete(e);let r=I(t).trim();this.targetNames.set(n,r);for(let e of this.entities.values())e.targetId===n&&(e.playerName=r)}}return}if(r===`TargetInfoEvent`||t===`TargetInfoEvent`){let e=n.targetId,t=n.nameTag;if(e!=null&&t!=null){let n=this.netStrings.get(t);n?this.targetNames.set(e,I(n).trim()):this.pendingNameTags.set(t,e)}let r=n.sensorGroup;e!=null&&r!=null&&this.targetTeams.set(e,r);let i=n.renderFlags;if(e!=null&&i!=null&&this.targetRenderFlags.set(e,i),e!=null){let t=this.targetNames.get(e),n=this.targetTeams.get(e),r=this.targetRenderFlags.get(e);for(let i of this.entities.values())i.targetId===e&&(t&&(i.playerName=t),n!=null&&(i.sensorGroup=n),r!=null&&(i.targetRenderFlags=r))}return}if(r===`SetSensorGroupEvent`||t===`SetSensorGroupEvent`){let e=n.sensorGroup;e!=null&&(this.playerSensorGroup=e);return}if(r===`SensorGroupColorEvent`||t===`SensorGroupColorEvent`){let e=n.sensorGroup,t=n.colors;if(t){let n=this.sensorGroupColors.get(e);n||(n=new Map,this.sensorGroupColors.set(e,n));for(let e of t)e.default?n.delete(e.index):n.set(e.index,{r:e.r??0,g:e.g??0,b:e.b??0})}return}if(r===`RemoteCommandEvent`||t===`RemoteCommandEvent`){let e=this.resolveNetString(n.funcName),t=n.args,r=this.getTimeSec();if(e===`ChatMessage`&&t.length>=4){let e=de(this.resolveNetString(t[3])),n=t[4]?I(this.resolveNetString(t[4])):``,i=this.formatRemoteArgs(t[3],t.slice(4));if(i){let a=i.indexOf(`: `),{text:o,wavPath:s}=he(a>=0?i.slice(a+2):i),c,l;if(s){let e=this.resolveNetString(t[1]);c=e?`voice/${e}/${s}.wav`:s;let n=this.resolveNetString(t[2]);if(n){let e=parseFloat(n);Number.isFinite(e)&&(l=Math.max(.5,Math.min(2,e)))}}let u=e??0;this.pushChatMessage({timeSec:r,sender:n,text:o,kind:`chat`,colorCode:u,segments:[{text:n?`${n}: ${o}`:o,colorCode:u}],soundPath:c,soundPitch:l})}}else if(e===`CannedChatMessage`&&t.length>=6){let e=de(this.resolveNetString(t[1])),n=I(this.resolveNetString(t[2])),i=I(this.resolveNetString(t[4])),a=this.formatRemoteArgs(t[1],t.slice(2));if(a){let{wavPath:o}=he(a),s=he(I(this.resolveNetString(t[3]))).text,c,l;if(o){let e=this.resolveNetString(t[5]);if(c=e?`voice/${e}/${o}.wav`:o,t[6]){let e=parseFloat(this.resolveNetString(t[6]));Number.isFinite(e)&&(l=Math.max(.5,Math.min(2,e)))}}let u=e??0,d=[];i&&d.push({text:`[${i}] `,colorCode:0}),d.push({text:n?`${n}: ${s}`:s,colorCode:u}),this.pushChatMessage({timeSec:r,sender:n,text:s,kind:`chat`,colorCode:u,segments:d,soundPath:c,soundPitch:l})}}else if(e===`ServerMessage`&&t.length>=2){this.handleServerMessage(t);let e=de(this.resolveNetString(t[1])),n=this.formatRemoteArgs(t[1],t.slice(2));if(n){let{text:t,wavPath:i}=he(n),a=e??0;this.pushChatMessage({timeSec:r,sender:``,text:t,kind:`server`,colorCode:a,segments:[{text:t,colorCode:a}],soundPath:i??void 0})}}else this.handleHudRemoteCommand(e,t);return}if(r===`Sim3DAudioEvent`||r===`Sim2DAudioEvent`||t===`Sim3DAudioEvent`||t===`Sim2DAudioEvent`){let e=n.profileId;if(typeof e==`number`){let i=this.getTimeSec(),a=r===`Sim3DAudioEvent`||t===`Sim3DAudioEvent`?n.position:void 0;this.audioEvents.push({profileId:e,position:a,timeSec:i}),this.audioEvents.length>100&&this.audioEvents.splice(0,this.audioEvents.length-100)}}}processGhostUpdate(e){let t=e.index,n=this.entityIdByGhostIndex.get(t);if(n){let t=this.entities.get(n);t&&t.type===`Projectile`&&!t.hasExploded&&t.explosionDataBlockId!=null&&t.position&&(e.type===`delete`||e.type===`create`)&&this.spawnExplosion(t,[...t.position])}if(e.type===`delete`){n&&(this.removeSoundSlotEntities(n),this.entities.delete(n),this.entityIdByGhostIndex.delete(t));return}let r=this.resolveGhostClassName(t,e.classId);if(!r){if(e.type===`create`)throw Error(`No ghost parser for classId ${e.classId} (ghost index ${t})`);return}let i=ne(r,t);n&&n!==i&&(this.removeSoundSlotEntities(n),this.entities.delete(n));let a,o=this.entities.get(i);if(o&&e.type===`create`?(this.removeSoundSlotEntities(i),o.spawnTick=this.tickCount,this.resetEntity(o),a=o):o?a=o:(a={id:i,ghostIndex:t,className:r,spawnTick:this.tickCount,type:F(r),rotation:[0,0,0,1]},this.entities.set(i,a)),a.ghostIndex=t,a.className=r,a.type=F(r),this.entityIdByGhostIndex.set(t,i),this.applyGhostData(a,e.parsedData),e.type===`create`&&e.parsedData){let n=De(r,t,e.parsedData);n&&(a.sceneData=n)}}resetEntity(e){e.rotation=[0,0,0,1],e.hasExploded=void 0,e.explosionShape=void 0,e.explosionLifetimeTicks=void 0,e.faceViewer=void 0,e.simulatedVelocity=void 0,e.projectilePhysics=void 0,e.gravityMod=void 0,e.direction=void 0,e.velocity=void 0,e.position=void 0,e.dataBlock=void 0,e.dataBlockId=void 0,e.shapeHint=void 0,e.visual=void 0,e.targetId=void 0,e.targetRenderFlags=void 0,e.carryingFlag=void 0,e.sensorGroup=void 0,e.playerName=void 0,e.weaponShape=void 0,e.packShape=void 0,e.falling=void 0,e.jetting=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0,e.weaponImageStatesDbId=void 0,e.itemPhysics=void 0,e.threads=void 0,e.headPitch=void 0,e.headYaw=void 0,e.health=void 0,e.energy=void 0,e.maxEnergy=void 0,e.damageState=void 0,e.actionAnim=void 0,e.actionAtEnd=void 0,e.explosionDataBlockId=void 0,e.maintainEmitterId=void 0}applyGhostData(e,t){if(!t)return;let n=t,r=n.dataBlockId;if(r!=null){e.dataBlockId=r;let t=this.getDataBlockData(r),i=me(e.className,t);if(e.visual=le(e.className,t)??ue(e.className,t),typeof i==`string`&&(e.shapeHint=i,e.dataBlock=i),e.type===`Player`&&typeof t?.maxEnergy==`number`&&(e.maxEnergy=t.maxEnergy),e.type===`Projectile`&&(ae.has(e.className)?e.projectilePhysics=`linear`:Se.has(e.className)?(e.projectilePhysics=`ballistic`,e.gravityMod=ve(t,[`gravityMod`])??1):re.has(e.className)&&(e.projectilePhysics=`seeker`)),e.type===`Projectile`&&e.explosionDataBlockId==null){let t=this.resolveExplosionInfo(r);t&&(e.explosionShape=t.shape,e.faceViewer=t.faceViewer,e.explosionLifetimeTicks=t.lifetimeTicks,e.explosionDataBlockId=t.explosionDataBlockId)}if(e.type===`Projectile`&&e.maintainEmitterId==null){let n=t?.baseEmitter;typeof n==`number`&&n>0&&(e.maintainEmitterId=n)}if(e.className===`WheeledVehicle`&&typeof t?.maxSteeringAngle==`number`&&(e.maxSteeringAngle=t.maxSteeringAngle),e.className===`ForceFieldBare`&&t){let r=t.color1,i=[];for(let e=0;e<5;e++){let n=t[`texture${e}`];n&&i.push(n)}let a=n.scale;e.forceFieldData={textures:i,color:r?[r.r,r.g,r.b]:[1,1,1],baseTranslucency:t.baseTranslucency??1,dimensions:a?[a.y,a.z,a.x]:[1,1,1],framesPerSec:t.framesPerSec??1,scrollSpeed:t.scrollSpeed??0,umapping:t.umapping??1,vmapping:t.vmapping??1}}}if(Array.isArray(n.wheels)){let t=n.wheels;if(!e.wheels||e.wheels.length!==t.length)e.wheels=t.map(e=>({speed:e.avel,lateralSlip:e.Dx,longitudinalSlip:e.Dy}));else for(let n=0;n0){let n=t.find(e=>e.index===0);if(n?.dataBlockId&&n.dataBlockId>0){let t=this.getDataBlockData(n.dataBlockId),r=me(`ShapeBaseImageData`,t);if(r){let n=t?.mountPoint;(n==null||n<=0)&&!/pack_/i.test(r)&&(e.weaponShape=r)}let i=e.weaponImageState;e.weaponImageState={dataBlockId:n.dataBlockId,triggerDown:n.triggerDown??i?.triggerDown??!1,ammo:n.ammo??i?.ammo??!0,loaded:n.loaded??i?.loaded??!0,target:n.target??i?.target??!1,wet:n.wet??i?.wet??!1,fireCount:n.fireCount??i?.fireCount??0},t&&e.weaponImageStatesDbId!==n.dataBlockId&&(e.weaponImageStates=ce(t),e.weaponImageStatesDbId=n.dataBlockId)}else n&&!n.dataBlockId&&(e.weaponShape=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0);let r=t.find(e=>e.index===2);if(r?.dataBlockId&&r.dataBlockId>0){let t=me(`ShapeBaseImageData`,this.getDataBlockData(r.dataBlockId));t&&(e.packShape=t)}else r&&!r.dataBlockId&&(e.packShape=void 0);let i=t.find(e=>e.index===3);if(i?.dataBlockId&&i.dataBlockId>0){e.carryingFlag=!0;let t=me(`ShapeBaseImageData`,this.getDataBlockData(i.dataBlockId));if(t&&(e.flagShape=t),e.targetId!=null&&e.targetId>=0){let t=this.targetRenderFlags.get(e.targetId)??0,n=t|2;n!==t&&(this.targetRenderFlags.set(e.targetId,n),e.targetRenderFlags=n)}}else if(i&&!i.dataBlockId&&(e.carryingFlag=!1,e.flagShape=void 0,e.targetId!=null&&e.targetId>=0)){let t=this.targetRenderFlags.get(e.targetId)??0,n=t&-3;n!==t&&(this.targetRenderFlags.set(e.targetId,n),e.targetRenderFlags=n)}}}let i=pe(n.position)?n.position:pe(n.initialPosition)?n.initialPosition:pe(n.explodePosition)?n.explodePosition:pe(n.endPoint)?n.endPoint:pe(n.transform?.position)?n.transform.position:void 0;i&&(e.position=[i.x,i.y,i.z],this.updateSoundSlotPositions(e));let a=be(n.direction)?n.direction:void 0;if(a&&(e.direction=[a.x,a.y,a.z]),e.type===`Player`&&typeof n.rotationZ==`number`&&(e.rotation=ge(n.rotationZ)),e.type===`Player`&&(typeof n.headX==`number`&&(e.headPitch=n.headX),typeof n.headZ==`number`&&(e.headYaw=n.headZ)),se(n.angPosition)){let t=L(n.angPosition);t&&(e.rotation=t)}else if(se(n.transform?.rotation)){let t=L(n.transform.rotation);t&&(e.rotation=t)}else if(e.type===`Item`&&typeof n.rotation?.angle==`number`){let t=n.rotation;e.rotation=ge((t.zSign??1)*t.angle)}else if(e.type===`Projectile`){let t=n.velocity??n.direction??(pe(n.initialPosition)&&pe(n.endPos)?{x:n.endPos.x-n.initialPosition.x,y:n.endPos.y-n.initialPosition.y,z:n.endPos.z-n.initialPosition.z}:void 0);be(t)&&(t.x!==0||t.y!==0)&&(e.rotation=ge(Math.atan2(t.x,t.y)))}if(be(n.velocity)&&(e.velocity=[n.velocity.x,n.velocity.y,n.velocity.z],e.direction||=[n.velocity.x,n.velocity.y,n.velocity.z]),typeof n.moveFlag0==`boolean`&&(e.falling=n.moveFlag0),typeof n.moveFlag1==`boolean`&&(e.jetting=n.moveFlag1),e.type===`Item`){let t=n.atRest;if(t===!1&&be(n.velocity)){let t=n.velocity;e.itemPhysics={velocity:[t.x,t.y,t.z],atRest:!1},jn.debug(`Item %s (%s): atRest=false pos=%s vel=%s`,e.id,e.shapeHint??e.dataBlock??`db#${e.dataBlockId}`,n.position?`${n.position.x.toFixed(1)},${n.position.y.toFixed(1)},${n.position.z.toFixed(1)}`:`none`,`${t.x.toFixed(1)},${t.y.toFixed(1)},${t.z.toFixed(1)}`)}else t===!0&&(jn.debug(`Item %s (%s): atRest=true pos=%s`,e.id,e.shapeHint??e.dataBlock??`db#${e.dataBlockId}`,e.position?`${e.position[0].toFixed(1)},${e.position[1].toFixed(1)},${e.position[2].toFixed(1)}`:`none`),e.itemPhysics=void 0)}if(e.projectilePhysics){if(e.projectilePhysics===`linear`){let t=ve(e.dataBlockId==null?void 0:this.getDataBlockData(e.dataBlockId),[`dryVelocity`,`muzzleVelocity`,`bulletVelocity`])??80,r=e.direction??[0,1,0],i=r[0]*t,a=r[1]*t,o=r[2]*t,s=n.excessVel,c=n.excessDir;typeof s==`number`&&s>0&&be(c)&&(i+=c.x*s,a+=c.y*s,o+=c.z*s),e.simulatedVelocity=[i,a,o]}else be(n.velocity)&&(e.simulatedVelocity=[n.velocity.x,n.velocity.y,n.velocity.z]);let t=n.currTick;if(typeof t==`number`&&t>0&&e.simulatedVelocity&&e.position){let n=32/1e3*t,r=e.simulatedVelocity;if(e.position[0]+=r[0]*n,e.position[1]+=r[1]*n,e.position[2]+=r[2]*n,e.projectilePhysics===`ballistic`){let t=-9.81*(e.gravityMod??1);e.position[2]+=.5*t*n*n,r[2]+=t*n}}}let o=pe(n.explodePosition)?n.explodePosition:pe(n.explodePoint)?n.explodePoint:void 0;if(e.type===`Projectile`&&!e.hasExploded&&o&&e.explosionDataBlockId!=null&&this.spawnExplosion(e,[o.x,o.y,o.z]),typeof n.damageLevel==`number`&&(e.health=_e(1-n.damageLevel,0,1)),typeof n.damageState==`number`&&(e.damageState=n.damageState),typeof n.action==`number`&&(e.actionAnim=n.action,e.actionAtEnd=!!n.actionAtEnd),Array.isArray(n.threads)){let t=n.threads;if(e.threads){let n=[...e.threads];for(let e of t){let t=n.findIndex(t=>t.index===e.index);t>=0?n[t]=e:n.push(e)}e.threads=n}else e.threads=t}if(typeof n.energy==`number`&&(e.energy=_e(n.energy,0,1)),typeof n.targetId==`number`){e.targetId=n.targetId;let t=this.targetNames.get(n.targetId);t&&(e.playerName=t);let r=this.targetTeams.get(n.targetId);r!=null&&(e.sensorGroup=r,e.ghostIndex===this.latestControl.ghostIndex&&this.lastControlType===`player`&&(this.playerSensorGroup=r));let i=this.targetRenderFlags.get(n.targetId);i!=null&&(e.targetRenderFlags=i)}let s=n.sounds;Array.isArray(s)&&this.syncSoundSlotEntities(e,s),e.className===`WayPoint`&&typeof n.name==`string`&&(e.label=n.name),e.className===`AudioEmitter`&&(typeof n.filename==`string`&&(e.audioFileName=n.filename),typeof n.volume==`number`&&(e.audioVolume=n.volume),typeof n.is3D==`boolean`&&(e.audioIs3D=n.is3D),typeof n.isLooping==`boolean`&&(e.audioIsLooping=n.isLooping),typeof n.minDistance==`number`&&(e.audioMinDistance=n.minDistance),typeof n.maxDistance==`number`&&(e.audioMaxDistance=n.maxDistance),typeof n.minLoopGap==`number`&&(e.audioMinLoopGap=n.minLoopGap),typeof n.maxLoopGap==`number`&&(e.audioMaxLoopGap=n.maxLoopGap))}syncSoundSlotEntities(e,t){for(let n of t){let t=`${e.id}:sound:${n.index}`;if(n.playing&&typeof n.profileId==`number`){let r=this.getDataBlockData(n.profileId),i=r?.filename;if(!i)continue;let a=i.endsWith(`.wav`)?i:`${i}.wav`,o=r.description,s=o==null?void 0:this.getDataBlockData(o),c=this.entities.get(t);c?c.position=e.position:this.entities.set(t,{id:t,ghostIndex:e.ghostIndex,className:`AudioEmitter`,type:`AudioEmitter`,spawnTick:this.tickCount,position:e.position,rotation:[0,0,0,1],audioFileName:a,audioVolume:s?.volume??1,audioIs3D:s?.is3D??!0,audioIsLooping:s?.isLooping??!1,audioMinDistance:s?.referenceDistance??20,audioMaxDistance:s?.maxDistance??100,audioMinLoopGap:s?.minLoopGap??0,audioMaxLoopGap:s?.maxLoopGap??0})}else this.entities.delete(t)}}updateSoundSlotPositions(e){for(let t=0;t<4;t++){let n=this.entities.get(`${e.id}:sound:${t}`);n&&(n.position=e.position)}}removeSoundSlotEntities(e){for(let t=0;t<4;t++)this.entities.delete(`${e}:sound:${t}`)}resolveExplosionInfo(e){let t=this.getDataBlockData(e);if(!t)return;let n=t.explosion;if(n==null)return;let r=this.getDataBlockData(n);if(!r)return;let i=r.dtsFileName||void 0,a=r.lifetimeMS??31;return{shape:i,faceViewer:r.faceViewer!==!1&&r.faceViewer!==0,lifetimeTicks:a,explosionDataBlockId:n}}spawnExplosion(e,t){e.hasExploded=!0;let n=e.explosionLifetimeTicks??31,r=`fx_${this.nextExplosionId++}`,i={id:r,ghostIndex:-1,className:`Explosion`,spawnTick:this.tickCount,type:`Explosion`,dataBlock:e.explosionShape,explosionDataBlockId:e.explosionDataBlockId,position:t,rotation:[0,0,0,1],isExplosion:!0,faceViewer:e.faceViewer!==!1,expiryTick:this.tickCount+n};if(this.entities.set(r,i),e.explosionDataBlockId!=null){let n=this.getDataBlockData(e.explosionDataBlockId)?.subExplosions;if(Array.isArray(n))for(let e of n){if(e==null)continue;let n=this.getDataBlockData(e);if(!n)continue;let r=n.dtsFileName||void 0,i=n.lifetimeMS??31,a=n.offset??0,o=Math.random()*Math.PI*2,s=[t[0]+Math.cos(o)*a,t[1]+Math.sin(o)*a,t[2]],c=`fx_${this.nextExplosionId++}`,l={id:c,ghostIndex:-1,className:`Explosion`,spawnTick:this.tickCount,type:`Explosion`,dataBlock:r,explosionDataBlockId:e,position:s,rotation:[0,0,0,1],isExplosion:!0,faceViewer:n.faceViewer!==!1&&n.faceViewer!==0,expiryTick:this.tickCount+i};this.entities.set(c,l)}}e.position=void 0,e.simulatedVelocity=void 0}advanceProjectiles(){let e=32/1e3;for(let t of this.entities.values()){if(!t.simulatedVelocity||!t.position)continue;let n=t.simulatedVelocity,r=t.position;t.projectilePhysics===`ballistic`&&(n[2]+=-9.81*(t.gravityMod??1)*e),r[0]+=n[0]*e,r[1]+=n[1]*e,r[2]+=n[2]*e,(n[0]!==0||n[1]!==0)&&(t.rotation=ge(Math.atan2(n[0],n[1])))}}advanceItems(){let e=32/1e3;for(let t of this.entities.values()){let n=t.itemPhysics;if(!n||n.atRest||!t.position)continue;let r=n.velocity,i=t.position;r[2]+=-20*e,i[0]+=r[0]*e,i[1]+=r[1]*e,i[2]+=r[2]*e;let a=kn(i[0],i[1]);if(a!=null&&i[2]0){let e=Math.max(0,1-t/o);r[0]*=e,r[1]*=e}r[2]=e*.2,Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2])<.15&&(r[0]=r[1]=r[2]=0,n.atRest=!0)}i[2]<-1e3&&(n.atRest=!0)}}removeExpiredExplosions(){for(let[e,t]of this.entities)t.isExplosion&&t.expiryTick!=null&&this.tickCount>=t.expiryTick&&this.entities.delete(e)}updateCameraAndHud(){let e=this.latestControl,t=this.getTimeSec(),n=e.data,r=this.lastControlType;if(this.removeExpiredExplosions(),e.position){let{yaw:i,pitch:a}=this.getCameraYawPitch(n);if(this.isPiloting){if(n){let e=n.controlObjectData?.angPosition;if(e&&typeof e.w==`number`){this.lastVehicleHeading=xe(e),this.lastVehiclePitch=we(e);let t=L(e);if(t){let[e,n,r,i]=t,a=1-2*(n*n+r*r),o=2*(e*n+r*i),s=2*(e*r-n*i);this.lastVehicleOrbitDir=[-a,-o,-s]}}}i=this.lastVehicleHeading,a=this.lastVehiclePitch}if(this.camera={time:t,position:[e.position.x,e.position.y,e.position.z],rotation:Ce(i,_e(a,-ye,ye)),fov:this.latestFov,mode:`observer`,yaw:i,pitch:a},r===`camera`)if((typeof n?.cameraMode==`number`?n.cameraMode:this.lastCameraMode)===3){this.camera.mode=`third-person`,typeof this.lastOrbitDistance==`number`&&(this.camera.orbitDistance=this.lastOrbitDistance);let e=typeof n?.orbitObjectGhostIndex==`number`?n.orbitObjectGhostIndex:this.lastOrbitGhostIndex;typeof e==`number`&&e>=0&&(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(e))}else this.camera.mode=`observer`;else e.ghostIndex>=0&&(this.controlPlayerGhostId=this.resolveEntityIdForGhostIndex(e.ghostIndex)),this.firstPerson?this.camera.mode=`first-person`:(this.camera.mode=`third-person`,this.isPiloting&&this.lastPilotGhostIndex!=null?(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),this.camera.orbitDistance=15,this.lastVehicleOrbitDir&&(this.camera.orbitDirection=this.lastVehicleOrbitDir)):(this.camera.orbitTargetId=this.controlPlayerGhostId,this.camera.orbitDistance=3)),this.controlPlayerGhostId&&(this.camera.controlEntityId=this.controlPlayerGhostId);if(r===`player`&&e.position){if(this.isPiloting&&this.lastPilotGhostIndex!=null){let r=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),i=r?this.entities.get(r):void 0;if(i){let r=n?.controlObjectData;if(r){i.position=[e.position.x,e.position.y,e.position.z],this.lastVehiclePos=i.position.slice(),this.lastVehiclePosTime=t;let n=r.linMomentum;if(n&&pe(n)){let e=i.dataBlockId,t=(e==null?void 0:this.getDataBlockData(e))?.mass??200,r=t>0?1/t:1/200;this.lastVehicleVelocity=[n.x*r,n.y*r,n.z*r],i.velocity=this.lastVehicleVelocity}let a=r.angPosition;if(a&&typeof a.w==`number`){let e=L(a);e&&(i.rotation=e)}}else if(this.lastVehiclePos&&this.lastVehicleVelocity&&this.lastVehiclePosTime>0){let e=t-this.lastVehiclePosTime;if(e>0&&e<1){let[t,n,r]=this.lastVehicleVelocity;i.position=[this.lastVehiclePos[0]+t*e,this.lastVehiclePos[1]+n*e,this.lastVehiclePos[2]+r*e]}}}}else if(this.controlPlayerGhostId){let t=this.entities.get(this.controlPlayerGhostId);if(t){t.position=[e.position.x,e.position.y,e.position.z],t.rotation=ge(i),t.headPitch=this.getControlPlayerHeadPitch(a);let r=n?.velocity;be(r)&&(t.velocity=[r.x,r.y,r.z])}}}}else this.camera&&={...this.camera,time:t,fov:this.latestFov};let i={health:1,energy:1};if(this.camera?.mode===`first-person`){let e=this.controlPlayerGhostId,t=e?this.entities.get(e):void 0;i.health=t?.health??1;let r=n?.energyLevel;if(typeof r==`number`){let e=t?.maxEnergy??60;e>0&&(i.energy=_e(r/e,0,1))}else i.energy=t?.energy??1}else if(this.camera?.mode===`third-person`&&this.camera.orbitTargetId){let e=this.entities.get(this.camera.orbitTargetId);i.health=e?.health??1,i.energy=e?.energy??1}this.lastStatus=i}getControlPlayerHeadPitch(e){return _e(e/ye,-1,1)}getAbsoluteRotation(e){return e?typeof e.rotationZ==`number`&&typeof e.headX==`number`?{yaw:e.rotationZ,pitch:e.headX}:typeof e.rotZ==`number`&&typeof e.rotX==`number`?{yaw:e.rotZ,pitch:e.rotX}:null:null}resolveIffColor(e){if(this.playerSensorGroup===0)return;let t=this.sensorGroupColors.get(this.playerSensorGroup);if(t){let n=t.get(e);if(n)return n}if(e===this.playerSensorGroup)return ie;if(e!==0)return P}pushChatMessage(e){this.chatMessages.push({...e,id:++this.chatMessageIdCounter}),this.chatMessages.length>200&&this.chatMessages.splice(0,this.chatMessages.length-200),this._chatGen++}handleServerMessage(e){if(e.length<2)return;let t=this.resolveNetString(e[0]);if((t===`MsgTeamScoreIs`||t===`MsgTeamScore`)&&e.length>=4){let t=parseInt(this.resolveNetString(e[2]),10),n=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(t)&&!isNaN(n)){let e=this.teamScores.find(e=>e.teamId===t);e&&(e.score=n,this.onTeamScoresChanged())}}else if(t===`MsgCTFAddTeam`&&e.length>=6){let t=parseInt(this.resolveNetString(e[2]),10),n=I(this.resolveNetString(e[3])),r=parseInt(this.resolveNetString(e[5]),10);if(!isNaN(t)&&t>0){let e=this.teamScores.find(e=>e.teamId===t);e?(e.name=n,e.score=isNaN(r)?e.score:r):this.teamScores.push({teamId:t,name:n,score:isNaN(r)?0:r,playerCount:0}),this.onTeamScoresChanged()}}else if(t===`MsgClientJoin`&&e.length>=4){let t=I(this.resolveNetString(e[2])).trim(),n=parseInt(this.resolveNetString(e[3]),10);isNaN(n)||(this.playerRoster.set(n,{name:t,teamId:0,score:0,ping:0,packetLoss:0}),this.onRosterChanged()),!this.connectedPlayerName&&t&&I(this.resolveNetString(e[1])).includes(`Welcome to Tribes`)&&(this.connectedPlayerName=t,this.connectedClientId=n,this.onMissionInfoChange?.())}else if(t===`MsgClientDrop`&&e.length>=4){let t=parseInt(this.resolveNetString(e[3]),10);isNaN(t)||(this.playerRoster.delete(t),this.onRosterChanged())}else if(t===`MsgClientJoinTeam`&&e.length>=6){let t=parseInt(this.resolveNetString(e[4]),10),n=parseInt(this.resolveNetString(e[5]),10);if(!isNaN(t)&&!isNaN(n)){let e=this.playerRoster.get(t);e?e.teamId=n:this.playerRoster.set(t,{name:``,teamId:n,score:0,ping:0,packetLoss:0}),this.onRosterChanged()}}else if(t===`MsgPlayerScore`&&e.length>=5){let t=parseInt(this.resolveNetString(e[2]),10);if(!isNaN(t)){let n=this.playerRoster.get(t);if(n){let t=parseInt(this.resolveNetString(e[3]),10),r=parseInt(this.resolveNetString(e[4]),10),i=parseInt(this.resolveNetString(e[5]??``),10);isNaN(t)||(n.score=t),isNaN(r)||(n.ping=r),isNaN(i)||(n.packetLoss=i),this.onRosterChanged()}}}else if(t===`MsgSystemClock`&&e.length>=4){let t=parseFloat(this.resolveNetString(e[3]));this.clockAnchorStreamSec=this.getTimeSec(),this.clockDurationMs=Number.isFinite(t)?t:0}else if(t===`MsgMissionDropInfo`&&e.length>=5){let t=I(this.resolveNetString(e[2])),n=I(this.resolveNetString(e[3])),r=I(this.resolveNetString(e[4]));jn.info(`mission drop info: mission=%s gameType=%s server=%s`,t,n,r),this.missionDisplayName=t||this.missionDisplayName,this.missionTypeDisplayName=n||this.missionTypeDisplayName,this.serverDisplayName=r||this.serverDisplayName,this.onMissionInfoChange?.()}else if(t===`MsgLoadInfo`&&e.length>=5){let t=I(this.resolveNetString(e[3])),n=I(this.resolveNetString(e[4]));jn.info(`load info: mission=%s gameType=%s`,t,n),this.missionDisplayName=t||this.missionDisplayName,this.missionTypeDisplayName=n||this.missionTypeDisplayName,this.onMissionInfoChange?.()}else if(t===`MsgClientReady`&&e.length>=3){let t=this.resolveNetString(e[2]);jn.info(`client ready: gameClass=%s`,t),this.gameClassName=t||this.gameClassName,this.onMissionInfoChange?.()}}onTeamScoresChanged(){}onRosterChanged(){}handleHudRemoteCommand(e,t){if(e===`setWeaponsHudItem`&&t.length>=3){let e=parseInt(t[0],10),n=parseInt(t[1],10),r=t[2]===`1`||t[2]===`true`;isNaN(e)||(r?this.weaponsHud.slots.set(e,isNaN(n)?-1:n):this.weaponsHud.slots.delete(e),this.onWeaponsHudChanged())}else if(e===`setWeaponsHudAmmo`&&t.length>=2){let e=parseInt(t[0],10),n=parseInt(t[1],10);isNaN(e)||(this.weaponsHud.slots.set(e,isNaN(n)?-1:n),this.onWeaponsHudChanged())}else if(e===`setWeaponsHudActive`&&t.length>=1){let e=parseInt(t[0],10);this.weaponsHud.activeIndex=isNaN(e)?-1:e,!isNaN(e)&&e>=0&&!this.weaponsHud.slots.has(e)&&this.weaponsHud.slots.set(e,-1),this.onWeaponsHudChanged()}else if(e===`setWeaponsHudClearAll`)this.weaponsHud.slots.clear(),this.weaponsHud.activeIndex=-1,this.onWeaponsHudChanged();else if(e===`setBackpackHudItem`&&t.length>=2){let e=parseInt(t[0],10);(t[1]===`1`||t[1]===`true`)&&!isNaN(e)?(this.backpackHud.packIndex=e,this.backpackHud.active=!1,this.backpackHud.text=``):(this.backpackHud.packIndex=-1,this.backpackHud.active=!1,this.backpackHud.text=``)}else if(e===`setSatchelArmed`)this.backpackHud.active=!0;else if(e===`setCloakIconOn`||e===`setRepairPackIconOn`||e===`setShieldIconOn`||e===`setSenJamIconOn`)this.backpackHud.active=!0;else if(e===`setCloakIconOff`||e===`setRepairPackIconOff`||e===`setShieldIconOff`||e===`setSenJamIconOff`)this.backpackHud.active=!1;else if(e===`updatePackText`&&t.length>=1)this.backpackHud.text=t[0]??``;else if(e===`setInventoryHudItem`&&t.length>=3){let e=parseInt(t[0],10),n=parseInt(t[1],10),r=t[2]===`1`||t[2]===`true`;isNaN(e)||(r&&!isNaN(n)?this.inventoryHud.slots.set(e,n):this.inventoryHud.slots.delete(e),this.onInventoryHudChanged())}else if(e===`setInventoryHudAmount`&&t.length>=2){let e=parseInt(t[0],10),n=parseInt(t[1],10);!isNaN(e)&&!isNaN(n)&&(this.inventoryHud.slots.set(e,n),this.onInventoryHudChanged())}else e===`setInventoryHudClearAll`&&(this.inventoryHud.slots.clear(),this.inventoryHud.activeSlot=-1,this.onInventoryHudChanged())}onWeaponsHudChanged(){}onInventoryHudChanged(){}buildEntityList(e){let t=[];for(let n of this.entities.values()){if(e&&!e(n))continue;let r=n.targetId!=null&&n.targetId>=0?this.targetRenderFlags.get(n.targetId)??n.targetRenderFlags:n.targetRenderFlags;n.type===`Player`&&!n.carryingFlag&&(r=r==null?r:r&-3),t.push({id:n.id,type:n.type,visual:n.visual,direction:n.direction,ghostIndex:n.ghostIndex,className:n.className,dataBlockId:n.dataBlockId,shapeHint:n.shapeHint,dataBlock:n.dataBlock,weaponShape:n.weaponShape,packShape:n.packShape,flagShape:n.flagShape,falling:n.falling,jetting:n.jetting,playerName:n.playerName,targetRenderFlags:r,iffColor:(n.type===`Player`||(r??0)&2)&&n.sensorGroup!=null?this.resolveIffColor(n.sensorGroup):void 0,position:n.position&&(n.simulatedVelocity||n.itemPhysics&&!n.itemPhysics.atRest)?[...n.position]:n.position,rotation:n.rotation,velocity:n.velocity,health:n.health,energy:n.energy,actionAnim:n.actionAnim,actionAtEnd:n.actionAtEnd,damageState:n.damageState,faceViewer:n.faceViewer,threads:n.threads,explosionDataBlockId:n.explosionDataBlockId,maintainEmitterId:n.maintainEmitterId,weaponImageState:n.weaponImageState,weaponImageStates:n.weaponImageStates,headPitch:n.headPitch,headYaw:n.headYaw,label:n.label,audioFileName:n.audioFileName,audioVolume:n.audioVolume,audioIs3D:n.audioIs3D,audioIsLooping:n.audioIsLooping,audioMinDistance:n.audioMinDistance,audioMaxDistance:n.audioMaxDistance,audioMinLoopGap:n.audioMinLoopGap,audioMaxLoopGap:n.audioMaxLoopGap,wheels:n.wheels,steeringYaw:n.steeringYaw,frozen:n.frozen,maxSteeringAngle:n.maxSteeringAngle,sceneData:n.sceneData,forceFieldData:n.forceFieldData})}return t}computeMatchClockMs(e){if(this.clockAnchorStreamSec==null)return null;let t=(e-this.clockAnchorStreamSec)*1e3;return-this.clockDurationMs+t}buildHudState(){let e={slots:Array.from(this.weaponsHud.slots.entries()).map(([e,t])=>({index:e,ammo:t})),activeIndex:this.weaponsHud.activeIndex},t={slots:Array.from(this.inventoryHud.slots.entries()).map(([e,t])=>({slot:e,count:t})),activeSlot:this.inventoryHud.activeSlot},n=this.backpackHud.packIndex>=0?{...this.backpackHud}:null,r=this.teamScores.map(e=>({...e})),i=new Map;for(let{teamId:e}of this.playerRoster.values())e>0&&i.set(e,(i.get(e)??0)+1);for(let e of r)e.playerCount=i.get(e.teamId)??0;let a=[];for(let[e,t]of this.playerRoster)a.push({clientId:e,...t});return{weaponsHud:e,inventoryHud:t,backpackHud:n,teamScores:r,playerRoster:a}}buildTimeFilteredEvents(e){return this._chatSnapshotGen!==this._chatGen&&(this._chatSnapshot=this.chatMessages.slice(),this._chatSnapshotGen=this._chatGen),{chatMessages:this._chatSnapshot,audioEvents:this.audioEvents.filter(t=>t.timeSec>e-.5&&t.timeSec<=e)}}},Nn=A(`liveStreaming`),Pn=class extends Mn{packetParser;relay;currentTimeSec=0;connectSynced=!1;_snapshot=null;_snapshotTick=-1;_ready=!1;_teamScoresGen=0;_rosterGen=0;_weaponsHudGen=0;_inventoryHudGen=0;_cachedHud=null;dataBlockClassNames=new Map;onReady;onMissionChange;missionName=null;lastMoveAck=0;constructor(e){super(),this.relay=e;let{registry:t,ghostTracker:n,packetParser:r}=fe();this.packetParser=r,this.ghostTracker=n,this.registry=t}getDataBlockData(e){return this.packetParser.getDataBlockDataMap()?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){this._shapeConstructorCache=new Map;let t=this.packetParser.getDataBlockDataMap();if(t){for(let[,e]of t){let t=e.shape,n=e.sequences;t&&n&&this._shapeConstructorCache.set(t.toLowerCase(),n)}return this._shapeConstructorCache.get(e.toLowerCase())}}getTimeSec(){return this.currentTimeSec}getCameraYawPitch(e){return this.getAbsoluteRotation(e)??{yaw:0,pitch:0}}getEffectShapes(){let e=new Set,t=this.packetParser.getDataBlockDataMap();if(!t)return[];for(let[,n]of t){let r=n.explosion;if(r==null)continue;let i=t.get(r);i?.dtsFileName&&e.add(i.dtsFileName)}return[...e]}onTeamScoresChanged(){this._teamScoresGen++}onRosterChanged(){this._rosterGen++}onWeaponsHudChanged(){this._weaponsHudGen++}onInventoryHudChanged(){this._inventoryHudGen++}reset(){this.resetSharedState(),this.ghostTracker.clear?.(),this.currentTimeSec=0,this._snapshot=null,this._snapshotTick=-1,this._cachedHud=null,this.dataBlockClassNames.clear(),this.observerMode=`fly`,this.missionName=null}getSnapshot(){return this._snapshot&&this._snapshotTick===this.tickCount?this._snapshot:this.buildSnapshot()}stepToTime(e,t){return this.currentTimeSec=e,this.getSnapshot()}syncConnectSequence(e){if(this.connectSynced||e.length<1)return;this.connectSynced=!0;let t=e[0]>>1&1;this.packetParser.setConnectionProtocolState({lastSeqRecvdAtSend:Array(32).fill(0),lastSeqRecvd:0,highestAckedSeq:0,lastSendSeq:536870911,ackMask:0,connectSequence:t,lastRecvAckAck:0,connectionEstablished:!0})}feedPacket(e){this.syncConnectSequence(e),this.processPacket(e)}handleRelayCommands(e){if(e.type!==`RemoteCommandEvent`)return;let t=e.funcName;if(!t)return;let n=this.resolveNetString(t);if([`t2csri_pokeClient`,`t2csri_getChallengeChunk`,`t2csri_decryptChallenge`].includes(n)){let t=(e.args??[]).map(e=>this.resolveNetString(e)).filter(e=>e!==``);Nn.info(`auth event: %s %o`,n,t),this.relay.sendAuthEvent(n,t);return}let r=(e.args??[]).map(e=>this.resolveNetString(e));if(n===`MissionStartPhase1`){let e=r[0]??``,t=r[1]??null;Nn.info(`mission phase 1, seq=%s mission=%s resolvedArgs=%o`,e,t,r),t&&t!==this.missionName&&(this.missionName=t,this.entities.clear(),this.entityIdByGhostIndex.clear(),this._ready=!1,this._snapshot=null,this._snapshotTick=-1,this._cachedHud=null,this.observerMode=`fly`,this.lastMoveAck=0,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.onMissionChange?.(t)),this.relay.sendCommand(`MissionStartPhase1Done`,[e])}else if(n===`MissionStartPhase2`){let e=r[0]??``;Nn.info(`mission phase 2 (datablocks), seq=%s`,e),this.relay.sendCommand(`MissionStartPhase2Done`,[e])}else if(n===`MissionStartPhase3`){let e=r[0]??``,t=r[1]??null;Nn.info(`mission phase 3 (ghosting), seq=%s mission=%s`,e,t),t&&(this.missionName=t),this.relay.sendCommand(`setClientFav`,[``]),this.relay.sendCommand(`MissionStartPhase3Done`,[e])}}handleCRCChallenge(e){if(e.type!==`CRCChallengeEvent`)return;let t=e.crcValue,n=e.field1,r=e.field2,i=(n&1)!=0;Nn.info(`CRC challenge: seed=0x%s f1=0x%s f2=0x%s includeTextures=%s`,(t>>>0).toString(16),(n>>>0).toString(16),(r>>>0).toString(16),i);let a=this.packetParser.getDataBlockDataMap(),o=[];if(a)for(let[e,t]of a){let n=this.dataBlockClassNames.get(e);if(!n)continue;let r=me(n,t);o.push({objectId:e,className:n,shapeName:r??``})}Nn.info(`CRC: sending %d datablocks for computation`,o.length),this.relay.sendCRCCompute(t,r,o,i)}handleGhostingMessage(e){if(e.type!==`GhostingMessageEvent`)return;let t=e.message,n=e.sequence,r=e.ghostCount;Nn.info(`GhostingMessageEvent: message=%d sequence=%d ghostCount=%d`,t,n,r),t===0&&(Nn.info(`Sending ghost ack (type 1) for sequence %d`,n),this.relay.sendGhostAck(n,r))}observerMode=`fly`;requestScores(){this.relay.sendCommand(`getScores`,[])}getPlayerList(){let e=[];for(let[t,n]of this.targetNames){let r=this.targetTeams.get(t)??0;e.push({targetId:t,name:n,sensorGroup:r})}return e}processPacket(e){try{let t=this.packetParser.protocolRejected,n=this.packetParser.protocolNoDispatch,r=this.packetParser.parsePacket(e),i=this.packetParser.protocolRejected>t,a=this.packetParser.protocolNoDispatch>n;(i||a)&&Nn.warn(`packet #%d %s: %d bytes (total rejected=%d, noDispatch=%d)`,this.tickCount,i?`REJECTED`:`no-dispatch`,e.length,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch);let o=this.tickCount<20,s=this.tickCount%100==0,c=o||s;c&&Nn.debug(`packet #%d: %d events, %d ghosts, %d bytes%s%s`,this.tickCount,r.events.length,r.ghosts.length,e.length,r.gameState.controlObjectGhostIndex===void 0?``:`, control=${r.gameState.controlObjectGhostIndex}`,r.gameState.cameraFov===void 0?``:`, fov=${r.gameState.cameraFov}`),this.lastMoveAck=r.gameState.lastMoveAck,this.processControlObject(r.gameState);for(let e of r.events)if(e.parsedData){this.handleRelayCommands(e.parsedData),this.handleCRCChallenge(e.parsedData),this.handleGhostingMessage(e.parsedData);let t=e.parsedData.type;if(t===`RemoteCommandEvent`){let t=this.resolveNetString(e.parsedData.funcName??``);Nn.debug(`remote: %s`,t)}if(o&&t!==`NetStringEvent`&&t!==`RemoteCommandEvent`&&Nn.debug(`event: %s%s`,t,t===`SimDataBlockEvent`?` id=${e.parsedData.objectId} class=${e.parsedData.dataBlockClassName}`:``),t===`SimDataBlockEvent`){let t=e.parsedData.objectId,n=e.parsedData.dataBlockClassName;if(t!=null&&n&&this.dataBlockClassNames.set(t,n),c){let r=e.parsedData.dataBlockData,i=me(n??``,r);Nn.debug(`datablock: id=%d class=%s%s`,t,n??`?`,i?` shape=${i}`:``)}}let n=this.registry.getEventParser(e.classId)?.name;if(this.processEvent(e,n),o&&t===`NetStringEvent`){let t=e.parsedData.id,n=e.parsedData.value;t!=null&&typeof n==`string`&&Nn.trace(`netString #%d = "%s"`,t,n.length>60?n.slice(0,60)+`…`:n)}if(t===`TargetInfoEvent`){let t=e.parsedData.targetId,n=e.parsedData.nameTag;if(t!=null&&n!=null){let r=this.netStrings.get(n);if(r){let n=I(r);Nn.info(`target #%d: "%s" team=%s`,t,n,e.parsedData.sensorGroup??`?`)}}}if(t===`SetSensorGroupEvent`){let t=e.parsedData.sensorGroup;t!=null&&Nn.info(`sensor group changed: → %d`,t)}if(t===`SensorGroupColorEvent`){let t=e.parsedData.sensorGroup,n=e.parsedData.colors;n&&Nn.debug(`sensor group colors: group=%d, %d entries`,t,n.length)}}for(let e of r.ghosts){if(e.type===`create`){let t=e.parsedData?.position,n=t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.z==`number`,r=this.resolveGhostClassName(e.index,e.classId);Nn.debug(`ghost create: #%d %s%s (%d entities total)`,e.index,r??`?`,n?` at (${t.x.toFixed(1)}, ${t.y.toFixed(1)}, ${t.z.toFixed(1)})`:``,this.entities.size+1),this._ready||(this._ready=!0,this.onReady?.())}else if(e.type===`delete`){let t=this.entityIdByGhostIndex.get(e.index),n=t?this.entities.get(t):void 0;(this.tickCount<50||this.tickCount%200==0)&&Nn.debug(`ghost delete: #%d %s (%d entities remaining)`,e.index,n?.className??`?`,this.entities.size-1)}this.processGhostUpdate(e)}if(this.tickCount++,this.advanceProjectiles(),this.advanceItems(),s&&this.tickCount>1){let e=this.packetParser.getDataBlockDataMap();Nn.info(`status @ tick %d: %d entities, %d datablocks, rejected=%d, noDispatch=%d`,this.tickCount,this.entities.size,e?.size??0,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch)}let l=this.entities.size;if(this.tickCount===1||l>0&&l%25==0&&this.tickCount<100){let e=new Map;for(let t of this.entities.values())e.set(t.type,(e.get(t.type)??0)+1);let t=[...e.entries()].map(([e,t])=>`${e}=${t}`).join(` `);Nn.info(`entity count: %d (%s)`,l,t)}let u=this.camera?.mode;if(this.updateCameraAndHud(),this.camera&&this.camera.mode!==u&&Nn.info(`camera mode: %s → %s%s`,u??`none`,this.camera.mode,this.camera.mode===`third-person`?` orbit=${this.camera.orbitTargetId??`?`} dist=${this.camera.orbitDistance??`?`}`:``),this.tickCount<=5&&this.camera){let[e,t,n]=this.camera.position;Nn.debug(`camera: mode=%s pos=(%s, %s, %s) fov=%s`,this.camera.mode,e.toFixed(1),t.toFixed(1),n.toFixed(1),this.camera.fov)}}catch(t){let n={tickCount:this.tickCount,entityCount:this.entities.size,dataLength:e.length,controlGhost:this.latestControl.ghostIndex,connectSynced:this.connectSynced};Nn.error(`Failed to process live packet: %o %o`,t,n)}}buildSnapshot(){let e=this.buildEntityList(),t=this.currentTimeSec,{chatMessages:n,audioEvents:r}=this.buildTimeFilteredEvents(t),i=this._cachedHud,a,o,s,c,l;i&&i.weaponsHudGen===this._weaponsHudGen&&i.inventoryHudGen===this._inventoryHudGen&&i.teamScoresGen===this._teamScoresGen&&i.rosterGen===this._rosterGen&&i.backpackPackIndex===this.backpackHud.packIndex&&i.backpackActive===this.backpackHud.active?(a=i.weaponsHud,o=i.inventoryHud,s=i.backpackHud,c=i.teamScores,l=i.playerRoster):({weaponsHud:a,inventoryHud:o,backpackHud:s,teamScores:c,playerRoster:l}=this.buildHudState(),this._cachedHud={weaponsHudGen:this._weaponsHudGen,inventoryHudGen:this._inventoryHudGen,teamScoresGen:this._teamScoresGen,rosterGen:this._rosterGen,backpackPackIndex:this.backpackHud.packIndex,backpackActive:this.backpackHud.active,weaponsHud:a,inventoryHud:o,backpackHud:s,teamScores:c,playerRoster:l}),this.camera||={time:t,position:[0,0,200],rotation:[0,0,0,1],fov:90,mode:`observer`};let u={timeSec:t,exhausted:!1,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:n,audioEvents:r,weaponsHud:a,backpackHud:s,inventoryHud:o,teamScores:c,playerRoster:l,connectedClientId:this.connectedClientId,matchClockMs:this.computeMatchClockMs(t)};return this._snapshot=u,this._snapshotTick=this.tickCount,u}},Fn=j()(e=>({missionEntities:new Map,streamEntities:new Map,isStreaming:!1,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:0,setEntity(t){e(e=>{let n=new Map(e.missionEntities);return n.set(t.id,t),{missionEntities:n,version:e.version+1}})},deleteEntity(t){e(e=>{if(!e.missionEntities.has(t))return e;let n=new Map(e.missionEntities);return n.delete(t),{missionEntities:n,version:e.version+1}})},setEntities(t){e(e=>{let n=new Map(e.missionEntities);for(let e of t)n.set(e.id,e);return{missionEntities:n,version:e.version+1}})},setAllEntities(t){e(e=>{let n=new Map;for(let e of t)n.set(e.id,e);return{missionEntities:n,dataSource:e.isStreaming?e.dataSource:`map`}})},clearEntities(){e(e=>e.missionEntities.size===0?e:e.isStreaming?{missionEntities:new Map,version:e.version+1}:{missionEntities:new Map,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1})},setMissionInfo(t){let n={};if(t.missionName!==void 0&&(n.missionName=t.missionName),t.missionType!==void 0&&(n.missionType=t.missionType),t.missionTypeDisplayName!==void 0&&(n.missionTypeDisplayName=t.missionTypeDisplayName),t.missionDisplayName!==void 0&&(n.missionDisplayName=t.missionDisplayName),t.gameClassName!==void 0&&(n.gameClassName=t.gameClassName,t.missionType===void 0))if(t.gameClassName){let e=t.gameClassName.replace(/Game$/i,``);n.missionType=Oe[e.toLowerCase()]??e}else n.missionType=null;t.serverDisplayName!==void 0&&(n.serverDisplayName=t.serverDisplayName),t.recorderName!==void 0&&(n.recorderName=t.recorderName),t.recordingDate!==void 0&&(n.recordingDate=t.recordingDate),e(e=>({...n,version:e.version+1}))},beginStreaming(t){e(e=>({isStreaming:!0,dataSource:t,streamEntities:new Map,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1}))},endStreaming(){e(e=>e.isStreaming?{isStreaming:!1,dataSource:e.missionEntities.size>0?`map`:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,streamEntities:new Map,version:e.version+1}:e)},setStreamEntity(t){e(e=>{let n=new Map(e.streamEntities);return n.set(t.id,t),{streamEntities:n,version:e.version+1}})},deleteStreamEntity(t){e(e=>{if(!e.streamEntities.has(t))return e;let n=new Map(e.streamEntities);return n.delete(t),{streamEntities:n,version:e.version+1}})},setStreamEntities(t){e(e=>{let n=new Map(e.streamEntities);for(let e of t)n.set(e.id,e);return{streamEntities:n,version:e.version+1}})},setAllStreamEntities(t){e(e=>{let n=new Map;for(let e of t)n.set(e.id,e);let r=e.streamEntities;return n.size===r.size&&[...n.keys()].every(e=>r.has(e))?e:{streamEntities:n,version:e.version+1}})},clearStreamEntities(){e(e=>e.streamEntities.size===0?e:{streamEntities:new Map,version:e.version+1})}}));function In(e){return e.isStreaming?e.streamEntities:e.missionEntities}function Ln(e){return e.version}function Rn(){return M(Fn,Ln),M(Fn,In)}function zn(){return Rn()}function Bn(e){let t=e.isStreaming?e.streamEntities:e.missionEntities,n=[];for(let e of t.values())e.renderType!==`None`&&n.push(e);return n}function Vn(e,t){if(e.length!==t.length)return!1;for(let n=0;n({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,servers:[],serversLoading:!1,adapter:null,liveReady:!1,_relay:null,_adapter:null,_pending:[],_listInFlight:!1,connectRelay(n=dr){let r=t();r._relay&&r._relay.close();let i=new Cn(n,{onOpen(){e({relayConnected:!0});let n=t();for(let e of n._pending)e();n._pending=[]},onStatus(t,n,r,i){ur.info(`game status: %s%s%s`,t,n?` — ${n}`:``,i?` map=${i}`:``),e({gameStatus:t,gameStatusMessage:n,...i?{mapName:i}:{}})},onServerList(n){t()._listInFlight=!1,e({servers:n,serversLoading:!1})},onGamePacket(e){let n=t()._adapter;n||ur.warn(`received game packet but no adapter is active`),n?.feedPacket(e)},onPing(t){e({relayToGameServerPing:t})},onWsPing(t){e({browserToRelayPing:t})},onError(n){ur.error(`error: %s`,n),t()._listInFlight=!1,e({serversLoading:!1})},onClose(){let n=t();n._relay===i&&(n._relay=null,n._adapter=null,n._pending=[],n._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1}))}});i.connect(),t()._relay=i},disconnectRelay(){let n=t();n._relay?.close(),n._relay=null,n._adapter=null,n._pending=[],n._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1})},listServers(){let n=t();if(n._listInFlight)return;n._listInFlight=!0;let r=()=>{let e=t();e._relay?.sendWsPing(),e._relay?.listServers()};e({serversLoading:!0}),n._relay?.connected?r():(n._pending.push(r),n._relay||t().connectRelay())},joinServer(n,r){let i=t();if(!i._relay)return;let a=i.servers.find(e=>e.address===n),o=new Pn(i._relay);o.onReady=()=>e({liveReady:!0}),o.onMissionChange=t=>{ur.info(`mission changed: %s`,t),e({mapName:t,liveReady:!1}),Fn.getState().setMissionInfo({missionName:t,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null})},o.onMissionInfoChange=()=>{Fn.getState().setMissionInfo({missionDisplayName:o.missionDisplayName??void 0,missionTypeDisplayName:o.missionTypeDisplayName??void 0,gameClassName:o.gameClassName??void 0,serverDisplayName:o.serverDisplayName??void 0,recorderName:o.connectedPlayerName??void 0})},i._adapter=o,e({mapName:a?.mapName??i.mapName,serverName:a?.name,warriorName:r,liveReady:!1,gameStatus:null,adapter:o}),Fn.getState().setMissionInfo({missionName:a?.mapName??void 0,missionTypeDisplayName:a?.gameType??void 0,serverDisplayName:a?.name??void 0,recorderName:r??void 0}),i._relay.joinServer(n,r)},disconnectServer(){t().disconnectRelay()},sendMoves(e,n){t()._relay?.sendMoves(e,n)},sendCommand(e,...n){t()._relay?.sendCommand(e,n)}}));function pr(e,t){return M(fr,e,t)}function mr(e){return e.relayToGameServerPing!=null&&e.browserToRelayPing!=null?e.relayToGameServerPing+e.browserToRelayPing:e.relayToGameServerPing??null}var hr=[.25,.5,1,2,4];function gr(e){let t=(0,z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,B.jsx)(B.Fragment,{children:n}),t[0]=n,t[1]=r),r}function _r(){return Ae(vr)}function vr(e){return e.playback.recording}function yr(){return Ae(br)}function br(e){return e.playback.status===`playing`}function xr(){return Ae(Sr)}function Sr(e){return e.playback.timeMs/1e3}function Cr(){return Ae(wr)}function wr(e){return e.playback.durationMs/1e3}function Tr(){return Ae(Er)}function Er(e){return e.playback.rate}function Dr(){let e=(0,z.c)(17),t=_r(),n=Ae(jr),r=Ae(Ar),i=Ae(kr),a=Ae(Or),o;e[0]===n?o=e[1]:(o=e=>{n(e)},e[0]=n,e[1]=o);let s=o,c;e[2]!==t||e[3]!==r?(c=()=>{t&&r(`playing`)},e[2]=t,e[3]=r,e[4]=c):c=e[4];let l=c,u;e[5]===r?u=e[6]:(u=()=>{r(`paused`)},e[5]=r,e[6]=u);let d=u,f;e[7]===i?f=e[8]:(f=e=>{i(e*1e3)},e[7]=i,e[8]=f);let p=f,m;e[9]===a?m=e[10]:(m=e=>{a(e)},e[9]=a,e[10]=m);let h=m,g;return e[11]!==d||e[12]!==l||e[13]!==p||e[14]!==s||e[15]!==h?(g={setRecording:s,play:l,pause:d,seek:p,setSpeed:h},e[11]=d,e[12]=l,e[13]=p,e[14]=s,e[15]=h,e[16]=g):g=e[16],g}function Or(e){return e.setPlaybackRate}function kr(e){return e.setPlaybackTime}function Ar(e){return e.setPlaybackStatus}function jr(e){return e.setRecording}var Mr=A(`LoadDemoButton`);function Nr({isActive:e=!1,choosingMap:t=!1,onCancelChoosingMap:n}){let r=_r()?.source===`demo`,{setRecording:i}=Dr(),a=(0,R.useRef)(null),o=(0,R.useRef)(0),s=(0,R.useRef)(null),c=(0,R.useCallback)(()=>{if(N.getState().cancel(),t&&r){n?.();return}if(r){o.current+=1,s.current?.abort(),s.current=null,i(null),bn.getState().reset();return}a.current?.click()},[r,t,n,i]);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`input`,{ref:a,type:`file`,accept:`.rec`,style:{display:`none`},onChange:(0,R.useCallback)(async e=>{let t=e.target.files?.[0];if(t){e.target.value=``;try{let e=await t.arrayBuffer(),n=o.current+1;o.current=n;let{createDemoStreamingRecording:r}=await Me(async()=>{let{createDemoStreamingRecording:e}=await import(`./demoStreaming-Tnv976xF.js`);return{createDemoStreamingRecording:e}},__vite__mapDeps([0,1,2,3,4,5])),a=await r(e);if(o.current!==n)return;fr.getState().disconnectServer(),i(a),s.current?.abort();let c=new AbortController;s.current=c;let l=bn.getState();l.reset(),l.setScanProgress(0),Me(async()=>{let{scanDemoTimeline:e}=await import(`./demoTimelineScanner-BGzL-XZF.js`);return{scanDemoTimeline:e}},__vite__mapDeps([6,1,2,3,5])).then(({scanDemoTimeline:t})=>t(e,a.recorderName,e=>{o.current===n&&bn.getState().setScanProgress(e)},c.signal)).then(e=>{if(o.current!==n)return;let t=bn.getState();t.setEvents(e),t.setScanProgress(null)}).catch(e=>{o.current===n&&(e instanceof Error&&e.name===`AbortError`||(Mr.error(`Timeline scan failed: %o`,e),bn.getState().setScanProgress(null)))})}catch(e){Mr.error(`Failed to load demo: %o`,e)}}},[i])}),(0,B.jsxs)(`button`,{type:`button`,className:mn.Button,"aria-label":r?`Unload demo`:`Load demo (.rec)`,title:r?`Unload demo`:`Load demo (.rec)`,onClick:c,"data-active":e,children:[(0,B.jsx)(vn,{className:mn.DemoIcon}),(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Demo`}),(0,B.jsx)(`span`,{className:mn.ButtonHint,children:t&&r?`Return to demo`:r?`Click to unload`:`Load a .rec file`})]})]})}function Pr(e){return S({tag:`svg`,attr:{fill:`currentColor`,viewBox:`0 0 16 16`},child:[{tag:`path`,attr:{d:`M11.251.068a.5.5 0 0 1 .227.58L9.677 6.5H13a.5.5 0 0 1 .364.843l-8 8.5a.5.5 0 0 1-.842-.49L6.323 9.5H3a.5.5 0 0 1-.364-.843l8-8.5a.5.5 0 0 1 .615-.09z`},child:[]}]})(e)}function Fr(e){return S({tag:`svg`,attr:{fill:`currentColor`,viewBox:`0 0 16 16`},child:[{tag:`path`,attr:{d:`m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393`},child:[]}]})(e)}var Ir={JoinServerButton:`_JoinServerButton_cz8os_1 _Button_p0g82_2`,Icon:`_Icon_cz8os_5 _Icon_p0g82_85`,blink:`_blink_cz8os_1`};function Lr(e){let t=(0,z.c)(15),{isActive:n,onOpenServerBrowser:r}=e,i=pr(zr),a=pr(Rr),o=i===`connected`,s=i===`connecting`||i===`challenging`||i===`authenticating`,c=o?`Connected –\xA0click to disconnect`:`Join server`,l=o?`Connected –\xA0click to disconnect`:`Join server`,u;t[0]!==a||t[1]!==o||t[2]!==r?(u=()=>{N.getState().cancel(),o?a():r()},t[0]=a,t[1]=o,t[2]=r,t[3]=u):u=t[3];let d,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,B.jsx)(Pr,{className:Ir.Icon}),f=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Live`}),t[4]=d,t[5]=f):(d=t[4],f=t[5]);let p=s?`Connecting…`:o?`Connected`:`Join a game`,m;t[6]===p?m=t[7]:(m=(0,B.jsxs)(B.Fragment,{children:[f,(0,B.jsx)(`span`,{className:mn.ButtonHint,children:p})]}),t[6]=p,t[7]=m);let h;return t[8]!==n||t[9]!==o||t[10]!==c||t[11]!==l||t[12]!==u||t[13]!==m?(h=(0,B.jsxs)(`button`,{type:`button`,className:Ir.JoinServerButton,"aria-label":c,title:l,"data-connected":o,onClick:u,"data-active":n,children:[d,m]}),t[8]=n,t[9]=o,t[10]=c,t[11]=l,t[12]=u,t[13]=m,t[14]=h):h=t[14],h}function Rr(e){return e.disconnectServer}function zr(e){return e.gameStatus}function Br(e,t=[]){let n=[];function r(t,r){let i=R.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=R.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=R.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>R.createContext(e));return function(n){let r=n?.[e]||t;return R.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Vr(i,...t)]}function Vr(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Hr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ur(...e){return t=>{let n=!1,r=e.map(e=>{let r=Hr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t{let{children:r,...i}=e,a=R.Children.toArray(r),o=a.find(Jr);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,B.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,B.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Kr(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(R.isValidElement(n)){let e=Xr(n),i=Yr(r,n.props);return n.type!==R.Fragment&&(i.ref=t?Ur(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qr=Symbol(`radix.slottable`);function Jr(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===qr}function Yr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Xr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Zr(e){let t=e+`CollectionProvider`,[n,r]=Br(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=R.useRef(null),a=R.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Gr(s),l=R.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,B.jsx)(c,{ref:Wr(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Gr(u),p=R.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=R.useRef(null),s=Wr(t,o),c=a(u,n);return R.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return R.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function Qr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var $r=globalThis?.document?R.useLayoutEffect:()=>{},ei=R.useInsertionEffect||$r;function ti({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ni({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=R.useRef(e!==void 0);R.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,R.useCallback(t=>{if(s){let n=ri(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ni({defaultProp:e,onChange:t}){let[n,r]=R.useState(e),i=R.useRef(n),a=R.useRef(t);return ei(()=>{a.current=t},[t]),R.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ri(e){return typeof e==`function`}var ii=e(Fe(),1),ai=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Gr(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function oi(e,t){return R.useReducer((e,n)=>t[e][n]??e,e)}var si=e=>{let{present:t,children:n}=e,r=ci(t),i=typeof n==`function`?n({present:r.isPresent}):R.Children.only(n),a=Wr(r.ref,ui(i));return typeof n==`function`||r.isPresent?R.cloneElement(i,{ref:a}):null};si.displayName=`Presence`;function ci(e){let[t,n]=R.useState(),r=R.useRef(null),i=R.useRef(e),a=R.useRef(`none`),[o,s]=oi(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return R.useEffect(()=>{let e=li(r.current);a.current=o===`mounted`?e:`none`},[o]),$r(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=li(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),$r(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=li(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=li(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:R.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function li(e){return e?.animationName||`none`}function ui(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var di=R.useId||(()=>void 0),fi=0;function pi(e){let[t,n]=R.useState(di());return $r(()=>{e||n(e=>e??String(fi++))},[e]),e||(t?`radix-${t}`:``)}var mi=`Collapsible`,[hi,gi]=Br(mi),[_i,vi]=hi(mi),yi=R.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=ti({prop:r,defaultProp:i??!1,onChange:o,caller:mi});return(0,B.jsx)(_i,{scope:n,disabled:a,contentId:pi(),open:c,onOpenToggle:R.useCallback(()=>l(e=>!e),[l]),children:(0,B.jsx)(ai.div,{"data-state":Ti(c),"data-disabled":a?``:void 0,...s,ref:t})})});yi.displayName=mi;var bi=`CollapsibleTrigger`,xi=R.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=vi(bi,n);return(0,B.jsx)(ai.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ti(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Qr(e.onClick,i.onOpenToggle)})});xi.displayName=bi;var Si=`CollapsibleContent`,Ci=R.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=vi(Si,e.__scopeCollapsible);return(0,B.jsx)(si,{present:n||i.open,children:({present:e})=>(0,B.jsx)(wi,{...r,ref:t,present:e})})});Ci.displayName=Si;var wi=R.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=vi(Si,n),[s,c]=R.useState(r),l=R.useRef(null),u=Wr(t,l),d=R.useRef(0),f=d.current,p=R.useRef(0),m=p.current,h=o.open||s,g=R.useRef(h),_=R.useRef(void 0);return R.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),$r(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,B.jsx)(ai.div,{"data-state":Ti(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Ti(e){return e?`open`:`closed`}var Ei=yi,Di=xi,Oi=Ci,ki=R.createContext(void 0);function Ai(e){let t=R.useContext(ki);return e||t||`ltr`}var ji=`Accordion`,Mi=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[V,Ni,Pi]=Zr(ji),[Fi,Ii]=Br(ji,[Pi,gi]),Li=gi(),Ri=R.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,B.jsx)(V.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,B.jsx)(Wi,{...a,ref:t}):(0,B.jsx)(Ui,{...i,ref:t})})});Ri.displayName=ji;var[zi,Bi]=Fi(ji),[Vi,Hi]=Fi(ji,{collapsible:!1}),Ui=R.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,c]=ti({prop:n,defaultProp:r??``,onChange:i,caller:ji});return(0,B.jsx)(zi,{scope:e.__scopeAccordion,value:R.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:R.useCallback(()=>a&&c(``),[a,c]),children:(0,B.jsx)(Vi,{scope:e.__scopeAccordion,collapsible:a,children:(0,B.jsx)(qi,{...o,ref:t})})})}),Wi=R.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=ti({prop:n,defaultProp:r??[],onChange:i,caller:ji}),c=R.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=R.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,B.jsx)(zi,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,B.jsx)(Vi,{scope:e.__scopeAccordion,collapsible:!0,children:(0,B.jsx)(qi,{...a,ref:t})})})}),[Gi,Ki]=Fi(ji),qi=R.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=Wr(R.useRef(null),t),c=Ni(n),l=Ai(i)===`ltr`,u=Qr(e.onKeyDown,e=>{if(!Mi.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=()=>{o=r+1,o>s&&(o=0)},d=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,B.jsx)(Gi,{scope:n,disabled:r,direction:i,orientation:a,children:(0,B.jsx)(V.Slot,{scope:n,children:(0,B.jsx)(ai.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})}),Ji=`AccordionItem`,[Yi,Xi]=Fi(Ji),Zi=R.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=Ki(Ji,n),o=Bi(Ji,n),s=Li(n),c=pi(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,B.jsx)(Yi,{scope:n,open:l,disabled:u,triggerId:c,children:(0,B.jsx)(Ei,{"data-orientation":a.orientation,"data-state":ia(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});Zi.displayName=Ji;var Qi=`AccordionHeader`,$i=R.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=Ki(ji,n),a=Xi(Qi,n);return(0,B.jsx)(ai.h3,{"data-orientation":i.orientation,"data-state":ia(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});$i.displayName=Qi;var ea=`AccordionTrigger`,ta=R.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=Ki(ji,n),a=Xi(ea,n),o=Hi(ea,n),s=Li(n);return(0,B.jsx)(V.ItemSlot,{scope:n,children:(0,B.jsx)(Di,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});ta.displayName=ea;var na=`AccordionContent`,ra=R.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=Ki(ji,n),a=Xi(na,n),o=Li(n);return(0,B.jsx)(Oi,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})});ra.displayName=na;function ia(e){return e?`open`:`closed`}var aa=Ri,oa=Zi,sa=ta,ca=ra;function la(e){return S({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M256 16C141.31 16 48 109.31 48 224v154.83l82 32.81L146.88 496H192v-64h32v64h16v-64h32v64h16v-64h32v64h45.12L382 411.64l82-32.81V224c0-114.69-93.31-208-208-208zm-88 320a56 56 0 1 1 56-56 56.06 56.06 0 0 1-56 56zm51.51 64L244 320h24l24.49 80zM344 336a56 56 0 1 1 56-56 56.06 56.06 0 0 1-56 56zm104 32z`},child:[]}]})(e)}function ua(e){return S({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`m190.06 414 163.12-139.78a24 24 0 0 0 0-36.44L190.06 98c-15.57-13.34-39.62-2.28-39.62 18.22v279.6c0 20.5 24.05 31.56 39.62 18.18z`},child:[]}]})(e)}var da={AccordionGroup:`_AccordionGroup_1ysdj_1`,Trigger:`_Trigger_1ysdj_7`,TriggerIcon:`_TriggerIcon_1ysdj_24`,Content:`_Content_1ysdj_35`,slideDown:`_slideDown_1ysdj_1`,slideUp:`_slideUp_1ysdj_1`,Body:`_Body_1ysdj_47`,BodyNoPadding:`_BodyNoPadding_1ysdj_51`};function fa(e){let t=(0,z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,B.jsx)(aa,{className:da.AccordionGroup,...e}),t[0]=e,t[1]=n),n}function pa(e){let t=(0,z.c)(10),{value:n,label:r,children:i,noPadding:a}=e,o=a===void 0?!1:a,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsx)(ua,{className:da.TriggerIcon}),t[0]=s):s=t[0];let c;t[1]===r?c=t[2]:(c=(0,B.jsxs)(sa,{className:da.Trigger,children:[s,` `,r]}),t[1]=r,t[2]=c);let l=o?da.BodyNoPadding:da.Body,u;t[3]!==i||t[4]!==l?(u=(0,B.jsx)(ca,{className:da.Content,children:(0,B.jsx)(`div`,{className:l,children:i})}),t[3]=i,t[4]=l,t[5]=u):u=t[5];let d;return t[6]!==c||t[7]!==u||t[8]!==n?(d=(0,B.jsxs)(oa,{value:n,children:[c,u]}),t[6]=c,t[7]=u,t[8]=n,t[9]=d):d=t[9],d}function ma(e){return S({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M144,16H112A64.07,64.07,0,0,0,48,80v96a64.07,64.07,0,0,0,64,64h32a64.07,64.07,0,0,0,64-64V80A64.07,64.07,0,0,0,144,16Zm48,160a48.05,48.05,0,0,1-48,48H112a48.05,48.05,0,0,1-48-48V80a48.05,48.05,0,0,1,48-48h32a48.05,48.05,0,0,1,48,48ZM136,83.31v89.38l10.34-10.35a8,8,0,0,1,11.32,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L120,172.69V83.31L109.66,93.66A8,8,0,0,1,98.34,82.34l24-24a8,8,0,0,1,11.32,0l24,24a8,8,0,0,1-11.32,11.32Z`},child:[]}]})(e)}function ha(e){return S({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M144,16H112A64.07,64.07,0,0,0,48,80v96a64.07,64.07,0,0,0,64,64h32a64.07,64.07,0,0,0,64-64V80A64.07,64.07,0,0,0,144,16Zm48,64v24H128V32h16A48.05,48.05,0,0,1,192,80ZM144,224H112a48.05,48.05,0,0,1-48-48V120H192v56A48.05,48.05,0,0,1,144,224Z`},child:[]}]})(e)}function ga(e){return S({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M239.22,59.44l-45.63,95.82a3.54,3.54,0,0,1-.16.34l-34.21,71.84a8,8,0,1,1-14.44-6.88L173.62,160H40a8,8,0,0,1-5.66-13.66L76.69,104,34.34,61.66A8,8,0,0,1,40,48H232a8,8,0,0,1,7.22,11.44Z`},child:[]}]})(e)}function _a(e){return S({tag:`svg`,attr:{viewBox:`0 0 1024 1024`},child:[{tag:`path`,attr:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm234.8 736.5L223.5 277.2c16-19.7 34-37.7 53.7-53.7l523.3 523.3c-16 19.6-34 37.7-53.7 53.7z`},child:[]}]})(e)}function va(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`},child:[]},{tag:`circle`,attr:{cx:`9`,cy:`7`,r:`4`},child:[]},{tag:`path`,attr:{d:`M22 21v-2a4 4 0 0 0-3-3.87`},child:[]},{tag:`path`,attr:{d:`M16 3.13a4 4 0 0 1 0 7.75`},child:[]}]})(e)}function ya(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`},child:[]},{tag:`path`,attr:{d:`M3 9h18`},child:[]},{tag:`path`,attr:{d:`m15 14-3 3-3-3`},child:[]}]})(e)}function ba(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`},child:[]},{tag:`path`,attr:{d:`M3 9h18`},child:[]},{tag:`path`,attr:{d:`m9 16 3-3 3 3`},child:[]}]})(e)}function xa(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`},child:[]},{tag:`path`,attr:{d:`M9 3v18`},child:[]},{tag:`path`,attr:{d:`m14 9 3 3-3 3`},child:[]}]})(e)}function Sa(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`},child:[]},{tag:`path`,attr:{d:`M9 3v18`},child:[]},{tag:`path`,attr:{d:`m16 15-3-3 3-3`},child:[]}]})(e)}function Ca(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`circle`,attr:{cx:`12`,cy:`12`,r:`10`},child:[]},{tag:`line`,attr:{x1:`22`,x2:`18`,y1:`12`,y2:`12`},child:[]},{tag:`line`,attr:{x1:`6`,x2:`2`,y1:`12`,y2:`12`},child:[]},{tag:`line`,attr:{x1:`12`,x2:`12`,y1:`6`,y2:`2`},child:[]},{tag:`line`,attr:{x1:`12`,x2:`12`,y1:`22`,y2:`18`},child:[]}]})(e)}function wa(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`rect`,attr:{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`},child:[]},{tag:`path`,attr:{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`},child:[]},{tag:`path`,attr:{d:`M12 11h4`},child:[]},{tag:`path`,attr:{d:`M12 16h4`},child:[]},{tag:`path`,attr:{d:`M8 11h.01`},child:[]},{tag:`path`,attr:{d:`M8 16h.01`},child:[]}]})(e)}function Ta(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M2 8V2h6`},child:[]},{tag:`path`,attr:{d:`m2 2 10 10`},child:[]},{tag:`path`,attr:{d:`M12 2A10 10 0 1 1 2 12`},child:[]}]})(e)}var Ea={Root:`_Root_cfjcw_1`,ProgressWrap:`_ProgressWrap_cfjcw_6`,ProgressLabel:`_ProgressLabel_cfjcw_13`,ProgressBar:`_ProgressBar_cfjcw_19`,ProgressFill:`_ProgressFill_cfjcw_27`,Filters:`_Filters_cfjcw_33`,FilterButton:`_FilterButton_cfjcw_40`,EventList:`_EventList_cfjcw_57`,EventRow:`_EventRow_cfjcw_63`,EventTime:`_EventTime_cfjcw_120`,EventIcon:`_EventIcon_cfjcw_129`,EventDescription:`_EventDescription_cfjcw_172`,Killer:`_Killer_cfjcw_177`,Victim:`_Victim_cfjcw_180`,DamageType:`_DamageType_cfjcw_183`,Empty:`_Empty_cfjcw_186`};function Da(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}var Oa={kill:(0,B.jsx)(Ca,{}),death:(0,B.jsx)(la,{}),"flag-grab":(0,B.jsx)(ga,{}),"flag-return":(0,B.jsx)(ga,{}),"flag-cap":(0,B.jsx)(ga,{}),"match-start":(0,B.jsx)(Fr,{}),"match-end":(0,B.jsx)(_a,{})},ka={chaingun:`chaingunned`,plasma:`plasma rifled`};function Aa(e){if(e.type===`kill`&&e.killer&&e.victim)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:Ea.Killer,title:e.killer,children:`You`}),` `,(0,B.jsx)(`span`,{className:Ea.DamageType,children:e.weapon?ka[e.weapon]??`${e.weapon}${e.weapon.endsWith(`e`)?`d`:`ed`}`:`killed`}),` `,(0,B.jsx)(`span`,{className:Ea.Victim,children:e.victim})]});if(e.type===`death`)return e.killer?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:Ea.Killer,children:e.killer}),` `,(0,B.jsx)(`span`,{className:Ea.DamageType,children:e.weapon?ka[e.weapon]??`${e.weapon}${e.weapon.endsWith(`e`)?`d`:`ed`}`:`killed`}),` `,(0,B.jsx)(`span`,{className:Ea.Victim,title:e.victim,children:`you`})]}):(0,B.jsx)(B.Fragment,{children:e.description});if(e.type===`flag-grab`)return(0,B.jsxs)(B.Fragment,{children:[`You grabbed `,e.flagTeamName?`the ${e.flagTeamName} flag`:`the enemy flag`]});if(e.type===`flag-return`)return(0,B.jsx)(B.Fragment,{children:`You returned your flag`});if(e.type===`flag-cap`&&e.capturer){let t=e.teamAffinity===`friendly`?`the enemy flag`:e.teamAffinity===`enemy`?`your flag`:e.flagTeamName?`the ${e.flagTeamName} flag`:`a flag`;return(0,B.jsxs)(B.Fragment,{children:[e.capturer,` captured `,t]})}return e.type===`match-start`?`Match started`:e.type===`match-end`?`Match ended`:e.description}function ja(){let e=(0,z.c)(58),t=xn(Ra),n=xn(La),{seek:r}=Dr(),[i,a]=(0,R.useState)(`all`),o,s;if(e[0]!==t||e[1]!==i||e[2]!==n||e[3]!==r){s=Symbol.for(`react.early_return_sentinel`);bb0:{let c=t?.filter(e=>i===`all`||e.type===i)??[],l;e[6]===r?l=e[7]:(l=e=>{r(Math.max(0,e-3)),document.activeElement instanceof HTMLElement&&document.activeElement.blur()},e[6]=r,e[7]=l);let u=l;if(n!=null&&t==null){let t;e[8]===n?t=e[9]:(t=Math.round(n*100),e[8]=n,e[9]=t);let r;e[10]===t?r=e[11]:(r=(0,B.jsxs)(`span`,{className:Ea.ProgressLabel,children:[`Scanning… `,t,`%`]}),e[10]=t,e[11]=r);let i=`${n*100}%`,a;e[12]===i?a=e[13]:(a=(0,B.jsx)(`div`,{className:Ea.ProgressBar,children:(0,B.jsx)(`div`,{className:Ea.ProgressFill,style:{width:i}})}),e[12]=i,e[13]=a);let o;e[14]!==r||e[15]!==a?(o=(0,B.jsx)(`div`,{className:Ea.Root,children:(0,B.jsxs)(`div`,{className:Ea.ProgressWrap,children:[r,a]})}),e[14]=r,e[15]=a,e[16]=o):o=e[16],s=o;break bb0}if(!t){s=null;break bb0}let d;e[17]===t?d=e[18]:(d=t.filter(Ia),e[17]=t,e[18]=d);let f=d.length,p;e[19]===t?p=e[20]:(p=t.filter(Fa),e[19]=t,e[20]=p);let m=p.length,h;e[21]===t?h=e[22]:(h=t.filter(Pa),e[21]=t,e[22]=h);let g=h.length,_;e[23]===t?_=e[24]:(_=t.filter(Na),e[23]=t,e[24]=_);let v=_.length,y;e[25]===t?y=e[26]:(y=t.filter(Ma),e[25]=t,e[26]=y);let b=y.length,x=i===`all`,S;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>a(`all`),e[27]=S):S=e[27];let C;e[28]!==t.length||e[29]!==x?(C=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":x,onClick:S,children:[`All (`,t.length,`)`]}),e[28]=t.length,e[29]=x,e[30]=C):C=e[30];let w=i===`kill`,T;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>a(`kill`),e[31]=T):T=e[31];let E;e[32]!==f||e[33]!==w?(E=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":w,onClick:T,children:[`Kills (`,f,`)`]}),e[32]=f,e[33]=w,e[34]=E):E=e[34];let D=i===`death`,O;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>a(`death`),e[35]=O):O=e[35];let k;e[36]!==m||e[37]!==D?(k=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":D,onClick:O,children:[`Deaths (`,m,`)`]}),e[36]=m,e[37]=D,e[38]=k):k=e[38];let A=i===`flag-grab`,j;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>a(`flag-grab`),e[39]=j):j=e[39];let M;e[40]!==g||e[41]!==A?(M=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":A,onClick:j,children:[`Grabs (`,g,`)`]}),e[40]=g,e[41]=A,e[42]=M):M=e[42];let ee=i===`flag-return`,te;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>a(`flag-return`),e[43]=te):te=e[43];let N;e[44]!==v||e[45]!==ee?(N=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":ee,onClick:te,children:[`Returns (`,v,`)`]}),e[44]=v,e[45]=ee,e[46]=N):N=e[46];let P=i===`flag-cap`,ne;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(ne=()=>a(`flag-cap`),e[47]=ne):ne=e[47];let re;e[48]!==b||e[49]!==P?(re=(0,B.jsxs)(`button`,{type:`button`,className:Ea.FilterButton,"data-active":P,onClick:ne,children:[`Caps (`,b,`)`]}),e[48]=b,e[49]=P,e[50]=re):re=e[50];let F;e[51]!==C||e[52]!==E||e[53]!==k||e[54]!==M||e[55]!==N||e[56]!==re?(F=(0,B.jsxs)(`div`,{className:Ea.Filters,children:[C,E,k,M,N,re]}),e[51]=C,e[52]=E,e[53]=k,e[54]=M,e[55]=N,e[56]=re,e[57]=F):F=e[57],o=(0,B.jsxs)(`div`,{className:Ea.Root,children:[F,c.length===0?(0,B.jsx)(`div`,{className:Ea.Empty,children:`No events found.`}):(0,B.jsx)(`div`,{className:Ea.EventList,children:c.map((e,t)=>(0,B.jsxs)(`button`,{type:`button`,className:Ea.EventRow,onClick:()=>u(e.timeSec),children:[(0,B.jsx)(`span`,{className:Ea.EventTime,children:Da(e.timeSec)}),(0,B.jsx)(`span`,{className:Ea.EventIcon,"data-type":e.type,"data-affinity":e.teamAffinity,children:Oa[e.type]}),(0,B.jsx)(`span`,{className:Ea.EventDescription,children:Aa(e)})]},`${e.timeSec}-${e.type}-${t}`))})]})}e[0]=t,e[1]=i,e[2]=n,e[3]=r,e[4]=o,e[5]=s}else o=e[4],s=e[5];return s===Symbol.for(`react.early_return_sentinel`)?o:s}function Ma(e){return e.type===`flag-cap`}function Na(e){return e.type===`flag-return`}function Pa(e){return e.type===`flag-grab`}function Fa(e){return e.type===`death`}function Ia(e){return e.type===`kill`}function La(e){return e.scanProgress}function Ra(e){return e.events}var za=new Map([[`flag`,`Flags`],[`huntersflag1`,`Flags`],[`huntersflag2`,`Flags`],[`huntersflag4`,`Flags`],[`huntersflag8`,`Flags`],[`stationinventory`,`Inventory Stations`],[`stationammo`,`Inventory Stations`],[`mobileinvstation`,`Inventory Stations`],[`stationvehiclepad`,`Vehicle Pads`],[`stationvehicle`,`Vehicle Pads`],[`generatorlarge`,`Generators`],[`solarpanel`,`Generators`],[`sensorlargepulse`,`Sensors`],[`sensormediumpulse`,`Sensors`],[`turretbaselarge`,`Turrets`],[`sentryturret`,`Turrets`],[`repairpatch`,`Health`],[`repairkit`,`Health`],[`ammopack`,`Packs`],[`energypack`,`Packs`],[`shieldpack`,`Packs`],[`repairpack`,`Packs`],[`cloakingpack`,`Packs`],[`sensorjammerpack`,`Packs`],[`aabarrelpack`,`Packs`],[`elfbarrelpack`,`Packs`],[`missilebarrelpack`,`Packs`],[`mortarbarrelpack`,`Packs`],[`plasmabarrelpack`,`Packs`],[`inventorydeployable`,`Packs`],[`motionsensordeployable`,`Packs`],[`pulsesensordeployable`,`Packs`],[`turretoutdoordeployable`,`Packs`],[`turretindoordeployable`,`Packs`],[`satchelcharge`,`Weapons`],[`blaster`,`Weapons`],[`chaingun`,`Weapons`],[`disc`,`Weapons`],[`grenadelauncher`,`Weapons`],[`elfgun`,`Weapons`],[`missilelauncher`,`Weapons`],[`mortar`,`Weapons`],[`plasma`,`Weapons`],[`shocklance`,`Weapons`],[`sniperrifle`,`Weapons`],[`targetinglaser`,`Weapons`],[`chaingunammo`,`Ammo`],[`discammo`,`Ammo`],[`grenadelauncherammo`,`Ammo`],[`missilelauncherammo`,`Ammo`],[`mortarammo`,`Ammo`],[`plasmaammo`,`Ammo`],[`bombammo`,`Ammo`],[`assaultmortarammo`,`Ammo`],[`grenade`,`Ammo`],[`concussiongrenade`,`Ammo`],[`flashgrenade`,`Ammo`],[`flaregrenade`,`Ammo`],[`cameragrenade`,`Ammo`],[`mine`,`Ammo`],[`beacon`,`Ammo`],[`flipflop`,`Switches`],[`nexus`,`Nexus`],[`nexusbase`,`Nexus`],[`nexuscap`,`Nexus`]]),Ba=[`Flags`,`Inventory Stations`,`Generators`,`Vehicle Pads`,`Turrets`,`Sensors`,`Nexus`,`Switches`,`Packs`,`Health`,`Weapons`,`Ammo`];function Va(e){return e.renderType===`Shape`&&typeof e.dataBlock==`string`&&e.dataBlock!==``&&Array.isArray(e.position)}function Ha(e,t){let n=new Map;for(let r of e.values()){if(!Va(r))continue;let e=za.get(r.dataBlock.toLowerCase());if(!e)continue;let i=r.dataBlock;if(t&&r.runtimeObject){let e=O(r.runtimeObject,t);e&&(i=e)}let a=n.get(e);a||(a=[],n.set(e,a)),a.push({entityId:r.id,label:i,position:r.position,teamId:r.teamId})}let r=[];for(let e of Ba){let t=n.get(e);t&&t.length>0&&(t.sort((e,t)=>{let n=(e.teamId??0)-(t.teamId??0);return n===0?e.label.localeCompare(t.label):n}),r.push({name:e,targets:t}))}return r}var Ua={Root:`_Root_pb9qa_1`,Empty:`_Empty_pb9qa_6`,TourAllButton:`_TourAllButton_pb9qa_13`,CategoryHeader:`_CategoryHeader_pb9qa_40`,CategoryCount:`_CategoryCount_pb9qa_58`,TourButton:`_TourButton_pb9qa_63`,PlayIcon:`_PlayIcon_pb9qa_83`,ExitIcon:`_ExitIcon_pb9qa_87`,ItemList:`_ItemList_pb9qa_100`,ItemRow:`_ItemRow_pb9qa_106`,ItemLabel:`_ItemLabel_pb9qa_151`,TeamBadge:`_TeamBadge_pb9qa_156`};function Wa(e){return S({tag:`svg`,attr:{viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`},child:[{tag:`path`,attr:{fillRule:`evenodd`,d:`M3 4.25A2.25 2.25 0 0 1 5.25 2h5.5A2.25 2.25 0 0 1 13 4.25v2a.75.75 0 0 1-1.5 0v-2a.75.75 0 0 0-.75-.75h-5.5a.75.75 0 0 0-.75.75v11.5c0 .414.336.75.75.75h5.5a.75.75 0 0 0 .75-.75v-2a.75.75 0 0 1 1.5 0v2A2.25 2.25 0 0 1 10.75 18h-5.5A2.25 2.25 0 0 1 3 15.75V4.25Z`,clipRule:`evenodd`},child:[]},{tag:`path`,attr:{fillRule:`evenodd`,d:`M19 10a.75.75 0 0 0-.75-.75H8.704l1.048-.943a.75.75 0 1 0-1.004-1.114l-2.5 2.25a.75.75 0 0 0 0 1.114l2.5 2.25a.75.75 0 1 0 1.004-1.114l-1.048-.943h9.546A.75.75 0 0 0 19 10Z`,clipRule:`evenodd`},child:[]}]})(e)}var Ga=`__all__`;function Ka(e){return e.animation?{targets:e.animation.targets,categoryName:e.animation.categoryName,currentIndex:e.animation.currentIndex}:null}function qa(e,t){return e===t?!0:!e||!t?!1:e.categoryName===t.categoryName&&e.currentIndex===t.currentIndex&&e.targets===t.targets}function Ja(){let e=(0,z.c)(28),t=zn(),n=Ae(Xa),r;e[0]!==n||e[1]!==t?(r=Ha(t,n),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i=r,a=te(Ka,qa),o;if(e[3]!==i){o=new Map;for(let e=0;e{let n=e.teamId!=null&&e.teamId>0?e.teamId:1/0,r=t.teamId!=null&&t.teamId>0?t.teamId:1/0;if(n!==r)return n-r;let i=o.get(e)??0,a=o.get(t)??0;return i===a?e.label.localeCompare(t.label):i-a},e[8]=o,e[9]=t),s=i.flatMap(Ya).sort(t),e[5]=i,e[6]=o,e[7]=s}else s=e[7];let c=s;if(i.length===0){let t;return e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(`div`,{className:Ua.Root,children:(0,B.jsx)(`p`,{className:Ua.Empty,children:`No map features found`})}),e[10]=t):t=e[10],t}let l=a!==null&&a.categoryName===Ga,u;e[11]!==c||e[12]!==l?(u=()=>{l?N.getState().cancel():N.getState().startTour(c,Ga)},e[11]=c,e[12]=l,e[13]=u):u=e[13];let d=u,f;e[14]===l?f=e[15]:(f=l?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Wa,{className:Ua.ExitIcon}),` Exit tour`]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Fr,{className:Ua.PlayIcon}),` `,(0,B.jsx)(`span`,{className:Ua.ButtonLabel,children:`Tour all features`})]}),e[14]=l,e[15]=f);let p;e[16]!==d||e[17]!==l||e[18]!==f?(p=(0,B.jsx)(`button`,{type:`button`,className:Ua.TourAllButton,"data-active":l,onClick:d,children:f}),e[16]=d,e[17]=l,e[18]=f,e[19]=p):p=e[19];let m;if(e[20]!==i||e[21]!==a){let t;e[23]===a?t=e[24]:(t=e=>(0,B.jsx)(Za,{category:e,tourState:a},e.name),e[23]=a,e[24]=t),m=i.map(t),e[20]=i,e[21]=a,e[22]=m}else m=e[22];let h;return e[25]!==p||e[26]!==m?(h=(0,B.jsxs)(`div`,{className:Ua.Root,children:[p,m]}),e[25]=p,e[26]=m,e[27]=h):h=e[27],h}function Ya(e){return e.targets}function Xa(e){return e.runtime.runtime?.state.datablocks}function Za(e){let t=(0,z.c)(30),{category:n,tourState:r}=e,i=r!==null&&r.categoryName===n.name,a;t[0]!==n.name||t[1]!==n.targets||t[2]!==i?(a=()=>{i?N.getState().cancel():N.getState().startTour(n.targets,n.name)},t[0]=n.name,t[1]=n.targets,t[2]=i,t[3]=a):a=t[3];let o=a,s;t[4]===n.name?s=t[5]:(s=(0,B.jsx)(`span`,{children:n.name}),t[4]=n.name,t[5]=s);let c;t[6]===n.targets.length?c=t[7]:(c=(0,B.jsxs)(`span`,{className:Ua.CategoryCount,children:[`(`,n.targets.length,`)`]}),t[6]=n.targets.length,t[7]=c);let l;t[8]===i?l=t[9]:(l=i?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Wa,{className:Ua.ExitIcon}),` Exit tour`]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Fr,{className:Ua.PlayIcon}),` Tour all`]}),t[8]=i,t[9]=l);let u;t[10]!==o||t[11]!==i||t[12]!==l?(u=(0,B.jsx)(`button`,{type:`button`,className:Ua.TourButton,"data-active":i,onClick:o,children:l}),t[10]=o,t[11]=i,t[12]=l,t[13]=u):u=t[13];let d;t[14]!==s||t[15]!==c||t[16]!==u?(d=(0,B.jsxs)(`div`,{className:Ua.CategoryHeader,children:[s,c,u]}),t[14]=s,t[15]=c,t[16]=u,t[17]=d):d=t[17];let f;if(t[18]!==n.targets||t[19]!==i||t[20]!==r){let e;t[22]!==i||t[23]!==r?(e=(e,t)=>{let n=i&&r.currentIndex===t||r!==null&&r.targets[r.currentIndex]?.entityId===e.entityId;return(0,B.jsxs)(`button`,{type:`button`,className:Ua.ItemRow,"data-active":n,onClick:()=>N.getState().flyTo(e),children:[(0,B.jsx)(Fr,{className:Ua.PlayIcon}),` `,(0,B.jsx)(`span`,{className:Ua.ItemLabel,children:e.label}),e.teamId!=null&&e.teamId>0&&(0,B.jsx)(`span`,{className:Ua.TeamBadge,"data-team":e.teamId,children:k[e.teamId]??`Team ${e.teamId}`})]},e.entityId)},t[22]=i,t[23]=r,t[24]=e):e=t[24],f=n.targets.map(e),t[18]=n.targets,t[19]=i,t[20]=r,t[21]=f}else f=t[21];let p;t[25]===f?p=t[26]:(p=(0,B.jsx)(`div`,{className:Ua.ItemList,children:f}),t[25]=f,t[26]=p);let m;return t[27]!==d||t[28]!==p?(m=(0,B.jsxs)(B.Fragment,{children:[d,p]}),t[27]=d,t[28]=p,t[29]=m):m=t[29],m}function Qa(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M16 21L11.2381 12.2698L15 6L23 21H16ZM8 10L14 21H2L8 10ZM5.5 8C4.11929 8 3 6.88071 3 5.5C3 4.11929 4.11929 3 5.5 3C6.88071 3 8 4.11929 8 5.5C8 6.88071 6.88071 8 5.5 8Z`},child:[]}]})(e)}function $a(e){let t=(0,z.c)(6),{isActive:n,onClick:r}=e,i=n===void 0?!1:n,a,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(Qa,{}),o=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Explore`}),s=(0,B.jsx)(`span`,{className:mn.ButtonHint,children:`Browse maps`}),t[0]=a,t[1]=o,t[2]=s):(a=t[0],o=t[1],s=t[2]);let c;return t[3]!==i||t[4]!==r?(c=(0,B.jsxs)(`button`,{type:`button`,className:mn.Button,onClick:r,"data-active":i,children:[a,o,s]}),t[3]=i,t[4]=r,t[5]=c):c=t[5],c}function eo(e){let t=(0,z.c)(7),{missionName:n,onClick:r}=e,i=Jn(),a=Xn(),o=i===`demo`||i===`live`?a:n,s;t[0]===o?s=t[1]:(s=o?C(o):!1,t[0]=o,t[1]=s);let c=!s,l,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,B.jsx)(wa,{}),u=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Show map info`}),t[2]=l,t[3]=u):(l=t[2],u=t[3]);let d;return t[4]!==r||t[5]!==c?(d=(0,B.jsxs)(`button`,{type:`button`,className:mn.Button,"aria-label":`Show map info`,onClick:r,disabled:c,children:[l,u]}),t[4]=r,t[5]=c,t[6]=d):d=t[6],d}function to(e){let t=(0,z.c)(4),{onClick:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,B.jsx)(va,{}),i=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Show scores`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let a;return t[2]===n?a=t[3]:(a=(0,B.jsxs)(`button`,{type:`button`,className:mn.Button,"aria-label":`Show scores`,onClick:n,children:[r,i]}),t[2]=n,t[3]=a),a}var H={InspectorControls:`_InspectorControls_cm86c_1`,Dropdown:`_Dropdown_cm86c_8`,Group:`_Group_cm86c_16`,CheckboxField:`_CheckboxField_cm86c_24`,Label:`_Label_cm86c_39`,Description:`_Description_cm86c_47`,Control:`_Control_cm86c_60`,Field:`_Field_cm86c_67`,Tools:`_Tools_cm86c_91`,MapInfoButton:`_MapInfoButton_cm86c_114 _Button_p0g82_2`,ShowScoresButton:`_ShowScoresButton_cm86c_115 _Button_p0g82_2`,ForceRenderButton:`_ForceRenderButton_cm86c_119`,CloseSidebarButton:`_CloseSidebarButton_cm86c_131 _Button_p0g82_2`},no=[`controls`,`preferences`,`audio`,`timeline`],ro=(0,R.memo)(function(e){let t=(0,z.c)(209),{missionName:n,missionType:r,onOpenMapInfo:i,onOpenScoreScreen:a,onOpenServerBrowser:o,onChooseMap:s,onCancelChoosingMap:l,choosingMap:u,cameraRef:d,invalidateRef:p,onClose:m}=e,h=g(),_=Jn(),y=_r(),b=Xn(),x=_===`demo`||_===`live`?b:n,S;t[0]===x?S=t[1]:(S=x?C(x):!1,t[0]=x,t[1]=S);let w=S,T=pr(io),{fogEnabled:E,setFogEnabled:D,fov:O,setFov:k,audioEnabled:A,setAudioEnabled:j,audioVolume:M,setAudioVolume:ee,animationEnabled:te,setAnimationEnabled:N,fpsLimit:P,setFpsLimit:ne,showInputOverlay:re,setShowInputOverlay:F}=c(),{speedMultiplier:ie,setSpeedMultiplier:ae,mouseSensitivity:I,setMouseSensitivity:oe,touchMode:L,setTouchMode:se,invertScroll:ce,setInvertScroll:le,invertDrag:ue,setInvertDrag:de,invertJoystick:fe,setInvertJoystick:pe}=v(),{debugMode:me,setDebugMode:he,renderOnDemand:ge,setRenderOnDemand:_e}=f(),[ve,ye]=(0,R.useState)(!1),be=(0,R.useRef)(null),xe=(0,R.useRef)(null),Se=(0,R.useRef)(null),Ce,we;t[2]===ve?(Ce=t[3],we=t[4]):(Ce=()=>{ve&&be.current?.focus()},we=[ve],t[2]=ve,t[3]=Ce,t[4]=we),(0,R.useEffect)(Ce,we);let Te;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(Te=e=>{let t=e.relatedTarget;t&&Se.current?.contains(t)||ye(!1)},t[5]=Te):Te=t[5];let Ee=Te,De;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(De=e=>{e.key===`Escape`&&(ye(!1),xe.current?.focus())},t[6]=De):De=t[6];let Oe=De,ke=_===`map`&&!y||(u??!1),Ae;t[7]!==s||t[8]!==ke?(Ae=(0,B.jsx)($a,{isActive:ke,onClick:s}),t[7]=s,t[8]=ke,t[9]=Ae):Ae=t[9];let je=!u&&y?.source===`demo`,Me;t[10]!==u||t[11]!==l||t[12]!==je?(Me=(0,B.jsx)(Nr,{isActive:je,choosingMap:u,onCancelChoosingMap:l}),t[10]=u,t[11]=l,t[12]=je,t[13]=Me):Me=t[13];let Ne;t[14]!==u||t[15]!==T||t[16]!==o?(Ne=o&&(0,B.jsx)(Lr,{isActive:!u&&T,onOpenServerBrowser:o}),t[14]=u,t[15]=T,t[16]=o,t[17]=Ne):Ne=t[17];let Pe;t[18]!==Ne||t[19]!==Ae||t[20]!==Me?(Pe=(0,B.jsxs)(`div`,{className:mn.ButtonGroup,children:[Ae,Me,Ne]}),t[18]=Ne,t[19]=Ae,t[20]=Me,t[21]=Pe):Pe=t[21];let Fe=!w,Ie;t[22]!==d||t[23]!==n||t[24]!==r||t[25]!==Fe?(Ie=(0,B.jsx)(_n,{missionName:n,missionType:r,cameraRef:d,disabled:Fe}),t[22]=d,t[23]=n,t[24]=r,t[25]=Fe,t[26]=Ie):Ie=t[26];let Le;t[27]!==n||t[28]!==i?(Le=(0,B.jsx)(eo,{missionName:n,onClick:i}),t[27]=n,t[28]=i,t[29]=Le):Le=t[29];let Re;t[30]===a?Re=t[31]:(Re=a&&(0,B.jsx)(to,{onClick:a}),t[30]=a,t[31]=Re);let ze;t[32]!==Pe||t[33]!==Ie||t[34]!==Le||t[35]!==Re?(ze=(0,B.jsxs)(`div`,{className:H.Tools,children:[Pe,Ie,Le,Re]}),t[32]=Pe,t[33]=Ie,t[34]=Le,t[35]=Re,t[36]=ze):ze=t[36];let Be;t[37]===y?.source?Be=t[38]:(Be=y?.source===`demo`&&(0,B.jsx)(pa,{value:`timeline`,label:`Timeline`,noPadding:!0,children:(0,B.jsx)(ja,{})}),t[37]=y?.source,t[38]=Be);let Ve;t[39]!==_||t[40]!==y?(Ve=_===`map`&&!y&&(0,B.jsx)(pa,{value:`mapFeatures`,label:`Map Features`,noPadding:!0,children:(0,B.jsx)(Ja,{})}),t[39]=_,t[40]=y,t[41]=Ve):Ve=t[41];let He;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,B.jsx)(`label`,{htmlFor:`speedInput`,children:`Fly speed`}),t[42]=He):He=t[42];let Ue;t[43]===ie?Ue=t[44]:(Ue=Math.round(ie*100),t[43]=ie,t[44]=Ue);let We;t[45]===ae?We=t[46]:(We=e=>ae(parseFloat(e.target.value)/100),t[45]=ae,t[46]=We);let Ge;t[47]!==Ue||t[48]!==We?(Ge=(0,B.jsx)(`div`,{className:H.Control,children:(0,B.jsx)(`input`,{id:`speedInput`,type:`range`,min:1,max:100,step:1,value:Ue,onChange:We})}),t[47]=Ue,t[48]=We,t[49]=Ge):Ge=t[49];let Ke=h===!1?` Use your scroll wheel or trackpad to adjust while flying.`:``,qe;t[50]===Ke?qe=t[51]:(qe=(0,B.jsxs)(`p`,{className:H.Description,children:[`How fast you move in free-flying mode.`,Ke]}),t[50]=Ke,t[51]=qe);let Je;t[52]!==Ge||t[53]!==qe?(Je=(0,B.jsxs)(`div`,{className:H.Field,children:[He,Ge,qe]}),t[52]=Ge,t[53]=qe,t[54]=Je):Je=t[54];let Ye;t[55]!==h||t[56]!==se||t[57]!==L?(Ye=h?(0,B.jsxs)(`div`,{className:H.Field,children:[(0,B.jsx)(`label`,{htmlFor:`touchModeInput`,children:`Joystick`}),` `,(0,B.jsx)(`div`,{className:H.Control,children:(0,B.jsxs)(`select`,{id:`touchModeInput`,value:L,onChange:e=>se(e.target.value),children:[(0,B.jsx)(`option`,{value:`dualStick`,children:`Dual stick`}),(0,B.jsx)(`option`,{value:`moveLookStick`,children:`Single stick`})]})}),(0,B.jsx)(`p`,{className:H.Description,children:`Single stick has a unified move + look control. Dual stick has independent move + look.`})]}):null,t[55]=h,t[56]=se,t[57]=L,t[58]=Ye):Ye=t[58];let Xe;t[59]!==ce||t[60]!==h||t[61]!==le?(Xe=h===!1?(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[(0,B.jsx)(`input`,{id:`invertScroll`,type:`checkbox`,checked:ce,onChange:e=>{le(e.target.checked)}}),(0,B.jsx)(`label`,{className:H.Label,htmlFor:`invertScroll`,children:`Invert scroll direction`}),(0,B.jsx)(`p`,{className:H.Description,children:`Reverse which scroll direction increases and decreases fly speed.`})]}):null,t[59]=ce,t[60]=h,t[61]=le,t[62]=Xe):Xe=t[62];let Ze;t[63]!==fe||t[64]!==h||t[65]!==pe?(Ze=h?(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[(0,B.jsx)(`input`,{id:`invertJoystick`,type:`checkbox`,checked:fe,onChange:e=>{pe(e.target.checked)}}),(0,B.jsx)(`label`,{className:H.Label,htmlFor:`invertJoystick`,children:`Invert joystick direction`}),(0,B.jsx)(`p`,{className:H.Description,children:`Reverse joystick look direction.`})]}):null,t[63]=fe,t[64]=h,t[65]=pe,t[66]=Ze):Ze=t[66];let Qe;t[67]===de?Qe=t[68]:(Qe=e=>{de(e.target.checked)},t[67]=de,t[68]=Qe);let $e;t[69]!==ue||t[70]!==Qe?($e=(0,B.jsx)(`input`,{id:`invertDrag`,type:`checkbox`,checked:ue,onChange:Qe}),t[69]=ue,t[70]=Qe,t[71]=$e):$e=t[71];let et,tt;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`invertDrag`,children:`Invert drag direction`}),tt=(0,B.jsx)(`p`,{className:H.Description,children:`Reverse how dragging the viewport aims the camera.`}),t[72]=et,t[73]=tt):(et=t[72],tt=t[73]);let nt;t[74]===$e?nt=t[75]:(nt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[$e,et,tt]}),t[74]=$e,t[75]=nt);let rt;t[76]!==h||t[77]!==I||t[78]!==oe?(rt=h===!1&&(0,B.jsxs)(`div`,{className:H.Field,children:[(0,B.jsx)(`label`,{htmlFor:`mouseSensitivityInput`,children:`Mouse sensitivity`}),(0,B.jsx)(`div`,{className:H.Control,children:(0,B.jsx)(`input`,{id:`mouseSensitivityInput`,type:`range`,min:1,max:256,step:2,value:Math.round(I*16e3),onChange:e=>{oe(parseInt(e.target.value)/16e3)}})})]}),t[76]=h,t[77]=I,t[78]=oe,t[79]=rt):rt=t[79];let it;t[80]!==Je||t[81]!==Ye||t[82]!==Xe||t[83]!==Ze||t[84]!==nt||t[85]!==rt?(it=(0,B.jsxs)(pa,{value:`controls`,label:`Controls`,children:[Je,Ye,Xe,Ze,nt,rt]}),t[80]=Je,t[81]=Ye,t[82]=Xe,t[83]=Ze,t[84]=nt,t[85]=rt,t[86]=it):it=t[86];let at;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,B.jsx)(`label`,{htmlFor:`fovInput`,children:`FOV`}),t[87]=at):at=t[87];let ot;t[88]===O?ot=t[89]:(ot=(0,B.jsxs)(`output`,{htmlFor:`fovInput`,children:[O,`°`]}),t[88]=O,t[89]=ot);let st;t[90]===k?st=t[91]:(st=e=>k(parseInt(e.target.value)),t[90]=k,t[91]=st);let ct;t[92]!==O||t[93]!==st?(ct=(0,B.jsx)(`input`,{id:`fovInput`,type:`range`,min:75,max:120,step:5,value:O,onChange:st}),t[92]=O,t[93]=st,t[94]=ct):ct=t[94];let lt;t[95]!==ot||t[96]!==ct?(lt=(0,B.jsxs)(`div`,{className:H.Field,children:[at,(0,B.jsxs)(`div`,{className:H.Control,children:[ot,ct]})]}),t[95]=ot,t[96]=ct,t[97]=lt):lt=t[97];let ut;t[98]===F?ut=t[99]:(ut=e=>{F(e.target.checked)},t[98]=F,t[99]=ut);let dt;t[100]!==re||t[101]!==ut?(dt=(0,B.jsx)(`input`,{id:`showInputOverlayInput`,type:`checkbox`,checked:re,onChange:ut}),t[100]=re,t[101]=ut,t[102]=dt):dt=t[102];let ft;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`showInputOverlayInput`,children:`Show input overlay`}),t[103]=ft):ft=t[103];let pt;t[104]===dt?pt=t[105]:(pt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[dt,ft]}),t[104]=dt,t[105]=pt);let mt;t[106]!==lt||t[107]!==pt?(mt=(0,B.jsxs)(pa,{value:`preferences`,label:`Preferences`,children:[lt,pt]}),t[106]=lt,t[107]=pt,t[108]=mt):mt=t[108];let ht;t[109]===j?ht=t[110]:(ht=e=>{j(e.target.checked)},t[109]=j,t[110]=ht);let gt;t[111]!==A||t[112]!==ht?(gt=(0,B.jsx)(`input`,{id:`audioInput`,type:`checkbox`,checked:A,onChange:ht}),t[111]=A,t[112]=ht,t[113]=gt):gt=t[113];let _t;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`audioInput`,children:`Enable audio`}),t[114]=_t):_t=t[114];let vt;t[115]===gt?vt=t[116]:(vt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[gt,_t]}),t[115]=gt,t[116]=vt);let yt;t[117]===Symbol.for(`react.memo_cache_sentinel`)?(yt=(0,B.jsx)(`label`,{htmlFor:`volumeInput`,children:`Master volume`}),t[117]=yt):yt=t[117];let bt;t[118]===M?bt=t[119]:(bt=Math.round(M*100),t[118]=M,t[119]=bt);let xt;t[120]===bt?xt=t[121]:(xt=(0,B.jsxs)(`output`,{htmlFor:`volumeInput`,children:[bt,`%`]}),t[120]=bt,t[121]=xt);let St;t[122]===ee?St=t[123]:(St=e=>ee(parseFloat(e.target.value)),t[122]=ee,t[123]=St);let Ct;t[124]!==M||t[125]!==St?(Ct=(0,B.jsx)(`input`,{id:`volumeInput`,type:`range`,min:0,max:1,step:.05,value:M,onChange:St}),t[124]=M,t[125]=St,t[126]=Ct):Ct=t[126];let wt;t[127]!==xt||t[128]!==Ct?(wt=(0,B.jsxs)(`div`,{className:H.Field,children:[yt,(0,B.jsxs)(`div`,{className:H.Control,children:[xt,Ct]})]}),t[127]=xt,t[128]=Ct,t[129]=wt):wt=t[129];let Tt;t[130]!==vt||t[131]!==wt?(Tt=(0,B.jsxs)(pa,{value:`audio`,label:`Audio`,children:[vt,wt]}),t[130]=vt,t[131]=wt,t[132]=Tt):Tt=t[132];let Et;t[133]===D?Et=t[134]:(Et=e=>{D(e.target.checked)},t[133]=D,t[134]=Et);let Dt;t[135]!==E||t[136]!==Et?(Dt=(0,B.jsx)(`input`,{id:`fogInput`,type:`checkbox`,checked:E,onChange:Et}),t[135]=E,t[136]=Et,t[137]=Dt):Dt=t[137];let Ot;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(Ot=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`fogInput`,children:`Enable fog`}),t[138]=Ot):Ot=t[138];let kt;t[139]===Dt?kt=t[140]:(kt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[Dt,Ot]}),t[139]=Dt,t[140]=kt);let At;t[141]===N?At=t[142]:(At=e=>{N(e.target.checked)},t[141]=N,t[142]=At);let jt;t[143]!==te||t[144]!==At?(jt=(0,B.jsx)(`input`,{id:`animationInput`,type:`checkbox`,checked:te,onChange:At}),t[143]=te,t[144]=At,t[145]=jt):jt=t[145];let Mt;t[146]===Symbol.for(`react.memo_cache_sentinel`)?(Mt=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`animationInput`,children:`Enable animations`}),t[146]=Mt):Mt=t[146];let Nt;t[147]===jt?Nt=t[148]:(Nt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[jt,Mt]}),t[147]=jt,t[148]=Nt);let Pt;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(Pt=(0,B.jsx)(`label`,{htmlFor:`fpsLimitInput`,children:`FPS limit`}),t[149]=Pt):Pt=t[149];let Ft=P??``,It;t[150]===ne?It=t[151]:(It=e=>{let t=e.target.value;ne(t===``?null:parseInt(t))},t[150]=ne,t[151]=It);let Lt,Rt,zt,Bt,Vt;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(Lt=(0,B.jsx)(`option`,{value:`30`,children:`30`}),Rt=(0,B.jsx)(`option`,{value:`60`,children:`60`}),zt=(0,B.jsx)(`option`,{value:`120`,children:`120`}),Bt=(0,B.jsx)(`option`,{value:`144`,children:`144`}),Vt=(0,B.jsx)(`option`,{value:``,children:`No limit`}),t[152]=Lt,t[153]=Rt,t[154]=zt,t[155]=Bt,t[156]=Vt):(Lt=t[152],Rt=t[153],zt=t[154],Bt=t[155],Vt=t[156]);let Ht;t[157]!==Ft||t[158]!==It?(Ht=(0,B.jsx)(`div`,{className:H.Control,children:(0,B.jsxs)(`select`,{id:`fpsLimitInput`,value:Ft,onChange:It,children:[Lt,Rt,zt,Bt,Vt]})}),t[157]=Ft,t[158]=It,t[159]=Ht):Ht=t[159];let Ut;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(Ut=(0,B.jsx)(`p`,{className:H.Description,children:`Give your device a break by capping the framerate.`}),t[160]=Ut):Ut=t[160];let Wt;t[161]===Ht?Wt=t[162]:(Wt=(0,B.jsxs)(`div`,{className:H.Field,children:[Pt,Ht,Ut]}),t[161]=Ht,t[162]=Wt);let Gt;t[163]!==kt||t[164]!==Nt||t[165]!==Wt?(Gt=(0,B.jsxs)(pa,{value:`graphics`,label:`Graphics`,children:[kt,Nt,Wt]}),t[163]=kt,t[164]=Nt,t[165]=Wt,t[166]=Gt):Gt=t[166];let Kt;t[167]===he?Kt=t[168]:(Kt=e=>{he(e.target.checked)},t[167]=he,t[168]=Kt);let qt;t[169]!==me||t[170]!==Kt?(qt=(0,B.jsx)(`input`,{id:`debugInput`,type:`checkbox`,checked:me,onChange:Kt}),t[169]=me,t[170]=Kt,t[171]=qt):qt=t[171];let Jt;t[172]===Symbol.for(`react.memo_cache_sentinel`)?(Jt=(0,B.jsx)(`label`,{className:H.Label,htmlFor:`debugInput`,children:`Render debug visuals`}),t[172]=Jt):Jt=t[172];let Yt;t[173]===qt?Yt=t[174]:(Yt=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[qt,Jt]}),t[173]=qt,t[174]=Yt);let Xt;t[175]===_e?Xt=t[176]:(Xt=e=>{_e(e.target.checked)},t[175]=_e,t[176]=Xt);let Zt;t[177]!==ge||t[178]!==Xt?(Zt=(0,B.jsx)(`input`,{id:`onDemandInput`,type:`checkbox`,checked:ge,onChange:Xt}),t[177]=ge,t[178]=Xt,t[179]=Zt):Zt=t[179];let Qt;t[180]===Symbol.for(`react.memo_cache_sentinel`)?(Qt=(0,B.jsx)(`label`,{htmlFor:`onDemandInput`,children:`Render on demand `}),t[180]=Qt):Qt=t[180];let $t;t[181]===p?$t=t[182]:($t=()=>p.current?.(),t[181]=p,t[182]=$t);let en;t[183]===Symbol.for(`react.memo_cache_sentinel`)?(en=(0,B.jsx)(nn,{}),t[183]=en):en=t[183];let tn;t[184]===$t?tn=t[185]:(tn=(0,B.jsxs)(`div`,{className:H.Label,children:[Qt,(0,B.jsx)(`button`,{type:`button`,className:H.ForceRenderButton,title:`Force render`,"aria-label":`Force render`,onClick:$t,children:en})]}),t[184]=$t,t[185]=tn);let rn;t[186]===Symbol.for(`react.memo_cache_sentinel`)?(rn=(0,B.jsx)(`p`,{className:H.Description,children:`Significantly decreases CPU and GPU usage by only rendering frames when requested. Helpful when developing parts of the app unrelated to rendering.`}),t[186]=rn):rn=t[186];let an;t[187]!==Zt||t[188]!==tn?(an=(0,B.jsxs)(`div`,{className:H.CheckboxField,children:[Zt,tn,rn]}),t[187]=Zt,t[188]=tn,t[189]=an):an=t[189];let on;t[190]!==Yt||t[191]!==an?(on=(0,B.jsxs)(pa,{value:`debug`,label:`Debug`,children:[Yt,an]}),t[190]=Yt,t[191]=an,t[192]=on):on=t[192];let sn;t[193]!==Be||t[194]!==Ve||t[195]!==it||t[196]!==mt||t[197]!==Tt||t[198]!==Gt||t[199]!==on?(sn=(0,B.jsx)(`div`,{className:H.Accordions,children:(0,B.jsxs)(fa,{type:`multiple`,defaultValue:no,children:[Be,Ve,it,mt,Tt,Gt,on]})}),t[193]=Be,t[194]=Ve,t[195]=it,t[196]=mt,t[197]=Tt,t[198]=Gt,t[199]=on,t[200]=sn):sn=t[200];let cn;t[201]===Symbol.for(`react.memo_cache_sentinel`)?(cn=(0,B.jsx)(`span`,{className:mn.ButtonLabel,children:`Close`}),t[201]=cn):cn=t[201];let ln;t[202]===m?ln=t[203]:(ln=(0,B.jsx)(`button`,{className:H.CloseSidebarButton,onClick:m,children:cn}),t[202]=m,t[203]=ln);let un;return t[204]!==ve||t[205]!==ze||t[206]!==sn||t[207]!==ln?(un=(0,B.jsx)(`div`,{className:H.InspectorControls,children:(0,B.jsx)(`div`,{ref:Se,children:(0,B.jsxs)(`div`,{className:H.Dropdown,ref:be,id:`settingsPanel`,tabIndex:-1,onKeyDown:Oe,onBlur:Ee,"data-open":ve,children:[ze,sn,ln]})})}),t[204]=ve,t[205]=ze,t[206]=sn,t[207]=ln,t[208]=un):un=t[208],un});function io(e){return e.gameStatus===`connected`||e.gameStatus===`authenticating`}function ao(...e){}function oo(e,t){return so(e)?e(co(t)?t():t):e}function so(e){return typeof e==`function`}function co(e){return typeof e==`function`}function lo(e,t){return typeof Object.hasOwn==`function`?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function U(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function uo(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``)}function fo(e,t){let n={...e};for(let e of t)lo(n,e)&&delete n[e];return n}function po(e,t){let n={};for(let r of t)lo(e,r)&&(n[r]=e[r]);return n}function mo(e){return e}function ho(e,t){if(!e)throw Error(typeof t==`string`?t:`Invariant failed`)}function go(e){return Object.keys(e)}function _o(e,...t){let n=typeof e==`function`?e(...t):e;return n==null?!1:!n}function vo(e){return e.disabled||e[`aria-disabled`]===!0||e[`aria-disabled`]===`true`}function yo(e){let t={};for(let n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function W(...e){for(let t of e)if(t!==void 0)return t}function bo(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function xo(e){return!e||!(0,R.isValidElement)(e)?!1:`ref`in e.props||`ref`in e}function So(e){return xo(e)?{...e.props}.ref||e.ref:null}function Co(e,t){let n={...e};for(let r in t){if(!lo(t,r))continue;if(r===`className`){let r=`className`;n[r]=e[r]?`${e[r]} ${t[r]}`:t[r];continue}if(r===`style`){let r=`style`;n[r]=e[r]?{...e[r],...t[r]}:t[r];continue}let i=t[r];if(typeof i==`function`&&r.startsWith(`on`)){let t=e[r];if(typeof t==`function`){n[r]=(...e)=>{i(...e),t(...e)};continue}}n[r]=i}return n}var wo=To();function To(){return typeof window<`u`&&!!window.document?.createElement}function Eo(e){return e?`self`in e?e.document:e.ownerDocument||document:document}function Do(e){return e?`self`in e?e.self:Eo(e).defaultView||window:self}function Oo(e,t=!1){let{activeElement:n}=Eo(e);if(!n?.nodeName)return null;if(ko(n)&&n.contentDocument?.body)return Oo(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Eo(n).getElementById(e);if(t)return t}}return n}function G(e,t){return e===t||e.contains(t)}function ko(e){return e.tagName===`IFRAME`}function Ao(e){let t=e.tagName.toLowerCase();return t===`button`?!0:t===`input`&&e.type?jo.indexOf(e.type)!==-1:!1}var jo=[`button`,`color`,`file`,`image`,`reset`,`submit`];function Mo(e){if(typeof e.checkVisibility==`function`)return e.checkVisibility();let t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}function No(e){try{let t=e instanceof HTMLInputElement&&e.selectionStart!==null,n=e.tagName===`TEXTAREA`;return t||n||!1}catch{return!1}}function Po(e){return e.isContentEditable||No(e)}function Fo(e){if(No(e))return e.value;if(e.isContentEditable){let t=Eo(e).createRange();return t.selectNodeContents(e),t.toString()}return``}function Io(e){let t=0,n=0;if(No(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){let r=Eo(e).getSelection();if(r?.rangeCount&&r.anchorNode&&G(e,r.anchorNode)&&r.focusNode&&G(e,r.focusNode)){let i=r.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(e),a.setEnd(i.startContainer,i.startOffset),t=a.toString().length,a.setEnd(i.endContainer,i.endOffset),n=a.toString().length}}return{start:t,end:n}}function Lo(e,t){let n=[`dialog`,`menu`,`listbox`,`tree`,`grid`],r=e?.getAttribute(`role`);return r&&n.indexOf(r)!==-1?r:t}function Ro(e){if(!e)return null;let t=e=>e===`auto`||e===`scroll`;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:n}=getComputedStyle(e);if(t(n))return e}return Ro(e.parentElement)||document.scrollingElement||document.body}function zo(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function Bo(e,t){let n=e.map((e,t)=>[t,e]),r=!1;return n.sort(([e,n],[i,a])=>{let o=t(n),s=t(a);return o===s||!o||!s?0:Vo(o,s)?(e>i&&(r=!0),-1):(et):e}function Vo(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Ho(){return wo&&!!navigator.maxTouchPoints}function Uo(){return wo?/mac|iphone|ipad|ipod/i.test(navigator.platform):!1}function Wo(){return wo&&Uo()&&/apple/i.test(navigator.vendor)}function Go(){return wo&&/firefox\//i.test(navigator.userAgent)}function Ko(){return wo&&navigator.platform.startsWith(`Mac`)&&!Ho()}function qo(e){return!!(e.currentTarget&&!G(e.currentTarget,e.target))}function Jo(e){return e.target===e.currentTarget}function Yo(e){let t=e.currentTarget;if(!t)return!1;let n=Uo();if(n&&!e.metaKey||!n&&!e.ctrlKey)return!1;let r=t.tagName.toLowerCase();return r===`a`||r===`button`&&t.type===`submit`||r===`input`&&t.type===`submit`}function Xo(e){let t=e.currentTarget;if(!t)return!1;let n=t.tagName.toLowerCase();return e.altKey?n===`a`||n===`button`&&t.type===`submit`||n===`input`&&t.type===`submit`:!1}function Zo(e,t){let n=new FocusEvent(`blur`,t),r=e.dispatchEvent(n),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent(`focusout`,i)),r}function Qo(e,t,n){let r=new KeyboardEvent(t,n);return e.dispatchEvent(r)}function $o(e,t){let n=new MouseEvent(`click`,t);return e.dispatchEvent(n)}function es(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!G(n,r)}function ts(e,t,n,r){let i=(e=>{if(r){let t=setTimeout(e,r);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),n()}),a=()=>{i(),n()};return e.addEventListener(t,a,{once:!0,capture:!0}),i}function ns(e,t,n,r=window){let i=[];try{r.document.addEventListener(e,t,n);for(let a of Array.from(r.frames))i.push(ns(e,t,n,a))}catch{}return()=>{try{r.document.removeEventListener(e,t,n)}catch{}for(let e of i)e()}}var rs={...R},is=rs.useId;rs.useDeferredValue;var as=rs.useInsertionEffect,K=wo?R.useLayoutEffect:R.useEffect;function os(e){let[t]=(0,R.useState)(e);return t}function ss(e){let t=(0,R.useRef)(e);return K(()=>{t.current=e}),t}function q(e){let t=(0,R.useRef)(()=>{throw Error(`Cannot call an event handler while rendering.`)});return as?as(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>t.current?.call(t,...e),[])}function cs(e){let[t,n]=(0,R.useState)(null);return K(()=>{if(t==null||!e)return;let n=null;return e(e=>(n=e,t)),()=>{e(n)}},[t,e]),[t,n]}function ls(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let n of e)bo(n,t)}},e)}function us(e){if(is){let t=is();return e||t}let[t,n]=(0,R.useState)(e);return K(()=>{e||t||n(`id-${Math.random().toString(36).slice(2,8)}`)},[e,t]),e||t}function ds(e,t){let n=e=>{if(typeof e==`string`)return e},[r,i]=(0,R.useState)(()=>n(t));return K(()=>{i((e&&`current`in e?e.current:e)?.tagName.toLowerCase()||n(t))},[e,t]),r}function fs(e,t,n){let r=os(n),[i,a]=(0,R.useState)(r);return(0,R.useEffect)(()=>{let n=e&&`current`in e?e.current:e;if(!n)return;let i=()=>{a(n.getAttribute(t)??r)},o=new MutationObserver(i);return o.observe(n,{attributeFilter:[t]}),i(),()=>o.disconnect()},[e,t,r]),i}function ps(e,t){let n=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(n.current)return e();n.current=!0},t),(0,R.useEffect)(()=>()=>{n.current=!1},[])}function ms(e,t){let n=(0,R.useRef)(!1);K(()=>{if(n.current)return e();n.current=!0},t),K(()=>()=>{n.current=!1},[])}function hs(){return(0,R.useReducer)(()=>[],[])}function gs(e){return q(typeof e==`function`?e:()=>e)}function _s(e,t,n=[]){let r=(0,R.useCallback)(n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n)),[...n,e.wrapElement]);return{...e,wrapElement:r}}function vs(e=!1,t){let[n,r]=(0,R.useState)(null);return{portalRef:ls(r,t),portalNode:n,domReady:!e||n}}function ys(e,t,n){let r=e.onLoadedMetadataCapture,i=(0,R.useMemo)(()=>Object.assign(()=>{},r,{[t]:n}),[r,t,n]);return[r?.[t],{onLoadedMetadataCapture:i}]}var bs=!1;function xs(){return(0,R.useEffect)(()=>{bs||=(ns(`mousemove`,Es,!0),ns(`mousedown`,Ds,!0),ns(`mouseup`,Ds,!0),ns(`keydown`,Ds,!0),ns(`scroll`,Ds,!0),!0)},[]),q(()=>Ss)}var Ss=!1,Cs=0,ws=0;function Ts(e){let t=e.movementX||e.screenX-Cs,n=e.movementY||e.screenY-ws;return Cs=e.screenX,ws=e.screenY,t||n||!1}function Es(e){Ts(e)&&(Ss=!0)}function Ds(){Ss=!1}function Os(e){let t=R.forwardRef((t,n)=>e({...t,ref:n}));return t.displayName=e.displayName||e.name,t}function ks(e,t){return R.memo(e,t)}function As(e,t){let{wrapElement:n,render:r,...i}=t,a=ls(t.ref,So(r)),o;if(R.isValidElement(r)){let e={...r.props,ref:a};o=R.cloneElement(r,Co(i,e))}else o=r?r(i):(0,B.jsx)(e,{...i});return n?n(o):o}function js(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function Ms(e=[],t=[]){let n=R.createContext(void 0),r=R.createContext(void 0),i=()=>R.useContext(n),a=(e=!1)=>{let t=R.useContext(r),n=i();return e?t:t||n},o=()=>{let e=R.useContext(r),t=i();if(!(e&&e===t))return t},s=t=>e.reduceRight((e,n)=>(0,B.jsx)(n,{...t,children:e}),(0,B.jsx)(n.Provider,{...t}));return{context:n,scopedContext:r,useContext:i,useScopedContext:a,useProviderContext:o,ContextProvider:s,ScopedContextProvider:e=>(0,B.jsx)(s,{...e,children:t.reduceRight((t,n)=>(0,B.jsx)(n,{...e,children:t}),(0,B.jsx)(r.Provider,{...e}))})}}var Ns=Ms(),Ps=Ns.useContext;Ns.useScopedContext,Ns.useProviderContext;var Fs=Ns.ContextProvider,Is=Ns.ScopedContextProvider,Ls=Ms([Fs],[Is]),Rs=Ls.useContext;Ls.useScopedContext;var zs=Ls.useProviderContext,Bs=Ls.ContextProvider,Vs=Ls.ScopedContextProvider,Hs=(0,R.createContext)(void 0),Us=(0,R.createContext)(void 0);function Ws(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function Gs(e,t){return t&&e.item(t)||null}function Ks(e){let t=[];for(let n of e){let e=t.find(e=>e[0]?.rowId===n.rowId);e?e.push(n):t.push([n])}return t}function qs(e,t=!1){if(No(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let n=Eo(e).getSelection();n?.selectAllChildren(e),t&&n?.collapseToEnd()}}var Js=Symbol(`FOCUS_SILENTLY`);function Ys(e){e[Js]=!0,e.focus({preventScroll:!0})}function Xs(e){let t=e[Js];return delete e[Js],t}function Zs(e,t,n){if(!t||t===n)return!1;let r=e.item(t.id);return!(!r||n&&r.element===n)}var Qs=`div`,$s=js(function({store:e,shouldRegisterItem:t=!0,getItem:n=mo,element:r,...i}){let a=Ps();e||=a;let o=us(i.id),s=(0,R.useRef)(r);return(0,R.useEffect)(()=>{let r=s.current;if(!o||!r||!t)return;let i=n({id:o,element:r});return e?.renderItem(i)},[o,t,n,e]),i={...i,ref:ls(s,i.ref)},yo(i)});Os(function(e){return As(Qs,$s(e))});var ec=(0,R.createContext)(!0),tc=`input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])`;function nc(e){return Number.parseInt(e.getAttribute(`tabindex`)||`0`,10)<0}function rc(e){return!(!e.matches(tc)||!Mo(e)||e.closest(`[inert]`))}function ic(e){if(!rc(e)||nc(e))return!1;if(!(`form`in e)||!e.form||e.checked||e.type!==`radio`)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!(`length`in t))return!0;let n=Oo(e);return!n||n===e||!(`form`in n)||n.form!==e.form||n.name!==e.name}function ac(e,t){let n=Array.from(e.querySelectorAll(tc));t&&n.unshift(e);let r=n.filter(rc);return r.forEach((e,t)=>{if(!ko(e))return;let n=e.contentDocument?.body;n&&r.splice(t,1,...ac(n))}),r}function oc(e,t,n){let r=Array.from(e.querySelectorAll(tc)),i=r.filter(ic);return t&&ic(e)&&i.unshift(e),i.forEach((e,t)=>{if(!ko(e))return;let r=e.contentDocument?.body;if(!r)return;let a=oc(r,!1,n);i.splice(t,1,...a)}),!i.length&&n?r:i}function sc(e,t,n){let[r]=oc(e,t,n);return r||null}function cc(e,t,n,r){let i=Oo(e),a=ac(e,t),o=a.indexOf(i),s=a.slice(o+1);return s.find(ic)||(n?a.find(ic):null)||(r?s[0]:null)||null}function lc(e,t){return cc(document.body,!1,e,t)}function uc(e,t,n,r){let i=Oo(e),a=ac(e,t).reverse(),o=a.indexOf(i),s=a.slice(o+1);return s.find(ic)||(n?a.find(ic):null)||(r?s[0]:null)||null}function dc(e,t){return uc(document.body,!1,e,t)}function fc(e){for(;e&&!rc(e);)e=e.closest(tc);return e||null}function pc(e){let t=Oo(e);if(!t)return!1;if(t===e)return!0;let n=t.getAttribute(`aria-activedescendant`);return n?n===e.id:!1}function mc(e){let t=Oo(e);if(!t)return!1;if(G(e,t))return!0;let n=t.getAttribute(`aria-activedescendant`);return!n||!(`id`in e)?!1:n===e.id?!0:!!e.querySelector(`#${CSS.escape(n)}`)}function hc(e){!mc(e)&&rc(e)&&e.focus()}function gc(e){let t=e.getAttribute(`tabindex`)??``;e.setAttribute(`data-tabindex`,t),e.setAttribute(`tabindex`,`-1`)}function _c(e,t){let n=oc(e,t);for(let e of n)gc(e)}function vc(e){let t=e.querySelectorAll(`[data-tabindex]`),n=e=>{let t=e.getAttribute(`data-tabindex`);e.removeAttribute(`data-tabindex`),t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)};e.hasAttribute(`data-tabindex`)&&n(e);for(let e of t)n(e)}function yc(e,t){`scrollIntoView`in e?(e.focus({preventScroll:!0}),e.scrollIntoView({block:`nearest`,inline:`nearest`,...t})):e.focus()}var bc=`div`,xc=Wo(),Sc=[`text`,`search`,`url`,`tel`,`email`,`password`,`number`,`date`,`month`,`week`,`time`,`datetime`,`datetime-local`],Cc=Symbol(`safariFocusAncestor`);function wc(e){return e?!!e[Cc]:!1}function Tc(e,t){e&&(e[Cc]=t)}function Ec(e){let{tagName:t,readOnly:n,type:r}=e;return t===`TEXTAREA`&&!n||t===`SELECT`&&!n?!0:t===`INPUT`&&!n?Sc.includes(r):!!(e.isContentEditable||e.getAttribute(`role`)===`combobox`&&e.dataset.name)}function Dc(e){return`labels`in e?e.labels:null}function Oc(e){return e.tagName.toLowerCase()===`input`&&e.type?e.type===`radio`||e.type===`checkbox`:!1}function kc(e){return e?e===`button`||e===`summary`||e===`input`||e===`select`||e===`textarea`||e===`a`:!0}function Ac(e){return e?e===`button`||e===`input`||e===`select`||e===`textarea`:!0}function jc(e,t,n,r,i){return e?t?n&&!r?-1:void 0:n?i:i||0:i}function Mc(e,t){return q(n=>{e?.(n),!n.defaultPrevented&&t&&(n.stopPropagation(),n.preventDefault())})}var Nc=!1,Pc=!0;function Fc(e){let t=e.target;t&&`hasAttribute`in t&&(t.hasAttribute(`data-focus-visible`)||(Pc=!1))}function Ic(e){e.metaKey||e.ctrlKey||e.altKey||(Pc=!0)}var Lc=js(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:n,onFocusVisible:r,...i}){let a=(0,R.useRef)(null);(0,R.useEffect)(()=>{e&&(Nc||=(ns(`mousedown`,Fc,!0),ns(`keydown`,Ic,!0),!0))},[e]),xc&&(0,R.useEffect)(()=>{if(!e)return;let t=a.current;if(!t||!Oc(t))return;let n=Dc(t);if(!n)return;let r=()=>queueMicrotask(()=>t.focus());for(let e of n)e.addEventListener(`mouseup`,r);return()=>{for(let e of n)e.removeEventListener(`mouseup`,r)}},[e]);let o=e&&vo(i),s=!!o&&!t,[c,l]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&s&&c&&l(!1)},[e,s,c]),(0,R.useEffect)(()=>{if(!e||!c)return;let t=a.current;if(!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(()=>{rc(t)||l(!1)});return n.observe(t),()=>n.disconnect()},[e,c]);let u=Mc(i.onKeyPressCapture,o),d=Mc(i.onMouseDownCapture,o),f=Mc(i.onClickCapture,o),p=i.onMouseDown,m=q(t=>{if(p?.(t),t.defaultPrevented||!e)return;let n=t.currentTarget;if(!xc||qo(t)||!Ao(n)&&!Oc(n))return;let r=!1,i=()=>{r=!0};n.addEventListener(`focusin`,i,{capture:!0,once:!0});let a=fc(n.parentElement);Tc(a,!0),ts(n,`mouseup`,()=>{n.removeEventListener(`focusin`,i,!0),Tc(a,!1),!r&&hc(n)})}),h=(t,n)=>{if(n&&(t.currentTarget=n),!e)return;let i=t.currentTarget;i&&pc(i)&&(r?.(t),!t.defaultPrevented&&(i.dataset.focusVisible=`true`,l(!0)))},g=i.onKeyDownCapture,_=q(t=>{if(g?.(t),t.defaultPrevented||!e||c||t.metaKey||t.altKey||t.ctrlKey||!Jo(t))return;let n=t.currentTarget;ts(n,`focusout`,()=>h(t,n))}),v=i.onFocusCapture,y=q(t=>{if(v?.(t),t.defaultPrevented||!e)return;if(!Jo(t)){l(!1);return}let n=t.currentTarget;Pc||Ec(t.target)?ts(t.target,`focusout`,()=>h(t,n)):l(!1)}),b=i.onBlur,x=q(t=>{b?.(t),e&&es(t)&&(t.currentTarget.removeAttribute(`data-focus-visible`),l(!1))}),S=(0,R.useContext)(ec),C=q(t=>{e&&n&&t&&S&&queueMicrotask(()=>{pc(t)||rc(t)&&t.focus()})}),w=ds(a),T=e&&kc(w),E=e&&Ac(w),D=i.style,O=(0,R.useMemo)(()=>s?{pointerEvents:`none`,...D}:D,[s,D]);return i={"data-focus-visible":e&&c||void 0,"data-autofocus":n||void 0,"aria-disabled":o||void 0,...i,ref:ls(a,C,i.ref),style:O,tabIndex:jc(e,s,T,E,i.tabIndex),disabled:E&&s?!0:void 0,contentEditable:o?void 0:i.contentEditable,onKeyPressCapture:u,onClickCapture:f,onMouseDownCapture:d,onMouseDown:m,onKeyDownCapture:_,onFocusCapture:y,onBlur:x},yo(i)});Os(function(e){return As(bc,Lc(e))});var Rc=`button`;function zc(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return e.key===`Enter`?Ao(t)||t.tagName===`SUMMARY`||t.tagName===`A`:e.key===` `?Ao(t)||t.tagName===`SUMMARY`||t.tagName===`INPUT`||t.tagName===`SELECT`:!1}var Bc=Symbol(`command`),Vc=js(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let r=(0,R.useRef)(null),[i,a]=(0,R.useState)(!1);(0,R.useEffect)(()=>{r.current&&a(Ao(r.current))},[]);let[o,s]=(0,R.useState)(!1),c=(0,R.useRef)(!1),l=vo(n),[u,d]=ys(n,Bc,!0),f=n.onKeyDown,p=q(n=>{f?.(n);let r=n.currentTarget;if(n.defaultPrevented||u||l||!Jo(n)||No(r)||r.isContentEditable)return;let i=e&&n.key===`Enter`,a=t&&n.key===` `,o=n.key===`Enter`&&!e,d=n.key===` `&&!t;if(o||d){n.preventDefault();return}if(i||a){let e=zc(n);if(i){if(!e){n.preventDefault();let{view:e,...t}=n,i=()=>$o(r,t);Go()?ts(r,`keyup`,i):queueMicrotask(i)}}else a&&(c.current=!0,e||(n.preventDefault(),s(!0)))}}),m=n.onKeyUp,h=q(e=>{if(m?.(e),e.defaultPrevented||u||l||e.metaKey)return;let n=t&&e.key===` `;if(c.current&&n&&(c.current=!1,!zc(e))){e.preventDefault(),s(!1);let t=e.currentTarget,{view:n,...r}=e;queueMicrotask(()=>$o(t,r))}});return n={"data-active":o||void 0,type:i?`button`:void 0,...d,...n,ref:ls(r,n.ref),onKeyDown:p,onKeyUp:h},n=Lc(n),n});Os(function(e){return As(Rc,Vc(e))});function Hc(e,t){let n=e.__unstableInternals;return ho(n,`Invalid store`),n[t]}function Uc(e,...t){let n=e,r=n,i=Symbol(),a=ao,o=new Set,s=new Set,c=new Set,l=new Set,u=new Set,d=new WeakMap,f=new WeakMap,p=e=>(c.add(e),()=>c.delete(e)),m=()=>{let e=o.size,r=Symbol();o.add(r);let i=()=>{o.delete(r),!o.size&&a()};if(e)return i;let s=go(n).map(e=>U(...t.map(t=>{let n=(t?.getState)?.call(t);if(n&&lo(n,e))return qc(t,[e],t=>{S(e,t[e],!0)})}))),l=[];for(let e of c)l.push(e());let u=t.map(Gc);return a=U(...s,...l,...u),i},h=(e,t,n=l)=>(n.add(t),f.set(t,e),()=>{var e;(e=d.get(t))==null||e(),d.delete(t),f.delete(t),n.delete(t)}),g=(e,t)=>h(e,t),_=(e,t)=>(d.set(t,t(n,n)),h(e,t)),v=(e,t)=>(d.set(t,t(n,r)),h(e,t,u)),y=e=>Uc(po(n,e),C),b=e=>Uc(fo(n,e),C),x=()=>n,S=(e,a,o=!1)=>{var c;if(!lo(n,e))return;let p=oo(a,n[e]);if(p===n[e])return;if(!o)for(let n of t)(c=n?.setState)==null||c.call(n,e,p);let m=n;n={...n,[e]:p};let h=Symbol();i=h,s.add(e);let g=(t,r,i)=>{var a;let o=f.get(t);(!o||o.some(t=>i?i.has(t):t===e))&&((a=d.get(t))==null||a(),d.set(t,t(n,r)))};for(let e of l)g(e,m);queueMicrotask(()=>{if(i!==h)return;let e=n;for(let e of u)g(e,r,s);r=e,s.clear()})},C={getState:x,setState:S,__unstableInternals:{setup:p,init:m,subscribe:g,sync:_,batch:v,pick:y,omit:b}};return C}function Wc(e,...t){if(e)return Hc(e,`setup`)(...t)}function Gc(e,...t){if(e)return Hc(e,`init`)(...t)}function Kc(e,...t){if(e)return Hc(e,`subscribe`)(...t)}function qc(e,...t){if(e)return Hc(e,`sync`)(...t)}function Jc(e,...t){if(e)return Hc(e,`batch`)(...t)}function Yc(e,...t){if(e)return Hc(e,`omit`)(...t)}function Xc(e,...t){if(e)return Hc(e,`pick`)(...t)}function Zc(...e){let t={};for(let n of e){let e=(n?.getState)?.call(n);e&&Object.assign(t,e)}let n=Uc(t,...e);return Object.assign({},...e,n)}var{useSyncExternalStore:Qc}=e(ee(),1).default,$c=()=>()=>{};function J(e,t=mo){let n=R.useCallback(t=>e?Kc(e,null,t):$c(),[e]),r=()=>{let n=typeof t==`string`?t:null,r=typeof t==`function`?t:null,i=e?.getState();if(r)return r(i);if(i&&n&&lo(i,n))return i[n]};return Qc(n,r,r)}function el(e,t){let n=R.useRef({}),r=R.useCallback(t=>e?Kc(e,null,t):$c(),[e]),i=()=>{let r=e?.getState(),i=!1,a=n.current;for(let e in t){let n=t[e];if(typeof n==`function`){let t=n(r);t!==a[e]&&(a[e]=t,i=!0)}if(typeof n==`string`){if(!r||!lo(r,n))continue;let t=r[n];t!==a[e]&&(a[e]=t,i=!0)}}return i&&(n.current={...a}),n.current};return Qc(r,i,i)}function tl(e,t,n,r){let i=lo(t,n)?t[n]:void 0,a=ss({value:i,setValue:r?t[r]:void 0});K(()=>qc(e,[n],(e,t)=>{let{value:r,setValue:i}=a.current;i&&e[n]!==t[n]&&e[n]!==r&&i(e[n])}),[e,n]),K(()=>{if(i!==void 0)return e.setState(n,i),Jc(e,[n],()=>{i!==void 0&&e.setState(n,i)})})}function nl(e,t){let[n,r]=R.useState(()=>e(t));K(()=>Gc(n),[n]);let i=R.useCallback(e=>J(n,e),[n]);return[R.useMemo(()=>({...n,useState:i}),[n,i]),q(()=>{r(n=>e({...t,...n.getState()}))})]}var rl=`button`;function il(e){return Po(e)?!0:e.tagName===`INPUT`&&!Ao(e)}function al(e,t=!1){let n=e.clientHeight,{top:r}=e.getBoundingClientRect(),i=Math.max(n*.875,n-40)*1.5,a=t?n-i+r:i+r;return e.tagName===`HTML`?a+e.scrollTop:a}function ol(e,t=!1){let{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function sl(e,t,n,r=!1){if(!t||!n)return;let{renderedItems:i}=t.getState(),a=Ro(e);if(!a)return;let o=al(a,r),s,c;for(let e=0;e=0){c!==void 0&&ce.rowId===m);return f.ariaPosInSet+t.findIndex(e=>e.id===u)},isTabbable(t){if(!t?.renderedItems.length)return!0;if(t.virtualFocus)return!1;if(i)return!0;if(t.activeId===null)return!1;let n=e?.item(t.activeId);return n?.disabled||!n?.element?!0:t.activeId===u}}),b=(0,R.useCallback)(e=>{let t={...e,id:u||e.id,rowId:m,disabled:!!p,children:e.element?.textContent};return a?a(t):t},[u,m,p,a]),x=c.onFocus,S=(0,R.useRef)(!1),C=q(t=>{if(x?.(t),t.defaultPrevented||qo(t)||!u||!e||cl(t,e))return;let{virtualFocus:n,baseElement:r}=e.getState();e.setActiveId(u),Po(t.currentTarget)&&qs(t.currentTarget),n&&Jo(t)&&(il(t.currentTarget)||r?.isConnected&&(Wo()&&t.currentTarget.hasAttribute(`data-autofocus`)&&t.currentTarget.scrollIntoView({block:`nearest`,inline:`nearest`}),S.current=!0,t.relatedTarget===r||Zs(e,t.relatedTarget)?Ys(r):r.focus()))}),w=c.onBlurCapture,T=q(t=>{w?.(t),!t.defaultPrevented&&e?.getState()?.virtualFocus&&S.current&&(S.current=!1,t.preventDefault(),t.stopPropagation())}),E=c.onKeyDown,D=gs(n),O=gs(r),k=q(t=>{if(E?.(t),t.defaultPrevented||!Jo(t)||!e)return;let{currentTarget:n}=t,r=e.getState(),i=!!e.item(u)?.rowId,a=r.orientation!==`horizontal`,o=r.orientation!==`vertical`,s=()=>!!(i||o||!r.baseElement||!No(r.baseElement)),c={ArrowUp:(i||a)&&e.up,ArrowRight:(i||o)&&e.next,ArrowDown:(i||a)&&e.down,ArrowLeft:(i||o)&&e.previous,Home:()=>{if(s())return!i||t.ctrlKey?e?.first():e?.previous(-1)},End:()=>{if(s())return!i||t.ctrlKey?e?.last():e?.next(-1)},PageUp:()=>sl(n,e,e?.up,!0),PageDown:()=>sl(n,e,e?.down)}[t.key];if(c){if(Po(n)){let e=Io(n),r=o&&t.key===`ArrowLeft`,i=o&&t.key===`ArrowRight`,s=a&&t.key===`ArrowUp`,c=a&&t.key===`ArrowDown`;if(i||c){let{length:t}=Fo(n);if(e.end!==t)return}else if((r||s)&&e.start!==0)return}let r=c();if(D(t)||r!==void 0){if(!O(t))return;t.preventDefault(),e.move(r)}}}),A=(0,R.useMemo)(()=>({id:u,baseElement:h}),[u,h]);return c=_s(c,e=>(0,B.jsx)(Hs.Provider,{value:A,children:e}),[A]),c={"data-active-item":g||void 0,...c,id:u,ref:ls(d,c.ref),tabIndex:y?c.tabIndex:-1,onFocus:C,onBlurCapture:T,onKeyDown:k},c=Vc(c),c=$s({store:e,...c,getItem:b,shouldRegisterItem:u?c.shouldRegisterItem:!1}),yo({...c,"aria-setsize":_,"aria-posinset":v})});ks(Os(function(e){return As(rl,ll(e))}));function ul(e){let t=[];for(let n of e)t.push(...n);return t}function dl(e){return e.slice().reverse()}var fl=`div`;function pl(e){return e.some(e=>!!e.rowId)}function ml(e){let t=e.target;return t&&!No(t)?!1:e.key.length===1&&!e.ctrlKey&&!e.metaKey}function hl(e){return e.key===`Shift`||e.key===`Control`||e.key===`Alt`||e.key===`Meta`}function gl(e,t,n){return q(r=>{if(t?.(r),r.defaultPrevented||r.isPropagationStopped()||!Jo(r)||hl(r)||ml(r))return;let i=Gs(e,e.getState().activeId)?.element;if(!i)return;let{view:a,...o}=r;i!==n?.current&&i.focus(),Qo(i,r.type,o)||r.preventDefault(),r.currentTarget.contains(i)&&r.stopPropagation()})}function _l(e){return Ws(ul(dl(Ks(e))))}function vl(e,t){let{virtualFocus:n,baseElement:r}=e.getState();if(!n||!r||!No(r)){t();return}let i=r.scrollLeft,a=r.scrollTop;t(),r.scrollLeft=i,r.scrollTop=a}function yl(e){let[t,n]=(0,R.useState)(!1),r=(0,R.useCallback)(()=>n(!0),[]),i=J(e,t=>Gs(e,t.activeId));return(0,R.useEffect)(()=>{let r=i?.element;t&&r&&(n(!1),vl(e,()=>{r.focus({preventScroll:!0})}))},[e,i,t]),r}var bl=js(function({store:e,composite:t=!0,focusOnMove:n=t,moveOnKeyPress:r=!0,...i}){let a=zs();e||=a,ho(e,!1);let o=(0,R.useRef)(null),s=(0,R.useRef)(null),c=yl(e),l=J(e,`moves`),[,u]=cs(t?e.setBaseElement:null);(0,R.useEffect)(()=>{if(!e||!l||!t||!n)return;let{activeId:r}=e.getState(),i=Gs(e,r)?.element;i&&vl(e,()=>yc(i))},[e,l,t,n]),K(()=>{if(!e||!l||!t)return;let{baseElement:n,activeId:r}=e.getState();if(r!==null||!n)return;let i=s.current;s.current=null,i&&Zo(i,{relatedTarget:n}),pc(n)||n.focus()},[e,l,t]);let d=J(e,`activeId`),f=J(e,`virtualFocus`);K(()=>{if(!e||!t||!f)return;let n=s.current;if(s.current=null,!n)return;let r=Gs(e,d)?.element||Oo(n);r!==n&&Zo(n,{relatedTarget:r})},[e,d,f,t]);let p=gl(e,i.onKeyDownCapture,s),m=gl(e,i.onKeyUpCapture,s),h=i.onFocusCapture,g=q(t=>{if(h?.(t),t.defaultPrevented||!e)return;let{virtualFocus:n}=e.getState();if(!n)return;let r=t.relatedTarget,i=Xs(t.currentTarget);Jo(t)&&i&&(t.stopPropagation(),s.current=r)}),_=i.onFocus,v=q(n=>{if(_?.(n),n.defaultPrevented||!t||!e)return;let{relatedTarget:r}=n,{virtualFocus:i}=e.getState();i?Jo(n)&&!Zs(e,r)&&queueMicrotask(c):Jo(n)&&e.setActiveId(null)}),y=i.onBlurCapture,b=q(t=>{if(y?.(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:r}=e.getState();if(!n)return;let i=Gs(e,r)?.element,a=t.relatedTarget,o=Zs(e,a),c=s.current;s.current=null,Jo(t)&&o?(a===i?c&&c!==a&&Zo(c,t):i?Zo(i,t):c&&Zo(c,t),t.stopPropagation()):!Zs(e,t.target)&&i&&Zo(i,t)}),x=i.onKeyDown,S=gs(r),C=q(t=>{if(x?.(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!Jo(t))return;let{orientation:n,renderedItems:r,activeId:i}=e.getState();if(Gs(e,i)?.element?.isConnected)return;let a=n!==`horizontal`,o=n!==`vertical`,s=pl(r);if((t.key===`ArrowLeft`||t.key===`ArrowRight`||t.key===`Home`||t.key===`End`)&&No(t.currentTarget))return;let c={ArrowUp:(s||a)&&(()=>s?_l(r)?.id:e?.last()),ArrowRight:(s||o)&&e.first,ArrowDown:(s||a)&&e.first,ArrowLeft:(s||o)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let n=c();if(n!==void 0){if(!S(t))return;t.preventDefault(),e.move(n)}}});i=_s(i,t=>(0,B.jsx)(Bs,{value:e,children:t}),[e]);let w=J(e,n=>{if(e&&t&&n.virtualFocus)return Gs(e,n.activeId)?.id});return i={"aria-activedescendant":w,...i,ref:ls(o,u,i.ref),onKeyDownCapture:p,onKeyUpCapture:m,onFocusCapture:g,onFocus:v,onBlurCapture:b,onKeyDown:C},i=Lc({focusable:J(e,e=>t&&(e.virtualFocus||e.activeId===null)),...i}),i});Os(function(e){return As(fl,bl(e))});var xl=Ms();xl.useContext,xl.useScopedContext;var Sl=xl.useProviderContext,Cl=xl.ContextProvider,wl=xl.ScopedContextProvider,Tl=Ms([Cl],[wl]);Tl.useContext,Tl.useScopedContext;var El=Tl.useProviderContext,Dl=Tl.ContextProvider,Ol=Tl.ScopedContextProvider,kl=(0,R.createContext)(void 0),Al=(0,R.createContext)(void 0),jl=`div`;function Ml(e,t){let n=setTimeout(t,e);return()=>clearTimeout(n)}function Nl(e){let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)}function Pl(...e){return e.join(`, `).split(`, `).reduce((e,t)=>{let n=t.endsWith(`ms`)?1:1e3,r=Number.parseFloat(t||`0s`)*n;return r>e?r:e},0)}function Fl(e,t,n){return!n&&t!==!1&&(!e||!!t)}var Y=js(function({store:e,alwaysVisible:t,...n}){let r=Sl();e||=r,ho(e,!1);let i=(0,R.useRef)(null),a=us(n.id),[o,s]=(0,R.useState)(null),c=J(e,`open`),l=J(e,`mounted`),u=J(e,`animated`),d=J(e,`contentElement`),f=J(e.disclosure,`contentElement`);K(()=>{i.current&&e?.setContentElement(i.current)},[e]),K(()=>{let t;return e?.setState(`animated`,e=>(t=e,!0)),()=>{t!==void 0&&e?.setState(`animated`,t)}},[e]),K(()=>{if(u){if(!d?.isConnected){s(null);return}return Nl(()=>{s(c?`enter`:l?`leave`:null)})}},[u,d,c,l]),K(()=>{if(!e||!u||!o||!d)return;let t=()=>e?.setState(`animating`,!1),n=()=>(0,ii.flushSync)(t);if(o===`leave`&&c||o===`enter`&&!c)return;if(typeof u==`number`)return Ml(u,n);let{transitionDuration:r,animationDuration:i,transitionDelay:a,animationDelay:s}=getComputedStyle(d),{transitionDuration:l=`0`,animationDuration:p=`0`,transitionDelay:m=`0`,animationDelay:h=`0`}=f?getComputedStyle(f):{},g=Pl(a,s,m,h)+Pl(r,i,l,p);if(!g){o===`enter`&&e.setState(`animated`,!1),t();return}return Ml(Math.max(g-1e3/60,0),n)},[e,u,d,f,c,o]),n=_s(n,t=>(0,B.jsx)(Ol,{value:e,children:t}),[e]);let p=Fl(l,n.hidden,t),m=n.style,h=(0,R.useMemo)(()=>p?{...m,display:`none`}:m,[p,m]);return n={"data-open":c||void 0,"data-enter":o===`enter`||void 0,"data-leave":o===`leave`||void 0,hidden:p,...n,id:a,ref:ls(a?e.setContentElement:null,i,n.ref),style:h},yo(n)}),Il=Os(function(e){return As(jl,Y(e))});Os(function({unmountOnHide:e,...t}){let n=Sl();return J(t.store||n,t=>!e||t?.mounted)===!1?null:(0,B.jsx)(Il,{...t})});function X(e={}){let t=Zc(e.store,Yc(e.disclosure,[`contentElement`,`disclosureElement`])),n=t?.getState(),r=W(e.open,n?.open,e.defaultOpen,!1),i=W(e.animated,n?.animated,!1),a=Uc({open:r,animated:i,animating:!!i&&r,mounted:r,contentElement:W(n?.contentElement,null),disclosureElement:W(n?.disclosureElement,null)},t);return Wc(a,()=>qc(a,[`animated`,`animating`],e=>{e.animated||a.setState(`animating`,!1)})),Wc(a,()=>Kc(a,[`open`],()=>{a.getState().animated&&a.setState(`animating`,!0)})),Wc(a,()=>qc(a,[`open`,`animating`],e=>{a.setState(`mounted`,e.open||e.animating)})),{...a,disclosure:e.disclosure,setOpen:e=>a.setState(`open`,e),show:()=>a.setState(`open`,!0),hide:()=>a.setState(`open`,!1),toggle:()=>a.setState(`open`,e=>!e),stopAnimation:()=>a.setState(`animating`,!1),setContentElement:e=>a.setState(`contentElement`,e),setDisclosureElement:e=>a.setState(`disclosureElement`,e)}}function Z(e,t,n){return ps(t,[n.store,n.disclosure]),tl(e,n,`open`,`setOpen`),tl(e,n,`mounted`,`setMounted`),tl(e,n,`animated`),Object.assign(e,{disclosure:n.disclosure})}function Ll(e={}){let[t,n]=nl(X,e);return Z(t,n,e)}var Rl=Ms([Dl],[Ol]);Rl.useContext,Rl.useScopedContext;var zl=Rl.useProviderContext,Bl=Rl.ContextProvider,Vl=Rl.ScopedContextProvider;function Hl(e){let t=e.find(e=>!!e.element),n=[...e].reverse().find(e=>!!e.element),r=t?.element?.parentElement;for(;r&&n?.element;){if(n&&r.contains(n.element))return r;r=r.parentElement}return Eo(r).body}function Ul(e){return e?.__unstablePrivateStore}function Wl(e={}){e.store;let t=e.store?.getState(),n=W(e.items,t?.items,e.defaultItems,[]),r=new Map(n.map(e=>[e.id,e])),i={items:n,renderedItems:W(t?.renderedItems,[])},a=Ul(e.store),o=Uc({items:n,renderedItems:i.renderedItems},a),s=Uc(i,e.store),c=e=>{let t=Bo(e,e=>e.element);o.setState(`renderedItems`,t),s.setState(`renderedItems`,t)};Wc(s,()=>Gc(o)),Wc(o,()=>Jc(o,[`items`],e=>{s.setState(`items`,e.items)})),Wc(o,()=>Jc(o,[`renderedItems`],e=>{let t=!0,n=requestAnimationFrame(()=>{let{renderedItems:t}=s.getState();e.renderedItems!==t&&c(e.renderedItems)});if(typeof IntersectionObserver!=`function`)return()=>cancelAnimationFrame(n);let r=()=>{if(t){t=!1;return}cancelAnimationFrame(n),n=requestAnimationFrame(()=>c(e.renderedItems))},i=Hl(e.renderedItems),a=new IntersectionObserver(r,{root:i});for(let t of e.renderedItems)t.element&&a.observe(t.element);return()=>{cancelAnimationFrame(n),a.disconnect()}}));let l=(e,t,n=!1)=>{let i;return t(t=>{let n=t.findIndex(({id:t})=>t===e.id),a=t.slice();if(n!==-1){i=t[n];let o={...i,...e};a[n]=o,r.set(e.id,o)}else a.push(e),r.set(e.id,e);return a}),()=>{t(t=>{if(!i)return n&&r.delete(e.id),t.filter(({id:t})=>t!==e.id);let a=t.findIndex(({id:t})=>t===e.id);if(a===-1)return t;let o=t.slice();return o[a]=i,r.set(e.id,i),o})}},u=e=>l(e,e=>o.setState(`items`,e),!0);return{...s,registerItem:u,renderItem:e=>U(u(e),l(e,e=>o.setState(`renderedItems`,e))),item:e=>{if(!e)return null;let t=r.get(e);if(!t){let{items:n}=o.getState();t=n.find(t=>t.id===e),t&&r.set(e,t)}return t||null},__unstablePrivateStore:o}}function Gl(e,t,n){return ps(t,[n.store]),tl(e,n,`items`,`setItems`),e}var Kl={id:null};function ql(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function Jl(e,t){return e.filter(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function Yl(e,t){return e.filter(e=>e.rowId===t)}function Xl(e,t,n=!1){let r=e.findIndex(e=>e.id===t);return[...e.slice(r+1),...n?[Kl]:[],...e.slice(0,r)]}function Zl(e){let t=[];for(let n of e){let e=t.find(e=>e[0]?.rowId===n.rowId);e?e.push(n):t.push([n])}return t}function Ql(e){let t=0;for(let{length:n}of e)n>t&&(t=n);return t}function $l(e){return{id:`__EMPTY_ITEM__`,disabled:!0,rowId:e}}function eu(e,t,n){let r=Ql(e);for(let i of e)for(let e=0;eqc(i,[`renderedItems`,`activeId`],e=>{i.setState(`activeId`,t=>t===void 0?ql(e.renderedItems)?.id:t)}));let a=(e=`next`,t={})=>{let n=i.getState(),{skip:r=0,activeId:a=n.activeId,focusShift:o=n.focusShift,focusLoop:s=n.focusLoop,focusWrap:c=n.focusWrap,includesBaseElement:l=n.includesBaseElement,renderedItems:u=n.renderedItems,rtl:d=n.rtl}=t,f=e===`up`||e===`down`,p=e===`next`||e===`down`,m=p?d&&!f:!d||f,h=o&&!r,g=f?ul(eu(Zl(u),a,h)):u;if(g=m?dl(g):g,g=f?tu(g):g,a==null)return ql(g)?.id;let _=g.find(e=>e.id===a);if(!_)return ql(g)?.id;let v=g.some(e=>e.rowId),y=g.indexOf(_),b=g.slice(y+1),x=Yl(b,_.rowId);if(r){let e=Jl(x,a);return(e.slice(r)[0]||e[e.length-1])?.id}let S=s&&(f?s!==`horizontal`:s!==`vertical`),C=v&&c&&(f?c!==`horizontal`:c!==`vertical`),w=p?(!v||f)&&S&&l:f?l:!1;if(S)return ql(Xl(C&&!w?g:Yl(g,_.rowId),a,w),a)?.id;if(C){let e=ql(w?x:b,a);return w?e?.id||null:e?.id}let T=ql(x,a);return!T&&w?null:T?.id};return{...n,...i,setBaseElement:e=>i.setState(`baseElement`,e),setActiveId:e=>i.setState(`activeId`,e),move:e=>{e!==void 0&&(i.setState(`activeId`,e),i.setState(`moves`,e=>e+1))},first:()=>ql(i.getState().renderedItems)?.id,last:()=>ql(dl(i.getState().renderedItems))?.id,next:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`next`,e)),previous:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`previous`,e)),down:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`down`,e)),up:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`up`,e))}}function ru(e){return{id:us(e.id),...e}}function iu(e,t,n){return e=Gl(e,t,n),tl(e,n,`activeId`,`setActiveId`),tl(e,n,`includesBaseElement`),tl(e,n,`virtualFocus`),tl(e,n,`orientation`),tl(e,n,`rtl`),tl(e,n,`focusLoop`),tl(e,n,`focusWrap`),tl(e,n,`focusShift`),e}var au=(0,R.createContext)(void 0),ou=Ms([Bl,Bs],[Vl,Vs]),su=ou.useContext,cu=ou.useScopedContext,lu=ou.useProviderContext,uu=ou.ContextProvider,du=ou.ScopedContextProvider,fu=(0,R.createContext)(void 0),pu=(0,R.createContext)(!1),mu=(0,R.createContext)(null),hu=`span`,gu=js(function(e){return e={...e,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:`1px`,...e.style}},e});Os(function(e){return As(hu,gu(e))});var _u=`span`,vu=js(function(e){return e={"data-focus-trap":``,tabIndex:0,"aria-hidden":!0,...e,style:{position:`fixed`,top:0,left:0,...e.style}},e=gu(e),e}),yu=Os(function(e){return As(_u,vu(e))}),bu=`div`;function xu(e){return Eo(e).body}function Su(e,t){return t?typeof t==`function`?t(e):t:Eo(e).createElement(`div`)}function Cu(e=`id`){return`${e?`${e}-`:``}${Math.random().toString(36).slice(2,8)}`}function wu(e){queueMicrotask(()=>{e?.focus()})}var Tu=js(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:n,portalRef:r,portal:i=!0,...a}){let o=(0,R.useRef)(null),s=ls(o,a.ref),c=(0,R.useContext)(mu),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),p=(0,R.useRef)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),g=(0,R.useRef)(null);return K(()=>{let e=o.current;if(!e||!i){u(null);return}let t=Su(e,n);if(!t){u(null);return}let a=t.isConnected;if(a||(c||xu(e)).appendChild(t),t.id||=e.id?`portal/${e.id}`:Cu(),u(t),bo(r,t),!a)return()=>{t.remove(),bo(r,null)}},[i,n,c,r]),K(()=>{if(!i||!e||!t)return;let n=Eo(t).createElement(`span`);return n.style.position=`fixed`,t.insertAdjacentElement(`afterend`,n),f(n),()=>{n.remove(),f(null)}},[i,e,t]),(0,R.useEffect)(()=>{if(!l||!e)return;let t=0,n=e=>{if(!es(e))return;let n=e.type===`focusin`;if(cancelAnimationFrame(t),n)return vc(l);t=requestAnimationFrame(()=>{_c(l,!0)})};return l.addEventListener(`focusin`,n,!0),l.addEventListener(`focusout`,n,!0),()=>{cancelAnimationFrame(t),l.removeEventListener(`focusin`,n,!0),l.removeEventListener(`focusout`,n,!0)}},[l,e]),a=_s(a,t=>{if(t=(0,B.jsx)(mu.Provider,{value:l||c,children:t}),!i)return t;if(!l)return(0,B.jsx)(`span`,{ref:s,id:a.id,style:{position:`fixed`},hidden:!0});t=(0,B.jsxs)(B.Fragment,{children:[e&&l&&(0,B.jsx)(yu,{ref:m,"data-focus-trap":a.id,className:`__focus-trap-inner-before`,onFocus:e=>{es(e,l)?wu(lc()):wu(p.current)}}),t,e&&l&&(0,B.jsx)(yu,{ref:h,"data-focus-trap":a.id,className:`__focus-trap-inner-after`,onFocus:e=>{es(e,l)?wu(dc()):wu(g.current)}})]}),l&&(t=(0,ii.createPortal)(t,l));let n=(0,B.jsxs)(B.Fragment,{children:[e&&l&&(0,B.jsx)(yu,{ref:p,"data-focus-trap":a.id,className:`__focus-trap-outer-before`,onFocus:e=>{e.relatedTarget!==g.current&&es(e,l)?wu(m.current):wu(dc())}}),e&&(0,B.jsx)(`span`,{"aria-owns":l?.id,style:{position:`fixed`}}),e&&l&&(0,B.jsx)(yu,{ref:g,"data-focus-trap":a.id,className:`__focus-trap-outer-after`,onFocus:e=>{if(es(e,l))wu(h.current);else{let e=lc();if(e===m.current){requestAnimationFrame(()=>lc()?.focus());return}wu(e)}}})]});return d&&e&&(n=(0,ii.createPortal)(n,d)),(0,B.jsxs)(B.Fragment,{children:[n,t]})},[l,c,i,a.id,e,d]),a={...a,ref:s},a});Os(function(e){return As(bu,Tu(e))});var Eu=(0,R.createContext)(0);function Du({level:e,children:t}){let n=(0,R.useContext)(Eu),r=Math.max(Math.min(e||n+1,6),1);return(0,B.jsx)(Eu.Provider,{value:r,children:t})}var Ou=`div`,ku=js(function({autoFocusOnShow:e=!0,...t}){return t=_s(t,t=>(0,B.jsx)(ec.Provider,{value:e,children:t}),[e]),t});Os(function(e){return As(Ou,ku(e))});function Au(e,t){let n=Eo(e).createElement(`button`);return n.type=`button`,n.tabIndex=-1,n.textContent=`Dismiss popup`,Object.assign(n.style,{border:`0px`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0px`,position:`absolute`,whiteSpace:`nowrap`,width:`1px`}),n.addEventListener(`click`,t),e.prepend(n),()=>{n.removeEventListener(`click`,t),n.remove()}}function ju(e){let t=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(!e){t.current=null;return}return ns(`mousedown`,e=>{t.current=e.target},!0)},[e]),t}var Mu=new WeakMap;function Nu(e,t,n){Mu.has(e)||Mu.set(e,new Map);let r=Mu.get(e),i=r.get(t);if(!i)return r.set(t,n()),()=>{var e;(e=r.get(t))==null||e(),r.delete(t)};let a=n(),o=()=>{a(),i(),r.delete(t)};return r.set(t,o),()=>{r.get(t)===o&&(a(),r.set(t,i))}}function Pu(e,t,n){return Nu(e,t,()=>{let r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r==null?e.removeAttribute(t):e.setAttribute(t,r)}})}function Fu(e,t,n){return Nu(e,t,()=>{let r=t in e,i=e[t];return e[t]=n,()=>{r?e[t]=i:delete e[t]}})}function Iu(e,t){return e?Nu(e,`style`,()=>{let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}):()=>{}}function Lu(e,t,n){return e?Nu(e,t,()=>{let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}):()=>{}}var Ru=[`SCRIPT`,`STYLE`];function zu(e){return`__ariakit-dialog-snapshot-${e}`}function Bu(e,t){let n=Eo(t),r=zu(e);if(!n.body[r])return!0;do{if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}while(!0)}function Vu(e,t,n){return Ru.includes(t.tagName)||!Bu(e,t)?!1:!n.some(e=>e&&G(t,e))}function Hu(e,t,n,r){for(let i of t){if(!i?.isConnected)continue;let a=t.some(e=>!e||e===i?!1:e.contains(i)),o=Eo(i),s=i;for(;i.parentElement&&i!==o.body;){if(r?.(i.parentElement,s),!a)for(let r of i.parentElement.children)Vu(e,r,t)&&n(r,s);i=i.parentElement}}}function Uu(e,t){let{body:n}=Eo(t[0]),r=[];return Hu(e,t,t=>{r.push(Fu(t,zu(e),!0))}),U(Fu(n,zu(e),!0),()=>{for(let e of r)e()})}function Wu(e,...t){if(!e)return!1;let n=e.getAttribute(`data-backdrop`);return n==null?!1:n===``||n===`true`||!t.length?!0:t.some(e=>n===e)}function Gu(e=``,t=!1){return`__ariakit-dialog-${t?`ancestor`:`outside`}${e?`-${e}`:``}`}function Ku(e,t=``){return U(Fu(e,Gu(),!0),Fu(e,Gu(t),!0))}function qu(e,t=``){return U(Fu(e,Gu(``,!0),!0),Fu(e,Gu(t,!0),!0))}function Ju(e,t){let n=Gu(t,!0);if(e[n])return!0;let r=Gu(t);do{if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}while(!0)}function Yu(e,t){let n=[],r=t.map(e=>e?.id);return Hu(e,t,t=>{Wu(t,...r)||n.unshift(Ku(t,e))},(t,r)=>{r.hasAttribute(`data-dialog`)&&r.id!==e||n.unshift(qu(t,e))}),()=>{for(let e of n)e()}}function Xu(e){return e.tagName===`HTML`?!0:G(Eo(e).body,e)}function Zu(e,t){if(!e)return!1;if(G(e,t))return!0;let n=t.getAttribute(`aria-activedescendant`);if(n){let t=Eo(e).getElementById(n);if(t)return G(e,t)}return!1}function Qu(e,t){if(!(`clientY`in e))return!1;let n=t.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}function $u({store:e,type:t,listener:n,capture:r,domReady:i}){let a=q(n),o=J(e,`open`),s=(0,R.useRef)(!1);K(()=>{if(!o||!i)return;let{contentElement:t}=e.getState();if(!t)return;let n=()=>{s.current=!0};return t.addEventListener(`focusin`,n,!0),()=>t.removeEventListener(`focusin`,n,!0)},[e,o,i]),(0,R.useEffect)(()=>o?ns(t,t=>{let{contentElement:n,disclosureElement:r}=e.getState(),i=t.target;n&&i&&Xu(i)&&(G(n,i)||Zu(r,i)||i.hasAttribute(`data-focus-trap`)||Qu(t,n)||s.current&&!Ju(i,n.id)||wc(i)||a(t))},r):void 0,[o,r,e,t,a])}function ed(e,t){return typeof e==`function`?e(t):!!e}function td(e,t,n){let r=ju(J(e,`open`)),i={store:e,domReady:n,capture:!0};$u({...i,type:`click`,listener:n=>{let{contentElement:i}=e.getState(),a=r.current;a&&Mo(a)&&Ju(a,i?.id)&&ed(t,n)&&e.hide()}}),$u({...i,type:`focusin`,listener:n=>{let{contentElement:r}=e.getState();r&&n.target!==Eo(r)&&ed(t,n)&&e.hide()}}),$u({...i,type:`contextmenu`,listener:n=>{ed(t,n)&&e.hide()}})}var nd=(0,R.createContext)({});function rd(e){let t=(0,R.useContext)(nd),[n,r]=(0,R.useState)([]),i=(0,R.useCallback)(e=>(r(t=>[...t,e]),U(t.add?.call(t,e),()=>{r(t=>t.filter(t=>t!==e))})),[t]);K(()=>qc(e,[`open`,`contentElement`],n=>{if(n.open&&n.contentElement)return t.add?.call(t,e)}),[e,t]);let a=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,B.jsx)(nd.Provider,{value:a,children:e}),[a]),nestedDialogs:n}}function id({attribute:e,contentId:t,contentElement:n,enabled:r}){let[i,a]=hs(),o=(0,R.useCallback)(()=>{if(!r||!n)return!1;let{body:i}=Eo(n),a=i.getAttribute(e);return!a||a===t},[i,r,n,e,t]);return(0,R.useEffect)(()=>{if(!r||!t||!n)return;let{body:i}=Eo(n);if(o())return i.setAttribute(e,t),()=>i.removeAttribute(e);let s=new MutationObserver(()=>(0,ii.flushSync)(a));return s.observe(i,{attributeFilter:[e]}),()=>s.disconnect()},[i,r,t,n,o,e]),o}function ad(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?`paddingLeft`:`paddingRight`}function od(e,t,n){let r=id({attribute:`data-dialog-prevent-body-scroll`,contentElement:e,contentId:t,enabled:n});(0,R.useEffect)(()=>{if(!r()||!e)return;let t=Eo(e),n=Do(e),{documentElement:i,body:a}=t,o=i.style.getPropertyValue(`--scrollbar-width`),s=o?Number.parseInt(o,10):n.innerWidth-i.clientWidth,c=()=>Lu(i,`--scrollbar-width`,`${s}px`),l=ad(i),u=()=>Iu(a,{overflow:`hidden`,[l]:`${s}px`}),d=()=>{let{scrollX:e,scrollY:t,visualViewport:r}=n,i=r?.offsetLeft??0,o=r?.offsetTop??0,c=Iu(a,{position:`fixed`,overflow:`hidden`,top:`${-(t-Math.floor(o))}px`,left:`${-(e-Math.floor(i))}px`,right:`0`,[l]:`${s}px`});return()=>{c(),n.scrollTo({left:e,top:t,behavior:`instant`})}},f=Uo()&&!Ko();return U(c(),f?d():u())},[r,e])}function sd(e,...t){if(!e)return!1;let n=e.getAttribute(`data-focus-trap`);return n==null?!1:t.length?n===``?!1:t.some(e=>n===e):!0}function cd(){return`inert`in HTMLElement.prototype}function ld(e){return Pu(e,`aria-hidden`,`true`)}function ud(e,t){return`style`in e?cd()?Fu(e,`inert`,!0):U(...oc(e,!0).map(e=>{if(t?.some(t=>t&&G(t,e)))return ao;let n=Nu(e,`focus`,()=>(e.focus=ao,()=>{delete e.focus}));return U(Pu(e,`tabindex`,`-1`),n)}),ld(e),Iu(e,{pointerEvents:`none`,userSelect:`none`,cursor:`default`})):ao}function dd(e,t){let n=[],r=t.map(e=>e?.id);return Hu(e,t,e=>{Wu(e,...r)||sd(e,...r)||n.unshift(ud(e,t))},e=>{e.hasAttribute(`role`)&&(t.some(t=>t&&G(t,e))||n.unshift(Pu(e,`role`,`none`)))}),()=>{for(let e of n)e()}}var fd=`div`,pd=`a.button.details.dialog.div.form.h1.h2.h3.h4.h5.h6.header.img.input.label.li.nav.ol.p.section.select.span.summary.textarea.ul.svg`.split(`.`);js(function(e){return e});var md=Os(function(e){return As(fd,e)});Object.assign(md,pd.reduce((e,t)=>(e[t]=Os(function(e){return As(t,e)}),e),{}));function hd({store:e,backdrop:t,alwaysVisible:n,hidden:r}){let i=(0,R.useRef)(null),a=Ll({disclosure:e}),o=J(e,`contentElement`);(0,R.useEffect)(()=>{let e=i.current,t=o;e&&t&&(e.style.zIndex=getComputedStyle(t).zIndex)},[o]),K(()=>{let e=o?.id;if(!e)return;let t=i.current;if(t)return qu(t,e)},[o]);let s=Y({ref:i,store:a,role:`presentation`,"data-backdrop":o?.id||``,alwaysVisible:n,hidden:r??void 0,style:{position:`fixed`,top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,B.jsx)(md,{...s,render:t});let c=typeof t==`boolean`?`div`:t;return(0,B.jsx)(md,{...s,render:(0,B.jsx)(c,{})})}function gd(e={}){return X(e)}function _d(e,t,n){return Z(e,t,n)}function vd(e={}){let[t,n]=nl(gd,e);return _d(t,n,e)}var yd=`div`,Q=Wo();function bd(e){let t=Oo();return!t||e&&G(e,t)?!1:!!rc(t)}function xd(e,t=!1){if(!e)return null;let n=`current`in e?e.current:e;return n?t?rc(n)?n:null:n:null}var Sd=js(function({store:e,open:t,onClose:n,focusable:r=!0,modal:i=!0,portal:a=!!i,backdrop:o=!!i,hideOnEscape:s=!0,hideOnInteractOutside:c=!0,getPersistentElements:l,preventBodyScroll:u=!!i,autoFocusOnShow:d=!0,autoFocusOnHide:f=!0,initialFocus:p,finalFocus:m,unmountOnHide:h,unstable_treeSnapshotKey:g,..._}){let v=El(),y=(0,R.useRef)(null),b=vd({store:e||v,open:t,setOpen(e){if(e)return;let t=y.current;if(!t)return;let r=new Event(`close`,{bubbles:!1,cancelable:!0});n&&t.addEventListener(`close`,n,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&b.setOpen(!0)}}),{portalRef:x,domReady:S}=vs(a,_.portalRef),C=_.preserveTabOrder,w=J(b,e=>C&&!i&&e.mounted),T=us(_.id),E=J(b,`open`),D=J(b,`mounted`),O=J(b,`contentElement`),k=Fl(D,_.hidden,_.alwaysVisible);od(O,T,u&&!k),td(b,c,S);let{wrapElement:A,nestedDialogs:j}=rd(b);_=_s(_,A,[A]),K(()=>{if(!E)return;let e=y.current,t=Oo(e,!0);t&&t.tagName!==`BODY`&&(e&&G(e,t)||b.setDisclosureElement(t))},[b,E]),Q&&(0,R.useEffect)(()=>{if(!D)return;let{disclosureElement:e}=b.getState();if(!e||!Ao(e))return;let t=()=>{let t=!1,n=()=>{t=!0};e.addEventListener(`focusin`,n,{capture:!0,once:!0}),ts(e,`mouseup`,()=>{e.removeEventListener(`focusin`,n,!0),!t&&hc(e)})};return e.addEventListener(`mousedown`,t),()=>{e.removeEventListener(`mousedown`,t)}},[b,D]),(0,R.useEffect)(()=>{if(!D||!S)return;let e=y.current;if(!e)return;let t=Do(e),n=t.visualViewport||t,r=()=>{let n=t.visualViewport?.height??t.innerHeight;e.style.setProperty(`--dialog-viewport-height`,`${n}px`)};return r(),n.addEventListener(`resize`,r),()=>{n.removeEventListener(`resize`,r)}},[D,S]),(0,R.useEffect)(()=>{if(!i||!D||!S)return;let e=y.current;if(e&&!e.querySelector(`[data-dialog-dismiss]`))return Au(e,b.hide)},[b,i,D,S]),K(()=>{if(!cd()||E||!D||!S)return;let e=y.current;if(e)return ud(e)},[E,D,S]);let M=E&&S;K(()=>{if(!T||!M)return;let e=y.current;return Uu(T,[e])},[T,M,g]);let ee=q(l);K(()=>{if(!T||!M)return;let{disclosureElement:e}=b.getState(),t=[y.current,...ee()||[],...j.map(e=>e.getState().contentElement)];return i?U(Yu(T,t),dd(T,t)):Yu(T,[e,...t])},[T,b,M,ee,j,i,g]);let te=!!d,N=gs(d),[P,ne]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!E||!te||!S||!O?.isConnected)return;let e=xd(p,!0)||O.querySelector(`[data-autofocus=true],[autofocus]`)||sc(O,!0,a&&w)||O,t=rc(e);N(t?e:null)&&(ne(!0),queueMicrotask(()=>{e.focus(),Q&&t&&e.scrollIntoView({block:`nearest`,inline:`nearest`})}))},[E,te,S,O,p,a,w,N]);let re=!!f,F=gs(f),[ie,ae]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(E)return ae(!0),()=>ae(!1)},[E]);let I=(0,R.useCallback)((e,t=!0)=>{let{disclosureElement:n}=b.getState();if(bd(e))return;let r=xd(m)||n;if(r?.id){let e=Eo(r),t=`[aria-activedescendant="${r.id}"]`,n=e.querySelector(t);n&&(r=n)}if(r&&!rc(r)){let e=r.closest(`[data-dialog]`);if(e?.id){let t=Eo(e),n=`[aria-controls~="${e.id}"]`,i=t.querySelector(n);i&&(r=i)}}let i=r&&rc(r);if(!i&&t){requestAnimationFrame(()=>I(e,!1));return}F(i?r:null)&&i&&r?.focus({preventScroll:!0})},[b,m,F]),oe=(0,R.useRef)(!1);K(()=>{if(E||!ie||!re)return;let e=y.current;oe.current=!0,I(e)},[E,ie,S,re,I]),(0,R.useEffect)(()=>{if(!ie||!re)return;let e=y.current;return()=>{if(oe.current){oe.current=!1;return}I(e)}},[ie,re,I]);let L=gs(s);(0,R.useEffect)(()=>!S||!D?void 0:ns(`keydown`,e=>{if(e.key!==`Escape`||e.defaultPrevented)return;let t=y.current;if(!t||Ju(t))return;let n=e.target;if(!n)return;let{disclosureElement:r}=b.getState();(n.tagName===`BODY`||G(t,n)||!r||G(r,n))&&L(e)&&b.hide()},!0),[b,S,D,L]),_=_s(_,e=>(0,B.jsx)(Du,{level:i?1:void 0,children:e}),[i]);let se=_.hidden,ce=_.alwaysVisible;_=_s(_,e=>o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(hd,{store:b,backdrop:o,hidden:se,alwaysVisible:ce}),e]}):e,[b,o,se,ce]);let[le,ue]=(0,R.useState)(),[de,fe]=(0,R.useState)();return _=_s(_,e=>(0,B.jsx)(Ol,{value:b,children:(0,B.jsx)(kl.Provider,{value:ue,children:(0,B.jsx)(Al.Provider,{value:fe,children:e})})}),[b]),_={"data-dialog":``,role:`dialog`,tabIndex:r?-1:void 0,"aria-labelledby":le,"aria-describedby":de,..._,id:T,ref:ls(y,_.ref)},_=ku({..._,autoFocusOnShow:P}),_=Y({store:b,..._}),_=Lc({..._,focusable:r}),_=Tu({portal:a,..._,portalRef:x,preserveTabOrder:w}),_});function Cd(e,t=El){return Os(function(n){let r=t();return J(n.store||r,e=>!n.unmountOnHide||e?.mounted||!!n.open)?(0,B.jsx)(e,{...n}):null})}Cd(Os(function(e){return As(yd,Sd(e))}),El);var wd=Math.min,Td=Math.max,Ed=Math.round,Dd=Math.floor,Od=e=>({x:e,y:e}),kd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ad(e,t,n){return Td(e,wd(t,n))}function jd(e,t){return typeof e==`function`?e(t):e}function Md(e){return e.split(`-`)[0]}function $(e){return e.split(`-`)[1]}function Nd(e){return e===`x`?`y`:`x`}function Pd(e){return e===`y`?`height`:`width`}function Fd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Id(e){return Nd(Fd(e))}function Ld(e,t,n){n===void 0&&(n=!1);let r=$(e),i=Id(e),a=Pd(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Kd(o)),[o,Kd(o)]}function Rd(e){let t=Kd(e);return[zd(e),t,zd(t)]}function zd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Bd=[`left`,`right`],Vd=[`right`,`left`],Hd=[`top`,`bottom`],Ud=[`bottom`,`top`];function Wd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Vd:Bd:t?Bd:Vd;case`left`:case`right`:return t?Hd:Ud;default:return[]}}function Gd(e,t,n,r){let i=$(e),a=Wd(Md(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(zd)))),a}function Kd(e){let t=Md(e);return kd[t]+e.slice(t.length)}function qd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:qd(e)}function Yd(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Xd(e,t,n){let{reference:r,floating:i}=e,a=Fd(t),o=Id(t),s=Pd(o),c=Md(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch($(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Zd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=jd(t,e),p=Jd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Yd(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Yd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Qd=50,$d=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Zd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Xd(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=jd(e,t)||{};if(l==null)return{};let d=Jd(u),f={x:n,y:r},p=Id(i),m=Pd(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=wd(d[_],T),D=wd(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Ad(O,A,k),M=!c.arrow&&$(i)!=null&&A!==j&&a.reference[m]/2-(Ae<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Fd(t))||T.every(e=>Fd(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Fd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},nf=new Set([`left`,`top`]);async function rf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Md(n),s=$(n),c=Fd(n)===`y`,l=nf.has(o)?-1:1,u=a&&c?-1:1,d=jd(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var af=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await rf(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},of=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=jd(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Fd(Md(i)),p=Nd(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ad(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ad(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},sf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=jd(e,t),u={x:n,y:r},d=Fd(i),f=Nd(d),p=u[f],m=u[d],h=jd(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=nf.has(Md(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},cf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=jd(e,t),u=await o.detectOverflow(t,l),d=Md(i),f=$(i),p=Fd(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=wd(h-u[g],v),x=wd(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Td(u.left,0),t=Td(u.right,0),n=Td(u.top,0),r=Td(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Td(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Td(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function lf(){return typeof window<`u`}function uf(e){return pf(e)?(e.nodeName||``).toLowerCase():`#document`}function df(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ff(e){return((pf(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function pf(e){return lf()?e instanceof Node||e instanceof df(e).Node:!1}function mf(e){return lf()?e instanceof Element||e instanceof df(e).Element:!1}function hf(e){return lf()?e instanceof HTMLElement||e instanceof df(e).HTMLElement:!1}function gf(e){return!lf()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof df(e).ShadowRoot}function _f(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Of(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function vf(e){return/^(table|td|th)$/.test(uf(e))}function yf(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var bf=/transform|translate|scale|rotate|perspective|filter/,xf=/paint|layout|strict|content/,Sf=e=>!!e&&e!==`none`,Cf;function wf(e){let t=mf(e)?Of(e):e;return Sf(t.transform)||Sf(t.translate)||Sf(t.scale)||Sf(t.rotate)||Sf(t.perspective)||!Ef()&&(Sf(t.backdropFilter)||Sf(t.filter))||bf.test(t.willChange||``)||xf.test(t.contain||``)}function Tf(e){let t=Af(e);for(;hf(t)&&!Df(t);){if(wf(t))return t;if(yf(t))return null;t=Af(t)}return null}function Ef(){return Cf??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Cf}function Df(e){return/^(html|body|#document)$/.test(uf(e))}function Of(e){return df(e).getComputedStyle(e)}function kf(e){return mf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Af(e){if(uf(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||gf(e)&&e.host||ff(e);return gf(t)?t.host:t}function jf(e){let t=Af(e);return Df(t)?e.ownerDocument?e.ownerDocument.body:e.body:hf(t)&&_f(t)?t:jf(t)}function Mf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=jf(e),i=r===e.ownerDocument?.body,a=df(r);if(i){let e=Nf(a);return t.concat(a,a.visualViewport||[],_f(r)?r:[],e&&n?Mf(e):[])}else return t.concat(r,Mf(r,[],n))}function Nf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pf(e){let t=Of(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=hf(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ed(n)!==a||Ed(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ff(e){return mf(e)?e:e.contextElement}function If(e){let t=Ff(e);if(!hf(t))return Od(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Pf(t),o=(a?Ed(n.width):n.width)/r,s=(a?Ed(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Lf=Od(0);function Rf(e){let t=df(e);return!Ef()||!t.visualViewport?Lf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==df(e)?!1:t}function Bf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ff(e),o=Od(1);t&&(r?mf(r)&&(o=If(r)):o=If(e));let s=zf(a,n,r)?Rf(a):Od(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=df(a),t=r&&mf(r)?df(r):r,n=e,i=Nf(n);for(;i&&r&&t!==n;){let e=If(i),t=i.getBoundingClientRect(),r=Of(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=df(i),i=Nf(n)}}return Yd({width:u,height:d,x:c,y:l})}function Vf(e,t){let n=kf(e).scrollLeft;return t?t.left+n:Bf(ff(e)).left+n}function Hf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Vf(e,n),y:n.top+t.scrollTop}}function Uf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ff(r),s=t?yf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Od(1),u=Od(0),d=hf(r);if((d||!d&&!a)&&((uf(r)!==`body`||_f(o))&&(c=kf(r)),d)){let e=Bf(r);l=If(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Hf(o,c):Od(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Wf(e){return Array.from(e.getClientRects())}function Gf(e){let t=ff(e),n=kf(e),r=e.ownerDocument.body,i=Td(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Td(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Vf(e),s=-n.scrollTop;return Of(r).direction===`rtl`&&(o+=Td(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Kf=25;function qf(e,t){let n=df(e),r=ff(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ef();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Vf(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Kf&&(a-=o)}else l<=Kf&&(a+=l);return{width:a,height:o,x:s,y:c}}function Jf(e,t){let n=Bf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=hf(e)?If(e):Od(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Yf(e,t,n){let r;if(t===`viewport`)r=qf(e,n);else if(t===`document`)r=Gf(ff(e));else if(mf(t))r=Jf(t,n);else{let n=Rf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yd(r)}function Xf(e,t){let n=Af(e);return n===t||!mf(n)||Df(n)?!1:Of(n).position===`fixed`||Xf(n,t)}function Zf(e,t){let n=t.get(e);if(n)return n;let r=Mf(e,[],!1).filter(e=>mf(e)&&uf(e)!==`body`),i=null,a=Of(e).position===`fixed`,o=a?Af(e):e;for(;mf(o)&&!Df(o);){let t=Of(o),n=wf(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||_f(o)&&!n&&Xf(e,o))?r=r.filter(e=>e!==o):i=t,o=Af(o)}return t.set(e,r),r}function Qf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?yf(t)?[]:Zf(t,this._c):[].concat(n),r],o=Yf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{o(!1,1e-7)},1e3)}n===1&&!sp(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lp(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ff(e),u=i||a?[...l?Mf(l):[],...t?Mf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cp(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Bf(e):null;c&&g();function g(){let t=Bf(e);h&&!sp(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var up=af,dp=of,fp=tf,pp=cf,mp=ef,hp=sf,gp=(e,t,n)=>{let r=new Map,i={platform:op,...n},a={...i.platform,_c:r};return $d(e,t,{...i,platform:a})},_p=`div`;function vp(e=0,t=0,n=0,r=0){if(typeof DOMRect==`function`)return new DOMRect(e,t,n,r);let i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...i,toJSON:()=>i}}function yp(e){if(!e)return vp();let{x:t,y:n,width:r,height:i}=e;return vp(t,n,r,i)}function bp(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?yp(r):n.getBoundingClientRect()}}}function xp(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function Sp(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}function Cp(e,t){return up(({placement:n})=>{let r=(e?.clientHeight||0)/2,i=typeof t.gutter==`number`?t.gutter+r:t.gutter??r;return{crossAxis:n.split(`-`)[1]?void 0:t.shift,mainAxis:i,alignmentAxis:t.shift}})}function wp(e){if(e.flip===!1)return;let t=typeof e.flip==`string`?e.flip.split(` `):void 0;return ho(!t||t.every(xp),!1),fp({padding:e.overflowPadding,fallbackPlacements:t})}function Tp(e){if(!(!e.slide&&!e.overlap))return dp({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:hp()})}function Ep(e){return pp({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:i}){let a=t.floating,o=Math.round(i.reference.width);n=Math.floor(n),r=Math.floor(r),a.style.setProperty(`--popover-anchor-width`,`${o}px`),a.style.setProperty(`--popover-available-width`,`${n}px`),a.style.setProperty(`--popover-available-height`,`${r}px`),e.sameWidth&&(a.style.width=`${o}px`),e.fitViewport&&(a.style.maxWidth=`${n}px`,a.style.maxHeight=`${r}px`)}})}function Dp(e,t){if(e)return mp({element:e,padding:t.arrowPadding})}var Op=js(function({store:e,modal:t=!1,portal:n=!!t,preserveTabOrder:r=!0,autoFocusOnShow:i=!0,wrapperProps:a,fixed:o=!1,flip:s=!0,shift:c=0,slide:l=!0,overlap:u=!1,sameWidth:d=!1,fitViewport:f=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:g,updatePosition:_,...v}){let y=zl();e||=y,ho(e,!1);let b=J(e,`arrowElement`),x=J(e,`anchorElement`),S=J(e,`disclosureElement`),C=J(e,`popoverElement`),w=J(e,`contentElement`),T=J(e,`placement`),E=J(e,`mounted`),D=J(e,`rendered`),O=(0,R.useRef)(null),[k,A]=(0,R.useState)(!1),{portalRef:j,domReady:M}=vs(n,v.portalRef),ee=q(g),te=q(_),N=!!_;K(()=>{if(!C?.isConnected)return;C.style.setProperty(`--popover-overflow-padding`,`${h}px`);let t=bp(x,ee),n=async()=>{if(!E)return;b||(O.current=O.current||document.createElement(`div`));let n=b||O.current,r=[Cp(n,{gutter:p,shift:c}),wp({flip:s,overflowPadding:h}),Tp({slide:l,shift:c,overlap:u,overflowPadding:h}),Dp(n,{arrowPadding:m}),Ep({sameWidth:d,fitViewport:f,overflowPadding:h})],i=await gp(t,C,{placement:T,strategy:o?`fixed`:`absolute`,middleware:r});e?.setState(`currentPlacement`,i.placement),A(!0);let a=Sp(i.x),g=Sp(i.y);if(Object.assign(C.style,{top:`0`,left:`0`,transform:`translate3d(${a}px,${g}px,0)`}),n&&i.middlewareData.arrow){let{x:e,y:t}=i.middlewareData.arrow,r=i.placement.split(`-`)[0],a=n.clientWidth/2,o=n.clientHeight/2,s=e==null?-a:e+a,c=t==null?-o:t+o;C.style.setProperty(`--popover-transform-origin`,{top:`${s}px calc(100% + ${o}px)`,bottom:`${s}px ${-o}px`,left:`calc(100% + ${a}px) ${c}px`,right:`${-a}px ${c}px`}[r]),Object.assign(n.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,[r]:`100%`})}},r=lp(t,C,async()=>{N?(await te({updatePosition:n}),A(!0)):await n()},{elementResize:typeof ResizeObserver==`function`});return()=>{A(!1),r()}},[e,D,C,b,x,C,T,E,M,o,s,c,l,u,d,f,p,m,h,ee,N,te]),K(()=>{if(!E||!M||!C?.isConnected||!w?.isConnected)return;let e=()=>{C.style.zIndex=getComputedStyle(w).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[E,M,C,w]);let P=o?`fixed`:`absolute`;return v=_s(v,t=>(0,B.jsx)(`div`,{...a,style:{position:P,top:0,left:0,width:`max-content`,...a?.style},ref:e?.setPopoverElement,children:t}),[e,P,a]),v=_s(v,t=>(0,B.jsx)(Vl,{value:e,children:t}),[e]),v={"data-placing":!k||void 0,...v,style:{position:`relative`,...v.style}},v=Sd({store:e,modal:t,portal:n,preserveTabOrder:r,preserveTabOrderAnchor:S||x,autoFocusOnShow:k&&i,...v,portalRef:j}),v});Cd(Os(function(e){return As(_p,Op(e))}),zl);function kp({popover:e,...t}={}){let n=Zc(t.store,Yc(e,[`arrowElement`,`anchorElement`,`contentElement`,`popoverElement`,`disclosureElement`])),r=n?.getState(),i=gd({...t,store:n}),a=W(t.placement,r?.placement,`bottom`),o=Uc({...i.getState(),placement:a,currentPlacement:a,anchorElement:W(r?.anchorElement,null),popoverElement:W(r?.popoverElement,null),arrowElement:W(r?.arrowElement,null),rendered:Symbol(`rendered`)},i,n);return{...i,...o,setAnchorElement:e=>o.setState(`anchorElement`,e),setPopoverElement:e=>o.setState(`popoverElement`,e),setArrowElement:e=>o.setState(`arrowElement`,e),render:()=>o.setState(`rendered`,Symbol(`rendered`))}}function Ap(e,t,n){return ps(t,[n.popover]),tl(e,n,`placement`),_d(e,t,n)}var jp=`div`,Mp=js(function({store:e,...t}){let n=zl();return e||=n,t={...t,ref:ls(e?.setAnchorElement,t.ref)},t});Os(function(e){return As(jp,Mp(e))});var Np=(0,R.createContext)(void 0),Pp=`div`,Fp=js(function(e){let[t,n]=(0,R.useState)();return e=_s(e,e=>(0,B.jsx)(Np.Provider,{value:n,children:e}),[]),e={role:`group`,"aria-labelledby":t,...e},yo(e)});Os(function(e){return As(Pp,Fp(e))});var Ip=`div`,Lp=js(function({store:e,...t}){return t=Fp(t),t});Os(function(e){return As(Ip,Lp(e))});var Rp=`div`,zp=js(function(e){let t=(0,R.useContext)(Np),n=us(e.id);return K(()=>(t?.(n),()=>t?.(void 0)),[t,n]),e={"aria-hidden":!0,...e,id:n},yo(e)});Os(function(e){return As(Rp,zp(e))});var Bp=`div`,Vp=js(function({store:e,...t}){return t=zp(t),t});Os(function(e){return As(Bp,Vp(e))});var Hp=`div`;function Up(e){let t=e.relatedTarget;return t?.nodeType===Node.ELEMENT_NODE?t:null}function Wp(e){let t=Up(e);return t?G(e.currentTarget,t):!1}var Gp=Symbol(`composite-hover`);function Kp(e){let t=Up(e);if(!t)return!1;do{if(lo(t,Gp)&&t[Gp])return!0;t=t.parentElement}while(t);return!1}var qp=js(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:n=!!t,...r}){let i=Rs();e||=i,ho(e,!1);let a=xs(),o=r.onMouseMove,s=gs(t),c=q(t=>{if(o?.(t),!t.defaultPrevented&&a()&&s(t)){if(!mc(t.currentTarget)){let t=e?.getState().baseElement;t&&!pc(t)&&t.focus()}e?.setActiveId(t.currentTarget.id)}}),l=r.onMouseLeave,u=gs(n),d=q(t=>{var n;l?.(t),!t.defaultPrevented&&a()&&(Wp(t)||Kp(t)||s(t)&&u(t)&&(e?.setActiveId(null),(n=e?.getState().baseElement)==null||n.focus()))}),f=(0,R.useCallback)(e=>{e&&(e[Gp]=!0)},[]);return r={...r,ref:ls(f,r.ref),onMouseMove:c,onMouseLeave:d},yo(r)});ks(Os(function(e){return As(Hp,qp(e))}));var Jp=`input`;function Yp(e,t,n){return n?e.find(e=>!e.disabled&&e.value)?.value===t:!1}function Xp(e,t){return!t||e==null?!1:(e=uo(e),t.length>e.length&&t.toLowerCase().indexOf(e.toLowerCase())===0)}function Zp(e){return e.type===`input`}function Qp(e){return e===`inline`||e===`list`||e===`both`||e===`none`}function $p(e){return e.find(e=>e.disabled?!1:e.element?.getAttribute(`role`)!==`tab`)?.id}var em=js(function({store:e,focusable:t=!0,autoSelect:n=!1,getAutoSelectId:r,setValueOnChange:i,showMinLength:a=0,showOnChange:o,showOnMouseDown:s,showOnClick:c=s,showOnKeyDown:l,showOnKeyPress:u=l,blurActiveItemOnClick:d,setValueOnClick:f=!0,moveOnKeyPress:p=!0,autoComplete:m=`list`,...h}){let g=lu();e||=g,ho(e,!1);let _=(0,R.useRef)(null),[v,y]=hs(),b=(0,R.useRef)(!1),x=(0,R.useRef)(!1),S=J(e,e=>e.virtualFocus&&n),C=m===`inline`||m===`both`,[w,T]=(0,R.useState)(C);ms(()=>{C&&T(!0)},[C]);let E=J(e,`value`),D=(0,R.useRef)(void 0);(0,R.useEffect)(()=>qc(e,[`selectedValue`,`activeId`],(e,t)=>{D.current=t.selectedValue}),[e]);let O=J(e,e=>{if(C&&w&&!(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||D.current?.includes(e.activeValue))))return e.activeValue}),k=J(e,`renderedItems`),A=J(e,`open`),j=J(e,`contentElement`),M=(0,R.useMemo)(()=>!C||!w?E:Yp(k,O,S)?Xp(E,O)?E+(O?.slice(E.length)||``):E:O||E,[C,w,k,O,S,E]);(0,R.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>T(!0);return e.addEventListener(`combobox-item-move`,t),()=>{e.removeEventListener(`combobox-item-move`,t)}},[]),(0,R.useEffect)(()=>{if(!C||!w||!O||!Yp(k,O,S)||!Xp(E,O))return;let e=ao;return queueMicrotask(()=>{let t=_.current;if(!t)return;let{start:n,end:r}=Io(t),i=E.length,a=O.length;zo(t,i,a),e=()=>{if(!pc(t))return;let{start:e,end:o}=Io(t);e===i&&o===a&&zo(t,n,r)}}),()=>e()},[v,C,w,O,k,S,E]);let ee=(0,R.useRef)(null),te=q(r),N=(0,R.useRef)(null),P=(0,R.useRef)(!1),ne=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(!A||!j)return;let t=Ro(j);if(!t)return;ee.current=t;let n=()=>{b.current=!1,P.current=!0},r=()=>{if(ne.current||(P.current=!0),!e||!b.current)return;let{activeId:t}=e.getState();t!==null&&t!==N.current&&(b.current=!1)},i={passive:!0,capture:!0};return t.addEventListener(`wheel`,n,i),t.addEventListener(`touchmove`,n,i),t.addEventListener(`scroll`,r,i),()=>{t.removeEventListener(`wheel`,n,!0),t.removeEventListener(`touchmove`,n,!0),t.removeEventListener(`scroll`,r,!0)}},[A,j,e]),K(()=>{P.current=!1,E&&(x.current||(b.current=!0))},[E]),K(()=>{S!==`always`&&A||(b.current=A)},[S,A]);let re=J(e,`resetValueOnSelect`);ps(()=>{let t=b.current;if(!e||!A||!t&&(!re||P.current))return;let{baseElement:n,contentElement:r,activeId:i}=e.getState();if(!(n&&!pc(n))){if(r?.hasAttribute(`data-placing`)){let e=new MutationObserver(y);return e.observe(r,{attributeFilter:[`data-placing`]}),()=>e.disconnect()}if(S&&t){let t=te(k),n=t===void 0?$p(k)??e.first():t;N.current=n,e.move(n??null)}else{let t=e.item(i||e.first())?.element;t&&`scrollIntoView`in t&&(ne.current=!0,t.scrollIntoView({block:`nearest`,inline:`nearest`}),requestAnimationFrame(()=>{ne.current=!1}))}}},[e,A,v,E,S,re,te,k]),(0,R.useEffect)(()=>{if(!C)return;let t=_.current;if(!t)return;let n=[t,j].filter(e=>!!e),r=t=>{n.every(e=>es(t,e))&&e?.setValue(M)};for(let e of n)e.addEventListener(`focusout`,r);return()=>{for(let e of n)e.removeEventListener(`focusout`,r)}},[C,j,e,M]);let F=e=>e.currentTarget.value.length>=a,ie=h.onChange,ae=gs(o??F),I=gs(i??!e.tag),oe=q(t=>{if(ie?.(t),t.defaultPrevented||!e)return;let n=t.currentTarget,{value:r,selectionStart:i,selectionEnd:a}=n,o=t.nativeEvent;if(b.current=!0,Zp(o)&&(o.isComposing&&(b.current=!1,x.current=!0),C)){let e=o.inputType===`insertText`||o.inputType===`insertCompositionText`,t=i===r.length;T(e&&t)}if(I(t)){let t=r===e.getState().value;e.setValue(r),queueMicrotask(()=>{zo(n,i,a)}),C&&S&&t&&y()}ae(t)&&e.show(),(!S||!b.current)&&e.setActiveId(null)}),L=h.onCompositionEnd,se=q(e=>{b.current=!0,x.current=!1,L?.(e),!e.defaultPrevented&&S&&y()}),ce=h.onMouseDown,le=gs(d??(()=>!!e?.getState().includesBaseElement)),ue=gs(f),de=gs(c??F),fe=q(t=>{ce?.(t),!t.defaultPrevented&&(t.button||t.ctrlKey||e&&(le(t)&&e.setActiveId(null),ue(t)&&e.setValue(M),de(t)&&ts(t.currentTarget,`mouseup`,e.show)))}),pe=h.onKeyDown,me=gs(u??F),he=q(t=>{if(pe?.(t),t.repeat||(b.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:n}=e.getState();n||(t.key===`ArrowUp`||t.key===`ArrowDown`)&&me(t)&&(t.preventDefault(),e.show())}),ge=h.onBlur,_e=q(e=>{b.current=!1,ge?.(e),e.defaultPrevented}),ve=us(h.id),ye=Qp(m)?m:void 0,be=J(e,e=>e.activeId===null);return h={role:`combobox`,"aria-autocomplete":ye,"aria-haspopup":Lo(j,`listbox`),"aria-expanded":A,"aria-controls":j?.id,"data-active-item":be||void 0,value:M,...h,id:ve,ref:ls(_,h.ref),onChange:oe,onCompositionEnd:se,onMouseDown:fe,onKeyDown:he,onBlur:_e},h=bl({store:e,focusable:t,...h,moveOnKeyPress:e=>_o(p,e)?!1:(C&&T(!0),!0)}),h=Mp({store:e,...h}),{autoComplete:`off`,...h}}),tm=Os(function(e){return As(Jp,em(e))}),nm=`div`,rm=js(function({store:e,...t}){let n=cu();return e||=n,ho(e,!1),Lo(J(e,`contentElement`))===`grid`&&(t={role:`rowgroup`,...t}),t=Lp({store:e,...t}),t}),im=Os(function(e){return As(nm,rm(e))}),am=`div`,om=js(function(e){return e=Vp(e),e}),sm=Os(function(e){return As(am,om(e))}),cm=`div`;function lm(e,t){if(t!=null)return e==null?!1:Array.isArray(e)?e.includes(t):e===t}function um(e){return{menu:`menuitem`,listbox:`option`,tree:`treeitem`}[e]??`option`}var dm=js(function({store:e,value:t,hideOnClick:n,setValueOnClick:r,selectValueOnClick:i=!0,resetValueOnSelect:a,focusOnHover:o=!1,moveOnKeyPress:s=!0,getItem:c,...l}){let u=cu();e||=u,ho(e,!1);let{resetValueOnSelectState:d,multiSelectable:f,selected:p}=el(e,{resetValueOnSelectState:`resetValueOnSelect`,multiSelectable(e){return Array.isArray(e.selectedValue)},selected(e){return lm(e.selectedValue,t)}}),m=(0,R.useCallback)(e=>{let n={...e,value:t};return c?c(n):n},[t,c]);r??=!f,n??=t!=null&&!f;let h=l.onClick,g=gs(r),_=gs(i),v=gs(a??d??f),y=gs(n),b=q(n=>{h?.(n),!n.defaultPrevented&&(Xo(n)||Yo(n)||(t!=null&&(_(n)&&(v(n)&&e?.resetValue(),e?.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),g(n)&&e?.setValue(t)),y(n)&&e?.hide()))}),x=l.onKeyDown,S=q(t=>{if(x?.(t),t.defaultPrevented)return;let n=e?.getState().baseElement;n&&(pc(n)||(t.key.length===1||t.key===`Backspace`||t.key===`Delete`)&&(queueMicrotask(()=>n.focus()),No(n)&&e?.setValue(n.value)))});f&&p!=null&&(l={"aria-selected":p,...l}),l=_s(l,e=>(0,B.jsx)(fu.Provider,{value:t,children:(0,B.jsx)(pu.Provider,{value:p??!1,children:e})}),[t,p]),l={role:um((0,R.useContext)(au)),children:t,...l,onClick:b,onKeyDown:S};let C=gs(s);return l=ll({store:e,...l,getItem:m,moveOnKeyPress:t=>{if(!C(t))return!1;let n=new Event(`combobox-item-move`);return(e?.getState().baseElement)?.dispatchEvent(n),!0}}),l=qp({store:e,focusOnHover:o,...l}),l}),fm=ks(Os(function(e){return As(cm,dm(e))})),pm=`div`,mm=js(function({store:e,alwaysVisible:t,...n}){let r=cu(!0),i=su();e||=i;let a=!!e&&e===r;ho(e,!1);let o=(0,R.useRef)(null),s=us(n.id),c=J(e,`mounted`),l=Fl(c,n.hidden,t),u=l?{...n.style,display:`none`}:n.style,d=J(e,e=>Array.isArray(e.selectedValue)),f=fs(o,`role`,n.role),p=(f===`listbox`||f===`tree`||f===`grid`)&&d||void 0,[m,h]=(0,R.useState)(!1),g=J(e,`contentElement`);K(()=>{if(!c)return;let e=o.current;if(!e||g!==e)return;let t=()=>{h(!!e.querySelector(`[role='listbox']`))},n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributeFilter:[`role`]}),t(),()=>n.disconnect()},[c,g]),m||(n={role:`listbox`,"aria-multiselectable":p,...n}),n=_s(n,t=>(0,B.jsx)(du,{value:e,children:(0,B.jsx)(au.Provider,{value:f,children:t})}),[e,f]);let _=s&&(!r||!a)?e.setContentElement:null;return n={hidden:l,...n,id:s,ref:ls(_,o,n.ref),style:u},yo(n)}),hm=Os(function(e){return As(pm,mm(e))}),gm=`div`;function _m(e,...t){if(!e)return!1;if(`id`in e){let n=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(`, `);return n?e.matches(n):!1}return!1}var vm=js(function({store:e,modal:t,tabIndex:n,alwaysVisible:r,autoFocusOnHide:i=!0,hideOnInteractOutside:a=!0,...o}){let s=lu();e||=s,ho(e,!1);let c=J(e,`baseElement`),l=(0,R.useRef)(!1),u=J(e.tag,e=>e?.renderedItems.length);return o=mm({store:e,alwaysVisible:r,...o}),o=Op({store:e,modal:t,alwaysVisible:r,backdrop:!1,autoFocusOnShow:!1,finalFocus:c,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:u,...o,getPersistentElements(){let n=o.getPersistentElements?.call(o)||[];if(!t||!e)return n;let{contentElement:r,baseElement:i}=e.getState();if(!i)return n;let a=Eo(i),s=[];if(r?.id&&s.push(`[aria-controls~="${r.id}"]`),i?.id&&s.push(`[aria-controls~="${i.id}"]`),!s.length)return[...n,i];let c=s.join(`,`),l=a.querySelectorAll(c);return[...n,...l]},autoFocusOnHide(e){return _o(i,e)?!1:l.current?(l.current=!1,!1):!0},hideOnInteractOutside(t){let n=e?.getState(),r=n?.contentElement?.id,i=n?.baseElement?.id;if(_m(t.target,r,i))return!1;let o=typeof a==`function`?a(t):a;return o&&(l.current=t.type===`click`),o}}),o}),ym=Cd(Os(function(e){return As(gm,vm(e))}),lu);(0,R.createContext)(null),(0,R.createContext)(null);var bm=Ms([Bs],[Vs]),xm=bm.useContext;bm.useScopedContext,bm.useProviderContext,bm.ContextProvider,bm.ScopedContextProvider;var Sm=Wo()&&Ho();function Cm({tag:e,...t}={}){let n=Zc(t.store,Xc(e,[`value`,`rtl`])),r=e?.getState(),i=n?.getState(),a=W(t.activeId,i?.activeId,t.defaultActiveId,null),o=nu({...t,activeId:a,includesBaseElement:W(t.includesBaseElement,i?.includesBaseElement,!0),orientation:W(t.orientation,i?.orientation,`vertical`),focusLoop:W(t.focusLoop,i?.focusLoop,!0),focusWrap:W(t.focusWrap,i?.focusWrap,!0),virtualFocus:W(t.virtualFocus,i?.virtualFocus,!0)}),s=kp({...t,placement:W(t.placement,i?.placement,`bottom-start`)}),c=W(t.value,i?.value,t.defaultValue,``),l=W(t.selectedValue,i?.selectedValue,r?.values,t.defaultSelectedValue,``),u=Array.isArray(l),d={...o.getState(),...s.getState(),value:c,selectedValue:l,resetValueOnSelect:W(t.resetValueOnSelect,i?.resetValueOnSelect,u),resetValueOnHide:W(t.resetValueOnHide,i?.resetValueOnHide,u&&!e),activeValue:i?.activeValue},f=Uc(d,o,s,n);return Sm&&Wc(f,()=>qc(f,[`virtualFocus`],()=>{f.setState(`virtualFocus`,!1)})),Wc(f,()=>{if(e)return U(qc(f,[`selectedValue`],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),qc(e,[`values`],e=>{f.setState(`selectedValue`,e.values)}))}),Wc(f,()=>qc(f,[`resetValueOnHide`,`mounted`],e=>{e.resetValueOnHide&&(e.mounted||f.setState(`value`,c))})),Wc(f,()=>qc(f,[`open`],e=>{e.open||(f.setState(`activeId`,a),f.setState(`moves`,0))})),Wc(f,()=>qc(f,[`moves`,`activeId`],(e,t)=>{e.moves===t.moves&&f.setState(`activeValue`,void 0)})),Wc(f,()=>Jc(f,[`moves`,`renderedItems`],(e,t)=>{if(e.moves===t.moves)return;let{activeId:n}=f.getState(),r=o.item(n);f.setState(`activeValue`,r?.value)})),{...s,...o,...f,tag:e,setValue:e=>f.setState(`value`,e),resetValue:()=>f.setState(`value`,d.value),setSelectedValue:e=>f.setState(`selectedValue`,e)}}function wm(e){let t=xm();return e={...e,tag:e.tag===void 0?t:e.tag},ru(e)}function Tm(e,t,n){return ps(t,[n.tag]),tl(e,n,`value`,`setValue`),tl(e,n,`selectedValue`,`setSelectedValue`),tl(e,n,`resetValueOnHide`),tl(e,n,`resetValueOnSelect`),Object.assign(iu(Ap(e,t,n),t,n),{tag:n.tag})}function Em(e={}){e=wm(e);let[t,n]=nl(Cm,e);return Tm(t,n,e)}function Dm(e={}){return(0,B.jsx)(uu,{value:Em(e),children:e.children})}var Om=e(t(((e,t)=>{var n={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,Ấ:`A`,Ắ:`A`,Ẳ:`A`,Ẵ:`A`,Ặ:`A`,Æ:`AE`,Ầ:`A`,Ằ:`A`,Ȃ:`A`,Ả:`A`,Ạ:`A`,Ẩ:`A`,Ẫ:`A`,Ậ:`A`,Ç:`C`,Ḉ:`C`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,Ế:`E`,Ḗ:`E`,Ề:`E`,Ḕ:`E`,Ḝ:`E`,Ȇ:`E`,Ẻ:`E`,Ẽ:`E`,Ẹ:`E`,Ể:`E`,Ễ:`E`,Ệ:`E`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,Ḯ:`I`,Ȋ:`I`,Ỉ:`I`,Ị:`I`,Ð:`D`,Ñ:`N`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,Ố:`O`,Ṍ:`O`,Ṓ:`O`,Ȏ:`O`,Ỏ:`O`,Ọ:`O`,Ổ:`O`,Ỗ:`O`,Ộ:`O`,Ờ:`O`,Ở:`O`,Ỡ:`O`,Ớ:`O`,Ợ:`O`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,Ủ:`U`,Ụ:`U`,Ử:`U`,Ữ:`U`,Ự:`U`,Ý:`Y`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,ấ:`a`,ắ:`a`,ẳ:`a`,ẵ:`a`,ặ:`a`,æ:`ae`,ầ:`a`,ằ:`a`,ȃ:`a`,ả:`a`,ạ:`a`,ẩ:`a`,ẫ:`a`,ậ:`a`,ç:`c`,ḉ:`c`,è:`e`,é:`e`,ê:`e`,ë:`e`,ế:`e`,ḗ:`e`,ề:`e`,ḕ:`e`,ḝ:`e`,ȇ:`e`,ẻ:`e`,ẽ:`e`,ẹ:`e`,ể:`e`,ễ:`e`,ệ:`e`,ì:`i`,í:`i`,î:`i`,ï:`i`,ḯ:`i`,ȋ:`i`,ỉ:`i`,ị:`i`,ð:`d`,ñ:`n`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,ố:`o`,ṍ:`o`,ṓ:`o`,ȏ:`o`,ỏ:`o`,ọ:`o`,ổ:`o`,ỗ:`o`,ộ:`o`,ờ:`o`,ở:`o`,ỡ:`o`,ớ:`o`,ợ:`o`,ù:`u`,ú:`u`,û:`u`,ü:`u`,ủ:`u`,ụ:`u`,ử:`u`,ữ:`u`,ự:`u`,ý:`y`,ÿ:`y`,Ā:`A`,ā:`a`,Ă:`A`,ă:`a`,Ą:`A`,ą:`a`,Ć:`C`,ć:`c`,Ĉ:`C`,ĉ:`c`,Ċ:`C`,ċ:`c`,Č:`C`,č:`c`,C̆:`C`,c̆:`c`,Ď:`D`,ď:`d`,Đ:`D`,đ:`d`,Ē:`E`,ē:`e`,Ĕ:`E`,ĕ:`e`,Ė:`E`,ė:`e`,Ę:`E`,ę:`e`,Ě:`E`,ě:`e`,Ĝ:`G`,Ǵ:`G`,ĝ:`g`,ǵ:`g`,Ğ:`G`,ğ:`g`,Ġ:`G`,ġ:`g`,Ģ:`G`,ģ:`g`,Ĥ:`H`,ĥ:`h`,Ħ:`H`,ħ:`h`,Ḫ:`H`,ḫ:`h`,Ĩ:`I`,ĩ:`i`,Ī:`I`,ī:`i`,Ĭ:`I`,ĭ:`i`,Į:`I`,į:`i`,İ:`I`,ı:`i`,IJ:`IJ`,ij:`ij`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,Ḱ:`K`,ḱ:`k`,K̆:`K`,k̆:`k`,Ĺ:`L`,ĺ:`l`,Ļ:`L`,ļ:`l`,Ľ:`L`,ľ:`l`,Ŀ:`L`,ŀ:`l`,Ł:`l`,ł:`l`,Ḿ:`M`,ḿ:`m`,M̆:`M`,m̆:`m`,Ń:`N`,ń:`n`,Ņ:`N`,ņ:`n`,Ň:`N`,ň:`n`,ʼn:`n`,N̆:`N`,n̆:`n`,Ō:`O`,ō:`o`,Ŏ:`O`,ŏ:`o`,Ő:`O`,ő:`o`,Œ:`OE`,œ:`oe`,P̆:`P`,p̆:`p`,Ŕ:`R`,ŕ:`r`,Ŗ:`R`,ŗ:`r`,Ř:`R`,ř:`r`,R̆:`R`,r̆:`r`,Ȓ:`R`,ȓ:`r`,Ś:`S`,ś:`s`,Ŝ:`S`,ŝ:`s`,Ş:`S`,Ș:`S`,ș:`s`,ş:`s`,Š:`S`,š:`s`,Ţ:`T`,ţ:`t`,ț:`t`,Ț:`T`,Ť:`T`,ť:`t`,Ŧ:`T`,ŧ:`t`,T̆:`T`,t̆:`t`,Ũ:`U`,ũ:`u`,Ū:`U`,ū:`u`,Ŭ:`U`,ŭ:`u`,Ů:`U`,ů:`u`,Ű:`U`,ű:`u`,Ų:`U`,ų:`u`,Ȗ:`U`,ȗ:`u`,V̆:`V`,v̆:`v`,Ŵ:`W`,ŵ:`w`,Ẃ:`W`,ẃ:`w`,X̆:`X`,x̆:`x`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Y̆:`Y`,y̆:`y`,Ź:`Z`,ź:`z`,Ż:`Z`,ż:`z`,Ž:`Z`,ž:`z`,ſ:`s`,ƒ:`f`,Ơ:`O`,ơ:`o`,Ư:`U`,ư:`u`,Ǎ:`A`,ǎ:`a`,Ǐ:`I`,ǐ:`i`,Ǒ:`O`,ǒ:`o`,Ǔ:`U`,ǔ:`u`,Ǖ:`U`,ǖ:`u`,Ǘ:`U`,ǘ:`u`,Ǚ:`U`,ǚ:`u`,Ǜ:`U`,ǜ:`u`,Ứ:`U`,ứ:`u`,Ṹ:`U`,ṹ:`u`,Ǻ:`A`,ǻ:`a`,Ǽ:`AE`,ǽ:`ae`,Ǿ:`O`,ǿ:`o`,Þ:`TH`,þ:`th`,Ṕ:`P`,ṕ:`p`,Ṥ:`S`,ṥ:`s`,X́:`X`,x́:`x`,Ѓ:`Г`,ѓ:`г`,Ќ:`К`,ќ:`к`,A̋:`A`,a̋:`a`,E̋:`E`,e̋:`e`,I̋:`I`,i̋:`i`,Ǹ:`N`,ǹ:`n`,Ồ:`O`,ồ:`o`,Ṑ:`O`,ṑ:`o`,Ừ:`U`,ừ:`u`,Ẁ:`W`,ẁ:`w`,Ỳ:`Y`,ỳ:`y`,Ȁ:`A`,ȁ:`a`,Ȅ:`E`,ȅ:`e`,Ȉ:`I`,ȉ:`i`,Ȍ:`O`,ȍ:`o`,Ȑ:`R`,ȑ:`r`,Ȕ:`U`,ȕ:`u`,B̌:`B`,b̌:`b`,Č̣:`C`,č̣:`c`,Ê̌:`E`,ê̌:`e`,F̌:`F`,f̌:`f`,Ǧ:`G`,ǧ:`g`,Ȟ:`H`,ȟ:`h`,J̌:`J`,ǰ:`j`,Ǩ:`K`,ǩ:`k`,M̌:`M`,m̌:`m`,P̌:`P`,p̌:`p`,Q̌:`Q`,q̌:`q`,Ř̩:`R`,ř̩:`r`,Ṧ:`S`,ṧ:`s`,V̌:`V`,v̌:`v`,W̌:`W`,w̌:`w`,X̌:`X`,x̌:`x`,Y̌:`Y`,y̌:`y`,A̧:`A`,a̧:`a`,B̧:`B`,b̧:`b`,Ḑ:`D`,ḑ:`d`,Ȩ:`E`,ȩ:`e`,Ɛ̧:`E`,ɛ̧:`e`,Ḩ:`H`,ḩ:`h`,I̧:`I`,i̧:`i`,Ɨ̧:`I`,ɨ̧:`i`,M̧:`M`,m̧:`m`,O̧:`O`,o̧:`o`,Q̧:`Q`,q̧:`q`,U̧:`U`,u̧:`u`,X̧:`X`,x̧:`x`,Z̧:`Z`,z̧:`z`,й:`и`,Й:`И`,ё:`е`,Ё:`Е`},r=Object.keys(n).join(`|`),i=new RegExp(r,`g`),a=new RegExp(r,``);function o(e){return n[e]}var s=function(e){return e.replace(i,o)},c=function(e){return!!e.match(a)};t.exports=s,t.exports.has=c,t.exports.remove=s}))()),km={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},Am=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function jm(e,t,n={}){let{keys:r,threshold:i=km.MATCHES,baseSort:a=Am,sorter:o=e=>e.sort((e,t)=>Lm(e,t,a))}=n;return o(e.reduce(s,[])).map(({item:e})=>e);function s(e,a,o){let s=Mm(a,r,t,n),{rank:c,keyThreshold:l=i}=s;return c>=l&&e.push({...s,item:a,index:o}),e}}jm.rankings=km;function Mm(e,t,n,r){if(!t){let t=e;return{rankedValue:t,rank:Pm(t,n,r),keyIndex:-1,keyThreshold:r.threshold}}return Vm(e,t).reduce(({rank:e,rankedValue:t,keyIndex:i,keyThreshold:a},{itemValue:o,attributes:s},c)=>{let l=Pm(o,n,r),u=t,{minRanking:d,maxRanking:f,threshold:p}=s;return l=km.MATCHES?l=d:l>f&&(l=f),l>e&&(e=l,i=c,a=p,u=o),{rankedValue:u,rank:e,keyIndex:i,keyThreshold:a}},{rankedValue:e,rank:km.NO_MATCH,keyIndex:-1,keyThreshold:r.threshold})}function*Nm(e,t){let n=-1;for(;(n=e.indexOf(t,n+1))>-1;)yield n;return-1}function Pm(e,t,n){if(e=Rm(e,n),t=Rm(t,n),t.length>e.length)return km.NO_MATCH;if(e===t)return km.CASE_SENSITIVE_EQUAL;e=e.toLowerCase(),t=t.toLowerCase();let r=Nm(e,t),i=r.next(),a=i.value;if(e.length===t.length&&a===0)return km.EQUAL;if(a===0)return km.STARTS_WITH;let o=i;for(;!o.done;){if(o.value>0&&e[o.value-1]===` `)return km.WORD_STARTS_WITH;o=r.next()}return a>0?km.CONTAINS:t.length===1?km.NO_MATCH:Fm(e).includes(t)?km.ACRONYM:Im(e,t)}function Fm(e){let t=``,n=` `;for(let r=0;r-1))return km.NO_MATCH}return a(r-o)}function Lm(e,t,n){let{rank:r,keyIndex:i}=e,{rank:a,keyIndex:o}=t;return r===a?i===o?n(e,t):ia?-1:1}function Rm(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,Om.default)(e)),e}function zm(e,t){typeof t==`object`&&(t=t.key);let n;if(typeof t==`function`)n=t(e);else if(e==null)n=null;else if(Object.hasOwnProperty.call(e,t))n=e[t];else if(t.includes(`.`))return Bm(t,e);else n=null;return n==null?[]:Array.isArray(n)?n:[String(n)]}function Bm(e,t){let n=e.split(`.`),r=[t];for(let e=0,t=n.length;e{var n=200,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=1,o=2,s=1/0,c=9007199254740991,l=`[object Arguments]`,u=`[object Array]`,d=`[object Boolean]`,f=`[object Date]`,p=`[object Error]`,m=`[object Function]`,h=`[object GeneratorFunction]`,g=`[object Map]`,_=`[object Number]`,v=`[object Object]`,y=`[object Promise]`,b=`[object RegExp]`,x=`[object Set]`,S=`[object String]`,C=`[object Symbol]`,w=`[object WeakMap]`,T=`[object ArrayBuffer]`,E=`[object DataView]`,D=`[object Float32Array]`,O=`[object Float64Array]`,k=`[object Int8Array]`,A=`[object Int16Array]`,j=`[object Int32Array]`,M=`[object Uint8Array]`,ee=`[object Uint8ClampedArray]`,te=`[object Uint16Array]`,N=`[object Uint32Array]`,P=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,ae=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,L={};L[D]=L[O]=L[k]=L[A]=L[j]=L[M]=L[ee]=L[te]=L[N]=!0,L[l]=L[u]=L[T]=L[d]=L[E]=L[f]=L[p]=L[m]=L[g]=L[_]=L[v]=L[b]=L[x]=L[S]=L[w]=!1;var se=typeof global==`object`&&global&&global.Object===Object&&global,ce=typeof self==`object`&&self&&self.Object===Object&&self,le=se||ce||Function(`return this`)(),ue=typeof e==`object`&&e&&!e.nodeType&&e,de=ue&&typeof t==`object`&&t&&!t.nodeType&&t,fe=de&&de.exports===ue&&se.process,pe=function(){try{return fe&&fe.binding(`util`)}catch{}}(),me=pe&&pe.isTypedArray;function he(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n-1}function lt(e,t){var n=this.__data__,r=Et(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}it.prototype.clear=at,it.prototype.delete=ot,it.prototype.get=st,it.prototype.has=ct,it.prototype.set=lt;function ut(e){var t=-1,n=e?e.length:0;for(this.clear();++tt||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function B(e,t){return function(n,r){if(n==null)return n;if(!bn(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++al))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=i&a?new gt:void 0;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=c}function wn(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function Tn(e){return!!e&&typeof e==`object`}function En(e){return typeof e==`symbol`||Tn(e)&&Ne.call(e)==C}var Dn=me?be(me):Lt;function On(e){return e==null?``:Gt(e)}function kn(e,t,n){var r=e==null?void 0:At(e,t);return r===void 0?n:r}function An(e,t){return e!=null&&rn(e,t,Mt)}function jn(e){return bn(e)?Tt(e):zt(e)}function Mn(e){return e}function Nn(e){return on(e)?_e(pn(e)):Wt(e)}t.exports=hn}))(),1),qm={InputWrapper:`_InputWrapper_avklz_1`,Shortcut:`_Shortcut_avklz_9`,Input:`_Input_avklz_1`,SelectedValue:`_SelectedValue_avklz_52`,SelectedName:`_SelectedName_avklz_67`,ItemType:`_ItemType_avklz_79`,Popover:`_Popover_avklz_83`,PopoverWrapper:`_PopoverWrapper_avklz_97`,List:`_List_avklz_110`,Group:`_Group_avklz_114`,GroupLabel:`_GroupLabel_avklz_122`,Item:`_Item_avklz_79`,ItemHeader:`_ItemHeader_avklz_162`,ItemName:`_ItemName_avklz_168`,ItemTypes:`_ItemTypes_avklz_174`,ItemMissionName:`_ItemMissionName_avklz_193`,NoResults:`_NoResults_avklz_198`,Backdrop:`_Backdrop_avklz_205`,CloseButton:`_CloseButton_avklz_215`},Jm=new Set([`SkiFree`,`SkiFree_Daily`,`SkiFree_Randomizer`]),Ym={"missions.vl2":`Official`,"TR2final105-client.vl2":`Team Rabbit 2`,"z_mappacks/CTF/Classic_maps_v1.vl2":`Classic`,"z_mappacks/CTF/DynamixFinalPack.vl2":`Official`,"z_mappacks/CTF/KryMapPack_b3EDIT.vl2":`KryMapPack`,"z_mappacks/CTF/S5maps.vl2":`S5`,"z_mappacks/CTF/S8maps.vl2":`S8`,"z_mappacks/CTF/TWL-MapPack.vl2":`TWL`,"z_mappacks/CTF/TWL-MapPackEDIT.vl2":`TWL`,"z_mappacks/CTF/TWL2-MapPack.vl2":`TWL2`,"z_mappacks/CTF/TWL2-MapPackEDIT.vl2":`TWL2`,"z_mappacks/TWL_T2arenaOfficialMaps.vl2":`Arena`,"z_mappacks/xPack2.vl2":`xPack2`,"z_mappacks/z_DMP2-V0.6.vl2":`DMP2 (Discord Map Pack)`,"z_mappacks/zDMP-4.7.3DX.vl2":`DMP (Discord Map Pack)`,"z_mappacks/zDMP-4.7.3DX-ServerOnly.vl2":`DMP (Discord Map Pack)`},Xm={"z_mappacks/DM":`DM`,"z_mappacks/LCTF":`LCTF`,"z_mappacks/Lak":`LakRabbit`},Zm=e=>{let t=e.match(/^(.*)(\/[^/]+)$/);return t?t[1]:``},Qm=T().filter(e=>!Jm.has(e)).map(e=>{let t=w(e),[n]=E(t.resourcePath),r=Zm(n),i=Ym[n]??Xm[r]??null;return{resourcePath:t.resourcePath,missionName:e,displayName:t.displayName,sourcePath:n,groupName:i,missionTypes:t.missionTypes}}),$m=new Map(Qm.map(e=>[e.missionName,e]));function eh(e){let t=new Map;for(let n of e){let e=t.get(n.groupName)??[];e.push(n),t.set(n.groupName,e)}return t.forEach((e,n)=>{t.set(n,(0,Km.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],[`asc`]))}),(0,Km.default)(Array.from(t.entries()),[([e])=>e===`Official`?0:e==null?2:1,([e])=>e?e.toLowerCase():``],[`asc`,`asc`])}var th=eh(Qm),nh=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function rh(e){let t=(0,z.c)(12),{mission:n}=e,r=n.displayName||n.missionName,i;t[0]===r?i=t[1]:(i=(0,B.jsx)(`span`,{className:qm.ItemName,children:r}),t[0]=r,t[1]=i);let a;t[2]===n.missionTypes?a=t[3]:(a=n.missionTypes.length>0&&(0,B.jsx)(`span`,{className:qm.ItemTypes,children:n.missionTypes.map(ih)}),t[2]=n.missionTypes,t[3]=a);let o;t[4]!==i||t[5]!==a?(o=(0,B.jsxs)(`span`,{className:qm.ItemHeader,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===n.missionName?s=t[8]:(s=(0,B.jsx)(`span`,{className:qm.ItemMissionName,children:n.missionName}),t[7]=n.missionName,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,B.jsxs)(B.Fragment,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ih(e){return(0,B.jsx)(`span`,{className:qm.ItemType,"data-mission-type":e,children:e},e)}function ah(e){let t=(0,z.c)(65),{value:n,missionType:r,onChange:i,disabled:a,autoFocus:o,onCancel:s}=e,[c,l]=(0,R.useState)(``),u=(0,R.useRef)(null),d=(0,R.useRef)(r),f;t[0]===s?f=t[1]:(f=e=>{e||s?.()},t[0]=s,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{(0,R.startTransition)(()=>l(e))},t[2]=p):p=t[2];let m=Em({resetValueOnHide:!0,selectedValue:n,setOpen:f,setSelectedValue:e=>{if(e){let t=d.current,n=w(e).missionTypes;(!t||!n.includes(t))&&(t=n[0]),i({missionName:e,missionType:t}),u.current?.blur()}},setValue:p}),h=J(m,`open`),g,_;t[3]!==o||t[4]!==m?(g=()=>{o&&(u.current?.focus(),m.show())},_=[o,m],t[3]=o,t[4]=m,t[5]=g,t[6]=_):(g=t[5],_=t[6]),(0,R.useEffect)(g,_);let v,y;t[7]===m?(v=t[8],y=t[9]):(v=()=>{let e=e=>{e.code===`KeyK`&&(e.metaKey||e.ctrlKey)&&(e.stopPropagation(),e.preventDefault(),u.current?.focus(),m.show())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},y=[m],t[7]=m,t[8]=v,t[9]=y),(0,R.useEffect)(v,y);let b;t[10]===n?b=t[11]:(b=$m.get(n),t[10]=n,t[11]=b);let x=b,S;bb0:{if(!c){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e={type:`grouped`,groups:th},t[12]=e):e=t[12],S=e;break bb0}let e;t[13]===c?e=t[14]:(e=jm(Qm,c,{keys:[`displayName`,`missionName`,`missionTypes`,`groupName`]}),t[13]=c,t[14]=e);let n=e,r;t[15]===n?r=t[16]:(r={type:`flat`,missions:n},t[15]=n,t[16]=r),S=r}let C=S,T=x?x.displayName||x.missionName:n,E=C.type===`flat`?C.missions.length===0:C.groups.length===0,D=e=>(0,B.jsx)(fm,{value:e.missionName,className:qm.Item,focusOnHover:!0,onClick:t=>{if(t.target&&t.target instanceof HTMLElement){let r=t.target.dataset.missionType;r?(d.current=r,e.missionName===n&&i({missionName:e.missionName,missionType:r})):d.current=null}else d.current=null},children:(0,B.jsx)(rh,{mission:e})},e.missionName),O=Dm,k=h?`visible`:`hidden`,A;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,B.jsx)(`div`,{className:qm.Backdrop}),t[17]=A):A=t[17];let j;t[18]===k?j=t[19]:(j=(0,B.jsx)(R.Activity,{mode:k,children:A}),t[18]=k,t[19]=j);let M=x?void 0:`Choose a map…`,ee,te;t[20]===m?(ee=t[21],te=t[22]):(ee=()=>{try{document.exitPointerLock()}catch{}m.show()},te=e=>{e.key===`Escape`&&!m.getState().open&&u.current?.blur()},t[20]=m,t[21]=ee,t[22]=te);let N;t[23]!==o||t[24]!==a||t[25]!==M||t[26]!==ee||t[27]!==te?(N=(0,B.jsx)(tm,{ref:u,autoSelect:!0,autoFocus:o,disabled:a,placeholder:M,className:qm.Input,onFocus:ee,onKeyDown:te}),t[23]=o,t[24]=a,t[25]=M,t[26]=ee,t[27]=te,t[28]=N):N=t[28];let P;t[29]!==T||t[30]!==r||t[31]!==x?(P=x&&(0,B.jsxs)(`div`,{className:qm.SelectedValue,children:[(0,B.jsx)(`span`,{className:qm.SelectedName,children:T}),r&&(0,B.jsx)(`span`,{className:qm.ItemType,"data-mission-type":r,children:r})]}),t[29]=T,t[30]=r,t[31]=x,t[32]=P):P=t[32];let ne;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,B.jsx)(`kbd`,{className:qm.Shortcut,children:nh?`⌘K`:`^K`}),t[33]=ne):ne=t[33];let re;t[34]!==N||t[35]!==P?(re=(0,B.jsxs)(`div`,{className:qm.InputWrapper,onKeyDown:sh,children:[N,P,ne]}),t[34]=N,t[35]=P,t[36]=re):re=t[36];let F;t[37]!==m||t[38]!==s?(F=()=>{m.hide(),s?.()},t[37]=m,t[38]=s,t[39]=F):F=t[39];let ie;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,B.jsx)(Gm,{}),t[40]=ie):ie=t[40];let ae;t[41]!==h||t[42]!==F?(ae=(0,B.jsx)(`button`,{type:`button`,className:qm.CloseButton,"data-open":h,onClick:F,children:ie}),t[41]=h,t[42]=F,t[43]=ae):ae=t[43];let I=ym,oe=qm,L;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(L={className:qm.PopoverWrapper},t[44]=L):L=t[44];let se=oh,ce=hm,le=qm,ue=C.type===`flat`?C.missions.map(D):C.groups.map(e=>{let[t,n]=e;return t?(0,B.jsxs)(im,{className:qm.Group,children:[(0,B.jsx)(sm,{className:qm.GroupLabel,children:t}),n.map(D)]},t):(0,B.jsx)(R.Fragment,{children:n.map(D)},`ungrouped`)}),de;t[45]===E?de=t[46]:(de=E&&(0,B.jsx)(`div`,{className:qm.NoResults,children:`No missions found`}),t[45]=E,t[46]=de);let fe;t[47]!==ce||t[48]!==le.List||t[49]!==ue||t[50]!==de?(fe=(0,B.jsxs)(ce,{className:le.List,children:[ue,de]}),t[47]=ce,t[48]=le.List,t[49]=ue,t[50]=de,t[51]=fe):fe=t[51];let pe;t[52]!==I||t[53]!==oe.Popover||t[54]!==L||t[55]!==se||t[56]!==fe?(pe=(0,B.jsx)(I,{gutter:4,fitViewport:!0,sameWidth:!0,fixed:!0,autoFocusOnHide:!1,className:oe.Popover,wrapperProps:L,onKeyDown:se,children:fe}),t[52]=I,t[53]=oe.Popover,t[54]=L,t[55]=se,t[56]=fe,t[57]=pe):pe=t[57];let me;return t[58]!==O||t[59]!==m||t[60]!==j||t[61]!==re||t[62]!==ae||t[63]!==pe?(me=(0,B.jsxs)(O,{store:m,children:[j,re,ae,pe]}),t[58]=O,t[59]=m,t[60]=j,t[61]=re,t[62]=ae,t[63]=pe,t[64]=me):me=t[64],me}function oh(e){e.metaKey||e.stopPropagation()}function sh(e){e.metaKey||e.stopPropagation()}function ch(e){return S({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`m12 6-6 8h12zM6 16h12v2H6z`},child:[]}]})(e)}var lh={Header:`_Header_klnnn_1`,MissionInfo:`_MissionInfo_klnnn_9`,MissionName:`_MissionName_klnnn_21 _SelectedName_avklz_67`,MissionType:`_MissionType_klnnn_25 _ItemType_avklz_79`,MissionTypeDisplayName:`_MissionTypeDisplayName_klnnn_30`,Metadata:`_Metadata_klnnn_35`,Attribution:`_Attribution_klnnn_46`,ServerInfo:`_ServerInfo_klnnn_47`,PlayerName:`_PlayerName_klnnn_51`,RecordingDate:`_RecordingDate_klnnn_52`,ServerName:`_ServerName_klnnn_53`,EjectButton:`_EjectButton_klnnn_57 _DestructiveActionButton_p0g82_141 _Button_p0g82_2`,DisconnectButton:`_DisconnectButton_klnnn_58 _DestructiveActionButton_p0g82_141 _Button_p0g82_2`,EjectIcon:`_EjectIcon_klnnn_62`,Error:`_Error_klnnn_67`,Pulsing:`_Pulsing_klnnn_81`,blink:`_blink_klnnn_1`,ConnectionPing:`_ConnectionPing_klnnn_85`,PingDot:`_PingDot_klnnn_95 _Pulsing_klnnn_81`};function uh(){let e=(0,z.c)(28),t=Jn(),n=nr(),r=Qn(),i=er(),a=ir(),o=or(),s=cr(),[c,l]=s?s.split(` `):[null,null],u=t===`live`,d=_r(),f=pr(ph),p=pr(mr),m=fh,h=dh,g=lh,_;e[0]!==n||e[1]!==r||e[2]!==i?(_=n&&r?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:lh.MissionName,children:n}),r&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`span`,{className:lh.MissionType,"data-mission-type":r,children:i===`LCTF`?`LCTF`:r})]})]}):null,e[0]=n,e[1]=r,e[2]=i,e[3]=_):_=e[3];let v;e[4]===_?v=e[5]:(v=(0,B.jsx)(`div`,{className:lh.MissionInfo,children:_}),e[4]=_,e[5]=v);let y;e[6]!==f||e[7]!==p?(y=f&&p!=null?(0,B.jsxs)(`span`,{className:lh.ConnectionPing,"data-quality":p<150?`good`:p<300?`fine`:`poor`,children:[(0,B.jsx)(`span`,{className:lh.PingDot}),` `,D(p)]}):null,e[6]=f,e[7]=p,e[8]=y):y=e[8];let b=lh,x=u?f?o?(0,B.jsxs)(`div`,{className:lh.Attribution,children:[`Connected as`,` `,(0,B.jsx)(`span`,{className:lh.PlayerName,children:o})]}):null:(0,B.jsx)(`div`,{className:lh.Error,children:`Disconnected`}):o&&s?(0,B.jsxs)(`div`,{className:lh.Attribution,children:[`Recorded by `,(0,B.jsx)(`span`,{className:lh.PlayerName,children:o}),` `,`on`,` `,(0,B.jsx)(`span`,{className:lh.RecordingDate,children:c.replace(/-/g,` `)}),` `,`at`,` `,(0,B.jsx)(`span`,{className:lh.RecordingDate,children:(l??``).replace(/(AM|PM)$/,` $1`)})]}):null,S;e[9]===a?S=e[10]:(S=a?(0,B.jsxs)(`div`,{className:lh.ServerInfo,children:[`Server: `,(0,B.jsx)(`span`,{className:lh.ServerName,children:a})]}):null,e[9]=a,e[10]=S);let C;e[11]!==b.Metadata||e[12]!==x||e[13]!==S?(C=(0,B.jsxs)(`div`,{className:b.Metadata,children:[x,S]}),e[11]=b.Metadata,e[12]=x,e[13]=S,e[14]=C):C=e[14];let w;e[15]!==t||e[16]!==h||e[17]!==m||e[18]!==u||e[19]!==f||e[20]!==d?(w=t===`demo`?(0,B.jsx)(`button`,{type:`button`,className:lh.EjectButton,title:`Unload demo`,"aria-label":`Unload demo`,onClick:m,disabled:!d,children:(0,B.jsx)(ch,{className:lh.EjectIcon})}):u?(0,B.jsx)(`button`,{type:`button`,className:lh.DisconnectButton,title:`Disconnect`,"aria-label":`Disconnect`,onClick:h,disabled:!f,children:(0,B.jsx)(Ta,{})}):null,e[15]=t,e[16]=h,e[17]=m,e[18]=u,e[19]=f,e[20]=d,e[21]=w):w=e[21];let T;return e[22]!==g.Header||e[23]!==v||e[24]!==y||e[25]!==C||e[26]!==w?(T=(0,B.jsxs)(`div`,{className:g.Header,children:[v,y,C,w]}),e[22]=g.Header,e[23]=v,e[24]=y,e[25]=C,e[26]=w,e[27]=T):T=e[27],T}function dh(){fr.getState().disconnectServer(),je.getState().setRecording(null)}function fh(){je.getState().setRecording(null)}function ph(e){return e.gameStatus===`connected`||e.gameStatus===`authenticating`}function mh(e){let t=(0,z.c)(5),{onChangeMission:n}=e,{setRecording:r}=Dr(),i=(0,R.useEffectEvent)(n),a;t[0]!==i||t[1]!==r?(a=()=>(window.setMissionName=e=>{let t=w(e).missionTypes;i({missionName:e,missionType:t[0]})},window.getMissionList=T,window.getMissionInfo=w,window.loadDemoRecording=r,hh),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=[r],t[3]=r,t[4]=o),(0,R.useEffect)(a,o)}function hh(){delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo,delete window.loadDemoRecording}var gh=(0,R.createContext)(null);function _h(){let e=(0,R.useContext)(gh);if(!e)throw Error(`useCameras must be used within CamerasProvider`);return e}function vh({children:e}){let t=o(e=>e.camera),[n,r]=(0,R.useState)(-1),[i,a]=(0,R.useState)({}),[s,c]=(0,R.useState)(()=>({initialized:!1,position:null,quarternion:null})),l=(0,R.useCallback)(e=>{a(t=>({...t,[e.id]:e}))},[]),u=(0,R.useCallback)(e=>{a(t=>{let{[e.id]:n,...r}=t;return r})},[]),d=Object.keys(i).length,f=(0,R.useCallback)(e=>{if(e>=0&&e{f(d?(n+1)%d:-1)},[d,n,f]);(0,R.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith(`#c`)){let[t,n]=e.slice(2).split(`~`),r=t.split(`,`).map(e=>parseFloat(e)),i=n.split(`,`).map(e=>parseFloat(e));c({initialized:!0,position:new Ee(...r),quarternion:new Te(...i)})}else c({initialized:!0,position:null,quarternion:null})};return window.addEventListener(`hashchange`,e),e(),()=>{window.removeEventListener(`hashchange`,e)}},[]),(0,R.useEffect)(()=>{s.initialized&&s.position&&(t.position.copy(s.position),s.quarternion&&t.quaternion.copy(s.quarternion))},[t,s]),(0,R.useEffect)(()=>{!s.initialized||s.position||d>0&&n===-1&&f(0)},[d,f,n,s]);let m=(0,R.useMemo)(()=>({registerCamera:l,unregisterCamera:u,nextCamera:p,setCameraIndex:f,cameraCount:d}),[l,u,p,f,d]);return d===0&&n!==-1&&r(-1),(0,B.jsx)(gh.Provider,{value:m,children:e})}var yh=(0,R.createContext)(null);function bh(){let e=(0,R.useContext)(yh);if(!e)throw Error(`useInputContext must be used within an InputProvider`);return e}function xh(){return bh().onInput}function Sh(){return bh().mode}var Ch=new Set([`Ctrl`,`Shift`,`Alt`]),wh=new Set([`MetaLeft`,`MetaRight`,`ControlLeft`,`ControlRight`,`ShiftLeft`,`ShiftRight`,`AltLeft`,`AltRight`]);function Th(e){if(typeof e!=`string`)return e;let t=e.split(`-`),n=t.pop(),r=[];for(let e of t)Ch.has(e)&&r.push(e);return{type:`key`,code:n,modifiers:r.length>0?r:void 0}}function Eh(e,t){let n=e.has(`ControlLeft`)||e.has(`ControlRight`),r=e.has(`ShiftLeft`)||e.has(`ShiftRight`),i=e.has(`AltLeft`)||e.has(`AltRight`);return n===(t?.includes(`Ctrl`)??!1)&&r===(t?.includes(`Shift`)??!1)&&i===(t?.includes(`Alt`)??!1)}function Dh(e,t){let n=t?.includes(`Ctrl`)??!1,r=t?.includes(`Shift`)??!1,i=t?.includes(`Alt`)??!1;return e.ctrlKey===n&&e.shiftKey===r&&e.altKey===i}function Oh(){return{pressed:!1}}function kh(){return{dragging:!1,deltaX:0,deltaY:0,startX:0,startY:0}}function Ah(){return{deltaX:0,deltaY:0}}function jh(){return{touching:!1,dragging:!1,deltaX:0,deltaY:0}}function Mh(e){switch(e.type){case`key`:case`click`:return Oh();case`drag`:case`pointerLockMove`:return kh();case`scroll`:return Ah();case`touch`:return jh()}}var Nh=j()(ke(()=>({keys:new Set,actions:{}}))),Ph=new Map;function Fh(e,t){let n=Ph.get(e);return n||(n=new Set,Ph.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&Ph.delete(e)}}function Ih(e){let t=Ph.get(e);if(t)for(let e of t)e()}var Lh=new Set([`text`,`search`,`url`,`tel`,`email`,`password`,`number`,`date`,`datetime-local`,`month`,`week`,`time`]),Rh=new Set([`Space`,`Enter`,`NumpadEnter`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]);function zh(e){if(e.code===`Tab`)return document.pointerLockElement?(e.preventDefault(),!1):!0;let t=document.activeElement;if(!t||t===document.body)return!1;let n=t.tagName;if(t.isContentEditable||n===`TEXTAREA`)return!0;if(n===`INPUT`){let n=t.type.toLowerCase();return Lh.has(n)?!0:Rh.has(e.code)}return n===`BUTTON`||n===`SELECT`||n===`A`||n===`SUMMARY`?Rh.has(e.code):!1}function Bh(e){if(e.metaKey||zh(e))return;let{keys:t}=Nh.getState();if(t.has(e.code))return;let n=new Set(t);n.add(e.code),Nh.setState(e=>({...e,keys:n}))}function Vh(e){let{keys:t}=Nh.getState();if(!t.has(e.code))return;let n=new Set(t);if(n.delete(e.code),e.code===`MetaLeft`||e.code===`MetaRight`)for(let e of n)wh.has(e)||n.delete(e);Nh.setState(e=>({...e,keys:n}))}function Hh(){let{keys:e}=Nh.getState();e.size!==0&&Nh.setState(e=>({...e,keys:new Set}))}window.addEventListener(`keydown`,Bh),window.addEventListener(`keyup`,Vh),window.addEventListener(`blur`,Hh);function Uh(e){let t=(0,z.c)(2),n;return t[0]===e?n=t[1]:(n=t=>e(t.actions),t[0]=e,t[1]=n),M(Nh,n)}function Wh(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[Nh.subscribe,Gh],e[0]=t):t=e[0],t}function Gh(){return Nh.getState().actions}function Kh(){let{actions:e}=Nh.getState(),t={};for(let[n,r]of Object.entries(e))`deltaX`in r&&(r.deltaX!==0||r.deltaY!==0)&&(t[n]={...r,deltaX:0,deltaY:0});Object.keys(t).length>0&&Nh.setState(e=>({...e,actions:{...e.actions,...t}}))}function qh(e,t){let n=(0,z.c)(5),r=(0,R.useEffectEvent)(t),i;n[0]!==e||n[1]!==r?(i=()=>Fh(e,r),n[0]=e,n[1]=r,n[2]=i):i=n[2];let a;n[3]===e?a=n[4]:(a=[e],n[3]=e,n[4]=a),(0,R.useEffect)(i,a)}var Jh=1,Yh=11,Xh=.002;function Zh(e){let t=(e-b)/(1-b);return(Math.round(t*15)+1)/16}function Qh(e,t){let n=e[t];return n!=null&&`pressed`in n&&n.pressed}function $h(){let e=(0,z.c)(41),t=g(),{speedMultiplier:n,setSpeedMultiplier:r,mouseSensitivity:i,invertScroll:s,invertDrag:c}=v(),{onInput:l,mode:u}=bh(),[,d]=Wh(),f=o(ng),{setCameraIndex:p,cameraCount:m}=_h(),h=(0,R.useRef)(!1),_=(0,R.useRef)(!1),y,x;e[0]===t?(y=e[1],x=e[2]):(y=()=>{t&&document.pointerLockElement&&document.exitPointerLock()},x=[t],e[0]=t,e[1]=y,e[2]=x),(0,R.useEffect)(y,x);let S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],e[3]=S):S=e[3],(0,R.useEffect)(eg,S);let C;e[4]!==f||e[5]!==t?(C=()=>{!t&&!N.getState().animation&&f.domElement.requestPointerLock()},e[4]=f,e[5]=t,e[6]=C):C=e[6],qh(`canvasClick`,C);let w;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{h.current=!0},e[7]=w):w=e[7],qh(`nextPlayer`,w);let T;e[8]!==d||e[9]!==s||e[10]!==r?(T=()=>{let e=d().adjustSpeed;if(!e||e.deltaY===0)return;let t=s?-1:1,n=(e.deltaY>0?-1:1)*t,i=Math.ceil(Math.log2(Math.abs(e.deltaY)+1)),a=Math.max(Jh,Math.min(Yh,i))*n;r(e=>{let t=Math.round(e*100)+a;return Math.max(b,Math.min(1,t/100))})},e[8]=d,e[9]=s,e[10]=r,e[11]=T):T=e[11],qh(`adjustSpeed`,T);let E;e[12]!==m||e[13]!==p?(E=e=>{eD(0),e[15]=D,e[16]=O),qh(`camera1`,O);let k;e[17]===D?k=e[18]:(k=()=>D(1),e[17]=D,e[18]=k),qh(`camera2`,k);let A;e[19]===D?A=e[20]:(A=()=>D(2),e[19]=D,e[20]=A),qh(`camera3`,A);let j;e[21]===D?j=e[22]:(j=()=>D(3),e[21]=D,e[22]=j),qh(`camera4`,j);let M;e[23]===D?M=e[24]:(M=()=>D(4),e[23]=D,e[24]=M),qh(`camera5`,M);let ee;e[25]===D?ee=e[26]:(ee=()=>D(5),e[25]=D,e[26]=ee),qh(`camera6`,ee);let te;e[27]===D?te=e[28]:(te=()=>D(6),e[27]=D,e[28]=te),qh(`camera7`,te);let P;e[29]===D?P=e[30]:(P=()=>D(7),e[29]=D,e[30]=P),qh(`camera8`,P);let ne;e[31]===D?ne=e[32]:(ne=()=>D(8),e[31]=D,e[32]=ne),qh(`camera9`,ne);let re;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(re=()=>{_.current=!0},e[33]=re):re=e[33],qh(`toggleObserverMode`,re);let F;return e[34]!==d||e[35]!==c||e[36]!==u||e[37]!==i||e[38]!==l||e[39]!==n?(F=(e,t)=>{if(N.getState().animation)return;let r=d(),a=0,o=0,s=r.lockedLook;s&&(s.deltaX!==0||s.deltaY!==0)&&(a=s.deltaX*i,o=s.deltaY*i);let f=r.dragLook;if(f?.dragging&&(f.deltaX!==0||f.deltaY!==0)){let e=(c?1:-1)*(u===`follow`?-1:1);a+=e*f.deltaX*Xh,o+=e*f.deltaY*Xh}Qh(r,`lookLeft`)&&(a-=1*t),Qh(r,`lookRight`)&&(a+=1*t),Qh(r,`lookUp`)&&(o-=1*t),Qh(r,`lookDown`)&&(o+=1*t);let p=0,m=0,g=0;Qh(r,`moveLeft`)&&(p=-1),Qh(r,`moveRight`)&&(p+=1),Qh(r,`moveForward`)&&(m=1),Qh(r,`moveBackward`)&&--m,Qh(r,`moveUp`)&&(g=1),Qh(r,`moveDown`)&&--g;let v=Zh(n);p=Math.max(-1,Math.min(1,p*v)),m=Math.max(-1,Math.min(1,m*v)),g=Math.max(-1,Math.min(1,g*v));let y=[!1,!1,!1,!1,!1,!1];h.current&&=(y[0]=!0,!1),_.current&&=(y[2]=!0,!1),Kh();let b=a!==0||o!==0,x=p!==0||m!==0||g!==0,S=y.some(Boolean);!b&&!x&&!S||l({deltaYaw:a,deltaPitch:o,x:p,y:m,z:g,triggers:y,delta:t})},e[34]=d,e[35]=c,e[36]=u,e[37]=i,e[38]=l,e[39]=n,e[40]=F):F=e[40],a(F),null}function eg(){return N.subscribe(tg)}function tg(e){e.animation&&document.pointerLockElement&&document.exitPointerLock()}function ng(e){return e.gl}var rg=(0,R.lazy)(()=>Me(()=>import(`./TouchHandler-BGxxpP92.js`).then(e=>({default:e.TouchHandler})),__vite__mapDeps([7,8,2,9,3,10,11,12,13,14])));function ig(e){let t=(0,z.c)(9),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let i=(0,R.useRef)(r),[a,o]=(0,R.useState)(`local`),s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i.current.push(e)},t[1]=s):s=t[1];let c=s,l;t[2]===a?l=t[3]:(l={moveQueue:i,onInput:c,mode:a,setMode:o},t[2]=a,t[3]=l);let u;t[4]===n?u=t[5]:(u=(0,B.jsx)(Ne,{children:n}),t[4]=n,t[5]=u);let d;return t[6]!==l||t[7]!==u?(d=(0,B.jsx)(yh.Provider,{value:l,children:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8],d}function ag(){let e=(0,z.c)(5),t=g(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,B.jsx)($h,{}),e[0]=n):n=e[0];let r;e[1]===t?r=e[2]:(r=t?(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(rg,{})}):null,e[1]=t,e[2]=r);let i;return e[3]===r?i=e[4]:(i=(0,B.jsxs)(B.Fragment,{children:[n,r]}),e[3]=r,e[4]=i),i}var og=(0,R.lazy)(()=>Me(()=>import(`./TouchJoystick-DYqKShVz.js`).then(e=>({default:e.TouchJoystick})),__vite__mapDeps([15,2,16,11,9,12,13,14,17]))),sg=(0,R.lazy)(()=>Me(()=>import(`./KeyboardOverlay-Du-YZ_-q.js`).then(e=>({default:e.KeyboardOverlay})),__vite__mapDeps([18,2,11,9,12,13,19,20,21,10,22])));function cg(){let e=(0,z.c)(9),t=g(),n=te(lg),{showInputOverlay:r}=c(),i;e[0]!==t||e[1]!==n?(i=t&&!n?(0,B.jsx)(og,{}):null,e[0]=t,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==t||e[4]!==r?(a=t===!1&&r?(0,B.jsx)(sg,{}):null,e[3]=t,e[4]=r,e[5]=a):a=e[5];let o;return e[6]!==i||e[7]!==a?(o=(0,B.jsxs)(R.Suspense,{children:[i,a]}),e[6]=i,e[7]=a,e[8]=o):o=e[8],o}function lg(e){return e.animation!==null}var ug={LoadingIndicator:`_LoadingIndicator_8ijel_1`,loadingComplete:`_loadingComplete_8ijel_1`,Spinner:`_Spinner_8ijel_19`,spin:`_spin_8ijel_1`,Progress:`_Progress_8ijel_28`,ProgressBar:`_ProgressBar_8ijel_36`,ProgressText:`_ProgressText_8ijel_43`};function dg(e){let t=(0,z.c)(12),{isLoading:n,progress:r}=e,i=r===void 0?null:r,a=(i??0)*100,o=!n,s=i==null,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,B.jsx)(`div`,{className:ug.Spinner}),t[0]=c):c=t[0];let l=`${a}%`,u;t[1]===l?u=t[2]:(u=(0,B.jsx)(`div`,{className:ug.Progress,children:(0,B.jsx)(`div`,{className:ug.ProgressBar,style:{width:l}})}),t[1]=l,t[2]=u);let d;t[3]===a?d=t[4]:(d=Math.round(a),t[3]=a,t[4]=d);let f;t[5]===d?f=t[6]:(f=(0,B.jsxs)(`div`,{className:ug.ProgressText,children:[d,`%`]}),t[5]=d,t[6]=f);let p;return t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==f?(p=(0,B.jsxs)(`div`,{className:ug.LoadingIndicator,"data-complete":o,"data-indeterminate":s,children:[c,u,f]}),t[7]=o,t[8]=s,t[9]=u,t[10]=f,t[11]=p):p=t[11],p}var fg={Dialog:`_Dialog_1t9wa_1`,Overlay:`_Overlay_1t9wa_22`,DialogButton:`_DialogButton_1t9wa_33`,Secondary:`_Secondary_1t9wa_72 _DialogButton_1t9wa_33`,Actions:`_Actions_1t9wa_86`};function pg(e){let t=(0,z.c)(5),{onClose:n}=e,r;t[0]===n?r=t[1]:(r=e=>{n?.()},t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,B.jsx)(`div`,{className:fg.Dialog,children:(0,B.jsx)(dg,{isLoading:!0})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,B.jsx)(`div`,{className:fg.Overlay,onClick:r,children:i}),t[3]=r,t[4]=a),a}var mg={Button:`_Button_n870r_1`};function hg(e){let t=(0,z.c)(9),{isOpen:n,orientation:r,onClick:i}=e,a=n?`Close sidebar`:`Open sidebar`,o=n?`Close sidebar`:`Open sidebar`,s;t[0]!==n||t[1]!==r?(s=r===`top`?n?(0,B.jsx)(ba,{}):(0,B.jsx)(ya,{}):n?(0,B.jsx)(Sa,{}):(0,B.jsx)(xa,{}),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c;return t[3]!==i||t[4]!==r||t[5]!==a||t[6]!==o||t[7]!==s?(c=(0,B.jsx)(`button`,{type:`button`,className:mg.Button,"data-orientation":r,"aria-label":a,title:o,onClick:i,children:s}),t[3]=i,t[4]=r,t[5]=a,t[6]=o,t[7]=s,t[8]=c):c=t[8],c}var gg={Button:`_Button_wk3rb_1 _DestructiveActionButton_p0g82_141 _Button_p0g82_2`,ButtonLabel:`_ButtonLabel_wk3rb_9 _ButtonLabel_p0g82_37`};function _g(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsxs)(`button`,{type:`button`,className:gg.Button,onClick:vg,children:[(0,B.jsx)(Wa,{}),(0,B.jsx)(`span`,{className:gg.ButtonLabel,children:`Exit tour`})]}),e[0]=t):t=e[0],t}function vg(){return N.getState().cancel()}var yg={Frame:`_Frame_1u5rk_1`,Toolbar:`_Toolbar_1u5rk_16`,Sidebar:`_Sidebar_1u5rk_29`,Content:`_Content_1u5rk_43`,ThreeView:`_ThreeView_1u5rk_52`,PlayerBar:`_PlayerBar_1u5rk_61`,Backdrop:`_Backdrop_1u5rk_71`};function bg({children:e}){return e}function xg(e,t){return(0,R.lazy)(()=>t().then(t=>({default:t[e]})))}var Sg=xg(`GameView`,()=>Me(()=>import(`./GameView-C7uJjiJd.js`),__vite__mapDeps([23,2,16,24,5,25,26,27,8,9,3,10,28,11,12,13,29,30,31,32,33,34,35,36,1,37,38,39,4,21,40,41,42]))),Cg=xg(`DemoPlaybackControls`,()=>Me(()=>import(`./DemoPlaybackControls-D--l_WXN.js`),__vite__mapDeps([43,2,19,20,9,44]))),wg=xg(`PlayerHUD`,()=>Me(()=>import(`./PlayerHUD-IFZkOeCb.js`),__vite__mapDeps([45,2,16,9,33,24,5,12,13,34,10,35,41,46]))),Tg=xg(`MapInfoDialog`,()=>Me(()=>import(`./MapInfoDialog-C3Dk90R7.js`),__vite__mapDeps([47,2,36,28,9,33,24,5,12,13,48]))),Eg=xg(`ServerBrowser`,()=>Me(()=>import(`./ServerBrowser-DxPc-p2a.js`),__vite__mapDeps([49,2,11,9,12,13,50]))),Dg=xg(`ScoreScreen`,()=>Me(()=>import(`./ScoreScreen-oQegOqLS.js`),__vite__mapDeps([51,2,9,34,10,35,13,52])));function Og(){let[e,t]=y(),n=$t(),{clearFogEnabledOverride:r,sidebarOpen:i,setSidebarOpen:a}=c(),{missionName:o,missionType:s}=e,[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)(!1),[h,_]=(0,R.useState)(!1),[v,b]=(0,R.useState)(0),[x,S]=(0,R.useState)(!0),C=g(),T=te(e=>e.animation!==null),E=(0,R.useCallback)(e=>{window.location.hash=``,r(),_(!1),N.getState().cancel(),fr.getState().disconnectServer(),je.getState().setRecording(null),Fn.getState().endStreaming(),t(e),C&&a(!1)},[r,t,C,a]);mh({onChangeMission:E});let D=_r(),O=Jn(),k=O===`demo`||O===`live`,A=Xn(),j=Qn();(0,R.useEffect)(()=>{if(!(!k||!A))try{let e=w(A);t({missionName:A,missionType:j&&e.missionTypes.includes(j)?j:void 0})}catch{t(null)}},[k,A,j,t]),(0,R.useEffect)(()=>{D&&_(!1)},[D]);let M=pr(e=>e.gameStatus);(0,R.useEffect)(()=>{M===`connected`&&C&&a(!1)},[M,C,a]),(0,R.useEffect)(()=>{D&&C&&a(!1)},[C,D,a]),(0,R.useEffect)(()=>{T&&C&&a(!1)},[C,T,a]),(0,R.useEffect)(()=>{let e=e=>{e.code===`Backslash`&&(e.metaKey||e.ctrlKey)&&(e.stopPropagation(),e.preventDefault(),a(e=>!e))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]);let ee=v,P=ee<1;(0,R.useEffect)(()=>{if(P)S(!0);else{let e=setTimeout(()=>S(!1),500);return()=>clearTimeout(e)}},[P]);let ne=(0,R.useCallback)((e,t=0)=>{b(t)},[]),re=(0,R.useRef)(null),F=(0,R.useRef)(null),ie=(0,R.useCallback)(()=>u(!0),[]),ae=(0,R.useCallback)(()=>m(!0),[]),I=(0,R.useCallback)(()=>{f(!0)},[]),oe=(0,R.useCallback)(()=>_(!0),[]),L=(0,R.useCallback)(()=>{_(!1)},[]),se=(0,R.useCallback)(e=>{re.current=e.camera,F.current=e.invalidate},[]);return(0,B.jsx)(`main`,{className:yg.Frame,children:(0,B.jsxs)(gr,{children:[(0,B.jsxs)(`header`,{className:yg.Toolbar,children:[(0,B.jsx)(hg,{orientation:`top`,isOpen:i,onClick:()=>{a(e=>!e)}}),(0,B.jsx)(hg,{orientation:`left`,isOpen:i,onClick:()=>{a(e=>!e)}}),(0,B.jsx)(R.Activity,{mode:k&&!h?`visible`:`hidden`,children:(0,B.jsx)(uh,{})}),(0,B.jsx)(R.Activity,{mode:!k||h?`visible`:`hidden`,children:(0,B.jsx)(ah,{value:h?``:o,missionType:h?``:s??``,onChange:E,autoFocus:h,onCancel:L})}),T&&(0,B.jsx)(_g,{})]}),i?(0,B.jsx)(`div`,{className:yg.Backdrop}):null,(0,B.jsx)(R.Activity,{mode:i?`visible`:`hidden`,children:(0,B.jsx)(`div`,{className:yg.Sidebar,"data-open":i,children:(0,B.jsx)(ro,{missionName:o,missionType:s,choosingMap:h,cameraRef:re,invalidateRef:F,onOpenMapInfo:ie,onOpenScoreScreen:k?ae:void 0,onOpenServerBrowser:n.live?I:void 0,onChooseMap:oe,onCancelChoosingMap:L,onClose:()=>{a(!1)}})})}),(0,B.jsx)(ig,{children:(0,B.jsxs)(`div`,{className:yg.Content,children:[(0,B.jsx)(`div`,{className:yg.ThreeView,children:(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(Sg,{missionName:o,missionType:s,dpr:l||d||p?.25:void 0,onCreated:se,onLoadingChange:ne})})}),k&&!p?(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(wg,{})}):null,(0,B.jsx)(cg,{}),x&&(0,B.jsx)(dg,{isLoading:P,progress:ee})]})}),(0,B.jsx)(`footer`,{className:yg.PlayerBar,children:D?.source===`demo`?(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(Cg,{})}):null}),l?(0,B.jsx)(bg,{children:(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(pg,{onClose:()=>u(!1)}),children:(0,B.jsx)(Tg,{onClose:()=>u(!1),missionName:o,missionType:s??``})})}):null,d?(0,B.jsx)(bg,{children:(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(pg,{onClose:()=>f(!1)}),children:(0,B.jsx)(Eg,{onClose:()=>f(!1)})})}):null,p?(0,B.jsx)(bg,{children:(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(pg,{onClose:()=>m(!1)}),children:(0,B.jsx)(Dg,{onClose:()=>m(!1)})})}):null]})})}var kg=new Jt;function Ag(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(R.Suspense,{children:(0,B.jsx)(qe,{children:(0,B.jsx)(en,{children:(0,B.jsx)(Zt,{client:kg,children:(0,B.jsx)(h,{children:(0,B.jsx)(Og,{})})})})})}),e[0]=t):t=e[0],t}(0,Re.createRoot)(document.getElementById(`root`)).render((0,B.jsx)(R.StrictMode,{children:(0,B.jsx)(Ag,{})}));export{Tt as $,pr as A,yn as B,xr as C,_r as D,Dr as E,Kn as F,cn as G,fn as H,qn as I,an as J,sn as K,Mn as L,Hn as M,Jn as N,Tr as O,Un as P,Et as Q,An as R,hr as S,yr as T,un as U,pn as V,ln as W,Lt as X,Xt as Y,kt as Z,_h as _,Dh as a,pt as at,ha as b,Ih as c,Ze as ct,Uh as d,Le as dt,nt as et,Wh as f,vh as g,xh as h,jh as i,it,Fn as j,fr as k,Th as l,Ye as lt,Sh as m,kh as n,vt as nt,Nh as o,Ct as ot,bh as p,on as q,Mh as r,at as rt,Eh as s,rt as st,ag as t,et as tt,qh as u,Je as ut,Wm as v,Cr as w,ma as x,va as y,On as z}; \ No newline at end of file diff --git a/docs/assets/index-DvT5LFSb.css b/docs/assets/index-DvT5LFSb.css deleted file mode 100644 index bae0a15f..00000000 --- a/docs/assets/index-DvT5LFSb.css +++ /dev/null @@ -1 +0,0 @@ -@layer button{@media (hover:hover){._Button_1u47f_2{background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_1u47f_2:not(:disabled):hover{background:#0062b3cc;border-color:#fff6}._Button_1u47f_2 svg{opacity:.6}._Button_1u47f_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_1u47f_135:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_1u47f_135{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}@media (hover:hover){._Button_1u47f_2{background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_1u47f_2:not(:disabled):hover{background:#0062b3cc;border-color:#fff6}._Button_1u47f_2 svg{opacity:.6}._Button_1u47f_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_1u47f_135:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_1u47f_135{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}@media (hover:hover){._Button_1u47f_2{background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_1u47f_2:not(:disabled):hover{background:#0062b3cc;border-color:#fff6}._Button_1u47f_2 svg{opacity:.6}._Button_1u47f_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_1u47f_135:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_1u47f_135{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}@media (hover:hover){._Button_1u47f_2{background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_1u47f_2:not(:disabled):hover{background:#0062b3cc;border-color:#fff6}._Button_1u47f_2 svg{opacity:.6}._Button_1u47f_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_1u47f_135:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_1u47f_135{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}@media (hover:hover){._Button_1u47f_2{background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_1u47f_2:not(:disabled):hover{background:#0062b3cc;border-color:#fff6}._Button_1u47f_2 svg{opacity:.6}._Button_1u47f_2:not(:disabled):hover svg{opacity:1}}@media (hover:hover){._DestructiveActionButton_1u47f_135:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_1u47f_135{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}._Button_1u47f_2{color:#fff;cursor:pointer;background:#0062b3cc;border:1px solid #fff6;border-radius:5px;flex:auto;justify-content:center;align-items:center;gap:8px;width:auto;min-width:28px;height:auto;min-height:32px;margin:0;padding:4px 8px;font-family:inherit;font-size:18px;font-weight:500;transition:background .2s,border-color .2s;display:flex;position:relative;transform:translate(0);box-shadow:0 1px 2px #0006}._Button_1u47f_2 svg{opacity:.8;pointer-events:none;flex:none;transition:opacity .2s}._Button_1u47f_2:disabled{opacity:.6;color:#fffc;cursor:default;box-shadow:inset 0 0 12px 1px #36363680}@media (hover:hover){._Button_1u47f_2{background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d}._Button_1u47f_2:not(:disabled):hover{background:#0062b3cc;border-color:#fff6}._Button_1u47f_2 svg{opacity:.6}._Button_1u47f_2:not(:disabled):hover svg{opacity:1}}._Button_1u47f_2:not(:disabled):active,._Button_1u47f_2[aria-expanded=true]{background:#0062b3b3;border-color:#ffffff4d;transform:translateY(1px)}._Button_1u47f_2[data-active=true]{background:#0075d5e6;border-color:#fff6}._ButtonLabel_1u47f_82{font-size:14px}._ButtonHint_1u47f_86{opacity:.7;font-size:10px}._ButtonGroup_1u47f_91{flex:1 0 auto;align-items:stretch;width:100%;display:flex}._ButtonGroup_1u47f_91 ._Button_1u47f_2{background:#1b4f87b3;flex-direction:column;flex:1 0 0;gap:1px;padding-top:8px;padding-bottom:8px;font-size:22px;box-shadow:inset 0 0 10px #04284780}._ButtonGroup_1u47f_91 ._Button_1u47f_2 svg{margin-bottom:3px}._ButtonGroup_1u47f_91 ._Button_1u47f_2[data-active=true]{background:#0065cbcc;box-shadow:inset 0 2px 3px #08bdff80,inset 0 -2px 6px #00122880}._ButtonGroup_1u47f_91 ._Button_1u47f_2[data-active=true] svg{opacity:1}._ButtonGroup_1u47f_91 ._Button_1u47f_2:not(:first-child){border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}._ButtonGroup_1u47f_91 ._Button_1u47f_2:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}._DestructiveActionButton_1u47f_135{background:#d5423ab3;flex:none;min-width:28px;min-height:28px;margin:0 10px 0 0;padding:2px;font-size:16px}@media (hover:hover){._DestructiveActionButton_1u47f_135:not(:disabled):hover{background:#e5463be6}}@media (pointer:coarse){._DestructiveActionButton_1u47f_135{min-width:36px;min-height:36px;margin-right:6px;font-size:20px}}}:root{--monospace-font:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace}html{box-sizing:border-box;background:#000;margin:0;padding:0;overflow:hidden}*,:before,:after{box-sizing:inherit}body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:100%}body{margin:0;padding:0;overflow:hidden}._Button_1xmvi_1[data-copied=true]{background:#0075d5e6;border-color:#fff6}._ClipboardIcon_1xmvi_10{opacity:1;display:none}._Button_1xmvi_1[data-copied=true] ._ClipboardIcon_1xmvi_10{animation:.22s linear infinite _showClipboardCheck_1xmvi_1;display:block}._Button_1xmvi_1[data-copied=true] ._PinIcon_1xmvi_20{display:none}@keyframes _showClipboardCheck_1xmvi_1{0%{opacity:1}to{opacity:.2}}._JoinServerButton_cz8os_1[data-connected=true] ._Icon_cz8os_5{animation:1.2s ease-out infinite _blink_cz8os_1}@keyframes _blink_cz8os_1{0%{opacity:1}to{opacity:.25}}._AccordionGroup_1ysdj_1{flex-direction:column;gap:1px;display:flex}._Trigger_1ysdj_7{color:#fff;text-align:left;text-transform:uppercase;letter-spacing:.0417em;background:#ffffff1a;border:0;align-items:center;gap:4px;width:100%;padding:6px 8px;font-family:inherit;font-size:12px;font-weight:400;display:flex}._TriggerIcon_1ysdj_24{opacity:.5;font-size:12px;transition:transform .2s;transform:rotate(0)}._Trigger_1ysdj_7[data-state=open] ._TriggerIcon_1ysdj_24{transform:rotate(90deg)}._Content_1ysdj_35{overflow:hidden}._Content_1ysdj_35[data-state=open]{animation:.3s _slideDown_1ysdj_1}._Content_1ysdj_35[data-state=closed]{animation:.3s _slideUp_1ysdj_1}._Body_1ysdj_47{padding:16px 12px 10px}@keyframes _slideDown_1ysdj_1{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes _slideUp_1ysdj_1{0%{height:var(--radix-accordion-content-height)}to{height:0}}@media (pointer:coarse){._Trigger_1ysdj_7{padding-top:12px;padding-bottom:12px}}._Root_cfjcw_1{flex-direction:column;display:flex}._ProgressWrap_cfjcw_6{flex-direction:column;gap:4px;padding:12px 10px;display:flex}._ProgressLabel_cfjcw_13{opacity:.7;text-align:center;font-size:11px}._ProgressBar_cfjcw_19{background:#ffffff1a;border-radius:2px;width:100%;height:4px;overflow:hidden}._ProgressFill_cfjcw_27{background:#0a84ffcc;height:100%;transition:width .15s}._Filters_cfjcw_33{flex-wrap:wrap;gap:4px;padding:10px;display:flex}._FilterButton_cfjcw_40{color:#ffffffb3;cursor:pointer;background:#ffffff0d;border:1px solid #fff3;border-radius:3px;padding:2px 8px;font-family:inherit;font-size:11px}._FilterButton_cfjcw_40[data-active=true]{color:#fff;background:#0062b399;border-color:#64b4ff80}._EventList_cfjcw_57{flex-direction:column;padding:2px 0 12px;display:flex}._EventRow_cfjcw_63{color:#fffc;text-align:left;cursor:pointer;white-space:nowrap;background:0 0;border:0;align-items:center;gap:8px;padding:3px 10px 3px 8px;font-family:inherit;font-size:13px;display:flex}@media (hover:hover){._EventRow_cfjcw_63:hover{background:#ffffff1a}._FilterButton_cfjcw_40:hover{background:#ffffff1a;border-color:#ffffff4d}._FilterButton_cfjcw_40[data-active=true]:hover{background:#0062b3cc;border-color:#64b4ffb3}}._EventRow_cfjcw_63:active{color:#fff;background:#0055b1cc}@media (pointer:coarse){._FilterButton_cfjcw_40{flex:1 0 auto;padding:4px 8px;font-size:13px}._EventList_cfjcw_57{gap:2px}._EventRow_cfjcw_63{padding-top:5px;padding-bottom:5px;font-size:14px}}._EventTime_cfjcw_120{font-variant-numeric:tabular-nums;opacity:.6;text-align:right;flex-shrink:0;min-width:3.5em;font-size:11px}._EventIcon_cfjcw_129{flex-shrink:0;align-items:center;margin:0 1px;font-size:13px;display:flex}._EventIcon_cfjcw_129[data-type=kill],._EventIcon_cfjcw_129[data-type=death]{color:#8a8380}._EventIcon_cfjcw_129[data-type=flag-cap]{color:#69db7c;margin:0;font-size:15px}._EventIcon_cfjcw_129[data-type=flag-grab],._EventIcon_cfjcw_129[data-type=flag-return]{margin:0;font-size:15px}._EventIcon_cfjcw_129[data-type=flag-cap][data-affinity=enemy]{color:#ff6b6b}._EventIcon_cfjcw_129[data-type=flag-cap][data-affinity=neutral]{color:#adb5bd}._EventIcon_cfjcw_129[data-type=match-start]{color:#74c0fc;margin:0;font-size:15px}._EventIcon_cfjcw_129[data-type=match-end]{color:#74c0fc}._EventDescription_cfjcw_172{text-overflow:ellipsis;overflow:hidden}._Empty_cfjcw_186{opacity:.5;text-align:center;padding:4px 10px 12px;font-size:12px}._Root_pb9qa_1{flex-direction:column;display:flex}._Empty_pb9qa_6{opacity:.5;text-align:center;padding:4px 10px 12px;font-size:12px}._TourAllButton_pb9qa_13{color:#fffc;cursor:pointer;background:0 0;border:0;justify-content:flex-start;align-self:flex-start;align-items:center;gap:6px;padding:10px 14px;font-family:inherit;font-size:14px;font-weight:500;display:flex}@media (hover:hover){._TourAllButton_pb9qa_13:hover{color:#fff}}._CategoryHeader_pb9qa_40{color:#fff9;text-transform:uppercase;letter-spacing:.04em;-webkit-user-select:none;user-select:none;align-items:baseline;gap:6px;padding:4px 4px 4px 14px;font-size:12px;font-weight:600;display:flex}._CategoryHeader_pb9qa_40:not(:first-child){border-top:1px solid #ffffff0f;padding-top:8px}._CategoryCount_pb9qa_58{opacity:.7;font-weight:400}._TourButton_pb9qa_63{color:#fffc;cursor:pointer;text-transform:none;background:0 0;border:0;border-radius:0;align-items:center;gap:5px;margin:0 0 0 auto;padding:6px 8px;font-family:inherit;font-size:12px;font-weight:500;display:flex}._PlayIcon_pb9qa_83{color:#74c0fc}._ExitIcon_pb9qa_87{color:#ff8363}@media (hover:hover){._TourButton_pb9qa_63:hover{color:#fff}}._ItemList_pb9qa_100{flex-direction:column;padding:0 0 8px;display:flex}._ItemRow_pb9qa_106{color:#fffc;text-align:left;cursor:pointer;white-space:nowrap;background:0 0;border:0;align-items:center;gap:4px;padding:4px 10px 4px 12px;font-family:inherit;font-size:13px;display:flex}._ItemRow_pb9qa_106 ._PlayIcon_pb9qa_83{font-size:12px}@media (hover:hover){._ItemRow_pb9qa_106:not(:hover) ._PlayIcon_pb9qa_83{visibility:hidden}}._ItemRow_pb9qa_106[data-active=true]{color:#fff;background:#0055b180}@media (hover:hover){._ItemRow_pb9qa_106:hover{background:#ffffff1a}._ItemRow_pb9qa_106[data-active=true]:hover{background:#0055b199}}._ItemRow_pb9qa_106:active{color:#fff;background:#0055b1cc}._ItemLabel_pb9qa_151{text-overflow:ellipsis;overflow:hidden}._TeamBadge_pb9qa_156{color:#fff;border-radius:2px;flex-shrink:0;margin:0 0 0 6px;padding:0 4px;font-size:11px;line-height:1.5}._TeamBadge_pb9qa_156[data-team="1"]{background:#086c8acc}._TeamBadge_pb9qa_156[data-team="2"]{background:#8f5e14cc}@media (pointer:coarse){._CategoryHeader_pb9qa_40{padding:6px 8px 6px 16px;font-size:13px}._TourButton_pb9qa_63{font-size:13px}._ItemRow_pb9qa_106{padding-top:6px;padding-bottom:6px;padding-left:14px;font-size:14px}}._InspectorControls_cm86c_1{z-index:2;font-size:13px;line-height:1.231;position:relative}._Dropdown_cm86c_8{flex-direction:column;justify-content:center;align-items:stretch;gap:0;display:flex}._Group_cm86c_16{flex-wrap:wrap;justify-content:center;align-items:center;gap:20px;display:flex}._CheckboxField_cm86c_24{grid-template-rows:auto auto;grid-template-columns:auto 1fr;align-items:center;gap:0 6px;margin:0 0 8px;display:grid}._CheckboxField_cm86c_24 input[type=checkbox]{grid-area:1/1;margin-left:0}._CheckboxField_cm86c_24 ._Label_cm86c_39{grid-area:1/2;align-items:center;gap:6px;display:flex}._Description_cm86c_47{opacity:.6;margin:2px 0 0;padding:0;font-size:12px;line-height:1.5}._CheckboxField_cm86c_24 ._Description_cm86c_47{grid-area:2/2}._Control_cm86c_60{justify-content:flex-end;align-items:center;gap:8px;display:flex}._Field_cm86c_67{grid-template-rows:auto auto;grid-template-columns:1fr auto;align-items:center;margin:0 0 12px;display:grid}._Field_cm86c_67:has(._Description_cm86c_47){margin:0 0 10px}._Field_cm86c_67 select{margin-bottom:6px}._Field_cm86c_67 input[type=range]{max-width:100px}._Field_cm86c_67 output{opacity:.7}._Tools_cm86c_91{flex-wrap:wrap;align-items:center;gap:8px;padding:10px;display:flex}._Field_cm86c_67 label{grid-area:1/1}._Field_cm86c_67 ._Control_cm86c_60{grid-area:1/2}._Field_cm86c_67 ._Description_cm86c_47{grid-area:2/1/auto/-1}._ForceRenderButton_cm86c_119{color:#4cb5ff;cursor:pointer;background:0 0;border:0;place-content:center;margin:0;padding:0 2px;font-size:16px;display:grid}._CloseSidebarButton_cm86c_131{margin:12px;padding-top:8px;padding-bottom:8px}@media (width>=900px){._CloseSidebarButton_cm86c_131{display:none}}@media (pointer:coarse){._Tools_cm86c_91{padding-top:12px;padding-bottom:13px}._Field_cm86c_67{grid-template-columns:auto minmax(0,70%);gap:0 20px;margin-bottom:20px}._CheckboxField_cm86c_24{margin-bottom:16px}._Description_cm86c_47{font-size:13px;line-height:1.53846}._Field_cm86c_67 label,._CheckboxField_cm86c_24 ._Label_cm86c_39{font-size:15px}._CheckboxField_cm86c_24 input[type=checkbox]{min-width:19px;min-height:19px;padding-right:6px}._Field_cm86c_67 select{width:100%;max-width:none;padding:4px 6px;font-size:15px}._Field_cm86c_67 input[type=range]{width:100%;max-width:none;padding-top:10px;padding-bottom:10px}}@media (width<=499px){._PopoverWrapper_1p1ez_97{width:auto!important;max-width:none!important;left:8px!important;right:8px!important;transform:translateY(44px)!important}._Popover_1p1ez_83{min-width:0}}@media (pointer:fine){._CloseButton_1p1ez_215{visibility:hidden}}@media (width<=899px){._InputWrapper_1p1ez_1{flex:1 1 0;max-width:460px;margin-left:4px}._Input_1p1ez_1{width:100%}}._InputWrapper_1p1ez_1{z-index:2;align-items:center;margin:10px 10px 10px 8px;display:flex;position:relative}._Shortcut_1p1ez_9{color:#fff9;pointer-events:none;background:#ffffff26;border-radius:3px;padding:1px 4px;font-family:system-ui,sans-serif;font-size:11px;position:absolute;right:7px}._Input_1p1ez_1[aria-expanded=true]~._Shortcut_1p1ez_9{display:none}._Input_1p1ez_1{color:#fff;-webkit-user-select:text;user-select:text;background:#0009;border:1px solid #ffffff4d;border-radius:3px;outline:none;width:280px;padding:6px 36px 6px 8px;font-size:14px}._Input_1p1ez_1[aria-expanded=true]{padding-right:8px}._Input_1p1ez_1:focus{border-color:#fff9}._Input_1p1ez_1::placeholder{color:#777;font-family:inherit;font-size:12px}._SelectedValue_1p1ez_52{pointer-events:none;align-items:center;gap:6px;display:flex;position:absolute;left:8px;right:36px;overflow:hidden}._Input_1p1ez_1[aria-expanded=true]~._SelectedValue_1p1ez_52{display:none}._SelectedName_1p1ez_67{color:#fff;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:600;line-height:1.28571;overflow:hidden}._SelectedValue_1p1ez_52>._ItemType_1p1ez_79{flex-shrink:0}._Popover_1p1ez_83{z-index:100;min-width:360px;max-height:var(--popover-available-height,90vh);overscroll-behavior:contain;background:#141414f2;border:1px solid #ffffff80;border-radius:3px;overflow:hidden auto;box-shadow:0 8px 24px #0009}@media (width<=499px){._PopoverWrapper_1p1ez_97{width:auto!important;max-width:none!important;left:8px!important;right:8px!important;transform:translateY(44px)!important}._Popover_1p1ez_83{min-width:0}}._List_1p1ez_110{padding:4px 0}._List_1p1ez_110:has(>._Group_1p1ez_114:first-child){padding-top:0}._Group_1p1ez_114{padding-bottom:4px}._GroupLabel_1p1ez_122{color:#c6caca;z-index:1;background:#3a4548f2;border-bottom:1px solid #ffffff4d;padding:6px 8px 6px 12px;font-size:13px;font-weight:600;position:sticky;top:0}._Group_1p1ez_114:not(:last-child){border-bottom:1px solid #ffffff4d}._Item_1p1ez_79{cursor:pointer;border-radius:4px;outline:none;flex-direction:column;gap:1px;margin:4px 4px 0;padding:6px 8px;scroll-margin-top:32px;display:flex}._List_1p1ez_110>._Item_1p1ez_79:first-child{margin-top:0}._Item_1p1ez_79[data-active-item]{background:#ffffff26}._Item_1p1ez_79[aria-selected=true]{background:#6496ff4d}._ItemHeader_1p1ez_162{align-items:center;gap:6px;display:flex}._ItemName_1p1ez_168{color:#fff;font-size:14px;font-weight:600}._ItemTypes_1p1ez_174{gap:3px;display:flex}._ItemType_1p1ez_79{color:#fff;background:#ff9d0066;border-radius:3px;padding:2px 5px;font-size:10px;font-weight:600;line-height:1.3}._ItemType_1p1ez_79:hover{background:#ff9d00b3}._ItemMissionName_1p1ez_193{color:#ffffff80;font-size:12px}._NoResults_1p1ez_198{color:#ffffff80;text-align:center;padding:12px 8px;font-size:13px}._Backdrop_1p1ez_205{z-index:1;background:#00000080;position:fixed;inset:0}._CloseButton_1p1ez_215{z-index:101;color:#ffffff80;background:0 0;border:0;place-content:center;margin:0 0 0 -8px;padding:6px;font-size:24px;display:grid;position:relative}@media (pointer:fine){._CloseButton_1p1ez_215{visibility:hidden}}._CloseButton_1p1ez_215[data-open=false]{visibility:hidden}@media (width<=899px){._InputWrapper_1p1ez_1{flex:1 1 0;max-width:460px;margin-left:4px}._Input_1p1ez_1{width:100%}}._Header_klnnn_1{flex:auto;justify-content:flex-start;align-items:center;gap:12px;display:flex}._MissionInfo_klnnn_9{color:#fff;background:0 0;border:1px solid #fff0;border-radius:3px;align-items:center;gap:6px;margin:10px auto 10px 4px;padding:5px 8px;display:flex}._MissionType_klnnn_25{pointer-events:none}._MissionTypeDisplayName_klnnn_30{opacity:.5;font-size:12px}._Metadata_klnnn_35{text-align:right;flex-direction:column;gap:2px;margin-left:4px;padding:8px 0;font-size:12px;line-height:1.16667;display:flex}._Attribution_klnnn_46,._ServerInfo_klnnn_47{color:#83938b}._PlayerName_klnnn_51,._RecordingDate_klnnn_52,._ServerName_klnnn_53{color:#eceae7}._EjectIcon_klnnn_62{margin-top:-.5px;font-size:21px}._Error_klnnn_67{color:#ff6a45}@media (width<=899px){._Metadata_klnnn_35{display:none}._MissionInfo_klnnn_9{margin-left:0}}._Pulsing_klnnn_81{animation:1.2s ease-out infinite _blink_klnnn_1}._ConnectionPing_klnnn_85{background:#ffffff1a;border-radius:12px;align-items:center;gap:6px;padding:5px 8px;font-size:12px;display:inline-flex}._PingDot_klnnn_95{background:currentColor;border-radius:3px;width:6px;height:6px;display:inline-block}._ConnectionPing_klnnn_85[data-quality=good] ._PingDot_klnnn_95{color:#74ff45}._ConnectionPing_klnnn_85[data-quality=fine] ._PingDot_klnnn_95{color:#ff9e2f}._ConnectionPing_klnnn_85[data-quality=poor] ._PingDot_klnnn_95{color:#e83f25}@keyframes _blink_klnnn_1{0%{opacity:1}to{opacity:.25}}._LoadingIndicator_8ijel_1{pointer-events:none;z-index:1;opacity:.8;flex-direction:column;align-items:center;gap:16px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._LoadingIndicator_8ijel_1[data-complete=true]{animation:.3s ease-out forwards _loadingComplete_8ijel_1}._Spinner_8ijel_19{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite _spin_8ijel_1}._Progress_8ijel_28{background:#fff3;border-radius:2px;width:200px;height:4px;overflow:hidden}._ProgressBar_8ijel_36{background:#fff;border-radius:2px;height:100%;transition:width .1s ease-out}._ProgressText_8ijel_43{color:#ffffffb3;font-variant-numeric:tabular-nums;font-size:14px}._LoadingIndicator_8ijel_1[data-indeterminate=true] ._Progress_8ijel_28,._LoadingIndicator_8ijel_1[data-indeterminate=true] ._ProgressText_8ijel_43{display:none}@keyframes _spin_8ijel_1{to{transform:rotate(360deg)}}@keyframes _loadingComplete_8ijel_1{0%{opacity:1}to{opacity:0}}._Dialog_1t9wa_1{color:#b0d5c9;-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;background:#142526cc;border:1px solid #41838b99;border-radius:4px;outline:none;min-width:120px;max-width:calc(100dvw - 40px);min-height:120px;max-height:calc(100dvh - 40px);font-size:14px;line-height:1.5;position:relative;overflow:hidden;box-shadow:0 0 50px #0006,inset 0 0 60px #01070d99}._Overlay_1t9wa_22{z-index:10;background:#000000b3;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}._DialogButton_1t9wa_33{color:#99fff1;text-shadow:0 -1px 1px #0006;cursor:pointer;background:linear-gradient(#30a497cc,#1f9688cc 33%,#218377cc 67%,#046564cc);border:1px solid #387c74cc;border-top-color:#57b7b9cc;border-radius:4px;padding:4px 18px;font-family:inherit;font-size:14px;font-weight:500;box-shadow:inset 0 0 4px #02808e80}._DialogButton_1t9wa_33:hover:not(:disabled){color:#b1fff5;border:1px solid #409188e6;border-top-color:#5ac6c2e6;box-shadow:inset 0 0 4px #02808e80,0 0 5px #3effbf80}._DialogButton_1t9wa_33:active:not(:disabled){transform:translateY(1px)}._DialogButton_1t9wa_33:disabled{opacity:.4;cursor:not-allowed}._Secondary_1t9wa_72{box-shadow:none;color:#a2e2cfcc;text-shadow:none;background:0 0;border:1px solid #387c74cc}._Secondary_1t9wa_72:hover:not(:disabled){color:#a9ffe5cc;border:1px solid #3f9087e6}._Actions_1t9wa_86{align-items:center;gap:10px;display:flex}@media (width<=719px){._Dialog_1t9wa_1{border-radius:0;max-width:calc(100dvw - 20px);max-height:calc(100dvh - 20px)}}@media (width<=639px){._Overlay_1t9wa_22{padding:10px}}._Button_sprpv_1{color:#fff;cursor:pointer;opacity:.6;background:0 0;border:0;border-radius:4px;flex:none;place-content:center;min-width:30px;min-height:30px;margin:0 0 0 8px;padding:2px;font-size:24px;display:grid}._Button_sprpv_1:active,._Button_sprpv_1[data-active=true]{opacity:1;transform:translateY(1px)}._Button_sprpv_1[data-orientation=top]{min-width:48px;min-height:48px;margin:0;display:none}@media (hover:hover){._Button_sprpv_1:not(:disabled):hover{opacity:1}}._Button_sprpv_1 svg{pointer-events:none}@media (width<=899px){._Button_sprpv_1[data-orientation=left]{display:none}._Button_sprpv_1[data-orientation=top]{display:grid}}@media (pointer:coarse){._Button_sprpv_1{font-size:28px}}._Button_wk3rb_1{gap:6px;margin:0 10px 0 auto;padding:4px 10px 4px 6px;font-size:20px}._ButtonLabel_wk3rb_9{font-size:13px;font-weight:500}@media (width<=799px){._Button_wk3rb_1{margin:0 10px 0 0;padding-right:6px}._Button_wk3rb_1 ._ButtonLabel_wk3rb_9{display:none}}._Frame_1u5rk_1{grid-template:"sidebar toolbar""sidebar content"1fr"sidebar footer"/auto 1fr;width:100dvw;height:100dvh;display:grid;overflow:hidden}._Toolbar_1u5rk_16{color:#fff;z-index:3;view-transition-class:layout;background:#191f1f;border-bottom:1px solid #465555;grid-area:toolbar;align-items:center;display:flex;position:relative;box-shadow:0 0 3px 1px #0006}._Sidebar_1u5rk_29{color:#fff;z-index:2;background:#191f1f;border-right:1px solid #465555;grid-area:sidebar;width:320px;height:100%;min-height:0;position:relative;overflow-y:auto;box-shadow:0 0 3px 1px #0006}._Content_1u5rk_43{z-index:0;grid-area:content;min-width:0;min-height:0;position:relative;overflow:hidden}._ThreeView_1u5rk_52{z-index:0;position:absolute;inset:0}._PlayerBar_1u5rk_61{color:#fff;z-index:1;background:#191f1f;border-top:1px solid #465555;grid-area:footer;position:relative;box-shadow:0 0 3px 1px #0006}._Backdrop_1u5rk_71{display:none}@media (width<=899px){._Frame_1u5rk_1{grid-template:"toolbar""content"1fr"footer"/1fr;display:grid}._Sidebar_1u5rk_29{border:1px solid #465555;border-top:0;grid-area:content-start/content/footer-end;justify-self:center;width:auto;max-width:500px;height:calc(100% + 1px);margin:0 -1px}._Toolbar_1u5rk_16{justify-content:space-between}._Backdrop_1u5rk_71{z-index:2;background:#000000b3;display:block;position:fixed;inset:0}} diff --git a/docs/assets/useBaseQuery-NrPec9_7.js b/docs/assets/useBaseQuery-Co62zxSo.js similarity index 99% rename from docs/assets/useBaseQuery-NrPec9_7.js rename to docs/assets/useBaseQuery-Co62zxSo.js index 044830bc..2fdb49f5 100644 --- a/docs/assets/useBaseQuery-NrPec9_7.js +++ b/docs/assets/useBaseQuery-Co62zxSo.js @@ -1 +1 @@ -import{r as e}from"./chunk-DECur_0Z.js";import{r as t,t as n}from"./jsx-runtime-BpGWiA-R.js";import{$ as r,Q as i,X as a,Y as o,Z as s,at as c,ct as l,et as u,it as d,lt as f,nt as p,ot as m,rt as h,st as g,tt as _,ut as v}from"./index-B1XI52_L.js";var y=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=i(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),x(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return S(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return S(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof h(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!c(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&C(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||h(this.options.enabled,this.#t)!==h(t.enabled,this.#t)||d(this.options.staleTime,this.#t)!==d(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||h(this.options.enabled,this.#t)!==h(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(_)),t}#g(){this.#b();let e=d(this.options.staleTime,this.#t);if(r.isServer()||this.#r.isStale||!u(e))return;let t=g(this.#r.dataUpdatedAt,e)+1;this.#d=l.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(r.isServer()||h(this.options.enabled,this.#t)===!1||!u(this.#p)||this.#p===0)&&(this.#f=l.setInterval(()=>{(this.options.refetchIntervalInBackground||f.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(l.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(l.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,o=this.#r,s=this.#i,c=this.#a,l=e===n?this.#n:e.state,{state:u}=e,d={...u},f=!1,m;if(t._optimisticResults){let i=this.hasListeners(),o=!i&&x(e,t),s=i&&C(e,n,t,r);(o||s)&&(d={...d,...a(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:g,errorUpdatedAt:_,status:v}=d;m=d.data;let y=!1;if(t.placeholderData!==void 0&&m===void 0&&v===`pending`){let e;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=o.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,m=p(o?.data,e,t),f=!0)}if(t.select&&m!==void 0&&!y)if(o&&m===s?.data&&t.select===this.#c)m=this.#l;else try{this.#c=t.select,m=t.select(m),m=p(o?.data,m,t),this.#l=m,this.#s=null}catch(e){this.#s=e}this.#s&&(g=this.#s,m=this.#l,_=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,S=v===`pending`,T=v===`error`,E=S&&b,D=m!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:S,isSuccess:v===`success`,isError:T,isInitialLoading:E,isLoading:E,data:m,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:_,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:T&&!D,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:T&&D,isStale:w(e,t),refetch:this.refetch,promise:this.#o,isEnabled:h(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,r=O.status===`error`&&!t,a=e=>{r?e.reject(O.error):t&&e.resolve(O.data)},o=()=>{a(this.#o=O.promise=i())},s=this.#o;switch(s.status){case`pending`:e.queryHash===n.queryHash&&a(s);break;case`fulfilled`:(r||O.data!==s.value)&&o();break;case`rejected`:(!r||O.error!==s.reason)&&o();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!c(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){s.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function b(e,t){return h(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function x(e,t){return b(e,t)||e.state.data!==void 0&&S(e,t,t.refetchOnMount)}function S(e,t,n){if(h(t.enabled,e)!==!1&&d(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&w(e,t)}return!1}function C(e,t,n,r){return(e!==t||h(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&w(e,n)}function w(e,t){return h(t.enabled,e)!==!1&&e.isStaleByTime(d(t.staleTime,e))}function T(e,t){return!c(e.getCurrentResult(),t)}var E=e(t(),1),D=E.createContext(!1),O=()=>E.useContext(D);D.Provider,n();function k(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var A=E.createContext(k()),j=()=>E.useContext(A),M=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?m(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},N=e=>{E.useEffect(()=>{e.clearReset()},[e])},P=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||m(n,[e.error,r])),F=(e,t)=>t.state.data===void 0,I=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},L=(e,t)=>e.isLoading&&e.isFetching&&!t,R=(e,t)=>e?.suspense&&t.isPending,z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B(e,t,n){let i=O(),a=j(),c=o(n),l=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(l);let u=c.getQueryCache().get(l.queryHash);l._optimisticResults=i?`isRestoring`:`optimistic`,I(l),M(l,a,u),N(a);let d=!c.getQueryCache().get(l.queryHash),[f]=E.useState(()=>new t(c,l)),p=f.getOptimisticResult(l),m=!i&&e.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(e=>{let t=m?f.subscribe(s.batchCalls(e)):_;return f.updateResult(),t},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),E.useEffect(()=>{f.setOptions(l)},[l,f]),R(l,p))throw z(l,f,a);if(P({result:p,errorResetBoundary:a,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!r.isServer()&&L(p,i)&&(d?z(l,f,a):u?.promise)?.catch(_).finally(()=>{f.updateResult()}),l.notifyOnChangeProps?p:f.trackResult(p)}export{F as n,y as r,B as t}; \ No newline at end of file +import{r as e}from"./chunk-DECur_0Z.js";import{r as t,t as n}from"./jsx-runtime-BpGWiA-R.js";import{$ as r,Q as i,X as a,Y as o,Z as s,at as c,ct as l,et as u,it as d,lt as f,nt as p,ot as m,rt as h,st as g,tt as _,ut as v}from"./index-DfaykQpF.js";var y=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=i(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),x(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return S(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return S(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof h(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!c(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&C(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||h(this.options.enabled,this.#t)!==h(t.enabled,this.#t)||d(this.options.staleTime,this.#t)!==d(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||h(this.options.enabled,this.#t)!==h(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(_)),t}#g(){this.#b();let e=d(this.options.staleTime,this.#t);if(r.isServer()||this.#r.isStale||!u(e))return;let t=g(this.#r.dataUpdatedAt,e)+1;this.#d=l.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(r.isServer()||h(this.options.enabled,this.#t)===!1||!u(this.#p)||this.#p===0)&&(this.#f=l.setInterval(()=>{(this.options.refetchIntervalInBackground||f.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(l.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(l.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,o=this.#r,s=this.#i,c=this.#a,l=e===n?this.#n:e.state,{state:u}=e,d={...u},f=!1,m;if(t._optimisticResults){let i=this.hasListeners(),o=!i&&x(e,t),s=i&&C(e,n,t,r);(o||s)&&(d={...d,...a(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:g,errorUpdatedAt:_,status:v}=d;m=d.data;let y=!1;if(t.placeholderData!==void 0&&m===void 0&&v===`pending`){let e;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=o.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,m=p(o?.data,e,t),f=!0)}if(t.select&&m!==void 0&&!y)if(o&&m===s?.data&&t.select===this.#c)m=this.#l;else try{this.#c=t.select,m=t.select(m),m=p(o?.data,m,t),this.#l=m,this.#s=null}catch(e){this.#s=e}this.#s&&(g=this.#s,m=this.#l,_=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,S=v===`pending`,T=v===`error`,E=S&&b,D=m!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:S,isSuccess:v===`success`,isError:T,isInitialLoading:E,isLoading:E,data:m,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:_,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:T&&!D,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:T&&D,isStale:w(e,t),refetch:this.refetch,promise:this.#o,isEnabled:h(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,r=O.status===`error`&&!t,a=e=>{r?e.reject(O.error):t&&e.resolve(O.data)},o=()=>{a(this.#o=O.promise=i())},s=this.#o;switch(s.status){case`pending`:e.queryHash===n.queryHash&&a(s);break;case`fulfilled`:(r||O.data!==s.value)&&o();break;case`rejected`:(!r||O.error!==s.reason)&&o();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!c(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){s.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function b(e,t){return h(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function x(e,t){return b(e,t)||e.state.data!==void 0&&S(e,t,t.refetchOnMount)}function S(e,t,n){if(h(t.enabled,e)!==!1&&d(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&w(e,t)}return!1}function C(e,t,n,r){return(e!==t||h(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&w(e,n)}function w(e,t){return h(t.enabled,e)!==!1&&e.isStaleByTime(d(t.staleTime,e))}function T(e,t){return!c(e.getCurrentResult(),t)}var E=e(t(),1),D=E.createContext(!1),O=()=>E.useContext(D);D.Provider,n();function k(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var A=E.createContext(k()),j=()=>E.useContext(A),M=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?m(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},N=e=>{E.useEffect(()=>{e.clearReset()},[e])},P=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||m(n,[e.error,r])),F=(e,t)=>t.state.data===void 0,I=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},L=(e,t)=>e.isLoading&&e.isFetching&&!t,R=(e,t)=>e?.suspense&&t.isPending,z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B(e,t,n){let i=O(),a=j(),c=o(n),l=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(l);let u=c.getQueryCache().get(l.queryHash);l._optimisticResults=i?`isRestoring`:`optimistic`,I(l),M(l,a,u),N(a);let d=!c.getQueryCache().get(l.queryHash),[f]=E.useState(()=>new t(c,l)),p=f.getOptimisticResult(l),m=!i&&e.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(e=>{let t=m?f.subscribe(s.batchCalls(e)):_;return f.updateResult(),t},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),E.useEffect(()=>{f.setOptions(l)},[l,f]),R(l,p))throw z(l,f,a);if(P({result:p,errorResetBoundary:a,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!r.isServer()&&L(p,i)&&(d?z(l,f,a):u?.promise)?.catch(_).finally(()=>{f.updateResult()}),l.notifyOnChangeProps?p:f.trackResult(p)}export{F as n,y as r,B as t}; \ No newline at end of file diff --git a/docs/assets/useQuery-FY4YqwDi.js b/docs/assets/useQuery-FY4YqwDi.js deleted file mode 100644 index 635aa2ed..00000000 --- a/docs/assets/useQuery-FY4YqwDi.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,t}from"./useBaseQuery-NrPec9_7.js";function n(n,r){return t(n,e,r)}export{n as t}; \ No newline at end of file diff --git a/docs/assets/useQuery-lKBLxuin.js b/docs/assets/useQuery-lKBLxuin.js new file mode 100644 index 00000000..151b9f57 --- /dev/null +++ b/docs/assets/useQuery-lKBLxuin.js @@ -0,0 +1 @@ +import{r as e,t}from"./useBaseQuery-Co62zxSo.js";function n(n,r){return t(n,e,r)}export{n as t}; \ No newline at end of file diff --git a/docs/base/@vl2/Classic_maps_v1.vl2/shapes/borg11.glb b/docs/base/@vl2/Classic_maps_v1.vl2/shapes/borg11.glb index c5ae4640..ab66a38f 100644 Binary files a/docs/base/@vl2/Classic_maps_v1.vl2/shapes/borg11.glb and b/docs/base/@vl2/Classic_maps_v1.vl2/shapes/borg11.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2flag.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2flag.glb index 48debb92..8b5c4552 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2flag.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2flag.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2heavy_male.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2heavy_male.glb index 1886690d..8a2c3b4c 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2heavy_male.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2heavy_male.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2light_female.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2light_female.glb index deb0d0ec..0ce2bf6f 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2light_female.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2light_female.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2light_male.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2light_male.glb index 5e47f9ab..7b432e88 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2light_male.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2light_male.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2medium_female.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2medium_female.glb index ad11ddfa..6d874bf8 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2medium_female.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2medium_female.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2medium_male.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2medium_male.glb index 0a7f70e2..cb493709 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2medium_male.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2medium_male.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_chaingun.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_chaingun.glb index 67d389e9..0cf97cf8 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_chaingun.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_chaingun.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_disc.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_disc.glb index 836a783a..ffa7143f 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_disc.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_disc.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_grenade_launcher.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_grenade_launcher.glb index b7429dbb..2b2dfa4e 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_grenade_launcher.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_grenade_launcher.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_mortar.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_mortar.glb index 5f4300aa..dd42290e 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_mortar.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_mortar.glb differ diff --git a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_shocklance.glb b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_shocklance.glb index f895dba8..a9792ffb 100644 Binary files a/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_shocklance.glb and b/docs/base/@vl2/TR2final105-client.vl2/shapes/TR2weapon_shocklance.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/ammo_plasma.glb b/docs/base/@vl2/shapes.vl2/shapes/ammo_plasma.glb index 4f858d46..458febbd 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/ammo_plasma.glb and b/docs/base/@vl2/shapes.vl2/shapes/ammo_plasma.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/banner_honor.glb b/docs/base/@vl2/shapes.vl2/shapes/banner_honor.glb index 05cb233b..b7df4442 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/banner_honor.glb and b/docs/base/@vl2/shapes.vl2/shapes/banner_honor.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/banner_strength.glb b/docs/base/@vl2/shapes.vl2/shapes/banner_strength.glb index f56a342b..8d353f36 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/banner_strength.glb and b/docs/base/@vl2/shapes.vl2/shapes/banner_strength.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/banner_unity.glb b/docs/base/@vl2/shapes.vl2/shapes/banner_unity.glb index 4567150f..730f49b4 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/banner_unity.glb and b/docs/base/@vl2/shapes.vl2/shapes/banner_unity.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/beacon.glb b/docs/base/@vl2/shapes.vl2/shapes/beacon.glb index a9398dd3..5f78b02f 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/beacon.glb and b/docs/base/@vl2/shapes.vl2/shapes/beacon.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/bioderm_heavy.glb b/docs/base/@vl2/shapes.vl2/shapes/bioderm_heavy.glb index 130502ff..11979142 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/bioderm_heavy.glb and b/docs/base/@vl2/shapes.vl2/shapes/bioderm_heavy.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/bioderm_light.glb b/docs/base/@vl2/shapes.vl2/shapes/bioderm_light.glb index dac89303..f2b0098c 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/bioderm_light.glb and b/docs/base/@vl2/shapes.vl2/shapes/bioderm_light.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/bioderm_medium.glb b/docs/base/@vl2/shapes.vl2/shapes/bioderm_medium.glb index 9efd7f55..332a1236 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/bioderm_medium.glb and b/docs/base/@vl2/shapes.vl2/shapes/bioderm_medium.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/borg12.glb b/docs/base/@vl2/shapes.vl2/shapes/borg12.glb index 7e13f381..2456a4b0 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/borg12.glb and b/docs/base/@vl2/shapes.vl2/shapes/borg12.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/borg13.glb b/docs/base/@vl2/shapes.vl2/shapes/borg13.glb index ccc1d4a8..b5a774cd 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/borg13.glb and b/docs/base/@vl2/shapes.vl2/shapes/borg13.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/borg2.glb b/docs/base/@vl2/shapes.vl2/shapes/borg2.glb index b21a0bf4..ca8a7c87 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/borg2.glb and b/docs/base/@vl2/shapes.vl2/shapes/borg2.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/borg3.glb b/docs/base/@vl2/shapes.vl2/shapes/borg3.glb index 6a087459..9e71cc4f 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/borg3.glb and b/docs/base/@vl2/shapes.vl2/shapes/borg3.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/camera.glb b/docs/base/@vl2/shapes.vl2/shapes/camera.glb index 988ff4f2..f1049d07 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/camera.glb and b/docs/base/@vl2/shapes.vl2/shapes/camera.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/chaingun_shot.glb b/docs/base/@vl2/shapes.vl2/shapes/chaingun_shot.glb index c2eef81d..aaab4dfb 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/chaingun_shot.glb and b/docs/base/@vl2/shapes.vl2/shapes/chaingun_shot.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/deploy_ammo.glb b/docs/base/@vl2/shapes.vl2/shapes/deploy_ammo.glb index 084fd8f9..c126aa9f 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/deploy_ammo.glb and b/docs/base/@vl2/shapes.vl2/shapes/deploy_ammo.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/deploy_inventory.glb b/docs/base/@vl2/shapes.vl2/shapes/deploy_inventory.glb index e02088b0..51e1e338 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/deploy_inventory.glb and b/docs/base/@vl2/shapes.vl2/shapes/deploy_inventory.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/deploy_sensor_motion.glb b/docs/base/@vl2/shapes.vl2/shapes/deploy_sensor_motion.glb index 5af58ba0..925248f0 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/deploy_sensor_motion.glb and b/docs/base/@vl2/shapes.vl2/shapes/deploy_sensor_motion.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/deploy_sensor_pulse.glb b/docs/base/@vl2/shapes.vl2/shapes/deploy_sensor_pulse.glb index 7780dfb3..426e7e63 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/deploy_sensor_pulse.glb and b/docs/base/@vl2/shapes.vl2/shapes/deploy_sensor_pulse.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/disc.glb b/docs/base/@vl2/shapes.vl2/shapes/disc.glb index 245957f9..9cbdac35 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/disc.glb and b/docs/base/@vl2/shapes.vl2/shapes/disc.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/disc_explosion.glb b/docs/base/@vl2/shapes.vl2/shapes/disc_explosion.glb index 20ff0428..5e4ef342 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/disc_explosion.glb and b/docs/base/@vl2/shapes.vl2/shapes/disc_explosion.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/effect_plasma_explosion.glb b/docs/base/@vl2/shapes.vl2/shapes/effect_plasma_explosion.glb index 1b8e38b4..aea7d171 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/effect_plasma_explosion.glb and b/docs/base/@vl2/shapes.vl2/shapes/effect_plasma_explosion.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/energy_bolt.glb b/docs/base/@vl2/shapes.vl2/shapes/energy_bolt.glb index 52d73fcf..2a1c491f 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/energy_bolt.glb and b/docs/base/@vl2/shapes.vl2/shapes/energy_bolt.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/energy_explosion.glb b/docs/base/@vl2/shapes.vl2/shapes/energy_explosion.glb index 5ff13848..bc30dba9 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/energy_explosion.glb and b/docs/base/@vl2/shapes.vl2/shapes/energy_explosion.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/ext_flagstand.glb b/docs/base/@vl2/shapes.vl2/shapes/ext_flagstand.glb index b9446995..dd408902 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/ext_flagstand.glb and b/docs/base/@vl2/shapes.vl2/shapes/ext_flagstand.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/flag.glb b/docs/base/@vl2/shapes.vl2/shapes/flag.glb index be0ac078..ade26599 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/flag.glb and b/docs/base/@vl2/shapes.vl2/shapes/flag.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/gravemarker_1.glb b/docs/base/@vl2/shapes.vl2/shapes/gravemarker_1.glb index 79cbfe87..0fc6ec32 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/gravemarker_1.glb and b/docs/base/@vl2/shapes.vl2/shapes/gravemarker_1.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/grenade.glb b/docs/base/@vl2/shapes.vl2/shapes/grenade.glb index 59af4c27..2f822125 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/grenade.glb and b/docs/base/@vl2/shapes.vl2/shapes/grenade.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/grenade_flare.glb b/docs/base/@vl2/shapes.vl2/shapes/grenade_flare.glb index b1e899f5..ba351a9a 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/grenade_flare.glb and b/docs/base/@vl2/shapes.vl2/shapes/grenade_flare.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/grenade_flash.glb b/docs/base/@vl2/shapes.vl2/shapes/grenade_flash.glb index 0e5bfda2..2d0ca347 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/grenade_flash.glb and b/docs/base/@vl2/shapes.vl2/shapes/grenade_flash.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/grenade_projectile.glb b/docs/base/@vl2/shapes.vl2/shapes/grenade_projectile.glb index ce2e217b..6b981b82 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/grenade_projectile.glb and b/docs/base/@vl2/shapes.vl2/shapes/grenade_projectile.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/heavy_male.glb b/docs/base/@vl2/shapes.vl2/shapes/heavy_male.glb index 814c80b6..c6f35855 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/heavy_male.glb and b/docs/base/@vl2/shapes.vl2/shapes/heavy_male.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/light_female.glb b/docs/base/@vl2/shapes.vl2/shapes/light_female.glb index 7c5d5a23..7f3caf6f 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/light_female.glb and b/docs/base/@vl2/shapes.vl2/shapes/light_female.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/light_male.glb b/docs/base/@vl2/shapes.vl2/shapes/light_male.glb index 6e4b36b5..b3c1fdd9 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/light_male.glb and b/docs/base/@vl2/shapes.vl2/shapes/light_male.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/medium_female.glb b/docs/base/@vl2/shapes.vl2/shapes/medium_female.glb index dfec12e5..6544f5f1 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/medium_female.glb and b/docs/base/@vl2/shapes.vl2/shapes/medium_female.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/medium_male.glb b/docs/base/@vl2/shapes.vl2/shapes/medium_male.glb index eb6378bf..59960471 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/medium_male.glb and b/docs/base/@vl2/shapes.vl2/shapes/medium_male.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/mine.glb b/docs/base/@vl2/shapes.vl2/shapes/mine.glb index bf0e0832..b44c72f6 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/mine.glb and b/docs/base/@vl2/shapes.vl2/shapes/mine.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/mortar_explosion.glb b/docs/base/@vl2/shapes.vl2/shapes/mortar_explosion.glb index d8760250..31f6fa91 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/mortar_explosion.glb and b/docs/base/@vl2/shapes.vl2/shapes/mortar_explosion.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/mortar_projectile.glb b/docs/base/@vl2/shapes.vl2/shapes/mortar_projectile.glb index 6d392eb1..e3189938 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/mortar_projectile.glb and b/docs/base/@vl2/shapes.vl2/shapes/mortar_projectile.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/nexus_effect.glb b/docs/base/@vl2/shapes.vl2/shapes/nexus_effect.glb index bd641590..e29aab9b 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/nexus_effect.glb and b/docs/base/@vl2/shapes.vl2/shapes/nexus_effect.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/nexusbase.glb b/docs/base/@vl2/shapes.vl2/shapes/nexusbase.glb index 726504d7..40687ab6 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/nexusbase.glb and b/docs/base/@vl2/shapes.vl2/shapes/nexusbase.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/nexuscap.glb b/docs/base/@vl2/shapes.vl2/shapes/nexuscap.glb index 99976938..b538c498 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/nexuscap.glb and b/docs/base/@vl2/shapes.vl2/shapes/nexuscap.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_ammo.glb b/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_ammo.glb index c64d03eb..454d6e89 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_ammo.glb and b/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_ammo.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_sensor_motion.glb b/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_sensor_motion.glb index 63871e93..416097c7 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_sensor_motion.glb and b/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_sensor_motion.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_sensor_pulse.glb b/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_sensor_pulse.glb index 8d308001..17ea7190 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_sensor_pulse.glb and b/docs/base/@vl2/shapes.vl2/shapes/pack_deploy_sensor_pulse.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_cloaking.glb b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_cloaking.glb index ce24a773..f3f20dda 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_cloaking.glb and b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_cloaking.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_energy.glb b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_energy.glb index 1cd4212c..162d3414 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_energy.glb and b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_energy.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_repair.glb b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_repair.glb index 837e5363..83f182f5 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_repair.glb and b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_repair.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_satchel.glb b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_satchel.glb index b77661a7..b47597f5 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_satchel.glb and b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_satchel.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_sensorjammer.glb b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_sensorjammer.glb index 92f76f03..56b077bf 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_sensorjammer.glb and b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_sensorjammer.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_shield.glb b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_shield.glb index 904d983c..44d693da 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_shield.glb and b/docs/base/@vl2/shapes.vl2/shapes/pack_upgrade_shield.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/plasmabolt.glb b/docs/base/@vl2/shapes.vl2/shapes/plasmabolt.glb index 5bcdc205..5b51c900 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/plasmabolt.glb and b/docs/base/@vl2/shapes.vl2/shapes/plasmabolt.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/repair_kit.glb b/docs/base/@vl2/shapes.vl2/shapes/repair_kit.glb index 67a7cea9..a2ff4be3 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/repair_kit.glb and b/docs/base/@vl2/shapes.vl2/shapes/repair_kit.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/repair_patch.glb b/docs/base/@vl2/shapes.vl2/shapes/repair_patch.glb index ecba2a2d..5b574538 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/repair_patch.glb and b/docs/base/@vl2/shapes.vl2/shapes/repair_patch.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/sensor_pulse_large.glb b/docs/base/@vl2/shapes.vl2/shapes/sensor_pulse_large.glb index 72346f9c..05cb7dcd 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/sensor_pulse_large.glb and b/docs/base/@vl2/shapes.vl2/shapes/sensor_pulse_large.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/sensor_pulse_medium.glb b/docs/base/@vl2/shapes.vl2/shapes/sensor_pulse_medium.glb index bf80237b..e2329341 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/sensor_pulse_medium.glb and b/docs/base/@vl2/shapes.vl2/shapes/sensor_pulse_medium.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/solarpanel.glb b/docs/base/@vl2/shapes.vl2/shapes/solarpanel.glb index 5fc66e3f..9d2691f3 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/solarpanel.glb and b/docs/base/@vl2/shapes.vl2/shapes/solarpanel.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/station_generator_large.glb b/docs/base/@vl2/shapes.vl2/shapes/station_generator_large.glb index 06225781..0424bc56 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/station_generator_large.glb and b/docs/base/@vl2/shapes.vl2/shapes/station_generator_large.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/station_inv_human.glb b/docs/base/@vl2/shapes.vl2/shapes/station_inv_human.glb index 37648a1b..36b9eaa0 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/station_inv_human.glb and b/docs/base/@vl2/shapes.vl2/shapes/station_inv_human.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/station_inv_mpb.glb b/docs/base/@vl2/shapes.vl2/shapes/station_inv_mpb.glb index 1a56501b..13025bda 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/station_inv_mpb.glb and b/docs/base/@vl2/shapes.vl2/shapes/station_inv_mpb.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/station_teleport.glb b/docs/base/@vl2/shapes.vl2/shapes/station_teleport.glb index 33379a83..485c5282 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/station_teleport.glb and b/docs/base/@vl2/shapes.vl2/shapes/station_teleport.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/switch.glb b/docs/base/@vl2/shapes.vl2/shapes/switch.glb index 04341ce9..0511a5e2 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/switch.glb and b/docs/base/@vl2/shapes.vl2/shapes/switch.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_bd.glb b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_bd.glb index e8d1fbea..9ed2ee92 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_bd.glb and b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_bd.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_be.glb b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_be.glb index 831630a3..afa89cd0 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_be.glb and b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_be.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_ds.glb b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_ds.glb index 712fc921..36d314a8 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_ds.glb and b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_ds.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_hb.glb b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_hb.glb index 002a74bc..f2caa1bf 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_hb.glb and b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_hb.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_inf.glb b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_inf.glb index db580345..a9495004 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_inf.glb and b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_inf.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_projector.glb b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_projector.glb index d87269b9..1c70e06a 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_projector.glb and b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_projector.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_storm.glb b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_storm.glb index 89b9e77a..9ca6181c 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_storm.glb and b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_storm.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_sw.glb b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_sw.glb index bd37fba1..8166b283 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/teamlogo_sw.glb and b/docs/base/@vl2/shapes.vl2/shapes/teamlogo_sw.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_aa_large.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_aa_large.glb index c40c3460..ebaa7581 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_aa_large.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_aa_large.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_assaulttank_mortar.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_assaulttank_mortar.glb index f2293df9..c2a9c08f 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_assaulttank_mortar.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_assaulttank_mortar.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_assaulttank_plasma.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_assaulttank_plasma.glb index 28a7bfda..65cd7009 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_assaulttank_plasma.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_assaulttank_plasma.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_base_large.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_base_large.glb index e39d5c09..ad7497c1 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_base_large.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_base_large.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_base_mpb.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_base_mpb.glb index 3cff32fb..af16d184 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_base_mpb.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_base_mpb.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_belly_barrell.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_belly_barrell.glb index d77ab240..41784a3e 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_belly_barrell.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_belly_barrell.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_belly_barrelr.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_belly_barrelr.glb index ca4ff23d..38f25268 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_belly_barrelr.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_belly_barrelr.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_belly_base.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_belly_base.glb index 083cc6a7..79c05ad5 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_belly_base.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_belly_base.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_elf_large.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_elf_large.glb index a0587f5e..72ad55f5 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_elf_large.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_elf_large.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_fusion_large.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_fusion_large.glb index 8fecbc66..2c49a1be 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_fusion_large.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_fusion_large.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployc.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployc.glb index 2745a3e8..29cf3492 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployc.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployc.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployf.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployf.glb index 6f239425..e0b226c9 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployf.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployf.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployw.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployw.glb index 70997941..464af634 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployw.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_indoor_deployw.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_missile_large.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_missile_large.glb index 47f46a31..eac976be 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_missile_large.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_missile_large.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_mortar_large.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_mortar_large.glb index 17613a36..69733076 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_mortar_large.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_mortar_large.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_outdoor_deploy.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_outdoor_deploy.glb index 8c051f63..600f99a6 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_outdoor_deploy.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_outdoor_deploy.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_sentry.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_sentry.glb index 3e29487c..83b73bca 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_sentry.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_sentry.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_tank_barrelchain.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_tank_barrelchain.glb index 664e8ab0..535cff0f 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_tank_barrelchain.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_tank_barrelchain.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_tank_barrelmortar.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_tank_barrelmortar.glb index 5317d81a..0b79b97f 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_tank_barrelmortar.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_tank_barrelmortar.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/turret_tank_base.glb b/docs/base/@vl2/shapes.vl2/shapes/turret_tank_base.glb index a303f002..06d92c29 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/turret_tank_base.glb and b/docs/base/@vl2/shapes.vl2/shapes/turret_tank_base.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_bomber.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_bomber.glb index e44c7d7f..3508657b 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_bomber.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_bomber.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_hapc.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_hapc.glb index e625ab29..2f0fc9d8 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_hapc.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_hapc.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_scout.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_scout.glb index b7a79164..d001144d 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_scout.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_air_scout.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_scout.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_scout.glb index e53bf73b..439b7c83 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_scout.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_scout.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_tank.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_tank.glb index 9acac95f..bc79c337 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_tank.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_tank.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_tank_wreck.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_tank_wreck.glb index 837bbd3d..f5821bad 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_tank_wreck.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_grav_tank_wreck.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_assault.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_assault.glb index 51cfefc1..518e25b3 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_assault.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_assault.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_assault_wreck.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_assault_wreck.glb index 837bbd3d..f5821bad 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_assault_wreck.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_assault_wreck.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_mpbase.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_mpbase.glb index 7a7e8f24..a1f41b71 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_mpbase.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_land_mpbase.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_pad.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_pad.glb index 6c4d6d1e..31e06fb5 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_pad.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_pad.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/vehicle_pad_station.glb b/docs/base/@vl2/shapes.vl2/shapes/vehicle_pad_station.glb index 9325ad48..868cae9d 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/vehicle_pad_station.glb and b/docs/base/@vl2/shapes.vl2/shapes/vehicle_pad_station.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_chaingun.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_chaingun.glb index b60e1970..32fa69dd 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_chaingun.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_chaingun.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_disc.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_disc.glb index 1d2c340c..680dde19 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_disc.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_disc.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_energy.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_energy.glb index 12f66055..d4a61efd 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_energy.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_energy.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_grenade_launcher.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_grenade_launcher.glb index 334ed138..30d460ea 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_grenade_launcher.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_grenade_launcher.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_missile.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_missile.glb index a5cc8131..5806ca9f 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_missile.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_missile.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_mortar.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_mortar.glb index ef1135d2..2f3227d2 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_mortar.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_mortar.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_plasma.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_plasma.glb index b03c2b3a..4e71ac0c 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_plasma.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_plasma.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_repair.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_repair.glb index b25960e8..e3f754d5 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_repair.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_repair.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_shocklance.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_shocklance.glb index cef5e651..1e50ab4d 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_shocklance.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_shocklance.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/weapon_sniper.glb b/docs/base/@vl2/shapes.vl2/shapes/weapon_sniper.glb index 80e3f7fe..bf419cd1 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/weapon_sniper.glb and b/docs/base/@vl2/shapes.vl2/shapes/weapon_sniper.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/xorg2.glb b/docs/base/@vl2/shapes.vl2/shapes/xorg2.glb index 294144bf..4cc56ed2 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/xorg2.glb and b/docs/base/@vl2/shapes.vl2/shapes/xorg2.glb differ diff --git a/docs/base/@vl2/shapes.vl2/shapes/xorg4.glb b/docs/base/@vl2/shapes.vl2/shapes/xorg4.glb index 918de191..416963ff 100644 Binary files a/docs/base/@vl2/shapes.vl2/shapes/xorg4.glb and b/docs/base/@vl2/shapes.vl2/shapes/xorg4.glb differ diff --git a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/shapes/borg11.glb b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/shapes/borg11.glb index c5ae4640..ab66a38f 100644 Binary files a/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/shapes/borg11.glb and b/docs/base/@vl2/z_mappacks/CTF/Classic_maps_v1.vl2/shapes/borg11.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/buildStation.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/buildStation.glb index eaffacc9..64d16cd6 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/buildStation.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/buildStation.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/cannonTip.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/cannonTip.glb index 0fa6962e..95da8085 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/cannonTip.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/cannonTip.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/dsFlame.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/dsFlame.glb index 5c883246..aa4b3668 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/dsFlame.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/dsFlame.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/dsPlane.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/dsPlane.glb index 8a648171..a499930d 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/dsPlane.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/dsPlane.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/faceBox.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/faceBox.glb index e8121583..e31d15fb 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/faceBox.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/faceBox.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/faceSphere.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/faceSphere.glb index e08b6323..3826125b 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/faceSphere.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/faceSphere.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/hellFireGun.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/hellFireGun.glb index 1149079d..a56d7c8f 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/hellFireGun.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/hellFireGun.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/hellFireTurret.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/hellFireTurret.glb index ee2d1e2a..b239c73a 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/hellFireTurret.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/hellFireTurret.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1CMDStation.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1CMDStation.glb index 8402da31..a86d3725 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1CMDStation.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1CMDStation.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Chaingun.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Chaingun.glb index 9b1c1538..46274b19 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Chaingun.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Chaingun.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1DepAmmo.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1DepAmmo.glb index 17557f28..4f4d09ae 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1DepAmmo.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1DepAmmo.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1DepInvy.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1DepInvy.glb index f7f4ce39..7dfcf12d 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1DepInvy.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1DepInvy.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1GrenadeLauncher.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1GrenadeLauncher.glb index c4a8505d..ab160070 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1GrenadeLauncher.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1GrenadeLauncher.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1LSensor.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1LSensor.glb index f421f26d..e722f921 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1LSensor.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1LSensor.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1MisTurret.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1MisTurret.glb index d080bba0..939fdf5c 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1MisTurret.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1MisTurret.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1PowerGen.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1PowerGen.glb index e38d708f..54821428 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1PowerGen.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1PowerGen.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RemoteTurret.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RemoteTurret.glb index 393b5638..236e6ddb 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RemoteTurret.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RemoteTurret.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RepairPack.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RepairPack.glb index 9e5ea371..82d39e0d 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RepairPack.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RepairPack.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RepairPackGun.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RepairPackGun.glb index 77ca6908..7fc2a4a2 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RepairPackGun.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1RepairPackGun.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Sentry.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Sentry.glb index 59f0e781..cf56a0b5 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Sentry.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Sentry.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Solar.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Solar.glb index 3be368f2..aa1ca7d7 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Solar.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1Solar.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1TargetLaser.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1TargetLaser.glb index 996ac8c8..17609e8e 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1TargetLaser.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1TargetLaser.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1VehPad.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1VehPad.glb index d6a4952a..6082e4ad 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1VehPad.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1VehPad.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1VehStation.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1VehStation.glb index 501afc4f..1358aa9e 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1VehStation.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1VehStation.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1ammopad.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1ammopad.glb index 91e10bfd..4a3fb425 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1ammopad.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1ammopad.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1blaster.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1blaster.glb index 9b613c62..1164cc53 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1blaster.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1blaster.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1disc.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1disc.glb index 34a7055b..d61de658 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1disc.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1disc.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1elfTurret.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1elfTurret.glb index bad9328c..08b6d821 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1elfTurret.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1elfTurret.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1flyer.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1flyer.glb index 3cdc80bb..ea79d6fc 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1flyer.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1flyer.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1flyer2.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1flyer2.glb index 3f0f4cb1..781b4359 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1flyer2.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1flyer2.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1hpc.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1hpc.glb index bfda30a1..61d0ea18 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1hpc.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1hpc.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1inventorystation.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1inventorystation.glb index ee4331c5..5fa6f028 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1inventorystation.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1inventorystation.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1lpc.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1lpc.glb index abc7050a..994de6ff 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1lpc.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1lpc.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1mSensor.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1mSensor.glb index c9425ebe..372a4bff 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1mSensor.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1mSensor.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1mortar.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1mortar.glb index eda284ae..89404744 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1mortar.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1mortar.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1pGen.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1pGen.glb index 6feb57e6..fbda49d3 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1pGen.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1pGen.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1plasma.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1plasma.glb index 0bfb25c2..6c010cfd 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1plasma.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t1plasma.glb differ diff --git a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t2DepAmmo.glb b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t2DepAmmo.glb index f97d4b3f..fb4eab80 100644 Binary files a/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t2DepAmmo.glb and b/docs/base/@vl2/z_mappacks/z_DMP2-V0.6.vl2/shapes/t2DepAmmo.glb differ diff --git a/docs/index.html b/docs/index.html index ebe90ec5..1bda0a4c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -19,7 +19,7 @@ - + @@ -38,7 +38,7 @@ - +
diff --git a/src/components/Button.module.css b/src/components/Button.module.css index dbbdf2e1..890d3a93 100644 --- a/src/components/Button.module.css +++ b/src/components/Button.module.css @@ -34,6 +34,10 @@ transition: opacity 0.2s; } + .Button:not(:has(.ButtonLabel)) svg { + opacity: 1; + } + .Button:disabled { opacity: 0.6; box-shadow: inset 0 0 12px 1px rgba(54, 54, 54, 0.5); @@ -48,11 +52,13 @@ border-right: 1px solid rgba(200, 200, 200, 0.3); border-bottom: 1px solid rgba(200, 200, 200, 0.3); background: rgba(3, 82, 147, 0.6); + color: rgba(255, 255, 255, 0.9); } .Button:not(:disabled):hover { background: rgba(0, 98, 179, 0.8); border-color: rgba(255, 255, 255, 0.4); + color: #fff; } .Button svg { diff --git a/src/components/CopyCoordinatesButton.tsx b/src/components/CopyCoordinatesButton.tsx index f6304318..d4848f2c 100644 --- a/src/components/CopyCoordinatesButton.tsx +++ b/src/components/CopyCoordinatesButton.tsx @@ -40,7 +40,10 @@ export function CopyCoordinatesButton({ if (!camera) return; const hash = encodeViewHash(camera); const params = new URLSearchParams(); - params.set("mission", `${missionName}~${missionType}`); + const missionString = missionType + ? `${missionName}~${missionType}` + : missionName; + params.set("mission", missionString); params.set("fog", fogEnabled.toString()); const fullPath = `${window.location.pathname}?${params}${hash}`; const fullUrl = `${window.location.origin}${fullPath}`; diff --git a/src/components/DemoPlaybackControls.module.css b/src/components/DemoPlaybackControls.module.css index b24288c9..d589e957 100644 --- a/src/components/DemoPlaybackControls.module.css +++ b/src/components/DemoPlaybackControls.module.css @@ -23,11 +23,6 @@ justify-content: center; padding: 0; font-size: 12px; - /* border: 1px solid rgba(255, 255, 255, 0.3); - border-radius: 4px; - background: rgba(3, 82, 147, 0.6); - color: #fff; - cursor: pointer; */ } @media (pointer: coarse) { diff --git a/src/components/GenericShape.tsx b/src/components/GenericShape.tsx index ac1bdc89..ec74acc1 100644 --- a/src/components/GenericShape.tsx +++ b/src/components/GenericShape.tsx @@ -9,6 +9,7 @@ import { MeshBasicMaterial, MeshLambertMaterial, AdditiveBlending, + AdditiveAnimationBlendMode, AnimationMixer, AnimationClip, LoopOnce, @@ -46,8 +47,25 @@ import { } from "../stream/playbackUtils"; import type { ThreadState as StreamThreadState } from "../stream/types"; +/** Shape entity data readable in useFrame for streaming mode. */ +interface StreamShapeEntity { + threads?: StreamThreadState[]; + wheels?: Array<{ speed: number; lateralSlip: number; longitudinalSlip: number }>; + steeringYaw?: number; + frozen?: boolean; + maxSteeringAngle?: number; +} + const log = createLogger("GenericShape"); +/** WheeledVehicle per-wheel animation state (position-controlled, not threaded). */ +interface WheelAnimState { + wheelAction?: AnimationAction; + springAction?: AnimationAction; + turnAction?: AnimationAction; + rotation: number; +} + /** Returns pausable time in seconds for demo mode, real time otherwise. */ function shapeNowSec(): number { const { recording } = engineStore.getState().playback; @@ -461,8 +479,8 @@ export const ShapeRenderer = memo(function ShapeRenderer({ children, }: { loadingColor?: string; - /** Stable entity reference whose `.threads` field is mutated in-place. */ - streamEntity?: { threads?: StreamThreadState[] }; + /** Stable entity reference whose fields are mutated in-place. */ + streamEntity?: StreamShapeEntity; children?: React.ReactNode; }) { const { object, shapeName } = useShapeInfo(); @@ -514,8 +532,8 @@ export const ShapeModel = memo(function ShapeModel({ streamEntity, }: { gltf: ReturnType; - /** Stable entity reference whose `.threads` field is mutated in-place. */ - streamEntity?: { threads?: StreamThreadState[] }; + /** Stable entity reference whose fields are mutated in-place. */ + streamEntity?: StreamShapeEntity; }) { const { object, shapeName } = useShapeInfo(); const { debugMode } = useDebug(); @@ -656,6 +674,8 @@ export const ShapeModel = memo(function ShapeModel({ const animationEnabledRef = useRef(animationEnabled); animationEnabledRef.current = animationEnabled; + const wheelAnimsRef = useRef(null); + // Stream entity reference for imperative thread reads in useFrame. // The entity is mutated in-place, so reading streamEntity?.threads // always returns the latest value without requiring React re-renders. @@ -698,24 +718,28 @@ export const ShapeModel = memo(function ShapeModel({ } }, [iflMeshes]); - // DTS cyclic flags by sequence name. Cyclic sequences loop; non-cyclic - // play once and clamp. Falls back to assuming cyclic if data is absent. - const seqCyclicByName = useMemo(() => { - const map = new Map(); + // DTS sequence flags by name, parsed from glTF extras. + const { seqCyclicByName, seqBlendByName } = useMemo(() => { + const cycMap = new Map(); + const blendMap = new Map(); const rawNames = gltf.scene.userData?.dts_sequence_names; const rawCyclic = gltf.scene.userData?.dts_sequence_cyclic; - if (typeof rawNames === "string" && typeof rawCyclic === "string") { + const rawBlend = gltf.scene.userData?.dts_sequence_blend; + if (typeof rawNames === "string") { try { const names: string[] = JSON.parse(rawNames); - const cyclic: boolean[] = JSON.parse(rawCyclic); + const cyclic: boolean[] = typeof rawCyclic === "string" ? JSON.parse(rawCyclic) : []; + const blend: boolean[] = typeof rawBlend === "string" ? JSON.parse(rawBlend) : []; for (let i = 0; i < names.length; i++) { - map.set(names[i].toLowerCase(), cyclic[i] ?? true); + const lower = names[i].toLowerCase(); + cycMap.set(lower, cyclic[i] ?? true); + if (blend[i]) blendMap.set(lower, true); } } catch { /* expected */ } } - return map; + return { seqCyclicByName: cycMap, seqBlendByName: blendMap }; }, [gltf]); // Animation setup. @@ -768,6 +792,12 @@ export const ShapeModel = memo(function ShapeModel({ action.setLoop(LoopOnce, 1); action.clampWhenFinished = true; } + // Blend sequences (DTS flag 0x8) are delta transforms multiplied + // onto the existing pose. Use Three.js additive blending so they + // composite on top of non-blend threads (e.g. Deploy on Ambient). + if (seqBlendByName.has(seqLower)) { + action.blendMode = AdditiveAnimationBlendMode; + } action.reset().play(); thread.action = action; } @@ -857,11 +887,57 @@ export const ShapeModel = memo(function ShapeModel({ } } + // Set up WheeledVehicle wheel/spring/turn animations. + // These are position-controlled (setPos) not thread-controlled. + // Detect by checking if wheel0/spring0 clips exist. + if (mixer && clipsByName.has("wheel0")) { + const wheelAnims: WheelAnimState[] = []; + for (let i = 0; i < 6; i++) { + const state: WheelAnimState = { rotation: 0 }; + const wheelClip = clipsByName.get(`wheel${i}`); + if (wheelClip) { + const action = mixer.clipAction(wheelClip); + action.setLoop(LoopOnce, 1); + action.clampWhenFinished = true; + action.paused = true; + action.play(); + state.wheelAction = action; + } + const springClip = clipsByName.get(`spring${i}`); + if (springClip) { + const action = mixer.clipAction(springClip); + action.setLoop(LoopOnce, 1); + action.clampWhenFinished = true; + action.paused = true; + action.play(); + // Rest position: springs at full extension (pos=0 in Torque). + action.time = 0; + state.springAction = action; + } + const turnClip = clipsByName.get(`turn${i}`); + if (turnClip) { + const action = mixer.clipAction(turnClip); + action.setLoop(LoopOnce, 1); + action.clampWhenFinished = true; + action.paused = true; + action.play(); + // Center (straight ahead). + action.time = turnClip.duration * 0.5; + state.turnAction = action; + } + wheelAnims.push(state); + } + wheelAnimsRef.current = wheelAnims; + } else { + wheelAnimsRef.current = null; + } + return () => { unsubs.forEach((fn) => fn()); handlePlayThreadRef.current = null; handleStopThreadRef.current = null; prevDemoThreadsRef.current = undefined; + wheelAnimsRef.current = null; for (const slot of [...threads.keys()]) handleStopThread(slot); }; }, [ @@ -869,6 +945,7 @@ export const ShapeModel = memo(function ShapeModel({ clipsByName, visNodesBySequence, seqCyclicByName, + seqBlendByName, object, runtime, ]); @@ -963,6 +1040,19 @@ export const ShapeModel = memo(function ShapeModel({ if (!seqName) continue; if (t.state === 0) { playThread(slot, seqName); + // If the animation is already finished (atEnd=true on first + // appearance — e.g. a deployed MPB entering scope), snap to + // the end pose immediately instead of replaying it. + if (t.atEnd) { + const thread = threads.get(slot); + if (thread?.action) { + const clip = thread.action.getClip(); + thread.action.time = t.forward ? clip.duration : 0; + thread.action.setLoop(LoopOnce, 1); + thread.action.clampWhenFinished = true; + thread.action.paused = true; + } + } } else { stopThread(slot); } @@ -1005,6 +1095,46 @@ export const ShapeModel = memo(function ShapeModel({ } } + // Drive WheeledVehicle wheel/spring/turn animations from ghost state. + const wheelAnims = wheelAnimsRef.current; + if (wheelAnims && animationEnabled) { + const entity = streamEntityRef.current; + const wheels = entity?.wheels; + const steeringYaw = entity?.steeringYaw ?? 0; + // From VehicleData datablock (e.g. MPB = 0.3 rad). + const maxSteeringAngle = entity?.maxSteeringAngle ?? 0.3; + + for (let i = 0; i < wheelAnims.length; i++) { + const wa = wheelAnims[i]; + const wheel = wheels?.[i]; + + // Wheel rotation: accumulate from speed, matching Torque's + // advanceTime: rotation += wheelSpeed * dt * TWO_PI, then + // wrap to [0,1) and flip negative to 1-rotation. + if (wa.wheelAction && wheel) { + wa.rotation += wheel.speed * effectDelta * Math.PI * 2; + wa.rotation -= Math.floor(wa.rotation); // wrap to [0,1) + wa.wheelAction.time = + wa.rotation * wa.wheelAction.getClip().duration; + } + + // Spring: ghost vehicles stay at rest (fully extended = pos 0). + // The server already accounts for spring height in the ghost position. + // (Spring animation would only change with client-side raycasts.) + + // Turn: steering angle → animation position. + // Torque: pos = 0.5 - t * 0.5 where t = steerAngle² / maxSteeringAngle + if (wa.turnAction) { + const t = + (steeringYaw * Math.abs(steeringYaw)) / maxSteeringAngle; + const pos = 0.5 - t * 0.5; + wa.turnAction.time = + Math.max(0, Math.min(1, pos)) * + wa.turnAction.getClip().duration; + } + } + } + // Advance IFL texture atlases. // Matches Torque's animateIfls(): // time = th->pos * th->sequence->duration + th->sequence->toolBegin diff --git a/src/components/MissionSelect.module.css b/src/components/MissionSelect.module.css index 1c51304a..64477f9f 100644 --- a/src/components/MissionSelect.module.css +++ b/src/components/MissionSelect.module.css @@ -213,13 +213,15 @@ } .CloseButton { + flex: 0 0 auto; + align-self: stretch; position: relative; z-index: 101; display: grid; place-content: center; background: transparent; margin: 0 0 0 -8px; - padding: 6px; + padding: 6px 12px 6px 8px; border: 0; font-size: 24px; color: rgba(255, 255, 255, 0.5); diff --git a/src/components/ToggleSidebarButton.module.css b/src/components/ToggleSidebarButton.module.css index 839a208c..f83b2442 100644 --- a/src/components/ToggleSidebarButton.module.css +++ b/src/components/ToggleSidebarButton.module.css @@ -1,13 +1,14 @@ .Button { flex: 0 0 auto; + align-self: stretch; display: grid; place-content: center; min-width: 30px; min-height: 30px; - padding: 2px; - margin: 0 0 0 8px; + padding: 2px 4px 2px 8px; + margin: 0 0 0 2px; font-size: 24px; - border-radius: 4px; + border-radius: 0; background: transparent; color: #fff; border: 0; diff --git a/src/state/gameEntityTypes.ts b/src/state/gameEntityTypes.ts index dd97b12b..b3773a1e 100644 --- a/src/state/gameEntityTypes.ts +++ b/src/state/gameEntityTypes.ts @@ -132,6 +132,14 @@ export interface ShapeEntity extends PositionedBase { targetRenderFlags?: number; iffColor?: { r: number; g: number; b: number }; weaponShape?: string; + /** WheeledVehicle per-wheel state (speed, slip). */ + wheels?: Array<{ speed: number; lateralSlip: number; longitudinalSlip: number }>; + /** Vehicle steering angle (radians). */ + steeringYaw?: number; + /** Vehicle frozen state (deployed). */ + frozen?: boolean; + /** Vehicle max steering angle (radians), from datablock. */ + maxSteeringAngle?: number; } export interface PlayerEntity extends PositionedBase { diff --git a/src/stream/StreamEngine.ts b/src/stream/StreamEngine.ts index 404f712f..bf2f3159 100644 --- a/src/stream/StreamEngine.ts +++ b/src/stream/StreamEngine.ts @@ -126,6 +126,14 @@ export interface MutableEntity { audioMinLoopGap?: number; audioMaxLoopGap?: number; sceneData?: SceneObject; + /** WheeledVehicle per-wheel state from ghost data. */ + wheels?: Array<{ speed: number; lateralSlip: number; longitudinalSlip: number }>; + /** Vehicle steering angle (radians), from ghost data. */ + steeringYaw?: number; + /** Vehicle frozen state (deployed MPB, etc.). */ + frozen?: boolean; + /** Vehicle max steering angle (radians), from VehicleData datablock. */ + maxSteeringAngle?: number; /** Force field visual data extracted from ForceFieldBareData datablock. */ forceFieldData?: { textures: string[]; @@ -961,6 +969,14 @@ export abstract class StreamEngine implements StreamingPlayback { } } + // Vehicle maxSteeringAngle from VehicleData datablock. + if ( + entity.className === "WheeledVehicle" && + typeof blockData?.maxSteeringAngle === "number" + ) { + entity.maxSteeringAngle = blockData.maxSteeringAngle; + } + // Force field visual data from ForceFieldBareData datablock. if (entity.className === "ForceFieldBare" && blockData) { const color1 = blockData.color1 as @@ -993,6 +1009,35 @@ export abstract class StreamEngine implements StreamingPlayback { } } + // WheeledVehicle per-wheel state. Mutate in-place to avoid allocation + // on every ghost update (~32Hz). + if (Array.isArray(data.wheels)) { + const incoming = data.wheels as Array<{ + avel: number; + Dy: number; + Dx: number; + }>; + if (!entity.wheels || entity.wheels.length !== incoming.length) { + entity.wheels = incoming.map((w) => ({ + speed: w.avel, + lateralSlip: w.Dx, + longitudinalSlip: w.Dy, + })); + } else { + for (let i = 0; i < incoming.length; i++) { + entity.wheels[i].speed = incoming[i].avel; + entity.wheels[i].lateralSlip = incoming[i].Dx; + entity.wheels[i].longitudinalSlip = incoming[i].Dy; + } + } + } + if (typeof data.steeringYaw === "number") { + entity.steeringYaw = data.steeringYaw; + } + if (typeof data.frozen === "boolean") { + entity.frozen = data.frozen; + } + // Weapon images (Player) if (entity.type === "Player") { const images = data.images as @@ -2253,6 +2298,10 @@ export abstract class StreamEngine implements StreamingPlayback { audioMaxDistance: entity.audioMaxDistance, audioMinLoopGap: entity.audioMinLoopGap, audioMaxLoopGap: entity.audioMaxLoopGap, + wheels: entity.wheels, + steeringYaw: entity.steeringYaw, + frozen: entity.frozen, + maxSteeringAngle: entity.maxSteeringAngle, sceneData: entity.sceneData, forceFieldData: entity.forceFieldData, }); diff --git a/src/stream/entityBridge.ts b/src/stream/entityBridge.ts index f5ca4918..ae5a594c 100644 --- a/src/stream/entityBridge.ts +++ b/src/stream/entityBridge.ts @@ -223,5 +223,9 @@ export function streamEntityToGameEntity( threads: entity.threads, targetRenderFlags: entity.targetRenderFlags, iffColor: entity.iffColor, + wheels: entity.wheels, + steeringYaw: entity.steeringYaw, + frozen: entity.frozen, + maxSteeringAngle: entity.maxSteeringAngle, } satisfies ShapeEntity; } diff --git a/src/stream/types.ts b/src/stream/types.ts index 0a683bd1..9446533f 100644 --- a/src/stream/types.ts +++ b/src/stream/types.ts @@ -153,6 +153,14 @@ export interface StreamEntity { audioMaxDistance?: number; audioMinLoopGap?: number; audioMaxLoopGap?: number; + /** WheeledVehicle per-wheel state. */ + wheels?: Array<{ speed: number; lateralSlip: number; longitudinalSlip: number }>; + /** Vehicle steering angle (radians). */ + steeringYaw?: number; + /** Vehicle frozen state (deployed). */ + frozen?: boolean; + /** Vehicle max steering angle (radians). */ + maxSteeringAngle?: number; /** Scene infrastructure data (terrain, interior, sky, etc.). */ sceneData?: SceneObject; /** Force field visual data from ForceFieldBareData datablock. */