From d9be5c1ebad735fb8d325322e317ff3329612fac Mon Sep 17 00:00:00 2001 From: Brian Beck Date: Sun, 1 Mar 2026 09:40:17 -0800 Subject: [PATCH] migrate to CSS Modules --- app/page.module.css | 71 ++ app/page.tsx | 22 +- app/style.css | 735 ------------------ docs/404.html | 2 +- docs/404/index.html | 2 +- docs/__next.__PAGE__.txt | 6 +- docs/__next._full.txt | 8 +- docs/__next._head.txt | 2 +- docs/__next._index.txt | 4 +- docs/__next._tree.txt | 6 +- .../_buildManifest.js | 0 .../_clientMiddlewareManifest.json | 0 .../_ssgManifest.js | 0 docs/_next/static/chunks/17606cb20096103a.css | 1 - docs/_next/static/chunks/88e3d9a60c48713e.js | 211 ----- docs/_next/static/chunks/ad5913f83864409c.js | 528 ------------- docs/_next/static/chunks/afff663ba7029ccf.css | 1 - docs/_next/static/chunks/c339a594c158eab3.js | 211 +++++ docs/_next/static/chunks/e620039d1c837dab.css | 1 + docs/_next/static/chunks/f12455938f261f57.js | 528 +++++++++++++ docs/_next/static/chunks/f6c55b3b7050a508.css | 12 + docs/_not-found/__next._full.txt | 4 +- docs/_not-found/__next._head.txt | 2 +- docs/_not-found/__next._index.txt | 4 +- .../_not-found/__next._not-found.__PAGE__.txt | 2 +- docs/_not-found/__next._not-found.txt | 2 +- docs/_not-found/__next._tree.txt | 4 +- docs/_not-found/index.html | 2 +- docs/_not-found/index.txt | 4 +- docs/index.html | 2 +- docs/index.txt | 8 +- .../CopyCoordinatesButton.module.css | 36 + src/components/CopyCoordinatesButton.tsx | 9 +- src/components/DebugElements.module.css | 23 + src/components/DebugElements.tsx | 9 +- src/components/DemoControls.module.css | 111 +++ src/components/DemoControls.tsx | 19 +- src/components/FloatingLabel.module.css | 9 + src/components/FloatingLabel.tsx | 18 +- src/components/InspectorControls.module.css | 175 +++++ src/components/InspectorControls.tsx | 48 +- src/components/KeyboardOverlay.module.css | 55 ++ src/components/KeyboardOverlay.tsx | 53 +- src/components/LoadDemoButton.module.css | 12 + src/components/LoadDemoButton.tsx | 7 +- src/components/MissionSelect.module.css | 181 +++++ src/components/MissionSelect.tsx | 43 +- src/components/PlayerNameplate.module.css | 46 ++ src/components/PlayerNameplate.tsx | 16 +- src/components/TouchControls.module.css | 22 + src/components/TouchControls.tsx | 37 +- 51 files changed, 1684 insertions(+), 1630 deletions(-) create mode 100644 app/page.module.css rename docs/_next/static/{A7b21KJnATF7QS7o5ziIf => YSDmiCN1S-sDYVxEL27I6}/_buildManifest.js (100%) rename docs/_next/static/{A7b21KJnATF7QS7o5ziIf => YSDmiCN1S-sDYVxEL27I6}/_clientMiddlewareManifest.json (100%) rename docs/_next/static/{A7b21KJnATF7QS7o5ziIf => YSDmiCN1S-sDYVxEL27I6}/_ssgManifest.js (100%) delete mode 100644 docs/_next/static/chunks/17606cb20096103a.css delete mode 100644 docs/_next/static/chunks/88e3d9a60c48713e.js delete mode 100644 docs/_next/static/chunks/ad5913f83864409c.js delete mode 100644 docs/_next/static/chunks/afff663ba7029ccf.css create mode 100644 docs/_next/static/chunks/c339a594c158eab3.js create mode 100644 docs/_next/static/chunks/e620039d1c837dab.css create mode 100644 docs/_next/static/chunks/f12455938f261f57.js create mode 100644 docs/_next/static/chunks/f6c55b3b7050a508.css create mode 100644 src/components/CopyCoordinatesButton.module.css create mode 100644 src/components/DebugElements.module.css create mode 100644 src/components/DemoControls.module.css create mode 100644 src/components/FloatingLabel.module.css create mode 100644 src/components/InspectorControls.module.css create mode 100644 src/components/KeyboardOverlay.module.css create mode 100644 src/components/LoadDemoButton.module.css create mode 100644 src/components/MissionSelect.module.css create mode 100644 src/components/PlayerNameplate.module.css create mode 100644 src/components/TouchControls.module.css diff --git a/app/page.module.css b/app/page.module.css new file mode 100644 index 00000000..1d9723fd --- /dev/null +++ b/app/page.module.css @@ -0,0 +1,71 @@ +.CanvasContainer { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 0; +} + +.LoadingIndicator { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + display: flex; + flex-direction: column; + align-items: center; + gap: 16px; + pointer-events: none; + z-index: 1; + opacity: 0.8; +} + +.LoadingIndicator[data-complete="true"] { + animation: loadingComplete 0.3s ease-out forwards; +} + +.Spinner { + width: 48px; + height: 48px; + border: 4px solid rgba(255, 255, 255, 0.2); + border-top-color: white; + border-radius: 50%; + animation: spin 1s linear infinite; +} + +.Progress { + width: 200px; + height: 4px; + background: rgba(255, 255, 255, 0.2); + border-radius: 2px; + overflow: hidden; +} + +.ProgressBar { + height: 100%; + background: white; + border-radius: 2px; + transition: width 0.1s ease-out; +} + +.ProgressText { + font-size: 14px; + color: rgba(255, 255, 255, 0.7); + font-variant-numeric: tabular-nums; +} + +@keyframes spin { + to { + transform: rotate(360deg); + } +} + +@keyframes loadingComplete { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} diff --git a/app/page.tsx b/app/page.tsx index e934c76f..fd7f9837 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -49,6 +49,7 @@ import { findMissionByDemoName, } from "@/src/manifest"; import { createParser, parseAsBoolean, useQueryState } from "nuqs"; +import styles from "./page.module.css"; const MapInfoDialog = lazy(() => import("@/src/components/MapInfoDialog").then((mod) => ({ @@ -231,17 +232,21 @@ function MapInspector() { onClearFogEnabledOverride={clearFogEnabledOverride} > -
+
{showLoadingIndicator && ( -
-
-
+
+
+
-
+
{Math.round(loadingProgress * 100)}%
@@ -304,7 +309,10 @@ function MapInspector() { /> )} - + diff --git a/app/style.css b/app/style.css index a39bd6b3..ca6510c4 100644 --- a/app/style.css +++ b/app/style.css @@ -44,741 +44,6 @@ main { height: 100dvh; } -#canvasContainer { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - z-index: 0; -} - -#controls { - position: fixed; - top: 0; - left: 0; - background: rgba(0, 0, 0, 0.5); - color: #fff; - padding: 8px 12px 8px 8px; - border-radius: 0 0 4px 0; - font-size: 13px; - z-index: 2; -} - input[type="range"] { max-width: 80px; } - -.CheckboxField, -.LabelledButton { - display: flex; - align-items: center; - gap: 6px; -} - -.Field { - display: flex; - align-items: center; - gap: 6px; -} - -#controls, -.Controls-dropdown, -.Controls-group { - display: flex; - align-items: center; - justify-content: center; - gap: 20px; -} - -@media (max-width: 1279px) { - .Controls-dropdown[data-open="false"] { - display: none; - } - - .Controls-dropdown { - position: absolute; - top: calc(100% + 2px); - left: 2px; - right: 2px; - display: flex; - overflow: auto; - max-height: calc(100dvh - 56px); - flex-direction: column; - align-items: center; - gap: 12px; - background: rgba(0, 0, 0, 0.8); - border: 1px solid rgba(255, 255, 255, 0.2); - border-radius: 4px; - padding: 12px; - box-shadow: 0 0 12px rgba(0, 0, 0, 0.4); - } - - .Controls-group { - flex-wrap: wrap; - gap: 12px 20px; - } -} - -@media (max-width: 639px) { - #controls { - right: 0; - border-radius: 0; - } - - #controls > .MissionSelect-inputWrapper { - flex: 1 1 0; - min-width: 0; - } - - #controls > .MissionSelect-inputWrapper .MissionSelect-input { - width: 100%; - } - - .Controls-toggle { - flex: 0 0 auto; - } -} - -.IconButton { - position: relative; - display: flex; - align-items: center; - justify-content: center; - width: 28px; - height: 28px; - margin: 0 0 0 -12px; - font-size: 15px; - padding: 0; - border-top: 1px solid rgba(255, 255, 255, 0.3); - border-left: 1px solid rgba(255, 255, 255, 0.3); - border-right: 1px solid rgba(200, 200, 200, 0.3); - border-bottom: 1px solid rgba(200, 200, 200, 0.3); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); - border-radius: 4px; - background: rgba(3, 82, 147, 0.6); - color: #fff; - cursor: pointer; - transform: translate(0, 0); - transition: - background 0.2s, - border-color 0.2s; -} - -.ButtonLabel { - font-size: 12px; -} - -.IconButton svg { - pointer-events: none; -} - -@media (hover: hover) { - .IconButton:hover { - background: rgba(0, 98, 179, 0.8); - border-color: rgba(255, 255, 255, 0.4); - } -} - -.IconButton:active, -.IconButton[aria-expanded="true"] { - background: rgba(0, 98, 179, 0.7); - border-color: rgba(255, 255, 255, 0.3); - transform: translate(0, 1px); -} - -.IconButton[data-active="true"] { - background: rgba(0, 117, 213, 0.9); - border-color: rgba(255, 255, 255, 0.4); -} - -.Controls-toggle { - margin: 0; -} - -@media (max-width: 1279px) { - .LabelledButton { - width: auto; - padding: 0 10px; - } -} - -@media (min-width: 1280px) { - .Controls-toggle { - display: none; - } - - .LabelledButton .ButtonLabel { - display: none; - } - - .MapInfoButton { - display: none; - } -} - -.CopyCoordinatesButton[data-copied="true"] { - background: rgba(0, 117, 213, 0.9); - border-color: rgba(255, 255, 255, 0.4); -} - -.CopyCoordinatesButton .ClipboardCheck { - display: none; - opacity: 1; -} - -.CopyCoordinatesButton[data-copied="true"] .ClipboardCheck { - display: block; - animation: showClipboardCheck 220ms linear infinite; -} - -.CopyCoordinatesButton[data-copied="true"] .MapPin { - display: none; -} - -.StaticShapeLabel { - background: rgba(0, 0, 0, 0.5); - color: #fff; - font-size: 11px; - white-space: nowrap; - padding: 1px 3px; - border-radius: 1px; - text-align: center; -} - -.PlayerNameplate { - pointer-events: none; - display: inline-flex; - flex-direction: column; - align-items: center; - white-space: nowrap; -} - -.PlayerTop { - padding-bottom: 20px; -} - -.PlayerBottom { - padding-top: 20px; -} - -.PlayerNameplate-iffArrow { - width: 12px; - height: 12px; - image-rendering: pixelated; - filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); -} - -.PlayerNameplate-name { - color: #fff; - font-size: 11px; - text-shadow: - 0 1px 3px rgba(0, 0, 0, 0.9), - 0 0 1px rgba(0, 0, 0, 0.7); -} - -.PlayerNameplate-healthBar { - width: 60px; - height: 4px; - background: rgba(0, 0, 0, 0.5); - border: 1px solid rgba(255, 255, 255, 0.2); - margin: 2px auto 0; - overflow: hidden; -} - -.PlayerNameplate-healthFill { - height: 100%; - background: #2ecc40; -} - -.StatsPanel { - left: auto !important; - top: auto !important; - right: 0; - bottom: 0; -} - -.AxisLabel { - font-size: 12px; - pointer-events: none; -} - -.AxisLabel[data-axis="x"] { - color: rgb(255, 153, 0); -} - -.AxisLabel[data-axis="y"] { - color: rgb(153, 255, 0); -} - -.AxisLabel[data-axis="z"] { - color: rgb(0, 153, 255); -} - -/* MissionSelect combobox styles */ -.MissionSelect-inputWrapper { - position: relative; - display: flex; - align-items: center; -} - -.MissionSelect-shortcut { - position: absolute; - right: 7px; - font-family: system-ui, sans-serif; - font-size: 11px; - padding: 1px 4px; - border-radius: 3px; - background: rgba(255, 255, 255, 0.15); - color: rgba(255, 255, 255, 0.6); - pointer-events: none; -} - -.MissionSelect-input[aria-expanded="true"] ~ .MissionSelect-shortcut { - display: none; -} - -.MissionSelect-input { - width: 280px; - padding: 6px 36px 6px 8px; - font-size: 14px; - border: 1px solid rgba(255, 255, 255, 0.3); - border-radius: 3px; - background: rgba(0, 0, 0, 0.6); - color: #fff; - outline: none; - user-select: text; -} - -.MissionSelect-input[aria-expanded="true"] { - padding-right: 8px; -} - -.MissionSelect-input:focus { - border-color: rgba(255, 255, 255, 0.6); -} - -.MissionSelect-input::placeholder { - color: transparent; -} - -.MissionSelect-selectedValue { - position: absolute; - left: 8px; - right: 36px; - display: flex; - align-items: center; - gap: 6px; - pointer-events: none; - overflow: hidden; -} - -.MissionSelect-input[aria-expanded="true"] ~ .MissionSelect-selectedValue { - display: none; -} - -.MissionSelect-selectedName { - color: #fff; - font-weight: 600; - font-size: 14px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - flex-shrink: 1; - min-width: 0; -} - -.MissionSelect-selectedValue > .MissionSelect-itemType { - flex-shrink: 0; -} - -.MissionSelect-popover { - z-index: 100; - min-width: 320px; - max-height: var(--popover-available-height, 90vh); - overflow-y: auto; - overscroll-behavior: contain; - background: rgba(20, 20, 20, 0.95); - border: 1px solid rgba(255, 255, 255, 0.5); - border-radius: 3px; - box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); -} - -.MissionSelect-list { - padding: 4px 0; -} - -.MissionSelect-list:has(> .MissionSelect-group:first-child) { - padding-top: 0; -} - -.MissionSelect-group { - padding-bottom: 4px; -} - -.MissionSelect-groupLabel { - position: sticky; - top: 0; - padding: 6px 8px 6px 12px; - font-size: 13px; - font-weight: 600; - color: rgb(198, 202, 202); - background: rgba(58, 69, 72, 0.95); - border-bottom: 1px solid rgba(255, 255, 255, 0.3); - z-index: 1; -} - -.MissionSelect-group:not(:last-child) { - border-bottom: 1px solid rgba(255, 255, 255, 0.3); -} - -.MissionSelect-item { - display: flex; - flex-direction: column; - gap: 1px; - margin: 4px 4px 0; - padding: 6px 8px; - border-radius: 4px; - cursor: pointer; - outline: none; - scroll-margin-top: 32px; -} - -.MissionSelect-list > .MissionSelect-item:first-child { - margin-top: 0; -} - -.MissionSelect-item[data-active-item] { - background: rgba(255, 255, 255, 0.15); -} - -.MissionSelect-item[aria-selected="true"] { - background: rgba(100, 150, 255, 0.3); -} - -.MissionSelect-itemHeader { - display: flex; - align-items: center; - gap: 6px; -} - -.MissionSelect-itemName { - font-size: 14px; - font-weight: 600; - color: #fff; -} - -.MissionSelect-itemTypes { - display: flex; - gap: 3px; -} - -.MissionSelect-itemType { - font-size: 10px; - font-weight: 600; - padding: 2px 5px; - border-radius: 3px; - background: rgba(255, 157, 0, 0.4); - color: #fff; -} - -.MissionSelect-itemType:hover { - background: rgba(255, 157, 0, 0.7); -} - -.MissionSelect-itemMissionName { - font-size: 12px; - color: rgba(255, 255, 255, 0.5); -} - -.MissionSelect-noResults { - padding: 12px 8px; - font-size: 13px; - color: rgba(255, 255, 255, 0.5); - text-align: center; -} - -.LoadingSpinner { - width: 48px; - height: 48px; - border: 4px solid rgba(255, 255, 255, 0.2); - border-top-color: white; - border-radius: 50%; - animation: LoadingSpinner-spin 1s linear infinite; -} - -@keyframes LoadingSpinner-spin { - to { - transform: rotate(360deg); - } -} - -#loadingIndicator { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - display: flex; - flex-direction: column; - align-items: center; - gap: 16px; - pointer-events: none; - z-index: 1; - opacity: 0.8; -} - -#loadingIndicator[data-complete="true"] { - animation: loadingComplete 0.3s ease-out forwards; -} - -@keyframes loadingComplete { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} - -.LoadingProgress { - width: 200px; - height: 4px; - background: rgba(255, 255, 255, 0.2); - border-radius: 2px; - overflow: hidden; -} - -.LoadingProgress-bar { - height: 100%; - background: white; - border-radius: 2px; - transition: width 0.1s ease-out; -} - -.LoadingProgress-text { - font-size: 14px; - color: rgba(255, 255, 255, 0.7); - font-variant-numeric: tabular-nums; -} - -@keyframes showClipboardCheck { - 0% { - opacity: 1; - } - 100% { - opacity: 0.2; - } -} - -.KeyboardOverlay { - position: fixed; - bottom: 16px; - left: 50%; - transform: translateX(-50%); - display: flex; - align-items: flex-end; - gap: 10px; - pointer-events: none; - z-index: 1; -} - -.KeyboardOverlay-column { - display: flex; - gap: 4px; - flex-direction: column; - justify-content: center; -} - -.KeyboardOverlay-row { - display: flex; - gap: 4px; - justify-content: stretch; -} - -.KeyboardOverlay-spacer { - width: 32px; -} - -.KeyboardOverlay-key { - min-width: 32px; - height: 32px; - display: flex; - flex: 1 0 0; - align-items: center; - justify-content: center; - padding: 0 8px; - border-radius: 4px; - background: rgba(0, 0, 0, 0.4); - border: 1px solid rgba(255, 255, 255, 0.2); - color: rgba(255, 255, 255, 0.5); - font-size: 11px; - font-weight: 600; - white-space: nowrap; -} - -.KeyboardOverlay-key[data-pressed="true"] { - background: rgba(52, 187, 171, 0.6); - border-color: rgba(35, 253, 220, 0.5); - color: #fff; -} - -.KeyboardOverlay-arrow { - margin-right: 3px; -} - -.TouchJoystick { - position: fixed; - bottom: 20px; - left: 50%; - transform: translateX(-50%); - width: 140px; - height: 140px; - z-index: 1; -} - -.TouchJoystick--left { - left: 20px; - transform: none; -} - -.TouchJoystick--right { - left: auto; - right: 20px; - transform: none; -} - -.TouchJoystick .back { - background: rgba(3, 79, 76, 0.6) !important; - border: 1px solid rgba(0, 219, 223, 0.5) !important; - box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7) !important; -} - -.TouchJoystick .front { - background: radial-gradient( - circle at 50% 50%, - rgba(23, 247, 198, 0.9) 0%, - rgba(9, 184, 170, 0.95) 100% - ) !important; - border: 2px solid rgba(255, 255, 255, 0.4) !important; - box-shadow: - 0 2px 4px rgba(0, 0, 0, 0.5), - 0 1px 1px rgba(0, 0, 0, 0.3), - inset 0 1px 0 rgba(255, 255, 255, 0.15), - inset 0 -1px 2px rgba(0, 0, 0, 0.3) !important; -} - -.DemoControls { - position: fixed; - bottom: 0; - left: 0; - right: 0; - display: flex; - align-items: center; - gap: 10px; - padding: 8px 12px; - background: rgba(0, 0, 0, 0.7); - color: #fff; - font-size: 13px; - z-index: 2; -} - -.DemoControls-playPause { - width: 32px; - height: 32px; - flex-shrink: 0; - display: flex; - align-items: center; - justify-content: center; - padding: 0; - border: 1px solid rgba(255, 255, 255, 0.3); - border-radius: 4px; - background: rgba(3, 82, 147, 0.6); - color: #fff; - font-size: 14px; - cursor: pointer; -} - -@media (hover: hover) { - .DemoControls-playPause:hover { - background: rgba(0, 98, 179, 0.8); - } -} - -.DemoControls-time { - flex-shrink: 0; - font-variant-numeric: tabular-nums; - white-space: nowrap; -} - -.DemoControls-seek[type="range"] { - flex: 1 1 0; - min-width: 0; - max-width: none; -} - -.DemoControls-speed { - flex-shrink: 0; - padding: 2px 4px; - border: 1px solid rgba(255, 255, 255, 0.3); - border-radius: 3px; - background: rgba(0, 0, 0, 0.6); - color: #fff; - font-size: 12px; -} - -.DemoDiagnosticsPanel { - display: flex; - flex-direction: column; - gap: 3px; - margin-left: 8px; - padding: 4px 8px; - border: 1px solid rgba(255, 255, 255, 0.2); - border-radius: 4px; - background: rgba(0, 0, 0, 0.55); - min-width: 320px; -} - -.DemoDiagnosticsPanel[data-context-lost="true"] { - border-color: rgba(255, 90, 90, 0.8); - background: rgba(70, 0, 0, 0.45); -} - -.DemoDiagnosticsPanel-status { - font-size: 11px; - font-weight: 700; - letter-spacing: 0.02em; -} - -.DemoDiagnosticsPanel-metrics { - display: flex; - flex-wrap: wrap; - gap: 4px 10px; - font-size: 11px; - opacity: 0.92; -} - -.DemoDiagnosticsPanel-footer { - display: flex; - flex-wrap: wrap; - gap: 4px 8px; - align-items: center; - font-size: 11px; -} - -.DemoDiagnosticsPanel-footer button { - border: 1px solid rgba(255, 255, 255, 0.3); - border-radius: 3px; - background: rgba(3, 82, 147, 0.6); - color: #fff; - padding: 1px 6px; - font-size: 11px; - cursor: pointer; -} - -.DemoDiagnosticsPanel-footer button:hover { - background: rgba(0, 98, 179, 0.8); -} - -.DemoIcon { - font-size: 19px; -} diff --git a/docs/404.html b/docs/404.html index 4b46fc1e..4854656f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html index 4b46fc1e..4854656f 100644 --- a/docs/404/index.html +++ b/docs/404/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/__next.__PAGE__.txt b/docs/__next.__PAGE__.txt index 2bc18171..66aad164 100644 --- a/docs/__next.__PAGE__.txt +++ b/docs/__next.__PAGE__.txt @@ -1,10 +1,10 @@ 1:"$Sreact.fragment" 2:I[47257,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"ClientPageRoot"] -3:I[31713,["/t2-mapper/_next/static/chunks/e6da73430a674f20.js","/t2-mapper/_next/static/chunks/88e3d9a60c48713e.js","/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","/t2-mapper/_next/static/chunks/ad5913f83864409c.js","/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js"],"default"] +3:I[31713,["/t2-mapper/_next/static/chunks/e6da73430a674f20.js","/t2-mapper/_next/static/chunks/c339a594c158eab3.js","/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","/t2-mapper/_next/static/chunks/f12455938f261f57.js","/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js"],"default"] 6:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"OutletBoundary"] 7:"$Sreact.suspense" -:HL["/t2-mapper/_next/static/chunks/afff663ba7029ccf.css","style"] -0:{"buildId":"A7b21KJnATF7QS7o5ziIf","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/afff663ba7029ccf.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/88e3d9a60c48713e.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/ad5913f83864409c.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/f6c55b3b7050a508.css","style"] +0:{"buildId":"YSDmiCN1S-sDYVxEL27I6","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/f6c55b3b7050a508.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/c339a594c158eab3.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/f12455938f261f57.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/docs/__next._full.txt b/docs/__next._full.txt index e92da796..bf7ac3b3 100644 --- a/docs/__next._full.txt +++ b/docs/__next._full.txt @@ -3,15 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"ClientPageRoot"] -6:I[31713,["/t2-mapper/_next/static/chunks/e6da73430a674f20.js","/t2-mapper/_next/static/chunks/88e3d9a60c48713e.js","/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","/t2-mapper/_next/static/chunks/ad5913f83864409c.js","/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js"],"default"] +6:I[31713,["/t2-mapper/_next/static/chunks/e6da73430a674f20.js","/t2-mapper/_next/static/chunks/c339a594c158eab3.js","/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","/t2-mapper/_next/static/chunks/f12455938f261f57.js","/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"MetadataBoundary"] 10:I[68027,[],"default"] -:HL["/t2-mapper/_next/static/chunks/17606cb20096103a.css","style"] -:HL["/t2-mapper/_next/static/chunks/afff663ba7029ccf.css","style"] -0:{"P":null,"b":"A7b21KJnATF7QS7o5ziIf","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/17606cb20096103a.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/afff663ba7029ccf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/88e3d9a60c48713e.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/ad5913f83864409c.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] +:HL["/t2-mapper/_next/static/chunks/f6c55b3b7050a508.css","style"] +0:{"P":null,"b":"YSDmiCN1S-sDYVxEL27I6","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/f6c55b3b7050a508.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/c339a594c158eab3.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/f12455938f261f57.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/__next._head.txt b/docs/__next._head.txt index 0e7c7ebc..0969284a 100644 --- a/docs/__next._head.txt +++ b/docs/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"IconMark"] -0:{"buildId":"A7b21KJnATF7QS7o5ziIf","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"YSDmiCN1S-sDYVxEL27I6","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/__next._index.txt b/docs/__next._index.txt index cec13dd5..bfcbae61 100644 --- a/docs/__next._index.txt +++ b/docs/__next._index.txt @@ -2,5 +2,5 @@ 2:I[12985,["/t2-mapper/_next/static/chunks/e6da73430a674f20.js"],"NuqsAdapter"] 3:I[39756,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/17606cb20096103a.css","style"] -0:{"buildId":"A7b21KJnATF7QS7o5ziIf","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/17606cb20096103a.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] +0:{"buildId":"YSDmiCN1S-sDYVxEL27I6","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/__next._tree.txt b/docs/__next._tree.txt index 7fe119e5..950e9512 100644 --- a/docs/__next._tree.txt +++ b/docs/__next._tree.txt @@ -1,3 +1,3 @@ -:HL["/t2-mapper/_next/static/chunks/17606cb20096103a.css","style"] -:HL["/t2-mapper/_next/static/chunks/afff663ba7029ccf.css","style"] -0:{"buildId":"A7b21KJnATF7QS7o5ziIf","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] +:HL["/t2-mapper/_next/static/chunks/f6c55b3b7050a508.css","style"] +0:{"buildId":"YSDmiCN1S-sDYVxEL27I6","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/_next/static/A7b21KJnATF7QS7o5ziIf/_buildManifest.js b/docs/_next/static/YSDmiCN1S-sDYVxEL27I6/_buildManifest.js similarity index 100% rename from docs/_next/static/A7b21KJnATF7QS7o5ziIf/_buildManifest.js rename to docs/_next/static/YSDmiCN1S-sDYVxEL27I6/_buildManifest.js diff --git a/docs/_next/static/A7b21KJnATF7QS7o5ziIf/_clientMiddlewareManifest.json b/docs/_next/static/YSDmiCN1S-sDYVxEL27I6/_clientMiddlewareManifest.json similarity index 100% rename from docs/_next/static/A7b21KJnATF7QS7o5ziIf/_clientMiddlewareManifest.json rename to docs/_next/static/YSDmiCN1S-sDYVxEL27I6/_clientMiddlewareManifest.json diff --git a/docs/_next/static/A7b21KJnATF7QS7o5ziIf/_ssgManifest.js b/docs/_next/static/YSDmiCN1S-sDYVxEL27I6/_ssgManifest.js similarity index 100% rename from docs/_next/static/A7b21KJnATF7QS7o5ziIf/_ssgManifest.js rename to docs/_next/static/YSDmiCN1S-sDYVxEL27I6/_ssgManifest.js diff --git a/docs/_next/static/chunks/17606cb20096103a.css b/docs/_next/static/chunks/17606cb20096103a.css deleted file mode 100644 index 7b61ed57..00000000 --- a/docs/_next/static/chunks/17606cb20096103a.css +++ /dev/null @@ -1 +0,0 @@ -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}main{width:100dvw;height:100dvh}#canvasContainer{z-index:0;position:absolute;inset:0}#controls{color:#fff;z-index:2;background:#00000080;border-radius:0 0 4px;padding:8px 12px 8px 8px;font-size:13px;position:fixed;top:0;left:0}input[type=range]{max-width:80px}.CheckboxField,.LabelledButton,.Field{align-items:center;gap:6px;display:flex}#controls,.Controls-dropdown,.Controls-group{justify-content:center;align-items:center;gap:20px;display:flex}@media (max-width:1279px){.Controls-dropdown[data-open=false]{display:none}.Controls-dropdown{background:#000c;border:1px solid #fff3;border-radius:4px;flex-direction:column;align-items:center;gap:12px;max-height:calc(100dvh - 56px);padding:12px;display:flex;position:absolute;top:calc(100% + 2px);left:2px;right:2px;overflow:auto;box-shadow:0 0 12px #0006}.Controls-group{flex-wrap:wrap;gap:12px 20px}}@media (max-width:639px){#controls{border-radius:0;right:0}#controls>.MissionSelect-inputWrapper{flex:1 1 0;min-width:0}#controls>.MissionSelect-inputWrapper .MissionSelect-input{width:100%}.Controls-toggle{flex:none}}.IconButton{color:#fff;cursor:pointer;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d;border-radius:4px;justify-content:center;align-items:center;width:28px;height:28px;margin:0 0 0 -12px;padding:0;font-size:15px;transition:background .2s,border-color .2s;display:flex;position:relative;transform:translate(0);box-shadow:0 1px 2px #0006}.ButtonLabel{font-size:12px}.IconButton svg{pointer-events:none}@media (hover:hover){.IconButton:hover{background:#0062b3cc;border-color:#fff6}}.IconButton:active,.IconButton[aria-expanded=true]{background:#0062b3b3;border-color:#ffffff4d;transform:translateY(1px)}.IconButton[data-active=true]{background:#0075d5e6;border-color:#fff6}.Controls-toggle{margin:0}@media (max-width:1279px){.LabelledButton{width:auto;padding:0 10px}}@media (min-width:1280px){.Controls-toggle,.LabelledButton .ButtonLabel,.MapInfoButton{display:none}}.CopyCoordinatesButton[data-copied=true]{background:#0075d5e6;border-color:#fff6}.CopyCoordinatesButton .ClipboardCheck{opacity:1;display:none}.CopyCoordinatesButton[data-copied=true] .ClipboardCheck{animation:.22s linear infinite showClipboardCheck;display:block}.CopyCoordinatesButton[data-copied=true] .MapPin{display:none}.StaticShapeLabel{color:#fff;white-space:nowrap;text-align:center;background:#00000080;border-radius:1px;padding:1px 3px;font-size:11px}.PlayerNameplate{pointer-events:none;white-space:nowrap;flex-direction:column;align-items:center;display:inline-flex}.PlayerTop{padding-bottom:20px}.PlayerBottom{padding-top:20px}.PlayerNameplate-iffArrow{width:12px;height:12px;image-rendering:pixelated;filter:drop-shadow(0 1px 2px #000000b3)}.PlayerNameplate-name{color:#fff;text-shadow:0 1px 3px #000000e6,0 0 1px #000000b3;font-size:11px}.PlayerNameplate-healthBar{background:#00000080;border:1px solid #fff3;width:60px;height:4px;margin:2px auto 0;overflow:hidden}.PlayerNameplate-healthFill{background:#2ecc40;height:100%}.StatsPanel{bottom:0;right:0;top:auto!important;left:auto!important}.AxisLabel{pointer-events:none;font-size:12px}.AxisLabel[data-axis=x]{color:#f90}.AxisLabel[data-axis=y]{color:#9f0}.AxisLabel[data-axis=z]{color:#09f}.MissionSelect-inputWrapper{align-items:center;display:flex;position:relative}.MissionSelect-shortcut{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}.MissionSelect-input[aria-expanded=true]~.MissionSelect-shortcut{display:none}.MissionSelect-input{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}.MissionSelect-input[aria-expanded=true]{padding-right:8px}.MissionSelect-input:focus{border-color:#fff9}.MissionSelect-input::placeholder{color:#0000}.MissionSelect-selectedValue{pointer-events:none;align-items:center;gap:6px;display:flex;position:absolute;left:8px;right:36px;overflow:hidden}.MissionSelect-input[aria-expanded=true]~.MissionSelect-selectedValue{display:none}.MissionSelect-selectedName{color:#fff;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden}.MissionSelect-selectedValue>.MissionSelect-itemType{flex-shrink:0}.MissionSelect-popover{z-index:100;min-width:320px;max-height:var(--popover-available-height,90vh);overscroll-behavior:contain;background:#141414f2;border:1px solid #ffffff80;border-radius:3px;overflow-y:auto;box-shadow:0 8px 24px #0009}.MissionSelect-list{padding:4px 0}.MissionSelect-list:has(>.MissionSelect-group:first-child){padding-top:0}.MissionSelect-group{padding-bottom:4px}.MissionSelect-groupLabel{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}.MissionSelect-group:not(:last-child){border-bottom:1px solid #ffffff4d}.MissionSelect-item{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}.MissionSelect-list>.MissionSelect-item:first-child{margin-top:0}.MissionSelect-item[data-active-item]{background:#ffffff26}.MissionSelect-item[aria-selected=true]{background:#6496ff4d}.MissionSelect-itemHeader{align-items:center;gap:6px;display:flex}.MissionSelect-itemName{color:#fff;font-size:14px;font-weight:600}.MissionSelect-itemTypes{gap:3px;display:flex}.MissionSelect-itemType{color:#fff;background:#ff9d0066;border-radius:3px;padding:2px 5px;font-size:10px;font-weight:600}.MissionSelect-itemType:hover{background:#ff9d00b3}.MissionSelect-itemMissionName{color:#ffffff80;font-size:12px}.MissionSelect-noResults{color:#ffffff80;text-align:center;padding:12px 8px;font-size:13px}.LoadingSpinner{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite LoadingSpinner-spin}@keyframes LoadingSpinner-spin{to{transform:rotate(360deg)}}#loadingIndicator{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[data-complete=true]{animation:.3s ease-out forwards loadingComplete}@keyframes loadingComplete{0%{opacity:1}to{opacity:0}}.LoadingProgress{background:#fff3;border-radius:2px;width:200px;height:4px;overflow:hidden}.LoadingProgress-bar{background:#fff;border-radius:2px;height:100%;transition:width .1s ease-out}.LoadingProgress-text{color:#ffffffb3;font-variant-numeric:tabular-nums;font-size:14px}@keyframes showClipboardCheck{0%{opacity:1}to{opacity:.2}}.KeyboardOverlay{pointer-events:none;z-index:1;align-items:flex-end;gap:10px;display:flex;position:fixed;bottom:16px;left:50%;transform:translate(-50%)}.KeyboardOverlay-column{flex-direction:column;justify-content:center;gap:4px;display:flex}.KeyboardOverlay-row{justify-content:stretch;gap:4px;display:flex}.KeyboardOverlay-spacer{width:32px}.KeyboardOverlay-key{color:#ffffff80;white-space:nowrap;background:#0006;border:1px solid #fff3;border-radius:4px;flex:1 0 0;justify-content:center;align-items:center;min-width:32px;height:32px;padding:0 8px;font-size:11px;font-weight:600;display:flex}.KeyboardOverlay-key[data-pressed=true]{color:#fff;background:#34bbab99;border-color:#23fddc80}.KeyboardOverlay-arrow{margin-right:3px}.TouchJoystick{z-index:1;width:140px;height:140px;position:fixed;bottom:20px;left:50%;transform:translate(-50%)}.TouchJoystick--left{left:20px;transform:none}.TouchJoystick--right{left:auto;right:20px;transform:none}.TouchJoystick .back{background:#034f4c99!important;border:1px solid #00dbdf80!important;box-shadow:inset 0 0 10px #000000b3!important}.TouchJoystick .front{background:radial-gradient(circle,#17f7c6e6 0%,#09b8aaf2 100%)!important;border:2px solid #fff6!important;box-shadow:0 2px 4px #00000080,0 1px 1px #0000004d,inset 0 1px #ffffff26,inset 0 -1px 2px #0000004d!important}.DemoControls{color:#fff;z-index:2;background:#000000b3;align-items:center;gap:10px;padding:8px 12px;font-size:13px;display:flex;position:fixed;bottom:0;left:0;right:0}.DemoControls-playPause{color:#fff;cursor:pointer;background:#03529399;border:1px solid #ffffff4d;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;padding:0;font-size:14px;display:flex}@media (hover:hover){.DemoControls-playPause:hover{background:#0062b3cc}}.DemoControls-time{font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0}.DemoControls-seek[type=range]{flex:1 1 0;min-width:0;max-width:none}.DemoControls-speed{color:#fff;background:#0009;border:1px solid #ffffff4d;border-radius:3px;flex-shrink:0;padding:2px 4px;font-size:12px}.DemoDiagnosticsPanel{background:#0000008c;border:1px solid #fff3;border-radius:4px;flex-direction:column;gap:3px;min-width:320px;margin-left:8px;padding:4px 8px;display:flex}.DemoDiagnosticsPanel[data-context-lost=true]{background:#46000073;border-color:#ff5a5acc}.DemoDiagnosticsPanel-status{letter-spacing:.02em;font-size:11px;font-weight:700}.DemoDiagnosticsPanel-metrics{opacity:.92;flex-wrap:wrap;gap:4px 10px;font-size:11px;display:flex}.DemoDiagnosticsPanel-footer{flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:11px;display:flex}.DemoDiagnosticsPanel-footer button{color:#fff;cursor:pointer;background:#03529399;border:1px solid #ffffff4d;border-radius:3px;padding:1px 6px;font-size:11px}.DemoDiagnosticsPanel-footer button:hover{background:#0062b3cc}.DemoIcon{font-size:19px} diff --git a/docs/_next/static/chunks/88e3d9a60c48713e.js b/docs/_next/static/chunks/88e3d9a60c48713e.js deleted file mode 100644 index 7a9c3b33..00000000 --- a/docs/_next/static/chunks/88e3d9a60c48713e.js +++ /dev/null @@ -1,211 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47071,971,e=>{"use strict";var t=e.i(71645),a=e.i(90072),r=e.i(73949),i=e.i(91037);e.s(["useLoader",()=>i.G],971);var i=i;let n=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function o(e,o){let l=(0,r.useThree)(e=>e.gl),s=(0,i.G)(a.TextureLoader,n(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==o||o(s)},[o]),(0,t.useEffect)(()=>{if("initTexture"in l){let e=[];Array.isArray(s)?e=s:s instanceof a.Texture?e=[s]:n(s)&&(e=Object.values(s)),e.forEach(e=>{e instanceof a.Texture&&l.initTexture(e)})}},[l,s]),(0,t.useMemo)(()=>{if(!n(e))return s;{let t={},a=0;for(let r in e)t[r]=s[a++];return t}},[e,s])}o.preload=e=>i.G.preload(a.TextureLoader,e),o.clear=e=>i.G.clear(a.TextureLoader,e),e.s(["useTexture",()=>o],47071)},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},75567,e=>{"use strict";var t=e.i(90072);function a(e,r={}){let{repeat:i=[1,1],disableMipmaps:n=!1}=r;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...i),e.flipY=!1,e.anisotropy=16,n?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function r(e){let a=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return a.colorSpace=t.NoColorSpace,a.wrapS=a.wrapT=t.RepeatWrapping,a.generateMipmaps=!1,a.minFilter=t.LinearFilter,a.magFilter=t.LinearFilter,a.needsUpdate=!0,a}e.s(["setupMask",()=>r,"setupTexture",()=>a])},47021,e=>{"use strict";var t=e.i(8560);let a=` -#ifdef USE_FOG - // Check fog enabled uniform - allows toggling without shader recompilation - #ifdef USE_VOLUMETRIC_FOG - if (!fogEnabled) { - // Skip all fog calculations when disabled - } else { - #endif - - float dist = vFogDepth; - - // Discard fragments at or beyond visible distance - matches Torque's behavior - // where objects beyond visibleDistance are not rendered at all. - // This prevents fully-fogged geometry from showing as silhouettes against - // the sky's fog-to-sky gradient. - if (dist >= fogFar) { - discard; - } - - // Step 1: Calculate distance-based haze (quadratic falloff) - // Since we discard at fogFar, haze never reaches 1.0 here - float haze = 0.0; - if (dist > fogNear) { - float fogScale = 1.0 / (fogFar - fogNear); - float distFactor = (dist - fogNear) * fogScale - 1.0; - haze = 1.0 - distFactor * distFactor; - } - - // Step 2: Calculate fog volume contributions - // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false) - // All fog uses the global fogColor - see Tribes2_Fog_System.md for details - float volumeFog = 0.0; - - #ifdef USE_VOLUMETRIC_FOG - { - #ifdef USE_FOG_WORLD_POSITION - float fragmentHeight = vFogWorldPosition.y; - #else - float fragmentHeight = cameraHeight; - #endif - - float deltaY = fragmentHeight - cameraHeight; - float absDeltaY = abs(deltaY); - - // Determine if we're going up (positive) or down (negative) - if (absDeltaY > 0.01) { - // Non-horizontal ray: ray-march through fog volumes - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - // Skip inactive volumes (visibleDistance = 0) - if (volVisDist <= 0.0) continue; - - // Calculate fog factor for this volume - // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage - // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0) - // Since we don't have quality settings, we use visFactor = 1.0 - float factor = (1.0 / volVisDist) * volPct; - - // Find ray intersection with this volume's height range - float rayMinY = min(cameraHeight, fragmentHeight); - float rayMaxY = max(cameraHeight, fragmentHeight); - - // Check if ray intersects volume height range - if (rayMinY < volMaxH && rayMaxY > volMinH) { - float intersectMin = max(rayMinY, volMinH); - float intersectMax = min(rayMaxY, volMaxH); - float intersectHeight = intersectMax - intersectMin; - - // Calculate distance traveled through this volume using similar triangles: - // subDist / dist = intersectHeight / absDeltaY - float subDist = dist * (intersectHeight / absDeltaY); - - // Accumulate fog: fog += subDist * factor - volumeFog += subDist * factor; - } - } - } else { - // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - // If camera is inside this volume, apply fog for full distance - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - float factor = (1.0 / volVisDist) * volPct; - volumeFog += dist * factor; - } - } - } - } - #endif - - // Step 3: Combine haze and volume fog - // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct - // This gives fog volumes priority over haze - float volPct = min(volumeFog, 1.0); - float hazePct = haze; - if (volPct + hazePct > 1.0) { - hazePct = 1.0 - volPct; - } - float fogFactor = hazePct + volPct; - - // Apply fog using global fogColor (per-volume colors not used in Tribes 2) - gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor); - - #ifdef USE_VOLUMETRIC_FOG - } // end fogEnabled check - #endif -#endif -`;function r(){t.ShaderChunk.fog_pars_fragment=` -#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif - - // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set) - // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats - #ifdef USE_VOLUMETRIC_FOG - uniform float fogVolumeData[12]; - uniform float cameraHeight; - #endif - - #ifdef USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; - #endif -#endif -`,t.ShaderChunk.fog_fragment=a,t.ShaderChunk.fog_pars_vertex=` -#ifdef USE_FOG - varying float vFogDepth; - #ifdef USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; - #endif -#endif -`,t.ShaderChunk.fog_vertex=` -#ifdef USE_FOG - // Use Euclidean distance from camera, not view-space z-depth - // This ensures fog doesn't change when rotating the camera - vFogDepth = length(mvPosition.xyz); - #ifdef USE_FOG_WORLD_POSITION - vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; - #endif -#endif -`}function i(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.uniforms.fogEnabled=t.fogEnabled,e.vertexShader=e.vertexShader.replace("#include ",`#include -#ifdef USE_FOG - #define USE_FOG_WORLD_POSITION - #define USE_VOLUMETRIC_FOG - varying vec3 vFogWorldPosition; -#endif`),e.vertexShader=e.vertexShader.replace("#include ",`#include -#ifdef USE_FOG - vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include -#ifdef USE_FOG - #define USE_VOLUMETRIC_FOG - uniform float fogVolumeData[12]; - uniform float cameraHeight; - uniform bool fogEnabled; - #define USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",a)}e.s(["fogFragmentShader",0,a,"injectCustomFog",()=>i,"installCustomFogShader",()=>r])},48066,e=>{"use strict";let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function a(e,r,i=!0){t.cameraHeight.value=e,t.fogVolumeData.value.set(r),t.fogEnabled.value=i}function r(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function i(e){let t=new Float32Array(12);for(let a=0;a<3;a++){let r=4*a,i=e[a];i&&(t[r+0]=i.visibleDistance,t[r+1]=i.minHeight,t[r+2]=i.maxHeight,t[r+3]=i.percentage)}return t}e.s(["globalFogUniforms",0,t,"packFogVolumeData",()=>i,"resetGlobalFogUniforms",()=>r,"updateGlobalFogUniforms",()=>a])},89887,60099,e=>{"use strict";let t,a;var r=e.i(43476),i=e.i(932),n=e.i(71645),o=e.i(90072),l=e.i(49774),s=e.i(31067),c=e.i(88014),u=e.i(73949);let d=new o.Vector3,f=new o.Vector3,m=new o.Vector3,g=new o.Vector2;function p(e,t,a){let r=d.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=a.width/2,n=a.height/2;return[r.x*i+i,-(r.y*n)+n]}let h=e=>1e-10>Math.abs(e)?0:e;function y(e,t,a=""){let r="matrix3d(";for(let a=0;16!==a;a++)r+=h(t[a]*e.elements[a])+(15!==a?",":")");return a+r}let b=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>y(e,t)),v=(a=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],(e,t)=>y(e,a(t),"translate(-50%,-50%)")),x=n.forwardRef(({children:e,eps:t=.001,style:a,className:r,prepend:i,center:y,fullscreen:x,portal:k,distanceFactor:S,sprite:_=!1,transform:j=!1,occlude:M,onOcclude:E,castShadow:P,receiveShadow:C,material:F,geometry:I,zIndexRange:O=[0x1000037,0],calculatePosition:D=p,as:T="div",wrapperClass:w,pointerEvents:N="auto",...R},B)=>{let{gl:V,camera:L,scene:H,size:W,raycaster:U,events:z,viewport:A}=(0,u.useThree)(),[G]=n.useState(()=>document.createElement(T)),$=n.useRef(null),Y=n.useRef(null),q=n.useRef(0),K=n.useRef([0,0]),J=n.useRef(null),X=n.useRef(null),Z=(null==k?void 0:k.current)||z.connected||V.domElement.parentNode,Q=n.useRef(null),ee=n.useRef(!1),et=n.useMemo(()=>{var e;return M&&"blending"!==M||Array.isArray(M)&&M.length&&(e=M[0])&&"object"==typeof e&&"current"in e},[M]);n.useLayoutEffect(()=>{let e=V.domElement;M&&"blending"===M?(e.style.zIndex=`${Math.floor(O[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[M]),n.useLayoutEffect(()=>{if(Y.current){let e=$.current=c.createRoot(G);if(H.updateMatrixWorld(),j)G.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=D(Y.current,L,W);G.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Z&&(i?Z.prepend(G):Z.appendChild(G)),()=>{Z&&Z.removeChild(G),e.unmount()}}},[Z,j]),n.useLayoutEffect(()=>{w&&(G.className=w)},[w]);let ea=n.useMemo(()=>j?{position:"absolute",top:0,left:0,width:W.width,height:W.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:y?"translate3d(-50%,-50%,0)":"none",...x&&{top:-W.height/2,left:-W.width/2,width:W.width,height:W.height},...a},[a,y,x,W,j]),er=n.useMemo(()=>({position:"absolute",pointerEvents:N}),[N]);n.useLayoutEffect(()=>{var t,i;ee.current=!1,j?null==(t=$.current)||t.render(n.createElement("div",{ref:J,style:ea},n.createElement("div",{ref:X,style:er},n.createElement("div",{ref:B,className:r,style:a,children:e})))):null==(i=$.current)||i.render(n.createElement("div",{ref:B,style:ea,className:r,children:e}))});let ei=n.useRef(!0);(0,l.useFrame)(e=>{if(Y.current){L.updateMatrixWorld(),Y.current.updateWorldMatrix(!0,!1);let e=j?K.current:D(Y.current,L,W);if(j||Math.abs(q.current-L.zoom)>t||Math.abs(K.current[0]-e[0])>t||Math.abs(K.current[1]-e[1])>t){var a;let t,r,i,n,l=(a=Y.current,t=d.setFromMatrixPosition(a.matrixWorld),r=f.setFromMatrixPosition(L.matrixWorld),i=t.sub(r),n=L.getWorldDirection(m),i.angleTo(n)>Math.PI/2),s=!1;et&&(Array.isArray(M)?s=M.map(e=>e.current):"blending"!==M&&(s=[H]));let c=ei.current;s?ei.current=function(e,t,a,r){let i=d.setFromMatrixPosition(e.matrixWorld),n=i.clone();n.project(t),g.set(n.x,n.y),a.setFromCamera(g,t);let o=a.intersectObjects(r,!0);if(o.length){let e=o[0].distance;return i.distanceTo(a.ray.origin)({vertexShader:j?void 0:` - /* - This shader is from the THREE's SpriteMaterial. - We need to turn the backing plane into a Sprite - (make it always face the camera) if "transfrom" - is false. - */ - #include - - void main() { - vec2 center = vec2(0., 1.); - float rotation = 0.0; - - // This is somewhat arbitrary, but it seems to work well - // Need to figure out how to derive this dynamically if it even matters - float size = 0.03; - - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - - gl_Position = projectionMatrix * mvPosition; - } - `,fragmentShader:` - void main() { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); - } - `}),[j]);return n.createElement("group",(0,s.default)({},R,{ref:Y}),M&&!et&&n.createElement("mesh",{castShadow:P,receiveShadow:C,ref:Q},I||n.createElement("planeGeometry",null),F||n.createElement("shaderMaterial",{side:o.DoubleSide,vertexShader:en.vertexShader,fragmentShader:en.fragmentShader})))});e.s(["Html",()=>x],60099);let k=[0,0,0],S=new o.Vector3,_=(0,n.memo)(function(e){let t,a,o,s=(0,i.c)(11),{children:c,color:u,position:d,opacity:f}=e,m=void 0===u?"white":u,g=void 0===d?k:d,p=void 0===f?"fadeWithDistance":f,h="fadeWithDistance"===p,y=(0,n.useRef)(null),[b,v]=(0,n.useState)(0!==p),_=(0,n.useRef)(null);return s[0]!==h||s[1]!==b||s[2]!==p?(t=e=>{var t,a,r;let i,{camera:n}=e,o=y.current;if(!o)return;o.getWorldPosition(S);let l=(t=S.x,a=S.y,r=S.z,-((t-(i=n.matrixWorld.elements)[12])*i[8])+-((a-i[13])*i[9])+-((r-i[14])*i[10])<0);if(h){let e=l?1/0:n.position.distanceTo(S),t=e<200;if(b!==t&&v(t),_.current&&t){let t=Math.max(0,Math.min(1,1-e/200));_.current.style.opacity=t.toString()}}else{let e=!l&&0!==p;b!==e&&v(e),_.current&&(_.current.style.opacity=p.toString())}},s[0]=h,s[1]=b,s[2]=p,s[3]=t):t=s[3],(0,l.useFrame)(t),s[4]!==c||s[5]!==m||s[6]!==b||s[7]!==g?(a=b?(0,r.jsx)(x,{position:g,center:!0,children:(0,r.jsx)("div",{ref:_,className:"StaticShapeLabel",style:{color:m},children:c})}):null,s[4]=c,s[5]=m,s[6]=b,s[7]=g,s[8]=a):a=s[8],s[9]!==a?(o=(0,r.jsx)("group",{ref:y,children:a}),s[9]=a,s[10]=o):o=s[10],o});e.s(["FloatingLabel",0,_],89887)},51434,e=>{"use strict";var t=e.i(43476),a=e.i(932),r=e.i(71645),i=e.i(73949),n=e.i(90072);let o=(0,r.createContext)(void 0);function l(e){let l,c,u,d,f=(0,a.c)(7),{children:m}=e,{camera:g}=(0,i.useThree)();f[0]===Symbol.for("react.memo_cache_sentinel")?(l={audioLoader:null,audioListener:null},f[0]=l):l=f[0];let[p,h]=(0,r.useState)(l);return f[1]!==g?(c=()=>{let e=new n.AudioLoader,t=g.children.find(s);t||(t=new n.AudioListener,g.add(t)),h({audioLoader:e,audioListener:t})},u=[g],f[1]=g,f[2]=c,f[3]=u):(c=f[2],u=f[3]),(0,r.useEffect)(c,u),f[4]!==p||f[5]!==m?(d=(0,t.jsx)(o.Provider,{value:p,children:m}),f[4]=p,f[5]=m,f[6]=d):d=f[6],d}function s(e){return e instanceof n.AudioListener}function c(){let e=(0,r.useContext)(o);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}e.s(["AudioProvider",()=>l,"useAudio",()=>c])},6112,79473,58647,30064,13876,e=>{"use strict";var t=e.i(932),a=e.i(8155);let r=e=>(t,a,r)=>{let i=r.subscribe;return r.subscribe=(e,t,a)=>{let n=e;if(t){let i=(null==a?void 0:a.equalityFn)||Object.is,o=e(r.getState());n=a=>{let r=e(a);if(!i(o,r)){let e=o;t(o=r,e)}},(null==a?void 0:a.fireImmediately)&&t(o,o)}return i(n)},e(t,a,r)};e.s(["subscribeWithSelector",()=>r],79473);var i=e.i(66748);function n(e){return e.toLowerCase()}function o(e){let t=n(e.trim());return t.startsWith("$")?t.slice(1):t}let l={runtime:{runtime:null,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},world:{entitiesById:{},players:[],ghosts:[],projectiles:[],flags:[],teams:{},scores:{}},playback:{recording:null,status:"stopped",timeMs:0,rate:1,frameCursor:0,durationMs:0,streamSnapshot:null},diagnostics:{eventCounts:{"object.created":0,"object.deleted":0,"field.changed":0,"method.called":0,"global.changed":0,"batch.flushed":0},recentEvents:[],maxRecentEvents:200,webglContextLost:!1,playbackEvents:[],maxPlaybackEvents:400,rendererSamples:[],maxRendererSamples:2400}},s=(0,a.createStore)()(r(e=>({...l,setRuntime(t){let a=function(e){let t={},a={},r={},i={};for(let a of e.state.objectsById.values())t[a._id]=0,a._name&&(r[n(a._name)]=a._id,a._isDatablock&&(i[n(a._name)]=a._id));for(let t of e.state.globals.keys())a[o(t)]=0;return{objectVersionById:t,globalVersionByName:a,objectIdsByName:r,datablockIdsByName:i}}(t);e(e=>({...e,runtime:{runtime:t,objectVersionById:a.objectVersionById,globalVersionByName:a.globalVersionByName,objectIdsByName:a.objectIdsByName,datablockIdsByName:a.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,a){0!==t.length&&e(e=>{let r={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},l={...e.runtime.objectIdsByName},s={...e.runtime.datablockIdsByName},c={...e.diagnostics.eventCounts},u=[...e.diagnostics.recentEvents],d=e=>{null!=e&&(r[e]=(r[e]??0)+1)};for(let e of t){if(c[e.type]=(c[e.type]??0)+1,u.push(e),"object.created"===e.type){let t=e.object;if(d(e.objectId),t._name){let a=n(t._name);l[a]=e.objectId,t._isDatablock&&(s[a]=e.objectId)}d(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete r[e.objectId],t?._name){let e=n(t._name);delete l[e],t._isDatablock&&delete s[e]}d(t?._parent?._id);continue}if("field.changed"===e.type){d(e.objectId);continue}if("global.changed"===e.type){let t=o(e.name);i[t]=(i[t]??0)+1;continue}}let f=a?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);c["batch.flushed"]+=1,u.push({type:"batch.flushed",tick:f,events:t});let m=e.diagnostics.maxRecentEvents,g=u.length>m?u.slice(u.length-m):u;return{...e,runtime:{...e.runtime,objectVersionById:r,globalVersionByName:i,objectIdsByName:l,datablockIdsByName:s,lastRuntimeTick:f},diagnostics:{...e.diagnostics,eventCounts:c,recentEvents:g}}})},setDemoRecording(t){let a=Math.max(0,(t?.duration??0)*1e3),r=function(e=0){let t=Error().stack;if(!t)return null;let a=t.split("\n").map(e=>e.trim()).filter(Boolean).slice(1+e,9+e);return a.length>0?a.join(" <= "):null}(1);e(e=>{let i=e.playback.streamSnapshot,n=e.playback.recording,o={t:Date.now(),kind:"recording.set",message:"setDemoRecording invoked",playbackStatus:e.playback.status,playbackTimeMs:e.playback.timeMs,frameCursor:e.playback.frameCursor,streamEntityCount:i?.entities.length??0,streamCameraMode:i?.camera?.mode??null,streamExhausted:i?.exhausted??!1,meta:{previousMissionName:n?.missionName??null,nextMissionName:t?.missionName??null,previousDurationSec:n?Number(n.duration.toFixed(3)):null,nextDurationSec:t?Number(t.duration.toFixed(3)):null,isNull:null==t,isMetadataOnly:!!t?.isMetadataOnly,isPartial:!!t?.isPartial,hasStreamingPlayback:!!t?.streamingPlayback,stack:r??"unavailable"}};return{...e,world:function(e){if(!e)return{entitiesById:{},players:[],ghosts:[],projectiles:[],flags:[],teams:{},scores:{}};let t={},a=[],r=[],i=[],n=[];for(let o of e.entities){let e=String(o.id);t[e]=o;let l=o.type.toLowerCase();if("player"===l){a.push(e),e.startsWith("player_")&&r.push(e);continue}if("projectile"===l){i.push(e);continue}(o.dataBlock?.toLowerCase()==="flag"||o.dataBlock?.toLowerCase().includes("flag"))&&n.push(e)}return{entitiesById:t,players:a,ghosts:r,projectiles:i,flags:n,teams:{},scores:{}}}(t),playback:{recording:t,status:"stopped",timeMs:0,rate:1,frameCursor:0,durationMs:a,streamSnapshot:null},diagnostics:{...e.diagnostics,webglContextLost:!1,playbackEvents:[o],rendererSamples:[]}}})},setPlaybackTime(t){e(e=>{var a,r,i;let n=(a=t,r=0,i=e.playback.durationMs,a<0?0:a>i?i:a);return{...e,playback:{...e.playback,timeMs:n,frameCursor:n}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var a,r,i;let n=Number.isFinite(t)?(r=.01,i=16,(a=t)<.01?.01:a>16?16:a):1;e(e=>({...e,playback:{...e.playback,rate:n}}))},setPlaybackFrameCursor(t){let a=Number.isFinite(t)?t:0;e(e=>({...e,playback:{...e.playback,frameCursor:a}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))},setWebglContextLost(t){e(e=>({...e,diagnostics:{...e.diagnostics,webglContextLost:t}}))},recordPlaybackDiagnosticEvent(t){e(e=>{let a=e.playback.streamSnapshot,r={t:Date.now(),kind:t.kind,message:t.message,playbackStatus:e.playback.status,playbackTimeMs:e.playback.timeMs,frameCursor:e.playback.frameCursor,streamEntityCount:a?.entities.length??0,streamCameraMode:a?.camera?.mode??null,streamExhausted:a?.exhausted??!1,meta:t.meta},i=[...e.diagnostics.playbackEvents,r],n=e.diagnostics.maxPlaybackEvents,o=i.length>n?i.slice(i.length-n):i;return{...e,diagnostics:{...e.diagnostics,playbackEvents:o}}})},appendRendererSample(t){e(e=>{let a=e.playback.streamSnapshot,r={t:t.t??Date.now(),playbackStatus:e.playback.status,playbackTimeMs:e.playback.timeMs,frameCursor:e.playback.frameCursor,streamEntityCount:a?.entities.length??0,streamCameraMode:a?.camera?.mode??null,streamExhausted:a?.exhausted??!1,geometries:t.geometries,textures:t.textures,programs:t.programs,renderCalls:t.renderCalls,renderTriangles:t.renderTriangles,renderPoints:t.renderPoints,renderLines:t.renderLines,sceneObjects:t.sceneObjects,visibleSceneObjects:t.visibleSceneObjects,jsHeapUsed:t.jsHeapUsed,jsHeapTotal:t.jsHeapTotal,jsHeapLimit:t.jsHeapLimit},i=[...e.diagnostics.rendererSamples,r],n=e.diagnostics.maxRendererSamples,o=i.length>n?i.slice(i.length-n):i;return{...e,diagnostics:{...e.diagnostics,rendererSamples:o}}})},clearPlaybackDiagnostics(){e(e=>({...e,diagnostics:{...e.diagnostics,webglContextLost:!1,playbackEvents:[],rendererSamples:[]}}))}})));function c(){return s}function u(e,t){return(0,i.useStoreWithEqualityFn)(s,e,t)}function d(e){let a,r,i,n=(0,t.c)(7),o=u(f);n[0]!==e?(a=t=>null==e?-1:t.runtime.objectVersionById[e]??-1,n[0]=e,n[1]=a):a=n[1];let l=u(a);if(null==e||!o||-1===l)return;n[2]!==e||n[3]!==o.state.objectsById?(r=o.state.objectsById.get(e),n[2]=e,n[3]=o.state.objectsById,n[4]=r):r=n[4];let s=r;return n[5]!==s?(i=s?{...s}:void 0,n[5]=s,n[6]=i):i=n[6],i}function f(e){return e.runtime.runtime}function m(e){let a,r,i,o,l,s=(0,t.c)(11),c=u(g);s[0]!==e?(a=e?n(e):"",s[0]=e,s[1]=a):a=s[1];let d=a;s[2]!==d?(r=e=>d?e.runtime.objectIdsByName[d]:void 0,s[2]=d,s[3]=r):r=s[3];let f=u(r);s[4]!==f?(i=e=>null==f?-1:e.runtime.objectVersionById[f]??-1,s[4]=f,s[5]=i):i=s[5];let m=u(i);if(!c||!d||null==f||-1===m)return;s[6]!==f||s[7]!==c.state.objectsById?(o=c.state.objectsById.get(f),s[6]=f,s[7]=c.state.objectsById,s[8]=o):o=s[8];let p=o;return s[9]!==p?(l=p?{...p}:void 0,s[9]=p,s[10]=l):l=s[10],l}function g(e){return e.runtime.runtime}function p(e){let a,r,i,o,l,s=(0,t.c)(11),c=u(h);s[0]!==e?(a=e?n(e):"",s[0]=e,s[1]=a):a=s[1];let d=a;s[2]!==d?(r=e=>d?e.runtime.datablockIdsByName[d]:void 0,s[2]=d,s[3]=r):r=s[3];let f=u(r);s[4]!==f?(i=e=>null==f?-1:e.runtime.objectVersionById[f]??-1,s[4]=f,s[5]=i):i=s[5];let m=u(i);if(!c||!d||null==f||-1===m)return;s[6]!==f||s[7]!==c.state.objectsById?(o=c.state.objectsById.get(f),s[6]=f,s[7]=c.state.objectsById,s[8]=o):o=s[8];let g=o;return s[9]!==g?(l=g?{...g}:void 0,s[9]=g,s[10]=l):l=s[10],l}function h(e){return e.runtime.runtime}function y(e,a){let r,i,n,o,l=(0,t.c)(13);l[0]!==a?(r=void 0===a?[]:a,l[0]=a,l[1]=r):r=l[1];let s=r,c=u(k);l[2]!==e?(i=t=>null==e?-1:t.runtime.objectVersionById[e]??-1,l[2]=e,l[3]=i):i=l[3];let d=u(i);if(null==e){let e;return l[4]!==s?(e=s.map(x),l[4]=s,l[5]=e):e=l[5],e}if(!c||-1===d){let e;return l[6]!==s?(e=s.map(v),l[6]=s,l[7]=e):e=l[7],e}let f=c.state.objectsById;if(l[8]!==e||l[9]!==c.state.objectsById){o=Symbol.for("react.early_return_sentinel");e:{let t=f.get(e);if(!t?._children){let e;l[12]===Symbol.for("react.memo_cache_sentinel")?(e=[],l[12]=e):e=l[12],o=e;break e}n=t._children.map(b)}l[8]=e,l[9]=c.state.objectsById,l[10]=n,l[11]=o}else n=l[10],o=l[11];return o!==Symbol.for("react.early_return_sentinel")?o:n}function b(e){return e._id}function v(e){return e._id}function x(e){return e._id}function k(e){return e.runtime.runtime}e.s(["engineStore",0,s,"useDatablockByName",()=>p,"useEngineSelector",()=>u,"useEngineStoreApi",()=>c,"useRuntimeChildIds",()=>y,"useRuntimeObjectById",()=>d,"useRuntimeObjectByName",()=>m],58647);let S={maxRuntimeEvents:80,maxPlaybackEvents:200,maxRendererSamples:1200,maxStreamEntities:40};function _(e){return e&&"object"==typeof e?{kind:"TorqueObject",id:"number"==typeof e._id?e._id:null,className:"string"==typeof e._className?e._className:null,class:"string"==typeof e._class?e._class:null,name:"string"==typeof e._name?e._name:null,isDatablock:!!e._isDatablock,parentId:e._parent&&"number"==typeof e._parent._id?e._parent._id:null,childCount:Array.isArray(e._children)?e._children.length:0}:null}function j(e,t={}){let a,r,i,n={...S,...t},o=(a=new WeakSet,function e(t,r=0){if(null==t)return t;let i=typeof t;if("string"===i||"number"===i||"boolean"===i)return t;if("bigint"===i)return t.toString();if("function"===i)return`[Function ${t.name||"anonymous"}]`;if("object"!==i)return String(t);if("_id"in t&&"_className"in t)return _(t);if(t instanceof Date)return t.toISOString();if(Array.isArray(t)){if(r>=2)return{kind:"Array",length:t.length};let a=t.slice(0,8).map(t=>e(t,r+1));return{kind:"Array",length:t.length,sample:a}}if(a.has(t))return"[Circular]";if(a.add(t),r>=2)return{kind:t?.constructor?.name??"Object"};let n=Object.keys(t).slice(0,12),o={};for(let a of n)try{o[a]=e(t[a],r+1)}catch(e){o[a]=`[Unserializable: ${e.message}]`}return Object.keys(t).length>n.length&&(o.__truncatedKeys=Object.keys(t).length-n.length),o}),l=e.diagnostics.recentEvents.slice(-n.maxRuntimeEvents).map(e=>(function(e,t){if("object.created"===e.type||"object.deleted"===e.type)return{type:e.type,objectId:e.objectId,object:_(e.object)};if("field.changed"===e.type)return{type:e.type,objectId:e.objectId,field:e.field,value:t(e.value),previousValue:t(e.previousValue),object:_(e.object)};if("method.called"===e.type)return{type:e.type,className:e.className,methodName:e.methodName,objectId:e.objectId??null,args:t(e.args)};if("global.changed"===e.type)return{type:e.type,name:e.name,value:t(e.value),previousValue:t(e.previousValue)};if("batch.flushed"===e.type){let t={};for(let a of e.events)t[a.type]=(t[a.type]??0)+1;return{type:e.type,tick:e.tick,eventCount:e.events.length,byType:t}}return{type:"unknown"}})(e,o)),s=e.diagnostics.playbackEvents.slice(-n.maxPlaybackEvents).map(e=>({...e,meta:e.meta?o(e.meta):void 0})),c=e.diagnostics.rendererSamples.slice(-n.maxRendererSamples);return{generatedAt:new Date().toISOString(),playback:{status:e.playback.status,timeMs:e.playback.timeMs,frameCursor:e.playback.frameCursor,rate:e.playback.rate,durationMs:e.playback.durationMs,recording:(r=e.playback.recording)?{duration:r.duration,missionName:r.missionName,gameType:r.gameType,isMetadataOnly:!!r.isMetadataOnly,isPartial:!!r.isPartial,hasStreamingPlayback:!!r.streamingPlayback,entitiesCount:r.entities.length,cameraModesCount:r.cameraModes.length,controlPlayerGhostId:r.controlPlayerGhostId??null}:null,streamSnapshot:function(e,t){let a=e.playback.streamSnapshot;if(!a)return null;let r={},i={};for(let e of a.entities){let t=e.type||"Unknown";r[t]=(r[t]??0)+1,e.visual?.kind&&(i[e.visual.kind]=(i[e.visual.kind]??0)+1)}let n=a.entities.slice(0,t).map(e=>({id:e.id,type:e.type,dataBlock:e.dataBlock??null,className:e.className??null,ghostIndex:e.ghostIndex??null,dataBlockId:e.dataBlockId??null,shapeHint:e.shapeHint??null,visualKind:e.visual?.kind??null,hasPosition:!!e.position,hasRotation:!!e.rotation}));return{timeSec:a.timeSec,exhausted:a.exhausted,cameraMode:a.camera?.mode??null,controlEntityId:a.camera?.controlEntityId??null,orbitTargetId:a.camera?.orbitTargetId??null,controlPlayerGhostId:a.controlPlayerGhostId??null,entityCount:a.entities.length,entitiesByType:r,visualsByKind:i,entitySample:n,status:a.status}}(e,n.maxStreamEntities)},runtime:(i=e.runtime.runtime)?{lastRuntimeTick:e.runtime.lastRuntimeTick,objectCount:i.state.objectsById.size,datablockCount:i.state.datablocks.size,globalCount:i.state.globals.size,activePackageCount:i.state.activePackages.length,executedScriptCount:i.state.executedScripts.size,failedScriptCount:i.state.failedScripts.size}:null,diagnostics:{webglContextLost:e.diagnostics.webglContextLost,eventCounts:e.diagnostics.eventCounts,playbackEventCount:e.diagnostics.playbackEvents.length,rendererSampleCount:e.diagnostics.rendererSamples.length,runtimeEventCount:e.diagnostics.recentEvents.length,playbackEventsByKind:function(e){let t={};for(let a of e)t[a.kind]=(t[a.kind]??0)+1;return t}(e.diagnostics.playbackEvents),rendererTrend:function(e){if(e.length<2)return null;let t=e[0],a=e[e.length-1];return{sampleCount:e.length,durationSec:Number(((a.t-t.t)/1e3).toFixed(3)),geometriesDelta:a.geometries-t.geometries,texturesDelta:a.textures-t.textures,programsDelta:a.programs-t.programs,sceneObjectsDelta:a.sceneObjects-t.sceneObjects,visibleSceneObjectsDelta:a.visibleSceneObjects-t.visibleSceneObjects,renderCallsDelta:a.renderCalls-t.renderCalls}}(c),playbackEvents:s,rendererSamples:c,runtimeEvents:l}}}function M(e,t={}){return JSON.stringify(j(e,t),null,2)}function E(e){return p(e)}e.s(["buildSerializableDiagnosticsJson",()=>M,"buildSerializableDiagnosticsSnapshot",()=>j],30064),e.s([],13876),e.s(["useDatablock",()=>E],6112)},61921,e=>{e.v(t=>Promise.all(["static/chunks/cb4089eec9313f48.js"].map(t=>e.l(t))).then(()=>t(29055)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/b9c295cb642f6712.js"].map(t=>e.l(t))).then(()=>t(63724)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/6e74e9455d83b68c.js"].map(t=>e.l(t))).then(()=>t(42585)))},84968,e=>{e.v(t=>Promise.all(["static/chunks/70bf3e06d5674fac.js"].map(t=>e.l(t))).then(()=>t(90208)))},59197,e=>{e.v(t=>Promise.all(["static/chunks/0be79f7f5e0597a7.css","static/chunks/1cf33c843f96e1c9.js"].map(t=>e.l(t))).then(()=>t(94247)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/ad5913f83864409c.js b/docs/_next/static/chunks/ad5913f83864409c.js deleted file mode 100644 index c499e6df..00000000 --- a/docs/_next/static/chunks/ad5913f83864409c.js +++ /dev/null @@ -1,528 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,38360,(e,t,r)=>{var a={À:"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",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(a).join("|"),i=RegExp(n,"g"),o=RegExp(n,"");function s(e){return a[e]}var l=function(e){return e.replace(i,s)};t.exports=l,t.exports.has=function(e){return!!e.match(o)},t.exports.remove=l},29402,(e,t,r)=>{var a,n,i,o,s="__lodash_hash_undefined__",l=1/0,u="[object Arguments]",c="[object Array]",d="[object Boolean]",f="[object Date]",h="[object Error]",m="[object Function]",p="[object Map]",g="[object Number]",v="[object Object]",y="[object Promise]",A="[object RegExp]",F="[object Set]",b="[object String]",C="[object Symbol]",B="[object WeakMap]",S="[object ArrayBuffer]",x="[object DataView]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,D=/^\./,k=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,I=/\\(\\)?/g,w=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[u]=R[c]=R[S]=R[d]=R[x]=R[f]=R[h]=R[m]=R[p]=R[g]=R[v]=R[A]=R[F]=R[b]=R[B]=!1;var P=e.g&&e.g.Object===Object&&e.g,G="object"==typeof self&&self&&self.Object===Object&&self,L=P||G||Function("return this")(),j=r&&!r.nodeType&&r,_=j&&t&&!t.nodeType&&t,O=_&&_.exports===j&&P.process,U=function(){try{return O&&O.binding("util")}catch(e){}}(),H=U&&U.isTypedArray;function N(e,t){for(var r=-1,a=e?e.length:0,n=Array(a);++r-1},eC.prototype.set=function(e,t){var r=this.__data__,a=eE(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},eB.prototype.clear=function(){this.__data__={hash:new eb,map:new(el||eC),string:new eb}},eB.prototype.delete=function(e){return eP(this,e).delete(e)},eB.prototype.get=function(e){return eP(this,e).get(e)},eB.prototype.has=function(e){return eP(this,e).has(e)},eB.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eS.prototype.add=eS.prototype.push=function(e){return this.__data__.set(e,s),this},eS.prototype.has=function(e){return this.__data__.has(e)},ex.prototype.clear=function(){this.__data__=new eC},ex.prototype.delete=function(e){return this.__data__.delete(e)},ex.prototype.get=function(e){return this.__data__.get(e)},ex.prototype.has=function(e){return this.__data__.has(e)},ex.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eC){var a=r.__data__;if(!el||a.length<199)return a.push([e,t]),this;r=this.__data__=new eB(a)}return r.set(e,t),this};var eM=(a=function(e,t){return e&&eD(e,t,e0)},function(e,t){if(null==e)return e;if(!eq(e))return a(e,t);for(var r=e.length,n=-1,i=Object(e);++ns))return!1;var u=i.get(e);if(u&&i.get(t))return u==t;var c=-1,d=!0,f=1&n?new eS:void 0;for(i.set(e,t),i.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==C}var e$=H?J(H):function(e){return eY(e)&&eW(e.length)&&!!R[ee.call(e)]};function e0(e){return eq(e)?function(e,t){var r=ez(e)||eV(e)?function(e,t){for(var r=-1,a=Array(e);++rt||i&&o&&l&&!s&&!u||a&&o&&l||!r&&l||!n)return 1;if(!a&&!i&&!u&&e=s)return l;return l*("desc"==r[a]?-1:1)}}return e.index-t.index}(e,t,r)});l--;)s[l]=s[l].value;return s}(e,t,r))}},76775,(e,t,r)=>{function a(e,t,r,a){return Math.round(e/r)+" "+a+(t>=1.5*r?"s":"")}t.exports=function(e,t){t=t||{};var r,n,i,o,s=typeof e;if("string"===s&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(u){var c=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:break}}}return}if("number"===s&&isFinite(e)){return t.long?(n=Math.abs(r=e))>=864e5?a(r,n,864e5,"day"):n>=36e5?a(r,n,36e5,"hour"):n>=6e4?a(r,n,6e4,"minute"):n>=1e3?a(r,n,1e3,"second"):r+" ms":(o=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":o>=36e5?Math.round(i/36e5)+"h":o>=6e4?Math.round(i/6e4)+"m":o>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},7003,(e,t,r)=>{t.exports=function(t){function r(e){let t,n,i,o=null;function s(...e){if(!s.enabled)return;let a=Number(new Date);s.diff=a-(t||a),s.prev=t,s.curr=a,t=a,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let n=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,a)=>{if("%%"===t)return"%";n++;let i=r.formatters[a];if("function"==typeof i){let r=e[n];t=i.call(s,r),e.splice(n,1),n--}return t}),r.formatArgs.call(s,e),(s.log||r.log).apply(s,e)}return s.namespace=e,s.useColors=r.useColors(),s.color=r.selectColor(e),s.extend=a,s.destroy=r.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==r.namespaces&&(n=r.namespaces,i=r.enabled(e)),i),set:e=>{o=e}}),"function"==typeof r.init&&r.init(s),s}function a(e,t){let a=r(this.namespace+(void 0===t?":":t)+e);return a.log=this.log,a}function n(e,t){let r=0,a=0,n=-1,i=0;for(;r"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){for(let t of(r.save(e),r.namespaces=e,r.names=[],r.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===t[0]?r.skips.push(t.slice(1)):r.names.push(t)},r.enabled=function(e){for(let t of r.skips)if(n(e,t))return!1;for(let t of r.names)if(n(e,t))return!0;return!1},r.humanize=e.r(76775),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(e=>{r[e]=t[e]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(e){let t=0;for(let r=0;r{let a;var n=e.i(47167);r.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let a=0,n=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(a++,"%c"===e&&(n=a))}),e.splice(n,0,r)},r.save=function(e){try{e?r.storage.setItem("debug",e):r.storage.removeItem("debug")}catch(e){}},r.load=function(){let e;try{e=r.storage.getItem("debug")||r.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==n.default&&"env"in n.default&&(e=n.default.env.DEBUG),e},r.useColors=function(){let e;return"undefined"!=typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},r.storage=function(){try{return localStorage}catch(e){}}(),a=!1,r.destroy=()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},r.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],r.log=console.debug||console.log||(()=>{}),t.exports=e.r(7003)(r);let{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},81405,(e,t,r)=>{var a;e.e,(a=function(){function e(e){return n.appendChild(e.dom),e}function t(e){for(var t=0;to+1e3&&(l.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){i=this.end()},domElement:n,setMode:t}}).Panel=function(e,t,r){var a=1/0,n=0,i=Math.round,o=i(window.devicePixelRatio||1),s=80*o,l=48*o,u=3*o,c=2*o,d=3*o,f=15*o,h=74*o,m=30*o,p=document.createElement("canvas");p.width=s,p.height=l,p.style.cssText="width:80px;height:48px";var g=p.getContext("2d");return g.font="bold "+9*o+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=r,g.fillRect(0,0,s,l),g.fillStyle=t,g.fillText(e,u,c),g.fillRect(d,f,h,m),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(d,f,h,m),{dom:p,update:function(l,v){a=Math.min(a,l),n=Math.max(n,l),g.fillStyle=r,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(i(l)+" "+e+" ("+i(a)+"-"+i(n)+")",u,c),g.drawImage(p,d+o,f,h-o,m,d,f,h-o,m),g.fillRect(d+h-o,f,o,m),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(d+h-o,f,o,i((1-l/v)*m))}}},t.exports=a},75840,e=>{e.v({Bar:"PlayerHUD-module__-E1Scq__Bar",BarFill:"PlayerHUD-module__-E1Scq__BarFill",ChatWindow:"PlayerHUD-module__-E1Scq__ChatWindow",EnergyBar:"PlayerHUD-module__-E1Scq__EnergyBar PlayerHUD-module__-E1Scq__Bar",HealthBar:"PlayerHUD-module__-E1Scq__HealthBar PlayerHUD-module__-E1Scq__Bar",PlayerHUD:"PlayerHUD-module__-E1Scq__PlayerHUD"})},31713,e=>{"use strict";let t;var r,a,n=e.i(43476),i=e.i(932),o=e.i(71645),s=e.i(91037),l=e.i(8560),u=e.i(90072);e.s(["ACESFilmicToneMapping",()=>u.ACESFilmicToneMapping,"AddEquation",()=>u.AddEquation,"AddOperation",()=>u.AddOperation,"AdditiveAnimationBlendMode",()=>u.AdditiveAnimationBlendMode,"AdditiveBlending",()=>u.AdditiveBlending,"AgXToneMapping",()=>u.AgXToneMapping,"AlphaFormat",()=>u.AlphaFormat,"AlwaysCompare",()=>u.AlwaysCompare,"AlwaysDepth",()=>u.AlwaysDepth,"AlwaysStencilFunc",()=>u.AlwaysStencilFunc,"AmbientLight",()=>u.AmbientLight,"AnimationAction",()=>u.AnimationAction,"AnimationClip",()=>u.AnimationClip,"AnimationLoader",()=>u.AnimationLoader,"AnimationMixer",()=>u.AnimationMixer,"AnimationObjectGroup",()=>u.AnimationObjectGroup,"AnimationUtils",()=>u.AnimationUtils,"ArcCurve",()=>u.ArcCurve,"ArrayCamera",()=>u.ArrayCamera,"ArrowHelper",()=>u.ArrowHelper,"AttachedBindMode",()=>u.AttachedBindMode,"Audio",()=>u.Audio,"AudioAnalyser",()=>u.AudioAnalyser,"AudioContext",()=>u.AudioContext,"AudioListener",()=>u.AudioListener,"AudioLoader",()=>u.AudioLoader,"AxesHelper",()=>u.AxesHelper,"BackSide",()=>u.BackSide,"BasicDepthPacking",()=>u.BasicDepthPacking,"BasicShadowMap",()=>u.BasicShadowMap,"BatchedMesh",()=>u.BatchedMesh,"Bone",()=>u.Bone,"BooleanKeyframeTrack",()=>u.BooleanKeyframeTrack,"Box2",()=>u.Box2,"Box3",()=>u.Box3,"Box3Helper",()=>u.Box3Helper,"BoxGeometry",()=>u.BoxGeometry,"BoxHelper",()=>u.BoxHelper,"BufferAttribute",()=>u.BufferAttribute,"BufferGeometry",()=>u.BufferGeometry,"BufferGeometryLoader",()=>u.BufferGeometryLoader,"ByteType",()=>u.ByteType,"Cache",()=>u.Cache,"Camera",()=>u.Camera,"CameraHelper",()=>u.CameraHelper,"CanvasTexture",()=>u.CanvasTexture,"CapsuleGeometry",()=>u.CapsuleGeometry,"CatmullRomCurve3",()=>u.CatmullRomCurve3,"CineonToneMapping",()=>u.CineonToneMapping,"CircleGeometry",()=>u.CircleGeometry,"ClampToEdgeWrapping",()=>u.ClampToEdgeWrapping,"Clock",()=>u.Clock,"Color",()=>u.Color,"ColorKeyframeTrack",()=>u.ColorKeyframeTrack,"ColorManagement",()=>u.ColorManagement,"CompressedArrayTexture",()=>u.CompressedArrayTexture,"CompressedCubeTexture",()=>u.CompressedCubeTexture,"CompressedTexture",()=>u.CompressedTexture,"CompressedTextureLoader",()=>u.CompressedTextureLoader,"ConeGeometry",()=>u.ConeGeometry,"ConstantAlphaFactor",()=>u.ConstantAlphaFactor,"ConstantColorFactor",()=>u.ConstantColorFactor,"Controls",()=>u.Controls,"CubeCamera",()=>u.CubeCamera,"CubeDepthTexture",()=>u.CubeDepthTexture,"CubeReflectionMapping",()=>u.CubeReflectionMapping,"CubeRefractionMapping",()=>u.CubeRefractionMapping,"CubeTexture",()=>u.CubeTexture,"CubeTextureLoader",()=>u.CubeTextureLoader,"CubeUVReflectionMapping",()=>u.CubeUVReflectionMapping,"CubicBezierCurve",()=>u.CubicBezierCurve,"CubicBezierCurve3",()=>u.CubicBezierCurve3,"CubicInterpolant",()=>u.CubicInterpolant,"CullFaceBack",()=>u.CullFaceBack,"CullFaceFront",()=>u.CullFaceFront,"CullFaceFrontBack",()=>u.CullFaceFrontBack,"CullFaceNone",()=>u.CullFaceNone,"Curve",()=>u.Curve,"CurvePath",()=>u.CurvePath,"CustomBlending",()=>u.CustomBlending,"CustomToneMapping",()=>u.CustomToneMapping,"CylinderGeometry",()=>u.CylinderGeometry,"Cylindrical",()=>u.Cylindrical,"Data3DTexture",()=>u.Data3DTexture,"DataArrayTexture",()=>u.DataArrayTexture,"DataTexture",()=>u.DataTexture,"DataTextureLoader",()=>u.DataTextureLoader,"DataUtils",()=>u.DataUtils,"DecrementStencilOp",()=>u.DecrementStencilOp,"DecrementWrapStencilOp",()=>u.DecrementWrapStencilOp,"DefaultLoadingManager",()=>u.DefaultLoadingManager,"DepthFormat",()=>u.DepthFormat,"DepthStencilFormat",()=>u.DepthStencilFormat,"DepthTexture",()=>u.DepthTexture,"DetachedBindMode",()=>u.DetachedBindMode,"DirectionalLight",()=>u.DirectionalLight,"DirectionalLightHelper",()=>u.DirectionalLightHelper,"DiscreteInterpolant",()=>u.DiscreteInterpolant,"DodecahedronGeometry",()=>u.DodecahedronGeometry,"DoubleSide",()=>u.DoubleSide,"DstAlphaFactor",()=>u.DstAlphaFactor,"DstColorFactor",()=>u.DstColorFactor,"DynamicCopyUsage",()=>u.DynamicCopyUsage,"DynamicDrawUsage",()=>u.DynamicDrawUsage,"DynamicReadUsage",()=>u.DynamicReadUsage,"EdgesGeometry",()=>u.EdgesGeometry,"EllipseCurve",()=>u.EllipseCurve,"EqualCompare",()=>u.EqualCompare,"EqualDepth",()=>u.EqualDepth,"EqualStencilFunc",()=>u.EqualStencilFunc,"EquirectangularReflectionMapping",()=>u.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>u.EquirectangularRefractionMapping,"Euler",()=>u.Euler,"EventDispatcher",()=>u.EventDispatcher,"ExternalTexture",()=>u.ExternalTexture,"ExtrudeGeometry",()=>u.ExtrudeGeometry,"FileLoader",()=>u.FileLoader,"Float16BufferAttribute",()=>u.Float16BufferAttribute,"Float32BufferAttribute",()=>u.Float32BufferAttribute,"FloatType",()=>u.FloatType,"Fog",()=>u.Fog,"FogExp2",()=>u.FogExp2,"FramebufferTexture",()=>u.FramebufferTexture,"FrontSide",()=>u.FrontSide,"Frustum",()=>u.Frustum,"FrustumArray",()=>u.FrustumArray,"GLBufferAttribute",()=>u.GLBufferAttribute,"GLSL1",()=>u.GLSL1,"GLSL3",()=>u.GLSL3,"GreaterCompare",()=>u.GreaterCompare,"GreaterDepth",()=>u.GreaterDepth,"GreaterEqualCompare",()=>u.GreaterEqualCompare,"GreaterEqualDepth",()=>u.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>u.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>u.GreaterStencilFunc,"GridHelper",()=>u.GridHelper,"Group",()=>u.Group,"HalfFloatType",()=>u.HalfFloatType,"HemisphereLight",()=>u.HemisphereLight,"HemisphereLightHelper",()=>u.HemisphereLightHelper,"IcosahedronGeometry",()=>u.IcosahedronGeometry,"ImageBitmapLoader",()=>u.ImageBitmapLoader,"ImageLoader",()=>u.ImageLoader,"ImageUtils",()=>u.ImageUtils,"IncrementStencilOp",()=>u.IncrementStencilOp,"IncrementWrapStencilOp",()=>u.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>u.InstancedBufferAttribute,"InstancedBufferGeometry",()=>u.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>u.InstancedInterleavedBuffer,"InstancedMesh",()=>u.InstancedMesh,"Int16BufferAttribute",()=>u.Int16BufferAttribute,"Int32BufferAttribute",()=>u.Int32BufferAttribute,"Int8BufferAttribute",()=>u.Int8BufferAttribute,"IntType",()=>u.IntType,"InterleavedBuffer",()=>u.InterleavedBuffer,"InterleavedBufferAttribute",()=>u.InterleavedBufferAttribute,"Interpolant",()=>u.Interpolant,"InterpolateDiscrete",()=>u.InterpolateDiscrete,"InterpolateLinear",()=>u.InterpolateLinear,"InterpolateSmooth",()=>u.InterpolateSmooth,"InterpolationSamplingMode",()=>u.InterpolationSamplingMode,"InterpolationSamplingType",()=>u.InterpolationSamplingType,"InvertStencilOp",()=>u.InvertStencilOp,"KeepStencilOp",()=>u.KeepStencilOp,"KeyframeTrack",()=>u.KeyframeTrack,"LOD",()=>u.LOD,"LatheGeometry",()=>u.LatheGeometry,"Layers",()=>u.Layers,"LessCompare",()=>u.LessCompare,"LessDepth",()=>u.LessDepth,"LessEqualCompare",()=>u.LessEqualCompare,"LessEqualDepth",()=>u.LessEqualDepth,"LessEqualStencilFunc",()=>u.LessEqualStencilFunc,"LessStencilFunc",()=>u.LessStencilFunc,"Light",()=>u.Light,"LightProbe",()=>u.LightProbe,"Line",()=>u.Line,"Line3",()=>u.Line3,"LineBasicMaterial",()=>u.LineBasicMaterial,"LineCurve",()=>u.LineCurve,"LineCurve3",()=>u.LineCurve3,"LineDashedMaterial",()=>u.LineDashedMaterial,"LineLoop",()=>u.LineLoop,"LineSegments",()=>u.LineSegments,"LinearFilter",()=>u.LinearFilter,"LinearInterpolant",()=>u.LinearInterpolant,"LinearMipMapLinearFilter",()=>u.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>u.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>u.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>u.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>u.LinearSRGBColorSpace,"LinearToneMapping",()=>u.LinearToneMapping,"LinearTransfer",()=>u.LinearTransfer,"Loader",()=>u.Loader,"LoaderUtils",()=>u.LoaderUtils,"LoadingManager",()=>u.LoadingManager,"LoopOnce",()=>u.LoopOnce,"LoopPingPong",()=>u.LoopPingPong,"LoopRepeat",()=>u.LoopRepeat,"MOUSE",()=>u.MOUSE,"Material",()=>u.Material,"MaterialLoader",()=>u.MaterialLoader,"MathUtils",()=>u.MathUtils,"Matrix2",()=>u.Matrix2,"Matrix3",()=>u.Matrix3,"Matrix4",()=>u.Matrix4,"MaxEquation",()=>u.MaxEquation,"Mesh",()=>u.Mesh,"MeshBasicMaterial",()=>u.MeshBasicMaterial,"MeshDepthMaterial",()=>u.MeshDepthMaterial,"MeshDistanceMaterial",()=>u.MeshDistanceMaterial,"MeshLambertMaterial",()=>u.MeshLambertMaterial,"MeshMatcapMaterial",()=>u.MeshMatcapMaterial,"MeshNormalMaterial",()=>u.MeshNormalMaterial,"MeshPhongMaterial",()=>u.MeshPhongMaterial,"MeshPhysicalMaterial",()=>u.MeshPhysicalMaterial,"MeshStandardMaterial",()=>u.MeshStandardMaterial,"MeshToonMaterial",()=>u.MeshToonMaterial,"MinEquation",()=>u.MinEquation,"MirroredRepeatWrapping",()=>u.MirroredRepeatWrapping,"MixOperation",()=>u.MixOperation,"MultiplyBlending",()=>u.MultiplyBlending,"MultiplyOperation",()=>u.MultiplyOperation,"NearestFilter",()=>u.NearestFilter,"NearestMipMapLinearFilter",()=>u.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>u.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>u.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>u.NearestMipmapNearestFilter,"NeutralToneMapping",()=>u.NeutralToneMapping,"NeverCompare",()=>u.NeverCompare,"NeverDepth",()=>u.NeverDepth,"NeverStencilFunc",()=>u.NeverStencilFunc,"NoBlending",()=>u.NoBlending,"NoColorSpace",()=>u.NoColorSpace,"NoNormalPacking",()=>u.NoNormalPacking,"NoToneMapping",()=>u.NoToneMapping,"NormalAnimationBlendMode",()=>u.NormalAnimationBlendMode,"NormalBlending",()=>u.NormalBlending,"NormalGAPacking",()=>u.NormalGAPacking,"NormalRGPacking",()=>u.NormalRGPacking,"NotEqualCompare",()=>u.NotEqualCompare,"NotEqualDepth",()=>u.NotEqualDepth,"NotEqualStencilFunc",()=>u.NotEqualStencilFunc,"NumberKeyframeTrack",()=>u.NumberKeyframeTrack,"Object3D",()=>u.Object3D,"ObjectLoader",()=>u.ObjectLoader,"ObjectSpaceNormalMap",()=>u.ObjectSpaceNormalMap,"OctahedronGeometry",()=>u.OctahedronGeometry,"OneFactor",()=>u.OneFactor,"OneMinusConstantAlphaFactor",()=>u.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>u.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>u.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>u.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>u.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>u.OneMinusSrcColorFactor,"OrthographicCamera",()=>u.OrthographicCamera,"PCFShadowMap",()=>u.PCFShadowMap,"PCFSoftShadowMap",()=>u.PCFSoftShadowMap,"PMREMGenerator",()=>l.PMREMGenerator,"Path",()=>u.Path,"PerspectiveCamera",()=>u.PerspectiveCamera,"Plane",()=>u.Plane,"PlaneGeometry",()=>u.PlaneGeometry,"PlaneHelper",()=>u.PlaneHelper,"PointLight",()=>u.PointLight,"PointLightHelper",()=>u.PointLightHelper,"Points",()=>u.Points,"PointsMaterial",()=>u.PointsMaterial,"PolarGridHelper",()=>u.PolarGridHelper,"PolyhedronGeometry",()=>u.PolyhedronGeometry,"PositionalAudio",()=>u.PositionalAudio,"PropertyBinding",()=>u.PropertyBinding,"PropertyMixer",()=>u.PropertyMixer,"QuadraticBezierCurve",()=>u.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>u.QuadraticBezierCurve3,"Quaternion",()=>u.Quaternion,"QuaternionKeyframeTrack",()=>u.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>u.QuaternionLinearInterpolant,"R11_EAC_Format",()=>u.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>u.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>u.RED_RGTC1_Format,"REVISION",()=>u.REVISION,"RG11_EAC_Format",()=>u.RG11_EAC_Format,"RGBADepthPacking",()=>u.RGBADepthPacking,"RGBAFormat",()=>u.RGBAFormat,"RGBAIntegerFormat",()=>u.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>u.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>u.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>u.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>u.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>u.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>u.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>u.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>u.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>u.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>u.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>u.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>u.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>u.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>u.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>u.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>u.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>u.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>u.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>u.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>u.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>u.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>u.RGBDepthPacking,"RGBFormat",()=>u.RGBFormat,"RGBIntegerFormat",()=>u.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>u.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>u.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>u.RGB_ETC1_Format,"RGB_ETC2_Format",()=>u.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>u.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>u.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>u.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>u.RGDepthPacking,"RGFormat",()=>u.RGFormat,"RGIntegerFormat",()=>u.RGIntegerFormat,"RawShaderMaterial",()=>u.RawShaderMaterial,"Ray",()=>u.Ray,"Raycaster",()=>u.Raycaster,"RectAreaLight",()=>u.RectAreaLight,"RedFormat",()=>u.RedFormat,"RedIntegerFormat",()=>u.RedIntegerFormat,"ReinhardToneMapping",()=>u.ReinhardToneMapping,"RenderTarget",()=>u.RenderTarget,"RenderTarget3D",()=>u.RenderTarget3D,"RepeatWrapping",()=>u.RepeatWrapping,"ReplaceStencilOp",()=>u.ReplaceStencilOp,"ReverseSubtractEquation",()=>u.ReverseSubtractEquation,"RingGeometry",()=>u.RingGeometry,"SIGNED_R11_EAC_Format",()=>u.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>u.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>u.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>u.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>u.SRGBColorSpace,"SRGBTransfer",()=>u.SRGBTransfer,"Scene",()=>u.Scene,"ShaderChunk",()=>l.ShaderChunk,"ShaderLib",()=>l.ShaderLib,"ShaderMaterial",()=>u.ShaderMaterial,"ShadowMaterial",()=>u.ShadowMaterial,"Shape",()=>u.Shape,"ShapeGeometry",()=>u.ShapeGeometry,"ShapePath",()=>u.ShapePath,"ShapeUtils",()=>u.ShapeUtils,"ShortType",()=>u.ShortType,"Skeleton",()=>u.Skeleton,"SkeletonHelper",()=>u.SkeletonHelper,"SkinnedMesh",()=>u.SkinnedMesh,"Source",()=>u.Source,"Sphere",()=>u.Sphere,"SphereGeometry",()=>u.SphereGeometry,"Spherical",()=>u.Spherical,"SphericalHarmonics3",()=>u.SphericalHarmonics3,"SplineCurve",()=>u.SplineCurve,"SpotLight",()=>u.SpotLight,"SpotLightHelper",()=>u.SpotLightHelper,"Sprite",()=>u.Sprite,"SpriteMaterial",()=>u.SpriteMaterial,"SrcAlphaFactor",()=>u.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>u.SrcAlphaSaturateFactor,"SrcColorFactor",()=>u.SrcColorFactor,"StaticCopyUsage",()=>u.StaticCopyUsage,"StaticDrawUsage",()=>u.StaticDrawUsage,"StaticReadUsage",()=>u.StaticReadUsage,"StereoCamera",()=>u.StereoCamera,"StreamCopyUsage",()=>u.StreamCopyUsage,"StreamDrawUsage",()=>u.StreamDrawUsage,"StreamReadUsage",()=>u.StreamReadUsage,"StringKeyframeTrack",()=>u.StringKeyframeTrack,"SubtractEquation",()=>u.SubtractEquation,"SubtractiveBlending",()=>u.SubtractiveBlending,"TOUCH",()=>u.TOUCH,"TangentSpaceNormalMap",()=>u.TangentSpaceNormalMap,"TetrahedronGeometry",()=>u.TetrahedronGeometry,"Texture",()=>u.Texture,"TextureLoader",()=>u.TextureLoader,"TextureUtils",()=>u.TextureUtils,"Timer",()=>u.Timer,"TimestampQuery",()=>u.TimestampQuery,"TorusGeometry",()=>u.TorusGeometry,"TorusKnotGeometry",()=>u.TorusKnotGeometry,"Triangle",()=>u.Triangle,"TriangleFanDrawMode",()=>u.TriangleFanDrawMode,"TriangleStripDrawMode",()=>u.TriangleStripDrawMode,"TrianglesDrawMode",()=>u.TrianglesDrawMode,"TubeGeometry",()=>u.TubeGeometry,"UVMapping",()=>u.UVMapping,"Uint16BufferAttribute",()=>u.Uint16BufferAttribute,"Uint32BufferAttribute",()=>u.Uint32BufferAttribute,"Uint8BufferAttribute",()=>u.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>u.Uint8ClampedBufferAttribute,"Uniform",()=>u.Uniform,"UniformsGroup",()=>u.UniformsGroup,"UniformsLib",()=>l.UniformsLib,"UniformsUtils",()=>u.UniformsUtils,"UnsignedByteType",()=>u.UnsignedByteType,"UnsignedInt101111Type",()=>u.UnsignedInt101111Type,"UnsignedInt248Type",()=>u.UnsignedInt248Type,"UnsignedInt5999Type",()=>u.UnsignedInt5999Type,"UnsignedIntType",()=>u.UnsignedIntType,"UnsignedShort4444Type",()=>u.UnsignedShort4444Type,"UnsignedShort5551Type",()=>u.UnsignedShort5551Type,"UnsignedShortType",()=>u.UnsignedShortType,"VSMShadowMap",()=>u.VSMShadowMap,"Vector2",()=>u.Vector2,"Vector3",()=>u.Vector3,"Vector4",()=>u.Vector4,"VectorKeyframeTrack",()=>u.VectorKeyframeTrack,"VideoFrameTexture",()=>u.VideoFrameTexture,"VideoTexture",()=>u.VideoTexture,"WebGL3DRenderTarget",()=>u.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>u.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>u.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>u.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>u.WebGLRenderTarget,"WebGLRenderer",()=>l.WebGLRenderer,"WebGLUtils",()=>l.WebGLUtils,"WebGPUCoordinateSystem",()=>u.WebGPUCoordinateSystem,"WebXRController",()=>u.WebXRController,"WireframeGeometry",()=>u.WireframeGeometry,"WrapAroundEnding",()=>u.WrapAroundEnding,"ZeroCurvatureEnding",()=>u.ZeroCurvatureEnding,"ZeroFactor",()=>u.ZeroFactor,"ZeroSlopeEnding",()=>u.ZeroSlopeEnding,"ZeroStencilOp",()=>u.ZeroStencilOp,"createCanvasElement",()=>u.createCanvasElement,"error",()=>u.error,"getConsoleFunction",()=>u.getConsoleFunction,"log",()=>u.log,"setConsoleFunction",()=>u.setConsoleFunction,"warn",()=>u.warn,"warnOnce",()=>u.warnOnce],32009);var c=e.i(32009);function d(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}let f=["x","y","top","bottom","left","right","width","height"];var h=e.i(46791);function m({ref:e,children:t,fallback:r,resize:a,style:i,gl:l,events:u=s.f,eventSource:h,eventPrefix:m,shadows:p,linear:g,flat:v,legacy:y,orthographic:A,frameloop:F,dpr:b,performance:C,raycaster:B,camera:S,scene:x,onPointerMissed:E,onCreated:M,...D}){o.useMemo(()=>(0,s.e)(c),[]);let k=(0,s.u)(),[I,w]=function({debounce:e,scroll:t,polyfill:r,offsetSize:a}={debounce:0,scroll:!1,offsetSize:!1}){var n,i,s;let l=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!l)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[u,c]=(0,o.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),h=(0,o.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:u,orientationHandler:null}),m=e?"number"==typeof e?e:e.scroll:null,p=e?"number"==typeof e?e:e.resize:null,g=(0,o.useRef)(!1);(0,o.useEffect)(()=>(g.current=!0,()=>void(g.current=!1)));let[v,y,A]=(0,o.useMemo)(()=>{let e=()=>{let e,t;if(!h.current.element)return;let{left:r,top:n,width:i,height:o,bottom:s,right:l,x:u,y:d}=h.current.element.getBoundingClientRect(),m={left:r,top:n,width:i,height:o,bottom:s,right:l,x:u,y:d};h.current.element instanceof HTMLElement&&a&&(m.height=h.current.element.offsetHeight,m.width=h.current.element.offsetWidth),Object.freeze(m),g.current&&(e=h.current.lastBounds,t=m,!f.every(r=>e[r]===t[r]))&&c(h.current.lastBounds=m)};return[e,p?d(e,p):e,m?d(e,m):e]},[c,a,m,p]);function F(){h.current.scrollContainers&&(h.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",A,!0)),h.current.scrollContainers=null),h.current.resizeObserver&&(h.current.resizeObserver.disconnect(),h.current.resizeObserver=null),h.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",h.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",h.current.orientationHandler))}function b(){h.current.element&&(h.current.resizeObserver=new l(A),h.current.resizeObserver.observe(h.current.element),t&&h.current.scrollContainers&&h.current.scrollContainers.forEach(e=>e.addEventListener("scroll",A,{capture:!0,passive:!0})),h.current.orientationHandler=()=>{A()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",h.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",h.current.orientationHandler))}return n=A,i=!!t,(0,o.useEffect)(()=>{if(i)return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)},[n,i]),s=y,(0,o.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,o.useEffect)(()=>{F(),b()},[t,A,y]),(0,o.useEffect)(()=>F,[]),[e=>{e&&e!==h.current.element&&(F(),h.current.element=e,h.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:a,overflowX:n,overflowY:i}=window.getComputedStyle(t);return[a,n,i].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),b())},u,v]}({scroll:!0,debounce:{scroll:50,resize:0},...a}),T=o.useRef(null),R=o.useRef(null);o.useImperativeHandle(e,()=>T.current);let P=(0,s.a)(E),[G,L]=o.useState(!1),[j,_]=o.useState(!1);if(G)throw G;if(j)throw j;let O=o.useRef(null);(0,s.b)(()=>{let e=T.current;w.width>0&&w.height>0&&e&&(O.current||(O.current=(0,s.c)(e)),async function(){await O.current.configure({gl:l,scene:x,events:u,shadows:p,linear:g,flat:v,legacy:y,orthographic:A,frameloop:F,dpr:b,performance:C,raycaster:B,camera:S,size:w,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(h?(0,s.i)(h)?h.current:h:R.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],a=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(a/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==M||M(e)}}),O.current.render((0,n.jsx)(k,{children:(0,n.jsx)(s.E,{set:_,children:(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)(s.B,{set:L}),children:null!=t?t:null})})}))}())}),o.useEffect(()=>{let e=T.current;if(e)return()=>(0,s.d)(e)},[]);let U=h?"none":"auto";return(0,n.jsx)("div",{ref:R,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:U,...i},...D,children:(0,n.jsx)("div",{ref:I,style:{width:"100%",height:"100%"},children:(0,n.jsx)("canvas",{ref:T,style:{display:"block"},children:r})})})}function p(e){return(0,n.jsx)(h.FiberProvider,{children:(0,n.jsx)(m,{...e})})}e.i(39695),e.i(98133),e.i(95087);var g=e.i(66027),v=e.i(54970),y=e.i(12979),A=e.i(49774),F=e.i(73949),b=e.i(62395),C=e.i(75567),B=e.i(47071);let S={value:!0},x=` -vec3 terrainLinearToSRGB(vec3 linear) { - vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; - vec3 lower = linear * 12.92; - return mix(lower, higher, step(vec3(0.0031308), linear)); -} - -vec3 terrainSRGBToLinear(vec3 srgb) { - vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); - vec3 lower = srgb / 12.92; - return mix(lower, higher, step(vec3(0.04045), srgb)); -} - -// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines -// Returns 1.0 on grid lines, 0.0 elsewhere -float terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); -} -`;var E=e.i(79123),M=e.i(47021),D=e.i(48066);let k={0:32,1:32,2:32,3:32,4:32,5:32};function I({displacementMap:e,visibilityMask:t,textureNames:r,alphaTextures:a,detailTextureName:i,lightmap:s}){let{debugMode:l}=(0,E.useDebug)(),c=(0,B.useTexture)(r.map(e=>(0,y.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,C.setupTexture)(e))}),d=i?(0,y.textureToUrl)(i):null,f=(0,B.useTexture)(d??y.FALLBACK_TEXTURE_URL,e=>{(0,C.setupTexture)(e)}),h=(0,o.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:a,tiling:n,detailTexture:i=null,lightmap:o=null}){e.uniforms.sunLightPointsDown=S;let s=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),a&&(e.uniforms.visibilityMask={value:a}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:n[r]??32}}),o&&(e.uniforms.terrainLightmap={value:o}),i&&(e.uniforms.detailTexture={value:i},e.uniforms.detailTiling={value:64},e.uniforms.detailFadeDistance={value:150},e.vertexShader=e.vertexShader.replace("#include ",`#include -varying vec3 vTerrainWorldPos;`),e.vertexShader=e.vertexShader.replace("#include ",`#include -vTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;`)),e.fragmentShader=` -uniform sampler2D albedo0; -uniform sampler2D albedo1; -uniform sampler2D albedo2; -uniform sampler2D albedo3; -uniform sampler2D albedo4; -uniform sampler2D albedo5; -uniform sampler2D mask0; -uniform sampler2D mask1; -uniform sampler2D mask2; -uniform sampler2D mask3; -uniform sampler2D mask4; -uniform sampler2D mask5; -uniform float tiling0; -uniform float tiling1; -uniform float tiling2; -uniform float tiling3; -uniform float tiling4; -uniform float tiling5; -${a?"uniform sampler2D visibilityMask;":""} -${o?"uniform sampler2D terrainLightmap;":""} -uniform bool sunLightPointsDown; -${i?`uniform sampler2D detailTexture; -uniform float detailTiling; -uniform float detailFadeDistance; -varying vec3 vTerrainWorldPos;`:""} - -${x} - -// Global variable to store shadow factor from RE_Direct for use in output calculation -float terrainShadowFactor = 1.0; -`+e.fragmentShader,a){let t="#include ";e.fragmentShader=e.fragmentShader.replace(t,`${t} - // Early discard for invisible areas (before fog/lighting) - float visibility = texture2D(visibilityMask, vMapUv).r; - if (visibility < 0.5) { - discard; - } - `)}e.fragmentShader=e.fragmentShader.replace("#include ",` - // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js) - vec2 baseUv = vMapUv; - vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb; - ${s>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":""} - ${s>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":""} - ${s>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":""} - ${s>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":""} - ${s>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":""} - - // Sample alpha masks for all layers (use R channel) - // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices), - // but GPU linear filtering samples at texel centers. This offset aligns them. - vec2 alphaUv = baseUv + vec2(0.5 / 256.0); - float a0 = texture2D(mask0, alphaUv).r; - ${s>1?"float a1 = texture2D(mask1, alphaUv).r;":""} - ${s>2?"float a2 = texture2D(mask2, alphaUv).r;":""} - ${s>3?"float a3 = texture2D(mask3, alphaUv).r;":""} - ${s>4?"float a4 = texture2D(mask4, alphaUv).r;":""} - ${s>5?"float a5 = texture2D(mask5, alphaUv).r;":""} - - // Torque-style additive weighted blending (blender.cc): - // result = tex0 * alpha0 + tex1 * alpha1 + tex2 * alpha2 + ... - // Each layer's alpha map defines its contribution weight. - vec3 blended = c0 * a0; - ${s>1?"blended += c1 * a1;":""} - ${s>2?"blended += c2 * a2;":""} - ${s>3?"blended += c3 * a3;":""} - ${s>4?"blended += c4 * a4;":""} - ${s>5?"blended += c5 * a5;":""} - - // Assign to diffuseColor before lighting - vec3 textureColor = blended; - - ${i?`// Detail texture blending (Torque-style multiplicative blend) - // Sample detail texture at high frequency tiling - vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb; - - // Calculate distance-based fade factor using world positions - // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance - float distToCamera = distance(vTerrainWorldPos, cameraPosition); - float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0); - - // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor) - // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray - // Direct multiplication adds subtle darkening for surface detail - textureColor *= mix(vec3(1.0), detailColor, detailFade);`:""} - - // Store blended texture in diffuseColor (still in linear space here) - // We'll convert to sRGB in the output calculation - diffuseColor.rgb = textureColor; -`),o&&(e.fragmentShader=e.fragmentShader.replace("#include ",`#include - -// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting -#undef RE_Direct -void RE_Direct_TerrainShadow( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - // Torque lighting (terrLighting.cc): if light points up, terrain gets only ambient - // This prevents shadow acne from light hitting terrain backfaces - if (!sunLightPointsDown) { - terrainShadowFactor = 0.0; - return; - } - // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js) - // Extract shadow factor by comparing to original sun color - #if ( NUM_DIR_LIGHTS > 0 ) - vec3 originalSunColor = directionalLights[0].color; - float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b); - float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b); - terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0); - #endif - // Don't add to reflectedLight - we'll compute lighting in gamma space at output -} -#define RE_Direct RE_Direct_TerrainShadow - -`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include -// Clear indirect diffuse - we'll compute ambient in gamma space -#if defined( RE_IndirectDiffuse ) - irradiance = vec3(0.0); -#endif -`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include - // Clear Three.js lighting - we compute everything in gamma space - reflectedLight.directDiffuse = vec3(0.0); - reflectedLight.indirectDiffuse = vec3(0.0); -`)),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style terrain lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space -{ - // Get texture in sRGB space (undo Three.js linear decode) - vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb); - - ${o?` - // Sample terrain lightmap for smooth NdotL - vec2 lightmapUv = vMapUv + vec2(0.5 / 512.0); - float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r; - - // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file) - // Three.js interprets them as linear, but the numerical values are preserved - #if ( NUM_DIR_LIGHTS > 0 ) - vec3 sunColorSRGB = directionalLights[0].color; - #else - vec3 sunColorSRGB = vec3(0.7); - #endif - vec3 ambientColorSRGB = ambientLightColor; - - // Torque formula (terrLighting.cc:471-483): - // lighting = ambient + NdotL * shadowFactor * sunColor - // Clamp lighting to [0,1] before multiplying by texture - vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0); - `:` - // No lightmap - use simple ambient lighting - vec3 lightingSRGB = ambientLightColor; - `} - - // Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space - vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); - - // Convert back to linear for Three.js output pipeline - outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance; -} -#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`#if DEBUG_MODE - // Debug mode: overlay green grid matching terrain grid squares (256x256) - float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5); - vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green - gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.1); -#endif - -#include `)}({shader:e,baseTextures:c,alphaTextures:a,visibilityMask:t,tiling:k,detailTexture:d?f:null,lightmap:s}),(0,M.injectCustomFog)(e,D.globalFogUniforms)},[c,a,t,f,d,s]),m=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=m.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!l,e.needsUpdate=!0)},[l]);let p=`${d?"detail":"nodetail"}-${s?"lightmap":"nolightmap"}`;return(0,n.jsx)("meshLambertMaterial",{ref:m,map:e,depthWrite:!0,side:u.FrontSide,defines:{DEBUG_MODE:+!!l},onBeforeCompile:h},p)}function w(e){let t,r,a=(0,i.c)(8),{displacementMap:s,visibilityMask:l,textureNames:u,alphaTextures:c,detailTextureName:d,lightmap:f}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),a[0]=t):t=a[0],a[1]!==c||a[2]!==d||a[3]!==s||a[4]!==f||a[5]!==u||a[6]!==l?(r=(0,n.jsx)(o.Suspense,{fallback:t,children:(0,n.jsx)(I,{displacementMap:s,visibilityMask:l,textureNames:u,alphaTextures:c,detailTextureName:d,lightmap:f})}),a[1]=c,a[2]=d,a[3]=s,a[4]=f,a[5]=u,a[6]=l,a[7]=r):r=a[7],r}let T=(0,o.memo)(function(e){let t,r,a,o=(0,i.c)(15),{tileX:s,tileZ:l,blockSize:u,basePosition:c,textureNames:d,geometry:f,displacementMap:h,visibilityMask:m,alphaTextures:p,detailTextureName:g,lightmap:v,visible:y}=e,A=void 0===y||y,F=u/2,b=c.x+s*u+F,C=c.z+l*u+F;o[0]!==b||o[1]!==C?(t=[b,0,C],o[0]=b,o[1]=C,o[2]=t):t=o[2];let B=t;return o[3]!==p||o[4]!==g||o[5]!==h||o[6]!==v||o[7]!==d||o[8]!==m?(r=(0,n.jsx)(w,{displacementMap:h,visibilityMask:m,textureNames:d,alphaTextures:p,detailTextureName:g,lightmap:v}),o[3]=p,o[4]=g,o[5]=h,o[6]=v,o[7]=d,o[8]=m,o[9]=r):r=o[9],o[10]!==f||o[11]!==B||o[12]!==r||o[13]!==A?(a=(0,n.jsx)("mesh",{position:B,geometry:f,castShadow:!0,receiveShadow:!0,visible:A,children:r}),o[10]=f,o[11]=B,o[12]=r,o[13]=A,o[14]=a):a=o[14],a});e.i(13876);var R=e.i(58647);function P(e){return(0,R.useRuntimeObjectByName)(e)}function G(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,a=r>>8&255,n=r>>16,i=256*a;for(let r=0;r0?a:(t[0]!==r?(e=(0,b.getFloat)(r,"visibleDistance")??600,t[0]=r,t[1]=e):e=t[1],e)}(),z=(0,F.useThree)(j),q=-(128*N);w[6]!==q?(s={x:q,z:q},w[6]=q,w[7]=s):s=w[7];let Q=s;if(w[8]!==R){let e=(0,b.getProperty)(R,"emptySquares");l=e?e.split(" ").map(_):[],w[8]=R,w[9]=l}else l=w[9];let W=l,{data:X}=((I=(0,i.c)(2))[0]!==L?(k={queryKey:["terrain",L],queryFn:()=>(0,y.loadTerrain)(L)},I[0]=L,I[1]=k):k=I[1],(0,g.useQuery)(k));e:{let e;if(!X){c=null;break e}let t=256*N;w[10]!==t||w[11]!==N||w[12]!==X.heightMap?(!function(e,t,r){let a=e.attributes.position,n=e.attributes.uv,i=e.attributes.normal,o=a.array,s=n.array,l=i.array,u=a.count,c=(e,r)=>(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),d=(e,r)=>{let a=Math.floor(e=Math.max(0,Math.min(255,e))),n=Math.floor(r=Math.max(0,Math.min(255,r))),i=Math.min(a+1,255),o=Math.min(n+1,255),s=e-a,l=r-n;return(t[256*n+a]/65535*2048*(1-s)+t[256*n+i]/65535*2048*s)*(1-l)+(t[256*o+a]/65535*2048*(1-s)+t[256*o+i]/65535*2048*s)*l};for(let e=0;e0?(m/=v,p/=v,g/=v):(m=0,p=1,g=0),l[3*e]=m,l[3*e+1]=p,l[3*e+2]=g}a.needsUpdate=!0,i.needsUpdate=!0}(e=function(e,t){let r=new u.BufferGeometry,a=new Float32Array(198147),n=new Float32Array(198147),i=new Float32Array(132098),o=new Uint32Array(393216),s=0,l=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let o=257*t+r;a[3*o]=r*l-e/2,a[3*o+1]=e/2-t*l,a[3*o+2]=0,n[3*o]=0,n[3*o+1]=0,n[3*o+2]=1,i[2*o]=r/256,i[2*o+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,a=r+1,n=(e+1)*257+t,i=n+1;((t^e)&1)==0?(o[s++]=r,o[s++]=n,o[s++]=i,o[s++]=r,o[s++]=i,o[s++]=a):(o[s++]=r,o[s++]=n,o[s++]=a,o[s++]=a,o[s++]=n,o[s++]=i)}return r.setIndex(new u.BufferAttribute(o,1)),r.setAttribute("position",new u.Float32BufferAttribute(a,3)),r.setAttribute("normal",new u.Float32BufferAttribute(n,3)),r.setAttribute("uv",new u.Float32BufferAttribute(i,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(t,0),X.heightMap,N),w[10]=t,w[11]=N,w[12]=X.heightMap,w[13]=e):e=w[13],c=e}let Y=c,Z=P("Sun");t:{let e,t;if(!Z){let e;w[14]===Symbol.for("react.memo_cache_sentinel")?(e=new u.Vector3(.57735,-.57735,.57735),w[14]=e):e=w[14],d=e;break t}w[15]!==Z?(e=((0,b.getProperty)(Z,"direction")??"0.57735 0.57735 -0.57735").split(" ").map(O),w[15]=Z,w[16]=e):e=w[16];let[r,a,n]=e,i=Math.sqrt(r*r+n*n+a*a),o=r/i,s=n/i,l=a/i;w[17]!==s||w[18]!==l||w[19]!==o?(t=new u.Vector3(o,s,l),w[17]=s,w[18]=l,w[19]=o,w[20]=t):t=w[20],d=t}let $=d;r:{let e;if(!X){f=null;break r}w[21]!==N||w[22]!==$||w[23]!==X.heightMap?(e=function(e,t,r){let a=(t,r)=>{let a=Math.max(0,Math.min(255,t)),n=Math.max(0,Math.min(255,r)),i=Math.floor(a),o=Math.floor(n),s=Math.min(i+1,255),l=Math.min(o+1,255),u=a-i,c=n-o;return((e[256*o+i]/65535*(1-u)+e[256*o+s]/65535*u)*(1-c)+(e[256*l+i]/65535*(1-u)+e[256*l+s]/65535*u)*c)*2048},n=new u.Vector3(-t.x,-t.y,-t.z).normalize(),i=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let o=t/2+.25,s=e/2+.25,l=a(o,s),u=a(o-.5,s),c=a(o+.5,s),d=a(o,s-.5),f=-((a(o,s+.5)-d)/1),h=-((c-u)/1),m=Math.sqrt(f*f+r*r+h*h),p=Math.max(0,f/m*n.x+r/m*n.y+h/m*n.z),g=1;p>0&&(g=function(e,t,r,a,n,i){let o=a.z/n,s=a.x/n,l=a.y,u=Math.sqrt(o*o+s*s);if(u<1e-4)return 1;let c=.5/u,d=o*c,f=s*c,h=l*c,m=e,p=t,g=r+.1;for(let e=0;e<768&&(m+=d,p+=f,g+=h,!(m<0)&&!(m>=256)&&!(p<0)&&!(p>=256)&&!(g>2048));e++)if(gArray(eo).fill(null),w[34]=eo,w[35]=B):B=w[35];let[el,eu]=(0,o.useState)(B);w[36]===Symbol.for("react.memo_cache_sentinel")?(S={xStart:0,xEnd:0,zStart:0,zEnd:0},w[36]=S):S=w[36];let ec=(0,o.useRef)(S);return(w[37]!==Q.x||w[38]!==Q.z||w[39]!==K||w[40]!==z.position.x||w[41]!==z.position.z||w[42]!==eo||w[43]!==V?(x=()=>{let e=z.position.x-Q.x,t=z.position.z-Q.z,r=Math.floor((e-V)/K),a=Math.ceil((e+V)/K),n=Math.floor((t-V)/K),i=Math.ceil((t+V)/K),o=ec.current;if(r===o.xStart&&a===o.xEnd&&n===o.zStart&&i===o.zEnd)return;o.xStart=r,o.xEnd=a,o.zStart=n,o.zEnd=i;let s=[];for(let e=r;e{let t=el[e];return(0,n.jsx)(T,{tileX:t?.tileX??0,tileZ:t?.tileZ??0,blockSize:K,basePosition:Q,textureNames:X.textureNames,geometry:Y,displacementMap:et,visibilityMask:ea,alphaTextures:en,detailTextureName:J,lightmap:ee,visible:null!==t},e)}),w[55]=Q,w[56]=K,w[57]=J,w[58]=es,w[59]=en,w[60]=et,w[61]=Y,w[62]=X.textureNames,w[63]=ee,w[64]=el,w[65]=M):M=w[65],w[66]!==E||w[67]!==M?(D=(0,n.jsxs)(n.Fragment,{children:[E,M]}),w[66]=E,w[67]=M,w[68]=D):D=w[68],D):null});function j(e){return e.camera}function _(e){return parseInt(e,10)}function O(e){return parseFloat(e)}function U(e){return(0,C.setupMask)(e)}function H(e,t){return t}let N=(0,o.createContext)(null);function J(){return(0,o.useContext)(N)}function K(e){return(0,n.jsx)(t4,{objectId:e},e)}var V=o;let z=(0,V.createContext)(null),q={didCatch:!1,error:null};class Q extends V.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=q}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;null!==t&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(q))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:a}=this.props;r&&null!==t.error&&function(e=[],t=[]){return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,a)&&(this.props.onReset?.({next:a,prev:e.resetKeys,reason:"keys"}),this.setState(q))}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:a}=this.props,{didCatch:n,error:i}=this.state,o=e;if(n){let e={error:i,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(r)o=(0,V.createElement)(r,e);else if(void 0!==a)o=a;else throw i}return(0,V.createElement)(z.Provider,{value:{didCatch:n,error:i,resetErrorBoundary:this.resetErrorBoundary}},o)}}var W=e.i(31067),X=u;function Y(e,t){if(t===u.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==u.TriangleFanDrawMode&&t!==u.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],a=e.getAttribute("position");if(void 0===a)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e=2.0 are supported."));return}let s=new eK(n,{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&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}s.setExtensions(i),s.setPlugins(o),s.parse(r,a)}parseAsync(e,t){let r=this;return new Promise(function(a,n){r.parse(e,t,a,n)})}}function ea(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let en={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"};class ei{constructor(e){this.parser=e,this.name=en.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,a=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n.source,i)}}class eA{constructor(e){this.parser=e,this.name=en.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,a=r.json,n=a.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],o=a.images[i.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,s);if(a.extensionsRequired&&a.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class eF{constructor(e){this.parser=e,this.name=en.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,a=r.json,n=a.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],o=a.images[i.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,s);if(a.extensionsRequired&&a.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class eb{constructor(e){this.name=en.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],a=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return a.then(function(t){let r=e.byteOffset||0,a=e.byteLength||0,i=e.count,o=e.byteStride,s=new Uint8Array(t,r,a);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(i,o,s,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(i*o);return n.decodeGltfBuffer(new Uint8Array(t),i,o,s,e.mode,e.filter),t})})}}}class eC{constructor(e){this.name=en.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==ew.TRIANGLES&&e.mode!==ew.TRIANGLE_STRIP&&e.mode!==ew.TRIANGLE_FAN&&void 0!==e.mode)return null;let a=r.extensions[this.name].attributes,n=[],i={};for(let e in a)n.push(this.parser.getDependency("accessor",a[e]).then(t=>(i[e]=t,i[e])));return n.length<1?null:(n.push(this.parser.createNodeMesh(e)),Promise.all(n).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],a=e[0].count,n=[];for(let e of r){let t=new X.Matrix4,r=new X.Vector3,o=new X.Quaternion,s=new X.Vector3(1,1,1),l=new X.InstancedMesh(e.geometry,e.material,a);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"},ej={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},e_={CUBICSPLINE:void 0,LINEAR:X.InterpolateLinear,STEP:X.InterpolateDiscrete};function eO(e,t,r){for(let a in r.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=r.extensions[a])}function eU(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function eH(e){let t="",r=Object.keys(e).sort();for(let a=0,n=r.length;a-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||a&&n<98?this.textureLoader=new X.TextureLoader(this.options.manager):this.textureLoader=new X.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new X.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let r=this,a=this.json,n=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([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(t){let i={scene:t[0][a.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:a.asset,parser:r,userData:{}};return eO(n,i,a),eU(i,a),Promise.all(r._invokeAll(function(e){return e.afterRoot&&e.afterRoot(i)})).then(function(){for(let e of i.scenes)e.updateMatrixWorld();e(i)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,a=t.length;r{let r=this.associations.get(e);for(let[a,i]of(null!=r&&this.associations.set(t,r),e.children.entries()))n(i,t.children[a])};return n(r,a),a.name+="_instance_"+e.uses[t]++,a}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&i.setY(t,d[e*s+1]),s>=3&&i.setZ(t,d[e*s+2]),s>=4&&i.setW(t,d[e*s+3]),s>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i})}loadTexture(e){let t=this.json,r=this.options,a=t.textures[e].source,n=t.images[a],i=this.textureLoader;if(n.uri){let e=r.manager.getHandler(n.uri);null!==e&&(i=e)}return this.loadTextureImage(e,a,i)}loadTextureImage(e,t,r){let a=this,n=this.json,i=n.textures[e],o=n.images[t],s=(o.uri||o.bufferView)+":"+i.sampler;if(this.textureCache[s])return this.textureCache[s];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=i.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let r=(n.samplers||{})[i.sampler]||{};return t.magFilter=eR[r.magFilter]||X.LinearFilter,t.minFilter=eR[r.minFilter]||X.LinearMipmapLinearFilter,t.wrapS=eP[r.wrapS]||X.RepeatWrapping,t.wrapT=eP[r.wrapT]||X.RepeatWrapping,a.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=l,l}loadImageSource(e,t){let r=this.json,a=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let n=r.images[e],i=self.URL||self.webkitURL,o=n.uri||"",s=!1;if(void 0!==n.bufferView)o=this.getDependency("bufferView",n.bufferView).then(function(e){s=!0;let t=new Blob([e],{type:n.mimeType});return o=i.createObjectURL(t)});else if(void 0===n.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(e){return new Promise(function(r,n){let i=r;!0===t.isImageBitmapLoader&&(i=function(e){let t=new X.Texture(e);t.needsUpdate=!0,r(t)}),t.load(X.LoaderUtils.resolveURL(e,a.path),i,void 0,n)})}).then(function(e){var t;return!0===s&&i.revokeObjectURL(o),eU(e,n),e.userData.mimeType=n.mimeType||((t=n.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,a){let n=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((i=i.clone()).channel=r.texCoord),n.extensions[en.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[en.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(i);i=n.extensions[en.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),n.associations.set(i,t)}}return void 0!==a&&("number"==typeof a&&(a=3001===a?ee:et),"colorSpace"in i?i.colorSpace=a:i.encoding=a===ee?3001:3e3),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,r=e.material,a=void 0===t.attributes.tangent,n=void 0!==t.attributes.color,i=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new X.PointsMaterial,X.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new X.LineBasicMaterial,X.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(a||n||i){let e="ClonedMaterial:"+r.uuid+":";a&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),i&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),n&&(t.vertexColors=!0),i&&(t.flatShading=!0),a&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return X.MeshStandardMaterial}loadMaterial(e){let t,r=this,a=this.json,n=this.extensions,i=a.materials[e],o={},s=i.extensions||{},l=[];if(s[en.KHR_MATERIALS_UNLIT]){let e=n[en.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(o,i,r))}else{let a=i.pbrMetallicRoughness||{};if(o.color=new X.Color(1,1,1),o.opacity=1,Array.isArray(a.baseColorFactor)){let e=a.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],et),o.opacity=e[3]}void 0!==a.baseColorTexture&&l.push(r.assignTexture(o,"map",a.baseColorTexture,ee)),o.metalness=void 0!==a.metallicFactor?a.metallicFactor:1,o.roughness=void 0!==a.roughnessFactor?a.roughnessFactor:1,void 0!==a.metallicRoughnessTexture&&(l.push(r.assignTexture(o,"metalnessMap",a.metallicRoughnessTexture)),l.push(r.assignTexture(o,"roughnessMap",a.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}!0===i.doubleSided&&(o.side=X.DoubleSide);let u=i.alphaMode||"OPAQUE";if("BLEND"===u?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,"MASK"===u&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==X.MeshBasicMaterial&&(l.push(r.assignTexture(o,"normalMap",i.normalTexture)),o.normalScale=new X.Vector2(1,1),void 0!==i.normalTexture.scale)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==i.occlusionTexture&&t!==X.MeshBasicMaterial&&(l.push(r.assignTexture(o,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==X.MeshBasicMaterial){let e=i.emissiveFactor;o.emissive=new X.Color().setRGB(e[0],e[1],e[2],et)}return void 0!==i.emissiveTexture&&t!==X.MeshBasicMaterial&&l.push(r.assignTexture(o,"emissiveMap",i.emissiveTexture,ee)),Promise.all(l).then(function(){let a=new t(o);return i.name&&(a.name=i.name),eU(a,i),r.associations.set(a,{materials:e}),i.extensions&&eO(n,a,i),a})}createUniqueName(e){let t=X.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,a=this.primitiveCache,n=[];for(let i=0,o=e.length;i0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,a=t.weights.length;r1?new X.Group:1===t.length?t[0]:new X.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of a.associations)(e instanceof X.Material||e instanceof X.Texture)&&t.set(e,r);return e.traverse(e=>{let r=a.associations.get(e);null!=r&&t.set(e,r)}),t})(n),n})}_createAnimationTracks(e,t,r,a,n){let i,o=[],s=e.name?e.name:e.uuid,l=[];switch(ej[n.path]===ej.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(s),ej[n.path]){case ej.weights:i=X.NumberKeyframeTrack;break;case ej.rotation:i=X.QuaternionKeyframeTrack;break;case ej.position:case ej.scale:i=X.VectorKeyframeTrack;break;default:i=1===r.itemSize?X.NumberKeyframeTrack:X.VectorKeyframeTrack}let u=void 0!==a.interpolation?e_[a.interpolation]:X.InterpolateLinear,c=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(a)},r,a)}decodeDracoFile(e,t,r,a){let n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let a=JSON.stringify(t);if(eq.has(e)){let t=eq.get(e);if(t.key===a)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n=this.workerNextTaskID++,i=e.byteLength,o=this._getWorker(n,i).then(a=>(r=a,new Promise((a,i)=>{r._callbacks[n]={resolve:a,reject:i},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),eq.set(e,{key:a,promise:o}),o}_createGeometry(e){let t=new ez.BufferGeometry;e.index&&t.setIndex(new ez.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,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 r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let a=eW.toString(),n=["/* draco decoder */",r,"\n/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_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,r=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(n),n.byteLength);try{let e=function(e,t,r,a){var n,i,o;let s,l,u,c,d,f,h=a.attributeIDs,m=a.attributeTypes,p=t.GetEncodedGeometryType(r);if(p===e.TRIANGULAR_MESH)d=new e.Mesh,f=t.DecodeBufferToMesh(r,d);else if(p===e.POINT_CLOUD)d=new e.PointCloud,f=t.DecodeBufferToPointCloud(r,d);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||0===d.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let g={index:null,attributes:[]};for(let r in h){let n,i,o=self[m[r]];if(a.useUniqueIDs)i=h[r],n=t.GetAttributeByUniqueId(d,i);else{if(-1===(i=t.GetAttributeId(d,e[h[r]])))continue;n=t.GetAttribute(d,i)}g.attributes.push(function(e,t,r,a,n,i){let o=i.num_components(),s=r.num_points()*o,l=s*n.BYTES_PER_ELEMENT,u=function(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}}(e,n),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,i,u,l,c);let d=new n(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:a,array:d,itemSize:o}}(e,t,d,r,o,n))}return p===e.TRIANGULAR_MESH&&(n=e,i=t,o=d,s=3*o.num_faces(),l=4*s,u=n._malloc(l),i.GetTrianglesUInt32Array(o,l,u),c=new Uint32Array(n.HEAPF32.buffer,u,s).slice(),n._free(u),g.index={array:c,itemSize:1}),e.destroy(d),g}(t,r,o,i),n=e.attributes.map(e=>e.array.buffer);e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:e},n)}catch(e){console.error(e),self.postMessage({type:"error",id:a.id,error:e.message})}finally{t.destroy(o),t.destroy(r)}})}}}var eX=e.i(971);let eY=function(e){let t=new Map,r=new Map,a=e.clone();return function e(t,r,a){a(t,r);for(let n=0;n{let f={keys:l,deep:a,inject:s,castShadow:n,receiveShadow:i};if(Array.isArray(t=o.useMemo(()=>{if(!1===e&&!Array.isArray(t)){let e=!1;if(t.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return eY(t)}return t},[t,e])))return o.createElement("group",(0,W.default)({},c,{ref:d}),t.map(e=>o.createElement(eZ,(0,W.default)({key:e.uuid,object:e},f))),r);let{children:h,...m}=function(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:r,inject:a,castShadow:n,receiveShadow:i}){let s={};for(let r of t)s[r]=e[r];return r&&(s.geometry&&"materialsOnly"!==r&&(s.geometry=s.geometry.clone()),s.material&&"geometriesOnly"!==r&&(s.material=s.material.clone())),a&&(s="function"==typeof a?{...s,children:a(e)}:o.isValidElement(a)?{...s,children:a}:{...s,...a}),e instanceof u.Mesh&&(n&&(s.castShadow=!0),i&&(s.receiveShadow=!0)),s}(t,f),p=t.type[0].toLowerCase()+t.type.slice(1);return o.createElement(p,(0,W.default)({},m,c,{ref:d}),t.children.map(e=>"Bone"===e.type?o.createElement("primitive",(0,W.default)({key:e.uuid,object:e},f)):o.createElement(eZ,(0,W.default)({key:e.uuid,object:e},f,{isChild:!0}))),r,h)}),e$=null,e0="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function e1(e=!0,r=!0,a){return n=>{a&&a(n),e&&(e$||(e$=new eQ),e$.setDecoderPath("string"==typeof e?e:e0),n.setDRACOLoader(e$)),r&&n.setMeshoptDecoder((()=>{let e;if(t)return t;let r=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]),a=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("object"!=typeof WebAssembly)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(r)&&(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 i=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?a-71:a>64?a-65:a>47?a+4:a>46?63:62}let r=0;for(let n=0;n{(e=t.instance).exports.__wasm_call_ctors()});function o(t,r,a,n,i,o){let s=e.exports.sbrk,l=a+3&-4,u=s(l*n),c=s(i.length),d=new Uint8Array(e.exports.memory.buffer);d.set(i,c);let f=t(u,a,n,c,i.length);if(0===f&&o&&o(u,l,n),r.set(d.subarray(u,u+a*n)),s(u-s(0)),0!==f)throw Error(`Malformed buffer data: ${f}`)}let s={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:i,supported:!0,decodeVertexBuffer(t,r,a,n,i){o(e.exports.meshopt_decodeVertexBuffer,t,r,a,n,e.exports[s[i]])},decodeIndexBuffer(t,r,a,n){o(e.exports.meshopt_decodeIndexBuffer,t,r,a,n)},decodeIndexSequence(t,r,a,n){o(e.exports.meshopt_decodeIndexSequence,t,r,a,n)},decodeGltfBuffer(t,r,a,n,i,u){o(e.exports[l[i]],t,r,a,n,e.exports[s[u]])}}})())}}let e2=(e,t,r,a)=>(0,eX.useLoader)(er,e,e1(t,r,a));e2.preload=(e,t,r,a)=>eX.useLoader.preload(er,e,e1(t,r,a)),e2.clear=e=>eX.useLoader.clear(er,e),e2.setDecoderPath=e=>{e0=e};var e3=e.i(89887);let e9=` -vec3 interiorLinearToSRGB(vec3 linear) { - vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; - vec3 lower = linear * 12.92; - return mix(lower, higher, step(vec3(0.0031308), linear)); -} - -vec3 interiorSRGBToLinear(vec3 srgb) { - vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); - vec3 lower = srgb / 12.92; - return mix(lower, higher, step(vec3(0.04045), srgb)); -} - -// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines -// Returns 1.0 on grid lines, 0.0 elsewhere -float debugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); -} -`;function e5({materialName:e,material:t,lightMap:r}){let a=(0,E.useDebug)(),i=a?.debugMode??!1,s=(0,y.textureToUrl)(e),l=(0,B.useTexture)(s,e=>(0,C.setupTexture)(e)),c=new Set(t?.userData?.flag_names??[]).has("SelfIlluminating"),d=new Set(t?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),f=(0,o.useCallback)(e=>{let t;(0,M.injectCustomFog)(e,D.globalFogUniforms),t=d??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new u.Vector3(0,.4,1):new u.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include -${e9} -uniform bool useSceneLighting; -uniform vec3 interiorDebugColor; -`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Lightmap handled in custom output calculation -#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space -// Get texture in sRGB space (undo Three.js linear decode) -vec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb); - -// Compute lighting in sRGB space -vec3 lightingSRGB = vec3(0.0); - -if (useSceneLighting) { - // Three.js computed: reflectedLight = lighting \xd7 texture_linear / PI - // Extract pure lighting: lighting = reflectedLight \xd7 PI / texture_linear - vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001)); - vec3 extractedLighting = totalLight * PI / safeTexLinear; - // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors - // are sRGB values (Torque used them directly in gamma space). Three.js treats them - // as linear but the numerical values are the same. DO NOT convert to sRGB here! - // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap - // (sceneLighting.cc line 1785: tmp.clamp()) - lightingSRGB = clamp(extractedLighting, 0.0, 1.0); -} - -// Add lightmap contribution (for BOTH outside and inside surfaces) -// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load -// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here. -#ifdef USE_LIGHTMAP - // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back - lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb); -#endif -// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827) -lightingSRGB = clamp(lightingSRGB, 0.0, 1.0); - -// Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space -vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); - -// Convert back to linear for Three.js output pipeline -vec3 resultLinear = interiorSRGBToLinear(resultSRGB); - -// Reassign outgoingLight before opaque_fragment consumes it -outgoingLight = resultLinear + totalEmissiveRadiance; - -#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`// Debug mode: overlay colored grid on top of normal rendering -// Blue grid = SurfaceOutsideVisible (receives scene ambient light) -// Red grid = inside surface (no scene ambient light) -#if DEBUG_MODE && defined(USE_MAP) - // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide - float gridIntensity = debugGrid(vMapUv, 4.0, 1.5); - gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); -#endif - -#include `)},[d]),h=(0,o.useRef)(null),m=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=h.current??m.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!i,e.needsUpdate=!0)},[i]);let p={DEBUG_MODE:+!!i},g=`${d}`;return c?(0,n.jsx)("meshBasicMaterial",{ref:h,map:l,toneMapped:!1,defines:p,onBeforeCompile:f},g):(0,n.jsx)("meshLambertMaterial",{ref:m,map:l,lightMap:r,toneMapped:!1,defines:p,onBeforeCompile:f},g)}function e8(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=u.SRGBColorSpace),t??null}function e6(e){let t,r,a,s=(0,i.c)(13),{node:l}=e;e:{let e,r;if(!l.material){let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],s[0]=e):e=s[0],t=e;break e}if(Array.isArray(l.material)){let e;s[1]!==l.material?(e=l.material.map(e4),s[1]=l.material,s[2]=e):e=s[2],t=e;break e}s[3]!==l.material?(e=e8(l.material),s[3]=l.material,s[4]=e):e=s[4],s[5]!==e?(r=[e],s[5]=e,s[6]=r):r=s[6],t=r}let u=t;return s[7]!==u||s[8]!==l.material?(r=l.material?(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(l.material)?l.material.map((e,t)=>(0,n.jsx)(e5,{materialName:e.userData.resource_path,material:e,lightMap:u[t]},t)):(0,n.jsx)(e5,{materialName:l.material.userData.resource_path,material:l.material,lightMap:u[0]})}):null,s[7]=u,s[8]=l.material,s[9]=r):r=s[9],s[10]!==l.geometry||s[11]!==r?(a=(0,n.jsx)("mesh",{geometry:l.geometry,castShadow:!0,receiveShadow:!0,children:r}),s[10]=l.geometry,s[11]=r,s[12]=a):a=s[12],a}function e4(e){return e8(e)}let e7=(0,o.memo)(function(e){let t,r,a,o,s,l,u=(0,i.c)(10),{object:c,interiorFile:d}=e,{nodes:f}=((l=(0,i.c)(2))[0]!==d?(s=(0,y.interiorToUrl)(d),l[0]=d,l[1]=s):s=l[1],e2(s)),h=(0,E.useDebug)(),m=h?.debugMode??!1;return u[0]===Symbol.for("react.memo_cache_sentinel")?(t=[0,-Math.PI/2,0],u[0]=t):t=u[0],u[1]!==f?(r=Object.entries(f).filter(ta).map(tn),u[1]=f,u[2]=r):r=u[2],u[3]!==m||u[4]!==d||u[5]!==c?(a=m?(0,n.jsxs)(e3.FloatingLabel,{children:[c._id,": ",d]}):null,u[3]=m,u[4]=d,u[5]=c,u[6]=a):a=u[6],u[7]!==r||u[8]!==a?(o=(0,n.jsxs)("group",{rotation:t,children:[r,a]}),u[7]=r,u[8]=a,u[9]=o):o=u[9],o});function te(e){let t,r,a,o,s=(0,i.c)(9),{color:l,label:u}=e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("boxGeometry",{args:[10,10,10]}),s[0]=t):t=s[0],s[1]!==l?(r=(0,n.jsx)("meshStandardMaterial",{color:l,wireframe:!0}),s[1]=l,s[2]=r):r=s[2],s[3]!==l||s[4]!==u?(a=u?(0,n.jsx)(e3.FloatingLabel,{color:l,children:u}):null,s[3]=l,s[4]=u,s[5]=a):a=s[5],s[6]!==r||s[7]!==a?(o=(0,n.jsxs)("mesh",{children:[t,r,a]}),s[6]=r,s[7]=a,s[8]=o):o=s[8],o}function tt(e){let t,r=(0,i.c)(3),{label:a}=e,o=(0,E.useDebug)(),s=o?.debugMode??!1;return r[0]!==s||r[1]!==a?(t=s?(0,n.jsx)(te,{color:"red",label:a}):null,r[0]=s,r[1]=a,r[2]=t):t=r[2],t}let tr=(0,o.memo)(function(e){let t,r,a,s,l,u,c,d,f,h=(0,i.c)(22),{object:m}=e;h[0]!==m?(t=(0,b.getProperty)(m,"interiorFile"),h[0]=m,h[1]=t):t=h[1];let p=t;h[2]!==m?(r=(0,b.getPosition)(m),h[2]=m,h[3]=r):r=h[3];let g=r;h[4]!==m?(a=(0,b.getScale)(m),h[4]=m,h[5]=a):a=h[5];let v=a;h[6]!==m?(s=(0,b.getRotation)(m),h[6]=m,h[7]=s):s=h[7];let y=s,A=`${m._id}: ${p}`;return h[8]!==A?(l=(0,n.jsx)(tt,{label:A}),h[8]=A,h[9]=l):l=h[9],h[10]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.jsx)(te,{color:"orange"}),h[10]=u):u=h[10],h[11]!==p||h[12]!==m?(c=(0,n.jsx)(o.Suspense,{fallback:u,children:(0,n.jsx)(e7,{object:m,interiorFile:p})}),h[11]=p,h[12]=m,h[13]=c):c=h[13],h[14]!==l||h[15]!==c?(d=(0,n.jsx)(Q,{fallback:l,children:c}),h[14]=l,h[15]=c,h[16]=d):d=h[16],h[17]!==g||h[18]!==y||h[19]!==v||h[20]!==d?(f=(0,n.jsx)("group",{position:g,quaternion:y,scale:v,children:d}),h[17]=g,h[18]=y,h[19]=v,h[20]=d,h[21]=f):f=h[21],f});function ta(e){let[,t]=e;return t.isMesh}function tn(e){let[t,r]=e;return(0,n.jsx)(e6,{node:r},t)}function ti(e,{path:t}){let[r]=(0,eX.useLoader)(u.CubeTextureLoader,[e],e=>e.setPath(t));return r}ti.preload=(e,{path:t})=>eX.useLoader.preload(u.CubeTextureLoader,[e],e=>e.setPath(t));let to=()=>{};function ts(e){return e.wrapS=u.RepeatWrapping,e.wrapT=u.RepeatWrapping,e.minFilter=u.LinearFilter,e.magFilter=u.LinearFilter,e.colorSpace=u.NoColorSpace,e.needsUpdate=!0,e}let tl=` - attribute float alpha; - - uniform vec2 uvOffset; - - varying vec2 vUv; - varying float vAlpha; - - void main() { - // Apply UV offset for scrolling - vUv = uv + uvOffset; - vAlpha = alpha; - - vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0); - // Set depth to far plane so clouds are always visible and behind other geometry - gl_Position = pos.xyww; - } -`,tu=` - uniform sampler2D cloudTexture; - uniform float debugMode; - uniform int layerIndex; - - varying vec2 vUv; - varying float vAlpha; - - // Debug grid using screen-space derivatives for sharp, anti-aliased lines - float debugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); - } - - void main() { - vec4 texColor = texture2D(cloudTexture, vUv); - - // Tribes 2 uses GL_MODULATE: final = texture \xd7 vertex color - // Vertex color is white with varying alpha, so: - // Final RGB = Texture RGB \xd7 1.0 = Texture RGB - // Final Alpha = Texture Alpha \xd7 Vertex Alpha - float finalAlpha = texColor.a * vAlpha; - vec3 color = texColor.rgb; - - // Debug mode: overlay R/G/B grid for layers 0/1/2 - if (debugMode > 0.5) { - float gridIntensity = debugGrid(vUv, 4.0, 1.5); - vec3 gridColor; - if (layerIndex == 0) { - gridColor = vec3(1.0, 0.0, 0.0); // Red - } else if (layerIndex == 1) { - gridColor = vec3(0.0, 1.0, 0.0); // Green - } else { - gridColor = vec3(0.0, 0.0, 1.0); // Blue - } - color = mix(color, gridColor, gridIntensity * 0.5); - } - - // Output clouds with texture color and combined alpha - gl_FragColor = vec4(color, finalAlpha); - } -`;function tc({textureUrl:e,radius:t,heightPercent:r,speed:a,windDirection:i,layerIndex:s}){let{debugMode:l}=(0,E.useDebug)(),{animationEnabled:c}=(0,E.useSettings)(),d=(0,o.useRef)(null),f=(0,B.useTexture)(e,ts),h=(0,o.useMemo)(()=>{let e=r-.05;return function(e,t,r,a){var n;let i,o,s,l,c,d,f,h,m,p,g,v,y,A,F,b,C,B=new u.BufferGeometry,S=new Float32Array(75),x=new Float32Array(50),E=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],M=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let a=5*t+r,n=-e+r*M,i=e-t*M,o=e*E[a];S[3*a]=n,S[3*a+1]=o,S[3*a+2]=i,x[2*a]=r,x[2*a+1]=t}n=S,i=e=>({x:n[3*e],y:n[3*e+1],z:n[3*e+2]}),o=(e,t,r,a)=>{n[3*e]=t,n[3*e+1]=r,n[3*e+2]=a},s=i(1),l=i(3),c=i(5),d=i(6),f=i(8),h=i(9),m=i(15),p=i(16),g=i(18),v=i(19),y=i(21),A=i(23),F=c.x+(s.x-c.x)*.5,b=c.y+(s.y-c.y)*.5,C=c.z+(s.z-c.z)*.5,o(0,d.x+(F-d.x)*2,d.y+(b-d.y)*2,d.z+(C-d.z)*2),F=h.x+(l.x-h.x)*.5,b=h.y+(l.y-h.y)*.5,C=h.z+(l.z-h.z)*.5,o(4,f.x+(F-f.x)*2,f.y+(b-f.y)*2,f.z+(C-f.z)*2),F=y.x+(m.x-y.x)*.5,b=y.y+(m.y-y.y)*.5,C=y.z+(m.z-y.z)*.5,o(20,p.x+(F-p.x)*2,p.y+(b-p.y)*2,p.z+(C-p.z)*2),F=A.x+(v.x-A.x)*.5,b=A.y+(v.y-A.y)*.5,C=A.z+(v.z-A.z)*.5,o(24,g.x+(F-g.x)*2,g.y+(b-g.y)*2,g.z+(C-g.z)*2);let D=function(e,t){let r=new Float32Array(25);for(let a=0;a<25;a++){let n=e[3*a],i=e[3*a+2],o=1.3-Math.sqrt(n*n+i*i)/t;o<.4?o=0:o>.8&&(o=1),r[a]=o}return r}(S,e),k=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,a=r+1,n=r+5,i=n+1;k.push(r,n,i),k.push(r,i,a)}return B.setIndex(k),B.setAttribute("position",new u.Float32BufferAttribute(S,3)),B.setAttribute("uv",new u.Float32BufferAttribute(x,2)),B.setAttribute("alpha",new u.Float32BufferAttribute(D,1)),B.computeBoundingSphere(),B}(t,r,e,0)},[t,r]);(0,o.useEffect)(()=>()=>{h.dispose()},[h]);let m=(0,o.useMemo)(()=>new u.ShaderMaterial({uniforms:{cloudTexture:{value:f},uvOffset:{value:new u.Vector2(0,0)},debugMode:{value:+!!l},layerIndex:{value:s}},vertexShader:tl,fragmentShader:tu,transparent:!0,depthWrite:!1,side:u.DoubleSide}),[f,l,s]);return(0,o.useEffect)(()=>()=>{m.dispose()},[m]),(0,A.useFrame)(c?(e,t)=>{let r=1e3*t/32;d.current??=new u.Vector2(0,0),d.current.x+=i.x*a*r,d.current.y+=i.y*a*r,d.current.x-=Math.floor(d.current.x),d.current.y-=Math.floor(d.current.y),m.uniforms.uvOffset.value.copy(d.current)}:to),(0,n.jsx)("mesh",{geometry:h,frustumCulled:!1,renderOrder:10,children:(0,n.jsx)("primitive",{object:m,attach:"material"})})}function td(e){var t;let r,a,s,l,c,d,f,h,m,p,v,F,C,B,S,x,E,M,D,k=(0,i.c)(37),{object:I}=e;k[0]!==I?(r=(0,b.getProperty)(I,"materialList"),k[0]=I,k[1]=r):r=k[1];let{data:w}=(t=r,(M=(0,i.c)(7))[0]!==t?(S=["detailMapList",t],x=()=>(0,y.loadDetailMapList)(t),M[0]=t,M[1]=S,M[2]=x):(S=M[1],x=M[2]),D=!!t,M[3]!==S||M[4]!==x||M[5]!==D?(E={queryKey:S,queryFn:x,enabled:D},M[3]=S,M[4]=x,M[5]=D,M[6]=E):E=M[6],(0,g.useQuery)(E));k[2]!==I?(a=(0,b.getFloat)(I,"visibleDistance")??500,k[2]=I,k[3]=a):a=k[3];let T=.95*a;k[4]!==I?(s=(0,b.getFloat)(I,"cloudSpeed1")??1e-4,k[4]=I,k[5]=s):s=k[5],k[6]!==I?(l=(0,b.getFloat)(I,"cloudSpeed2")??2e-4,k[6]=I,k[7]=l):l=k[7],k[8]!==I?(c=(0,b.getFloat)(I,"cloudSpeed3")??3e-4,k[8]=I,k[9]=c):c=k[9],k[10]!==s||k[11]!==l||k[12]!==c?(d=[s,l,c],k[10]=s,k[11]=l,k[12]=c,k[13]=d):d=k[13];let R=d;k[14]!==I?(f=(0,b.getFloat)(I,"cloudHeightPer1")??.35,k[14]=I,k[15]=f):f=k[15],k[16]!==I?(h=(0,b.getFloat)(I,"cloudHeightPer2")??.25,k[16]=I,k[17]=h):h=k[17],k[18]!==I?(m=(0,b.getFloat)(I,"cloudHeightPer3")??.2,k[18]=I,k[19]=m):m=k[19],k[20]!==f||k[21]!==h||k[22]!==m?(p=[f,h,m],k[20]=f,k[21]=h,k[22]=m,k[23]=p):p=k[23];let P=p;if(k[24]!==I){e:{let e,t=(0,b.getProperty)(I,"windVelocity");if(t){let[e,r]=t.split(" ").map(tf);if(0!==e||0!==r){v=new u.Vector2(r,-e).normalize();break e}}k[26]===Symbol.for("react.memo_cache_sentinel")?(e=new u.Vector2(1,0),k[26]=e):e=k[26],v=e}k[24]=I,k[25]=v}else v=k[25];let G=v;t:{let e;if(!w){let e;k[27]===Symbol.for("react.memo_cache_sentinel")?(e=[],k[27]=e):e=k[27],F=e;break t}if(k[28]!==P||k[29]!==R||k[30]!==w){e=[];for(let t=0;t<3;t++){let r=w[7+t];r&&e.push({texture:r,height:P[t],speed:R[t]})}k[28]=P,k[29]=R,k[30]=w,k[31]=e}else e=k[31];F=e}let L=F,j=(0,o.useRef)(null);return(k[32]===Symbol.for("react.memo_cache_sentinel")?(C=e=>{let{camera:t}=e;j.current&&j.current.position.copy(t.position)},k[32]=C):C=k[32],(0,A.useFrame)(C),L&&0!==L.length)?(k[33]!==L||k[34]!==T||k[35]!==G?(B=(0,n.jsx)("group",{ref:j,children:L.map((e,t)=>{let r=(0,y.textureToUrl)(e.texture);return(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(tc,{textureUrl:r,radius:T,heightPercent:e.height,speed:e.speed,windDirection:G,layerIndex:t})},t)})}),k[33]=L,k[34]=T,k[35]=G,k[36]=B):B=k[36],B):null}function tf(e){return parseFloat(e)}let th=!1;function tm(e){if(!e)return;let[t,r,a]=e.split(" ").map(e=>parseFloat(e));return[new u.Color().setRGB(t,r,a),new u.Color().setRGB(t,r,a).convertSRGBToLinear()]}function tp({skyBoxFiles:e,fogColor:t,fogState:r}){let{camera:a}=(0,F.useThree)(),i=ti(e,{path:""}),s=!!t,l=(0,o.useMemo)(()=>a.projectionMatrixInverse,[a]),c=(0,o.useMemo)(()=>r?(0,D.packFogVolumeData)(r.fogVolumes):new Float32Array(12),[r]),d=(0,o.useRef)({skybox:{value:i},fogColor:{value:t??new u.Color(0,0,0)},enableFog:{value:s},inverseProjectionMatrix:{value:l},cameraMatrixWorld:{value:a.matrixWorld},cameraHeight:D.globalFogUniforms.cameraHeight,fogVolumeData:{value:c},horizonFogHeight:{value:.18}}),f=(0,o.useMemo)(()=>{if(!r)return .18;let e=.95*r.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[r]);return(0,o.useEffect)(()=>{d.current.skybox.value=i,d.current.fogColor.value=t??new u.Color(0,0,0),d.current.enableFog.value=s,d.current.fogVolumeData.value=c,d.current.horizonFogHeight.value=f},[i,t,s,c,f]),(0,n.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,n.jsxs)("bufferGeometry",{children:[(0,n.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,n.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,n.jsx)("shaderMaterial",{uniforms:d.current,vertexShader:` - varying vec2 vUv; - - void main() { - vUv = uv; - gl_Position = vec4(position.xy, 0.9999, 1.0); - } - `,fragmentShader:` - uniform samplerCube skybox; - uniform vec3 fogColor; - uniform bool enableFog; - uniform mat4 inverseProjectionMatrix; - uniform mat4 cameraMatrixWorld; - uniform float cameraHeight; - uniform float fogVolumeData[12]; - uniform float horizonFogHeight; - - varying vec2 vUv; - - // Convert linear to sRGB for display - // shaderMaterial does NOT get automatic linear->sRGB output conversion - // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js - vec3 linearToSRGB(vec3 linear) { - vec3 low = linear * 12.92; - vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; - return mix(low, high, step(vec3(0.0031308), linear)); - } - - void main() { - vec2 ndc = vUv * 2.0 - 1.0; - vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); - viewPos.xyz /= viewPos.w; - vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); - direction = vec3(direction.z, direction.y, -direction.x); - // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear - vec4 skyColor = textureCube(skybox, direction); - vec3 finalColor; - - if (enableFog) { - vec3 effectiveFogColor = fogColor; - - // Calculate how much fog volume the ray passes through - // For skybox at "infinite" distance, the relevant height is how much - // of the volume is above/below camera depending on view direction - float volumeFogInfluence = 0.0; - - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - // Check if camera is inside this volume - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - // Camera is inside the fog volume - // Looking horizontally or up at shallow angles means ray travels - // through more fog before exiting the volume - float heightAboveCamera = volMaxH - cameraHeight; - float heightBelowCamera = cameraHeight - volMinH; - float volumeHeight = volMaxH - volMinH; - - // For horizontal rays (direction.y ≈ 0), maximum fog influence - // For rays going up steeply, less fog (exits volume quickly) - // For rays going down, more fog (travels through volume below) - float rayInfluence; - if (direction.y >= 0.0) { - // Looking up: influence based on how steep we're looking - // Shallow angles = long path through fog = high influence - rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); - } else { - // Looking down: always high fog (into the volume) - rayInfluence = 1.0; - } - - // Scale by percentage and volume depth factor - volumeFogInfluence += rayInfluence * volPct; - } - } - - // Base fog factor from view direction (for haze at horizon) - // In Torque, the fog "bans" (bands) are rendered as geometry from - // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox. - // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3). - // - // horizonFogHeight is the direction.y value where the fog band ends: - // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2) - // - // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18 - // - // Torque renders the fog bands as geometry with linear vertex alpha - // interpolation. We use a squared curve (t^2) to create a gentler - // falloff at the top of the gradient, matching Tribes 2's appearance. - float baseFogFactor; - if (direction.y <= 0.0) { - // Looking at or below horizon: full fog - baseFogFactor = 1.0; - } else if (direction.y >= horizonFogHeight) { - // Above fog band: no fog - baseFogFactor = 0.0; - } else { - // Within fog band: squared curve for gentler falloff at top - float t = direction.y / horizonFogHeight; - baseFogFactor = (1.0 - t) * (1.0 - t); - } - - // Combine base fog with volume fog influence - // When inside a volume, increase fog intensity - float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); - - finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor); - } else { - finalColor = skyColor.rgb; - } - // Convert linear result to sRGB for display - gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); - } - `,depthWrite:!1,depthTest:!1})]})}function tg(e){let t,r,a,o,s=(0,i.c)(6),{materialList:l,fogColor:u,fogState:c}=e,{data:d}=((o=(0,i.c)(2))[0]!==l?(a={queryKey:["detailMapList",l],queryFn:()=>(0,y.loadDetailMapList)(l)},o[0]=l,o[1]=a):a=o[1],(0,g.useQuery)(a));s[0]!==d?(t=d?[(0,y.textureToUrl)(d[1]),(0,y.textureToUrl)(d[3]),(0,y.textureToUrl)(d[4]),(0,y.textureToUrl)(d[5]),(0,y.textureToUrl)(d[0]),(0,y.textureToUrl)(d[2])]:null,s[0]=d,s[1]=t):t=s[1];let f=t;return f?(s[2]!==u||s[3]!==c||s[4]!==f?(r=(0,n.jsx)(tp,{skyBoxFiles:f,fogColor:u,fogState:c}),s[2]=u,s[3]=c,s[4]=f,s[5]=r):r=s[5],r):null}function tv({skyColor:e,fogColor:t,fogState:r}){let{camera:a}=(0,F.useThree)(),i=!!t,s=(0,o.useMemo)(()=>a.projectionMatrixInverse,[a]),l=(0,o.useMemo)(()=>r?(0,D.packFogVolumeData)(r.fogVolumes):new Float32Array(12),[r]),c=(0,o.useMemo)(()=>{if(!r)return .18;let e=.95*r.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[r]),d=(0,o.useRef)({skyColor:{value:e},fogColor:{value:t??new u.Color(0,0,0)},enableFog:{value:i},inverseProjectionMatrix:{value:s},cameraMatrixWorld:{value:a.matrixWorld},cameraHeight:D.globalFogUniforms.cameraHeight,fogVolumeData:{value:l},horizonFogHeight:{value:c}});return(0,o.useEffect)(()=>{d.current.skyColor.value=e,d.current.fogColor.value=t??new u.Color(0,0,0),d.current.enableFog.value=i,d.current.fogVolumeData.value=l,d.current.horizonFogHeight.value=c},[e,t,i,l,c]),(0,n.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,n.jsxs)("bufferGeometry",{children:[(0,n.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,n.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,n.jsx)("shaderMaterial",{uniforms:d.current,vertexShader:` - varying vec2 vUv; - - void main() { - vUv = uv; - gl_Position = vec4(position.xy, 0.9999, 1.0); - } - `,fragmentShader:` - uniform vec3 skyColor; - uniform vec3 fogColor; - uniform bool enableFog; - uniform mat4 inverseProjectionMatrix; - uniform mat4 cameraMatrixWorld; - uniform float cameraHeight; - uniform float fogVolumeData[12]; - uniform float horizonFogHeight; - - varying vec2 vUv; - - // Convert linear to sRGB for display - vec3 linearToSRGB(vec3 linear) { - vec3 low = linear * 12.92; - vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; - return mix(low, high, step(vec3(0.0031308), linear)); - } - - void main() { - vec2 ndc = vUv * 2.0 - 1.0; - vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); - viewPos.xyz /= viewPos.w; - vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); - direction = vec3(direction.z, direction.y, -direction.x); - - vec3 finalColor; - - if (enableFog) { - // Calculate volume fog influence (same logic as SkyBoxTexture) - float volumeFogInfluence = 0.0; - - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - float rayInfluence; - if (direction.y >= 0.0) { - rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); - } else { - rayInfluence = 1.0; - } - volumeFogInfluence += rayInfluence * volPct; - } - } - - // Base fog factor from view direction - float baseFogFactor; - if (direction.y <= 0.0) { - baseFogFactor = 1.0; - } else if (direction.y >= horizonFogHeight) { - baseFogFactor = 0.0; - } else { - float t = direction.y / horizonFogHeight; - baseFogFactor = (1.0 - t) * (1.0 - t); - } - - // Combine base fog with volume fog influence - float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); - - finalColor = mix(skyColor, fogColor, finalFogFactor); - } else { - finalColor = skyColor; - } - - gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); - } - `,depthWrite:!1,depthTest:!1})]})}function ty(e,t){let{fogDistance:r,visibleDistance:a}=e;return[r,a]}function tA({fogState:e,enabled:t}){let{scene:r,camera:a}=(0,F.useThree)(),n=(0,o.useRef)(null),i=(0,o.useMemo)(()=>(0,D.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,o.useEffect)(()=>{th||((0,M.installCustomFogShader)(),th=!0)},[]),(0,o.useEffect)(()=>{(0,D.resetGlobalFogUniforms)();let[t,o]=ty(e,a.position.y),s=new u.Fog(e.fogColor,t,o);return r.fog=s,n.current=s,(0,D.updateGlobalFogUniforms)(a.position.y,i),()=>{r.fog=null,n.current=null,(0,D.resetGlobalFogUniforms)()}},[r,a,e,i]),(0,o.useEffect)(()=>{let r=n.current;if(r)if(t){let[t,n]=ty(e,a.position.y);r.near=t,r.far=n}else r.near=1e10,r.far=1e10},[t,e,a.position.y]),(0,A.useFrame)(()=>{let r=n.current;if(!r)return;let o=a.position.y;if((0,D.updateGlobalFogUniforms)(o,i,t),t){let[t,a]=ty(e,o);r.near=t,r.far=a,r.color.copy(e.fogColor)}}),null}function tF(e){return parseFloat(e)}function tb(e){return parseFloat(e)}function tC(e){return parseFloat(e)}function tB(e){let t=new Set;return e.bones.forEach((e,r)=>{e.name.match(/^Hulk/i)&&t.add(r)}),t}function tS(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,a=e.attributes.skinWeight,n=e.index,i=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(o)){i[e]=!0;break}}if(n){let t=[],r=n.array;for(let e=0;e{for(r.current+=n;r.current>=.03125;)if(r.current-=.03125,a.current++,t.current)for(let e of t.current)e(a.current)});let i=(0,o.useCallback)(e=>(t.current??=new Set,t.current.add(e),()=>{t.current.delete(e)}),[]),s=(0,o.useCallback)(()=>a.current,[]),l=(0,o.useMemo)(()=>({subscribe:i,getTick:s}),[i,s]);return(0,n.jsx)(tR.Provider,{value:l,children:e})}let tG=new Map;function tL(e){e.onBeforeCompile=t=>{(0,M.injectCustomFog)(t,D.globalFogUniforms),e instanceof u.MeshLambertMaterial&&(t.uniforms.shapeDirectionalFactor={value:1},t.uniforms.shapeAmbientFactor={value:1.5},t.fragmentShader=t.fragmentShader.replace("#include ",`#include -uniform float shapeDirectionalFactor; -uniform float shapeAmbientFactor; -`),t.fragmentShader=t.fragmentShader.replace("#include ",`#include - // Apply shape-specific lighting multipliers - reflectedLight.directDiffuse *= shapeDirectionalFactor; - reflectedLight.indirectDiffuse *= shapeAmbientFactor; -`))}}function tj(e,t,r,a,n=1,i=!1){let o=r.has("Translucent"),s=r.has("Additive"),l=r.has("SelfIlluminating"),c=n<1||i;if(l){let e=s||o||c,r=new u.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...c&&{opacity:n},...s&&{blending:u.AdditiveBlending}});return tL(r),r}if(a||o){let e={map:t,transparent:c,alphaTest:.5*!c,...c&&{opacity:n,depthWrite:!1},reflectivity:0},r=new u.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),a=new u.MeshLambertMaterial({...e,side:0});return tL(r),tL(a),[r,a]}let d=new u.MeshLambertMaterial({map:t,side:2,reflectivity:0,...c&&{transparent:!0,opacity:n,depthWrite:!1}});return tL(d),d}function t_(e){let t,r=(0,i.c)(2);return r[0]!==e?(t=(0,y.shapeToUrl)(e),r[0]=e,r[1]=t):t=r[1],e2(t)}let tO=(0,o.memo)(function(e){let t,r,a,s,l,c,d=(0,i.c)(37),{material:f,shapeName:h,geometry:m,backGeometry:p,castShadow:g,receiveShadow:v,vis:A,animated:F}=e,b=void 0!==g&&g,C=void 0!==v&&v,S=void 0===A?1:A,x=void 0!==F&&F,M=f.userData.resource_path;d[0]!==f.userData.flag_names?(t=f.userData.flag_names??[],d[0]=f.userData.flag_names,d[1]=t):t=d[1],d[2]!==t?(r=new Set(t),d[2]=t,d[3]=r):r=d[3];let D=r,k=function(e){let t,r,a,n,s=(0,i.c)(14),{animationEnabled:l}=(0,E.useSettings)();s[0]!==e?(t={queryKey:["ifl",e],queryFn:()=>(0,y.loadImageFrameList)(e)},s[0]=e,s[1]=t):t=s[1];let{data:c}=(m=t,(0,tw.useBaseQuery)({...m,enabled:!0,suspense:!0,throwOnError:tT.defaultThrowOnError,placeholderData:void 0},tI.QueryObserver,void 0));if(s[2]!==c||s[3]!==e){let t;s[5]!==e?(t=t=>(0,y.iflTextureToUrl)(t.name,e),s[5]=e,s[6]=t):t=s[6],r=c.map(t),s[2]=c,s[3]=e,s[4]=r}else r=s[4];let d=r,f=(0,B.useTexture)(d);if(s[7]!==c||s[8]!==e||s[9]!==f){let t;if(!(a=tG.get(e))){let t,r,n,i,o,s,l,c,d;r=(t=f[0].image).width,n=t.height,o=Math.ceil(Math.sqrt(i=f.length)),s=Math.ceil(i/o),(l=document.createElement("canvas")).width=r*o,l.height=n*s,c=l.getContext("2d"),f.forEach((e,t)=>{let a=Math.floor(t/o);c.drawImage(e.image,t%o*r,a*n)}),(d=new u.CanvasTexture(l)).colorSpace=u.SRGBColorSpace,d.generateMipmaps=!1,d.minFilter=u.NearestFilter,d.magFilter=u.NearestFilter,d.wrapS=u.ClampToEdgeWrapping,d.wrapT=u.ClampToEdgeWrapping,d.repeat.set(1/o,1/s),a={texture:d,columns:o,rows:s,frameCount:i,frameStartTicks:[],totalTicks:0,lastFrame:-1},tG.set(e,a)}t=0,(p=a).frameStartTicks=c.map(e=>{let r=t;return t+=e.frameCount,r}),p.totalTicks=t,s[7]=c,s[8]=e,s[9]=f,s[10]=a}else a=s[10];let h=a;s[11]!==l||s[12]!==h?(n=e=>{let t=l?function(e,t){if(0===e.totalTicks)return 0;let r=t%e.totalTicks,{frameStartTicks:a}=e;for(let e=a.length-1;e>=0;e--)if(r>=a[e])return e;return 0}(h,e):0;!function(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,a=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,a/e.rows)}(h,t)},s[11]=l,s[12]=h,s[13]=n):n=s[13];var m,p,g=n;let v=(0,o.useContext)(tR);if(!v)throw Error("useTick must be used within a TickProvider");let A=(0,o.useRef)(g);return A.current=g,(0,o.useEffect)(()=>v.subscribe(e=>A.current(e)),[v]),h.texture}(`textures/${M}.ifl`);d[4]!==h?(a=h&&tE(h),d[4]=h,d[5]=a):a=d[5];let I=a;d[6]!==x||d[7]!==D||d[8]!==I||d[9]!==f||d[10]!==k||d[11]!==S?(s=tj(f,k,D,I,S,x),d[6]=x,d[7]=D,d[8]=I,d[9]=f,d[10]=k,d[11]=S,d[12]=s):s=d[12];let w=s;if(Array.isArray(w)){let e,t,r,a,i,o=p||m;return d[13]!==w[0]?(e=(0,n.jsx)("primitive",{object:w[0],attach:"material"}),d[13]=w[0],d[14]=e):e=d[14],d[15]!==b||d[16]!==C||d[17]!==e||d[18]!==o?(t=(0,n.jsx)("mesh",{geometry:o,castShadow:b,receiveShadow:C,children:e}),d[15]=b,d[16]=C,d[17]=e,d[18]=o,d[19]=t):t=d[19],d[20]!==w[1]?(r=(0,n.jsx)("primitive",{object:w[1],attach:"material"}),d[20]=w[1],d[21]=r):r=d[21],d[22]!==b||d[23]!==m||d[24]!==C||d[25]!==r?(a=(0,n.jsx)("mesh",{geometry:m,castShadow:b,receiveShadow:C,children:r}),d[22]=b,d[23]=m,d[24]=C,d[25]=r,d[26]=a):a=d[26],d[27]!==t||d[28]!==a?(i=(0,n.jsxs)(n.Fragment,{children:[t,a]}),d[27]=t,d[28]=a,d[29]=i):i=d[29],i}return d[30]!==w?(l=(0,n.jsx)("primitive",{object:w,attach:"material"}),d[30]=w,d[31]=l):l=d[31],d[32]!==b||d[33]!==m||d[34]!==C||d[35]!==l?(c=(0,n.jsx)("mesh",{geometry:m,castShadow:b,receiveShadow:C,children:l}),d[32]=b,d[33]=m,d[34]=C,d[35]=l,d[36]=c):c=d[36],c}),tU=(0,o.memo)(function(e){let t,r,a,o,s,l,u,c,d=(0,i.c)(42),{material:f,shapeName:h,geometry:m,backGeometry:p,castShadow:g,receiveShadow:v,vis:A,animated:F}=e,b=void 0!==g&&g,S=void 0!==v&&v,x=void 0===A?1:A,E=void 0!==F&&F,M=f.userData.resource_path;d[0]!==f.userData.flag_names?(t=f.userData.flag_names??[],d[0]=f.userData.flag_names,d[1]=t):t=d[1],d[2]!==t?(r=new Set(t),d[2]=t,d[3]=r):r=d[3];let D=r;M||console.warn(`No resource_path was found on "${h}" - rendering fallback.`),d[4]!==M?(a=M?(0,y.textureToUrl)(M):y.FALLBACK_TEXTURE_URL,d[4]=M,d[5]=a):a=d[5];let k=a;d[6]!==h?(o=h&&tE(h),d[6]=h,d[7]=o):o=d[7];let I=o,w=D.has("Translucent");d[8]!==I||d[9]!==w?(s=e=>I||w?(0,C.setupTexture)(e,{disableMipmaps:!0}):(0,C.setupTexture)(e),d[8]=I,d[9]=w,d[10]=s):s=d[10];let T=(0,B.useTexture)(k,s);d[11]!==E||d[12]!==D||d[13]!==I||d[14]!==f||d[15]!==T||d[16]!==x?(l=tj(f,T,D,I,x,E),d[11]=E,d[12]=D,d[13]=I,d[14]=f,d[15]=T,d[16]=x,d[17]=l):l=d[17];let R=l;if(Array.isArray(R)){let e,t,r,a,i,o=p||m;return d[18]!==R[0]?(e=(0,n.jsx)("primitive",{object:R[0],attach:"material"}),d[18]=R[0],d[19]=e):e=d[19],d[20]!==b||d[21]!==S||d[22]!==o||d[23]!==e?(t=(0,n.jsx)("mesh",{geometry:o,castShadow:b,receiveShadow:S,children:e}),d[20]=b,d[21]=S,d[22]=o,d[23]=e,d[24]=t):t=d[24],d[25]!==R[1]?(r=(0,n.jsx)("primitive",{object:R[1],attach:"material"}),d[25]=R[1],d[26]=r):r=d[26],d[27]!==b||d[28]!==m||d[29]!==S||d[30]!==r?(a=(0,n.jsx)("mesh",{geometry:m,castShadow:b,receiveShadow:S,children:r}),d[27]=b,d[28]=m,d[29]=S,d[30]=r,d[31]=a):a=d[31],d[32]!==t||d[33]!==a?(i=(0,n.jsxs)(n.Fragment,{children:[t,a]}),d[32]=t,d[33]=a,d[34]=i):i=d[34],i}return d[35]!==R?(u=(0,n.jsx)("primitive",{object:R,attach:"material"}),d[35]=R,d[36]=u):u=d[36],d[37]!==b||d[38]!==m||d[39]!==S||d[40]!==u?(c=(0,n.jsx)("mesh",{geometry:m,castShadow:b,receiveShadow:S,children:u}),d[37]=b,d[38]=m,d[39]=S,d[40]=u,d[41]=c):c=d[41],c}),tH=(0,o.memo)(function(e){let t=(0,i.c)(18),{material:r,shapeName:a,geometry:o,backGeometry:s,castShadow:l,receiveShadow:u,vis:c,animated:d}=e,f=void 0!==l&&l,h=void 0!==u&&u,m=void 0===c?1:c,p=void 0!==d&&d,g=new Set(r.userData.flag_names??[]).has("IflMaterial"),v=r.userData.resource_path;if(g&&v){let e;return t[0]!==p||t[1]!==s||t[2]!==f||t[3]!==o||t[4]!==r||t[5]!==h||t[6]!==a||t[7]!==m?(e=(0,n.jsx)(tO,{material:r,shapeName:a,geometry:o,backGeometry:s,castShadow:f,receiveShadow:h,vis:m,animated:p}),t[0]=p,t[1]=s,t[2]=f,t[3]=o,t[4]=r,t[5]=h,t[6]=a,t[7]=m,t[8]=e):e=t[8],e}if(!r.name)return null;{let e;return t[9]!==p||t[10]!==s||t[11]!==f||t[12]!==o||t[13]!==r||t[14]!==h||t[15]!==a||t[16]!==m?(e=(0,n.jsx)(tU,{material:r,shapeName:a,geometry:o,backGeometry:s,castShadow:f,receiveShadow:h,vis:m,animated:p}),t[9]=p,t[10]=s,t[11]=f,t[12]=o,t[13]=r,t[14]=h,t[15]=a,t[16]=m,t[17]=e):e=t[17],e}});function tN(e){let t,r,a,o,s=(0,i.c)(9),{color:l,label:u}=e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("boxGeometry",{args:[10,10,10]}),s[0]=t):t=s[0],s[1]!==l?(r=(0,n.jsx)("meshStandardMaterial",{color:l,wireframe:!0}),s[1]=l,s[2]=r):r=s[2],s[3]!==l||s[4]!==u?(a=u?(0,n.jsx)(e3.FloatingLabel,{color:l,children:u}):null,s[3]=l,s[4]=u,s[5]=a):a=s[5],s[6]!==r||s[7]!==a?(o=(0,n.jsxs)("mesh",{children:[t,r,a]}),s[6]=r,s[7]=a,s[8]=o):o=s[8],o}function tJ(e){let t,r=(0,i.c)(4),{color:a,label:o}=e,{debugMode:s}=(0,E.useDebug)();return r[0]!==a||r[1]!==s||r[2]!==o?(t=s?(0,n.jsx)(tN,{color:a,label:o}):null,r[0]=a,r[1]=s,r[2]=o,r[3]=t):t=r[3],t}let tK=new Set(["octahedron.dts"]);function tV(e){let t,r,a,o,s=(0,i.c)(6),{label:l}=e,{debugMode:u}=(0,E.useDebug)();return u?(s[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("icosahedronGeometry",{args:[1,1]}),r=(0,n.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),s[0]=t,s[1]=r):(t=s[0],r=s[1]),s[2]!==l?(a=l?(0,n.jsx)(e3.FloatingLabel,{color:"cyan",children:l}):null,s[2]=l,s[3]=a):a=s[3],s[4]!==a?(o=(0,n.jsxs)("mesh",{children:[t,r,a]}),s[4]=a,s[5]=o):o=s[5],o):null}function tz(e){let t,r,a,s,l,u=(0,i.c)(15),{loadingColor:c,children:d}=e,f=void 0===c?"yellow":c,{object:h,shapeName:m}=tD();if(!m){let e,t=`${h._id}: `;return u[0]!==t?(e=(0,n.jsx)(tJ,{color:"orange",label:t}),u[0]=t,u[1]=e):e=u[1],e}if(tK.has(m.toLowerCase())){let e,t=`${h._id}: ${m}`;return u[2]!==t?(e=(0,n.jsx)(tV,{label:t}),u[2]=t,u[3]=e):e=u[3],e}let p=`${h._id}: ${m}`;return u[4]!==p?(t=(0,n.jsx)(tJ,{color:"red",label:p}),u[4]=p,u[5]=t):t=u[5],u[6]!==f?(r=(0,n.jsx)(tN,{color:f}),u[6]=f,u[7]=r):r=u[7],u[8]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)(tW,{}),u[8]=a):a=u[8],u[9]!==d||u[10]!==r?(s=(0,n.jsxs)(o.Suspense,{fallback:r,children:[a,d]}),u[9]=d,u[10]=r,u[11]=s):s=u[11],u[12]!==t||u[13]!==s?(l=(0,n.jsx)(Q,{fallback:t,children:s}),u[12]=t,u[13]=s,u[14]=l):l=u[14],l}function tq(e){return null!=e&&"ambient"===(e.vis_sequence??"").toLowerCase()&&Array.isArray(e.vis_keyframes)&&e.vis_keyframes.length>1&&(e.vis_duration??0)>0}function tQ(e){let t,r,a=(0,i.c)(7),{keyframes:s,duration:l,cyclic:u,children:c}=e,d=(0,o.useRef)(null),{animationEnabled:f}=(0,E.useSettings)();return a[0]!==f||a[1]!==u||a[2]!==l||a[3]!==s?(t=()=>{let e=d.current;if(!e)return;if(!f)return void e.traverse(e=>{if(e.isMesh){let t=e.material;t&&!Array.isArray(t)&&(t.opacity=s[0])}});let t=performance.now()/1e3,r=u?t%l/l:Math.min(t/l,1),a=s.length,n=r*a,i=Math.floor(n)%a,o=n-Math.floor(n),c=s[i]+(s[(i+1)%a]-s[i])*o;e.traverse(e=>{if(e.isMesh){let t=e.material;t&&!Array.isArray(t)&&(t.opacity=c)}})},a[0]=f,a[1]=u,a[2]=l,a[3]=s,a[4]=t):t=a[4],(0,A.useFrame)(t),a[5]!==c?(r=(0,n.jsx)("group",{ref:d,children:c}),a[5]=c,a[6]=r):r=a[6],r}let tW=(0,o.memo)(function(){let e,t,r,a,s,l,u=(0,i.c)(19),{object:c,shapeName:d,isOrganic:f}=tD(),{debugMode:h}=(0,E.useDebug)(),{nodes:m}=t_(d);if(u[0]!==m){e:{let t,r=Object.values(m).filter(tX);if(r.length>0){e=tB(r[0].skeleton);break e}u[2]===Symbol.for("react.memo_cache_sentinel")?(t=new Set,u[2]=t):t=u[2],e=t}u[0]=m,u[1]=e}else e=u[1];let p=e;u[3]!==p||u[4]!==f||u[5]!==m?(t=Object.entries(m).filter(tY).map(e=>{let[,t]=e,r=tS(t.geometry,p),a=null;if(r){(r=r.clone()).computeVertexNormals();let e=r.attributes.position,t=r.attributes.normal,n=e.array,i=t.array,o=new Map;for(let t=0;t1){let t=0,r=0,a=0;for(let n of e)t+=i[3*n],r+=i[3*n+1],a+=i[3*n+2];let n=Math.sqrt(t*t+r*r+a*a);for(let o of(n>0&&(t/=n,r/=n,a/=n),e))i[3*o]=t,i[3*o+1]=r,i[3*o+2]=a}if(t.needsUpdate=!0,f){let e=(a=r.clone()).attributes.normal,t=e.array;for(let e=0;e{let{node:t,geometry:r,backGeometry:a,vis:i,visAnim:s}=e,l=!!s,u=(0,n.jsx)("mesh",{geometry:r,children:(0,n.jsx)("meshStandardMaterial",{color:"gray",wireframe:!0})}),c=t.material?Array.isArray(t.material)?t.material.map((e,t)=>(0,n.jsx)(tH,{material:e,shapeName:d,geometry:r,backGeometry:a,castShadow:v,receiveShadow:v,vis:i,animated:l},t)):(0,n.jsx)(tH,{material:t.material,shapeName:d,geometry:r,backGeometry:a,castShadow:v,receiveShadow:v,vis:i,animated:l}):null;return s?(0,n.jsx)(tQ,{keyframes:s.keyframes,duration:s.duration,cyclic:s.cyclic,children:(0,n.jsx)(o.Suspense,{fallback:u,children:c})},t.id):(0,n.jsx)(o.Suspense,{fallback:u,children:c},t.id)}),u[8]=v,u[9]=g,u[10]=d,u[11]=a):a=u[11],u[12]!==h||u[13]!==c||u[14]!==d?(s=h?(0,n.jsxs)(e3.FloatingLabel,{children:[c._id,": ",d]}):null,u[12]=h,u[13]=c,u[14]=d,u[15]=s):s=u[15],u[16]!==a||u[17]!==s?(l=(0,n.jsxs)("group",{rotation:r,children:[a,s]}),u[16]=a,u[17]=s,u[18]=l):l=u[18],l});function tX(e){return e.skeleton}function tY(e){let[,t]=e;return t.material&&"Unassigned"!==t.material.name&&!t.name.match(/^Hulk/i)&&((t.userData?.vis??1)>.01||tq(t.userData))}var tZ=e.i(6112);let t$={1:"Storm",2:"Inferno"},t0=(0,o.createContext)(null);function t1(){let e=(0,o.useContext)(t0);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function t2({children:e}){let{camera:t}=(0,F.useThree)(),[r,a]=(0,o.useState)(-1),[i,s]=(0,o.useState)({}),[l,c]=(0,o.useState)(()=>({initialized:!1,position:null,quarternion:null})),d=(0,o.useCallback)(e=>{s(t=>({...t,[e.id]:e}))},[]),f=(0,o.useCallback)(e=>{s(t=>{let{[e.id]:r,...a}=t;return a})},[]),h=Object.keys(i).length,m=(0,o.useCallback)(e=>{if(e>=0&&e{m(h?(r+1)%h:-1)},[h,r,m]);(0,o.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,r]=e.slice(2).split("~"),a=t.split(",").map(e=>parseFloat(e)),n=r.split(",").map(e=>parseFloat(e));c({initialized:!0,position:new u.Vector3(...a),quarternion:new u.Quaternion(...n)})}else c({initialized:!0,position:null,quarternion:null})};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}},[]),(0,o.useEffect)(()=>{l.initialized&&l.position&&(t.position.copy(l.position),l.quarternion&&t.quaternion.copy(l.quarternion))},[t,l]),(0,o.useEffect)(()=>{l.initialized&&!l.position&&h>0&&-1===r&&m(0)},[h,m,r,l]);let g=(0,o.useMemo)(()=>({registerCamera:d,unregisterCamera:f,nextCamera:p,setCameraIndex:m,cameraCount:h}),[d,f,p,m,h]);return 0===h&&-1!==r&&a(-1),(0,n.jsx)(t0.Provider,{value:g,children:e})}let t3=(0,o.createContext)(null),t9=t3.Provider,t5=(0,o.lazy)(()=>e.A(61921).then(e=>({default:e.AudioEmitter}))),t8={AudioEmitter:function(e){let t,r=(0,i.c)(3),{audioEnabled:a}=(0,E.useSettings)();return r[0]!==a||r[1]!==e?(t=a?(0,n.jsx)(t5,{...e}):null,r[0]=a,r[1]=e,r[2]=t):t=r[2],t},Camera:function(e){let t,r,a,n,s,l=(0,i.c)(14),{object:c}=e,{registerCamera:d,unregisterCamera:f}=t1(),h=(0,o.useId)();l[0]!==c?(t=(0,b.getProperty)(c,"dataBlock"),l[0]=c,l[1]=t):t=l[1];let m=t;l[2]!==c?(r=(0,b.getPosition)(c),l[2]=c,l[3]=r):r=l[3];let p=r;l[4]!==c?(a=(0,b.getRotation)(c),l[4]=c,l[5]=a):a=l[5];let g=a;return l[6]!==m||l[7]!==h||l[8]!==p||l[9]!==g||l[10]!==d||l[11]!==f?(n=()=>{if("Observer"===m){let e={id:h,position:new u.Vector3(...p),rotation:g};return d(e),()=>{f(e)}}},s=[h,m,d,f,p,g],l[6]=m,l[7]=h,l[8]=p,l[9]=g,l[10]=d,l[11]=f,l[12]=n,l[13]=s):(n=l[12],s=l[13]),(0,o.useEffect)(n,s),null},ForceFieldBare:(0,o.lazy)(()=>e.A(25147).then(e=>({default:e.ForceFieldBare}))),InteriorInstance:tr,Item:function(e){let t,r,a,s,l,u,c,d,f,h,m,p,g=(0,i.c)(32),{object:v}=e,y=J();g[0]!==v?(t=(0,b.getProperty)(v,"dataBlock")??"",g[0]=v,g[1]=t):t=g[1];let F=t,C=(0,tZ.useDatablock)(F);g[2]!==C||g[3]!==v?(r=function(e){if("string"==typeof e){let t=e.toLowerCase();return"0"!==t&&"false"!==t&&""!==t}return!!e}((0,b.getProperty)(v,"rotate")??(0,b.getProperty)(C,"rotate")),g[2]=C,g[3]=v,g[4]=r):r=g[4];let B=r;g[5]!==v?(a=(0,b.getPosition)(v),g[5]=v,g[6]=a):a=g[6];let S=a;g[7]!==v?(s=(0,b.getScale)(v),g[7]=v,g[8]=s):s=g[8];let x=s;g[9]!==v?(l=(0,b.getRotation)(v),g[9]=v,g[10]=l):l=g[10];let M=l,{animationEnabled:D}=(0,E.useSettings)(),k=(0,o.useRef)(null);g[11]!==D||g[12]!==B?(u=()=>{if(!k.current||!B||!D)return;let e=performance.now()/1e3;k.current.rotation.y=e/3*Math.PI*2},g[11]=D,g[12]=B,g[13]=u):u=g[13],(0,A.useFrame)(u),g[14]!==C?(c=(0,b.getProperty)(C,"shapeFile"),g[14]=C,g[15]=c):c=g[15];let I=c;I||console.error(` missing shape for datablock: ${F}`);let w=F?.toLowerCase()==="flag",T=y?.team??null,R=T&&T>0?t$[T]:null,P=w&&R?`${R} Flag`:null;return g[16]!==M||g[17]!==B?(d=!B&&{quaternion:M},g[16]=M,g[17]=B,g[18]=d):d=g[18],g[19]!==P?(f=P?(0,n.jsx)(e3.FloatingLabel,{opacity:.6,children:P}):null,g[19]=P,g[20]=f):f=g[20],g[21]!==f?(h=(0,n.jsx)(tz,{loadingColor:"pink",children:f}),g[21]=f,g[22]=h):h=g[22],g[23]!==S||g[24]!==x||g[25]!==h||g[26]!==d?(m=(0,n.jsx)("group",{ref:k,position:S,...d,scale:x,children:h}),g[23]=S,g[24]=x,g[25]=h,g[26]=d,g[27]=m):m=g[27],g[28]!==v||g[29]!==I||g[30]!==m?(p=(0,n.jsx)(tk,{type:"Item",object:v,shapeName:I,children:m}),g[28]=v,g[29]=I,g[30]=m,g[31]=p):p=g[31],p},SimGroup:function(e){let t,r,a,o,s=(0,i.c)(17),{object:l}=e,u=(0,R.useRuntimeObjectById)(l._id)??l,c=J();s[0]!==u._children?(t=u._children??[],s[0]=u._children,s[1]=t):t=s[1];let d=(0,R.useRuntimeChildIds)(u._id,t),f=null,h=!1;if(c&&c.hasTeams){if(h=!0,null!=c.team)f=c.team;else if(u._name){let e;if(s[2]!==u._name){let t;s[4]===Symbol.for("react.memo_cache_sentinel")?(t=/^team(\d+)$/i,s[4]=t):t=s[4],e=u._name.match(t),s[2]=u._name,s[3]=e}else e=s[3];let t=e;t&&(f=parseInt(t[1],10))}}else if(u._name){let e;s[5]!==u._name?(e=u._name.toLowerCase(),s[5]=u._name,s[6]=e):e=s[6],h="teams"===e}s[7]!==h||s[8]!==u||s[9]!==c||s[10]!==f?(r={object:u,parent:c,hasTeams:h,team:f},s[7]=h,s[8]=u,s[9]=c,s[10]=f,s[11]=r):r=s[11];let m=r;return s[12]!==d?(a=d.map(K),s[12]=d,s[13]=a):a=s[13],s[14]!==m||s[15]!==a?(o=(0,n.jsx)(N.Provider,{value:m,children:a}),s[14]=m,s[15]=a,s[16]=o):o=s[16],o},Sky:function({object:e}){let{fogEnabled:t,highQualityFog:r}=(0,E.useSettings)(),a=(0,b.getProperty)(e,"materialList"),i=(0,o.useMemo)(()=>tm((0,b.getProperty)(e,"SkySolidColor")),[e]),s=(0,b.getInt)(e,"useSkyTextures")??1,l=(0,o.useMemo)(()=>(function(e,t=!0){let r=(0,b.getFloat)(e,"fogDistance")??0,a=(0,b.getFloat)(e,"visibleDistance")??1e3,n=(0,b.getFloat)(e,"high_fogDistance"),i=(0,b.getFloat)(e,"high_visibleDistance"),o=t&&null!=n&&n>0?n:r,s=t&&null!=i&&i>0?i:a,l=function(e){if(!e)return new u.Color(.5,.5,.5);let[t,r,a]=e.split(" ").map(e=>parseFloat(e));return new u.Color().setRGB(t,r,a).convertSRGBToLinear()}((0,b.getProperty)(e,"fogColor")),c=[];for(let t=1;t<=3;t++){let r=function(e,t=1){if(!e)return null;let r=e.split(" ").map(e=>parseFloat(e));if(r.length<3)return null;let[a,n,i]=r;return a<=0||i<=n?null:{visibleDistance:a,minHeight:n,maxHeight:i,percentage:Math.max(0,Math.min(1,t))}}((0,b.getProperty)(e,`fogVolume${t}`),1);r&&c.push(r)}let d=c.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:o,visibleDistance:s,fogColor:l,fogVolumes:c,fogLine:d,enabled:s>o}})(e,r),[e,r]),c=(0,o.useMemo)(()=>tm((0,b.getProperty)(e,"fogColor")),[e]),d=i||c,f=l.enabled&&t,h=l.fogColor,{scene:m,gl:p}=(0,F.useThree)();(0,o.useEffect)(()=>{if(f){let e=h.clone();m.background=e,p.setClearColor(e)}else if(d){let e=d[0].clone();m.background=e,p.setClearColor(e)}else m.background=null;return()=>{m.background=null}},[m,p,f,h,d]);let g=i?.[1];return(0,n.jsxs)(n.Fragment,{children:[a&&s?(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(tg,{materialList:a,fogColor:f?h:void 0,fogState:f?l:void 0},a)}):g?(0,n.jsx)(tv,{skyColor:g,fogColor:f?h:void 0,fogState:f?l:void 0}):null,(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(td,{object:e})}),l.enabled?(0,n.jsx)(tA,{fogState:l,enabled:t}):null]})},StaticShape:function(e){let t,r,a,o,s,l,u,c,d=(0,i.c)(19),{object:f}=e;d[0]!==f?(t=(0,b.getProperty)(f,"dataBlock")??"",d[0]=f,d[1]=t):t=d[1];let h=t,m=(0,tZ.useDatablock)(h);d[2]!==f?(r=(0,b.getPosition)(f),d[2]=f,d[3]=r):r=d[3];let p=r;d[4]!==f?(a=(0,b.getRotation)(f),d[4]=f,d[5]=a):a=d[5];let g=a;d[6]!==f?(o=(0,b.getScale)(f),d[6]=f,d[7]=o):o=d[7];let v=o;d[8]!==m?(s=(0,b.getProperty)(m,"shapeFile"),d[8]=m,d[9]=s):s=d[9];let y=s;return y||console.error(` missing shape for datablock: ${h}`),d[10]===Symbol.for("react.memo_cache_sentinel")?(l=(0,n.jsx)(tz,{}),d[10]=l):l=d[10],d[11]!==p||d[12]!==g||d[13]!==v?(u=(0,n.jsx)("group",{position:p,quaternion:g,scale:v,children:l}),d[11]=p,d[12]=g,d[13]=v,d[14]=u):u=d[14],d[15]!==f||d[16]!==y||d[17]!==u?(c=(0,n.jsx)(tk,{type:"StaticShape",object:f,shapeName:y,children:u}),d[15]=f,d[16]=y,d[17]=u,d[18]=c):c=d[18],c},Sun:function(e){let t,r,a,s,l,c,d,f,h,m,p=(0,i.c)(25),{object:g}=e;p[0]!==g?(t=((0,b.getProperty)(g,"direction")??"0.57735 0.57735 -0.57735").split(" ").map(tC),p[0]=g,p[1]=t):t=p[1];let[v,y,A]=t,F=Math.sqrt(v*v+A*A+y*y),C=v/F,B=A/F,x=y/F;p[2]!==C||p[3]!==B||p[4]!==x?(r=new u.Vector3(C,B,x),p[2]=C,p[3]=B,p[4]=x,p[5]=r):r=p[5];let E=r,M=-(5e3*E.x),D=-(5e3*E.y),k=-(5e3*E.z);p[6]!==M||p[7]!==D||p[8]!==k?(a=new u.Vector3(M,D,k),p[6]=M,p[7]=D,p[8]=k,p[9]=a):a=p[9];let I=a;if(p[10]!==g){let[e,t,r]=((0,b.getProperty)(g,"color")??"0.7 0.7 0.7 1").split(" ").map(tb);s=new u.Color(e,t,r),p[10]=g,p[11]=s}else s=p[11];let w=s;if(p[12]!==g){let[e,t,r]=((0,b.getProperty)(g,"ambient")??"0.5 0.5 0.5 1").split(" ").map(tF);l=new u.Color(e,t,r),p[12]=g,p[13]=l}else l=p[13];let T=l,R=E.y<0;return p[14]!==R?(c=()=>{S.value=R},d=[R],p[14]=R,p[15]=c,p[16]=d):(c=p[15],d=p[16]),(0,o.useEffect)(c,d),p[17]!==w||p[18]!==I?(f=(0,n.jsx)("directionalLight",{position:I,color:w,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}),p[17]=w,p[18]=I,p[19]=f):f=p[19],p[20]!==T?(h=(0,n.jsx)("ambientLight",{color:T,intensity:1}),p[20]=T,p[21]=h):h=p[21],p[22]!==f||p[23]!==h?(m=(0,n.jsxs)(n.Fragment,{children:[f,h]}),p[22]=f,p[23]=h,p[24]=m):m=p[24],m},TerrainBlock:L,TSStatic:function(e){let t,r,a,o,s,l,u,c=(0,i.c)(17),{object:d}=e;c[0]!==d?(t=(0,b.getProperty)(d,"shapeName"),c[0]=d,c[1]=t):t=c[1];let f=t;c[2]!==d?(r=(0,b.getPosition)(d),c[2]=d,c[3]=r):r=c[3];let h=r;c[4]!==d?(a=(0,b.getRotation)(d),c[4]=d,c[5]=a):a=c[5];let m=a;c[6]!==d?(o=(0,b.getScale)(d),c[6]=d,c[7]=o):o=c[7];let p=o;return f||console.error(" missing shapeName for object",d),c[8]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(tz,{}),c[8]=s):s=c[8],c[9]!==h||c[10]!==m||c[11]!==p?(l=(0,n.jsx)("group",{position:h,quaternion:m,scale:p,children:s}),c[9]=h,c[10]=m,c[11]=p,c[12]=l):l=c[12],c[13]!==d||c[14]!==f||c[15]!==l?(u=(0,n.jsx)(tk,{type:"TSStatic",object:d,shapeName:f,children:l}),c[13]=d,c[14]=f,c[15]=l,c[16]=u):u=c[16],u},Turret:function(e){let t,r,a,o,s,l,u,c,d,f,h,m=(0,i.c)(27),{object:p}=e;m[0]!==p?(t=(0,b.getProperty)(p,"dataBlock")??"",m[0]=p,m[1]=t):t=m[1];let g=t;m[2]!==p?(r=(0,b.getProperty)(p,"initialBarrel"),m[2]=p,m[3]=r):r=m[3];let v=r,y=(0,tZ.useDatablock)(g),A=(0,tZ.useDatablock)(v);m[4]!==p?(a=(0,b.getPosition)(p),m[4]=p,m[5]=a):a=m[5];let F=a;m[6]!==p?(o=(0,b.getRotation)(p),m[6]=p,m[7]=o):o=m[7];let C=o;m[8]!==p?(s=(0,b.getScale)(p),m[8]=p,m[9]=s):s=m[9];let B=s;m[10]!==y?(l=(0,b.getProperty)(y,"shapeFile"),m[10]=y,m[11]=l):l=m[11];let S=l;m[12]!==A?(u=(0,b.getProperty)(A,"shapeFile"),m[12]=A,m[13]=u):u=m[13];let x=u;return S||console.error(` missing shape for datablock: ${g}`),v&&!x&&console.error(` missing shape for barrel datablock: ${v}`),m[14]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(tz,{}),m[14]=c):c=m[14],m[15]!==x||m[16]!==p?(d=x?(0,n.jsx)(tk,{type:"Turret",object:p,shapeName:x,children:(0,n.jsx)("group",{position:[0,1.5,0],children:(0,n.jsx)(tz,{})})}):null,m[15]=x,m[16]=p,m[17]=d):d=m[17],m[18]!==F||m[19]!==C||m[20]!==B||m[21]!==d?(f=(0,n.jsxs)("group",{position:F,quaternion:C,scale:B,children:[c,d]}),m[18]=F,m[19]=C,m[20]=B,m[21]=d,m[22]=f):f=m[22],m[23]!==p||m[24]!==S||m[25]!==f?(h=(0,n.jsx)(tk,{type:"Turret",object:p,shapeName:S,children:f}),m[23]=p,m[24]=S,m[25]=f,m[26]=h):h=m[26],h},WaterBlock:(0,o.lazy)(()=>e.A(18599).then(e=>({default:e.WaterBlock}))),WayPoint:function(e){let t,r,a,o=(0,i.c)(7),{object:s}=e;o[0]!==s?(t=(0,b.getPosition)(s),o[0]=s,o[1]=t):t=o[1];let l=t;o[2]!==s?(r=(0,b.getProperty)(s,"name"),o[2]=s,o[3]=r):r=o[3];let u=r;return o[4]!==u||o[5]!==l?(a=u?(0,n.jsx)(e3.FloatingLabel,{position:l,opacity:.6,children:u}):null,o[4]=u,o[5]=l,o[6]=a):a=o[6],a}},t6=new Set(["ForceFieldBare","Item","StaticShape","Turret"]);function t4(e){let t,r,a,s=(0,i.c)(13),{object:l,objectId:u}=e,c=(0,R.useRuntimeObjectById)(u??l?._id)??l,{missionType:d}=(0,o.useContext)(t3),f=(0,R.useEngineSelector)(t7);e:{let e,r;if(!c){t=!1;break e}s[0]!==c?(e=new Set(((0,b.getProperty)(c,"missionTypesList")??"").toLowerCase().split(/\s+/).filter(Boolean)),s[0]=c,s[1]=e):e=s[1];let a=e;s[2]!==d||s[3]!==a?(r=!a.size||a.has(d.toLowerCase()),s[2]=d,s[3]=a,s[4]=r):r=s[4],t=r}let h=t;if(!c)return null;let m=t8[c._className];s[5]!==f||s[6]!==c._className?(r=f&&t6.has(c._className),s[5]=f,s[6]=c._className,s[7]=r):r=s[7];let p=r;return s[8]!==m||s[9]!==p||s[10]!==c||s[11]!==h?(a=h&&m?(0,n.jsx)(o.Suspense,{children:!p&&(0,n.jsx)(m,{object:c})}):null,s[8]=m,s[9]=p,s[10]=c,s[11]=h,s[12]=a):a=s[12],a}function t7(e){return null!=e.playback.recording}let re=(0,o.createContext)(null);function rt(e){let t,r,a=(0,i.c)(5),{runtime:o,children:s}=e;return a[0]!==s?(t=(0,n.jsx)(tP,{children:s}),a[0]=s,a[1]=t):t=a[1],a[2]!==o||a[3]!==t?(r=(0,n.jsx)(re.Provider,{value:o,children:t}),a[2]=o,a[3]=t,a[4]=r):r=a[4],r}var rr=e.i(86608),ra=e.i(38433),rn=e.i(33870),ri=e.i(91996);let ro=async e=>{let t;try{t=(0,y.getUrlForPath)(e)}catch(t){return console.warn(`Script not in manifest: ${e} (${t})`),null}try{let r=await fetch(t);if(!r.ok)return console.error(`Script fetch failed: ${e} (${r.status})`),null;return await r.text()}catch(t){return console.error(`Script fetch error: ${e}`),console.error(t),null}},rs=(0,rn.createScriptCache)(),rl={findFiles:e=>{let t=(0,v.default)(e,{nocase:!0});return(0,ri.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,ri.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,ri.getResourceMap)()[(0,ri.getResourceKey)(e)]};function ru(e){"batch.flushed"===e.type&&R.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function rc(e){e instanceof Error&&"AbortError"===e.name||console.error("Mission runtime failed to become ready:",e)}let rd=(0,o.memo)(function(e){let t,r,a,s,l,u,c,d,f=(0,i.c)(17),{name:h,missionType:m,onLoadingChange:p}=e,{data:v}=((d=(0,i.c)(2))[0]!==h?(c={queryKey:["parsedMission",h],queryFn:()=>(0,y.loadMission)(h)},d[0]=h,d[1]=c):c=d[1],(0,g.useQuery)(c)),{missionGroup:A,runtime:F,progress:b}=function(e,t,r){let a,n,s,l=(0,i.c)(6);l[0]===Symbol.for("react.memo_cache_sentinel")?(a={missionGroup:void 0,runtime:void 0,progress:0},l[0]=a):a=l[0];let[u,c]=(0,o.useState)(a);return l[1]!==e||l[2]!==t||l[3]!==r?(n=()=>{if(!r)return;let a=new AbortController,n=!1,i=null,o=(0,ra.createProgressTracker)(),s=()=>{c(e=>({...e,progress:o.progress}))};o.on("update",s);let{runtime:l,ready:u}=(0,rr.runServer)({missionName:e,missionType:t,runtimeOptions:{loadScript:ro,fileSystem:rl,cache:rs,signal:a.signal,progress:o,ignoreScripts:["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"]}});return u.then(()=>{n||a.signal.aborted||(R.engineStore.getState().setRuntime(l),c({missionGroup:l.getObjectByName("MissionGroup"),runtime:l,progress:1}))}).catch(rc),i=l.subscribeRuntimeEvents(ru),R.engineStore.getState().setRuntime(l),()=>{n=!0,o.off("update",s),a.abort(),i?.(),R.engineStore.getState().clearRuntime(),l.destroy()}},s=[e,t,r],l[1]=e,l[2]=t,l[3]=r,l[4]=n,l[5]=s):(n=l[4],s=l[5]),(0,o.useEffect)(n,s),u}(h,m,v),C=!v||!A||!F;f[0]!==A||f[1]!==m||f[2]!==v?(t={metadata:v,missionType:m,missionGroup:A},f[0]=A,f[1]=m,f[2]=v,f[3]=t):t=f[3];let B=t;return(f[4]!==C||f[5]!==p||f[6]!==b?(r=()=>{p?.(C,b)},a=[C,b,p],f[4]=C,f[5]=p,f[6]=b,f[7]=r,f[8]=a):(r=f[7],a=f[8]),(0,o.useEffect)(r,a),C)?null:(f[9]!==A?(s=(0,n.jsx)(t4,{object:A}),f[9]=A,f[10]=s):s=f[10],f[11]!==F||f[12]!==s?(l=(0,n.jsx)(rt,{runtime:F,children:s}),f[11]=F,f[12]=s,f[13]=l):l=f[13],f[14]!==B||f[15]!==l?(u=(0,n.jsx)(t9,{value:B,children:l}),f[14]=B,f[15]=l,f[16]=u):u=f[16],u)});var rf=e.i(19273),rh=e.i(86491),rm=e.i(40143),rp=e.i(15823),rg=class extends rp.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let a=t.queryKey,n=t.queryHash??(0,rf.hashQueryKeyByOptions)(a,t),i=this.get(n);return i||(i=new rh.Query({client:e,queryKey:a,queryHash:n,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a)}),this.add(i)),i}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(){rm.notifyManager.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=>(0,rf.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,rf.matchQuery)(e,t)):t}notify(e){rm.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){rm.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){rm.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rv=e.i(88587),ry=e.i(36553),rA=class extends rv.Removable{#t;#r;#a;#n;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#a=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},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.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#a.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,ry.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):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.#a.canRun(this)});let a="pending"===this.state.status,n=!this.#n.canStart();try{if(a)t();else{this.#i({type:"pending",variables:e,isPaused:n}),await this.#a.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:n})}let i=await this.#n.start();return await this.#a.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#a.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#i({type:"success",data:i}),i}catch(t){try{await this.#a.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#a.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:"error",error:t}),t}finally{this.#a.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),rm.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#a.notify({mutation:this,type:"updated",action:e})})}},rF=rp,rb=class extends rF.Subscribable{constructor(e={}){super(),this.config=e,this.#o=new Set,this.#s=new Map,this.#l=0}#o;#s;#l;build(e,t,r){let a=new rA({client:e,mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:r});return this.add(a),a}add(e){this.#o.add(e);let t=rC(e);if("string"==typeof t){let r=this.#s.get(t);r?r.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#o.delete(e)){let t=rC(e);if("string"==typeof t){let r=this.#s.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=rC(e);if("string"!=typeof t)return!0;{let r=this.#s.get(t),a=r?.find(e=>"pending"===e.state.status);return!a||a===e}}runNext(e){let t=rC(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){rm.notifyManager.batch(()=>{this.#o.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#o.clear(),this.#s.clear()})}getAll(){return Array.from(this.#o)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,rf.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,rf.matchMutation)(e,t))}notify(e){rm.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return rm.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(rf.noop))))}};function rC(e){return e.options.scope?.id}var rB=e.i(75555),rS=e.i(14448);function rx(e){return{onFetch:(t,r)=>{let a=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},l=0,u=async()=>{let r=!1,u=(0,rf.ensureQueryFn)(t.options,t.fetchOptions),c=async(e,a,n)=>{let i;if(r)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);let o=(i={client:t.client,queryKey:t.queryKey,pageParam:a,direction:n?"backward":"forward",meta:t.options.meta},(0,rf.addConsumeAwareSignal)(i,()=>t.signal,()=>r=!0),i),s=await u(o),{maxPages:l}=t.options,c=n?rf.addToStart:rf.addToEnd;return{pages:c(e.pages,s,l),pageParams:c(e.pageParams,a,l)}};if(n&&i.length){let e="backward"===n,t={pages:i,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:rE)(a,t);s=await c(t,r,e)}else{let t=e??i.length;do{let e=0===l?o[0]??a.initialPageParam:rE(a,s);if(l>0&&null==e)break;s=await c(s,e),l++}while(lt.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function rE(e,{pages:t,pageParams:r}){let a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,r[a],r):void 0}var rM=class{#u;#a;#c;#d;#f;#h;#m;#p;constructor(e={}){this.#u=e.queryCache||new rg,this.#a=e.mutationCache||new rb,this.#c=e.defaultOptions||{},this.#d=new Map,this.#f=new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#m=rB.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#p=rS.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#m?.(),this.#m=void 0,this.#p?.(),this.#p=void 0)}isFetching(e){return this.#u.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#a.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#u.build(this,t),a=r.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,rf.resolveStaleTime)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#u.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let a=this.defaultQueryOptions({queryKey:e}),n=this.#u.get(a.queryHash),i=n?.state.data,o=(0,rf.functionalUpdate)(t,i);if(void 0!==o)return this.#u.build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return rm.notifyManager.batch(()=>this.#u.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state}removeQueries(e){let t=this.#u;rm.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#u;return rm.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(rm.notifyManager.batch(()=>this.#u.findAll(e).map(e=>e.cancel(r)))).then(rf.noop).catch(rf.noop)}invalidateQueries(e,t={}){return rm.notifyManager.batch(()=>(this.#u.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 r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(rm.notifyManager.batch(()=>this.#u.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(rf.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(rf.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#u.build(this,t);return r.isStaleByTime((0,rf.resolveStaleTime)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(rf.noop).catch(rf.noop)}fetchInfiniteQuery(e){return e.behavior=rx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(rf.noop).catch(rf.noop)}ensureInfiniteQueryData(e){return e.behavior=rx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return rS.onlineManager.isOnline()?this.#a.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#u}getMutationCache(){return this.#a}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#d.set((0,rf.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#d.values()],r={};return t.forEach(t=>{(0,rf.partialMatchKey)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#f.set((0,rf.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#f.values()],r={};return t.forEach(t=>{(0,rf.partialMatchKey)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,rf.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===rf.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#u.clear(),this.#a.clear()}},rD=e.i(12598),rk=e.i(8155);let rI=e=>{let t=(0,rk.createStore)(e),r=e=>(function(e,t=e=>e){let r=o.default.useSyncExternalStore(e.subscribe,o.default.useCallback(()=>t(e.getState()),[e,t]),o.default.useCallback(()=>t(e.getInitialState()),[e,t]));return o.default.useDebugValue(r),r})(t,e);return Object.assign(r,t),r};var rw=e.i(79473);let rT=o.createContext(null);function rR({map:e,children:t,onChange:r,domElement:a}){let n=e.map(e=>e.name+e.keys).join("-"),i=o.useMemo(()=>{let t;return(t=(0,rw.subscribeWithSelector)(()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{})))?rI(t):rI},[n]),s=o.useMemo(()=>[i.subscribe,i.getState,i],[n]),l=i.setState;return o.useEffect(()=>{let t=e.map(({name:e,keys:t,up:a})=>({keys:t,up:a,fn:t=>{l({[e]:t}),r&&r(e,t,s[1]())}})).reduce((e,{keys:t,fn:r,up:a=!0})=>(t.forEach(t=>e[t]={fn:r,pressed:!1,up:a}),e),{}),n=({key:e,code:r})=>{let a=t[e]||t[r];if(!a)return;let{fn:n,pressed:i,up:o}=a;a.pressed=!0,(o||!i)&&n(!0)},i=({key:e,code:r})=>{let a=t[e]||t[r];if(!a)return;let{fn:n,up:i}=a;a.pressed=!1,i&&n(!1)},o=a||window;return o.addEventListener("keydown",n,{passive:!0}),o.addEventListener("keyup",i,{passive:!0}),()=>{o.removeEventListener("keydown",n),o.removeEventListener("keyup",i)}},[a,n]),o.createElement(rT.Provider,{value:s,children:t})}function rP(e){let[t,r,a]=o.useContext(rT);return e?a(e):[t,r]}var rG=Object.defineProperty;class rL{constructor(){((e,t,r)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?rG(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let r=this._listeners[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let r=t.slice(0);for(let t=0,a=r.length;t{let a;return(a="symbol"!=typeof t?t+"":t)in e?rj(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,r};let rO=new u.Euler(0,0,0,"YXZ"),rU=new u.Vector3,rH={type:"change"},rN={type:"lock"},rJ={type:"unlock"},rK=Math.PI/2;class rV extends rL{constructor(e,t){super(),r_(this,"camera"),r_(this,"domElement"),r_(this,"isLocked"),r_(this,"minPolarAngle"),r_(this,"maxPolarAngle"),r_(this,"pointerSpeed"),r_(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(rO.setFromQuaternion(this.camera.quaternion),rO.y-=.002*e.movementX*this.pointerSpeed,rO.x-=.002*e.movementY*this.pointerSpeed,rO.x=Math.max(rK-this.maxPolarAngle,Math.min(rK-this.minPolarAngle,rO.x)),this.camera.quaternion.setFromEuler(rO),this.dispatchEvent(rH))}),r_(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(rN),this.isLocked=!0):(this.dispatchEvent(rJ),this.isLocked=!1))}),r_(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),r_(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),r_(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),r_(this,"dispose",()=>{this.disconnect()}),r_(this,"getObject",()=>this.camera),r_(this,"direction",new u.Vector3(0,0,-1)),r_(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),r_(this,"moveForward",e=>{rU.setFromMatrixColumn(this.camera.matrix,0),rU.crossVectors(this.camera.up,rU),this.camera.position.addScaledVector(rU,e)}),r_(this,"moveRight",e=>{rU.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(rU,e)}),r_(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),r_(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}(a={}).forward="forward",a.backward="backward",a.left="left",a.right="right",a.up="up",a.down="down",a.lookUp="lookUp",a.lookDown="lookDown",a.lookLeft="lookLeft",a.lookRight="lookRight",a.camera1="camera1",a.camera2="camera2",a.camera3="camera3",a.camera4="camera4",a.camera5="camera5",a.camera6="camera6",a.camera7="camera7",a.camera8="camera8",a.camera9="camera9";let rz=Math.PI/2-.01;function rq(){let e,t,r,a,n,s,l,c,d,f,h,m,p,g=(0,i.c)(26),{speedMultiplier:v,setSpeedMultiplier:y}=(0,E.useControls)(),[b,C]=rP(),{camera:B,gl:S}=(0,F.useThree)(),{nextCamera:x,setCameraIndex:M,cameraCount:D}=t1(),k=(0,o.useRef)(null);g[0]===Symbol.for("react.memo_cache_sentinel")?(e=new u.Vector3,g[0]=e):e=g[0];let I=(0,o.useRef)(e);g[1]===Symbol.for("react.memo_cache_sentinel")?(t=new u.Vector3,g[1]=t):t=g[1];let w=(0,o.useRef)(t);g[2]===Symbol.for("react.memo_cache_sentinel")?(r=new u.Vector3,g[2]=r):r=g[2];let T=(0,o.useRef)(r);g[3]===Symbol.for("react.memo_cache_sentinel")?(a=new u.Euler(0,0,0,"YXZ"),g[3]=a):a=g[3];let R=(0,o.useRef)(a);return g[4]!==B||g[5]!==S.domElement?(n=()=>{let e=new rV(B,S.domElement);return k.current=e,()=>{e.dispose()}},s=[B,S.domElement],g[4]=B,g[5]=S.domElement,g[6]=n,g[7]=s):(n=g[6],s=g[7]),(0,o.useEffect)(n,s),g[8]!==B||g[9]!==S.domElement||g[10]!==x?(l=()=>{let e=S.domElement,t=new u.Euler(0,0,0,"YXZ"),r=!1,a=!1,n=0,i=0,o=t=>{k.current?.isLocked||t.target===e&&(r=!0,a=!1,n=t.clientX,i=t.clientY)},s=e=>{!r||!a&&3>Math.abs(e.clientX-n)&&3>Math.abs(e.clientY-i)||(a=!0,t.setFromQuaternion(B.quaternion,"YXZ"),t.y=t.y-.003*e.movementX,t.x=t.x-.003*e.movementY,t.x=Math.max(-rz,Math.min(rz,t.x)),B.quaternion.setFromEuler(t))},l=()=>{r=!1},c=t=>{let r=k.current;!r||r.isLocked?x():t.target!==e||a||r.lock()};return e.addEventListener("mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",l),document.addEventListener("click",c),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l),document.removeEventListener("click",c)}},c=[B,S.domElement,x],g[8]=B,g[9]=S.domElement,g[10]=x,g[11]=l,g[12]=c):(l=g[11],c=g[12]),(0,o.useEffect)(l,c),g[13]!==D||g[14]!==M||g[15]!==b?(d=()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return b(t=>{for(let r=0;r{let e=e=>{e.preventDefault();let t=e.deltaY>0?-1:1,r=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*t;y(e=>Math.max(.1,Math.min(5,Math.round((e+r)*20)/20)))},t=S.domElement;return t.addEventListener("wheel",e,{passive:!1}),()=>{t.removeEventListener("wheel",e)}},m=[S.domElement,y],g[18]=S.domElement,g[19]=y,g[20]=h,g[21]=m):(h=g[20],m=g[21]),(0,o.useEffect)(h,m),g[22]!==B||g[23]!==C||g[24]!==v?(p=(e,t)=>{let{forward:r,backward:a,left:n,right:i,up:o,down:s,lookUp:l,lookDown:u,lookLeft:c,lookRight:d}=C();if((l||u||c||d)&&(R.current.setFromQuaternion(B.quaternion,"YXZ"),c&&(R.current.y=R.current.y+ +t),d&&(R.current.y=R.current.y-t),l&&(R.current.x=R.current.x+ +t),u&&(R.current.x=R.current.x-t),R.current.x=Math.max(-rz,Math.min(rz,R.current.x)),B.quaternion.setFromEuler(R.current)),!r&&!a&&!n&&!i&&!o&&!s)return;let f=80*v;B.getWorldDirection(I.current),I.current.normalize(),w.current.crossVectors(B.up,I.current).normalize(),T.current.set(0,0,0),r&&T.current.add(I.current),a&&T.current.sub(I.current),n&&T.current.add(w.current),i&&T.current.sub(w.current),o&&(T.current.y=T.current.y+1),s&&(T.current.y=T.current.y-1),T.current.lengthSq()>0&&(T.current.normalize().multiplyScalar(f*t),B.position.add(T.current))},g[22]=B,g[23]=C,g[24]=v,g[25]=p):p=g[25],(0,A.useFrame)(p),null}let rQ=[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"lookUp",keys:["ArrowUp"]},{name:"lookDown",keys:["ArrowDown"]},{name:"lookLeft",keys:["ArrowLeft"]},{name:"lookRight",keys:["ArrowRight"]},{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"]}];function rW(){let e,t,r=(0,i.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],r[0]=e):e=r[0],(0,o.useEffect)(rX,e),r[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(rq,{}),r[1]=t):t=r[1],t}function rX(){return window.addEventListener("keydown",rY,{capture:!0}),window.addEventListener("keyup",rY,{capture:!0}),()=>{window.removeEventListener("keydown",rY,{capture:!0}),window.removeEventListener("keyup",rY,{capture:!0})}}function rY(e){(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()}function rZ(e){let t,r=(0,i.c)(2),{children:a}=e;return r[0]!==a?(t=(0,n.jsx)(n.Fragment,{children:a}),r[0]=a,r[1]=t):t=r[1],t}function r$(){return(0,R.useEngineSelector)(r0)}function r0(e){return e.playback.recording}function r1(){return(0,R.useEngineSelector)(r2)}function r2(e){return"playing"===e.playback.status}function r3(){return(0,R.useEngineSelector)(r9)}function r9(e){return e.playback.timeMs/1e3}function r5(e){return e.playback.durationMs/1e3}function r8(e){return e.playback.rate}function r6(){let e,t,r,a,n,o,s=(0,i.c)(17),l=r$(),u=(0,R.useEngineSelector)(at),c=(0,R.useEngineSelector)(ae),d=(0,R.useEngineSelector)(r7),f=(0,R.useEngineSelector)(r4);s[0]!==u?(e=e=>{u(e)},s[0]=u,s[1]=e):e=s[1];let h=e;s[2]!==l||s[3]!==c?(t=()=>{(!(l?.isMetadataOnly||l?.isPartial)||l.streamingPlayback)&&c("playing")},s[2]=l,s[3]=c,s[4]=t):t=s[4];let m=t;s[5]!==c?(r=()=>{c("paused")},s[5]=c,s[6]=r):r=s[6];let p=r;s[7]!==d?(a=e=>{d(1e3*e)},s[7]=d,s[8]=a):a=s[8];let g=a;s[9]!==f?(n=e=>{f(e)},s[9]=f,s[10]=n):n=s[10];let v=n;return s[11]!==p||s[12]!==m||s[13]!==g||s[14]!==h||s[15]!==v?(o={setRecording:h,play:m,pause:p,seek:g,setSpeed:v},s[11]=p,s[12]=m,s[13]=g,s[14]=h,s[15]=v,s[16]=o):o=s[16],o}function r4(e){return e.setPlaybackRate}function r7(e){return e.setPlaybackTime}function ae(e){return e.setPlaybackStatus}function at(e){return e.setDemoRecording}function ar(){let e,t,r,a,o,s,l,u,c,d,f,h,m,p,g,v,y,A,F,b,C,B,S,x,E=(0,i.c)(51),M=r$(),D=rP(af),k=rP(ad),I=rP(ac),w=rP(au),T=rP(al),R=rP(as),P=rP(ao),G=rP(ai),L=rP(an),j=rP(aa);return M?null:(E[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:"KeyboardOverlay-spacer"}),E[0]=e):e=E[0],E[1]!==D?(t=(0,n.jsx)("div",{className:"KeyboardOverlay-key","data-pressed":D,children:"W"}),E[1]=D,E[2]=t):t=E[2],E[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,n.jsx)("div",{className:"KeyboardOverlay-spacer"}),E[3]=r):r=E[3],E[4]!==t?(a=(0,n.jsxs)("div",{className:"KeyboardOverlay-row",children:[e,t,r]}),E[4]=t,E[5]=a):a=E[5],E[6]!==I?(o=(0,n.jsx)("div",{className:"KeyboardOverlay-key","data-pressed":I,children:"A"}),E[6]=I,E[7]=o):o=E[7],E[8]!==k?(s=(0,n.jsx)("div",{className:"KeyboardOverlay-key","data-pressed":k,children:"S"}),E[8]=k,E[9]=s):s=E[9],E[10]!==w?(l=(0,n.jsx)("div",{className:"KeyboardOverlay-key","data-pressed":w,children:"D"}),E[10]=w,E[11]=l):l=E[11],E[12]!==o||E[13]!==s||E[14]!==l?(u=(0,n.jsxs)("div",{className:"KeyboardOverlay-row",children:[o,s,l]}),E[12]=o,E[13]=s,E[14]=l,E[15]=u):u=E[15],E[16]!==a||E[17]!==u?(c=(0,n.jsxs)("div",{className:"KeyboardOverlay-column",children:[a,u]}),E[16]=a,E[17]=u,E[18]=c):c=E[18],E[19]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)("span",{className:"KeyboardOverlay-arrow",children:"↑"}),E[19]=d):d=E[19],E[20]!==T?(f=(0,n.jsx)("div",{className:"KeyboardOverlay-row",children:(0,n.jsxs)("div",{className:"KeyboardOverlay-key","data-pressed":T,children:[d," Space"]})}),E[20]=T,E[21]=f):f=E[21],E[22]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)("span",{className:"KeyboardOverlay-arrow",children:"↓"}),E[22]=h):h=E[22],E[23]!==R?(m=(0,n.jsx)("div",{className:"KeyboardOverlay-row",children:(0,n.jsxs)("div",{className:"KeyboardOverlay-key","data-pressed":R,children:[h," Shift"]})}),E[23]=R,E[24]=m):m=E[24],E[25]!==f||E[26]!==m?(p=(0,n.jsxs)("div",{className:"KeyboardOverlay-column",children:[f,m]}),E[25]=f,E[26]=m,E[27]=p):p=E[27],E[28]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)("div",{className:"KeyboardOverlay-spacer"}),E[28]=g):g=E[28],E[29]!==P?(v=(0,n.jsx)("div",{className:"KeyboardOverlay-key","data-pressed":P,children:"↑"}),E[29]=P,E[30]=v):v=E[30],E[31]===Symbol.for("react.memo_cache_sentinel")?(y=(0,n.jsx)("div",{className:"KeyboardOverlay-spacer"}),E[31]=y):y=E[31],E[32]!==v?(A=(0,n.jsxs)("div",{className:"KeyboardOverlay-row",children:[g,v,y]}),E[32]=v,E[33]=A):A=E[33],E[34]!==L?(F=(0,n.jsx)("div",{className:"KeyboardOverlay-key","data-pressed":L,children:"←"}),E[34]=L,E[35]=F):F=E[35],E[36]!==G?(b=(0,n.jsx)("div",{className:"KeyboardOverlay-key","data-pressed":G,children:"↓"}),E[36]=G,E[37]=b):b=E[37],E[38]!==j?(C=(0,n.jsx)("div",{className:"KeyboardOverlay-key","data-pressed":j,children:"→"}),E[38]=j,E[39]=C):C=E[39],E[40]!==F||E[41]!==b||E[42]!==C?(B=(0,n.jsxs)("div",{className:"KeyboardOverlay-row",children:[F,b,C]}),E[40]=F,E[41]=b,E[42]=C,E[43]=B):B=E[43],E[44]!==A||E[45]!==B?(S=(0,n.jsxs)("div",{className:"KeyboardOverlay-column",children:[A,B]}),E[44]=A,E[45]=B,E[46]=S):S=E[46],E[47]!==p||E[48]!==S||E[49]!==c?(x=(0,n.jsxs)("div",{className:"KeyboardOverlay",children:[c,p,S]}),E[47]=p,E[48]=S,E[49]=c,E[50]=x):x=E[50],x)}function aa(e){return e.lookRight}function an(e){return e.lookLeft}function ai(e){return e.lookDown}function ao(e){return e.lookUp}function as(e){return e.down}function al(e){return e.up}function au(e){return e.right}function ac(e){return e.left}function ad(e){return e.backward}function af(e){return e.forward}let ah=Math.PI/2-.01;function am({joystickState:t,joystickZone:r,lookJoystickState:a,lookJoystickZone:i}){let{touchMode:s}=(0,E.useControls)();(0,o.useEffect)(()=>{let a=r.current;if(!a)return;let n=null,i=!1;return e.A(84968).then(e=>{i||((n=e.default.create({zone:a,mode:"static",position:{left:"70px",bottom:"70px"},size:120,restOpacity:.9})).on("move",(e,r)=>{t.current.angle=r.angle.radian,t.current.force=Math.min(1,r.force)}),n.on("end",()=>{t.current.force=0}))}),()=>{i=!0,n?.destroy()}},[t,r,s]),(0,o.useEffect)(()=>{if("dualStick"!==s)return;let t=i.current;if(!t)return;let r=null,n=!1;return e.A(84968).then(e=>{n||((r=e.default.create({zone:t,mode:"static",position:{right:"70px",bottom:"70px"},size:120,restOpacity:.9})).on("move",(e,t)=>{a.current.angle=t.angle.radian,a.current.force=Math.min(1,t.force)}),r.on("end",()=>{a.current.force=0}))}),()=>{n=!0,r?.destroy()}},[s,a,i]);let l=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};return"dualStick"===s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{ref:r,className:"TouchJoystick TouchJoystick--left",onContextMenu:e=>e.preventDefault(),onTouchStart:l}),(0,n.jsx)("div",{ref:i,className:"TouchJoystick TouchJoystick--right",onContextMenu:e=>e.preventDefault(),onTouchStart:l})]}):(0,n.jsx)("div",{ref:r,className:"TouchJoystick",onContextMenu:e=>e.preventDefault(),onTouchStart:l})}function ap(e){let t,r,a,n,s,l,c,d,f,h,m=(0,i.c)(25),{joystickState:p,joystickZone:g,lookJoystickState:v}=e,{speedMultiplier:y,touchMode:b}=(0,E.useControls)(),{camera:C,gl:B}=(0,F.useThree)();m[0]===Symbol.for("react.memo_cache_sentinel")?(t=new u.Euler(0,0,0,"YXZ"),m[0]=t):t=m[0];let S=(0,o.useRef)(t),x=(0,o.useRef)(null);m[1]===Symbol.for("react.memo_cache_sentinel")?(r={x:0,y:0},m[1]=r):r=m[1];let M=(0,o.useRef)(r);m[2]===Symbol.for("react.memo_cache_sentinel")?(a=new u.Vector3,m[2]=a):a=m[2];let D=(0,o.useRef)(a);m[3]===Symbol.for("react.memo_cache_sentinel")?(n=new u.Vector3,m[3]=n):n=m[3];let k=(0,o.useRef)(n);m[4]===Symbol.for("react.memo_cache_sentinel")?(s=new u.Vector3,m[4]=s):s=m[4];let I=(0,o.useRef)(s);return m[5]!==C.quaternion?(l=()=>{S.current.setFromQuaternion(C.quaternion,"YXZ")},m[5]=C.quaternion,m[6]=l):l=m[6],m[7]!==C?(c=[C],m[7]=C,m[8]=c):c=m[8],(0,o.useEffect)(l,c),m[9]!==C.quaternion||m[10]!==B.domElement||m[11]!==g||m[12]!==b?(d=()=>{if("moveLookStick"!==b)return;let e=B.domElement,t=e=>{let t=g.current;if(!t)return!1;let r=t.getBoundingClientRect();return e.clientX>=r.left&&e.clientX<=r.right&&e.clientY>=r.top&&e.clientY<=r.bottom},r=e=>{if(null===x.current)for(let r=0;r{if(null!==x.current)for(let t=0;t{for(let t=0;t{e.removeEventListener("touchstart",r),e.removeEventListener("touchmove",a),e.removeEventListener("touchend",n),e.removeEventListener("touchcancel",n),x.current=null}},m[9]=C.quaternion,m[10]=B.domElement,m[11]=g,m[12]=b,m[13]=d):d=m[13],m[14]!==C||m[15]!==B.domElement||m[16]!==g||m[17]!==b?(f=[C,B.domElement,g,b],m[14]=C,m[15]=B.domElement,m[16]=g,m[17]=b,m[18]=f):f=m[18],(0,o.useEffect)(d,f),m[19]!==C||m[20]!==p.current||m[21]!==v||m[22]!==y||m[23]!==b?(h=(e,t)=>{let{force:r,angle:a}=p.current;if("dualStick"===b){let e=v.current;if(e.force>.15){let r=(e.force-.15)/.85,a=Math.cos(e.angle),n=Math.sin(e.angle);S.current.setFromQuaternion(C.quaternion,"YXZ"),S.current.y=S.current.y-a*r*2.5*t,S.current.x=S.current.x+n*r*2.5*t,S.current.x=Math.max(-ah,Math.min(ah,S.current.x)),C.quaternion.setFromEuler(S.current)}if(r>.08){let e=80*y*((r-.08)/.92),n=Math.cos(a),i=Math.sin(a);C.getWorldDirection(D.current),D.current.normalize(),k.current.crossVectors(C.up,D.current).normalize(),I.current.set(0,0,0).addScaledVector(D.current,i).addScaledVector(k.current,-n),I.current.lengthSq()>0&&(I.current.normalize().multiplyScalar(e*t),C.position.add(I.current))}}else if("moveLookStick"===b&&r>0){let e=80*y*.5;if(C.getWorldDirection(D.current),D.current.normalize(),I.current.copy(D.current).multiplyScalar(e*t),C.position.add(I.current),r>=.15){let e=Math.cos(a),n=Math.sin(a),i=(r-.15)/.85;S.current.setFromQuaternion(C.quaternion,"YXZ"),S.current.y=S.current.y-e*i*1.25*t,S.current.x=S.current.x+n*i*1.25*t,S.current.x=Math.max(-ah,Math.min(ah,S.current.x)),C.quaternion.setFromEuler(S.current)}}},m[19]=C,m[20]=p.current,m[21]=v,m[22]=y,m[23]=b,m[24]=h):h=m[24],(0,A.useFrame)(h),null}var ag="undefined"!=typeof window&&!!(null==(r=window.document)?void 0:r.createElement);function av(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function ay(e){return e?"self"in e?e.self:av(e).defaultView||window:self}function aA(e,t=!1){let{activeElement:r}=av(e);if(!(null==r?void 0:r.nodeName))return null;if(ab(r)&&r.contentDocument)return aA(r.contentDocument.body,t);if(t){let e=r.getAttribute("aria-activedescendant");if(e){let t=av(r).getElementById(e);if(t)return t}}return r}function aF(e,t){return e===t||e.contains(t)}function ab(e){return"IFRAME"===e.tagName}function aC(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==aB.indexOf(e.type)}var aB=["button","color","file","image","reset","submit"];function aS(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function ax(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function aE(e){return e.isContentEditable||ax(e)}function aM(e){let t=0,r=0;if(ax(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let a=av(e).getSelection();if((null==a?void 0:a.rangeCount)&&a.anchorNode&&aF(e,a.anchorNode)&&a.focusNode&&aF(e,a.focusNode)){let n=a.getRangeAt(0),i=n.cloneRange();i.selectNodeContents(e),i.setEnd(n.startContainer,n.startOffset),t=i.toString().length,i.setEnd(n.endContainer,n.endOffset),r=i.toString().length}}return{start:t,end:r}}function aD(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function ak(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return ak(e.parentElement)||document.scrollingElement||document.body}function aI(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function aw(e,t){return t&&e.item(t)||null}var aT=Symbol("FOCUS_SILENTLY");function aR(e,t,r){if(!t||t===r)return!1;let a=e.item(t.id);return!!a&&(!r||a.element!==r)}function aP(){}function aG(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function aL(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function aj(e){return e}function a_(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function aO(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function aU(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function aH(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function aN(...e){for(let t of e)if(void 0!==t)return t}function aJ(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function aK(){return ag&&!!navigator.maxTouchPoints}function aV(){return!!ag&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function az(){return ag&&aV()&&/apple/i.test(navigator.vendor)}function aq(e){return!!(e.currentTarget&&!aF(e.currentTarget,e.target))}function aQ(e){return e.target===e.currentTarget}function aW(e,t){let r=new FocusEvent("blur",t),a=e.dispatchEvent(r),n={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",n)),a}function aX(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function aY(e,t){let r=t||e.currentTarget,a=e.relatedTarget;return!a||!aF(r,a)}function aZ(e,t,r,a){let n=(e=>{if(a){let t=setTimeout(e,a);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,i,!0),r()}),i=()=>{n(),r()};return e.addEventListener(t,i,{once:!0,capture:!0}),n}function a$(e,t,r,a=window){let n=[];try{for(let i of(a.document.addEventListener(e,t,r),Array.from(a.frames)))n.push(a$(e,t,r,i))}catch(e){}return()=>{try{a.document.removeEventListener(e,t,r)}catch(e){}for(let e of n)e()}}var a0={...o},a1=a0.useId;a0.useDeferredValue;var a2=a0.useInsertionEffect,a3=ag?o.useLayoutEffect:o.useEffect;function a9(e){let t=(0,o.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return a2?a2(()=>{t.current=e}):t.current=e,(0,o.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function a5(...e){return(0,o.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)aJ(r,t)}},e)}function a8(e){if(a1){let t=a1();return e||t}let[t,r]=(0,o.useState)(e);return a3(()=>{if(e||t)return;let a=Math.random().toString(36).slice(2,8);r(`id-${a}`)},[e,t]),e||t}function a6(e,t){let r=(0,o.useRef)(!1);(0,o.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,o.useEffect)(()=>()=>{r.current=!1},[])}function a4(){return(0,o.useReducer)(()=>[],[])}function a7(e){return a9("function"==typeof e?e:()=>e)}function ne(e,t,r=[]){let a=(0,o.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:a}}function nt(e=!1,t){let[r,a]=(0,o.useState)(null);return{portalRef:a5(a,t),portalNode:r,domReady:!e||r}}var nr=!1,na=!1,nn=0,ni=0;function no(e){let t,r;t=e.movementX||e.screenX-nn,r=e.movementY||e.screenY-ni,nn=e.screenX,ni=e.screenY,(t||r||0)&&(na=!0)}function ns(){na=!1}function nl(e){let t=o.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function nu(e,t){return o.memo(e,t)}function nc(e,t){let r,{wrapElement:a,render:i,...s}=t,l=a5(t.ref,i&&(0,o.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(o.isValidElement(i)){let e={...i.props,ref:l};r=o.cloneElement(i,function(e,t){let r={...e};for(let a in t){if(!aG(t,a))continue;if("className"===a){let a="className";r[a]=e[a]?`${e[a]} ${t[a]}`:t[a];continue}if("style"===a){let a="style";r[a]=e[a]?{...e[a],...t[a]}:t[a];continue}let n=t[a];if("function"==typeof n&&a.startsWith("on")){let t=e[a];if("function"==typeof t){r[a]=(...e)=>{n(...e),t(...e)};continue}}r[a]=n}return r}(s,e))}else r=i?i(s):(0,n.jsx)(e,{...s});return a?a(r):r}function nd(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function nf(e=[],t=[]){let r=o.createContext(void 0),a=o.createContext(void 0),i=()=>o.useContext(r),s=t=>e.reduceRight((e,r)=>(0,n.jsx)(r,{...t,children:e}),(0,n.jsx)(r.Provider,{...t}));return{context:r,scopedContext:a,useContext:i,useScopedContext:(e=!1)=>{let t=o.useContext(a),r=i();return e?t:t||r},useProviderContext:()=>{let e=o.useContext(a),t=i();if(!e||e!==t)return t},ContextProvider:s,ScopedContextProvider:e=>(0,n.jsx)(s,{...e,children:t.reduceRight((t,r)=>(0,n.jsx)(r,{...e,children:t}),(0,n.jsx)(a.Provider,{...e}))})}}var nh=nf(),nm=nh.useContext;nh.useScopedContext,nh.useProviderContext;var np=nf([nh.ContextProvider],[nh.ScopedContextProvider]),ng=np.useContext;np.useScopedContext;var nv=np.useProviderContext,ny=np.ContextProvider,nA=np.ScopedContextProvider,nF=(0,o.createContext)(void 0),nb=(0,o.createContext)(void 0),nC=(0,o.createContext)(!0),nB="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 nS(e){return!(!e.matches(nB)||!aS(e)||e.closest("[inert]"))}function nx(e){if(!nS(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=aA(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function nE(e,t){let r=Array.from(e.querySelectorAll(nB));t&&r.unshift(e);let a=r.filter(nS);return a.forEach((e,t)=>{if(ab(e)&&e.contentDocument){let r=e.contentDocument.body;a.splice(t,1,...nE(r))}}),a}function nM(e,t,r){let a=Array.from(e.querySelectorAll(nB)),n=a.filter(nx);return(t&&nx(e)&&n.unshift(e),n.forEach((e,t)=>{if(ab(e)&&e.contentDocument){let a=nM(e.contentDocument.body,!1,r);n.splice(t,1,...a)}}),!n.length&&r)?a:n}function nD(e,t){var r;let a,n,i,o;return r=document.body,a=aA(r),i=(n=nE(r,!1)).indexOf(a),(o=n.slice(i+1)).find(nx)||(e?n.find(nx):null)||(t?o[0]:null)||null}function nk(e,t){var r;let a,n,i,o;return r=document.body,a=aA(r),i=(n=nE(r,!1).reverse()).indexOf(a),(o=n.slice(i+1)).find(nx)||(e?n.find(nx):null)||(t?o[0]:null)||null}function nI(e){let t=aA(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function nw(e){let t=aA(e);if(!t)return!1;if(aF(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function nT(e){!nw(e)&&nS(e)&&e.focus()}var nR=az(),nP=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],nG=Symbol("safariFocusAncestor");function nL(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function nj(e,t){return a9(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var n_=!1,nO=!0;function nU(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(nO=!1)}function nH(e){e.metaKey||e.ctrlKey||e.altKey||(nO=!0)}var nN=nd(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:a,...n}){var i,s,l,u,c;let d=(0,o.useRef)(null);(0,o.useEffect)(()=>{!e||n_||(a$("mousedown",nU,!0),a$("keydown",nH,!0),n_=!0)},[e]),nR&&(0,o.useEffect)(()=>{if(!e)return;let t=d.current;if(!t||!nL(t))return;let r="labels"in t?t.labels:null;if(!r)return;let a=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",a);return()=>{for(let e of r)e.removeEventListener("mouseup",a)}},[e]);let f=e&&aU(n),h=!!f&&!t,[m,p]=(0,o.useState)(!1);(0,o.useEffect)(()=>{e&&h&&m&&p(!1)},[e,h,m]),(0,o.useEffect)(()=>{if(!e||!m)return;let t=d.current;if(!t||"undefined"==typeof IntersectionObserver)return;let r=new IntersectionObserver(()=>{nS(t)||p(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let g=nj(n.onKeyPressCapture,f),v=nj(n.onMouseDownCapture,f),y=nj(n.onClickCapture,f),A=n.onMouseDown,F=a9(t=>{if(null==A||A(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!nR||aq(t)||!aC(r)&&!nL(r))return;let a=!1,n=()=>{a=!0};r.addEventListener("focusin",n,{capture:!0,once:!0});let i=function(e){for(;e&&!nS(e);)e=e.closest(nB);return e||null}(r.parentElement);i&&(i[nG]=!0),aZ(r,"mouseup",()=>{r.removeEventListener("focusin",n,!0),i&&(i[nG]=!1),a||nT(r)})}),b=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let n=t.currentTarget;n&&nI(n)&&(null==a||a(t),t.defaultPrevented||(n.dataset.focusVisible="true",p(!0)))},C=n.onKeyDownCapture,B=a9(t=>{if(null==C||C(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!aQ(t))return;let r=t.currentTarget;aZ(r,"focusout",()=>b(t,r))}),S=n.onFocusCapture,x=a9(t=>{if(null==S||S(t),t.defaultPrevented||!e)return;if(!aQ(t))return void p(!1);let r=t.currentTarget;nO||function(e){let{tagName:t,readOnly:r,type:a}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:nP.includes(a))}(t.target)?aZ(t.target,"focusout",()=>b(t,r)):p(!1)}),E=n.onBlur,M=a9(t=>{null==E||E(t),!e||aY(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),p(!1))}),D=(0,o.useContext)(nC),k=a9(t=>{e&&r&&t&&D&&queueMicrotask(()=>{nI(t)||nS(t)&&t.focus()})}),I=function(e,t){let r=e=>{if("string"==typeof e)return e},[a,n]=(0,o.useState)(()=>r(void 0));return a3(()=>{let t=e&&"current"in e?e.current:e;n((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),a}(d),w=e&&(!I||"button"===I||"summary"===I||"input"===I||"select"===I||"textarea"===I||"a"===I),T=e&&(!I||"button"===I||"input"===I||"select"===I||"textarea"===I),R=n.style,P=(0,o.useMemo)(()=>h?{pointerEvents:"none",...R}:R,[h,R]);return n={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":f||void 0,...n,ref:a5(d,k,n.ref),style:P,tabIndex:(i=e,s=h,l=w,u=T,c=n.tabIndex,i?s?l&&!u?-1:void 0:l?c:c||0:c),disabled:!!T&&!!h||void 0,contentEditable:f?void 0:n.contentEditable,onKeyPressCapture:g,onClickCapture:y,onMouseDownCapture:v,onMouseDown:F,onKeyDownCapture:B,onFocusCapture:x,onBlur:M},aH(n)});function nJ(e){let t=[];for(let r of e)t.push(...r);return t}function nK(e){return e.slice().reverse()}function nV(e,t,r){return a9(a=>{var n;let i,o;if(null==t||t(a),a.defaultPrevented||a.isPropagationStopped()||!aQ(a)||"Shift"===a.key||"Control"===a.key||"Alt"===a.key||"Meta"===a.key||(!(i=a.target)||ax(i))&&1===a.key.length&&!a.ctrlKey&&!a.metaKey)return;let s=e.getState(),l=null==(n=aw(e,s.activeId))?void 0:n.element;if(!l)return;let{view:u,...c}=a;l!==(null==r?void 0:r.current)&&l.focus(),o=new KeyboardEvent(a.type,c),l.dispatchEvent(o)||a.preventDefault(),a.currentTarget.contains(l)&&a.stopPropagation()})}nl(function(e){return nc("div",nN(e))});var nz=nd(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:a=!0,...i}){let s=nv();a_(e=e||s,!1);let l=(0,o.useRef)(null),u=(0,o.useRef)(null),c=function(e){let[t,r]=(0,o.useState)(!1),a=(0,o.useCallback)(()=>r(!0),[]),n=e.useState(t=>aw(e,t.activeId));return(0,o.useEffect)(()=>{let e=null==n?void 0:n.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[n,t]),a}(e),d=e.useState("moves"),[,f]=function(e){let[t,r]=(0,o.useState)(null);return a3(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,o.useEffect)(()=>{var a;if(!e||!d||!t||!r)return;let{activeId:n}=e.getState(),i=null==(a=aw(e,n))?void 0:a.element;i&&("scrollIntoView"in i?(i.focus({preventScroll:!0}),i.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):i.focus())},[e,d,t,r]),a3(()=>{if(!e||!d||!t)return;let{baseElement:r,activeId:a}=e.getState();if(null!==a||!r)return;let n=u.current;u.current=null,n&&aW(n,{relatedTarget:r}),nI(r)||r.focus()},[e,d,t]);let h=e.useState("activeId"),m=e.useState("virtualFocus");a3(()=>{var r;if(!e||!t||!m)return;let a=u.current;if(u.current=null,!a)return;let n=(null==(r=aw(e,h))?void 0:r.element)||aA(a);n!==a&&aW(a,{relatedTarget:n})},[e,h,m,t]);let p=nV(e,i.onKeyDownCapture,u),g=nV(e,i.onKeyUpCapture,u),v=i.onFocusCapture,y=a9(t=>{var r;let a;if(null==v||v(t),t.defaultPrevented||!e)return;let{virtualFocus:n}=e.getState();if(!n)return;let i=t.relatedTarget,o=(a=(r=t.currentTarget)[aT],delete r[aT],a);aQ(t)&&o&&(t.stopPropagation(),u.current=i)}),A=i.onFocus,F=a9(r=>{if(null==A||A(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:a}=r,{virtualFocus:n}=e.getState();n?aQ(r)&&!aR(e,a)&&queueMicrotask(c):aQ(r)&&e.setActiveId(null)}),b=i.onBlurCapture,C=a9(t=>{var r;if(null==b||b(t),t.defaultPrevented||!e)return;let{virtualFocus:a,activeId:n}=e.getState();if(!a)return;let i=null==(r=aw(e,n))?void 0:r.element,o=t.relatedTarget,s=aR(e,o),l=u.current;u.current=null,aQ(t)&&s?(o===i?l&&l!==o&&aW(l,t):i?aW(i,t):l&&aW(l,t),t.stopPropagation()):!aR(e,t.target)&&i&&aW(i,t)}),B=i.onKeyDown,S=a7(a),x=a9(t=>{var r;if(null==B||B(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!aQ(t))return;let{orientation:a,renderedItems:n,activeId:i}=e.getState(),o=aw(e,i);if(null==(r=null==o?void 0:o.element)?void 0:r.isConnected)return;let s="horizontal"!==a,l="vertical"!==a,u=n.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&ax(t.currentTarget))return;let c={ArrowUp:(u||s)&&(()=>{if(u){let e=nJ(nK(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(n))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(u||l)&&e.first,ArrowDown:(u||s)&&e.first,ArrowLeft:(u||l)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!S(t))return;t.preventDefault(),e.move(r)}}});return i=ne(i,t=>(0,n.jsx)(ny,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var a;if(e&&t&&r.virtualFocus)return null==(a=aw(e,r.activeId))?void 0:a.id}),...i,ref:a5(l,f,i.ref),onKeyDownCapture:p,onKeyUpCapture:g,onFocusCapture:y,onFocus:F,onBlurCapture:C,onKeyDown:x},i=nN({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});nl(function(e){return nc("div",nz(e))});var nq=nf();nq.useContext,nq.useScopedContext;var nQ=nq.useProviderContext,nW=nf([nq.ContextProvider],[nq.ScopedContextProvider]);nW.useContext,nW.useScopedContext;var nX=nW.useProviderContext,nY=nW.ContextProvider,nZ=nW.ScopedContextProvider,n$=(0,o.createContext)(void 0),n0=(0,o.createContext)(void 0),n1=nf([nY],[nZ]);n1.useContext,n1.useScopedContext;var n2=n1.useProviderContext,n3=n1.ContextProvider,n9=n1.ScopedContextProvider,n5=nd(function({store:e,...t}){let r=n2();return e=e||r,t={...t,ref:a5(null==e?void 0:e.setAnchorElement,t.ref)}});nl(function(e){return nc("div",n5(e))});var n8=(0,o.createContext)(void 0),n6=nf([n3,ny],[n9,nA]),n4=n6.useContext,n7=n6.useScopedContext,ie=n6.useProviderContext,it=n6.ContextProvider,ir=n6.ScopedContextProvider,ia=(0,o.createContext)(void 0),ii=(0,o.createContext)(!1);function io(e,t){let r=e.__unstableInternals;return a_(r,"Invalid store"),r[t]}function is(e,...t){let r=e,a=r,n=Symbol(),i=aP,o=new Set,s=new Set,l=new Set,u=new Set,c=new Set,d=new WeakMap,f=new WeakMap,h=(e,t,r=u)=>(r.add(t),f.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),f.delete(t),r.delete(t)}),m=(e,i,o=!1)=>{var l,h;if(!aG(r,e))return;let m=(h=r[e],"function"==typeof i?i("function"==typeof h?h():h):i);if(m===r[e])return;if(!o)for(let r of t)null==(l=null==r?void 0:r.setState)||l.call(r,e,m);let p=r;r={...r,[e]:m};let g=Symbol();n=g,s.add(e);let v=(t,a,n)=>{var i;let o=f.get(t);(!o||o.some(t=>n?n.has(t):t===e))&&(null==(i=d.get(t))||i(),d.set(t,t(r,a)))};for(let e of u)v(e,p);queueMicrotask(()=>{if(n!==g)return;let e=r;for(let e of c)v(e,a,s);a=e,s.clear()})},p={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{let e=o.size,a=Symbol();o.add(a);let n=()=>{o.delete(a),o.size||i()};if(e)return n;let s=Object.keys(r).map(e=>aL(...t.map(t=>{var r;let a=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(a&&aG(a,e))return id(t,[e],t=>{m(e,t[e],!0)})}))),u=[];for(let e of l)u.push(e());return i=aL(...s,...u,...t.map(iu)),n},subscribe:(e,t)=>h(e,t),sync:(e,t)=>(d.set(t,t(r,r)),h(e,t)),batch:(e,t)=>(d.set(t,t(r,a)),h(e,t,c)),pick:e=>is(function(e,t){let r={};for(let a of t)aG(e,a)&&(r[a]=e[a]);return r}(r,e),p),omit:e=>is(function(e,t){let r={...e};for(let e of t)aG(r,e)&&delete r[e];return r}(r,e),p)}};return p}function il(e,...t){if(e)return io(e,"setup")(...t)}function iu(e,...t){if(e)return io(e,"init")(...t)}function ic(e,...t){if(e)return io(e,"subscribe")(...t)}function id(e,...t){if(e)return io(e,"sync")(...t)}function ih(e,...t){if(e)return io(e,"batch")(...t)}function im(e,...t){if(e)return io(e,"omit")(...t)}function ip(...e){var t;let r={};for(let a of e){let e=null==(t=null==a?void 0:a.getState)?void 0:t.call(a);e&&Object.assign(r,e)}let a=is(r,...e);return Object.assign({},...e,a)}function ig(e,t){}function iv(e,t,r){if(!r)return!1;let a=e.find(e=>!e.disabled&&e.value);return(null==a?void 0:a.value)===t}function iy(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var iA=nd(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:a,setValueOnChange:n,showMinLength:i=0,showOnChange:s,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:c,showOnKeyPress:d=c,blurActiveItemOnClick:f,setValueOnClick:h=!0,moveOnKeyPress:m=!0,autoComplete:p="list",...g}){var v;let y,A=ie();a_(e=e||A,!1);let F=(0,o.useRef)(null),[b,C]=a4(),B=(0,o.useRef)(!1),S=(0,o.useRef)(!1),x=e.useState(e=>e.virtualFocus&&r),E="inline"===p||"both"===p,[M,D]=(0,o.useState)(E);v=[E],y=(0,o.useRef)(!1),a3(()=>{if(y.current)return(()=>{E&&D(!0)})();y.current=!0},v),a3(()=>()=>{y.current=!1},[]);let k=e.useState("value"),I=(0,o.useRef)();(0,o.useEffect)(()=>id(e,["selectedValue","activeId"],(e,t)=>{I.current=t.selectedValue}),[]);let w=e.useState(e=>{var t;if(E&&M){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=I.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),T=e.useState("renderedItems"),R=e.useState("open"),P=e.useState("contentElement"),G=(0,o.useMemo)(()=>{if(!E||!M)return k;if(iv(T,w,x)){if(iy(k,w)){let e=(null==w?void 0:w.slice(k.length))||"";return k+e}return k}return w||k},[E,M,T,w,x,k]);(0,o.useEffect)(()=>{let e=F.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,o.useEffect)(()=>{if(!E||!M||!w||!iv(T,w,x)||!iy(k,w))return;let e=aP;return queueMicrotask(()=>{let t=F.current;if(!t)return;let{start:r,end:a}=aM(t),n=k.length,i=w.length;aI(t,n,i),e=()=>{if(!nI(t))return;let{start:e,end:o}=aM(t);e!==n||o===i&&aI(t,r,a)}}),()=>e()},[b,E,M,w,T,x,k]);let L=(0,o.useRef)(null),j=a9(a),_=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!R||!P)return;let t=ak(P);if(!t)return;L.current=t;let r=()=>{B.current=!1},a=()=>{if(!e||!B.current)return;let{activeId:t}=e.getState();null===t||t!==_.current&&(B.current=!1)},n={passive:!0,capture:!0};return t.addEventListener("wheel",r,n),t.addEventListener("touchmove",r,n),t.addEventListener("scroll",a,n),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",a,!0)}},[R,P,e]),a3(()=>{!k||S.current||(B.current=!0)},[k]),a3(()=>{"always"!==x&&R||(B.current=R)},[x,R]);let O=e.useState("resetValueOnSelect");a6(()=>{var t,r;let a=B.current;if(!e||!R||!a&&!O)return;let{baseElement:n,contentElement:i,activeId:o}=e.getState();if(!n||nI(n)){if(null==i?void 0:i.hasAttribute("data-placing")){let e=new MutationObserver(C);return e.observe(i,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(x&&a){let r,a=j(T),n=void 0!==a?a:null!=(t=null==(r=T.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();_.current=n,e.move(null!=n?n:null)}else{let t=null==(r=e.item(o||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,R,b,k,x,O,j,T]),(0,o.useEffect)(()=>{if(!E)return;let t=F.current;if(!t)return;let r=[t,P].filter(e=>!!e),a=t=>{r.every(e=>aY(t,e))&&(null==e||e.setValue(G))};for(let e of r)e.addEventListener("focusout",a);return()=>{for(let e of r)e.removeEventListener("focusout",a)}},[E,P,e,G]);let U=e=>e.currentTarget.value.length>=i,H=g.onChange,N=a7(null!=s?s:U),J=a7(null!=n?n:!e.tag),K=a9(t=>{if(null==H||H(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:a,selectionStart:n,selectionEnd:i}=r,o=t.nativeEvent;if(B.current=!0,"input"===o.type&&(o.isComposing&&(B.current=!1,S.current=!0),E)){let e="insertText"===o.inputType||"insertCompositionText"===o.inputType,t=n===a.length;D(e&&t)}if(J(t)){let t=a===e.getState().value;e.setValue(a),queueMicrotask(()=>{aI(r,n,i)}),E&&x&&t&&C()}N(t)&&e.show(),x&&B.current||e.setActiveId(null)}),V=g.onCompositionEnd,z=a9(e=>{B.current=!0,S.current=!1,null==V||V(e),e.defaultPrevented||x&&C()}),q=g.onMouseDown,Q=a7(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),W=a7(h),X=a7(null!=u?u:U),Y=a9(t=>{null==q||q(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(Q(t)&&e.setActiveId(null),W(t)&&e.setValue(G),X(t)&&aZ(t.currentTarget,"mouseup",e.show))}),Z=g.onKeyDown,$=a7(null!=d?d:U),ee=a9(t=>{if(null==Z||Z(t),t.repeat||(B.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&$(t)&&(t.preventDefault(),e.show())}),et=g.onBlur,er=a9(e=>{if(B.current=!1,null==et||et(e),e.defaultPrevented)return}),ea=a8(g.id),en=e.useState(e=>null===e.activeId);return g={id:ea,role:"combobox","aria-autocomplete":"inline"===p||"list"===p||"both"===p||"none"===p?p:void 0,"aria-haspopup":aD(P,"listbox"),"aria-expanded":R,"aria-controls":null==P?void 0:P.id,"data-active-item":en||void 0,value:G,...g,ref:a5(F,g.ref),onChange:K,onCompositionEnd:z,onMouseDown:Y,onKeyDown:ee,onBlur:er},g=nz({store:e,focusable:t,...g,moveOnKeyPress:e=>!aO(m,e)&&(E&&D(!0),!0)}),{autoComplete:"off",...g=n5({store:e,...g})}}),iF=nl(function(e){return nc("input",iA(e))});function ib(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var iC=Symbol("composite-hover"),iB=nd(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...a}){let n=ng();a_(e=e||n,!1);let i=((0,o.useEffect)(()=>{nr||(a$("mousemove",no,!0),a$("mousedown",ns,!0),a$("mouseup",ns,!0),a$("keydown",ns,!0),a$("scroll",ns,!0),nr=!0)},[]),a9(()=>na)),s=a.onMouseMove,l=a7(t),u=a9(t=>{if((null==s||s(t),!t.defaultPrevented&&i())&&l(t)){if(!nw(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!nI(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=a.onMouseLeave,d=a7(r),f=a9(t=>{var r;let a;null==c||c(t),!t.defaultPrevented&&i()&&((a=ib(t))&&aF(t.currentTarget,a)||function(e){let t=ib(e);if(!t)return!1;do{if(aG(t,iC)&&t[iC])return!0;t=t.parentElement}while(t)return!1}(t)||!l(t)||d(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),h=(0,o.useCallback)(e=>{e&&(e[iC]=!0)},[]);return aH(a={...a,ref:a5(h,a.ref),onMouseMove:u,onMouseLeave:f})});nu(nl(function(e){return nc("div",iB(e))}));var iS=nd(function({store:e,shouldRegisterItem:t=!0,getItem:r=aj,element:a,...n}){let i=nm();e=e||i;let s=a8(n.id),l=(0,o.useRef)(a);return(0,o.useEffect)(()=>{let a=l.current;if(!s||!a||!t)return;let n=r({id:s,element:a});return null==e?void 0:e.renderItem(n)},[s,t,r,e]),aH(n={...n,ref:a5(l,n.ref)})});function ix(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?aC(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(aC(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}nl(function(e){return nc("div",iS(e))});var iE=Symbol("command"),iM=nd(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...r}){let a,n,i=(0,o.useRef)(null),[s,l]=(0,o.useState)(!1);(0,o.useEffect)(()=>{i.current&&l(aC(i.current))},[]);let[u,c]=(0,o.useState)(!1),d=(0,o.useRef)(!1),f=aU(r),[h,m]=(a=r.onLoadedMetadataCapture,n=(0,o.useMemo)(()=>Object.assign(()=>{},{...a,[iE]:!0}),[a,iE,!0]),[null==a?void 0:a[iE],{onLoadedMetadataCapture:n}]),p=r.onKeyDown,g=a9(r=>{null==p||p(r);let a=r.currentTarget;if(r.defaultPrevented||h||f||!aQ(r)||ax(a)||a.isContentEditable)return;let n=e&&"Enter"===r.key,i=t&&" "===r.key,o="Enter"===r.key&&!e,s=" "===r.key&&!t;if(o||s)return void r.preventDefault();if(n||i){let e=ix(r);if(n){if(!e){r.preventDefault();let{view:e,...t}=r,n=()=>aX(a,t);ag&&/firefox\//i.test(navigator.userAgent)?aZ(a,"keyup",n):queueMicrotask(n)}}else i&&(d.current=!0,e||(r.preventDefault(),c(!0)))}}),v=r.onKeyUp,y=a9(e=>{if(null==v||v(e),e.defaultPrevented||h||f||e.metaKey)return;let r=t&&" "===e.key;if(d.current&&r&&(d.current=!1,!ix(e))){e.preventDefault(),c(!1);let t=e.currentTarget,{view:r,...a}=e;queueMicrotask(()=>aX(t,a))}});return nN(r={"data-active":u||void 0,type:s?"button":void 0,...m,...r,ref:a5(i,r.ref),onKeyDown:g,onKeyUp:y})});nl(function(e){return nc("button",iM(e))});var{useSyncExternalStore:iD}=e.i(2239).default,ik=()=>()=>{};function iI(e,t=aj){let r=o.useCallback(t=>e?ic(e,null,t):ik(),[e]),a=()=>{let r="string"==typeof t?t:null,a="function"==typeof t?t:null,n=null==e?void 0:e.getState();return a?a(n):n&&r&&aG(n,r)?n[r]:void 0};return iD(r,a,a)}function iw(e,t){let r=o.useRef({}),a=o.useCallback(t=>e?ic(e,null,t):ik(),[e]),n=()=>{let a=null==e?void 0:e.getState(),n=!1,i=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(a);t!==i[e]&&(i[e]=t,n=!0)}if("string"==typeof r){if(!a||!aG(a,r))continue;let t=a[r];t!==i[e]&&(i[e]=t,n=!0)}}return n&&(r.current={...i}),r.current};return iD(a,n,n)}function iT(e,t,r,a){var n;let i,s=aG(t,r)?t[r]:void 0,l=(n={value:s,setValue:a?t[a]:void 0},i=(0,o.useRef)(n),a3(()=>{i.current=n}),i);a3(()=>id(e,[r],(e,t)=>{let{value:a,setValue:n}=l.current;n&&e[r]!==t[r]&&e[r]!==a&&n(e[r])}),[e,r]),a3(()=>{if(void 0!==s)return e.setState(r,s),ih(e,[r],()=>{void 0!==s&&e.setState(r,s)})})}function iR(e,t){let[r,a]=o.useState(()=>e(t));a3(()=>iu(r),[r]);let n=o.useCallback(e=>iI(r,e),[r]);return[o.useMemo(()=>({...r,useState:n}),[r,n]),a9(()=>{a(r=>e({...t,...r.getState()}))})]}function iP(e,t,r,a=!1){var n;let i,o;if(!t||!r)return;let{renderedItems:s}=t.getState(),l=ak(e);if(!l)return;let u=function(e,t=!1){let r=e.clientHeight,{top:a}=e.getBoundingClientRect(),n=1.5*Math.max(.875*r,r-40),i=t?r-n+a:n+a;return"HTML"===e.tagName?i+e.scrollTop:i}(l,a);for(let e=0;e=0){void 0!==o&&ot||(e&&(null==m?void 0:m.baseElement)&&m.baseElement===e.baseElement?m.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===f,ariaSetSize:e=>null!=l?l:e&&(null==m?void 0:m.ariaSetSize)&&m.baseElement===e.baseElement?m.ariaSetSize:void 0,ariaPosInSet(e){if(null!=u)return u;if(!e||!(null==m?void 0:m.ariaPosInSet)||m.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===g);return m.ariaPosInSet+t.findIndex(e=>e.id===f)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(i)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===f}}),C=(0,o.useCallback)(e=>{var t;let r={...e,id:f||e.id,rowId:g,disabled:!!p,children:null==(t=e.element)?void 0:t.textContent};return s?s(r):r},[f,g,p,s]),B=c.onFocus,S=(0,o.useRef)(!1),x=a9(t=>{var r,a;if(null==B||B(t),t.defaultPrevented||aq(t)||!f||!e||(r=e,!aQ(t)&&aR(r,t.target)))return;let{virtualFocus:n,baseElement:i}=e.getState();e.setActiveId(f),aE(t.currentTarget)&&function(e,t=!1){if(ax(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=av(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!n||!aQ(t)||!aE(a=t.currentTarget)&&("INPUT"!==a.tagName||aC(a))&&(null==i?void 0:i.isConnected)&&((az()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),S.current=!0,t.relatedTarget===i||aR(e,t.relatedTarget))?(i[aT]=!0,i.focus({preventScroll:!0})):i.focus())}),E=c.onBlurCapture,M=a9(t=>{if(null==E||E(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&S.current&&(S.current=!1,t.preventDefault(),t.stopPropagation())}),D=c.onKeyDown,k=a7(r),I=a7(a),w=a9(t=>{if(null==D||D(t),t.defaultPrevented||!aQ(t)||!e)return;let{currentTarget:r}=t,a=e.getState(),n=e.item(f),i=!!(null==n?void 0:n.rowId),o="horizontal"!==a.orientation,s="vertical"!==a.orientation,l=()=>!(!i&&!s&&a.baseElement&&ax(a.baseElement)),u={ArrowUp:(i||o)&&e.up,ArrowRight:(i||s)&&e.next,ArrowDown:(i||o)&&e.down,ArrowLeft:(i||s)&&e.previous,Home:()=>{if(l())return!i||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(l())return!i||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>iP(r,e,null==e?void 0:e.up,!0),PageDown:()=>iP(r,e,null==e?void 0:e.down)}[t.key];if(u){if(aE(r)){let e=aM(r),a=s&&"ArrowLeft"===t.key,n=s&&"ArrowRight"===t.key,i=o&&"ArrowUp"===t.key,l=o&&"ArrowDown"===t.key;if(n||l){let{length:t}=function(e){if(ax(e))return e.value;if(e.isContentEditable){let t=av(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((a||i)&&0!==e.start)return}let a=u();if(k(t)||void 0!==a){if(!I(t))return;t.preventDefault(),e.move(a)}}}),T=(0,o.useMemo)(()=>({id:f,baseElement:v}),[f,v]);return c={id:f,"data-active-item":y||void 0,...c=ne(c,e=>(0,n.jsx)(nF.Provider,{value:T,children:e}),[T]),ref:a5(h,c.ref),tabIndex:b?c.tabIndex:-1,onFocus:x,onBlurCapture:M,onKeyDown:w},c=iM(c),aH({...c=iS({store:e,...c,getItem:C,shouldRegisterItem:!!f&&c.shouldRegisterItem}),"aria-setsize":A,"aria-posinset":F})});nu(nl(function(e){return nc("button",iG(e))}));var iL=nd(function({store:e,value:t,hideOnClick:r,setValueOnClick:a,selectValueOnClick:i=!0,resetValueOnSelect:s,focusOnHover:l=!1,moveOnKeyPress:u=!0,getItem:c,...d}){var f,h;let m=n7();a_(e=e||m,!1);let{resetValueOnSelectState:p,multiSelectable:g,selected:v}=iw(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),y=(0,o.useCallback)(e=>{let r={...e,value:t};return c?c(r):r},[t,c]);a=null!=a?a:!g,r=null!=r?r:null!=t&&!g;let A=d.onClick,F=a7(a),b=a7(i),C=a7(null!=(f=null!=s?s:p)?f:g),B=a7(r),S=a9(r=>{null==A||A(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=aV();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let a=t.tagName.toLowerCase();return"a"===a||"button"===a&&"submit"===t.type||"input"===a&&"submit"===t.type}(r)&&(null!=t&&(b(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),F(r)&&(null==e||e.setValue(t))),B(r)&&(null==e||e.hide()))}),x=d.onKeyDown,E=a9(t=>{if(null==x||x(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||nI(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),ax(r)&&(null==e||e.setValue(r.value)))});g&&null!=v&&(d={"aria-selected":v,...d}),d=ne(d,e=>(0,n.jsx)(ia.Provider,{value:t,children:(0,n.jsx)(ii.Provider,{value:null!=v&&v,children:e})}),[t,v]),d={role:null!=(h=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,o.useContext)(n8)])?h:"option",children:t,...d,onClick:S,onKeyDown:E};let M=a7(u);return d=iG({store:e,...d,getItem:y,moveOnKeyPress:t=>{if(!M(t))return!1;let r=new Event("combobox-item-move"),a=null==e?void 0:e.getState().baseElement;return null==a||a.dispatchEvent(r),!0}}),d=iB({store:e,focusOnHover:l,...d})}),ij=nu(nl(function(e){return nc("div",iL(e))})),i_=e.i(74080);function iO(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function iU(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,a=Number.parseFloat(t||"0s")*r;return a>e?a:e},0)}function iH(e,t,r){return!r&&!1!==t&&(!e||!!t)}var iN=nd(function({store:e,alwaysVisible:t,...r}){let a=nQ();a_(e=e||a,!1);let i=(0,o.useRef)(null),s=a8(r.id),[l,u]=(0,o.useState)(null),c=e.useState("open"),d=e.useState("mounted"),f=e.useState("animated"),h=e.useState("contentElement"),m=iI(e.disclosure,"contentElement");a3(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),a3(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),a3(()=>{if(f){var e;let t;return(null==h?void 0:h.isConnected)?(e=()=>{u(c?"enter":d?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void u(null)}},[f,h,c,d]),a3(()=>{if(!e||!f||!l||!h)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,i_.flushSync)(t);if("leave"===l&&c||"enter"===l&&!c)return;if("number"==typeof f)return iO(f,r);let{transitionDuration:a,animationDuration:n,transitionDelay:i,animationDelay:o}=getComputedStyle(h),{transitionDuration:s="0",animationDuration:u="0",transitionDelay:d="0",animationDelay:p="0"}=m?getComputedStyle(m):{},g=iU(i,o,d,p)+iU(a,n,s,u);if(!g){"enter"===l&&e.setState("animated",!1),t();return}return iO(Math.max(g-1e3/60,0),r)},[e,f,h,m,c,l]);let p=iH(d,(r=ne(r,t=>(0,n.jsx)(nZ,{value:e,children:t}),[e])).hidden,t),g=r.style,v=(0,o.useMemo)(()=>p?{...g,display:"none"}:g,[p,g]);return aH(r={id:s,"data-open":c||void 0,"data-enter":"enter"===l||void 0,"data-leave":"leave"===l||void 0,hidden:p,...r,ref:a5(s?e.setContentElement:null,i,r.ref),style:v})}),iJ=nl(function(e){return nc("div",iN(e))});nl(function({unmountOnHide:e,...t}){let r=nQ();return!1===iI(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,n.jsx)(iJ,{...t})});var iK=nd(function({store:e,alwaysVisible:t,...r}){let a=n7(!0),i=n4(),s=!!(e=e||i)&&e===a;a_(e,!1);let l=(0,o.useRef)(null),u=a8(r.id),c=e.useState("mounted"),d=iH(c,r.hidden,t),f=d?{...r.style,display:"none"}:r.style,h=e.useState(e=>Array.isArray(e.selectedValue)),m=function(e,t,r){let a=function(e){let[t]=(0,o.useState)(e);return t}(r),[n,i]=(0,o.useState)(a);return(0,o.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let n=()=>{let e=r.getAttribute(t);i(null==e?a:e)},o=new MutationObserver(n);return o.observe(r,{attributeFilter:[t]}),n(),()=>o.disconnect()},[e,t,a]),n}(l,"role",r.role),p="listbox"===m||"tree"===m||"grid"===m,[g,v]=(0,o.useState)(!1),y=e.useState("contentElement");a3(()=>{if(!c)return;let e=l.current;if(!e||y!==e)return;let t=()=>{v(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[c,y]),g||(r={role:"listbox","aria-multiselectable":p&&h||void 0,...r}),r=ne(r,t=>(0,n.jsx)(ir,{value:e,children:(0,n.jsx)(n8.Provider,{value:m,children:t})}),[e,m]);let A=!u||a&&s?null:e.setContentElement;return aH(r={id:u,hidden:d,...r,ref:a5(A,l,r.ref),style:f})}),iV=nl(function(e){return nc("div",iK(e))}),iz=(0,o.createContext)(null),iq=nd(function(e){return{...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}}});nl(function(e){return nc("span",iq(e))});var iQ=nd(function(e){return iq(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),iW=nl(function(e){return nc("span",iQ(e))});function iX(e){queueMicrotask(()=>{null==e||e.focus()})}var iY=nd(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:a,portal:i=!0,...s}){let l=(0,o.useRef)(null),u=a5(l,s.ref),c=(0,o.useContext)(iz),[d,f]=(0,o.useState)(null),[h,m]=(0,o.useState)(null),p=(0,o.useRef)(null),g=(0,o.useRef)(null),v=(0,o.useRef)(null),y=(0,o.useRef)(null);return a3(()=>{let e=l.current;if(!e||!i)return void f(null);let t=r?"function"==typeof r?r(e):r:av(e).createElement("div");if(!t)return void f(null);let n=t.isConnected;if(n||(c||av(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),aJ(a,t),!n)return()=>{t.remove(),aJ(a,null)}},[i,r,c,a]),a3(()=>{if(!i||!e||!t)return;let r=av(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),m(r),()=>{r.remove(),m(null)}},[i,e,t]),(0,o.useEffect)(()=>{if(!d||!e)return;let t=0,r=e=>{if(!aY(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=d.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(d.hasAttribute("data-tabindex")&&t(d),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of nM(d,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return d.addEventListener("focusin",r,!0),d.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),d.removeEventListener("focusin",r,!0),d.removeEventListener("focusout",r,!0)}},[d,e]),s={...s=ne(s,t=>{if(t=(0,n.jsx)(iz.Provider,{value:d||c,children:t}),!i)return t;if(!d)return(0,n.jsx)("span",{ref:u,id:s.id,style:{position:"fixed"},hidden:!0});t=(0,n.jsxs)(n.Fragment,{children:[e&&d&&(0,n.jsx)(iW,{ref:g,"data-focus-trap":s.id,className:"__focus-trap-inner-before",onFocus:e=>{aY(e,d)?iX(nD()):iX(p.current)}}),t,e&&d&&(0,n.jsx)(iW,{ref:v,"data-focus-trap":s.id,className:"__focus-trap-inner-after",onFocus:e=>{aY(e,d)?iX(nk()):iX(y.current)}})]}),d&&(t=(0,i_.createPortal)(t,d));let r=(0,n.jsxs)(n.Fragment,{children:[e&&d&&(0,n.jsx)(iW,{ref:p,"data-focus-trap":s.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==y.current&&aY(e,d)?iX(g.current):iX(nk())}}),e&&(0,n.jsx)("span",{"aria-owns":null==d?void 0:d.id,style:{position:"fixed"}}),e&&d&&(0,n.jsx)(iW,{ref:y,"data-focus-trap":s.id,className:"__focus-trap-outer-after",onFocus:e=>{if(aY(e,d))iX(v.current);else{let e=nD();if(e===g.current)return void requestAnimationFrame(()=>{var e;return null==(e=nD())?void 0:e.focus()});iX(e)}}})]});return h&&e&&(r=(0,i_.createPortal)(r,h)),(0,n.jsxs)(n.Fragment,{children:[r,t]})},[d,c,i,s.id,e,h]),ref:u}});nl(function(e){return nc("div",iY(e))});var iZ=(0,o.createContext)(0);function i$({level:e,children:t}){let r=(0,o.useContext)(iZ),a=Math.max(Math.min(e||r+1,6),1);return(0,n.jsx)(iZ.Provider,{value:a,children:t})}var i0=nd(function({autoFocusOnShow:e=!0,...t}){return ne(t,t=>(0,n.jsx)(nC.Provider,{value:e,children:t}),[e])});nl(function(e){return nc("div",i0(e))});var i1=new WeakMap;function i2(e,t,r){i1.has(e)||i1.set(e,new Map);let a=i1.get(e),n=a.get(t);if(!n)return a.set(t,r()),()=>{var e;null==(e=a.get(t))||e(),a.delete(t)};let i=r(),o=()=>{i(),n(),a.delete(t)};return a.set(t,o),()=>{a.get(t)===o&&(i(),a.set(t,n))}}function i3(e,t,r){return i2(e,t,()=>{let a=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==a?e.removeAttribute(t):e.setAttribute(t,a)}})}function i9(e,t,r){return i2(e,t,()=>{let a=t in e,n=e[t];return e[t]=r,()=>{a?e[t]=n:delete e[t]}})}function i5(e,t){return e?i2(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var i8=["SCRIPT","STYLE"];function i6(e){return`__ariakit-dialog-snapshot-${e}`}function i4(e,t,r,a){for(let n of t){if(!(null==n?void 0:n.isConnected))continue;let i=t.some(e=>!!e&&e!==n&&e.contains(n)),o=av(n),s=n;for(;n.parentElement&&n!==o.body;){if(null==a||a(n.parentElement,s),!i)for(let a of n.parentElement.children)(function(e,t,r){return!i8.includes(t.tagName)&&!!function(e,t){let r=av(t),a=i6(e);if(!r.body[a])return!0;for(;;){if(t===r.body)return!1;if(t[a])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&aF(t,e))})(e,a,t)&&r(a,s);n=n.parentElement}}}function i7(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function oe(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function ot(e,t=""){return aL(i9(e,oe("",!0),!0),i9(e,oe(t,!0),!0))}function or(e,t){if(e[oe(t,!0)])return!0;let r=oe(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function oa(e,t){let r=[],a=t.map(e=>null==e?void 0:e.id);return i4(e,t,t=>{i7(t,...a)||r.unshift(function(e,t=""){return aL(i9(e,oe(),!0),i9(e,oe(t),!0))}(t,e))},(t,a)=>{a.hasAttribute("data-dialog")&&a.id!==e||r.unshift(ot(t,e))}),()=>{for(let e of r)e()}}function on({store:e,type:t,listener:r,capture:a,domReady:n}){let i=a9(r),s=iI(e,"open"),l=(0,o.useRef)(!1);a3(()=>{if(!s||!n)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{l.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,s,n]),(0,o.useEffect)(()=>{if(s)return a$(t,t=>{let{contentElement:r,disclosureElement:a}=e.getState(),n=t.target;!r||!n||!(!("HTML"===n.tagName||aF(av(n).body,n))||aF(r,n)||function(e,t){if(!e)return!1;if(aF(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=av(e).getElementById(r);if(t)return aF(e,t)}return!1}(a,n)||n.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!l.current||or(n,r.id))&&(n&&n[nG]||i(t))},a)},[s,a])}function oi(e,t){return"function"==typeof e?e(t):!!e}var oo=(0,o.createContext)({});function os(){return"inert"in HTMLElement.prototype}function ol(e,t){if(!("style"in e))return aP;if(os())return i9(e,"inert",!0);let r=nM(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&aF(t,e)))return aP;let r=i2(e,"focus",()=>(e.focus=aP,()=>{delete e.focus}));return aL(i3(e,"tabindex","-1"),r)});return aL(...r,i3(e,"aria-hidden","true"),i5(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ou(e={}){let t=ip(e.store,im(e.disclosure,["contentElement","disclosureElement"]));ig(e,t);let r=null==t?void 0:t.getState(),a=aN(e.open,null==r?void 0:r.open,e.defaultOpen,!1),n=aN(e.animated,null==r?void 0:r.animated,!1),i=is({open:a,animated:n,animating:!!n&&a,mounted:a,contentElement:aN(null==r?void 0:r.contentElement,null),disclosureElement:aN(null==r?void 0:r.disclosureElement,null)},t);return il(i,()=>id(i,["animated","animating"],e=>{e.animated||i.setState("animating",!1)})),il(i,()=>ic(i,["open"],()=>{i.getState().animated&&i.setState("animating",!0)})),il(i,()=>id(i,["open","animating"],e=>{i.setState("mounted",e.open||e.animating)})),{...i,disclosure:e.disclosure,setOpen:e=>i.setState("open",e),show:()=>i.setState("open",!0),hide:()=>i.setState("open",!1),toggle:()=>i.setState("open",e=>!e),stopAnimation:()=>i.setState("animating",!1),setContentElement:e=>i.setState("contentElement",e),setDisclosureElement:e=>i.setState("disclosureElement",e)}}function oc(e,t,r){return a6(t,[r.store,r.disclosure]),iT(e,r,"open","setOpen"),iT(e,r,"mounted","setMounted"),iT(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}nd(function(e){return e});var od=nl(function(e){return nc("div",e)});function of({store:e,backdrop:t,alwaysVisible:r,hidden:a}){let i=(0,o.useRef)(null),s=function(e={}){let[t,r]=iR(ou,e);return oc(t,r,e)}({disclosure:e}),l=iI(e,"contentElement");(0,o.useEffect)(()=>{let e=i.current;!e||l&&(e.style.zIndex=getComputedStyle(l).zIndex)},[l]),a3(()=>{let e=null==l?void 0:l.id;if(!e)return;let t=i.current;if(t)return ot(t,e)},[l]);let u=iN({ref:i,store:s,role:"presentation","data-backdrop":(null==l?void 0:l.id)||"",alwaysVisible:r,hidden:null!=a?a:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,o.isValidElement)(t))return(0,n.jsx)(od,{...u,render:t});let c="boolean"!=typeof t?t:"div";return(0,n.jsx)(od,{...u,render:(0,n.jsx)(c,{})})}function oh(e={}){return ou(e)}Object.assign(od,["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"].reduce((e,t)=>(e[t]=nl(function(e){return nc(t,e)}),e),{}));var om=az();function op(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?nS(r)?r:null:r:null}var og=nd(function({store:e,open:t,onClose:r,focusable:a=!0,modal:i=!0,portal:s=!!i,backdrop:l=!!i,hideOnEscape:u=!0,hideOnInteractOutside:c=!0,getPersistentElements:d,preventBodyScroll:f=!!i,autoFocusOnShow:h=!0,autoFocusOnHide:m=!0,initialFocus:p,finalFocus:g,unmountOnHide:v,unstable_treeSnapshotKey:y,...A}){var F;let b,C,B,S=nX(),x=(0,o.useRef)(null),E=function(e={}){let[t,r]=iR(oh,e);return oc(t,r,e)}({store:e||S,open:t,setOpen(e){if(e)return;let t=x.current;if(!t)return;let a=new Event("close",{bubbles:!1,cancelable:!0});r&&t.addEventListener("close",r,{once:!0}),t.dispatchEvent(a),a.defaultPrevented&&E.setOpen(!0)}}),{portalRef:M,domReady:D}=nt(s,A.portalRef),k=A.preserveTabOrder,I=iI(E,e=>k&&!i&&e.mounted),w=a8(A.id),T=iI(E,"open"),R=iI(E,"mounted"),P=iI(E,"contentElement"),G=iH(R,A.hidden,A.alwaysVisible);b=function({attribute:e,contentId:t,contentElement:r,enabled:a}){let[n,i]=a4(),s=(0,o.useCallback)(()=>{if(!a||!r)return!1;let{body:n}=av(r),i=n.getAttribute(e);return!i||i===t},[n,a,r,e,t]);return(0,o.useEffect)(()=>{if(!a||!t||!r)return;let{body:n}=av(r);if(s())return n.setAttribute(e,t),()=>n.removeAttribute(e);let o=new MutationObserver(()=>(0,i_.flushSync)(i));return o.observe(n,{attributeFilter:[e]}),()=>o.disconnect()},[n,a,t,r,s,e]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:P,contentId:w,enabled:f&&!G}),(0,o.useEffect)(()=>{var e,t;if(!b()||!P)return;let r=av(P),a=ay(P),{documentElement:n,body:i}=r,o=n.style.getPropertyValue("--scrollbar-width"),s=o?Number.parseInt(o,10):a.innerWidth-n.clientWidth,l=Math.round(n.getBoundingClientRect().left)+n.scrollLeft?"paddingLeft":"paddingRight",u=aV()&&!(ag&&navigator.platform.startsWith("Mac")&&!aK());return aL((e="--scrollbar-width",t=`${s}px`,n?i2(n,e,()=>{let r=n.style.getPropertyValue(e);return n.style.setProperty(e,t),()=>{r?n.style.setProperty(e,r):n.style.removeProperty(e)}}):()=>{}),u?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:o}=a,u=null!=(e=null==o?void 0:o.offsetLeft)?e:0,c=null!=(t=null==o?void 0:o.offsetTop)?t:0,d=i5(i,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(c))}px`,left:`${-(r-Math.floor(u))}px`,right:"0",[l]:`${s}px`});return()=>{d(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():i5(i,{overflow:"hidden",[l]:`${s}px`}))},[b,P]),F=iI(E,"open"),C=(0,o.useRef)(),(0,o.useEffect)(()=>{if(!F){C.current=null;return}return a$("mousedown",e=>{C.current=e.target},!0)},[F]),on({...B={store:E,domReady:D,capture:!0},type:"click",listener:e=>{let{contentElement:t}=E.getState(),r=C.current;r&&aS(r)&&or(r,null==t?void 0:t.id)&&oi(c,e)&&E.hide()}}),on({...B,type:"focusin",listener:e=>{let{contentElement:t}=E.getState();!t||e.target===av(t)||oi(c,e)&&E.hide()}}),on({...B,type:"contextmenu",listener:e=>{oi(c,e)&&E.hide()}});let{wrapElement:L,nestedDialogs:j}=function(e){let t=(0,o.useContext)(oo),[r,a]=(0,o.useState)([]),i=(0,o.useCallback)(e=>{var r;return a(t=>[...t,e]),aL(null==(r=t.add)?void 0:r.call(t,e),()=>{a(t=>t.filter(t=>t!==e))})},[t]);a3(()=>id(e,["open","contentElement"],r=>{var a;if(r.open&&r.contentElement)return null==(a=t.add)?void 0:a.call(t,e)}),[e,t]);let s=(0,o.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,o.useCallback)(e=>(0,n.jsx)(oo.Provider,{value:s,children:e}),[s]),nestedDialogs:r}}(E);A=ne(A,L,[L]),a3(()=>{if(!T)return;let e=x.current,t=aA(e,!0);!t||"BODY"===t.tagName||e&&aF(e,t)||E.setDisclosureElement(t)},[E,T]),om&&(0,o.useEffect)(()=>{if(!R)return;let{disclosureElement:e}=E.getState();if(!e||!aC(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),aZ(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||nT(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[E,R]),(0,o.useEffect)(()=>{if(!R||!D)return;let e=x.current;if(!e)return;let t=ay(e),r=t.visualViewport||t,a=()=>{var r,a;let n=null!=(a=null==(r=t.visualViewport)?void 0:r.height)?a:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${n}px`)};return a(),r.addEventListener("resize",a),()=>{r.removeEventListener("resize",a)}},[R,D]),(0,o.useEffect)(()=>{if(!i||!R||!D)return;let e=x.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=E.hide,(r=av(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[E,i,R,D]),a3(()=>{if(!os()||T||!R||!D)return;let e=x.current;if(e)return ol(e)},[T,R,D]);let _=T&&D;a3(()=>{if(w&&_)return function(e,t){let{body:r}=av(t[0]),a=[];return i4(e,t,t=>{a.push(i9(t,i6(e),!0))}),aL(i9(r,i6(e),!0),()=>{for(let e of a)e()})}(w,[x.current])},[w,_,y]);let O=a9(d);a3(()=>{if(!w||!_)return;let{disclosureElement:e}=E.getState(),t=[x.current,...O()||[],...j.map(e=>e.getState().contentElement)];if(i){let e,r;return aL(oa(w,t),(e=[],r=t.map(e=>null==e?void 0:e.id),i4(w,t,a=>{i7(a,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(a,...r)&&e.unshift(ol(a,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&aF(e,r))||e.unshift(i3(r,"role","none"))}),()=>{for(let t of e)t()}))}return oa(w,[e,...t])},[w,E,_,O,j,i,y]);let U=!!h,H=a7(h),[N,J]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(!T||!U||!D||!(null==P?void 0:P.isConnected))return;let e=op(p,!0)||P.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[a]=nM(e,t,r);return a||null}(P,!0,s&&I)||P,t=nS(e);H(t?e:null)&&(J(!0),queueMicrotask(()=>{e.focus(),!om||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[T,U,D,P,p,s,I,H]);let K=!!m,V=a7(m),[z,q]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(T)return q(!0),()=>q(!1)},[T]);let Q=(0,o.useCallback)((e,t=!0)=>{let r,{disclosureElement:a}=E.getState();if(!(!(r=aA())||e&&aF(e,r))&&nS(r))return;let n=op(g)||a;if(null==n?void 0:n.id){let e=av(n),t=`[aria-activedescendant="${n.id}"]`,r=e.querySelector(t);r&&(n=r)}if(n&&!nS(n)){let e=n.closest("[data-dialog]");if(null==e?void 0:e.id){let t=av(e),r=`[aria-controls~="${e.id}"]`,a=t.querySelector(r);a&&(n=a)}}let i=n&&nS(n);!i&&t?requestAnimationFrame(()=>Q(e,!1)):!V(i?n:null)||i&&(null==n||n.focus({preventScroll:!0}))},[E,g,V]),W=(0,o.useRef)(!1);a3(()=>{if(T||!z||!K)return;let e=x.current;W.current=!0,Q(e)},[T,z,D,K,Q]),(0,o.useEffect)(()=>{if(!z||!K)return;let e=x.current;return()=>{if(W.current){W.current=!1;return}Q(e)}},[z,K,Q]);let X=a7(u);(0,o.useEffect)(()=>{if(D&&R)return a$("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=x.current;if(!t||or(t))return;let r=e.target;if(!r)return;let{disclosureElement:a}=E.getState();!("BODY"===r.tagName||aF(t,r)||!a||aF(a,r))||X(e)&&E.hide()},!0)},[E,D,R,X]);let Y=(A=ne(A,e=>(0,n.jsx)(i$,{level:i?1:void 0,children:e}),[i])).hidden,Z=A.alwaysVisible;A=ne(A,e=>l?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(of,{store:E,backdrop:l,hidden:Y,alwaysVisible:Z}),e]}):e,[E,l,Y,Z]);let[$,ee]=(0,o.useState)(),[et,er]=(0,o.useState)();return A=i0({...A={id:w,"data-dialog":"",role:"dialog",tabIndex:a?-1:void 0,"aria-labelledby":$,"aria-describedby":et,...A=ne(A,e=>(0,n.jsx)(nZ,{value:E,children:(0,n.jsx)(n$.Provider,{value:ee,children:(0,n.jsx)(n0.Provider,{value:er,children:e})})}),[E]),ref:a5(x,A.ref)},autoFocusOnShow:N}),A=iY({portal:s,...A=nN({...A=iN({store:E,...A}),focusable:a}),portalRef:M,preserveTabOrder:I})});function ov(e,t=nX){return nl(function(r){let a=t();return iI(r.store||a,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,n.jsx)(e,{...r}):null})}ov(nl(function(e){return nc("div",og(e))}),nX);let oy=Math.min,oA=Math.max,oF=Math.round,ob=Math.floor,oC=e=>({x:e,y:e}),oB={left:"right",right:"left",bottom:"top",top:"bottom"},oS={start:"end",end:"start"};function ox(e,t){return"function"==typeof e?e(t):e}function oE(e){return e.split("-")[0]}function oM(e){return e.split("-")[1]}function oD(e){return"x"===e?"y":"x"}function ok(e){return"y"===e?"height":"width"}let oI=new Set(["top","bottom"]);function ow(e){return oI.has(oE(e))?"y":"x"}function oT(e){return e.replace(/start|end/g,e=>oS[e])}let oR=["left","right"],oP=["right","left"],oG=["top","bottom"],oL=["bottom","top"];function oj(e){return e.replace(/left|right|bottom|top/g,e=>oB[e])}function o_(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function oO(e){let{x:t,y:r,width:a,height:n}=e;return{width:a,height:n,top:r,left:t,right:t+a,bottom:r+n,x:t,y:r}}function oU(e,t,r){let a,{reference:n,floating:i}=e,o=ow(t),s=oD(ow(t)),l=ok(s),u=oE(t),c="y"===o,d=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,h=n[l]/2-i[l]/2;switch(u){case"top":a={x:d,y:n.y-i.height};break;case"bottom":a={x:d,y:n.y+n.height};break;case"right":a={x:n.x+n.width,y:f};break;case"left":a={x:n.x-i.width,y:f};break;default:a={x:n.x,y:n.y}}switch(oM(t)){case"start":a[s]-=h*(r&&c?-1:1);break;case"end":a[s]+=h*(r&&c?-1:1)}return a}let oH=async(e,t,r)=>{let{placement:a="bottom",strategy:n="absolute",middleware:i=[],platform:o}=r,s=i.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:n}),{x:c,y:d}=oU(u,a,l),f=a,h={},m=0;for(let r=0;r{try{return e.matches(t)}catch(e){return!1}})}let o9=["transform","translate","scale","rotate","perspective"],o5=["transform","translate","scale","rotate","perspective","filter"],o8=["paint","layout","strict","content"];function o6(e){let t=o4(),r=oX(e)?st(e):e;return o9.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||o5.some(e=>(r.willChange||"").includes(e))||o8.some(e=>(r.contain||"").includes(e))}function o4(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let o7=new Set(["html","body","#document"]);function se(e){return o7.has(oz(e))}function st(e){return oq(e).getComputedStyle(e)}function sr(e){return oX(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sa(e){if("html"===oz(e))return e;let t=e.assignedSlot||e.parentNode||oZ(e)&&e.host||oQ(e);return oZ(t)?t.host:t}function sn(e,t,r){var a;void 0===t&&(t=[]),void 0===r&&(r=!0);let n=function e(t){let r=sa(t);return se(r)?t.ownerDocument?t.ownerDocument.body:t.body:oY(r)&&o0(r)?r:e(r)}(e),i=n===(null==(a=e.ownerDocument)?void 0:a.body),o=oq(n);if(i){let e=si(o);return t.concat(o,o.visualViewport||[],o0(n)?n:[],e&&r?sn(e):[])}return t.concat(n,sn(n,[],r))}function si(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function so(e){let t=st(e),r=parseFloat(t.width)||0,a=parseFloat(t.height)||0,n=oY(e),i=n?e.offsetWidth:r,o=n?e.offsetHeight:a,s=oF(r)!==i||oF(a)!==o;return s&&(r=i,a=o),{width:r,height:a,$:s}}function ss(e){return oX(e)?e:e.contextElement}function sl(e){let t=ss(e);if(!oY(t))return oC(1);let r=t.getBoundingClientRect(),{width:a,height:n,$:i}=so(t),o=(i?oF(r.width):r.width)/a,s=(i?oF(r.height):r.height)/n;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}let su=oC(0);function sc(e){let t=oq(e);return o4()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:su}function sd(e,t,r,a){var n;void 0===t&&(t=!1),void 0===r&&(r=!1);let i=e.getBoundingClientRect(),o=ss(e),s=oC(1);t&&(a?oX(a)&&(s=sl(a)):s=sl(e));let l=(void 0===(n=r)&&(n=!1),a&&(!n||a===oq(o))&&n)?sc(o):oC(0),u=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){let e=oq(o),t=a&&oX(a)?oq(a):a,r=e,n=si(r);for(;n&&a&&t!==r;){let e=sl(n),t=n.getBoundingClientRect(),a=st(n),i=t.left+(n.clientLeft+parseFloat(a.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(a.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=i,c+=o,n=si(r=oq(n))}}return oO({width:d,height:f,x:u,y:c})}function sf(e,t){let r=sr(e).scrollLeft;return t?t.left+r:sd(oQ(e)).left+r}function sh(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-sf(e,r),y:r.top+t.scrollTop}}let sm=new Set(["absolute","fixed"]);function sp(e,t,r){var a;let n;if("viewport"===t)n=function(e,t){let r=oq(e),a=oQ(e),n=r.visualViewport,i=a.clientWidth,o=a.clientHeight,s=0,l=0;if(n){i=n.width,o=n.height;let e=o4();(!e||e&&"fixed"===t)&&(s=n.offsetLeft,l=n.offsetTop)}let u=sf(a);if(u<=0){let e=a.ownerDocument,t=e.body,r=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(a.clientWidth-t.clientWidth-n);o<=25&&(i-=o)}else u<=25&&(i+=u);return{width:i,height:o,x:s,y:l}}(e,r);else if("document"===t){let t,r,i,o,s,l,u;a=oQ(e),t=oQ(a),r=sr(a),i=a.ownerDocument.body,o=oA(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=oA(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),l=-r.scrollLeft+sf(a),u=-r.scrollTop,"rtl"===st(i).direction&&(l+=oA(t.clientWidth,i.clientWidth)-o),n={width:o,height:s,x:l,y:u}}else if(oX(t)){let e,a,i,o,s,l;a=(e=sd(t,!0,"fixed"===r)).top+t.clientTop,i=e.left+t.clientLeft,o=oY(t)?sl(t):oC(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,n={width:s,height:l,x:i*o.x,y:a*o.y}}else{let r=sc(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return oO(n)}function sg(e){return"static"===st(e).position}function sv(e,t){if(!oY(e)||"fixed"===st(e).position)return null;if(t)return t(e);let r=e.offsetParent;return oQ(e)===r&&(r=r.ownerDocument.body),r}function sy(e,t){var r;let a=oq(e);if(o3(e))return a;if(!oY(e)){let t=sa(e);for(;t&&!se(t);){if(oX(t)&&!sg(t))return t;t=sa(t)}return a}let n=sv(e,t);for(;n&&(r=n,o1.has(oz(r)))&&sg(n);)n=sv(n,t);return n&&se(n)&&sg(n)&&!o6(n)?a:n||function(e){let t=sa(e);for(;oY(t)&&!se(t);){if(o6(t))return t;if(o3(t))break;t=sa(t)}return null}(e)||a}let sA=async function(e){let t=this.getOffsetParent||sy,r=this.getDimensions,a=await r(e.floating);return{reference:function(e,t,r){let a=oY(t),n=oQ(t),i="fixed"===r,o=sd(e,!0,i,t),s={scrollLeft:0,scrollTop:0},l=oC(0);if(a||!a&&!i)if(("body"!==oz(t)||o0(n))&&(s=sr(t)),a){let e=sd(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else n&&(l.x=sf(n));i&&!a&&n&&(l.x=sf(n));let u=!n||a||i?oC(0):sh(n,s);return{x:o.left+s.scrollLeft-l.x-u.x,y:o.top+s.scrollTop-l.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},sF={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:a,strategy:n}=e,i="fixed"===n,o=oQ(a),s=!!t&&o3(t.floating);if(a===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},u=oC(1),c=oC(0),d=oY(a);if((d||!d&&!i)&&(("body"!==oz(a)||o0(o))&&(l=sr(a)),oY(a))){let e=sd(a);u=sl(a),c.x=e.x+a.clientLeft,c.y=e.y+a.clientTop}let f=!o||d||i?oC(0):sh(o,l);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}},getDocumentElement:oQ,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:a,strategy:n}=e,i=[..."clippingAncestors"===r?o3(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let a=sn(e,[],!1).filter(e=>oX(e)&&"body"!==oz(e)),n=null,i="fixed"===st(e).position,o=i?sa(e):e;for(;oX(o)&&!se(o);){let t=st(o),r=o6(o);r||"fixed"!==t.position||(n=null),(i?!r&&!n:!r&&"static"===t.position&&!!n&&sm.has(n.position)||o0(o)&&!r&&function e(t,r){let a=sa(t);return!(a===r||!oX(a)||se(a))&&("fixed"===st(a).position||e(a,r))}(e,o))?a=a.filter(e=>e!==o):n=t,o=sa(o)}return t.set(e,a),a}(t,this._c):[].concat(r),a],o=i[0],s=i.reduce((e,r)=>{let a=sp(t,r,n);return e.top=oA(a.top,e.top),e.right=oy(a.right,e.right),e.bottom=oy(a.bottom,e.bottom),e.left=oA(a.left,e.left),e},sp(t,o,n));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:sy,getElementRects:sA,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=so(e);return{width:t,height:r}},getScale:sl,isElement:oX,isRTL:function(e){return"rtl"===st(e).direction}};function sb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sC(e=0,t=0,r=0,a=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,a);let n={x:e,y:t,width:r,height:a,top:t,right:e+r,bottom:t+a,left:e};return{...n,toJSON:()=>n}}function sB(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function sS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var sx=nd(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:a=!0,autoFocusOnShow:i=!0,wrapperProps:s,fixed:l=!1,flip:u=!0,shift:c=0,slide:d=!0,overlap:f=!1,sameWidth:h=!1,fitViewport:m=!1,gutter:p,arrowPadding:g=4,overflowPadding:v=8,getAnchorRect:y,updatePosition:A,...F}){let b=n2();a_(e=e||b,!1);let C=e.useState("arrowElement"),B=e.useState("anchorElement"),S=e.useState("disclosureElement"),x=e.useState("popoverElement"),E=e.useState("contentElement"),M=e.useState("placement"),D=e.useState("mounted"),k=e.useState("rendered"),I=(0,o.useRef)(null),[w,T]=(0,o.useState)(!1),{portalRef:R,domReady:P}=nt(r,F.portalRef),G=a9(y),L=a9(A),j=!!A;a3(()=>{if(!(null==x?void 0:x.isConnected))return;x.style.setProperty("--popover-overflow-padding",`${v}px`);let t={contextElement:B||void 0,getBoundingClientRect:()=>{let e=null==G?void 0:G(B);return e||!B?function(e){if(!e)return sC();let{x:t,y:r,width:a,height:n}=e;return sC(t,r,a,n)}(e):B.getBoundingClientRect()}},r=async()=>{var r,a,n,i,o;let s,y,A;if(!D)return;C||(I.current=I.current||document.createElement("div"));let F=C||I.current,b=[(r={gutter:p,shift:c},void 0===(a=({placement:e})=>{var t;let a=((null==F?void 0:F.clientHeight)||0)/2,n="number"==typeof r.gutter?r.gutter+a:null!=(t=r.gutter)?t:a;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:n,alignmentAxis:r.shift}})&&(a=0),{name:"offset",options:a,async fn(e){var t,r;let{x:n,y:i,placement:o,middlewareData:s}=e,l=await oK(e,a);return o===(null==(t=s.offset)?void 0:t.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:n+l.x,y:i+l.y,data:{...l,placement:o}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return a_(!r||r.every(sB),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,a,n,i,o,s,l,u;let c,d,f,{placement:h,middlewareData:m,rects:p,initialPlacement:g,platform:v,elements:y}=e,{mainAxis:A=!0,crossAxis:F=!0,fallbackPlacements:b,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:B="none",flipAlignment:S=!0,...x}=ox(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let E=oE(h),M=ow(g),D=oE(g)===g,k=await (null==v.isRTL?void 0:v.isRTL(y.floating)),I=b||(D||!S?[oj(g)]:(c=oj(g),[oT(g),c,oT(c)])),w="none"!==B;!b&&w&&I.push(...(d=oM(g),f=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?oP:oR;return t?oR:oP;case"left":case"right":return t?oG:oL;default:return[]}}(oE(g),"start"===B,k),d&&(f=f.map(e=>e+"-"+d),S&&(f=f.concat(f.map(oT)))),f));let T=[g,...I],R=await oN(e,x),P=[],G=(null==(a=m.flip)?void 0:a.overflows)||[];if(A&&P.push(R[E]),F){let e,t,r,a,n=(s=h,l=p,void 0===(u=k)&&(u=!1),e=oM(s),r=ok(t=oD(ow(s))),a="x"===t?e===(u?"end":"start")?"right":"left":"start"===e?"bottom":"top",l.reference[r]>l.floating[r]&&(a=oj(a)),[a,oj(a)]);P.push(R[n[0]],R[n[1]])}if(G=[...G,{placement:h,overflows:P}],!P.every(e=>e<=0)){let e=((null==(n=m.flip)?void 0:n.index)||0)+1,t=T[e];if(t&&("alignment"!==F||M===ow(t)||G.every(e=>ow(e.placement)!==M||e.overflows[0]>0)))return{data:{index:e,overflows:G},reset:{placement:t}};let r=null==(i=G.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!r)switch(C){case"bestFit":{let e=null==(o=G.filter(e=>{if(w){let t=ow(e.placement);return t===M||"y"===t}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])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=g}if(h!==r)return{reset:{placement:r}}}return{}}}}({flip:u,overflowPadding:v}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:a,placement:n,rects:i,middlewareData:o}=e,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=ox(t,e),c={x:r,y:a},d=ow(n),f=oD(d),h=c[f],m=c[d],p=ox(s,e),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){let e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,r=i.reference[f]+i.reference[e]-g.mainAxis;hr&&(h=r)}if(u){var v,y;let e="y"===f?"width":"height",t=oJ.has(oE(n)),r=i.reference[d]-i.floating[e]+(t&&(null==(v=o.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),a=i.reference[d]+i.reference[e]+(t?0:(null==(y=o.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);ma&&(m=a)}return{[f]:h,[d]:m}}})},async fn(e){let{x:t,y:a,placement:n}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=ox(r,e),u={x:t,y:a},c=await oN(e,l),d=ow(oE(n)),f=oD(d),h=u[f],m=u[d];if(i){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=h+c[e],a=h-c[t];h=oA(r,oy(h,a))}if(o){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+c[e],a=m-c[t];m=oA(r,oy(m,a))}let p=s.fn({...e,[f]:h,[d]:m});return{...p,data:{x:p.x-t,y:p.y-a,enabled:{[f]:i,[d]:o}}}}}}}({slide:d,shift:c,overlap:f,overflowPadding:v}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:a,placement:n,rects:i,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=ox(r,e)||{};if(null==u)return{};let d=o_(c),f={x:t,y:a},h=oD(ow(n)),m=ok(h),p=await o.getDimensions(u),g="y"===h,v=g?"clientHeight":"clientWidth",y=i.reference[m]+i.reference[h]-f[h]-i.floating[m],A=f[h]-i.reference[h],F=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),b=F?F[v]:0;b&&await (null==o.isElement?void 0:o.isElement(F))||(b=s.floating[v]||i.floating[m]);let C=b/2-p[m]/2-1,B=oy(d[g?"top":"left"],C),S=oy(d[g?"bottom":"right"],C),x=b-p[m]-S,E=b/2-p[m]/2+(y/2-A/2),M=oA(B,oy(E,x)),D=!l.arrow&&null!=oM(n)&&E!==M&&i.reference[m]/2-(E{},...d}=ox(i,e),f=await oN(e,d),h=oE(o),m=oM(o),p="y"===ow(o),{width:g,height:v}=s.floating;"top"===h||"bottom"===h?(a=h,n=m===(await (null==l.isRTL?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(n=h,a="end"===m?"top":"bottom");let y=v-f.top-f.bottom,A=g-f.left-f.right,F=oy(v-f[a],y),b=oy(g-f[n],A),C=!e.middlewareData.shift,B=F,S=b;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(S=A),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(B=y),C&&!m){let e=oA(f.left,0),t=oA(f.right,0),r=oA(f.top,0),a=oA(f.bottom,0);p?S=g-2*(0!==e||0!==t?e+t:oA(f.left,f.right)):B=v-2*(0!==r||0!==a?r+a:oA(f.top,f.bottom))}await c({...e,availableWidth:S,availableHeight:B});let x=await l.getDimensions(u.floating);return g!==x.width||v!==x.height?{reset:{rects:!0}}:{}}}],B=await (o={placement:M,strategy:l?"fixed":"absolute",middleware:b},s=new Map,A={...(y={platform:sF,...o}).platform,_c:s},oH(t,x,{...y,platform:A}));null==e||e.setState("currentPlacement",B.placement),T(!0);let S=sS(B.x),E=sS(B.y);if(Object.assign(x.style,{top:"0",left:"0",transform:`translate3d(${S}px,${E}px,0)`}),F&&B.middlewareData.arrow){let{x:e,y:t}=B.middlewareData.arrow,r=B.placement.split("-")[0],a=F.clientWidth/2,n=F.clientHeight/2,i=null!=e?e+a:-a,o=null!=t?t+n:-n;x.style.setProperty("--popover-transform-origin",{top:`${i}px calc(100% + ${n}px)`,bottom:`${i}px ${-n}px`,left:`calc(100% + ${a}px) ${o}px`,right:`${-a}px ${o}px`}[r]),Object.assign(F.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},a=function(e,t,r,a){let n;void 0===a&&(a={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=a,c=ss(e),d=i||o?[...c?sn(c):[],...sn(t)]:[];d.forEach(e=>{i&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});let f=c&&l?function(e,t){let r,a=null,n=oQ(e);function i(){var e;clearTimeout(r),null==(e=a)||e.disconnect(),a=null}return!function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(s||t(),!f||!h)return;let m={rootMargin:-ob(d)+"px "+-ob(n.clientWidth-(c+f))+"px "+-ob(n.clientHeight-(d+h))+"px "+-ob(c)+"px",threshold:oA(0,oy(1,l))||1},p=!0;function g(t){let a=t[0].intersectionRatio;if(a!==l){if(!p)return o();a?o(!1,a):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==a||sb(u,e.getBoundingClientRect())||o(),p=!1}try{a=new IntersectionObserver(g,{...m,root:n.ownerDocument})}catch(e){a=new IntersectionObserver(g,m)}a.observe(e)}(!0),i}(c,r):null,h=-1,m=null;s&&(m=new ResizeObserver(e=>{let[a]=e;a&&a.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!u&&m.observe(c),m.observe(t));let p=u?sd(e):null;return u&&function t(){let a=sd(e);p&&!sb(p,a)&&r(),p=a,n=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,u&&cancelAnimationFrame(n)}}(t,x,async()=>{j?(await L({updatePosition:r}),T(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{T(!1),a()}},[e,k,x,C,B,x,M,D,P,l,u,c,d,f,h,m,p,g,v,G,j,L]),a3(()=>{if(!D||!P||!(null==x?void 0:x.isConnected)||!(null==E?void 0:E.isConnected))return;let e=()=>{x.style.zIndex=getComputedStyle(E).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[D,P,x,E]);let _=l?"fixed":"absolute";return F=ne(F,t=>(0,n.jsx)("div",{...s,style:{position:_,top:0,left:0,width:"max-content",...null==s?void 0:s.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,_,s]),F={"data-placing":!w||void 0,...F=ne(F,t=>(0,n.jsx)(n9,{value:e,children:t}),[e]),style:{position:"relative",...F.style}},F=og({store:e,modal:t,portal:r,preserveTabOrder:a,preserveTabOrderAnchor:S||B,autoFocusOnShow:w&&i,...F,portalRef:R})});ov(nl(function(e){return nc("div",sx(e))}),n2);var sE=nd(function({store:e,modal:t,tabIndex:r,alwaysVisible:a,autoFocusOnHide:n=!0,hideOnInteractOutside:i=!0,...s}){let l=ie();a_(e=e||l,!1);let u=e.useState("baseElement"),c=(0,o.useRef)(!1),d=iI(e.tag,e=>null==e?void 0:e.renderedItems.length);return s=iK({store:e,alwaysVisible:a,...s}),s=sx({store:e,modal:t,alwaysVisible:a,backdrop:!1,autoFocusOnShow:!1,finalFocus:u,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:d,...s,getPersistentElements(){var r;let a=(null==(r=s.getPersistentElements)?void 0:r.call(s))||[];if(!t||!e)return a;let{contentElement:n,baseElement:i}=e.getState();if(!i)return a;let o=av(i),l=[];if((null==n?void 0:n.id)&&l.push(`[aria-controls~="${n.id}"]`),(null==i?void 0:i.id)&&l.push(`[aria-controls~="${i.id}"]`),!l.length)return[...a,i];let u=l.join(",");return[...a,...o.querySelectorAll(u)]},autoFocusOnHide:e=>!aO(n,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,a;let n=null==e?void 0:e.getState(),o=null==(r=null==n?void 0:n.contentElement)?void 0:r.id,s=null==(a=null==n?void 0:n.baseElement)?void 0:a.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,s))return!1;let l="function"==typeof i?i(t):i;return l&&(c.current="click"===t.type),l}})}),sM=ov(nl(function(e){return nc("div",sE(e))}),ie);(0,o.createContext)(null),(0,o.createContext)(null);var sD=nf([ny],[nA]),sk=sD.useContext;sD.useScopedContext,sD.useProviderContext,sD.ContextProvider,sD.ScopedContextProvider;var sI={id:null};function sw(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function sT(e,t){return e.filter(e=>e.rowId===t)}function sR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function sP(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var sG=az()&&aK();function sL({tag:e,...t}={}){let r=ip(t.store,function(e,...t){if(e)return io(e,"pick")(...t)}(e,["value","rtl"]));ig(t,r);let a=null==e?void 0:e.getState(),n=null==r?void 0:r.getState(),i=aN(t.activeId,null==n?void 0:n.activeId,t.defaultActiveId,null),o=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),a=function(e={}){var t,r;ig(e,e.store);let a=null==(t=e.store)?void 0:t.getState(),n=aN(e.items,null==a?void 0:a.items,e.defaultItems,[]),i=new Map(n.map(e=>[e.id,e])),o={items:n,renderedItems:aN(null==a?void 0:a.renderedItems,[])},s=null==(r=e.store)?void 0:r.__unstablePrivateStore,l=is({items:n,renderedItems:o.renderedItems},s),u=is(o,e.store),c=e=>{var t;let r,a,n=(t=e=>e.element,r=e.map((e,t)=>[t,e]),a=!1,(r.sort(([e,r],[n,i])=>{var o;let s=t(r),l=t(i);return s!==l&&s&&l?(o=s,l.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING)?(e>n&&(a=!0),-1):(et):e);l.setState("renderedItems",n),u.setState("renderedItems",n)};il(u,()=>iu(l)),il(l,()=>ih(l,["items"],e=>{u.setState("items",e.items)})),il(l,()=>ih(l,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=u.getState();e.renderedItems!==t&&c(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let a=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>c(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),a=[...e].reverse().find(e=>!!e.element),n=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;n&&(null==a?void 0:a.element);){let e=n;if(a&&e.contains(a.element))return n;n=n.parentElement}return av(n).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&a.observe(t.element);return()=>{cancelAnimationFrame(r),a.disconnect()}}));let d=(e,t,r=!1)=>{let a;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),n=t.slice();if(-1!==r){let o={...a=t[r],...e};n[r]=o,i.set(e.id,o)}else n.push(e),i.set(e.id,e);return n}),()=>{t(t=>{if(!a)return r&&i.delete(e.id),t.filter(({id:t})=>t!==e.id);let n=t.findIndex(({id:t})=>t===e.id);if(-1===n)return t;let o=t.slice();return o[n]=a,i.set(e.id,a),o})}},f=e=>d(e,e=>l.setState("items",e),!0);return{...u,registerItem:f,renderItem:e=>aL(f(e),d(e,e=>l.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=i.get(e);if(!t){let{items:r}=l.getState();(t=r.find(t=>t.id===e))&&i.set(e,t)}return t||null},__unstablePrivateStore:l}}(e),n=aN(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),i=is({...a.getState(),id:aN(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:n,baseElement:aN(null==r?void 0:r.baseElement,null),includesBaseElement:aN(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===n),moves:aN(null==r?void 0:r.moves,0),orientation:aN(e.orientation,null==r?void 0:r.orientation,"both"),rtl:aN(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:aN(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:aN(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:aN(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:aN(e.focusShift,null==r?void 0:r.focusShift,!1)},a,e.store);il(i,()=>id(i,["renderedItems","activeId"],e=>{i.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=sw(e.renderedItems))?void 0:r.id})}));let o=(e="next",t={})=>{var r,a;let n=i.getState(),{skip:o=0,activeId:s=n.activeId,focusShift:l=n.focusShift,focusLoop:u=n.focusLoop,focusWrap:c=n.focusWrap,includesBaseElement:d=n.includesBaseElement,renderedItems:f=n.renderedItems,rtl:h=n.rtl}=t,m="up"===e||"down"===e,p="next"===e||"down"===e,g=m?nJ(function(e,t,r){let a=sP(e);for(let n of e)for(let e=0;ee.id===s);if(!v)return null==(a=sw(g))?void 0:a.id;let y=g.some(e=>e.rowId),A=g.indexOf(v),F=g.slice(A+1),b=sT(F,v.rowId);if(o){let e=b.filter(e=>s?!e.disabled&&e.id!==s:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let C=u&&(m?"horizontal"!==u:"vertical"!==u),B=y&&c&&(m?"horizontal"!==c:"vertical"!==c),S=p?(!y||m)&&C&&d:!!m&&d;if(C){let e=sw(function(e,t,r=!1){let a=e.findIndex(e=>e.id===t);return[...e.slice(a+1),...r?[sI]:[],...e.slice(0,a)]}(B&&!S?g:sT(g,v.rowId),s,S),s);return null==e?void 0:e.id}if(B){let e=sw(S?b:F,s);return S?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let x=sw(b,s);return!x&&S?null:null==x?void 0:x.id};return{...a,...i,setBaseElement:e=>i.setState("baseElement",e),setActiveId:e=>i.setState("activeId",e),move:e=>{void 0!==e&&(i.setState("activeId",e),i.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=sw(i.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=sw(nK(i.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("up",e))}}({...t,activeId:i,includesBaseElement:aN(t.includesBaseElement,null==n?void 0:n.includesBaseElement,!0),orientation:aN(t.orientation,null==n?void 0:n.orientation,"vertical"),focusLoop:aN(t.focusLoop,null==n?void 0:n.focusLoop,!0),focusWrap:aN(t.focusWrap,null==n?void 0:n.focusWrap,!0),virtualFocus:aN(t.virtualFocus,null==n?void 0:n.virtualFocus,!0)}),s=function({popover:e,...t}={}){let r=ip(t.store,im(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));ig(t,r);let a=null==r?void 0:r.getState(),n=oh({...t,store:r}),i=aN(t.placement,null==a?void 0:a.placement,"bottom"),o=is({...n.getState(),placement:i,currentPlacement:i,anchorElement:aN(null==a?void 0:a.anchorElement,null),popoverElement:aN(null==a?void 0:a.popoverElement,null),arrowElement:aN(null==a?void 0:a.arrowElement,null),rendered:Symbol("rendered")},n,r);return{...n,...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"))}}({...t,placement:aN(t.placement,null==n?void 0:n.placement,"bottom-start")}),l=aN(t.value,null==n?void 0:n.value,t.defaultValue,""),u=aN(t.selectedValue,null==n?void 0:n.selectedValue,null==a?void 0:a.values,t.defaultSelectedValue,""),c=Array.isArray(u),d={...o.getState(),...s.getState(),value:l,selectedValue:u,resetValueOnSelect:aN(t.resetValueOnSelect,null==n?void 0:n.resetValueOnSelect,c),resetValueOnHide:aN(t.resetValueOnHide,null==n?void 0:n.resetValueOnHide,c&&!e),activeValue:null==n?void 0:n.activeValue},f=is(d,o,s,r);return sG&&il(f,()=>id(f,["virtualFocus"],()=>{f.setState("virtualFocus",!1)})),il(f,()=>{if(e)return aL(id(f,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),id(e,["values"],e=>{f.setState("selectedValue",e.values)}))}),il(f,()=>id(f,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||f.setState("value",l)})),il(f,()=>id(f,["open"],e=>{e.open||(f.setState("activeId",i),f.setState("moves",0))})),il(f,()=>id(f,["moves","activeId"],(e,t)=>{e.moves===t.moves&&f.setState("activeValue",void 0)})),il(f,()=>ih(f,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=f.getState(),a=o.item(r);f.setState("activeValue",null==a?void 0:a.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 sj(e={}){var t,r,a,n,i,o,s,l;let u;t=e,u=sk();let[c,d]=iR(sL,e={id:a8((r=t={...t,tag:void 0!==t.tag?t.tag:u}).id),...r});return a6(d,[(a=e).tag]),iT(c,a,"value","setValue"),iT(c,a,"selectedValue","setSelectedValue"),iT(c,a,"resetValueOnHide"),iT(c,a,"resetValueOnSelect"),Object.assign((o=c,a6(s=d,[(l=a).popover]),iT(o,l,"placement"),n=oc(o,s,l),i=n,a6(d,[a.store]),iT(i,a,"items","setItems"),iT(n=i,a,"activeId","setActiveId"),iT(n,a,"includesBaseElement"),iT(n,a,"virtualFocus"),iT(n,a,"orientation"),iT(n,a,"rtl"),iT(n,a,"focusLoop"),iT(n,a,"focusWrap"),iT(n,a,"focusShift"),n),{tag:a.tag})}function s_(e={}){let t=sj(e);return(0,n.jsx)(it,{value:t,children:e.children})}var sO=(0,o.createContext)(void 0),sU=nd(function(e){let[t,r]=(0,o.useState)();return aH(e={role:"group","aria-labelledby":t,...e=ne(e,e=>(0,n.jsx)(sO.Provider,{value:r,children:e}),[])})});nl(function(e){return nc("div",sU(e))});var sH=nd(function({store:e,...t}){return sU(t)});nl(function(e){return nc("div",sH(e))});var sN=nd(function({store:e,...t}){let r=n7();return a_(e=e||r,!1),"grid"===aD(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=sH({store:e,...t})}),sJ=nl(function(e){return nc("div",sN(e))}),sK=nd(function(e){let t=(0,o.useContext)(sO),r=a8(e.id);return a3(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),aH(e={id:r,"aria-hidden":!0,...e})});nl(function(e){return nc("div",sK(e))});var sV=nd(function({store:e,...t}){return sK(t)});nl(function(e){return nc("div",sV(e))});var sz=nd(function(e){return sV(e)}),sq=nl(function(e){return nc("div",sz(e))}),sQ=e.i(38360);let sW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},sX=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function sY(e,t,r={}){let{keys:a,threshold:n=sW.MATCHES,baseSort:i=sX,sorter:o=e=>e.sort((e,t)=>(function(e,t,r){let{rank:a,keyIndex:n}=e,{rank:i,keyIndex:o}=t;return a!==i?a>i?-1:1:n===o?r(e,t):n{let s=sZ(n,u,c),l=t,{minRanking:d,maxRanking:f,threshold:h}=i;return s=sW.MATCHES?s=d:s>f&&(s=f),s>e&&(e=s,r=o,a=h,l=n),{rankedValue:l,rank:e,keyIndex:r,keyThreshold:a}},{rankedValue:s,rank:sW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:s,rank:sZ(s,u,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:f,keyThreshold:h=n}=d;return f>=h&&e.push({...d,item:i,index:o}),e},[])).map(({item:e})=>e)}function sZ(e,t,r){if(e=s$(e,r),(t=s$(t,r)).length>e.length)return sW.NO_MATCH;if(e===t)return sW.CASE_SENSITIVE_EQUAL;let a=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),n=a.next(),i=n.value;if(e.length===t.length&&0===i)return sW.EQUAL;if(0===i)return sW.STARTS_WITH;let o=n;for(;!o.done;){if(o.value>0&&" "===e[o.value-1])return sW.WORD_STARTS_WITH;o=a.next()}return i>0?sW.CONTAINS:1===t.length?sW.NO_MATCH:(function(e){let t="",r=" ";for(let a=0;a-1))return sW.NO_MATCH;return r=i-s,a=n/t.length,sW.MATCHES+1/r*a}(e,t)}function s$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,sQ.default)(e)),e}sY.rankings=sW;let s0={maxRanking:1/0,minRanking:-1/0};var s1=e.i(29402);let s2=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),s3={"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)"},s9={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},s5=(0,ri.getMissionList)().filter(e=>!s2.has(e)).map(e=>{let t,r=(0,ri.getMissionInfo)(e),[a]=(0,ri.getSourceAndPath)(r.resourcePath),n=(t=a.match(/^(.*)(\/[^/]+)$/))?t[1]:"",i=s3[a]??s9[n]??null;return{resourcePath:r.resourcePath,missionName:e,displayName:r.displayName,sourcePath:a,groupName:i,missionTypes:r.missionTypes}}),s8=new Map(s5.map(e=>[e.missionName,e])),s6=function(e){let t=new Map;for(let r of e){let e=t.get(r.groupName)??[];e.push(r),t.set(r.groupName,e)}return t.forEach((e,r)=>{t.set(r,(0,s1.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,s1.default)(Array.from(t.entries()),[([e])=>"Official"===e?0:null==e?2:1,([e])=>e?e.toLowerCase():""],["asc","asc"])}(s5),s4="undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function s7(e){let t,r,a,o,s,l=(0,i.c)(12),{mission:u}=e,c=u.displayName||u.missionName;return l[0]!==c?(t=(0,n.jsx)("span",{className:"MissionSelect-itemName",children:c}),l[0]=c,l[1]=t):t=l[1],l[2]!==u.missionTypes?(r=u.missionTypes.length>0&&(0,n.jsx)("span",{className:"MissionSelect-itemTypes",children:u.missionTypes.map(le)}),l[2]=u.missionTypes,l[3]=r):r=l[3],l[4]!==t||l[5]!==r?(a=(0,n.jsxs)("span",{className:"MissionSelect-itemHeader",children:[t,r]}),l[4]=t,l[5]=r,l[6]=a):a=l[6],l[7]!==u.missionName?(o=(0,n.jsx)("span",{className:"MissionSelect-itemMissionName",children:u.missionName}),l[7]=u.missionName,l[8]=o):o=l[8],l[9]!==a||l[10]!==o?(s=(0,n.jsxs)(n.Fragment,{children:[a,o]}),l[9]=a,l[10]=o,l[11]=s):s=l[11],s}function le(e){return(0,n.jsx)("span",{className:"MissionSelect-itemType","data-mission-type":e,children:e},e)}function lt(e){let t,r,a,s,l,u,c,d,f,h,m,p,g,v,y,A,F,b=(0,i.c)(44),{value:C,missionType:B,onChange:S,disabled:x}=e,[E,M]=(0,o.useState)(""),D=(0,o.useRef)(null),k=(0,o.useRef)(B);b[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{(0,o.startTransition)(()=>M(e))},b[0]=t):t=b[0];let I=sj({resetValueOnHide:!0,selectedValue:C,setSelectedValue:e=>{if(e){let t=k.current,r=(0,ri.getMissionInfo)(e).missionTypes;t&&r.includes(t)||(t=r[0]),S({missionName:e,missionType:t}),D.current?.blur()}},setValue:t});b[1]!==I?(r=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),D.current?.focus(),I.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},a=[I],b[1]=I,b[2]=r,b[3]=a):(r=b[2],a=b[3]),(0,o.useEffect)(r,a),b[4]!==C?(s=s8.get(C),b[4]=C,b[5]=s):s=b[5];let w=s;e:{let e,t;if(!E){let e;b[6]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:s6},b[6]=e):e=b[6],l=e;break e}b[7]!==E?(e=sY(s5,E,{keys:["displayName","missionName","missionTypes","groupName"]}),b[7]=E,b[8]=e):e=b[8];let r=e;b[9]!==r?(t={type:"flat",missions:r},b[9]=r,b[10]=t):t=b[10],l=t}let T=l,R=w?w.displayName||w.missionName:C,P="flat"===T.type?0===T.missions.length:0===T.groups.length,G=e=>(0,n.jsx)(ij,{value:e.missionName,className:"MissionSelect-item",focusOnHover:!0,onClick:t=>{if(t.target&&t.target instanceof HTMLElement){let r=t.target.dataset.missionType;r?(k.current=r,e.missionName===C&&S({missionName:e.missionName,missionType:r})):k.current=null}else k.current=null},children:(0,n.jsx)(s7,{mission:e})},e.missionName);b[11]!==I?(u=()=>{try{document.exitPointerLock()}catch{}I.show()},c=e=>{"Escape"!==e.key||I.getState().open||D.current?.blur()},b[11]=I,b[12]=u,b[13]=c):(u=b[12],c=b[13]),b[14]!==x||b[15]!==R||b[16]!==u||b[17]!==c?(d=(0,n.jsx)(iF,{ref:D,autoSelect:!0,disabled:x,placeholder:R,className:"MissionSelect-input",onFocus:u,onKeyDown:c}),b[14]=x,b[15]=R,b[16]=u,b[17]=c,b[18]=d):d=b[18],b[19]!==R?(f=(0,n.jsx)("span",{className:"MissionSelect-selectedName",children:R}),b[19]=R,b[20]=f):f=b[20],b[21]!==B?(h=B&&(0,n.jsx)("span",{className:"MissionSelect-itemType","data-mission-type":B,children:B}),b[21]=B,b[22]=h):h=b[22],b[23]!==h||b[24]!==f?(m=(0,n.jsxs)("div",{className:"MissionSelect-selectedValue",children:[f,h]}),b[23]=h,b[24]=f,b[25]=m):m=b[25],b[26]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)("kbd",{className:"MissionSelect-shortcut",children:s4?"⌘K":"^K"}),b[26]=p):p=b[26],b[27]!==m||b[28]!==d?(g=(0,n.jsxs)("div",{className:"MissionSelect-inputWrapper",children:[d,m,p]}),b[27]=m,b[28]=d,b[29]=g):g=b[29];let L="flat"===T.type?T.missions.map(G):T.groups.map(e=>{let[t,r]=e;return t?(0,n.jsxs)(sJ,{className:"MissionSelect-group",children:[(0,n.jsx)(sq,{className:"MissionSelect-groupLabel",children:t}),r.map(G)]},t):(0,n.jsx)(o.Fragment,{children:r.map(G)},"ungrouped")});return b[30]!==P?(v=P&&(0,n.jsx)("div",{className:"MissionSelect-noResults",children:"No missions found"}),b[30]=P,b[31]=v):v=b[31],b[32]!==iV||b[33]!==L||b[34]!==v?(y=(0,n.jsxs)(iV,{className:"MissionSelect-list",children:[L,v]}),b[32]=iV,b[33]=L,b[34]=v,b[35]=y):y=b[35],b[36]!==sM||b[37]!==y?(A=(0,n.jsx)(sM,{gutter:4,fitViewport:!0,autoFocusOnHide:!1,className:"MissionSelect-popover",children:y}),b[36]=sM,b[37]=y,b[38]=A):A=b[38],b[39]!==s_||b[40]!==I||b[41]!==g||b[42]!==A?(F=(0,n.jsxs)(s_,{store:I,children:[g,A]}),b[39]=s_,b[40]=I,b[41]=g,b[42]=A,b[43]=F):F=b[43],F}var lr=e.i(11152),la=e.i(40141);function ln(e){return(0,la.GenIcon)({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 li(e){let t,r,a,s,l,u=(0,i.c)(11),{cameraRef:c,missionName:d,missionType:f}=e,{fogEnabled:h}=(0,E.useSettings)(),[m,p]=(0,o.useState)(!1),g=(0,o.useRef)(null);u[0]!==c||u[1]!==h||u[2]!==d||u[3]!==f?(t=async()=>{clearTimeout(g.current);let e=c.current;if(!e)return;let t=function({position:e,quaternion:t}){let r=e=>parseFloat(e.toFixed(3)),a=`${r(e.x)},${r(e.y)},${r(e.z)}`,n=`${r(t.x)},${r(t.y)},${r(t.z)},${r(t.w)}`;return`#c${a}~${n}`}(e),r=new URLSearchParams;r.set("mission",`${d}~${f}`),r.set("fog",h.toString());let a=`${window.location.pathname}?${r}${t}`,n=`${window.location.origin}${a}`;window.history.replaceState(null,"",a);try{await navigator.clipboard.writeText(n),p(!0),g.current=setTimeout(()=>{p(!1)},1100)}catch(e){console.error(e)}},u[0]=c,u[1]=h,u[2]=d,u[3]=f,u[4]=t):t=u[4];let v=t,y=m?"true":"false";return u[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,n.jsx)(lr.FaMapPin,{className:"MapPin"}),a=(0,n.jsx)(ln,{className:"ClipboardCheck"}),s=(0,n.jsx)("span",{className:"ButtonLabel",children:" Copy coordinates URL"}),u[5]=r,u[6]=a,u[7]=s):(r=u[5],a=u[6],s=u[7]),u[8]!==v||u[9]!==y?(l=(0,n.jsxs)("button",{type:"button",className:"IconButton LabelledButton CopyCoordinatesButton","aria-label":"Copy coordinates URL",title:"Copy coordinates URL",onClick:v,"data-copied":y,id:"copyCoordinatesButton",children:[r,a,s]}),u[8]=v,u[9]=y,u[10]=l):l=u[10],l}function lo(e){return(0,la.GenIcon)({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)}var ls={},ll=function(e,t,r,a,n){var i=new Worker(ls[t]||(ls[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(e){var t=e.data,r=t.$e$;if(r){var a=Error(r[0]);a.code=r[1],a.stack=r[2],n(a,null)}else n(null,t)},i.postMessage(r,a),i},lu=Uint8Array,lc=Uint16Array,ld=Int32Array,lf=new lu([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),lh=new lu([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),lm=new lu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lp=function(e,t){for(var r=new lc(31),a=0;a<31;++a)r[a]=t+=1<>1|(21845&lB)<<1;lS=(61680&(lS=(52428&lS)>>2|(13107&lS)<<2))>>4|(3855&lS)<<4,lC[lB]=((65280&lS)>>8|(255&lS)<<8)>>1}for(var lx=function(e,t,r){for(var a,n=e.length,i=0,o=new lc(t);i>l]=u}else for(i=0,a=new lc(n);i>15-e[i]);return a},lE=new lu(288),lB=0;lB<144;++lB)lE[lB]=8;for(var lB=144;lB<256;++lB)lE[lB]=9;for(var lB=256;lB<280;++lB)lE[lB]=7;for(var lB=280;lB<288;++lB)lE[lB]=8;for(var lM=new lu(32),lB=0;lB<32;++lB)lM[lB]=5;var lD=lx(lE,9,0),lk=lx(lE,9,1),lI=lx(lM,5,0),lw=lx(lM,5,1),lT=function(e){for(var t=e[0],r=1;rt&&(t=e[r]);return t},lR=function(e,t,r){var a=t/8|0;return(e[a]|e[a+1]<<8)>>(7&t)&r},lP=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},lG=function(e){return(e+7)/8|0},lL=function(e,t,r){return(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length),new lu(e.subarray(t,r))},lj=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],l_=function(e,t,r){var a=Error(t||lj[e]);if(a.code=e,Error.captureStackTrace&&Error.captureStackTrace(a,l_),!r)throw a;return a},lO=function(e,t,r,a){var n=e.length,i=a?a.length:0;if(!n||t.f&&!t.l)return r||new lu(0);var o=!r,s=o||2!=t.i,l=t.i;o&&(r=new lu(3*n));var u=function(e){var t=r.length;if(e>t){var a=new lu(Math.max(2*t,e));a.set(r),r=a}},c=t.f||0,d=t.p||0,f=t.b||0,h=t.l,m=t.d,p=t.m,g=t.n,v=8*n;do{if(!h){c=lR(e,d,1);var y=lR(e,d+1,3);if(d+=3,y)if(1==y)h=lk,m=lw,p=9,g=5;else if(2==y){var A=lR(e,d,31)+257,F=lR(e,d+10,15)+4,b=A+lR(e,d+5,31)+1;d+=14;for(var C=new lu(b),B=new lu(19),S=0;S>4;if(k<16)C[S++]=k;else{var I=0,w=0;for(16==k?(w=3+lR(e,d,3),d+=2,I=C[S-1]):17==k?(w=3+lR(e,d,7),d+=3):18==k&&(w=11+lR(e,d,127),d+=7);w--;)C[S++]=I}}var T=C.subarray(0,A),R=C.subarray(A);p=lT(T),g=lT(R),h=lx(T,p,1),m=lx(R,g,1)}else l_(1);else{var k=lG(d)+4,P=e[k-4]|e[k-3]<<8,G=k+P;if(G>n){l&&l_(0);break}s&&u(f+P),r.set(e.subarray(k,G),f),t.b=f+=P,t.p=d=8*G,t.f=c;continue}if(d>v){l&&l_(0);break}}s&&u(f+131072);for(var L=(1<>4;if((d+=15&I)>v){l&&l_(0);break}if(I||l_(2),O<256)r[f++]=O;else if(256==O){_=d,h=null;break}else{var U=O-254;if(O>264){var S=O-257,H=lf[S];U=lR(e,d,(1<>4;N||l_(3),d+=15&N;var R=lF[J];if(J>3){var H=lh[J];R+=lP(e,d)&(1<v){l&&l_(0);break}s&&u(f+131072);var K=f+U;if(f>8},lH=function(e,t,r){r<<=7&t;var a=t/8|0;e[a]|=r,e[a+1]|=r>>8,e[a+2]|=r>>16},lN=function(e,t){for(var r=[],a=0;af&&(f=i[a].s);var h=new lc(f+1),m=lJ(r[c-1],h,0);if(m>t){var a=0,p=0,g=m-t,v=1<t)p+=v-(1<>=g;p>0;){var A=i[a].s;h[A]=0&&p;--a){var F=i[a].s;h[F]==t&&(--h[F],++p)}m=t}return{t:new lu(h),l:m}},lJ=function(e,t,r){return -1==e.s?Math.max(lJ(e.l,t,r+1),lJ(e.r,t,r+1)):t[e.s]=r},lK=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new lc(++t),a=0,n=e[0],i=1,o=function(e){r[a++]=e},s=1;s<=t;++s)if(e[s]==n&&s!=t)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=e[s]}return{c:r.subarray(0,a),n:t}},lV=function(e,t){for(var r=0,a=0;a>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var i=0;i4&&!I[lm[T-1]];--T);var R=u+5<<3,P=lV(n,lE)+lV(i,lM)+o,G=lV(n,g)+lV(i,A)+o+14+3*T+lV(M,I)+2*M[16]+3*M[17]+7*M[18];if(l>=0&&R<=P&&R<=G)return lz(t,c,e.subarray(l,l+u));if(lU(t,c,1+(G15&&(lU(t,c,O[D]>>5&127),c+=O[D]>>12)}}else d=lD,f=lE,h=lI,m=lM;for(var D=0;D255){var U=H>>18&31;lH(t,c,d[U+257]),c+=f[U+257],U>7&&(lU(t,c,H>>23&31),c+=lf[U]);var N=31&H;lH(t,c,h[N]),c+=m[N],N>3&&(lH(t,c,H>>5&8191),c+=lh[N])}else lH(t,c,d[H]),c+=f[H]}return lH(t,c,d[256]),c+f[256]},lQ=new ld([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lW=new lu(0),lX=function(e,t,r,a,n,i){var o=i.z||e.length,s=new lu(a+o+5*(1+Math.ceil(o/7e3))+n),l=s.subarray(a,s.length-n),u=i.l,c=7&(i.r||0);if(t){c&&(l[0]=i.r>>3);for(var d=lQ[t-1],f=d>>13,h=8191&d,m=(1<7e3||E>24576)&&(T>423||!u)){c=lq(e,l,0,F,b,C,S,E,D,x-D,c),E=B=S=0,D=x;for(var R=0;R<286;++R)b[R]=0;for(var R=0;R<30;++R)C[R]=0}var P=2,G=0,L=h,j=I-w&32767;if(T>2&&k==A(x-j))for(var _=Math.min(f,T)-1,O=Math.min(32767,x),U=Math.min(258,T);j<=O&&--L&&I!=w;){if(e[x+P]==e[x+P-j]){for(var H=0;HP){if(P=H,G=j,H>_)break;for(var N=Math.min(j,H-2),J=0,R=0;RJ&&(J=z,w=K)}}}w=p[I=w],j+=I-w&32767}if(G){F[E++]=0x10000000|ly[P]<<18|lb[G];var q=31&ly[P],Q=31&lb[G];S+=lf[q]+lh[Q],++b[257+q],++C[Q],M=x+P,++B}else F[E++]=e[x],++b[e[x]]}}for(x=Math.max(x,M);x=o&&(l[c/8|0]=u,W=o),c=lz(l,c+1,e.subarray(x,W))}i.i=o}return lL(s,0,a+lG(c)+n)},lY=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,a=9;--a;)r=(1&r&&-0x12477ce0)^r>>>1;e[t]=r}return e}(),lZ=function(){var e=-1;return{p:function(t){for(var r=e,a=0;a>>8;e=r},d:function(){return~e}}},l$=function(){var e=1,t=0;return{p:function(r){for(var a=e,n=t,i=0|r.length,o=0;o!=i;){for(var s=Math.min(o+2655,i);o>16),n=(65535&n)+15*(n>>16)}e=a,t=n},d:function(){return e%=65521,t%=65521,(255&e)<<24|(65280&e)<<8|(255&t)<<8|t>>8}}},l0=function(e,t,r,a,n){if(!n&&(n={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),o=new lu(i.length+e.length);o.set(i),o.set(e,i.length),e=o,n.w=i.length}return lX(e,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,r,a,n)},l1=function(e,t){var r={};for(var a in e)r[a]=e[a];for(var a in t)r[a]=t[a];return r},l2=function(e,t,r){for(var a=e(),n=e.toString(),i=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o>>0},us=function(e,t){return uo(e,t)+0x100000000*uo(e,t+4)},ul=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},uu=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&ul(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var a=0;a<=r.length;++a)e[a+10]=r.charCodeAt(a)}},uc=function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&l_(6,"invalid gzip data");var t=e[3],r=10;4&t&&(r+=(e[10]|e[11]<<8)+2);for(var a=(t>>3&1)+(t>>4&1);a>0;a-=!e[r++]);return r+(2&t)},ud=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},uf=function(e){return 10+(e.filename?e.filename.length+1:0)},uh=function(e,t){var r=t.level;if(e[0]=120,e[1]=(0==r?0:r<6?1:9==r?3:2)<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var a=l$();a.p(t.dictionary),ul(e,2,a.d())}},um=function(e,t){return((15&e[0])!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&l_(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&l_(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function up(e,t){return"function"==typeof e&&(t=e,e={}),this.ondata=t,e}var ug=function(){function e(e,t){if("function"==typeof e&&(t=e,e={}),this.ondata=t,this.o=e||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new lu(98304),this.o.dictionary){var r=this.o.dictionary.subarray(-32768);this.b.set(r,32768-r.length),this.s.i=32768-r.length}}return e.prototype.p=function(e,t){this.ondata(l0(e,this.o,0,0,this.s),t)},e.prototype.push=function(e,t){this.ondata||l_(5),this.s.l&&l_(4);var r=e.length+this.s.z;if(r>this.b.length){if(r>2*this.b.length-32768){var a=new lu(-32768&r);a.set(this.b.subarray(0,this.s.z)),this.b=a}var n=this.b.length-this.s.z;this.b.set(e.subarray(0,n),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(e.subarray(n),32768),this.s.z=e.length-n+32768,this.s.i=32766,this.s.w=32768}else this.b.set(e,this.s.z),this.s.z+=e.length;this.s.l=1&t,(this.s.z>this.s.w+8191||t)&&(this.p(this.b,t||!1),this.s.w=this.s.i,this.s.i-=2)},e.prototype.flush=function(){this.ondata||l_(5),this.s.l&&l_(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},e}(),uv=function(e,t){un([l6,function(){return[ua,ug]}],this,up.call(this,e,t),function(e){onmessage=ua(new ug(e.data))},6,1)};function uy(e,t){return l0(e,t||{},0,0)}var uA=function(){function e(e,t){"function"==typeof e&&(t=e,e={}),this.ondata=t;var r=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:r?r.length:0},this.o=new lu(32768),this.p=new lu(0),r&&this.o.set(r)}return e.prototype.e=function(e){if(this.ondata||l_(5),this.d&&l_(4),this.p.length){if(e.length){var t=new lu(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}}else this.p=e},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,r=lO(this.p,this.s,this.o);this.ondata(lL(r,t,this.s.b),this.d),this.o=lL(r,this.s.b-32768),this.s.b=this.o.length,this.p=lL(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),uF=function(e,t){un([l8,function(){return[ua,uA]}],this,up.call(this,e,t),function(e){onmessage=ua(new uA(e.data))},7,0)};function ub(e,t){return lO(e,{i:2},t&&t.out,t&&t.dictionary)}(function(){function e(e,t){this.c=lZ(),this.l=0,this.v=1,ug.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),this.l+=e.length,ug.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var r=l0(e,this.o,this.v&&uf(this.o),t&&8,this.s);this.v&&(uu(r,this.o),this.v=0),t&&(ul(r,r.length-8,this.c.d()),ul(r,r.length-4,this.l)),this.ondata(r,t)},e.prototype.flush=function(){ug.prototype.flush.call(this)}})();var uC=function(){function e(e,t){this.v=1,this.r=0,uA.call(this,e,t)}return e.prototype.push=function(e,t){if(uA.prototype.e.call(this,e),this.r+=e.length,this.v){var r=this.p.subarray(this.v-1),a=r.length>3?uc(r):4;if(a>r.length){if(!t)return}else this.v>1&&this.onmember&&this.onmember(this.r-r.length);this.p=r.subarray(a),this.v=0}uA.prototype.c.call(this,t),!this.s.f||this.s.l||t||(this.v=lG(this.s.p)+9,this.s={i:0},this.o=new lu(0),this.push(new lu(0),t))},e}(),uB=function(e,t){var r=this;un([l8,l4,function(){return[ua,uA,uC]}],this,up.call(this,e,t),function(e){var t=new uC(e.data);t.onmember=function(e){return postMessage(e)},onmessage=ua(t)},9,0,function(e){return r.onmember&&r.onmember(e)})},uS=(function(){function e(e,t){this.c=l$(),this.v=1,ug.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),ug.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var r=l0(e,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(uh(r,this.o),this.v=0),t&&ul(r,r.length-4,this.c.d()),this.ondata(r,t)},e.prototype.flush=function(){ug.prototype.flush.call(this)}}(),function(){function e(e,t){uA.call(this,e,t),this.v=e&&e.dictionary?2:1}return e.prototype.push=function(e,t){if(uA.prototype.e.call(this,e),this.v){if(this.p.length<6&&!t)return;this.p=this.p.subarray(um(this.p,this.v-1)),this.v=0}t&&(this.p.length<4&&l_(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),uA.prototype.c.call(this,t)},e}()),ux=function(e,t){un([l8,l7,function(){return[ua,uA,uS]}],this,up.call(this,e,t),function(e){onmessage=ua(new uS(e.data))},11,0)},uE=function(){function e(e,t){this.o=up.call(this,e,t)||{},this.G=uC,this.I=uA,this.Z=uS}return e.prototype.i=function(){var e=this;this.s.ondata=function(t,r){e.ondata(t,r)}},e.prototype.push=function(e,t){if(this.ondata||l_(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var r=new lu(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length)}else this.p=e;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,t),this.p=null)}},e}();function uM(e,t){uE.call(this,e,t),this.queuedSize=0,this.G=uB,this.I=uF,this.Z=ux}uM.prototype.i=function(){var e=this;this.s.ondata=function(t,r,a){e.ondata(t,r,a)},this.s.ondrain=function(t){e.queuedSize-=t,e.ondrain&&e.ondrain(t)}},uM.prototype.push=function(e,t){this.queuedSize+=e.length,uE.prototype.push.call(this,e,t)};var uD="undefined"!=typeof TextEncoder&&new TextEncoder,uk="undefined"!=typeof TextDecoder&&new TextDecoder,uI=0;try{uk.decode(lW,{stream:!0}),uI=1}catch(e){}var uw=function(e){for(var t="",r=0;;){var a=e[r++],n=(a>127)+(a>223)+(a>239);if(r+n>e.length)return{s:t,r:lL(e,r-1)};n?3==n?t+=String.fromCharCode(55296|(a=((15&a)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536)>>10,56320|1023&a):1&n?t+=String.fromCharCode((31&a)<<6|63&e[r++]):t+=String.fromCharCode((15&a)<<12|(63&e[r++])<<6|63&e[r++]):t+=String.fromCharCode(a)}};function uT(e,t){if(t){for(var r=new lu(e.length),a=0;a>1)),o=0,s=function(e){i[o++]=e},a=0;ai.length){var l=new lu(o+8+(n-a<<1));l.set(i),i=l}var u=e.charCodeAt(a);u<128||t?s(u):(u<2048?s(192|u>>6):(u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>18),s(128|u>>12&63)):s(224|u>>12),s(128|u>>6&63)),s(128|63&u))}return lL(i,0,o)}(function(e){this.ondata=e,uI?this.t=new TextDecoder:this.p=lW}).prototype.push=function(e,t){if(this.ondata||l_(5),t=!!t,this.t){this.ondata(this.t.decode(e,{stream:!0}),t),t&&(this.t.decode().length&&l_(8),this.t=null);return}this.p||l_(4);var r=new lu(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length);var a=uw(r),n=a.s,i=a.r;t?(i.length&&l_(8),this.p=null):this.p=i,this.ondata(n,t)},(function(e){this.ondata=e}).prototype.push=function(e,t){this.ondata||l_(5),this.d&&l_(4),this.ondata(uT(e),this.d=t||!1)};var uR=function(e){return 1==e?3:e<6?2:+(9==e)},uP=function(e,t){for(;1!=ui(e,t);t+=4+ui(e,t+2));return[us(e,t+12),us(e,t+4),us(e,t+20)]},uG=function(e){var t=0;if(e)for(var r in e){var a=e[r].length;a>65535&&l_(9),t+=a+4}return t},uL=function(e,t,r,a,n,i,o,s){var l=a.length,u=r.extra,c=s&&s.length,d=uG(u);ul(e,t,null!=o?0x2014b50:0x4034b50),t+=4,null!=o&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(i<0&&8),e[t++]=n&&8,e[t++]=255&r.compression,e[t++]=r.compression>>8;var f=new Date(null==r.mtime?Date.now():r.mtime),h=f.getFullYear()-1980;if((h<0||h>119)&&l_(10),ul(e,t,h<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,-1!=i&&(ul(e,t,r.crc),ul(e,t+4,i<0?-i-2:i),ul(e,t+8,r.size)),ul(e,t+12,l),ul(e,t+14,d),t+=16,null!=o&&(ul(e,t,c),ul(e,t+6,r.attrs),ul(e,t+10,o),t+=14),e.set(a,t),t+=l,d)for(var m in u){var p=u[m],g=p.length;ul(e,t,+m),ul(e,t+2,g),e.set(p,t+4),t+=4+g}return c&&(e.set(s,t),t+=c),t},uj=function(e,t,r,a,n){ul(e,t,0x6054b50),ul(e,t+8,r),ul(e,t+10,r),ul(e,t+12,a),ul(e,t+16,n)},u_=function(){function e(e){this.filename=e,this.c=lZ(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||l_(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}();function uO(e,t){var r=this;t||(t={}),u_.call(this,e),this.d=new ug(t,function(e,t){r.ondata(null,e,t)}),this.compression=8,this.flag=uR(t.level)}function uU(e,t){var r=this;t||(t={}),u_.call(this,e),this.d=new uv(t,function(e,t,a){r.ondata(e,t,a)}),this.compression=8,this.flag=uR(t.level),this.terminate=this.d.terminate}function uH(e){this.ondata=e,this.u=[],this.d=1}uO.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},uO.prototype.push=function(e,t){u_.prototype.push.call(this,e,t)},uU.prototype.process=function(e,t){this.d.push(e,t)},uU.prototype.push=function(e,t){u_.prototype.push.call(this,e,t)},uH.prototype.add=function(e){var t=this;if(this.ondata||l_(5),2&this.d)this.ondata(l_(4+(1&this.d)*8,0,1),null,!1);else{var r=uT(e.filename),a=r.length,n=e.comment,i=n&&uT(n),o=a!=e.filename.length||i&&n.length!=i.length,s=a+uG(e.extra)+30;a>65535&&this.ondata(l_(11,0,1),null,!1);var l=new lu(s);uL(l,0,e,r,o,-1);var u=[l],c=function(){for(var e=0,r=u;e0){var a=Math.min(this.c,e.length),n=e.subarray(0,a);if(this.c-=a,this.d?this.d.push(n,!this.c):this.k[0].push(n),(e=e.subarray(a)).length)return this.push(e,t)}else{var i=0,o=0,s=void 0,l=void 0;this.p.length?e.length?((l=new lu(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var u=l.length,c=this.c,d=c&&this.d,f=this;oo+30+d+h){var m,p,g=[];f.k.unshift(g),i=2;var v=uo(l,o+18),y=uo(l,o+22),A=function(e,t){if(t){for(var r="",a=0;a=0&&(F.size=v,F.originalSize=y),f.onfile(F)}return"break"}if(c){if(0x8074b50==e)return s=o+=12+(-2==c&&8),i=3,f.c=0,"break";else if(0x2014b50==e)return s=o-=4,i=3,f.c=0,"break"}}();++o);if(this.p=lW,c<0){var h=i?l.subarray(0,s-12-(-2==c&&8)-(0x8074b50==uo(l,s-16)&&4)):l.subarray(0,o);d?d.push(h,!!i):this.k[+(2==i)].push(h)}if(2&i)return this.push(l.subarray(o),t);this.p=l.subarray(o)}t&&(this.c&&l_(13),this.p=null)},uV.prototype.register=function(e){this.o[e.compression]=e},"function"==typeof queueMicrotask&&queueMicrotask;var uz=e.i(48450);let uq=[0,0,0,0,0,0,0,0,0,329,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2809,68,0,27,0,58,3,62,4,7,0,0,15,65,554,3,394,404,189,117,30,51,27,15,34,32,80,1,142,3,142,39,0,144,125,44,122,275,70,135,61,127,8,12,113,246,122,36,185,1,149,309,335,12,11,14,54,151,0,0,2,0,0,211,0,2090,344,736,993,2872,701,605,646,1552,328,305,1240,735,1533,1713,562,3,1775,1149,1469,979,407,553,59,279,31,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function uQ(e){return e.node?e.node.pop:e.leaf.pop}let uW=new class{nodes=[];leaves=[];tablesBuilt=!1;buildTables(){if(this.tablesBuilt)return;this.tablesBuilt=!0,this.leaves=[];for(let t=0;t<256;t++){var e;this.leaves.push({pop:uq[t]+ +((e=t)>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)+1,symbol:t,numBits:0,code:0})}this.nodes=[{pop:0,index0:0,index1:0}];let t=256,r=[];for(let e=0;e<256;e++)r.push({node:null,leaf:this.leaves[e]});for(;1!==t;){let e=0xfffffffe,a=0xffffffff,n=-1,i=-1;for(let o=0;oi?n:i;r[s]={node:o,leaf:null},l!==t-1&&(r[l]=r[t-1]),t--}this.nodes[0]=r[0].node,this.generateCodes(0,0,0)}determineIndex(e){return null!==e.leaf?-(this.leaves.indexOf(e.leaf)+1):this.nodes.indexOf(e.node)}generateCodes(e,t,r){if(t<0){let a=this.leaves[-(t+1)];a.code=e,a.numBits=r}else{let a=this.nodes[t];this.generateCodes(e,a.index0,r+1),this.generateCodes(e|1<=0)t=e.readFlag()?this.nodes[t].index1:this.nodes[t].index0;else{r.push(this.leaves[-(t+1)].symbol);break}}return String.fromCharCode(...r)}{let t=e.readInt(8);return String.fromCharCode(...e.readBytes(t))}}};class uX{data;bitNum;maxReadBitNum;error;stringBuffer=null;constructor(e,t=0){this.data=e,this.bitNum=t,this.maxReadBitNum=e.length<<3,this.error=!1}getCurPos(){return this.bitNum}setCurPos(e){this.bitNum=e}getBytePosition(){return this.bitNum+7>>3}isError(){return this.error}isFull(){return this.bitNum>this.maxReadBitNum}getRemainingBits(){return this.maxReadBitNum-this.bitNum}getMaxPos(){return this.maxReadBitNum}readFlag(){if(this.bitNum>=this.maxReadBitNum)return this.error=!0,!1;let e=1<<(7&this.bitNum),t=(this.data[this.bitNum>>3]&e)!=0;return this.bitNum++,t}readInt(e){if(0===e)return 0;if(this.bitNum+e>this.maxReadBitNum)return this.error=!0,0;let t=this.bitNum>>3,r=7&this.bitNum;if(this.bitNum+=e,e+r<=32){let a=0,n=e+r+7>>3;for(let e=0;e>>=r,32===e)?a>>>0:a&(1<>3;for(let e=0;e>>0:a&(1<>3,r=new Uint8Array(t),a=this.bitNum>>3,n=7&this.bitNum,i=8-n;if(0===n)r.set(this.data.subarray(a,a+t));else{let e=this.data[a];for(let o=0;o>n|t<this.maxReadBitNum)return this.error=!0,0;let e=this.bitNum>>3,t=7&this.bitNum,r=uX.f32U8;if(0===t)r[0]=this.data[e],r[1]=this.data[e+1],r[2]=this.data[e+2],r[3]=this.data[e+3];else{let a=8-t;for(let n=0;n<4;n++){let i=this.data[e+n],o=e+n+1>t|o<>>0)}getCompressionPoint(){return this.compressionPoint}getConnectionContext(){let e=this.dataBlockDataMap;return{compressionPoint:this.compressionPoint,ghostTracker:this.ghostTracker,getDataBlockParser:e=>this.registry.getDataBlockParser(e),getDataBlockData:e?t=>e.get(t):void 0,getGhostParser:e=>this.registry.getGhostParser(e)}}setNextRecvEventSeq(e){this.nextRecvEventSeq=e>>>0}setConnectionProtocolState(e){for(this.lastSeqRecvdAtSend=e.lastSeqRecvdAtSend.slice(0,32);this.lastSeqRecvdAtSend.length<32;)this.lastSeqRecvdAtSend.push(0);this.lastSeqRecvd=e.lastSeqRecvd>>>0,this.highestAckedSeq=e.highestAckedSeq>>>0,this.lastSendSeq=e.lastSendSeq>>>0,this.recvAckMask=e.ackMask>>>0,this.connectSequence=e.connectSequence>>>0,this.lastRecvAckAck=e.lastRecvAckAck>>>0,this.connectionEstablished=e.connectionEstablished}onSendPacketTrigger(){this.lastSendSeq=this.lastSendSeq+1>>>0,this.lastSeqRecvdAtSend[31&this.lastSendSeq]=this.lastSeqRecvd>>>0}applyProtocolHeader(e){if(e.connectSeqBit!==(1&this.connectSequence)||e.ackByteCount>4||e.packetType>2)return{accepted:!1,dispatchData:!1};let t=(e.seqNumber|0xfffffe00&this.lastSeqRecvd)>>>0;if(t>>0),this.lastSeqRecvd+31>>0;if(r>>0),this.lastSendSeq>>0,0===e.packetType&&(this.recvAckMask=(1|this.recvAckMask)>>>0);for(let t=this.highestAckedSeq+1;t<=r;t++)(e.ackMask&1<<(r-t&31))!=0&&(this.lastRecvAckAck=this.lastSeqRecvdAtSend[31&t]>>>0);t-this.lastRecvAckAck>32&&(this.lastRecvAckAck=t-32),this.highestAckedSeq=r;let n=this.lastSeqRecvd!==t&&0===e.packetType;return this.lastSeqRecvd=t,{accepted:!0,dispatchData:n}}parsePacket(e){let t=new uX(e),r=this.readDnetHeader(t),a=this.applyProtocolHeader(r);if(this.packetsParsed++,!a.accepted)return this.protocolRejected++,{dnetHeader:r,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};if(!a.dispatchData)return this.protocolNoDispatch++,{dnetHeader:r,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};let n=this.readRateInfo(t);t.setStringBuffer(!0);let i=this.readGameState(t),o=void 0===i.controlObjectDataStart||void 0!==i.controlObjectData,s=o?this.readEvents(t):[],l=s[s.length-1],u=!l||l.dataBitsEnd!==l.dataBitsStart,c=o&&u?t.getCurPos():void 0,d=o&&u?this.readGhosts(t,r.seqNumber):[];return t.setStringBuffer(!1),{dnetHeader:r,rateInfo:n,gameState:i,events:s,ghosts:d,ghostSectionStart:c}}readDnetHeader(e){let t=e.readFlag(),r=e.readInt(1),a=e.readInt(9),n=e.readInt(9),i=e.readInt(2),o=e.readInt(3),s=o>0?e.readInt(8*o):0;return{gameFlag:t,connectSeqBit:r,seqNumber:a,highestAck:n,packetType:i,ackByteCount:o,ackMask:s}}readRateInfo(e){let t={};return e.readFlag()&&(t.updateDelay=e.readInt(10),t.packetSize=e.readInt(10)),e.readFlag()&&(t.maxUpdateDelay=e.readInt(10),t.maxPacketSize=e.readInt(10)),t}readGameState(e){let t,r,a,n,i,o,s,l,u,c,d,f,h,m,p,g=e.readInt(32);e.readFlag()&&(e.readFlag()&&(t=e.readFloat(7)),e.readFlag()&&(r=1.5*e.readFloat(7))),e.readFlag()&&(a=e.readFlag(),n=e.readFlag()),e.readFlag()&&((i=e.readFlag())&&(o={x:e.readF32(),y:e.readF32(),z:e.readF32()}),1===(s=e.readRangedU32(0,2))?e.readFlag()&&(l=e.readRangedU32(0,1023)):2===s&&(u={x:e.readF32(),y:e.readF32(),z:e.readF32()}));let v=e.readFlag(),y=e.readFlag();if(e.readFlag())if(e.readFlag()){let p=e.readInt(10);c=p,d=e.getCurPos();let A=e.savePos(),F=this.ghostTracker.getGhost(p),b=F?this.registry.getGhostParser(F.classId):void 0,C=this.controlParserByGhostIndex.get(p),B=this.registry.getGhostParser(25),S=this.registry.getGhostParser(4),x=[],E=new Set,M=e=>{!e?.readPacketData||E.has(e.name)||(E.add(e.name),x.push(e))};M(b),M(C),M(B),M(S);let D=!1;for(let t of x){e.restorePos(A);try{let r=this.getConnectionContext(),a=t.readPacketData(e,r);if(e.getCurPos()-d<=0||e.isError())continue;h=a,f=e.getCurPos(),this.controlParserByGhostIndex.set(p,t),r.compressionPoint!==this.compressionPoint&&(this.compressionPoint=r.compressionPoint,m=this.compressionPoint),this.controlObjectParsed++,D=!0;break}catch{}}if(!D)return e.restorePos(A),f=d,this.controlObjectFailed++,{lastMoveAck:g,damageFlash:t,whiteOut:r,selfLocked:a,selfHomed:n,seekerTracking:i,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:u,pinged:v,jammed:y,controlObjectGhostIndex:c,controlObjectDataStart:d,controlObjectDataEnd:f,controlObjectData:h,targetVisibility:[]}}else m={x:e.readF32(),y:e.readF32(),z:e.readF32()},this.compressionPoint=m;let A=[];for(;e.readFlag();)A.push({index:e.readInt(4),mask:e.readInt(32)});return e.readFlag()&&(p=e.readInt(8)),{lastMoveAck:g,damageFlash:t,whiteOut:r,selfLocked:a,selfHomed:n,seekerTracking:i,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:u,pinged:v,jammed:y,controlObjectGhostIndex:c,controlObjectDataStart:d,controlObjectDataEnd:f,controlObjectData:h,compressionPoint:m,targetVisibility:A.length>0?A:void 0,cameraFov:p}}readEvents(e){let t=[],r=!0,a=-2;for(;;){let n,i,o,s=e.readFlag();if(r&&!s){if(r=!1,!e.readFlag()){this.dispatchGuaranteedEvents(t);break}}else if(r||s){if(!s)break}else{this.dispatchGuaranteedEvents(t);break}!r&&(a=n=e.readFlag()?a+1&127:e.readInt(7),(i=n|0xffffff80&this.nextRecvEventSeq)0&&this.pendingGuaranteedEvents[0].absoluteSequenceNumber===this.nextRecvEventSeq;){let t=this.pendingGuaranteedEvents.shift();if(!t)break;this.nextRecvEventSeq=this.nextRecvEventSeq+1>>>0,e.push(t.event),t.event.parsedData&&this.applyEventSideEffects(t.event.parsedData)}}applyEventSideEffects(e){let t=e.type;if("GhostingMessageEvent"===t){let t=e.message;"number"==typeof t&&2===t&&this.ghostTracker.clear();return}if("GhostAlwaysObjectEvent"===t){let t=e.ghostIndex,r=e.classId;if("number"==typeof t&&"number"==typeof r){let e=this.registry.getGhostParser(r);this.ghostTracker.createGhost(t,r,e?.name??`unknown_${r}`)}}"SimDataBlockEvent"===t&&this.dataBlockDataMap&&e.dataBlockData&&"number"==typeof e.objectId&&this.dataBlockDataMap.set(e.objectId,e.dataBlockData)}readGhosts(e,t){let r=[];if(!e.readFlag())return r;let a=e.readInt(3)+3;for(;e.readFlag();){let n;if(e.isError())break;let i=e.readInt(a);if(e.isError())break;if(e.readFlag()){this.ghostTracker.deleteGhost(i),this.ghostDeletes++,r.push({index:i,type:"delete",updateBitsStart:e.getCurPos(),updateBitsEnd:e.getCurPos()});continue}let o=!this.ghostTracker.hasGhost(i);n=o?e.readInt(7)+0:this.ghostTracker.getGhost(i)?.classId;let s=e.getCurPos(),l=void 0!==n?this.registry.getGhostParser(n):void 0;if(o&&!l){this.ghostsTrackerDiverged++,u0("DIVERGED pkt=%d seq=%d idx=%d classId=%d bit=%d/%d trackerSize=%d (server sent UPDATE for ghost not in our tracker; 7-bit classId is actually update data)",this.packetsParsed,t,i,n,s,e.getMaxPos(),this.ghostTracker.size()),r.push({index:i,type:"create",classId:n,updateBitsStart:s,updateBitsEnd:s});break}let u=!1;if(l)try{let t=this.getConnectionContext();t.currentGhostIndex=i;let a=l.unpackUpdate(e,o,t),c=e.getCurPos();o&&void 0!==n?(this.ghostTracker.createGhost(i,n,l.name),this.ghostCreatesParsed++):this.ghostUpdatesParsed++,r.push({index:i,type:o?"create":"update",classId:n,updateBitsStart:s,updateBitsEnd:c,parsedData:a}),u=!0}catch(c){this.ghostsFailed++;let a=o?"create":"update",u=c instanceof Error?c.message:String(c);u0("FAIL pkt=%d seq=%d #%d idx=%d op=%s classId=%d parser=%s bit=%d/%d trackerSize=%d err=%s",this.packetsParsed,t,r.length,i,a,n,l.name,s,e.getMaxPos(),this.ghostTracker.size(),u)}if(!u){u0("STOP pkt=%d seq=%d idx=%d op=%s classId=%d parser=%s bit=%d/%d",this.packetsParsed,t,i,o?"create":"update",n,l?.name??"NONE",s,e.getMaxPos()),r.push({index:i,type:o?"create":"update",classId:n,updateBitsStart:s,updateBitsEnd:s});break}}return r}emptyGameState(){return{lastMoveAck:0,pinged:!1,jammed:!1}}}class u2{eventParsers=new Map;ghostParsers=new Map;dataBlockParsers=new Map;eventCatalog=new Map;ghostCatalog=new Map;dataBlockCatalog=new Map;catalogEvent(e){this.eventCatalog.set(e.name,e)}catalogGhost(e){this.ghostCatalog.set(e.name,e)}catalogDataBlock(e){this.dataBlockCatalog.set(e.name,e)}bindDeterministicDataBlocks(e,t){let r=0,a=[];for(let n=0;n0&&(a.sounds=t)}if(e.readFlag()){let t=[];for(let r=0;r<4;r++)e.readFlag()&&t.push({index:r,sequence:e.readInt(5),state:e.readInt(2),forward:e.readFlag(),atEnd:e.readFlag()});t.length>0&&(a.threads=t)}let n=!1;if(e.readFlag()){let r=[];for(let a=0;a<8;a++)if(e.readFlag()){let i={index:a};e.readFlag()?i.dataBlockId=u5(e):i.dataBlockId=0,e.readFlag()&&(e.readFlag()?i.skinTagIndex=e.readInt(10):i.skinName=e.readString(),n=!0),i.wet=e.readFlag(),i.ammo=e.readFlag(),i.loaded=e.readFlag(),i.target=e.readFlag(),i.triggerDown=e.readFlag(),i.fireCount=e.readInt(3),t&&(i.imageExtraFlag=e.readFlag()),r.push(i)}r.length>0&&(a.images=r)}if(e.readFlag()){if(e.readFlag()){a.stateAEnabled=e.readFlag(),a.stateB=e.readFlag();let t=e.readFlag();a.hasInvulnerability=t,t?(a.invulnerabilityVisual=e.readFlag(),a.invulnerabilityTicks=e.readU32()):a.binaryCloak=e.readFlag()}if(e.readFlag())if(e.readFlag()){let t=e.readFlag();a.stateBMode=t,t?a.energyPackOn=!0:a.energyPackOn=!1}else a.shieldNormal=e.readNormalVector(8),a.energyPercent=e.readFloat(5);e.readFlag()&&(a.stateValue1=e.readU32(),a.stateValue2=e.readU32())}return n&&(a.imageSkinDirty=!0),e.readFlag()&&(e.readFlag()?(a.mountObject=e.readInt(10),a.mountNode=e.readInt(5)):a.mountObject=-1),a}function u4(e,t,r){let a=u6(e,t,r);if(e.readFlag()&&(a.impactSound=e.readInt(3)),e.readFlag()&&(a.action=e.readInt(8),a.actionHoldAtEnd=e.readFlag(),a.actionAtEnd=e.readFlag(),a.actionFirstPerson=e.readFlag(),!a.actionAtEnd&&e.readFlag()&&(a.actionAnimPos=e.readSignedFloat(6))),e.readFlag()&&(a.armAction=e.readInt(8)),e.readFlag())return a;if(e.readFlag()){if(a.actionState=e.readInt(3),e.readFlag()&&(a.recoverTicks=e.readInt(7)),a.moveFlag0=e.readFlag(),a.moveFlag1=e.readFlag(),a.position=e.readCompressedPoint(r.compressionPoint),e.readFlag()){let t=e.readInt(13)/32,r=e.readNormalVector(10);a.velocity={x:r.x*t,y:r.y*t,z:r.z*t}}else a.velocity={x:0,y:0,z:0};a.headX=e.readSignedFloat(6),a.headZ=e.readSignedFloat(6),a.rotationZ=2*e.readFloat(7)*Math.PI,a.move=u9(e),a.allowWarp=e.readFlag()}return a.energy=e.readFloat(5),a}function u7(e,t){let r={};if(r.energyLevel=e.readF32(),r.rechargeRate=e.readF32(),r.actionState=e.readInt(3),e.readFlag()&&(r.recoverTicks=e.readInt(7)),e.readFlag()&&(r.jumpDelay=e.readInt(7)),e.readFlag()){let a={x:e.readF32(),y:e.readF32(),z:e.readF32()};r.position=a,t.compressionPoint=a,r.velocity={x:e.readF32(),y:e.readF32(),z:e.readF32()},r.jumpSurfaceLastContact=e.readInt(4)}if(r.headX=e.readF32(),r.headZ=e.readF32(),r.rotationZ=e.readF32(),e.readFlag()){let a=e.readInt(10);r.controlObjectGhost=a;let n=t.ghostTracker.getGhost(a),i=n?t.getGhostParser?.(n.classId):void 0;if(i?.readPacketData){let n=t.currentGhostIndex;t.currentGhostIndex=a,r.controlObjectData=i.readPacketData(e,t),t.currentGhostIndex=n}}return r.disableMove=e.readFlag(),r.pilot=e.readFlag(),r}function ce(e,t,r){let a=u6(e,t,r);return(a.jetting=e.readFlag(),e.readFlag())?a._controlledEarlyReturn=!0:(a.steeringYaw=e.readFloat(9),a.steeringPitch=e.readFloat(9),a.move=u9(e),a.frozen=e.readFlag(),e.readFlag()&&(a.position=e.readCompressedPoint(r.compressionPoint),a.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},a.linMomentum=e.readPoint3F(),a.angMomentum=e.readPoint3F()),e.readFlag()&&(a.energy=e.readFloat(8))),a}function ct(e,t){let r={};r.energyLevel=e.readF32(),r.rechargeRate=e.readF32(),r.steering={x:e.readF32(),y:e.readF32()};let a={x:e.readF32(),y:e.readF32(),z:e.readF32()};return r.linPosition=a,r.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},r.linMomentum=e.readPoint3F(),r.angMomentum=e.readPoint3F(),r.disableMove=e.readFlag(),r.frozen=e.readFlag(),t.compressionPoint=a,r}function cr(e,t){let r=ct(e,t);r.braking=e.readFlag();let a=4,n=t.currentGhostIndex;if(void 0!==n){let e=cK.get(n);void 0!==e&&(a=e)}let i=[];for(let t=0;t64)throw Error(`Invalid Sky fogVolumeCount: ${t}`);a.fogVolumeCount=t,a.useSkyTextures=e.readBool(),a.renderBottomTexture=e.readBool(),a.skySolidColor={r:e.readF32(),g:e.readF32(),b:e.readF32()},a.windEffectPrecipitation=e.readBool();let r=[];for(let a=0;a3)throw Error(`Invalid precipitation colorCount: ${t}`);let r=[];for(let a=0;aMath.floor(e.getRemainingBits()/96))throw Error(`Invalid physicalZone point count: ${t}`);let r=[];for(let a=0;aMath.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone plane count: ${n}`);let i=[];for(let t=0;tMath.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone edge count: ${o}`);let s=[];for(let t=0;t0&&(r.audioData=e.readBitsBuffer(8*a)),r}function dn(e,t){return{type:"GhostingMessageEvent",sequence:e.readU32(),message:e.readInt(3),ghostCount:e.readInt(11)}}function di(e,t){let r={type:"GhostAlwaysObjectEvent"};r.ghostIndex=e.readInt(10);let a=e.readFlag();if(r._hasObjectData=a,a){let a=e.readInt(7);r.classId=a;let n=t.getGhostParser?.(a);if(!n)throw Error(`No ghost parser for GhostAlwaysObjectEvent classId=${a}`);r.objectData=n.unpackUpdate(e,!0,t)}return r}function ds(e,t){let r={type:"PathManagerEvent"};if(e.readFlag()){r.messageType="NewPaths";let t=e.readU32(),a=[];for(let r=0;r0&&(t.hudImages=r),t}function dB(e){let t={};e.readFlag()&&(t.crc=e.readU32()),t.shapeName=e.readString(),t.mountPoint=e.readU32(),e.readFlag()||(t.offset=e.readAffineTransform()),t.firstPerson=e.readFlag(),t.mass=e.readF32(),t.usesEnergy=e.readFlag(),t.minEnergy=e.readF32(),t.hasFlash=e.readFlag(),t.projectile=dv(e),t.muzzleFlash=dv(e),t.isSeeker=e.readFlag(),t.isSeeker&&(t.seekerRadius=e.readF32(),t.maxSeekAngle=e.readF32(),t.seekerLockTime=e.readF32(),t.seekerFreeTime=e.readF32(),t.isTargetLockRequired=e.readFlag(),t.maxLockRange=e.readF32()),t.cloakable=e.readFlag(),t.lightType=e.readRangedU32(0,3),0!==t.lightType&&(t.lightRadius=e.readF32(),t.lightTime=e.readS32(),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)}),t.shellExitDir={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.shellExitVariance=e.readF32(),t.shellVelocity=e.readF32(),t.casing=dv(e),t.accuFire=e.readFlag();let r=[];for(let t=0;t<31;t++){if(!e.readFlag())continue;let t={};t.name=e.readString(),t.transitionOnAmmo=e.readInt(5),t.transitionOnNoAmmo=e.readInt(5),t.transitionOnTarget=e.readInt(5),t.transitionOnNoTarget=e.readInt(5),t.transitionOnWet=e.readInt(5),t.transitionOnNotWet=e.readInt(5),t.transitionOnTriggerUp=e.readInt(5),t.transitionOnTriggerDown=e.readInt(5),t.transitionOnTimeout=e.readInt(5),t.transitionGeneric0In=e.readInt(5),t.transitionGeneric0Out=e.readInt(5),e.readFlag()&&(t.timeoutValue=e.readF32()),t.waitForTimeout=e.readFlag(),t.fire=e.readFlag(),t.ejectShell=e.readFlag(),t.scaleAnimation=e.readFlag(),t.direction=e.readFlag(),t.reload=e.readFlag(),e.readFlag()&&(t.energyDrain=e.readF32()),t.loaded=e.readInt(3),t.spin=e.readInt(3),t.recoil=e.readInt(3),e.readFlag()&&(t.sequence=e.readSignedInt(16)),e.readFlag()&&(t.sequenceVis=e.readSignedInt(16)),t.flashSequence=e.readFlag(),t.ignoreLoadedForReady=e.readFlag(),t.emitter=dv(e),null!==t.emitter&&(t.emitterTime=e.readF32(),t.emitterNode=e.readS32()),t.sound=dv(e),r.push(t)}return t.states=r,t}function dS(e){let t=dC(e);t.renderFirstPerson=e.readFlag(),t.minLookAngle=e.readF32(),t.maxLookAngle=e.readF32(),t.maxFreelookAngle=e.readF32(),t.maxTimeScale=e.readF32(),t.maxStepHeight=e.readF32(),t.runForce=e.readF32(),t.runEnergyDrain=e.readF32(),t.minRunEnergy=e.readF32(),t.maxForwardSpeed=e.readF32(),t.maxBackwardSpeed=e.readF32(),t.maxSideSpeed=e.readF32(),t.maxUnderwaterForwardSpeed=e.readF32(),t.maxUnderwaterBackwardSpeed=e.readF32(),t.maxUnderwaterSideSpeedRef=dv(e),e.readFlag()&&(t.runSurfaceAngleRef=e.readInt(11)),t.runSurfaceAngle=e.readF32(),t.recoverDelay=e.readF32(),t.recoverRunForceScale=e.readF32(),t.jumpForce=e.readF32(),t.jumpEnergyDrain=e.readF32(),t.minJumpEnergy=e.readF32(),t.minJumpSpeed=e.readF32(),t.maxJumpSpeed=e.readF32(),t.jumpSurfaceAngle=e.readF32(),t.minJetEnergy=e.readF32(),t.splashVelocity=e.readF32(),t.splashAngle=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.bubbleEmitTime=e.readF32(),t.medSplashSoundVel=e.readF32(),t.hardSplashSoundVel=e.readF32(),t.exitSplashSoundVel=e.readF32(),t.jumpDelay=e.readInt(7),t.horizMaxSpeed=e.readF32(),t.horizResistSpeed=e.readF32(),t.horizResistFactor=e.readF32(),t.upMaxSpeed=e.readF32(),t.upResistSpeed=e.readF32(),t.upResistFactor=e.readF32(),t.jetEnergyDrain=e.readF32(),t.canJet=e.readF32(),t.maxJetHorizontalPercentage=e.readF32(),t.maxJetForwardSpeed=e.readF32(),t.jetForce=e.readF32(),t.minJetSpeed=e.readF32(),t.maxDamage=e.readF32(),t.minImpactDamageSpeed=e.readF32(),t.impactDamageScale=e.readF32(),t.footSplashHeight=e.readF32();let r=[];for(let t=0;t<32;t++)e.readFlag()?r.push(e.readInt(11)):r.push(null);t.sounds=r,t.boxSize={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.footPuffEmitter=dv(e),t.footPuffNumParts=e.readF32(),t.footPuffRadius=e.readF32(),t.decalData=dv(e),t.decalOffset=e.readF32(),t.dustEmitter=dv(e),t.splash=dv(e);let a=[];for(let t=0;t<3;t++)a.push(dv(e));return t.splashEmitters=a,t.groundImpactMinSpeed=e.readF32(),t.groundImpactShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeDuration=e.readF32(),t.groundImpactShakeFalloff=e.readF32(),t.boundingRadius=e.readF32(),t.moveBubbleSize=e.readF32(),t}function dx(e){let t=dC(e);t.bodyRestitution=e.readF32(),t.bodyFriction=e.readF32();let r=[];for(let t=0;t<2;t++)r.push(dv(e));t.impactSounds=r,t.minImpactSpeed=e.readF32(),t.softImpactSpeed=e.readF32(),t.hardImpactSpeed=e.readF32(),t.minRollSpeed=e.readF32(),t.maxSteeringAngle=e.readF32(),t.maxDrag=e.readF32(),t.minDrag=e.readF32(),t.cameraOffset=e.readF32(),t.cameraLag=e.readF32(),t.jetForce=e.readF32(),t.jetEnergyDrain=e.readF32(),t.minJetEnergy=e.readF32(),t.integration=e.readF32(),t.collisionTol=e.readF32(),t.massCenter=e.readF32(),t.exitSplashSoundVelocity=e.readF32(),t.softSplashSoundVelocity=e.readF32(),t.mediumSplashSoundVelocity=e.readF32(),t.hardSplashSoundVelocity=e.readF32();let a=[];for(let t=0;t<5;t++)a.push(dv(e));t.waterSounds=a,t.dustEmitter=dv(e);let n=[];for(let t=0;t<3;t++)n.push(dv(e));t.damageEmitters=n;let i=[];for(let t=0;t<2;t++)i.push(dv(e));return t.splashEmitters=i,t.damageEmitterOffset0={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageEmitterOffset1={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageLevelTolerance0=e.readF32(),t.damageLevelTolerance1=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.collDamageThresholdVel=e.readF32(),t.collDamageMultiplier=e.readF32(),t}function dE(e){let t=dx(e);t.jetActivateSound=dv(e),t.jetDeactivateSound=dv(e);let r=[];for(let t=0;t<4;t++)r.push(dv(e));return t.jetEmitters=r,t.maneuveringForce=e.readF32(),t.horizontalSurfaceForce=e.readF32(),t.verticalSurfaceForce=e.readF32(),t.autoInputDamping=e.readF32(),t.steeringForce=e.readF32(),t.steeringRollForce=e.readF32(),t.rollForce=e.readF32(),t.autoAngularForce=e.readF32(),t.rotationalDrag=e.readF32(),t.maxAutoSpeed=e.readF32(),t.autoLinearForce=e.readF32(),t.hoverHeight=e.readF32(),t.createHoverHeight=e.readF32(),t.minTrailSpeed=e.readF32(),t.vertThrustMultiple=e.readF32(),t.maxForwardSpeed=e.readF32(),t}function dM(e){let t=dx(e);t.dragForce=e.readF32(),t.mainThrustForce=e.readF32(),t.reverseThrustForce=e.readF32(),t.strafeThrustForce=e.readF32(),t.turboFactor=e.readF32(),t.stabLenMin=e.readF32(),t.stabLenMax=e.readF32(),t.stabSpringConstant=e.readF32(),t.stabDampingConstant=e.readF32(),t.gyroDrag=e.readF32(),t.normalForce=e.readF32(),t.restorativeForce=e.readF32(),t.steeringForce=e.readF32(),t.rollForce=e.readF32(),t.pitchForce=e.readF32(),t.floatingThrustFactor=e.readF32(),t.brakingForce=e.readF32(),t.dustTrailOffset={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.dustTrailFreqMod=e.readF32(),t.triggerTrailHeight=e.readF32(),t.floatSound=dv(e),t.thrustSound=dv(e),t.turboSound=dv(e);let r=[];for(let t=0;t<3;t++)r.push(dv(e));return t.jetEmitters=r,t.dustTrailEmitter=dv(e),t.mainThrustEmitterFactor=e.readF32(),t.strafeThrustEmitterFactor=e.readF32(),t.reverseThrustEmitterFactor=e.readF32(),t}function dD(e){let t=dx(e);return t.tireRadius=e.readF32(),t.tireStaticFriction=e.readF32(),t.tireKineticFriction=e.readF32(),t.tireRestitution=e.readF32(),t.tireLateralForce=e.readF32(),t.tireLateralDamping=e.readF32(),t.tireLateralRelaxation=e.readF32(),t.tireLongitudinalForce=e.readF32(),t.tireLongitudinalDamping=e.readF32(),t.tireEmitter=dv(e),t.jetSound=dv(e),t.engineSound=dv(e),t.squealSound=dv(e),t.wadeSound=dv(e),t.spring=e.readF32(),t.springDamping=e.readF32(),t.springLength=e.readF32(),t.brakeTorque=e.readF32(),t.engineTorque=e.readF32(),t.engineBrake=e.readF32(),t.maxWheelSpeed=e.readF32(),t.steeringAngle=e.readF32(),t.steeringReturn=e.readF32(),t.steeringDamping=e.readF32(),t.powerSteeringFactor=e.readF32(),t}function dk(e){let t=dC(e);return t.noIndividualDamage=e.readFlag(),t.dynamicTypeField=e.readS32(),t}function dI(e){let t=dk(e);return t.thetaMin=e.readF32(),t.thetaMax=e.readF32(),t.thetaNull=e.readF32(),t.neverUpdateControl=e.readFlag(),t.primaryAxis=e.readRangedU32(0,3),t.maxCapacitorEnergy=e.readF32(),t.capacitorRechargeRate=e.readF32(),t}function dw(e){let t=dB(e);return t.activationMS=e.readInt(8),t.deactivateDelayMS=e.readInt(8),t.degPerSecTheta=e.readRangedU32(0,1080),t.degPerSecPhi=e.readRangedU32(0,1080),t.dontFireInsideDamageRadius=e.readFlag(),t.damageRadius=e.readF32(),t.useCapacitor=e.readFlag(),t}function dT(e){let t=dC(e);return t.friction=e.readFloat(10),t.elasticity=e.readFloat(10),t.sticky=e.readFlag(),e.readFlag()&&(t.gravityMod=e.readFloat(10)),e.readFlag()&&(t.maxVelocity=e.readF32()),e.readFlag()&&(t.lightType=e.readInt(2),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)},t.lightTime=e.readS32(),t.lightRadius=e.readF32(),t.lightOnlyStatic=e.readFlag()),t}function dR(e){let t={};t.projectileShapeName=e.readString(),t.faceViewerLinkTime=e.readS32(),t.lifetime=e.readS32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.scale={x:e.readF32(),y:e.readF32(),z:e.readF32()}),t.activateEmitter=dv(e),t.maintainEmitter=dv(e),t.activateSound=dv(e),t.maintainSound=dv(e),t.explosion=dv(e),t.splash=dv(e),t.bounceExplosion=dv(e),t.bounceSound=dv(e),t.underwaterExplosion=dv(e);let r=[];for(let t=0;t<6;t++)r.push(dv(e));return t.decals=r,e.readFlag()&&(t.lightRadius=e.readFloat(8),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),e.readFlag()&&(t.underwaterLightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),t.explodeOnWaterImpact=dF(e),t.depthTolerance=e.readF32(),t}function dP(e){let t=dR(e);return t.dryVelocity=e.readF32(),t.wetVelocity=e.readF32(),t.fizzleTime=e.readU32(),t.fizzleType=e.readU32(),t.hardRetarget=e.readFlag(),t.inheritedVelocityScale=e.readRangedU32(0,90),t.lifetimeMS=e.readRangedU32(0,90),t.collideWithOwnerTimeMS=e.readU32(),t.proximityRadius=e.readU32(),t.tracerProjectile=e.readFlag(),t}function dG(e){let t=dR(e);return t.grenadeElasticity=e.readS32(),t.grenadeFriction=e.readF32(),t.dragCoefficient=e.readF32(),t.windCoefficient=e.readF32(),t.gravityMod=e.readF32(),t.muzzleVelocity=e.readF32(),t.drag=e.readF32(),t.lifetimeMS=e.readS32(),t}function dL(e){let t=dR(e);return t.lifetimeMS=e.readS32(),t.muzzleVelocity=e.readF32(),t.turningSpeed=e.readF32(),t.proximityRadius=e.readF32(),t.terrainAvoidanceSpeed=e.readF32(),t.terrainScanAhead=e.readF32(),t.terrainHeightFail=e.readF32(),t.terrainAvoidanceRadius=e.readF32(),t.flareDistance=e.readF32(),t.flareAngle=e.readF32(),t.useFlechette=dF(e),t.maxVelocity=e.readF32(),t.acceleration=e.readF32(),t.flechetteDelayMs=e.readS32(),t.exhaustTimeMs=e.readS32(),t.exhaustNodeName=e.readString(),t.casingShapeName=e.readString(),t.casingDebris=dv(e),t.puffEmitter=dv(e),t.exhaustEmitter=dv(e),t}function dj(e){let t=dR(e);t.maxRifleRange=e.readF32(),t.rifleHeadMultiplier=e.readF32(),t.beamColor=dA(e),t.fadeTime=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32(),t.lightColor=dA(e),t.lightRadius=e.readF32();let r=[];for(let t=0;t<12;t++)r.push(e.readString());return t.textures=r,t}function d_(e){let t=dR(e);t.zapDuration=e.readF32(),t.boltLength=e.readF32(),t.numParts=e.readF32(),t.lightningFreq=e.readF32(),t.lightningDensity=e.readF32(),t.lightningAmp=e.readF32(),t.lightningWidth=e.readF32(),t.shockwave=dv(e);let r=[],a=[],n=[],i=[];for(let t=0;t<2;t++)r.push(e.readF32()),a.push(e.readF32()),n.push(e.readF32()),i.push(e.readF32());t.startWidth=r,t.endWidth=a,t.boltSpeed=n,t.texWrap=i;let o=[];for(let t=0;t<4;t++)o.push(e.readString());return t.textures=o,t.emitter=dv(e),t}function dO(e){let t=dR(e);return t.beamRange=e.readF32(),t.beamDrainRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t.flareTexture=e.readString(),t.hitEmitter=dv(e),t}function dU(e){let t=dR(e);return t.beamRange=e.readF32(),t.beamRepairRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t}function dH(e){let t=dR(e);t.maxRifleRange=e.readF32(),t.beamColor=dA(e),t.startBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32();let r=[];for(let t=0;t<4;t++)r.push(e.readString());return t.textures=r,t}function dN(e){let t=dP(e);return t.tracerLength=e.readF32(),t.tracerAlpha=e.readF32(),t.tracerMinPixels=e.readF32(),t.crossViewFraction=dF(e),t.tracerColor=dA(e),t.tracerWidth=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=dF(e),t.textureName0=e.readString(),t.textureName1=e.readString(),t}function dJ(e){let t=dG(e);return t.energyDrainPerSecond=e.readF32(),t.energyMinDrain=e.readF32(),t.beamWidth=e.readF32(),t.beamRange=e.readF32(),t.numSegments=e.readF32(),t.texRepeat=e.readF32(),t.beamFlareAngle=e.readF32(),t.beamTexture=e.readString(),t.flareTexture=e.readString(),t}function dK(e){let t=dP(e);return t.numFlares=e.readF32(),t.flareColor=dA(e),t.flareTexture=e.readString(),t.smokeTexture=e.readString(),t.size=e.readF32(),t.flareModTexture=e.readF32(),t.smokeSize=e.readF32(),t}function dV(e){let t=dG(e);return t.smokeDist=e.readF32(),t.noSmoke=e.readF32(),t.boomTime=e.readF32(),t.casingDist=e.readF32(),t.smokeCushion=e.readF32(),t.noSmokeCounter=e.readF32(),t.smokeTexture=e.readString(),t.bombTexture=e.readString(),t}function dz(e){let t=dG(e);return t.size=e.readF32(),t.useLensFlare=dF(e),t.flareTexture=e.readString(),t.lensFlareTexture=e.readString(),t}function dq(e){let t={};t.dtsFileName=e.readString(),t.soundProfile=dv(e),t.particleEmitter=dv(e),t.particleDensity=e.readInt(14),t.particleRadius=e.readF32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.explosionScale={x:e.readInt(16),y:e.readInt(16),z:e.readInt(16)}),t.playSpeed=e.readInt(14),t.debrisThetaMin=e.readRangedU32(0,180),t.debrisThetaMax=e.readRangedU32(0,180),t.debrisPhiMin=e.readRangedU32(0,360),t.debrisPhiMax=e.readRangedU32(0,360),t.debrisMinVelocity=e.readRangedU32(0,1e3),t.debrisMaxVelocity=e.readRangedU32(0,1e3),t.debrisNum=e.readInt(14),t.debrisVariance=e.readRangedU32(0,1e4),t.delayMS=e.readInt(16),t.delayVariance=e.readInt(16),t.lifetimeMS=e.readInt(16),t.lifetimeVariance=e.readInt(16),t.offset=e.readF32(),t.shakeCamera=e.readFlag(),t.hasLight=e.readFlag(),t.camShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeDuration=e.readF32(),t.camShakeRadius=e.readF32(),t.camShakeFalloff=e.readF32(),t.shockwave=dv(e),t.debris=dv(e);let r=[];for(let t=0;t<4;t++)r.push(dv(e));t.emitters=r;let a=[];for(let t=0;t<5;t++)a.push(dv(e));t.subExplosions=a;let n=e.readRangedU32(0,4),i=[];for(let t=0;t0&&fh("DataBlock binding: %d/%d bound, missing parsers: %s",t,uY.length,r.join(", "));const{bound:a,missing:n}=this.registry.bindDeterministicGhosts(uZ,0);n.length>0&&fh("Ghost binding: %d/%d bound, missing parsers: %s",a,uZ.length,n.join(", "));const{bound:i,missing:o}=this.registry.bindDeterministicEvents(u$,255);o.length>0&&fh("Event binding: %d/%d bound, missing parsers: %s",i,u$.length,o.join(", ")),this.packetParser=new u1(this.registry,this.ghostTracker)}getRegistry(){return this.registry}getGhostTracker(){return this.ghostTracker}getPacketParser(){return this.packetParser}get loaded(){return this._loaded}get header(){if(!this._loaded)throw Error("must call load() first");return this._header}get initialBlock(){if(!this._loaded)throw Error("must call load() first");return this._initialBlock}get blockCount(){if(!this._loaded)throw Error("must call load() first");if(void 0===this._blockCount){let e=this._decompressedData,t=this._decompressedView,r=0,a=0;for(;a+2<=e.length;){let n=4095&t.getUint16(a,!0);if((a+=2+n)>e.length)break;r++}this._blockCount=r}return this._blockCount}get blockCursor(){if(!this._loaded)throw Error("must call load() first");return this._blockCursor}async load(){if(this._loaded)return{header:this._header,initialBlock:this._initialBlock};let e=this.readHeader();fh('header: "%s" version=0x%s length=%dms (%smin) initialBlockSize=%d',e.identString,e.protocolVersion.toString(16),e.demoLengthMs,(e.demoLengthMs/1e3/60).toFixed(1),e.initialBlockSize);let t=this.buffer.subarray(this.offset,this.offset+e.initialBlockSize),r=this.readInitialBlock(t);this.offset+=e.initialBlockSize;let a=this.buffer.subarray(this.offset);fh("compressed block stream: %d bytes",a.length);let n=await new Promise((e,t)=>{var r,n;r=(r,a)=>{r?t(r):e(a)},n||(n=r,r={}),"function"!=typeof n&&l_(7),ur(a,r,[l8],function(e){return ue(ub(e.data[0],ut(e.data[1])))},1,n)});return fh("decompressed block stream: %d bytes",n.length),this._decompressedData=n,this._decompressedView=new DataView(n.buffer,n.byteOffset,n.byteLength),this.setupPacketParser(r),this._header=e,this._initialBlock=r,this._blockStreamOffset=0,this._blockCursor=0,this._loaded=!0,{header:e,initialBlock:r}}nextBlock(){if(!this._loaded)throw Error("must call load() first");let e=this._decompressedData,t=this._decompressedView,r=this._blockStreamOffset;if(r+2>e.length)return;let a=t.getUint16(r,!0),n=a>>12,i=4095&a;if(r+2+i>e.length)return void fp("block %d: size %d would exceed decompressed data (offset=%d remaining=%d), stopping",this._blockCursor,i,r+2,e.length-r-2);let o=e.subarray(r+2,r+2+i);this._blockStreamOffset=r+2+i;let s={index:this._blockCursor,type:n,size:i,data:o};if(this._blockCursor++,0===n)try{s.parsed=this.packetParser.parsePacket(o)}catch{}else if(1===n)this.packetParser.onSendPacketTrigger();else if(2===n&&64===i)try{s.parsed=this.readRawMove(o)}catch{}else if(3===n&&8===i)try{s.parsed=this.readInfoBlock(o)}catch{}return s}reset(){if(!this._loaded)throw Error("must call load() first");this._blockStreamOffset=0,this._blockCursor=0,this._blockCount=void 0,this.setupPacketParser(this._initialBlock)}processBlocks(e){if(!this._loaded)throw Error("must call load() first");let t=0;for(let r=0;r=128&&t<128+uY.length?uY[t-128]:`unknown(${t})`;throw Error(`No parser for DataBlock classId ${t} (${e}) at bit ${i}`)}}fh("all %d/%d DataBlocks parsed (%d payloads), bit position after DataBlocks: %d",l,i,s.size,a.getCurPos());let u=a.readU8(),c=[];for(let e=0;e<6;e++)c.push(a.readU32());let d=[];for(let e=0;e<16;e++)d.push(a.readU32());let f=a.readU32(),h=[];for(let e=0;e>3<<3),this.readSimpleTargetManager(a),this.readSimpleTargetManager(a),fm('after sequential tail bit=%d mission="%s" CRC=0x%s',a.getCurPos(),I,w.toString(16))}catch(e){r=e instanceof Error?e.message:String(e)}finally{this.ghostTracker=S}let T=C-a.getCurPos(),R=I.length>0?I.split("").filter(e=>{let t=e.charCodeAt(0);return t>=32&&t<=126}).length/I.length:1,P=I.length>0&&R>=.8&&void 0===r;return fh('initial block: events=%d ghosts=%d ghostingSeq=%d controlObj=%d mission="%s" CRC=0x%s valid=%s%s',x.length,D.length,M,k,I,w.toString(16),P,r?` error=${r}`:""),{taggedStrings:n,dataBlockHeaders:o,dataBlockCount:l,dataBlocks:s,demoSetting:u,connectionFields:c,stateArray:d,scoreEntries:h,demoValues:m,sensorGroupColors:p,targetEntries:g,connectionState:v,roundTripTime:y,packetLoss:A,pathManager:F,notifyCount:b,nextRecvEventSeq:E,ghostingSequence:M,initialGhosts:D,initialEvents:x,controlObjectGhostIndex:k,controlObjectData:t,missionName:I,missionCRC:w,phase2TrailingBits:T,phase2Valid:P,phase2Error:r}}readScoreEntry(e){let t=e.readFlag()?e.readInt(16):0,r=e.readFlag()?e.readInt(16):0,a=e.readFlag()?e.readInt(16):0,n=e.readInt(6),i=e.readInt(6),o=e.readInt(6),s=e.readFlag(),l=[];for(let t=0;t<6;t++)l.push(e.readFlag());return{clientId:t,teamId:r,score:a,field0:n,field1:i,field2:o,isBot:s,triggerFlags:l}}readDemoValues(e){let t=[];for(;e.readFlag();)t.push(e.readString());return t}readComplexTargetManager(e){e.readU8(),e.readU8(),e.readU8(),e.readU8();let t=[];for(let r=0;r<32;r++)for(let a=0;a<32;a++)e.readFlag()&&t.push({group:r,targetGroup:a,r:e.readU8(),g:e.readU8(),b:e.readU8(),a:e.readU8()});let r=[];for(let t=0;t<512;t++){if(!e.readFlag())continue;let a={targetId:t,sensorGroup:0,targetData:0,damageLevel:0};e.readFlag()&&(a.sensorData=e.readU32()),e.readFlag()&&(a.voiceMapData=e.readU32()),e.readFlag()&&(a.name=e.readString()),e.readFlag()&&(a.skin=e.readString()),e.readFlag()&&(a.skinPref=e.readString()),e.readFlag()&&(a.voice=e.readString()),e.readFlag()&&(a.typeDescription=e.readString()),a.sensorGroup=e.readInt(5),a.targetData=e.readInt(9),t>=32&&e.readFlag()&&(a.dataBlockRef=e.readInt(11)),a.damageLevel=e.readFloat(7),r.push(a)}return{sensorGroupColors:t,targets:r}}readPathManager(e){let t=[],r=e.readU32();for(let a=0;athis.registry.getDataBlockParser(e)};t=i.unpack(e,r)}catch{r.push({classId:a,guaranteed:!0,dataBitsStart:n,dataBitsEnd:n});break}else{r.push({classId:a,guaranteed:!0,dataBitsStart:n,dataBitsEnd:n});break}r.push({classId:a,guaranteed:!0,dataBitsStart:n,dataBitsEnd:e.getCurPos(),parsedData:t}),fm(" event classId=%d bits=%d",a,e.getCurPos()-n)}return{nextRecvEventSeq:t,events:r}}readGhostStartBlock(e,t){let r=e.readU32(),a=[];fm("ghost block: seq=%d bit=%d",r,e.getCurPos());let n=this.registry.getGhostCatalog(),i=8*e.getBuffer().length,o=new Map;for(let[e,r]of t)o.set(e,r.data);for(;e.readFlag()&&!e.isError();){let r=e.readInt(10),s=e.readInt(7)+0,l=e.getCurPos(),u=[],c=new Set,{entry:d}=this.identifyGhostViaDataBlock(e,t,n),f=this.registry.getGhostParser(s);f&&(u.push({entry:f,method:"registry"}),c.add(f)),d&&!c.has(d)&&(u.push({entry:d,method:"datablock"}),c.add(d));let h={getDataBlockData:e=>o.get(e),getDataBlockParser:e=>this.registry.getDataBlockParser(e)},m=!1;for(let{entry:t,method:n}of u){let o="registry"===n,u=this.tryGhostParser(e,t,l,i,!1,h,o);if(!1!==u){this.ghostTracker.createGhost(r,s,t.name),fm(" ghost idx=%d classId=%d parser=%s bits=%d via=%s",r,s,t.name,e.getCurPos()-l,n),a.push({index:r,type:"create",classId:s,updateBitsStart:l,updateBitsEnd:e.getCurPos(),parsedData:u}),m=!0;break}}if(!m){fm(" ghost idx=%d classId=%d NO PARSER (stopping at bit=%d, remaining=%d)",r,s,l,i-l);break}}return fm("ghost loop ended at bit=%d remaining=%d count=%d",e.getCurPos(),i-e.getCurPos(),a.length),{ghostingSequence:r,ghosts:a}}tryGhostParser(e,t,r,a,n=!1,i,o=!1){let s=e.savePos();n||fm(" try %s: startBit=%d",t.name,r);try{let l=t.unpackUpdate(e,!0,{compressionPoint:{x:0,y:0,z:0},ghostTracker:this.ghostTracker,...i}),u=e.getCurPos()-r,c=a-e.getCurPos();if(e.isError()||!o&&u<3)return n||fm(" reject %s: bits=%d isError=%s",t.name,u,e.isError()),e.restorePos(s),!1;if(c>1e3){let r=e.getCurPos(),a=e.readFlag();if(e.setCurPos(r),!a)return n||fm(" reject %s: bits=%d misaligned (remaining=%d)",t.name,u,c),e.restorePos(s),!1}return l??{}}catch(r){return n||fm(" reject %s: error at bit=%d: %s",t.name,e.getCurPos(),r instanceof Error?r.message:String(r)),e.restorePos(s),!1}}identifyGhostViaDataBlock(e,t,r){let a;if(!t)return{entry:void 0,dbFlag:!1};let n=e.savePos(),i=!1;try{if(i=e.readFlag()){let n=e.readInt(11),i=t.get(n);if(i){let e=i.className.replace(/Data$/,"");(a=r.get(e))||fm(" identifyGhostViaDataBlock: dbId=%d className=%s ghostName=%s (no ghost parser)",n,i.className,e)}else fm(" identifyGhostViaDataBlock: dbId=%d (no DataBlock found)",n)}else fm(" identifyGhostViaDataBlock: DataBlock flag=0")}catch{}return e.restorePos(n),{entry:a,dbFlag:i}}readRawMove(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getInt32(0,!0),a=t.getInt32(4,!0),n=t.getInt32(8,!0),i=t.getUint32(12,!0),o=t.getUint32(16,!0),s=t.getUint32(20,!0),l=t.getFloat32(24,!0),u=t.getFloat32(28,!0),c=t.getFloat32(32,!0),d=t.getFloat32(36,!0),f=t.getFloat32(40,!0),h=t.getFloat32(44,!0),m=t.getUint32(48,!0),p=t.getUint32(52,!0),g=0!==e[56],v=[];for(let t=0;t<6;t++)v.push(0!==e[57+t]);return{px:r,py:a,pz:n,pyaw:i,ppitch:o,proll:s,x:l,y:u,z:c,yaw:d,pitch:f,roll:h,id:m,sendCount:p,freeLook:g,trigger:v}}readInfoBlock(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{value1:t.getUint32(0,!0),value2:t.getFloat32(4,!0)}}}let fv=Object.freeze({r:0,g:255,b:0}),fy=Object.freeze({r:255,g:0,b:0}),fA=new Set(["FlyingVehicle","HoverVehicle","WheeledVehicle"]),fF=new Set(["BombProjectile","EnergyProjectile","FlareProjectile","GrenadeProjectile","LinearFlareProjectile","LinearProjectile","Projectile","SeekerProjectile","TracerProjectile"]),fb=new Set(["LinearProjectile","TracerProjectile","LinearFlareProjectile","Projectile"]),fC=new Set(["GrenadeProjectile","EnergyProjectile","FlareProjectile","BombProjectile"]),fB=new Set(["SeekerProjectile"]),fS=new Set(["StaticShape","ScopeAlwaysShape","Turret","BeaconObject","ForceFieldBare"]),fx=new Set(["TSStatic","InteriorInstance","TerrainBlock","Sky","Sun","MissionArea","PhysicalZone","MissionMarker","SpawnSphere","VehicleBlocker","Camera"]),fE=.494*Math.PI,fM=new u.Matrix4,fD=new u.Quaternion;function fk(e){return null!=e&&Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function fI(e,t,r){return er?r:e}function fw(e){let t=-e/2;return[0,Math.sin(t),0,Math.cos(t)]}function fT(e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||!Number.isFinite(e.z)||!Number.isFinite(e.w))return null;let t=-e.y,r=-e.z,a=-e.x,n=e.w,i=t*t+r*r+a*a+n*n;if(i<=1e-12)return null;let o=1/Math.sqrt(i);return[t*o,r*o,a*o,n*o]}function fR(e){let t="";for(let r=0;r=32&&(t+=e[r]);return t}function fP(e){return"Player"===e?"Player":fA.has(e)?"Vehicle":"Item"===e?"Item":fF.has(e)?"Projectile":fS.has(e)?"Deployable":"Ghost"}function fG(e,t){return"Player"===e?`player_${t}`:fA.has(e)?`vehicle_${t}`:"Item"===e?`item_${t}`:fF.has(e)?`projectile_${t}`:fS.has(e)?`deployable_${t}`:`ghost_${t}`}function fL(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z&&"number"==typeof e.w}function fj(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z}function f_(e){if(e){for(let t of[e.shapeName,e.projectileShapeName,e.shapeFileName,e.shapeFile,e.model])if("string"==typeof t&&t.length>0)return t}}function fO(e,t){if(e)for(let r of t){let t=e[r];if("number"==typeof t&&Number.isFinite(t))return t}}function fU(e,t){if(e)for(let r of t){let t=e[r];if("string"==typeof t&&t.length>0)return t}}function fH(e){return e?"number"==typeof e.cameraMode?"camera":"number"==typeof e.rotationZ?"player":null:null}class fN{parser;initialBlock;registry;netStrings=new Map;targetNames=new Map;targetTeams=new Map;sensorGroupColors=new Map;state;constructor(e){this.parser=e,this.registry=e.getRegistry();const t=e.initialBlock;this.initialBlock={dataBlocks:t.dataBlocks,initialGhosts:t.initialGhosts,controlObjectGhostIndex:t.controlObjectGhostIndex,controlObjectData:t.controlObjectData,targetEntries:t.targetEntries,sensorGroupColors:t.sensorGroupColors,taggedStrings:t.taggedStrings},this.state={moveTicks:0,moveYawAccum:0,movePitchAccum:0,yawOffset:0,pitchOffset:0,lastAbsYaw:0,lastAbsPitch:0,lastControlType:"player",isPiloting:!1,lastOrbitDistance:void 0,exhausted:!1,latestFov:100,latestControl:{ghostIndex:t.controlObjectGhostIndex,data:t.controlObjectData,position:fk(t.controlObjectData?.position)?t.controlObjectData?.position:void 0},camera:null,entitiesById:new Map,entityIdByGhostIndex:new Map,lastStatus:{health:1,energy:1},nextExplosionId:0,playerSensorGroup:0},this.reset()}reset(){for(let[e,t]of(this.parser.reset(),this.netStrings.clear(),this.targetNames.clear(),this.targetTeams.clear(),this.sensorGroupColors.clear(),this.state.entitiesById.clear(),this.state.entityIdByGhostIndex.clear(),this.initialBlock.taggedStrings))this.netStrings.set(e,t);for(let e of this.initialBlock.targetEntries)e.name&&this.targetNames.set(e.targetId,fR(e.name)),this.targetTeams.set(e.targetId,e.sensorGroup);for(let e of this.initialBlock.sensorGroupColors){let t=this.sensorGroupColors.get(e.group);t||(t=new Map,this.sensorGroupColors.set(e.group,t)),t.set(e.targetGroup,{r:e.r,g:e.g,b:e.b})}if(this.state.playerSensorGroup=0,this.state.moveTicks=0,this.state.moveYawAccum=0,this.state.movePitchAccum=0,this.state.yawOffset=0,this.state.pitchOffset=0,this.state.lastAbsYaw=0,this.state.lastAbsPitch=0,this.state.lastControlType=fH(this.initialBlock.controlObjectData)??"player",this.state.isPiloting="player"===this.state.lastControlType&&!!(this.initialBlock.controlObjectData?.pilot||this.initialBlock.controlObjectData?.controlObjectGhost!=null),this.state.lastCameraMode="camera"===this.state.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.cameraMode?this.initialBlock.controlObjectData.cameraMode:void 0,this.state.lastOrbitGhostIndex="camera"===this.state.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.orbitObjectGhostIndex?this.initialBlock.controlObjectData.orbitObjectGhostIndex:void 0,"camera"===this.state.lastControlType){let e=this.initialBlock.controlObjectData?.minOrbitDist,t=this.initialBlock.controlObjectData?.maxOrbitDist,r=this.initialBlock.controlObjectData?.curOrbitDist;"number"==typeof e&&"number"==typeof t&&Number.isFinite(e)&&Number.isFinite(t)?this.state.lastOrbitDistance=Math.max(0,t-e):"number"==typeof r&&Number.isFinite(r)?this.state.lastOrbitDistance=Math.max(0,r):this.state.lastOrbitDistance=void 0}else this.state.lastOrbitDistance=void 0;let e=this.getAbsoluteRotation(this.initialBlock.controlObjectData);for(let t of(e&&(this.state.lastAbsYaw=e.yaw,this.state.lastAbsPitch=e.pitch,this.state.yawOffset=e.yaw,this.state.pitchOffset=e.pitch),this.state.exhausted=!1,this.state.latestFov=100,this.state.latestControl={ghostIndex:this.initialBlock.controlObjectGhostIndex,data:this.initialBlock.controlObjectData,position:fk(this.initialBlock.controlObjectData?.position)?this.initialBlock.controlObjectData?.position:void 0},this.state.controlPlayerGhostId="player"===this.state.lastControlType&&this.initialBlock.controlObjectGhostIndex>=0?`player_${this.initialBlock.controlObjectGhostIndex}`:void 0,this.state.camera=null,this.state.lastStatus={health:1,energy:1},this.state.nextExplosionId=0,this.initialBlock.initialGhosts)){if("create"!==t.type||null==t.classId)continue;let e=this.registry.getGhostParser(t.classId)?.name??`ghost_${t.classId}`,r=fG(e,t.index),a={id:r,ghostIndex:t.index,className:e,spawnTick:0,type:fP(e),rotation:[0,0,0,1]};this.applyGhostData(a,t.parsedData),this.state.entitiesById.set(r,a),this.state.entityIdByGhostIndex.set(t.index,r)}if(0===this.state.playerSensorGroup&&"player"===this.state.lastControlType&&this.state.latestControl.ghostIndex>=0){let e=this.state.entityIdByGhostIndex.get(this.state.latestControl.ghostIndex),t=e?this.state.entitiesById.get(e):void 0;t?.sensorGroup!=null&&t.sensorGroup>0&&(this.state.playerSensorGroup=t.sensorGroup)}this.updateCameraAndHud()}getSnapshot(){return this.buildSnapshot()}getEffectShapes(){let e=new Set;for(let[,t]of this.initialBlock.dataBlocks){let r=t.data?.explosion;if(null==r)continue;let a=this.getDataBlockData(r),n=a?.dtsFileName;n&&e.add(n)}return[...e]}stepToTime(e,t=1/0){let r=Math.floor(1e3*(Number.isFinite(e)?Math.max(0,e):0)/32);r0&&(this.state.playerSensorGroup=t.sensorGroup)}if(r){let e=fH(r);if(e&&(this.state.lastControlType=e),"player"===this.state.lastControlType)this.state.isPiloting=!!(r.pilot||null!=r.controlObjectGhost);else if(this.state.isPiloting=!1,"number"==typeof r.cameraMode)if(this.state.lastCameraMode=r.cameraMode,3===r.cameraMode){"number"==typeof r.orbitObjectGhostIndex&&(this.state.lastOrbitGhostIndex=r.orbitObjectGhostIndex);let e=r.minOrbitDist,t=r.maxOrbitDist,a=r.curOrbitDist;"number"==typeof e&&"number"==typeof t&&Number.isFinite(e)&&Number.isFinite(t)?this.state.lastOrbitDistance=Math.max(0,t-e):"number"==typeof a&&Number.isFinite(a)&&(this.state.lastOrbitDistance=Math.max(0,a))}else this.state.lastOrbitGhostIndex=void 0,this.state.lastOrbitDistance=void 0}for(let e of t.events){let t=this.registry.getEventParser(e.classId)?.name;if("NetStringEvent"===t&&e.parsedData){let t=e.parsedData.id,r=e.parsedData.value;null!=t&&"string"==typeof r&&this.netStrings.set(t,r);continue}if("TargetInfoEvent"===t&&e.parsedData){let t=e.parsedData.targetId,r=e.parsedData.nameTag;if(null!=t&&null!=r){let e=this.netStrings.get(r);e&&this.targetNames.set(t,fR(e))}let a=e.parsedData.sensorGroup;null!=t&&null!=a&&this.targetTeams.set(t,a)}else if("SetSensorGroupEvent"===t&&e.parsedData){let t=e.parsedData.sensorGroup;null!=t&&(this.state.playerSensorGroup=t)}else if("SensorGroupColorEvent"===t&&e.parsedData){let t=e.parsedData.sensorGroup,r=e.parsedData.colors;if(r){let e=this.sensorGroupColors.get(t);for(let a of(e||(e=new Map,this.sensorGroupColors.set(t,e)),r))a.default?e.delete(a.index):e.set(a.index,{r:a.r??0,g:a.g??0,b:a.b??0})}}}for(let e of t.ghosts)this.applyPacketGhost(e);return}if(3===e.type&&this.isInfoData(e.parsed)){Number.isFinite(e.parsed.value2)&&(this.state.latestFov=e.parsed.value2);return}2===e.type&&this.isMoveData(e.parsed)&&(this.state.moveYawAccum+=e.parsed.yaw??0,this.state.movePitchAccum+=e.parsed.pitch??0)}applyPacketGhost(e){let t=e.index,r=this.state.entityIdByGhostIndex.get(t);if("delete"===e.type){r&&(this.state.entitiesById.delete(r),this.state.entityIdByGhostIndex.delete(t));return}let a=this.resolveGhostClassName(t,e.classId);if(!a)return;let n=fG(a,t);r&&r!==n&&this.state.entitiesById.delete(r);let i=this.state.entitiesById.get(n);i||(i={id:n,ghostIndex:t,className:a,spawnTick:this.state.moveTicks,type:fP(a),rotation:[0,0,0,1]},this.state.entitiesById.set(n,i)),i.ghostIndex=t,i.className=a,i.type=fP(a),this.state.entityIdByGhostIndex.set(t,n),this.applyGhostData(i,e.parsedData)}resolveGhostClassName(e,t){if("number"==typeof t){let e=this.registry.getGhostParser(t)?.name;if(e)return e}let r=this.state.entityIdByGhostIndex.get(e);if(r){let e=this.state.entitiesById.get(r);if(e?.className)return e.className}let a=this.parser.getGhostTracker().getGhost(e);if(a?.className)return a.className}resolveEntityIdForGhostIndex(e){let t=this.state.entityIdByGhostIndex.get(e);if(t)return t;let r=this.parser.getGhostTracker().getGhost(e);if(r)return fG(r.className,e)}getDataBlockData(e){let t=this.initialBlock.dataBlocks.get(e);if(t?.data)return t.data;let r=this.parser.getPacketParser();return r.dataBlockDataMap?.get(e)}resolveExplosionInfo(e){let t=this.getDataBlockData(e),r=t?.explosion;if(null==r)return;let a=this.getDataBlockData(r);if(!a)return;let n=a.dtsFileName;if(!n)return;let i=a.lifetimeMS??31;return{shape:n,faceViewer:!1!==a.faceViewer&&0!==a.faceViewer,lifetimeTicks:i}}applyGhostData(e,t){if(!t)return;let r=t.dataBlockId;if(null!=r){e.dataBlockId=r;let t=this.getDataBlockData(r),a=f_(t);if(e.visual=function(e,t){if(!t)return;let r=fU(t,["tracerTex0","textureName0","texture0"])??"";if(!("TracerProjectile"===e||r.length>0&&null!=fO(t,["tracerLength"]))||!r)return;let a=fU(t,["tracerTex1","textureName1","texture1"]),n=fO(t,["tracerLength"])??10,i=fO(t,["tracerWidth"]),o=fO(t,["tracerAlpha"]),s=null!=i&&(null!=fO(t,["crossViewAng"])||i<=.7)?i:o??i??.5,l=fO(t,["crossViewAng","crossViewFraction"])??("number"==typeof t.tracerWidth&&t.tracerWidth>.7?t.tracerWidth:.98);return{kind:"tracer",texture:r,crossTexture:a,tracerLength:n,tracerWidth:s,crossViewAng:l,crossSize:fO(t,["crossSize","muzzleVelocity"])??.45,renderCross:function(e,t){if(e)for(let r of t){let t=e[r];if("boolean"==typeof t)return t}}(t,["renderCross","proximityRadius"])??!0}}(e.className,t)??function(e,t){if(t){if("LinearFlareProjectile"===e){let e=fU(t,["smokeTexture","flareTexture"]);if(!e)return;let r=t.flareColor,a=fO(t,["size"])??.5;return{kind:"sprite",texture:e,color:r?{r:r.r,g:r.g,b:r.b}:{r:1,g:1,b:1},size:a}}if("FlareProjectile"===e){let e=fU(t,["flareTexture"]);if(!e)return;return{kind:"sprite",texture:e,color:{r:1,g:.9,b:.5},size:fO(t,["size"])??4}}}}(e.className,t),"string"==typeof a&&(e.shapeHint=a,e.dataBlock=a),"Player"===e.type&&"number"==typeof t?.maxEnergy&&(e.maxEnergy=t.maxEnergy),"Projectile"===e.type&&(fb.has(e.className)?e.projectilePhysics="linear":fC.has(e.className)?(e.projectilePhysics="ballistic",e.gravityMod=fO(t,["gravityMod"])??1):fB.has(e.className)&&(e.projectilePhysics="seeker")),"Projectile"===e.type&&!e.explosionShape){let t=this.resolveExplosionInfo(r);t&&(e.explosionShape=t.shape,e.faceViewer=t.faceViewer,e.explosionLifetimeTicks=t.lifetimeTicks)}}if("Player"===e.type){let r=t.images;if(Array.isArray(r)&&r.length>0){let t=r[0];if(t?.dataBlockId&&t.dataBlockId>0){let r=this.getDataBlockData(t.dataBlockId),a=f_(r);if(a){let t=r?.mountPoint;(null==t||t<=0)&&!/pack_/i.test(a)&&(e.weaponShape=a)}}}}let a=fk(t.position)?t.position:fk(t.initialPosition)?t.initialPosition:fk(t.explodePosition)?t.explodePosition:fk(t.endPoint)?t.endPoint:fk(t.transform?.position)?t.transform.position:void 0;a&&(e.position=[a.x,a.y,a.z]);let n=fj(t.direction)?t.direction:void 0;if(n&&(e.direction=[n.x,n.y,n.z]),"Player"===e.type&&"number"==typeof t.rotationZ)e.rotation=fw(t.rotationZ);else if(fL(t.angPosition)){let r=fT(t.angPosition);r&&(e.rotation=r)}else if(fL(t.transform?.rotation)){let r=fT(t.transform.rotation);r&&(e.rotation=r)}else if("Item"===e.type&&"number"==typeof t.rotation?.angle){let r=t.rotation;e.rotation=fw((r.zSign??1)*r.angle)}else if("Projectile"===e.type){let r=t.velocity??t.direction??(fk(t.initialPosition)&&fk(t.endPos)?{x:t.endPos.x-t.initialPosition.x,y:t.endPos.y-t.initialPosition.y,z:t.endPos.z-t.initialPosition.z}:void 0);fj(r)&&(0!==r.x||0!==r.y)&&(e.rotation=fw(Math.atan2(r.x,r.y)))}if(fj(t.velocity)&&(e.velocity=[t.velocity.x,t.velocity.y,t.velocity.z],e.direction||(e.direction=[t.velocity.x,t.velocity.y,t.velocity.z])),e.projectilePhysics){if("linear"===e.projectilePhysics){let r=fO(null!=e.dataBlockId?this.getDataBlockData(e.dataBlockId):void 0,["dryVelocity","muzzleVelocity","bulletVelocity"])??80,a=e.direction??[0,1,0],n=a[0]*r,i=a[1]*r,o=a[2]*r,s=t.excessVel,l=t.excessDir;"number"==typeof s&&s>0&&fj(l)&&(n+=l.x*s,i+=l.y*s,o+=l.z*s),e.simulatedVelocity=[n,i,o]}else e.velocity&&(e.simulatedVelocity=[e.velocity[0],e.velocity[1],e.velocity[2]]);let r=t.currTick;if("number"==typeof r&&r>0&&e.simulatedVelocity&&e.position){let t=.032*r,a=e.simulatedVelocity;if(e.position[0]+=a[0]*t,e.position[1]+=a[1]*t,e.position[2]+=a[2]*t,"ballistic"===e.projectilePhysics){let r=9.81*(e.gravityMod??1);e.position[2]-=.5*r*t*t,a[2]-=r*t}}}let i=fk(t.explodePosition)?t.explodePosition:fk(t.explodePoint)?t.explodePoint:void 0;if("Projectile"===e.type&&!e.hasExploded&&i&&e.explosionShape){e.hasExploded=!0;let t=`fx_${this.state.nextExplosionId++}`,r=e.explosionLifetimeTicks??31,a={id:t,ghostIndex:-1,className:"Explosion",spawnTick:this.state.moveTicks,type:"Explosion",dataBlock:e.explosionShape,position:[i.x,i.y,i.z],rotation:[0,0,0,1],isExplosion:!0,faceViewer:!1!==e.faceViewer,expiryTick:this.state.moveTicks+r};this.state.entitiesById.set(t,a),e.position=void 0,e.simulatedVelocity=void 0}if("number"==typeof t.damageLevel&&(e.health=fI(1-t.damageLevel,0,1)),"number"==typeof t.damageState&&(e.damageState=t.damageState),"number"==typeof t.action&&(e.actionAnim=t.action,e.actionAtEnd=!!t.actionAtEnd),"number"==typeof t.energy&&(e.energy=fI(t.energy,0,1)),"number"==typeof t.targetId){e.targetId=t.targetId;let r=this.targetNames.get(t.targetId);r&&(e.playerName=r);let a=this.targetTeams.get(t.targetId);null!=a&&(e.sensorGroup=a,e.ghostIndex===this.state.latestControl.ghostIndex&&"player"===this.state.lastControlType&&(this.state.playerSensorGroup=a))}}advanceProjectiles(){for(let e of this.state.entitiesById.values()){if(!e.simulatedVelocity||!e.position)continue;let t=e.simulatedVelocity,r=e.position;if("ballistic"===e.projectilePhysics){let r=9.81*(e.gravityMod??1);t[2]-=.032*r}r[0]+=.032*t[0],r[1]+=.032*t[1],r[2]+=.032*t[2],(0!==t[0]||0!==t[1])&&(e.rotation=fw(Math.atan2(t[0],t[1])))}}removeExpiredExplosions(){for(let[e,t]of this.state.entitiesById)t.isExplosion&&null!=t.expiryTick&&this.state.moveTicks>=t.expiryTick&&this.state.entitiesById.delete(e)}updateCameraAndHud(){let e=this.state.latestControl,t=.032*this.state.moveTicks,r=e.data,a=this.state.lastControlType;if(e.position){var n,i;let o,s,l,u,c=this.getAbsoluteRotation(r),d=!this.state.isPiloting&&"player"===a,f=d?this.state.moveYawAccum+this.state.yawOffset:this.state.lastAbsYaw,h=d?this.state.movePitchAccum+this.state.pitchOffset:this.state.lastAbsPitch,m=f,p=h;if(c?(m=c.yaw,p=c.pitch,this.state.lastAbsYaw=m,this.state.lastAbsPitch=p,this.state.yawOffset=m-this.state.moveYawAccum,this.state.pitchOffset=p-this.state.movePitchAccum):d?(this.state.lastAbsYaw=m,this.state.lastAbsPitch=p):(m=this.state.lastAbsYaw,p=this.state.lastAbsPitch),this.state.camera={time:t,position:[e.position.x,e.position.y,e.position.z],rotation:(n=m,o=Math.sin(i=fI(p,-fE,fE)),s=Math.cos(i),l=Math.sin(n),u=Math.cos(n),fM.set(-l,u*o,-u*s,0,0,s,o,0,u,l*o,-l*s,0,0,0,0,1),fD.setFromRotationMatrix(fM),[fD.x,fD.y,fD.z,fD.w]),fov:this.state.latestFov,mode:"observer",yaw:m,pitch:p},"camera"===a)if(("number"==typeof r?.cameraMode?r.cameraMode:this.state.lastCameraMode)===3){this.state.camera.mode="third-person","number"==typeof this.state.lastOrbitDistance&&(this.state.camera.orbitDistance=this.state.lastOrbitDistance);let e="number"==typeof r?.orbitObjectGhostIndex?r.orbitObjectGhostIndex:this.state.lastOrbitGhostIndex;"number"==typeof e&&e>=0&&(this.state.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(e))}else this.state.camera.mode="observer";else this.state.camera.mode="first-person",e.ghostIndex>=0&&(this.state.controlPlayerGhostId=`player_${e.ghostIndex}`),this.state.controlPlayerGhostId&&(this.state.camera.controlEntityId=this.state.controlPlayerGhostId);if("player"===a&&!this.state.isPiloting&&this.state.controlPlayerGhostId&&e.position){let t=this.state.entitiesById.get(this.state.controlPlayerGhostId);t&&(t.position=[e.position.x,e.position.y,e.position.z],t.rotation=fw(m))}}else this.state.camera&&(this.state.camera={...this.state.camera,time:t,fov:this.state.latestFov});let o={health:1,energy:1};if(this.state.camera?.mode==="first-person"){let e=this.state.controlPlayerGhostId,t=e?this.state.entitiesById.get(e):void 0;o.health=t?.health??1;let a=r?.energyLevel;if("number"==typeof a){let e=t?.maxEnergy??60;e>0&&(o.energy=fI(a/e,0,1))}else o.energy=t?.energy??1}else if(this.state.camera?.mode==="third-person"&&this.state.camera.orbitTargetId){let e=this.state.entitiesById.get(this.state.camera.orbitTargetId);o.health=e?.health??1,o.energy=e?.energy??1}this.state.lastStatus=o}buildSnapshot(){let e=[];for(let t of this.state.entitiesById.values())(t.spawnTick>0||!fx.has(t.className))&&e.push({id:t.id,type:t.type,visual:t.visual,direction:t.direction,ghostIndex:t.ghostIndex,className:t.className,dataBlockId:t.dataBlockId,shapeHint:t.shapeHint,dataBlock:t.dataBlock,weaponShape:t.weaponShape,playerName:t.playerName,iffColor:"Player"===t.type&&null!=t.sensorGroup?this.resolveIffColor(t.sensorGroup):void 0,position:t.position?[...t.position]:void 0,rotation:t.rotation?[...t.rotation]:void 0,velocity:t.velocity,health:t.health,energy:t.energy,actionAnim:t.actionAnim,actionAtEnd:t.actionAtEnd,damageState:t.damageState,faceViewer:t.faceViewer});return{timeSec:.032*this.state.moveTicks,exhausted:this.state.exhausted,camera:this.state.camera,entities:e,controlPlayerGhostId:this.state.controlPlayerGhostId,status:this.state.lastStatus}}resolveIffColor(e){if(0===this.state.playerSensorGroup)return;let t=this.sensorGroupColors.get(this.state.playerSensorGroup);if(t){let r=t.get(e);if(r)return r}return e===this.state.playerSensorGroup?fv:0!==e?fy:void 0}getAbsoluteRotation(e){return e?"number"==typeof e.rotationZ&&"number"==typeof e.headX?{yaw:e.rotationZ,pitch:e.headX}:"number"==typeof e.rotZ&&"number"==typeof e.rotX?{yaw:e.rotZ,pitch:e.rotX}:null:null}isPacketData(e){return!!e&&"object"==typeof e&&"gameState"in e&&"events"in e&&"ghosts"in e}isMoveData(e){return!!e&&"object"==typeof e&&"yaw"in e}isInfoData(e){return!!e&&"object"==typeof e&&"value2"in e&&"number"==typeof e.value2}}async function fJ(e){let t=new fg(new Uint8Array(e)),{header:r,initialBlock:a}=await t.load(),{missionName:n,gameType:i}=function(e){let t=null,r=null;for(let a=0;a{if(f){p.current=p.current+1,h(null);return}m.current?.click()},d[0]=f,d[1]=h,d[2]=e):e=d[2];let g=e;d[3]!==h?(t=async e=>{let t=e.target.files?.[0];if(t){e.target.value="";try{let e=await t.arrayBuffer(),r=p.current+1;p.current=r;let a=await fJ(e);if(p.current!==r)return;h(a)}catch(e){console.error("Failed to load demo:",e)}}},d[3]=h,d[4]=t):t=d[4];let v=t;d[5]===Symbol.for("react.memo_cache_sentinel")?(r={display:"none"},d[5]=r):r=d[5],d[6]!==v?(a=(0,n.jsx)("input",{ref:m,type:"file",accept:".rec",style:r,onChange:v}),d[6]=v,d[7]=a):a=d[7];let y=f?"Unload demo":"Load demo (.rec)",A=f?"Unload demo":"Load demo (.rec)",F=f?"true":void 0;d[8]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(lo,{className:"DemoIcon"}),d[8]=s):s=d[8];let b=f?"Unload demo":"Demo";return d[9]!==b?(l=(0,n.jsx)("span",{className:"ButtonLabel",children:b}),d[9]=b,d[10]=l):l=d[10],d[11]!==g||d[12]!==y||d[13]!==A||d[14]!==F||d[15]!==l?(u=(0,n.jsxs)("button",{type:"button",className:"IconButton LabelledButton","aria-label":y,title:A,onClick:g,"data-active":F,children:[s,l]}),d[11]=g,d[12]=y,d[13]=A,d[14]=F,d[15]=l,d[16]=u):u=d[16],d[17]!==u||d[18]!==a?(c=(0,n.jsxs)(n.Fragment,{children:[a,u]}),d[17]=u,d[18]=a,d[19]=c):c=d[19],c}function fV(e){return(0,la.GenIcon)({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:"12",y1:"16",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12.01",y2:"8"},child:[]}]})(e)}function fz(e){return(0,la.GenIcon)({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:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}function fq(e){let t,r,a,s,l,u,c,d,f,h,m,p,g,v,y,A,F,b,C,B,S,x,M,D,k,I,w,T,R,P,G,L,j,_,O,U,H,N,J,K,V,z,q,Q,W,X=(0,i.c)(103),{missionName:Y,missionType:Z,onChangeMission:$,onOpenMapInfo:ee,cameraRef:et,isTouch:er}=e,{fogEnabled:ea,setFogEnabled:en,fov:ei,setFov:eo,audioEnabled:es,setAudioEnabled:el,animationEnabled:eu,setAnimationEnabled:ec}=(0,E.useSettings)(),{speedMultiplier:ed,setSpeedMultiplier:ef,touchMode:eh,setTouchMode:em}=(0,E.useControls)(),{debugMode:ep,setDebugMode:eg}=(0,E.useDebug)(),ev=null!=r$(),[ey,eA]=(0,o.useState)(!1),eF=(0,o.useRef)(null),eb=(0,o.useRef)(null),eC=(0,o.useRef)(null);X[0]!==ey?(t=()=>{ey&&eF.current?.focus()},r=[ey],X[0]=ey,X[1]=t,X[2]=r):(t=X[1],r=X[2]),(0,o.useEffect)(t,r),X[3]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{let t=e.relatedTarget;t&&eC.current?.contains(t)||eA(!1)},X[3]=a):a=X[3];let eB=a;X[4]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{"Escape"===e.key&&(eA(!1),eb.current?.focus())},X[4]=s):s=X[4];let eS=s;return X[5]!==ev||X[6]!==Y||X[7]!==Z||X[8]!==$?(l=(0,n.jsx)(lt,{value:Y,missionType:Z,onChange:$,disabled:ev}),X[5]=ev,X[6]=Y,X[7]=Z,X[8]=$,X[9]=l):l=X[9],X[10]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{eA(fQ)},X[10]=u):u=X[10],X[11]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(fz,{}),X[11]=c):c=X[11],X[12]!==ey?(d=(0,n.jsx)("button",{ref:eb,className:"IconButton Controls-toggle",onClick:u,"aria-expanded":ey,"aria-controls":"settingsPanel","aria-label":"Settings",children:c}),X[12]=ey,X[13]=d):d=X[13],X[14]!==et||X[15]!==Y||X[16]!==Z?(f=(0,n.jsx)(li,{cameraRef:et,missionName:Y,missionType:Z}),X[14]=et,X[15]=Y,X[16]=Z,X[17]=f):f=X[17],X[18]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)(fK,{}),X[18]=h):h=X[18],X[19]===Symbol.for("react.memo_cache_sentinel")?(m=(0,n.jsx)(fV,{}),p=(0,n.jsx)("span",{className:"ButtonLabel",children:"Show map info"}),X[19]=m,X[20]=p):(m=X[19],p=X[20]),X[21]!==ee?(g=(0,n.jsxs)("button",{type:"button",className:"IconButton LabelledButton MapInfoButton","aria-label":"Show map info",onClick:ee,children:[m,p]}),X[21]=ee,X[22]=g):g=X[22],X[23]!==g||X[24]!==f?(v=(0,n.jsxs)("div",{className:"Controls-group",children:[f,h,g]}),X[23]=g,X[24]=f,X[25]=v):v=X[25],X[26]!==en?(y=e=>{en(e.target.checked)},X[26]=en,X[27]=y):y=X[27],X[28]!==ea||X[29]!==y?(A=(0,n.jsx)("input",{id:"fogInput",type:"checkbox",checked:ea,onChange:y}),X[28]=ea,X[29]=y,X[30]=A):A=X[30],X[31]===Symbol.for("react.memo_cache_sentinel")?(F=(0,n.jsx)("label",{htmlFor:"fogInput",children:"Fog?"}),X[31]=F):F=X[31],X[32]!==A?(b=(0,n.jsxs)("div",{className:"CheckboxField",children:[A,F]}),X[32]=A,X[33]=b):b=X[33],X[34]!==el?(C=e=>{el(e.target.checked)},X[34]=el,X[35]=C):C=X[35],X[36]!==es||X[37]!==C?(B=(0,n.jsx)("input",{id:"audioInput",type:"checkbox",checked:es,onChange:C}),X[36]=es,X[37]=C,X[38]=B):B=X[38],X[39]===Symbol.for("react.memo_cache_sentinel")?(S=(0,n.jsx)("label",{htmlFor:"audioInput",children:"Audio?"}),X[39]=S):S=X[39],X[40]!==B?(x=(0,n.jsxs)("div",{className:"CheckboxField",children:[B,S]}),X[40]=B,X[41]=x):x=X[41],X[42]!==b||X[43]!==x?(M=(0,n.jsxs)("div",{className:"Controls-group",children:[b,x]}),X[42]=b,X[43]=x,X[44]=M):M=X[44],X[45]!==ec?(D=e=>{ec(e.target.checked)},X[45]=ec,X[46]=D):D=X[46],X[47]!==eu||X[48]!==D?(k=(0,n.jsx)("input",{id:"animationInput",type:"checkbox",checked:eu,onChange:D}),X[47]=eu,X[48]=D,X[49]=k):k=X[49],X[50]===Symbol.for("react.memo_cache_sentinel")?(I=(0,n.jsx)("label",{htmlFor:"animationInput",children:"Animation?"}),X[50]=I):I=X[50],X[51]!==k?(w=(0,n.jsxs)("div",{className:"CheckboxField",children:[k,I]}),X[51]=k,X[52]=w):w=X[52],X[53]!==eg?(T=e=>{eg(e.target.checked)},X[53]=eg,X[54]=T):T=X[54],X[55]!==ep||X[56]!==T?(R=(0,n.jsx)("input",{id:"debugInput",type:"checkbox",checked:ep,onChange:T}),X[55]=ep,X[56]=T,X[57]=R):R=X[57],X[58]===Symbol.for("react.memo_cache_sentinel")?(P=(0,n.jsx)("label",{htmlFor:"debugInput",children:"Debug?"}),X[58]=P):P=X[58],X[59]!==R?(G=(0,n.jsxs)("div",{className:"CheckboxField",children:[R,P]}),X[59]=R,X[60]=G):G=X[60],X[61]!==w||X[62]!==G?(L=(0,n.jsxs)("div",{className:"Controls-group",children:[w,G]}),X[61]=w,X[62]=G,X[63]=L):L=X[63],X[64]===Symbol.for("react.memo_cache_sentinel")?(j=(0,n.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),X[64]=j):j=X[64],X[65]!==eo?(_=e=>eo(parseInt(e.target.value)),X[65]=eo,X[66]=_):_=X[66],X[67]!==ei||X[68]!==ev||X[69]!==_?(O=(0,n.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:ei,disabled:ev,onChange:_}),X[67]=ei,X[68]=ev,X[69]=_,X[70]=O):O=X[70],X[71]!==ei?(U=(0,n.jsx)("output",{htmlFor:"fovInput",children:ei}),X[71]=ei,X[72]=U):U=X[72],X[73]!==O||X[74]!==U?(H=(0,n.jsxs)("div",{className:"Field",children:[j,O,U]}),X[73]=O,X[74]=U,X[75]=H):H=X[75],X[76]===Symbol.for("react.memo_cache_sentinel")?(N=(0,n.jsx)("label",{htmlFor:"speedInput",children:"Speed"}),X[76]=N):N=X[76],X[77]!==ef?(J=e=>ef(parseFloat(e.target.value)),X[77]=ef,X[78]=J):J=X[78],X[79]!==ev||X[80]!==ed||X[81]!==J?(K=(0,n.jsxs)("div",{className:"Field",children:[N,(0,n.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:ed,disabled:ev,onChange:J})]}),X[79]=ev,X[80]=ed,X[81]=J,X[82]=K):K=X[82],X[83]!==H||X[84]!==K?(V=(0,n.jsxs)("div",{className:"Controls-group",children:[H,K]}),X[83]=H,X[84]=K,X[85]=V):V=X[85],X[86]!==er||X[87]!==em||X[88]!==eh?(z=er&&(0,n.jsx)("div",{className:"Controls-group",children:(0,n.jsxs)("div",{className:"Field",children:[(0,n.jsx)("label",{htmlFor:"touchModeInput",children:"Joystick:"})," ",(0,n.jsxs)("select",{id:"touchModeInput",value:eh,onChange:e=>em(e.target.value),children:[(0,n.jsx)("option",{value:"dualStick",children:"Dual Stick"}),(0,n.jsx)("option",{value:"moveLookStick",children:"Single Stick"})]})]})}),X[86]=er,X[87]=em,X[88]=eh,X[89]=z):z=X[89],X[90]!==ey||X[91]!==v||X[92]!==M||X[93]!==L||X[94]!==V||X[95]!==z?(q=(0,n.jsxs)("div",{className:"Controls-dropdown",ref:eF,id:"settingsPanel",tabIndex:-1,onKeyDown:eS,onBlur:eB,"data-open":ey,children:[v,M,L,V,z]}),X[90]=ey,X[91]=v,X[92]=M,X[93]=L,X[94]=V,X[95]=z,X[96]=q):q=X[96],X[97]!==q||X[98]!==d?(Q=(0,n.jsxs)("div",{ref:eC,children:[d,q]}),X[97]=q,X[98]=d,X[99]=Q):Q=X[99],X[100]!==Q||X[101]!==l?(W=(0,n.jsxs)("div",{id:"controls",onKeyDown:fY,onPointerDown:fX,onClick:fW,children:[l,Q]}),X[100]=Q,X[101]=l,X[102]=W):W=X[102],W}function fQ(e){return!e}function fW(e){return e.stopPropagation()}function fX(e){return e.stopPropagation()}function fY(e){return e.stopPropagation()}let fZ=()=>null,f$=o.forwardRef(({envMap:e,resolution:t=256,frames:r=1/0,makeDefault:a,children:n,...i},s)=>{let l=(0,F.useThree)(({set:e})=>e),c=(0,F.useThree)(({camera:e})=>e),d=(0,F.useThree)(({size:e})=>e),f=o.useRef(null);o.useImperativeHandle(s,()=>f.current,[]);let h=o.useRef(null),m=function(e,t,r){let a=(0,F.useThree)(e=>e.size),n=(0,F.useThree)(e=>e.viewport),i="number"==typeof e?e:a.width*n.dpr,s=a.height*n.dpr,l=("number"==typeof e?void 0:e)||{},{samples:c=0,depth:d,...f}=l,h=null!=d?d:l.depthBuffer,m=o.useMemo(()=>{let e=new u.WebGLRenderTarget(i,s,{minFilter:u.LinearFilter,magFilter:u.LinearFilter,type:u.HalfFloatType,...f});return h&&(e.depthTexture=new u.DepthTexture(i,s,u.FloatType)),e.samples=c,e},[]);return o.useLayoutEffect(()=>{m.setSize(i,s),c&&(m.samples=c)},[c,m,i,s]),o.useEffect(()=>()=>m.dispose(),[]),m}(t);o.useLayoutEffect(()=>{i.manual||(f.current.aspect=d.width/d.height)},[d,i]),o.useLayoutEffect(()=>{f.current.updateProjectionMatrix()});let p=0,g=null,v="function"==typeof n;return(0,A.useFrame)(t=>{v&&(r===1/0||p{if(a)return l(()=>({camera:f.current})),()=>l(()=>({camera:c}))},[f,a,l]),o.createElement(o.Fragment,null,o.createElement("perspectiveCamera",(0,W.default)({ref:f},i),!v&&n),o.createElement("group",{ref:h},v&&n(m.texture)))});function f0(){let e,t,r=(0,i.c)(3),{fov:a}=(0,E.useSettings)();return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=[0,256,0],r[0]=e):e=r[0],r[1]!==a?(t=(0,n.jsx)(f$,{makeDefault:!0,position:e,fov:a}),r[1]=a,r[2]=t):t=r[2],t}var f1=e.i(51434),f2=e.i(81405);function f3(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function f9({showPanel:e=0,className:t,parent:r}){let a=function(e,t=[],r){let[a,n]=o.useState();return o.useLayoutEffect(()=>{let t=e();return n(t),f3(void 0,t),()=>f3(void 0,null)},t),a}(()=>new f2.default,[]);return o.useEffect(()=>{if(a){let n=r&&r.current||document.body;a.showPanel(e),null==n||n.appendChild(a.dom);let i=(null!=t?t:"").split(" ").filter(e=>e);i.length&&a.dom.classList.add(...i);let o=(0,s.j)(()=>a.begin()),l=(0,s.k)(()=>a.end());return()=>{i.length&&a.dom.classList.remove(...i),null==n||n.removeChild(a.dom),o(),l()}}},[r,a,t,e]),null}var f5=e.i(60099);function f8(){let e,t,r=(0,i.c)(3),{debugMode:a}=(0,E.useDebug)(),s=(0,o.useRef)(null);return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=s.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},r[0]=e):e=r[0],(0,o.useEffect)(e),r[1]!==a?(t=a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(f9,{className:"StatsPanel"}),(0,n.jsx)("axesHelper",{ref:s,args:[70],renderOrder:999,children:(0,n.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),(0,n.jsx)(f5.Html,{position:[80,0,0],center:!0,children:(0,n.jsx)("span",{className:"AxisLabel","data-axis":"y",children:"Y"})}),(0,n.jsx)(f5.Html,{position:[0,80,0],center:!0,children:(0,n.jsx)("span",{className:"AxisLabel","data-axis":"z",children:"Z"})}),(0,n.jsx)(f5.Html,{position:[0,0,80],center:!0,children:(0,n.jsx)("span",{className:"AxisLabel","data-axis":"x",children:"X"})})]}):null,r[1]=a,r[2]=t):t=r[2],t}let f6=new u.Vector3,f4=new u.Vector3,f7=new u.Matrix4,he=new u.Vector3(0,1,0),ht=new u.Quaternion().setFromAxisAngle(new u.Vector3(0,1,0),Math.PI/2),hr=ht.clone().invert(),ha=0;function hn(e){return ha+=1,`${e}-${ha}`}function hi(e){e.wrapS=u.ClampToEdgeWrapping,e.wrapT=u.ClampToEdgeWrapping,e.minFilter=u.LinearFilter,e.magFilter=u.LinearFilter,e.colorSpace=u.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function ho(e,t){return t.set(e[1],e[2],e[0])}function hs(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,a=e.length-1;for(;a-r>1;){let n=r+a>>1;e[n].time<=t?r=n:a=n}return e[r]}function hl(e,t,r){let a=e.clone(!0),n=t.find(e=>"Root"===e.name);if(n){let e=new u.AnimationMixer(a);e.clipAction(n).play(),e.setTime(0)}a.updateMatrixWorld(!0);let i=null,o=null;return(a.traverse(e=>{i||e.name!==r||(i=new u.Vector3,o=new u.Quaternion,e.getWorldPosition(i),e.getWorldQuaternion(o))}),i&&o)?{position:i,quaternion:o}:null}let hu=new u.TextureLoader;function hc(e,t){let r=e.userData?.resource_path,a=new Set(e.userData?.flag_names??[]);if(!r){let t=new u.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return tL(t),t}let n=(0,y.textureToUrl)(r),i=hu.load(n);(0,C.setupTexture)(i);let o=tj(e,i,a,!1,t);return Array.isArray(o)?o[1]:o}function hd(e){let t=null;e.traverse(e=>{!t&&e.skeleton&&(t=e.skeleton)});let r=t?tB(t):new Set;e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"||(e.userData?.vis??1)<.01){e.visible=!1;return}if(e.geometry){let t=tS(e.geometry,r);!function(e){e.computeVertexNormals();let t=e.attributes.position,r=e.attributes.normal;if(!t||!r)return;let a=t.array,n=r.array,i=new Map;for(let e=0;e1){let t=0,r=0,a=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],a+=n[3*i+2];let i=Math.sqrt(t*t+r*r+a*a);for(let o of(i>0&&(t/=i,r/=i,a/=i),e))n[3*o]=t,n[3*o+1]=r,n[3*o+2]=a}r.needsUpdate=!0}(t=t.clone()),e.geometry=t}let t=e.userData?.vis??1;Array.isArray(e.material)?e.material=e.material.map(e=>hc(e,t)):e.material&&(e.material=hc(e.material,t))})}function hf(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}var hh=o;function hm(e){let t,r,a,s,l,c,d,f,h,m,p,g,v,y=(0,i.c)(28),{entity:F,timeRef:b}=e,C=(0,R.useEngineStoreApi)(),B=t_(F.dataBlock);if(y[0]!==B.scene){var S;let e,n,i;S=B.scene,e=new Map,n=new Map,i=S.clone(),function e(t,r,a){a(t,r);for(let n=0;n{t||"Mount0"!==e.name||(t=e)}),y[0]=B.scene,y[1]=t,y[2]=r,y[3]=a}else t=y[1],r=y[2],a=y[3];y[4]!==t||y[5]!==r||y[6]!==a?(s={clonedScene:a,mixer:r,mount0:t},y[4]=t,y[5]=r,y[6]=a,y[7]=s):s=y[7];let{clonedScene:x,mixer:E,mount0:M}=s;y[8]===Symbol.for("react.memo_cache_sentinel")?(l=new Map,y[8]=l):l=y[8];let D=(0,o.useRef)(l);y[9]===Symbol.for("react.memo_cache_sentinel")?(c={name:"Root",timeScale:1},y[9]=c):c=y[9];let k=(0,o.useRef)(c),I=(0,o.useRef)(!1);return y[10]!==B.animations||y[11]!==E?(d=()=>{let e=new Map;for(let t of B.animations){let r=E.clipAction(t);e.set(t.name.toLowerCase(),r)}D.current=e;let t=e.get("root");return t&&t.play(),k.current={name:"Root",timeScale:1},E.update(0),()=>{E.stopAllAction(),D.current=new Map}},f=[E,B.animations],y[10]=B.animations,y[11]=E,y[12]=d,y[13]=f):(d=y[12],f=y[13]),(0,o.useEffect)(d,f),y[14]!==C||y[15]!==F.keyframes||y[16]!==E||y[17]!==b?(h=(e,t)=>{let r=C.getState().playback,a="playing"===r.status,n=b.current,i=hs(F.keyframes,n),o=i?.damageState!=null&&i.damageState>=1,s=D.current;if(o&&!I.current){I.current=!0;let e=[...s.keys()].filter(hp);if(e.length>0){let t=e[Math.floor(Math.random()*e.length)],r=s.get(k.current.name.toLowerCase());r&&r.fadeOut(.25);let a=s.get(t);a.setLoop(u.LoopOnce,1),a.clampWhenFinished=!0,a.reset().fadeIn(.25).play(),k.current={name:t,timeScale:1}}}if(!o&&I.current){I.current=!1;let e=s.get(k.current.name.toLowerCase());e&&(e.stop(),e.setLoop(u.LoopRepeat,1/0),e.clampWhenFinished=!1),k.current={name:"Root",timeScale:1};let t=s.get("root");t&&t.reset().play()}if(!I.current){let e=function(e,t){if(!e)return{animation:"Root",timeScale:1};let[r,a,n]=e;if(n<-10)return{animation:"Fall",timeScale:1};let i=-2*Math.atan2(t[1],t[3]),o=Math.cos(i),s=Math.sin(i),l=r*o+a*s,u=-r*s+a*o,c=-u,d=-l,f=Math.max(u,c,d,l);return f<.1?{animation:"Root",timeScale:1}:f===u?{animation:"Forward",timeScale:1}:f===c?{animation:"Back",timeScale:1}:f===d?{animation:"Side",timeScale:1}:{animation:"Side",timeScale:-1}}(i?.velocity,i?.rotation??[0,0,0,1]),t=k.current;if(e.animation!==t.name||e.timeScale!==t.timeScale){let r=s.get(t.name.toLowerCase()),n=s.get(e.animation.toLowerCase());n&&(a&&r&&r!==n?(r.fadeOut(.25),n.reset().fadeIn(.25).play()):(r&&r!==n&&r.stop(),n.reset().play()),n.timeScale=e.timeScale,k.current={name:e.animation,timeScale:e.timeScale})}}a?E.update(t*r.rate):E.update(0)},y[14]=C,y[15]=F.keyframes,y[16]=E,y[17]=b,y[18]=h):h=y[18],(0,A.useFrame)(h),y[19]===Symbol.for("react.memo_cache_sentinel")?(m=[0,Math.PI/2,0],y[19]=m):m=y[19],y[20]!==x?(p=(0,n.jsx)("group",{rotation:m,children:(0,n.jsx)("primitive",{object:x})}),y[20]=x,y[21]=p):p=y[21],y[22]!==F.weaponShape||y[23]!==M?(g=F.weaponShape&&M&&(0,n.jsx)(h_,{fallback:null,children:(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(hg,{weaponShape:F.weaponShape,mount0:M})})}),y[22]=F.weaponShape,y[23]=M,y[24]=g):g=y[24],y[25]!==p||y[26]!==g?(v=(0,n.jsxs)(n.Fragment,{children:[p,g]}),y[25]=p,y[26]=g,y[27]=v):v=y[27],v}function hp(e){return e.startsWith("die")}function hg(e){let t,r,a=(0,i.c)(7),{weaponShape:n,mount0:s}=e,l=t_(n);return a[0]!==s||a[1]!==l.animations||a[2]!==l.scene?(t=()=>{let e=l.scene.clone(!0);hd(e);let t=hl(l.scene,l.animations,"Mountpoint");if(t){let r=t.quaternion.clone().invert(),a=t.position.clone().negate().applyQuaternion(r);e.position.copy(a),e.quaternion.copy(r)}return s.add(e),()=>{s.remove(e)}},a[0]=s,a[1]=l.animations,a[2]=l.scene,a[3]=t):t=a[3],a[4]!==s||a[5]!==l?(r=[l,s],a[4]=s,a[5]=l,a[6]=r):r=a[6],(0,o.useEffect)(t,r),null}function hv(e){let t,r,a=(0,i.c)(7),{shapeName:n,eyeOffsetRef:s}=e,l=t_(n);return a[0]!==s||a[1]!==l.animations||a[2]!==l.scene?(t=()=>{let e=hl(l.scene,l.animations,"Eye");e?s.current.set(e.position.z,e.position.y,-e.position.x):s.current.set(0,2.1,0)},a[0]=s,a[1]=l.animations,a[2]=l.scene,a[3]=t):t=a[3],a[4]!==s||a[5]!==l?(r=[l,s],a[4]=s,a[5]=l,a[6]=r):r=a[6],(0,o.useEffect)(t,r),null}function hy(e){let t,r,a,o=(0,i.c)(6),{shapeName:s,entityId:l}=e,u="number"==typeof l?l:0;o[0]!==u?(t={_class:"player",_className:"Player",_id:u},o[0]=u,o[1]=t):t=o[1];let c=t;return o[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,n.jsx)(tz,{loadingColor:"#00ff88"}),o[2]=r):r=o[2],o[3]!==s||o[4]!==c?(a=(0,n.jsx)(tk,{object:c,shapeName:s,type:"StaticShape",children:r}),o[3]=s,o[4]=c,o[5]=a):a=o[5],a}function hA(e){let t,r,a,o,s,l=(0,i.c)(16),{shapeName:u,playerShapeName:c}=e,d=t_(c),f=t_(u);if(l[0]!==d.animations||l[1]!==d.scene||l[2]!==f){e:{let e,r,a,n=hl(d.scene,d.animations,"Mount0");if(!n){let e;l[4]===Symbol.for("react.memo_cache_sentinel")?(e={position:void 0,quaternion:void 0},l[4]=e):e=l[4],t=e;break e}let i=hl(f.scene,f.animations,"Mountpoint");if(i){let t=i.quaternion.clone().invert(),a=i.position.clone().negate().applyQuaternion(t);r=n.quaternion.clone().multiply(t),e=a.clone().applyQuaternion(n.quaternion).add(n.position)}else e=n.position.clone(),r=n.quaternion.clone();let o=e.applyQuaternion(ht),s=ht.clone().multiply(r).multiply(hr);l[5]!==o||l[6]!==s?(a={position:o,quaternion:s},l[5]=o,l[6]=s,l[7]=a):a=l[7],t=a}l[0]=d.animations,l[1]=d.scene,l[2]=f,l[3]=t}else t=l[3];let h=t;l[8]===Symbol.for("react.memo_cache_sentinel")?(r={_class:"weapon",_className:"Weapon",_id:0},l[8]=r):r=l[8];let m=r;return l[9]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)(tz,{loadingColor:"#4488ff"}),l[9]=a):a=l[9],l[10]!==h.position||l[11]!==h.quaternion?(o=(0,n.jsx)("group",{position:h.position,quaternion:h.quaternion,children:a}),l[10]=h.position,l[11]=h.quaternion,l[12]=o):o=l[12],l[13]!==u||l[14]!==o?(s=(0,n.jsx)(tk,{object:m,shapeName:u,type:"Item",children:o}),l[13]=u,l[14]=o,l[15]=s):s=l[15],s}let hF=new u.Vector3,hb=new u.Vector3,hC=new u.Vector3,hB=new u.Vector3,hS=new u.Vector3,hx=new u.Vector3,hE=new u.Vector3(0,1,0);function hM(e){let t,r,a,o,s,l=(0,i.c)(14),{visual:c}=e;l[0]!==c.texture?(t=(0,y.textureToUrl)(c.texture),l[0]=c.texture,l[1]=t):t=l[1];let d=t,f=(0,B.useTexture)(d,hD),h=Array.isArray(f)?f[0]:f;l[2]!==c.color.b||l[3]!==c.color.g||l[4]!==c.color.r?(r=new u.Color().setRGB(c.color.r,c.color.g,c.color.b,u.SRGBColorSpace),l[2]=c.color.b,l[3]=c.color.g,l[4]=c.color.r,l[5]=r):r=l[5];let m=r;return l[6]!==c.size?(a=[c.size,c.size,1],l[6]=c.size,l[7]=a):a=l[7],l[8]!==m||l[9]!==h?(o=(0,n.jsx)("spriteMaterial",{map:h,color:m,transparent:!0,blending:u.AdditiveBlending,depthWrite:!1,toneMapped:!1}),l[8]=m,l[9]=h,l[10]=o):o=l[10],l[11]!==a||l[12]!==o?(s=(0,n.jsx)("sprite",{scale:a,children:o}),l[11]=a,l[12]=o,l[13]=s):s=l[13],s}function hD(e){hi(Array.isArray(e)?e[0]:e)}function hk(e){let t,r,a,s,l,c,d,f,h,m,p,g,v=(0,i.c)(28),{entity:F,visual:b}=e,C=(0,o.useRef)(null),S=(0,o.useRef)(null),x=(0,o.useRef)(null);v[0]===Symbol.for("react.memo_cache_sentinel")?(t=new u.Quaternion,v[0]=t):t=v[0];let E=(0,o.useRef)(t);v[1]!==b.texture?(r=(0,y.textureToUrl)(b.texture),v[1]=b.texture,v[2]=r):r=v[2];let M=b.crossTexture??b.texture;v[3]!==M?(a=(0,y.textureToUrl)(M),v[3]=M,v[4]=a):a=v[4],v[5]!==r||v[6]!==a?(s=[r,a],v[5]=r,v[6]=a,v[7]=s):s=v[7];let D=s,k=(0,B.useTexture)(D,hI);v[8]!==k?(l=Array.isArray(k)?k:[k,k],v[8]=k,v[9]=l):l=v[9];let[I,w]=l;return v[10]!==F||v[11]!==b.crossSize||v[12]!==b.crossViewAng||v[13]!==b.renderCross||v[14]!==b.tracerLength||v[15]!==b.tracerWidth?(c=e=>{var t;let{camera:r}=e,a=C.current,n=S.current;if(!a||!n)return;let i=F.keyframes[0],o=i?.position,s=F.direction??i?.velocity;if(!o||!s||(ho(s,hF),1e-8>hF.lengthSq())){a.visible=!1,x.current&&(x.current.visible=!1);return}hF.normalize(),a.visible=!0,ho(o,hx),hb.copy(hx).sub(r.position),hC.crossVectors(hb,hF),1e-8>hC.lengthSq()&&(hC.crossVectors(hE,hF),1e-8>hC.lengthSq()&&hC.set(1,0,0)),hC.normalize().multiplyScalar(b.tracerWidth);let l=.5*b.tracerLength;hB.copy(hF).multiplyScalar(-l),hS.copy(hF).multiplyScalar(l);let u=n.array;u[0]=hB.x+hC.x,u[1]=hB.y+hC.y,u[2]=hB.z+hC.z,u[3]=hB.x-hC.x,u[4]=hB.y-hC.y,u[5]=hB.z-hC.z,u[6]=hS.x-hC.x,u[7]=hS.y-hC.y,u[8]=hS.z-hC.z,u[9]=hS.x+hC.x,u[10]=hS.y+hC.y,u[11]=hS.z+hC.z,n.needsUpdate=!0;let c=x.current;if(!c)return;if(!b.renderCross){c.visible=!1;return}hb.normalize();let d=hF.dot(hb);if(d>-b.crossViewAng&&df6.lengthSq()&&f6.set(-1,0,0),f6.normalize(),f4.crossVectors(f6,hF).normalize(),f7.set(f6.x,hF.x,f4.x,0,f6.y,hF.y,f4.y,0,f6.z,hF.z,f4.z,0,0,0,0,1),t.setFromRotationMatrix(f7),c.quaternion.copy(E.current),c.scale.setScalar(b.crossSize)},v[10]=F,v[11]=b.crossSize,v[12]=b.crossViewAng,v[13]=b.renderCross,v[14]=b.tracerLength,v[15]=b.tracerWidth,v[16]=c):c=v[16],(0,A.useFrame)(c),v[17]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)("bufferAttribute",{ref:S,attach:"attributes-position",args:[new Float32Array(12),3]}),v[17]=d):d=v[17],v[18]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)("bufferAttribute",{attach:"attributes-uv",args:[new Float32Array([0,0,0,1,1,1,1,0]),2]}),v[18]=f):f=v[18],v[19]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsxs)("bufferGeometry",{children:[d,f,(0,n.jsx)("bufferAttribute",{attach:"index",args:[new Uint16Array([0,1,2,0,2,3]),1]})]}),v[19]=h):h=v[19],v[20]!==I?(m=(0,n.jsxs)("mesh",{ref:C,children:[h,(0,n.jsx)("meshBasicMaterial",{map:I,transparent:!0,blending:u.AdditiveBlending,side:u.DoubleSide,depthWrite:!1,toneMapped:!1})]}),v[20]=I,v[21]=m):m=v[21],v[22]!==w||v[23]!==b.renderCross?(p=b.renderCross?(0,n.jsxs)("mesh",{ref:x,children:[(0,n.jsxs)("bufferGeometry",{children:[(0,n.jsx)("bufferAttribute",{attach:"attributes-position",args:[new Float32Array([-.5,0,-.5,.5,0,-.5,.5,0,.5,-.5,0,.5]),3]}),(0,n.jsx)("bufferAttribute",{attach:"attributes-uv",args:[new Float32Array([0,0,0,1,1,1,1,0]),2]}),(0,n.jsx)("bufferAttribute",{attach:"index",args:[new Uint16Array([0,1,2,0,2,3]),1]})]}),(0,n.jsx)("meshBasicMaterial",{map:w,transparent:!0,blending:u.AdditiveBlending,side:u.DoubleSide,depthWrite:!1,toneMapped:!1})]}):null,v[22]=w,v[23]=b.renderCross,v[24]=p):p=v[24],v[25]!==m||v[26]!==p?(g=(0,n.jsxs)(n.Fragment,{children:[m,p]}),v[25]=m,v[26]=p,v[27]=g):g=v[27],g}function hI(e){for(let t of Array.isArray(e)?e:[e])hi(t)}let hw=(0,y.textureToUrl)("gui/hud_alliedtriangle"),hT=(0,y.textureToUrl)("gui/hud_enemytriangle"),hR=new u.Vector3;function hP(e){let t,r,a,s,l,c,d=(0,i.c)(22),{entity:f,timeRef:h}=e,m=t_(f.dataBlock),{camera:p}=(0,F.useThree)(),g=(0,o.useRef)(null),v=(0,o.useRef)(null),y=(0,o.useRef)(null),b=(0,o.useRef)(null),C=(0,o.useRef)(null),[B,S]=(0,o.useState)(!0);e:{if(f.playerName){t=f.playerName;break e}if("string"==typeof f.id){let e;if(d[0]!==f.id){let t;d[2]===Symbol.for("react.memo_cache_sentinel")?(t=/^player_/,d[2]=t):t=d[2],e=f.id.replace(t,"Player "),d[0]=f.id,d[1]=e}else e=d[1];t=e;break e}t=`Player ${f.id}`}let x=t;d[3]!==m.scene?(r=new u.Box3().setFromObject(m.scene),d[3]=m.scene,d[4]=r):r=d[4];let E=r.max.y+.1;d[5]!==f.keyframes?(a=f.keyframes.some(hG),d[5]=f.keyframes,d[6]=a):a=d[6];let M=a;d[7]!==p||d[8]!==f.iffColor||d[9]!==f.keyframes||d[10]!==M||d[11]!==B||d[12]!==h?(s=()=>{let e=g.current;if(!e)return;e.getWorldPosition(hR);let t=p.position.distanceTo(hR),r=p.matrixWorld.elements,a=!(-((hR.x-r[12])*r[8])+-((hR.y-r[13])*r[9])+-((hR.z-r[14])*r[10])<0)&&t<150;if(B!==a&&S(a),!a)return;let n=hs(f.keyframes,h.current),i=n?.health??1;if(n?.damageState!=null&&n.damageState>=1){v.current&&(v.current.style.opacity="0"),y.current&&(y.current.style.opacity="0");return}let o=Math.max(0,Math.min(1,1-t/150)).toString();if(v.current&&(v.current.style.opacity=o),y.current&&(y.current.style.opacity=o),C.current&&f.iffColor){let e=f.iffColor.r>f.iffColor.g?hT:hw;C.current.src!==e&&(C.current.src=e)}b.current&&M&&(b.current.style.width=`${Math.max(0,Math.min(100,100*i))}%`,b.current.style.background=f.iffColor?`rgb(${f.iffColor.r}, ${f.iffColor.g}, ${f.iffColor.b})`:"")},d[7]=p,d[8]=f.iffColor,d[9]=f.keyframes,d[10]=M,d[11]=B,d[12]=h,d[13]=s):s=d[13],(0,A.useFrame)(s);let D=f.iffColor&&f.iffColor.r>f.iffColor.g?hT:hw;return d[14]!==x||d[15]!==M||d[16]!==E||d[17]!==D||d[18]!==B?(l=B&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(f5.Html,{position:[0,E,0],center:!0,children:(0,n.jsx)("div",{ref:v,className:"PlayerNameplate PlayerTop",children:(0,n.jsx)("img",{ref:C,className:"PlayerNameplate-iffArrow",src:D,alt:""})})}),(0,n.jsx)(f5.Html,{position:[0,-.2,0],center:!0,children:(0,n.jsxs)("div",{ref:y,className:"PlayerNameplate PlayerBottom",children:[(0,n.jsx)("div",{className:"PlayerNameplate-name",children:x}),M&&(0,n.jsx)("div",{className:"PlayerNameplate-healthBar",children:(0,n.jsx)("div",{ref:b,className:"PlayerNameplate-healthFill"})})]})})]}),d[14]=x,d[15]=M,d[16]=E,d[17]=D,d[18]=B,d[19]=l):l=d[19],d[20]!==l?(c=(0,n.jsx)("group",{ref:g,children:l}),d[20]=l,d[21]=c):c=d[21],c}function hG(e){return null!=e.health}function hL(e){let t,r,a,o,s,l,u,c,d=(0,i.c)(80),{entity:f,timeRef:h}=e,m=(0,R.useEngineStoreApi)(),p=(0,E.useDebug)(),g=p?.debugMode??!1,v=String(f.id);if(f.visual?.kind==="tracer"){let e,t,r,a,i;return d[0]===Symbol.for("react.memo_cache_sentinel")?(e={demoVisualKind:"tracer"},d[0]=e):e=d[0],d[1]!==f?(t=(0,n.jsx)(hh.Suspense,{fallback:null,children:(0,n.jsx)(hk,{entity:f,visual:f.visual})}),d[1]=f,d[2]=t):t=d[2],d[3]!==g||d[4]!==f?(r=g?(0,n.jsx)(hj,{entity:f}):null,d[3]=g,d[4]=f,d[5]=r):r=d[5],d[6]!==t||d[7]!==r?(a=(0,n.jsxs)("group",{name:"model",userData:e,children:[t,r]}),d[6]=t,d[7]=r,d[8]=a):a=d[8],d[9]!==v||d[10]!==a?(i=(0,n.jsx)("group",{name:v,children:a}),d[9]=v,d[10]=a,d[11]=i):i=d[11],i}if(f.visual?.kind==="sprite"){let e,t,r,a,i;return d[12]===Symbol.for("react.memo_cache_sentinel")?(e={demoVisualKind:"sprite"},d[12]=e):e=d[12],d[13]!==f.visual?(t=(0,n.jsx)(hh.Suspense,{fallback:null,children:(0,n.jsx)(hM,{visual:f.visual})}),d[13]=f.visual,d[14]=t):t=d[14],d[15]!==g||d[16]!==f?(r=g?(0,n.jsx)(hj,{entity:f}):null,d[15]=g,d[16]=f,d[17]=r):r=d[17],d[18]!==t||d[19]!==r?(a=(0,n.jsxs)("group",{name:"model",userData:e,children:[t,r]}),d[18]=t,d[19]=r,d[20]=a):a=d[20],d[21]!==v||d[22]!==a?(i=(0,n.jsx)("group",{name:v,children:a}),d[21]=v,d[22]=a,d[23]=i):i=d[23],i}if(!f.dataBlock){let e,t,r,a,i,o;return d[24]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("sphereGeometry",{args:[.3,6,4]}),d[24]=e):e=d[24],d[25]!==f.type?(t=hf(f.type),d[25]=f.type,d[26]=t):t=d[26],d[27]!==t?(r=(0,n.jsxs)("mesh",{children:[e,(0,n.jsx)("meshBasicMaterial",{color:t,wireframe:!0})]}),d[27]=t,d[28]=r):r=d[28],d[29]!==g||d[30]!==f?(a=g?(0,n.jsx)(hj,{entity:f}):null,d[29]=g,d[30]=f,d[31]=a):a=d[31],d[32]!==r||d[33]!==a?(i=(0,n.jsxs)("group",{name:"model",children:[r,a]}),d[32]=r,d[33]=a,d[34]=i):i=d[34],d[35]!==v||d[36]!==i?(o=(0,n.jsx)("group",{name:v,children:i}),d[35]=v,d[36]=i,d[37]=o):o=d[37],o}d[38]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("sphereGeometry",{args:[.5,8,6]}),d[38]=t):t=d[38],d[39]!==f.type?(r=hf(f.type),d[39]=f.type,d[40]=r):r=d[40],d[41]!==r?(a=(0,n.jsxs)("mesh",{children:[t,(0,n.jsx)("meshBasicMaterial",{color:r,wireframe:!0})]}),d[41]=r,d[42]=a):a=d[42];let y=a;if("Player"===f.type){let e,t,r,a,i,o,s;d[43]!==m?(e=m.getState().playback.recording?.controlPlayerGhostId,d[43]=m,d[44]=e):e=d[44];let l=f.id===e;return d[45]!==f||d[46]!==h?(t=(0,n.jsx)(hm,{entity:f,timeRef:h}),d[45]=f,d[46]=h,d[47]=t):t=d[47],d[48]!==y||d[49]!==t?(r=(0,n.jsx)(hh.Suspense,{fallback:y,children:t}),d[48]=y,d[49]=t,d[50]=r):r=d[50],d[51]!==y||d[52]!==r?(a=(0,n.jsx)(h_,{fallback:y,children:r}),d[51]=y,d[52]=r,d[53]=a):a=d[53],d[54]!==f||d[55]!==l||d[56]!==h?(i=!l&&(0,n.jsx)(hh.Suspense,{fallback:null,children:(0,n.jsx)(hP,{entity:f,timeRef:h})}),d[54]=f,d[55]=l,d[56]=h,d[57]=i):i=d[57],d[58]!==a||d[59]!==i?(o=(0,n.jsxs)("group",{name:"model",children:[a,i]}),d[58]=a,d[59]=i,d[60]=o):o=d[60],d[61]!==v||d[62]!==o?(s=(0,n.jsx)("group",{name:v,children:o}),d[61]=v,d[62]=o,d[63]=s):s=d[63],s}return d[64]!==f.dataBlock||d[65]!==f.id?(o=(0,n.jsx)(hy,{shapeName:f.dataBlock,entityId:f.id}),d[64]=f.dataBlock,d[65]=f.id,d[66]=o):o=d[66],d[67]!==y||d[68]!==o?(s=(0,n.jsx)(hh.Suspense,{fallback:y,children:o}),d[67]=y,d[68]=o,d[69]=s):s=d[69],d[70]!==y||d[71]!==s?(l=(0,n.jsx)("group",{name:"model",children:(0,n.jsx)(h_,{fallback:y,children:s})}),d[70]=y,d[71]=s,d[72]=l):l=d[72],d[73]!==f.dataBlock||d[74]!==f.weaponShape?(u=f.weaponShape&&(0,n.jsx)("group",{name:"weapon",children:(0,n.jsx)(h_,{fallback:null,children:(0,n.jsx)(hh.Suspense,{fallback:null,children:(0,n.jsx)(hA,{shapeName:f.weaponShape,playerShapeName:f.dataBlock})})})}),d[73]=f.dataBlock,d[74]=f.weaponShape,d[75]=u):u=d[75],d[76]!==v||d[77]!==l||d[78]!==u?(c=(0,n.jsxs)("group",{name:v,children:[l,u]}),d[76]=v,d[77]=l,d[78]=u,d[79]=c):c=d[79],c}function hj(e){let t,r,a=(0,i.c)(9),{entity:o}=e,s=String(o.id);a[0]!==o.className||a[1]!==o.dataBlockId||a[2]!==o.ghostIndex||a[3]!==o.shapeHint||a[4]!==o.type||a[5]!==s?((t=[]).push(`${s} (${o.type})`),o.className&&t.push(`class ${o.className}`),"number"==typeof o.ghostIndex&&t.push(`ghost ${o.ghostIndex}`),"number"==typeof o.dataBlockId&&t.push(`db ${o.dataBlockId}`),t.push(o.shapeHint?`shapeHint ${o.shapeHint}`:"shapeHint "),a[0]=o.className,a[1]=o.dataBlockId,a[2]=o.ghostIndex,a[3]=o.shapeHint,a[4]=o.type,a[5]=s,a[6]=t):t=a[6];let l=t.join(" | ");return a[7]!==l?(r=(0,n.jsx)(e3.FloatingLabel,{color:"#ff6688",children:l}),a[7]=l,a[8]=r):r=a[8],r}class h_ extends hh.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.warn("[demo] Shape load failed:",e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}let hO=new u.Vector3,hU=new u.Quaternion,hH=new u.Quaternion,hN=new u.Vector3,hJ=new u.Vector3,hK=new u.Vector3,hV=new u.Vector3,hz=new u.Raycaster,hq=0,hQ=0;function hW({recording:e}){let t=(0,R.useEngineStoreApi)(),r=(0,o.useRef)(null);r.current||(r.current=hn("StreamingDemoPlayback"));let a=(0,o.useRef)(null),i=(0,o.useRef)(0),s=(0,o.useRef)(0),l=(0,o.useRef)(null),c=(0,o.useRef)(null),d=(0,o.useRef)(new u.Vector3(0,2.1,0)),f=(0,o.useRef)(e.streamingPlayback??null),h=(0,o.useRef)(null),m=(0,o.useRef)(""),p=(0,o.useRef)(new Map),g=(0,o.useRef)(0),v=(0,o.useRef)(!1),[F,b]=(0,o.useState)([]),[C,B]=(0,o.useState)(null);(0,o.useEffect)(()=>{hq+=1;let a=Date.now();return t.getState().recordPlaybackDiagnosticEvent({kind:"component.lifecycle",message:"StreamingDemoPlayback mounted",meta:{component:"StreamingDemoPlayback",phase:"mount",instanceId:r.current,mountCount:hq,unmountCount:hQ,recordingMissionName:e.missionName??null,recordingDurationSec:Number(e.duration.toFixed(3)),ts:a}}),console.info("[demo diagnostics] StreamingDemoPlayback mounted",{instanceId:r.current,mountCount:hq,unmountCount:hQ,recordingMissionName:e.missionName??null,mountedAt:a}),()=>{hQ+=1;let a=Date.now();t.getState().recordPlaybackDiagnosticEvent({kind:"component.lifecycle",message:"StreamingDemoPlayback unmounted",meta:{component:"StreamingDemoPlayback",phase:"unmount",instanceId:r.current,mountCount:hq,unmountCount:hQ,recordingMissionName:e.missionName??null,ts:a}}),console.info("[demo diagnostics] StreamingDemoPlayback unmounted",{instanceId:r.current,mountCount:hq,unmountCount:hQ,recordingMissionName:e.missionName??null,unmountedAt:a})}},[t]);let S=(0,o.useCallback)(e=>{let r=p.current.size,a=function(e){let t=[];for(let r of e.entities){let e=r.visual?.kind==="tracer"?`tracer:${r.visual.texture}:${r.visual.crossTexture??""}:${r.visual.tracerLength}:${r.visual.tracerWidth}:${r.visual.crossViewAng}:${r.visual.crossSize}:${+!!r.visual.renderCross}`:r.visual?.kind==="sprite"?`sprite:${r.visual.texture}:${r.visual.color.r}:${r.visual.color.g}:${r.visual.color.b}:${r.visual.size}`:"";t.push(`${r.id}|${r.type}|${r.dataBlock??""}|${r.weaponShape??""}|${r.playerName??""}|${r.className??""}|${r.ghostIndex??""}|${r.dataBlockId??""}|${r.shapeHint??""}|${r.faceViewer?"fv":""}|${e}`)}return t.sort(),t.join(";")}(e),n=m.current!==a,i=new Map;for(let t of e.entities){var o,s,l,u,c,d,f,h,v;let r=p.current.get(t.id);r&&r.type===t.type&&r.dataBlock===t.dataBlock&&r.weaponShape===t.weaponShape&&r.className===t.className&&r.ghostIndex===t.ghostIndex&&r.dataBlockId===t.dataBlockId&&r.shapeHint===t.shapeHint||(o=t.id,s=t.type,l=t.dataBlock,u=t.visual,c=t.direction,d=t.weaponShape,f=t.playerName,h=t.className,v=t.ghostIndex,r={id:o,type:s,dataBlock:l,visual:u,direction:c,weaponShape:d,playerName:f,className:h,ghostIndex:v,dataBlockId:t.dataBlockId,shapeHint:t.shapeHint,keyframes:[{time:0,position:[0,0,0],rotation:[0,0,0,1]}]}),r.playerName=t.playerName,r.iffColor=t.iffColor,r.dataBlock=t.dataBlock,r.visual=t.visual,r.direction=t.direction,r.weaponShape=t.weaponShape,r.className=t.className,r.ghostIndex=t.ghostIndex,r.dataBlockId=t.dataBlockId,r.shapeHint=t.shapeHint,0===r.keyframes.length&&r.keyframes.push({time:e.timeSec,position:t.position??[0,0,0],rotation:t.rotation??[0,0,0,1]});let a=r.keyframes[0];a.time=e.timeSec,t.position&&(a.position=t.position),t.rotation&&(a.rotation=t.rotation),a.velocity=t.velocity,a.health=t.health,a.energy=t.energy,a.actionAnim=t.actionAnim,a.actionAtEnd=t.actionAtEnd,a.damageState=t.damageState,i.set(t.id,r)}if(p.current=i,n){m.current=a,b(Array.from(i.values()));let n=Date.now();n-g.current>=500&&(g.current=n,t.getState().recordPlaybackDiagnosticEvent({kind:"stream.entities.rebuild",message:"Renderable demo entity list was rebuilt",meta:{previousEntityCount:r,nextEntityCount:i.size,snapshotTimeSec:Number(e.timeSec.toFixed(3))}}))}let y=null;if(e.camera?.mode==="first-person"&&e.camera.controlEntityId){let t=i.get(e.camera.controlEntityId);t?.dataBlock&&(y=t.dataBlock)}B(e=>e===y?e:y)},[t]);return(0,o.useEffect)(()=>{f.current=e.streamingPlayback??null,p.current=new Map,m.current="",h.current=null,i.current=0,s.current=0,l.current=null,c.current=null,v.current=!1;let r=f.current;if(!r)return void t.getState().setPlaybackStreamSnapshot(null);for(let e of(r.reset(),r.getEffectShapes()))e2.preload((0,y.shapeToUrl)(e));let a=r.getSnapshot();return i.current=a.timeSec,s.current=a.timeSec,l.current=a,c.current=a,S(a),t.getState().setPlaybackStreamSnapshot(a),h.current=a,()=>{t.getState().setPlaybackStreamSnapshot(null)}},[e,t,S]),(0,A.useFrame)((e,r)=>{let n=f.current;if(!n)return;let o=t.getState(),u=o.playback,m="playing"===u.status,p=u.timeMs/1e3,g=!m&&Math.abs(p-s.current)>5e-4,y=m&&Math.abs(p-i.current)>.05,A=g||y;A&&(s.current=p),m&&(s.current+=r*u.rate);let F=Math.max(1,Math.ceil(1e3*r*Math.max(u.rate,.01)/32)+2),b=s.current+.032,C=n.stepToTime(b,m&&!A?F:1/0),B=c.current;!B||C.timeSec.048?(l.current=C,c.current=C):C.timeSec!==B.timeSec&&(l.current=B,c.current=C);let x=c.current??C,E=l.current??x,M=x.timeSec-.032,D=Math.max(0,Math.min(1,(s.current-M)/.032));i.current=s.current,C.exhausted&&m&&(s.current=Math.min(s.current,C.timeSec)),S(x);let k=h.current;k&&x.timeSec===k.timeSec&&x.exhausted===k.exhausted&&x.status.health===k.status.health&&x.status.energy===k.status.energy&&x.camera?.mode===k.camera?.mode&&x.camera?.controlEntityId===k.camera?.controlEntityId&&x.camera?.orbitTargetId===k.camera?.orbitTargetId||(h.current=x,o.setPlaybackStreamSnapshot(x));let I=x.camera,w=I&&E.camera&&E.camera.mode===I.mode&&E.camera.controlEntityId===I.controlEntityId&&E.camera.orbitTargetId===I.orbitTargetId?E.camera:null;if(I){if(w){let t=w.position[0],r=w.position[1],a=w.position[2],n=I.position[0],i=I.position[1],o=I.position[2];e.camera.position.set(r+(i-r)*D,a+(o-a)*D,t+(n-t)*D),hU.set(...w.rotation),hH.set(...I.rotation),hU.slerp(hH,D),e.camera.quaternion.copy(hU)}else e.camera.position.set(I.position[1],I.position[2],I.position[0]),e.camera.quaternion.set(...I.rotation);if(Number.isFinite(I.fov)&&"isPerspectiveCamera"in e.camera&&e.camera.isPerspectiveCamera){var T,R;let t=e.camera,r=(T=w&&Number.isFinite(w.fov)?w.fov+(I.fov-w.fov)*D:I.fov,180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,T))*Math.PI/180/2)/(Number.isFinite(R=t.aspect)&&R>1e-6?R:4/3)))/Math.PI);Math.abs(t.fov-r)>.01&&(t.fov=r,t.updateProjectionMatrix())}}let P=new Map(x.entities.map(e=>[e.id,e])),G=new Map(E.entities.map(e=>[e.id,e])),L=a.current;if(L)for(let t of L.children){let r=P.get(t.name);if(!r?.position){t.visible=!1;continue}t.visible=!0;let a=G.get(t.name);if(a?.position){let e=a.position[0],n=a.position[1],i=a.position[2],o=r.position[0],s=r.position[1],l=r.position[2],u=e+(o-e)*D,c=n+(s-n)*D,d=i+(l-i)*D;t.position.set(c,d,u)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion):r.visual?.kind==="tracer"?t.quaternion.identity():r.rotation&&(a?.rotation?(hU.set(...a.rotation),hH.set(...r.rotation),hU.slerp(hH,D),t.quaternion.copy(hU)):t.quaternion.set(...r.rotation))}let j=I?.mode;if("third-person"===j&&L&&I?.orbitTargetId){let t=L.children.find(e=>e.name===I.orbitTargetId);if(t){let r=P.get(I.orbitTargetId);hJ.copy(t.position),r?.type==="Player"&&(hJ.y+=1);let a=!1;if("number"==typeof I.yaw&&"number"==typeof I.pitch){let e=Math.sin(I.pitch),t=Math.cos(I.pitch),r=Math.sin(I.yaw),n=Math.cos(I.yaw);hN.set(-t,-r*e,-n*e),a=hN.lengthSq()>1e-8}if(a||(hN.copy(e.camera.position).sub(hJ),a=hN.lengthSq()>1e-8),a){hN.normalize();let t=Math.max(.1,I.orbitDistance??4);for(let r of(hK.copy(hJ).addScaledVector(hN,t),hz.near=.001,hz.far=2.5*t,hz.camera=e.camera,hz.set(hJ,hN),hz.intersectObjects(e.scene.children,!0))){if(r.distance<=1e-4||function(e,t){let r=e;for(;r;){if(r.name===t)return!0;r=r.parent}return!1}(r.object,I.orbitTargetId))continue;if(!r.face)break;hV.copy(r.face.normal).transformDirection(r.object.matrixWorld);let e=-hN.dot(hV);if(e>.01){let a=r.distance-.05/e;a>t&&(a=t),a<0&&(a=0),hK.copy(hJ).addScaledVector(hN,a)}break}e.camera.position.copy(hK),e.camera.lookAt(hJ)}}}if("first-person"===j&&L&&I?.controlEntityId){let t=L.children.find(e=>e.name===I.controlEntityId);t?(hO.copy(d.current).applyQuaternion(t.quaternion),e.camera.position.add(hO)):e.camera.position.y+=d.current.y}m&&C.exhausted?(v.current||(v.current=!0,o.recordPlaybackDiagnosticEvent({kind:"stream.exhausted",message:"Streaming playback reached end-of-stream while playing",meta:{streamTimeSec:Number(C.timeSec.toFixed(3)),requestedPlaybackSec:Number(s.current.toFixed(3))}})),o.setPlaybackStatus("paused")):C.exhausted||(v.current=!1);let _=1e3*s.current;Math.abs(_-u.timeMs)>.5&&o.setPlaybackTime(_)}),(0,n.jsxs)(tP,{children:[(0,n.jsx)("group",{ref:a,children:F.map(e=>(0,n.jsx)(hL,{entity:e,timeRef:i},e.id))}),C&&(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(hv,{shapeName:C,eyeOffsetRef:d})})]})}let hX=0,hY=0;function hZ({recording:e}){let{gl:t,scene:r}=(0,F.useThree)(),a=(0,R.useEngineStoreApi)(),n=(0,o.useRef)(null),i=(0,o.useRef)(0);return(0,o.useEffect)(()=>{a.getState().recordPlaybackDiagnosticEvent({kind:"recording.loaded",meta:{missionName:e.missionName??null,gameType:e.gameType??null,isMetadataOnly:!!e.isMetadataOnly,isPartial:!!e.isPartial,hasStreamingPlayback:!!e.streamingPlayback,durationSec:Number(e.duration.toFixed(3))}})},[a]),(0,o.useEffect)(()=>{let e=t.domElement;if(!e)return;let r=()=>{try{let e=t.getContext();if(e&&"function"==typeof e.isContextLost)return!!e.isContextLost()}catch{}},n=e=>{e.preventDefault();let t=a.getState();t.setWebglContextLost(!0),t.recordPlaybackDiagnosticEvent({kind:"webgl.context.lost",message:"Renderer emitted webglcontextlost",meta:{contextLost:r()}}),console.error("[demo diagnostics] WebGL context lost")},i=()=>{let e=a.getState();e.setWebglContextLost(!1),e.recordPlaybackDiagnosticEvent({kind:"webgl.context.restored",message:"Renderer emitted webglcontextrestored",meta:{contextLost:r()}}),console.warn("[demo diagnostics] WebGL context restored")},o=e=>{a.getState().recordPlaybackDiagnosticEvent({kind:"webgl.context.creation_error",message:e.statusMessage??"Context creation error",meta:{contextLost:r()}}),console.error("[demo diagnostics] WebGL context creation error",e.statusMessage??"")};return e.addEventListener("webglcontextlost",n,!1),e.addEventListener("webglcontextrestored",i,!1),e.addEventListener("webglcontextcreationerror",o,!1),()=>{e.removeEventListener("webglcontextlost",n,!1),e.removeEventListener("webglcontextrestored",i,!1),e.removeEventListener("webglcontextcreationerror",o,!1)}},[a,t]),(0,o.useEffect)(()=>{let e=()=>{let e,o,{sceneObjects:s,visibleSceneObjects:l}=(e=0,o=0,r.traverse(t=>{e+=1,t.visible&&(o+=1)}),{sceneObjects:e,visibleSceneObjects:o}),u=Array.isArray(t.info.programs)?t.info.programs.length:0,c=performance.memory,d={t:Date.now(),geometries:t.info.memory.geometries,textures:t.info.memory.textures,programs:u,renderCalls:t.info.render.calls,renderTriangles:t.info.render.triangles,renderPoints:t.info.render.points,renderLines:t.info.render.lines,sceneObjects:s,visibleSceneObjects:l,jsHeapUsed:c?.usedJSHeapSize,jsHeapTotal:c?.totalJSHeapSize,jsHeapLimit:c?.jsHeapSizeLimit};a.getState().appendRendererSample(d);let f=n.current;if(n.current={geometries:d.geometries,textures:d.textures,programs:d.programs,sceneObjects:d.sceneObjects,visibleSceneObjects:d.visibleSceneObjects},!f)return;let h=d.t,m=d.geometries-f.geometries,p=d.textures-f.textures,g=d.programs-f.programs,v=d.sceneObjects-f.sceneObjects;h-i.current>=5e3&&(m>=200||p>=100||g>=20||v>=400)&&(i.current=h,a.getState().recordPlaybackDiagnosticEvent({kind:"renderer.resource.spike",message:"Detected large one-second renderer resource increase",meta:{geometryDelta:m,textureDelta:p,programDelta:g,sceneObjectDelta:v,geometries:d.geometries,textures:d.textures,programs:d.programs,sceneObjects:d.sceneObjects}}))};e();let o=window.setInterval(e,1e3);return()=>{window.clearInterval(o)}},[a,t,r]),null}function h$(){let e=(0,R.useEngineStoreApi)(),t=r$(),r=(0,o.useRef)(null);return(r.current||(r.current=hn("DemoPlayback")),(0,o.useEffect)(()=>{hX+=1;let a=Date.now();return e.getState().recordPlaybackDiagnosticEvent({kind:"component.lifecycle",message:"DemoPlayback mounted",meta:{component:"DemoPlayback",phase:"mount",instanceId:r.current,mountCount:hX,unmountCount:hY,recordingMissionName:t?.missionName??null,recordingDurationSec:t?Number(t.duration.toFixed(3)):null,ts:a}}),console.info("[demo diagnostics] DemoPlayback mounted",{instanceId:r.current,mountCount:hX,unmountCount:hY,recordingMissionName:t?.missionName??null,mountedAt:a}),()=>{hY+=1;let a=Date.now();e.getState().recordPlaybackDiagnosticEvent({kind:"component.lifecycle",message:"DemoPlayback unmounted",meta:{component:"DemoPlayback",phase:"unmount",instanceId:r.current,mountCount:hX,unmountCount:hY,recordingMissionName:t?.missionName??null,ts:a}}),console.info("[demo diagnostics] DemoPlayback unmounted",{instanceId:r.current,mountCount:hX,unmountCount:hY,recordingMissionName:t?.missionName??null,unmountedAt:a})}},[e]),t)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(hZ,{recording:t}),(0,n.jsx)(hW,{recording:t})]}):null}var h0=e.i(30064);let h1=[.25,.5,1,2,4];function h2(e){let t=Math.floor(e/60),r=Math.floor(e%60);return`${t}:${r.toString().padStart(2,"0")}`}function h3(){let e,t,r,a,o,s,l,u,c,d,f,h,m,p,g,v,y,A,F,b,C=(0,i.c)(55),B=r$(),S=r1(),x=r3(),E=(0,R.useEngineSelector)(r5),M=(0,R.useEngineSelector)(r8),{play:D,pause:k,seek:I,setSpeed:w}=r6(),T=(0,R.useEngineStoreApi)(),P=(0,R.useEngineSelector)(mr),G=(0,R.useEngineSelector)(mt),L=(0,R.useEngineSelector)(me),j=(0,R.useEngineSelector)(h7),_=(0,R.useEngineSelector)(h4);C[0]!==I?(e=e=>{I(parseFloat(e.target.value))},C[0]=I,C[1]=e):e=C[1];let O=e;C[2]!==w?(t=e=>{w(parseFloat(e.target.value))},C[2]=w,C[3]=t):t=C[3];let U=t;C[4]!==T?(r=()=>{let e=T.getState(),t=(0,h0.buildSerializableDiagnosticsSnapshot)(e),r=(0,h0.buildSerializableDiagnosticsJson)(e);console.log("[demo diagnostics dump]",t),console.log("[demo diagnostics dump json]",r)},C[4]=T,C[5]=r):r=C[5];let H=r;C[6]!==T?(a=()=>{T.getState().clearPlaybackDiagnostics(),console.info("[demo diagnostics] Cleared playback diagnostics")},C[6]=T,C[7]=a):a=C[7];let N=a;if(!B)return null;let J=S?k:D,K=S?"Pause":"Play",V=S?"❚❚":"▶";C[8]!==J||C[9]!==K||C[10]!==V?(o=(0,n.jsx)("button",{className:"DemoControls-playPause",onClick:J,"aria-label":K,children:V}),C[8]=J,C[9]=K,C[10]=V,C[11]=o):o=C[11],C[12]!==x?(s=h2(x),C[12]=x,C[13]=s):s=C[13],C[14]!==E?(l=h2(E),C[14]=E,C[15]=l):l=C[15];let z=`${s} / ${l}`;C[16]!==z?(u=(0,n.jsx)("span",{className:"DemoControls-time",children:z}),C[16]=z,C[17]=u):u=C[17],C[18]!==x||C[19]!==E||C[20]!==O?(c=(0,n.jsx)("input",{className:"DemoControls-seek",type:"range",min:0,max:E,step:.01,value:x,onChange:O}),C[18]=x,C[19]=E,C[20]=O,C[21]=c):c=C[21],C[22]===Symbol.for("react.memo_cache_sentinel")?(d=h1.map(h9),C[22]=d):d=C[22],C[23]!==U||C[24]!==M?(f=(0,n.jsx)("select",{className:"DemoControls-speed",value:M,onChange:U,children:d}),C[23]=U,C[24]=M,C[25]=f):f=C[25];let q=P?"true":void 0,Q=P?"WebGL context: LOST":"WebGL context: ok";if(C[26]!==Q?(h=(0,n.jsx)("div",{className:"DemoDiagnosticsPanel-status",children:Q}),C[26]=Q,C[27]=h):h=C[27],C[28]!==L){var W;m=(0,n.jsx)("div",{className:"DemoDiagnosticsPanel-metrics",children:L?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{children:["geom ",L.geometries," tex"," ",L.textures," prog"," ",L.programs]}),(0,n.jsxs)("span",{children:["draw ",L.renderCalls," tri"," ",L.renderTriangles]}),(0,n.jsxs)("span",{children:["scene ",L.visibleSceneObjects,"/",L.sceneObjects]}),(0,n.jsxs)("span",{children:["heap ",Number.isFinite(W=L.jsHeapUsed)&&null!=W?W<1024?`${Math.round(W)} B`:W<1048576?`${(W/1024).toFixed(1)} KB`:W<0x40000000?`${(W/1048576).toFixed(1)} MB`:`${(W/0x40000000).toFixed(2)} GB`:"n/a"]})]}):(0,n.jsx)("span",{children:"No renderer samples yet"})}),C[28]=L,C[29]=m}else m=C[29];return C[30]!==j||C[31]!==G?(p=(0,n.jsxs)("span",{children:["samples ",G," events ",j]}),C[30]=j,C[31]=G,C[32]=p):p=C[32],C[33]!==_?(g=_?(0,n.jsxs)("span",{title:_.message,children:["last event: ",_.kind]}):(0,n.jsx)("span",{children:"last event: none"}),C[33]=_,C[34]=g):g=C[34],C[35]!==H?(v=(0,n.jsx)("button",{type:"button",onClick:H,children:"Dump"}),C[35]=H,C[36]=v):v=C[36],C[37]!==N?(y=(0,n.jsx)("button",{type:"button",onClick:N,children:"Clear"}),C[37]=N,C[38]=y):y=C[38],C[39]!==p||C[40]!==g||C[41]!==v||C[42]!==y?(A=(0,n.jsxs)("div",{className:"DemoDiagnosticsPanel-footer",children:[p,g,v,y]}),C[39]=p,C[40]=g,C[41]=v,C[42]=y,C[43]=A):A=C[43],C[44]!==q||C[45]!==h||C[46]!==m||C[47]!==A?(F=(0,n.jsxs)("div",{className:"DemoDiagnosticsPanel","data-context-lost":q,children:[h,m,A]}),C[44]=q,C[45]=h,C[46]=m,C[47]=A,C[48]=F):F=C[48],C[49]!==u||C[50]!==c||C[51]!==f||C[52]!==F||C[53]!==o?(b=(0,n.jsxs)("div",{className:"DemoControls",onKeyDown:h6,onPointerDown:h8,onClick:h5,children:[o,u,c,f,F]}),C[49]=u,C[50]=c,C[51]=f,C[52]=F,C[53]=o,C[54]=b):b=C[54],b}function h9(e){return(0,n.jsxs)("option",{value:e,children:[e,"x"]},e)}function h5(e){return e.stopPropagation()}function h8(e){return e.stopPropagation()}function h6(e){return e.stopPropagation()}function h4(e){let t=e.diagnostics.playbackEvents;return t.length>0?t[t.length-1]:null}function h7(e){return e.diagnostics.playbackEvents.length}function me(e){let t=e.diagnostics.rendererSamples;return t.length>0?t[t.length-1]:null}function mt(e){return e.diagnostics.rendererSamples.length}function mr(e){return e.diagnostics.webglContextLost}var ma=e.i(75840);function mn(e,t){if(0===e.length)return{health:1,energy:1};let r=0,a=e.length-1;if(t<=e[0].time)return{health:e[0].health??1,energy:e[0].energy??1};if(t>=e[a].time)return{health:e[a].health??1,energy:e[a].energy??1};for(;a-r>1;){let n=r+a>>1;e[n].time<=t?r=n:a=n}return{health:e[r].health??1,energy:e[r].energy??1}}function mi(e){let t,r=(0,i.c)(2),{value:a}=e,o=Math.max(0,Math.min(100,100*a)),s=`${o}%`;return r[0]!==s?(t=(0,n.jsx)("div",{className:ma.default.HealthBar,children:(0,n.jsx)("div",{className:ma.default.BarFill,style:{width:s}})}),r[0]=s,r[1]=t):t=r[1],t}function mo(e){let t,r=(0,i.c)(2),{value:a}=e,o=Math.max(0,Math.min(100,100*a)),s=`${o}%`;return r[0]!==s?(t=(0,n.jsx)("div",{className:ma.default.EnergyBar,children:(0,n.jsx)("div",{className:ma.default.BarFill,style:{width:s}})}),r[0]=s,r[1]=t):t=r[1],t}function ms(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:ma.default.ChatWindow}),t[0]=e):e=t[0],e}function ml(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:ma.default.WeaponSlots}),t[0]=e):e=t[0],e}function mu(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:ma.default.ToolBelt}),t[0]=e):e=t[0],e}function mc(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:ma.default.Reticle}),t[0]=e):e=t[0],e}function md(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:ma.default.TeamStats}),t[0]=e):e=t[0],e}function mf(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:ma.default.Compass}),t[0]=e):e=t[0],e}function mh(){let e,t,r,a,o,s,l,u,c,d,f,h,m=(0,i.c)(44),p=r$(),g=r3(),v=(0,R.useEngineSelector)(mm);if(m[0]!==p){e:{let t=new Map;if(!p){e=t;break e}for(let e of p.entities)t.set(e.id,e);e=t}m[0]=p,m[1]=e}else e=m[1];let y=e;if(!p)return null;if(p.isMetadataOnly||p.isPartial){let e,t,r,a,i,o,s,l,u,c=v?.status;return c?(m[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(ms,{}),t=(0,n.jsx)(mf,{}),m[2]=e,m[3]=t):(e=m[2],t=m[3]),m[4]!==c.health?(r=(0,n.jsx)(mi,{value:c.health}),m[4]=c.health,m[5]=r):r=m[5],m[6]!==c.energy?(a=(0,n.jsx)(mo,{value:c.energy}),m[6]=c.energy,m[7]=a):a=m[7],m[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)(md,{}),o=(0,n.jsx)(mc,{}),s=(0,n.jsx)(mu,{}),l=(0,n.jsx)(ml,{}),m[8]=i,m[9]=o,m[10]=s,m[11]=l):(i=m[8],o=m[9],s=m[10],l=m[11]),m[12]!==r||m[13]!==a?(u=(0,n.jsxs)("div",{className:ma.default.PlayerHUD,children:[e,t,r,a,i,o,s,l]}),m[12]=r,m[13]=a,m[14]=u):u=m[14],u):null}m[15]!==g||m[16]!==p.cameraModes?(t=function(e,t){if(0===e.length||t=e[e.length-1].time)return e[e.length-1];let r=0,a=e.length-1;for(;a-r>1;){let n=r+a>>1;e[n].time<=t?r=n:a=n}return e[r]}(p.cameraModes,g),m[15]=g,m[16]=p.cameraModes,m[17]=t):t=m[17];let A=t;m[18]===Symbol.for("react.memo_cache_sentinel")?(r={health:1,energy:1},m[18]=r):r=m[18];let F=r;if(A?.mode==="first-person"){let e,t,r;if(m[19]!==g||m[20]!==y||m[21]!==p.controlPlayerGhostId){let r=p.controlPlayerGhostId?y.get(p.controlPlayerGhostId):void 0,a=y.get("recording_player");e=r?mn(r.keyframes,g):void 0,t=a?mn(a.keyframes,g):void 0,m[19]=g,m[20]=y,m[21]=p.controlPlayerGhostId,m[22]=e,m[23]=t}else e=m[22],t=m[23];let a=t,n=e?.health??1,i=a?.energy??e?.energy??1;m[24]!==n||m[25]!==i?(r={health:n,energy:i},m[24]=n,m[25]=i,m[26]=r):r=m[26],F=r}else if(A?.mode==="third-person"&&A.orbitTargetId)if(m[27]!==g||m[28]!==y||m[29]!==A.orbitTargetId){let e=y.get(A.orbitTargetId);e&&(F=mn(e.keyframes,g)),m[27]=g,m[28]=y,m[29]=A.orbitTargetId,m[30]=F}else F=m[30];return m[31]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)(ms,{}),o=(0,n.jsx)(mf,{}),m[31]=a,m[32]=o):(a=m[31],o=m[32]),m[33]!==F.health?(s=(0,n.jsx)(mi,{value:F.health}),m[33]=F.health,m[34]=s):s=m[34],m[35]!==F.energy?(l=(0,n.jsx)(mo,{value:F.energy}),m[35]=F.energy,m[36]=l):l=m[36],m[37]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(md,{}),d=(0,n.jsx)(mc,{}),f=(0,n.jsx)(mu,{}),u=(0,n.jsx)(ml,{}),m[37]=u,m[38]=c,m[39]=d,m[40]=f):(u=m[37],c=m[38],d=m[39],f=m[40]),m[41]!==s||m[42]!==l?(h=(0,n.jsxs)("div",{className:ma.default.PlayerHUD,children:[a,o,s,l,c,d,f,u]}),m[41]=s,m[42]=l,m[43]=h):h=m[43],h}function mm(e){return e.playback.streamSnapshot}var mp=e.i(50361),mg=e.i(24540);function mv(e,t,r){try{return e(t)}catch(e){return(0,mg.l)("[nuqs] Error while parsing value `%s`: %O"+(r?" (for key `%s`)":""),t,e,r),null}}function my(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),mv(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}my({parse:e=>e,serialize:String}),my({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),my({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),my({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),my({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let mA=my({parse:e=>"true"===e.toLowerCase(),serialize:String});function mF(e,t){return e.valueOf()===t.valueOf()}my({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:mF}),my({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:mF}),my({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:mF});let mb=(0,mp.r)(),mC={};function mB(e,t,r,a,n,i){let o=!1,s=Object.entries(e).reduce((e,[s,l])=>{var u;let c=t?.[s]??s,d=a[c],f="multi"===l.type?[]:null,h=void 0===d?("multi"===l.type?r?.getAll(c):r?.get(c))??f:d;return n&&i&&((u=n[c]??f)===h||null!==u&&null!==h&&"string"!=typeof u&&"string"!=typeof h&&u.length===h.length&&u.every((e,t)=>e===h[t]))?e[s]=i[s]??null:(o=!0,e[s]=((0,mp.i)(h)?null:mv(l.parse,h,c))??null,n&&(n[c]=h)),e},{});if(!o){let t=Object.keys(e),r=Object.keys(i??{});o=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:o}}function mS(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function mx(e,t={}){let{parse:r,type:a,serialize:n,eq:i,defaultValue:s,...l}=t,[{[e]:u},c]=function(e,t={}){let r=(0,o.useId)(),a=(0,mg.i)(),n=(0,mg.a)(),{history:i="replace",scroll:s=a?.scroll??!1,shallow:l=a?.shallow??!0,throttleMs:u=mp.s.timeMs,limitUrlUpdates:c=a?.limitUrlUpdates,clearOnDefault:d=a?.clearOnDefault??!0,startTransition:f,urlKeys:h=mC}=t,m=Object.keys(e).join(","),p=(0,o.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,h[e]??e])),[m,JSON.stringify(h)]),g=(0,mg.r)(Object.values(p)),v=g.searchParams,y=(0,o.useRef)({}),A=(0,o.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),F=mp.t.useQueuedQueries(Object.values(p)),[b,C]=(0,o.useState)(()=>mB(e,h,v??new URLSearchParams,F).state),B=(0,o.useRef)(b);if((0,mg.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",r,m,b,v),Object.keys(y.current).join("&")!==Object.values(p).join("&")){let{state:t,hasChanged:a}=mB(e,h,v,F,y.current,B.current);a&&((0,mg.c)("[nuq+ %s `%s`] State changed: %O",r,m,{state:t,initialSearchParams:v,queuedQueries:F,queryRef:y.current,stateRef:B.current}),B.current=t,C(t)),y.current=Object.fromEntries(Object.entries(p).map(([t,r])=>[r,e[t]?.type==="multi"?v?.getAll(r):v?.get(r)??null]))}(0,o.useEffect)(()=>{let{state:t,hasChanged:a}=mB(e,h,v,F,y.current,B.current);a&&((0,mg.c)("[nuq+ %s `%s`] State changed: %O",r,m,{state:t,initialSearchParams:v,queuedQueries:F,queryRef:y.current,stateRef:B.current}),B.current=t,C(t))},[Object.values(p).map(e=>`${e}=${v?.getAll(e)}`).join("&"),JSON.stringify(F)]),(0,o.useEffect)(()=>{let t=Object.keys(e).reduce((t,a)=>(t[a]=({state:t,query:n})=>{C(i=>{let{defaultValue:o}=e[a],s=p[a],l=t??o??null;return Object.is(i[a]??o??null,l)?((0,mg.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",r,m,s,t,o,B.current),i):(B.current={...B.current,[a]:l},y.current[s]=n,(0,mg.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",r,m,s,t,o,B.current),B.current)})},t),{});for(let a of Object.keys(e)){let e=p[a];(0,mg.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",r,e,m),mb.on(e,t[a])}return()=>{for(let a of Object.keys(e)){let e=p[a];(0,mg.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",r,e,m),mb.off(e,t[a])}}},[m,p]);let S=(0,o.useCallback)((t,a={})=>{let o,h=Object.fromEntries(Object.keys(e).map(e=>[e,null])),v="function"==typeof t?t(mS(B.current,A))??h:t??h;(0,mg.c)("[nuq+ %s `%s`] setState: %O",r,m,v);let y=0,F=!1,b=[];for(let[t,r]of Object.entries(v)){let h=e[t],m=p[t];if(!h||void 0===r)continue;(a.clearOnDefault??h.clearOnDefault??d)&&null!==r&&void 0!==h.defaultValue&&(h.eq??((e,t)=>e===t))(r,h.defaultValue)&&(r=null);let v=null===r?null:(h.serialize??String)(r);mb.emit(m,{state:r,query:v});let A={key:m,query:v,options:{history:a.history??h.history??i,shallow:a.shallow??h.shallow??l,scroll:a.scroll??h.scroll??s,startTransition:a.startTransition??h.startTransition??f}};if(a?.limitUrlUpdates?.method==="debounce"||c?.method==="debounce"||h.limitUrlUpdates?.method==="debounce"){!0===A.options.shallow&&console.warn((0,mg.s)(422));let e=a?.limitUrlUpdates?.timeMs??c?.timeMs??h.limitUrlUpdates?.timeMs??mp.s.timeMs,t=mp.t.push(A,e,g,n);yt(e),F?mp.n.flush(g,n):mp.n.getPendingPromise(g));return o??C},[m,i,l,s,u,c?.method,c?.timeMs,f,p,g.updateUrl,g.getSearchParamsSnapshot,g.rateLimitFactor,n,A]);return[(0,o.useMemo)(()=>mS(b,A),[b,A]),S]}({[e]:{parse:r??(e=>e),type:a,serialize:n,eq:i,defaultValue:s}},l);return[u,(0,o.useCallback)((t,r={})=>c(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,c])]}let mE=(0,o.lazy)(()=>e.A(59197).then(e=>({default:e.MapInfoDialog}))),mM=new rM,mD={toneMapping:u.NoToneMapping,outputColorSpace:u.SRGBColorSpace},mk=my({parse(e){let[t,r]=e.split("~"),a=r,n=(0,ri.getMissionInfo)(t).missionTypes;return r&&n.includes(r)||(a=n[0]),{missionName:t,missionType:a}},serialize:({missionName:e,missionType:t})=>1===(0,ri.getMissionInfo)(e).missionTypes.length?e:`${e}~${t}`,eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});function mI(){let e,t,r,a,s,l,[c,d]=mx("mission",mk),f=(0,R.useEngineStoreApi)(),[h,m]=mx("fog",mA),g=(0,o.useCallback)(()=>{m(null)},[m]),v=(0,o.useRef)(c);v.current=c;let y=(0,o.useCallback)(e=>{let t=v.current,r=function(e=0){let t=Error().stack;if(!t)return null;let r=t.split("\n").map(e=>e.trim()).filter(Boolean).slice(1+e,9+e);return r.length>0?r.join(" <= "):null}(1);f.getState().recordPlaybackDiagnosticEvent({kind:"mission.change.requested",message:"changeMission invoked",meta:{previousMissionName:t.missionName,previousMissionType:t.missionType??null,nextMissionName:e.missionName,nextMissionType:e.missionType??null,stack:r??"unavailable"}}),console.info("[mission trace] changeMission",{previousMission:t,nextMission:e,stack:r}),window.location.hash="",g(),d(e)},[f,d,g]),A=(r=(0,i.c)(2),a=(0,o.useRef)(null),r[0]===Symbol.for("react.memo_cache_sentinel")?(e=e=>{let t=window.matchMedia("(pointer: coarse)");return t.addEventListener("change",e),a.current=t,()=>{t.removeEventListener("change",e)}},r[0]=e):e=r[0],s=e,r[1]===Symbol.for("react.memo_cache_sentinel")?(t=()=>a.current?.matches??null,r[1]=t):t=r[1],l=t,(0,o.useSyncExternalStore)(s,l,fZ)),{missionName:F,missionType:b}=c,[C,B]=(0,o.useState)(!1),[S,x]=(0,o.useState)(0),[M,D]=(0,o.useState)(!0),k=S<1;(0,o.useEffect)(()=>{if(k)D(!0);else{let e=setTimeout(()=>D(!1),500);return()=>clearTimeout(e)}},[k]),(0,o.useEffect)(()=>(window.setMissionName=e=>{let t=(0,ri.getMissionInfo)(e).missionTypes;y({missionName:e,missionType:t[0]})},window.getMissionList=ri.getMissionList,window.getMissionInfo=ri.getMissionInfo,()=>{delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo}),[y]),(0,o.useEffect)(()=>{let e=e=>{if("KeyI"!==e.code||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||B(!0)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let I=(0,o.useCallback)((e,t=0)=>{x(t)},[]),w=(0,o.useRef)(null),T=(0,o.useRef)({angle:0,force:0}),P=(0,o.useRef)(null),G=(0,o.useRef)({angle:0,force:0}),L=(0,o.useRef)(null);return(0,n.jsx)(rD.QueryClientProvider,{client:mM,children:(0,n.jsx)("main",{children:(0,n.jsx)(rZ,{children:(0,n.jsx)(E.SettingsProvider,{fogEnabledOverride:h,onClearFogEnabledOverride:g,children:(0,n.jsxs)(rR,{map:rQ,children:[(0,n.jsxs)("div",{id:"canvasContainer",children:[M&&(0,n.jsxs)("div",{id:"loadingIndicator","data-complete":!k,children:[(0,n.jsx)("div",{className:"LoadingSpinner"}),(0,n.jsx)("div",{className:"LoadingProgress",children:(0,n.jsx)("div",{className:"LoadingProgress-bar",style:{width:`${100*S}%`}})}),(0,n.jsxs)("div",{className:"LoadingProgress-text",children:[Math.round(100*S),"%"]})]}),(0,n.jsx)(p,{frameloop:"always",gl:mD,shadows:{type:u.PCFShadowMap},onCreated:e=>{w.current=e.camera},children:(0,n.jsx)(t2,{children:(0,n.jsxs)(f1.AudioProvider,{children:[(0,n.jsx)(rd,{name:F,missionType:b,onLoadingChange:I},`${F}~${b}`),(0,n.jsx)(f0,{}),(0,n.jsx)(f8,{}),(0,n.jsx)(h$,{}),(0,n.jsx)(mR,{isTouch:A,joystickStateRef:T,joystickZoneRef:P,lookJoystickStateRef:G,lookJoystickZoneRef:L})]})})})]}),(0,n.jsx)(mh,{}),A&&(0,n.jsx)(am,{joystickState:T,joystickZone:P,lookJoystickState:G,lookJoystickZone:L}),!1===A&&(0,n.jsx)(ar,{}),(0,n.jsx)(fq,{missionName:F,missionType:b,onChangeMission:y,onOpenMapInfo:()=>B(!0),cameraRef:w,isTouch:A}),C&&(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(mE,{open:C,onClose:()=>B(!1),missionName:F,missionType:b??""})}),(0,n.jsx)(mT,{changeMission:y,currentMission:c}),(0,n.jsx)(h3,{}),(0,n.jsx)(mP,{})]})})})})})}let mw={"Capture the Flag":"CTF","Capture and Hold":"CnH",Deathmatch:"DM","Team Deathmatch":"TDM",Siege:"Siege",Bounty:"Bounty",Rabbit:"Rabbit"};function mT(e){let t,r,a=(0,i.c)(5),{changeMission:n,currentMission:s}=e,l=r$();return a[0]!==n||a[1]!==s||a[2]!==l?(t=()=>{if(!l?.missionName)return;let e=(0,ri.findMissionByDemoName)(l.missionName);if(!e)return void console.warn(`Demo mission "${l.missionName}" not found in manifest`);let t=(0,ri.getMissionInfo)(e),r=l.gameType?mw[l.gameType]:void 0,a=r&&t.missionTypes.includes(r)?r:t.missionTypes[0];(s.missionName!==e||s.missionType!==a)&&n({missionName:e,missionType:a})},r=[l,n,s],a[0]=n,a[1]=s,a[2]=l,a[3]=t,a[4]=r):(t=a[3],r=a[4]),(0,o.useEffect)(t,r),null}function mR(e){let t,r=(0,i.c)(6),{isTouch:a,joystickStateRef:o,joystickZoneRef:s,lookJoystickStateRef:l,lookJoystickZoneRef:u}=e;if(r1()||null===a)return null;if(a){let e;return r[0]!==o||r[1]!==s||r[2]!==l||r[3]!==u?(e=(0,n.jsx)(ap,{joystickState:o,joystickZone:s,lookJoystickState:l,lookJoystickZone:u}),r[0]=o,r[1]=s,r[2]=l,r[3]=u,r[4]=e):e=r[4],e}return r[5]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(rW,{}),r[5]=t):t=r[5],t}function mP(){let e,t,r=(0,i.c)(4),{setRecording:a}=r6(),n=(0,R.useEngineStoreApi)();return r[0]!==n||r[1]!==a?(e=()=>(window.loadDemoRecording=a,window.getDemoDiagnostics=()=>(0,h0.buildSerializableDiagnosticsSnapshot)(n.getState()),window.getDemoDiagnosticsJson=()=>(0,h0.buildSerializableDiagnosticsJson)(n.getState()),window.clearDemoDiagnostics=()=>{n.getState().clearPlaybackDiagnostics()},mG),t=[n,a],r[0]=n,r[1]=a,r[2]=e,r[3]=t):(e=r[2],t=r[3]),(0,o.useEffect)(e,t),null}function mG(){delete window.loadDemoRecording,delete window.getDemoDiagnostics,delete window.getDemoDiagnosticsJson,delete window.clearDemoDiagnostics}function mL(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(mI,{})}),t[0]=e):e=t[0],e}e.s(["default",()=>mL],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/afff663ba7029ccf.css b/docs/_next/static/chunks/afff663ba7029ccf.css deleted file mode 100644 index 337341c6..00000000 --- a/docs/_next/static/chunks/afff663ba7029ccf.css +++ /dev/null @@ -1 +0,0 @@ -.PlayerHUD-module__-E1Scq__PlayerHUD{z-index:1;pointer-events:none;padding-bottom:48px;position:absolute;inset:0}.PlayerHUD-module__-E1Scq__ChatWindow{position:absolute;top:60px;left:4px}.PlayerHUD-module__-E1Scq__Bar{background:#00000080;border:1px solid #fff3;width:160px;height:14px;position:absolute;overflow:hidden}.PlayerHUD-module__-E1Scq__HealthBar{top:60px;right:32px;}.PlayerHUD-module__-E1Scq__EnergyBar{top:80px;right:32px;}.PlayerHUD-module__-E1Scq__BarFill{height:100%;transition:width .15s ease-out;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__HealthBar .PlayerHUD-module__-E1Scq__BarFill{background:#2ecc40}.PlayerHUD-module__-E1Scq__EnergyBar .PlayerHUD-module__-E1Scq__BarFill{background:#0af} diff --git a/docs/_next/static/chunks/c339a594c158eab3.js b/docs/_next/static/chunks/c339a594c158eab3.js new file mode 100644 index 00000000..13e0ff20 --- /dev/null +++ b/docs/_next/static/chunks/c339a594c158eab3.js @@ -0,0 +1,211 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47071,971,e=>{"use strict";var t=e.i(71645),a=e.i(90072),r=e.i(73949),i=e.i(91037);e.s(["useLoader",()=>i.G],971);var i=i;let n=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function o(e,o){let l=(0,r.useThree)(e=>e.gl),s=(0,i.G)(a.TextureLoader,n(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==o||o(s)},[o]),(0,t.useEffect)(()=>{if("initTexture"in l){let e=[];Array.isArray(s)?e=s:s instanceof a.Texture?e=[s]:n(s)&&(e=Object.values(s)),e.forEach(e=>{e instanceof a.Texture&&l.initTexture(e)})}},[l,s]),(0,t.useMemo)(()=>{if(!n(e))return s;{let t={},a=0;for(let r in e)t[r]=s[a++];return t}},[e,s])}o.preload=e=>i.G.preload(a.TextureLoader,e),o.clear=e=>i.G.clear(a.TextureLoader,e),e.s(["useTexture",()=>o],47071)},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},75567,e=>{"use strict";var t=e.i(90072);function a(e,r={}){let{repeat:i=[1,1],disableMipmaps:n=!1}=r;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...i),e.flipY=!1,e.anisotropy=16,n?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function r(e){let a=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return a.colorSpace=t.NoColorSpace,a.wrapS=a.wrapT=t.RepeatWrapping,a.generateMipmaps=!1,a.minFilter=t.LinearFilter,a.magFilter=t.LinearFilter,a.needsUpdate=!0,a}e.s(["setupMask",()=>r,"setupTexture",()=>a])},47021,e=>{"use strict";var t=e.i(8560);let a=` +#ifdef USE_FOG + // Check fog enabled uniform - allows toggling without shader recompilation + #ifdef USE_VOLUMETRIC_FOG + if (!fogEnabled) { + // Skip all fog calculations when disabled + } else { + #endif + + float dist = vFogDepth; + + // Discard fragments at or beyond visible distance - matches Torque's behavior + // where objects beyond visibleDistance are not rendered at all. + // This prevents fully-fogged geometry from showing as silhouettes against + // the sky's fog-to-sky gradient. + if (dist >= fogFar) { + discard; + } + + // Step 1: Calculate distance-based haze (quadratic falloff) + // Since we discard at fogFar, haze never reaches 1.0 here + float haze = 0.0; + if (dist > fogNear) { + float fogScale = 1.0 / (fogFar - fogNear); + float distFactor = (dist - fogNear) * fogScale - 1.0; + haze = 1.0 - distFactor * distFactor; + } + + // Step 2: Calculate fog volume contributions + // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false) + // All fog uses the global fogColor - see Tribes2_Fog_System.md for details + float volumeFog = 0.0; + + #ifdef USE_VOLUMETRIC_FOG + { + #ifdef USE_FOG_WORLD_POSITION + float fragmentHeight = vFogWorldPosition.y; + #else + float fragmentHeight = cameraHeight; + #endif + + float deltaY = fragmentHeight - cameraHeight; + float absDeltaY = abs(deltaY); + + // Determine if we're going up (positive) or down (negative) + if (absDeltaY > 0.01) { + // Non-horizontal ray: ray-march through fog volumes + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + // Skip inactive volumes (visibleDistance = 0) + if (volVisDist <= 0.0) continue; + + // Calculate fog factor for this volume + // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage + // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0) + // Since we don't have quality settings, we use visFactor = 1.0 + float factor = (1.0 / volVisDist) * volPct; + + // Find ray intersection with this volume's height range + float rayMinY = min(cameraHeight, fragmentHeight); + float rayMaxY = max(cameraHeight, fragmentHeight); + + // Check if ray intersects volume height range + if (rayMinY < volMaxH && rayMaxY > volMinH) { + float intersectMin = max(rayMinY, volMinH); + float intersectMax = min(rayMaxY, volMaxH); + float intersectHeight = intersectMax - intersectMin; + + // Calculate distance traveled through this volume using similar triangles: + // subDist / dist = intersectHeight / absDeltaY + float subDist = dist * (intersectHeight / absDeltaY); + + // Accumulate fog: fog += subDist * factor + volumeFog += subDist * factor; + } + } + } else { + // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + // If camera is inside this volume, apply fog for full distance + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + float factor = (1.0 / volVisDist) * volPct; + volumeFog += dist * factor; + } + } + } + } + #endif + + // Step 3: Combine haze and volume fog + // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct + // This gives fog volumes priority over haze + float volPct = min(volumeFog, 1.0); + float hazePct = haze; + if (volPct + hazePct > 1.0) { + hazePct = 1.0 - volPct; + } + float fogFactor = hazePct + volPct; + + // Apply fog using global fogColor (per-volume colors not used in Tribes 2) + gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor); + + #ifdef USE_VOLUMETRIC_FOG + } // end fogEnabled check + #endif +#endif +`;function r(){t.ShaderChunk.fog_pars_fragment=` +#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif + + // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set) + // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats + #ifdef USE_VOLUMETRIC_FOG + uniform float fogVolumeData[12]; + uniform float cameraHeight; + #endif + + #ifdef USE_FOG_WORLD_POSITION + varying vec3 vFogWorldPosition; + #endif +#endif +`,t.ShaderChunk.fog_fragment=a,t.ShaderChunk.fog_pars_vertex=` +#ifdef USE_FOG + varying float vFogDepth; + #ifdef USE_FOG_WORLD_POSITION + varying vec3 vFogWorldPosition; + #endif +#endif +`,t.ShaderChunk.fog_vertex=` +#ifdef USE_FOG + // Use Euclidean distance from camera, not view-space z-depth + // This ensures fog doesn't change when rotating the camera + vFogDepth = length(mvPosition.xyz); + #ifdef USE_FOG_WORLD_POSITION + vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; + #endif +#endif +`}function i(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.uniforms.fogEnabled=t.fogEnabled,e.vertexShader=e.vertexShader.replace("#include ",`#include +#ifdef USE_FOG + #define USE_FOG_WORLD_POSITION + #define USE_VOLUMETRIC_FOG + varying vec3 vFogWorldPosition; +#endif`),e.vertexShader=e.vertexShader.replace("#include ",`#include +#ifdef USE_FOG + vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include +#ifdef USE_FOG + #define USE_VOLUMETRIC_FOG + uniform float fogVolumeData[12]; + uniform float cameraHeight; + uniform bool fogEnabled; + #define USE_FOG_WORLD_POSITION + varying vec3 vFogWorldPosition; +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",a)}e.s(["fogFragmentShader",0,a,"injectCustomFog",()=>i,"installCustomFogShader",()=>r])},48066,e=>{"use strict";let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function a(e,r,i=!0){t.cameraHeight.value=e,t.fogVolumeData.value.set(r),t.fogEnabled.value=i}function r(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function i(e){let t=new Float32Array(12);for(let a=0;a<3;a++){let r=4*a,i=e[a];i&&(t[r+0]=i.visibleDistance,t[r+1]=i.minHeight,t[r+2]=i.maxHeight,t[r+3]=i.percentage)}return t}e.s(["globalFogUniforms",0,t,"packFogVolumeData",()=>i,"resetGlobalFogUniforms",()=>r,"updateGlobalFogUniforms",()=>a])},67191,e=>{e.v({Label:"FloatingLabel-module__8y09Ka__Label"})},89887,60099,e=>{"use strict";let t,a;var r=e.i(43476),i=e.i(932),n=e.i(71645),o=e.i(90072),l=e.i(49774),s=e.i(31067),c=e.i(88014),u=e.i(73949);let d=new o.Vector3,f=new o.Vector3,m=new o.Vector3,g=new o.Vector2;function p(e,t,a){let r=d.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=a.width/2,n=a.height/2;return[r.x*i+i,-(r.y*n)+n]}let h=e=>1e-10>Math.abs(e)?0:e;function y(e,t,a=""){let r="matrix3d(";for(let a=0;16!==a;a++)r+=h(t[a]*e.elements[a])+(15!==a?",":")");return a+r}let b=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>y(e,t)),v=(a=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],(e,t)=>y(e,a(t),"translate(-50%,-50%)")),x=n.forwardRef(({children:e,eps:t=.001,style:a,className:r,prepend:i,center:y,fullscreen:x,portal:k,distanceFactor:S,sprite:_=!1,transform:j=!1,occlude:M,onOcclude:E,castShadow:P,receiveShadow:F,material:C,geometry:I,zIndexRange:O=[0x1000037,0],calculatePosition:D=p,as:T="div",wrapperClass:w,pointerEvents:N="auto",...R},B)=>{let{gl:V,camera:L,scene:H,size:W,raycaster:U,events:z,viewport:A}=(0,u.useThree)(),[G]=n.useState(()=>document.createElement(T)),$=n.useRef(null),Y=n.useRef(null),q=n.useRef(0),K=n.useRef([0,0]),J=n.useRef(null),X=n.useRef(null),Z=(null==k?void 0:k.current)||z.connected||V.domElement.parentNode,Q=n.useRef(null),ee=n.useRef(!1),et=n.useMemo(()=>{var e;return M&&"blending"!==M||Array.isArray(M)&&M.length&&(e=M[0])&&"object"==typeof e&&"current"in e},[M]);n.useLayoutEffect(()=>{let e=V.domElement;M&&"blending"===M?(e.style.zIndex=`${Math.floor(O[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[M]),n.useLayoutEffect(()=>{if(Y.current){let e=$.current=c.createRoot(G);if(H.updateMatrixWorld(),j)G.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=D(Y.current,L,W);G.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Z&&(i?Z.prepend(G):Z.appendChild(G)),()=>{Z&&Z.removeChild(G),e.unmount()}}},[Z,j]),n.useLayoutEffect(()=>{w&&(G.className=w)},[w]);let ea=n.useMemo(()=>j?{position:"absolute",top:0,left:0,width:W.width,height:W.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:y?"translate3d(-50%,-50%,0)":"none",...x&&{top:-W.height/2,left:-W.width/2,width:W.width,height:W.height},...a},[a,y,x,W,j]),er=n.useMemo(()=>({position:"absolute",pointerEvents:N}),[N]);n.useLayoutEffect(()=>{var t,i;ee.current=!1,j?null==(t=$.current)||t.render(n.createElement("div",{ref:J,style:ea},n.createElement("div",{ref:X,style:er},n.createElement("div",{ref:B,className:r,style:a,children:e})))):null==(i=$.current)||i.render(n.createElement("div",{ref:B,style:ea,className:r,children:e}))});let ei=n.useRef(!0);(0,l.useFrame)(e=>{if(Y.current){L.updateMatrixWorld(),Y.current.updateWorldMatrix(!0,!1);let e=j?K.current:D(Y.current,L,W);if(j||Math.abs(q.current-L.zoom)>t||Math.abs(K.current[0]-e[0])>t||Math.abs(K.current[1]-e[1])>t){var a;let t,r,i,n,l=(a=Y.current,t=d.setFromMatrixPosition(a.matrixWorld),r=f.setFromMatrixPosition(L.matrixWorld),i=t.sub(r),n=L.getWorldDirection(m),i.angleTo(n)>Math.PI/2),s=!1;et&&(Array.isArray(M)?s=M.map(e=>e.current):"blending"!==M&&(s=[H]));let c=ei.current;s?ei.current=function(e,t,a,r){let i=d.setFromMatrixPosition(e.matrixWorld),n=i.clone();n.project(t),g.set(n.x,n.y),a.setFromCamera(g,t);let o=a.intersectObjects(r,!0);if(o.length){let e=o[0].distance;return i.distanceTo(a.ray.origin)({vertexShader:j?void 0:` + /* + This shader is from the THREE's SpriteMaterial. + We need to turn the backing plane into a Sprite + (make it always face the camera) if "transfrom" + is false. + */ + #include + + void main() { + vec2 center = vec2(0., 1.); + float rotation = 0.0; + + // This is somewhat arbitrary, but it seems to work well + // Need to figure out how to derive this dynamically if it even matters + float size = 0.03; + + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + + gl_Position = projectionMatrix * mvPosition; + } + `,fragmentShader:` + void main() { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } + `}),[j]);return n.createElement("group",(0,s.default)({},R,{ref:Y}),M&&!et&&n.createElement("mesh",{castShadow:P,receiveShadow:F,ref:Q},I||n.createElement("planeGeometry",null),C||n.createElement("shaderMaterial",{side:o.DoubleSide,vertexShader:en.vertexShader,fragmentShader:en.fragmentShader})))});e.s(["Html",()=>x],60099);var k=e.i(67191);let S=[0,0,0],_=new o.Vector3,j=(0,n.memo)(function(e){let t,a,o,s=(0,i.c)(11),{children:c,color:u,position:d,opacity:f}=e,m=void 0===u?"white":u,g=void 0===d?S:d,p=void 0===f?"fadeWithDistance":f,h="fadeWithDistance"===p,y=(0,n.useRef)(null),[b,v]=(0,n.useState)(0!==p),j=(0,n.useRef)(null);return s[0]!==h||s[1]!==b||s[2]!==p?(t=e=>{var t,a,r;let i,{camera:n}=e,o=y.current;if(!o)return;o.getWorldPosition(_);let l=(t=_.x,a=_.y,r=_.z,-((t-(i=n.matrixWorld.elements)[12])*i[8])+-((a-i[13])*i[9])+-((r-i[14])*i[10])<0);if(h){let e=l?1/0:n.position.distanceTo(_),t=e<200;if(b!==t&&v(t),j.current&&t){let t=Math.max(0,Math.min(1,1-e/200));j.current.style.opacity=t.toString()}}else{let e=!l&&0!==p;b!==e&&v(e),j.current&&(j.current.style.opacity=p.toString())}},s[0]=h,s[1]=b,s[2]=p,s[3]=t):t=s[3],(0,l.useFrame)(t),s[4]!==c||s[5]!==m||s[6]!==b||s[7]!==g?(a=b?(0,r.jsx)(x,{position:g,center:!0,children:(0,r.jsx)("div",{ref:j,className:k.default.Label,style:{color:m},children:c})}):null,s[4]=c,s[5]=m,s[6]=b,s[7]=g,s[8]=a):a=s[8],s[9]!==a?(o=(0,r.jsx)("group",{ref:y,children:a}),s[9]=a,s[10]=o):o=s[10],o});e.s(["FloatingLabel",0,j],89887)},51434,e=>{"use strict";var t=e.i(43476),a=e.i(932),r=e.i(71645),i=e.i(73949),n=e.i(90072);let o=(0,r.createContext)(void 0);function l(e){let l,c,u,d,f=(0,a.c)(7),{children:m}=e,{camera:g}=(0,i.useThree)();f[0]===Symbol.for("react.memo_cache_sentinel")?(l={audioLoader:null,audioListener:null},f[0]=l):l=f[0];let[p,h]=(0,r.useState)(l);return f[1]!==g?(c=()=>{let e=new n.AudioLoader,t=g.children.find(s);t||(t=new n.AudioListener,g.add(t)),h({audioLoader:e,audioListener:t})},u=[g],f[1]=g,f[2]=c,f[3]=u):(c=f[2],u=f[3]),(0,r.useEffect)(c,u),f[4]!==p||f[5]!==m?(d=(0,t.jsx)(o.Provider,{value:p,children:m}),f[4]=p,f[5]=m,f[6]=d):d=f[6],d}function s(e){return e instanceof n.AudioListener}function c(){let e=(0,r.useContext)(o);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}e.s(["AudioProvider",()=>l,"useAudio",()=>c])},6112,79473,58647,30064,13876,e=>{"use strict";var t=e.i(932),a=e.i(8155);let r=e=>(t,a,r)=>{let i=r.subscribe;return r.subscribe=(e,t,a)=>{let n=e;if(t){let i=(null==a?void 0:a.equalityFn)||Object.is,o=e(r.getState());n=a=>{let r=e(a);if(!i(o,r)){let e=o;t(o=r,e)}},(null==a?void 0:a.fireImmediately)&&t(o,o)}return i(n)},e(t,a,r)};e.s(["subscribeWithSelector",()=>r],79473);var i=e.i(66748);function n(e){return e.toLowerCase()}function o(e){let t=n(e.trim());return t.startsWith("$")?t.slice(1):t}let l={runtime:{runtime:null,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},world:{entitiesById:{},players:[],ghosts:[],projectiles:[],flags:[],teams:{},scores:{}},playback:{recording:null,status:"stopped",timeMs:0,rate:1,frameCursor:0,durationMs:0,streamSnapshot:null},diagnostics:{eventCounts:{"object.created":0,"object.deleted":0,"field.changed":0,"method.called":0,"global.changed":0,"batch.flushed":0},recentEvents:[],maxRecentEvents:200,webglContextLost:!1,playbackEvents:[],maxPlaybackEvents:400,rendererSamples:[],maxRendererSamples:2400}},s=(0,a.createStore)()(r(e=>({...l,setRuntime(t){let a=function(e){let t={},a={},r={},i={};for(let a of e.state.objectsById.values())t[a._id]=0,a._name&&(r[n(a._name)]=a._id,a._isDatablock&&(i[n(a._name)]=a._id));for(let t of e.state.globals.keys())a[o(t)]=0;return{objectVersionById:t,globalVersionByName:a,objectIdsByName:r,datablockIdsByName:i}}(t);e(e=>({...e,runtime:{runtime:t,objectVersionById:a.objectVersionById,globalVersionByName:a.globalVersionByName,objectIdsByName:a.objectIdsByName,datablockIdsByName:a.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,a){0!==t.length&&e(e=>{let r={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},l={...e.runtime.objectIdsByName},s={...e.runtime.datablockIdsByName},c={...e.diagnostics.eventCounts},u=[...e.diagnostics.recentEvents],d=e=>{null!=e&&(r[e]=(r[e]??0)+1)};for(let e of t){if(c[e.type]=(c[e.type]??0)+1,u.push(e),"object.created"===e.type){let t=e.object;if(d(e.objectId),t._name){let a=n(t._name);l[a]=e.objectId,t._isDatablock&&(s[a]=e.objectId)}d(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete r[e.objectId],t?._name){let e=n(t._name);delete l[e],t._isDatablock&&delete s[e]}d(t?._parent?._id);continue}if("field.changed"===e.type){d(e.objectId);continue}if("global.changed"===e.type){let t=o(e.name);i[t]=(i[t]??0)+1;continue}}let f=a?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);c["batch.flushed"]+=1,u.push({type:"batch.flushed",tick:f,events:t});let m=e.diagnostics.maxRecentEvents,g=u.length>m?u.slice(u.length-m):u;return{...e,runtime:{...e.runtime,objectVersionById:r,globalVersionByName:i,objectIdsByName:l,datablockIdsByName:s,lastRuntimeTick:f},diagnostics:{...e.diagnostics,eventCounts:c,recentEvents:g}}})},setDemoRecording(t){let a=Math.max(0,(t?.duration??0)*1e3),r=function(e=0){let t=Error().stack;if(!t)return null;let a=t.split("\n").map(e=>e.trim()).filter(Boolean).slice(1+e,9+e);return a.length>0?a.join(" <= "):null}(1);e(e=>{let i=e.playback.streamSnapshot,n=e.playback.recording,o={t:Date.now(),kind:"recording.set",message:"setDemoRecording invoked",playbackStatus:e.playback.status,playbackTimeMs:e.playback.timeMs,frameCursor:e.playback.frameCursor,streamEntityCount:i?.entities.length??0,streamCameraMode:i?.camera?.mode??null,streamExhausted:i?.exhausted??!1,meta:{previousMissionName:n?.missionName??null,nextMissionName:t?.missionName??null,previousDurationSec:n?Number(n.duration.toFixed(3)):null,nextDurationSec:t?Number(t.duration.toFixed(3)):null,isNull:null==t,isMetadataOnly:!!t?.isMetadataOnly,isPartial:!!t?.isPartial,hasStreamingPlayback:!!t?.streamingPlayback,stack:r??"unavailable"}};return{...e,world:function(e){if(!e)return{entitiesById:{},players:[],ghosts:[],projectiles:[],flags:[],teams:{},scores:{}};let t={},a=[],r=[],i=[],n=[];for(let o of e.entities){let e=String(o.id);t[e]=o;let l=o.type.toLowerCase();if("player"===l){a.push(e),e.startsWith("player_")&&r.push(e);continue}if("projectile"===l){i.push(e);continue}(o.dataBlock?.toLowerCase()==="flag"||o.dataBlock?.toLowerCase().includes("flag"))&&n.push(e)}return{entitiesById:t,players:a,ghosts:r,projectiles:i,flags:n,teams:{},scores:{}}}(t),playback:{recording:t,status:"stopped",timeMs:0,rate:1,frameCursor:0,durationMs:a,streamSnapshot:null},diagnostics:{...e.diagnostics,webglContextLost:!1,playbackEvents:[o],rendererSamples:[]}}})},setPlaybackTime(t){e(e=>{var a,r,i;let n=(a=t,r=0,i=e.playback.durationMs,a<0?0:a>i?i:a);return{...e,playback:{...e.playback,timeMs:n,frameCursor:n}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var a,r,i;let n=Number.isFinite(t)?(r=.01,i=16,(a=t)<.01?.01:a>16?16:a):1;e(e=>({...e,playback:{...e.playback,rate:n}}))},setPlaybackFrameCursor(t){let a=Number.isFinite(t)?t:0;e(e=>({...e,playback:{...e.playback,frameCursor:a}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))},setWebglContextLost(t){e(e=>({...e,diagnostics:{...e.diagnostics,webglContextLost:t}}))},recordPlaybackDiagnosticEvent(t){e(e=>{let a=e.playback.streamSnapshot,r={t:Date.now(),kind:t.kind,message:t.message,playbackStatus:e.playback.status,playbackTimeMs:e.playback.timeMs,frameCursor:e.playback.frameCursor,streamEntityCount:a?.entities.length??0,streamCameraMode:a?.camera?.mode??null,streamExhausted:a?.exhausted??!1,meta:t.meta},i=[...e.diagnostics.playbackEvents,r],n=e.diagnostics.maxPlaybackEvents,o=i.length>n?i.slice(i.length-n):i;return{...e,diagnostics:{...e.diagnostics,playbackEvents:o}}})},appendRendererSample(t){e(e=>{let a=e.playback.streamSnapshot,r={t:t.t??Date.now(),playbackStatus:e.playback.status,playbackTimeMs:e.playback.timeMs,frameCursor:e.playback.frameCursor,streamEntityCount:a?.entities.length??0,streamCameraMode:a?.camera?.mode??null,streamExhausted:a?.exhausted??!1,geometries:t.geometries,textures:t.textures,programs:t.programs,renderCalls:t.renderCalls,renderTriangles:t.renderTriangles,renderPoints:t.renderPoints,renderLines:t.renderLines,sceneObjects:t.sceneObjects,visibleSceneObjects:t.visibleSceneObjects,jsHeapUsed:t.jsHeapUsed,jsHeapTotal:t.jsHeapTotal,jsHeapLimit:t.jsHeapLimit},i=[...e.diagnostics.rendererSamples,r],n=e.diagnostics.maxRendererSamples,o=i.length>n?i.slice(i.length-n):i;return{...e,diagnostics:{...e.diagnostics,rendererSamples:o}}})},clearPlaybackDiagnostics(){e(e=>({...e,diagnostics:{...e.diagnostics,webglContextLost:!1,playbackEvents:[],rendererSamples:[]}}))}})));function c(){return s}function u(e,t){return(0,i.useStoreWithEqualityFn)(s,e,t)}function d(e){let a,r,i,n=(0,t.c)(7),o=u(f);n[0]!==e?(a=t=>null==e?-1:t.runtime.objectVersionById[e]??-1,n[0]=e,n[1]=a):a=n[1];let l=u(a);if(null==e||!o||-1===l)return;n[2]!==e||n[3]!==o.state.objectsById?(r=o.state.objectsById.get(e),n[2]=e,n[3]=o.state.objectsById,n[4]=r):r=n[4];let s=r;return n[5]!==s?(i=s?{...s}:void 0,n[5]=s,n[6]=i):i=n[6],i}function f(e){return e.runtime.runtime}function m(e){let a,r,i,o,l,s=(0,t.c)(11),c=u(g);s[0]!==e?(a=e?n(e):"",s[0]=e,s[1]=a):a=s[1];let d=a;s[2]!==d?(r=e=>d?e.runtime.objectIdsByName[d]:void 0,s[2]=d,s[3]=r):r=s[3];let f=u(r);s[4]!==f?(i=e=>null==f?-1:e.runtime.objectVersionById[f]??-1,s[4]=f,s[5]=i):i=s[5];let m=u(i);if(!c||!d||null==f||-1===m)return;s[6]!==f||s[7]!==c.state.objectsById?(o=c.state.objectsById.get(f),s[6]=f,s[7]=c.state.objectsById,s[8]=o):o=s[8];let p=o;return s[9]!==p?(l=p?{...p}:void 0,s[9]=p,s[10]=l):l=s[10],l}function g(e){return e.runtime.runtime}function p(e){let a,r,i,o,l,s=(0,t.c)(11),c=u(h);s[0]!==e?(a=e?n(e):"",s[0]=e,s[1]=a):a=s[1];let d=a;s[2]!==d?(r=e=>d?e.runtime.datablockIdsByName[d]:void 0,s[2]=d,s[3]=r):r=s[3];let f=u(r);s[4]!==f?(i=e=>null==f?-1:e.runtime.objectVersionById[f]??-1,s[4]=f,s[5]=i):i=s[5];let m=u(i);if(!c||!d||null==f||-1===m)return;s[6]!==f||s[7]!==c.state.objectsById?(o=c.state.objectsById.get(f),s[6]=f,s[7]=c.state.objectsById,s[8]=o):o=s[8];let g=o;return s[9]!==g?(l=g?{...g}:void 0,s[9]=g,s[10]=l):l=s[10],l}function h(e){return e.runtime.runtime}function y(e,a){let r,i,n,o,l=(0,t.c)(13);l[0]!==a?(r=void 0===a?[]:a,l[0]=a,l[1]=r):r=l[1];let s=r,c=u(k);l[2]!==e?(i=t=>null==e?-1:t.runtime.objectVersionById[e]??-1,l[2]=e,l[3]=i):i=l[3];let d=u(i);if(null==e){let e;return l[4]!==s?(e=s.map(x),l[4]=s,l[5]=e):e=l[5],e}if(!c||-1===d){let e;return l[6]!==s?(e=s.map(v),l[6]=s,l[7]=e):e=l[7],e}let f=c.state.objectsById;if(l[8]!==e||l[9]!==c.state.objectsById){o=Symbol.for("react.early_return_sentinel");e:{let t=f.get(e);if(!t?._children){let e;l[12]===Symbol.for("react.memo_cache_sentinel")?(e=[],l[12]=e):e=l[12],o=e;break e}n=t._children.map(b)}l[8]=e,l[9]=c.state.objectsById,l[10]=n,l[11]=o}else n=l[10],o=l[11];return o!==Symbol.for("react.early_return_sentinel")?o:n}function b(e){return e._id}function v(e){return e._id}function x(e){return e._id}function k(e){return e.runtime.runtime}e.s(["engineStore",0,s,"useDatablockByName",()=>p,"useEngineSelector",()=>u,"useEngineStoreApi",()=>c,"useRuntimeChildIds",()=>y,"useRuntimeObjectById",()=>d,"useRuntimeObjectByName",()=>m],58647);let S={maxRuntimeEvents:80,maxPlaybackEvents:200,maxRendererSamples:1200,maxStreamEntities:40};function _(e){return e&&"object"==typeof e?{kind:"TorqueObject",id:"number"==typeof e._id?e._id:null,className:"string"==typeof e._className?e._className:null,class:"string"==typeof e._class?e._class:null,name:"string"==typeof e._name?e._name:null,isDatablock:!!e._isDatablock,parentId:e._parent&&"number"==typeof e._parent._id?e._parent._id:null,childCount:Array.isArray(e._children)?e._children.length:0}:null}function j(e,t={}){let a,r,i,n={...S,...t},o=(a=new WeakSet,function e(t,r=0){if(null==t)return t;let i=typeof t;if("string"===i||"number"===i||"boolean"===i)return t;if("bigint"===i)return t.toString();if("function"===i)return`[Function ${t.name||"anonymous"}]`;if("object"!==i)return String(t);if("_id"in t&&"_className"in t)return _(t);if(t instanceof Date)return t.toISOString();if(Array.isArray(t)){if(r>=2)return{kind:"Array",length:t.length};let a=t.slice(0,8).map(t=>e(t,r+1));return{kind:"Array",length:t.length,sample:a}}if(a.has(t))return"[Circular]";if(a.add(t),r>=2)return{kind:t?.constructor?.name??"Object"};let n=Object.keys(t).slice(0,12),o={};for(let a of n)try{o[a]=e(t[a],r+1)}catch(e){o[a]=`[Unserializable: ${e.message}]`}return Object.keys(t).length>n.length&&(o.__truncatedKeys=Object.keys(t).length-n.length),o}),l=e.diagnostics.recentEvents.slice(-n.maxRuntimeEvents).map(e=>(function(e,t){if("object.created"===e.type||"object.deleted"===e.type)return{type:e.type,objectId:e.objectId,object:_(e.object)};if("field.changed"===e.type)return{type:e.type,objectId:e.objectId,field:e.field,value:t(e.value),previousValue:t(e.previousValue),object:_(e.object)};if("method.called"===e.type)return{type:e.type,className:e.className,methodName:e.methodName,objectId:e.objectId??null,args:t(e.args)};if("global.changed"===e.type)return{type:e.type,name:e.name,value:t(e.value),previousValue:t(e.previousValue)};if("batch.flushed"===e.type){let t={};for(let a of e.events)t[a.type]=(t[a.type]??0)+1;return{type:e.type,tick:e.tick,eventCount:e.events.length,byType:t}}return{type:"unknown"}})(e,o)),s=e.diagnostics.playbackEvents.slice(-n.maxPlaybackEvents).map(e=>({...e,meta:e.meta?o(e.meta):void 0})),c=e.diagnostics.rendererSamples.slice(-n.maxRendererSamples);return{generatedAt:new Date().toISOString(),playback:{status:e.playback.status,timeMs:e.playback.timeMs,frameCursor:e.playback.frameCursor,rate:e.playback.rate,durationMs:e.playback.durationMs,recording:(r=e.playback.recording)?{duration:r.duration,missionName:r.missionName,gameType:r.gameType,isMetadataOnly:!!r.isMetadataOnly,isPartial:!!r.isPartial,hasStreamingPlayback:!!r.streamingPlayback,entitiesCount:r.entities.length,cameraModesCount:r.cameraModes.length,controlPlayerGhostId:r.controlPlayerGhostId??null}:null,streamSnapshot:function(e,t){let a=e.playback.streamSnapshot;if(!a)return null;let r={},i={};for(let e of a.entities){let t=e.type||"Unknown";r[t]=(r[t]??0)+1,e.visual?.kind&&(i[e.visual.kind]=(i[e.visual.kind]??0)+1)}let n=a.entities.slice(0,t).map(e=>({id:e.id,type:e.type,dataBlock:e.dataBlock??null,className:e.className??null,ghostIndex:e.ghostIndex??null,dataBlockId:e.dataBlockId??null,shapeHint:e.shapeHint??null,visualKind:e.visual?.kind??null,hasPosition:!!e.position,hasRotation:!!e.rotation}));return{timeSec:a.timeSec,exhausted:a.exhausted,cameraMode:a.camera?.mode??null,controlEntityId:a.camera?.controlEntityId??null,orbitTargetId:a.camera?.orbitTargetId??null,controlPlayerGhostId:a.controlPlayerGhostId??null,entityCount:a.entities.length,entitiesByType:r,visualsByKind:i,entitySample:n,status:a.status}}(e,n.maxStreamEntities)},runtime:(i=e.runtime.runtime)?{lastRuntimeTick:e.runtime.lastRuntimeTick,objectCount:i.state.objectsById.size,datablockCount:i.state.datablocks.size,globalCount:i.state.globals.size,activePackageCount:i.state.activePackages.length,executedScriptCount:i.state.executedScripts.size,failedScriptCount:i.state.failedScripts.size}:null,diagnostics:{webglContextLost:e.diagnostics.webglContextLost,eventCounts:e.diagnostics.eventCounts,playbackEventCount:e.diagnostics.playbackEvents.length,rendererSampleCount:e.diagnostics.rendererSamples.length,runtimeEventCount:e.diagnostics.recentEvents.length,playbackEventsByKind:function(e){let t={};for(let a of e)t[a.kind]=(t[a.kind]??0)+1;return t}(e.diagnostics.playbackEvents),rendererTrend:function(e){if(e.length<2)return null;let t=e[0],a=e[e.length-1];return{sampleCount:e.length,durationSec:Number(((a.t-t.t)/1e3).toFixed(3)),geometriesDelta:a.geometries-t.geometries,texturesDelta:a.textures-t.textures,programsDelta:a.programs-t.programs,sceneObjectsDelta:a.sceneObjects-t.sceneObjects,visibleSceneObjectsDelta:a.visibleSceneObjects-t.visibleSceneObjects,renderCallsDelta:a.renderCalls-t.renderCalls}}(c),playbackEvents:s,rendererSamples:c,runtimeEvents:l}}}function M(e,t={}){return JSON.stringify(j(e,t),null,2)}function E(e){return p(e)}e.s(["buildSerializableDiagnosticsJson",()=>M,"buildSerializableDiagnosticsSnapshot",()=>j],30064),e.s([],13876),e.s(["useDatablock",()=>E],6112)},61921,e=>{e.v(t=>Promise.all(["static/chunks/cb4089eec9313f48.js"].map(t=>e.l(t))).then(()=>t(29055)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/b9c295cb642f6712.js"].map(t=>e.l(t))).then(()=>t(63724)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/6e74e9455d83b68c.js"].map(t=>e.l(t))).then(()=>t(42585)))},84968,e=>{e.v(t=>Promise.all(["static/chunks/70bf3e06d5674fac.js"].map(t=>e.l(t))).then(()=>t(90208)))},59197,e=>{e.v(t=>Promise.all(["static/chunks/0be79f7f5e0597a7.css","static/chunks/1cf33c843f96e1c9.js"].map(t=>e.l(t))).then(()=>t(94247)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e620039d1c837dab.css b/docs/_next/static/chunks/e620039d1c837dab.css new file mode 100644 index 00000000..5e92debc --- /dev/null +++ b/docs/_next/static/chunks/e620039d1c837dab.css @@ -0,0 +1 @@ +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}main{width:100dvw;height:100dvh}input[type=range]{max-width:80px} diff --git a/docs/_next/static/chunks/f12455938f261f57.js b/docs/_next/static/chunks/f12455938f261f57.js new file mode 100644 index 00000000..453faba9 --- /dev/null +++ b/docs/_next/static/chunks/f12455938f261f57.js @@ -0,0 +1,528 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13070,e=>{e.v({Arrow:"KeyboardOverlay-module__HsRBsa__Arrow",Column:"KeyboardOverlay-module__HsRBsa__Column",Key:"KeyboardOverlay-module__HsRBsa__Key",Root:"KeyboardOverlay-module__HsRBsa__Root",Row:"KeyboardOverlay-module__HsRBsa__Row",Spacer:"KeyboardOverlay-module__HsRBsa__Spacer"})},78295,e=>{e.v({Joystick:"TouchControls-module__AkxfgW__Joystick",Left:"TouchControls-module__AkxfgW__Left TouchControls-module__AkxfgW__Joystick",Right:"TouchControls-module__AkxfgW__Right TouchControls-module__AkxfgW__Joystick"})},38360,(e,t,r)=>{var a={À:"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",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(a).join("|"),i=RegExp(n,"g"),o=RegExp(n,"");function s(e){return a[e]}var l=function(e){return e.replace(i,s)};t.exports=l,t.exports.has=function(e){return!!e.match(o)},t.exports.remove=l},29402,(e,t,r)=>{var a,n,i,o,s="__lodash_hash_undefined__",l=1/0,u="[object Arguments]",c="[object Array]",d="[object Boolean]",f="[object Date]",h="[object Error]",m="[object Function]",p="[object Map]",g="[object Number]",v="[object Object]",y="[object Promise]",A="[object RegExp]",F="[object Set]",b="[object String]",C="[object Symbol]",B="[object WeakMap]",S="[object ArrayBuffer]",x="[object DataView]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,D=/^\./,I=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,k=/\\(\\)?/g,w=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[u]=R[c]=R[S]=R[d]=R[x]=R[f]=R[h]=R[m]=R[p]=R[g]=R[v]=R[A]=R[F]=R[b]=R[B]=!1;var P=e.g&&e.g.Object===Object&&e.g,G="object"==typeof self&&self&&self.Object===Object&&self,_=P||G||Function("return this")(),L=r&&!r.nodeType&&r,j=L&&t&&!t.nodeType&&t,O=j&&j.exports===L&&P.process,N=function(){try{return O&&O.binding("util")}catch(e){}}(),U=N&&N.isTypedArray;function H(e,t){for(var r=-1,a=e?e.length:0,n=Array(a);++r-1},eC.prototype.set=function(e,t){var r=this.__data__,a=eE(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},eB.prototype.clear=function(){this.__data__={hash:new eb,map:new(el||eC),string:new eb}},eB.prototype.delete=function(e){return eP(this,e).delete(e)},eB.prototype.get=function(e){return eP(this,e).get(e)},eB.prototype.has=function(e){return eP(this,e).has(e)},eB.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eS.prototype.add=eS.prototype.push=function(e){return this.__data__.set(e,s),this},eS.prototype.has=function(e){return this.__data__.has(e)},ex.prototype.clear=function(){this.__data__=new eC},ex.prototype.delete=function(e){return this.__data__.delete(e)},ex.prototype.get=function(e){return this.__data__.get(e)},ex.prototype.has=function(e){return this.__data__.has(e)},ex.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eC){var a=r.__data__;if(!el||a.length<199)return a.push([e,t]),this;r=this.__data__=new eB(a)}return r.set(e,t),this};var eM=(a=function(e,t){return e&&eD(e,t,e0)},function(e,t){if(null==e)return e;if(!eq(e))return a(e,t);for(var r=e.length,n=-1,i=Object(e);++ns))return!1;var u=i.get(e);if(u&&i.get(t))return u==t;var c=-1,d=!0,f=1&n?new eS:void 0;for(i.set(e,t),i.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==C}var e$=U?J(U):function(e){return eY(e)&&eW(e.length)&&!!R[ee.call(e)]};function e0(e){return eq(e)?function(e,t){var r=ez(e)||eK(e)?function(e,t){for(var r=-1,a=Array(e);++rt||i&&o&&l&&!s&&!u||a&&o&&l||!r&&l||!n)return 1;if(!a&&!i&&!u&&e=s)return l;return l*("desc"==r[a]?-1:1)}}return e.index-t.index}(e,t,r)});l--;)s[l]=s[l].value;return s}(e,t,r))}},97442,e=>{e.v({Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})},65883,e=>{e.v({ButtonLabel:"InspectorControls-module__gNRB6W__ButtonLabel",CheckboxField:"InspectorControls-module__gNRB6W__CheckboxField",Controls:"InspectorControls-module__gNRB6W__Controls",Dropdown:"InspectorControls-module__gNRB6W__Dropdown",Field:"InspectorControls-module__gNRB6W__Field",Group:"InspectorControls-module__gNRB6W__Group",IconButton:"InspectorControls-module__gNRB6W__IconButton",LabelledButton:"InspectorControls-module__gNRB6W__LabelledButton",MapInfoButton:"InspectorControls-module__gNRB6W__MapInfoButton InspectorControls-module__gNRB6W__IconButton InspectorControls-module__gNRB6W__LabelledButton",MissionSelectWrapper:"InspectorControls-module__gNRB6W__MissionSelectWrapper",Toggle:"InspectorControls-module__gNRB6W__Toggle InspectorControls-module__gNRB6W__IconButton"})},36679,e=>{e.v({ButtonLabel:"CopyCoordinatesButton-module__BxovtG__ButtonLabel "+e.i(65883).ButtonLabel,ClipboardCheck:"CopyCoordinatesButton-module__BxovtG__ClipboardCheck",MapPin:"CopyCoordinatesButton-module__BxovtG__MapPin",Root:"CopyCoordinatesButton-module__BxovtG__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,showClipboardCheck:"CopyCoordinatesButton-module__BxovtG__showClipboardCheck"})},76775,(e,t,r)=>{function a(e,t,r,a){return Math.round(e/r)+" "+a+(t>=1.5*r?"s":"")}t.exports=function(e,t){t=t||{};var r,n,i,o,s=typeof e;if("string"===s&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(u){var c=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return 6048e5*c;case"days":case"day":case"d":return 864e5*c;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*c;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*c;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:break}}}return}if("number"===s&&isFinite(e)){return t.long?(n=Math.abs(r=e))>=864e5?a(r,n,864e5,"day"):n>=36e5?a(r,n,36e5,"hour"):n>=6e4?a(r,n,6e4,"minute"):n>=1e3?a(r,n,1e3,"second"):r+" ms":(o=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":o>=36e5?Math.round(i/36e5)+"h":o>=6e4?Math.round(i/6e4)+"m":o>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},7003,(e,t,r)=>{t.exports=function(t){function r(e){let t,n,i,o=null;function s(...e){if(!s.enabled)return;let a=Number(new Date);s.diff=a-(t||a),s.prev=t,s.curr=a,t=a,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let n=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,a)=>{if("%%"===t)return"%";n++;let i=r.formatters[a];if("function"==typeof i){let r=e[n];t=i.call(s,r),e.splice(n,1),n--}return t}),r.formatArgs.call(s,e),(s.log||r.log).apply(s,e)}return s.namespace=e,s.useColors=r.useColors(),s.color=r.selectColor(e),s.extend=a,s.destroy=r.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==r.namespaces&&(n=r.namespaces,i=r.enabled(e)),i),set:e=>{o=e}}),"function"==typeof r.init&&r.init(s),s}function a(e,t){let a=r(this.namespace+(void 0===t?":":t)+e);return a.log=this.log,a}function n(e,t){let r=0,a=0,n=-1,i=0;for(;r"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){for(let t of(r.save(e),r.namespaces=e,r.names=[],r.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===t[0]?r.skips.push(t.slice(1)):r.names.push(t)},r.enabled=function(e){for(let t of r.skips)if(n(e,t))return!1;for(let t of r.names)if(n(e,t))return!0;return!1},r.humanize=e.r(76775),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(e=>{r[e]=t[e]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(e){let t=0;for(let r=0;r{let a;var n=e.i(47167);r.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let a=0,n=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(a++,"%c"===e&&(n=a))}),e.splice(n,0,r)},r.save=function(e){try{e?r.storage.setItem("debug",e):r.storage.removeItem("debug")}catch(e){}},r.load=function(){let e;try{e=r.storage.getItem("debug")||r.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==n.default&&"env"in n.default&&(e=n.default.env.DEBUG),e},r.useColors=function(){let e;return"undefined"!=typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},r.storage=function(){try{return localStorage}catch(e){}}(),a=!1,r.destroy=()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},r.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],r.log=console.debug||console.log||(()=>{}),t.exports=e.r(7003)(r);let{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},28903,e=>{e.v({ButtonLabel:"LoadDemoButton-module__kGZaoW__ButtonLabel "+e.i(65883).ButtonLabel,DemoIcon:"LoadDemoButton-module__kGZaoW__DemoIcon",Root:"LoadDemoButton-module__kGZaoW__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton})},81405,(e,t,r)=>{var a;e.e,(a=function(){function e(e){return n.appendChild(e.dom),e}function t(e){for(var t=0;to+1e3&&(l.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){i=this.end()},domElement:n,setMode:t}}).Panel=function(e,t,r){var a=1/0,n=0,i=Math.round,o=i(window.devicePixelRatio||1),s=80*o,l=48*o,u=3*o,c=2*o,d=3*o,f=15*o,h=74*o,m=30*o,p=document.createElement("canvas");p.width=s,p.height=l,p.style.cssText="width:80px;height:48px";var g=p.getContext("2d");return g.font="bold "+9*o+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=r,g.fillRect(0,0,s,l),g.fillStyle=t,g.fillText(e,u,c),g.fillRect(d,f,h,m),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(d,f,h,m),{dom:p,update:function(l,v){a=Math.min(a,l),n=Math.max(n,l),g.fillStyle=r,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(i(l)+" "+e+" ("+i(a)+"-"+i(n)+")",u,c),g.drawImage(p,d+o,f,h-o,m,d,f,h-o,m),g.fillRect(d+h-o,f,o,m),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(d+h-o,f,o,i((1-l/v)*m))}}},t.exports=a},55141,e=>{e.v({AxisLabel:"DebugElements-module__Cmeo9W__AxisLabel",StatsPanel:"DebugElements-module__Cmeo9W__StatsPanel"})},29418,e=>{e.v({Bottom:"PlayerNameplate-module__zYDm0a__Bottom PlayerNameplate-module__zYDm0a__Root",HealthBar:"PlayerNameplate-module__zYDm0a__HealthBar",HealthFill:"PlayerNameplate-module__zYDm0a__HealthFill",IffArrow:"PlayerNameplate-module__zYDm0a__IffArrow",Name:"PlayerNameplate-module__zYDm0a__Name",Root:"PlayerNameplate-module__zYDm0a__Root",Top:"PlayerNameplate-module__zYDm0a__Top PlayerNameplate-module__zYDm0a__Root"})},21629,e=>{e.v({DiagnosticsFooter:"DemoControls-module__PjV4fq__DiagnosticsFooter",DiagnosticsMetrics:"DemoControls-module__PjV4fq__DiagnosticsMetrics",DiagnosticsPanel:"DemoControls-module__PjV4fq__DiagnosticsPanel",DiagnosticsStatus:"DemoControls-module__PjV4fq__DiagnosticsStatus",PlayPause:"DemoControls-module__PjV4fq__PlayPause",Root:"DemoControls-module__PjV4fq__Root",Seek:"DemoControls-module__PjV4fq__Seek",Speed:"DemoControls-module__PjV4fq__Speed",Time:"DemoControls-module__PjV4fq__Time"})},75840,e=>{e.v({Bar:"PlayerHUD-module__-E1Scq__Bar",BarFill:"PlayerHUD-module__-E1Scq__BarFill",ChatWindow:"PlayerHUD-module__-E1Scq__ChatWindow",EnergyBar:"PlayerHUD-module__-E1Scq__EnergyBar PlayerHUD-module__-E1Scq__Bar",HealthBar:"PlayerHUD-module__-E1Scq__HealthBar PlayerHUD-module__-E1Scq__Bar",PlayerHUD:"PlayerHUD-module__-E1Scq__PlayerHUD"})},3011,e=>{e.v({CanvasContainer:"page-module__E0kJGG__CanvasContainer",LoadingIndicator:"page-module__E0kJGG__LoadingIndicator",Progress:"page-module__E0kJGG__Progress",ProgressBar:"page-module__E0kJGG__ProgressBar",ProgressText:"page-module__E0kJGG__ProgressText",Spinner:"page-module__E0kJGG__Spinner",loadingComplete:"page-module__E0kJGG__loadingComplete",spin:"page-module__E0kJGG__spin"})},31713,e=>{"use strict";let t;var r,a,n=e.i(43476),i=e.i(932),o=e.i(71645),s=e.i(91037),l=e.i(8560),u=e.i(90072);e.s(["ACESFilmicToneMapping",()=>u.ACESFilmicToneMapping,"AddEquation",()=>u.AddEquation,"AddOperation",()=>u.AddOperation,"AdditiveAnimationBlendMode",()=>u.AdditiveAnimationBlendMode,"AdditiveBlending",()=>u.AdditiveBlending,"AgXToneMapping",()=>u.AgXToneMapping,"AlphaFormat",()=>u.AlphaFormat,"AlwaysCompare",()=>u.AlwaysCompare,"AlwaysDepth",()=>u.AlwaysDepth,"AlwaysStencilFunc",()=>u.AlwaysStencilFunc,"AmbientLight",()=>u.AmbientLight,"AnimationAction",()=>u.AnimationAction,"AnimationClip",()=>u.AnimationClip,"AnimationLoader",()=>u.AnimationLoader,"AnimationMixer",()=>u.AnimationMixer,"AnimationObjectGroup",()=>u.AnimationObjectGroup,"AnimationUtils",()=>u.AnimationUtils,"ArcCurve",()=>u.ArcCurve,"ArrayCamera",()=>u.ArrayCamera,"ArrowHelper",()=>u.ArrowHelper,"AttachedBindMode",()=>u.AttachedBindMode,"Audio",()=>u.Audio,"AudioAnalyser",()=>u.AudioAnalyser,"AudioContext",()=>u.AudioContext,"AudioListener",()=>u.AudioListener,"AudioLoader",()=>u.AudioLoader,"AxesHelper",()=>u.AxesHelper,"BackSide",()=>u.BackSide,"BasicDepthPacking",()=>u.BasicDepthPacking,"BasicShadowMap",()=>u.BasicShadowMap,"BatchedMesh",()=>u.BatchedMesh,"Bone",()=>u.Bone,"BooleanKeyframeTrack",()=>u.BooleanKeyframeTrack,"Box2",()=>u.Box2,"Box3",()=>u.Box3,"Box3Helper",()=>u.Box3Helper,"BoxGeometry",()=>u.BoxGeometry,"BoxHelper",()=>u.BoxHelper,"BufferAttribute",()=>u.BufferAttribute,"BufferGeometry",()=>u.BufferGeometry,"BufferGeometryLoader",()=>u.BufferGeometryLoader,"ByteType",()=>u.ByteType,"Cache",()=>u.Cache,"Camera",()=>u.Camera,"CameraHelper",()=>u.CameraHelper,"CanvasTexture",()=>u.CanvasTexture,"CapsuleGeometry",()=>u.CapsuleGeometry,"CatmullRomCurve3",()=>u.CatmullRomCurve3,"CineonToneMapping",()=>u.CineonToneMapping,"CircleGeometry",()=>u.CircleGeometry,"ClampToEdgeWrapping",()=>u.ClampToEdgeWrapping,"Clock",()=>u.Clock,"Color",()=>u.Color,"ColorKeyframeTrack",()=>u.ColorKeyframeTrack,"ColorManagement",()=>u.ColorManagement,"CompressedArrayTexture",()=>u.CompressedArrayTexture,"CompressedCubeTexture",()=>u.CompressedCubeTexture,"CompressedTexture",()=>u.CompressedTexture,"CompressedTextureLoader",()=>u.CompressedTextureLoader,"ConeGeometry",()=>u.ConeGeometry,"ConstantAlphaFactor",()=>u.ConstantAlphaFactor,"ConstantColorFactor",()=>u.ConstantColorFactor,"Controls",()=>u.Controls,"CubeCamera",()=>u.CubeCamera,"CubeDepthTexture",()=>u.CubeDepthTexture,"CubeReflectionMapping",()=>u.CubeReflectionMapping,"CubeRefractionMapping",()=>u.CubeRefractionMapping,"CubeTexture",()=>u.CubeTexture,"CubeTextureLoader",()=>u.CubeTextureLoader,"CubeUVReflectionMapping",()=>u.CubeUVReflectionMapping,"CubicBezierCurve",()=>u.CubicBezierCurve,"CubicBezierCurve3",()=>u.CubicBezierCurve3,"CubicInterpolant",()=>u.CubicInterpolant,"CullFaceBack",()=>u.CullFaceBack,"CullFaceFront",()=>u.CullFaceFront,"CullFaceFrontBack",()=>u.CullFaceFrontBack,"CullFaceNone",()=>u.CullFaceNone,"Curve",()=>u.Curve,"CurvePath",()=>u.CurvePath,"CustomBlending",()=>u.CustomBlending,"CustomToneMapping",()=>u.CustomToneMapping,"CylinderGeometry",()=>u.CylinderGeometry,"Cylindrical",()=>u.Cylindrical,"Data3DTexture",()=>u.Data3DTexture,"DataArrayTexture",()=>u.DataArrayTexture,"DataTexture",()=>u.DataTexture,"DataTextureLoader",()=>u.DataTextureLoader,"DataUtils",()=>u.DataUtils,"DecrementStencilOp",()=>u.DecrementStencilOp,"DecrementWrapStencilOp",()=>u.DecrementWrapStencilOp,"DefaultLoadingManager",()=>u.DefaultLoadingManager,"DepthFormat",()=>u.DepthFormat,"DepthStencilFormat",()=>u.DepthStencilFormat,"DepthTexture",()=>u.DepthTexture,"DetachedBindMode",()=>u.DetachedBindMode,"DirectionalLight",()=>u.DirectionalLight,"DirectionalLightHelper",()=>u.DirectionalLightHelper,"DiscreteInterpolant",()=>u.DiscreteInterpolant,"DodecahedronGeometry",()=>u.DodecahedronGeometry,"DoubleSide",()=>u.DoubleSide,"DstAlphaFactor",()=>u.DstAlphaFactor,"DstColorFactor",()=>u.DstColorFactor,"DynamicCopyUsage",()=>u.DynamicCopyUsage,"DynamicDrawUsage",()=>u.DynamicDrawUsage,"DynamicReadUsage",()=>u.DynamicReadUsage,"EdgesGeometry",()=>u.EdgesGeometry,"EllipseCurve",()=>u.EllipseCurve,"EqualCompare",()=>u.EqualCompare,"EqualDepth",()=>u.EqualDepth,"EqualStencilFunc",()=>u.EqualStencilFunc,"EquirectangularReflectionMapping",()=>u.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>u.EquirectangularRefractionMapping,"Euler",()=>u.Euler,"EventDispatcher",()=>u.EventDispatcher,"ExternalTexture",()=>u.ExternalTexture,"ExtrudeGeometry",()=>u.ExtrudeGeometry,"FileLoader",()=>u.FileLoader,"Float16BufferAttribute",()=>u.Float16BufferAttribute,"Float32BufferAttribute",()=>u.Float32BufferAttribute,"FloatType",()=>u.FloatType,"Fog",()=>u.Fog,"FogExp2",()=>u.FogExp2,"FramebufferTexture",()=>u.FramebufferTexture,"FrontSide",()=>u.FrontSide,"Frustum",()=>u.Frustum,"FrustumArray",()=>u.FrustumArray,"GLBufferAttribute",()=>u.GLBufferAttribute,"GLSL1",()=>u.GLSL1,"GLSL3",()=>u.GLSL3,"GreaterCompare",()=>u.GreaterCompare,"GreaterDepth",()=>u.GreaterDepth,"GreaterEqualCompare",()=>u.GreaterEqualCompare,"GreaterEqualDepth",()=>u.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>u.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>u.GreaterStencilFunc,"GridHelper",()=>u.GridHelper,"Group",()=>u.Group,"HalfFloatType",()=>u.HalfFloatType,"HemisphereLight",()=>u.HemisphereLight,"HemisphereLightHelper",()=>u.HemisphereLightHelper,"IcosahedronGeometry",()=>u.IcosahedronGeometry,"ImageBitmapLoader",()=>u.ImageBitmapLoader,"ImageLoader",()=>u.ImageLoader,"ImageUtils",()=>u.ImageUtils,"IncrementStencilOp",()=>u.IncrementStencilOp,"IncrementWrapStencilOp",()=>u.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>u.InstancedBufferAttribute,"InstancedBufferGeometry",()=>u.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>u.InstancedInterleavedBuffer,"InstancedMesh",()=>u.InstancedMesh,"Int16BufferAttribute",()=>u.Int16BufferAttribute,"Int32BufferAttribute",()=>u.Int32BufferAttribute,"Int8BufferAttribute",()=>u.Int8BufferAttribute,"IntType",()=>u.IntType,"InterleavedBuffer",()=>u.InterleavedBuffer,"InterleavedBufferAttribute",()=>u.InterleavedBufferAttribute,"Interpolant",()=>u.Interpolant,"InterpolateDiscrete",()=>u.InterpolateDiscrete,"InterpolateLinear",()=>u.InterpolateLinear,"InterpolateSmooth",()=>u.InterpolateSmooth,"InterpolationSamplingMode",()=>u.InterpolationSamplingMode,"InterpolationSamplingType",()=>u.InterpolationSamplingType,"InvertStencilOp",()=>u.InvertStencilOp,"KeepStencilOp",()=>u.KeepStencilOp,"KeyframeTrack",()=>u.KeyframeTrack,"LOD",()=>u.LOD,"LatheGeometry",()=>u.LatheGeometry,"Layers",()=>u.Layers,"LessCompare",()=>u.LessCompare,"LessDepth",()=>u.LessDepth,"LessEqualCompare",()=>u.LessEqualCompare,"LessEqualDepth",()=>u.LessEqualDepth,"LessEqualStencilFunc",()=>u.LessEqualStencilFunc,"LessStencilFunc",()=>u.LessStencilFunc,"Light",()=>u.Light,"LightProbe",()=>u.LightProbe,"Line",()=>u.Line,"Line3",()=>u.Line3,"LineBasicMaterial",()=>u.LineBasicMaterial,"LineCurve",()=>u.LineCurve,"LineCurve3",()=>u.LineCurve3,"LineDashedMaterial",()=>u.LineDashedMaterial,"LineLoop",()=>u.LineLoop,"LineSegments",()=>u.LineSegments,"LinearFilter",()=>u.LinearFilter,"LinearInterpolant",()=>u.LinearInterpolant,"LinearMipMapLinearFilter",()=>u.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>u.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>u.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>u.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>u.LinearSRGBColorSpace,"LinearToneMapping",()=>u.LinearToneMapping,"LinearTransfer",()=>u.LinearTransfer,"Loader",()=>u.Loader,"LoaderUtils",()=>u.LoaderUtils,"LoadingManager",()=>u.LoadingManager,"LoopOnce",()=>u.LoopOnce,"LoopPingPong",()=>u.LoopPingPong,"LoopRepeat",()=>u.LoopRepeat,"MOUSE",()=>u.MOUSE,"Material",()=>u.Material,"MaterialLoader",()=>u.MaterialLoader,"MathUtils",()=>u.MathUtils,"Matrix2",()=>u.Matrix2,"Matrix3",()=>u.Matrix3,"Matrix4",()=>u.Matrix4,"MaxEquation",()=>u.MaxEquation,"Mesh",()=>u.Mesh,"MeshBasicMaterial",()=>u.MeshBasicMaterial,"MeshDepthMaterial",()=>u.MeshDepthMaterial,"MeshDistanceMaterial",()=>u.MeshDistanceMaterial,"MeshLambertMaterial",()=>u.MeshLambertMaterial,"MeshMatcapMaterial",()=>u.MeshMatcapMaterial,"MeshNormalMaterial",()=>u.MeshNormalMaterial,"MeshPhongMaterial",()=>u.MeshPhongMaterial,"MeshPhysicalMaterial",()=>u.MeshPhysicalMaterial,"MeshStandardMaterial",()=>u.MeshStandardMaterial,"MeshToonMaterial",()=>u.MeshToonMaterial,"MinEquation",()=>u.MinEquation,"MirroredRepeatWrapping",()=>u.MirroredRepeatWrapping,"MixOperation",()=>u.MixOperation,"MultiplyBlending",()=>u.MultiplyBlending,"MultiplyOperation",()=>u.MultiplyOperation,"NearestFilter",()=>u.NearestFilter,"NearestMipMapLinearFilter",()=>u.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>u.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>u.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>u.NearestMipmapNearestFilter,"NeutralToneMapping",()=>u.NeutralToneMapping,"NeverCompare",()=>u.NeverCompare,"NeverDepth",()=>u.NeverDepth,"NeverStencilFunc",()=>u.NeverStencilFunc,"NoBlending",()=>u.NoBlending,"NoColorSpace",()=>u.NoColorSpace,"NoNormalPacking",()=>u.NoNormalPacking,"NoToneMapping",()=>u.NoToneMapping,"NormalAnimationBlendMode",()=>u.NormalAnimationBlendMode,"NormalBlending",()=>u.NormalBlending,"NormalGAPacking",()=>u.NormalGAPacking,"NormalRGPacking",()=>u.NormalRGPacking,"NotEqualCompare",()=>u.NotEqualCompare,"NotEqualDepth",()=>u.NotEqualDepth,"NotEqualStencilFunc",()=>u.NotEqualStencilFunc,"NumberKeyframeTrack",()=>u.NumberKeyframeTrack,"Object3D",()=>u.Object3D,"ObjectLoader",()=>u.ObjectLoader,"ObjectSpaceNormalMap",()=>u.ObjectSpaceNormalMap,"OctahedronGeometry",()=>u.OctahedronGeometry,"OneFactor",()=>u.OneFactor,"OneMinusConstantAlphaFactor",()=>u.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>u.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>u.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>u.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>u.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>u.OneMinusSrcColorFactor,"OrthographicCamera",()=>u.OrthographicCamera,"PCFShadowMap",()=>u.PCFShadowMap,"PCFSoftShadowMap",()=>u.PCFSoftShadowMap,"PMREMGenerator",()=>l.PMREMGenerator,"Path",()=>u.Path,"PerspectiveCamera",()=>u.PerspectiveCamera,"Plane",()=>u.Plane,"PlaneGeometry",()=>u.PlaneGeometry,"PlaneHelper",()=>u.PlaneHelper,"PointLight",()=>u.PointLight,"PointLightHelper",()=>u.PointLightHelper,"Points",()=>u.Points,"PointsMaterial",()=>u.PointsMaterial,"PolarGridHelper",()=>u.PolarGridHelper,"PolyhedronGeometry",()=>u.PolyhedronGeometry,"PositionalAudio",()=>u.PositionalAudio,"PropertyBinding",()=>u.PropertyBinding,"PropertyMixer",()=>u.PropertyMixer,"QuadraticBezierCurve",()=>u.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>u.QuadraticBezierCurve3,"Quaternion",()=>u.Quaternion,"QuaternionKeyframeTrack",()=>u.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>u.QuaternionLinearInterpolant,"R11_EAC_Format",()=>u.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>u.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>u.RED_RGTC1_Format,"REVISION",()=>u.REVISION,"RG11_EAC_Format",()=>u.RG11_EAC_Format,"RGBADepthPacking",()=>u.RGBADepthPacking,"RGBAFormat",()=>u.RGBAFormat,"RGBAIntegerFormat",()=>u.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>u.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>u.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>u.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>u.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>u.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>u.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>u.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>u.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>u.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>u.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>u.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>u.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>u.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>u.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>u.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>u.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>u.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>u.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>u.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>u.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>u.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>u.RGBDepthPacking,"RGBFormat",()=>u.RGBFormat,"RGBIntegerFormat",()=>u.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>u.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>u.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>u.RGB_ETC1_Format,"RGB_ETC2_Format",()=>u.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>u.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>u.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>u.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>u.RGDepthPacking,"RGFormat",()=>u.RGFormat,"RGIntegerFormat",()=>u.RGIntegerFormat,"RawShaderMaterial",()=>u.RawShaderMaterial,"Ray",()=>u.Ray,"Raycaster",()=>u.Raycaster,"RectAreaLight",()=>u.RectAreaLight,"RedFormat",()=>u.RedFormat,"RedIntegerFormat",()=>u.RedIntegerFormat,"ReinhardToneMapping",()=>u.ReinhardToneMapping,"RenderTarget",()=>u.RenderTarget,"RenderTarget3D",()=>u.RenderTarget3D,"RepeatWrapping",()=>u.RepeatWrapping,"ReplaceStencilOp",()=>u.ReplaceStencilOp,"ReverseSubtractEquation",()=>u.ReverseSubtractEquation,"RingGeometry",()=>u.RingGeometry,"SIGNED_R11_EAC_Format",()=>u.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>u.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>u.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>u.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>u.SRGBColorSpace,"SRGBTransfer",()=>u.SRGBTransfer,"Scene",()=>u.Scene,"ShaderChunk",()=>l.ShaderChunk,"ShaderLib",()=>l.ShaderLib,"ShaderMaterial",()=>u.ShaderMaterial,"ShadowMaterial",()=>u.ShadowMaterial,"Shape",()=>u.Shape,"ShapeGeometry",()=>u.ShapeGeometry,"ShapePath",()=>u.ShapePath,"ShapeUtils",()=>u.ShapeUtils,"ShortType",()=>u.ShortType,"Skeleton",()=>u.Skeleton,"SkeletonHelper",()=>u.SkeletonHelper,"SkinnedMesh",()=>u.SkinnedMesh,"Source",()=>u.Source,"Sphere",()=>u.Sphere,"SphereGeometry",()=>u.SphereGeometry,"Spherical",()=>u.Spherical,"SphericalHarmonics3",()=>u.SphericalHarmonics3,"SplineCurve",()=>u.SplineCurve,"SpotLight",()=>u.SpotLight,"SpotLightHelper",()=>u.SpotLightHelper,"Sprite",()=>u.Sprite,"SpriteMaterial",()=>u.SpriteMaterial,"SrcAlphaFactor",()=>u.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>u.SrcAlphaSaturateFactor,"SrcColorFactor",()=>u.SrcColorFactor,"StaticCopyUsage",()=>u.StaticCopyUsage,"StaticDrawUsage",()=>u.StaticDrawUsage,"StaticReadUsage",()=>u.StaticReadUsage,"StereoCamera",()=>u.StereoCamera,"StreamCopyUsage",()=>u.StreamCopyUsage,"StreamDrawUsage",()=>u.StreamDrawUsage,"StreamReadUsage",()=>u.StreamReadUsage,"StringKeyframeTrack",()=>u.StringKeyframeTrack,"SubtractEquation",()=>u.SubtractEquation,"SubtractiveBlending",()=>u.SubtractiveBlending,"TOUCH",()=>u.TOUCH,"TangentSpaceNormalMap",()=>u.TangentSpaceNormalMap,"TetrahedronGeometry",()=>u.TetrahedronGeometry,"Texture",()=>u.Texture,"TextureLoader",()=>u.TextureLoader,"TextureUtils",()=>u.TextureUtils,"Timer",()=>u.Timer,"TimestampQuery",()=>u.TimestampQuery,"TorusGeometry",()=>u.TorusGeometry,"TorusKnotGeometry",()=>u.TorusKnotGeometry,"Triangle",()=>u.Triangle,"TriangleFanDrawMode",()=>u.TriangleFanDrawMode,"TriangleStripDrawMode",()=>u.TriangleStripDrawMode,"TrianglesDrawMode",()=>u.TrianglesDrawMode,"TubeGeometry",()=>u.TubeGeometry,"UVMapping",()=>u.UVMapping,"Uint16BufferAttribute",()=>u.Uint16BufferAttribute,"Uint32BufferAttribute",()=>u.Uint32BufferAttribute,"Uint8BufferAttribute",()=>u.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>u.Uint8ClampedBufferAttribute,"Uniform",()=>u.Uniform,"UniformsGroup",()=>u.UniformsGroup,"UniformsLib",()=>l.UniformsLib,"UniformsUtils",()=>u.UniformsUtils,"UnsignedByteType",()=>u.UnsignedByteType,"UnsignedInt101111Type",()=>u.UnsignedInt101111Type,"UnsignedInt248Type",()=>u.UnsignedInt248Type,"UnsignedInt5999Type",()=>u.UnsignedInt5999Type,"UnsignedIntType",()=>u.UnsignedIntType,"UnsignedShort4444Type",()=>u.UnsignedShort4444Type,"UnsignedShort5551Type",()=>u.UnsignedShort5551Type,"UnsignedShortType",()=>u.UnsignedShortType,"VSMShadowMap",()=>u.VSMShadowMap,"Vector2",()=>u.Vector2,"Vector3",()=>u.Vector3,"Vector4",()=>u.Vector4,"VectorKeyframeTrack",()=>u.VectorKeyframeTrack,"VideoFrameTexture",()=>u.VideoFrameTexture,"VideoTexture",()=>u.VideoTexture,"WebGL3DRenderTarget",()=>u.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>u.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>u.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>u.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>u.WebGLRenderTarget,"WebGLRenderer",()=>l.WebGLRenderer,"WebGLUtils",()=>l.WebGLUtils,"WebGPUCoordinateSystem",()=>u.WebGPUCoordinateSystem,"WebXRController",()=>u.WebXRController,"WireframeGeometry",()=>u.WireframeGeometry,"WrapAroundEnding",()=>u.WrapAroundEnding,"ZeroCurvatureEnding",()=>u.ZeroCurvatureEnding,"ZeroFactor",()=>u.ZeroFactor,"ZeroSlopeEnding",()=>u.ZeroSlopeEnding,"ZeroStencilOp",()=>u.ZeroStencilOp,"createCanvasElement",()=>u.createCanvasElement,"error",()=>u.error,"getConsoleFunction",()=>u.getConsoleFunction,"log",()=>u.log,"setConsoleFunction",()=>u.setConsoleFunction,"warn",()=>u.warn,"warnOnce",()=>u.warnOnce],32009);var c=e.i(32009);function d(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}let f=["x","y","top","bottom","left","right","width","height"];var h=e.i(46791);function m({ref:e,children:t,fallback:r,resize:a,style:i,gl:l,events:u=s.f,eventSource:h,eventPrefix:m,shadows:p,linear:g,flat:v,legacy:y,orthographic:A,frameloop:F,dpr:b,performance:C,raycaster:B,camera:S,scene:x,onPointerMissed:E,onCreated:M,...D}){o.useMemo(()=>(0,s.e)(c),[]);let I=(0,s.u)(),[k,w]=function({debounce:e,scroll:t,polyfill:r,offsetSize:a}={debounce:0,scroll:!1,offsetSize:!1}){var n,i,s;let l=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!l)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[u,c]=(0,o.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),h=(0,o.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:u,orientationHandler:null}),m=e?"number"==typeof e?e:e.scroll:null,p=e?"number"==typeof e?e:e.resize:null,g=(0,o.useRef)(!1);(0,o.useEffect)(()=>(g.current=!0,()=>void(g.current=!1)));let[v,y,A]=(0,o.useMemo)(()=>{let e=()=>{let e,t;if(!h.current.element)return;let{left:r,top:n,width:i,height:o,bottom:s,right:l,x:u,y:d}=h.current.element.getBoundingClientRect(),m={left:r,top:n,width:i,height:o,bottom:s,right:l,x:u,y:d};h.current.element instanceof HTMLElement&&a&&(m.height=h.current.element.offsetHeight,m.width=h.current.element.offsetWidth),Object.freeze(m),g.current&&(e=h.current.lastBounds,t=m,!f.every(r=>e[r]===t[r]))&&c(h.current.lastBounds=m)};return[e,p?d(e,p):e,m?d(e,m):e]},[c,a,m,p]);function F(){h.current.scrollContainers&&(h.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",A,!0)),h.current.scrollContainers=null),h.current.resizeObserver&&(h.current.resizeObserver.disconnect(),h.current.resizeObserver=null),h.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",h.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",h.current.orientationHandler))}function b(){h.current.element&&(h.current.resizeObserver=new l(A),h.current.resizeObserver.observe(h.current.element),t&&h.current.scrollContainers&&h.current.scrollContainers.forEach(e=>e.addEventListener("scroll",A,{capture:!0,passive:!0})),h.current.orientationHandler=()=>{A()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",h.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",h.current.orientationHandler))}return n=A,i=!!t,(0,o.useEffect)(()=>{if(i)return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)},[n,i]),s=y,(0,o.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,o.useEffect)(()=>{F(),b()},[t,A,y]),(0,o.useEffect)(()=>F,[]),[e=>{e&&e!==h.current.element&&(F(),h.current.element=e,h.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:a,overflowX:n,overflowY:i}=window.getComputedStyle(t);return[a,n,i].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),b())},u,v]}({scroll:!0,debounce:{scroll:50,resize:0},...a}),T=o.useRef(null),R=o.useRef(null);o.useImperativeHandle(e,()=>T.current);let P=(0,s.a)(E),[G,_]=o.useState(!1),[L,j]=o.useState(!1);if(G)throw G;if(L)throw L;let O=o.useRef(null);(0,s.b)(()=>{let e=T.current;w.width>0&&w.height>0&&e&&(O.current||(O.current=(0,s.c)(e)),async function(){await O.current.configure({gl:l,scene:x,events:u,shadows:p,linear:g,flat:v,legacy:y,orthographic:A,frameloop:F,dpr:b,performance:C,raycaster:B,camera:S,size:w,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(h?(0,s.i)(h)?h.current:h:R.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],a=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(a/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==M||M(e)}}),O.current.render((0,n.jsx)(I,{children:(0,n.jsx)(s.E,{set:j,children:(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)(s.B,{set:_}),children:null!=t?t:null})})}))}())}),o.useEffect(()=>{let e=T.current;if(e)return()=>(0,s.d)(e)},[]);let N=h?"none":"auto";return(0,n.jsx)("div",{ref:R,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...i},...D,children:(0,n.jsx)("div",{ref:k,style:{width:"100%",height:"100%"},children:(0,n.jsx)("canvas",{ref:T,style:{display:"block"},children:r})})})}function p(e){return(0,n.jsx)(h.FiberProvider,{children:(0,n.jsx)(m,{...e})})}e.i(39695),e.i(98133),e.i(95087);var g=e.i(66027),v=e.i(54970),y=e.i(12979),A=e.i(49774),F=e.i(73949),b=e.i(62395),C=e.i(75567),B=e.i(47071);let S={value:!0},x=` +vec3 terrainLinearToSRGB(vec3 linear) { + vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; + vec3 lower = linear * 12.92; + return mix(lower, higher, step(vec3(0.0031308), linear)); +} + +vec3 terrainSRGBToLinear(vec3 srgb) { + vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); + vec3 lower = srgb / 12.92; + return mix(lower, higher, step(vec3(0.04045), srgb)); +} + +// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines +// Returns 1.0 on grid lines, 0.0 elsewhere +float terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); +} +`;var E=e.i(79123),M=e.i(47021),D=e.i(48066);let I={0:32,1:32,2:32,3:32,4:32,5:32};function k({displacementMap:e,visibilityMask:t,textureNames:r,alphaTextures:a,detailTextureName:i,lightmap:s}){let{debugMode:l}=(0,E.useDebug)(),c=(0,B.useTexture)(r.map(e=>(0,y.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,C.setupTexture)(e))}),d=i?(0,y.textureToUrl)(i):null,f=(0,B.useTexture)(d??y.FALLBACK_TEXTURE_URL,e=>{(0,C.setupTexture)(e)}),h=(0,o.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:a,tiling:n,detailTexture:i=null,lightmap:o=null}){e.uniforms.sunLightPointsDown=S;let s=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),a&&(e.uniforms.visibilityMask={value:a}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:n[r]??32}}),o&&(e.uniforms.terrainLightmap={value:o}),i&&(e.uniforms.detailTexture={value:i},e.uniforms.detailTiling={value:64},e.uniforms.detailFadeDistance={value:150},e.vertexShader=e.vertexShader.replace("#include ",`#include +varying vec3 vTerrainWorldPos;`),e.vertexShader=e.vertexShader.replace("#include ",`#include +vTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;`)),e.fragmentShader=` +uniform sampler2D albedo0; +uniform sampler2D albedo1; +uniform sampler2D albedo2; +uniform sampler2D albedo3; +uniform sampler2D albedo4; +uniform sampler2D albedo5; +uniform sampler2D mask0; +uniform sampler2D mask1; +uniform sampler2D mask2; +uniform sampler2D mask3; +uniform sampler2D mask4; +uniform sampler2D mask5; +uniform float tiling0; +uniform float tiling1; +uniform float tiling2; +uniform float tiling3; +uniform float tiling4; +uniform float tiling5; +${a?"uniform sampler2D visibilityMask;":""} +${o?"uniform sampler2D terrainLightmap;":""} +uniform bool sunLightPointsDown; +${i?`uniform sampler2D detailTexture; +uniform float detailTiling; +uniform float detailFadeDistance; +varying vec3 vTerrainWorldPos;`:""} + +${x} + +// Global variable to store shadow factor from RE_Direct for use in output calculation +float terrainShadowFactor = 1.0; +`+e.fragmentShader,a){let t="#include ";e.fragmentShader=e.fragmentShader.replace(t,`${t} + // Early discard for invisible areas (before fog/lighting) + float visibility = texture2D(visibilityMask, vMapUv).r; + if (visibility < 0.5) { + discard; + } + `)}e.fragmentShader=e.fragmentShader.replace("#include ",` + // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js) + vec2 baseUv = vMapUv; + vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb; + ${s>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":""} + ${s>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":""} + ${s>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":""} + ${s>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":""} + ${s>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":""} + + // Sample alpha masks for all layers (use R channel) + // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices), + // but GPU linear filtering samples at texel centers. This offset aligns them. + vec2 alphaUv = baseUv + vec2(0.5 / 256.0); + float a0 = texture2D(mask0, alphaUv).r; + ${s>1?"float a1 = texture2D(mask1, alphaUv).r;":""} + ${s>2?"float a2 = texture2D(mask2, alphaUv).r;":""} + ${s>3?"float a3 = texture2D(mask3, alphaUv).r;":""} + ${s>4?"float a4 = texture2D(mask4, alphaUv).r;":""} + ${s>5?"float a5 = texture2D(mask5, alphaUv).r;":""} + + // Torque-style additive weighted blending (blender.cc): + // result = tex0 * alpha0 + tex1 * alpha1 + tex2 * alpha2 + ... + // Each layer's alpha map defines its contribution weight. + vec3 blended = c0 * a0; + ${s>1?"blended += c1 * a1;":""} + ${s>2?"blended += c2 * a2;":""} + ${s>3?"blended += c3 * a3;":""} + ${s>4?"blended += c4 * a4;":""} + ${s>5?"blended += c5 * a5;":""} + + // Assign to diffuseColor before lighting + vec3 textureColor = blended; + + ${i?`// Detail texture blending (Torque-style multiplicative blend) + // Sample detail texture at high frequency tiling + vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb; + + // Calculate distance-based fade factor using world positions + // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance + float distToCamera = distance(vTerrainWorldPos, cameraPosition); + float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0); + + // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor) + // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray + // Direct multiplication adds subtle darkening for surface detail + textureColor *= mix(vec3(1.0), detailColor, detailFade);`:""} + + // Store blended texture in diffuseColor (still in linear space here) + // We'll convert to sRGB in the output calculation + diffuseColor.rgb = textureColor; +`),o&&(e.fragmentShader=e.fragmentShader.replace("#include ",`#include + +// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting +#undef RE_Direct +void RE_Direct_TerrainShadow( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + // Torque lighting (terrLighting.cc): if light points up, terrain gets only ambient + // This prevents shadow acne from light hitting terrain backfaces + if (!sunLightPointsDown) { + terrainShadowFactor = 0.0; + return; + } + // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js) + // Extract shadow factor by comparing to original sun color + #if ( NUM_DIR_LIGHTS > 0 ) + vec3 originalSunColor = directionalLights[0].color; + float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b); + float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b); + terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0); + #endif + // Don't add to reflectedLight - we'll compute lighting in gamma space at output +} +#define RE_Direct RE_Direct_TerrainShadow + +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include +// Clear indirect diffuse - we'll compute ambient in gamma space +#if defined( RE_IndirectDiffuse ) + irradiance = vec3(0.0); +#endif +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include + // Clear Three.js lighting - we compute everything in gamma space + reflectedLight.directDiffuse = vec3(0.0); + reflectedLight.indirectDiffuse = vec3(0.0); +`)),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style terrain lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space +{ + // Get texture in sRGB space (undo Three.js linear decode) + vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb); + + ${o?` + // Sample terrain lightmap for smooth NdotL + vec2 lightmapUv = vMapUv + vec2(0.5 / 512.0); + float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r; + + // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file) + // Three.js interprets them as linear, but the numerical values are preserved + #if ( NUM_DIR_LIGHTS > 0 ) + vec3 sunColorSRGB = directionalLights[0].color; + #else + vec3 sunColorSRGB = vec3(0.7); + #endif + vec3 ambientColorSRGB = ambientLightColor; + + // Torque formula (terrLighting.cc:471-483): + // lighting = ambient + NdotL * shadowFactor * sunColor + // Clamp lighting to [0,1] before multiplying by texture + vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0); + `:` + // No lightmap - use simple ambient lighting + vec3 lightingSRGB = ambientLightColor; + `} + + // Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space + vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); + + // Convert back to linear for Three.js output pipeline + outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance; +} +#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`#if DEBUG_MODE + // Debug mode: overlay green grid matching terrain grid squares (256x256) + float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5); + vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green + gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.1); +#endif + +#include `)}({shader:e,baseTextures:c,alphaTextures:a,visibilityMask:t,tiling:I,detailTexture:d?f:null,lightmap:s}),(0,M.injectCustomFog)(e,D.globalFogUniforms)},[c,a,t,f,d,s]),m=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=m.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!l,e.needsUpdate=!0)},[l]);let p=`${d?"detail":"nodetail"}-${s?"lightmap":"nolightmap"}`;return(0,n.jsx)("meshLambertMaterial",{ref:m,map:e,depthWrite:!0,side:u.FrontSide,defines:{DEBUG_MODE:+!!l},onBeforeCompile:h},p)}function w(e){let t,r,a=(0,i.c)(8),{displacementMap:s,visibilityMask:l,textureNames:u,alphaTextures:c,detailTextureName:d,lightmap:f}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),a[0]=t):t=a[0],a[1]!==c||a[2]!==d||a[3]!==s||a[4]!==f||a[5]!==u||a[6]!==l?(r=(0,n.jsx)(o.Suspense,{fallback:t,children:(0,n.jsx)(k,{displacementMap:s,visibilityMask:l,textureNames:u,alphaTextures:c,detailTextureName:d,lightmap:f})}),a[1]=c,a[2]=d,a[3]=s,a[4]=f,a[5]=u,a[6]=l,a[7]=r):r=a[7],r}let T=(0,o.memo)(function(e){let t,r,a,o=(0,i.c)(15),{tileX:s,tileZ:l,blockSize:u,basePosition:c,textureNames:d,geometry:f,displacementMap:h,visibilityMask:m,alphaTextures:p,detailTextureName:g,lightmap:v,visible:y}=e,A=void 0===y||y,F=u/2,b=c.x+s*u+F,C=c.z+l*u+F;o[0]!==b||o[1]!==C?(t=[b,0,C],o[0]=b,o[1]=C,o[2]=t):t=o[2];let B=t;return o[3]!==p||o[4]!==g||o[5]!==h||o[6]!==v||o[7]!==d||o[8]!==m?(r=(0,n.jsx)(w,{displacementMap:h,visibilityMask:m,textureNames:d,alphaTextures:p,detailTextureName:g,lightmap:v}),o[3]=p,o[4]=g,o[5]=h,o[6]=v,o[7]=d,o[8]=m,o[9]=r):r=o[9],o[10]!==f||o[11]!==B||o[12]!==r||o[13]!==A?(a=(0,n.jsx)("mesh",{position:B,geometry:f,castShadow:!0,receiveShadow:!0,visible:A,children:r}),o[10]=f,o[11]=B,o[12]=r,o[13]=A,o[14]=a):a=o[14],a});e.i(13876);var R=e.i(58647);function P(e){return(0,R.useRuntimeObjectByName)(e)}function G(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,a=r>>8&255,n=r>>16,i=256*a;for(let r=0;r0?a:(t[0]!==r?(e=(0,b.getFloat)(r,"visibleDistance")??600,t[0]=r,t[1]=e):e=t[1],e)}(),z=(0,F.useThree)(L),q=-(128*H);w[6]!==q?(s={x:q,z:q},w[6]=q,w[7]=s):s=w[7];let Q=s;if(w[8]!==R){let e=(0,b.getProperty)(R,"emptySquares");l=e?e.split(" ").map(j):[],w[8]=R,w[9]=l}else l=w[9];let W=l,{data:X}=((k=(0,i.c)(2))[0]!==_?(I={queryKey:["terrain",_],queryFn:()=>(0,y.loadTerrain)(_)},k[0]=_,k[1]=I):I=k[1],(0,g.useQuery)(I));e:{let e;if(!X){c=null;break e}let t=256*H;w[10]!==t||w[11]!==H||w[12]!==X.heightMap?(!function(e,t,r){let a=e.attributes.position,n=e.attributes.uv,i=e.attributes.normal,o=a.array,s=n.array,l=i.array,u=a.count,c=(e,r)=>(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),d=(e,r)=>{let a=Math.floor(e=Math.max(0,Math.min(255,e))),n=Math.floor(r=Math.max(0,Math.min(255,r))),i=Math.min(a+1,255),o=Math.min(n+1,255),s=e-a,l=r-n;return(t[256*n+a]/65535*2048*(1-s)+t[256*n+i]/65535*2048*s)*(1-l)+(t[256*o+a]/65535*2048*(1-s)+t[256*o+i]/65535*2048*s)*l};for(let e=0;e0?(m/=v,p/=v,g/=v):(m=0,p=1,g=0),l[3*e]=m,l[3*e+1]=p,l[3*e+2]=g}a.needsUpdate=!0,i.needsUpdate=!0}(e=function(e,t){let r=new u.BufferGeometry,a=new Float32Array(198147),n=new Float32Array(198147),i=new Float32Array(132098),o=new Uint32Array(393216),s=0,l=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let o=257*t+r;a[3*o]=r*l-e/2,a[3*o+1]=e/2-t*l,a[3*o+2]=0,n[3*o]=0,n[3*o+1]=0,n[3*o+2]=1,i[2*o]=r/256,i[2*o+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,a=r+1,n=(e+1)*257+t,i=n+1;((t^e)&1)==0?(o[s++]=r,o[s++]=n,o[s++]=i,o[s++]=r,o[s++]=i,o[s++]=a):(o[s++]=r,o[s++]=n,o[s++]=a,o[s++]=a,o[s++]=n,o[s++]=i)}return r.setIndex(new u.BufferAttribute(o,1)),r.setAttribute("position",new u.Float32BufferAttribute(a,3)),r.setAttribute("normal",new u.Float32BufferAttribute(n,3)),r.setAttribute("uv",new u.Float32BufferAttribute(i,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(t,0),X.heightMap,H),w[10]=t,w[11]=H,w[12]=X.heightMap,w[13]=e):e=w[13],c=e}let Y=c,Z=P("Sun");t:{let e,t;if(!Z){let e;w[14]===Symbol.for("react.memo_cache_sentinel")?(e=new u.Vector3(.57735,-.57735,.57735),w[14]=e):e=w[14],d=e;break t}w[15]!==Z?(e=((0,b.getProperty)(Z,"direction")??"0.57735 0.57735 -0.57735").split(" ").map(O),w[15]=Z,w[16]=e):e=w[16];let[r,a,n]=e,i=Math.sqrt(r*r+n*n+a*a),o=r/i,s=n/i,l=a/i;w[17]!==s||w[18]!==l||w[19]!==o?(t=new u.Vector3(o,s,l),w[17]=s,w[18]=l,w[19]=o,w[20]=t):t=w[20],d=t}let $=d;r:{let e;if(!X){f=null;break r}w[21]!==H||w[22]!==$||w[23]!==X.heightMap?(e=function(e,t,r){let a=(t,r)=>{let a=Math.max(0,Math.min(255,t)),n=Math.max(0,Math.min(255,r)),i=Math.floor(a),o=Math.floor(n),s=Math.min(i+1,255),l=Math.min(o+1,255),u=a-i,c=n-o;return((e[256*o+i]/65535*(1-u)+e[256*o+s]/65535*u)*(1-c)+(e[256*l+i]/65535*(1-u)+e[256*l+s]/65535*u)*c)*2048},n=new u.Vector3(-t.x,-t.y,-t.z).normalize(),i=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let o=t/2+.25,s=e/2+.25,l=a(o,s),u=a(o-.5,s),c=a(o+.5,s),d=a(o,s-.5),f=-((a(o,s+.5)-d)/1),h=-((c-u)/1),m=Math.sqrt(f*f+r*r+h*h),p=Math.max(0,f/m*n.x+r/m*n.y+h/m*n.z),g=1;p>0&&(g=function(e,t,r,a,n,i){let o=a.z/n,s=a.x/n,l=a.y,u=Math.sqrt(o*o+s*s);if(u<1e-4)return 1;let c=.5/u,d=o*c,f=s*c,h=l*c,m=e,p=t,g=r+.1;for(let e=0;e<768&&(m+=d,p+=f,g+=h,!(m<0)&&!(m>=256)&&!(p<0)&&!(p>=256)&&!(g>2048));e++)if(gArray(eo).fill(null),w[34]=eo,w[35]=B):B=w[35];let[el,eu]=(0,o.useState)(B);w[36]===Symbol.for("react.memo_cache_sentinel")?(S={xStart:0,xEnd:0,zStart:0,zEnd:0},w[36]=S):S=w[36];let ec=(0,o.useRef)(S);return(w[37]!==Q.x||w[38]!==Q.z||w[39]!==V||w[40]!==z.position.x||w[41]!==z.position.z||w[42]!==eo||w[43]!==K?(x=()=>{let e=z.position.x-Q.x,t=z.position.z-Q.z,r=Math.floor((e-K)/V),a=Math.ceil((e+K)/V),n=Math.floor((t-K)/V),i=Math.ceil((t+K)/V),o=ec.current;if(r===o.xStart&&a===o.xEnd&&n===o.zStart&&i===o.zEnd)return;o.xStart=r,o.xEnd=a,o.zStart=n,o.zEnd=i;let s=[];for(let e=r;e{let t=el[e];return(0,n.jsx)(T,{tileX:t?.tileX??0,tileZ:t?.tileZ??0,blockSize:V,basePosition:Q,textureNames:X.textureNames,geometry:Y,displacementMap:et,visibilityMask:ea,alphaTextures:en,detailTextureName:J,lightmap:ee,visible:null!==t},e)}),w[55]=Q,w[56]=V,w[57]=J,w[58]=es,w[59]=en,w[60]=et,w[61]=Y,w[62]=X.textureNames,w[63]=ee,w[64]=el,w[65]=M):M=w[65],w[66]!==E||w[67]!==M?(D=(0,n.jsxs)(n.Fragment,{children:[E,M]}),w[66]=E,w[67]=M,w[68]=D):D=w[68],D):null});function L(e){return e.camera}function j(e){return parseInt(e,10)}function O(e){return parseFloat(e)}function N(e){return(0,C.setupMask)(e)}function U(e,t){return t}let H=(0,o.createContext)(null);function J(){return(0,o.useContext)(H)}function V(e){return(0,n.jsx)(t4,{objectId:e},e)}var K=o;let z=(0,K.createContext)(null),q={didCatch:!1,error:null};class Q extends K.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=q}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;null!==t&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(q))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:a}=this.props;r&&null!==t.error&&function(e=[],t=[]){return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,a)&&(this.props.onReset?.({next:a,prev:e.resetKeys,reason:"keys"}),this.setState(q))}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:a}=this.props,{didCatch:n,error:i}=this.state,o=e;if(n){let e={error:i,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(r)o=(0,K.createElement)(r,e);else if(void 0!==a)o=a;else throw i}return(0,K.createElement)(z.Provider,{value:{didCatch:n,error:i,resetErrorBoundary:this.resetErrorBoundary}},o)}}var W=e.i(31067),X=u;function Y(e,t){if(t===u.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==u.TriangleFanDrawMode&&t!==u.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],a=e.getAttribute("position");if(void 0===a)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e=2.0 are supported."));return}let s=new eV(n,{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&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}s.setExtensions(i),s.setPlugins(o),s.parse(r,a)}parseAsync(e,t){let r=this;return new Promise(function(a,n){r.parse(e,t,a,n)})}}function ea(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let en={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"};class ei{constructor(e){this.parser=e,this.name=en.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,a=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n.source,i)}}class eA{constructor(e){this.parser=e,this.name=en.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,a=r.json,n=a.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],o=a.images[i.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,s);if(a.extensionsRequired&&a.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class eF{constructor(e){this.parser=e,this.name=en.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,a=r.json,n=a.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],o=a.images[i.source],s=r.textureLoader;if(o.uri){let e=r.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,s);if(a.extensionsRequired&&a.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class eb{constructor(e){this.name=en.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],a=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return a.then(function(t){let r=e.byteOffset||0,a=e.byteLength||0,i=e.count,o=e.byteStride,s=new Uint8Array(t,r,a);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(i,o,s,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(i*o);return n.decodeGltfBuffer(new Uint8Array(t),i,o,s,e.mode,e.filter),t})})}}}class eC{constructor(e){this.name=en.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==ew.TRIANGLES&&e.mode!==ew.TRIANGLE_STRIP&&e.mode!==ew.TRIANGLE_FAN&&void 0!==e.mode)return null;let a=r.extensions[this.name].attributes,n=[],i={};for(let e in a)n.push(this.parser.getDependency("accessor",a[e]).then(t=>(i[e]=t,i[e])));return n.length<1?null:(n.push(this.parser.createNodeMesh(e)),Promise.all(n).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],a=e[0].count,n=[];for(let e of r){let t=new X.Matrix4,r=new X.Vector3,o=new X.Quaternion,s=new X.Vector3(1,1,1),l=new X.InstancedMesh(e.geometry,e.material,a);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"},eL={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ej={CUBICSPLINE:void 0,LINEAR:X.InterpolateLinear,STEP:X.InterpolateDiscrete};function eO(e,t,r){for(let a in r.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=r.extensions[a])}function eN(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function eU(e){let t="",r=Object.keys(e).sort();for(let a=0,n=r.length;a-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||a&&n<98?this.textureLoader=new X.TextureLoader(this.options.manager):this.textureLoader=new X.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new X.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let r=this,a=this.json,n=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([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(t){let i={scene:t[0][a.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:a.asset,parser:r,userData:{}};return eO(n,i,a),eN(i,a),Promise.all(r._invokeAll(function(e){return e.afterRoot&&e.afterRoot(i)})).then(function(){for(let e of i.scenes)e.updateMatrixWorld();e(i)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,a=t.length;r{let r=this.associations.get(e);for(let[a,i]of(null!=r&&this.associations.set(t,r),e.children.entries()))n(i,t.children[a])};return n(r,a),a.name+="_instance_"+e.uses[t]++,a}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&i.setY(t,d[e*s+1]),s>=3&&i.setZ(t,d[e*s+2]),s>=4&&i.setW(t,d[e*s+3]),s>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i})}loadTexture(e){let t=this.json,r=this.options,a=t.textures[e].source,n=t.images[a],i=this.textureLoader;if(n.uri){let e=r.manager.getHandler(n.uri);null!==e&&(i=e)}return this.loadTextureImage(e,a,i)}loadTextureImage(e,t,r){let a=this,n=this.json,i=n.textures[e],o=n.images[t],s=(o.uri||o.bufferView)+":"+i.sampler;if(this.textureCache[s])return this.textureCache[s];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=i.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let r=(n.samplers||{})[i.sampler]||{};return t.magFilter=eR[r.magFilter]||X.LinearFilter,t.minFilter=eR[r.minFilter]||X.LinearMipmapLinearFilter,t.wrapS=eP[r.wrapS]||X.RepeatWrapping,t.wrapT=eP[r.wrapT]||X.RepeatWrapping,a.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=l,l}loadImageSource(e,t){let r=this.json,a=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let n=r.images[e],i=self.URL||self.webkitURL,o=n.uri||"",s=!1;if(void 0!==n.bufferView)o=this.getDependency("bufferView",n.bufferView).then(function(e){s=!0;let t=new Blob([e],{type:n.mimeType});return o=i.createObjectURL(t)});else if(void 0===n.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(e){return new Promise(function(r,n){let i=r;!0===t.isImageBitmapLoader&&(i=function(e){let t=new X.Texture(e);t.needsUpdate=!0,r(t)}),t.load(X.LoaderUtils.resolveURL(e,a.path),i,void 0,n)})}).then(function(e){var t;return!0===s&&i.revokeObjectURL(o),eN(e,n),e.userData.mimeType=n.mimeType||((t=n.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,a){let n=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((i=i.clone()).channel=r.texCoord),n.extensions[en.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[en.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(i);i=n.extensions[en.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),n.associations.set(i,t)}}return void 0!==a&&("number"==typeof a&&(a=3001===a?ee:et),"colorSpace"in i?i.colorSpace=a:i.encoding=a===ee?3001:3e3),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,r=e.material,a=void 0===t.attributes.tangent,n=void 0!==t.attributes.color,i=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new X.PointsMaterial,X.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new X.LineBasicMaterial,X.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(a||n||i){let e="ClonedMaterial:"+r.uuid+":";a&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),i&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),n&&(t.vertexColors=!0),i&&(t.flatShading=!0),a&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return X.MeshStandardMaterial}loadMaterial(e){let t,r=this,a=this.json,n=this.extensions,i=a.materials[e],o={},s=i.extensions||{},l=[];if(s[en.KHR_MATERIALS_UNLIT]){let e=n[en.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(o,i,r))}else{let a=i.pbrMetallicRoughness||{};if(o.color=new X.Color(1,1,1),o.opacity=1,Array.isArray(a.baseColorFactor)){let e=a.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],et),o.opacity=e[3]}void 0!==a.baseColorTexture&&l.push(r.assignTexture(o,"map",a.baseColorTexture,ee)),o.metalness=void 0!==a.metallicFactor?a.metallicFactor:1,o.roughness=void 0!==a.roughnessFactor?a.roughnessFactor:1,void 0!==a.metallicRoughnessTexture&&(l.push(r.assignTexture(o,"metalnessMap",a.metallicRoughnessTexture)),l.push(r.assignTexture(o,"roughnessMap",a.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}!0===i.doubleSided&&(o.side=X.DoubleSide);let u=i.alphaMode||"OPAQUE";if("BLEND"===u?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,"MASK"===u&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==X.MeshBasicMaterial&&(l.push(r.assignTexture(o,"normalMap",i.normalTexture)),o.normalScale=new X.Vector2(1,1),void 0!==i.normalTexture.scale)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==i.occlusionTexture&&t!==X.MeshBasicMaterial&&(l.push(r.assignTexture(o,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==X.MeshBasicMaterial){let e=i.emissiveFactor;o.emissive=new X.Color().setRGB(e[0],e[1],e[2],et)}return void 0!==i.emissiveTexture&&t!==X.MeshBasicMaterial&&l.push(r.assignTexture(o,"emissiveMap",i.emissiveTexture,ee)),Promise.all(l).then(function(){let a=new t(o);return i.name&&(a.name=i.name),eN(a,i),r.associations.set(a,{materials:e}),i.extensions&&eO(n,a,i),a})}createUniqueName(e){let t=X.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,a=this.primitiveCache,n=[];for(let i=0,o=e.length;i0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,a=t.weights.length;r1?new X.Group:1===t.length?t[0]:new X.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of a.associations)(e instanceof X.Material||e instanceof X.Texture)&&t.set(e,r);return e.traverse(e=>{let r=a.associations.get(e);null!=r&&t.set(e,r)}),t})(n),n})}_createAnimationTracks(e,t,r,a,n){let i,o=[],s=e.name?e.name:e.uuid,l=[];switch(eL[n.path]===eL.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(s),eL[n.path]){case eL.weights:i=X.NumberKeyframeTrack;break;case eL.rotation:i=X.QuaternionKeyframeTrack;break;case eL.position:case eL.scale:i=X.VectorKeyframeTrack;break;default:i=1===r.itemSize?X.NumberKeyframeTrack:X.VectorKeyframeTrack}let u=void 0!==a.interpolation?ej[a.interpolation]:X.InterpolateLinear,c=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(a)},r,a)}decodeDracoFile(e,t,r,a){let n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let a=JSON.stringify(t);if(eq.has(e)){let t=eq.get(e);if(t.key===a)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n=this.workerNextTaskID++,i=e.byteLength,o=this._getWorker(n,i).then(a=>(r=a,new Promise((a,i)=>{r._callbacks[n]={resolve:a,reject:i},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),eq.set(e,{key:a,promise:o}),o}_createGeometry(e){let t=new ez.BufferGeometry;e.index&&t.setIndex(new ez.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,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 r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let a=eW.toString(),n=["/* draco decoder */",r,"\n/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_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,r=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(n),n.byteLength);try{let e=function(e,t,r,a){var n,i,o;let s,l,u,c,d,f,h=a.attributeIDs,m=a.attributeTypes,p=t.GetEncodedGeometryType(r);if(p===e.TRIANGULAR_MESH)d=new e.Mesh,f=t.DecodeBufferToMesh(r,d);else if(p===e.POINT_CLOUD)d=new e.PointCloud,f=t.DecodeBufferToPointCloud(r,d);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||0===d.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let g={index:null,attributes:[]};for(let r in h){let n,i,o=self[m[r]];if(a.useUniqueIDs)i=h[r],n=t.GetAttributeByUniqueId(d,i);else{if(-1===(i=t.GetAttributeId(d,e[h[r]])))continue;n=t.GetAttribute(d,i)}g.attributes.push(function(e,t,r,a,n,i){let o=i.num_components(),s=r.num_points()*o,l=s*n.BYTES_PER_ELEMENT,u=function(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}}(e,n),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(r,i,u,l,c);let d=new n(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:a,array:d,itemSize:o}}(e,t,d,r,o,n))}return p===e.TRIANGULAR_MESH&&(n=e,i=t,o=d,s=3*o.num_faces(),l=4*s,u=n._malloc(l),i.GetTrianglesUInt32Array(o,l,u),c=new Uint32Array(n.HEAPF32.buffer,u,s).slice(),n._free(u),g.index={array:c,itemSize:1}),e.destroy(d),g}(t,r,o,i),n=e.attributes.map(e=>e.array.buffer);e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:e},n)}catch(e){console.error(e),self.postMessage({type:"error",id:a.id,error:e.message})}finally{t.destroy(o),t.destroy(r)}})}}}var eX=e.i(971);let eY=function(e){let t=new Map,r=new Map,a=e.clone();return function e(t,r,a){a(t,r);for(let n=0;n{let f={keys:l,deep:a,inject:s,castShadow:n,receiveShadow:i};if(Array.isArray(t=o.useMemo(()=>{if(!1===e&&!Array.isArray(t)){let e=!1;if(t.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return eY(t)}return t},[t,e])))return o.createElement("group",(0,W.default)({},c,{ref:d}),t.map(e=>o.createElement(eZ,(0,W.default)({key:e.uuid,object:e},f))),r);let{children:h,...m}=function(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:r,inject:a,castShadow:n,receiveShadow:i}){let s={};for(let r of t)s[r]=e[r];return r&&(s.geometry&&"materialsOnly"!==r&&(s.geometry=s.geometry.clone()),s.material&&"geometriesOnly"!==r&&(s.material=s.material.clone())),a&&(s="function"==typeof a?{...s,children:a(e)}:o.isValidElement(a)?{...s,children:a}:{...s,...a}),e instanceof u.Mesh&&(n&&(s.castShadow=!0),i&&(s.receiveShadow=!0)),s}(t,f),p=t.type[0].toLowerCase()+t.type.slice(1);return o.createElement(p,(0,W.default)({},m,c,{ref:d}),t.children.map(e=>"Bone"===e.type?o.createElement("primitive",(0,W.default)({key:e.uuid,object:e},f)):o.createElement(eZ,(0,W.default)({key:e.uuid,object:e},f,{isChild:!0}))),r,h)}),e$=null,e0="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function e1(e=!0,r=!0,a){return n=>{a&&a(n),e&&(e$||(e$=new eQ),e$.setDecoderPath("string"==typeof e?e:e0),n.setDRACOLoader(e$)),r&&n.setMeshoptDecoder((()=>{let e;if(t)return t;let r=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]),a=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("object"!=typeof WebAssembly)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(r)&&(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 i=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?a-71:a>64?a-65:a>47?a+4:a>46?63:62}let r=0;for(let n=0;n{(e=t.instance).exports.__wasm_call_ctors()});function o(t,r,a,n,i,o){let s=e.exports.sbrk,l=a+3&-4,u=s(l*n),c=s(i.length),d=new Uint8Array(e.exports.memory.buffer);d.set(i,c);let f=t(u,a,n,c,i.length);if(0===f&&o&&o(u,l,n),r.set(d.subarray(u,u+a*n)),s(u-s(0)),0!==f)throw Error(`Malformed buffer data: ${f}`)}let s={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:i,supported:!0,decodeVertexBuffer(t,r,a,n,i){o(e.exports.meshopt_decodeVertexBuffer,t,r,a,n,e.exports[s[i]])},decodeIndexBuffer(t,r,a,n){o(e.exports.meshopt_decodeIndexBuffer,t,r,a,n)},decodeIndexSequence(t,r,a,n){o(e.exports.meshopt_decodeIndexSequence,t,r,a,n)},decodeGltfBuffer(t,r,a,n,i,u){o(e.exports[l[i]],t,r,a,n,e.exports[s[u]])}}})())}}let e2=(e,t,r,a)=>(0,eX.useLoader)(er,e,e1(t,r,a));e2.preload=(e,t,r,a)=>eX.useLoader.preload(er,e,e1(t,r,a)),e2.clear=e=>eX.useLoader.clear(er,e),e2.setDecoderPath=e=>{e0=e};var e3=e.i(89887);let e9=` +vec3 interiorLinearToSRGB(vec3 linear) { + vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; + vec3 lower = linear * 12.92; + return mix(lower, higher, step(vec3(0.0031308), linear)); +} + +vec3 interiorSRGBToLinear(vec3 srgb) { + vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); + vec3 lower = srgb / 12.92; + return mix(lower, higher, step(vec3(0.04045), srgb)); +} + +// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines +// Returns 1.0 on grid lines, 0.0 elsewhere +float debugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); +} +`;function e5({materialName:e,material:t,lightMap:r}){let a=(0,E.useDebug)(),i=a?.debugMode??!1,s=(0,y.textureToUrl)(e),l=(0,B.useTexture)(s,e=>(0,C.setupTexture)(e)),c=new Set(t?.userData?.flag_names??[]).has("SelfIlluminating"),d=new Set(t?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),f=(0,o.useCallback)(e=>{let t;(0,M.injectCustomFog)(e,D.globalFogUniforms),t=d??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new u.Vector3(0,.4,1):new u.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include +${e9} +uniform bool useSceneLighting; +uniform vec3 interiorDebugColor; +`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Lightmap handled in custom output calculation +#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space +// Get texture in sRGB space (undo Three.js linear decode) +vec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb); + +// Compute lighting in sRGB space +vec3 lightingSRGB = vec3(0.0); + +if (useSceneLighting) { + // Three.js computed: reflectedLight = lighting \xd7 texture_linear / PI + // Extract pure lighting: lighting = reflectedLight \xd7 PI / texture_linear + vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001)); + vec3 extractedLighting = totalLight * PI / safeTexLinear; + // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors + // are sRGB values (Torque used them directly in gamma space). Three.js treats them + // as linear but the numerical values are the same. DO NOT convert to sRGB here! + // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap + // (sceneLighting.cc line 1785: tmp.clamp()) + lightingSRGB = clamp(extractedLighting, 0.0, 1.0); +} + +// Add lightmap contribution (for BOTH outside and inside surfaces) +// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load +// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here. +#ifdef USE_LIGHTMAP + // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back + lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb); +#endif +// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827) +lightingSRGB = clamp(lightingSRGB, 0.0, 1.0); + +// Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space +vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); + +// Convert back to linear for Three.js output pipeline +vec3 resultLinear = interiorSRGBToLinear(resultSRGB); + +// Reassign outgoingLight before opaque_fragment consumes it +outgoingLight = resultLinear + totalEmissiveRadiance; + +#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`// Debug mode: overlay colored grid on top of normal rendering +// Blue grid = SurfaceOutsideVisible (receives scene ambient light) +// Red grid = inside surface (no scene ambient light) +#if DEBUG_MODE && defined(USE_MAP) + // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide + float gridIntensity = debugGrid(vMapUv, 4.0, 1.5); + gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); +#endif + +#include `)},[d]),h=(0,o.useRef)(null),m=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=h.current??m.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!i,e.needsUpdate=!0)},[i]);let p={DEBUG_MODE:+!!i},g=`${d}`;return c?(0,n.jsx)("meshBasicMaterial",{ref:h,map:l,toneMapped:!1,defines:p,onBeforeCompile:f},g):(0,n.jsx)("meshLambertMaterial",{ref:m,map:l,lightMap:r,toneMapped:!1,defines:p,onBeforeCompile:f},g)}function e8(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=u.SRGBColorSpace),t??null}function e6(e){let t,r,a,s=(0,i.c)(13),{node:l}=e;e:{let e,r;if(!l.material){let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],s[0]=e):e=s[0],t=e;break e}if(Array.isArray(l.material)){let e;s[1]!==l.material?(e=l.material.map(e4),s[1]=l.material,s[2]=e):e=s[2],t=e;break e}s[3]!==l.material?(e=e8(l.material),s[3]=l.material,s[4]=e):e=s[4],s[5]!==e?(r=[e],s[5]=e,s[6]=r):r=s[6],t=r}let u=t;return s[7]!==u||s[8]!==l.material?(r=l.material?(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(l.material)?l.material.map((e,t)=>(0,n.jsx)(e5,{materialName:e.userData.resource_path,material:e,lightMap:u[t]},t)):(0,n.jsx)(e5,{materialName:l.material.userData.resource_path,material:l.material,lightMap:u[0]})}):null,s[7]=u,s[8]=l.material,s[9]=r):r=s[9],s[10]!==l.geometry||s[11]!==r?(a=(0,n.jsx)("mesh",{geometry:l.geometry,castShadow:!0,receiveShadow:!0,children:r}),s[10]=l.geometry,s[11]=r,s[12]=a):a=s[12],a}function e4(e){return e8(e)}let e7=(0,o.memo)(function(e){let t,r,a,o,s,l,u=(0,i.c)(10),{object:c,interiorFile:d}=e,{nodes:f}=((l=(0,i.c)(2))[0]!==d?(s=(0,y.interiorToUrl)(d),l[0]=d,l[1]=s):s=l[1],e2(s)),h=(0,E.useDebug)(),m=h?.debugMode??!1;return u[0]===Symbol.for("react.memo_cache_sentinel")?(t=[0,-Math.PI/2,0],u[0]=t):t=u[0],u[1]!==f?(r=Object.entries(f).filter(ta).map(tn),u[1]=f,u[2]=r):r=u[2],u[3]!==m||u[4]!==d||u[5]!==c?(a=m?(0,n.jsxs)(e3.FloatingLabel,{children:[c._id,": ",d]}):null,u[3]=m,u[4]=d,u[5]=c,u[6]=a):a=u[6],u[7]!==r||u[8]!==a?(o=(0,n.jsxs)("group",{rotation:t,children:[r,a]}),u[7]=r,u[8]=a,u[9]=o):o=u[9],o});function te(e){let t,r,a,o,s=(0,i.c)(9),{color:l,label:u}=e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("boxGeometry",{args:[10,10,10]}),s[0]=t):t=s[0],s[1]!==l?(r=(0,n.jsx)("meshStandardMaterial",{color:l,wireframe:!0}),s[1]=l,s[2]=r):r=s[2],s[3]!==l||s[4]!==u?(a=u?(0,n.jsx)(e3.FloatingLabel,{color:l,children:u}):null,s[3]=l,s[4]=u,s[5]=a):a=s[5],s[6]!==r||s[7]!==a?(o=(0,n.jsxs)("mesh",{children:[t,r,a]}),s[6]=r,s[7]=a,s[8]=o):o=s[8],o}function tt(e){let t,r=(0,i.c)(3),{label:a}=e,o=(0,E.useDebug)(),s=o?.debugMode??!1;return r[0]!==s||r[1]!==a?(t=s?(0,n.jsx)(te,{color:"red",label:a}):null,r[0]=s,r[1]=a,r[2]=t):t=r[2],t}let tr=(0,o.memo)(function(e){let t,r,a,s,l,u,c,d,f,h=(0,i.c)(22),{object:m}=e;h[0]!==m?(t=(0,b.getProperty)(m,"interiorFile"),h[0]=m,h[1]=t):t=h[1];let p=t;h[2]!==m?(r=(0,b.getPosition)(m),h[2]=m,h[3]=r):r=h[3];let g=r;h[4]!==m?(a=(0,b.getScale)(m),h[4]=m,h[5]=a):a=h[5];let v=a;h[6]!==m?(s=(0,b.getRotation)(m),h[6]=m,h[7]=s):s=h[7];let y=s,A=`${m._id}: ${p}`;return h[8]!==A?(l=(0,n.jsx)(tt,{label:A}),h[8]=A,h[9]=l):l=h[9],h[10]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.jsx)(te,{color:"orange"}),h[10]=u):u=h[10],h[11]!==p||h[12]!==m?(c=(0,n.jsx)(o.Suspense,{fallback:u,children:(0,n.jsx)(e7,{object:m,interiorFile:p})}),h[11]=p,h[12]=m,h[13]=c):c=h[13],h[14]!==l||h[15]!==c?(d=(0,n.jsx)(Q,{fallback:l,children:c}),h[14]=l,h[15]=c,h[16]=d):d=h[16],h[17]!==g||h[18]!==y||h[19]!==v||h[20]!==d?(f=(0,n.jsx)("group",{position:g,quaternion:y,scale:v,children:d}),h[17]=g,h[18]=y,h[19]=v,h[20]=d,h[21]=f):f=h[21],f});function ta(e){let[,t]=e;return t.isMesh}function tn(e){let[t,r]=e;return(0,n.jsx)(e6,{node:r},t)}function ti(e,{path:t}){let[r]=(0,eX.useLoader)(u.CubeTextureLoader,[e],e=>e.setPath(t));return r}ti.preload=(e,{path:t})=>eX.useLoader.preload(u.CubeTextureLoader,[e],e=>e.setPath(t));let to=()=>{};function ts(e){return e.wrapS=u.RepeatWrapping,e.wrapT=u.RepeatWrapping,e.minFilter=u.LinearFilter,e.magFilter=u.LinearFilter,e.colorSpace=u.NoColorSpace,e.needsUpdate=!0,e}let tl=` + attribute float alpha; + + uniform vec2 uvOffset; + + varying vec2 vUv; + varying float vAlpha; + + void main() { + // Apply UV offset for scrolling + vUv = uv + uvOffset; + vAlpha = alpha; + + vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + // Set depth to far plane so clouds are always visible and behind other geometry + gl_Position = pos.xyww; + } +`,tu=` + uniform sampler2D cloudTexture; + uniform float debugMode; + uniform int layerIndex; + + varying vec2 vUv; + varying float vAlpha; + + // Debug grid using screen-space derivatives for sharp, anti-aliased lines + float debugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); + } + + void main() { + vec4 texColor = texture2D(cloudTexture, vUv); + + // Tribes 2 uses GL_MODULATE: final = texture \xd7 vertex color + // Vertex color is white with varying alpha, so: + // Final RGB = Texture RGB \xd7 1.0 = Texture RGB + // Final Alpha = Texture Alpha \xd7 Vertex Alpha + float finalAlpha = texColor.a * vAlpha; + vec3 color = texColor.rgb; + + // Debug mode: overlay R/G/B grid for layers 0/1/2 + if (debugMode > 0.5) { + float gridIntensity = debugGrid(vUv, 4.0, 1.5); + vec3 gridColor; + if (layerIndex == 0) { + gridColor = vec3(1.0, 0.0, 0.0); // Red + } else if (layerIndex == 1) { + gridColor = vec3(0.0, 1.0, 0.0); // Green + } else { + gridColor = vec3(0.0, 0.0, 1.0); // Blue + } + color = mix(color, gridColor, gridIntensity * 0.5); + } + + // Output clouds with texture color and combined alpha + gl_FragColor = vec4(color, finalAlpha); + } +`;function tc({textureUrl:e,radius:t,heightPercent:r,speed:a,windDirection:i,layerIndex:s}){let{debugMode:l}=(0,E.useDebug)(),{animationEnabled:c}=(0,E.useSettings)(),d=(0,o.useRef)(null),f=(0,B.useTexture)(e,ts),h=(0,o.useMemo)(()=>{let e=r-.05;return function(e,t,r,a){var n;let i,o,s,l,c,d,f,h,m,p,g,v,y,A,F,b,C,B=new u.BufferGeometry,S=new Float32Array(75),x=new Float32Array(50),E=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],M=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let a=5*t+r,n=-e+r*M,i=e-t*M,o=e*E[a];S[3*a]=n,S[3*a+1]=o,S[3*a+2]=i,x[2*a]=r,x[2*a+1]=t}n=S,i=e=>({x:n[3*e],y:n[3*e+1],z:n[3*e+2]}),o=(e,t,r,a)=>{n[3*e]=t,n[3*e+1]=r,n[3*e+2]=a},s=i(1),l=i(3),c=i(5),d=i(6),f=i(8),h=i(9),m=i(15),p=i(16),g=i(18),v=i(19),y=i(21),A=i(23),F=c.x+(s.x-c.x)*.5,b=c.y+(s.y-c.y)*.5,C=c.z+(s.z-c.z)*.5,o(0,d.x+(F-d.x)*2,d.y+(b-d.y)*2,d.z+(C-d.z)*2),F=h.x+(l.x-h.x)*.5,b=h.y+(l.y-h.y)*.5,C=h.z+(l.z-h.z)*.5,o(4,f.x+(F-f.x)*2,f.y+(b-f.y)*2,f.z+(C-f.z)*2),F=y.x+(m.x-y.x)*.5,b=y.y+(m.y-y.y)*.5,C=y.z+(m.z-y.z)*.5,o(20,p.x+(F-p.x)*2,p.y+(b-p.y)*2,p.z+(C-p.z)*2),F=A.x+(v.x-A.x)*.5,b=A.y+(v.y-A.y)*.5,C=A.z+(v.z-A.z)*.5,o(24,g.x+(F-g.x)*2,g.y+(b-g.y)*2,g.z+(C-g.z)*2);let D=function(e,t){let r=new Float32Array(25);for(let a=0;a<25;a++){let n=e[3*a],i=e[3*a+2],o=1.3-Math.sqrt(n*n+i*i)/t;o<.4?o=0:o>.8&&(o=1),r[a]=o}return r}(S,e),I=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,a=r+1,n=r+5,i=n+1;I.push(r,n,i),I.push(r,i,a)}return B.setIndex(I),B.setAttribute("position",new u.Float32BufferAttribute(S,3)),B.setAttribute("uv",new u.Float32BufferAttribute(x,2)),B.setAttribute("alpha",new u.Float32BufferAttribute(D,1)),B.computeBoundingSphere(),B}(t,r,e,0)},[t,r]);(0,o.useEffect)(()=>()=>{h.dispose()},[h]);let m=(0,o.useMemo)(()=>new u.ShaderMaterial({uniforms:{cloudTexture:{value:f},uvOffset:{value:new u.Vector2(0,0)},debugMode:{value:+!!l},layerIndex:{value:s}},vertexShader:tl,fragmentShader:tu,transparent:!0,depthWrite:!1,side:u.DoubleSide}),[f,l,s]);return(0,o.useEffect)(()=>()=>{m.dispose()},[m]),(0,A.useFrame)(c?(e,t)=>{let r=1e3*t/32;d.current??=new u.Vector2(0,0),d.current.x+=i.x*a*r,d.current.y+=i.y*a*r,d.current.x-=Math.floor(d.current.x),d.current.y-=Math.floor(d.current.y),m.uniforms.uvOffset.value.copy(d.current)}:to),(0,n.jsx)("mesh",{geometry:h,frustumCulled:!1,renderOrder:10,children:(0,n.jsx)("primitive",{object:m,attach:"material"})})}function td(e){var t;let r,a,s,l,c,d,f,h,m,p,v,F,C,B,S,x,E,M,D,I=(0,i.c)(37),{object:k}=e;I[0]!==k?(r=(0,b.getProperty)(k,"materialList"),I[0]=k,I[1]=r):r=I[1];let{data:w}=(t=r,(M=(0,i.c)(7))[0]!==t?(S=["detailMapList",t],x=()=>(0,y.loadDetailMapList)(t),M[0]=t,M[1]=S,M[2]=x):(S=M[1],x=M[2]),D=!!t,M[3]!==S||M[4]!==x||M[5]!==D?(E={queryKey:S,queryFn:x,enabled:D},M[3]=S,M[4]=x,M[5]=D,M[6]=E):E=M[6],(0,g.useQuery)(E));I[2]!==k?(a=(0,b.getFloat)(k,"visibleDistance")??500,I[2]=k,I[3]=a):a=I[3];let T=.95*a;I[4]!==k?(s=(0,b.getFloat)(k,"cloudSpeed1")??1e-4,I[4]=k,I[5]=s):s=I[5],I[6]!==k?(l=(0,b.getFloat)(k,"cloudSpeed2")??2e-4,I[6]=k,I[7]=l):l=I[7],I[8]!==k?(c=(0,b.getFloat)(k,"cloudSpeed3")??3e-4,I[8]=k,I[9]=c):c=I[9],I[10]!==s||I[11]!==l||I[12]!==c?(d=[s,l,c],I[10]=s,I[11]=l,I[12]=c,I[13]=d):d=I[13];let R=d;I[14]!==k?(f=(0,b.getFloat)(k,"cloudHeightPer1")??.35,I[14]=k,I[15]=f):f=I[15],I[16]!==k?(h=(0,b.getFloat)(k,"cloudHeightPer2")??.25,I[16]=k,I[17]=h):h=I[17],I[18]!==k?(m=(0,b.getFloat)(k,"cloudHeightPer3")??.2,I[18]=k,I[19]=m):m=I[19],I[20]!==f||I[21]!==h||I[22]!==m?(p=[f,h,m],I[20]=f,I[21]=h,I[22]=m,I[23]=p):p=I[23];let P=p;if(I[24]!==k){e:{let e,t=(0,b.getProperty)(k,"windVelocity");if(t){let[e,r]=t.split(" ").map(tf);if(0!==e||0!==r){v=new u.Vector2(r,-e).normalize();break e}}I[26]===Symbol.for("react.memo_cache_sentinel")?(e=new u.Vector2(1,0),I[26]=e):e=I[26],v=e}I[24]=k,I[25]=v}else v=I[25];let G=v;t:{let e;if(!w){let e;I[27]===Symbol.for("react.memo_cache_sentinel")?(e=[],I[27]=e):e=I[27],F=e;break t}if(I[28]!==P||I[29]!==R||I[30]!==w){e=[];for(let t=0;t<3;t++){let r=w[7+t];r&&e.push({texture:r,height:P[t],speed:R[t]})}I[28]=P,I[29]=R,I[30]=w,I[31]=e}else e=I[31];F=e}let _=F,L=(0,o.useRef)(null);return(I[32]===Symbol.for("react.memo_cache_sentinel")?(C=e=>{let{camera:t}=e;L.current&&L.current.position.copy(t.position)},I[32]=C):C=I[32],(0,A.useFrame)(C),_&&0!==_.length)?(I[33]!==_||I[34]!==T||I[35]!==G?(B=(0,n.jsx)("group",{ref:L,children:_.map((e,t)=>{let r=(0,y.textureToUrl)(e.texture);return(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(tc,{textureUrl:r,radius:T,heightPercent:e.height,speed:e.speed,windDirection:G,layerIndex:t})},t)})}),I[33]=_,I[34]=T,I[35]=G,I[36]=B):B=I[36],B):null}function tf(e){return parseFloat(e)}let th=!1;function tm(e){if(!e)return;let[t,r,a]=e.split(" ").map(e=>parseFloat(e));return[new u.Color().setRGB(t,r,a),new u.Color().setRGB(t,r,a).convertSRGBToLinear()]}function tp({skyBoxFiles:e,fogColor:t,fogState:r}){let{camera:a}=(0,F.useThree)(),i=ti(e,{path:""}),s=!!t,l=(0,o.useMemo)(()=>a.projectionMatrixInverse,[a]),c=(0,o.useMemo)(()=>r?(0,D.packFogVolumeData)(r.fogVolumes):new Float32Array(12),[r]),d=(0,o.useRef)({skybox:{value:i},fogColor:{value:t??new u.Color(0,0,0)},enableFog:{value:s},inverseProjectionMatrix:{value:l},cameraMatrixWorld:{value:a.matrixWorld},cameraHeight:D.globalFogUniforms.cameraHeight,fogVolumeData:{value:c},horizonFogHeight:{value:.18}}),f=(0,o.useMemo)(()=>{if(!r)return .18;let e=.95*r.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[r]);return(0,o.useEffect)(()=>{d.current.skybox.value=i,d.current.fogColor.value=t??new u.Color(0,0,0),d.current.enableFog.value=s,d.current.fogVolumeData.value=c,d.current.horizonFogHeight.value=f},[i,t,s,c,f]),(0,n.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,n.jsxs)("bufferGeometry",{children:[(0,n.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,n.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,n.jsx)("shaderMaterial",{uniforms:d.current,vertexShader:` + varying vec2 vUv; + + void main() { + vUv = uv; + gl_Position = vec4(position.xy, 0.9999, 1.0); + } + `,fragmentShader:` + uniform samplerCube skybox; + uniform vec3 fogColor; + uniform bool enableFog; + uniform mat4 inverseProjectionMatrix; + uniform mat4 cameraMatrixWorld; + uniform float cameraHeight; + uniform float fogVolumeData[12]; + uniform float horizonFogHeight; + + varying vec2 vUv; + + // Convert linear to sRGB for display + // shaderMaterial does NOT get automatic linear->sRGB output conversion + // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js + vec3 linearToSRGB(vec3 linear) { + vec3 low = linear * 12.92; + vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; + return mix(low, high, step(vec3(0.0031308), linear)); + } + + void main() { + vec2 ndc = vUv * 2.0 - 1.0; + vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); + viewPos.xyz /= viewPos.w; + vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); + direction = vec3(direction.z, direction.y, -direction.x); + // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear + vec4 skyColor = textureCube(skybox, direction); + vec3 finalColor; + + if (enableFog) { + vec3 effectiveFogColor = fogColor; + + // Calculate how much fog volume the ray passes through + // For skybox at "infinite" distance, the relevant height is how much + // of the volume is above/below camera depending on view direction + float volumeFogInfluence = 0.0; + + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + // Check if camera is inside this volume + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + // Camera is inside the fog volume + // Looking horizontally or up at shallow angles means ray travels + // through more fog before exiting the volume + float heightAboveCamera = volMaxH - cameraHeight; + float heightBelowCamera = cameraHeight - volMinH; + float volumeHeight = volMaxH - volMinH; + + // For horizontal rays (direction.y ≈ 0), maximum fog influence + // For rays going up steeply, less fog (exits volume quickly) + // For rays going down, more fog (travels through volume below) + float rayInfluence; + if (direction.y >= 0.0) { + // Looking up: influence based on how steep we're looking + // Shallow angles = long path through fog = high influence + rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); + } else { + // Looking down: always high fog (into the volume) + rayInfluence = 1.0; + } + + // Scale by percentage and volume depth factor + volumeFogInfluence += rayInfluence * volPct; + } + } + + // Base fog factor from view direction (for haze at horizon) + // In Torque, the fog "bans" (bands) are rendered as geometry from + // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox. + // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3). + // + // horizonFogHeight is the direction.y value where the fog band ends: + // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2) + // + // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18 + // + // Torque renders the fog bands as geometry with linear vertex alpha + // interpolation. We use a squared curve (t^2) to create a gentler + // falloff at the top of the gradient, matching Tribes 2's appearance. + float baseFogFactor; + if (direction.y <= 0.0) { + // Looking at or below horizon: full fog + baseFogFactor = 1.0; + } else if (direction.y >= horizonFogHeight) { + // Above fog band: no fog + baseFogFactor = 0.0; + } else { + // Within fog band: squared curve for gentler falloff at top + float t = direction.y / horizonFogHeight; + baseFogFactor = (1.0 - t) * (1.0 - t); + } + + // Combine base fog with volume fog influence + // When inside a volume, increase fog intensity + float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); + + finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor); + } else { + finalColor = skyColor.rgb; + } + // Convert linear result to sRGB for display + gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); + } + `,depthWrite:!1,depthTest:!1})]})}function tg(e){let t,r,a,o,s=(0,i.c)(6),{materialList:l,fogColor:u,fogState:c}=e,{data:d}=((o=(0,i.c)(2))[0]!==l?(a={queryKey:["detailMapList",l],queryFn:()=>(0,y.loadDetailMapList)(l)},o[0]=l,o[1]=a):a=o[1],(0,g.useQuery)(a));s[0]!==d?(t=d?[(0,y.textureToUrl)(d[1]),(0,y.textureToUrl)(d[3]),(0,y.textureToUrl)(d[4]),(0,y.textureToUrl)(d[5]),(0,y.textureToUrl)(d[0]),(0,y.textureToUrl)(d[2])]:null,s[0]=d,s[1]=t):t=s[1];let f=t;return f?(s[2]!==u||s[3]!==c||s[4]!==f?(r=(0,n.jsx)(tp,{skyBoxFiles:f,fogColor:u,fogState:c}),s[2]=u,s[3]=c,s[4]=f,s[5]=r):r=s[5],r):null}function tv({skyColor:e,fogColor:t,fogState:r}){let{camera:a}=(0,F.useThree)(),i=!!t,s=(0,o.useMemo)(()=>a.projectionMatrixInverse,[a]),l=(0,o.useMemo)(()=>r?(0,D.packFogVolumeData)(r.fogVolumes):new Float32Array(12),[r]),c=(0,o.useMemo)(()=>{if(!r)return .18;let e=.95*r.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[r]),d=(0,o.useRef)({skyColor:{value:e},fogColor:{value:t??new u.Color(0,0,0)},enableFog:{value:i},inverseProjectionMatrix:{value:s},cameraMatrixWorld:{value:a.matrixWorld},cameraHeight:D.globalFogUniforms.cameraHeight,fogVolumeData:{value:l},horizonFogHeight:{value:c}});return(0,o.useEffect)(()=>{d.current.skyColor.value=e,d.current.fogColor.value=t??new u.Color(0,0,0),d.current.enableFog.value=i,d.current.fogVolumeData.value=l,d.current.horizonFogHeight.value=c},[e,t,i,l,c]),(0,n.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,n.jsxs)("bufferGeometry",{children:[(0,n.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,n.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,n.jsx)("shaderMaterial",{uniforms:d.current,vertexShader:` + varying vec2 vUv; + + void main() { + vUv = uv; + gl_Position = vec4(position.xy, 0.9999, 1.0); + } + `,fragmentShader:` + uniform vec3 skyColor; + uniform vec3 fogColor; + uniform bool enableFog; + uniform mat4 inverseProjectionMatrix; + uniform mat4 cameraMatrixWorld; + uniform float cameraHeight; + uniform float fogVolumeData[12]; + uniform float horizonFogHeight; + + varying vec2 vUv; + + // Convert linear to sRGB for display + vec3 linearToSRGB(vec3 linear) { + vec3 low = linear * 12.92; + vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; + return mix(low, high, step(vec3(0.0031308), linear)); + } + + void main() { + vec2 ndc = vUv * 2.0 - 1.0; + vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); + viewPos.xyz /= viewPos.w; + vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); + direction = vec3(direction.z, direction.y, -direction.x); + + vec3 finalColor; + + if (enableFog) { + // Calculate volume fog influence (same logic as SkyBoxTexture) + float volumeFogInfluence = 0.0; + + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + float rayInfluence; + if (direction.y >= 0.0) { + rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); + } else { + rayInfluence = 1.0; + } + volumeFogInfluence += rayInfluence * volPct; + } + } + + // Base fog factor from view direction + float baseFogFactor; + if (direction.y <= 0.0) { + baseFogFactor = 1.0; + } else if (direction.y >= horizonFogHeight) { + baseFogFactor = 0.0; + } else { + float t = direction.y / horizonFogHeight; + baseFogFactor = (1.0 - t) * (1.0 - t); + } + + // Combine base fog with volume fog influence + float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); + + finalColor = mix(skyColor, fogColor, finalFogFactor); + } else { + finalColor = skyColor; + } + + gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); + } + `,depthWrite:!1,depthTest:!1})]})}function ty(e,t){let{fogDistance:r,visibleDistance:a}=e;return[r,a]}function tA({fogState:e,enabled:t}){let{scene:r,camera:a}=(0,F.useThree)(),n=(0,o.useRef)(null),i=(0,o.useMemo)(()=>(0,D.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,o.useEffect)(()=>{th||((0,M.installCustomFogShader)(),th=!0)},[]),(0,o.useEffect)(()=>{(0,D.resetGlobalFogUniforms)();let[t,o]=ty(e,a.position.y),s=new u.Fog(e.fogColor,t,o);return r.fog=s,n.current=s,(0,D.updateGlobalFogUniforms)(a.position.y,i),()=>{r.fog=null,n.current=null,(0,D.resetGlobalFogUniforms)()}},[r,a,e,i]),(0,o.useEffect)(()=>{let r=n.current;if(r)if(t){let[t,n]=ty(e,a.position.y);r.near=t,r.far=n}else r.near=1e10,r.far=1e10},[t,e,a.position.y]),(0,A.useFrame)(()=>{let r=n.current;if(!r)return;let o=a.position.y;if((0,D.updateGlobalFogUniforms)(o,i,t),t){let[t,a]=ty(e,o);r.near=t,r.far=a,r.color.copy(e.fogColor)}}),null}function tF(e){return parseFloat(e)}function tb(e){return parseFloat(e)}function tC(e){return parseFloat(e)}function tB(e){let t=new Set;return e.bones.forEach((e,r)=>{e.name.match(/^Hulk/i)&&t.add(r)}),t}function tS(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,a=e.attributes.skinWeight,n=e.index,i=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(o)){i[e]=!0;break}}if(n){let t=[],r=n.array;for(let e=0;e{for(r.current+=n;r.current>=.03125;)if(r.current-=.03125,a.current++,t.current)for(let e of t.current)e(a.current)});let i=(0,o.useCallback)(e=>(t.current??=new Set,t.current.add(e),()=>{t.current.delete(e)}),[]),s=(0,o.useCallback)(()=>a.current,[]),l=(0,o.useMemo)(()=>({subscribe:i,getTick:s}),[i,s]);return(0,n.jsx)(tR.Provider,{value:l,children:e})}let tG=new Map;function t_(e){e.onBeforeCompile=t=>{(0,M.injectCustomFog)(t,D.globalFogUniforms),e instanceof u.MeshLambertMaterial&&(t.uniforms.shapeDirectionalFactor={value:1},t.uniforms.shapeAmbientFactor={value:1.5},t.fragmentShader=t.fragmentShader.replace("#include ",`#include +uniform float shapeDirectionalFactor; +uniform float shapeAmbientFactor; +`),t.fragmentShader=t.fragmentShader.replace("#include ",`#include + // Apply shape-specific lighting multipliers + reflectedLight.directDiffuse *= shapeDirectionalFactor; + reflectedLight.indirectDiffuse *= shapeAmbientFactor; +`))}}function tL(e,t,r,a,n=1,i=!1){let o=r.has("Translucent"),s=r.has("Additive"),l=r.has("SelfIlluminating"),c=n<1||i;if(l){let e=s||o||c,r=new u.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...c&&{opacity:n},...s&&{blending:u.AdditiveBlending}});return t_(r),r}if(a||o){let e={map:t,transparent:c,alphaTest:.5*!c,...c&&{opacity:n,depthWrite:!1},reflectivity:0},r=new u.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),a=new u.MeshLambertMaterial({...e,side:0});return t_(r),t_(a),[r,a]}let d=new u.MeshLambertMaterial({map:t,side:2,reflectivity:0,...c&&{transparent:!0,opacity:n,depthWrite:!1}});return t_(d),d}function tj(e){let t,r=(0,i.c)(2);return r[0]!==e?(t=(0,y.shapeToUrl)(e),r[0]=e,r[1]=t):t=r[1],e2(t)}let tO=(0,o.memo)(function(e){let t,r,a,s,l,c,d=(0,i.c)(37),{material:f,shapeName:h,geometry:m,backGeometry:p,castShadow:g,receiveShadow:v,vis:A,animated:F}=e,b=void 0!==g&&g,C=void 0!==v&&v,S=void 0===A?1:A,x=void 0!==F&&F,M=f.userData.resource_path;d[0]!==f.userData.flag_names?(t=f.userData.flag_names??[],d[0]=f.userData.flag_names,d[1]=t):t=d[1],d[2]!==t?(r=new Set(t),d[2]=t,d[3]=r):r=d[3];let D=r,I=function(e){let t,r,a,n,s=(0,i.c)(14),{animationEnabled:l}=(0,E.useSettings)();s[0]!==e?(t={queryKey:["ifl",e],queryFn:()=>(0,y.loadImageFrameList)(e)},s[0]=e,s[1]=t):t=s[1];let{data:c}=(m=t,(0,tw.useBaseQuery)({...m,enabled:!0,suspense:!0,throwOnError:tT.defaultThrowOnError,placeholderData:void 0},tk.QueryObserver,void 0));if(s[2]!==c||s[3]!==e){let t;s[5]!==e?(t=t=>(0,y.iflTextureToUrl)(t.name,e),s[5]=e,s[6]=t):t=s[6],r=c.map(t),s[2]=c,s[3]=e,s[4]=r}else r=s[4];let d=r,f=(0,B.useTexture)(d);if(s[7]!==c||s[8]!==e||s[9]!==f){let t;if(!(a=tG.get(e))){let t,r,n,i,o,s,l,c,d;r=(t=f[0].image).width,n=t.height,o=Math.ceil(Math.sqrt(i=f.length)),s=Math.ceil(i/o),(l=document.createElement("canvas")).width=r*o,l.height=n*s,c=l.getContext("2d"),f.forEach((e,t)=>{let a=Math.floor(t/o);c.drawImage(e.image,t%o*r,a*n)}),(d=new u.CanvasTexture(l)).colorSpace=u.SRGBColorSpace,d.generateMipmaps=!1,d.minFilter=u.NearestFilter,d.magFilter=u.NearestFilter,d.wrapS=u.ClampToEdgeWrapping,d.wrapT=u.ClampToEdgeWrapping,d.repeat.set(1/o,1/s),a={texture:d,columns:o,rows:s,frameCount:i,frameStartTicks:[],totalTicks:0,lastFrame:-1},tG.set(e,a)}t=0,(p=a).frameStartTicks=c.map(e=>{let r=t;return t+=e.frameCount,r}),p.totalTicks=t,s[7]=c,s[8]=e,s[9]=f,s[10]=a}else a=s[10];let h=a;s[11]!==l||s[12]!==h?(n=e=>{let t=l?function(e,t){if(0===e.totalTicks)return 0;let r=t%e.totalTicks,{frameStartTicks:a}=e;for(let e=a.length-1;e>=0;e--)if(r>=a[e])return e;return 0}(h,e):0;!function(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,a=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,a/e.rows)}(h,t)},s[11]=l,s[12]=h,s[13]=n):n=s[13];var m,p,g=n;let v=(0,o.useContext)(tR);if(!v)throw Error("useTick must be used within a TickProvider");let A=(0,o.useRef)(g);return A.current=g,(0,o.useEffect)(()=>v.subscribe(e=>A.current(e)),[v]),h.texture}(`textures/${M}.ifl`);d[4]!==h?(a=h&&tE(h),d[4]=h,d[5]=a):a=d[5];let k=a;d[6]!==x||d[7]!==D||d[8]!==k||d[9]!==f||d[10]!==I||d[11]!==S?(s=tL(f,I,D,k,S,x),d[6]=x,d[7]=D,d[8]=k,d[9]=f,d[10]=I,d[11]=S,d[12]=s):s=d[12];let w=s;if(Array.isArray(w)){let e,t,r,a,i,o=p||m;return d[13]!==w[0]?(e=(0,n.jsx)("primitive",{object:w[0],attach:"material"}),d[13]=w[0],d[14]=e):e=d[14],d[15]!==b||d[16]!==C||d[17]!==e||d[18]!==o?(t=(0,n.jsx)("mesh",{geometry:o,castShadow:b,receiveShadow:C,children:e}),d[15]=b,d[16]=C,d[17]=e,d[18]=o,d[19]=t):t=d[19],d[20]!==w[1]?(r=(0,n.jsx)("primitive",{object:w[1],attach:"material"}),d[20]=w[1],d[21]=r):r=d[21],d[22]!==b||d[23]!==m||d[24]!==C||d[25]!==r?(a=(0,n.jsx)("mesh",{geometry:m,castShadow:b,receiveShadow:C,children:r}),d[22]=b,d[23]=m,d[24]=C,d[25]=r,d[26]=a):a=d[26],d[27]!==t||d[28]!==a?(i=(0,n.jsxs)(n.Fragment,{children:[t,a]}),d[27]=t,d[28]=a,d[29]=i):i=d[29],i}return d[30]!==w?(l=(0,n.jsx)("primitive",{object:w,attach:"material"}),d[30]=w,d[31]=l):l=d[31],d[32]!==b||d[33]!==m||d[34]!==C||d[35]!==l?(c=(0,n.jsx)("mesh",{geometry:m,castShadow:b,receiveShadow:C,children:l}),d[32]=b,d[33]=m,d[34]=C,d[35]=l,d[36]=c):c=d[36],c}),tN=(0,o.memo)(function(e){let t,r,a,o,s,l,u,c,d=(0,i.c)(42),{material:f,shapeName:h,geometry:m,backGeometry:p,castShadow:g,receiveShadow:v,vis:A,animated:F}=e,b=void 0!==g&&g,S=void 0!==v&&v,x=void 0===A?1:A,E=void 0!==F&&F,M=f.userData.resource_path;d[0]!==f.userData.flag_names?(t=f.userData.flag_names??[],d[0]=f.userData.flag_names,d[1]=t):t=d[1],d[2]!==t?(r=new Set(t),d[2]=t,d[3]=r):r=d[3];let D=r;M||console.warn(`No resource_path was found on "${h}" - rendering fallback.`),d[4]!==M?(a=M?(0,y.textureToUrl)(M):y.FALLBACK_TEXTURE_URL,d[4]=M,d[5]=a):a=d[5];let I=a;d[6]!==h?(o=h&&tE(h),d[6]=h,d[7]=o):o=d[7];let k=o,w=D.has("Translucent");d[8]!==k||d[9]!==w?(s=e=>k||w?(0,C.setupTexture)(e,{disableMipmaps:!0}):(0,C.setupTexture)(e),d[8]=k,d[9]=w,d[10]=s):s=d[10];let T=(0,B.useTexture)(I,s);d[11]!==E||d[12]!==D||d[13]!==k||d[14]!==f||d[15]!==T||d[16]!==x?(l=tL(f,T,D,k,x,E),d[11]=E,d[12]=D,d[13]=k,d[14]=f,d[15]=T,d[16]=x,d[17]=l):l=d[17];let R=l;if(Array.isArray(R)){let e,t,r,a,i,o=p||m;return d[18]!==R[0]?(e=(0,n.jsx)("primitive",{object:R[0],attach:"material"}),d[18]=R[0],d[19]=e):e=d[19],d[20]!==b||d[21]!==S||d[22]!==o||d[23]!==e?(t=(0,n.jsx)("mesh",{geometry:o,castShadow:b,receiveShadow:S,children:e}),d[20]=b,d[21]=S,d[22]=o,d[23]=e,d[24]=t):t=d[24],d[25]!==R[1]?(r=(0,n.jsx)("primitive",{object:R[1],attach:"material"}),d[25]=R[1],d[26]=r):r=d[26],d[27]!==b||d[28]!==m||d[29]!==S||d[30]!==r?(a=(0,n.jsx)("mesh",{geometry:m,castShadow:b,receiveShadow:S,children:r}),d[27]=b,d[28]=m,d[29]=S,d[30]=r,d[31]=a):a=d[31],d[32]!==t||d[33]!==a?(i=(0,n.jsxs)(n.Fragment,{children:[t,a]}),d[32]=t,d[33]=a,d[34]=i):i=d[34],i}return d[35]!==R?(u=(0,n.jsx)("primitive",{object:R,attach:"material"}),d[35]=R,d[36]=u):u=d[36],d[37]!==b||d[38]!==m||d[39]!==S||d[40]!==u?(c=(0,n.jsx)("mesh",{geometry:m,castShadow:b,receiveShadow:S,children:u}),d[37]=b,d[38]=m,d[39]=S,d[40]=u,d[41]=c):c=d[41],c}),tU=(0,o.memo)(function(e){let t=(0,i.c)(18),{material:r,shapeName:a,geometry:o,backGeometry:s,castShadow:l,receiveShadow:u,vis:c,animated:d}=e,f=void 0!==l&&l,h=void 0!==u&&u,m=void 0===c?1:c,p=void 0!==d&&d,g=new Set(r.userData.flag_names??[]).has("IflMaterial"),v=r.userData.resource_path;if(g&&v){let e;return t[0]!==p||t[1]!==s||t[2]!==f||t[3]!==o||t[4]!==r||t[5]!==h||t[6]!==a||t[7]!==m?(e=(0,n.jsx)(tO,{material:r,shapeName:a,geometry:o,backGeometry:s,castShadow:f,receiveShadow:h,vis:m,animated:p}),t[0]=p,t[1]=s,t[2]=f,t[3]=o,t[4]=r,t[5]=h,t[6]=a,t[7]=m,t[8]=e):e=t[8],e}if(!r.name)return null;{let e;return t[9]!==p||t[10]!==s||t[11]!==f||t[12]!==o||t[13]!==r||t[14]!==h||t[15]!==a||t[16]!==m?(e=(0,n.jsx)(tN,{material:r,shapeName:a,geometry:o,backGeometry:s,castShadow:f,receiveShadow:h,vis:m,animated:p}),t[9]=p,t[10]=s,t[11]=f,t[12]=o,t[13]=r,t[14]=h,t[15]=a,t[16]=m,t[17]=e):e=t[17],e}});function tH(e){let t,r,a,o,s=(0,i.c)(9),{color:l,label:u}=e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("boxGeometry",{args:[10,10,10]}),s[0]=t):t=s[0],s[1]!==l?(r=(0,n.jsx)("meshStandardMaterial",{color:l,wireframe:!0}),s[1]=l,s[2]=r):r=s[2],s[3]!==l||s[4]!==u?(a=u?(0,n.jsx)(e3.FloatingLabel,{color:l,children:u}):null,s[3]=l,s[4]=u,s[5]=a):a=s[5],s[6]!==r||s[7]!==a?(o=(0,n.jsxs)("mesh",{children:[t,r,a]}),s[6]=r,s[7]=a,s[8]=o):o=s[8],o}function tJ(e){let t,r=(0,i.c)(4),{color:a,label:o}=e,{debugMode:s}=(0,E.useDebug)();return r[0]!==a||r[1]!==s||r[2]!==o?(t=s?(0,n.jsx)(tH,{color:a,label:o}):null,r[0]=a,r[1]=s,r[2]=o,r[3]=t):t=r[3],t}let tV=new Set(["octahedron.dts"]);function tK(e){let t,r,a,o,s=(0,i.c)(6),{label:l}=e,{debugMode:u}=(0,E.useDebug)();return u?(s[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("icosahedronGeometry",{args:[1,1]}),r=(0,n.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),s[0]=t,s[1]=r):(t=s[0],r=s[1]),s[2]!==l?(a=l?(0,n.jsx)(e3.FloatingLabel,{color:"cyan",children:l}):null,s[2]=l,s[3]=a):a=s[3],s[4]!==a?(o=(0,n.jsxs)("mesh",{children:[t,r,a]}),s[4]=a,s[5]=o):o=s[5],o):null}function tz(e){let t,r,a,s,l,u=(0,i.c)(15),{loadingColor:c,children:d}=e,f=void 0===c?"yellow":c,{object:h,shapeName:m}=tD();if(!m){let e,t=`${h._id}: `;return u[0]!==t?(e=(0,n.jsx)(tJ,{color:"orange",label:t}),u[0]=t,u[1]=e):e=u[1],e}if(tV.has(m.toLowerCase())){let e,t=`${h._id}: ${m}`;return u[2]!==t?(e=(0,n.jsx)(tK,{label:t}),u[2]=t,u[3]=e):e=u[3],e}let p=`${h._id}: ${m}`;return u[4]!==p?(t=(0,n.jsx)(tJ,{color:"red",label:p}),u[4]=p,u[5]=t):t=u[5],u[6]!==f?(r=(0,n.jsx)(tH,{color:f}),u[6]=f,u[7]=r):r=u[7],u[8]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)(tW,{}),u[8]=a):a=u[8],u[9]!==d||u[10]!==r?(s=(0,n.jsxs)(o.Suspense,{fallback:r,children:[a,d]}),u[9]=d,u[10]=r,u[11]=s):s=u[11],u[12]!==t||u[13]!==s?(l=(0,n.jsx)(Q,{fallback:t,children:s}),u[12]=t,u[13]=s,u[14]=l):l=u[14],l}function tq(e){return null!=e&&"ambient"===(e.vis_sequence??"").toLowerCase()&&Array.isArray(e.vis_keyframes)&&e.vis_keyframes.length>1&&(e.vis_duration??0)>0}function tQ(e){let t,r,a=(0,i.c)(7),{keyframes:s,duration:l,cyclic:u,children:c}=e,d=(0,o.useRef)(null),{animationEnabled:f}=(0,E.useSettings)();return a[0]!==f||a[1]!==u||a[2]!==l||a[3]!==s?(t=()=>{let e=d.current;if(!e)return;if(!f)return void e.traverse(e=>{if(e.isMesh){let t=e.material;t&&!Array.isArray(t)&&(t.opacity=s[0])}});let t=performance.now()/1e3,r=u?t%l/l:Math.min(t/l,1),a=s.length,n=r*a,i=Math.floor(n)%a,o=n-Math.floor(n),c=s[i]+(s[(i+1)%a]-s[i])*o;e.traverse(e=>{if(e.isMesh){let t=e.material;t&&!Array.isArray(t)&&(t.opacity=c)}})},a[0]=f,a[1]=u,a[2]=l,a[3]=s,a[4]=t):t=a[4],(0,A.useFrame)(t),a[5]!==c?(r=(0,n.jsx)("group",{ref:d,children:c}),a[5]=c,a[6]=r):r=a[6],r}let tW=(0,o.memo)(function(){let e,t,r,a,s,l,u=(0,i.c)(19),{object:c,shapeName:d,isOrganic:f}=tD(),{debugMode:h}=(0,E.useDebug)(),{nodes:m}=tj(d);if(u[0]!==m){e:{let t,r=Object.values(m).filter(tX);if(r.length>0){e=tB(r[0].skeleton);break e}u[2]===Symbol.for("react.memo_cache_sentinel")?(t=new Set,u[2]=t):t=u[2],e=t}u[0]=m,u[1]=e}else e=u[1];let p=e;u[3]!==p||u[4]!==f||u[5]!==m?(t=Object.entries(m).filter(tY).map(e=>{let[,t]=e,r=tS(t.geometry,p),a=null;if(r){(r=r.clone()).computeVertexNormals();let e=r.attributes.position,t=r.attributes.normal,n=e.array,i=t.array,o=new Map;for(let t=0;t1){let t=0,r=0,a=0;for(let n of e)t+=i[3*n],r+=i[3*n+1],a+=i[3*n+2];let n=Math.sqrt(t*t+r*r+a*a);for(let o of(n>0&&(t/=n,r/=n,a/=n),e))i[3*o]=t,i[3*o+1]=r,i[3*o+2]=a}if(t.needsUpdate=!0,f){let e=(a=r.clone()).attributes.normal,t=e.array;for(let e=0;e{let{node:t,geometry:r,backGeometry:a,vis:i,visAnim:s}=e,l=!!s,u=(0,n.jsx)("mesh",{geometry:r,children:(0,n.jsx)("meshStandardMaterial",{color:"gray",wireframe:!0})}),c=t.material?Array.isArray(t.material)?t.material.map((e,t)=>(0,n.jsx)(tU,{material:e,shapeName:d,geometry:r,backGeometry:a,castShadow:v,receiveShadow:v,vis:i,animated:l},t)):(0,n.jsx)(tU,{material:t.material,shapeName:d,geometry:r,backGeometry:a,castShadow:v,receiveShadow:v,vis:i,animated:l}):null;return s?(0,n.jsx)(tQ,{keyframes:s.keyframes,duration:s.duration,cyclic:s.cyclic,children:(0,n.jsx)(o.Suspense,{fallback:u,children:c})},t.id):(0,n.jsx)(o.Suspense,{fallback:u,children:c},t.id)}),u[8]=v,u[9]=g,u[10]=d,u[11]=a):a=u[11],u[12]!==h||u[13]!==c||u[14]!==d?(s=h?(0,n.jsxs)(e3.FloatingLabel,{children:[c._id,": ",d]}):null,u[12]=h,u[13]=c,u[14]=d,u[15]=s):s=u[15],u[16]!==a||u[17]!==s?(l=(0,n.jsxs)("group",{rotation:r,children:[a,s]}),u[16]=a,u[17]=s,u[18]=l):l=u[18],l});function tX(e){return e.skeleton}function tY(e){let[,t]=e;return t.material&&"Unassigned"!==t.material.name&&!t.name.match(/^Hulk/i)&&((t.userData?.vis??1)>.01||tq(t.userData))}var tZ=e.i(6112);let t$={1:"Storm",2:"Inferno"},t0=(0,o.createContext)(null);function t1(){let e=(0,o.useContext)(t0);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function t2({children:e}){let{camera:t}=(0,F.useThree)(),[r,a]=(0,o.useState)(-1),[i,s]=(0,o.useState)({}),[l,c]=(0,o.useState)(()=>({initialized:!1,position:null,quarternion:null})),d=(0,o.useCallback)(e=>{s(t=>({...t,[e.id]:e}))},[]),f=(0,o.useCallback)(e=>{s(t=>{let{[e.id]:r,...a}=t;return a})},[]),h=Object.keys(i).length,m=(0,o.useCallback)(e=>{if(e>=0&&e{m(h?(r+1)%h:-1)},[h,r,m]);(0,o.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,r]=e.slice(2).split("~"),a=t.split(",").map(e=>parseFloat(e)),n=r.split(",").map(e=>parseFloat(e));c({initialized:!0,position:new u.Vector3(...a),quarternion:new u.Quaternion(...n)})}else c({initialized:!0,position:null,quarternion:null})};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}},[]),(0,o.useEffect)(()=>{l.initialized&&l.position&&(t.position.copy(l.position),l.quarternion&&t.quaternion.copy(l.quarternion))},[t,l]),(0,o.useEffect)(()=>{l.initialized&&!l.position&&h>0&&-1===r&&m(0)},[h,m,r,l]);let g=(0,o.useMemo)(()=>({registerCamera:d,unregisterCamera:f,nextCamera:p,setCameraIndex:m,cameraCount:h}),[d,f,p,m,h]);return 0===h&&-1!==r&&a(-1),(0,n.jsx)(t0.Provider,{value:g,children:e})}let t3=(0,o.createContext)(null),t9=t3.Provider,t5=(0,o.lazy)(()=>e.A(61921).then(e=>({default:e.AudioEmitter}))),t8={AudioEmitter:function(e){let t,r=(0,i.c)(3),{audioEnabled:a}=(0,E.useSettings)();return r[0]!==a||r[1]!==e?(t=a?(0,n.jsx)(t5,{...e}):null,r[0]=a,r[1]=e,r[2]=t):t=r[2],t},Camera:function(e){let t,r,a,n,s,l=(0,i.c)(14),{object:c}=e,{registerCamera:d,unregisterCamera:f}=t1(),h=(0,o.useId)();l[0]!==c?(t=(0,b.getProperty)(c,"dataBlock"),l[0]=c,l[1]=t):t=l[1];let m=t;l[2]!==c?(r=(0,b.getPosition)(c),l[2]=c,l[3]=r):r=l[3];let p=r;l[4]!==c?(a=(0,b.getRotation)(c),l[4]=c,l[5]=a):a=l[5];let g=a;return l[6]!==m||l[7]!==h||l[8]!==p||l[9]!==g||l[10]!==d||l[11]!==f?(n=()=>{if("Observer"===m){let e={id:h,position:new u.Vector3(...p),rotation:g};return d(e),()=>{f(e)}}},s=[h,m,d,f,p,g],l[6]=m,l[7]=h,l[8]=p,l[9]=g,l[10]=d,l[11]=f,l[12]=n,l[13]=s):(n=l[12],s=l[13]),(0,o.useEffect)(n,s),null},ForceFieldBare:(0,o.lazy)(()=>e.A(25147).then(e=>({default:e.ForceFieldBare}))),InteriorInstance:tr,Item:function(e){let t,r,a,s,l,u,c,d,f,h,m,p,g=(0,i.c)(32),{object:v}=e,y=J();g[0]!==v?(t=(0,b.getProperty)(v,"dataBlock")??"",g[0]=v,g[1]=t):t=g[1];let F=t,C=(0,tZ.useDatablock)(F);g[2]!==C||g[3]!==v?(r=function(e){if("string"==typeof e){let t=e.toLowerCase();return"0"!==t&&"false"!==t&&""!==t}return!!e}((0,b.getProperty)(v,"rotate")??(0,b.getProperty)(C,"rotate")),g[2]=C,g[3]=v,g[4]=r):r=g[4];let B=r;g[5]!==v?(a=(0,b.getPosition)(v),g[5]=v,g[6]=a):a=g[6];let S=a;g[7]!==v?(s=(0,b.getScale)(v),g[7]=v,g[8]=s):s=g[8];let x=s;g[9]!==v?(l=(0,b.getRotation)(v),g[9]=v,g[10]=l):l=g[10];let M=l,{animationEnabled:D}=(0,E.useSettings)(),I=(0,o.useRef)(null);g[11]!==D||g[12]!==B?(u=()=>{if(!I.current||!B||!D)return;let e=performance.now()/1e3;I.current.rotation.y=e/3*Math.PI*2},g[11]=D,g[12]=B,g[13]=u):u=g[13],(0,A.useFrame)(u),g[14]!==C?(c=(0,b.getProperty)(C,"shapeFile"),g[14]=C,g[15]=c):c=g[15];let k=c;k||console.error(` missing shape for datablock: ${F}`);let w=F?.toLowerCase()==="flag",T=y?.team??null,R=T&&T>0?t$[T]:null,P=w&&R?`${R} Flag`:null;return g[16]!==M||g[17]!==B?(d=!B&&{quaternion:M},g[16]=M,g[17]=B,g[18]=d):d=g[18],g[19]!==P?(f=P?(0,n.jsx)(e3.FloatingLabel,{opacity:.6,children:P}):null,g[19]=P,g[20]=f):f=g[20],g[21]!==f?(h=(0,n.jsx)(tz,{loadingColor:"pink",children:f}),g[21]=f,g[22]=h):h=g[22],g[23]!==S||g[24]!==x||g[25]!==h||g[26]!==d?(m=(0,n.jsx)("group",{ref:I,position:S,...d,scale:x,children:h}),g[23]=S,g[24]=x,g[25]=h,g[26]=d,g[27]=m):m=g[27],g[28]!==v||g[29]!==k||g[30]!==m?(p=(0,n.jsx)(tI,{type:"Item",object:v,shapeName:k,children:m}),g[28]=v,g[29]=k,g[30]=m,g[31]=p):p=g[31],p},SimGroup:function(e){let t,r,a,o,s=(0,i.c)(17),{object:l}=e,u=(0,R.useRuntimeObjectById)(l._id)??l,c=J();s[0]!==u._children?(t=u._children??[],s[0]=u._children,s[1]=t):t=s[1];let d=(0,R.useRuntimeChildIds)(u._id,t),f=null,h=!1;if(c&&c.hasTeams){if(h=!0,null!=c.team)f=c.team;else if(u._name){let e;if(s[2]!==u._name){let t;s[4]===Symbol.for("react.memo_cache_sentinel")?(t=/^team(\d+)$/i,s[4]=t):t=s[4],e=u._name.match(t),s[2]=u._name,s[3]=e}else e=s[3];let t=e;t&&(f=parseInt(t[1],10))}}else if(u._name){let e;s[5]!==u._name?(e=u._name.toLowerCase(),s[5]=u._name,s[6]=e):e=s[6],h="teams"===e}s[7]!==h||s[8]!==u||s[9]!==c||s[10]!==f?(r={object:u,parent:c,hasTeams:h,team:f},s[7]=h,s[8]=u,s[9]=c,s[10]=f,s[11]=r):r=s[11];let m=r;return s[12]!==d?(a=d.map(V),s[12]=d,s[13]=a):a=s[13],s[14]!==m||s[15]!==a?(o=(0,n.jsx)(H.Provider,{value:m,children:a}),s[14]=m,s[15]=a,s[16]=o):o=s[16],o},Sky:function({object:e}){let{fogEnabled:t,highQualityFog:r}=(0,E.useSettings)(),a=(0,b.getProperty)(e,"materialList"),i=(0,o.useMemo)(()=>tm((0,b.getProperty)(e,"SkySolidColor")),[e]),s=(0,b.getInt)(e,"useSkyTextures")??1,l=(0,o.useMemo)(()=>(function(e,t=!0){let r=(0,b.getFloat)(e,"fogDistance")??0,a=(0,b.getFloat)(e,"visibleDistance")??1e3,n=(0,b.getFloat)(e,"high_fogDistance"),i=(0,b.getFloat)(e,"high_visibleDistance"),o=t&&null!=n&&n>0?n:r,s=t&&null!=i&&i>0?i:a,l=function(e){if(!e)return new u.Color(.5,.5,.5);let[t,r,a]=e.split(" ").map(e=>parseFloat(e));return new u.Color().setRGB(t,r,a).convertSRGBToLinear()}((0,b.getProperty)(e,"fogColor")),c=[];for(let t=1;t<=3;t++){let r=function(e,t=1){if(!e)return null;let r=e.split(" ").map(e=>parseFloat(e));if(r.length<3)return null;let[a,n,i]=r;return a<=0||i<=n?null:{visibleDistance:a,minHeight:n,maxHeight:i,percentage:Math.max(0,Math.min(1,t))}}((0,b.getProperty)(e,`fogVolume${t}`),1);r&&c.push(r)}let d=c.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:o,visibleDistance:s,fogColor:l,fogVolumes:c,fogLine:d,enabled:s>o}})(e,r),[e,r]),c=(0,o.useMemo)(()=>tm((0,b.getProperty)(e,"fogColor")),[e]),d=i||c,f=l.enabled&&t,h=l.fogColor,{scene:m,gl:p}=(0,F.useThree)();(0,o.useEffect)(()=>{if(f){let e=h.clone();m.background=e,p.setClearColor(e)}else if(d){let e=d[0].clone();m.background=e,p.setClearColor(e)}else m.background=null;return()=>{m.background=null}},[m,p,f,h,d]);let g=i?.[1];return(0,n.jsxs)(n.Fragment,{children:[a&&s?(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(tg,{materialList:a,fogColor:f?h:void 0,fogState:f?l:void 0},a)}):g?(0,n.jsx)(tv,{skyColor:g,fogColor:f?h:void 0,fogState:f?l:void 0}):null,(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(td,{object:e})}),l.enabled?(0,n.jsx)(tA,{fogState:l,enabled:t}):null]})},StaticShape:function(e){let t,r,a,o,s,l,u,c,d=(0,i.c)(19),{object:f}=e;d[0]!==f?(t=(0,b.getProperty)(f,"dataBlock")??"",d[0]=f,d[1]=t):t=d[1];let h=t,m=(0,tZ.useDatablock)(h);d[2]!==f?(r=(0,b.getPosition)(f),d[2]=f,d[3]=r):r=d[3];let p=r;d[4]!==f?(a=(0,b.getRotation)(f),d[4]=f,d[5]=a):a=d[5];let g=a;d[6]!==f?(o=(0,b.getScale)(f),d[6]=f,d[7]=o):o=d[7];let v=o;d[8]!==m?(s=(0,b.getProperty)(m,"shapeFile"),d[8]=m,d[9]=s):s=d[9];let y=s;return y||console.error(` missing shape for datablock: ${h}`),d[10]===Symbol.for("react.memo_cache_sentinel")?(l=(0,n.jsx)(tz,{}),d[10]=l):l=d[10],d[11]!==p||d[12]!==g||d[13]!==v?(u=(0,n.jsx)("group",{position:p,quaternion:g,scale:v,children:l}),d[11]=p,d[12]=g,d[13]=v,d[14]=u):u=d[14],d[15]!==f||d[16]!==y||d[17]!==u?(c=(0,n.jsx)(tI,{type:"StaticShape",object:f,shapeName:y,children:u}),d[15]=f,d[16]=y,d[17]=u,d[18]=c):c=d[18],c},Sun:function(e){let t,r,a,s,l,c,d,f,h,m,p=(0,i.c)(25),{object:g}=e;p[0]!==g?(t=((0,b.getProperty)(g,"direction")??"0.57735 0.57735 -0.57735").split(" ").map(tC),p[0]=g,p[1]=t):t=p[1];let[v,y,A]=t,F=Math.sqrt(v*v+A*A+y*y),C=v/F,B=A/F,x=y/F;p[2]!==C||p[3]!==B||p[4]!==x?(r=new u.Vector3(C,B,x),p[2]=C,p[3]=B,p[4]=x,p[5]=r):r=p[5];let E=r,M=-(5e3*E.x),D=-(5e3*E.y),I=-(5e3*E.z);p[6]!==M||p[7]!==D||p[8]!==I?(a=new u.Vector3(M,D,I),p[6]=M,p[7]=D,p[8]=I,p[9]=a):a=p[9];let k=a;if(p[10]!==g){let[e,t,r]=((0,b.getProperty)(g,"color")??"0.7 0.7 0.7 1").split(" ").map(tb);s=new u.Color(e,t,r),p[10]=g,p[11]=s}else s=p[11];let w=s;if(p[12]!==g){let[e,t,r]=((0,b.getProperty)(g,"ambient")??"0.5 0.5 0.5 1").split(" ").map(tF);l=new u.Color(e,t,r),p[12]=g,p[13]=l}else l=p[13];let T=l,R=E.y<0;return p[14]!==R?(c=()=>{S.value=R},d=[R],p[14]=R,p[15]=c,p[16]=d):(c=p[15],d=p[16]),(0,o.useEffect)(c,d),p[17]!==w||p[18]!==k?(f=(0,n.jsx)("directionalLight",{position:k,color:w,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}),p[17]=w,p[18]=k,p[19]=f):f=p[19],p[20]!==T?(h=(0,n.jsx)("ambientLight",{color:T,intensity:1}),p[20]=T,p[21]=h):h=p[21],p[22]!==f||p[23]!==h?(m=(0,n.jsxs)(n.Fragment,{children:[f,h]}),p[22]=f,p[23]=h,p[24]=m):m=p[24],m},TerrainBlock:_,TSStatic:function(e){let t,r,a,o,s,l,u,c=(0,i.c)(17),{object:d}=e;c[0]!==d?(t=(0,b.getProperty)(d,"shapeName"),c[0]=d,c[1]=t):t=c[1];let f=t;c[2]!==d?(r=(0,b.getPosition)(d),c[2]=d,c[3]=r):r=c[3];let h=r;c[4]!==d?(a=(0,b.getRotation)(d),c[4]=d,c[5]=a):a=c[5];let m=a;c[6]!==d?(o=(0,b.getScale)(d),c[6]=d,c[7]=o):o=c[7];let p=o;return f||console.error(" missing shapeName for object",d),c[8]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(tz,{}),c[8]=s):s=c[8],c[9]!==h||c[10]!==m||c[11]!==p?(l=(0,n.jsx)("group",{position:h,quaternion:m,scale:p,children:s}),c[9]=h,c[10]=m,c[11]=p,c[12]=l):l=c[12],c[13]!==d||c[14]!==f||c[15]!==l?(u=(0,n.jsx)(tI,{type:"TSStatic",object:d,shapeName:f,children:l}),c[13]=d,c[14]=f,c[15]=l,c[16]=u):u=c[16],u},Turret:function(e){let t,r,a,o,s,l,u,c,d,f,h,m=(0,i.c)(27),{object:p}=e;m[0]!==p?(t=(0,b.getProperty)(p,"dataBlock")??"",m[0]=p,m[1]=t):t=m[1];let g=t;m[2]!==p?(r=(0,b.getProperty)(p,"initialBarrel"),m[2]=p,m[3]=r):r=m[3];let v=r,y=(0,tZ.useDatablock)(g),A=(0,tZ.useDatablock)(v);m[4]!==p?(a=(0,b.getPosition)(p),m[4]=p,m[5]=a):a=m[5];let F=a;m[6]!==p?(o=(0,b.getRotation)(p),m[6]=p,m[7]=o):o=m[7];let C=o;m[8]!==p?(s=(0,b.getScale)(p),m[8]=p,m[9]=s):s=m[9];let B=s;m[10]!==y?(l=(0,b.getProperty)(y,"shapeFile"),m[10]=y,m[11]=l):l=m[11];let S=l;m[12]!==A?(u=(0,b.getProperty)(A,"shapeFile"),m[12]=A,m[13]=u):u=m[13];let x=u;return S||console.error(` missing shape for datablock: ${g}`),v&&!x&&console.error(` missing shape for barrel datablock: ${v}`),m[14]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(tz,{}),m[14]=c):c=m[14],m[15]!==x||m[16]!==p?(d=x?(0,n.jsx)(tI,{type:"Turret",object:p,shapeName:x,children:(0,n.jsx)("group",{position:[0,1.5,0],children:(0,n.jsx)(tz,{})})}):null,m[15]=x,m[16]=p,m[17]=d):d=m[17],m[18]!==F||m[19]!==C||m[20]!==B||m[21]!==d?(f=(0,n.jsxs)("group",{position:F,quaternion:C,scale:B,children:[c,d]}),m[18]=F,m[19]=C,m[20]=B,m[21]=d,m[22]=f):f=m[22],m[23]!==p||m[24]!==S||m[25]!==f?(h=(0,n.jsx)(tI,{type:"Turret",object:p,shapeName:S,children:f}),m[23]=p,m[24]=S,m[25]=f,m[26]=h):h=m[26],h},WaterBlock:(0,o.lazy)(()=>e.A(18599).then(e=>({default:e.WaterBlock}))),WayPoint:function(e){let t,r,a,o=(0,i.c)(7),{object:s}=e;o[0]!==s?(t=(0,b.getPosition)(s),o[0]=s,o[1]=t):t=o[1];let l=t;o[2]!==s?(r=(0,b.getProperty)(s,"name"),o[2]=s,o[3]=r):r=o[3];let u=r;return o[4]!==u||o[5]!==l?(a=u?(0,n.jsx)(e3.FloatingLabel,{position:l,opacity:.6,children:u}):null,o[4]=u,o[5]=l,o[6]=a):a=o[6],a}},t6=new Set(["ForceFieldBare","Item","StaticShape","Turret"]);function t4(e){let t,r,a,s=(0,i.c)(13),{object:l,objectId:u}=e,c=(0,R.useRuntimeObjectById)(u??l?._id)??l,{missionType:d}=(0,o.useContext)(t3),f=(0,R.useEngineSelector)(t7);e:{let e,r;if(!c){t=!1;break e}s[0]!==c?(e=new Set(((0,b.getProperty)(c,"missionTypesList")??"").toLowerCase().split(/\s+/).filter(Boolean)),s[0]=c,s[1]=e):e=s[1];let a=e;s[2]!==d||s[3]!==a?(r=!a.size||a.has(d.toLowerCase()),s[2]=d,s[3]=a,s[4]=r):r=s[4],t=r}let h=t;if(!c)return null;let m=t8[c._className];s[5]!==f||s[6]!==c._className?(r=f&&t6.has(c._className),s[5]=f,s[6]=c._className,s[7]=r):r=s[7];let p=r;return s[8]!==m||s[9]!==p||s[10]!==c||s[11]!==h?(a=h&&m?(0,n.jsx)(o.Suspense,{children:!p&&(0,n.jsx)(m,{object:c})}):null,s[8]=m,s[9]=p,s[10]=c,s[11]=h,s[12]=a):a=s[12],a}function t7(e){return null!=e.playback.recording}let re=(0,o.createContext)(null);function rt(e){let t,r,a=(0,i.c)(5),{runtime:o,children:s}=e;return a[0]!==s?(t=(0,n.jsx)(tP,{children:s}),a[0]=s,a[1]=t):t=a[1],a[2]!==o||a[3]!==t?(r=(0,n.jsx)(re.Provider,{value:o,children:t}),a[2]=o,a[3]=t,a[4]=r):r=a[4],r}var rr=e.i(86608),ra=e.i(38433),rn=e.i(33870),ri=e.i(91996);let ro=async e=>{let t;try{t=(0,y.getUrlForPath)(e)}catch(t){return console.warn(`Script not in manifest: ${e} (${t})`),null}try{let r=await fetch(t);if(!r.ok)return console.error(`Script fetch failed: ${e} (${r.status})`),null;return await r.text()}catch(t){return console.error(`Script fetch error: ${e}`),console.error(t),null}},rs=(0,rn.createScriptCache)(),rl={findFiles:e=>{let t=(0,v.default)(e,{nocase:!0});return(0,ri.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,ri.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,ri.getResourceMap)()[(0,ri.getResourceKey)(e)]};function ru(e){"batch.flushed"===e.type&&R.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function rc(e){e instanceof Error&&"AbortError"===e.name||console.error("Mission runtime failed to become ready:",e)}let rd=(0,o.memo)(function(e){let t,r,a,s,l,u,c,d,f=(0,i.c)(17),{name:h,missionType:m,onLoadingChange:p}=e,{data:v}=((d=(0,i.c)(2))[0]!==h?(c={queryKey:["parsedMission",h],queryFn:()=>(0,y.loadMission)(h)},d[0]=h,d[1]=c):c=d[1],(0,g.useQuery)(c)),{missionGroup:A,runtime:F,progress:b}=function(e,t,r){let a,n,s,l=(0,i.c)(6);l[0]===Symbol.for("react.memo_cache_sentinel")?(a={missionGroup:void 0,runtime:void 0,progress:0},l[0]=a):a=l[0];let[u,c]=(0,o.useState)(a);return l[1]!==e||l[2]!==t||l[3]!==r?(n=()=>{if(!r)return;let a=new AbortController,n=!1,i=null,o=(0,ra.createProgressTracker)(),s=()=>{c(e=>({...e,progress:o.progress}))};o.on("update",s);let{runtime:l,ready:u}=(0,rr.runServer)({missionName:e,missionType:t,runtimeOptions:{loadScript:ro,fileSystem:rl,cache:rs,signal:a.signal,progress:o,ignoreScripts:["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"]}});return u.then(()=>{n||a.signal.aborted||(R.engineStore.getState().setRuntime(l),c({missionGroup:l.getObjectByName("MissionGroup"),runtime:l,progress:1}))}).catch(rc),i=l.subscribeRuntimeEvents(ru),R.engineStore.getState().setRuntime(l),()=>{n=!0,o.off("update",s),a.abort(),i?.(),R.engineStore.getState().clearRuntime(),l.destroy()}},s=[e,t,r],l[1]=e,l[2]=t,l[3]=r,l[4]=n,l[5]=s):(n=l[4],s=l[5]),(0,o.useEffect)(n,s),u}(h,m,v),C=!v||!A||!F;f[0]!==A||f[1]!==m||f[2]!==v?(t={metadata:v,missionType:m,missionGroup:A},f[0]=A,f[1]=m,f[2]=v,f[3]=t):t=f[3];let B=t;return(f[4]!==C||f[5]!==p||f[6]!==b?(r=()=>{p?.(C,b)},a=[C,b,p],f[4]=C,f[5]=p,f[6]=b,f[7]=r,f[8]=a):(r=f[7],a=f[8]),(0,o.useEffect)(r,a),C)?null:(f[9]!==A?(s=(0,n.jsx)(t4,{object:A}),f[9]=A,f[10]=s):s=f[10],f[11]!==F||f[12]!==s?(l=(0,n.jsx)(rt,{runtime:F,children:s}),f[11]=F,f[12]=s,f[13]=l):l=f[13],f[14]!==B||f[15]!==l?(u=(0,n.jsx)(t9,{value:B,children:l}),f[14]=B,f[15]=l,f[16]=u):u=f[16],u)});var rf=e.i(19273),rh=e.i(86491),rm=e.i(40143),rp=e.i(15823),rg=class extends rp.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let a=t.queryKey,n=t.queryHash??(0,rf.hashQueryKeyByOptions)(a,t),i=this.get(n);return i||(i=new rh.Query({client:e,queryKey:a,queryHash:n,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a)}),this.add(i)),i}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(){rm.notifyManager.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=>(0,rf.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,rf.matchQuery)(e,t)):t}notify(e){rm.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){rm.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){rm.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rv=e.i(88587),ry=e.i(36553),rA=class extends rv.Removable{#t;#r;#a;#n;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#a=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},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.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#a.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,ry.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):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.#a.canRun(this)});let a="pending"===this.state.status,n=!this.#n.canStart();try{if(a)t();else{this.#i({type:"pending",variables:e,isPaused:n}),await this.#a.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:n})}let i=await this.#n.start();return await this.#a.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#a.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#i({type:"success",data:i}),i}catch(t){try{await this.#a.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#a.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:"error",error:t}),t}finally{this.#a.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),rm.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#a.notify({mutation:this,type:"updated",action:e})})}},rF=rp,rb=class extends rF.Subscribable{constructor(e={}){super(),this.config=e,this.#o=new Set,this.#s=new Map,this.#l=0}#o;#s;#l;build(e,t,r){let a=new rA({client:e,mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:r});return this.add(a),a}add(e){this.#o.add(e);let t=rC(e);if("string"==typeof t){let r=this.#s.get(t);r?r.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#o.delete(e)){let t=rC(e);if("string"==typeof t){let r=this.#s.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=rC(e);if("string"!=typeof t)return!0;{let r=this.#s.get(t),a=r?.find(e=>"pending"===e.state.status);return!a||a===e}}runNext(e){let t=rC(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){rm.notifyManager.batch(()=>{this.#o.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#o.clear(),this.#s.clear()})}getAll(){return Array.from(this.#o)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,rf.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,rf.matchMutation)(e,t))}notify(e){rm.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return rm.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(rf.noop))))}};function rC(e){return e.options.scope?.id}var rB=e.i(75555),rS=e.i(14448);function rx(e){return{onFetch:(t,r)=>{let a=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},l=0,u=async()=>{let r=!1,u=(0,rf.ensureQueryFn)(t.options,t.fetchOptions),c=async(e,a,n)=>{let i;if(r)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);let o=(i={client:t.client,queryKey:t.queryKey,pageParam:a,direction:n?"backward":"forward",meta:t.options.meta},(0,rf.addConsumeAwareSignal)(i,()=>t.signal,()=>r=!0),i),s=await u(o),{maxPages:l}=t.options,c=n?rf.addToStart:rf.addToEnd;return{pages:c(e.pages,s,l),pageParams:c(e.pageParams,a,l)}};if(n&&i.length){let e="backward"===n,t={pages:i,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:rE)(a,t);s=await c(t,r,e)}else{let t=e??i.length;do{let e=0===l?o[0]??a.initialPageParam:rE(a,s);if(l>0&&null==e)break;s=await c(s,e),l++}while(lt.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function rE(e,{pages:t,pageParams:r}){let a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,r[a],r):void 0}var rM=class{#u;#a;#c;#d;#f;#h;#m;#p;constructor(e={}){this.#u=e.queryCache||new rg,this.#a=e.mutationCache||new rb,this.#c=e.defaultOptions||{},this.#d=new Map,this.#f=new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#m=rB.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#p=rS.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#m?.(),this.#m=void 0,this.#p?.(),this.#p=void 0)}isFetching(e){return this.#u.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#a.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#u.build(this,t),a=r.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,rf.resolveStaleTime)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#u.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let a=this.defaultQueryOptions({queryKey:e}),n=this.#u.get(a.queryHash),i=n?.state.data,o=(0,rf.functionalUpdate)(t,i);if(void 0!==o)return this.#u.build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return rm.notifyManager.batch(()=>this.#u.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state}removeQueries(e){let t=this.#u;rm.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#u;return rm.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(rm.notifyManager.batch(()=>this.#u.findAll(e).map(e=>e.cancel(r)))).then(rf.noop).catch(rf.noop)}invalidateQueries(e,t={}){return rm.notifyManager.batch(()=>(this.#u.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 r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(rm.notifyManager.batch(()=>this.#u.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(rf.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(rf.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#u.build(this,t);return r.isStaleByTime((0,rf.resolveStaleTime)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(rf.noop).catch(rf.noop)}fetchInfiniteQuery(e){return e.behavior=rx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(rf.noop).catch(rf.noop)}ensureInfiniteQueryData(e){return e.behavior=rx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return rS.onlineManager.isOnline()?this.#a.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#u}getMutationCache(){return this.#a}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#d.set((0,rf.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#d.values()],r={};return t.forEach(t=>{(0,rf.partialMatchKey)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#f.set((0,rf.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#f.values()],r={};return t.forEach(t=>{(0,rf.partialMatchKey)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,rf.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===rf.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#u.clear(),this.#a.clear()}},rD=e.i(12598),rI=e.i(8155);let rk=e=>{let t=(0,rI.createStore)(e),r=e=>(function(e,t=e=>e){let r=o.default.useSyncExternalStore(e.subscribe,o.default.useCallback(()=>t(e.getState()),[e,t]),o.default.useCallback(()=>t(e.getInitialState()),[e,t]));return o.default.useDebugValue(r),r})(t,e);return Object.assign(r,t),r};var rw=e.i(79473);let rT=o.createContext(null);function rR({map:e,children:t,onChange:r,domElement:a}){let n=e.map(e=>e.name+e.keys).join("-"),i=o.useMemo(()=>{let t;return(t=(0,rw.subscribeWithSelector)(()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{})))?rk(t):rk},[n]),s=o.useMemo(()=>[i.subscribe,i.getState,i],[n]),l=i.setState;return o.useEffect(()=>{let t=e.map(({name:e,keys:t,up:a})=>({keys:t,up:a,fn:t=>{l({[e]:t}),r&&r(e,t,s[1]())}})).reduce((e,{keys:t,fn:r,up:a=!0})=>(t.forEach(t=>e[t]={fn:r,pressed:!1,up:a}),e),{}),n=({key:e,code:r})=>{let a=t[e]||t[r];if(!a)return;let{fn:n,pressed:i,up:o}=a;a.pressed=!0,(o||!i)&&n(!0)},i=({key:e,code:r})=>{let a=t[e]||t[r];if(!a)return;let{fn:n,up:i}=a;a.pressed=!1,i&&n(!1)},o=a||window;return o.addEventListener("keydown",n,{passive:!0}),o.addEventListener("keyup",i,{passive:!0}),()=>{o.removeEventListener("keydown",n),o.removeEventListener("keyup",i)}},[a,n]),o.createElement(rT.Provider,{value:s,children:t})}function rP(e){let[t,r,a]=o.useContext(rT);return e?a(e):[t,r]}var rG=Object.defineProperty;class r_{constructor(){((e,t,r)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?rG(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let r=this._listeners[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let r=t.slice(0);for(let t=0,a=r.length;t{let a;return(a="symbol"!=typeof t?t+"":t)in e?rL(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,r};let rO=new u.Euler(0,0,0,"YXZ"),rN=new u.Vector3,rU={type:"change"},rH={type:"lock"},rJ={type:"unlock"},rV=Math.PI/2;class rK extends r_{constructor(e,t){super(),rj(this,"camera"),rj(this,"domElement"),rj(this,"isLocked"),rj(this,"minPolarAngle"),rj(this,"maxPolarAngle"),rj(this,"pointerSpeed"),rj(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(rO.setFromQuaternion(this.camera.quaternion),rO.y-=.002*e.movementX*this.pointerSpeed,rO.x-=.002*e.movementY*this.pointerSpeed,rO.x=Math.max(rV-this.maxPolarAngle,Math.min(rV-this.minPolarAngle,rO.x)),this.camera.quaternion.setFromEuler(rO),this.dispatchEvent(rU))}),rj(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(rH),this.isLocked=!0):(this.dispatchEvent(rJ),this.isLocked=!1))}),rj(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),rj(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),rj(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),rj(this,"dispose",()=>{this.disconnect()}),rj(this,"getObject",()=>this.camera),rj(this,"direction",new u.Vector3(0,0,-1)),rj(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),rj(this,"moveForward",e=>{rN.setFromMatrixColumn(this.camera.matrix,0),rN.crossVectors(this.camera.up,rN),this.camera.position.addScaledVector(rN,e)}),rj(this,"moveRight",e=>{rN.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(rN,e)}),rj(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),rj(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}(a={}).forward="forward",a.backward="backward",a.left="left",a.right="right",a.up="up",a.down="down",a.lookUp="lookUp",a.lookDown="lookDown",a.lookLeft="lookLeft",a.lookRight="lookRight",a.camera1="camera1",a.camera2="camera2",a.camera3="camera3",a.camera4="camera4",a.camera5="camera5",a.camera6="camera6",a.camera7="camera7",a.camera8="camera8",a.camera9="camera9";let rz=Math.PI/2-.01;function rq(){let e,t,r,a,n,s,l,c,d,f,h,m,p,g=(0,i.c)(26),{speedMultiplier:v,setSpeedMultiplier:y}=(0,E.useControls)(),[b,C]=rP(),{camera:B,gl:S}=(0,F.useThree)(),{nextCamera:x,setCameraIndex:M,cameraCount:D}=t1(),I=(0,o.useRef)(null);g[0]===Symbol.for("react.memo_cache_sentinel")?(e=new u.Vector3,g[0]=e):e=g[0];let k=(0,o.useRef)(e);g[1]===Symbol.for("react.memo_cache_sentinel")?(t=new u.Vector3,g[1]=t):t=g[1];let w=(0,o.useRef)(t);g[2]===Symbol.for("react.memo_cache_sentinel")?(r=new u.Vector3,g[2]=r):r=g[2];let T=(0,o.useRef)(r);g[3]===Symbol.for("react.memo_cache_sentinel")?(a=new u.Euler(0,0,0,"YXZ"),g[3]=a):a=g[3];let R=(0,o.useRef)(a);return g[4]!==B||g[5]!==S.domElement?(n=()=>{let e=new rK(B,S.domElement);return I.current=e,()=>{e.dispose()}},s=[B,S.domElement],g[4]=B,g[5]=S.domElement,g[6]=n,g[7]=s):(n=g[6],s=g[7]),(0,o.useEffect)(n,s),g[8]!==B||g[9]!==S.domElement||g[10]!==x?(l=()=>{let e=S.domElement,t=new u.Euler(0,0,0,"YXZ"),r=!1,a=!1,n=0,i=0,o=t=>{I.current?.isLocked||t.target===e&&(r=!0,a=!1,n=t.clientX,i=t.clientY)},s=e=>{!r||!a&&3>Math.abs(e.clientX-n)&&3>Math.abs(e.clientY-i)||(a=!0,t.setFromQuaternion(B.quaternion,"YXZ"),t.y=t.y-.003*e.movementX,t.x=t.x-.003*e.movementY,t.x=Math.max(-rz,Math.min(rz,t.x)),B.quaternion.setFromEuler(t))},l=()=>{r=!1},c=t=>{let r=I.current;!r||r.isLocked?x():t.target!==e||a||r.lock()};return e.addEventListener("mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",l),document.addEventListener("click",c),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l),document.removeEventListener("click",c)}},c=[B,S.domElement,x],g[8]=B,g[9]=S.domElement,g[10]=x,g[11]=l,g[12]=c):(l=g[11],c=g[12]),(0,o.useEffect)(l,c),g[13]!==D||g[14]!==M||g[15]!==b?(d=()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return b(t=>{for(let r=0;r{let e=e=>{e.preventDefault();let t=e.deltaY>0?-1:1,r=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*t;y(e=>Math.max(.1,Math.min(5,Math.round((e+r)*20)/20)))},t=S.domElement;return t.addEventListener("wheel",e,{passive:!1}),()=>{t.removeEventListener("wheel",e)}},m=[S.domElement,y],g[18]=S.domElement,g[19]=y,g[20]=h,g[21]=m):(h=g[20],m=g[21]),(0,o.useEffect)(h,m),g[22]!==B||g[23]!==C||g[24]!==v?(p=(e,t)=>{let{forward:r,backward:a,left:n,right:i,up:o,down:s,lookUp:l,lookDown:u,lookLeft:c,lookRight:d}=C();if((l||u||c||d)&&(R.current.setFromQuaternion(B.quaternion,"YXZ"),c&&(R.current.y=R.current.y+ +t),d&&(R.current.y=R.current.y-t),l&&(R.current.x=R.current.x+ +t),u&&(R.current.x=R.current.x-t),R.current.x=Math.max(-rz,Math.min(rz,R.current.x)),B.quaternion.setFromEuler(R.current)),!r&&!a&&!n&&!i&&!o&&!s)return;let f=80*v;B.getWorldDirection(k.current),k.current.normalize(),w.current.crossVectors(B.up,k.current).normalize(),T.current.set(0,0,0),r&&T.current.add(k.current),a&&T.current.sub(k.current),n&&T.current.add(w.current),i&&T.current.sub(w.current),o&&(T.current.y=T.current.y+1),s&&(T.current.y=T.current.y-1),T.current.lengthSq()>0&&(T.current.normalize().multiplyScalar(f*t),B.position.add(T.current))},g[22]=B,g[23]=C,g[24]=v,g[25]=p):p=g[25],(0,A.useFrame)(p),null}let rQ=[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"lookUp",keys:["ArrowUp"]},{name:"lookDown",keys:["ArrowDown"]},{name:"lookLeft",keys:["ArrowLeft"]},{name:"lookRight",keys:["ArrowRight"]},{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"]}];function rW(){let e,t,r=(0,i.c)(2);return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],r[0]=e):e=r[0],(0,o.useEffect)(rX,e),r[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(rq,{}),r[1]=t):t=r[1],t}function rX(){return window.addEventListener("keydown",rY,{capture:!0}),window.addEventListener("keyup",rY,{capture:!0}),()=>{window.removeEventListener("keydown",rY,{capture:!0}),window.removeEventListener("keyup",rY,{capture:!0})}}function rY(e){(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()}function rZ(e){let t,r=(0,i.c)(2),{children:a}=e;return r[0]!==a?(t=(0,n.jsx)(n.Fragment,{children:a}),r[0]=a,r[1]=t):t=r[1],t}function r$(){return(0,R.useEngineSelector)(r0)}function r0(e){return e.playback.recording}function r1(){return(0,R.useEngineSelector)(r2)}function r2(e){return"playing"===e.playback.status}function r3(){return(0,R.useEngineSelector)(r9)}function r9(e){return e.playback.timeMs/1e3}function r5(e){return e.playback.durationMs/1e3}function r8(e){return e.playback.rate}function r6(){let e,t,r,a,n,o,s=(0,i.c)(17),l=r$(),u=(0,R.useEngineSelector)(at),c=(0,R.useEngineSelector)(ae),d=(0,R.useEngineSelector)(r7),f=(0,R.useEngineSelector)(r4);s[0]!==u?(e=e=>{u(e)},s[0]=u,s[1]=e):e=s[1];let h=e;s[2]!==l||s[3]!==c?(t=()=>{(!(l?.isMetadataOnly||l?.isPartial)||l.streamingPlayback)&&c("playing")},s[2]=l,s[3]=c,s[4]=t):t=s[4];let m=t;s[5]!==c?(r=()=>{c("paused")},s[5]=c,s[6]=r):r=s[6];let p=r;s[7]!==d?(a=e=>{d(1e3*e)},s[7]=d,s[8]=a):a=s[8];let g=a;s[9]!==f?(n=e=>{f(e)},s[9]=f,s[10]=n):n=s[10];let v=n;return s[11]!==p||s[12]!==m||s[13]!==g||s[14]!==h||s[15]!==v?(o={setRecording:h,play:m,pause:p,seek:g,setSpeed:v},s[11]=p,s[12]=m,s[13]=g,s[14]=h,s[15]=v,s[16]=o):o=s[16],o}function r4(e){return e.setPlaybackRate}function r7(e){return e.setPlaybackTime}function ae(e){return e.setPlaybackStatus}function at(e){return e.setDemoRecording}var ar=e.i(13070);function aa(){let e,t,r,a,o,s,l,u,c,d,f,h,m,p,g,v,y,A,F,b,C,B,S,x,E=(0,i.c)(51),M=r$(),D=rP(ah),I=rP(af),k=rP(ad),w=rP(ac),T=rP(au),R=rP(al),P=rP(as),G=rP(ao),_=rP(ai),L=rP(an);return M?null:(E[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:ar.default.Spacer}),E[0]=e):e=E[0],E[1]!==D?(t=(0,n.jsx)("div",{className:ar.default.Key,"data-pressed":D,children:"W"}),E[1]=D,E[2]=t):t=E[2],E[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,n.jsx)("div",{className:ar.default.Spacer}),E[3]=r):r=E[3],E[4]!==t?(a=(0,n.jsxs)("div",{className:ar.default.Row,children:[e,t,r]}),E[4]=t,E[5]=a):a=E[5],E[6]!==k?(o=(0,n.jsx)("div",{className:ar.default.Key,"data-pressed":k,children:"A"}),E[6]=k,E[7]=o):o=E[7],E[8]!==I?(s=(0,n.jsx)("div",{className:ar.default.Key,"data-pressed":I,children:"S"}),E[8]=I,E[9]=s):s=E[9],E[10]!==w?(l=(0,n.jsx)("div",{className:ar.default.Key,"data-pressed":w,children:"D"}),E[10]=w,E[11]=l):l=E[11],E[12]!==o||E[13]!==s||E[14]!==l?(u=(0,n.jsxs)("div",{className:ar.default.Row,children:[o,s,l]}),E[12]=o,E[13]=s,E[14]=l,E[15]=u):u=E[15],E[16]!==a||E[17]!==u?(c=(0,n.jsxs)("div",{className:ar.default.Column,children:[a,u]}),E[16]=a,E[17]=u,E[18]=c):c=E[18],E[19]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)("span",{className:ar.default.Arrow,children:"↑"}),E[19]=d):d=E[19],E[20]!==T?(f=(0,n.jsx)("div",{className:ar.default.Row,children:(0,n.jsxs)("div",{className:ar.default.Key,"data-pressed":T,children:[d," Space"]})}),E[20]=T,E[21]=f):f=E[21],E[22]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)("span",{className:ar.default.Arrow,children:"↓"}),E[22]=h):h=E[22],E[23]!==R?(m=(0,n.jsx)("div",{className:ar.default.Row,children:(0,n.jsxs)("div",{className:ar.default.Key,"data-pressed":R,children:[h," Shift"]})}),E[23]=R,E[24]=m):m=E[24],E[25]!==f||E[26]!==m?(p=(0,n.jsxs)("div",{className:ar.default.Column,children:[f,m]}),E[25]=f,E[26]=m,E[27]=p):p=E[27],E[28]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)("div",{className:ar.default.Spacer}),E[28]=g):g=E[28],E[29]!==P?(v=(0,n.jsx)("div",{className:ar.default.Key,"data-pressed":P,children:"↑"}),E[29]=P,E[30]=v):v=E[30],E[31]===Symbol.for("react.memo_cache_sentinel")?(y=(0,n.jsx)("div",{className:ar.default.Spacer}),E[31]=y):y=E[31],E[32]!==v?(A=(0,n.jsxs)("div",{className:ar.default.Row,children:[g,v,y]}),E[32]=v,E[33]=A):A=E[33],E[34]!==_?(F=(0,n.jsx)("div",{className:ar.default.Key,"data-pressed":_,children:"←"}),E[34]=_,E[35]=F):F=E[35],E[36]!==G?(b=(0,n.jsx)("div",{className:ar.default.Key,"data-pressed":G,children:"↓"}),E[36]=G,E[37]=b):b=E[37],E[38]!==L?(C=(0,n.jsx)("div",{className:ar.default.Key,"data-pressed":L,children:"→"}),E[38]=L,E[39]=C):C=E[39],E[40]!==F||E[41]!==b||E[42]!==C?(B=(0,n.jsxs)("div",{className:ar.default.Row,children:[F,b,C]}),E[40]=F,E[41]=b,E[42]=C,E[43]=B):B=E[43],E[44]!==A||E[45]!==B?(S=(0,n.jsxs)("div",{className:ar.default.Column,children:[A,B]}),E[44]=A,E[45]=B,E[46]=S):S=E[46],E[47]!==p||E[48]!==S||E[49]!==c?(x=(0,n.jsxs)("div",{className:ar.default.Root,children:[c,p,S]}),E[47]=p,E[48]=S,E[49]=c,E[50]=x):x=E[50],x)}function an(e){return e.lookRight}function ai(e){return e.lookLeft}function ao(e){return e.lookDown}function as(e){return e.lookUp}function al(e){return e.down}function au(e){return e.up}function ac(e){return e.right}function ad(e){return e.left}function af(e){return e.backward}function ah(e){return e.forward}var am=e.i(78295);function ap(e){let t=e.querySelector(".back");t&&(t.style.background="rgba(3, 79, 76, 0.6)",t.style.border="1px solid rgba(0, 219, 223, 0.5)",t.style.boxShadow="inset 0 0 10px rgba(0, 0, 0, 0.7)");let r=e.querySelector(".front");r&&(r.style.background="radial-gradient(circle at 50% 50%, rgba(23, 247, 198, 0.9) 0%, rgba(9, 184, 170, 0.95) 100%)",r.style.border="2px solid rgba(255, 255, 255, 0.4)",r.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 2px rgba(0, 0, 0, 0.3)")}let ag=Math.PI/2-.01;function av({joystickState:t,joystickZone:r,lookJoystickState:a,lookJoystickZone:i}){let{touchMode:s}=(0,E.useControls)();(0,o.useEffect)(()=>{let a=r.current;if(!a)return;let n=null,i=!1;return e.A(84968).then(e=>{i||(n=e.default.create({zone:a,mode:"static",position:{left:"70px",bottom:"70px"},size:120,restOpacity:.9}),ap(a),n.on("move",(e,r)=>{t.current.angle=r.angle.radian,t.current.force=Math.min(1,r.force)}),n.on("end",()=>{t.current.force=0}))}),()=>{i=!0,n?.destroy()}},[t,r,s]),(0,o.useEffect)(()=>{if("dualStick"!==s)return;let t=i.current;if(!t)return;let r=null,n=!1;return e.A(84968).then(e=>{n||(r=e.default.create({zone:t,mode:"static",position:{right:"70px",bottom:"70px"},size:120,restOpacity:.9}),ap(t),r.on("move",(e,t)=>{a.current.angle=t.angle.radian,a.current.force=Math.min(1,t.force)}),r.on("end",()=>{a.current.force=0}))}),()=>{n=!0,r?.destroy()}},[s,a,i]);let l=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};return"dualStick"===s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{ref:r,className:am.default.Left,onContextMenu:e=>e.preventDefault(),onTouchStart:l}),(0,n.jsx)("div",{ref:i,className:am.default.Right,onContextMenu:e=>e.preventDefault(),onTouchStart:l})]}):(0,n.jsx)("div",{ref:r,className:am.default.Joystick,onContextMenu:e=>e.preventDefault(),onTouchStart:l})}function ay(e){let t,r,a,n,s,l,c,d,f,h,m=(0,i.c)(25),{joystickState:p,joystickZone:g,lookJoystickState:v}=e,{speedMultiplier:y,touchMode:b}=(0,E.useControls)(),{camera:C,gl:B}=(0,F.useThree)();m[0]===Symbol.for("react.memo_cache_sentinel")?(t=new u.Euler(0,0,0,"YXZ"),m[0]=t):t=m[0];let S=(0,o.useRef)(t),x=(0,o.useRef)(null);m[1]===Symbol.for("react.memo_cache_sentinel")?(r={x:0,y:0},m[1]=r):r=m[1];let M=(0,o.useRef)(r);m[2]===Symbol.for("react.memo_cache_sentinel")?(a=new u.Vector3,m[2]=a):a=m[2];let D=(0,o.useRef)(a);m[3]===Symbol.for("react.memo_cache_sentinel")?(n=new u.Vector3,m[3]=n):n=m[3];let I=(0,o.useRef)(n);m[4]===Symbol.for("react.memo_cache_sentinel")?(s=new u.Vector3,m[4]=s):s=m[4];let k=(0,o.useRef)(s);return m[5]!==C.quaternion?(l=()=>{S.current.setFromQuaternion(C.quaternion,"YXZ")},m[5]=C.quaternion,m[6]=l):l=m[6],m[7]!==C?(c=[C],m[7]=C,m[8]=c):c=m[8],(0,o.useEffect)(l,c),m[9]!==C.quaternion||m[10]!==B.domElement||m[11]!==g||m[12]!==b?(d=()=>{if("moveLookStick"!==b)return;let e=B.domElement,t=e=>{let t=g.current;if(!t)return!1;let r=t.getBoundingClientRect();return e.clientX>=r.left&&e.clientX<=r.right&&e.clientY>=r.top&&e.clientY<=r.bottom},r=e=>{if(null===x.current)for(let r=0;r{if(null!==x.current)for(let t=0;t{for(let t=0;t{e.removeEventListener("touchstart",r),e.removeEventListener("touchmove",a),e.removeEventListener("touchend",n),e.removeEventListener("touchcancel",n),x.current=null}},m[9]=C.quaternion,m[10]=B.domElement,m[11]=g,m[12]=b,m[13]=d):d=m[13],m[14]!==C||m[15]!==B.domElement||m[16]!==g||m[17]!==b?(f=[C,B.domElement,g,b],m[14]=C,m[15]=B.domElement,m[16]=g,m[17]=b,m[18]=f):f=m[18],(0,o.useEffect)(d,f),m[19]!==C||m[20]!==p.current||m[21]!==v||m[22]!==y||m[23]!==b?(h=(e,t)=>{let{force:r,angle:a}=p.current;if("dualStick"===b){let e=v.current;if(e.force>.15){let r=(e.force-.15)/.85,a=Math.cos(e.angle),n=Math.sin(e.angle);S.current.setFromQuaternion(C.quaternion,"YXZ"),S.current.y=S.current.y-a*r*2.5*t,S.current.x=S.current.x+n*r*2.5*t,S.current.x=Math.max(-ag,Math.min(ag,S.current.x)),C.quaternion.setFromEuler(S.current)}if(r>.08){let e=80*y*((r-.08)/.92),n=Math.cos(a),i=Math.sin(a);C.getWorldDirection(D.current),D.current.normalize(),I.current.crossVectors(C.up,D.current).normalize(),k.current.set(0,0,0).addScaledVector(D.current,i).addScaledVector(I.current,-n),k.current.lengthSq()>0&&(k.current.normalize().multiplyScalar(e*t),C.position.add(k.current))}}else if("moveLookStick"===b&&r>0){let e=80*y*.5;if(C.getWorldDirection(D.current),D.current.normalize(),k.current.copy(D.current).multiplyScalar(e*t),C.position.add(k.current),r>=.15){let e=Math.cos(a),n=Math.sin(a),i=(r-.15)/.85;S.current.setFromQuaternion(C.quaternion,"YXZ"),S.current.y=S.current.y-e*i*1.25*t,S.current.x=S.current.x+n*i*1.25*t,S.current.x=Math.max(-ag,Math.min(ag,S.current.x)),C.quaternion.setFromEuler(S.current)}}},m[19]=C,m[20]=p.current,m[21]=v,m[22]=y,m[23]=b,m[24]=h):h=m[24],(0,A.useFrame)(h),null}var aA="undefined"!=typeof window&&!!(null==(r=window.document)?void 0:r.createElement);function aF(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function ab(e){return e?"self"in e?e.self:aF(e).defaultView||window:self}function aC(e,t=!1){let{activeElement:r}=aF(e);if(!(null==r?void 0:r.nodeName))return null;if(aS(r)&&r.contentDocument)return aC(r.contentDocument.body,t);if(t){let e=r.getAttribute("aria-activedescendant");if(e){let t=aF(r).getElementById(e);if(t)return t}}return r}function aB(e,t){return e===t||e.contains(t)}function aS(e){return"IFRAME"===e.tagName}function ax(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==aE.indexOf(e.type)}var aE=["button","color","file","image","reset","submit"];function aM(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function aD(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function aI(e){return e.isContentEditable||aD(e)}function ak(e){let t=0,r=0;if(aD(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let a=aF(e).getSelection();if((null==a?void 0:a.rangeCount)&&a.anchorNode&&aB(e,a.anchorNode)&&a.focusNode&&aB(e,a.focusNode)){let n=a.getRangeAt(0),i=n.cloneRange();i.selectNodeContents(e),i.setEnd(n.startContainer,n.startOffset),t=i.toString().length,i.setEnd(n.endContainer,n.endOffset),r=i.toString().length}}return{start:t,end:r}}function aw(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function aT(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return aT(e.parentElement)||document.scrollingElement||document.body}function aR(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function aP(e,t){return t&&e.item(t)||null}var aG=Symbol("FOCUS_SILENTLY");function a_(e,t,r){if(!t||t===r)return!1;let a=e.item(t.id);return!!a&&(!r||a.element!==r)}function aL(){}function aj(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function aO(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function aN(e){return e}function aU(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function aH(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function aJ(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function aV(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function aK(...e){for(let t of e)if(void 0!==t)return t}function az(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function aq(){return aA&&!!navigator.maxTouchPoints}function aQ(){return!!aA&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function aW(){return aA&&aQ()&&/apple/i.test(navigator.vendor)}function aX(e){return!!(e.currentTarget&&!aB(e.currentTarget,e.target))}function aY(e){return e.target===e.currentTarget}function aZ(e,t){let r=new FocusEvent("blur",t),a=e.dispatchEvent(r),n={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",n)),a}function a$(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function a0(e,t){let r=t||e.currentTarget,a=e.relatedTarget;return!a||!aB(r,a)}function a1(e,t,r,a){let n=(e=>{if(a){let t=setTimeout(e,a);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,i,!0),r()}),i=()=>{n(),r()};return e.addEventListener(t,i,{once:!0,capture:!0}),n}function a2(e,t,r,a=window){let n=[];try{for(let i of(a.document.addEventListener(e,t,r),Array.from(a.frames)))n.push(a2(e,t,r,i))}catch(e){}return()=>{try{a.document.removeEventListener(e,t,r)}catch(e){}for(let e of n)e()}}var a3={...o},a9=a3.useId;a3.useDeferredValue;var a5=a3.useInsertionEffect,a8=aA?o.useLayoutEffect:o.useEffect;function a6(e){let t=(0,o.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return a5?a5(()=>{t.current=e}):t.current=e,(0,o.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function a4(...e){return(0,o.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)az(r,t)}},e)}function a7(e){if(a9){let t=a9();return e||t}let[t,r]=(0,o.useState)(e);return a8(()=>{if(e||t)return;let a=Math.random().toString(36).slice(2,8);r(`id-${a}`)},[e,t]),e||t}function ne(e,t){let r=(0,o.useRef)(!1);(0,o.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,o.useEffect)(()=>()=>{r.current=!1},[])}function nt(){return(0,o.useReducer)(()=>[],[])}function nr(e){return a6("function"==typeof e?e:()=>e)}function na(e,t,r=[]){let a=(0,o.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:a}}function nn(e=!1,t){let[r,a]=(0,o.useState)(null);return{portalRef:a4(a,t),portalNode:r,domReady:!e||r}}var ni=!1,no=!1,ns=0,nl=0;function nu(e){let t,r;t=e.movementX||e.screenX-ns,r=e.movementY||e.screenY-nl,ns=e.screenX,nl=e.screenY,(t||r||0)&&(no=!0)}function nc(){no=!1}function nd(e){let t=o.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function nf(e,t){return o.memo(e,t)}function nh(e,t){let r,{wrapElement:a,render:i,...s}=t,l=a4(t.ref,i&&(0,o.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(o.isValidElement(i)){let e={...i.props,ref:l};r=o.cloneElement(i,function(e,t){let r={...e};for(let a in t){if(!aj(t,a))continue;if("className"===a){let a="className";r[a]=e[a]?`${e[a]} ${t[a]}`:t[a];continue}if("style"===a){let a="style";r[a]=e[a]?{...e[a],...t[a]}:t[a];continue}let n=t[a];if("function"==typeof n&&a.startsWith("on")){let t=e[a];if("function"==typeof t){r[a]=(...e)=>{n(...e),t(...e)};continue}}r[a]=n}return r}(s,e))}else r=i?i(s):(0,n.jsx)(e,{...s});return a?a(r):r}function nm(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function np(e=[],t=[]){let r=o.createContext(void 0),a=o.createContext(void 0),i=()=>o.useContext(r),s=t=>e.reduceRight((e,r)=>(0,n.jsx)(r,{...t,children:e}),(0,n.jsx)(r.Provider,{...t}));return{context:r,scopedContext:a,useContext:i,useScopedContext:(e=!1)=>{let t=o.useContext(a),r=i();return e?t:t||r},useProviderContext:()=>{let e=o.useContext(a),t=i();if(!e||e!==t)return t},ContextProvider:s,ScopedContextProvider:e=>(0,n.jsx)(s,{...e,children:t.reduceRight((t,r)=>(0,n.jsx)(r,{...e,children:t}),(0,n.jsx)(a.Provider,{...e}))})}}var ng=np(),nv=ng.useContext;ng.useScopedContext,ng.useProviderContext;var ny=np([ng.ContextProvider],[ng.ScopedContextProvider]),nA=ny.useContext;ny.useScopedContext;var nF=ny.useProviderContext,nb=ny.ContextProvider,nC=ny.ScopedContextProvider,nB=(0,o.createContext)(void 0),nS=(0,o.createContext)(void 0),nx=(0,o.createContext)(!0),nE="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 nM(e){return!(!e.matches(nE)||!aM(e)||e.closest("[inert]"))}function nD(e){if(!nM(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=aC(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function nI(e,t){let r=Array.from(e.querySelectorAll(nE));t&&r.unshift(e);let a=r.filter(nM);return a.forEach((e,t)=>{if(aS(e)&&e.contentDocument){let r=e.contentDocument.body;a.splice(t,1,...nI(r))}}),a}function nk(e,t,r){let a=Array.from(e.querySelectorAll(nE)),n=a.filter(nD);return(t&&nD(e)&&n.unshift(e),n.forEach((e,t)=>{if(aS(e)&&e.contentDocument){let a=nk(e.contentDocument.body,!1,r);n.splice(t,1,...a)}}),!n.length&&r)?a:n}function nw(e,t){var r;let a,n,i,o;return r=document.body,a=aC(r),i=(n=nI(r,!1)).indexOf(a),(o=n.slice(i+1)).find(nD)||(e?n.find(nD):null)||(t?o[0]:null)||null}function nT(e,t){var r;let a,n,i,o;return r=document.body,a=aC(r),i=(n=nI(r,!1).reverse()).indexOf(a),(o=n.slice(i+1)).find(nD)||(e?n.find(nD):null)||(t?o[0]:null)||null}function nR(e){let t=aC(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function nP(e){let t=aC(e);if(!t)return!1;if(aB(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function nG(e){!nP(e)&&nM(e)&&e.focus()}var n_=aW(),nL=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],nj=Symbol("safariFocusAncestor");function nO(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function nN(e,t){return a6(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var nU=!1,nH=!0;function nJ(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(nH=!1)}function nV(e){e.metaKey||e.ctrlKey||e.altKey||(nH=!0)}var nK=nm(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:a,...n}){var i,s,l,u,c;let d=(0,o.useRef)(null);(0,o.useEffect)(()=>{!e||nU||(a2("mousedown",nJ,!0),a2("keydown",nV,!0),nU=!0)},[e]),n_&&(0,o.useEffect)(()=>{if(!e)return;let t=d.current;if(!t||!nO(t))return;let r="labels"in t?t.labels:null;if(!r)return;let a=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",a);return()=>{for(let e of r)e.removeEventListener("mouseup",a)}},[e]);let f=e&&aJ(n),h=!!f&&!t,[m,p]=(0,o.useState)(!1);(0,o.useEffect)(()=>{e&&h&&m&&p(!1)},[e,h,m]),(0,o.useEffect)(()=>{if(!e||!m)return;let t=d.current;if(!t||"undefined"==typeof IntersectionObserver)return;let r=new IntersectionObserver(()=>{nM(t)||p(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let g=nN(n.onKeyPressCapture,f),v=nN(n.onMouseDownCapture,f),y=nN(n.onClickCapture,f),A=n.onMouseDown,F=a6(t=>{if(null==A||A(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!n_||aX(t)||!ax(r)&&!nO(r))return;let a=!1,n=()=>{a=!0};r.addEventListener("focusin",n,{capture:!0,once:!0});let i=function(e){for(;e&&!nM(e);)e=e.closest(nE);return e||null}(r.parentElement);i&&(i[nj]=!0),a1(r,"mouseup",()=>{r.removeEventListener("focusin",n,!0),i&&(i[nj]=!1),a||nG(r)})}),b=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let n=t.currentTarget;n&&nR(n)&&(null==a||a(t),t.defaultPrevented||(n.dataset.focusVisible="true",p(!0)))},C=n.onKeyDownCapture,B=a6(t=>{if(null==C||C(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!aY(t))return;let r=t.currentTarget;a1(r,"focusout",()=>b(t,r))}),S=n.onFocusCapture,x=a6(t=>{if(null==S||S(t),t.defaultPrevented||!e)return;if(!aY(t))return void p(!1);let r=t.currentTarget;nH||function(e){let{tagName:t,readOnly:r,type:a}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:nL.includes(a))}(t.target)?a1(t.target,"focusout",()=>b(t,r)):p(!1)}),E=n.onBlur,M=a6(t=>{null==E||E(t),!e||a0(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),p(!1))}),D=(0,o.useContext)(nx),I=a6(t=>{e&&r&&t&&D&&queueMicrotask(()=>{nR(t)||nM(t)&&t.focus()})}),k=function(e,t){let r=e=>{if("string"==typeof e)return e},[a,n]=(0,o.useState)(()=>r(void 0));return a8(()=>{let t=e&&"current"in e?e.current:e;n((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),a}(d),w=e&&(!k||"button"===k||"summary"===k||"input"===k||"select"===k||"textarea"===k||"a"===k),T=e&&(!k||"button"===k||"input"===k||"select"===k||"textarea"===k),R=n.style,P=(0,o.useMemo)(()=>h?{pointerEvents:"none",...R}:R,[h,R]);return n={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":f||void 0,...n,ref:a4(d,I,n.ref),style:P,tabIndex:(i=e,s=h,l=w,u=T,c=n.tabIndex,i?s?l&&!u?-1:void 0:l?c:c||0:c),disabled:!!T&&!!h||void 0,contentEditable:f?void 0:n.contentEditable,onKeyPressCapture:g,onClickCapture:y,onMouseDownCapture:v,onMouseDown:F,onKeyDownCapture:B,onFocusCapture:x,onBlur:M},aV(n)});function nz(e){let t=[];for(let r of e)t.push(...r);return t}function nq(e){return e.slice().reverse()}function nQ(e,t,r){return a6(a=>{var n;let i,o;if(null==t||t(a),a.defaultPrevented||a.isPropagationStopped()||!aY(a)||"Shift"===a.key||"Control"===a.key||"Alt"===a.key||"Meta"===a.key||(!(i=a.target)||aD(i))&&1===a.key.length&&!a.ctrlKey&&!a.metaKey)return;let s=e.getState(),l=null==(n=aP(e,s.activeId))?void 0:n.element;if(!l)return;let{view:u,...c}=a;l!==(null==r?void 0:r.current)&&l.focus(),o=new KeyboardEvent(a.type,c),l.dispatchEvent(o)||a.preventDefault(),a.currentTarget.contains(l)&&a.stopPropagation()})}nd(function(e){return nh("div",nK(e))});var nW=nm(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:a=!0,...i}){let s=nF();aU(e=e||s,!1);let l=(0,o.useRef)(null),u=(0,o.useRef)(null),c=function(e){let[t,r]=(0,o.useState)(!1),a=(0,o.useCallback)(()=>r(!0),[]),n=e.useState(t=>aP(e,t.activeId));return(0,o.useEffect)(()=>{let e=null==n?void 0:n.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[n,t]),a}(e),d=e.useState("moves"),[,f]=function(e){let[t,r]=(0,o.useState)(null);return a8(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,o.useEffect)(()=>{var a;if(!e||!d||!t||!r)return;let{activeId:n}=e.getState(),i=null==(a=aP(e,n))?void 0:a.element;i&&("scrollIntoView"in i?(i.focus({preventScroll:!0}),i.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):i.focus())},[e,d,t,r]),a8(()=>{if(!e||!d||!t)return;let{baseElement:r,activeId:a}=e.getState();if(null!==a||!r)return;let n=u.current;u.current=null,n&&aZ(n,{relatedTarget:r}),nR(r)||r.focus()},[e,d,t]);let h=e.useState("activeId"),m=e.useState("virtualFocus");a8(()=>{var r;if(!e||!t||!m)return;let a=u.current;if(u.current=null,!a)return;let n=(null==(r=aP(e,h))?void 0:r.element)||aC(a);n!==a&&aZ(a,{relatedTarget:n})},[e,h,m,t]);let p=nQ(e,i.onKeyDownCapture,u),g=nQ(e,i.onKeyUpCapture,u),v=i.onFocusCapture,y=a6(t=>{var r;let a;if(null==v||v(t),t.defaultPrevented||!e)return;let{virtualFocus:n}=e.getState();if(!n)return;let i=t.relatedTarget,o=(a=(r=t.currentTarget)[aG],delete r[aG],a);aY(t)&&o&&(t.stopPropagation(),u.current=i)}),A=i.onFocus,F=a6(r=>{if(null==A||A(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:a}=r,{virtualFocus:n}=e.getState();n?aY(r)&&!a_(e,a)&&queueMicrotask(c):aY(r)&&e.setActiveId(null)}),b=i.onBlurCapture,C=a6(t=>{var r;if(null==b||b(t),t.defaultPrevented||!e)return;let{virtualFocus:a,activeId:n}=e.getState();if(!a)return;let i=null==(r=aP(e,n))?void 0:r.element,o=t.relatedTarget,s=a_(e,o),l=u.current;u.current=null,aY(t)&&s?(o===i?l&&l!==o&&aZ(l,t):i?aZ(i,t):l&&aZ(l,t),t.stopPropagation()):!a_(e,t.target)&&i&&aZ(i,t)}),B=i.onKeyDown,S=nr(a),x=a6(t=>{var r;if(null==B||B(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!aY(t))return;let{orientation:a,renderedItems:n,activeId:i}=e.getState(),o=aP(e,i);if(null==(r=null==o?void 0:o.element)?void 0:r.isConnected)return;let s="horizontal"!==a,l="vertical"!==a,u=n.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&aD(t.currentTarget))return;let c={ArrowUp:(u||s)&&(()=>{if(u){let e=nz(nq(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(n))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(u||l)&&e.first,ArrowDown:(u||s)&&e.first,ArrowLeft:(u||l)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!S(t))return;t.preventDefault(),e.move(r)}}});return i=na(i,t=>(0,n.jsx)(nb,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var a;if(e&&t&&r.virtualFocus)return null==(a=aP(e,r.activeId))?void 0:a.id}),...i,ref:a4(l,f,i.ref),onKeyDownCapture:p,onKeyUpCapture:g,onFocusCapture:y,onFocus:F,onBlurCapture:C,onKeyDown:x},i=nK({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});nd(function(e){return nh("div",nW(e))});var nX=np();nX.useContext,nX.useScopedContext;var nY=nX.useProviderContext,nZ=np([nX.ContextProvider],[nX.ScopedContextProvider]);nZ.useContext,nZ.useScopedContext;var n$=nZ.useProviderContext,n0=nZ.ContextProvider,n1=nZ.ScopedContextProvider,n2=(0,o.createContext)(void 0),n3=(0,o.createContext)(void 0),n9=np([n0],[n1]);n9.useContext,n9.useScopedContext;var n5=n9.useProviderContext,n8=n9.ContextProvider,n6=n9.ScopedContextProvider,n4=nm(function({store:e,...t}){let r=n5();return e=e||r,t={...t,ref:a4(null==e?void 0:e.setAnchorElement,t.ref)}});nd(function(e){return nh("div",n4(e))});var n7=(0,o.createContext)(void 0),ie=np([n8,nb],[n6,nC]),it=ie.useContext,ir=ie.useScopedContext,ia=ie.useProviderContext,ii=ie.ContextProvider,io=ie.ScopedContextProvider,is=(0,o.createContext)(void 0),il=(0,o.createContext)(!1);function iu(e,t){let r=e.__unstableInternals;return aU(r,"Invalid store"),r[t]}function ic(e,...t){let r=e,a=r,n=Symbol(),i=aL,o=new Set,s=new Set,l=new Set,u=new Set,c=new Set,d=new WeakMap,f=new WeakMap,h=(e,t,r=u)=>(r.add(t),f.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),f.delete(t),r.delete(t)}),m=(e,i,o=!1)=>{var l,h;if(!aj(r,e))return;let m=(h=r[e],"function"==typeof i?i("function"==typeof h?h():h):i);if(m===r[e])return;if(!o)for(let r of t)null==(l=null==r?void 0:r.setState)||l.call(r,e,m);let p=r;r={...r,[e]:m};let g=Symbol();n=g,s.add(e);let v=(t,a,n)=>{var i;let o=f.get(t);(!o||o.some(t=>n?n.has(t):t===e))&&(null==(i=d.get(t))||i(),d.set(t,t(r,a)))};for(let e of u)v(e,p);queueMicrotask(()=>{if(n!==g)return;let e=r;for(let e of c)v(e,a,s);a=e,s.clear()})},p={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{let e=o.size,a=Symbol();o.add(a);let n=()=>{o.delete(a),o.size||i()};if(e)return n;let s=Object.keys(r).map(e=>aO(...t.map(t=>{var r;let a=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(a&&aj(a,e))return ip(t,[e],t=>{m(e,t[e],!0)})}))),u=[];for(let e of l)u.push(e());return i=aO(...s,...u,...t.map(ih)),n},subscribe:(e,t)=>h(e,t),sync:(e,t)=>(d.set(t,t(r,r)),h(e,t)),batch:(e,t)=>(d.set(t,t(r,a)),h(e,t,c)),pick:e=>ic(function(e,t){let r={};for(let a of t)aj(e,a)&&(r[a]=e[a]);return r}(r,e),p),omit:e=>ic(function(e,t){let r={...e};for(let e of t)aj(r,e)&&delete r[e];return r}(r,e),p)}};return p}function id(e,...t){if(e)return iu(e,"setup")(...t)}function ih(e,...t){if(e)return iu(e,"init")(...t)}function im(e,...t){if(e)return iu(e,"subscribe")(...t)}function ip(e,...t){if(e)return iu(e,"sync")(...t)}function ig(e,...t){if(e)return iu(e,"batch")(...t)}function iv(e,...t){if(e)return iu(e,"omit")(...t)}function iy(...e){var t;let r={};for(let a of e){let e=null==(t=null==a?void 0:a.getState)?void 0:t.call(a);e&&Object.assign(r,e)}let a=ic(r,...e);return Object.assign({},...e,a)}function iA(e,t){}function iF(e,t,r){if(!r)return!1;let a=e.find(e=>!e.disabled&&e.value);return(null==a?void 0:a.value)===t}function ib(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var iC=nm(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:a,setValueOnChange:n,showMinLength:i=0,showOnChange:s,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:c,showOnKeyPress:d=c,blurActiveItemOnClick:f,setValueOnClick:h=!0,moveOnKeyPress:m=!0,autoComplete:p="list",...g}){var v;let y,A=ia();aU(e=e||A,!1);let F=(0,o.useRef)(null),[b,C]=nt(),B=(0,o.useRef)(!1),S=(0,o.useRef)(!1),x=e.useState(e=>e.virtualFocus&&r),E="inline"===p||"both"===p,[M,D]=(0,o.useState)(E);v=[E],y=(0,o.useRef)(!1),a8(()=>{if(y.current)return(()=>{E&&D(!0)})();y.current=!0},v),a8(()=>()=>{y.current=!1},[]);let I=e.useState("value"),k=(0,o.useRef)();(0,o.useEffect)(()=>ip(e,["selectedValue","activeId"],(e,t)=>{k.current=t.selectedValue}),[]);let w=e.useState(e=>{var t;if(E&&M){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=k.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),T=e.useState("renderedItems"),R=e.useState("open"),P=e.useState("contentElement"),G=(0,o.useMemo)(()=>{if(!E||!M)return I;if(iF(T,w,x)){if(ib(I,w)){let e=(null==w?void 0:w.slice(I.length))||"";return I+e}return I}return w||I},[E,M,T,w,x,I]);(0,o.useEffect)(()=>{let e=F.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,o.useEffect)(()=>{if(!E||!M||!w||!iF(T,w,x)||!ib(I,w))return;let e=aL;return queueMicrotask(()=>{let t=F.current;if(!t)return;let{start:r,end:a}=ak(t),n=I.length,i=w.length;aR(t,n,i),e=()=>{if(!nR(t))return;let{start:e,end:o}=ak(t);e!==n||o===i&&aR(t,r,a)}}),()=>e()},[b,E,M,w,T,x,I]);let _=(0,o.useRef)(null),L=a6(a),j=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!R||!P)return;let t=aT(P);if(!t)return;_.current=t;let r=()=>{B.current=!1},a=()=>{if(!e||!B.current)return;let{activeId:t}=e.getState();null===t||t!==j.current&&(B.current=!1)},n={passive:!0,capture:!0};return t.addEventListener("wheel",r,n),t.addEventListener("touchmove",r,n),t.addEventListener("scroll",a,n),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",a,!0)}},[R,P,e]),a8(()=>{!I||S.current||(B.current=!0)},[I]),a8(()=>{"always"!==x&&R||(B.current=R)},[x,R]);let O=e.useState("resetValueOnSelect");ne(()=>{var t,r;let a=B.current;if(!e||!R||!a&&!O)return;let{baseElement:n,contentElement:i,activeId:o}=e.getState();if(!n||nR(n)){if(null==i?void 0:i.hasAttribute("data-placing")){let e=new MutationObserver(C);return e.observe(i,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(x&&a){let r,a=L(T),n=void 0!==a?a:null!=(t=null==(r=T.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();j.current=n,e.move(null!=n?n:null)}else{let t=null==(r=e.item(o||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,R,b,I,x,O,L,T]),(0,o.useEffect)(()=>{if(!E)return;let t=F.current;if(!t)return;let r=[t,P].filter(e=>!!e),a=t=>{r.every(e=>a0(t,e))&&(null==e||e.setValue(G))};for(let e of r)e.addEventListener("focusout",a);return()=>{for(let e of r)e.removeEventListener("focusout",a)}},[E,P,e,G]);let N=e=>e.currentTarget.value.length>=i,U=g.onChange,H=nr(null!=s?s:N),J=nr(null!=n?n:!e.tag),V=a6(t=>{if(null==U||U(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:a,selectionStart:n,selectionEnd:i}=r,o=t.nativeEvent;if(B.current=!0,"input"===o.type&&(o.isComposing&&(B.current=!1,S.current=!0),E)){let e="insertText"===o.inputType||"insertCompositionText"===o.inputType,t=n===a.length;D(e&&t)}if(J(t)){let t=a===e.getState().value;e.setValue(a),queueMicrotask(()=>{aR(r,n,i)}),E&&x&&t&&C()}H(t)&&e.show(),x&&B.current||e.setActiveId(null)}),K=g.onCompositionEnd,z=a6(e=>{B.current=!0,S.current=!1,null==K||K(e),e.defaultPrevented||x&&C()}),q=g.onMouseDown,Q=nr(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),W=nr(h),X=nr(null!=u?u:N),Y=a6(t=>{null==q||q(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(Q(t)&&e.setActiveId(null),W(t)&&e.setValue(G),X(t)&&a1(t.currentTarget,"mouseup",e.show))}),Z=g.onKeyDown,$=nr(null!=d?d:N),ee=a6(t=>{if(null==Z||Z(t),t.repeat||(B.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&$(t)&&(t.preventDefault(),e.show())}),et=g.onBlur,er=a6(e=>{if(B.current=!1,null==et||et(e),e.defaultPrevented)return}),ea=a7(g.id),en=e.useState(e=>null===e.activeId);return g={id:ea,role:"combobox","aria-autocomplete":"inline"===p||"list"===p||"both"===p||"none"===p?p:void 0,"aria-haspopup":aw(P,"listbox"),"aria-expanded":R,"aria-controls":null==P?void 0:P.id,"data-active-item":en||void 0,value:G,...g,ref:a4(F,g.ref),onChange:V,onCompositionEnd:z,onMouseDown:Y,onKeyDown:ee,onBlur:er},g=nW({store:e,focusable:t,...g,moveOnKeyPress:e=>!aH(m,e)&&(E&&D(!0),!0)}),{autoComplete:"off",...g=n4({store:e,...g})}}),iB=nd(function(e){return nh("input",iC(e))});function iS(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var ix=Symbol("composite-hover"),iE=nm(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...a}){let n=nA();aU(e=e||n,!1);let i=((0,o.useEffect)(()=>{ni||(a2("mousemove",nu,!0),a2("mousedown",nc,!0),a2("mouseup",nc,!0),a2("keydown",nc,!0),a2("scroll",nc,!0),ni=!0)},[]),a6(()=>no)),s=a.onMouseMove,l=nr(t),u=a6(t=>{if((null==s||s(t),!t.defaultPrevented&&i())&&l(t)){if(!nP(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!nR(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=a.onMouseLeave,d=nr(r),f=a6(t=>{var r;let a;null==c||c(t),!t.defaultPrevented&&i()&&((a=iS(t))&&aB(t.currentTarget,a)||function(e){let t=iS(e);if(!t)return!1;do{if(aj(t,ix)&&t[ix])return!0;t=t.parentElement}while(t)return!1}(t)||!l(t)||d(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),h=(0,o.useCallback)(e=>{e&&(e[ix]=!0)},[]);return aV(a={...a,ref:a4(h,a.ref),onMouseMove:u,onMouseLeave:f})});nf(nd(function(e){return nh("div",iE(e))}));var iM=nm(function({store:e,shouldRegisterItem:t=!0,getItem:r=aN,element:a,...n}){let i=nv();e=e||i;let s=a7(n.id),l=(0,o.useRef)(a);return(0,o.useEffect)(()=>{let a=l.current;if(!s||!a||!t)return;let n=r({id:s,element:a});return null==e?void 0:e.renderItem(n)},[s,t,r,e]),aV(n={...n,ref:a4(l,n.ref)})});function iD(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?ax(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(ax(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}nd(function(e){return nh("div",iM(e))});var iI=Symbol("command"),ik=nm(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...r}){let a,n,i=(0,o.useRef)(null),[s,l]=(0,o.useState)(!1);(0,o.useEffect)(()=>{i.current&&l(ax(i.current))},[]);let[u,c]=(0,o.useState)(!1),d=(0,o.useRef)(!1),f=aJ(r),[h,m]=(a=r.onLoadedMetadataCapture,n=(0,o.useMemo)(()=>Object.assign(()=>{},{...a,[iI]:!0}),[a,iI,!0]),[null==a?void 0:a[iI],{onLoadedMetadataCapture:n}]),p=r.onKeyDown,g=a6(r=>{null==p||p(r);let a=r.currentTarget;if(r.defaultPrevented||h||f||!aY(r)||aD(a)||a.isContentEditable)return;let n=e&&"Enter"===r.key,i=t&&" "===r.key,o="Enter"===r.key&&!e,s=" "===r.key&&!t;if(o||s)return void r.preventDefault();if(n||i){let e=iD(r);if(n){if(!e){r.preventDefault();let{view:e,...t}=r,n=()=>a$(a,t);aA&&/firefox\//i.test(navigator.userAgent)?a1(a,"keyup",n):queueMicrotask(n)}}else i&&(d.current=!0,e||(r.preventDefault(),c(!0)))}}),v=r.onKeyUp,y=a6(e=>{if(null==v||v(e),e.defaultPrevented||h||f||e.metaKey)return;let r=t&&" "===e.key;if(d.current&&r&&(d.current=!1,!iD(e))){e.preventDefault(),c(!1);let t=e.currentTarget,{view:r,...a}=e;queueMicrotask(()=>a$(t,a))}});return nK(r={"data-active":u||void 0,type:s?"button":void 0,...m,...r,ref:a4(i,r.ref),onKeyDown:g,onKeyUp:y})});nd(function(e){return nh("button",ik(e))});var{useSyncExternalStore:iw}=e.i(2239).default,iT=()=>()=>{};function iR(e,t=aN){let r=o.useCallback(t=>e?im(e,null,t):iT(),[e]),a=()=>{let r="string"==typeof t?t:null,a="function"==typeof t?t:null,n=null==e?void 0:e.getState();return a?a(n):n&&r&&aj(n,r)?n[r]:void 0};return iw(r,a,a)}function iP(e,t){let r=o.useRef({}),a=o.useCallback(t=>e?im(e,null,t):iT(),[e]),n=()=>{let a=null==e?void 0:e.getState(),n=!1,i=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(a);t!==i[e]&&(i[e]=t,n=!0)}if("string"==typeof r){if(!a||!aj(a,r))continue;let t=a[r];t!==i[e]&&(i[e]=t,n=!0)}}return n&&(r.current={...i}),r.current};return iw(a,n,n)}function iG(e,t,r,a){var n;let i,s=aj(t,r)?t[r]:void 0,l=(n={value:s,setValue:a?t[a]:void 0},i=(0,o.useRef)(n),a8(()=>{i.current=n}),i);a8(()=>ip(e,[r],(e,t)=>{let{value:a,setValue:n}=l.current;n&&e[r]!==t[r]&&e[r]!==a&&n(e[r])}),[e,r]),a8(()=>{if(void 0!==s)return e.setState(r,s),ig(e,[r],()=>{void 0!==s&&e.setState(r,s)})})}function i_(e,t){let[r,a]=o.useState(()=>e(t));a8(()=>ih(r),[r]);let n=o.useCallback(e=>iR(r,e),[r]);return[o.useMemo(()=>({...r,useState:n}),[r,n]),a6(()=>{a(r=>e({...t,...r.getState()}))})]}function iL(e,t,r,a=!1){var n;let i,o;if(!t||!r)return;let{renderedItems:s}=t.getState(),l=aT(e);if(!l)return;let u=function(e,t=!1){let r=e.clientHeight,{top:a}=e.getBoundingClientRect(),n=1.5*Math.max(.875*r,r-40),i=t?r-n+a:n+a;return"HTML"===e.tagName?i+e.scrollTop:i}(l,a);for(let e=0;e=0){void 0!==o&&ot||(e&&(null==m?void 0:m.baseElement)&&m.baseElement===e.baseElement?m.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===f,ariaSetSize:e=>null!=l?l:e&&(null==m?void 0:m.ariaSetSize)&&m.baseElement===e.baseElement?m.ariaSetSize:void 0,ariaPosInSet(e){if(null!=u)return u;if(!e||!(null==m?void 0:m.ariaPosInSet)||m.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===g);return m.ariaPosInSet+t.findIndex(e=>e.id===f)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(i)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===f}}),C=(0,o.useCallback)(e=>{var t;let r={...e,id:f||e.id,rowId:g,disabled:!!p,children:null==(t=e.element)?void 0:t.textContent};return s?s(r):r},[f,g,p,s]),B=c.onFocus,S=(0,o.useRef)(!1),x=a6(t=>{var r,a;if(null==B||B(t),t.defaultPrevented||aX(t)||!f||!e||(r=e,!aY(t)&&a_(r,t.target)))return;let{virtualFocus:n,baseElement:i}=e.getState();e.setActiveId(f),aI(t.currentTarget)&&function(e,t=!1){if(aD(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=aF(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!n||!aY(t)||!aI(a=t.currentTarget)&&("INPUT"!==a.tagName||ax(a))&&(null==i?void 0:i.isConnected)&&((aW()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),S.current=!0,t.relatedTarget===i||a_(e,t.relatedTarget))?(i[aG]=!0,i.focus({preventScroll:!0})):i.focus())}),E=c.onBlurCapture,M=a6(t=>{if(null==E||E(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&S.current&&(S.current=!1,t.preventDefault(),t.stopPropagation())}),D=c.onKeyDown,I=nr(r),k=nr(a),w=a6(t=>{if(null==D||D(t),t.defaultPrevented||!aY(t)||!e)return;let{currentTarget:r}=t,a=e.getState(),n=e.item(f),i=!!(null==n?void 0:n.rowId),o="horizontal"!==a.orientation,s="vertical"!==a.orientation,l=()=>!(!i&&!s&&a.baseElement&&aD(a.baseElement)),u={ArrowUp:(i||o)&&e.up,ArrowRight:(i||s)&&e.next,ArrowDown:(i||o)&&e.down,ArrowLeft:(i||s)&&e.previous,Home:()=>{if(l())return!i||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(l())return!i||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>iL(r,e,null==e?void 0:e.up,!0),PageDown:()=>iL(r,e,null==e?void 0:e.down)}[t.key];if(u){if(aI(r)){let e=ak(r),a=s&&"ArrowLeft"===t.key,n=s&&"ArrowRight"===t.key,i=o&&"ArrowUp"===t.key,l=o&&"ArrowDown"===t.key;if(n||l){let{length:t}=function(e){if(aD(e))return e.value;if(e.isContentEditable){let t=aF(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((a||i)&&0!==e.start)return}let a=u();if(I(t)||void 0!==a){if(!k(t))return;t.preventDefault(),e.move(a)}}}),T=(0,o.useMemo)(()=>({id:f,baseElement:v}),[f,v]);return c={id:f,"data-active-item":y||void 0,...c=na(c,e=>(0,n.jsx)(nB.Provider,{value:T,children:e}),[T]),ref:a4(h,c.ref),tabIndex:b?c.tabIndex:-1,onFocus:x,onBlurCapture:M,onKeyDown:w},c=ik(c),aV({...c=iM({store:e,...c,getItem:C,shouldRegisterItem:!!f&&c.shouldRegisterItem}),"aria-setsize":A,"aria-posinset":F})});nf(nd(function(e){return nh("button",ij(e))}));var iO=nm(function({store:e,value:t,hideOnClick:r,setValueOnClick:a,selectValueOnClick:i=!0,resetValueOnSelect:s,focusOnHover:l=!1,moveOnKeyPress:u=!0,getItem:c,...d}){var f,h;let m=ir();aU(e=e||m,!1);let{resetValueOnSelectState:p,multiSelectable:g,selected:v}=iP(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),y=(0,o.useCallback)(e=>{let r={...e,value:t};return c?c(r):r},[t,c]);a=null!=a?a:!g,r=null!=r?r:null!=t&&!g;let A=d.onClick,F=nr(a),b=nr(i),C=nr(null!=(f=null!=s?s:p)?f:g),B=nr(r),S=a6(r=>{null==A||A(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=aQ();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let a=t.tagName.toLowerCase();return"a"===a||"button"===a&&"submit"===t.type||"input"===a&&"submit"===t.type}(r)&&(null!=t&&(b(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),F(r)&&(null==e||e.setValue(t))),B(r)&&(null==e||e.hide()))}),x=d.onKeyDown,E=a6(t=>{if(null==x||x(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||nR(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),aD(r)&&(null==e||e.setValue(r.value)))});g&&null!=v&&(d={"aria-selected":v,...d}),d=na(d,e=>(0,n.jsx)(is.Provider,{value:t,children:(0,n.jsx)(il.Provider,{value:null!=v&&v,children:e})}),[t,v]),d={role:null!=(h=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,o.useContext)(n7)])?h:"option",children:t,...d,onClick:S,onKeyDown:E};let M=nr(u);return d=ij({store:e,...d,getItem:y,moveOnKeyPress:t=>{if(!M(t))return!1;let r=new Event("combobox-item-move"),a=null==e?void 0:e.getState().baseElement;return null==a||a.dispatchEvent(r),!0}}),d=iE({store:e,focusOnHover:l,...d})}),iN=nf(nd(function(e){return nh("div",iO(e))})),iU=e.i(74080);function iH(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function iJ(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,a=Number.parseFloat(t||"0s")*r;return a>e?a:e},0)}function iV(e,t,r){return!r&&!1!==t&&(!e||!!t)}var iK=nm(function({store:e,alwaysVisible:t,...r}){let a=nY();aU(e=e||a,!1);let i=(0,o.useRef)(null),s=a7(r.id),[l,u]=(0,o.useState)(null),c=e.useState("open"),d=e.useState("mounted"),f=e.useState("animated"),h=e.useState("contentElement"),m=iR(e.disclosure,"contentElement");a8(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),a8(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),a8(()=>{if(f){var e;let t;return(null==h?void 0:h.isConnected)?(e=()=>{u(c?"enter":d?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void u(null)}},[f,h,c,d]),a8(()=>{if(!e||!f||!l||!h)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,iU.flushSync)(t);if("leave"===l&&c||"enter"===l&&!c)return;if("number"==typeof f)return iH(f,r);let{transitionDuration:a,animationDuration:n,transitionDelay:i,animationDelay:o}=getComputedStyle(h),{transitionDuration:s="0",animationDuration:u="0",transitionDelay:d="0",animationDelay:p="0"}=m?getComputedStyle(m):{},g=iJ(i,o,d,p)+iJ(a,n,s,u);if(!g){"enter"===l&&e.setState("animated",!1),t();return}return iH(Math.max(g-1e3/60,0),r)},[e,f,h,m,c,l]);let p=iV(d,(r=na(r,t=>(0,n.jsx)(n1,{value:e,children:t}),[e])).hidden,t),g=r.style,v=(0,o.useMemo)(()=>p?{...g,display:"none"}:g,[p,g]);return aV(r={id:s,"data-open":c||void 0,"data-enter":"enter"===l||void 0,"data-leave":"leave"===l||void 0,hidden:p,...r,ref:a4(s?e.setContentElement:null,i,r.ref),style:v})}),iz=nd(function(e){return nh("div",iK(e))});nd(function({unmountOnHide:e,...t}){let r=nY();return!1===iR(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,n.jsx)(iz,{...t})});var iq=nm(function({store:e,alwaysVisible:t,...r}){let a=ir(!0),i=it(),s=!!(e=e||i)&&e===a;aU(e,!1);let l=(0,o.useRef)(null),u=a7(r.id),c=e.useState("mounted"),d=iV(c,r.hidden,t),f=d?{...r.style,display:"none"}:r.style,h=e.useState(e=>Array.isArray(e.selectedValue)),m=function(e,t,r){let a=function(e){let[t]=(0,o.useState)(e);return t}(r),[n,i]=(0,o.useState)(a);return(0,o.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let n=()=>{let e=r.getAttribute(t);i(null==e?a:e)},o=new MutationObserver(n);return o.observe(r,{attributeFilter:[t]}),n(),()=>o.disconnect()},[e,t,a]),n}(l,"role",r.role),p="listbox"===m||"tree"===m||"grid"===m,[g,v]=(0,o.useState)(!1),y=e.useState("contentElement");a8(()=>{if(!c)return;let e=l.current;if(!e||y!==e)return;let t=()=>{v(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[c,y]),g||(r={role:"listbox","aria-multiselectable":p&&h||void 0,...r}),r=na(r,t=>(0,n.jsx)(io,{value:e,children:(0,n.jsx)(n7.Provider,{value:m,children:t})}),[e,m]);let A=!u||a&&s?null:e.setContentElement;return aV(r={id:u,hidden:d,...r,ref:a4(A,l,r.ref),style:f})}),iQ=nd(function(e){return nh("div",iq(e))}),iW=(0,o.createContext)(null),iX=nm(function(e){return{...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}}});nd(function(e){return nh("span",iX(e))});var iY=nm(function(e){return iX(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),iZ=nd(function(e){return nh("span",iY(e))});function i$(e){queueMicrotask(()=>{null==e||e.focus()})}var i0=nm(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:a,portal:i=!0,...s}){let l=(0,o.useRef)(null),u=a4(l,s.ref),c=(0,o.useContext)(iW),[d,f]=(0,o.useState)(null),[h,m]=(0,o.useState)(null),p=(0,o.useRef)(null),g=(0,o.useRef)(null),v=(0,o.useRef)(null),y=(0,o.useRef)(null);return a8(()=>{let e=l.current;if(!e||!i)return void f(null);let t=r?"function"==typeof r?r(e):r:aF(e).createElement("div");if(!t)return void f(null);let n=t.isConnected;if(n||(c||aF(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),az(a,t),!n)return()=>{t.remove(),az(a,null)}},[i,r,c,a]),a8(()=>{if(!i||!e||!t)return;let r=aF(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),m(r),()=>{r.remove(),m(null)}},[i,e,t]),(0,o.useEffect)(()=>{if(!d||!e)return;let t=0,r=e=>{if(!a0(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=d.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(d.hasAttribute("data-tabindex")&&t(d),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of nk(d,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return d.addEventListener("focusin",r,!0),d.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),d.removeEventListener("focusin",r,!0),d.removeEventListener("focusout",r,!0)}},[d,e]),s={...s=na(s,t=>{if(t=(0,n.jsx)(iW.Provider,{value:d||c,children:t}),!i)return t;if(!d)return(0,n.jsx)("span",{ref:u,id:s.id,style:{position:"fixed"},hidden:!0});t=(0,n.jsxs)(n.Fragment,{children:[e&&d&&(0,n.jsx)(iZ,{ref:g,"data-focus-trap":s.id,className:"__focus-trap-inner-before",onFocus:e=>{a0(e,d)?i$(nw()):i$(p.current)}}),t,e&&d&&(0,n.jsx)(iZ,{ref:v,"data-focus-trap":s.id,className:"__focus-trap-inner-after",onFocus:e=>{a0(e,d)?i$(nT()):i$(y.current)}})]}),d&&(t=(0,iU.createPortal)(t,d));let r=(0,n.jsxs)(n.Fragment,{children:[e&&d&&(0,n.jsx)(iZ,{ref:p,"data-focus-trap":s.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==y.current&&a0(e,d)?i$(g.current):i$(nT())}}),e&&(0,n.jsx)("span",{"aria-owns":null==d?void 0:d.id,style:{position:"fixed"}}),e&&d&&(0,n.jsx)(iZ,{ref:y,"data-focus-trap":s.id,className:"__focus-trap-outer-after",onFocus:e=>{if(a0(e,d))i$(v.current);else{let e=nw();if(e===g.current)return void requestAnimationFrame(()=>{var e;return null==(e=nw())?void 0:e.focus()});i$(e)}}})]});return h&&e&&(r=(0,iU.createPortal)(r,h)),(0,n.jsxs)(n.Fragment,{children:[r,t]})},[d,c,i,s.id,e,h]),ref:u}});nd(function(e){return nh("div",i0(e))});var i1=(0,o.createContext)(0);function i2({level:e,children:t}){let r=(0,o.useContext)(i1),a=Math.max(Math.min(e||r+1,6),1);return(0,n.jsx)(i1.Provider,{value:a,children:t})}var i3=nm(function({autoFocusOnShow:e=!0,...t}){return na(t,t=>(0,n.jsx)(nx.Provider,{value:e,children:t}),[e])});nd(function(e){return nh("div",i3(e))});var i9=new WeakMap;function i5(e,t,r){i9.has(e)||i9.set(e,new Map);let a=i9.get(e),n=a.get(t);if(!n)return a.set(t,r()),()=>{var e;null==(e=a.get(t))||e(),a.delete(t)};let i=r(),o=()=>{i(),n(),a.delete(t)};return a.set(t,o),()=>{a.get(t)===o&&(i(),a.set(t,n))}}function i8(e,t,r){return i5(e,t,()=>{let a=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==a?e.removeAttribute(t):e.setAttribute(t,a)}})}function i6(e,t,r){return i5(e,t,()=>{let a=t in e,n=e[t];return e[t]=r,()=>{a?e[t]=n:delete e[t]}})}function i4(e,t){return e?i5(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var i7=["SCRIPT","STYLE"];function oe(e){return`__ariakit-dialog-snapshot-${e}`}function ot(e,t,r,a){for(let n of t){if(!(null==n?void 0:n.isConnected))continue;let i=t.some(e=>!!e&&e!==n&&e.contains(n)),o=aF(n),s=n;for(;n.parentElement&&n!==o.body;){if(null==a||a(n.parentElement,s),!i)for(let a of n.parentElement.children)(function(e,t,r){return!i7.includes(t.tagName)&&!!function(e,t){let r=aF(t),a=oe(e);if(!r.body[a])return!0;for(;;){if(t===r.body)return!1;if(t[a])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&aB(t,e))})(e,a,t)&&r(a,s);n=n.parentElement}}}function or(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function oa(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function on(e,t=""){return aO(i6(e,oa("",!0),!0),i6(e,oa(t,!0),!0))}function oi(e,t){if(e[oa(t,!0)])return!0;let r=oa(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function oo(e,t){let r=[],a=t.map(e=>null==e?void 0:e.id);return ot(e,t,t=>{or(t,...a)||r.unshift(function(e,t=""){return aO(i6(e,oa(),!0),i6(e,oa(t),!0))}(t,e))},(t,a)=>{a.hasAttribute("data-dialog")&&a.id!==e||r.unshift(on(t,e))}),()=>{for(let e of r)e()}}function os({store:e,type:t,listener:r,capture:a,domReady:n}){let i=a6(r),s=iR(e,"open"),l=(0,o.useRef)(!1);a8(()=>{if(!s||!n)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{l.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,s,n]),(0,o.useEffect)(()=>{if(s)return a2(t,t=>{let{contentElement:r,disclosureElement:a}=e.getState(),n=t.target;!r||!n||!(!("HTML"===n.tagName||aB(aF(n).body,n))||aB(r,n)||function(e,t){if(!e)return!1;if(aB(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=aF(e).getElementById(r);if(t)return aB(e,t)}return!1}(a,n)||n.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!l.current||oi(n,r.id))&&(n&&n[nj]||i(t))},a)},[s,a])}function ol(e,t){return"function"==typeof e?e(t):!!e}var ou=(0,o.createContext)({});function oc(){return"inert"in HTMLElement.prototype}function od(e,t){if(!("style"in e))return aL;if(oc())return i6(e,"inert",!0);let r=nk(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&aB(t,e)))return aL;let r=i5(e,"focus",()=>(e.focus=aL,()=>{delete e.focus}));return aO(i8(e,"tabindex","-1"),r)});return aO(...r,i8(e,"aria-hidden","true"),i4(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function of(e={}){let t=iy(e.store,iv(e.disclosure,["contentElement","disclosureElement"]));iA(e,t);let r=null==t?void 0:t.getState(),a=aK(e.open,null==r?void 0:r.open,e.defaultOpen,!1),n=aK(e.animated,null==r?void 0:r.animated,!1),i=ic({open:a,animated:n,animating:!!n&&a,mounted:a,contentElement:aK(null==r?void 0:r.contentElement,null),disclosureElement:aK(null==r?void 0:r.disclosureElement,null)},t);return id(i,()=>ip(i,["animated","animating"],e=>{e.animated||i.setState("animating",!1)})),id(i,()=>im(i,["open"],()=>{i.getState().animated&&i.setState("animating",!0)})),id(i,()=>ip(i,["open","animating"],e=>{i.setState("mounted",e.open||e.animating)})),{...i,disclosure:e.disclosure,setOpen:e=>i.setState("open",e),show:()=>i.setState("open",!0),hide:()=>i.setState("open",!1),toggle:()=>i.setState("open",e=>!e),stopAnimation:()=>i.setState("animating",!1),setContentElement:e=>i.setState("contentElement",e),setDisclosureElement:e=>i.setState("disclosureElement",e)}}function oh(e,t,r){return ne(t,[r.store,r.disclosure]),iG(e,r,"open","setOpen"),iG(e,r,"mounted","setMounted"),iG(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}nm(function(e){return e});var om=nd(function(e){return nh("div",e)});function op({store:e,backdrop:t,alwaysVisible:r,hidden:a}){let i=(0,o.useRef)(null),s=function(e={}){let[t,r]=i_(of,e);return oh(t,r,e)}({disclosure:e}),l=iR(e,"contentElement");(0,o.useEffect)(()=>{let e=i.current;!e||l&&(e.style.zIndex=getComputedStyle(l).zIndex)},[l]),a8(()=>{let e=null==l?void 0:l.id;if(!e)return;let t=i.current;if(t)return on(t,e)},[l]);let u=iK({ref:i,store:s,role:"presentation","data-backdrop":(null==l?void 0:l.id)||"",alwaysVisible:r,hidden:null!=a?a:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,o.isValidElement)(t))return(0,n.jsx)(om,{...u,render:t});let c="boolean"!=typeof t?t:"div";return(0,n.jsx)(om,{...u,render:(0,n.jsx)(c,{})})}function og(e={}){return of(e)}Object.assign(om,["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"].reduce((e,t)=>(e[t]=nd(function(e){return nh(t,e)}),e),{}));var ov=aW();function oy(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?nM(r)?r:null:r:null}var oA=nm(function({store:e,open:t,onClose:r,focusable:a=!0,modal:i=!0,portal:s=!!i,backdrop:l=!!i,hideOnEscape:u=!0,hideOnInteractOutside:c=!0,getPersistentElements:d,preventBodyScroll:f=!!i,autoFocusOnShow:h=!0,autoFocusOnHide:m=!0,initialFocus:p,finalFocus:g,unmountOnHide:v,unstable_treeSnapshotKey:y,...A}){var F;let b,C,B,S=n$(),x=(0,o.useRef)(null),E=function(e={}){let[t,r]=i_(og,e);return oh(t,r,e)}({store:e||S,open:t,setOpen(e){if(e)return;let t=x.current;if(!t)return;let a=new Event("close",{bubbles:!1,cancelable:!0});r&&t.addEventListener("close",r,{once:!0}),t.dispatchEvent(a),a.defaultPrevented&&E.setOpen(!0)}}),{portalRef:M,domReady:D}=nn(s,A.portalRef),I=A.preserveTabOrder,k=iR(E,e=>I&&!i&&e.mounted),w=a7(A.id),T=iR(E,"open"),R=iR(E,"mounted"),P=iR(E,"contentElement"),G=iV(R,A.hidden,A.alwaysVisible);b=function({attribute:e,contentId:t,contentElement:r,enabled:a}){let[n,i]=nt(),s=(0,o.useCallback)(()=>{if(!a||!r)return!1;let{body:n}=aF(r),i=n.getAttribute(e);return!i||i===t},[n,a,r,e,t]);return(0,o.useEffect)(()=>{if(!a||!t||!r)return;let{body:n}=aF(r);if(s())return n.setAttribute(e,t),()=>n.removeAttribute(e);let o=new MutationObserver(()=>(0,iU.flushSync)(i));return o.observe(n,{attributeFilter:[e]}),()=>o.disconnect()},[n,a,t,r,s,e]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:P,contentId:w,enabled:f&&!G}),(0,o.useEffect)(()=>{var e,t;if(!b()||!P)return;let r=aF(P),a=ab(P),{documentElement:n,body:i}=r,o=n.style.getPropertyValue("--scrollbar-width"),s=o?Number.parseInt(o,10):a.innerWidth-n.clientWidth,l=Math.round(n.getBoundingClientRect().left)+n.scrollLeft?"paddingLeft":"paddingRight",u=aQ()&&!(aA&&navigator.platform.startsWith("Mac")&&!aq());return aO((e="--scrollbar-width",t=`${s}px`,n?i5(n,e,()=>{let r=n.style.getPropertyValue(e);return n.style.setProperty(e,t),()=>{r?n.style.setProperty(e,r):n.style.removeProperty(e)}}):()=>{}),u?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:o}=a,u=null!=(e=null==o?void 0:o.offsetLeft)?e:0,c=null!=(t=null==o?void 0:o.offsetTop)?t:0,d=i4(i,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(c))}px`,left:`${-(r-Math.floor(u))}px`,right:"0",[l]:`${s}px`});return()=>{d(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():i4(i,{overflow:"hidden",[l]:`${s}px`}))},[b,P]),F=iR(E,"open"),C=(0,o.useRef)(),(0,o.useEffect)(()=>{if(!F){C.current=null;return}return a2("mousedown",e=>{C.current=e.target},!0)},[F]),os({...B={store:E,domReady:D,capture:!0},type:"click",listener:e=>{let{contentElement:t}=E.getState(),r=C.current;r&&aM(r)&&oi(r,null==t?void 0:t.id)&&ol(c,e)&&E.hide()}}),os({...B,type:"focusin",listener:e=>{let{contentElement:t}=E.getState();!t||e.target===aF(t)||ol(c,e)&&E.hide()}}),os({...B,type:"contextmenu",listener:e=>{ol(c,e)&&E.hide()}});let{wrapElement:_,nestedDialogs:L}=function(e){let t=(0,o.useContext)(ou),[r,a]=(0,o.useState)([]),i=(0,o.useCallback)(e=>{var r;return a(t=>[...t,e]),aO(null==(r=t.add)?void 0:r.call(t,e),()=>{a(t=>t.filter(t=>t!==e))})},[t]);a8(()=>ip(e,["open","contentElement"],r=>{var a;if(r.open&&r.contentElement)return null==(a=t.add)?void 0:a.call(t,e)}),[e,t]);let s=(0,o.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,o.useCallback)(e=>(0,n.jsx)(ou.Provider,{value:s,children:e}),[s]),nestedDialogs:r}}(E);A=na(A,_,[_]),a8(()=>{if(!T)return;let e=x.current,t=aC(e,!0);!t||"BODY"===t.tagName||e&&aB(e,t)||E.setDisclosureElement(t)},[E,T]),ov&&(0,o.useEffect)(()=>{if(!R)return;let{disclosureElement:e}=E.getState();if(!e||!ax(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),a1(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||nG(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[E,R]),(0,o.useEffect)(()=>{if(!R||!D)return;let e=x.current;if(!e)return;let t=ab(e),r=t.visualViewport||t,a=()=>{var r,a;let n=null!=(a=null==(r=t.visualViewport)?void 0:r.height)?a:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${n}px`)};return a(),r.addEventListener("resize",a),()=>{r.removeEventListener("resize",a)}},[R,D]),(0,o.useEffect)(()=>{if(!i||!R||!D)return;let e=x.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=E.hide,(r=aF(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[E,i,R,D]),a8(()=>{if(!oc()||T||!R||!D)return;let e=x.current;if(e)return od(e)},[T,R,D]);let j=T&&D;a8(()=>{if(w&&j)return function(e,t){let{body:r}=aF(t[0]),a=[];return ot(e,t,t=>{a.push(i6(t,oe(e),!0))}),aO(i6(r,oe(e),!0),()=>{for(let e of a)e()})}(w,[x.current])},[w,j,y]);let O=a6(d);a8(()=>{if(!w||!j)return;let{disclosureElement:e}=E.getState(),t=[x.current,...O()||[],...L.map(e=>e.getState().contentElement)];if(i){let e,r;return aO(oo(w,t),(e=[],r=t.map(e=>null==e?void 0:e.id),ot(w,t,a=>{or(a,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(a,...r)&&e.unshift(od(a,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&aB(e,r))||e.unshift(i8(r,"role","none"))}),()=>{for(let t of e)t()}))}return oo(w,[e,...t])},[w,E,j,O,L,i,y]);let N=!!h,U=nr(h),[H,J]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(!T||!N||!D||!(null==P?void 0:P.isConnected))return;let e=oy(p,!0)||P.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[a]=nk(e,t,r);return a||null}(P,!0,s&&k)||P,t=nM(e);U(t?e:null)&&(J(!0),queueMicrotask(()=>{e.focus(),!ov||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[T,N,D,P,p,s,k,U]);let V=!!m,K=nr(m),[z,q]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(T)return q(!0),()=>q(!1)},[T]);let Q=(0,o.useCallback)((e,t=!0)=>{let r,{disclosureElement:a}=E.getState();if(!(!(r=aC())||e&&aB(e,r))&&nM(r))return;let n=oy(g)||a;if(null==n?void 0:n.id){let e=aF(n),t=`[aria-activedescendant="${n.id}"]`,r=e.querySelector(t);r&&(n=r)}if(n&&!nM(n)){let e=n.closest("[data-dialog]");if(null==e?void 0:e.id){let t=aF(e),r=`[aria-controls~="${e.id}"]`,a=t.querySelector(r);a&&(n=a)}}let i=n&&nM(n);!i&&t?requestAnimationFrame(()=>Q(e,!1)):!K(i?n:null)||i&&(null==n||n.focus({preventScroll:!0}))},[E,g,K]),W=(0,o.useRef)(!1);a8(()=>{if(T||!z||!V)return;let e=x.current;W.current=!0,Q(e)},[T,z,D,V,Q]),(0,o.useEffect)(()=>{if(!z||!V)return;let e=x.current;return()=>{if(W.current){W.current=!1;return}Q(e)}},[z,V,Q]);let X=nr(u);(0,o.useEffect)(()=>{if(D&&R)return a2("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=x.current;if(!t||oi(t))return;let r=e.target;if(!r)return;let{disclosureElement:a}=E.getState();!("BODY"===r.tagName||aB(t,r)||!a||aB(a,r))||X(e)&&E.hide()},!0)},[E,D,R,X]);let Y=(A=na(A,e=>(0,n.jsx)(i2,{level:i?1:void 0,children:e}),[i])).hidden,Z=A.alwaysVisible;A=na(A,e=>l?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(op,{store:E,backdrop:l,hidden:Y,alwaysVisible:Z}),e]}):e,[E,l,Y,Z]);let[$,ee]=(0,o.useState)(),[et,er]=(0,o.useState)();return A=i3({...A={id:w,"data-dialog":"",role:"dialog",tabIndex:a?-1:void 0,"aria-labelledby":$,"aria-describedby":et,...A=na(A,e=>(0,n.jsx)(n1,{value:E,children:(0,n.jsx)(n2.Provider,{value:ee,children:(0,n.jsx)(n3.Provider,{value:er,children:e})})}),[E]),ref:a4(x,A.ref)},autoFocusOnShow:H}),A=i0({portal:s,...A=nK({...A=iK({store:E,...A}),focusable:a}),portalRef:M,preserveTabOrder:k})});function oF(e,t=n$){return nd(function(r){let a=t();return iR(r.store||a,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,n.jsx)(e,{...r}):null})}oF(nd(function(e){return nh("div",oA(e))}),n$);let ob=Math.min,oC=Math.max,oB=Math.round,oS=Math.floor,ox=e=>({x:e,y:e}),oE={left:"right",right:"left",bottom:"top",top:"bottom"},oM={start:"end",end:"start"};function oD(e,t){return"function"==typeof e?e(t):e}function oI(e){return e.split("-")[0]}function ok(e){return e.split("-")[1]}function ow(e){return"x"===e?"y":"x"}function oT(e){return"y"===e?"height":"width"}let oR=new Set(["top","bottom"]);function oP(e){return oR.has(oI(e))?"y":"x"}function oG(e){return e.replace(/start|end/g,e=>oM[e])}let o_=["left","right"],oL=["right","left"],oj=["top","bottom"],oO=["bottom","top"];function oN(e){return e.replace(/left|right|bottom|top/g,e=>oE[e])}function oU(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function oH(e){let{x:t,y:r,width:a,height:n}=e;return{width:a,height:n,top:r,left:t,right:t+a,bottom:r+n,x:t,y:r}}function oJ(e,t,r){let a,{reference:n,floating:i}=e,o=oP(t),s=ow(oP(t)),l=oT(s),u=oI(t),c="y"===o,d=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,h=n[l]/2-i[l]/2;switch(u){case"top":a={x:d,y:n.y-i.height};break;case"bottom":a={x:d,y:n.y+n.height};break;case"right":a={x:n.x+n.width,y:f};break;case"left":a={x:n.x-i.width,y:f};break;default:a={x:n.x,y:n.y}}switch(ok(t)){case"start":a[s]-=h*(r&&c?-1:1);break;case"end":a[s]+=h*(r&&c?-1:1)}return a}let oV=async(e,t,r)=>{let{placement:a="bottom",strategy:n="absolute",middleware:i=[],platform:o}=r,s=i.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:n}),{x:c,y:d}=oJ(u,a,l),f=a,h={},m=0;for(let r=0;r{try{return e.matches(t)}catch(e){return!1}})}let o6=["transform","translate","scale","rotate","perspective"],o4=["transform","translate","scale","rotate","perspective","filter"],o7=["paint","layout","strict","content"];function se(e){let t=st(),r=o$(e)?sn(e):e;return o6.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||o4.some(e=>(r.willChange||"").includes(e))||o7.some(e=>(r.contain||"").includes(e))}function st(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let sr=new Set(["html","body","#document"]);function sa(e){return sr.has(oW(e))}function sn(e){return oX(e).getComputedStyle(e)}function si(e){return o$(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function so(e){if("html"===oW(e))return e;let t=e.assignedSlot||e.parentNode||o1(e)&&e.host||oY(e);return o1(t)?t.host:t}function ss(e,t,r){var a;void 0===t&&(t=[]),void 0===r&&(r=!0);let n=function e(t){let r=so(t);return sa(r)?t.ownerDocument?t.ownerDocument.body:t.body:o0(r)&&o3(r)?r:e(r)}(e),i=n===(null==(a=e.ownerDocument)?void 0:a.body),o=oX(n);if(i){let e=sl(o);return t.concat(o,o.visualViewport||[],o3(n)?n:[],e&&r?ss(e):[])}return t.concat(n,ss(n,[],r))}function sl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function su(e){let t=sn(e),r=parseFloat(t.width)||0,a=parseFloat(t.height)||0,n=o0(e),i=n?e.offsetWidth:r,o=n?e.offsetHeight:a,s=oB(r)!==i||oB(a)!==o;return s&&(r=i,a=o),{width:r,height:a,$:s}}function sc(e){return o$(e)?e:e.contextElement}function sd(e){let t=sc(e);if(!o0(t))return ox(1);let r=t.getBoundingClientRect(),{width:a,height:n,$:i}=su(t),o=(i?oB(r.width):r.width)/a,s=(i?oB(r.height):r.height)/n;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}let sf=ox(0);function sh(e){let t=oX(e);return st()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:sf}function sm(e,t,r,a){var n;void 0===t&&(t=!1),void 0===r&&(r=!1);let i=e.getBoundingClientRect(),o=sc(e),s=ox(1);t&&(a?o$(a)&&(s=sd(a)):s=sd(e));let l=(void 0===(n=r)&&(n=!1),a&&(!n||a===oX(o))&&n)?sh(o):ox(0),u=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){let e=oX(o),t=a&&o$(a)?oX(a):a,r=e,n=sl(r);for(;n&&a&&t!==r;){let e=sd(n),t=n.getBoundingClientRect(),a=sn(n),i=t.left+(n.clientLeft+parseFloat(a.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(a.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=i,c+=o,n=sl(r=oX(n))}}return oH({width:d,height:f,x:u,y:c})}function sp(e,t){let r=si(e).scrollLeft;return t?t.left+r:sm(oY(e)).left+r}function sg(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-sp(e,r),y:r.top+t.scrollTop}}let sv=new Set(["absolute","fixed"]);function sy(e,t,r){var a;let n;if("viewport"===t)n=function(e,t){let r=oX(e),a=oY(e),n=r.visualViewport,i=a.clientWidth,o=a.clientHeight,s=0,l=0;if(n){i=n.width,o=n.height;let e=st();(!e||e&&"fixed"===t)&&(s=n.offsetLeft,l=n.offsetTop)}let u=sp(a);if(u<=0){let e=a.ownerDocument,t=e.body,r=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(a.clientWidth-t.clientWidth-n);o<=25&&(i-=o)}else u<=25&&(i+=u);return{width:i,height:o,x:s,y:l}}(e,r);else if("document"===t){let t,r,i,o,s,l,u;a=oY(e),t=oY(a),r=si(a),i=a.ownerDocument.body,o=oC(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=oC(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),l=-r.scrollLeft+sp(a),u=-r.scrollTop,"rtl"===sn(i).direction&&(l+=oC(t.clientWidth,i.clientWidth)-o),n={width:o,height:s,x:l,y:u}}else if(o$(t)){let e,a,i,o,s,l;a=(e=sm(t,!0,"fixed"===r)).top+t.clientTop,i=e.left+t.clientLeft,o=o0(t)?sd(t):ox(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,n={width:s,height:l,x:i*o.x,y:a*o.y}}else{let r=sh(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return oH(n)}function sA(e){return"static"===sn(e).position}function sF(e,t){if(!o0(e)||"fixed"===sn(e).position)return null;if(t)return t(e);let r=e.offsetParent;return oY(e)===r&&(r=r.ownerDocument.body),r}function sb(e,t){var r;let a=oX(e);if(o8(e))return a;if(!o0(e)){let t=so(e);for(;t&&!sa(t);){if(o$(t)&&!sA(t))return t;t=so(t)}return a}let n=sF(e,t);for(;n&&(r=n,o9.has(oW(r)))&&sA(n);)n=sF(n,t);return n&&sa(n)&&sA(n)&&!se(n)?a:n||function(e){let t=so(e);for(;o0(t)&&!sa(t);){if(se(t))return t;if(o8(t))break;t=so(t)}return null}(e)||a}let sC=async function(e){let t=this.getOffsetParent||sb,r=this.getDimensions,a=await r(e.floating);return{reference:function(e,t,r){let a=o0(t),n=oY(t),i="fixed"===r,o=sm(e,!0,i,t),s={scrollLeft:0,scrollTop:0},l=ox(0);if(a||!a&&!i)if(("body"!==oW(t)||o3(n))&&(s=si(t)),a){let e=sm(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else n&&(l.x=sp(n));i&&!a&&n&&(l.x=sp(n));let u=!n||a||i?ox(0):sg(n,s);return{x:o.left+s.scrollLeft-l.x-u.x,y:o.top+s.scrollTop-l.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},sB={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:a,strategy:n}=e,i="fixed"===n,o=oY(a),s=!!t&&o8(t.floating);if(a===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},u=ox(1),c=ox(0),d=o0(a);if((d||!d&&!i)&&(("body"!==oW(a)||o3(o))&&(l=si(a)),o0(a))){let e=sm(a);u=sd(a),c.x=e.x+a.clientLeft,c.y=e.y+a.clientTop}let f=!o||d||i?ox(0):sg(o,l);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}},getDocumentElement:oY,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:a,strategy:n}=e,i=[..."clippingAncestors"===r?o8(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let a=ss(e,[],!1).filter(e=>o$(e)&&"body"!==oW(e)),n=null,i="fixed"===sn(e).position,o=i?so(e):e;for(;o$(o)&&!sa(o);){let t=sn(o),r=se(o);r||"fixed"!==t.position||(n=null),(i?!r&&!n:!r&&"static"===t.position&&!!n&&sv.has(n.position)||o3(o)&&!r&&function e(t,r){let a=so(t);return!(a===r||!o$(a)||sa(a))&&("fixed"===sn(a).position||e(a,r))}(e,o))?a=a.filter(e=>e!==o):n=t,o=so(o)}return t.set(e,a),a}(t,this._c):[].concat(r),a],o=i[0],s=i.reduce((e,r)=>{let a=sy(t,r,n);return e.top=oC(a.top,e.top),e.right=ob(a.right,e.right),e.bottom=ob(a.bottom,e.bottom),e.left=oC(a.left,e.left),e},sy(t,o,n));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:sb,getElementRects:sC,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=su(e);return{width:t,height:r}},getScale:sd,isElement:o$,isRTL:function(e){return"rtl"===sn(e).direction}};function sS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sx(e=0,t=0,r=0,a=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,a);let n={x:e,y:t,width:r,height:a,top:t,right:e+r,bottom:t+a,left:e};return{...n,toJSON:()=>n}}function sE(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function sM(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var sD=nm(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:a=!0,autoFocusOnShow:i=!0,wrapperProps:s,fixed:l=!1,flip:u=!0,shift:c=0,slide:d=!0,overlap:f=!1,sameWidth:h=!1,fitViewport:m=!1,gutter:p,arrowPadding:g=4,overflowPadding:v=8,getAnchorRect:y,updatePosition:A,...F}){let b=n5();aU(e=e||b,!1);let C=e.useState("arrowElement"),B=e.useState("anchorElement"),S=e.useState("disclosureElement"),x=e.useState("popoverElement"),E=e.useState("contentElement"),M=e.useState("placement"),D=e.useState("mounted"),I=e.useState("rendered"),k=(0,o.useRef)(null),[w,T]=(0,o.useState)(!1),{portalRef:R,domReady:P}=nn(r,F.portalRef),G=a6(y),_=a6(A),L=!!A;a8(()=>{if(!(null==x?void 0:x.isConnected))return;x.style.setProperty("--popover-overflow-padding",`${v}px`);let t={contextElement:B||void 0,getBoundingClientRect:()=>{let e=null==G?void 0:G(B);return e||!B?function(e){if(!e)return sx();let{x:t,y:r,width:a,height:n}=e;return sx(t,r,a,n)}(e):B.getBoundingClientRect()}},r=async()=>{var r,a,n,i,o;let s,y,A;if(!D)return;C||(k.current=k.current||document.createElement("div"));let F=C||k.current,b=[(r={gutter:p,shift:c},void 0===(a=({placement:e})=>{var t;let a=((null==F?void 0:F.clientHeight)||0)/2,n="number"==typeof r.gutter?r.gutter+a:null!=(t=r.gutter)?t:a;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:n,alignmentAxis:r.shift}})&&(a=0),{name:"offset",options:a,async fn(e){var t,r;let{x:n,y:i,placement:o,middlewareData:s}=e,l=await oq(e,a);return o===(null==(t=s.offset)?void 0:t.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:n+l.x,y:i+l.y,data:{...l,placement:o}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return aU(!r||r.every(sE),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,a,n,i,o,s,l,u;let c,d,f,{placement:h,middlewareData:m,rects:p,initialPlacement:g,platform:v,elements:y}=e,{mainAxis:A=!0,crossAxis:F=!0,fallbackPlacements:b,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:B="none",flipAlignment:S=!0,...x}=oD(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let E=oI(h),M=oP(g),D=oI(g)===g,I=await (null==v.isRTL?void 0:v.isRTL(y.floating)),k=b||(D||!S?[oN(g)]:(c=oN(g),[oG(g),c,oG(c)])),w="none"!==B;!b&&w&&k.push(...(d=ok(g),f=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?oL:o_;return t?o_:oL;case"left":case"right":return t?oj:oO;default:return[]}}(oI(g),"start"===B,I),d&&(f=f.map(e=>e+"-"+d),S&&(f=f.concat(f.map(oG)))),f));let T=[g,...k],R=await oK(e,x),P=[],G=(null==(a=m.flip)?void 0:a.overflows)||[];if(A&&P.push(R[E]),F){let e,t,r,a,n=(s=h,l=p,void 0===(u=I)&&(u=!1),e=ok(s),r=oT(t=ow(oP(s))),a="x"===t?e===(u?"end":"start")?"right":"left":"start"===e?"bottom":"top",l.reference[r]>l.floating[r]&&(a=oN(a)),[a,oN(a)]);P.push(R[n[0]],R[n[1]])}if(G=[...G,{placement:h,overflows:P}],!P.every(e=>e<=0)){let e=((null==(n=m.flip)?void 0:n.index)||0)+1,t=T[e];if(t&&("alignment"!==F||M===oP(t)||G.every(e=>oP(e.placement)!==M||e.overflows[0]>0)))return{data:{index:e,overflows:G},reset:{placement:t}};let r=null==(i=G.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!r)switch(C){case"bestFit":{let e=null==(o=G.filter(e=>{if(w){let t=oP(e.placement);return t===M||"y"===t}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])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=g}if(h!==r)return{reset:{placement:r}}}return{}}}}({flip:u,overflowPadding:v}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:a,placement:n,rects:i,middlewareData:o}=e,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=oD(t,e),c={x:r,y:a},d=oP(n),f=ow(d),h=c[f],m=c[d],p=oD(s,e),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){let e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,r=i.reference[f]+i.reference[e]-g.mainAxis;hr&&(h=r)}if(u){var v,y;let e="y"===f?"width":"height",t=oz.has(oI(n)),r=i.reference[d]-i.floating[e]+(t&&(null==(v=o.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),a=i.reference[d]+i.reference[e]+(t?0:(null==(y=o.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);ma&&(m=a)}return{[f]:h,[d]:m}}})},async fn(e){let{x:t,y:a,placement:n}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=oD(r,e),u={x:t,y:a},c=await oK(e,l),d=oP(oI(n)),f=ow(d),h=u[f],m=u[d];if(i){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=h+c[e],a=h-c[t];h=oC(r,ob(h,a))}if(o){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+c[e],a=m-c[t];m=oC(r,ob(m,a))}let p=s.fn({...e,[f]:h,[d]:m});return{...p,data:{x:p.x-t,y:p.y-a,enabled:{[f]:i,[d]:o}}}}}}}({slide:d,shift:c,overlap:f,overflowPadding:v}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:a,placement:n,rects:i,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=oD(r,e)||{};if(null==u)return{};let d=oU(c),f={x:t,y:a},h=ow(oP(n)),m=oT(h),p=await o.getDimensions(u),g="y"===h,v=g?"clientHeight":"clientWidth",y=i.reference[m]+i.reference[h]-f[h]-i.floating[m],A=f[h]-i.reference[h],F=await (null==o.getOffsetParent?void 0:o.getOffsetParent(u)),b=F?F[v]:0;b&&await (null==o.isElement?void 0:o.isElement(F))||(b=s.floating[v]||i.floating[m]);let C=b/2-p[m]/2-1,B=ob(d[g?"top":"left"],C),S=ob(d[g?"bottom":"right"],C),x=b-p[m]-S,E=b/2-p[m]/2+(y/2-A/2),M=oC(B,ob(E,x)),D=!l.arrow&&null!=ok(n)&&E!==M&&i.reference[m]/2-(E{},...d}=oD(i,e),f=await oK(e,d),h=oI(o),m=ok(o),p="y"===oP(o),{width:g,height:v}=s.floating;"top"===h||"bottom"===h?(a=h,n=m===(await (null==l.isRTL?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(n=h,a="end"===m?"top":"bottom");let y=v-f.top-f.bottom,A=g-f.left-f.right,F=ob(v-f[a],y),b=ob(g-f[n],A),C=!e.middlewareData.shift,B=F,S=b;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(S=A),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(B=y),C&&!m){let e=oC(f.left,0),t=oC(f.right,0),r=oC(f.top,0),a=oC(f.bottom,0);p?S=g-2*(0!==e||0!==t?e+t:oC(f.left,f.right)):B=v-2*(0!==r||0!==a?r+a:oC(f.top,f.bottom))}await c({...e,availableWidth:S,availableHeight:B});let x=await l.getDimensions(u.floating);return g!==x.width||v!==x.height?{reset:{rects:!0}}:{}}}],B=await (o={placement:M,strategy:l?"fixed":"absolute",middleware:b},s=new Map,A={...(y={platform:sB,...o}).platform,_c:s},oV(t,x,{...y,platform:A}));null==e||e.setState("currentPlacement",B.placement),T(!0);let S=sM(B.x),E=sM(B.y);if(Object.assign(x.style,{top:"0",left:"0",transform:`translate3d(${S}px,${E}px,0)`}),F&&B.middlewareData.arrow){let{x:e,y:t}=B.middlewareData.arrow,r=B.placement.split("-")[0],a=F.clientWidth/2,n=F.clientHeight/2,i=null!=e?e+a:-a,o=null!=t?t+n:-n;x.style.setProperty("--popover-transform-origin",{top:`${i}px calc(100% + ${n}px)`,bottom:`${i}px ${-n}px`,left:`calc(100% + ${a}px) ${o}px`,right:`${-a}px ${o}px`}[r]),Object.assign(F.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},a=function(e,t,r,a){let n;void 0===a&&(a={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=a,c=sc(e),d=i||o?[...c?ss(c):[],...ss(t)]:[];d.forEach(e=>{i&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});let f=c&&l?function(e,t){let r,a=null,n=oY(e);function i(){var e;clearTimeout(r),null==(e=a)||e.disconnect(),a=null}return!function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(s||t(),!f||!h)return;let m={rootMargin:-oS(d)+"px "+-oS(n.clientWidth-(c+f))+"px "+-oS(n.clientHeight-(d+h))+"px "+-oS(c)+"px",threshold:oC(0,ob(1,l))||1},p=!0;function g(t){let a=t[0].intersectionRatio;if(a!==l){if(!p)return o();a?o(!1,a):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==a||sS(u,e.getBoundingClientRect())||o(),p=!1}try{a=new IntersectionObserver(g,{...m,root:n.ownerDocument})}catch(e){a=new IntersectionObserver(g,m)}a.observe(e)}(!0),i}(c,r):null,h=-1,m=null;s&&(m=new ResizeObserver(e=>{let[a]=e;a&&a.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!u&&m.observe(c),m.observe(t));let p=u?sm(e):null;return u&&function t(){let a=sm(e);p&&!sS(p,a)&&r(),p=a,n=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,u&&cancelAnimationFrame(n)}}(t,x,async()=>{L?(await _({updatePosition:r}),T(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{T(!1),a()}},[e,I,x,C,B,x,M,D,P,l,u,c,d,f,h,m,p,g,v,G,L,_]),a8(()=>{if(!D||!P||!(null==x?void 0:x.isConnected)||!(null==E?void 0:E.isConnected))return;let e=()=>{x.style.zIndex=getComputedStyle(E).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[D,P,x,E]);let j=l?"fixed":"absolute";return F=na(F,t=>(0,n.jsx)("div",{...s,style:{position:j,top:0,left:0,width:"max-content",...null==s?void 0:s.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,j,s]),F={"data-placing":!w||void 0,...F=na(F,t=>(0,n.jsx)(n6,{value:e,children:t}),[e]),style:{position:"relative",...F.style}},F=oA({store:e,modal:t,portal:r,preserveTabOrder:a,preserveTabOrderAnchor:S||B,autoFocusOnShow:w&&i,...F,portalRef:R})});oF(nd(function(e){return nh("div",sD(e))}),n5);var sI=nm(function({store:e,modal:t,tabIndex:r,alwaysVisible:a,autoFocusOnHide:n=!0,hideOnInteractOutside:i=!0,...s}){let l=ia();aU(e=e||l,!1);let u=e.useState("baseElement"),c=(0,o.useRef)(!1),d=iR(e.tag,e=>null==e?void 0:e.renderedItems.length);return s=iq({store:e,alwaysVisible:a,...s}),s=sD({store:e,modal:t,alwaysVisible:a,backdrop:!1,autoFocusOnShow:!1,finalFocus:u,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:d,...s,getPersistentElements(){var r;let a=(null==(r=s.getPersistentElements)?void 0:r.call(s))||[];if(!t||!e)return a;let{contentElement:n,baseElement:i}=e.getState();if(!i)return a;let o=aF(i),l=[];if((null==n?void 0:n.id)&&l.push(`[aria-controls~="${n.id}"]`),(null==i?void 0:i.id)&&l.push(`[aria-controls~="${i.id}"]`),!l.length)return[...a,i];let u=l.join(",");return[...a,...o.querySelectorAll(u)]},autoFocusOnHide:e=>!aH(n,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,a;let n=null==e?void 0:e.getState(),o=null==(r=null==n?void 0:n.contentElement)?void 0:r.id,s=null==(a=null==n?void 0:n.baseElement)?void 0:a.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,s))return!1;let l="function"==typeof i?i(t):i;return l&&(c.current="click"===t.type),l}})}),sk=oF(nd(function(e){return nh("div",sI(e))}),ia);(0,o.createContext)(null),(0,o.createContext)(null);var sw=np([nb],[nC]),sT=sw.useContext;sw.useScopedContext,sw.useProviderContext,sw.ContextProvider,sw.ScopedContextProvider;var sR={id:null};function sP(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function sG(e,t){return e.filter(e=>e.rowId===t)}function s_(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function sL(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var sj=aW()&&aq();function sO({tag:e,...t}={}){let r=iy(t.store,function(e,...t){if(e)return iu(e,"pick")(...t)}(e,["value","rtl"]));iA(t,r);let a=null==e?void 0:e.getState(),n=null==r?void 0:r.getState(),i=aK(t.activeId,null==n?void 0:n.activeId,t.defaultActiveId,null),o=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),a=function(e={}){var t,r;iA(e,e.store);let a=null==(t=e.store)?void 0:t.getState(),n=aK(e.items,null==a?void 0:a.items,e.defaultItems,[]),i=new Map(n.map(e=>[e.id,e])),o={items:n,renderedItems:aK(null==a?void 0:a.renderedItems,[])},s=null==(r=e.store)?void 0:r.__unstablePrivateStore,l=ic({items:n,renderedItems:o.renderedItems},s),u=ic(o,e.store),c=e=>{var t;let r,a,n=(t=e=>e.element,r=e.map((e,t)=>[t,e]),a=!1,(r.sort(([e,r],[n,i])=>{var o;let s=t(r),l=t(i);return s!==l&&s&&l?(o=s,l.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING)?(e>n&&(a=!0),-1):(et):e);l.setState("renderedItems",n),u.setState("renderedItems",n)};id(u,()=>ih(l)),id(l,()=>ig(l,["items"],e=>{u.setState("items",e.items)})),id(l,()=>ig(l,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=u.getState();e.renderedItems!==t&&c(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let a=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>c(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),a=[...e].reverse().find(e=>!!e.element),n=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;n&&(null==a?void 0:a.element);){let e=n;if(a&&e.contains(a.element))return n;n=n.parentElement}return aF(n).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&a.observe(t.element);return()=>{cancelAnimationFrame(r),a.disconnect()}}));let d=(e,t,r=!1)=>{let a;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),n=t.slice();if(-1!==r){let o={...a=t[r],...e};n[r]=o,i.set(e.id,o)}else n.push(e),i.set(e.id,e);return n}),()=>{t(t=>{if(!a)return r&&i.delete(e.id),t.filter(({id:t})=>t!==e.id);let n=t.findIndex(({id:t})=>t===e.id);if(-1===n)return t;let o=t.slice();return o[n]=a,i.set(e.id,a),o})}},f=e=>d(e,e=>l.setState("items",e),!0);return{...u,registerItem:f,renderItem:e=>aO(f(e),d(e,e=>l.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=i.get(e);if(!t){let{items:r}=l.getState();(t=r.find(t=>t.id===e))&&i.set(e,t)}return t||null},__unstablePrivateStore:l}}(e),n=aK(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),i=ic({...a.getState(),id:aK(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:n,baseElement:aK(null==r?void 0:r.baseElement,null),includesBaseElement:aK(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===n),moves:aK(null==r?void 0:r.moves,0),orientation:aK(e.orientation,null==r?void 0:r.orientation,"both"),rtl:aK(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:aK(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:aK(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:aK(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:aK(e.focusShift,null==r?void 0:r.focusShift,!1)},a,e.store);id(i,()=>ip(i,["renderedItems","activeId"],e=>{i.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=sP(e.renderedItems))?void 0:r.id})}));let o=(e="next",t={})=>{var r,a;let n=i.getState(),{skip:o=0,activeId:s=n.activeId,focusShift:l=n.focusShift,focusLoop:u=n.focusLoop,focusWrap:c=n.focusWrap,includesBaseElement:d=n.includesBaseElement,renderedItems:f=n.renderedItems,rtl:h=n.rtl}=t,m="up"===e||"down"===e,p="next"===e||"down"===e,g=m?nz(function(e,t,r){let a=sL(e);for(let n of e)for(let e=0;ee.id===s);if(!v)return null==(a=sP(g))?void 0:a.id;let y=g.some(e=>e.rowId),A=g.indexOf(v),F=g.slice(A+1),b=sG(F,v.rowId);if(o){let e=b.filter(e=>s?!e.disabled&&e.id!==s:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let C=u&&(m?"horizontal"!==u:"vertical"!==u),B=y&&c&&(m?"horizontal"!==c:"vertical"!==c),S=p?(!y||m)&&C&&d:!!m&&d;if(C){let e=sP(function(e,t,r=!1){let a=e.findIndex(e=>e.id===t);return[...e.slice(a+1),...r?[sR]:[],...e.slice(0,a)]}(B&&!S?g:sG(g,v.rowId),s,S),s);return null==e?void 0:e.id}if(B){let e=sP(S?b:F,s);return S?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let x=sP(b,s);return!x&&S?null:null==x?void 0:x.id};return{...a,...i,setBaseElement:e=>i.setState("baseElement",e),setActiveId:e=>i.setState("activeId",e),move:e=>{void 0!==e&&(i.setState("activeId",e),i.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=sP(i.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=sP(nq(i.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),o("up",e))}}({...t,activeId:i,includesBaseElement:aK(t.includesBaseElement,null==n?void 0:n.includesBaseElement,!0),orientation:aK(t.orientation,null==n?void 0:n.orientation,"vertical"),focusLoop:aK(t.focusLoop,null==n?void 0:n.focusLoop,!0),focusWrap:aK(t.focusWrap,null==n?void 0:n.focusWrap,!0),virtualFocus:aK(t.virtualFocus,null==n?void 0:n.virtualFocus,!0)}),s=function({popover:e,...t}={}){let r=iy(t.store,iv(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));iA(t,r);let a=null==r?void 0:r.getState(),n=og({...t,store:r}),i=aK(t.placement,null==a?void 0:a.placement,"bottom"),o=ic({...n.getState(),placement:i,currentPlacement:i,anchorElement:aK(null==a?void 0:a.anchorElement,null),popoverElement:aK(null==a?void 0:a.popoverElement,null),arrowElement:aK(null==a?void 0:a.arrowElement,null),rendered:Symbol("rendered")},n,r);return{...n,...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"))}}({...t,placement:aK(t.placement,null==n?void 0:n.placement,"bottom-start")}),l=aK(t.value,null==n?void 0:n.value,t.defaultValue,""),u=aK(t.selectedValue,null==n?void 0:n.selectedValue,null==a?void 0:a.values,t.defaultSelectedValue,""),c=Array.isArray(u),d={...o.getState(),...s.getState(),value:l,selectedValue:u,resetValueOnSelect:aK(t.resetValueOnSelect,null==n?void 0:n.resetValueOnSelect,c),resetValueOnHide:aK(t.resetValueOnHide,null==n?void 0:n.resetValueOnHide,c&&!e),activeValue:null==n?void 0:n.activeValue},f=ic(d,o,s,r);return sj&&id(f,()=>ip(f,["virtualFocus"],()=>{f.setState("virtualFocus",!1)})),id(f,()=>{if(e)return aO(ip(f,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),ip(e,["values"],e=>{f.setState("selectedValue",e.values)}))}),id(f,()=>ip(f,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||f.setState("value",l)})),id(f,()=>ip(f,["open"],e=>{e.open||(f.setState("activeId",i),f.setState("moves",0))})),id(f,()=>ip(f,["moves","activeId"],(e,t)=>{e.moves===t.moves&&f.setState("activeValue",void 0)})),id(f,()=>ig(f,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=f.getState(),a=o.item(r);f.setState("activeValue",null==a?void 0:a.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 sN(e={}){var t,r,a,n,i,o,s,l;let u;t=e,u=sT();let[c,d]=i_(sO,e={id:a7((r=t={...t,tag:void 0!==t.tag?t.tag:u}).id),...r});return ne(d,[(a=e).tag]),iG(c,a,"value","setValue"),iG(c,a,"selectedValue","setSelectedValue"),iG(c,a,"resetValueOnHide"),iG(c,a,"resetValueOnSelect"),Object.assign((o=c,ne(s=d,[(l=a).popover]),iG(o,l,"placement"),n=oh(o,s,l),i=n,ne(d,[a.store]),iG(i,a,"items","setItems"),iG(n=i,a,"activeId","setActiveId"),iG(n,a,"includesBaseElement"),iG(n,a,"virtualFocus"),iG(n,a,"orientation"),iG(n,a,"rtl"),iG(n,a,"focusLoop"),iG(n,a,"focusWrap"),iG(n,a,"focusShift"),n),{tag:a.tag})}function sU(e={}){let t=sN(e);return(0,n.jsx)(ii,{value:t,children:e.children})}var sH=(0,o.createContext)(void 0),sJ=nm(function(e){let[t,r]=(0,o.useState)();return aV(e={role:"group","aria-labelledby":t,...e=na(e,e=>(0,n.jsx)(sH.Provider,{value:r,children:e}),[])})});nd(function(e){return nh("div",sJ(e))});var sV=nm(function({store:e,...t}){return sJ(t)});nd(function(e){return nh("div",sV(e))});var sK=nm(function({store:e,...t}){let r=ir();return aU(e=e||r,!1),"grid"===aw(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=sV({store:e,...t})}),sz=nd(function(e){return nh("div",sK(e))}),sq=nm(function(e){let t=(0,o.useContext)(sH),r=a7(e.id);return a8(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),aV(e={id:r,"aria-hidden":!0,...e})});nd(function(e){return nh("div",sq(e))});var sQ=nm(function({store:e,...t}){return sq(t)});nd(function(e){return nh("div",sQ(e))});var sW=nm(function(e){return sQ(e)}),sX=nd(function(e){return nh("div",sW(e))}),sY=e.i(38360);let sZ={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},s$=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function s0(e,t,r={}){let{keys:a,threshold:n=sZ.MATCHES,baseSort:i=s$,sorter:o=e=>e.sort((e,t)=>(function(e,t,r){let{rank:a,keyIndex:n}=e,{rank:i,keyIndex:o}=t;return a!==i?a>i?-1:1:n===o?r(e,t):n{let s=s1(n,u,c),l=t,{minRanking:d,maxRanking:f,threshold:h}=i;return s=sZ.MATCHES?s=d:s>f&&(s=f),s>e&&(e=s,r=o,a=h,l=n),{rankedValue:l,rank:e,keyIndex:r,keyThreshold:a}},{rankedValue:s,rank:sZ.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:s,rank:s1(s,u,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:f,keyThreshold:h=n}=d;return f>=h&&e.push({...d,item:i,index:o}),e},[])).map(({item:e})=>e)}function s1(e,t,r){if(e=s2(e,r),(t=s2(t,r)).length>e.length)return sZ.NO_MATCH;if(e===t)return sZ.CASE_SENSITIVE_EQUAL;let a=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),n=a.next(),i=n.value;if(e.length===t.length&&0===i)return sZ.EQUAL;if(0===i)return sZ.STARTS_WITH;let o=n;for(;!o.done;){if(o.value>0&&" "===e[o.value-1])return sZ.WORD_STARTS_WITH;o=a.next()}return i>0?sZ.CONTAINS:1===t.length?sZ.NO_MATCH:(function(e){let t="",r=" ";for(let a=0;a-1))return sZ.NO_MATCH;return r=i-s,a=n/t.length,sZ.MATCHES+1/r*a}(e,t)}function s2(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,sY.default)(e)),e}s0.rankings=sZ;let s3={maxRanking:1/0,minRanking:-1/0};var s9=e.i(29402),s5=e.i(97442);let s8=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),s6={"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)"},s4={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},s7=(0,ri.getMissionList)().filter(e=>!s8.has(e)).map(e=>{let t,r=(0,ri.getMissionInfo)(e),[a]=(0,ri.getSourceAndPath)(r.resourcePath),n=(t=a.match(/^(.*)(\/[^/]+)$/))?t[1]:"",i=s6[a]??s4[n]??null;return{resourcePath:r.resourcePath,missionName:e,displayName:r.displayName,sourcePath:a,groupName:i,missionTypes:r.missionTypes}}),le=new Map(s7.map(e=>[e.missionName,e])),lt=function(e){let t=new Map;for(let r of e){let e=t.get(r.groupName)??[];e.push(r),t.set(r.groupName,e)}return t.forEach((e,r)=>{t.set(r,(0,s9.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,s9.default)(Array.from(t.entries()),[([e])=>"Official"===e?0:null==e?2:1,([e])=>e?e.toLowerCase():""],["asc","asc"])}(s7),lr="undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function la(e){let t,r,a,o,s,l=(0,i.c)(12),{mission:u}=e,c=u.displayName||u.missionName;return l[0]!==c?(t=(0,n.jsx)("span",{className:s5.default.ItemName,children:c}),l[0]=c,l[1]=t):t=l[1],l[2]!==u.missionTypes?(r=u.missionTypes.length>0&&(0,n.jsx)("span",{className:s5.default.ItemTypes,children:u.missionTypes.map(ln)}),l[2]=u.missionTypes,l[3]=r):r=l[3],l[4]!==t||l[5]!==r?(a=(0,n.jsxs)("span",{className:s5.default.ItemHeader,children:[t,r]}),l[4]=t,l[5]=r,l[6]=a):a=l[6],l[7]!==u.missionName?(o=(0,n.jsx)("span",{className:s5.default.ItemMissionName,children:u.missionName}),l[7]=u.missionName,l[8]=o):o=l[8],l[9]!==a||l[10]!==o?(s=(0,n.jsxs)(n.Fragment,{children:[a,o]}),l[9]=a,l[10]=o,l[11]=s):s=l[11],s}function ln(e){return(0,n.jsx)("span",{className:s5.default.ItemType,"data-mission-type":e,children:e},e)}function li(e){let t,r,a,s,l,u,c,d,f,h,m,p,g,v,y,A,F,b=(0,i.c)(46),{value:C,missionType:B,onChange:S,disabled:x}=e,[E,M]=(0,o.useState)(""),D=(0,o.useRef)(null),I=(0,o.useRef)(B);b[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{(0,o.startTransition)(()=>M(e))},b[0]=t):t=b[0];let k=sN({resetValueOnHide:!0,selectedValue:C,setSelectedValue:e=>{if(e){let t=I.current,r=(0,ri.getMissionInfo)(e).missionTypes;t&&r.includes(t)||(t=r[0]),S({missionName:e,missionType:t}),D.current?.blur()}},setValue:t});b[1]!==k?(r=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),D.current?.focus(),k.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},a=[k],b[1]=k,b[2]=r,b[3]=a):(r=b[2],a=b[3]),(0,o.useEffect)(r,a),b[4]!==C?(s=le.get(C),b[4]=C,b[5]=s):s=b[5];let w=s;e:{let e,t;if(!E){let e;b[6]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:lt},b[6]=e):e=b[6],l=e;break e}b[7]!==E?(e=s0(s7,E,{keys:["displayName","missionName","missionTypes","groupName"]}),b[7]=E,b[8]=e):e=b[8];let r=e;b[9]!==r?(t={type:"flat",missions:r},b[9]=r,b[10]=t):t=b[10],l=t}let T=l,R=w?w.displayName||w.missionName:C,P="flat"===T.type?0===T.missions.length:0===T.groups.length,G=e=>(0,n.jsx)(iN,{value:e.missionName,className:s5.default.Item,focusOnHover:!0,onClick:t=>{if(t.target&&t.target instanceof HTMLElement){let r=t.target.dataset.missionType;r?(I.current=r,e.missionName===C&&S({missionName:e.missionName,missionType:r})):I.current=null}else I.current=null},children:(0,n.jsx)(la,{mission:e})},e.missionName);b[11]!==k?(u=()=>{try{document.exitPointerLock()}catch{}k.show()},c=e=>{"Escape"!==e.key||k.getState().open||D.current?.blur()},b[11]=k,b[12]=u,b[13]=c):(u=b[12],c=b[13]),b[14]!==x||b[15]!==R||b[16]!==u||b[17]!==c?(d=(0,n.jsx)(iB,{ref:D,autoSelect:!0,disabled:x,placeholder:R,className:s5.default.Input,onFocus:u,onKeyDown:c}),b[14]=x,b[15]=R,b[16]=u,b[17]=c,b[18]=d):d=b[18],b[19]!==R?(f=(0,n.jsx)("span",{className:s5.default.SelectedName,children:R}),b[19]=R,b[20]=f):f=b[20],b[21]!==B?(h=B&&(0,n.jsx)("span",{className:s5.default.ItemType,"data-mission-type":B,children:B}),b[21]=B,b[22]=h):h=b[22],b[23]!==h||b[24]!==f?(m=(0,n.jsxs)("div",{className:s5.default.SelectedValue,children:[f,h]}),b[23]=h,b[24]=f,b[25]=m):m=b[25],b[26]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)("kbd",{className:s5.default.Shortcut,children:lr?"⌘K":"^K"}),b[26]=p):p=b[26],b[27]!==m||b[28]!==d?(g=(0,n.jsxs)("div",{className:s5.default.InputWrapper,children:[d,m,p]}),b[27]=m,b[28]=d,b[29]=g):g=b[29];let _=s5.default,L=s5.default,j="flat"===T.type?T.missions.map(G):T.groups.map(e=>{let[t,r]=e;return t?(0,n.jsxs)(sz,{className:s5.default.Group,children:[(0,n.jsx)(sX,{className:s5.default.GroupLabel,children:t}),r.map(G)]},t):(0,n.jsx)(o.Fragment,{children:r.map(G)},"ungrouped")});return b[30]!==P?(v=P&&(0,n.jsx)("div",{className:s5.default.NoResults,children:"No missions found"}),b[30]=P,b[31]=v):v=b[31],b[32]!==iQ||b[33]!==L.List||b[34]!==j||b[35]!==v?(y=(0,n.jsxs)(iQ,{className:L.List,children:[j,v]}),b[32]=iQ,b[33]=L.List,b[34]=j,b[35]=v,b[36]=y):y=b[36],b[37]!==sk||b[38]!==_.Popover||b[39]!==y?(A=(0,n.jsx)(sk,{gutter:4,fitViewport:!0,autoFocusOnHide:!1,className:_.Popover,children:y}),b[37]=sk,b[38]=_.Popover,b[39]=y,b[40]=A):A=b[40],b[41]!==sU||b[42]!==k||b[43]!==g||b[44]!==A?(F=(0,n.jsxs)(sU,{store:k,children:[g,A]}),b[41]=sU,b[42]=k,b[43]=g,b[44]=A,b[45]=F):F=b[45],F}var lo=e.i(11152),ls=e.i(40141);function ll(e){return(0,ls.GenIcon)({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)}var lu=e.i(36679);function lc(e){let t,r,a,s,l,u=(0,i.c)(11),{cameraRef:c,missionName:d,missionType:f}=e,{fogEnabled:h}=(0,E.useSettings)(),[m,p]=(0,o.useState)(!1),g=(0,o.useRef)(null);u[0]!==c||u[1]!==h||u[2]!==d||u[3]!==f?(t=async()=>{clearTimeout(g.current);let e=c.current;if(!e)return;let t=function({position:e,quaternion:t}){let r=e=>parseFloat(e.toFixed(3)),a=`${r(e.x)},${r(e.y)},${r(e.z)}`,n=`${r(t.x)},${r(t.y)},${r(t.z)},${r(t.w)}`;return`#c${a}~${n}`}(e),r=new URLSearchParams;r.set("mission",`${d}~${f}`),r.set("fog",h.toString());let a=`${window.location.pathname}?${r}${t}`,n=`${window.location.origin}${a}`;window.history.replaceState(null,"",a);try{await navigator.clipboard.writeText(n),p(!0),g.current=setTimeout(()=>{p(!1)},1100)}catch(e){console.error(e)}},u[0]=c,u[1]=h,u[2]=d,u[3]=f,u[4]=t):t=u[4];let v=t,y=m?"true":"false";return u[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,n.jsx)(lo.FaMapPin,{className:lu.default.MapPin}),a=(0,n.jsx)(ll,{className:lu.default.ClipboardCheck}),s=(0,n.jsx)("span",{className:lu.default.ButtonLabel,children:" Copy coordinates URL"}),u[5]=r,u[6]=a,u[7]=s):(r=u[5],a=u[6],s=u[7]),u[8]!==v||u[9]!==y?(l=(0,n.jsxs)("button",{type:"button",className:lu.default.Root,"aria-label":"Copy coordinates URL",title:"Copy coordinates URL",onClick:v,"data-copied":y,id:"copyCoordinatesButton",children:[r,a,s]}),u[8]=v,u[9]=y,u[10]=l):l=u[10],l}function ld(e){return(0,ls.GenIcon)({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)}var lf={},lh=function(e,t,r,a,n){var i=new Worker(lf[t]||(lf[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(e){var t=e.data,r=t.$e$;if(r){var a=Error(r[0]);a.code=r[1],a.stack=r[2],n(a,null)}else n(null,t)},i.postMessage(r,a),i},lm=Uint8Array,lp=Uint16Array,lg=Int32Array,lv=new lm([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ly=new lm([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),lA=new lm([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lF=function(e,t){for(var r=new lp(31),a=0;a<31;++a)r[a]=t+=1<>1|(21845&lD)<<1;lI=(61680&(lI=(52428&lI)>>2|(13107&lI)<<2))>>4|(3855&lI)<<4,lM[lD]=((65280&lI)>>8|(255&lI)<<8)>>1}for(var lk=function(e,t,r){for(var a,n=e.length,i=0,o=new lp(t);i>l]=u}else for(i=0,a=new lp(n);i>15-e[i]);return a},lw=new lm(288),lD=0;lD<144;++lD)lw[lD]=8;for(var lD=144;lD<256;++lD)lw[lD]=9;for(var lD=256;lD<280;++lD)lw[lD]=7;for(var lD=280;lD<288;++lD)lw[lD]=8;for(var lT=new lm(32),lD=0;lD<32;++lD)lT[lD]=5;var lR=lk(lw,9,0),lP=lk(lw,9,1),lG=lk(lT,5,0),l_=lk(lT,5,1),lL=function(e){for(var t=e[0],r=1;rt&&(t=e[r]);return t},lj=function(e,t,r){var a=t/8|0;return(e[a]|e[a+1]<<8)>>(7&t)&r},lO=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},lN=function(e){return(e+7)/8|0},lU=function(e,t,r){return(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length),new lm(e.subarray(t,r))},lH=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],lJ=function(e,t,r){var a=Error(t||lH[e]);if(a.code=e,Error.captureStackTrace&&Error.captureStackTrace(a,lJ),!r)throw a;return a},lV=function(e,t,r,a){var n=e.length,i=a?a.length:0;if(!n||t.f&&!t.l)return r||new lm(0);var o=!r,s=o||2!=t.i,l=t.i;o&&(r=new lm(3*n));var u=function(e){var t=r.length;if(e>t){var a=new lm(Math.max(2*t,e));a.set(r),r=a}},c=t.f||0,d=t.p||0,f=t.b||0,h=t.l,m=t.d,p=t.m,g=t.n,v=8*n;do{if(!h){c=lj(e,d,1);var y=lj(e,d+1,3);if(d+=3,y)if(1==y)h=lP,m=l_,p=9,g=5;else if(2==y){var A=lj(e,d,31)+257,F=lj(e,d+10,15)+4,b=A+lj(e,d+5,31)+1;d+=14;for(var C=new lm(b),B=new lm(19),S=0;S>4;if(I<16)C[S++]=I;else{var k=0,w=0;for(16==I?(w=3+lj(e,d,3),d+=2,k=C[S-1]):17==I?(w=3+lj(e,d,7),d+=3):18==I&&(w=11+lj(e,d,127),d+=7);w--;)C[S++]=k}}var T=C.subarray(0,A),R=C.subarray(A);p=lL(T),g=lL(R),h=lk(T,p,1),m=lk(R,g,1)}else lJ(1);else{var I=lN(d)+4,P=e[I-4]|e[I-3]<<8,G=I+P;if(G>n){l&&lJ(0);break}s&&u(f+P),r.set(e.subarray(I,G),f),t.b=f+=P,t.p=d=8*G,t.f=c;continue}if(d>v){l&&lJ(0);break}}s&&u(f+131072);for(var _=(1<>4;if((d+=15&k)>v){l&&lJ(0);break}if(k||lJ(2),O<256)r[f++]=O;else if(256==O){j=d,h=null;break}else{var N=O-254;if(O>264){var S=O-257,U=lv[S];N=lj(e,d,(1<>4;H||lJ(3),d+=15&H;var R=lx[J];if(J>3){var U=ly[J];R+=lO(e,d)&(1<v){l&&lJ(0);break}s&&u(f+131072);var V=f+N;if(f>8},lz=function(e,t,r){r<<=7&t;var a=t/8|0;e[a]|=r,e[a+1]|=r>>8,e[a+2]|=r>>16},lq=function(e,t){for(var r=[],a=0;af&&(f=i[a].s);var h=new lp(f+1),m=lQ(r[c-1],h,0);if(m>t){var a=0,p=0,g=m-t,v=1<t)p+=v-(1<>=g;p>0;){var A=i[a].s;h[A]=0&&p;--a){var F=i[a].s;h[F]==t&&(--h[F],++p)}m=t}return{t:new lm(h),l:m}},lQ=function(e,t,r){return -1==e.s?Math.max(lQ(e.l,t,r+1),lQ(e.r,t,r+1)):t[e.s]=r},lW=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new lp(++t),a=0,n=e[0],i=1,o=function(e){r[a++]=e},s=1;s<=t;++s)if(e[s]==n&&s!=t)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=e[s]}return{c:r.subarray(0,a),n:t}},lX=function(e,t){for(var r=0,a=0;a>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var i=0;i4&&!k[lA[T-1]];--T);var R=u+5<<3,P=lX(n,lw)+lX(i,lT)+o,G=lX(n,g)+lX(i,A)+o+14+3*T+lX(M,k)+2*M[16]+3*M[17]+7*M[18];if(l>=0&&R<=P&&R<=G)return lY(t,c,e.subarray(l,l+u));if(lK(t,c,1+(G15&&(lK(t,c,O[D]>>5&127),c+=O[D]>>12)}}else d=lR,f=lw,h=lG,m=lT;for(var D=0;D255){var N=U>>18&31;lz(t,c,d[N+257]),c+=f[N+257],N>7&&(lK(t,c,U>>23&31),c+=lv[N]);var H=31&U;lz(t,c,h[H]),c+=m[H],H>3&&(lz(t,c,U>>5&8191),c+=ly[H])}else lz(t,c,d[U]),c+=f[U]}return lz(t,c,d[256]),c+f[256]},l$=new lg([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),l0=new lm(0),l1=function(e,t,r,a,n,i){var o=i.z||e.length,s=new lm(a+o+5*(1+Math.ceil(o/7e3))+n),l=s.subarray(a,s.length-n),u=i.l,c=7&(i.r||0);if(t){c&&(l[0]=i.r>>3);for(var d=l$[t-1],f=d>>13,h=8191&d,m=(1<7e3||E>24576)&&(T>423||!u)){c=lZ(e,l,0,F,b,C,S,E,D,x-D,c),E=B=S=0,D=x;for(var R=0;R<286;++R)b[R]=0;for(var R=0;R<30;++R)C[R]=0}var P=2,G=0,_=h,L=k-w&32767;if(T>2&&I==A(x-L))for(var j=Math.min(f,T)-1,O=Math.min(32767,x),N=Math.min(258,T);L<=O&&--_&&k!=w;){if(e[x+P]==e[x+P-L]){for(var U=0;UP){if(P=U,G=L,U>j)break;for(var H=Math.min(L,U-2),J=0,R=0;RJ&&(J=z,w=V)}}}w=p[k=w],L+=k-w&32767}if(G){F[E++]=0x10000000|lB[P]<<18|lE[G];var q=31&lB[P],Q=31&lE[G];S+=lv[q]+ly[Q],++b[257+q],++C[Q],M=x+P,++B}else F[E++]=e[x],++b[e[x]]}}for(x=Math.max(x,M);x=o&&(l[c/8|0]=u,W=o),c=lY(l,c+1,e.subarray(x,W))}i.i=o}return lU(s,0,a+lN(c)+n)},l2=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,a=9;--a;)r=(1&r&&-0x12477ce0)^r>>>1;e[t]=r}return e}(),l3=function(){var e=-1;return{p:function(t){for(var r=e,a=0;a>>8;e=r},d:function(){return~e}}},l9=function(){var e=1,t=0;return{p:function(r){for(var a=e,n=t,i=0|r.length,o=0;o!=i;){for(var s=Math.min(o+2655,i);o>16),n=(65535&n)+15*(n>>16)}e=a,t=n},d:function(){return e%=65521,t%=65521,(255&e)<<24|(65280&e)<<8|(255&t)<<8|t>>8}}},l5=function(e,t,r,a,n){if(!n&&(n={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),o=new lm(i.length+e.length);o.set(i),o.set(e,i.length),e=o,n.w=i.length}return l1(e,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,r,a,n)},l8=function(e,t){var r={};for(var a in e)r[a]=e[a];for(var a in t)r[a]=t[a];return r},l6=function(e,t,r){for(var a=e(),n=e.toString(),i=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o>>0},uf=function(e,t){return ud(e,t)+0x100000000*ud(e,t+4)},uh=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},um=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&uh(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var a=0;a<=r.length;++a)e[a+10]=r.charCodeAt(a)}},up=function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&lJ(6,"invalid gzip data");var t=e[3],r=10;4&t&&(r+=(e[10]|e[11]<<8)+2);for(var a=(t>>3&1)+(t>>4&1);a>0;a-=!e[r++]);return r+(2&t)},ug=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},uv=function(e){return 10+(e.filename?e.filename.length+1:0)},uy=function(e,t){var r=t.level;if(e[0]=120,e[1]=(0==r?0:r<6?1:9==r?3:2)<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var a=l9();a.p(t.dictionary),uh(e,2,a.d())}},uA=function(e,t){return((15&e[0])!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&lJ(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&lJ(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function uF(e,t){return"function"==typeof e&&(t=e,e={}),this.ondata=t,e}var ub=function(){function e(e,t){if("function"==typeof e&&(t=e,e={}),this.ondata=t,this.o=e||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new lm(98304),this.o.dictionary){var r=this.o.dictionary.subarray(-32768);this.b.set(r,32768-r.length),this.s.i=32768-r.length}}return e.prototype.p=function(e,t){this.ondata(l5(e,this.o,0,0,this.s),t)},e.prototype.push=function(e,t){this.ondata||lJ(5),this.s.l&&lJ(4);var r=e.length+this.s.z;if(r>this.b.length){if(r>2*this.b.length-32768){var a=new lm(-32768&r);a.set(this.b.subarray(0,this.s.z)),this.b=a}var n=this.b.length-this.s.z;this.b.set(e.subarray(0,n),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(e.subarray(n),32768),this.s.z=e.length-n+32768,this.s.i=32766,this.s.w=32768}else this.b.set(e,this.s.z),this.s.z+=e.length;this.s.l=1&t,(this.s.z>this.s.w+8191||t)&&(this.p(this.b,t||!1),this.s.w=this.s.i,this.s.i-=2)},e.prototype.flush=function(){this.ondata||lJ(5),this.s.l&&lJ(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},e}(),uC=function(e,t){uu([ur,function(){return[ul,ub]}],this,uF.call(this,e,t),function(e){onmessage=ul(new ub(e.data))},6,1)};function uB(e,t){return l5(e,t||{},0,0)}var uS=function(){function e(e,t){"function"==typeof e&&(t=e,e={}),this.ondata=t;var r=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:r?r.length:0},this.o=new lm(32768),this.p=new lm(0),r&&this.o.set(r)}return e.prototype.e=function(e){if(this.ondata||lJ(5),this.d&&lJ(4),this.p.length){if(e.length){var t=new lm(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}}else this.p=e},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,r=lV(this.p,this.s,this.o);this.ondata(lU(r,t,this.s.b),this.d),this.o=lU(r,this.s.b-32768),this.s.b=this.o.length,this.p=lU(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),ux=function(e,t){uu([ut,function(){return[ul,uS]}],this,uF.call(this,e,t),function(e){onmessage=ul(new uS(e.data))},7,0)};function uE(e,t){return lV(e,{i:2},t&&t.out,t&&t.dictionary)}(function(){function e(e,t){this.c=l3(),this.l=0,this.v=1,ub.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),this.l+=e.length,ub.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var r=l5(e,this.o,this.v&&uv(this.o),t&&8,this.s);this.v&&(um(r,this.o),this.v=0),t&&(uh(r,r.length-8,this.c.d()),uh(r,r.length-4,this.l)),this.ondata(r,t)},e.prototype.flush=function(){ub.prototype.flush.call(this)}})();var uM=function(){function e(e,t){this.v=1,this.r=0,uS.call(this,e,t)}return e.prototype.push=function(e,t){if(uS.prototype.e.call(this,e),this.r+=e.length,this.v){var r=this.p.subarray(this.v-1),a=r.length>3?up(r):4;if(a>r.length){if(!t)return}else this.v>1&&this.onmember&&this.onmember(this.r-r.length);this.p=r.subarray(a),this.v=0}uS.prototype.c.call(this,t),!this.s.f||this.s.l||t||(this.v=lN(this.s.p)+9,this.s={i:0},this.o=new lm(0),this.push(new lm(0),t))},e}(),uD=function(e,t){var r=this;uu([ut,ua,function(){return[ul,uS,uM]}],this,uF.call(this,e,t),function(e){var t=new uM(e.data);t.onmember=function(e){return postMessage(e)},onmessage=ul(t)},9,0,function(e){return r.onmember&&r.onmember(e)})},uI=(function(){function e(e,t){this.c=l9(),this.v=1,ub.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),ub.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var r=l5(e,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(uy(r,this.o),this.v=0),t&&uh(r,r.length-4,this.c.d()),this.ondata(r,t)},e.prototype.flush=function(){ub.prototype.flush.call(this)}}(),function(){function e(e,t){uS.call(this,e,t),this.v=e&&e.dictionary?2:1}return e.prototype.push=function(e,t){if(uS.prototype.e.call(this,e),this.v){if(this.p.length<6&&!t)return;this.p=this.p.subarray(uA(this.p,this.v-1)),this.v=0}t&&(this.p.length<4&&lJ(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),uS.prototype.c.call(this,t)},e}()),uk=function(e,t){uu([ut,un,function(){return[ul,uS,uI]}],this,uF.call(this,e,t),function(e){onmessage=ul(new uI(e.data))},11,0)},uw=function(){function e(e,t){this.o=uF.call(this,e,t)||{},this.G=uM,this.I=uS,this.Z=uI}return e.prototype.i=function(){var e=this;this.s.ondata=function(t,r){e.ondata(t,r)}},e.prototype.push=function(e,t){if(this.ondata||lJ(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var r=new lm(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length)}else this.p=e;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,t),this.p=null)}},e}();function uT(e,t){uw.call(this,e,t),this.queuedSize=0,this.G=uD,this.I=ux,this.Z=uk}uT.prototype.i=function(){var e=this;this.s.ondata=function(t,r,a){e.ondata(t,r,a)},this.s.ondrain=function(t){e.queuedSize-=t,e.ondrain&&e.ondrain(t)}},uT.prototype.push=function(e,t){this.queuedSize+=e.length,uw.prototype.push.call(this,e,t)};var uR="undefined"!=typeof TextEncoder&&new TextEncoder,uP="undefined"!=typeof TextDecoder&&new TextDecoder,uG=0;try{uP.decode(l0,{stream:!0}),uG=1}catch(e){}var u_=function(e){for(var t="",r=0;;){var a=e[r++],n=(a>127)+(a>223)+(a>239);if(r+n>e.length)return{s:t,r:lU(e,r-1)};n?3==n?t+=String.fromCharCode(55296|(a=((15&a)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536)>>10,56320|1023&a):1&n?t+=String.fromCharCode((31&a)<<6|63&e[r++]):t+=String.fromCharCode((15&a)<<12|(63&e[r++])<<6|63&e[r++]):t+=String.fromCharCode(a)}};function uL(e,t){if(t){for(var r=new lm(e.length),a=0;a>1)),o=0,s=function(e){i[o++]=e},a=0;ai.length){var l=new lm(o+8+(n-a<<1));l.set(i),i=l}var u=e.charCodeAt(a);u<128||t?s(u):(u<2048?s(192|u>>6):(u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>18),s(128|u>>12&63)):s(224|u>>12),s(128|u>>6&63)),s(128|63&u))}return lU(i,0,o)}(function(e){this.ondata=e,uG?this.t=new TextDecoder:this.p=l0}).prototype.push=function(e,t){if(this.ondata||lJ(5),t=!!t,this.t){this.ondata(this.t.decode(e,{stream:!0}),t),t&&(this.t.decode().length&&lJ(8),this.t=null);return}this.p||lJ(4);var r=new lm(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length);var a=u_(r),n=a.s,i=a.r;t?(i.length&&lJ(8),this.p=null):this.p=i,this.ondata(n,t)},(function(e){this.ondata=e}).prototype.push=function(e,t){this.ondata||lJ(5),this.d&&lJ(4),this.ondata(uL(e),this.d=t||!1)};var uj=function(e){return 1==e?3:e<6?2:+(9==e)},uO=function(e,t){for(;1!=uc(e,t);t+=4+uc(e,t+2));return[uf(e,t+12),uf(e,t+4),uf(e,t+20)]},uN=function(e){var t=0;if(e)for(var r in e){var a=e[r].length;a>65535&&lJ(9),t+=a+4}return t},uU=function(e,t,r,a,n,i,o,s){var l=a.length,u=r.extra,c=s&&s.length,d=uN(u);uh(e,t,null!=o?0x2014b50:0x4034b50),t+=4,null!=o&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(i<0&&8),e[t++]=n&&8,e[t++]=255&r.compression,e[t++]=r.compression>>8;var f=new Date(null==r.mtime?Date.now():r.mtime),h=f.getFullYear()-1980;if((h<0||h>119)&&lJ(10),uh(e,t,h<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,-1!=i&&(uh(e,t,r.crc),uh(e,t+4,i<0?-i-2:i),uh(e,t+8,r.size)),uh(e,t+12,l),uh(e,t+14,d),t+=16,null!=o&&(uh(e,t,c),uh(e,t+6,r.attrs),uh(e,t+10,o),t+=14),e.set(a,t),t+=l,d)for(var m in u){var p=u[m],g=p.length;uh(e,t,+m),uh(e,t+2,g),e.set(p,t+4),t+=4+g}return c&&(e.set(s,t),t+=c),t},uH=function(e,t,r,a,n){uh(e,t,0x6054b50),uh(e,t+8,r),uh(e,t+10,r),uh(e,t+12,a),uh(e,t+16,n)},uJ=function(){function e(e){this.filename=e,this.c=l3(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||lJ(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}();function uV(e,t){var r=this;t||(t={}),uJ.call(this,e),this.d=new ub(t,function(e,t){r.ondata(null,e,t)}),this.compression=8,this.flag=uj(t.level)}function uK(e,t){var r=this;t||(t={}),uJ.call(this,e),this.d=new uC(t,function(e,t,a){r.ondata(e,t,a)}),this.compression=8,this.flag=uj(t.level),this.terminate=this.d.terminate}function uz(e){this.ondata=e,this.u=[],this.d=1}uV.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},uV.prototype.push=function(e,t){uJ.prototype.push.call(this,e,t)},uK.prototype.process=function(e,t){this.d.push(e,t)},uK.prototype.push=function(e,t){uJ.prototype.push.call(this,e,t)},uz.prototype.add=function(e){var t=this;if(this.ondata||lJ(5),2&this.d)this.ondata(lJ(4+(1&this.d)*8,0,1),null,!1);else{var r=uL(e.filename),a=r.length,n=e.comment,i=n&&uL(n),o=a!=e.filename.length||i&&n.length!=i.length,s=a+uN(e.extra)+30;a>65535&&this.ondata(lJ(11,0,1),null,!1);var l=new lm(s);uU(l,0,e,r,o,-1);var u=[l],c=function(){for(var e=0,r=u;e0){var a=Math.min(this.c,e.length),n=e.subarray(0,a);if(this.c-=a,this.d?this.d.push(n,!this.c):this.k[0].push(n),(e=e.subarray(a)).length)return this.push(e,t)}else{var i=0,o=0,s=void 0,l=void 0;this.p.length?e.length?((l=new lm(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var u=l.length,c=this.c,d=c&&this.d,f=this;oo+30+d+h){var m,p,g=[];f.k.unshift(g),i=2;var v=ud(l,o+18),y=ud(l,o+22),A=function(e,t){if(t){for(var r="",a=0;a=0&&(F.size=v,F.originalSize=y),f.onfile(F)}return"break"}if(c){if(0x8074b50==e)return s=o+=12+(-2==c&&8),i=3,f.c=0,"break";else if(0x2014b50==e)return s=o-=4,i=3,f.c=0,"break"}}();++o);if(this.p=l0,c<0){var h=i?l.subarray(0,s-12-(-2==c&&8)-(0x8074b50==ud(l,s-16)&&4)):l.subarray(0,o);d?d.push(h,!!i):this.k[+(2==i)].push(h)}if(2&i)return this.push(l.subarray(o),t);this.p=l.subarray(o)}t&&(this.c&&lJ(13),this.p=null)},uX.prototype.register=function(e){this.o[e.compression]=e},"function"==typeof queueMicrotask&&queueMicrotask;var uY=e.i(48450);let uZ=[0,0,0,0,0,0,0,0,0,329,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2809,68,0,27,0,58,3,62,4,7,0,0,15,65,554,3,394,404,189,117,30,51,27,15,34,32,80,1,142,3,142,39,0,144,125,44,122,275,70,135,61,127,8,12,113,246,122,36,185,1,149,309,335,12,11,14,54,151,0,0,2,0,0,211,0,2090,344,736,993,2872,701,605,646,1552,328,305,1240,735,1533,1713,562,3,1775,1149,1469,979,407,553,59,279,31,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function u$(e){return e.node?e.node.pop:e.leaf.pop}let u0=new class{nodes=[];leaves=[];tablesBuilt=!1;buildTables(){if(this.tablesBuilt)return;this.tablesBuilt=!0,this.leaves=[];for(let t=0;t<256;t++){var e;this.leaves.push({pop:uZ[t]+ +((e=t)>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)+1,symbol:t,numBits:0,code:0})}this.nodes=[{pop:0,index0:0,index1:0}];let t=256,r=[];for(let e=0;e<256;e++)r.push({node:null,leaf:this.leaves[e]});for(;1!==t;){let e=0xfffffffe,a=0xffffffff,n=-1,i=-1;for(let o=0;oi?n:i;r[s]={node:o,leaf:null},l!==t-1&&(r[l]=r[t-1]),t--}this.nodes[0]=r[0].node,this.generateCodes(0,0,0)}determineIndex(e){return null!==e.leaf?-(this.leaves.indexOf(e.leaf)+1):this.nodes.indexOf(e.node)}generateCodes(e,t,r){if(t<0){let a=this.leaves[-(t+1)];a.code=e,a.numBits=r}else{let a=this.nodes[t];this.generateCodes(e,a.index0,r+1),this.generateCodes(e|1<=0)t=e.readFlag()?this.nodes[t].index1:this.nodes[t].index0;else{r.push(this.leaves[-(t+1)].symbol);break}}return String.fromCharCode(...r)}{let t=e.readInt(8);return String.fromCharCode(...e.readBytes(t))}}};class u1{data;bitNum;maxReadBitNum;error;stringBuffer=null;constructor(e,t=0){this.data=e,this.bitNum=t,this.maxReadBitNum=e.length<<3,this.error=!1}getCurPos(){return this.bitNum}setCurPos(e){this.bitNum=e}getBytePosition(){return this.bitNum+7>>3}isError(){return this.error}isFull(){return this.bitNum>this.maxReadBitNum}getRemainingBits(){return this.maxReadBitNum-this.bitNum}getMaxPos(){return this.maxReadBitNum}readFlag(){if(this.bitNum>=this.maxReadBitNum)return this.error=!0,!1;let e=1<<(7&this.bitNum),t=(this.data[this.bitNum>>3]&e)!=0;return this.bitNum++,t}readInt(e){if(0===e)return 0;if(this.bitNum+e>this.maxReadBitNum)return this.error=!0,0;let t=this.bitNum>>3,r=7&this.bitNum;if(this.bitNum+=e,e+r<=32){let a=0,n=e+r+7>>3;for(let e=0;e>>=r,32===e)?a>>>0:a&(1<>3;for(let e=0;e>>0:a&(1<>3,r=new Uint8Array(t),a=this.bitNum>>3,n=7&this.bitNum,i=8-n;if(0===n)r.set(this.data.subarray(a,a+t));else{let e=this.data[a];for(let o=0;o>n|t<this.maxReadBitNum)return this.error=!0,0;let e=this.bitNum>>3,t=7&this.bitNum,r=u1.f32U8;if(0===t)r[0]=this.data[e],r[1]=this.data[e+1],r[2]=this.data[e+2],r[3]=this.data[e+3];else{let a=8-t;for(let n=0;n<4;n++){let i=this.data[e+n],o=e+n+1>t|o<>>0)}getCompressionPoint(){return this.compressionPoint}getConnectionContext(){let e=this.dataBlockDataMap;return{compressionPoint:this.compressionPoint,ghostTracker:this.ghostTracker,getDataBlockParser:e=>this.registry.getDataBlockParser(e),getDataBlockData:e?t=>e.get(t):void 0,getGhostParser:e=>this.registry.getGhostParser(e)}}setNextRecvEventSeq(e){this.nextRecvEventSeq=e>>>0}setConnectionProtocolState(e){for(this.lastSeqRecvdAtSend=e.lastSeqRecvdAtSend.slice(0,32);this.lastSeqRecvdAtSend.length<32;)this.lastSeqRecvdAtSend.push(0);this.lastSeqRecvd=e.lastSeqRecvd>>>0,this.highestAckedSeq=e.highestAckedSeq>>>0,this.lastSendSeq=e.lastSendSeq>>>0,this.recvAckMask=e.ackMask>>>0,this.connectSequence=e.connectSequence>>>0,this.lastRecvAckAck=e.lastRecvAckAck>>>0,this.connectionEstablished=e.connectionEstablished}onSendPacketTrigger(){this.lastSendSeq=this.lastSendSeq+1>>>0,this.lastSeqRecvdAtSend[31&this.lastSendSeq]=this.lastSeqRecvd>>>0}applyProtocolHeader(e){if(e.connectSeqBit!==(1&this.connectSequence)||e.ackByteCount>4||e.packetType>2)return{accepted:!1,dispatchData:!1};let t=(e.seqNumber|0xfffffe00&this.lastSeqRecvd)>>>0;if(t>>0),this.lastSeqRecvd+31>>0;if(r>>0),this.lastSendSeq>>0,0===e.packetType&&(this.recvAckMask=(1|this.recvAckMask)>>>0);for(let t=this.highestAckedSeq+1;t<=r;t++)(e.ackMask&1<<(r-t&31))!=0&&(this.lastRecvAckAck=this.lastSeqRecvdAtSend[31&t]>>>0);t-this.lastRecvAckAck>32&&(this.lastRecvAckAck=t-32),this.highestAckedSeq=r;let n=this.lastSeqRecvd!==t&&0===e.packetType;return this.lastSeqRecvd=t,{accepted:!0,dispatchData:n}}parsePacket(e){let t=new u1(e),r=this.readDnetHeader(t),a=this.applyProtocolHeader(r);if(this.packetsParsed++,!a.accepted)return this.protocolRejected++,{dnetHeader:r,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};if(!a.dispatchData)return this.protocolNoDispatch++,{dnetHeader:r,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};let n=this.readRateInfo(t);t.setStringBuffer(!0);let i=this.readGameState(t),o=void 0===i.controlObjectDataStart||void 0!==i.controlObjectData,s=o?this.readEvents(t):[],l=s[s.length-1],u=!l||l.dataBitsEnd!==l.dataBitsStart,c=o&&u?t.getCurPos():void 0,d=o&&u?this.readGhosts(t,r.seqNumber):[];return t.setStringBuffer(!1),{dnetHeader:r,rateInfo:n,gameState:i,events:s,ghosts:d,ghostSectionStart:c}}readDnetHeader(e){let t=e.readFlag(),r=e.readInt(1),a=e.readInt(9),n=e.readInt(9),i=e.readInt(2),o=e.readInt(3),s=o>0?e.readInt(8*o):0;return{gameFlag:t,connectSeqBit:r,seqNumber:a,highestAck:n,packetType:i,ackByteCount:o,ackMask:s}}readRateInfo(e){let t={};return e.readFlag()&&(t.updateDelay=e.readInt(10),t.packetSize=e.readInt(10)),e.readFlag()&&(t.maxUpdateDelay=e.readInt(10),t.maxPacketSize=e.readInt(10)),t}readGameState(e){let t,r,a,n,i,o,s,l,u,c,d,f,h,m,p,g=e.readInt(32);e.readFlag()&&(e.readFlag()&&(t=e.readFloat(7)),e.readFlag()&&(r=1.5*e.readFloat(7))),e.readFlag()&&(a=e.readFlag(),n=e.readFlag()),e.readFlag()&&((i=e.readFlag())&&(o={x:e.readF32(),y:e.readF32(),z:e.readF32()}),1===(s=e.readRangedU32(0,2))?e.readFlag()&&(l=e.readRangedU32(0,1023)):2===s&&(u={x:e.readF32(),y:e.readF32(),z:e.readF32()}));let v=e.readFlag(),y=e.readFlag();if(e.readFlag())if(e.readFlag()){let p=e.readInt(10);c=p,d=e.getCurPos();let A=e.savePos(),F=this.ghostTracker.getGhost(p),b=F?this.registry.getGhostParser(F.classId):void 0,C=this.controlParserByGhostIndex.get(p),B=this.registry.getGhostParser(25),S=this.registry.getGhostParser(4),x=[],E=new Set,M=e=>{!e?.readPacketData||E.has(e.name)||(E.add(e.name),x.push(e))};M(b),M(C),M(B),M(S);let D=!1;for(let t of x){e.restorePos(A);try{let r=this.getConnectionContext(),a=t.readPacketData(e,r);if(e.getCurPos()-d<=0||e.isError())continue;h=a,f=e.getCurPos(),this.controlParserByGhostIndex.set(p,t),r.compressionPoint!==this.compressionPoint&&(this.compressionPoint=r.compressionPoint,m=this.compressionPoint),this.controlObjectParsed++,D=!0;break}catch{}}if(!D)return e.restorePos(A),f=d,this.controlObjectFailed++,{lastMoveAck:g,damageFlash:t,whiteOut:r,selfLocked:a,selfHomed:n,seekerTracking:i,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:u,pinged:v,jammed:y,controlObjectGhostIndex:c,controlObjectDataStart:d,controlObjectDataEnd:f,controlObjectData:h,targetVisibility:[]}}else m={x:e.readF32(),y:e.readF32(),z:e.readF32()},this.compressionPoint=m;let A=[];for(;e.readFlag();)A.push({index:e.readInt(4),mask:e.readInt(32)});return e.readFlag()&&(p=e.readInt(8)),{lastMoveAck:g,damageFlash:t,whiteOut:r,selfLocked:a,selfHomed:n,seekerTracking:i,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:u,pinged:v,jammed:y,controlObjectGhostIndex:c,controlObjectDataStart:d,controlObjectDataEnd:f,controlObjectData:h,compressionPoint:m,targetVisibility:A.length>0?A:void 0,cameraFov:p}}readEvents(e){let t=[],r=!0,a=-2;for(;;){let n,i,o,s=e.readFlag();if(r&&!s){if(r=!1,!e.readFlag()){this.dispatchGuaranteedEvents(t);break}}else if(r||s){if(!s)break}else{this.dispatchGuaranteedEvents(t);break}!r&&(a=n=e.readFlag()?a+1&127:e.readInt(7),(i=n|0xffffff80&this.nextRecvEventSeq)0&&this.pendingGuaranteedEvents[0].absoluteSequenceNumber===this.nextRecvEventSeq;){let t=this.pendingGuaranteedEvents.shift();if(!t)break;this.nextRecvEventSeq=this.nextRecvEventSeq+1>>>0,e.push(t.event),t.event.parsedData&&this.applyEventSideEffects(t.event.parsedData)}}applyEventSideEffects(e){let t=e.type;if("GhostingMessageEvent"===t){let t=e.message;"number"==typeof t&&2===t&&this.ghostTracker.clear();return}if("GhostAlwaysObjectEvent"===t){let t=e.ghostIndex,r=e.classId;if("number"==typeof t&&"number"==typeof r){let e=this.registry.getGhostParser(r);this.ghostTracker.createGhost(t,r,e?.name??`unknown_${r}`)}}"SimDataBlockEvent"===t&&this.dataBlockDataMap&&e.dataBlockData&&"number"==typeof e.objectId&&this.dataBlockDataMap.set(e.objectId,e.dataBlockData)}readGhosts(e,t){let r=[];if(!e.readFlag())return r;let a=e.readInt(3)+3;for(;e.readFlag();){let n;if(e.isError())break;let i=e.readInt(a);if(e.isError())break;if(e.readFlag()){this.ghostTracker.deleteGhost(i),this.ghostDeletes++,r.push({index:i,type:"delete",updateBitsStart:e.getCurPos(),updateBitsEnd:e.getCurPos()});continue}let o=!this.ghostTracker.hasGhost(i);n=o?e.readInt(7)+0:this.ghostTracker.getGhost(i)?.classId;let s=e.getCurPos(),l=void 0!==n?this.registry.getGhostParser(n):void 0;if(o&&!l){this.ghostsTrackerDiverged++,u5("DIVERGED pkt=%d seq=%d idx=%d classId=%d bit=%d/%d trackerSize=%d (server sent UPDATE for ghost not in our tracker; 7-bit classId is actually update data)",this.packetsParsed,t,i,n,s,e.getMaxPos(),this.ghostTracker.size()),r.push({index:i,type:"create",classId:n,updateBitsStart:s,updateBitsEnd:s});break}let u=!1;if(l)try{let t=this.getConnectionContext();t.currentGhostIndex=i;let a=l.unpackUpdate(e,o,t),c=e.getCurPos();o&&void 0!==n?(this.ghostTracker.createGhost(i,n,l.name),this.ghostCreatesParsed++):this.ghostUpdatesParsed++,r.push({index:i,type:o?"create":"update",classId:n,updateBitsStart:s,updateBitsEnd:c,parsedData:a}),u=!0}catch(c){this.ghostsFailed++;let a=o?"create":"update",u=c instanceof Error?c.message:String(c);u5("FAIL pkt=%d seq=%d #%d idx=%d op=%s classId=%d parser=%s bit=%d/%d trackerSize=%d err=%s",this.packetsParsed,t,r.length,i,a,n,l.name,s,e.getMaxPos(),this.ghostTracker.size(),u)}if(!u){u5("STOP pkt=%d seq=%d idx=%d op=%s classId=%d parser=%s bit=%d/%d",this.packetsParsed,t,i,o?"create":"update",n,l?.name??"NONE",s,e.getMaxPos()),r.push({index:i,type:o?"create":"update",classId:n,updateBitsStart:s,updateBitsEnd:s});break}}return r}emptyGameState(){return{lastMoveAck:0,pinged:!1,jammed:!1}}}class u6{eventParsers=new Map;ghostParsers=new Map;dataBlockParsers=new Map;eventCatalog=new Map;ghostCatalog=new Map;dataBlockCatalog=new Map;catalogEvent(e){this.eventCatalog.set(e.name,e)}catalogGhost(e){this.ghostCatalog.set(e.name,e)}catalogDataBlock(e){this.dataBlockCatalog.set(e.name,e)}bindDeterministicDataBlocks(e,t){let r=0,a=[];for(let n=0;n0&&(a.sounds=t)}if(e.readFlag()){let t=[];for(let r=0;r<4;r++)e.readFlag()&&t.push({index:r,sequence:e.readInt(5),state:e.readInt(2),forward:e.readFlag(),atEnd:e.readFlag()});t.length>0&&(a.threads=t)}let n=!1;if(e.readFlag()){let r=[];for(let a=0;a<8;a++)if(e.readFlag()){let i={index:a};e.readFlag()?i.dataBlockId=ce(e):i.dataBlockId=0,e.readFlag()&&(e.readFlag()?i.skinTagIndex=e.readInt(10):i.skinName=e.readString(),n=!0),i.wet=e.readFlag(),i.ammo=e.readFlag(),i.loaded=e.readFlag(),i.target=e.readFlag(),i.triggerDown=e.readFlag(),i.fireCount=e.readInt(3),t&&(i.imageExtraFlag=e.readFlag()),r.push(i)}r.length>0&&(a.images=r)}if(e.readFlag()){if(e.readFlag()){a.stateAEnabled=e.readFlag(),a.stateB=e.readFlag();let t=e.readFlag();a.hasInvulnerability=t,t?(a.invulnerabilityVisual=e.readFlag(),a.invulnerabilityTicks=e.readU32()):a.binaryCloak=e.readFlag()}if(e.readFlag())if(e.readFlag()){let t=e.readFlag();a.stateBMode=t,t?a.energyPackOn=!0:a.energyPackOn=!1}else a.shieldNormal=e.readNormalVector(8),a.energyPercent=e.readFloat(5);e.readFlag()&&(a.stateValue1=e.readU32(),a.stateValue2=e.readU32())}return n&&(a.imageSkinDirty=!0),e.readFlag()&&(e.readFlag()?(a.mountObject=e.readInt(10),a.mountNode=e.readInt(5)):a.mountObject=-1),a}function ca(e,t,r){let a=cr(e,t,r);if(e.readFlag()&&(a.impactSound=e.readInt(3)),e.readFlag()&&(a.action=e.readInt(8),a.actionHoldAtEnd=e.readFlag(),a.actionAtEnd=e.readFlag(),a.actionFirstPerson=e.readFlag(),!a.actionAtEnd&&e.readFlag()&&(a.actionAnimPos=e.readSignedFloat(6))),e.readFlag()&&(a.armAction=e.readInt(8)),e.readFlag())return a;if(e.readFlag()){if(a.actionState=e.readInt(3),e.readFlag()&&(a.recoverTicks=e.readInt(7)),a.moveFlag0=e.readFlag(),a.moveFlag1=e.readFlag(),a.position=e.readCompressedPoint(r.compressionPoint),e.readFlag()){let t=e.readInt(13)/32,r=e.readNormalVector(10);a.velocity={x:r.x*t,y:r.y*t,z:r.z*t}}else a.velocity={x:0,y:0,z:0};a.headX=e.readSignedFloat(6),a.headZ=e.readSignedFloat(6),a.rotationZ=2*e.readFloat(7)*Math.PI,a.move=u7(e),a.allowWarp=e.readFlag()}return a.energy=e.readFloat(5),a}function cn(e,t){let r={};if(r.energyLevel=e.readF32(),r.rechargeRate=e.readF32(),r.actionState=e.readInt(3),e.readFlag()&&(r.recoverTicks=e.readInt(7)),e.readFlag()&&(r.jumpDelay=e.readInt(7)),e.readFlag()){let a={x:e.readF32(),y:e.readF32(),z:e.readF32()};r.position=a,t.compressionPoint=a,r.velocity={x:e.readF32(),y:e.readF32(),z:e.readF32()},r.jumpSurfaceLastContact=e.readInt(4)}if(r.headX=e.readF32(),r.headZ=e.readF32(),r.rotationZ=e.readF32(),e.readFlag()){let a=e.readInt(10);r.controlObjectGhost=a;let n=t.ghostTracker.getGhost(a),i=n?t.getGhostParser?.(n.classId):void 0;if(i?.readPacketData){let n=t.currentGhostIndex;t.currentGhostIndex=a,r.controlObjectData=i.readPacketData(e,t),t.currentGhostIndex=n}}return r.disableMove=e.readFlag(),r.pilot=e.readFlag(),r}function ci(e,t,r){let a=cr(e,t,r);return(a.jetting=e.readFlag(),e.readFlag())?a._controlledEarlyReturn=!0:(a.steeringYaw=e.readFloat(9),a.steeringPitch=e.readFloat(9),a.move=u7(e),a.frozen=e.readFlag(),e.readFlag()&&(a.position=e.readCompressedPoint(r.compressionPoint),a.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},a.linMomentum=e.readPoint3F(),a.angMomentum=e.readPoint3F()),e.readFlag()&&(a.energy=e.readFloat(8))),a}function co(e,t){let r={};r.energyLevel=e.readF32(),r.rechargeRate=e.readF32(),r.steering={x:e.readF32(),y:e.readF32()};let a={x:e.readF32(),y:e.readF32(),z:e.readF32()};return r.linPosition=a,r.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},r.linMomentum=e.readPoint3F(),r.angMomentum=e.readPoint3F(),r.disableMove=e.readFlag(),r.frozen=e.readFlag(),t.compressionPoint=a,r}function cs(e,t){let r=co(e,t);r.braking=e.readFlag();let a=4,n=t.currentGhostIndex;if(void 0!==n){let e=cW.get(n);void 0!==e&&(a=e)}let i=[];for(let t=0;t64)throw Error(`Invalid Sky fogVolumeCount: ${t}`);a.fogVolumeCount=t,a.useSkyTextures=e.readBool(),a.renderBottomTexture=e.readBool(),a.skySolidColor={r:e.readF32(),g:e.readF32(),b:e.readF32()},a.windEffectPrecipitation=e.readBool();let r=[];for(let a=0;a3)throw Error(`Invalid precipitation colorCount: ${t}`);let r=[];for(let a=0;aMath.floor(e.getRemainingBits()/96))throw Error(`Invalid physicalZone point count: ${t}`);let r=[];for(let a=0;aMath.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone plane count: ${n}`);let i=[];for(let t=0;tMath.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone edge count: ${o}`);let s=[];for(let t=0;t0&&(r.audioData=e.readBitsBuffer(8*a)),r}function dc(e,t){return{type:"GhostingMessageEvent",sequence:e.readU32(),message:e.readInt(3),ghostCount:e.readInt(11)}}function dd(e,t){let r={type:"GhostAlwaysObjectEvent"};r.ghostIndex=e.readInt(10);let a=e.readFlag();if(r._hasObjectData=a,a){let a=e.readInt(7);r.classId=a;let n=t.getGhostParser?.(a);if(!n)throw Error(`No ghost parser for GhostAlwaysObjectEvent classId=${a}`);r.objectData=n.unpackUpdate(e,!0,t)}return r}function df(e,t){let r={type:"PathManagerEvent"};if(e.readFlag()){r.messageType="NewPaths";let t=e.readU32(),a=[];for(let r=0;r0&&(t.hudImages=r),t}function dD(e){let t={};e.readFlag()&&(t.crc=e.readU32()),t.shapeName=e.readString(),t.mountPoint=e.readU32(),e.readFlag()||(t.offset=e.readAffineTransform()),t.firstPerson=e.readFlag(),t.mass=e.readF32(),t.usesEnergy=e.readFlag(),t.minEnergy=e.readF32(),t.hasFlash=e.readFlag(),t.projectile=dC(e),t.muzzleFlash=dC(e),t.isSeeker=e.readFlag(),t.isSeeker&&(t.seekerRadius=e.readF32(),t.maxSeekAngle=e.readF32(),t.seekerLockTime=e.readF32(),t.seekerFreeTime=e.readF32(),t.isTargetLockRequired=e.readFlag(),t.maxLockRange=e.readF32()),t.cloakable=e.readFlag(),t.lightType=e.readRangedU32(0,3),0!==t.lightType&&(t.lightRadius=e.readF32(),t.lightTime=e.readS32(),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)}),t.shellExitDir={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.shellExitVariance=e.readF32(),t.shellVelocity=e.readF32(),t.casing=dC(e),t.accuFire=e.readFlag();let r=[];for(let t=0;t<31;t++){if(!e.readFlag())continue;let t={};t.name=e.readString(),t.transitionOnAmmo=e.readInt(5),t.transitionOnNoAmmo=e.readInt(5),t.transitionOnTarget=e.readInt(5),t.transitionOnNoTarget=e.readInt(5),t.transitionOnWet=e.readInt(5),t.transitionOnNotWet=e.readInt(5),t.transitionOnTriggerUp=e.readInt(5),t.transitionOnTriggerDown=e.readInt(5),t.transitionOnTimeout=e.readInt(5),t.transitionGeneric0In=e.readInt(5),t.transitionGeneric0Out=e.readInt(5),e.readFlag()&&(t.timeoutValue=e.readF32()),t.waitForTimeout=e.readFlag(),t.fire=e.readFlag(),t.ejectShell=e.readFlag(),t.scaleAnimation=e.readFlag(),t.direction=e.readFlag(),t.reload=e.readFlag(),e.readFlag()&&(t.energyDrain=e.readF32()),t.loaded=e.readInt(3),t.spin=e.readInt(3),t.recoil=e.readInt(3),e.readFlag()&&(t.sequence=e.readSignedInt(16)),e.readFlag()&&(t.sequenceVis=e.readSignedInt(16)),t.flashSequence=e.readFlag(),t.ignoreLoadedForReady=e.readFlag(),t.emitter=dC(e),null!==t.emitter&&(t.emitterTime=e.readF32(),t.emitterNode=e.readS32()),t.sound=dC(e),r.push(t)}return t.states=r,t}function dI(e){let t=dM(e);t.renderFirstPerson=e.readFlag(),t.minLookAngle=e.readF32(),t.maxLookAngle=e.readF32(),t.maxFreelookAngle=e.readF32(),t.maxTimeScale=e.readF32(),t.maxStepHeight=e.readF32(),t.runForce=e.readF32(),t.runEnergyDrain=e.readF32(),t.minRunEnergy=e.readF32(),t.maxForwardSpeed=e.readF32(),t.maxBackwardSpeed=e.readF32(),t.maxSideSpeed=e.readF32(),t.maxUnderwaterForwardSpeed=e.readF32(),t.maxUnderwaterBackwardSpeed=e.readF32(),t.maxUnderwaterSideSpeedRef=dC(e),e.readFlag()&&(t.runSurfaceAngleRef=e.readInt(11)),t.runSurfaceAngle=e.readF32(),t.recoverDelay=e.readF32(),t.recoverRunForceScale=e.readF32(),t.jumpForce=e.readF32(),t.jumpEnergyDrain=e.readF32(),t.minJumpEnergy=e.readF32(),t.minJumpSpeed=e.readF32(),t.maxJumpSpeed=e.readF32(),t.jumpSurfaceAngle=e.readF32(),t.minJetEnergy=e.readF32(),t.splashVelocity=e.readF32(),t.splashAngle=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.bubbleEmitTime=e.readF32(),t.medSplashSoundVel=e.readF32(),t.hardSplashSoundVel=e.readF32(),t.exitSplashSoundVel=e.readF32(),t.jumpDelay=e.readInt(7),t.horizMaxSpeed=e.readF32(),t.horizResistSpeed=e.readF32(),t.horizResistFactor=e.readF32(),t.upMaxSpeed=e.readF32(),t.upResistSpeed=e.readF32(),t.upResistFactor=e.readF32(),t.jetEnergyDrain=e.readF32(),t.canJet=e.readF32(),t.maxJetHorizontalPercentage=e.readF32(),t.maxJetForwardSpeed=e.readF32(),t.jetForce=e.readF32(),t.minJetSpeed=e.readF32(),t.maxDamage=e.readF32(),t.minImpactDamageSpeed=e.readF32(),t.impactDamageScale=e.readF32(),t.footSplashHeight=e.readF32();let r=[];for(let t=0;t<32;t++)e.readFlag()?r.push(e.readInt(11)):r.push(null);t.sounds=r,t.boxSize={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.footPuffEmitter=dC(e),t.footPuffNumParts=e.readF32(),t.footPuffRadius=e.readF32(),t.decalData=dC(e),t.decalOffset=e.readF32(),t.dustEmitter=dC(e),t.splash=dC(e);let a=[];for(let t=0;t<3;t++)a.push(dC(e));return t.splashEmitters=a,t.groundImpactMinSpeed=e.readF32(),t.groundImpactShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeDuration=e.readF32(),t.groundImpactShakeFalloff=e.readF32(),t.boundingRadius=e.readF32(),t.moveBubbleSize=e.readF32(),t}function dk(e){let t=dM(e);t.bodyRestitution=e.readF32(),t.bodyFriction=e.readF32();let r=[];for(let t=0;t<2;t++)r.push(dC(e));t.impactSounds=r,t.minImpactSpeed=e.readF32(),t.softImpactSpeed=e.readF32(),t.hardImpactSpeed=e.readF32(),t.minRollSpeed=e.readF32(),t.maxSteeringAngle=e.readF32(),t.maxDrag=e.readF32(),t.minDrag=e.readF32(),t.cameraOffset=e.readF32(),t.cameraLag=e.readF32(),t.jetForce=e.readF32(),t.jetEnergyDrain=e.readF32(),t.minJetEnergy=e.readF32(),t.integration=e.readF32(),t.collisionTol=e.readF32(),t.massCenter=e.readF32(),t.exitSplashSoundVelocity=e.readF32(),t.softSplashSoundVelocity=e.readF32(),t.mediumSplashSoundVelocity=e.readF32(),t.hardSplashSoundVelocity=e.readF32();let a=[];for(let t=0;t<5;t++)a.push(dC(e));t.waterSounds=a,t.dustEmitter=dC(e);let n=[];for(let t=0;t<3;t++)n.push(dC(e));t.damageEmitters=n;let i=[];for(let t=0;t<2;t++)i.push(dC(e));return t.splashEmitters=i,t.damageEmitterOffset0={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageEmitterOffset1={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageLevelTolerance0=e.readF32(),t.damageLevelTolerance1=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.collDamageThresholdVel=e.readF32(),t.collDamageMultiplier=e.readF32(),t}function dw(e){let t=dk(e);t.jetActivateSound=dC(e),t.jetDeactivateSound=dC(e);let r=[];for(let t=0;t<4;t++)r.push(dC(e));return t.jetEmitters=r,t.maneuveringForce=e.readF32(),t.horizontalSurfaceForce=e.readF32(),t.verticalSurfaceForce=e.readF32(),t.autoInputDamping=e.readF32(),t.steeringForce=e.readF32(),t.steeringRollForce=e.readF32(),t.rollForce=e.readF32(),t.autoAngularForce=e.readF32(),t.rotationalDrag=e.readF32(),t.maxAutoSpeed=e.readF32(),t.autoLinearForce=e.readF32(),t.hoverHeight=e.readF32(),t.createHoverHeight=e.readF32(),t.minTrailSpeed=e.readF32(),t.vertThrustMultiple=e.readF32(),t.maxForwardSpeed=e.readF32(),t}function dT(e){let t=dk(e);t.dragForce=e.readF32(),t.mainThrustForce=e.readF32(),t.reverseThrustForce=e.readF32(),t.strafeThrustForce=e.readF32(),t.turboFactor=e.readF32(),t.stabLenMin=e.readF32(),t.stabLenMax=e.readF32(),t.stabSpringConstant=e.readF32(),t.stabDampingConstant=e.readF32(),t.gyroDrag=e.readF32(),t.normalForce=e.readF32(),t.restorativeForce=e.readF32(),t.steeringForce=e.readF32(),t.rollForce=e.readF32(),t.pitchForce=e.readF32(),t.floatingThrustFactor=e.readF32(),t.brakingForce=e.readF32(),t.dustTrailOffset={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.dustTrailFreqMod=e.readF32(),t.triggerTrailHeight=e.readF32(),t.floatSound=dC(e),t.thrustSound=dC(e),t.turboSound=dC(e);let r=[];for(let t=0;t<3;t++)r.push(dC(e));return t.jetEmitters=r,t.dustTrailEmitter=dC(e),t.mainThrustEmitterFactor=e.readF32(),t.strafeThrustEmitterFactor=e.readF32(),t.reverseThrustEmitterFactor=e.readF32(),t}function dR(e){let t=dk(e);return t.tireRadius=e.readF32(),t.tireStaticFriction=e.readF32(),t.tireKineticFriction=e.readF32(),t.tireRestitution=e.readF32(),t.tireLateralForce=e.readF32(),t.tireLateralDamping=e.readF32(),t.tireLateralRelaxation=e.readF32(),t.tireLongitudinalForce=e.readF32(),t.tireLongitudinalDamping=e.readF32(),t.tireEmitter=dC(e),t.jetSound=dC(e),t.engineSound=dC(e),t.squealSound=dC(e),t.wadeSound=dC(e),t.spring=e.readF32(),t.springDamping=e.readF32(),t.springLength=e.readF32(),t.brakeTorque=e.readF32(),t.engineTorque=e.readF32(),t.engineBrake=e.readF32(),t.maxWheelSpeed=e.readF32(),t.steeringAngle=e.readF32(),t.steeringReturn=e.readF32(),t.steeringDamping=e.readF32(),t.powerSteeringFactor=e.readF32(),t}function dP(e){let t=dM(e);return t.noIndividualDamage=e.readFlag(),t.dynamicTypeField=e.readS32(),t}function dG(e){let t=dP(e);return t.thetaMin=e.readF32(),t.thetaMax=e.readF32(),t.thetaNull=e.readF32(),t.neverUpdateControl=e.readFlag(),t.primaryAxis=e.readRangedU32(0,3),t.maxCapacitorEnergy=e.readF32(),t.capacitorRechargeRate=e.readF32(),t}function d_(e){let t=dD(e);return t.activationMS=e.readInt(8),t.deactivateDelayMS=e.readInt(8),t.degPerSecTheta=e.readRangedU32(0,1080),t.degPerSecPhi=e.readRangedU32(0,1080),t.dontFireInsideDamageRadius=e.readFlag(),t.damageRadius=e.readF32(),t.useCapacitor=e.readFlag(),t}function dL(e){let t=dM(e);return t.friction=e.readFloat(10),t.elasticity=e.readFloat(10),t.sticky=e.readFlag(),e.readFlag()&&(t.gravityMod=e.readFloat(10)),e.readFlag()&&(t.maxVelocity=e.readF32()),e.readFlag()&&(t.lightType=e.readInt(2),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)},t.lightTime=e.readS32(),t.lightRadius=e.readF32(),t.lightOnlyStatic=e.readFlag()),t}function dj(e){let t={};t.projectileShapeName=e.readString(),t.faceViewerLinkTime=e.readS32(),t.lifetime=e.readS32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.scale={x:e.readF32(),y:e.readF32(),z:e.readF32()}),t.activateEmitter=dC(e),t.maintainEmitter=dC(e),t.activateSound=dC(e),t.maintainSound=dC(e),t.explosion=dC(e),t.splash=dC(e),t.bounceExplosion=dC(e),t.bounceSound=dC(e),t.underwaterExplosion=dC(e);let r=[];for(let t=0;t<6;t++)r.push(dC(e));return t.decals=r,e.readFlag()&&(t.lightRadius=e.readFloat(8),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),e.readFlag()&&(t.underwaterLightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),t.explodeOnWaterImpact=dx(e),t.depthTolerance=e.readF32(),t}function dO(e){let t=dj(e);return t.dryVelocity=e.readF32(),t.wetVelocity=e.readF32(),t.fizzleTime=e.readU32(),t.fizzleType=e.readU32(),t.hardRetarget=e.readFlag(),t.inheritedVelocityScale=e.readRangedU32(0,90),t.lifetimeMS=e.readRangedU32(0,90),t.collideWithOwnerTimeMS=e.readU32(),t.proximityRadius=e.readU32(),t.tracerProjectile=e.readFlag(),t}function dN(e){let t=dj(e);return t.grenadeElasticity=e.readS32(),t.grenadeFriction=e.readF32(),t.dragCoefficient=e.readF32(),t.windCoefficient=e.readF32(),t.gravityMod=e.readF32(),t.muzzleVelocity=e.readF32(),t.drag=e.readF32(),t.lifetimeMS=e.readS32(),t}function dU(e){let t=dj(e);return t.lifetimeMS=e.readS32(),t.muzzleVelocity=e.readF32(),t.turningSpeed=e.readF32(),t.proximityRadius=e.readF32(),t.terrainAvoidanceSpeed=e.readF32(),t.terrainScanAhead=e.readF32(),t.terrainHeightFail=e.readF32(),t.terrainAvoidanceRadius=e.readF32(),t.flareDistance=e.readF32(),t.flareAngle=e.readF32(),t.useFlechette=dx(e),t.maxVelocity=e.readF32(),t.acceleration=e.readF32(),t.flechetteDelayMs=e.readS32(),t.exhaustTimeMs=e.readS32(),t.exhaustNodeName=e.readString(),t.casingShapeName=e.readString(),t.casingDebris=dC(e),t.puffEmitter=dC(e),t.exhaustEmitter=dC(e),t}function dH(e){let t=dj(e);t.maxRifleRange=e.readF32(),t.rifleHeadMultiplier=e.readF32(),t.beamColor=dS(e),t.fadeTime=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32(),t.lightColor=dS(e),t.lightRadius=e.readF32();let r=[];for(let t=0;t<12;t++)r.push(e.readString());return t.textures=r,t}function dJ(e){let t=dj(e);t.zapDuration=e.readF32(),t.boltLength=e.readF32(),t.numParts=e.readF32(),t.lightningFreq=e.readF32(),t.lightningDensity=e.readF32(),t.lightningAmp=e.readF32(),t.lightningWidth=e.readF32(),t.shockwave=dC(e);let r=[],a=[],n=[],i=[];for(let t=0;t<2;t++)r.push(e.readF32()),a.push(e.readF32()),n.push(e.readF32()),i.push(e.readF32());t.startWidth=r,t.endWidth=a,t.boltSpeed=n,t.texWrap=i;let o=[];for(let t=0;t<4;t++)o.push(e.readString());return t.textures=o,t.emitter=dC(e),t}function dV(e){let t=dj(e);return t.beamRange=e.readF32(),t.beamDrainRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t.flareTexture=e.readString(),t.hitEmitter=dC(e),t}function dK(e){let t=dj(e);return t.beamRange=e.readF32(),t.beamRepairRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t}function dz(e){let t=dj(e);t.maxRifleRange=e.readF32(),t.beamColor=dS(e),t.startBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32();let r=[];for(let t=0;t<4;t++)r.push(e.readString());return t.textures=r,t}function dq(e){let t=dO(e);return t.tracerLength=e.readF32(),t.tracerAlpha=e.readF32(),t.tracerMinPixels=e.readF32(),t.crossViewFraction=dx(e),t.tracerColor=dS(e),t.tracerWidth=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=dx(e),t.textureName0=e.readString(),t.textureName1=e.readString(),t}function dQ(e){let t=dN(e);return t.energyDrainPerSecond=e.readF32(),t.energyMinDrain=e.readF32(),t.beamWidth=e.readF32(),t.beamRange=e.readF32(),t.numSegments=e.readF32(),t.texRepeat=e.readF32(),t.beamFlareAngle=e.readF32(),t.beamTexture=e.readString(),t.flareTexture=e.readString(),t}function dW(e){let t=dO(e);return t.numFlares=e.readF32(),t.flareColor=dS(e),t.flareTexture=e.readString(),t.smokeTexture=e.readString(),t.size=e.readF32(),t.flareModTexture=e.readF32(),t.smokeSize=e.readF32(),t}function dX(e){let t=dN(e);return t.smokeDist=e.readF32(),t.noSmoke=e.readF32(),t.boomTime=e.readF32(),t.casingDist=e.readF32(),t.smokeCushion=e.readF32(),t.noSmokeCounter=e.readF32(),t.smokeTexture=e.readString(),t.bombTexture=e.readString(),t}function dY(e){let t=dN(e);return t.size=e.readF32(),t.useLensFlare=dx(e),t.flareTexture=e.readString(),t.lensFlareTexture=e.readString(),t}function dZ(e){let t={};t.dtsFileName=e.readString(),t.soundProfile=dC(e),t.particleEmitter=dC(e),t.particleDensity=e.readInt(14),t.particleRadius=e.readF32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.explosionScale={x:e.readInt(16),y:e.readInt(16),z:e.readInt(16)}),t.playSpeed=e.readInt(14),t.debrisThetaMin=e.readRangedU32(0,180),t.debrisThetaMax=e.readRangedU32(0,180),t.debrisPhiMin=e.readRangedU32(0,360),t.debrisPhiMax=e.readRangedU32(0,360),t.debrisMinVelocity=e.readRangedU32(0,1e3),t.debrisMaxVelocity=e.readRangedU32(0,1e3),t.debrisNum=e.readInt(14),t.debrisVariance=e.readRangedU32(0,1e4),t.delayMS=e.readInt(16),t.delayVariance=e.readInt(16),t.lifetimeMS=e.readInt(16),t.lifetimeVariance=e.readInt(16),t.offset=e.readF32(),t.shakeCamera=e.readFlag(),t.hasLight=e.readFlag(),t.camShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeDuration=e.readF32(),t.camShakeRadius=e.readF32(),t.camShakeFalloff=e.readF32(),t.shockwave=dC(e),t.debris=dC(e);let r=[];for(let t=0;t<4;t++)r.push(dC(e));t.emitters=r;let a=[];for(let t=0;t<5;t++)a.push(dC(e));t.subExplosions=a;let n=e.readRangedU32(0,4),i=[];for(let t=0;t0&&fy("DataBlock binding: %d/%d bound, missing parsers: %s",t,u2.length,r.join(", "));const{bound:a,missing:n}=this.registry.bindDeterministicGhosts(u3,0);n.length>0&&fy("Ghost binding: %d/%d bound, missing parsers: %s",a,u3.length,n.join(", "));const{bound:i,missing:o}=this.registry.bindDeterministicEvents(u9,255);o.length>0&&fy("Event binding: %d/%d bound, missing parsers: %s",i,u9.length,o.join(", ")),this.packetParser=new u8(this.registry,this.ghostTracker)}getRegistry(){return this.registry}getGhostTracker(){return this.ghostTracker}getPacketParser(){return this.packetParser}get loaded(){return this._loaded}get header(){if(!this._loaded)throw Error("must call load() first");return this._header}get initialBlock(){if(!this._loaded)throw Error("must call load() first");return this._initialBlock}get blockCount(){if(!this._loaded)throw Error("must call load() first");if(void 0===this._blockCount){let e=this._decompressedData,t=this._decompressedView,r=0,a=0;for(;a+2<=e.length;){let n=4095&t.getUint16(a,!0);if((a+=2+n)>e.length)break;r++}this._blockCount=r}return this._blockCount}get blockCursor(){if(!this._loaded)throw Error("must call load() first");return this._blockCursor}async load(){if(this._loaded)return{header:this._header,initialBlock:this._initialBlock};let e=this.readHeader();fy('header: "%s" version=0x%s length=%dms (%smin) initialBlockSize=%d',e.identString,e.protocolVersion.toString(16),e.demoLengthMs,(e.demoLengthMs/1e3/60).toFixed(1),e.initialBlockSize);let t=this.buffer.subarray(this.offset,this.offset+e.initialBlockSize),r=this.readInitialBlock(t);this.offset+=e.initialBlockSize;let a=this.buffer.subarray(this.offset);fy("compressed block stream: %d bytes",a.length);let n=await new Promise((e,t)=>{var r,n;r=(r,a)=>{r?t(r):e(a)},n||(n=r,r={}),"function"!=typeof n&&lJ(7),us(a,r,[ut],function(e){return ui(uE(e.data[0],uo(e.data[1])))},1,n)});return fy("decompressed block stream: %d bytes",n.length),this._decompressedData=n,this._decompressedView=new DataView(n.buffer,n.byteOffset,n.byteLength),this.setupPacketParser(r),this._header=e,this._initialBlock=r,this._blockStreamOffset=0,this._blockCursor=0,this._loaded=!0,{header:e,initialBlock:r}}nextBlock(){if(!this._loaded)throw Error("must call load() first");let e=this._decompressedData,t=this._decompressedView,r=this._blockStreamOffset;if(r+2>e.length)return;let a=t.getUint16(r,!0),n=a>>12,i=4095&a;if(r+2+i>e.length)return void fF("block %d: size %d would exceed decompressed data (offset=%d remaining=%d), stopping",this._blockCursor,i,r+2,e.length-r-2);let o=e.subarray(r+2,r+2+i);this._blockStreamOffset=r+2+i;let s={index:this._blockCursor,type:n,size:i,data:o};if(this._blockCursor++,0===n)try{s.parsed=this.packetParser.parsePacket(o)}catch{}else if(1===n)this.packetParser.onSendPacketTrigger();else if(2===n&&64===i)try{s.parsed=this.readRawMove(o)}catch{}else if(3===n&&8===i)try{s.parsed=this.readInfoBlock(o)}catch{}return s}reset(){if(!this._loaded)throw Error("must call load() first");this._blockStreamOffset=0,this._blockCursor=0,this._blockCount=void 0,this.setupPacketParser(this._initialBlock)}processBlocks(e){if(!this._loaded)throw Error("must call load() first");let t=0;for(let r=0;r=128&&t<128+u2.length?u2[t-128]:`unknown(${t})`;throw Error(`No parser for DataBlock classId ${t} (${e}) at bit ${i}`)}}fy("all %d/%d DataBlocks parsed (%d payloads), bit position after DataBlocks: %d",l,i,s.size,a.getCurPos());let u=a.readU8(),c=[];for(let e=0;e<6;e++)c.push(a.readU32());let d=[];for(let e=0;e<16;e++)d.push(a.readU32());let f=a.readU32(),h=[];for(let e=0;e>3<<3),this.readSimpleTargetManager(a),this.readSimpleTargetManager(a),fA('after sequential tail bit=%d mission="%s" CRC=0x%s',a.getCurPos(),k,w.toString(16))}catch(e){r=e instanceof Error?e.message:String(e)}finally{this.ghostTracker=S}let T=C-a.getCurPos(),R=k.length>0?k.split("").filter(e=>{let t=e.charCodeAt(0);return t>=32&&t<=126}).length/k.length:1,P=k.length>0&&R>=.8&&void 0===r;return fy('initial block: events=%d ghosts=%d ghostingSeq=%d controlObj=%d mission="%s" CRC=0x%s valid=%s%s',x.length,D.length,M,I,k,w.toString(16),P,r?` error=${r}`:""),{taggedStrings:n,dataBlockHeaders:o,dataBlockCount:l,dataBlocks:s,demoSetting:u,connectionFields:c,stateArray:d,scoreEntries:h,demoValues:m,sensorGroupColors:p,targetEntries:g,connectionState:v,roundTripTime:y,packetLoss:A,pathManager:F,notifyCount:b,nextRecvEventSeq:E,ghostingSequence:M,initialGhosts:D,initialEvents:x,controlObjectGhostIndex:I,controlObjectData:t,missionName:k,missionCRC:w,phase2TrailingBits:T,phase2Valid:P,phase2Error:r}}readScoreEntry(e){let t=e.readFlag()?e.readInt(16):0,r=e.readFlag()?e.readInt(16):0,a=e.readFlag()?e.readInt(16):0,n=e.readInt(6),i=e.readInt(6),o=e.readInt(6),s=e.readFlag(),l=[];for(let t=0;t<6;t++)l.push(e.readFlag());return{clientId:t,teamId:r,score:a,field0:n,field1:i,field2:o,isBot:s,triggerFlags:l}}readDemoValues(e){let t=[];for(;e.readFlag();)t.push(e.readString());return t}readComplexTargetManager(e){e.readU8(),e.readU8(),e.readU8(),e.readU8();let t=[];for(let r=0;r<32;r++)for(let a=0;a<32;a++)e.readFlag()&&t.push({group:r,targetGroup:a,r:e.readU8(),g:e.readU8(),b:e.readU8(),a:e.readU8()});let r=[];for(let t=0;t<512;t++){if(!e.readFlag())continue;let a={targetId:t,sensorGroup:0,targetData:0,damageLevel:0};e.readFlag()&&(a.sensorData=e.readU32()),e.readFlag()&&(a.voiceMapData=e.readU32()),e.readFlag()&&(a.name=e.readString()),e.readFlag()&&(a.skin=e.readString()),e.readFlag()&&(a.skinPref=e.readString()),e.readFlag()&&(a.voice=e.readString()),e.readFlag()&&(a.typeDescription=e.readString()),a.sensorGroup=e.readInt(5),a.targetData=e.readInt(9),t>=32&&e.readFlag()&&(a.dataBlockRef=e.readInt(11)),a.damageLevel=e.readFloat(7),r.push(a)}return{sensorGroupColors:t,targets:r}}readPathManager(e){let t=[],r=e.readU32();for(let a=0;athis.registry.getDataBlockParser(e)};t=i.unpack(e,r)}catch{r.push({classId:a,guaranteed:!0,dataBitsStart:n,dataBitsEnd:n});break}else{r.push({classId:a,guaranteed:!0,dataBitsStart:n,dataBitsEnd:n});break}r.push({classId:a,guaranteed:!0,dataBitsStart:n,dataBitsEnd:e.getCurPos(),parsedData:t}),fA(" event classId=%d bits=%d",a,e.getCurPos()-n)}return{nextRecvEventSeq:t,events:r}}readGhostStartBlock(e,t){let r=e.readU32(),a=[];fA("ghost block: seq=%d bit=%d",r,e.getCurPos());let n=this.registry.getGhostCatalog(),i=8*e.getBuffer().length,o=new Map;for(let[e,r]of t)o.set(e,r.data);for(;e.readFlag()&&!e.isError();){let r=e.readInt(10),s=e.readInt(7)+0,l=e.getCurPos(),u=[],c=new Set,{entry:d}=this.identifyGhostViaDataBlock(e,t,n),f=this.registry.getGhostParser(s);f&&(u.push({entry:f,method:"registry"}),c.add(f)),d&&!c.has(d)&&(u.push({entry:d,method:"datablock"}),c.add(d));let h={getDataBlockData:e=>o.get(e),getDataBlockParser:e=>this.registry.getDataBlockParser(e)},m=!1;for(let{entry:t,method:n}of u){let o="registry"===n,u=this.tryGhostParser(e,t,l,i,!1,h,o);if(!1!==u){this.ghostTracker.createGhost(r,s,t.name),fA(" ghost idx=%d classId=%d parser=%s bits=%d via=%s",r,s,t.name,e.getCurPos()-l,n),a.push({index:r,type:"create",classId:s,updateBitsStart:l,updateBitsEnd:e.getCurPos(),parsedData:u}),m=!0;break}}if(!m){fA(" ghost idx=%d classId=%d NO PARSER (stopping at bit=%d, remaining=%d)",r,s,l,i-l);break}}return fA("ghost loop ended at bit=%d remaining=%d count=%d",e.getCurPos(),i-e.getCurPos(),a.length),{ghostingSequence:r,ghosts:a}}tryGhostParser(e,t,r,a,n=!1,i,o=!1){let s=e.savePos();n||fA(" try %s: startBit=%d",t.name,r);try{let l=t.unpackUpdate(e,!0,{compressionPoint:{x:0,y:0,z:0},ghostTracker:this.ghostTracker,...i}),u=e.getCurPos()-r,c=a-e.getCurPos();if(e.isError()||!o&&u<3)return n||fA(" reject %s: bits=%d isError=%s",t.name,u,e.isError()),e.restorePos(s),!1;if(c>1e3){let r=e.getCurPos(),a=e.readFlag();if(e.setCurPos(r),!a)return n||fA(" reject %s: bits=%d misaligned (remaining=%d)",t.name,u,c),e.restorePos(s),!1}return l??{}}catch(r){return n||fA(" reject %s: error at bit=%d: %s",t.name,e.getCurPos(),r instanceof Error?r.message:String(r)),e.restorePos(s),!1}}identifyGhostViaDataBlock(e,t,r){let a;if(!t)return{entry:void 0,dbFlag:!1};let n=e.savePos(),i=!1;try{if(i=e.readFlag()){let n=e.readInt(11),i=t.get(n);if(i){let e=i.className.replace(/Data$/,"");(a=r.get(e))||fA(" identifyGhostViaDataBlock: dbId=%d className=%s ghostName=%s (no ghost parser)",n,i.className,e)}else fA(" identifyGhostViaDataBlock: dbId=%d (no DataBlock found)",n)}else fA(" identifyGhostViaDataBlock: DataBlock flag=0")}catch{}return e.restorePos(n),{entry:a,dbFlag:i}}readRawMove(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getInt32(0,!0),a=t.getInt32(4,!0),n=t.getInt32(8,!0),i=t.getUint32(12,!0),o=t.getUint32(16,!0),s=t.getUint32(20,!0),l=t.getFloat32(24,!0),u=t.getFloat32(28,!0),c=t.getFloat32(32,!0),d=t.getFloat32(36,!0),f=t.getFloat32(40,!0),h=t.getFloat32(44,!0),m=t.getUint32(48,!0),p=t.getUint32(52,!0),g=0!==e[56],v=[];for(let t=0;t<6;t++)v.push(0!==e[57+t]);return{px:r,py:a,pz:n,pyaw:i,ppitch:o,proll:s,x:l,y:u,z:c,yaw:d,pitch:f,roll:h,id:m,sendCount:p,freeLook:g,trigger:v}}readInfoBlock(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{value1:t.getUint32(0,!0),value2:t.getFloat32(4,!0)}}}let fC=Object.freeze({r:0,g:255,b:0}),fB=Object.freeze({r:255,g:0,b:0}),fS=new Set(["FlyingVehicle","HoverVehicle","WheeledVehicle"]),fx=new Set(["BombProjectile","EnergyProjectile","FlareProjectile","GrenadeProjectile","LinearFlareProjectile","LinearProjectile","Projectile","SeekerProjectile","TracerProjectile"]),fE=new Set(["LinearProjectile","TracerProjectile","LinearFlareProjectile","Projectile"]),fM=new Set(["GrenadeProjectile","EnergyProjectile","FlareProjectile","BombProjectile"]),fD=new Set(["SeekerProjectile"]),fI=new Set(["StaticShape","ScopeAlwaysShape","Turret","BeaconObject","ForceFieldBare"]),fk=new Set(["TSStatic","InteriorInstance","TerrainBlock","Sky","Sun","MissionArea","PhysicalZone","MissionMarker","SpawnSphere","VehicleBlocker","Camera"]),fw=.494*Math.PI,fT=new u.Matrix4,fR=new u.Quaternion;function fP(e){return null!=e&&Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function fG(e,t,r){return er?r:e}function f_(e){let t=-e/2;return[0,Math.sin(t),0,Math.cos(t)]}function fL(e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||!Number.isFinite(e.z)||!Number.isFinite(e.w))return null;let t=-e.y,r=-e.z,a=-e.x,n=e.w,i=t*t+r*r+a*a+n*n;if(i<=1e-12)return null;let o=1/Math.sqrt(i);return[t*o,r*o,a*o,n*o]}function fj(e){let t="";for(let r=0;r=32&&(t+=e[r]);return t}function fO(e){return"Player"===e?"Player":fS.has(e)?"Vehicle":"Item"===e?"Item":fx.has(e)?"Projectile":fI.has(e)?"Deployable":"Ghost"}function fN(e,t){return"Player"===e?`player_${t}`:fS.has(e)?`vehicle_${t}`:"Item"===e?`item_${t}`:fx.has(e)?`projectile_${t}`:fI.has(e)?`deployable_${t}`:`ghost_${t}`}function fU(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z&&"number"==typeof e.w}function fH(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z}function fJ(e){if(e){for(let t of[e.shapeName,e.projectileShapeName,e.shapeFileName,e.shapeFile,e.model])if("string"==typeof t&&t.length>0)return t}}function fV(e,t){if(e)for(let r of t){let t=e[r];if("number"==typeof t&&Number.isFinite(t))return t}}function fK(e,t){if(e)for(let r of t){let t=e[r];if("string"==typeof t&&t.length>0)return t}}function fz(e){return e?"number"==typeof e.cameraMode?"camera":"number"==typeof e.rotationZ?"player":null:null}class fq{parser;initialBlock;registry;netStrings=new Map;targetNames=new Map;targetTeams=new Map;sensorGroupColors=new Map;state;constructor(e){this.parser=e,this.registry=e.getRegistry();const t=e.initialBlock;this.initialBlock={dataBlocks:t.dataBlocks,initialGhosts:t.initialGhosts,controlObjectGhostIndex:t.controlObjectGhostIndex,controlObjectData:t.controlObjectData,targetEntries:t.targetEntries,sensorGroupColors:t.sensorGroupColors,taggedStrings:t.taggedStrings},this.state={moveTicks:0,moveYawAccum:0,movePitchAccum:0,yawOffset:0,pitchOffset:0,lastAbsYaw:0,lastAbsPitch:0,lastControlType:"player",isPiloting:!1,lastOrbitDistance:void 0,exhausted:!1,latestFov:100,latestControl:{ghostIndex:t.controlObjectGhostIndex,data:t.controlObjectData,position:fP(t.controlObjectData?.position)?t.controlObjectData?.position:void 0},camera:null,entitiesById:new Map,entityIdByGhostIndex:new Map,lastStatus:{health:1,energy:1},nextExplosionId:0,playerSensorGroup:0},this.reset()}reset(){for(let[e,t]of(this.parser.reset(),this.netStrings.clear(),this.targetNames.clear(),this.targetTeams.clear(),this.sensorGroupColors.clear(),this.state.entitiesById.clear(),this.state.entityIdByGhostIndex.clear(),this.initialBlock.taggedStrings))this.netStrings.set(e,t);for(let e of this.initialBlock.targetEntries)e.name&&this.targetNames.set(e.targetId,fj(e.name)),this.targetTeams.set(e.targetId,e.sensorGroup);for(let e of this.initialBlock.sensorGroupColors){let t=this.sensorGroupColors.get(e.group);t||(t=new Map,this.sensorGroupColors.set(e.group,t)),t.set(e.targetGroup,{r:e.r,g:e.g,b:e.b})}if(this.state.playerSensorGroup=0,this.state.moveTicks=0,this.state.moveYawAccum=0,this.state.movePitchAccum=0,this.state.yawOffset=0,this.state.pitchOffset=0,this.state.lastAbsYaw=0,this.state.lastAbsPitch=0,this.state.lastControlType=fz(this.initialBlock.controlObjectData)??"player",this.state.isPiloting="player"===this.state.lastControlType&&!!(this.initialBlock.controlObjectData?.pilot||this.initialBlock.controlObjectData?.controlObjectGhost!=null),this.state.lastCameraMode="camera"===this.state.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.cameraMode?this.initialBlock.controlObjectData.cameraMode:void 0,this.state.lastOrbitGhostIndex="camera"===this.state.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.orbitObjectGhostIndex?this.initialBlock.controlObjectData.orbitObjectGhostIndex:void 0,"camera"===this.state.lastControlType){let e=this.initialBlock.controlObjectData?.minOrbitDist,t=this.initialBlock.controlObjectData?.maxOrbitDist,r=this.initialBlock.controlObjectData?.curOrbitDist;"number"==typeof e&&"number"==typeof t&&Number.isFinite(e)&&Number.isFinite(t)?this.state.lastOrbitDistance=Math.max(0,t-e):"number"==typeof r&&Number.isFinite(r)?this.state.lastOrbitDistance=Math.max(0,r):this.state.lastOrbitDistance=void 0}else this.state.lastOrbitDistance=void 0;let e=this.getAbsoluteRotation(this.initialBlock.controlObjectData);for(let t of(e&&(this.state.lastAbsYaw=e.yaw,this.state.lastAbsPitch=e.pitch,this.state.yawOffset=e.yaw,this.state.pitchOffset=e.pitch),this.state.exhausted=!1,this.state.latestFov=100,this.state.latestControl={ghostIndex:this.initialBlock.controlObjectGhostIndex,data:this.initialBlock.controlObjectData,position:fP(this.initialBlock.controlObjectData?.position)?this.initialBlock.controlObjectData?.position:void 0},this.state.controlPlayerGhostId="player"===this.state.lastControlType&&this.initialBlock.controlObjectGhostIndex>=0?`player_${this.initialBlock.controlObjectGhostIndex}`:void 0,this.state.camera=null,this.state.lastStatus={health:1,energy:1},this.state.nextExplosionId=0,this.initialBlock.initialGhosts)){if("create"!==t.type||null==t.classId)continue;let e=this.registry.getGhostParser(t.classId)?.name??`ghost_${t.classId}`,r=fN(e,t.index),a={id:r,ghostIndex:t.index,className:e,spawnTick:0,type:fO(e),rotation:[0,0,0,1]};this.applyGhostData(a,t.parsedData),this.state.entitiesById.set(r,a),this.state.entityIdByGhostIndex.set(t.index,r)}if(0===this.state.playerSensorGroup&&"player"===this.state.lastControlType&&this.state.latestControl.ghostIndex>=0){let e=this.state.entityIdByGhostIndex.get(this.state.latestControl.ghostIndex),t=e?this.state.entitiesById.get(e):void 0;t?.sensorGroup!=null&&t.sensorGroup>0&&(this.state.playerSensorGroup=t.sensorGroup)}this.updateCameraAndHud()}getSnapshot(){return this.buildSnapshot()}getEffectShapes(){let e=new Set;for(let[,t]of this.initialBlock.dataBlocks){let r=t.data?.explosion;if(null==r)continue;let a=this.getDataBlockData(r),n=a?.dtsFileName;n&&e.add(n)}return[...e]}stepToTime(e,t=1/0){let r=Math.floor(1e3*(Number.isFinite(e)?Math.max(0,e):0)/32);r0&&(this.state.playerSensorGroup=t.sensorGroup)}if(r){let e=fz(r);if(e&&(this.state.lastControlType=e),"player"===this.state.lastControlType)this.state.isPiloting=!!(r.pilot||null!=r.controlObjectGhost);else if(this.state.isPiloting=!1,"number"==typeof r.cameraMode)if(this.state.lastCameraMode=r.cameraMode,3===r.cameraMode){"number"==typeof r.orbitObjectGhostIndex&&(this.state.lastOrbitGhostIndex=r.orbitObjectGhostIndex);let e=r.minOrbitDist,t=r.maxOrbitDist,a=r.curOrbitDist;"number"==typeof e&&"number"==typeof t&&Number.isFinite(e)&&Number.isFinite(t)?this.state.lastOrbitDistance=Math.max(0,t-e):"number"==typeof a&&Number.isFinite(a)&&(this.state.lastOrbitDistance=Math.max(0,a))}else this.state.lastOrbitGhostIndex=void 0,this.state.lastOrbitDistance=void 0}for(let e of t.events){let t=this.registry.getEventParser(e.classId)?.name;if("NetStringEvent"===t&&e.parsedData){let t=e.parsedData.id,r=e.parsedData.value;null!=t&&"string"==typeof r&&this.netStrings.set(t,r);continue}if("TargetInfoEvent"===t&&e.parsedData){let t=e.parsedData.targetId,r=e.parsedData.nameTag;if(null!=t&&null!=r){let e=this.netStrings.get(r);e&&this.targetNames.set(t,fj(e))}let a=e.parsedData.sensorGroup;null!=t&&null!=a&&this.targetTeams.set(t,a)}else if("SetSensorGroupEvent"===t&&e.parsedData){let t=e.parsedData.sensorGroup;null!=t&&(this.state.playerSensorGroup=t)}else if("SensorGroupColorEvent"===t&&e.parsedData){let t=e.parsedData.sensorGroup,r=e.parsedData.colors;if(r){let e=this.sensorGroupColors.get(t);for(let a of(e||(e=new Map,this.sensorGroupColors.set(t,e)),r))a.default?e.delete(a.index):e.set(a.index,{r:a.r??0,g:a.g??0,b:a.b??0})}}}for(let e of t.ghosts)this.applyPacketGhost(e);return}if(3===e.type&&this.isInfoData(e.parsed)){Number.isFinite(e.parsed.value2)&&(this.state.latestFov=e.parsed.value2);return}2===e.type&&this.isMoveData(e.parsed)&&(this.state.moveYawAccum+=e.parsed.yaw??0,this.state.movePitchAccum+=e.parsed.pitch??0)}applyPacketGhost(e){let t=e.index,r=this.state.entityIdByGhostIndex.get(t);if("delete"===e.type){r&&(this.state.entitiesById.delete(r),this.state.entityIdByGhostIndex.delete(t));return}let a=this.resolveGhostClassName(t,e.classId);if(!a)return;let n=fN(a,t);r&&r!==n&&this.state.entitiesById.delete(r);let i=this.state.entitiesById.get(n);i||(i={id:n,ghostIndex:t,className:a,spawnTick:this.state.moveTicks,type:fO(a),rotation:[0,0,0,1]},this.state.entitiesById.set(n,i)),i.ghostIndex=t,i.className=a,i.type=fO(a),this.state.entityIdByGhostIndex.set(t,n),this.applyGhostData(i,e.parsedData)}resolveGhostClassName(e,t){if("number"==typeof t){let e=this.registry.getGhostParser(t)?.name;if(e)return e}let r=this.state.entityIdByGhostIndex.get(e);if(r){let e=this.state.entitiesById.get(r);if(e?.className)return e.className}let a=this.parser.getGhostTracker().getGhost(e);if(a?.className)return a.className}resolveEntityIdForGhostIndex(e){let t=this.state.entityIdByGhostIndex.get(e);if(t)return t;let r=this.parser.getGhostTracker().getGhost(e);if(r)return fN(r.className,e)}getDataBlockData(e){let t=this.initialBlock.dataBlocks.get(e);if(t?.data)return t.data;let r=this.parser.getPacketParser();return r.dataBlockDataMap?.get(e)}resolveExplosionInfo(e){let t=this.getDataBlockData(e),r=t?.explosion;if(null==r)return;let a=this.getDataBlockData(r);if(!a)return;let n=a.dtsFileName;if(!n)return;let i=a.lifetimeMS??31;return{shape:n,faceViewer:!1!==a.faceViewer&&0!==a.faceViewer,lifetimeTicks:i}}applyGhostData(e,t){if(!t)return;let r=t.dataBlockId;if(null!=r){e.dataBlockId=r;let t=this.getDataBlockData(r),a=fJ(t);if(e.visual=function(e,t){if(!t)return;let r=fK(t,["tracerTex0","textureName0","texture0"])??"";if(!("TracerProjectile"===e||r.length>0&&null!=fV(t,["tracerLength"]))||!r)return;let a=fK(t,["tracerTex1","textureName1","texture1"]),n=fV(t,["tracerLength"])??10,i=fV(t,["tracerWidth"]),o=fV(t,["tracerAlpha"]),s=null!=i&&(null!=fV(t,["crossViewAng"])||i<=.7)?i:o??i??.5,l=fV(t,["crossViewAng","crossViewFraction"])??("number"==typeof t.tracerWidth&&t.tracerWidth>.7?t.tracerWidth:.98);return{kind:"tracer",texture:r,crossTexture:a,tracerLength:n,tracerWidth:s,crossViewAng:l,crossSize:fV(t,["crossSize","muzzleVelocity"])??.45,renderCross:function(e,t){if(e)for(let r of t){let t=e[r];if("boolean"==typeof t)return t}}(t,["renderCross","proximityRadius"])??!0}}(e.className,t)??function(e,t){if(t){if("LinearFlareProjectile"===e){let e=fK(t,["smokeTexture","flareTexture"]);if(!e)return;let r=t.flareColor,a=fV(t,["size"])??.5;return{kind:"sprite",texture:e,color:r?{r:r.r,g:r.g,b:r.b}:{r:1,g:1,b:1},size:a}}if("FlareProjectile"===e){let e=fK(t,["flareTexture"]);if(!e)return;return{kind:"sprite",texture:e,color:{r:1,g:.9,b:.5},size:fV(t,["size"])??4}}}}(e.className,t),"string"==typeof a&&(e.shapeHint=a,e.dataBlock=a),"Player"===e.type&&"number"==typeof t?.maxEnergy&&(e.maxEnergy=t.maxEnergy),"Projectile"===e.type&&(fE.has(e.className)?e.projectilePhysics="linear":fM.has(e.className)?(e.projectilePhysics="ballistic",e.gravityMod=fV(t,["gravityMod"])??1):fD.has(e.className)&&(e.projectilePhysics="seeker")),"Projectile"===e.type&&!e.explosionShape){let t=this.resolveExplosionInfo(r);t&&(e.explosionShape=t.shape,e.faceViewer=t.faceViewer,e.explosionLifetimeTicks=t.lifetimeTicks)}}if("Player"===e.type){let r=t.images;if(Array.isArray(r)&&r.length>0){let t=r[0];if(t?.dataBlockId&&t.dataBlockId>0){let r=this.getDataBlockData(t.dataBlockId),a=fJ(r);if(a){let t=r?.mountPoint;(null==t||t<=0)&&!/pack_/i.test(a)&&(e.weaponShape=a)}}}}let a=fP(t.position)?t.position:fP(t.initialPosition)?t.initialPosition:fP(t.explodePosition)?t.explodePosition:fP(t.endPoint)?t.endPoint:fP(t.transform?.position)?t.transform.position:void 0;a&&(e.position=[a.x,a.y,a.z]);let n=fH(t.direction)?t.direction:void 0;if(n&&(e.direction=[n.x,n.y,n.z]),"Player"===e.type&&"number"==typeof t.rotationZ)e.rotation=f_(t.rotationZ);else if(fU(t.angPosition)){let r=fL(t.angPosition);r&&(e.rotation=r)}else if(fU(t.transform?.rotation)){let r=fL(t.transform.rotation);r&&(e.rotation=r)}else if("Item"===e.type&&"number"==typeof t.rotation?.angle){let r=t.rotation;e.rotation=f_((r.zSign??1)*r.angle)}else if("Projectile"===e.type){let r=t.velocity??t.direction??(fP(t.initialPosition)&&fP(t.endPos)?{x:t.endPos.x-t.initialPosition.x,y:t.endPos.y-t.initialPosition.y,z:t.endPos.z-t.initialPosition.z}:void 0);fH(r)&&(0!==r.x||0!==r.y)&&(e.rotation=f_(Math.atan2(r.x,r.y)))}if(fH(t.velocity)&&(e.velocity=[t.velocity.x,t.velocity.y,t.velocity.z],e.direction||(e.direction=[t.velocity.x,t.velocity.y,t.velocity.z])),e.projectilePhysics){if("linear"===e.projectilePhysics){let r=fV(null!=e.dataBlockId?this.getDataBlockData(e.dataBlockId):void 0,["dryVelocity","muzzleVelocity","bulletVelocity"])??80,a=e.direction??[0,1,0],n=a[0]*r,i=a[1]*r,o=a[2]*r,s=t.excessVel,l=t.excessDir;"number"==typeof s&&s>0&&fH(l)&&(n+=l.x*s,i+=l.y*s,o+=l.z*s),e.simulatedVelocity=[n,i,o]}else e.velocity&&(e.simulatedVelocity=[e.velocity[0],e.velocity[1],e.velocity[2]]);let r=t.currTick;if("number"==typeof r&&r>0&&e.simulatedVelocity&&e.position){let t=.032*r,a=e.simulatedVelocity;if(e.position[0]+=a[0]*t,e.position[1]+=a[1]*t,e.position[2]+=a[2]*t,"ballistic"===e.projectilePhysics){let r=9.81*(e.gravityMod??1);e.position[2]-=.5*r*t*t,a[2]-=r*t}}}let i=fP(t.explodePosition)?t.explodePosition:fP(t.explodePoint)?t.explodePoint:void 0;if("Projectile"===e.type&&!e.hasExploded&&i&&e.explosionShape){e.hasExploded=!0;let t=`fx_${this.state.nextExplosionId++}`,r=e.explosionLifetimeTicks??31,a={id:t,ghostIndex:-1,className:"Explosion",spawnTick:this.state.moveTicks,type:"Explosion",dataBlock:e.explosionShape,position:[i.x,i.y,i.z],rotation:[0,0,0,1],isExplosion:!0,faceViewer:!1!==e.faceViewer,expiryTick:this.state.moveTicks+r};this.state.entitiesById.set(t,a),e.position=void 0,e.simulatedVelocity=void 0}if("number"==typeof t.damageLevel&&(e.health=fG(1-t.damageLevel,0,1)),"number"==typeof t.damageState&&(e.damageState=t.damageState),"number"==typeof t.action&&(e.actionAnim=t.action,e.actionAtEnd=!!t.actionAtEnd),"number"==typeof t.energy&&(e.energy=fG(t.energy,0,1)),"number"==typeof t.targetId){e.targetId=t.targetId;let r=this.targetNames.get(t.targetId);r&&(e.playerName=r);let a=this.targetTeams.get(t.targetId);null!=a&&(e.sensorGroup=a,e.ghostIndex===this.state.latestControl.ghostIndex&&"player"===this.state.lastControlType&&(this.state.playerSensorGroup=a))}}advanceProjectiles(){for(let e of this.state.entitiesById.values()){if(!e.simulatedVelocity||!e.position)continue;let t=e.simulatedVelocity,r=e.position;if("ballistic"===e.projectilePhysics){let r=9.81*(e.gravityMod??1);t[2]-=.032*r}r[0]+=.032*t[0],r[1]+=.032*t[1],r[2]+=.032*t[2],(0!==t[0]||0!==t[1])&&(e.rotation=f_(Math.atan2(t[0],t[1])))}}removeExpiredExplosions(){for(let[e,t]of this.state.entitiesById)t.isExplosion&&null!=t.expiryTick&&this.state.moveTicks>=t.expiryTick&&this.state.entitiesById.delete(e)}updateCameraAndHud(){let e=this.state.latestControl,t=.032*this.state.moveTicks,r=e.data,a=this.state.lastControlType;if(e.position){var n,i;let o,s,l,u,c=this.getAbsoluteRotation(r),d=!this.state.isPiloting&&"player"===a,f=d?this.state.moveYawAccum+this.state.yawOffset:this.state.lastAbsYaw,h=d?this.state.movePitchAccum+this.state.pitchOffset:this.state.lastAbsPitch,m=f,p=h;if(c?(m=c.yaw,p=c.pitch,this.state.lastAbsYaw=m,this.state.lastAbsPitch=p,this.state.yawOffset=m-this.state.moveYawAccum,this.state.pitchOffset=p-this.state.movePitchAccum):d?(this.state.lastAbsYaw=m,this.state.lastAbsPitch=p):(m=this.state.lastAbsYaw,p=this.state.lastAbsPitch),this.state.camera={time:t,position:[e.position.x,e.position.y,e.position.z],rotation:(n=m,o=Math.sin(i=fG(p,-fw,fw)),s=Math.cos(i),l=Math.sin(n),u=Math.cos(n),fT.set(-l,u*o,-u*s,0,0,s,o,0,u,l*o,-l*s,0,0,0,0,1),fR.setFromRotationMatrix(fT),[fR.x,fR.y,fR.z,fR.w]),fov:this.state.latestFov,mode:"observer",yaw:m,pitch:p},"camera"===a)if(("number"==typeof r?.cameraMode?r.cameraMode:this.state.lastCameraMode)===3){this.state.camera.mode="third-person","number"==typeof this.state.lastOrbitDistance&&(this.state.camera.orbitDistance=this.state.lastOrbitDistance);let e="number"==typeof r?.orbitObjectGhostIndex?r.orbitObjectGhostIndex:this.state.lastOrbitGhostIndex;"number"==typeof e&&e>=0&&(this.state.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(e))}else this.state.camera.mode="observer";else this.state.camera.mode="first-person",e.ghostIndex>=0&&(this.state.controlPlayerGhostId=`player_${e.ghostIndex}`),this.state.controlPlayerGhostId&&(this.state.camera.controlEntityId=this.state.controlPlayerGhostId);if("player"===a&&!this.state.isPiloting&&this.state.controlPlayerGhostId&&e.position){let t=this.state.entitiesById.get(this.state.controlPlayerGhostId);t&&(t.position=[e.position.x,e.position.y,e.position.z],t.rotation=f_(m))}}else this.state.camera&&(this.state.camera={...this.state.camera,time:t,fov:this.state.latestFov});let o={health:1,energy:1};if(this.state.camera?.mode==="first-person"){let e=this.state.controlPlayerGhostId,t=e?this.state.entitiesById.get(e):void 0;o.health=t?.health??1;let a=r?.energyLevel;if("number"==typeof a){let e=t?.maxEnergy??60;e>0&&(o.energy=fG(a/e,0,1))}else o.energy=t?.energy??1}else if(this.state.camera?.mode==="third-person"&&this.state.camera.orbitTargetId){let e=this.state.entitiesById.get(this.state.camera.orbitTargetId);o.health=e?.health??1,o.energy=e?.energy??1}this.state.lastStatus=o}buildSnapshot(){let e=[];for(let t of this.state.entitiesById.values())(t.spawnTick>0||!fk.has(t.className))&&e.push({id:t.id,type:t.type,visual:t.visual,direction:t.direction,ghostIndex:t.ghostIndex,className:t.className,dataBlockId:t.dataBlockId,shapeHint:t.shapeHint,dataBlock:t.dataBlock,weaponShape:t.weaponShape,playerName:t.playerName,iffColor:"Player"===t.type&&null!=t.sensorGroup?this.resolveIffColor(t.sensorGroup):void 0,position:t.position?[...t.position]:void 0,rotation:t.rotation?[...t.rotation]:void 0,velocity:t.velocity,health:t.health,energy:t.energy,actionAnim:t.actionAnim,actionAtEnd:t.actionAtEnd,damageState:t.damageState,faceViewer:t.faceViewer});return{timeSec:.032*this.state.moveTicks,exhausted:this.state.exhausted,camera:this.state.camera,entities:e,controlPlayerGhostId:this.state.controlPlayerGhostId,status:this.state.lastStatus}}resolveIffColor(e){if(0===this.state.playerSensorGroup)return;let t=this.sensorGroupColors.get(this.state.playerSensorGroup);if(t){let r=t.get(e);if(r)return r}return e===this.state.playerSensorGroup?fC:0!==e?fB:void 0}getAbsoluteRotation(e){return e?"number"==typeof e.rotationZ&&"number"==typeof e.headX?{yaw:e.rotationZ,pitch:e.headX}:"number"==typeof e.rotZ&&"number"==typeof e.rotX?{yaw:e.rotZ,pitch:e.rotX}:null:null}isPacketData(e){return!!e&&"object"==typeof e&&"gameState"in e&&"events"in e&&"ghosts"in e}isMoveData(e){return!!e&&"object"==typeof e&&"yaw"in e}isInfoData(e){return!!e&&"object"==typeof e&&"value2"in e&&"number"==typeof e.value2}}async function fQ(e){let t=new fb(new Uint8Array(e)),{header:r,initialBlock:a}=await t.load(),{missionName:n,gameType:i}=function(e){let t=null,r=null;for(let a=0;a{if(f){p.current=p.current+1,h(null);return}m.current?.click()},d[0]=f,d[1]=h,d[2]=e):e=d[2];let g=e;d[3]!==h?(t=async e=>{let t=e.target.files?.[0];if(t){e.target.value="";try{let e=await t.arrayBuffer(),r=p.current+1;p.current=r;let a=await fQ(e);if(p.current!==r)return;h(a)}catch(e){console.error("Failed to load demo:",e)}}},d[3]=h,d[4]=t):t=d[4];let v=t;d[5]===Symbol.for("react.memo_cache_sentinel")?(r={display:"none"},d[5]=r):r=d[5],d[6]!==v?(a=(0,n.jsx)("input",{ref:m,type:"file",accept:".rec",style:r,onChange:v}),d[6]=v,d[7]=a):a=d[7];let y=f?"Unload demo":"Load demo (.rec)",A=f?"Unload demo":"Load demo (.rec)",F=f?"true":void 0;d[8]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(ld,{className:fW.default.DemoIcon}),d[8]=s):s=d[8];let b=f?"Unload demo":"Demo";return d[9]!==b?(l=(0,n.jsx)("span",{className:fW.default.ButtonLabel,children:b}),d[9]=b,d[10]=l):l=d[10],d[11]!==g||d[12]!==y||d[13]!==A||d[14]!==F||d[15]!==l?(u=(0,n.jsxs)("button",{type:"button",className:fW.default.Root,"aria-label":y,title:A,onClick:g,"data-active":F,children:[s,l]}),d[11]=g,d[12]=y,d[13]=A,d[14]=F,d[15]=l,d[16]=u):u=d[16],d[17]!==u||d[18]!==a?(c=(0,n.jsxs)(n.Fragment,{children:[a,u]}),d[17]=u,d[18]=a,d[19]=c):c=d[19],c}function fY(e){return(0,ls.GenIcon)({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:"12",y1:"16",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12.01",y2:"8"},child:[]}]})(e)}function fZ(e){return(0,ls.GenIcon)({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:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}var f$=e.i(65883);function f0(e){let t,r,a,s,l,u,c,d,f,h,m,p,g,v,y,A,F,b,C,B,S,x,M,D,I,k,w,T,R,P,G,_,L,j,O,N,U,H,J,V,K,z,q,Q,W,X=(0,i.c)(103),{missionName:Y,missionType:Z,onChangeMission:$,onOpenMapInfo:ee,cameraRef:et,isTouch:er}=e,{fogEnabled:ea,setFogEnabled:en,fov:ei,setFov:eo,audioEnabled:es,setAudioEnabled:el,animationEnabled:eu,setAnimationEnabled:ec}=(0,E.useSettings)(),{speedMultiplier:ed,setSpeedMultiplier:ef,touchMode:eh,setTouchMode:em}=(0,E.useControls)(),{debugMode:ep,setDebugMode:eg}=(0,E.useDebug)(),ev=null!=r$(),[ey,eA]=(0,o.useState)(!1),eF=(0,o.useRef)(null),eb=(0,o.useRef)(null),eC=(0,o.useRef)(null);X[0]!==ey?(t=()=>{ey&&eF.current?.focus()},r=[ey],X[0]=ey,X[1]=t,X[2]=r):(t=X[1],r=X[2]),(0,o.useEffect)(t,r),X[3]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{let t=e.relatedTarget;t&&eC.current?.contains(t)||eA(!1)},X[3]=a):a=X[3];let eB=a;X[4]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{"Escape"===e.key&&(eA(!1),eb.current?.focus())},X[4]=s):s=X[4];let eS=s;return X[5]!==ev||X[6]!==Y||X[7]!==Z||X[8]!==$?(l=(0,n.jsx)("div",{className:f$.default.MissionSelectWrapper,children:(0,n.jsx)(li,{value:Y,missionType:Z,onChange:$,disabled:ev})}),X[5]=ev,X[6]=Y,X[7]=Z,X[8]=$,X[9]=l):l=X[9],X[10]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{eA(f1)},X[10]=u):u=X[10],X[11]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(fZ,{}),X[11]=c):c=X[11],X[12]!==ey?(d=(0,n.jsx)("button",{ref:eb,className:f$.default.Toggle,onClick:u,"aria-expanded":ey,"aria-controls":"settingsPanel","aria-label":"Settings",children:c}),X[12]=ey,X[13]=d):d=X[13],X[14]!==et||X[15]!==Y||X[16]!==Z?(f=(0,n.jsx)(lc,{cameraRef:et,missionName:Y,missionType:Z}),X[14]=et,X[15]=Y,X[16]=Z,X[17]=f):f=X[17],X[18]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)(fX,{}),X[18]=h):h=X[18],X[19]===Symbol.for("react.memo_cache_sentinel")?(m=(0,n.jsx)(fY,{}),p=(0,n.jsx)("span",{className:f$.default.ButtonLabel,children:"Show map info"}),X[19]=m,X[20]=p):(m=X[19],p=X[20]),X[21]!==ee?(g=(0,n.jsxs)("button",{type:"button",className:f$.default.MapInfoButton,"aria-label":"Show map info",onClick:ee,children:[m,p]}),X[21]=ee,X[22]=g):g=X[22],X[23]!==g||X[24]!==f?(v=(0,n.jsxs)("div",{className:f$.default.Group,children:[f,h,g]}),X[23]=g,X[24]=f,X[25]=v):v=X[25],X[26]!==en?(y=e=>{en(e.target.checked)},X[26]=en,X[27]=y):y=X[27],X[28]!==ea||X[29]!==y?(A=(0,n.jsx)("input",{id:"fogInput",type:"checkbox",checked:ea,onChange:y}),X[28]=ea,X[29]=y,X[30]=A):A=X[30],X[31]===Symbol.for("react.memo_cache_sentinel")?(F=(0,n.jsx)("label",{htmlFor:"fogInput",children:"Fog?"}),X[31]=F):F=X[31],X[32]!==A?(b=(0,n.jsxs)("div",{className:f$.default.CheckboxField,children:[A,F]}),X[32]=A,X[33]=b):b=X[33],X[34]!==el?(C=e=>{el(e.target.checked)},X[34]=el,X[35]=C):C=X[35],X[36]!==es||X[37]!==C?(B=(0,n.jsx)("input",{id:"audioInput",type:"checkbox",checked:es,onChange:C}),X[36]=es,X[37]=C,X[38]=B):B=X[38],X[39]===Symbol.for("react.memo_cache_sentinel")?(S=(0,n.jsx)("label",{htmlFor:"audioInput",children:"Audio?"}),X[39]=S):S=X[39],X[40]!==B?(x=(0,n.jsxs)("div",{className:f$.default.CheckboxField,children:[B,S]}),X[40]=B,X[41]=x):x=X[41],X[42]!==b||X[43]!==x?(M=(0,n.jsxs)("div",{className:f$.default.Group,children:[b,x]}),X[42]=b,X[43]=x,X[44]=M):M=X[44],X[45]!==ec?(D=e=>{ec(e.target.checked)},X[45]=ec,X[46]=D):D=X[46],X[47]!==eu||X[48]!==D?(I=(0,n.jsx)("input",{id:"animationInput",type:"checkbox",checked:eu,onChange:D}),X[47]=eu,X[48]=D,X[49]=I):I=X[49],X[50]===Symbol.for("react.memo_cache_sentinel")?(k=(0,n.jsx)("label",{htmlFor:"animationInput",children:"Animation?"}),X[50]=k):k=X[50],X[51]!==I?(w=(0,n.jsxs)("div",{className:f$.default.CheckboxField,children:[I,k]}),X[51]=I,X[52]=w):w=X[52],X[53]!==eg?(T=e=>{eg(e.target.checked)},X[53]=eg,X[54]=T):T=X[54],X[55]!==ep||X[56]!==T?(R=(0,n.jsx)("input",{id:"debugInput",type:"checkbox",checked:ep,onChange:T}),X[55]=ep,X[56]=T,X[57]=R):R=X[57],X[58]===Symbol.for("react.memo_cache_sentinel")?(P=(0,n.jsx)("label",{htmlFor:"debugInput",children:"Debug?"}),X[58]=P):P=X[58],X[59]!==R?(G=(0,n.jsxs)("div",{className:f$.default.CheckboxField,children:[R,P]}),X[59]=R,X[60]=G):G=X[60],X[61]!==w||X[62]!==G?(_=(0,n.jsxs)("div",{className:f$.default.Group,children:[w,G]}),X[61]=w,X[62]=G,X[63]=_):_=X[63],X[64]===Symbol.for("react.memo_cache_sentinel")?(L=(0,n.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),X[64]=L):L=X[64],X[65]!==eo?(j=e=>eo(parseInt(e.target.value)),X[65]=eo,X[66]=j):j=X[66],X[67]!==ei||X[68]!==ev||X[69]!==j?(O=(0,n.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:ei,disabled:ev,onChange:j}),X[67]=ei,X[68]=ev,X[69]=j,X[70]=O):O=X[70],X[71]!==ei?(N=(0,n.jsx)("output",{htmlFor:"fovInput",children:ei}),X[71]=ei,X[72]=N):N=X[72],X[73]!==O||X[74]!==N?(U=(0,n.jsxs)("div",{className:f$.default.Field,children:[L,O,N]}),X[73]=O,X[74]=N,X[75]=U):U=X[75],X[76]===Symbol.for("react.memo_cache_sentinel")?(H=(0,n.jsx)("label",{htmlFor:"speedInput",children:"Speed"}),X[76]=H):H=X[76],X[77]!==ef?(J=e=>ef(parseFloat(e.target.value)),X[77]=ef,X[78]=J):J=X[78],X[79]!==ev||X[80]!==ed||X[81]!==J?(V=(0,n.jsxs)("div",{className:f$.default.Field,children:[H,(0,n.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:ed,disabled:ev,onChange:J})]}),X[79]=ev,X[80]=ed,X[81]=J,X[82]=V):V=X[82],X[83]!==U||X[84]!==V?(K=(0,n.jsxs)("div",{className:f$.default.Group,children:[U,V]}),X[83]=U,X[84]=V,X[85]=K):K=X[85],X[86]!==er||X[87]!==em||X[88]!==eh?(z=er&&(0,n.jsx)("div",{className:f$.default.Group,children:(0,n.jsxs)("div",{className:f$.default.Field,children:[(0,n.jsx)("label",{htmlFor:"touchModeInput",children:"Joystick:"})," ",(0,n.jsxs)("select",{id:"touchModeInput",value:eh,onChange:e=>em(e.target.value),children:[(0,n.jsx)("option",{value:"dualStick",children:"Dual Stick"}),(0,n.jsx)("option",{value:"moveLookStick",children:"Single Stick"})]})]})}),X[86]=er,X[87]=em,X[88]=eh,X[89]=z):z=X[89],X[90]!==ey||X[91]!==v||X[92]!==M||X[93]!==_||X[94]!==K||X[95]!==z?(q=(0,n.jsxs)("div",{className:f$.default.Dropdown,ref:eF,id:"settingsPanel",tabIndex:-1,onKeyDown:eS,onBlur:eB,"data-open":ey,children:[v,M,_,K,z]}),X[90]=ey,X[91]=v,X[92]=M,X[93]=_,X[94]=K,X[95]=z,X[96]=q):q=X[96],X[97]!==q||X[98]!==d?(Q=(0,n.jsxs)("div",{ref:eC,children:[d,q]}),X[97]=q,X[98]=d,X[99]=Q):Q=X[99],X[100]!==Q||X[101]!==l?(W=(0,n.jsxs)("div",{id:"controls",className:f$.default.Controls,onKeyDown:f9,onPointerDown:f3,onClick:f2,children:[l,Q]}),X[100]=Q,X[101]=l,X[102]=W):W=X[102],W}function f1(e){return!e}function f2(e){return e.stopPropagation()}function f3(e){return e.stopPropagation()}function f9(e){return e.stopPropagation()}let f5=()=>null,f8=o.forwardRef(({envMap:e,resolution:t=256,frames:r=1/0,makeDefault:a,children:n,...i},s)=>{let l=(0,F.useThree)(({set:e})=>e),c=(0,F.useThree)(({camera:e})=>e),d=(0,F.useThree)(({size:e})=>e),f=o.useRef(null);o.useImperativeHandle(s,()=>f.current,[]);let h=o.useRef(null),m=function(e,t,r){let a=(0,F.useThree)(e=>e.size),n=(0,F.useThree)(e=>e.viewport),i="number"==typeof e?e:a.width*n.dpr,s=a.height*n.dpr,l=("number"==typeof e?void 0:e)||{},{samples:c=0,depth:d,...f}=l,h=null!=d?d:l.depthBuffer,m=o.useMemo(()=>{let e=new u.WebGLRenderTarget(i,s,{minFilter:u.LinearFilter,magFilter:u.LinearFilter,type:u.HalfFloatType,...f});return h&&(e.depthTexture=new u.DepthTexture(i,s,u.FloatType)),e.samples=c,e},[]);return o.useLayoutEffect(()=>{m.setSize(i,s),c&&(m.samples=c)},[c,m,i,s]),o.useEffect(()=>()=>m.dispose(),[]),m}(t);o.useLayoutEffect(()=>{i.manual||(f.current.aspect=d.width/d.height)},[d,i]),o.useLayoutEffect(()=>{f.current.updateProjectionMatrix()});let p=0,g=null,v="function"==typeof n;return(0,A.useFrame)(t=>{v&&(r===1/0||p{if(a)return l(()=>({camera:f.current})),()=>l(()=>({camera:c}))},[f,a,l]),o.createElement(o.Fragment,null,o.createElement("perspectiveCamera",(0,W.default)({ref:f},i),!v&&n),o.createElement("group",{ref:h},v&&n(m.texture)))});function f6(){let e,t,r=(0,i.c)(3),{fov:a}=(0,E.useSettings)();return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=[0,256,0],r[0]=e):e=r[0],r[1]!==a?(t=(0,n.jsx)(f8,{makeDefault:!0,position:e,fov:a}),r[1]=a,r[2]=t):t=r[2],t}var f4=e.i(51434),f7=e.i(81405);function he(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function ht({showPanel:e=0,className:t,parent:r}){let a=function(e,t=[],r){let[a,n]=o.useState();return o.useLayoutEffect(()=>{let t=e();return n(t),he(void 0,t),()=>he(void 0,null)},t),a}(()=>new f7.default,[]);return o.useEffect(()=>{if(a){let n=r&&r.current||document.body;a.showPanel(e),null==n||n.appendChild(a.dom);let i=(null!=t?t:"").split(" ").filter(e=>e);i.length&&a.dom.classList.add(...i);let o=(0,s.j)(()=>a.begin()),l=(0,s.k)(()=>a.end());return()=>{i.length&&a.dom.classList.remove(...i),null==n||n.removeChild(a.dom),o(),l()}}},[r,a,t,e]),null}var hr=e.i(60099),ha=e.i(55141);function hn(){let e,t,r=(0,i.c)(3),{debugMode:a}=(0,E.useDebug)(),s=(0,o.useRef)(null);return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=s.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},r[0]=e):e=r[0],(0,o.useEffect)(e),r[1]!==a?(t=a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ht,{className:ha.default.StatsPanel}),(0,n.jsx)("axesHelper",{ref:s,args:[70],renderOrder:999,children:(0,n.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),(0,n.jsx)(hr.Html,{position:[80,0,0],center:!0,children:(0,n.jsx)("span",{className:ha.default.AxisLabel,"data-axis":"y",children:"Y"})}),(0,n.jsx)(hr.Html,{position:[0,80,0],center:!0,children:(0,n.jsx)("span",{className:ha.default.AxisLabel,"data-axis":"z",children:"Z"})}),(0,n.jsx)(hr.Html,{position:[0,0,80],center:!0,children:(0,n.jsx)("span",{className:ha.default.AxisLabel,"data-axis":"x",children:"X"})})]}):null,r[1]=a,r[2]=t):t=r[2],t}let hi=new u.Vector3,ho=new u.Vector3,hs=new u.Matrix4,hl=new u.Vector3(0,1,0),hu=new u.Quaternion().setFromAxisAngle(new u.Vector3(0,1,0),Math.PI/2),hc=hu.clone().invert(),hd=0;function hf(e){return hd+=1,`${e}-${hd}`}function hh(e){e.wrapS=u.ClampToEdgeWrapping,e.wrapT=u.ClampToEdgeWrapping,e.minFilter=u.LinearFilter,e.magFilter=u.LinearFilter,e.colorSpace=u.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function hm(e,t){return t.set(e[1],e[2],e[0])}function hp(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,a=e.length-1;for(;a-r>1;){let n=r+a>>1;e[n].time<=t?r=n:a=n}return e[r]}function hg(e,t,r){let a=e.clone(!0),n=t.find(e=>"Root"===e.name);if(n){let e=new u.AnimationMixer(a);e.clipAction(n).play(),e.setTime(0)}a.updateMatrixWorld(!0);let i=null,o=null;return(a.traverse(e=>{i||e.name!==r||(i=new u.Vector3,o=new u.Quaternion,e.getWorldPosition(i),e.getWorldQuaternion(o))}),i&&o)?{position:i,quaternion:o}:null}let hv=new u.TextureLoader;function hy(e,t){let r=e.userData?.resource_path,a=new Set(e.userData?.flag_names??[]);if(!r){let t=new u.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return t_(t),t}let n=(0,y.textureToUrl)(r),i=hv.load(n);(0,C.setupTexture)(i);let o=tL(e,i,a,!1,t);return Array.isArray(o)?o[1]:o}function hA(e){let t=null;e.traverse(e=>{!t&&e.skeleton&&(t=e.skeleton)});let r=t?tB(t):new Set;e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"||(e.userData?.vis??1)<.01){e.visible=!1;return}if(e.geometry){let t=tS(e.geometry,r);!function(e){e.computeVertexNormals();let t=e.attributes.position,r=e.attributes.normal;if(!t||!r)return;let a=t.array,n=r.array,i=new Map;for(let e=0;e1){let t=0,r=0,a=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],a+=n[3*i+2];let i=Math.sqrt(t*t+r*r+a*a);for(let o of(i>0&&(t/=i,r/=i,a/=i),e))n[3*o]=t,n[3*o+1]=r,n[3*o+2]=a}r.needsUpdate=!0}(t=t.clone()),e.geometry=t}let t=e.userData?.vis??1;Array.isArray(e.material)?e.material=e.material.map(e=>hy(e,t)):e.material&&(e.material=hy(e.material,t))})}function hF(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}var hb=o;function hC(e){let t,r,a,s,l,c,d,f,h,m,p,g,v,y=(0,i.c)(28),{entity:F,timeRef:b}=e,C=(0,R.useEngineStoreApi)(),B=tj(F.dataBlock);if(y[0]!==B.scene){var S;let e,n,i;S=B.scene,e=new Map,n=new Map,i=S.clone(),function e(t,r,a){a(t,r);for(let n=0;n{t||"Mount0"!==e.name||(t=e)}),y[0]=B.scene,y[1]=t,y[2]=r,y[3]=a}else t=y[1],r=y[2],a=y[3];y[4]!==t||y[5]!==r||y[6]!==a?(s={clonedScene:a,mixer:r,mount0:t},y[4]=t,y[5]=r,y[6]=a,y[7]=s):s=y[7];let{clonedScene:x,mixer:E,mount0:M}=s;y[8]===Symbol.for("react.memo_cache_sentinel")?(l=new Map,y[8]=l):l=y[8];let D=(0,o.useRef)(l);y[9]===Symbol.for("react.memo_cache_sentinel")?(c={name:"Root",timeScale:1},y[9]=c):c=y[9];let I=(0,o.useRef)(c),k=(0,o.useRef)(!1);return y[10]!==B.animations||y[11]!==E?(d=()=>{let e=new Map;for(let t of B.animations){let r=E.clipAction(t);e.set(t.name.toLowerCase(),r)}D.current=e;let t=e.get("root");return t&&t.play(),I.current={name:"Root",timeScale:1},E.update(0),()=>{E.stopAllAction(),D.current=new Map}},f=[E,B.animations],y[10]=B.animations,y[11]=E,y[12]=d,y[13]=f):(d=y[12],f=y[13]),(0,o.useEffect)(d,f),y[14]!==C||y[15]!==F.keyframes||y[16]!==E||y[17]!==b?(h=(e,t)=>{let r=C.getState().playback,a="playing"===r.status,n=b.current,i=hp(F.keyframes,n),o=i?.damageState!=null&&i.damageState>=1,s=D.current;if(o&&!k.current){k.current=!0;let e=[...s.keys()].filter(hB);if(e.length>0){let t=e[Math.floor(Math.random()*e.length)],r=s.get(I.current.name.toLowerCase());r&&r.fadeOut(.25);let a=s.get(t);a.setLoop(u.LoopOnce,1),a.clampWhenFinished=!0,a.reset().fadeIn(.25).play(),I.current={name:t,timeScale:1}}}if(!o&&k.current){k.current=!1;let e=s.get(I.current.name.toLowerCase());e&&(e.stop(),e.setLoop(u.LoopRepeat,1/0),e.clampWhenFinished=!1),I.current={name:"Root",timeScale:1};let t=s.get("root");t&&t.reset().play()}if(!k.current){let e=function(e,t){if(!e)return{animation:"Root",timeScale:1};let[r,a,n]=e;if(n<-10)return{animation:"Fall",timeScale:1};let i=-2*Math.atan2(t[1],t[3]),o=Math.cos(i),s=Math.sin(i),l=r*o+a*s,u=-r*s+a*o,c=-u,d=-l,f=Math.max(u,c,d,l);return f<.1?{animation:"Root",timeScale:1}:f===u?{animation:"Forward",timeScale:1}:f===c?{animation:"Back",timeScale:1}:f===d?{animation:"Side",timeScale:1}:{animation:"Side",timeScale:-1}}(i?.velocity,i?.rotation??[0,0,0,1]),t=I.current;if(e.animation!==t.name||e.timeScale!==t.timeScale){let r=s.get(t.name.toLowerCase()),n=s.get(e.animation.toLowerCase());n&&(a&&r&&r!==n?(r.fadeOut(.25),n.reset().fadeIn(.25).play()):(r&&r!==n&&r.stop(),n.reset().play()),n.timeScale=e.timeScale,I.current={name:e.animation,timeScale:e.timeScale})}}a?E.update(t*r.rate):E.update(0)},y[14]=C,y[15]=F.keyframes,y[16]=E,y[17]=b,y[18]=h):h=y[18],(0,A.useFrame)(h),y[19]===Symbol.for("react.memo_cache_sentinel")?(m=[0,Math.PI/2,0],y[19]=m):m=y[19],y[20]!==x?(p=(0,n.jsx)("group",{rotation:m,children:(0,n.jsx)("primitive",{object:x})}),y[20]=x,y[21]=p):p=y[21],y[22]!==F.weaponShape||y[23]!==M?(g=F.weaponShape&&M&&(0,n.jsx)(hq,{fallback:null,children:(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(hS,{weaponShape:F.weaponShape,mount0:M})})}),y[22]=F.weaponShape,y[23]=M,y[24]=g):g=y[24],y[25]!==p||y[26]!==g?(v=(0,n.jsxs)(n.Fragment,{children:[p,g]}),y[25]=p,y[26]=g,y[27]=v):v=y[27],v}function hB(e){return e.startsWith("die")}function hS(e){let t,r,a=(0,i.c)(7),{weaponShape:n,mount0:s}=e,l=tj(n);return a[0]!==s||a[1]!==l.animations||a[2]!==l.scene?(t=()=>{let e=l.scene.clone(!0);hA(e);let t=hg(l.scene,l.animations,"Mountpoint");if(t){let r=t.quaternion.clone().invert(),a=t.position.clone().negate().applyQuaternion(r);e.position.copy(a),e.quaternion.copy(r)}return s.add(e),()=>{s.remove(e)}},a[0]=s,a[1]=l.animations,a[2]=l.scene,a[3]=t):t=a[3],a[4]!==s||a[5]!==l?(r=[l,s],a[4]=s,a[5]=l,a[6]=r):r=a[6],(0,o.useEffect)(t,r),null}function hx(e){let t,r,a=(0,i.c)(7),{shapeName:n,eyeOffsetRef:s}=e,l=tj(n);return a[0]!==s||a[1]!==l.animations||a[2]!==l.scene?(t=()=>{let e=hg(l.scene,l.animations,"Eye");e?s.current.set(e.position.z,e.position.y,-e.position.x):s.current.set(0,2.1,0)},a[0]=s,a[1]=l.animations,a[2]=l.scene,a[3]=t):t=a[3],a[4]!==s||a[5]!==l?(r=[l,s],a[4]=s,a[5]=l,a[6]=r):r=a[6],(0,o.useEffect)(t,r),null}function hE(e){let t,r,a,o=(0,i.c)(6),{shapeName:s,entityId:l}=e,u="number"==typeof l?l:0;o[0]!==u?(t={_class:"player",_className:"Player",_id:u},o[0]=u,o[1]=t):t=o[1];let c=t;return o[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,n.jsx)(tz,{loadingColor:"#00ff88"}),o[2]=r):r=o[2],o[3]!==s||o[4]!==c?(a=(0,n.jsx)(tI,{object:c,shapeName:s,type:"StaticShape",children:r}),o[3]=s,o[4]=c,o[5]=a):a=o[5],a}function hM(e){let t,r,a,o,s,l=(0,i.c)(16),{shapeName:u,playerShapeName:c}=e,d=tj(c),f=tj(u);if(l[0]!==d.animations||l[1]!==d.scene||l[2]!==f){e:{let e,r,a,n=hg(d.scene,d.animations,"Mount0");if(!n){let e;l[4]===Symbol.for("react.memo_cache_sentinel")?(e={position:void 0,quaternion:void 0},l[4]=e):e=l[4],t=e;break e}let i=hg(f.scene,f.animations,"Mountpoint");if(i){let t=i.quaternion.clone().invert(),a=i.position.clone().negate().applyQuaternion(t);r=n.quaternion.clone().multiply(t),e=a.clone().applyQuaternion(n.quaternion).add(n.position)}else e=n.position.clone(),r=n.quaternion.clone();let o=e.applyQuaternion(hu),s=hu.clone().multiply(r).multiply(hc);l[5]!==o||l[6]!==s?(a={position:o,quaternion:s},l[5]=o,l[6]=s,l[7]=a):a=l[7],t=a}l[0]=d.animations,l[1]=d.scene,l[2]=f,l[3]=t}else t=l[3];let h=t;l[8]===Symbol.for("react.memo_cache_sentinel")?(r={_class:"weapon",_className:"Weapon",_id:0},l[8]=r):r=l[8];let m=r;return l[9]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)(tz,{loadingColor:"#4488ff"}),l[9]=a):a=l[9],l[10]!==h.position||l[11]!==h.quaternion?(o=(0,n.jsx)("group",{position:h.position,quaternion:h.quaternion,children:a}),l[10]=h.position,l[11]=h.quaternion,l[12]=o):o=l[12],l[13]!==u||l[14]!==o?(s=(0,n.jsx)(tI,{object:m,shapeName:u,type:"Item",children:o}),l[13]=u,l[14]=o,l[15]=s):s=l[15],s}let hD=new u.Vector3,hI=new u.Vector3,hk=new u.Vector3,hw=new u.Vector3,hT=new u.Vector3,hR=new u.Vector3,hP=new u.Vector3(0,1,0);function hG(e){let t,r,a,o,s,l=(0,i.c)(14),{visual:c}=e;l[0]!==c.texture?(t=(0,y.textureToUrl)(c.texture),l[0]=c.texture,l[1]=t):t=l[1];let d=t,f=(0,B.useTexture)(d,h_),h=Array.isArray(f)?f[0]:f;l[2]!==c.color.b||l[3]!==c.color.g||l[4]!==c.color.r?(r=new u.Color().setRGB(c.color.r,c.color.g,c.color.b,u.SRGBColorSpace),l[2]=c.color.b,l[3]=c.color.g,l[4]=c.color.r,l[5]=r):r=l[5];let m=r;return l[6]!==c.size?(a=[c.size,c.size,1],l[6]=c.size,l[7]=a):a=l[7],l[8]!==m||l[9]!==h?(o=(0,n.jsx)("spriteMaterial",{map:h,color:m,transparent:!0,blending:u.AdditiveBlending,depthWrite:!1,toneMapped:!1}),l[8]=m,l[9]=h,l[10]=o):o=l[10],l[11]!==a||l[12]!==o?(s=(0,n.jsx)("sprite",{scale:a,children:o}),l[11]=a,l[12]=o,l[13]=s):s=l[13],s}function h_(e){hh(Array.isArray(e)?e[0]:e)}function hL(e){let t,r,a,s,l,c,d,f,h,m,p,g,v=(0,i.c)(28),{entity:F,visual:b}=e,C=(0,o.useRef)(null),S=(0,o.useRef)(null),x=(0,o.useRef)(null);v[0]===Symbol.for("react.memo_cache_sentinel")?(t=new u.Quaternion,v[0]=t):t=v[0];let E=(0,o.useRef)(t);v[1]!==b.texture?(r=(0,y.textureToUrl)(b.texture),v[1]=b.texture,v[2]=r):r=v[2];let M=b.crossTexture??b.texture;v[3]!==M?(a=(0,y.textureToUrl)(M),v[3]=M,v[4]=a):a=v[4],v[5]!==r||v[6]!==a?(s=[r,a],v[5]=r,v[6]=a,v[7]=s):s=v[7];let D=s,I=(0,B.useTexture)(D,hj);v[8]!==I?(l=Array.isArray(I)?I:[I,I],v[8]=I,v[9]=l):l=v[9];let[k,w]=l;return v[10]!==F||v[11]!==b.crossSize||v[12]!==b.crossViewAng||v[13]!==b.renderCross||v[14]!==b.tracerLength||v[15]!==b.tracerWidth?(c=e=>{var t;let{camera:r}=e,a=C.current,n=S.current;if(!a||!n)return;let i=F.keyframes[0],o=i?.position,s=F.direction??i?.velocity;if(!o||!s||(hm(s,hD),1e-8>hD.lengthSq())){a.visible=!1,x.current&&(x.current.visible=!1);return}hD.normalize(),a.visible=!0,hm(o,hR),hI.copy(hR).sub(r.position),hk.crossVectors(hI,hD),1e-8>hk.lengthSq()&&(hk.crossVectors(hP,hD),1e-8>hk.lengthSq()&&hk.set(1,0,0)),hk.normalize().multiplyScalar(b.tracerWidth);let l=.5*b.tracerLength;hw.copy(hD).multiplyScalar(-l),hT.copy(hD).multiplyScalar(l);let u=n.array;u[0]=hw.x+hk.x,u[1]=hw.y+hk.y,u[2]=hw.z+hk.z,u[3]=hw.x-hk.x,u[4]=hw.y-hk.y,u[5]=hw.z-hk.z,u[6]=hT.x-hk.x,u[7]=hT.y-hk.y,u[8]=hT.z-hk.z,u[9]=hT.x+hk.x,u[10]=hT.y+hk.y,u[11]=hT.z+hk.z,n.needsUpdate=!0;let c=x.current;if(!c)return;if(!b.renderCross){c.visible=!1;return}hI.normalize();let d=hD.dot(hI);if(d>-b.crossViewAng&&dhi.lengthSq()&&hi.set(-1,0,0),hi.normalize(),ho.crossVectors(hi,hD).normalize(),hs.set(hi.x,hD.x,ho.x,0,hi.y,hD.y,ho.y,0,hi.z,hD.z,ho.z,0,0,0,0,1),t.setFromRotationMatrix(hs),c.quaternion.copy(E.current),c.scale.setScalar(b.crossSize)},v[10]=F,v[11]=b.crossSize,v[12]=b.crossViewAng,v[13]=b.renderCross,v[14]=b.tracerLength,v[15]=b.tracerWidth,v[16]=c):c=v[16],(0,A.useFrame)(c),v[17]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)("bufferAttribute",{ref:S,attach:"attributes-position",args:[new Float32Array(12),3]}),v[17]=d):d=v[17],v[18]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)("bufferAttribute",{attach:"attributes-uv",args:[new Float32Array([0,0,0,1,1,1,1,0]),2]}),v[18]=f):f=v[18],v[19]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsxs)("bufferGeometry",{children:[d,f,(0,n.jsx)("bufferAttribute",{attach:"index",args:[new Uint16Array([0,1,2,0,2,3]),1]})]}),v[19]=h):h=v[19],v[20]!==k?(m=(0,n.jsxs)("mesh",{ref:C,children:[h,(0,n.jsx)("meshBasicMaterial",{map:k,transparent:!0,blending:u.AdditiveBlending,side:u.DoubleSide,depthWrite:!1,toneMapped:!1})]}),v[20]=k,v[21]=m):m=v[21],v[22]!==w||v[23]!==b.renderCross?(p=b.renderCross?(0,n.jsxs)("mesh",{ref:x,children:[(0,n.jsxs)("bufferGeometry",{children:[(0,n.jsx)("bufferAttribute",{attach:"attributes-position",args:[new Float32Array([-.5,0,-.5,.5,0,-.5,.5,0,.5,-.5,0,.5]),3]}),(0,n.jsx)("bufferAttribute",{attach:"attributes-uv",args:[new Float32Array([0,0,0,1,1,1,1,0]),2]}),(0,n.jsx)("bufferAttribute",{attach:"index",args:[new Uint16Array([0,1,2,0,2,3]),1]})]}),(0,n.jsx)("meshBasicMaterial",{map:w,transparent:!0,blending:u.AdditiveBlending,side:u.DoubleSide,depthWrite:!1,toneMapped:!1})]}):null,v[22]=w,v[23]=b.renderCross,v[24]=p):p=v[24],v[25]!==m||v[26]!==p?(g=(0,n.jsxs)(n.Fragment,{children:[m,p]}),v[25]=m,v[26]=p,v[27]=g):g=v[27],g}function hj(e){for(let t of Array.isArray(e)?e:[e])hh(t)}var hO=e.i(29418);let hN=(0,y.textureToUrl)("gui/hud_alliedtriangle"),hU=(0,y.textureToUrl)("gui/hud_enemytriangle"),hH=new u.Vector3;function hJ(e){let t,r,a,s,l,c,d=(0,i.c)(22),{entity:f,timeRef:h}=e,m=tj(f.dataBlock),{camera:p}=(0,F.useThree)(),g=(0,o.useRef)(null),v=(0,o.useRef)(null),y=(0,o.useRef)(null),b=(0,o.useRef)(null),C=(0,o.useRef)(null),[B,S]=(0,o.useState)(!0);e:{if(f.playerName){t=f.playerName;break e}if("string"==typeof f.id){let e;if(d[0]!==f.id){let t;d[2]===Symbol.for("react.memo_cache_sentinel")?(t=/^player_/,d[2]=t):t=d[2],e=f.id.replace(t,"Player "),d[0]=f.id,d[1]=e}else e=d[1];t=e;break e}t=`Player ${f.id}`}let x=t;d[3]!==m.scene?(r=new u.Box3().setFromObject(m.scene),d[3]=m.scene,d[4]=r):r=d[4];let E=r.max.y+.1;d[5]!==f.keyframes?(a=f.keyframes.some(hV),d[5]=f.keyframes,d[6]=a):a=d[6];let M=a;d[7]!==p||d[8]!==f.iffColor||d[9]!==f.keyframes||d[10]!==M||d[11]!==B||d[12]!==h?(s=()=>{let e=g.current;if(!e)return;e.getWorldPosition(hH);let t=p.position.distanceTo(hH),r=p.matrixWorld.elements,a=!(-((hH.x-r[12])*r[8])+-((hH.y-r[13])*r[9])+-((hH.z-r[14])*r[10])<0)&&t<150;if(B!==a&&S(a),!a)return;let n=hp(f.keyframes,h.current),i=n?.health??1;if(n?.damageState!=null&&n.damageState>=1){v.current&&(v.current.style.opacity="0"),y.current&&(y.current.style.opacity="0");return}let o=Math.max(0,Math.min(1,1-t/150)).toString();if(v.current&&(v.current.style.opacity=o),y.current&&(y.current.style.opacity=o),C.current&&f.iffColor){let e=f.iffColor.r>f.iffColor.g?hU:hN;C.current.src!==e&&(C.current.src=e)}b.current&&M&&(b.current.style.width=`${Math.max(0,Math.min(100,100*i))}%`,b.current.style.background=f.iffColor?`rgb(${f.iffColor.r}, ${f.iffColor.g}, ${f.iffColor.b})`:"")},d[7]=p,d[8]=f.iffColor,d[9]=f.keyframes,d[10]=M,d[11]=B,d[12]=h,d[13]=s):s=d[13],(0,A.useFrame)(s);let D=f.iffColor&&f.iffColor.r>f.iffColor.g?hU:hN;return d[14]!==x||d[15]!==M||d[16]!==E||d[17]!==D||d[18]!==B?(l=B&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(hr.Html,{position:[0,E,0],center:!0,children:(0,n.jsx)("div",{ref:v,className:hO.default.Top,children:(0,n.jsx)("img",{ref:C,className:hO.default.IffArrow,src:D,alt:""})})}),(0,n.jsx)(hr.Html,{position:[0,-.2,0],center:!0,children:(0,n.jsxs)("div",{ref:y,className:hO.default.Bottom,children:[(0,n.jsx)("div",{className:hO.default.Name,children:x}),M&&(0,n.jsx)("div",{className:hO.default.HealthBar,children:(0,n.jsx)("div",{ref:b,className:hO.default.HealthFill})})]})})]}),d[14]=x,d[15]=M,d[16]=E,d[17]=D,d[18]=B,d[19]=l):l=d[19],d[20]!==l?(c=(0,n.jsx)("group",{ref:g,children:l}),d[20]=l,d[21]=c):c=d[21],c}function hV(e){return null!=e.health}function hK(e){let t,r,a,o,s,l,u,c,d=(0,i.c)(80),{entity:f,timeRef:h}=e,m=(0,R.useEngineStoreApi)(),p=(0,E.useDebug)(),g=p?.debugMode??!1,v=String(f.id);if(f.visual?.kind==="tracer"){let e,t,r,a,i;return d[0]===Symbol.for("react.memo_cache_sentinel")?(e={demoVisualKind:"tracer"},d[0]=e):e=d[0],d[1]!==f?(t=(0,n.jsx)(hb.Suspense,{fallback:null,children:(0,n.jsx)(hL,{entity:f,visual:f.visual})}),d[1]=f,d[2]=t):t=d[2],d[3]!==g||d[4]!==f?(r=g?(0,n.jsx)(hz,{entity:f}):null,d[3]=g,d[4]=f,d[5]=r):r=d[5],d[6]!==t||d[7]!==r?(a=(0,n.jsxs)("group",{name:"model",userData:e,children:[t,r]}),d[6]=t,d[7]=r,d[8]=a):a=d[8],d[9]!==v||d[10]!==a?(i=(0,n.jsx)("group",{name:v,children:a}),d[9]=v,d[10]=a,d[11]=i):i=d[11],i}if(f.visual?.kind==="sprite"){let e,t,r,a,i;return d[12]===Symbol.for("react.memo_cache_sentinel")?(e={demoVisualKind:"sprite"},d[12]=e):e=d[12],d[13]!==f.visual?(t=(0,n.jsx)(hb.Suspense,{fallback:null,children:(0,n.jsx)(hG,{visual:f.visual})}),d[13]=f.visual,d[14]=t):t=d[14],d[15]!==g||d[16]!==f?(r=g?(0,n.jsx)(hz,{entity:f}):null,d[15]=g,d[16]=f,d[17]=r):r=d[17],d[18]!==t||d[19]!==r?(a=(0,n.jsxs)("group",{name:"model",userData:e,children:[t,r]}),d[18]=t,d[19]=r,d[20]=a):a=d[20],d[21]!==v||d[22]!==a?(i=(0,n.jsx)("group",{name:v,children:a}),d[21]=v,d[22]=a,d[23]=i):i=d[23],i}if(!f.dataBlock){let e,t,r,a,i,o;return d[24]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("sphereGeometry",{args:[.3,6,4]}),d[24]=e):e=d[24],d[25]!==f.type?(t=hF(f.type),d[25]=f.type,d[26]=t):t=d[26],d[27]!==t?(r=(0,n.jsxs)("mesh",{children:[e,(0,n.jsx)("meshBasicMaterial",{color:t,wireframe:!0})]}),d[27]=t,d[28]=r):r=d[28],d[29]!==g||d[30]!==f?(a=g?(0,n.jsx)(hz,{entity:f}):null,d[29]=g,d[30]=f,d[31]=a):a=d[31],d[32]!==r||d[33]!==a?(i=(0,n.jsxs)("group",{name:"model",children:[r,a]}),d[32]=r,d[33]=a,d[34]=i):i=d[34],d[35]!==v||d[36]!==i?(o=(0,n.jsx)("group",{name:v,children:i}),d[35]=v,d[36]=i,d[37]=o):o=d[37],o}d[38]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("sphereGeometry",{args:[.5,8,6]}),d[38]=t):t=d[38],d[39]!==f.type?(r=hF(f.type),d[39]=f.type,d[40]=r):r=d[40],d[41]!==r?(a=(0,n.jsxs)("mesh",{children:[t,(0,n.jsx)("meshBasicMaterial",{color:r,wireframe:!0})]}),d[41]=r,d[42]=a):a=d[42];let y=a;if("Player"===f.type){let e,t,r,a,i,o,s;d[43]!==m?(e=m.getState().playback.recording?.controlPlayerGhostId,d[43]=m,d[44]=e):e=d[44];let l=f.id===e;return d[45]!==f||d[46]!==h?(t=(0,n.jsx)(hC,{entity:f,timeRef:h}),d[45]=f,d[46]=h,d[47]=t):t=d[47],d[48]!==y||d[49]!==t?(r=(0,n.jsx)(hb.Suspense,{fallback:y,children:t}),d[48]=y,d[49]=t,d[50]=r):r=d[50],d[51]!==y||d[52]!==r?(a=(0,n.jsx)(hq,{fallback:y,children:r}),d[51]=y,d[52]=r,d[53]=a):a=d[53],d[54]!==f||d[55]!==l||d[56]!==h?(i=!l&&(0,n.jsx)(hb.Suspense,{fallback:null,children:(0,n.jsx)(hJ,{entity:f,timeRef:h})}),d[54]=f,d[55]=l,d[56]=h,d[57]=i):i=d[57],d[58]!==a||d[59]!==i?(o=(0,n.jsxs)("group",{name:"model",children:[a,i]}),d[58]=a,d[59]=i,d[60]=o):o=d[60],d[61]!==v||d[62]!==o?(s=(0,n.jsx)("group",{name:v,children:o}),d[61]=v,d[62]=o,d[63]=s):s=d[63],s}return d[64]!==f.dataBlock||d[65]!==f.id?(o=(0,n.jsx)(hE,{shapeName:f.dataBlock,entityId:f.id}),d[64]=f.dataBlock,d[65]=f.id,d[66]=o):o=d[66],d[67]!==y||d[68]!==o?(s=(0,n.jsx)(hb.Suspense,{fallback:y,children:o}),d[67]=y,d[68]=o,d[69]=s):s=d[69],d[70]!==y||d[71]!==s?(l=(0,n.jsx)("group",{name:"model",children:(0,n.jsx)(hq,{fallback:y,children:s})}),d[70]=y,d[71]=s,d[72]=l):l=d[72],d[73]!==f.dataBlock||d[74]!==f.weaponShape?(u=f.weaponShape&&(0,n.jsx)("group",{name:"weapon",children:(0,n.jsx)(hq,{fallback:null,children:(0,n.jsx)(hb.Suspense,{fallback:null,children:(0,n.jsx)(hM,{shapeName:f.weaponShape,playerShapeName:f.dataBlock})})})}),d[73]=f.dataBlock,d[74]=f.weaponShape,d[75]=u):u=d[75],d[76]!==v||d[77]!==l||d[78]!==u?(c=(0,n.jsxs)("group",{name:v,children:[l,u]}),d[76]=v,d[77]=l,d[78]=u,d[79]=c):c=d[79],c}function hz(e){let t,r,a=(0,i.c)(9),{entity:o}=e,s=String(o.id);a[0]!==o.className||a[1]!==o.dataBlockId||a[2]!==o.ghostIndex||a[3]!==o.shapeHint||a[4]!==o.type||a[5]!==s?((t=[]).push(`${s} (${o.type})`),o.className&&t.push(`class ${o.className}`),"number"==typeof o.ghostIndex&&t.push(`ghost ${o.ghostIndex}`),"number"==typeof o.dataBlockId&&t.push(`db ${o.dataBlockId}`),t.push(o.shapeHint?`shapeHint ${o.shapeHint}`:"shapeHint "),a[0]=o.className,a[1]=o.dataBlockId,a[2]=o.ghostIndex,a[3]=o.shapeHint,a[4]=o.type,a[5]=s,a[6]=t):t=a[6];let l=t.join(" | ");return a[7]!==l?(r=(0,n.jsx)(e3.FloatingLabel,{color:"#ff6688",children:l}),a[7]=l,a[8]=r):r=a[8],r}class hq extends hb.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.warn("[demo] Shape load failed:",e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}let hQ=new u.Vector3,hW=new u.Quaternion,hX=new u.Quaternion,hY=new u.Vector3,hZ=new u.Vector3,h$=new u.Vector3,h0=new u.Vector3,h1=new u.Raycaster,h2=0,h3=0;function h9({recording:e}){let t=(0,R.useEngineStoreApi)(),r=(0,o.useRef)(null);r.current||(r.current=hf("StreamingDemoPlayback"));let a=(0,o.useRef)(null),i=(0,o.useRef)(0),s=(0,o.useRef)(0),l=(0,o.useRef)(null),c=(0,o.useRef)(null),d=(0,o.useRef)(new u.Vector3(0,2.1,0)),f=(0,o.useRef)(e.streamingPlayback??null),h=(0,o.useRef)(null),m=(0,o.useRef)(""),p=(0,o.useRef)(new Map),g=(0,o.useRef)(0),v=(0,o.useRef)(!1),[F,b]=(0,o.useState)([]),[C,B]=(0,o.useState)(null);(0,o.useEffect)(()=>{h2+=1;let a=Date.now();return t.getState().recordPlaybackDiagnosticEvent({kind:"component.lifecycle",message:"StreamingDemoPlayback mounted",meta:{component:"StreamingDemoPlayback",phase:"mount",instanceId:r.current,mountCount:h2,unmountCount:h3,recordingMissionName:e.missionName??null,recordingDurationSec:Number(e.duration.toFixed(3)),ts:a}}),console.info("[demo diagnostics] StreamingDemoPlayback mounted",{instanceId:r.current,mountCount:h2,unmountCount:h3,recordingMissionName:e.missionName??null,mountedAt:a}),()=>{h3+=1;let a=Date.now();t.getState().recordPlaybackDiagnosticEvent({kind:"component.lifecycle",message:"StreamingDemoPlayback unmounted",meta:{component:"StreamingDemoPlayback",phase:"unmount",instanceId:r.current,mountCount:h2,unmountCount:h3,recordingMissionName:e.missionName??null,ts:a}}),console.info("[demo diagnostics] StreamingDemoPlayback unmounted",{instanceId:r.current,mountCount:h2,unmountCount:h3,recordingMissionName:e.missionName??null,unmountedAt:a})}},[t]);let S=(0,o.useCallback)(e=>{let r=p.current.size,a=function(e){let t=[];for(let r of e.entities){let e=r.visual?.kind==="tracer"?`tracer:${r.visual.texture}:${r.visual.crossTexture??""}:${r.visual.tracerLength}:${r.visual.tracerWidth}:${r.visual.crossViewAng}:${r.visual.crossSize}:${+!!r.visual.renderCross}`:r.visual?.kind==="sprite"?`sprite:${r.visual.texture}:${r.visual.color.r}:${r.visual.color.g}:${r.visual.color.b}:${r.visual.size}`:"";t.push(`${r.id}|${r.type}|${r.dataBlock??""}|${r.weaponShape??""}|${r.playerName??""}|${r.className??""}|${r.ghostIndex??""}|${r.dataBlockId??""}|${r.shapeHint??""}|${r.faceViewer?"fv":""}|${e}`)}return t.sort(),t.join(";")}(e),n=m.current!==a,i=new Map;for(let t of e.entities){var o,s,l,u,c,d,f,h,v;let r=p.current.get(t.id);r&&r.type===t.type&&r.dataBlock===t.dataBlock&&r.weaponShape===t.weaponShape&&r.className===t.className&&r.ghostIndex===t.ghostIndex&&r.dataBlockId===t.dataBlockId&&r.shapeHint===t.shapeHint||(o=t.id,s=t.type,l=t.dataBlock,u=t.visual,c=t.direction,d=t.weaponShape,f=t.playerName,h=t.className,v=t.ghostIndex,r={id:o,type:s,dataBlock:l,visual:u,direction:c,weaponShape:d,playerName:f,className:h,ghostIndex:v,dataBlockId:t.dataBlockId,shapeHint:t.shapeHint,keyframes:[{time:0,position:[0,0,0],rotation:[0,0,0,1]}]}),r.playerName=t.playerName,r.iffColor=t.iffColor,r.dataBlock=t.dataBlock,r.visual=t.visual,r.direction=t.direction,r.weaponShape=t.weaponShape,r.className=t.className,r.ghostIndex=t.ghostIndex,r.dataBlockId=t.dataBlockId,r.shapeHint=t.shapeHint,0===r.keyframes.length&&r.keyframes.push({time:e.timeSec,position:t.position??[0,0,0],rotation:t.rotation??[0,0,0,1]});let a=r.keyframes[0];a.time=e.timeSec,t.position&&(a.position=t.position),t.rotation&&(a.rotation=t.rotation),a.velocity=t.velocity,a.health=t.health,a.energy=t.energy,a.actionAnim=t.actionAnim,a.actionAtEnd=t.actionAtEnd,a.damageState=t.damageState,i.set(t.id,r)}if(p.current=i,n){m.current=a,b(Array.from(i.values()));let n=Date.now();n-g.current>=500&&(g.current=n,t.getState().recordPlaybackDiagnosticEvent({kind:"stream.entities.rebuild",message:"Renderable demo entity list was rebuilt",meta:{previousEntityCount:r,nextEntityCount:i.size,snapshotTimeSec:Number(e.timeSec.toFixed(3))}}))}let y=null;if(e.camera?.mode==="first-person"&&e.camera.controlEntityId){let t=i.get(e.camera.controlEntityId);t?.dataBlock&&(y=t.dataBlock)}B(e=>e===y?e:y)},[t]);return(0,o.useEffect)(()=>{f.current=e.streamingPlayback??null,p.current=new Map,m.current="",h.current=null,i.current=0,s.current=0,l.current=null,c.current=null,v.current=!1;let r=f.current;if(!r)return void t.getState().setPlaybackStreamSnapshot(null);for(let e of(r.reset(),r.getEffectShapes()))e2.preload((0,y.shapeToUrl)(e));let a=r.getSnapshot();return i.current=a.timeSec,s.current=a.timeSec,l.current=a,c.current=a,S(a),t.getState().setPlaybackStreamSnapshot(a),h.current=a,()=>{t.getState().setPlaybackStreamSnapshot(null)}},[e,t,S]),(0,A.useFrame)((e,r)=>{let n=f.current;if(!n)return;let o=t.getState(),u=o.playback,m="playing"===u.status,p=u.timeMs/1e3,g=!m&&Math.abs(p-s.current)>5e-4,y=m&&Math.abs(p-i.current)>.05,A=g||y;A&&(s.current=p),m&&(s.current+=r*u.rate);let F=Math.max(1,Math.ceil(1e3*r*Math.max(u.rate,.01)/32)+2),b=s.current+.032,C=n.stepToTime(b,m&&!A?F:1/0),B=c.current;!B||C.timeSec.048?(l.current=C,c.current=C):C.timeSec!==B.timeSec&&(l.current=B,c.current=C);let x=c.current??C,E=l.current??x,M=x.timeSec-.032,D=Math.max(0,Math.min(1,(s.current-M)/.032));i.current=s.current,C.exhausted&&m&&(s.current=Math.min(s.current,C.timeSec)),S(x);let I=h.current;I&&x.timeSec===I.timeSec&&x.exhausted===I.exhausted&&x.status.health===I.status.health&&x.status.energy===I.status.energy&&x.camera?.mode===I.camera?.mode&&x.camera?.controlEntityId===I.camera?.controlEntityId&&x.camera?.orbitTargetId===I.camera?.orbitTargetId||(h.current=x,o.setPlaybackStreamSnapshot(x));let k=x.camera,w=k&&E.camera&&E.camera.mode===k.mode&&E.camera.controlEntityId===k.controlEntityId&&E.camera.orbitTargetId===k.orbitTargetId?E.camera:null;if(k){if(w){let t=w.position[0],r=w.position[1],a=w.position[2],n=k.position[0],i=k.position[1],o=k.position[2];e.camera.position.set(r+(i-r)*D,a+(o-a)*D,t+(n-t)*D),hW.set(...w.rotation),hX.set(...k.rotation),hW.slerp(hX,D),e.camera.quaternion.copy(hW)}else e.camera.position.set(k.position[1],k.position[2],k.position[0]),e.camera.quaternion.set(...k.rotation);if(Number.isFinite(k.fov)&&"isPerspectiveCamera"in e.camera&&e.camera.isPerspectiveCamera){var T,R;let t=e.camera,r=(T=w&&Number.isFinite(w.fov)?w.fov+(k.fov-w.fov)*D:k.fov,180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,T))*Math.PI/180/2)/(Number.isFinite(R=t.aspect)&&R>1e-6?R:4/3)))/Math.PI);Math.abs(t.fov-r)>.01&&(t.fov=r,t.updateProjectionMatrix())}}let P=new Map(x.entities.map(e=>[e.id,e])),G=new Map(E.entities.map(e=>[e.id,e])),_=a.current;if(_)for(let t of _.children){let r=P.get(t.name);if(!r?.position){t.visible=!1;continue}t.visible=!0;let a=G.get(t.name);if(a?.position){let e=a.position[0],n=a.position[1],i=a.position[2],o=r.position[0],s=r.position[1],l=r.position[2],u=e+(o-e)*D,c=n+(s-n)*D,d=i+(l-i)*D;t.position.set(c,d,u)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion):r.visual?.kind==="tracer"?t.quaternion.identity():r.rotation&&(a?.rotation?(hW.set(...a.rotation),hX.set(...r.rotation),hW.slerp(hX,D),t.quaternion.copy(hW)):t.quaternion.set(...r.rotation))}let L=k?.mode;if("third-person"===L&&_&&k?.orbitTargetId){let t=_.children.find(e=>e.name===k.orbitTargetId);if(t){let r=P.get(k.orbitTargetId);hZ.copy(t.position),r?.type==="Player"&&(hZ.y+=1);let a=!1;if("number"==typeof k.yaw&&"number"==typeof k.pitch){let e=Math.sin(k.pitch),t=Math.cos(k.pitch),r=Math.sin(k.yaw),n=Math.cos(k.yaw);hY.set(-t,-r*e,-n*e),a=hY.lengthSq()>1e-8}if(a||(hY.copy(e.camera.position).sub(hZ),a=hY.lengthSq()>1e-8),a){hY.normalize();let t=Math.max(.1,k.orbitDistance??4);for(let r of(h$.copy(hZ).addScaledVector(hY,t),h1.near=.001,h1.far=2.5*t,h1.camera=e.camera,h1.set(hZ,hY),h1.intersectObjects(e.scene.children,!0))){if(r.distance<=1e-4||function(e,t){let r=e;for(;r;){if(r.name===t)return!0;r=r.parent}return!1}(r.object,k.orbitTargetId))continue;if(!r.face)break;h0.copy(r.face.normal).transformDirection(r.object.matrixWorld);let e=-hY.dot(h0);if(e>.01){let a=r.distance-.05/e;a>t&&(a=t),a<0&&(a=0),h$.copy(hZ).addScaledVector(hY,a)}break}e.camera.position.copy(h$),e.camera.lookAt(hZ)}}}if("first-person"===L&&_&&k?.controlEntityId){let t=_.children.find(e=>e.name===k.controlEntityId);t?(hQ.copy(d.current).applyQuaternion(t.quaternion),e.camera.position.add(hQ)):e.camera.position.y+=d.current.y}m&&C.exhausted?(v.current||(v.current=!0,o.recordPlaybackDiagnosticEvent({kind:"stream.exhausted",message:"Streaming playback reached end-of-stream while playing",meta:{streamTimeSec:Number(C.timeSec.toFixed(3)),requestedPlaybackSec:Number(s.current.toFixed(3))}})),o.setPlaybackStatus("paused")):C.exhausted||(v.current=!1);let j=1e3*s.current;Math.abs(j-u.timeMs)>.5&&o.setPlaybackTime(j)}),(0,n.jsxs)(tP,{children:[(0,n.jsx)("group",{ref:a,children:F.map(e=>(0,n.jsx)(hK,{entity:e,timeRef:i},e.id))}),C&&(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(hx,{shapeName:C,eyeOffsetRef:d})})]})}let h5=0,h8=0;function h6({recording:e}){let{gl:t,scene:r}=(0,F.useThree)(),a=(0,R.useEngineStoreApi)(),n=(0,o.useRef)(null),i=(0,o.useRef)(0);return(0,o.useEffect)(()=>{a.getState().recordPlaybackDiagnosticEvent({kind:"recording.loaded",meta:{missionName:e.missionName??null,gameType:e.gameType??null,isMetadataOnly:!!e.isMetadataOnly,isPartial:!!e.isPartial,hasStreamingPlayback:!!e.streamingPlayback,durationSec:Number(e.duration.toFixed(3))}})},[a]),(0,o.useEffect)(()=>{let e=t.domElement;if(!e)return;let r=()=>{try{let e=t.getContext();if(e&&"function"==typeof e.isContextLost)return!!e.isContextLost()}catch{}},n=e=>{e.preventDefault();let t=a.getState();t.setWebglContextLost(!0),t.recordPlaybackDiagnosticEvent({kind:"webgl.context.lost",message:"Renderer emitted webglcontextlost",meta:{contextLost:r()}}),console.error("[demo diagnostics] WebGL context lost")},i=()=>{let e=a.getState();e.setWebglContextLost(!1),e.recordPlaybackDiagnosticEvent({kind:"webgl.context.restored",message:"Renderer emitted webglcontextrestored",meta:{contextLost:r()}}),console.warn("[demo diagnostics] WebGL context restored")},o=e=>{a.getState().recordPlaybackDiagnosticEvent({kind:"webgl.context.creation_error",message:e.statusMessage??"Context creation error",meta:{contextLost:r()}}),console.error("[demo diagnostics] WebGL context creation error",e.statusMessage??"")};return e.addEventListener("webglcontextlost",n,!1),e.addEventListener("webglcontextrestored",i,!1),e.addEventListener("webglcontextcreationerror",o,!1),()=>{e.removeEventListener("webglcontextlost",n,!1),e.removeEventListener("webglcontextrestored",i,!1),e.removeEventListener("webglcontextcreationerror",o,!1)}},[a,t]),(0,o.useEffect)(()=>{let e=()=>{let e,o,{sceneObjects:s,visibleSceneObjects:l}=(e=0,o=0,r.traverse(t=>{e+=1,t.visible&&(o+=1)}),{sceneObjects:e,visibleSceneObjects:o}),u=Array.isArray(t.info.programs)?t.info.programs.length:0,c=performance.memory,d={t:Date.now(),geometries:t.info.memory.geometries,textures:t.info.memory.textures,programs:u,renderCalls:t.info.render.calls,renderTriangles:t.info.render.triangles,renderPoints:t.info.render.points,renderLines:t.info.render.lines,sceneObjects:s,visibleSceneObjects:l,jsHeapUsed:c?.usedJSHeapSize,jsHeapTotal:c?.totalJSHeapSize,jsHeapLimit:c?.jsHeapSizeLimit};a.getState().appendRendererSample(d);let f=n.current;if(n.current={geometries:d.geometries,textures:d.textures,programs:d.programs,sceneObjects:d.sceneObjects,visibleSceneObjects:d.visibleSceneObjects},!f)return;let h=d.t,m=d.geometries-f.geometries,p=d.textures-f.textures,g=d.programs-f.programs,v=d.sceneObjects-f.sceneObjects;h-i.current>=5e3&&(m>=200||p>=100||g>=20||v>=400)&&(i.current=h,a.getState().recordPlaybackDiagnosticEvent({kind:"renderer.resource.spike",message:"Detected large one-second renderer resource increase",meta:{geometryDelta:m,textureDelta:p,programDelta:g,sceneObjectDelta:v,geometries:d.geometries,textures:d.textures,programs:d.programs,sceneObjects:d.sceneObjects}}))};e();let o=window.setInterval(e,1e3);return()=>{window.clearInterval(o)}},[a,t,r]),null}function h4(){let e=(0,R.useEngineStoreApi)(),t=r$(),r=(0,o.useRef)(null);return(r.current||(r.current=hf("DemoPlayback")),(0,o.useEffect)(()=>{h5+=1;let a=Date.now();return e.getState().recordPlaybackDiagnosticEvent({kind:"component.lifecycle",message:"DemoPlayback mounted",meta:{component:"DemoPlayback",phase:"mount",instanceId:r.current,mountCount:h5,unmountCount:h8,recordingMissionName:t?.missionName??null,recordingDurationSec:t?Number(t.duration.toFixed(3)):null,ts:a}}),console.info("[demo diagnostics] DemoPlayback mounted",{instanceId:r.current,mountCount:h5,unmountCount:h8,recordingMissionName:t?.missionName??null,mountedAt:a}),()=>{h8+=1;let a=Date.now();e.getState().recordPlaybackDiagnosticEvent({kind:"component.lifecycle",message:"DemoPlayback unmounted",meta:{component:"DemoPlayback",phase:"unmount",instanceId:r.current,mountCount:h5,unmountCount:h8,recordingMissionName:t?.missionName??null,ts:a}}),console.info("[demo diagnostics] DemoPlayback unmounted",{instanceId:r.current,mountCount:h5,unmountCount:h8,recordingMissionName:t?.missionName??null,unmountedAt:a})}},[e]),t)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h6,{recording:t}),(0,n.jsx)(h9,{recording:t})]}):null}var h7=e.i(30064),me=e.i(21629);let mt=[.25,.5,1,2,4];function mr(e){let t=Math.floor(e/60),r=Math.floor(e%60);return`${t}:${r.toString().padStart(2,"0")}`}function ma(){let e,t,r,a,o,s,l,u,c,d,f,h,m,p,g,v,y,A,F,b,C=(0,i.c)(55),B=r$(),S=r1(),x=r3(),E=(0,R.useEngineSelector)(r5),M=(0,R.useEngineSelector)(r8),{play:D,pause:I,seek:k,setSpeed:w}=r6(),T=(0,R.useEngineStoreApi)(),P=(0,R.useEngineSelector)(mf),G=(0,R.useEngineSelector)(md),_=(0,R.useEngineSelector)(mc),L=(0,R.useEngineSelector)(mu),j=(0,R.useEngineSelector)(ml);C[0]!==k?(e=e=>{k(parseFloat(e.target.value))},C[0]=k,C[1]=e):e=C[1];let O=e;C[2]!==w?(t=e=>{w(parseFloat(e.target.value))},C[2]=w,C[3]=t):t=C[3];let N=t;C[4]!==T?(r=()=>{let e=T.getState(),t=(0,h7.buildSerializableDiagnosticsSnapshot)(e),r=(0,h7.buildSerializableDiagnosticsJson)(e);console.log("[demo diagnostics dump]",t),console.log("[demo diagnostics dump json]",r)},C[4]=T,C[5]=r):r=C[5];let U=r;C[6]!==T?(a=()=>{T.getState().clearPlaybackDiagnostics(),console.info("[demo diagnostics] Cleared playback diagnostics")},C[6]=T,C[7]=a):a=C[7];let H=a;if(!B)return null;let J=S?I:D,V=S?"Pause":"Play",K=S?"❚❚":"▶";C[8]!==J||C[9]!==V||C[10]!==K?(o=(0,n.jsx)("button",{className:me.default.PlayPause,onClick:J,"aria-label":V,children:K}),C[8]=J,C[9]=V,C[10]=K,C[11]=o):o=C[11],C[12]!==x?(s=mr(x),C[12]=x,C[13]=s):s=C[13],C[14]!==E?(l=mr(E),C[14]=E,C[15]=l):l=C[15];let z=`${s} / ${l}`;C[16]!==z?(u=(0,n.jsx)("span",{className:me.default.Time,children:z}),C[16]=z,C[17]=u):u=C[17],C[18]!==x||C[19]!==E||C[20]!==O?(c=(0,n.jsx)("input",{className:me.default.Seek,type:"range",min:0,max:E,step:.01,value:x,onChange:O}),C[18]=x,C[19]=E,C[20]=O,C[21]=c):c=C[21],C[22]===Symbol.for("react.memo_cache_sentinel")?(d=mt.map(mn),C[22]=d):d=C[22],C[23]!==N||C[24]!==M?(f=(0,n.jsx)("select",{className:me.default.Speed,value:M,onChange:N,children:d}),C[23]=N,C[24]=M,C[25]=f):f=C[25];let q=P?"true":void 0,Q=P?"WebGL context: LOST":"WebGL context: ok";if(C[26]!==Q?(h=(0,n.jsx)("div",{className:me.default.DiagnosticsStatus,children:Q}),C[26]=Q,C[27]=h):h=C[27],C[28]!==_){var W;m=(0,n.jsx)("div",{className:me.default.DiagnosticsMetrics,children:_?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{children:["geom ",_.geometries," tex"," ",_.textures," prog"," ",_.programs]}),(0,n.jsxs)("span",{children:["draw ",_.renderCalls," tri"," ",_.renderTriangles]}),(0,n.jsxs)("span",{children:["scene ",_.visibleSceneObjects,"/",_.sceneObjects]}),(0,n.jsxs)("span",{children:["heap ",Number.isFinite(W=_.jsHeapUsed)&&null!=W?W<1024?`${Math.round(W)} B`:W<1048576?`${(W/1024).toFixed(1)} KB`:W<0x40000000?`${(W/1048576).toFixed(1)} MB`:`${(W/0x40000000).toFixed(2)} GB`:"n/a"]})]}):(0,n.jsx)("span",{children:"No renderer samples yet"})}),C[28]=_,C[29]=m}else m=C[29];return C[30]!==L||C[31]!==G?(p=(0,n.jsxs)("span",{children:["samples ",G," events ",L]}),C[30]=L,C[31]=G,C[32]=p):p=C[32],C[33]!==j?(g=j?(0,n.jsxs)("span",{title:j.message,children:["last event: ",j.kind]}):(0,n.jsx)("span",{children:"last event: none"}),C[33]=j,C[34]=g):g=C[34],C[35]!==U?(v=(0,n.jsx)("button",{type:"button",onClick:U,children:"Dump"}),C[35]=U,C[36]=v):v=C[36],C[37]!==H?(y=(0,n.jsx)("button",{type:"button",onClick:H,children:"Clear"}),C[37]=H,C[38]=y):y=C[38],C[39]!==p||C[40]!==g||C[41]!==v||C[42]!==y?(A=(0,n.jsxs)("div",{className:me.default.DiagnosticsFooter,children:[p,g,v,y]}),C[39]=p,C[40]=g,C[41]=v,C[42]=y,C[43]=A):A=C[43],C[44]!==q||C[45]!==h||C[46]!==m||C[47]!==A?(F=(0,n.jsxs)("div",{className:me.default.DiagnosticsPanel,"data-context-lost":q,children:[h,m,A]}),C[44]=q,C[45]=h,C[46]=m,C[47]=A,C[48]=F):F=C[48],C[49]!==u||C[50]!==c||C[51]!==f||C[52]!==F||C[53]!==o?(b=(0,n.jsxs)("div",{className:me.default.Root,onKeyDown:ms,onPointerDown:mo,onClick:mi,children:[o,u,c,f,F]}),C[49]=u,C[50]=c,C[51]=f,C[52]=F,C[53]=o,C[54]=b):b=C[54],b}function mn(e){return(0,n.jsxs)("option",{value:e,children:[e,"x"]},e)}function mi(e){return e.stopPropagation()}function mo(e){return e.stopPropagation()}function ms(e){return e.stopPropagation()}function ml(e){let t=e.diagnostics.playbackEvents;return t.length>0?t[t.length-1]:null}function mu(e){return e.diagnostics.playbackEvents.length}function mc(e){let t=e.diagnostics.rendererSamples;return t.length>0?t[t.length-1]:null}function md(e){return e.diagnostics.rendererSamples.length}function mf(e){return e.diagnostics.webglContextLost}var mh=e.i(75840);function mm(e,t){if(0===e.length)return{health:1,energy:1};let r=0,a=e.length-1;if(t<=e[0].time)return{health:e[0].health??1,energy:e[0].energy??1};if(t>=e[a].time)return{health:e[a].health??1,energy:e[a].energy??1};for(;a-r>1;){let n=r+a>>1;e[n].time<=t?r=n:a=n}return{health:e[r].health??1,energy:e[r].energy??1}}function mp(e){let t,r=(0,i.c)(2),{value:a}=e,o=Math.max(0,Math.min(100,100*a)),s=`${o}%`;return r[0]!==s?(t=(0,n.jsx)("div",{className:mh.default.HealthBar,children:(0,n.jsx)("div",{className:mh.default.BarFill,style:{width:s}})}),r[0]=s,r[1]=t):t=r[1],t}function mg(e){let t,r=(0,i.c)(2),{value:a}=e,o=Math.max(0,Math.min(100,100*a)),s=`${o}%`;return r[0]!==s?(t=(0,n.jsx)("div",{className:mh.default.EnergyBar,children:(0,n.jsx)("div",{className:mh.default.BarFill,style:{width:s}})}),r[0]=s,r[1]=t):t=r[1],t}function mv(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:mh.default.ChatWindow}),t[0]=e):e=t[0],e}function my(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:mh.default.WeaponSlots}),t[0]=e):e=t[0],e}function mA(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:mh.default.ToolBelt}),t[0]=e):e=t[0],e}function mF(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:mh.default.Reticle}),t[0]=e):e=t[0],e}function mb(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:mh.default.TeamStats}),t[0]=e):e=t[0],e}function mC(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("div",{className:mh.default.Compass}),t[0]=e):e=t[0],e}function mB(){let e,t,r,a,o,s,l,u,c,d,f,h,m=(0,i.c)(44),p=r$(),g=r3(),v=(0,R.useEngineSelector)(mS);if(m[0]!==p){e:{let t=new Map;if(!p){e=t;break e}for(let e of p.entities)t.set(e.id,e);e=t}m[0]=p,m[1]=e}else e=m[1];let y=e;if(!p)return null;if(p.isMetadataOnly||p.isPartial){let e,t,r,a,i,o,s,l,u,c=v?.status;return c?(m[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(mv,{}),t=(0,n.jsx)(mC,{}),m[2]=e,m[3]=t):(e=m[2],t=m[3]),m[4]!==c.health?(r=(0,n.jsx)(mp,{value:c.health}),m[4]=c.health,m[5]=r):r=m[5],m[6]!==c.energy?(a=(0,n.jsx)(mg,{value:c.energy}),m[6]=c.energy,m[7]=a):a=m[7],m[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)(mb,{}),o=(0,n.jsx)(mF,{}),s=(0,n.jsx)(mA,{}),l=(0,n.jsx)(my,{}),m[8]=i,m[9]=o,m[10]=s,m[11]=l):(i=m[8],o=m[9],s=m[10],l=m[11]),m[12]!==r||m[13]!==a?(u=(0,n.jsxs)("div",{className:mh.default.PlayerHUD,children:[e,t,r,a,i,o,s,l]}),m[12]=r,m[13]=a,m[14]=u):u=m[14],u):null}m[15]!==g||m[16]!==p.cameraModes?(t=function(e,t){if(0===e.length||t=e[e.length-1].time)return e[e.length-1];let r=0,a=e.length-1;for(;a-r>1;){let n=r+a>>1;e[n].time<=t?r=n:a=n}return e[r]}(p.cameraModes,g),m[15]=g,m[16]=p.cameraModes,m[17]=t):t=m[17];let A=t;m[18]===Symbol.for("react.memo_cache_sentinel")?(r={health:1,energy:1},m[18]=r):r=m[18];let F=r;if(A?.mode==="first-person"){let e,t,r;if(m[19]!==g||m[20]!==y||m[21]!==p.controlPlayerGhostId){let r=p.controlPlayerGhostId?y.get(p.controlPlayerGhostId):void 0,a=y.get("recording_player");e=r?mm(r.keyframes,g):void 0,t=a?mm(a.keyframes,g):void 0,m[19]=g,m[20]=y,m[21]=p.controlPlayerGhostId,m[22]=e,m[23]=t}else e=m[22],t=m[23];let a=t,n=e?.health??1,i=a?.energy??e?.energy??1;m[24]!==n||m[25]!==i?(r={health:n,energy:i},m[24]=n,m[25]=i,m[26]=r):r=m[26],F=r}else if(A?.mode==="third-person"&&A.orbitTargetId)if(m[27]!==g||m[28]!==y||m[29]!==A.orbitTargetId){let e=y.get(A.orbitTargetId);e&&(F=mm(e.keyframes,g)),m[27]=g,m[28]=y,m[29]=A.orbitTargetId,m[30]=F}else F=m[30];return m[31]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)(mv,{}),o=(0,n.jsx)(mC,{}),m[31]=a,m[32]=o):(a=m[31],o=m[32]),m[33]!==F.health?(s=(0,n.jsx)(mp,{value:F.health}),m[33]=F.health,m[34]=s):s=m[34],m[35]!==F.energy?(l=(0,n.jsx)(mg,{value:F.energy}),m[35]=F.energy,m[36]=l):l=m[36],m[37]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(mb,{}),d=(0,n.jsx)(mF,{}),f=(0,n.jsx)(mA,{}),u=(0,n.jsx)(my,{}),m[37]=u,m[38]=c,m[39]=d,m[40]=f):(u=m[37],c=m[38],d=m[39],f=m[40]),m[41]!==s||m[42]!==l?(h=(0,n.jsxs)("div",{className:mh.default.PlayerHUD,children:[a,o,s,l,c,d,f,u]}),m[41]=s,m[42]=l,m[43]=h):h=m[43],h}function mS(e){return e.playback.streamSnapshot}var mx=e.i(50361),mE=e.i(24540);function mM(e,t,r){try{return e(t)}catch(e){return(0,mE.l)("[nuqs] Error while parsing value `%s`: %O"+(r?" (for key `%s`)":""),t,e,r),null}}function mD(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),mM(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}mD({parse:e=>e,serialize:String}),mD({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),mD({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),mD({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),mD({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let mI=mD({parse:e=>"true"===e.toLowerCase(),serialize:String});function mk(e,t){return e.valueOf()===t.valueOf()}mD({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:mk}),mD({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:mk}),mD({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:mk});let mw=(0,mx.r)(),mT={};function mR(e,t,r,a,n,i){let o=!1,s=Object.entries(e).reduce((e,[s,l])=>{var u;let c=t?.[s]??s,d=a[c],f="multi"===l.type?[]:null,h=void 0===d?("multi"===l.type?r?.getAll(c):r?.get(c))??f:d;return n&&i&&((u=n[c]??f)===h||null!==u&&null!==h&&"string"!=typeof u&&"string"!=typeof h&&u.length===h.length&&u.every((e,t)=>e===h[t]))?e[s]=i[s]??null:(o=!0,e[s]=((0,mx.i)(h)?null:mM(l.parse,h,c))??null,n&&(n[c]=h)),e},{});if(!o){let t=Object.keys(e),r=Object.keys(i??{});o=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:o}}function mP(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function mG(e,t={}){let{parse:r,type:a,serialize:n,eq:i,defaultValue:s,...l}=t,[{[e]:u},c]=function(e,t={}){let r=(0,o.useId)(),a=(0,mE.i)(),n=(0,mE.a)(),{history:i="replace",scroll:s=a?.scroll??!1,shallow:l=a?.shallow??!0,throttleMs:u=mx.s.timeMs,limitUrlUpdates:c=a?.limitUrlUpdates,clearOnDefault:d=a?.clearOnDefault??!0,startTransition:f,urlKeys:h=mT}=t,m=Object.keys(e).join(","),p=(0,o.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,h[e]??e])),[m,JSON.stringify(h)]),g=(0,mE.r)(Object.values(p)),v=g.searchParams,y=(0,o.useRef)({}),A=(0,o.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),F=mx.t.useQueuedQueries(Object.values(p)),[b,C]=(0,o.useState)(()=>mR(e,h,v??new URLSearchParams,F).state),B=(0,o.useRef)(b);if((0,mE.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",r,m,b,v),Object.keys(y.current).join("&")!==Object.values(p).join("&")){let{state:t,hasChanged:a}=mR(e,h,v,F,y.current,B.current);a&&((0,mE.c)("[nuq+ %s `%s`] State changed: %O",r,m,{state:t,initialSearchParams:v,queuedQueries:F,queryRef:y.current,stateRef:B.current}),B.current=t,C(t)),y.current=Object.fromEntries(Object.entries(p).map(([t,r])=>[r,e[t]?.type==="multi"?v?.getAll(r):v?.get(r)??null]))}(0,o.useEffect)(()=>{let{state:t,hasChanged:a}=mR(e,h,v,F,y.current,B.current);a&&((0,mE.c)("[nuq+ %s `%s`] State changed: %O",r,m,{state:t,initialSearchParams:v,queuedQueries:F,queryRef:y.current,stateRef:B.current}),B.current=t,C(t))},[Object.values(p).map(e=>`${e}=${v?.getAll(e)}`).join("&"),JSON.stringify(F)]),(0,o.useEffect)(()=>{let t=Object.keys(e).reduce((t,a)=>(t[a]=({state:t,query:n})=>{C(i=>{let{defaultValue:o}=e[a],s=p[a],l=t??o??null;return Object.is(i[a]??o??null,l)?((0,mE.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",r,m,s,t,o,B.current),i):(B.current={...B.current,[a]:l},y.current[s]=n,(0,mE.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",r,m,s,t,o,B.current),B.current)})},t),{});for(let a of Object.keys(e)){let e=p[a];(0,mE.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",r,e,m),mw.on(e,t[a])}return()=>{for(let a of Object.keys(e)){let e=p[a];(0,mE.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",r,e,m),mw.off(e,t[a])}}},[m,p]);let S=(0,o.useCallback)((t,a={})=>{let o,h=Object.fromEntries(Object.keys(e).map(e=>[e,null])),v="function"==typeof t?t(mP(B.current,A))??h:t??h;(0,mE.c)("[nuq+ %s `%s`] setState: %O",r,m,v);let y=0,F=!1,b=[];for(let[t,r]of Object.entries(v)){let h=e[t],m=p[t];if(!h||void 0===r)continue;(a.clearOnDefault??h.clearOnDefault??d)&&null!==r&&void 0!==h.defaultValue&&(h.eq??((e,t)=>e===t))(r,h.defaultValue)&&(r=null);let v=null===r?null:(h.serialize??String)(r);mw.emit(m,{state:r,query:v});let A={key:m,query:v,options:{history:a.history??h.history??i,shallow:a.shallow??h.shallow??l,scroll:a.scroll??h.scroll??s,startTransition:a.startTransition??h.startTransition??f}};if(a?.limitUrlUpdates?.method==="debounce"||c?.method==="debounce"||h.limitUrlUpdates?.method==="debounce"){!0===A.options.shallow&&console.warn((0,mE.s)(422));let e=a?.limitUrlUpdates?.timeMs??c?.timeMs??h.limitUrlUpdates?.timeMs??mx.s.timeMs,t=mx.t.push(A,e,g,n);yt(e),F?mx.n.flush(g,n):mx.n.getPendingPromise(g));return o??C},[m,i,l,s,u,c?.method,c?.timeMs,f,p,g.updateUrl,g.getSearchParamsSnapshot,g.rateLimitFactor,n,A]);return[(0,o.useMemo)(()=>mP(b,A),[b,A]),S]}({[e]:{parse:r??(e=>e),type:a,serialize:n,eq:i,defaultValue:s}},l);return[u,(0,o.useCallback)((t,r={})=>c(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,c])]}var m_=e.i(3011);let mL=(0,o.lazy)(()=>e.A(59197).then(e=>({default:e.MapInfoDialog}))),mj=new rM,mO={toneMapping:u.NoToneMapping,outputColorSpace:u.SRGBColorSpace},mN=mD({parse(e){let[t,r]=e.split("~"),a=r,n=(0,ri.getMissionInfo)(t).missionTypes;return r&&n.includes(r)||(a=n[0]),{missionName:t,missionType:a}},serialize:({missionName:e,missionType:t})=>1===(0,ri.getMissionInfo)(e).missionTypes.length?e:`${e}~${t}`,eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});function mU(){let e,t,r,a,s,l,[c,d]=mG("mission",mN),f=(0,R.useEngineStoreApi)(),[h,m]=mG("fog",mI),g=(0,o.useCallback)(()=>{m(null)},[m]),v=(0,o.useRef)(c);v.current=c;let y=(0,o.useCallback)(e=>{let t=v.current,r=function(e=0){let t=Error().stack;if(!t)return null;let r=t.split("\n").map(e=>e.trim()).filter(Boolean).slice(1+e,9+e);return r.length>0?r.join(" <= "):null}(1);f.getState().recordPlaybackDiagnosticEvent({kind:"mission.change.requested",message:"changeMission invoked",meta:{previousMissionName:t.missionName,previousMissionType:t.missionType??null,nextMissionName:e.missionName,nextMissionType:e.missionType??null,stack:r??"unavailable"}}),console.info("[mission trace] changeMission",{previousMission:t,nextMission:e,stack:r}),window.location.hash="",g(),d(e)},[f,d,g]),A=(r=(0,i.c)(2),a=(0,o.useRef)(null),r[0]===Symbol.for("react.memo_cache_sentinel")?(e=e=>{let t=window.matchMedia("(pointer: coarse)");return t.addEventListener("change",e),a.current=t,()=>{t.removeEventListener("change",e)}},r[0]=e):e=r[0],s=e,r[1]===Symbol.for("react.memo_cache_sentinel")?(t=()=>a.current?.matches??null,r[1]=t):t=r[1],l=t,(0,o.useSyncExternalStore)(s,l,f5)),{missionName:F,missionType:b}=c,[C,B]=(0,o.useState)(!1),[S,x]=(0,o.useState)(0),[M,D]=(0,o.useState)(!0),I=S<1;(0,o.useEffect)(()=>{if(I)D(!0);else{let e=setTimeout(()=>D(!1),500);return()=>clearTimeout(e)}},[I]),(0,o.useEffect)(()=>(window.setMissionName=e=>{let t=(0,ri.getMissionInfo)(e).missionTypes;y({missionName:e,missionType:t[0]})},window.getMissionList=ri.getMissionList,window.getMissionInfo=ri.getMissionInfo,()=>{delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo}),[y]),(0,o.useEffect)(()=>{let e=e=>{if("KeyI"!==e.code||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||B(!0)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let k=(0,o.useCallback)((e,t=0)=>{x(t)},[]),w=(0,o.useRef)(null),T=(0,o.useRef)({angle:0,force:0}),P=(0,o.useRef)(null),G=(0,o.useRef)({angle:0,force:0}),_=(0,o.useRef)(null);return(0,n.jsx)(rD.QueryClientProvider,{client:mj,children:(0,n.jsx)("main",{children:(0,n.jsx)(rZ,{children:(0,n.jsx)(E.SettingsProvider,{fogEnabledOverride:h,onClearFogEnabledOverride:g,children:(0,n.jsxs)(rR,{map:rQ,children:[(0,n.jsxs)("div",{id:"canvasContainer",className:m_.default.CanvasContainer,children:[M&&(0,n.jsxs)("div",{id:"loadingIndicator",className:m_.default.LoadingIndicator,"data-complete":!I,children:[(0,n.jsx)("div",{className:m_.default.Spinner}),(0,n.jsx)("div",{className:m_.default.Progress,children:(0,n.jsx)("div",{className:m_.default.ProgressBar,style:{width:`${100*S}%`}})}),(0,n.jsxs)("div",{className:m_.default.ProgressText,children:[Math.round(100*S),"%"]})]}),(0,n.jsx)(p,{frameloop:"always",gl:mO,shadows:{type:u.PCFShadowMap},onCreated:e=>{w.current=e.camera},children:(0,n.jsx)(t2,{children:(0,n.jsxs)(f4.AudioProvider,{children:[(0,n.jsx)(rd,{name:F,missionType:b,onLoadingChange:k},`${F}~${b}`),(0,n.jsx)(f6,{}),(0,n.jsx)(hn,{}),(0,n.jsx)(h4,{}),(0,n.jsx)(mV,{isTouch:A,joystickStateRef:T,joystickZoneRef:P,lookJoystickStateRef:G,lookJoystickZoneRef:_})]})})})]}),(0,n.jsx)(mB,{}),A&&(0,n.jsx)(av,{joystickState:T,joystickZone:P,lookJoystickState:G,lookJoystickZone:_}),!1===A&&(0,n.jsx)(aa,{}),(0,n.jsx)(f0,{missionName:F,missionType:b,onChangeMission:y,onOpenMapInfo:()=>B(!0),cameraRef:w,isTouch:A}),C&&(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(mL,{open:C,onClose:()=>B(!1),missionName:F,missionType:b??""})}),(0,n.jsx)(mJ,{changeMission:y,currentMission:c}),(0,n.jsx)(ma,{}),(0,n.jsx)(mK,{})]})})})})})}let mH={"Capture the Flag":"CTF","Capture and Hold":"CnH",Deathmatch:"DM","Team Deathmatch":"TDM",Siege:"Siege",Bounty:"Bounty",Rabbit:"Rabbit"};function mJ(e){let t,r,a=(0,i.c)(5),{changeMission:n,currentMission:s}=e,l=r$();return a[0]!==n||a[1]!==s||a[2]!==l?(t=()=>{if(!l?.missionName)return;let e=(0,ri.findMissionByDemoName)(l.missionName);if(!e)return void console.warn(`Demo mission "${l.missionName}" not found in manifest`);let t=(0,ri.getMissionInfo)(e),r=l.gameType?mH[l.gameType]:void 0,a=r&&t.missionTypes.includes(r)?r:t.missionTypes[0];(s.missionName!==e||s.missionType!==a)&&n({missionName:e,missionType:a})},r=[l,n,s],a[0]=n,a[1]=s,a[2]=l,a[3]=t,a[4]=r):(t=a[3],r=a[4]),(0,o.useEffect)(t,r),null}function mV(e){let t,r=(0,i.c)(6),{isTouch:a,joystickStateRef:o,joystickZoneRef:s,lookJoystickStateRef:l,lookJoystickZoneRef:u}=e;if(r1()||null===a)return null;if(a){let e;return r[0]!==o||r[1]!==s||r[2]!==l||r[3]!==u?(e=(0,n.jsx)(ay,{joystickState:o,joystickZone:s,lookJoystickState:l,lookJoystickZone:u}),r[0]=o,r[1]=s,r[2]=l,r[3]=u,r[4]=e):e=r[4],e}return r[5]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(rW,{}),r[5]=t):t=r[5],t}function mK(){let e,t,r=(0,i.c)(4),{setRecording:a}=r6(),n=(0,R.useEngineStoreApi)();return r[0]!==n||r[1]!==a?(e=()=>(window.loadDemoRecording=a,window.getDemoDiagnostics=()=>(0,h7.buildSerializableDiagnosticsSnapshot)(n.getState()),window.getDemoDiagnosticsJson=()=>(0,h7.buildSerializableDiagnosticsJson)(n.getState()),window.clearDemoDiagnostics=()=>{n.getState().clearPlaybackDiagnostics()},mz),t=[n,a],r[0]=n,r[1]=a,r[2]=e,r[3]=t):(e=r[2],t=r[3]),(0,o.useEffect)(e,t),null}function mz(){delete window.loadDemoRecording,delete window.getDemoDiagnostics,delete window.getDemoDiagnosticsJson,delete window.clearDemoDiagnostics}function mq(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(mU,{})}),t[0]=e):e=t[0],e}e.s(["default",()=>mq],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/f6c55b3b7050a508.css b/docs/_next/static/chunks/f6c55b3b7050a508.css new file mode 100644 index 00000000..23e08bcb --- /dev/null +++ b/docs/_next/static/chunks/f6c55b3b7050a508.css @@ -0,0 +1,12 @@ +.FloatingLabel-module__8y09Ka__Label{color:#fff;white-space:nowrap;text-align:center;background:#00000080;border-radius:1px;padding:1px 3px;font-size:11px} +.KeyboardOverlay-module__HsRBsa__Root{pointer-events:none;z-index:1;align-items:flex-end;gap:10px;display:flex;position:fixed;bottom:16px;left:50%;transform:translate(-50%)}.KeyboardOverlay-module__HsRBsa__Column{flex-direction:column;justify-content:center;gap:4px;display:flex}.KeyboardOverlay-module__HsRBsa__Row{justify-content:stretch;gap:4px;display:flex}.KeyboardOverlay-module__HsRBsa__Spacer{width:32px}.KeyboardOverlay-module__HsRBsa__Key{color:#ffffff80;white-space:nowrap;background:#0006;border:1px solid #fff3;border-radius:4px;flex:1 0 0;justify-content:center;align-items:center;min-width:32px;height:32px;padding:0 8px;font-size:11px;font-weight:600;display:flex}.KeyboardOverlay-module__HsRBsa__Key[data-pressed=true]{color:#fff;background:#34bbab99;border-color:#23fddc80}.KeyboardOverlay-module__HsRBsa__Arrow{margin-right:3px} +.TouchControls-module__AkxfgW__Joystick{z-index:1;width:140px;height:140px;position:fixed;bottom:20px;left:50%;transform:translate(-50%)}.TouchControls-module__AkxfgW__Left{left:20px;transform:none;}.TouchControls-module__AkxfgW__Right{left:auto;right:20px;transform:none;} +.MissionSelect-module__N_AIjG__InputWrapper{align-items:center;display:flex;position:relative}.MissionSelect-module__N_AIjG__Shortcut{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}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]~.MissionSelect-module__N_AIjG__Shortcut{display:none}.MissionSelect-module__N_AIjG__Input{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}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]{padding-right:8px}.MissionSelect-module__N_AIjG__Input:focus{border-color:#fff9}.MissionSelect-module__N_AIjG__Input::placeholder{color:#0000}.MissionSelect-module__N_AIjG__SelectedValue{pointer-events:none;align-items:center;gap:6px;display:flex;position:absolute;left:8px;right:36px;overflow:hidden}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]~.MissionSelect-module__N_AIjG__SelectedValue{display:none}.MissionSelect-module__N_AIjG__SelectedName{color:#fff;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden}.MissionSelect-module__N_AIjG__SelectedValue>.MissionSelect-module__N_AIjG__ItemType{flex-shrink:0}.MissionSelect-module__N_AIjG__Popover{z-index:100;min-width:320px;max-height:var(--popover-available-height,90vh);overscroll-behavior:contain;background:#141414f2;border:1px solid #ffffff80;border-radius:3px;overflow-y:auto;box-shadow:0 8px 24px #0009}.MissionSelect-module__N_AIjG__List{padding:4px 0}.MissionSelect-module__N_AIjG__List:has(>.MissionSelect-module__N_AIjG__Group:first-child){padding-top:0}.MissionSelect-module__N_AIjG__Group{padding-bottom:4px}.MissionSelect-module__N_AIjG__GroupLabel{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}.MissionSelect-module__N_AIjG__Group:not(:last-child){border-bottom:1px solid #ffffff4d}.MissionSelect-module__N_AIjG__Item{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}.MissionSelect-module__N_AIjG__List>.MissionSelect-module__N_AIjG__Item:first-child{margin-top:0}.MissionSelect-module__N_AIjG__Item[data-active-item]{background:#ffffff26}.MissionSelect-module__N_AIjG__Item[aria-selected=true]{background:#6496ff4d}.MissionSelect-module__N_AIjG__ItemHeader{align-items:center;gap:6px;display:flex}.MissionSelect-module__N_AIjG__ItemName{color:#fff;font-size:14px;font-weight:600}.MissionSelect-module__N_AIjG__ItemTypes{gap:3px;display:flex}.MissionSelect-module__N_AIjG__ItemType{color:#fff;background:#ff9d0066;border-radius:3px;padding:2px 5px;font-size:10px;font-weight:600}.MissionSelect-module__N_AIjG__ItemType:hover{background:#ff9d00b3}.MissionSelect-module__N_AIjG__ItemMissionName{color:#ffffff80;font-size:12px}.MissionSelect-module__N_AIjG__NoResults{color:#ffffff80;text-align:center;padding:12px 8px;font-size:13px} +.InspectorControls-module__gNRB6W__Controls{color:#fff;z-index:2;background:#00000080;border-radius:0 0 4px;justify-content:center;align-items:center;gap:20px;padding:8px 12px 8px 8px;font-size:13px;display:flex;position:fixed;top:0;left:0}.InspectorControls-module__gNRB6W__Dropdown,.InspectorControls-module__gNRB6W__Group{justify-content:center;align-items:center;gap:20px;display:flex}.InspectorControls-module__gNRB6W__CheckboxField,.InspectorControls-module__gNRB6W__LabelledButton,.InspectorControls-module__gNRB6W__Field{align-items:center;gap:6px;display:flex}.InspectorControls-module__gNRB6W__IconButton{color:#fff;cursor:pointer;background:#03529399;border:1px solid #c8c8c84d;border-color:#ffffff4d #c8c8c84d #c8c8c84d #ffffff4d;border-radius:4px;justify-content:center;align-items:center;width:28px;height:28px;margin:0 0 0 -12px;padding:0;font-size:15px;transition:background .2s,border-color .2s;display:flex;position:relative;transform:translate(0);box-shadow:0 1px 2px #0006}.InspectorControls-module__gNRB6W__IconButton svg{pointer-events:none}@media (hover:hover){.InspectorControls-module__gNRB6W__IconButton:hover{background:#0062b3cc;border-color:#fff6}}.InspectorControls-module__gNRB6W__IconButton:active,.InspectorControls-module__gNRB6W__IconButton[aria-expanded=true]{background:#0062b3b3;border-color:#ffffff4d;transform:translateY(1px)}.InspectorControls-module__gNRB6W__IconButton[data-active=true]{background:#0075d5e6;border-color:#fff6}.InspectorControls-module__gNRB6W__ButtonLabel{font-size:12px}.InspectorControls-module__gNRB6W__Toggle{margin:0;}.InspectorControls-module__gNRB6W__MapInfoButton{}@media (max-width:1279px){.InspectorControls-module__gNRB6W__Dropdown[data-open=false]{display:none}.InspectorControls-module__gNRB6W__Dropdown{background:#000c;border:1px solid #fff3;border-radius:4px;flex-direction:column;align-items:center;gap:12px;max-height:calc(100dvh - 56px);padding:12px;display:flex;position:absolute;top:calc(100% + 2px);left:2px;right:2px;overflow:auto;box-shadow:0 0 12px #0006}.InspectorControls-module__gNRB6W__Group{flex-wrap:wrap;gap:12px 20px}.InspectorControls-module__gNRB6W__LabelledButton{width:auto;padding:0 10px}}@media (max-width:639px){.InspectorControls-module__gNRB6W__Controls{border-radius:0;right:0}.InspectorControls-module__gNRB6W__MissionSelectWrapper{flex:1 1 0;min-width:0}.InspectorControls-module__gNRB6W__MissionSelectWrapper input{width:100%}.InspectorControls-module__gNRB6W__Toggle{flex:none}}@media (min-width:1280px){.InspectorControls-module__gNRB6W__Toggle,.InspectorControls-module__gNRB6W__LabelledButton .InspectorControls-module__gNRB6W__ButtonLabel,.InspectorControls-module__gNRB6W__MapInfoButton{display:none}} +.CopyCoordinatesButton-module__BxovtG__Root{}.CopyCoordinatesButton-module__BxovtG__Root[data-copied=true]{background:#0075d5e6;border-color:#fff6}.CopyCoordinatesButton-module__BxovtG__ClipboardCheck{opacity:1;display:none}.CopyCoordinatesButton-module__BxovtG__Root[data-copied=true] .CopyCoordinatesButton-module__BxovtG__ClipboardCheck{animation:.22s linear infinite CopyCoordinatesButton-module__BxovtG__showClipboardCheck;display:block}.CopyCoordinatesButton-module__BxovtG__Root[data-copied=true] .CopyCoordinatesButton-module__BxovtG__MapPin{display:none}.CopyCoordinatesButton-module__BxovtG__ButtonLabel{}@keyframes CopyCoordinatesButton-module__BxovtG__showClipboardCheck{0%{opacity:1}to{opacity:.2}} +.LoadDemoButton-module__kGZaoW__Root{}.LoadDemoButton-module__kGZaoW__ButtonLabel{}.LoadDemoButton-module__kGZaoW__DemoIcon{font-size:19px} +.DebugElements-module__Cmeo9W__StatsPanel{bottom:0;right:0;top:auto!important;left:auto!important}.DebugElements-module__Cmeo9W__AxisLabel{pointer-events:none;font-size:12px}.DebugElements-module__Cmeo9W__AxisLabel[data-axis=x]{color:#f90}.DebugElements-module__Cmeo9W__AxisLabel[data-axis=y]{color:#9f0}.DebugElements-module__Cmeo9W__AxisLabel[data-axis=z]{color:#09f} +.PlayerNameplate-module__zYDm0a__Root{pointer-events:none;white-space:nowrap;flex-direction:column;align-items:center;display:inline-flex}.PlayerNameplate-module__zYDm0a__Top{padding-bottom:20px;}.PlayerNameplate-module__zYDm0a__Bottom{padding-top:20px;}.PlayerNameplate-module__zYDm0a__IffArrow{width:12px;height:12px;image-rendering:pixelated;filter:drop-shadow(0 1px 2px #000000b3)}.PlayerNameplate-module__zYDm0a__Name{color:#fff;text-shadow:0 1px 3px #000000e6,0 0 1px #000000b3;font-size:11px}.PlayerNameplate-module__zYDm0a__HealthBar{background:#00000080;border:1px solid #fff3;width:60px;height:4px;margin:2px auto 0;overflow:hidden}.PlayerNameplate-module__zYDm0a__HealthFill{background:#2ecc40;height:100%} +.DemoControls-module__PjV4fq__Root{color:#fff;z-index:2;background:#000000b3;align-items:center;gap:10px;padding:8px 12px;font-size:13px;display:flex;position:fixed;bottom:0;left:0;right:0}.DemoControls-module__PjV4fq__PlayPause{color:#fff;cursor:pointer;background:#03529399;border:1px solid #ffffff4d;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;padding:0;font-size:14px;display:flex}@media (hover:hover){.DemoControls-module__PjV4fq__PlayPause:hover{background:#0062b3cc}}.DemoControls-module__PjV4fq__Time{font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0}.DemoControls-module__PjV4fq__Seek[type=range]{flex:1 1 0;min-width:0;max-width:none}.DemoControls-module__PjV4fq__Speed{color:#fff;background:#0009;border:1px solid #ffffff4d;border-radius:3px;flex-shrink:0;padding:2px 4px;font-size:12px}.DemoControls-module__PjV4fq__DiagnosticsPanel{background:#0000008c;border:1px solid #fff3;border-radius:4px;flex-direction:column;gap:3px;min-width:320px;margin-left:8px;padding:4px 8px;display:flex}.DemoControls-module__PjV4fq__DiagnosticsPanel[data-context-lost=true]{background:#46000073;border-color:#ff5a5acc}.DemoControls-module__PjV4fq__DiagnosticsStatus{letter-spacing:.02em;font-size:11px;font-weight:700}.DemoControls-module__PjV4fq__DiagnosticsMetrics{opacity:.92;flex-wrap:wrap;gap:4px 10px;font-size:11px;display:flex}.DemoControls-module__PjV4fq__DiagnosticsFooter{flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:11px;display:flex}.DemoControls-module__PjV4fq__DiagnosticsFooter button{color:#fff;cursor:pointer;background:#03529399;border:1px solid #ffffff4d;border-radius:3px;padding:1px 6px;font-size:11px}.DemoControls-module__PjV4fq__DiagnosticsFooter button:hover{background:#0062b3cc} +.PlayerHUD-module__-E1Scq__PlayerHUD{z-index:1;pointer-events:none;padding-bottom:48px;position:absolute;inset:0}.PlayerHUD-module__-E1Scq__ChatWindow{position:absolute;top:60px;left:4px}.PlayerHUD-module__-E1Scq__Bar{background:#00000080;border:1px solid #fff3;width:160px;height:14px;position:absolute;overflow:hidden}.PlayerHUD-module__-E1Scq__HealthBar{top:60px;right:32px;}.PlayerHUD-module__-E1Scq__EnergyBar{top:80px;right:32px;}.PlayerHUD-module__-E1Scq__BarFill{height:100%;transition:width .15s ease-out;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__HealthBar .PlayerHUD-module__-E1Scq__BarFill{background:#2ecc40}.PlayerHUD-module__-E1Scq__EnergyBar .PlayerHUD-module__-E1Scq__BarFill{background:#0af} +.page-module__E0kJGG__CanvasContainer{z-index:0;position:absolute;inset:0}.page-module__E0kJGG__LoadingIndicator{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%)}.page-module__E0kJGG__LoadingIndicator[data-complete=true]{animation:.3s ease-out forwards page-module__E0kJGG__loadingComplete}.page-module__E0kJGG__Spinner{border:4px solid #fff3;border-top-color:#fff;border-radius:50%;width:48px;height:48px;animation:1s linear infinite page-module__E0kJGG__spin}.page-module__E0kJGG__Progress{background:#fff3;border-radius:2px;width:200px;height:4px;overflow:hidden}.page-module__E0kJGG__ProgressBar{background:#fff;border-radius:2px;height:100%;transition:width .1s ease-out}.page-module__E0kJGG__ProgressText{color:#ffffffb3;font-variant-numeric:tabular-nums;font-size:14px}@keyframes page-module__E0kJGG__spin{to{transform:rotate(360deg)}}@keyframes page-module__E0kJGG__loadingComplete{0%{opacity:1}to{opacity:0}} diff --git a/docs/_not-found/__next._full.txt b/docs/_not-found/__next._full.txt index b05819b5..b857093d 100644 --- a/docs/_not-found/__next._full.txt +++ b/docs/_not-found/__next._full.txt @@ -7,8 +7,8 @@ 8:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"ViewportBoundary"] a:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"MetadataBoundary"] c:I[68027,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/17606cb20096103a.css","style"] -0:{"P":null,"b":"A7b21KJnATF7QS7o5ziIf","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/17606cb20096103a.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] +0:{"P":null,"b":"YSDmiCN1S-sDYVxEL27I6","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} 9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] d:I[27201,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"IconMark"] 7:null diff --git a/docs/_not-found/__next._head.txt b/docs/_not-found/__next._head.txt index 937aaabb..d47c918f 100644 --- a/docs/_not-found/__next._head.txt +++ b/docs/_not-found/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"IconMark"] -0:{"buildId":"A7b21KJnATF7QS7o5ziIf","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"YSDmiCN1S-sDYVxEL27I6","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._index.txt b/docs/_not-found/__next._index.txt index cec13dd5..bfcbae61 100644 --- a/docs/_not-found/__next._index.txt +++ b/docs/_not-found/__next._index.txt @@ -2,5 +2,5 @@ 2:I[12985,["/t2-mapper/_next/static/chunks/e6da73430a674f20.js"],"NuqsAdapter"] 3:I[39756,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/17606cb20096103a.css","style"] -0:{"buildId":"A7b21KJnATF7QS7o5ziIf","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/17606cb20096103a.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] +0:{"buildId":"YSDmiCN1S-sDYVxEL27I6","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._not-found.__PAGE__.txt b/docs/_not-found/__next._not-found.__PAGE__.txt index 0316b866..0dec858b 100644 --- a/docs/_not-found/__next._not-found.__PAGE__.txt +++ b/docs/_not-found/__next._not-found.__PAGE__.txt @@ -1,5 +1,5 @@ 1:"$Sreact.fragment" 2:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"OutletBoundary"] 3:"$Sreact.suspense" -0:{"buildId":"A7b21KJnATF7QS7o5ziIf","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"YSDmiCN1S-sDYVxEL27I6","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} 4:null diff --git a/docs/_not-found/__next._not-found.txt b/docs/_not-found/__next._not-found.txt index c3369022..8afa47e2 100644 --- a/docs/_not-found/__next._not-found.txt +++ b/docs/_not-found/__next._not-found.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[39756,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] -0:{"buildId":"A7b21KJnATF7QS7o5ziIf","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"YSDmiCN1S-sDYVxEL27I6","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._tree.txt b/docs/_not-found/__next._tree.txt index 79b96468..8b9bdb7c 100644 --- a/docs/_not-found/__next._tree.txt +++ b/docs/_not-found/__next._tree.txt @@ -1,2 +1,2 @@ -:HL["/t2-mapper/_next/static/chunks/17606cb20096103a.css","style"] -0:{"buildId":"A7b21KJnATF7QS7o5ziIf","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] +0:{"buildId":"YSDmiCN1S-sDYVxEL27I6","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/_not-found/index.html b/docs/_not-found/index.html index 4b46fc1e..4854656f 100644 --- a/docs/_not-found/index.html +++ b/docs/_not-found/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_not-found/index.txt b/docs/_not-found/index.txt index b05819b5..b857093d 100644 --- a/docs/_not-found/index.txt +++ b/docs/_not-found/index.txt @@ -7,8 +7,8 @@ 8:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"ViewportBoundary"] a:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"MetadataBoundary"] c:I[68027,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] -:HL["/t2-mapper/_next/static/chunks/17606cb20096103a.css","style"] -0:{"P":null,"b":"A7b21KJnATF7QS7o5ziIf","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/17606cb20096103a.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] +0:{"P":null,"b":"YSDmiCN1S-sDYVxEL27I6","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} 9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] d:I[27201,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"IconMark"] 7:null diff --git a/docs/index.html b/docs/index.html index 3e41f228..28c268d4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -MapGenius – Explore maps for Tribes 2 \ No newline at end of file +MapGenius – Explore maps for Tribes 2 \ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index e92da796..bf7ac3b3 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -3,15 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"ClientPageRoot"] -6:I[31713,["/t2-mapper/_next/static/chunks/e6da73430a674f20.js","/t2-mapper/_next/static/chunks/88e3d9a60c48713e.js","/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","/t2-mapper/_next/static/chunks/ad5913f83864409c.js","/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js"],"default"] +6:I[31713,["/t2-mapper/_next/static/chunks/e6da73430a674f20.js","/t2-mapper/_next/static/chunks/c339a594c158eab3.js","/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","/t2-mapper/_next/static/chunks/f12455938f261f57.js","/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/4fd93823156e59e8.js"],"MetadataBoundary"] 10:I[68027,[],"default"] -:HL["/t2-mapper/_next/static/chunks/17606cb20096103a.css","style"] -:HL["/t2-mapper/_next/static/chunks/afff663ba7029ccf.css","style"] -0:{"P":null,"b":"A7b21KJnATF7QS7o5ziIf","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/17606cb20096103a.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/afff663ba7029ccf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/88e3d9a60c48713e.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/ad5913f83864409c.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/e620039d1c837dab.css","style"] +:HL["/t2-mapper/_next/static/chunks/f6c55b3b7050a508.css","style"] +0:{"P":null,"b":"YSDmiCN1S-sDYVxEL27I6","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/e620039d1c837dab.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/e6da73430a674f20.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/f6c55b3b7050a508.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/c339a594c158eab3.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/93b588fa7f31935c.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/22ebafda1e5f0224.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/39f1afbfab5559a9.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/f12455938f261f57.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/bb0aa1c978feffed.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/src/components/CopyCoordinatesButton.module.css b/src/components/CopyCoordinatesButton.module.css new file mode 100644 index 00000000..fd8b51ee --- /dev/null +++ b/src/components/CopyCoordinatesButton.module.css @@ -0,0 +1,36 @@ +.Root { + composes: IconButton from "./InspectorControls.module.css"; + composes: LabelledButton from "./InspectorControls.module.css"; +} + +.Root[data-copied="true"] { + background: rgba(0, 117, 213, 0.9); + border-color: rgba(255, 255, 255, 0.4); +} + +.ClipboardCheck { + display: none; + opacity: 1; +} + +.Root[data-copied="true"] .ClipboardCheck { + display: block; + animation: showClipboardCheck 220ms linear infinite; +} + +.Root[data-copied="true"] .MapPin { + display: none; +} + +.ButtonLabel { + composes: ButtonLabel from "./InspectorControls.module.css"; +} + +@keyframes showClipboardCheck { + 0% { + opacity: 1; + } + 100% { + opacity: 0.2; + } +} diff --git a/src/components/CopyCoordinatesButton.tsx b/src/components/CopyCoordinatesButton.tsx index 041cc579..c33f8430 100644 --- a/src/components/CopyCoordinatesButton.tsx +++ b/src/components/CopyCoordinatesButton.tsx @@ -3,6 +3,7 @@ import { FaMapPin } from "react-icons/fa"; import { FaClipboardCheck } from "react-icons/fa6"; import { Camera, Quaternion, Vector3 } from "three"; import { useSettings } from "./SettingsProvider"; +import styles from "./CopyCoordinatesButton.module.css"; function encodeViewHash({ position, @@ -55,16 +56,16 @@ export function CopyCoordinatesButton({ return ( ); } diff --git a/src/components/DebugElements.module.css b/src/components/DebugElements.module.css new file mode 100644 index 00000000..a7a4ba47 --- /dev/null +++ b/src/components/DebugElements.module.css @@ -0,0 +1,23 @@ +.StatsPanel { + left: auto !important; + top: auto !important; + right: 0; + bottom: 0; +} + +.AxisLabel { + font-size: 12px; + pointer-events: none; +} + +.AxisLabel[data-axis="x"] { + color: rgb(255, 153, 0); +} + +.AxisLabel[data-axis="y"] { + color: rgb(153, 255, 0); +} + +.AxisLabel[data-axis="z"] { + color: rgb(0, 153, 255); +} diff --git a/src/components/DebugElements.tsx b/src/components/DebugElements.tsx index af8dab02..c37c3846 100644 --- a/src/components/DebugElements.tsx +++ b/src/components/DebugElements.tsx @@ -2,6 +2,7 @@ import { Stats, Html } from "@react-three/drei"; import { useDebug } from "./SettingsProvider"; import { useEffect, useRef } from "react"; import { AxesHelper } from "three"; +import styles from "./DebugElements.module.css"; export function DebugElements() { const { debugMode } = useDebug(); @@ -17,7 +18,7 @@ export function DebugElements() { return debugMode ? ( <> - + - + Y - + Z - + X diff --git a/src/components/DemoControls.module.css b/src/components/DemoControls.module.css new file mode 100644 index 00000000..3382ae3b --- /dev/null +++ b/src/components/DemoControls.module.css @@ -0,0 +1,111 @@ +.Root { + position: fixed; + bottom: 0; + left: 0; + right: 0; + display: flex; + align-items: center; + gap: 10px; + padding: 8px 12px; + background: rgba(0, 0, 0, 0.7); + color: #fff; + font-size: 13px; + z-index: 2; +} + +.PlayPause { + width: 32px; + height: 32px; + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; + padding: 0; + border: 1px solid rgba(255, 255, 255, 0.3); + border-radius: 4px; + background: rgba(3, 82, 147, 0.6); + color: #fff; + font-size: 14px; + cursor: pointer; +} + +@media (hover: hover) { + .PlayPause:hover { + background: rgba(0, 98, 179, 0.8); + } +} + +.Time { + flex-shrink: 0; + font-variant-numeric: tabular-nums; + white-space: nowrap; +} + +.Seek[type="range"] { + flex: 1 1 0; + min-width: 0; + max-width: none; +} + +.Speed { + flex-shrink: 0; + padding: 2px 4px; + border: 1px solid rgba(255, 255, 255, 0.3); + border-radius: 3px; + background: rgba(0, 0, 0, 0.6); + color: #fff; + font-size: 12px; +} + +.DiagnosticsPanel { + display: flex; + flex-direction: column; + gap: 3px; + margin-left: 8px; + padding: 4px 8px; + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 4px; + background: rgba(0, 0, 0, 0.55); + min-width: 320px; +} + +.DiagnosticsPanel[data-context-lost="true"] { + border-color: rgba(255, 90, 90, 0.8); + background: rgba(70, 0, 0, 0.45); +} + +.DiagnosticsStatus { + font-size: 11px; + font-weight: 700; + letter-spacing: 0.02em; +} + +.DiagnosticsMetrics { + display: flex; + flex-wrap: wrap; + gap: 4px 10px; + font-size: 11px; + opacity: 0.92; +} + +.DiagnosticsFooter { + display: flex; + flex-wrap: wrap; + gap: 4px 8px; + align-items: center; + font-size: 11px; +} + +.DiagnosticsFooter button { + border: 1px solid rgba(255, 255, 255, 0.3); + border-radius: 3px; + background: rgba(3, 82, 147, 0.6); + color: #fff; + padding: 1px 6px; + font-size: 11px; + cursor: pointer; +} + +.DiagnosticsFooter button:hover { + background: rgba(0, 98, 179, 0.8); +} diff --git a/src/components/DemoControls.tsx b/src/components/DemoControls.tsx index dbb7639d..c8e31a22 100644 --- a/src/components/DemoControls.tsx +++ b/src/components/DemoControls.tsx @@ -13,6 +13,7 @@ import { useEngineSelector, useEngineStoreApi, } from "../state"; +import styles from "./DemoControls.module.css"; const SPEED_OPTIONS = [0.25, 0.5, 1, 2, 4]; @@ -89,23 +90,23 @@ export function DemoControls() { return (
e.stopPropagation()} onPointerDown={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()} > - + {`${formatTime(currentTime)} / ${formatTime(duration)}`}
-
+
{webglContextLost ? "WebGL context: LOST" : "WebGL context: ok"}
-
+
{latestRendererSample ? ( <> @@ -153,7 +154,7 @@ export function DemoControls() { No renderer samples yet )}
-
+
samples {rendererSampleCount} events {playbackEventCount} diff --git a/src/components/FloatingLabel.module.css b/src/components/FloatingLabel.module.css new file mode 100644 index 00000000..afeb4c6e --- /dev/null +++ b/src/components/FloatingLabel.module.css @@ -0,0 +1,9 @@ +.Label { + background: rgba(0, 0, 0, 0.5); + color: #fff; + font-size: 11px; + white-space: nowrap; + padding: 1px 3px; + border-radius: 1px; + text-align: center; +} diff --git a/src/components/FloatingLabel.tsx b/src/components/FloatingLabel.tsx index 48a237a2..179565d6 100644 --- a/src/components/FloatingLabel.tsx +++ b/src/components/FloatingLabel.tsx @@ -2,6 +2,7 @@ import { memo, ReactNode, useRef, useState } from "react"; import { Object3D, Vector3 } from "three"; import { useFrame } from "@react-three/fiber"; import { Html } from "@react-three/drei"; +import styles from "./FloatingLabel.module.css"; const DEFAULT_POSITION = [0, 0, 0] as [x: number, y: number, z: number]; const _worldPos = new Vector3(); @@ -15,7 +16,9 @@ function isBehindCamera( ): boolean { const e = camera.matrixWorld.elements; // Dot product of (objectPos - cameraPos) with camera forward (-Z column). - return (wx - e[12]) * -e[8] + (wy - e[13]) * -e[9] + (wz - e[14]) * -e[10] < 0; + return ( + (wx - e[12]) * -e[8] + (wy - e[13]) * -e[9] + (wz - e[14]) * -e[10] < 0 + ); } export const FloatingLabel = memo(function FloatingLabel({ @@ -39,10 +42,17 @@ export const FloatingLabel = memo(function FloatingLabel({ if (!group) return; group.getWorldPosition(_worldPos); - const behind = isBehindCamera(camera, _worldPos.x, _worldPos.y, _worldPos.z); + const behind = isBehindCamera( + camera, + _worldPos.x, + _worldPos.y, + _worldPos.z, + ); if (fadeWithDistance) { - const distance = behind ? Infinity : camera.position.distanceTo(_worldPos); + const distance = behind + ? Infinity + : camera.position.distanceTo(_worldPos); const shouldBeVisible = distance < 200; if (isVisible !== shouldBeVisible) { @@ -69,7 +79,7 @@ export const FloatingLabel = memo(function FloatingLabel({ {isVisible ? ( -
+
{children}
diff --git a/src/components/InspectorControls.module.css b/src/components/InspectorControls.module.css new file mode 100644 index 00000000..06592532 --- /dev/null +++ b/src/components/InspectorControls.module.css @@ -0,0 +1,175 @@ +.Controls { + position: fixed; + top: 0; + left: 0; + background: rgba(0, 0, 0, 0.5); + color: #fff; + padding: 8px 12px 8px 8px; + border-radius: 0 0 4px 0; + font-size: 13px; + z-index: 2; + display: flex; + align-items: center; + justify-content: center; + gap: 20px; +} + +.Dropdown { + display: flex; + align-items: center; + justify-content: center; + gap: 20px; +} + +.Group { + display: flex; + align-items: center; + justify-content: center; + gap: 20px; +} + +.CheckboxField, +.LabelledButton { + display: flex; + align-items: center; + gap: 6px; +} + +.Field { + display: flex; + align-items: center; + gap: 6px; +} + +.IconButton { + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + margin: 0 0 0 -12px; + font-size: 15px; + padding: 0; + border-top: 1px solid rgba(255, 255, 255, 0.3); + border-left: 1px solid rgba(255, 255, 255, 0.3); + border-right: 1px solid rgba(200, 200, 200, 0.3); + border-bottom: 1px solid rgba(200, 200, 200, 0.3); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); + border-radius: 4px; + background: rgba(3, 82, 147, 0.6); + color: #fff; + cursor: pointer; + transform: translate(0, 0); + transition: + background 0.2s, + border-color 0.2s; +} + +.IconButton svg { + pointer-events: none; +} + +@media (hover: hover) { + .IconButton:hover { + background: rgba(0, 98, 179, 0.8); + border-color: rgba(255, 255, 255, 0.4); + } +} + +.IconButton:active, +.IconButton[aria-expanded="true"] { + background: rgba(0, 98, 179, 0.7); + border-color: rgba(255, 255, 255, 0.3); + transform: translate(0, 1px); +} + +.IconButton[data-active="true"] { + background: rgba(0, 117, 213, 0.9); + border-color: rgba(255, 255, 255, 0.4); +} + +.ButtonLabel { + font-size: 12px; +} + +.Toggle { + composes: IconButton; + margin: 0; +} + +.MapInfoButton { + composes: IconButton; + composes: LabelledButton; +} + +.MissionSelectWrapper { +} + +@media (max-width: 1279px) { + .Dropdown[data-open="false"] { + display: none; + } + + .Dropdown { + position: absolute; + top: calc(100% + 2px); + left: 2px; + right: 2px; + display: flex; + overflow: auto; + max-height: calc(100dvh - 56px); + flex-direction: column; + align-items: center; + gap: 12px; + background: rgba(0, 0, 0, 0.8); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 4px; + padding: 12px; + box-shadow: 0 0 12px rgba(0, 0, 0, 0.4); + } + + .Group { + flex-wrap: wrap; + gap: 12px 20px; + } + + .LabelledButton { + width: auto; + padding: 0 10px; + } +} + +@media (max-width: 639px) { + .Controls { + right: 0; + border-radius: 0; + } + + .MissionSelectWrapper { + flex: 1 1 0; + min-width: 0; + } + + .MissionSelectWrapper input { + width: 100%; + } + + .Toggle { + flex: 0 0 auto; + } +} + +@media (min-width: 1280px) { + .Toggle { + display: none; + } + + .LabelledButton .ButtonLabel { + display: none; + } + + .MapInfoButton { + display: none; + } +} diff --git a/src/components/InspectorControls.tsx b/src/components/InspectorControls.tsx index c6ea6e49..577546a6 100644 --- a/src/components/InspectorControls.tsx +++ b/src/components/InspectorControls.tsx @@ -11,6 +11,7 @@ import { CopyCoordinatesButton } from "./CopyCoordinatesButton"; import { LoadDemoButton } from "./LoadDemoButton"; import { useDemoRecording } from "./DemoProvider"; import { FiInfo, FiSettings } from "react-icons/fi"; +import styles from "./InspectorControls.module.css"; export function InspectorControls({ missionName, @@ -79,20 +80,23 @@ export function InspectorControls({ return (
e.stopPropagation()} onPointerDown={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()} > - +
+ +
-
+
-
-
+
+
-
+
Audio?
-
-
+
+
-
+
Debug?
-
-
+
+
{fov}
-
+
{isTouch && ( -
-
+
+
{" "}